@office-open/pptx 0.4.5 → 0.4.6
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 +13 -13
- package/dist/index.d.mts +29 -34
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +594 -900
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["createScene3D","createShape3D","createEffectList","convertPixelsToEmu","createOutline","createEffectList","SW_REF","sx","convertPixelsToEmu","buildChildrenXml","convertPixelsToEmu","MEDIA_EXT_URI","convertPixelsToEmu","convertPixelsToEmu","createOutline","Xc","convertPixelsToEmu","convertPixelsToEmu","convertPixelsToEmu","Xc","convertPixelsToEmu","convertPixelsToEmu","GraphicFrameNonVisual","GraphicFrameNonVisual","convertPixelsToEmu","GraphicFrameNonVisual","convertPixelsToEmu","convertPixelsToEmu"],"sources":["../src/file/drawingml/effects.ts","../src/file/drawingml/fill.ts","../src/file/xml-components/base.ts","../src/file/xml-components/index.ts","../src/file/background/background.ts","../src/file/chart/chart-collection.ts","../src/file/comment/comment-author-list.ts","../src/file/comment/slide-comment-list.ts","../src/file/content-types/content-types.ts","../src/file/core-properties/properties.ts","../src/file/hyperlink-collection.ts","../src/file/media/media.ts","../src/file/drawingml/group-transform-2d.ts","../src/file/drawingml/group-shape-properties.ts","../src/file/shape-tree/group-shape-non-visual.ts","../src/file/shape/paragraph/end-paragraph-run.ts","../src/file/shape/paragraph/paragraph-properties.ts","../src/file/shape/paragraph/run-properties.ts","../src/file/shape/paragraph/run.ts","../src/file/shape/paragraph/paragraph.ts","../src/file/table/table-cell-properties.ts","../src/file/table/table-cell.ts","../src/file/shape/text-body.ts","../src/file/notes/notes-slide.ts","../src/file/presentation-properties.ts","../src/file/presentation/presentation.ts","../src/file/presentation/presentation-wrapper.ts","../src/file/slide-layout/slide-layout.ts","../src/file/slide-master/slide-master.ts","../src/file/animation/timing.ts","../src/file/drawingml/transform-2d.ts","../src/file/media/audio-frame.ts","../src/file/media/video-frame.ts","../src/file/drawingml/outline.ts","../src/file/drawingml/shape-properties.ts","../src/file/shape/shape.ts","../src/file/transition/transition.ts","../src/file/slide/slide.ts","../src/file/table-styles.ts","../src/file/theme/theme.ts","../src/file/view-properties.ts","../src/file/file.ts","../src/file/shape/paragraph/text.ts","../src/file/shape/paragraph/field.ts","../src/file/drawingml/blip-fill.ts","../src/file/drawingml/non-visual-drawing-props.ts","../src/file/drawingml/non-visual-shape-props.ts","../src/file/drawingml/non-visual-picture-props.ts","../src/file/shape/group-shape.ts","../src/file/shape/line-shape.ts","../src/file/shape-tree/shape-tree.ts","../src/file/notes-master/notes-master.ts","../src/file/header-footer/header-footer.ts","../src/file/picture/picture-non-visual.ts","../src/file/picture/picture.ts","../src/file/table/graphic.ts","../src/file/table/graphic-frame-non-visual.ts","../src/file/table/table-grid.ts","../src/file/table/table-properties.ts","../src/file/table/table-row.ts","../src/file/table/table.ts","../src/file/table/table-frame.ts","../src/file/chart/chart-frame.ts","../src/file/smartart/smartart-frame.ts","../src/file/index.ts","../src/export/packer/hyperlink-placeholders.ts","../src/export/packer/media-placeholders.ts","../src/export/packer/next-compiler.ts","../src/export/packer/packer.ts","../src/util/types.ts","../src/util/index.ts","../src/parse.ts","../src/index.ts"],"sourcesContent":["import {\n createEffectList,\n createScene3D,\n createShape3D,\n type EffectListOptions,\n type Scene3DOptions,\n type Shape3DOptions,\n type BevelOptions,\n} from \"@office-open/core/drawingml\";\n\nexport type EffectType = \"outerShadow\" | \"innerShadow\" | \"glow\" | \"reflection\" | \"softEdge\";\n\nexport const ReflectionAlignment = {\n TOP_LEFT: \"tl\",\n TOP: \"t\",\n TOP_RIGHT: \"tr\",\n LEFT: \"l\",\n CENTER: \"ctr\",\n RIGHT: \"r\",\n BOTTOM_LEFT: \"bl\",\n BOTTOM: \"b\",\n BOTTOM_RIGHT: \"br\",\n} as const;\n\nexport interface IShadowOptions {\n readonly blur?: number;\n readonly distance?: number;\n readonly direction?: number;\n readonly color?: string;\n readonly alpha?: number;\n readonly rotateWithShape?: boolean;\n}\n\nexport interface IGlowOptions {\n readonly radius?: number;\n readonly color?: string;\n readonly alpha?: number;\n}\n\nexport interface IReflectionOptions {\n readonly blurRadius?: number;\n readonly distance?: number;\n readonly direction?: number;\n readonly startAlpha?: number;\n readonly startPosition?: number;\n readonly endAlpha?: number;\n readonly endPosition?: number;\n readonly fadeDirection?: number;\n readonly scaleX?: number;\n readonly scaleY?: number;\n readonly skewX?: number;\n readonly skewY?: number;\n readonly alignment?: keyof typeof ReflectionAlignment;\n readonly rotateWithShape?: boolean;\n}\n\nexport interface ISoftEdgeOptions {\n readonly radius?: number;\n}\n\nexport interface IBevelOptions {\n readonly width?: number;\n readonly height?: number;\n}\n\nexport interface IRotation3DOptions {\n readonly x?: number;\n readonly y?: number;\n readonly z?: number;\n readonly perspective?: number;\n}\n\nexport interface IEffectsOptions {\n readonly outerShadow?: IShadowOptions;\n readonly innerShadow?: IShadowOptions;\n readonly glow?: IGlowOptions;\n readonly reflection?: IReflectionOptions;\n readonly softEdge?: ISoftEdgeOptions;\n readonly rotation3D?: IRotation3DOptions;\n readonly bevelTop?: IBevelOptions;\n readonly bevelBottom?: IBevelOptions;\n readonly extrusionH?: number;\n readonly material?:\n | \"plastic\"\n | \"metal\"\n | \"matte\"\n | \"warmMatte\"\n | \"softEdge\"\n | \"flat\"\n | \"powder\";\n readonly lighting?:\n | \"flat\"\n | \"legacyFlat1\"\n | \"legacyFlat2\"\n | \"legacyFlat3\"\n | \"legacyFlat4\"\n | \"legacyHarsh1\"\n | \"legacyHarsh2\"\n | \"legacyHarsh3\"\n | \"legacyHarsh4\"\n | \"legacyNormal1\"\n | \"legacyNormal2\"\n | \"legacyNormal3\"\n | \"legacyNormal4\"\n | \"threePt\"\n | \"balanced\"\n | \"soft\"\n | \"harsh\"\n | \"flood\"\n | \"contrasting\"\n | \"morning\"\n | \"sunrise\"\n | \"sunset\"\n | \"chilly\"\n | \"freezing\"\n | \"twoPt\"\n | \"brightRoom\"\n | \"gallery\";\n}\n\n/** Convert PPTX simple color to core SolidFillOptions. */\nfunction toColor(color?: string, alpha?: number) {\n if (!color) return { value: \"000000\", alpha: (alpha ?? 40) * 1000 };\n return { value: color.replace(\"#\", \"\"), alpha: (alpha ?? 40) * 1000 };\n}\n\n/** Convert PPTX IShadowOptions to core OuterShadowEffectOptions. */\nfunction toOuterShadow(opts: IShadowOptions) {\n return {\n blurRadius: opts.blur,\n distance: opts.distance,\n direction: opts.direction,\n rotWithShape: opts.rotateWithShape === false ? false : undefined,\n color: toColor(opts.color, opts.alpha),\n };\n}\n\n/** Convert PPTX IShadowOptions to core InnerShadowEffectOptions. */\nfunction toInnerShadow(opts: IShadowOptions) {\n return {\n blurRadius: opts.blur,\n distance: opts.distance,\n direction: opts.direction,\n color: toColor(opts.color, opts.alpha),\n };\n}\n\n/** Convert PPTX IGlowOptions to core GlowEffectOptions. */\nfunction toGlow(opts: IGlowOptions) {\n return {\n radius: opts.radius ?? 152400,\n color: toColor(opts.color, opts.alpha),\n };\n}\n\n/** Convert PPTX IReflectionOptions to core ReflectionEffectOptions. */\nfunction toReflection(opts: IReflectionOptions) {\n const result: Record<string, number | string> = {};\n if (opts.blurRadius !== undefined) result.blurRadius = opts.blurRadius;\n if (opts.distance !== undefined) result.distance = opts.distance;\n if (opts.direction !== undefined) result.direction = opts.direction;\n if (opts.startAlpha !== undefined) result.startAlpha = opts.startAlpha * 1000;\n if (opts.startPosition !== undefined) result.startPosition = opts.startPosition * 1000;\n if (opts.endAlpha !== undefined) result.endAlpha = opts.endAlpha * 1000;\n if (opts.endPosition !== undefined) result.endPosition = opts.endPosition * 1000;\n if (opts.fadeDirection !== undefined) result.fadeDirection = opts.fadeDirection * 60000;\n if (opts.scaleX !== undefined) result.scaleX = opts.scaleX * 1000;\n if (opts.scaleY !== undefined) result.scaleY = opts.scaleY * 1000;\n if (opts.skewX !== undefined) result.skewX = opts.skewX * 60000;\n if (opts.skewY !== undefined) result.skewY = opts.skewY * 60000;\n if (opts.alignment !== undefined) result.alignment = ReflectionAlignment[opts.alignment];\n if (opts.rotateWithShape === false) result.rotWithShape = 0;\n return result;\n}\n\n/** Convert PPTX IBevelOptions to core BevelOptions. */\nfunction toBevel(opts: IBevelOptions): BevelOptions {\n return {\n ...(opts.width !== undefined && { w: opts.width * 12700 }),\n ...(opts.height !== undefined && { h: opts.height * 12700 }),\n };\n}\n\n/** Map PPTX IEffectsOptions to core EffectListOptions. */\nfunction toEffectListOptions(opts: IEffectsOptions): EffectListOptions | undefined {\n const hasEffects =\n opts.outerShadow || opts.innerShadow || opts.glow || opts.reflection || opts.softEdge;\n if (!hasEffects) return undefined;\n\n return {\n outerShadow: opts.outerShadow ? toOuterShadow(opts.outerShadow) : undefined,\n innerShadow: opts.innerShadow ? toInnerShadow(opts.innerShadow) : undefined,\n glow: opts.glow ? toGlow(opts.glow) : undefined,\n reflection: opts.reflection ? toReflection(opts.reflection) : undefined,\n softEdge: opts.softEdge ? (opts.softEdge.radius ?? 50800) : undefined,\n };\n}\n\n/** Map PPTX IEffectsOptions to core Scene3DOptions, or null if not needed. */\nexport function buildScene3D(options: IEffectsOptions): ReturnType<typeof createScene3D> | null {\n if (!options.rotation3D && !options.lighting) return null;\n\n const cameraPreset = options.rotation3D?.perspective\n ? \"legacyPerspectiveFront\"\n : \"orthographicFront\";\n const cameraOpts = {\n preset: cameraPreset,\n ...(options.rotation3D?.perspective && { fov: options.rotation3D.perspective }),\n ...(options.rotation3D && {\n rotation: {\n lat: (options.rotation3D.x ?? 0) * 60000,\n lon: (options.rotation3D.y ?? 0) * 60000,\n rev: (options.rotation3D.z ?? 0) * 60000,\n },\n }),\n };\n\n return createScene3D({\n camera: cameraOpts as Scene3DOptions[\"camera\"],\n lightRig: { rig: options.lighting ?? \"threePt\", direction: \"t\" },\n });\n}\n\n/** Map PPTX IEffectsOptions to core Shape3DOptions, or null if not needed. */\nexport function buildShape3D(options: IEffectsOptions): ReturnType<typeof createShape3D> | null {\n if (!options.extrusionH && !options.bevelTop && !options.bevelBottom && !options.material)\n return null;\n\n const shape3dOpts: Shape3DOptions = {\n ...(options.bevelTop ? { bevelT: toBevel(options.bevelTop) } : {}),\n ...(options.bevelBottom ? { bevelB: toBevel(options.bevelBottom) } : {}),\n ...(options.extrusionH !== undefined ? { extrusionH: options.extrusionH } : {}),\n ...(options.material\n ? { prstMaterial: options.material as Shape3DOptions[\"prstMaterial\"] }\n : {}),\n };\n\n return createShape3D(shape3dOpts);\n}\n\n/** Create a:effectLst from PPTX simplified IEffectsOptions. */\nexport function createPptxEffectList(options: IEffectsOptions) {\n const effectListOpts = toEffectListOptions(options);\n return effectListOpts ? createEffectList(effectListOpts) : null;\n}\n\n// Re-export core types for advanced users\nexport type { EffectListOptions, Scene3DOptions, Shape3DOptions, BevelOptions };\n","export {\n buildFill,\n extractBlipFillMedia,\n type BlipFillConfigOptions,\n type BlipFillMediaData,\n type FillOptions,\n type GradientStopOptions,\n} from \"@office-open/core/drawingml\";\n","/**\n * Base XML Component infrastructure for PPTX documents.\n * Re-exports from core for local path alias usage.\n *\n * @module\n */\nexport { BaseXmlComponent } from \"@office-open/core\";\nexport type { IContext, IXmlableObject } from \"@office-open/core\";\n","/**\n * XML Components module — re-exports from core + pptx-specific additions.\n *\n * @module\n */\n// Core re-exports\nexport { BaseXmlComponent } from \"./base\";\nexport type { IContext, IXmlableObject } from \"./base\";\nexport { XmlComponent, IgnoreIfEmptyXmlComponent, EMPTY_OBJECT } from \"@office-open/core\";\nexport { XmlAttributeComponent, NextAttributeComponent } from \"@office-open/core\";\nexport type { AttributeMap, AttributeData, AttributePayload } from \"@office-open/core\";\nexport {\n OnOffElement,\n HpsMeasureElement,\n EmptyElement,\n StringValueElement,\n NumberValueElement,\n StringEnumValueElement,\n StringContainer,\n BuilderElement,\n chartAttr,\n wrapEl,\n} from \"@office-open/core\";\nexport {\n ImportedXmlComponent,\n ImportedRootElementAttributes,\n convertToXmlComponent,\n} from \"@office-open/core\";\nexport { InitializableXmlComponent } from \"@office-open/core\";\n","import type { IEffectsOptions } from \"@file/drawingml/effects\";\nimport { createPptxEffectList } from \"@file/drawingml/effects\";\nimport type { FillOptions } from \"@file/drawingml/fill\";\nimport { buildFill } from \"@file/drawingml/fill\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nexport interface IBackgroundOptions {\n readonly fill?: FillOptions;\n readonly effects?: IEffectsOptions;\n readonly shadeToTitle?: boolean;\n}\n\n/**\n * p:bg — Slide background.\n */\nexport class Background extends XmlComponent {\n public constructor(options: IBackgroundOptions = {}) {\n super(\"p:bg\");\n this.root.push(new BackgroundProperties(options));\n }\n}\n\nclass BackgroundProperties extends XmlComponent {\n private readonly shadeToTitle: boolean;\n\n public constructor(options: IBackgroundOptions) {\n super(\"p:bgPr\");\n this.shadeToTitle = !!options.shadeToTitle;\n this.root.push(\n options.fill !== undefined ? buildFill(options.fill) : buildFill({ type: \"none\" }),\n );\n if (options.effects) {\n const el = createPptxEffectList(options.effects);\n if (el) this.root.push(el);\n }\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n const obj = super.prepForXml(context);\n if (!obj) return undefined;\n // shadeToTitle is an attribute of p:bgPr, not a child element\n if (this.shadeToTitle && \"p:bgPr\" in obj) {\n const children = (obj as Record<string, unknown>)[\"p:bgPr\"] as Record<\n string,\n unknown\n >[];\n for (const child of children) {\n if (\"_attr\" in child) {\n (child as { _attr: Record<string, unknown> })._attr.shadeToTitle = 1;\n return obj;\n }\n }\n // No _attr found — insert one\n children.unshift({ _attr: { shadeToTitle: 1 } });\n }\n return obj;\n }\n}\n","export { ChartCollection, type IChartData } from \"@office-open/core/chart\";\n","import { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\n\nexport interface AuthorEntry {\n readonly id: number;\n readonly name: string;\n readonly initials: string;\n readonly clrIdx: number;\n readonly lastIdx: number;\n}\n\n/**\n * p:cmAuthorLst — Comment author list stored in `ppt/commentAuthors.xml`.\n */\nexport class CommentAuthorList extends XmlComponent {\n public constructor(authors: readonly AuthorEntry[]) {\n super(\"p:cmAuthorLst\");\n this.root.push(\n new NextAttributeComponent({\n \"xmlns:p\": {\n key: \"xmlns:p\",\n value: \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n }),\n );\n for (const author of authors) {\n this.root.push(\n new BuilderElement({\n name: \"p:cmAuthor\",\n attributes: {\n id: { key: \"id\", value: author.id },\n name: { key: \"name\", value: author.name },\n initials: { key: \"initials\", value: author.initials },\n clrIdx: { key: \"clrIdx\", value: author.clrIdx },\n lastIdx: { key: \"lastIdx\", value: author.lastIdx },\n },\n }),\n );\n }\n }\n}\n","import { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\n\nexport interface CommentEntry {\n readonly authorId: number;\n readonly idx: number;\n readonly date?: string;\n readonly x: number;\n readonly y: number;\n readonly text: string;\n}\n\n/**\n * p:cmLst — Comment list stored in `ppt/comments/slideN.xml`.\n */\nexport class SlideCommentList extends XmlComponent {\n public constructor(comments: readonly CommentEntry[]) {\n super(\"p:cmLst\");\n this.root.push(\n new NextAttributeComponent({\n \"xmlns:p\": {\n key: \"xmlns:p\",\n value: \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n }),\n );\n for (const comment of comments) {\n this.root.push(\n new BuilderElement({\n name: \"p:cm\",\n attributes: {\n authorId: { key: \"authorId\", value: comment.authorId },\n idx: { key: \"idx\", value: comment.idx },\n ...(comment.date != null ? { dt: { key: \"dt\", value: comment.date } } : {}),\n },\n children: [\n new BuilderElement({\n name: \"p:pos\",\n attributes: {\n x: { key: \"x\", value: comment.x },\n y: { key: \"y\", value: comment.y },\n },\n }),\n new BuilderElement({\n name: \"p:text\",\n children: [comment.text],\n }),\n ],\n }),\n );\n }\n }\n}\n","/**\n * Content Types module for PPTX packages.\n *\n * @module\n */\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nconst PPTX_MAIN =\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\";\nconst PPTX_SLIDE = \"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\";\nconst PPTX_SLIDE_MASTER =\n \"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\";\nconst PPTX_SLIDE_LAYOUT =\n \"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\";\nconst PPTX_THEME = \"application/vnd.openxmlformats-officedocument.theme+xml\";\nconst PPTX_NOTES = \"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\";\nconst PPTX_COMMENTS = \"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\";\nconst PPTX_COMMENT_AUTHORS =\n \"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml\";\nconst PPTX_CHART = \"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\";\nconst PPTX_PRES_PROPS =\n \"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml\";\nconst PPTX_VIEW_PROPS =\n \"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml\";\nconst PPTX_TABLE_STYLES =\n \"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml\";\n\ntype EntryType = \"Default\" | \"Override\";\n\ninterface ContentEntry {\n readonly type: EntryType;\n readonly contentType: string;\n readonly key: string;\n}\n\nconst STATIC_ENTRIES: readonly ContentEntry[] = [\n {\n type: \"Default\",\n contentType: \"application/vnd.openxmlformats-package.relationships+xml\",\n key: \"rels\",\n },\n { type: \"Default\", contentType: \"application/xml\", key: \"xml\" },\n { type: \"Default\", contentType: \"image/png\", key: \"png\" },\n { type: \"Default\", contentType: \"image/jpeg\", key: \"jpeg\" },\n { type: \"Default\", contentType: \"image/jpeg\", key: \"jpg\" },\n { type: \"Default\", contentType: \"video/mp4\", key: \"mp4\" },\n { type: \"Override\", contentType: PPTX_MAIN, key: \"/ppt/presentation.xml\" },\n {\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-package.core-properties+xml\",\n key: \"/docProps/core.xml\",\n },\n {\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n key: \"/docProps/app.xml\",\n },\n { type: \"Override\", contentType: PPTX_THEME, key: \"/ppt/theme/theme1.xml\" },\n { type: \"Override\", contentType: PPTX_PRES_PROPS, key: \"/ppt/presProps.xml\" },\n { type: \"Override\", contentType: PPTX_VIEW_PROPS, key: \"/ppt/viewProps.xml\" },\n { type: \"Override\", contentType: PPTX_TABLE_STYLES, key: \"/ppt/tableStyles.xml\" },\n];\n\nconst STATIC_CHILDREN: IXmlableObject[] = [\n { _attr: { xmlns: \"http://schemas.openxmlformats.org/package/2006/content-types\" } },\n ...STATIC_ENTRIES.map((e) => {\n if (e.type === \"Default\") {\n return { Default: { _attr: { ContentType: e.contentType, Extension: e.key } } };\n }\n return { Override: { _attr: { ContentType: e.contentType, PartName: e.key } } };\n }),\n];\n\nexport class ContentTypes extends BaseXmlComponent {\n private readonly dynamicEntries: ContentEntry[] = [];\n\n public constructor() {\n super(\"Types\");\n }\n\n public addSlide(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_SLIDE,\n key: `/ppt/slides/slide${index}.xml`,\n });\n }\n\n public addNotesSlide(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_NOTES,\n key: `/ppt/notesSlides/notesSlide${index}.xml`,\n });\n }\n\n public addComments(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_COMMENTS,\n key: `/ppt/comments/comment${index}.xml`,\n });\n }\n\n public addCommentAuthors(): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_COMMENT_AUTHORS,\n key: \"/ppt/commentAuthors.xml\",\n });\n }\n\n public addChart(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_CHART,\n key: `/ppt/charts/chart${index}.xml`,\n });\n }\n\n public addDiagramData(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml\",\n key: `/ppt/diagrams/data${index}.xml`,\n });\n }\n\n public addDiagramLayout(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType:\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml\",\n key: `/ppt/diagrams/layout${index}.xml`,\n });\n }\n\n public addDiagramStyle(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml\",\n key: `/ppt/diagrams/quickStyle${index}.xml`,\n });\n }\n\n public addDiagramColors(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType:\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml\",\n key: `/ppt/diagrams/colors${index}.xml`,\n });\n }\n\n public addDiagramDrawing(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: \"application/vnd.ms-office.drawingml.diagramDrawing+xml\",\n key: `/ppt/diagrams/drawing${index}.xml`,\n });\n }\n\n public addSlideLayout(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_SLIDE_LAYOUT,\n key: `/ppt/slideLayouts/slideLayout${index}.xml`,\n });\n }\n\n public addSlideMaster(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_SLIDE_MASTER,\n key: `/ppt/slideMasters/slideMaster${index}.xml`,\n });\n }\n\n public addTheme(index: number): void {\n if (index !== 1) {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_THEME,\n key: `/ppt/theme/theme${index}.xml`,\n });\n }\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n const children = [...STATIC_CHILDREN];\n for (const e of this.dynamicEntries) {\n if (e.type === \"Default\") {\n children.push({\n Default: { _attr: { ContentType: e.contentType, Extension: e.key } },\n });\n } else {\n children.push({\n Override: { _attr: { ContentType: e.contentType, PartName: e.key } },\n });\n }\n }\n return { Types: children };\n }\n}\n","/**\n * Core Properties module for PresentationML documents.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCore.xsd\n *\n * @module\n */\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { buildCorePropertiesXml } from \"@office-open/core\";\n\nexport interface ICorePropertiesOptions {\n readonly title?: string;\n readonly subject?: string;\n readonly creator?: string;\n readonly keywords?: string;\n readonly description?: string;\n readonly lastModifiedBy?: string;\n readonly revision?: number;\n}\n\nexport class CoreProperties extends BaseXmlComponent {\n private readonly options: ICorePropertiesOptions;\n\n public constructor(options: ICorePropertiesOptions) {\n super(\"cp:coreProperties\");\n this.options = options;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n return buildCorePropertiesXml(this.options);\n }\n}\n","export interface IHyperlinkData {\n readonly key: string;\n readonly url: string;\n readonly tooltip?: string;\n}\n\nexport class HyperlinkCollection {\n private readonly map = new Map<string, IHyperlinkData>();\n\n public addHyperlink(key: string, url: string, tooltip?: string): void {\n this.map.set(key, { key, url, tooltip });\n }\n\n public get Array(): readonly IHyperlinkData[] {\n return [...this.map.values()];\n }\n}\n","/**\n * Media module for PresentationML documents.\n *\n * @module\n */\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nimport type { IMediaDataTransformation } from \"./data\";\nimport type { IMediaData } from \"./data\";\n\nexport interface IMediaTransformation {\n readonly offset?: {\n readonly top?: number;\n readonly left?: number;\n };\n readonly width: number;\n readonly height: number;\n readonly flip?: {\n readonly vertical?: boolean;\n readonly horizontal?: boolean;\n };\n readonly rotation?: number;\n}\n\nexport const createTransformation = (options: IMediaTransformation): IMediaDataTransformation => ({\n emus: {\n x: convertPixelsToEmu(options.width),\n y: convertPixelsToEmu(options.height),\n },\n pixels: {\n x: Math.round(options.width),\n y: Math.round(options.height),\n },\n flip: options.flip,\n rotation: options.rotation ? options.rotation * 60_000 : undefined,\n});\n\nexport class Media {\n private readonly map: Map<string, IMediaData>;\n\n public constructor() {\n this.map = new Map<string, IMediaData>();\n }\n\n public addImage(key: string, mediaData: IMediaData): void {\n this.map.set(key, mediaData);\n }\n\n public addMedia(key: string, mediaData: IMediaData): void {\n this.map.set(key, mediaData);\n }\n\n public get Array(): readonly IMediaData[] {\n return [...this.map.values()];\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport {\n createGroupTransform2D,\n type GroupTransform2DOptions as CoreGroupTransform2DOptions,\n} from \"@office-open/core/drawingml\";\n\nexport type IGroupTransform2DOptions = CoreGroupTransform2DOptions;\n\n/**\n * a:xfrm — Group transform (CT_GroupTransform2D).\n * Extends regular Transform2D with child offset (chOff) and child extent (chExt).\n * Delegates to core createGroupTransform2D.\n */\nexport class GroupTransform2D extends XmlComponent {\n private readonly core: XmlComponent;\n\n public constructor(options: IGroupTransform2DOptions, prefix: \"a\" | \"p\" = \"a\") {\n super(`${prefix}:xfrm`);\n this.core = createGroupTransform2D(options, `${prefix}:xfrm`);\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n return this.core[\"prepForXml\"]?.(context);\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\nimport { GroupTransform2D, type IGroupTransform2DOptions } from \"./group-transform-2d\";\n\n/**\n * p:grpSpPr — Group shape properties with CT_GroupTransform2D.\n */\nexport class GroupShapeProperties extends XmlComponent {\n public constructor(options?: IGroupTransform2DOptions) {\n super(\"p:grpSpPr\");\n this.root.push(new GroupTransform2D(options ?? {}));\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\n\n/**\n * p:nvGrpSpPr — Non-visual properties for a group shape.\n */\nexport class GroupShapeNonVisualProperties extends BuilderElement<{}> {\n public constructor(id: number = 1, name: string = \"\") {\n super({\n name: \"p:nvGrpSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n new BuilderElement({ name: \"p:cNvGrpSpPr\" }),\n new BuilderElement({ name: \"p:nvPr\" }),\n ],\n });\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { attrs } from \"@office-open/xml\";\n\n/**\n * Pure function: builds a:endParaRPr XML object.\n */\nexport function buildEndParagraphRunProperties(lang: string = \"en-US\"): IXmlableObject {\n return { \"a:endParaRPr\": { _attr: { lang } } };\n}\n\nexport function buildEndParagraphRunPropertiesXml(lang: string = \"en-US\"): string {\n return `<a:endParaRPr${attrs({ lang })}/>`;\n}\n\n/**\n * a:endParaRPr — End paragraph run properties.\n * Lazy: stores lang, builds XML object in prepForXml.\n */\nexport class EndParagraphRunProperties extends BuilderElement<{\n readonly lang: string;\n}> {\n private readonly lang: string;\n\n public constructor(lang: string = \"en-US\") {\n super({ name: \"a:endParaRPr\" });\n this.lang = lang;\n }\n\n public override prepForXml(\n _context: import(\"@file/xml-components\").IContext,\n ): IXmlableObject | undefined {\n return buildEndParagraphRunProperties(this.lang);\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { attrs } from \"@office-open/xml\";\n\nexport const TextAlignment = {\n LEFT: \"l\",\n CENTER: \"ctr\",\n RIGHT: \"r\",\n JUSTIFY: \"just\",\n} as const;\n\nexport type BulletCharOptions = {\n readonly type: \"char\";\n readonly char?: string;\n readonly color?: string;\n readonly size?: number;\n};\n\nexport type BulletAutoNumOptions = {\n readonly type: \"autoNum\";\n readonly format?: string;\n readonly startAt?: number;\n readonly color?: string;\n readonly size?: number;\n};\n\nexport type BulletNoneOption = {\n readonly type: \"none\";\n};\n\nexport type BulletOptions = BulletCharOptions | BulletAutoNumOptions | BulletNoneOption;\n\nexport interface IParagraphPropertiesOptions {\n readonly alignment?: keyof typeof TextAlignment;\n readonly indentLevel?: number;\n readonly marginBottom?: number;\n readonly marginTop?: number;\n readonly bullet?: BulletOptions;\n /** @deprecated Use bullet: { type: \"none\" } instead */\n readonly bulletNone?: boolean;\n readonly lineSpacing?: number;\n readonly lineSpacingPoints?: number;\n readonly marginIndent?: number;\n readonly marginRight?: number;\n readonly defTabSize?: number;\n}\n\nfunction buildBulletChildren(options: BulletOptions): IXmlableObject[] {\n const children: IXmlableObject[] = [];\n\n if (options.type === \"none\") {\n children.push({ \"a:buNone\": {} });\n return children;\n }\n\n if (options.color) {\n children.push({\n \"a:buClr\": [{ \"a:srgbClr\": { _attr: { val: options.color.replace(\"#\", \"\") } } }],\n });\n }\n\n if (options.size !== undefined) {\n children.push({ \"a:buSzPct\": { _attr: { val: `${options.size}%` } } });\n }\n\n children.push({\n \"a:buFont\": {\n _attr: {\n typeface: \"Arial\",\n panose: \"020B0604020202020204\",\n pitchFamily: \"34\",\n charset: \"0\",\n },\n },\n });\n\n if (options.type === \"char\") {\n children.push({ \"a:buChar\": { _attr: { char: options.char ?? \"•\" } } });\n } else if (options.type === \"autoNum\") {\n const buAttrs: Record<string, string | number> = { type: options.format ?? \"arabicPeriod\" };\n if (options.startAt !== undefined) buAttrs.startAt = options.startAt;\n children.push({ \"a:buAutoNum\": { _attr: buAttrs } });\n }\n\n return children;\n}\n\n/**\n * Pure function: builds a:pPr XML object from options.\n * Returns undefined when no meaningful content (empty → omitted from output).\n */\nexport function buildParagraphProperties(\n options: IParagraphPropertiesOptions,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const attrs: Record<string, string | number> = {};\n if (options.alignment) attrs.algn = TextAlignment[options.alignment];\n if (options.indentLevel !== undefined) attrs.lvl = options.indentLevel;\n if (options.marginIndent !== undefined) attrs.marL = options.marginIndent;\n if (options.marginRight !== undefined) attrs.marR = options.marginRight;\n if (options.defTabSize !== undefined) attrs.defTabSz = options.defTabSize;\n if (Object.keys(attrs).length > 0) children.push({ _attr: attrs });\n\n if (options.lineSpacing !== undefined) {\n children.push({\n \"a:lnSpc\": [{ \"a:spcPct\": { _attr: { val: options.lineSpacing * 1000 } } }],\n });\n }\n\n if (options.lineSpacingPoints !== undefined) {\n children.push({\n \"a:lnSpc\": [{ \"a:spcPts\": { _attr: { val: options.lineSpacingPoints * 100 } } }],\n });\n }\n\n if (options.marginBottom !== undefined || options.marginTop !== undefined) {\n children.push({\n \"a:spcAft\": [{ \"a:spcPts\": { _attr: { val: options.marginBottom ?? 0 } } }],\n });\n }\n\n if (options.marginTop !== undefined) {\n children.push({\n \"a:spcBef\": [{ \"a:spcPts\": { _attr: { val: options.marginTop } } }],\n });\n }\n\n if (options.bullet) {\n children.push(...buildBulletChildren(options.bullet));\n } else if (options.bulletNone !== false) {\n children.push({ \"a:buNone\": {} });\n }\n\n if (children.length === 0) return undefined;\n\n return {\n \"a:pPr\": children.length === 1 && \"_attr\" in children[0] ? children[0] : children,\n };\n}\n\n/**\n * a:pPr — Paragraph properties (alignment, indent, spacing).\n * Lazy: stores options, builds XML object in prepForXml.\n * Omitted from output when completely empty.\n */\nexport class ParagraphProperties extends XmlComponent {\n private readonly options: IParagraphPropertiesOptions;\n\n public constructor(options: IParagraphPropertiesOptions = {}) {\n super(\"a:pPr\");\n this.options = options;\n }\n\n public prepForXml(\n _context: import(\"@file/xml-components\").IContext,\n ): IXmlableObject | undefined {\n return buildParagraphProperties(this.options);\n }\n\n public toXml(): string {\n return buildParagraphPropertiesXml(this.options);\n }\n}\n\nfunction buildBulletChildrenXml(options: BulletOptions): string {\n if (options.type === \"none\") {\n return \"<a:buNone/>\";\n }\n\n let s = \"\";\n if (options.color) {\n s += `<a:buClr><a:srgbClr${attrs({ val: options.color.replace(\"#\", \"\") })}/></a:buClr>`;\n }\n if (options.size !== undefined) {\n s += `<a:buSzPct${attrs({ val: `${options.size}%` })}/>`;\n }\n s += `<a:buFont${attrs({ typeface: \"Arial\", panose: \"020B0604020202020204\", pitchFamily: \"34\", charset: \"0\" })}/>`;\n if (options.type === \"char\") {\n s += `<a:buChar${attrs({ char: options.char ?? \"•\" })}/>`;\n } else if (options.type === \"autoNum\") {\n const buAttrs: Record<string, string | number | undefined> = {\n type: options.format ?? \"arabicPeriod\",\n };\n if (options.startAt !== undefined) buAttrs.startAt = options.startAt;\n s += `<a:buAutoNum${attrs(buAttrs)}/>`;\n }\n return s;\n}\n\nexport function buildParagraphPropertiesXml(options: IParagraphPropertiesOptions): string {\n const attrStr = attrs({\n algn: options.alignment ? TextAlignment[options.alignment] : undefined,\n lvl: options.indentLevel,\n marL: options.marginIndent,\n marR: options.marginRight,\n defTabSz: options.defTabSize,\n });\n\n const body: string[] = [];\n\n if (options.lineSpacing !== undefined) {\n body.push(`<a:lnSpc><a:spcPct${attrs({ val: options.lineSpacing * 1000 })}/></a:lnSpc>`);\n }\n\n if (options.lineSpacingPoints !== undefined) {\n body.push(\n `<a:lnSpc><a:spcPts${attrs({ val: options.lineSpacingPoints * 100 })}/></a:lnSpc>`,\n );\n }\n\n if (options.marginBottom !== undefined || options.marginTop !== undefined) {\n body.push(`<a:spcAft><a:spcPts${attrs({ val: options.marginBottom ?? 0 })}/></a:spcAft>`);\n }\n\n if (options.marginTop !== undefined) {\n body.push(`<a:spcBef><a:spcPts${attrs({ val: options.marginTop })}/></a:spcBef>`);\n }\n\n if (options.bullet) {\n body.push(buildBulletChildrenXml(options.bullet));\n } else if (options.bulletNone !== false) {\n body.push(\"<a:buNone/>\");\n }\n\n if (!attrStr && body.length === 0) return \"\";\n if (body.length === 0) return `<a:pPr${attrStr}/>`;\n return `<a:pPr${attrStr}>${body.join(\"\")}</a:pPr>`;\n}\n","import type { FillOptions } from \"@file/drawingml/fill\";\nimport { buildFill } from \"@file/drawingml/fill\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { createEffectList, createOutline } from \"@office-open/core/drawingml\";\nimport { attrs, xml } from \"@office-open/xml\";\n\nlet nextHyperlinkId = 1;\n\nexport const UnderlineStyle = {\n SINGLE: \"sng\",\n DOUBLE: \"dbl\",\n NONE: \"none\",\n} as const;\n\nexport const StrikeStyle = {\n SINGLE: \"sngStrike\",\n DOUBLE: \"dblStrike\",\n NONE: \"noStrike\",\n} as const;\n\nexport const TextCapitalization = {\n NONE: \"none\",\n ALL: \"all\",\n SMALL: \"small\",\n} as const;\n\nexport interface IHyperlinkOptions {\n readonly url: string;\n readonly tooltip?: string;\n}\n\nexport interface IRunPropertiesOptions {\n /** Font size in points. Serialized as OOXML `a:sz` (hundredths of a point). */\n readonly fontSize?: number;\n readonly bold?: boolean;\n readonly italic?: boolean;\n readonly underline?: keyof typeof UnderlineStyle;\n readonly font?: string;\n readonly lang?: string;\n readonly fill?: FillOptions;\n readonly hyperlink?: IHyperlinkOptions;\n readonly strike?: keyof typeof StrikeStyle;\n readonly baseline?: number;\n readonly spacing?: number;\n readonly capitalization?: keyof typeof TextCapitalization;\n readonly shadow?: boolean;\n readonly outline?: boolean;\n readonly rightToLeft?: boolean;\n readonly noProof?: boolean;\n readonly dirty?: boolean;\n}\n\n/**\n * Pure function: builds a:rPr XML object from options.\n * @param hyperlinkKey - pre-generated key for hyperlink placeholder\n * @param fillObject - pre-built fill IXmlableObject (from buildFill)\n */\nexport function buildRunProperties(\n options: IRunPropertiesOptions,\n hyperlinkKey?: string,\n fillObject?: IXmlableObject,\n effectListObject?: IXmlableObject,\n outlineObject?: IXmlableObject,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const attrs: Record<string, string | number | boolean> = {};\n if (options.fontSize) attrs.sz = options.fontSize * 100;\n if (options.bold !== undefined) attrs.b = options.bold;\n if (options.italic !== undefined) attrs.i = options.italic;\n if (options.underline) attrs.u = UnderlineStyle[options.underline];\n if (options.lang) attrs.lang = options.lang;\n if (options.strike) attrs.strike = StrikeStyle[options.strike];\n if (options.baseline !== undefined) attrs.baseline = options.baseline;\n if (options.capitalization)\n attrs.cap = TextCapitalization[options.capitalization] ?? options.capitalization;\n if (options.spacing !== undefined) attrs.spc = options.spacing;\n if (options.noProof !== undefined) attrs.noProof = options.noProof;\n if (options.dirty !== undefined) attrs.dirty = options.dirty;\n if (Object.keys(attrs).length > 0) children.push({ _attr: attrs });\n\n if (options.font) {\n children.push({ \"a:latin\": { _attr: { typeface: options.font } } });\n children.push({ \"a:ea\": { _attr: { typeface: options.font } } });\n }\n\n if (options.hyperlink && hyperlinkKey) {\n const hlinkAttrs: Record<string, string> = { \"r:id\": `{hlink:${hyperlinkKey}}` };\n if (options.hyperlink.tooltip) hlinkAttrs.tooltip = options.hyperlink.tooltip;\n children.push({ \"a:hlinkClick\": { _attr: hlinkAttrs } });\n }\n\n if (options.rightToLeft !== undefined) {\n children.push({ \"a:rtl\": { _attr: { val: options.rightToLeft ? 1 : 0 } } });\n }\n\n if (fillObject) {\n children.push(fillObject);\n }\n\n if (outlineObject) {\n children.push(outlineObject);\n }\n\n if (effectListObject) {\n children.push(effectListObject);\n }\n\n if (children.length === 0) return undefined;\n\n return {\n \"a:rPr\": children.length === 1 && \"_attr\" in children[0] ? children[0] : children,\n };\n}\n\n/**\n * a:rPr — Run properties (font, size, color, etc.).\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class RunProperties extends XmlComponent {\n private readonly options: IRunPropertiesOptions;\n\n public static hasProperties(options: IRunPropertiesOptions): boolean {\n return !!(\n options.fontSize ||\n options.bold !== undefined ||\n options.italic !== undefined ||\n options.underline ||\n options.font ||\n options.lang ||\n options.fill ||\n options.hyperlink ||\n options.strike ||\n options.baseline !== undefined ||\n options.spacing !== undefined ||\n options.capitalization ||\n options.shadow !== undefined ||\n options.outline !== undefined ||\n options.rightToLeft !== undefined ||\n options.noProof !== undefined ||\n options.dirty !== undefined\n );\n }\n\n public constructor(options: IRunPropertiesOptions = {}) {\n super(\"a:rPr\");\n this.options = options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const opts = this.options;\n\n // Register hyperlinks (B-level: side effect on context)\n let hyperlinkKey: string | undefined;\n if (opts.hyperlink) {\n hyperlinkKey = `hlink_${nextHyperlinkId++}`;\n const file = context.fileData as {\n Hyperlinks?: { addHyperlink(key: string, url: string, tooltip?: string): void };\n };\n file?.Hyperlinks?.addHyperlink(\n hyperlinkKey,\n opts.hyperlink.url,\n opts.hyperlink.tooltip,\n );\n }\n\n // Handle fill (needs context for prepForXml)\n let fillObj: IXmlableObject | undefined;\n if (opts.fill !== undefined) {\n fillObj = buildFill(opts.fill).prepForXml(context) ?? undefined;\n }\n\n // Handle outline\n let outlineObj: IXmlableObject | undefined;\n if (opts.outline) {\n outlineObj =\n createOutline({\n width: 12700,\n type: \"solidFill\",\n color: { value: \"000000\" },\n }).prepForXml(context) ?? undefined;\n }\n\n // Handle shadow\n let effectListObj: IXmlableObject | undefined;\n if (opts.shadow) {\n effectListObj =\n createEffectList({\n outerShadow: {\n blurRadius: 50800,\n distance: 38100,\n direction: 2700000,\n color: { value: \"000000\", transforms: { alpha: 40000 } },\n },\n }).prepForXml(context) ?? undefined;\n }\n\n return buildRunProperties(opts, hyperlinkKey, fillObj, effectListObj, outlineObj);\n }\n\n public toXml(context: IContext): string {\n const opts = this.options;\n\n let hyperlinkKey: string | undefined;\n if (opts.hyperlink) {\n hyperlinkKey = `hlink_${nextHyperlinkId++}`;\n const file = context.fileData as {\n Hyperlinks?: { addHyperlink(key: string, url: string, tooltip?: string): void };\n };\n file?.Hyperlinks?.addHyperlink(\n hyperlinkKey,\n opts.hyperlink.url,\n opts.hyperlink.tooltip,\n );\n }\n\n let fillObj: IXmlableObject | undefined;\n if (opts.fill !== undefined) {\n fillObj = buildFill(opts.fill).prepForXml(context) ?? undefined;\n }\n\n let outlineObj: IXmlableObject | undefined;\n if (opts.outline) {\n outlineObj =\n createOutline({\n width: 12700,\n type: \"solidFill\",\n color: { value: \"000000\" },\n }).prepForXml(context) ?? undefined;\n }\n\n let effectListObj: IXmlableObject | undefined;\n if (opts.shadow) {\n effectListObj =\n createEffectList({\n outerShadow: {\n blurRadius: 50800,\n distance: 38100,\n direction: 2700000,\n color: { value: \"000000\", transforms: { alpha: 40000 } },\n },\n }).prepForXml(context) ?? undefined;\n }\n\n return buildRunPropertiesXml(opts, hyperlinkKey, fillObj, effectListObj, outlineObj);\n }\n}\n\n/**\n * String version of buildRunProperties for zero-allocation serialization.\n */\nexport function buildRunPropertiesXml(\n options: IRunPropertiesOptions,\n hyperlinkKey?: string,\n fillObject?: IXmlableObject,\n effectListObject?: IXmlableObject,\n outlineObject?: IXmlableObject,\n): string {\n const a: Record<string, string | number | boolean | undefined> = {};\n if (options.fontSize) a.sz = options.fontSize * 100;\n if (options.bold !== undefined) a.b = options.bold;\n if (options.italic !== undefined) a.i = options.italic;\n if (options.underline) a.u = UnderlineStyle[options.underline];\n if (options.lang) a.lang = options.lang;\n if (options.strike) a.strike = StrikeStyle[options.strike];\n if (options.baseline !== undefined) a.baseline = options.baseline;\n if (options.capitalization)\n a.cap = TextCapitalization[options.capitalization] ?? options.capitalization;\n if (options.spacing !== undefined) a.spc = options.spacing;\n if (options.noProof !== undefined) a.noProof = options.noProof;\n if (options.dirty !== undefined) a.dirty = options.dirty;\n\n const attrStr = attrs(a);\n const body: string[] = [];\n\n if (options.font) {\n body.push(\n `<a:latin${attrs({ typeface: options.font })}/><a:ea${attrs({ typeface: options.font })}/>`,\n );\n }\n\n if (options.hyperlink && hyperlinkKey) {\n const h: Record<string, string | undefined> = { \"r:id\": `{hlink:${hyperlinkKey}}` };\n if (options.hyperlink.tooltip) h.tooltip = options.hyperlink.tooltip;\n body.push(`<a:hlinkClick${attrs(h)}/>`);\n }\n\n if (options.rightToLeft !== undefined) {\n body.push(`<a:rtl${attrs({ val: options.rightToLeft ? 1 : 0 })}/>`);\n }\n\n if (fillObject) {\n body.push(xml(fillObject));\n }\n\n if (outlineObject) {\n body.push(xml(outlineObject));\n }\n\n if (effectListObject) {\n body.push(xml(effectListObject));\n }\n\n if (!attrStr && body.length === 0) return \"\";\n if (body.length === 0) return `<a:rPr${attrStr}/>`;\n return `<a:rPr${attrStr}>${body.join(\"\")}</a:rPr>`;\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { escapeXml } from \"@office-open/xml\";\n\nimport type { IRunPropertiesOptions } from \"./run-properties\";\nimport { RunProperties } from \"./run-properties\";\n\nexport interface IRunOptions extends IRunPropertiesOptions {\n readonly text?: string;\n}\n\n/**\n * a:r — A run of text with properties.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class TextRun extends XmlComponent {\n private readonly options: IRunOptions;\n\n public constructor(options: IRunOptions | string = {}) {\n super(\"a:r\");\n this.options = typeof options === \"string\" ? { text: options } : options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (RunProperties.hasProperties(this.options)) {\n const rPr = new RunProperties(this.options);\n const rPrObj = rPr.prepForXml(context);\n if (rPrObj) children.push(rPrObj);\n }\n\n if (this.options.text) {\n children.push({ \"a:t\": [this.options.text] });\n }\n\n return {\n \"a:r\":\n children.length === 0\n ? {}\n : children.length === 1 && \"_attr\" in children[0]\n ? children[0]\n : children,\n };\n }\n\n public toXml(context: IContext): string {\n let s = \"<a:r>\";\n\n if (RunProperties.hasProperties(this.options)) {\n const rp = new RunProperties(this.options);\n s += rp.toXml(context);\n }\n\n if (this.options.text) {\n s += `<a:t>${escapeXml(this.options.text)}</a:t>`;\n }\n\n s += \"</a:r>\";\n return s;\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { buildEndParagraphRunProperties } from \"./end-paragraph-run\";\nimport { buildEndParagraphRunPropertiesXml } from \"./end-paragraph-run\";\nimport type { IParagraphPropertiesOptions } from \"./paragraph-properties\";\nimport { buildParagraphProperties } from \"./paragraph-properties\";\nimport { buildParagraphPropertiesXml } from \"./paragraph-properties\";\nimport { TextRun } from \"./run\";\n\nexport interface IParagraphOptions {\n /** Simple text content for the paragraph. Creates a single TextRun. */\n readonly text?: string;\n readonly properties?: IParagraphPropertiesOptions;\n readonly children?: readonly (TextRun | XmlComponent)[];\n}\n\n/**\n * a:p — A paragraph in a text body.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class Paragraph extends XmlComponent {\n private readonly options: IParagraphOptions;\n\n public constructor(options: string | IParagraphOptions = {}) {\n super(\"a:p\");\n this.options = typeof options === \"string\" ? { text: options } : options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const pPr = buildParagraphProperties(this.options.properties ?? {});\n if (pPr) children.push(pPr);\n\n if (this.options.text) {\n const obj = new TextRun(this.options.text).prepForXml(context);\n if (obj) children.push(obj);\n }\n\n if (this.options.children) {\n for (const child of this.options.children) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n }\n\n children.push(buildEndParagraphRunProperties());\n\n return { \"a:p\": children };\n }\n\n public toXml(context: IContext): string {\n let s = \"<a:p>\";\n\n const pPr = buildParagraphPropertiesXml(this.options.properties ?? {});\n if (pPr) s += pPr;\n\n if (this.options.text) {\n s += new TextRun(this.options.text).toXml(context);\n }\n\n if (this.options.children) {\n for (const child of this.options.children) {\n s += child.toXml(context);\n }\n }\n\n s += buildEndParagraphRunPropertiesXml();\n s += \"</a:p>\";\n return s;\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { buildFill } from \"../drawingml/fill\";\nimport type { FillOptions } from \"../drawingml/fill\";\n\nexport interface ICellBorderOptions {\n readonly width?: number;\n readonly color?: string;\n readonly dashStyle?: \"solid\" | \"dash\" | \"dashDot\" | \"lgDash\" | \"sysDot\" | \"sysDash\";\n}\n\nfunction buildBorderLine(name: string, options: ICellBorderOptions): IXmlableObject {\n const attrs: Record<string, string | number> = {};\n const children: IXmlableObject[] = [];\n\n if (options.width !== undefined) attrs.w = options.width;\n if (options.color) {\n children.push({\n \"a:solidFill\": [{ \"a:srgbClr\": { _attr: { val: options.color.replace(\"#\", \"\") } } }],\n });\n }\n if (options.dashStyle) {\n children.push({ \"a:prstDash\": { _attr: { val: options.dashStyle } } });\n }\n\n return { [name]: Object.keys(attrs).length > 0 ? [{ _attr: attrs }, ...children] : children };\n}\n\n/**\n * a:tcPr — Table cell properties (borders + fill).\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableCellProperties extends BaseXmlComponent {\n private readonly options?: {\n readonly fill?: FillOptions;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n readonly verticalAlign?: \"t\" | \"ctr\" | \"b\";\n };\n\n public constructor(options?: {\n readonly fill?: FillOptions;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n readonly verticalAlign?: \"t\" | \"ctr\" | \"b\";\n }) {\n super(\"a:tcPr\");\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const children: IXmlableObject[] = [];\n const opts = this.options;\n\n if (opts?.verticalAlign) {\n children.push({ _attr: { anchor: opts.verticalAlign } });\n }\n\n if (opts?.borders) {\n if (opts.borders.left) children.push(buildBorderLine(\"a:lnL\", opts.borders.left));\n if (opts.borders.right) children.push(buildBorderLine(\"a:lnR\", opts.borders.right));\n if (opts.borders.top) children.push(buildBorderLine(\"a:lnT\", opts.borders.top));\n if (opts.borders.bottom) children.push(buildBorderLine(\"a:lnB\", opts.borders.bottom));\n }\n\n if (opts?.fill !== undefined) {\n const fillComp = buildFill(opts.fill);\n const fillObj = fillComp.prepForXml(context);\n if (fillObj) children.push(fillObj);\n }\n\n return {\n \"a:tcPr\":\n children.length === 0\n ? {}\n : children.length === 1 && \"_attr\" in children[0]\n ? children[0]\n : children,\n };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport type { FillOptions } from \"../drawingml/fill\";\nimport { Paragraph } from \"../shape/paragraph/paragraph\";\nimport { TextRun } from \"../shape/paragraph/run\";\nimport { TableCellProperties, type ICellBorderOptions } from \"./table-cell-properties\";\n\nexport const VerticalAlignment = {\n TOP: \"t\",\n CENTER: \"ctr\",\n BOTTOM: \"b\",\n} as const;\n\nexport interface ITableCellOptions {\n readonly text?: string;\n readonly children?: readonly BaseXmlComponent[];\n readonly fill?: FillOptions;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n readonly columnSpan?: number;\n readonly rowSpan?: number;\n readonly verticalAlign?: keyof typeof VerticalAlignment;\n readonly margins?: {\n readonly top?: number;\n readonly bottom?: number;\n readonly left?: number;\n readonly right?: number;\n };\n}\n\n/**\n * a:tc — Table cell with text body and properties.\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableCell extends BaseXmlComponent {\n private readonly options: ITableCellOptions;\n private readonly paragraphs?: readonly BaseXmlComponent[];\n\n public constructor(options: ITableCellOptions = {}) {\n super(\"a:tc\");\n this.options = options;\n this.paragraphs =\n options.children ??\n (options.text !== undefined\n ? [\n new Paragraph({\n properties: { bulletNone: false },\n children: [new TextRun({ text: options.text })],\n }),\n ]\n : undefined);\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const opts = this.options;\n const children: IXmlableObject[] = [];\n\n // gridSpan and rowSpan attributes\n const tcAttrs: Record<string, number> = {};\n if (opts.columnSpan !== undefined && opts.columnSpan > 1)\n tcAttrs.gridSpan = opts.columnSpan;\n if (opts.rowSpan !== undefined && opts.rowSpan > 1) tcAttrs.rowSpan = opts.rowSpan;\n if (Object.keys(tcAttrs).length > 0) children.push({ _attr: tcAttrs });\n\n // a:txBody\n const txBodyChildren: IXmlableObject[] = [];\n const margins = opts.margins;\n const bodyPrAttrs: Record<string, number> = {};\n if (margins?.top !== undefined) bodyPrAttrs.tIns = margins.top;\n if (margins?.bottom !== undefined) bodyPrAttrs.bIns = margins.bottom;\n if (margins?.left !== undefined) bodyPrAttrs.lIns = margins.left;\n if (margins?.right !== undefined) bodyPrAttrs.rIns = margins.right;\n txBodyChildren.push({\n \"a:bodyPr\": Object.keys(bodyPrAttrs).length > 0 ? { _attr: bodyPrAttrs } : {},\n });\n txBodyChildren.push({ \"a:lstStyle\": {} });\n\n if (this.paragraphs) {\n for (const p of this.paragraphs) {\n const pObj = p.prepForXml(context);\n if (pObj) txBodyChildren.push(pObj);\n }\n } else {\n txBodyChildren.push({ \"a:p\": [] });\n }\n children.push({ \"a:txBody\": txBodyChildren });\n\n // a:tcPr\n const tcPr = new TableCellProperties({\n fill: opts.fill,\n borders: opts.borders,\n verticalAlign: opts.verticalAlign ? VerticalAlignment[opts.verticalAlign] : undefined,\n });\n const tcPrObj = tcPr.prepForXml(context);\n if (tcPrObj) children.push(tcPrObj);\n\n return { \"a:tc\": children };\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { attrs } from \"@office-open/xml\";\n\nimport { VerticalAlignment } from \"../table/table-cell\";\nimport { Paragraph } from \"./paragraph/paragraph\";\nimport { TextRun } from \"./paragraph/run\";\n\nexport interface ITextBodyOptions {\n readonly paragraphs?: readonly (Paragraph | string)[];\n readonly vertical?: \"vert\" | \"vert270\" | \"horz\" | \"wordArtVert\";\n readonly anchor?: keyof typeof VerticalAlignment;\n readonly autoFit?: \"normal\" | \"shape\" | \"none\";\n readonly wrap?: \"square\" | \"none\";\n readonly margins?: {\n readonly top?: number;\n readonly bottom?: number;\n readonly left?: number;\n readonly right?: number;\n };\n readonly columns?: number;\n readonly columnSpacing?: number;\n}\n\n/**\n * Pure function: builds a:bodyPr content.\n */\nfunction buildBodyPr(options: ITextBodyOptions): IXmlableObject {\n const bodyPrChildren: IXmlableObject[] = [];\n\n if (options.autoFit === \"normal\") bodyPrChildren.push({ \"a:normAutofit\": {} });\n else if (options.autoFit === \"shape\") bodyPrChildren.push({ \"a:spAutoFit\": {} });\n else if (options.autoFit === \"none\") bodyPrChildren.push({ \"a:noAutofit\": {} });\n\n const bodyPrContent: IXmlableObject[] = [];\n\n const attrs: Record<string, string | number> = {};\n if (options.vertical) attrs.vert = options.vertical;\n if (options.anchor) attrs.anchor = VerticalAlignment[options.anchor];\n if (options.wrap) attrs.wrap = options.wrap;\n if (options.margins?.top !== undefined) attrs.tIns = options.margins.top;\n if (options.margins?.bottom !== undefined) attrs.bIns = options.margins.bottom;\n if (options.margins?.left !== undefined) attrs.lIns = options.margins.left;\n if (options.margins?.right !== undefined) attrs.rIns = options.margins.right;\n if (options.columns !== undefined) attrs.numCol = options.columns;\n if (options.columnSpacing !== undefined) attrs.spcCol = options.columnSpacing * 100;\n if (Object.keys(attrs).length > 0) bodyPrContent.push({ _attr: attrs });\n\n bodyPrContent.push(...bodyPrChildren);\n\n return {\n \"a:bodyPr\":\n bodyPrContent.length === 1 && \"_attr\" in bodyPrContent[0]\n ? bodyPrContent[0]\n : bodyPrContent.length > 0\n ? bodyPrContent\n : {},\n };\n}\n\nfunction buildBodyPrXml(options: ITextBodyOptions): string {\n let s = \"<a:bodyPr\";\n\n const a: Record<string, string | number | undefined> = {};\n if (options.vertical) a.vert = options.vertical;\n if (options.anchor) a.anchor = VerticalAlignment[options.anchor];\n if (options.wrap) a.wrap = options.wrap;\n if (options.margins?.top !== undefined) a.tIns = options.margins.top;\n if (options.margins?.bottom !== undefined) a.bIns = options.margins.bottom;\n if (options.margins?.left !== undefined) a.lIns = options.margins.left;\n if (options.margins?.right !== undefined) a.rIns = options.margins.right;\n if (options.columns !== undefined) a.numCol = options.columns;\n if (options.columnSpacing !== undefined) a.spcCol = options.columnSpacing * 100;\n s += attrs(a);\n\n let inner = \"\";\n if (options.autoFit === \"normal\") inner += \"<a:normAutofit/>\";\n else if (options.autoFit === \"shape\") inner += \"<a:spAutoFit/>\";\n else if (options.autoFit === \"none\") inner += \"<a:noAutofit/>\";\n\n return inner ? `${s}>${inner}</a:bodyPr>` : `${s}/>`;\n}\n\n/**\n * p:txBody — Text body within a shape.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class TextBody extends XmlComponent {\n private readonly options: ITextBodyOptions;\n\n public constructor(options: ITextBodyOptions = {}) {\n super(\"p:txBody\");\n this.options = options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n children.push(buildBodyPr(this.options));\n children.push({ \"a:lstStyle\": {} });\n\n if (this.options.paragraphs) {\n for (const p of this.options.paragraphs) {\n const para =\n typeof p === \"string\"\n ? new Paragraph({ children: [new TextRun({ text: p })] })\n : p;\n const obj = para.prepForXml(context);\n if (obj) children.push(obj);\n }\n } else {\n const obj = new Paragraph().prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"p:txBody\": children };\n }\n\n public toXml(context: IContext): string {\n let s = \"<p:txBody>\";\n s += buildBodyPrXml(this.options);\n s += \"<a:lstStyle/>\";\n\n if (this.options.paragraphs) {\n for (const p of this.options.paragraphs) {\n const para =\n typeof p === \"string\"\n ? new Paragraph({ children: [new TextRun({ text: p })] })\n : p;\n s += para.toXml(context);\n }\n } else {\n s += new Paragraph().toXml(context);\n }\n\n s += \"</p:txBody>\";\n return s;\n }\n}\n","import { GroupShapeProperties } from \"@file/drawingml/group-shape-properties\";\nimport { GroupShapeNonVisualProperties } from \"@file/shape-tree/group-shape-non-visual\";\nimport { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\n\nimport { Paragraph } from \"../shape/paragraph/paragraph\";\nimport { TextRun } from \"../shape/paragraph/run\";\nimport { TextBody } from \"../shape/text-body\";\n\nexport interface INotesSlideOptions {\n readonly text?: string;\n}\n\n/**\n * p:notes — A notes slide associated with a presentation slide.\n *\n * Contains a slide image placeholder and a body text area for speaker notes.\n */\nexport class NotesSlide extends XmlComponent {\n public constructor(options: INotesSlideOptions = {}) {\n super(\"p:notes\");\n\n this.root.push(\n new NextAttributeComponent({\n \"xmlns:a\": {\n key: \"xmlns:a\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n },\n \"xmlns:r\": {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n \"xmlns:p\": {\n key: \"xmlns:p\",\n value: \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n }),\n );\n\n this.root.push(new NotesCommonSlideData(options.text));\n this.root.push(\n new BuilderElement({\n name: \"p:clrMapOvr\",\n children: [new BuilderElement({ name: \"a:masterClrMapping\" })],\n }),\n );\n }\n}\n\nclass NotesCommonSlideData extends XmlComponent {\n public constructor(text?: string) {\n super(\"p:cSld\");\n this.root.push(new NotesShapeTree(text));\n }\n}\n\nclass NotesShapeTree extends XmlComponent {\n public constructor(text?: string) {\n super(\"p:spTree\");\n this.root.push(new GroupShapeNonVisualProperties());\n this.root.push(new GroupShapeProperties());\n this.root.push(new SlideImagePlaceholder());\n this.root.push(new NotesBodyPlaceholder(text));\n }\n}\n\nclass SlideImagePlaceholder extends XmlComponent {\n public constructor() {\n super(\"p:sp\");\n this.root.push(\n new BuilderElement({\n name: \"p:nvSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: 2 },\n name: { key: \"name\", value: \"Slide Image Placeholder 1\" },\n },\n }),\n new BuilderElement({ name: \"p:cNvSpPr\" }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: [\n new BuilderElement({\n name: \"p:ph\",\n attributes: { type: { key: \"type\", value: \"sldImg\" } },\n }),\n ],\n }),\n ],\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: {\n x: { key: \"x\", value: 685800 },\n y: { key: \"y\", value: 1600200 },\n },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: 5486400 },\n cy: { key: \"cy\", value: 3086100 },\n },\n }),\n ],\n }),\n ],\n }),\n );\n }\n}\n\nclass NotesBodyPlaceholder extends XmlComponent {\n public constructor(text?: string) {\n super(\"p:sp\");\n this.root.push(\n new BuilderElement({\n name: \"p:nvSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: 3 },\n name: { key: \"name\", value: \"Notes Placeholder 1\" },\n },\n }),\n new BuilderElement({ name: \"p:cNvSpPr\" }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: [\n new BuilderElement({\n name: \"p:ph\",\n attributes: {\n type: { key: \"type\", value: \"body\" },\n idx: { key: \"idx\", value: 1 },\n },\n }),\n ],\n }),\n ],\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: {\n x: { key: \"x\", value: 685800 },\n y: { key: \"y\", value: 4800600 },\n },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: 5486400 },\n cy: { key: \"cy\", value: 3600450 },\n },\n }),\n ],\n }),\n ],\n }),\n );\n\n const textBodyOptions = text\n ? { paragraphs: [new Paragraph({ children: [new TextRun({ text })] })] }\n : undefined;\n this.root.push(new TextBody(textBodyOptions));\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nexport interface IShowOptions {\n readonly loop?: boolean;\n readonly kiosk?: boolean;\n readonly showNarration?: boolean;\n readonly useTimings?: boolean;\n}\n\nfunction buildPresPropsXml(showOptions?: IShowOptions): string {\n const showPrXml = showOptions\n ? `<p:showPr${[\n showOptions.loop ? ' loop=\"1\"' : \"\",\n showOptions.kiosk ? ' kiosk=\"1\"' : \"\",\n showOptions.showNarration === false ? ' showNarration=\"0\"' : \"\",\n showOptions.useTimings ? ' useTimings=\"1\"' : \"\",\n ].join(\"\")}><p:present/></p:showPr>`\n : \"\";\n return `<p:presentationPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">${showPrXml}</p:presentationPr>`;\n}\n\nexport class PresentationProperties extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n\n public constructor(showOptions?: IShowOptions) {\n super(\"p:presentationPr\");\n const key = showOptions ? JSON.stringify(showOptions) : \"\";\n if (!PresentationProperties.cache.has(key)) {\n PresentationProperties.cache.set(\n key,\n ImportedXmlComponent.fromXmlString(buildPresPropsXml(showOptions)),\n );\n }\n }\n\n public prepForXml() {\n const key = this.showOptions ? JSON.stringify(this.showOptions) : \"\";\n return PresentationProperties.cache.get(key)!.prepForXml({ stack: [] });\n }\n\n private readonly showOptions?: IShowOptions;\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport { ImportedXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nexport interface IPresentationOptions {\n readonly slideWidth?: number;\n readonly slideHeight?: number;\n readonly slideIds: readonly number[];\n readonly masterCount: number;\n}\n\nconst DEFAULT_TEXT_STYLE_XML = `<p:defaultTextStyle xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">\n <a:defPPr><a:defRPr/></a:defPPr>\n <a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl1pPr>\n <a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl2pPr>\n <a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl3pPr>\n <a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl4pPr>\n <a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl5pPr>\n <a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl6pPr>\n <a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl7pPr>\n <a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl8pPr>\n <a:lvl9pPr marL=\"3657600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl9pPr>\n</p:defaultTextStyle>`;\n\nconst DEFAULT_TEXT_STYLE_OBJ: IXmlableObject = ImportedXmlComponent.fromXmlString(\n DEFAULT_TEXT_STYLE_XML,\n).prepForXml({ stack: [] })!;\n\n/**\n * p:presentation — Root element of a PPTX file.\n * Lazy: stores options, builds XML object directly in prepForXml.\n */\nexport class Presentation extends XmlComponent {\n private readonly options: IPresentationOptions;\n\n public constructor(options: IPresentationOptions) {\n super(\"p:presentation\");\n this.options = options;\n }\n\n public prepForXml(_context: IContext): IXmlableObject | undefined {\n const opts = this.options;\n\n const children: IXmlableObject[] = [];\n\n // xmlns attributes\n children.push({\n _attr: {\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:p\": \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n });\n\n // sldMasterIdLst (dynamic — supports multiple masters)\n const masterIds = Array.from({ length: opts.masterCount }, (_, i) => ({\n \"p:sldMasterId\": { _attr: { id: 2147483648 + i * 12, \"r:id\": `rId${i + 1}` } },\n }));\n children.push({ \"p:sldMasterIdLst\": masterIds });\n\n // sldIdLst (dynamic) — rIds follow after master rIds\n const slideRidOffset = opts.masterCount + 1;\n const sldIds = opts.slideIds.map((id, i) => ({\n \"p:sldId\": { _attr: { id, \"r:id\": `rId${slideRidOffset + i}` } },\n }));\n children.push({ \"p:sldIdLst\": sldIds });\n\n // sldSz\n const cx = opts.slideWidth ?? 12192000;\n const cy = opts.slideHeight ?? 6858000;\n children.push({\n \"p:sldSz\": {\n _attr: {\n cx,\n cy,\n },\n },\n });\n\n // notesSz\n children.push({\n \"p:notesSz\": { _attr: { cx: 6858000, cy: 9144000 } },\n });\n\n // defaultTextStyle (cached static singleton)\n children.push(DEFAULT_TEXT_STYLE_OBJ);\n\n return { \"p:presentation\": children };\n }\n\n public toXml(_context: IContext): string {\n const opts = this.options;\n\n const cx = opts.slideWidth ?? 12192000;\n const cy = opts.slideHeight ?? 6858000;\n\n let s = `<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">`;\n s += \"<p:sldMasterIdLst>\";\n for (let mi = 0; mi < opts.masterCount; mi++) {\n s += `<p:sldMasterId id=\"${2147483648 + mi * 12}\" r:id=\"rId${mi + 1}\"/>`;\n }\n s += \"</p:sldMasterIdLst>\";\n s += \"<p:sldIdLst>\";\n const sRidOff = opts.masterCount + 1;\n for (let i = 0; i < opts.slideIds.length; i++) {\n s += `<p:sldId id=\"${opts.slideIds[i]}\" r:id=\"rId${sRidOff + i}\"/>`;\n }\n s += \"</p:sldIdLst>\";\n s += `<p:sldSz cx=\"${cx}\" cy=\"${cy}\"/>`;\n s += '<p:notesSz cx=\"6858000\" cy=\"9144000\"/>';\n s += DEFAULT_TEXT_STYLE_XML;\n s += \"</p:presentation>\";\n return s;\n }\n}\n","import { Relationships } from \"@file/relationships/relationships\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\n\nimport { Presentation } from \"./presentation\";\nimport type { IPresentationOptions } from \"./presentation\";\n\nexport interface IViewWrapper {\n readonly View: BaseXmlComponent;\n readonly Relationships: Relationships;\n}\n\nexport class PresentationWrapper implements IViewWrapper {\n private readonly presentation: Presentation;\n private readonly relationships: Relationships;\n\n public constructor(options: IPresentationOptions) {\n this.presentation = new Presentation(options);\n this.relationships = new Relationships();\n }\n\n public get View(): Presentation {\n return this.presentation;\n }\n\n public get Relationships(): Relationships {\n return this.relationships;\n }\n}\n","import type { ILayoutDefinition } from \"@file/file\";\nimport type { IMasterPlaceholderPosition } from \"@file/slide-master/slide-master\";\nimport type { IContext } from \"@file/xml-components\";\nimport { ImportedXmlComponent } from \"@file/xml-components\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\n\nexport type SlideLayoutType =\n | \"blank\"\n | \"title\"\n | \"tx\"\n | \"twoColTx\"\n | \"titleOnly\"\n | \"obj\"\n | \"secHead\"\n | \"chart\"\n | \"tbl\"\n | \"picTx\"\n | \"twoObj\"\n | \"twoTxTwoObj\"\n | \"objTx\"\n | \"vertTx\"\n | \"vertTitleAndTx\";\n\nconst NS = `xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"`;\n\nconst SP_TREE_HEADER = `<p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>`;\n\n// 16:9 reference slide width\nconst SW_REF = 12192000;\nconst sx = (refX: number, sw: number) => Math.round((refX * sw) / SW_REF);\n\n// ── Placeholder XML builders ──\n\n// No xfrm — inherited from master\nfunction dtPlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Date Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{5BCAD085-E8A6-8845-BD4E-CB4CCA059FC4}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/27/13</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction ftrPlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Footer Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction sldNumPlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Slide Number Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C1FF6DA9-008F-8B48-92A6-B652298478BF}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// title — no idx, no xfrm (inherited)\nfunction titlePlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Body (generic) idx, no xfrm (inherited)\nfunction bodyPlaceholder(id: number, idx: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Content Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Body with xfrm (positioned)\nfunction bodyPlaceholderAt(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Content Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Body with explicit type=\"body\" and xfrm\nfunction typedBodyPlaceholder(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Text Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Title with xfrm\nfunction titlePlaceholderAt(id: number, x: number, y: number, cx: number, cy: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// ctrTitle — centered title for title layout\nfunction ctrTitlePlaceholder(id: number, x: number, y: number, cx: number, cy: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ctrTitle\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"ctr\"><a:defRPr sz=\"6000\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// subTitle for title layout\nfunction subTitlePlaceholder(id: number, x: number, y: number, cx: number, cy: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Subtitle 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"subTitle\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr sz=\"2400\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Pic placeholder\nfunction picPlaceholder(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Picture Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"pic\" idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// ── Layout definitions (16:9 reference positions) ──\n\ninterface LayoutDef {\n type: SlideLayoutType;\n name: string;\n buildShapes: (sw: number) => string;\n}\n\nconst LAYOUT_DEFS: Record<SlideLayoutType, LayoutDef> = {\n // 1. title — ctrTitle + subTitle\n title: {\n type: \"title\",\n name: \"Title Slide\",\n buildShapes: (sw) =>\n ctrTitlePlaceholder(2, sx(1524000, sw), 1122363, sx(9144000, sw), 2387600) +\n subTitlePlaceholder(3, sx(1524000, sw), 3602038, sx(9144000, sw), 1655762),\n },\n // 2. obj — title + body (generic content)\n obj: {\n type: \"obj\",\n name: \"Title and Content\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n // 3. secHead — title + body (both positioned)\n secHead: {\n type: \"secHead\",\n name: \"Section Header\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(831850, sw), 1709738, sx(10515600, sw), 2852737) +\n typedBodyPlaceholder(3, 1, sx(831850, sw), 4589463, sx(10515600, sw), 1500187),\n },\n // 4. twoObj — title + 2 body columns\n twoObj: {\n type: \"twoObj\",\n name: \"Two Content\",\n buildShapes: (sw) =>\n titlePlaceholder(2) +\n bodyPlaceholderAt(3, 1, sx(838200, sw), 1825625, sx(5181600, sw), 4351338) +\n bodyPlaceholderAt(4, 2, sx(6172200, sw), 1825625, sx(5181600, sw), 4351338),\n },\n // 5. twoTxTwoObj — title + 4 quadrants (2 text, 2 content)\n twoTxTwoObj: {\n type: \"twoTxTwoObj\",\n name: \"Comparison\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(839788, sw), 365125, sx(10515600, sw), 1325563) +\n typedBodyPlaceholder(3, 1, sx(839788, sw), 1681163, sx(5157787, sw), 823912) +\n bodyPlaceholderAt(4, 2, sx(839788, sw), 2505075, sx(5157787, sw), 3684588) +\n typedBodyPlaceholder(5, 3, sx(6172200, sw), 1681163, sx(5183188, sw), 823912) +\n bodyPlaceholderAt(6, 4, sx(6172200, sw), 2505075, sx(5183188, sw), 3684588),\n },\n // 6. titleOnly — title only\n titleOnly: {\n type: \"titleOnly\",\n name: \"Title Only\",\n buildShapes: () => titlePlaceholder(2),\n },\n // 7. blank — no content placeholders\n blank: {\n type: \"blank\",\n name: \"Blank\",\n buildShapes: () => \"\",\n },\n // 8. objTx — title + body + text (object and text)\n objTx: {\n type: \"objTx\",\n name: \"Content with Caption\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(839788, sw), 457200, sx(3932237, sw), 1600200) +\n bodyPlaceholderAt(3, 1, sx(5183188, sw), 987425, sx(6172200, sw), 4873625) +\n typedBodyPlaceholder(4, 2, sx(839788, sw), 2057400, sx(3932237, sw), 3811588),\n },\n // 9. picTx — title + pic + text\n picTx: {\n type: \"picTx\",\n name: \"Picture with Caption\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(839788, sw), 457200, sx(3932237, sw), 1600200) +\n picPlaceholder(3, 1, sx(5183188, sw), 987425, sx(6172200, sw), 4873625) +\n typedBodyPlaceholder(4, 2, sx(839788, sw), 2057400, sx(3932237, sw), 3811588),\n },\n // 10. vertTx — title + body (vertical text)\n vertTx: {\n type: \"vertTx\",\n name: \"Vertical Text\",\n buildShapes: () =>\n titlePlaceholder(2) +\n `<p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`,\n },\n // 11. vertTitleAndTx — vertical title + body\n vertTitleAndTx: {\n type: \"vertTitleAndTx\",\n name: \"Vertical Title and Text\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(8724900, sw), 365125, sx(2628900, sw), 5811838) +\n typedBodyPlaceholder(3, 1, sx(838200, sw), 365125, sx(7734300, sw), 5811838),\n },\n // Aliases / simplified versions\n tx: {\n type: \"tx\",\n name: \"Title and Text\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n chart: {\n type: \"chart\",\n name: \"Content with Caption\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n tbl: {\n type: \"tbl\",\n name: \"Content with Caption\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n twoColTx: {\n type: \"twoColTx\",\n name: \"Two Content\",\n buildShapes: (sw) =>\n titlePlaceholder(2) +\n bodyPlaceholderAt(3, 1, sx(838200, sw), 1825625, sx(5181600, sw), 4351338) +\n bodyPlaceholderAt(4, 2, sx(6172200, sw), 1825625, sx(5181600, sw), 4351338),\n },\n};\n\nfunction buildLayoutXml(layoutType: SlideLayoutType, slideWidth: number = SW_REF): string {\n const def = LAYOUT_DEFS[layoutType];\n const contentShapes = def.buildShapes(slideWidth);\n // Count content shapes to determine starting ID for footer placeholders\n const contentCount = contentShapes ? (contentShapes.match(/<p:sp>/g) || []).length : 0;\n const footerStartId = 2 + contentCount;\n\n const footerShapes =\n dtPlaceholder(footerStartId) +\n ftrPlaceholder(footerStartId + 1) +\n sldNumPlaceholder(footerStartId + 2);\n\n return `<p:sldLayout ${NS} type=\"${layoutType}\" preserve=\"1\"><p:cSld name=\"${def.name}\"><p:spTree>${SP_TREE_HEADER}${contentShapes}${footerShapes}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;\n}\n\n// ── Custom layout builder ──\n\nfunction posToEmu(pos: IMasterPlaceholderPosition) {\n return {\n x: convertPixelsToEmu(pos.x),\n y: convertPixelsToEmu(pos.y),\n cx: convertPixelsToEmu(pos.width),\n cy: convertPixelsToEmu(pos.height),\n };\n}\n\nfunction positionedTitlePlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedSubtitlePlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Subtitle 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"subTitle\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedBodyPlaceholder(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Content Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedDatePlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Date Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{5BCAD085-E8A6-8845-BD4E-CB4CCA059FC4}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/27/13</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedFooterPlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Footer Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedSldNumPlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Slide Number Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C1FF6DA9-008F-8B48-92A6-B652298478BF}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction buildChildrenXml(children?: readonly BaseXmlComponent[]): string {\n if (!children || children.length === 0) return \"\";\n const ctx: IContext = { stack: [] };\n let result = \"\";\n for (const child of children) {\n const obj = child.prepForXml(ctx);\n if (obj) result += xml(obj);\n }\n return result;\n}\n\nfunction buildCustomLayoutXml(def: ILayoutDefinition): string {\n const ph = def.placeholders ?? {};\n const layoutType = def.type ?? \"blank\";\n const displayName = def.name ?? LAYOUT_DEFS[layoutType]?.name ?? layoutType;\n\n const shapes: string[] = [];\n let nextId = 2;\n\n // Content placeholders\n if (ph.title !== false) {\n const titlePos = ph.title ? posToEmu(ph.title) : null;\n if (titlePos) {\n shapes.push(\n positionedTitlePlaceholder(\n nextId++,\n titlePos.x,\n titlePos.y,\n titlePos.cx,\n titlePos.cy,\n ),\n );\n } else {\n shapes.push(titlePlaceholder(nextId++));\n }\n }\n\n if (ph.subtitle !== false && ph.subtitle !== undefined) {\n const subPos = posToEmu(ph.subtitle);\n shapes.push(\n positionedSubtitlePlaceholder(nextId++, subPos.x, subPos.y, subPos.cx, subPos.cy),\n );\n }\n\n if (ph.body !== false && ph.body !== undefined) {\n const bodyPos = ph.body ? posToEmu(ph.body) : null;\n if (bodyPos) {\n shapes.push(\n positionedBodyPlaceholder(\n nextId++,\n 1,\n bodyPos.x,\n bodyPos.y,\n bodyPos.cx,\n bodyPos.cy,\n ),\n );\n } else {\n shapes.push(bodyPlaceholder(nextId++, 1));\n }\n }\n\n // Footer placeholders\n if (ph.date !== false && ph.date !== undefined) {\n const datePos = ph.date ? posToEmu(ph.date) : null;\n if (datePos) {\n shapes.push(\n positionedDatePlaceholder(nextId++, datePos.x, datePos.y, datePos.cx, datePos.cy),\n );\n } else {\n shapes.push(dtPlaceholder(nextId++));\n }\n }\n\n if (ph.footer !== false && ph.footer !== undefined) {\n const ftrPos = ph.footer ? posToEmu(ph.footer) : null;\n if (ftrPos) {\n shapes.push(\n positionedFooterPlaceholder(nextId++, ftrPos.x, ftrPos.y, ftrPos.cx, ftrPos.cy),\n );\n } else {\n shapes.push(ftrPlaceholder(nextId++));\n }\n }\n\n if (ph.slideNumber !== false && ph.slideNumber !== undefined) {\n const sldPos = ph.slideNumber ? posToEmu(ph.slideNumber) : null;\n if (sldPos) {\n shapes.push(\n positionedSldNumPlaceholder(nextId++, sldPos.x, sldPos.y, sldPos.cx, sldPos.cy),\n );\n } else {\n shapes.push(sldNumPlaceholder(nextId++));\n }\n }\n\n // Children shapes — shift ids\n const childrenXml = buildChildrenXml(def.children);\n if (childrenXml) {\n const offset = nextId - 1;\n shapes.push(childrenXml.replace(/ id=\"(\\d+)\"/g, (_, n) => ` id=\"${parseInt(n) + offset}\"`));\n }\n\n return `<p:sldLayout ${NS} type=\"${layoutType}\" preserve=\"1\"><p:cSld name=\"${displayName}\"><p:spTree>${SP_TREE_HEADER}${shapes.join(\"\")}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;\n}\n\nexport class SlideLayout extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n public readonly layoutType: SlideLayoutType;\n private readonly cacheKey: string;\n\n public constructor(\n layoutType: SlideLayoutType = \"blank\",\n slideWidth: number = SW_REF,\n definition?: ILayoutDefinition,\n ) {\n super(\"p:sldLayout\");\n this.layoutType = layoutType;\n\n const hasCustom =\n definition &&\n (definition.placeholders !== undefined ||\n (definition.children !== undefined && definition.children.length > 0));\n\n if (hasCustom) {\n // Custom layouts are not cached (may contain dynamic children)\n this.cacheKey = `custom:${layoutType}:${slideWidth}:${Date.now()}:${Math.random()}`;\n SlideLayout.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(buildCustomLayoutXml(definition!)),\n );\n } else {\n this.cacheKey = `${layoutType}:${slideWidth}`;\n if (!SlideLayout.cache.has(this.cacheKey)) {\n SlideLayout.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(buildLayoutXml(layoutType, slideWidth)),\n );\n }\n }\n }\n\n public prepForXml() {\n return SlideLayout.cache.get(this.cacheKey)!.prepForXml({ stack: [] });\n }\n}\n\nexport class DefaultSlideLayout extends SlideLayout {\n public constructor() {\n super(\"blank\");\n }\n}\n","import type { IBackgroundOptions } from \"@file/background/background\";\nimport type { IHeaderFooterOptions } from \"@file/header-footer/header-footer\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext } from \"@file/xml-components\";\nimport { ImportedXmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\n\nexport interface IMasterPlaceholderPosition {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\nexport interface IMasterPlaceholderOptions {\n readonly title?: boolean | IMasterPlaceholderPosition;\n readonly body?: boolean | IMasterPlaceholderPosition;\n readonly date?: boolean | IMasterPlaceholderPosition;\n readonly footer?: boolean | IMasterPlaceholderPosition;\n readonly slideNumber?: boolean | IMasterPlaceholderPosition;\n}\n\nexport interface ISlideMasterOptions {\n readonly background?: IBackgroundOptions;\n readonly children?: readonly BaseXmlComponent[];\n readonly placeholders?: IMasterPlaceholderOptions;\n}\n\n// Reference positions (16:9 master, slideWidth = 12192000 EMU)\nconst SW_REF = 12192000;\nconst sx = (refX: number, sw: number) => Math.round((refX * sw) / SW_REF);\n\nconst REF_TITLE = { x: 838200, y: 365125, cx: 10515600, cy: 1325563 };\nconst REF_BODY = { x: 838200, y: 1825625, cx: 10515600, cy: 4351338 };\nconst REF_DATE = { x: 838200, y: 6356350, cx: 2743200, cy: 365125 };\nconst REF_FOOTER = { x: 4038600, y: 6356350, cx: 4114800, cy: 365125 };\nconst REF_SLDNUM = { x: 8610600, y: 6356350, cx: 2743200, cy: 365125 };\n\nfunction toEmu(pos: IMasterPlaceholderPosition) {\n return {\n x: convertPixelsToEmu(pos.x),\n y: convertPixelsToEmu(pos.y),\n cx: convertPixelsToEmu(pos.width),\n cy: convertPixelsToEmu(pos.height),\n };\n}\n\nfunction resolvePos(\n opt: boolean | IMasterPlaceholderPosition | undefined,\n ref: { x: number; y: number; cx: number; cy: number },\n): { x: number; y: number; cx: number; cy: number } | null {\n if (opt === false) return null;\n if (opt === undefined || opt === true) return ref;\n return toEmu(opt);\n}\n\nfunction phSp(\n id: number,\n name: string,\n phAttrs: string,\n x: number,\n y: number,\n cx: number,\n cy: number,\n bodyContent: string,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"${name}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph ${phAttrs}/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody>${bodyContent}</p:txBody></p:sp>`;\n}\n\nconst BODY_DEFAULT = `<a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p>`;\n\nfunction footerBody(algn: string, fldType: string, fldId: string, fldText: string): string {\n const fld =\n fldType && fldId\n ? `<a:fld id=\"${fldId}\" type=\"${fldType}\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>${fldText}</a:t></a:fld>`\n : \"\";\n return `<a:bodyPr/><a:lstStyle><a:lvl1pPr algn=\"${algn}\"><a:defRPr sz=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p>${fld}<a:endParaRPr lang=\"en-US\"/></a:p>`;\n}\n\nfunction buildBackgroundXml(bg?: IBackgroundOptions): string {\n if (!bg) return `<p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef>`;\n const { Background } = require(\"@file/background/background\") as {\n Background: new (o?: IBackgroundOptions) => { prepForXml(ctx: IContext): unknown };\n };\n const bgObj = new Background(bg);\n const obj = bgObj.prepForXml({ stack: [] });\n if (!obj) return `<p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef>`;\n // Background prepForXml returns { \"p:bg\": [...] }, xml() wraps it in <p:bg>.\n // Strip the outer <p:bg> since the caller already provides the wrapper.\n const full = xml(obj);\n return full.replace(/^<p:bg[^>]*>/, \"\").replace(/<\\/p:bg>$/, \"\");\n}\n\nfunction buildChildrenXml(children?: readonly BaseXmlComponent[]): string {\n if (!children || children.length === 0) return \"\";\n const ctx: IContext = { stack: [] };\n let result = \"\";\n for (const child of children) {\n const obj = child.prepForXml(ctx);\n if (obj) result += xml(obj);\n }\n return result;\n}\n\nfunction buildSlideMasterXml(\n layoutCount: number,\n headerFooter?: IHeaderFooterOptions,\n masterOptions?: ISlideMasterOptions,\n slideWidth: number = SW_REF,\n masterIndex: number = 0,\n): string {\n const hfXml = headerFooter ? `<p:hf dt=\"0\" hdr=\"0\" ftr=\"0\" sldNum=\"0\"/>` : \"\";\n const ph = masterOptions?.placeholders ?? {};\n\n // Layout IDs must be globally unique across all masters.\n // Master ID = 2147483648 + masterIndex * 12; layouts start at masterId + 1.\n const layoutIdBase = 2147483648 + masterIndex * 12 + 1;\n const layoutIdEntries: string[] = [];\n for (let i = 0; i < layoutCount; i++) {\n layoutIdEntries.push(`<p:sldLayoutId id=\"${layoutIdBase + i}\" r:id=\"rId${i + 1}\"/>`);\n }\n\n // Scaled reference positions (x/cx scaled, y/cy fixed)\n const sRef = (r: { x: number; y: number; cx: number; cy: number }) => ({\n x: sx(r.x, slideWidth),\n y: r.y,\n cx: sx(r.cx, slideWidth),\n cy: r.cy,\n });\n\n // Build placeholders\n const shapes: string[] = [];\n let nextId = 2;\n\n const titlePos = resolvePos(ph.title, sRef(REF_TITLE));\n if (titlePos) {\n shapes.push(\n phSp(\n nextId++,\n \"Title Placeholder 1\",\n 'type=\"title\"',\n titlePos.x,\n titlePos.y,\n titlePos.cx,\n titlePos.cy,\n BODY_DEFAULT,\n ),\n );\n }\n\n const bodyPos = resolvePos(ph.body, sRef(REF_BODY));\n if (bodyPos) {\n shapes.push(\n phSp(\n nextId++,\n \"Text Placeholder 2\",\n 'type=\"body\" idx=\"1\"',\n bodyPos.x,\n bodyPos.y,\n bodyPos.cx,\n bodyPos.cy,\n BODY_DEFAULT,\n ),\n );\n }\n\n const datePos = resolvePos(ph.date, sRef(REF_DATE));\n if (datePos) {\n shapes.push(\n phSp(\n nextId++,\n \"Date Placeholder 3\",\n 'type=\"dt\" sz=\"half\" idx=\"2\"',\n datePos.x,\n datePos.y,\n datePos.cx,\n datePos.cy,\n footerBody(\n \"l\",\n \"datetimeFigureOut\",\n \"{5BCAD085-E8A6-8845-BD4E-CB4CCA059FC4}\",\n \"1/27/13\",\n ),\n ),\n );\n }\n\n const footerPos = resolvePos(ph.footer, sRef(REF_FOOTER));\n if (footerPos) {\n shapes.push(\n phSp(\n nextId++,\n \"Footer Placeholder 4\",\n 'type=\"ftr\" sz=\"quarter\" idx=\"3\"',\n footerPos.x,\n footerPos.y,\n footerPos.cx,\n footerPos.cy,\n footerBody(\"ctr\", \"\", \"\", \"\"),\n ),\n );\n }\n\n const sldNumPos = resolvePos(ph.slideNumber, sRef(REF_SLDNUM));\n if (sldNumPos) {\n shapes.push(\n phSp(\n nextId++,\n \"Slide Number Placeholder 5\",\n 'type=\"sldNum\" sz=\"quarter\" idx=\"4\"',\n sldNumPos.x,\n sldNumPos.y,\n sldNumPos.cx,\n sldNumPos.cy,\n footerBody(\"r\", \"slidenum\", \"{C1FF6DA9-008F-8B48-92A6-B652298478BF}\", \"‹#›\"),\n ),\n );\n }\n\n // Custom children shapes — shift ids to avoid conflicts with placeholder ids\n const childrenXml = buildChildrenXml(masterOptions?.children);\n if (childrenXml) {\n const offset = nextId - 1;\n shapes.push(childrenXml.replace(/ id=\"(\\d+)\"/g, (_, n) => ` id=\"${parseInt(n) + offset}\"`));\n }\n\n // Background\n const bgInnerXml = buildBackgroundXml(masterOptions?.background);\n\n return `<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:bg>${bgInnerXml}</p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>${shapes.join(\"\")}</p:spTree></p:cSld><p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/><p:sldLayoutIdLst>${layoutIdEntries.join(\"\")}</p:sldLayoutIdLst>${hfXml}<p:txStyles><p:titleStyle><a:lvl1pPr algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPct val=\"0\"/></a:spcBef><a:buNone/><a:defRPr sz=\"4400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mj-lt\"/><a:ea typeface=\"+mj-ea\"/><a:cs typeface=\"+mj-cs\"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr marL=\"228600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPct val=\"0\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"685800\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"1143000\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1600200\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"2057400\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2514600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2971800\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3429000\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3886200\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr/></a:defPPr><a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3657600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:otherStyle></p:txStyles></p:sldMaster>`;\n}\n\nexport class DefaultSlideMaster extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n private readonly cacheKey: string;\n\n public constructor(\n layoutCount: number = 1,\n headerFooter?: IHeaderFooterOptions,\n masterOptions?: ISlideMasterOptions,\n slideWidth: number = SW_REF,\n masterIndex: number = 0,\n ) {\n super(\"p:sldMaster\");\n this.cacheKey = `${layoutCount}:${headerFooter ? JSON.stringify(headerFooter) : \"\"}:${masterOptions ? JSON.stringify(masterOptions) : \"\"}:${slideWidth}:${masterIndex}`;\n if (!DefaultSlideMaster.cache.has(this.cacheKey)) {\n DefaultSlideMaster.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(\n buildSlideMasterXml(\n layoutCount,\n headerFooter,\n masterOptions,\n slideWidth,\n masterIndex,\n ),\n ),\n );\n }\n }\n\n public prepForXml() {\n return DefaultSlideMaster.cache.get(this.cacheKey)!.prepForXml({ stack: [] });\n }\n}\n","import { BuilderElement, StringContainer, XmlComponent } from \"@file/xml-components\";\n\nimport type {\n AnimationClass,\n AnimationType,\n EmphasisType,\n IAnimationOptions,\n PathAnimationType,\n} from \"./types\";\n\n// --- Preset ID mappings ---\n\nconst ENTR_PRESET_IDS: Record<AnimationType, number> = {\n appear: 1,\n fade: 10,\n fly: 2,\n wipe: 22,\n dissolve: 34,\n split: 21,\n blinds: 25,\n checker: 26,\n randomBars: 24,\n wheel: 27,\n zoom: 10,\n cover: 28,\n push: 19,\n strips: 23,\n};\n\nconst EXIT_PRESET_IDS: Record<AnimationType, number> = {\n appear: 53,\n fade: 59,\n fly: 51,\n wipe: 72,\n dissolve: 84,\n split: 71,\n blinds: 75,\n checker: 76,\n randomBars: 74,\n wheel: 77,\n zoom: 60,\n cover: 78,\n push: 69,\n strips: 73,\n};\n\nconst EMPH_PRESET_IDS: Record<EmphasisType, number> = {\n growShrink: 53,\n spin: 54,\n growWithTurn: 56,\n colorChange: 29,\n transparency: 57,\n boldFlash: 50,\n wave: 55,\n pulse: 58,\n};\n\nconst PATH_PRESET_IDS: Record<PathAnimationType, number> = {\n customPath: 200,\n arc: 201,\n bounce: 202,\n circle: 203,\n curve: 204,\n figureEight: 205,\n line: 206,\n loop: 207,\n};\n\nconst DIRECTION_SUBTYPES: Record<string, number> = {\n left: 4,\n right: 8,\n up: 2,\n down: 1,\n horizontal: 16,\n vertical: 32,\n};\n\nconst FILTER_MAP: Record<string, string> = {\n fade: \"fade\",\n fly: \"fly\",\n wipe: \"wipe\",\n dissolve: \"dissolve\",\n split: \"split\",\n blinds: \"blinds\",\n checker: \"checkerboard\",\n randomBars: \"randombars\",\n wheel: \"wheel\",\n zoom: \"zoom\",\n cover: \"cover\",\n push: \"push\",\n strips: \"strips\",\n};\n\nconst DIRECTION_FILTER: Record<string, Record<string, string>> = {\n fly: { left: \"fromLeft\", right: \"fromRight\", up: \"fromTop\", down: \"fromBottom\" },\n wipe: { left: \"right\", right: \"left\", up: \"down\", down: \"up\" },\n split: { horizontal: \"horizontal\", vertical: \"vertical\" },\n blinds: { horizontal: \"horizontal\", vertical: \"vertical\" },\n checker: { horizontal: \"horizontal\", vertical: \"vertical\" },\n randomBars: { horizontal: \"horizontal\", vertical: \"vertical\" },\n cover: { left: \"left\", right: \"right\", up: \"top\", down: \"bottom\" },\n push: { left: \"left\", right: \"right\", up: \"top\", down: \"bottom\" },\n strips: {\n left: \"fromBottomLeft\",\n right: \"fromTopRight\",\n up: \"fromBottomRight\",\n down: \"fromTopLeft\",\n },\n wheel: {},\n};\n\nconst PATH_STRINGS: Record<PathAnimationType, string> = {\n customPath: \"\",\n arc: \"M 0 0 C 50 -100 100 -100 150 0\",\n bounce: \"M 0 0 L 50 0 C 50 -30 30 -50 0 -50 C -30 -50 -50 -30 -50 0 L 50 0\",\n circle: \"M 0 0 C 50 -50 100 0 50 50 C 0 100 -50 50 0 0\",\n curve: \"M 0 0 C 50 -80 100 -80 150 0 C 200 80 250 80 300 0\",\n figureEight:\n \"M 0 0 C 50 -50 100 0 50 50 C 0 100 -50 50 0 0 C -50 -50 -100 0 -50 50 C 0 100 50 50 0 0\",\n line: \"M 0 0 L 200 0\",\n loop: \"M 0 0 C 50 -80 100 0 50 80 C 0 160 -50 80 0 0\",\n};\n\n// --- Helper functions ---\n\nfunction resolvePresetId(options: IAnimationOptions): number {\n if (options.mediaType) return 1;\n if (options.attributeName) return 0;\n const cls: AnimationClass = options.class ?? \"entr\";\n\n if (cls === \"emph\" && options.emphasisType) {\n return EMPH_PRESET_IDS[options.emphasisType] ?? 0;\n }\n\n if (options.pathType) {\n return PATH_PRESET_IDS[options.pathType] ?? 200;\n }\n\n const type = options.type ?? \"appear\";\n const map = cls === \"exit\" ? EXIT_PRESET_IDS : ENTR_PRESET_IDS;\n return map[type] ?? 0;\n}\n\nfunction resolvePresetClass(options: IAnimationOptions): AnimationClass {\n if (options.mediaType) return \"mediacall\";\n if (options.attributeName) return \"entr\";\n if (options.pathType) return \"emph\";\n return options.class ?? \"entr\";\n}\n\nfunction resolvePresetSubtype(options: IAnimationOptions): number {\n if (options.direction) {\n return DIRECTION_SUBTYPES[options.direction] ?? 0;\n }\n return 0;\n}\n\nfunction buildTargetElement(spid: number, options?: IAnimationOptions): XmlComponent {\n const spTgtChildren: XmlComponent[] = [];\n if (options?.charRange) {\n spTgtChildren.push(\n new BuilderElement({\n name: \"p:txEl\",\n children: [\n new BuilderElement({\n name: \"p:charRg\",\n attributes: {\n st: { key: \"st\", value: options.charRange[0] },\n end: { key: \"end\", value: options.charRange[1] },\n },\n }),\n ],\n }),\n );\n } else if (options?.paragraphRange) {\n spTgtChildren.push(\n new BuilderElement({\n name: \"p:txEl\",\n children: [\n new BuilderElement({\n name: \"p:pRg\",\n attributes: {\n st: { key: \"st\", value: options.paragraphRange[0] },\n end: { key: \"end\", value: options.paragraphRange[1] },\n },\n }),\n ],\n }),\n );\n }\n\n return new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n children: spTgtChildren.length > 0 ? spTgtChildren : undefined,\n }),\n ],\n });\n}\n\nfunction buildEntrOrExitEffects(\n options: IAnimationOptions,\n spid: number,\n ids: { set: number; effect: number },\n): XmlComponent[] {\n const children: XmlComponent[] = [];\n\n // p:set — make shape visible (entr) or hidden (exit)\n const cls = options.class ?? \"entr\";\n const visibility = cls === \"exit\" ? \"hidden\" : \"visible\";\n children.push(\n new BuilderElement({\n name: \"p:set\",\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.set },\n dur: { key: \"dur\", value: \"1\" },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: { delay: { key: \"delay\", value: \"0\" } },\n }),\n ],\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:attrNameLst\",\n children: [new StringContainer(\"p:attrName\", \"style.visibility\")],\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:to\",\n children: [\n new BuilderElement({\n name: \"p:strVal\",\n attributes: { val: { key: \"val\", value: visibility } },\n }),\n ],\n }),\n ],\n }),\n );\n\n // p:animEffect for non-appear types\n if (options.type !== \"appear\") {\n const filterBase = FILTER_MAP[options.type ?? \"fade\"];\n const dirMap = DIRECTION_FILTER[options.type ?? \"fade\"];\n const dirFilter = options.direction && dirMap ? dirMap[options.direction] : undefined;\n\n let filter = filterBase;\n if (options.type === \"wheel\") {\n filter = \"wheel(4)\";\n } else if (options.type === \"split\") {\n const dir = options.direction ?? \"horizontal\";\n filter = `split(${dir})`;\n } else if (dirFilter) {\n filter = `${filterBase}(${dirFilter})`;\n }\n\n const transition = cls === \"exit\" ? \"out\" : \"in\";\n\n children.push(\n new BuilderElement({\n name: \"p:animEffect\",\n attributes: {\n transition: { key: \"transition\", value: transition },\n filter: { key: \"filter\", value: filter },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: String(options.duration ?? 500) },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n }\n\n return children;\n}\n\nfunction buildEmphasisEffects(\n options: IAnimationOptions,\n spid: number,\n ids: { set: number; effect: number },\n): XmlComponent[] {\n const emphType = options.emphasisType ?? \"growShrink\";\n const children: XmlComponent[] = [];\n const dur = String(options.duration ?? 500);\n\n // Common target element\n const tgtEl = new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n }),\n ],\n });\n\n switch (emphType) {\n case \"growShrink\":\n children.push(\n new BuilderElement({\n name: \"p:animScale\",\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n ...(options.autoReverse\n ? { autoRev: { key: \"autoRev\", value: 1 } }\n : {}),\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"0\" },\n },\n }),\n ],\n }),\n ],\n }),\n tgtEl,\n ],\n }),\n new BuilderElement({\n name: \"p:by\",\n attributes: {\n x: { key: \"x\", value: \"150000\" },\n y: { key: \"y\", value: \"150000\" },\n },\n }),\n ],\n }),\n );\n break;\n\n case \"spin\":\n children.push(\n new BuilderElement({\n name: \"p:animRot\",\n attributes: { by: { key: \"by\", value: \"3600000\" } },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"0\" },\n },\n }),\n ],\n }),\n ],\n }),\n tgtEl,\n ],\n }),\n ],\n }),\n );\n break;\n\n case \"colorChange\": {\n const color = options.color ?? \"FF0000\";\n children.push(\n new BuilderElement({\n name: \"p:animClr\",\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"0\" },\n },\n }),\n ],\n }),\n ],\n }),\n tgtEl,\n ],\n }),\n new BuilderElement({\n name: \"p:to\",\n children: [\n new BuilderElement({\n name: \"a:srgbClr\",\n attributes: { val: { key: \"val\", value: color } },\n }),\n ],\n }),\n ],\n }),\n );\n break;\n }\n\n case \"transparency\":\n children.push(\n new BuilderElement({\n name: \"p:anim\",\n attributes: {\n calcmode: { key: \"calcmode\", value: \"lin\" },\n valueType: { key: \"valueType\", value: \"num\" },\n from: { key: \"from\", value: \"0\" },\n to: { key: \"to\", value: \"1\" },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n tgtEl,\n new BuilderElement({\n name: \"p:attrNameLst\",\n children: [new StringContainer(\"p:attrName\", \"style.opacity\")],\n }),\n ],\n }),\n ],\n }),\n );\n break;\n\n default:\n // boldFlash, wave, pulse, growWithTurn — use p:animEffect with emph filter\n children.push(\n new BuilderElement({\n name: \"p:animEffect\",\n attributes: {\n transition: { key: \"transition\", value: \"in\" },\n filter: { key: \"filter\", value: emphType },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n tgtEl,\n ],\n }),\n ],\n }),\n );\n break;\n }\n\n return children;\n}\n\nfunction buildPathEffects(\n options: IAnimationOptions,\n spid: number,\n ids: { set: number; effect: number },\n): XmlComponent[] {\n const pathStr = options.path ?? PATH_STRINGS[options.pathType ?? \"customPath\"] ?? \"\";\n const dur = String(options.duration ?? 1000);\n\n return [\n new BuilderElement({\n name: \"p:animMotion\",\n attributes: {\n origin: { key: \"origin\", value: \"layout\" },\n path: { key: \"path\", value: pathStr },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: { delay: { key: \"delay\", value: \"0\" } },\n }),\n ],\n }),\n ],\n }),\n buildTargetElement(spid, options),\n ],\n }),\n ],\n }),\n ];\n}\n\n/**\n * Build p:cmd for media play/pause/stop (goes inside the animation sequence).\n * PowerPoint uses p:cmd type=\"call\" cmd=\"playFrom(0.0)\" for video play.\n */\nfunction buildMediaPlayCommand(\n options: IAnimationOptions,\n spid: number,\n ids: { cmd: number },\n): XmlComponent {\n const cmdStr = options.fullScreen ? \"playFrom(0.0,1.0)\" : \"playFrom(0.0)\";\n\n return new BuilderElement({\n name: \"p:cmd\",\n attributes: {\n type: { key: \"type\", value: \"call\" },\n cmd: { key: \"cmd\", value: cmdStr },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.cmd },\n dur: { key: \"dur\", value: String(options.duration ?? 10000) },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n buildTargetElement(spid),\n ],\n }),\n ],\n });\n}\n\n/**\n * Build p:video/p:audio with p:cMediaNode (goes as sibling of p:seq).\n * This is the media state controller, separate from the play command.\n */\nfunction buildMediaStateNode(\n options: IAnimationOptions,\n spid: number,\n ids: { mediaCtn: number },\n): XmlComponent {\n const isVideo = options.mediaType === \"playVideo\";\n const elementName = isVideo ? \"p:video\" : \"p:audio\";\n\n const mediaAttrs: Record<string, { key: string; value: string | number | boolean }> = {};\n if (!isVideo && options.isNarration) {\n mediaAttrs.isNarration = { key: \"isNarration\", value: true };\n }\n if (isVideo && options.fullScreen) {\n mediaAttrs.fullScrn = { key: \"fullScrn\", value: true };\n }\n\n const cMediaNodeAttrs: Record<string, { key: string; value: string | number }> = {};\n if (options.volume !== undefined) {\n cMediaNodeAttrs.vol = { key: \"vol\", value: options.volume * 1000 };\n } else {\n cMediaNodeAttrs.vol = { key: \"vol\", value: 80000 };\n }\n if (options.mute) {\n cMediaNodeAttrs.mute = { key: \"mute\", value: 1 };\n }\n\n return new BuilderElement({\n name: elementName,\n attributes: Object.keys(mediaAttrs).length > 0 ? mediaAttrs : undefined,\n children: [\n new BuilderElement({\n name: \"p:cMediaNode\",\n attributes: cMediaNodeAttrs,\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.mediaCtn },\n fill: { key: \"fill\", value: \"hold\" },\n display: { key: \"display\", value: \"0\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"indefinite\" },\n },\n }),\n ],\n }),\n ],\n }),\n buildTargetElement(spid),\n ],\n }),\n ],\n });\n}\n\nfunction buildPropertyAnimation(\n options: IAnimationOptions,\n spid: number,\n ids: { cBhvr: number },\n): XmlComponent {\n const attrs: Record<string, { key: string; value: string }> = {};\n if (options.calcMode) attrs.calcmode = { key: \"calcmode\", value: options.calcMode };\n if (options.valueType) attrs.valueType = { key: \"valueType\", value: options.valueType };\n if (options.from !== undefined) attrs.from = { key: \"from\", value: options.from };\n if (options.to !== undefined) attrs.to = { key: \"to\", value: options.to };\n if (options.animBy !== undefined) attrs.by = { key: \"by\", value: options.animBy };\n\n const cBhvrChildren: XmlComponent[] = [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.cBhvr },\n dur: { key: \"dur\", value: String(options.duration ?? 500) },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n buildTargetElement(spid, options),\n ];\n\n if (options.attributeName) {\n cBhvrChildren.push(\n new BuilderElement({\n name: \"p:attrNameLst\",\n children: [new StringContainer(\"p:attrName\", options.attributeName)],\n }),\n );\n }\n\n const animChildren: XmlComponent[] = [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: cBhvrChildren,\n }),\n ];\n\n // Build tavLst if from/to are specified\n if (options.from !== undefined || options.to !== undefined) {\n const tavList: XmlComponent[] = [];\n if (options.from !== undefined) {\n tavList.push(\n new BuilderElement({\n name: \"p:tav\",\n attributes: { tm: { key: \"tm\", value: \"0\" } },\n children: [\n new BuilderElement({\n name: \"p:val\",\n children: [\n new BuilderElement({\n name: \"p:strVal\",\n attributes: { val: { key: \"val\", value: options.from } },\n }),\n ],\n }),\n ],\n }),\n );\n }\n if (options.to !== undefined) {\n tavList.push(\n new BuilderElement({\n name: \"p:tav\",\n attributes: { tm: { key: \"tm\", value: \"100000\" } },\n children: [\n new BuilderElement({\n name: \"p:val\",\n children: [\n new BuilderElement({\n name: \"p:strVal\",\n attributes: { val: { key: \"val\", value: options.to } },\n }),\n ],\n }),\n ],\n }),\n );\n }\n if (tavList.length > 0) {\n animChildren.push(\n new BuilderElement({\n name: \"p:tavLst\",\n children: tavList,\n }),\n );\n }\n }\n\n return new BuilderElement({\n name: \"p:anim\",\n attributes: Object.keys(attrs).length > 0 ? attrs : undefined,\n children: animChildren,\n });\n}\n\n// --- Main class ---\n\ninterface IAnimationEntry {\n readonly spid: number;\n readonly options: IAnimationOptions;\n}\n\n/**\n * p:timing — Slide timing for shape animations.\n */\nexport class SlideTiming extends XmlComponent {\n public constructor(entries: readonly IAnimationEntry[]) {\n super(\"p:timing\");\n\n if (entries.length === 0) return;\n\n let id = 1;\n const rootCtnId = id++;\n const seqCtnId = id++;\n\n const animationNodes: XmlComponent[] = [];\n const mediaStateNodes: XmlComponent[] = [];\n let clickGroupDelay = 0;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n const { spid, options } = entry;\n\n const nodeType =\n options.trigger === \"withPrevious\"\n ? \"withEffect\"\n : options.trigger === \"afterPrevious\"\n ? \"afterEffect\"\n : \"clickEffect\";\n\n if (options.trigger === \"afterPrevious\" && i > 0) {\n clickGroupDelay += (options.duration ?? 500) + (options.delay ?? 0);\n }\n if (options.trigger === \"onClick\" || options.trigger === undefined) {\n clickGroupDelay = 0;\n }\n\n const groupCtnId = id++;\n const effectCtnId = id++;\n const setCtnId = id++;\n const effectCtnId2 = id++;\n\n const presetId = resolvePresetId(options);\n const presetClass = resolvePresetClass(options);\n const presetSubtype = resolvePresetSubtype(options);\n\n // Build effect children based on animation class\n let effectChildren: XmlComponent[];\n\n if (options.mediaType) {\n effectChildren = [buildMediaPlayCommand(options, spid, { cmd: effectCtnId2 })];\n // Generate media state node (p:video/p:audio) as sibling of p:seq\n const mediaStateId = id++;\n mediaStateNodes.push(\n buildMediaStateNode(options, spid, { mediaCtn: mediaStateId }),\n );\n } else if (options.attributeName) {\n effectChildren = [buildPropertyAnimation(options, spid, { cBhvr: effectCtnId2 })];\n } else if (options.pathType) {\n effectChildren = buildPathEffects(options, spid, {\n set: setCtnId,\n effect: effectCtnId2,\n });\n } else if (presetClass === \"emph\") {\n effectChildren = buildEmphasisEffects(options, spid, {\n set: setCtnId,\n effect: effectCtnId2,\n });\n } else {\n effectChildren = buildEntrOrExitEffects(options, spid, {\n set: setCtnId,\n effect: effectCtnId2,\n });\n }\n\n // Build cTn attributes with optional speed/repeatCount/autoReverse\n const cTnAttrs: Record<string, { key: string; value: string | number }> = {\n id: { key: \"id\", value: effectCtnId },\n fill: { key: \"fill\", value: \"hold\" },\n nodeType: { key: \"nodeType\", value: nodeType },\n };\n if (!options.mediaType && !options.attributeName) {\n cTnAttrs.presetID = { key: \"presetID\", value: presetId };\n cTnAttrs.presetClass = { key: \"presetClass\", value: presetClass };\n cTnAttrs.presetSubtype = { key: \"presetSubtype\", value: presetSubtype };\n }\n if (options.mediaType) {\n cTnAttrs.presetID = { key: \"presetID\", value: presetId };\n cTnAttrs.presetClass = { key: \"presetClass\", value: presetClass };\n cTnAttrs.presetSubtype = { key: \"presetSubtype\", value: presetSubtype };\n }\n if (options.speed !== undefined)\n cTnAttrs.spd = { key: \"spd\", value: String(options.speed) };\n if (options.repeatCount !== undefined)\n cTnAttrs.repeatCount = { key: \"repeatCount\", value: String(options.repeatCount) };\n if (options.autoReverse) cTnAttrs.autoRev = { key: \"autoRev\", value: 1 };\n\n // Build effect cTn\n const effectCtn = new BuilderElement({\n name: \"p:cTn\",\n attributes: cTnAttrs,\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: String(options.delay ?? 0) },\n },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:childTnLst\",\n children: effectChildren,\n }),\n ],\n });\n\n // Wrap in inner par\n const innerPar = new BuilderElement({\n name: \"p:par\",\n children: [effectCtn],\n });\n\n // Wrap in outer par (click group)\n const outerPar = new BuilderElement({\n name: \"p:par\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: groupCtnId },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: { delay: { key: \"delay\", value: \"0\" } },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:childTnLst\",\n children: [innerPar],\n }),\n ],\n }),\n ],\n });\n\n animationNodes.push(outerPar);\n }\n\n // Assemble the full timing tree\n this.root.push(\n new BuilderElement({\n name: \"p:tnLst\",\n children: [\n new BuilderElement({\n name: \"p:par\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: rootCtnId },\n dur: { key: \"dur\", value: \"indefinite\" },\n restart: { key: \"restart\", value: \"never\" },\n nodeType: { key: \"nodeType\", value: \"tmRoot\" },\n },\n children: [\n new BuilderElement({\n name: \"p:childTnLst\",\n children: [\n new BuilderElement({\n name: \"p:seq\",\n attributes: {\n concurrent: { key: \"concurrent\", value: 1 },\n nextAc: { key: \"nextAc\", value: \"seek\" },\n },\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: seqCtnId },\n dur: {\n key: \"dur\",\n value: \"indefinite\",\n },\n nodeType: {\n key: \"nodeType\",\n value: \"mainSeq\",\n },\n },\n children: [\n new BuilderElement({\n name: \"p:childTnLst\",\n children: animationNodes,\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:prevCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n evt: {\n key: \"evt\",\n value: \"onPrev\",\n },\n delay: {\n key: \"delay\",\n value: \"0\",\n },\n },\n children: [\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:sldTgt\",\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:nextCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n evt: {\n key: \"evt\",\n value: \"onNext\",\n },\n delay: {\n key: \"delay\",\n value: \"0\",\n },\n },\n children: [\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:sldTgt\",\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n ...mediaStateNodes,\n ],\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport {\n createTransform2D,\n type Transform2DOptions as CoreTransform2DOptions,\n} from \"@office-open/core/drawingml\";\n\nexport type ITransform2DOptions = CoreTransform2DOptions;\n\n/**\n * a:xfrm / p:xfrm — 2D transform for shapes and graphic frames (position + size in EMUs).\n * Delegates to core createTransform2D.\n */\nexport class Transform2D extends XmlComponent {\n private readonly core: XmlComponent;\n\n public constructor(options: ITransform2DOptions, prefix: \"a\" | \"p\" = \"a\") {\n super(`${prefix}:xfrm`);\n this.core = createTransform2D(options, `${prefix}:xfrm`);\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n return this.core[\"prepForXml\"]?.(context);\n }\n}\n","import type { IAnimationOptions } from \"@file/animation/types\";\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { Transform2D } from \"@file/drawingml/transform-2d\";\nimport type { File } from \"@file/file\";\nimport type { IMediaData } from \"@file/media/data\";\nimport { BuilderElement, type IContext, XmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nconst MEDIA_EXT_URI = \"{CF1602FD-DB20-4165-A070-5F299619DA56}\";\n\nexport type AudioType = \"mp3\" | \"wav\" | \"wma\" | \"aac\";\n\nexport interface IAudioFrameOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly data: Uint8Array;\n readonly type: AudioType;\n readonly name?: string;\n readonly animation?: IAnimationOptions;\n}\n\n/**\n * p:pic — An audio frame on a slide.\n *\n * Uses a media relationship for the audio file (via {media:fileName} placeholder).\n */\nexport class AudioFrame extends XmlComponent {\n private static nextId = 200;\n private readonly audioData: IMediaData;\n private readonly shapeId: number;\n private readonly animationOptions?: IAnimationOptions;\n\n public constructor(options: IAudioFrameOptions) {\n super(\"p:pic\");\n\n const id = AudioFrame.nextId++;\n this.shapeId = id;\n this.animationOptions = options.animation;\n const name = options.name ?? `Audio ${id}`;\n const mediaFileName = `${name.replace(/\\s+/g, \"_\")}.${options.type}`;\n\n this.audioData = {\n type: options.type,\n fileName: mediaFileName,\n transformation: {\n pixels: { x: options.width ?? 0, y: options.height ?? 0 },\n emus: {\n x: convertPixelsToEmu(options.width ?? 0),\n y: convertPixelsToEmu(options.height ?? 0),\n },\n },\n data: options.data,\n };\n\n // p:nvPicPr with p14:media extension\n this.root.push(\n new BuilderElement({\n name: \"p:nvPicPr\",\n children: [\n new BuilderElement({\n name: \"a:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n descr: { key: \"descr\", value: \"\" },\n },\n }),\n new BuilderElement({\n name: \"a:cNvPicPr\",\n children: [\n new BuilderElement({\n name: \"a:picLocks\",\n attributes: {\n noChangeAspect: { key: \"noChangeAspect\", value: \"1\" },\n },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: [\n new BuilderElement({\n name: \"p:extLst\",\n children: [\n new BuilderElement({\n name: \"p:ext\",\n attributes: { uri: { key: \"uri\", value: MEDIA_EXT_URI } },\n children: [\n new BuilderElement({\n name: \"p14:media\",\n attributes: {\n \"r:embed\": {\n key: \"r:embed\",\n value: `{media:${mediaFileName}}`,\n },\n \"xmlns:p14\": {\n key: \"xmlns:p14\",\n value: \"http://schemas.microsoft.com/office/powerpoint/2010/main\",\n },\n },\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n\n // p:blipFill — empty (no poster for audio, PowerPoint provides default icon)\n this.root.push(\n new BuilderElement({\n name: \"p:blipFill\",\n children: [\n new BuilderElement({\n name: \"a:stretch\",\n children: [new BuilderElement({ name: \"a:fillRect\" })],\n }),\n ],\n }),\n );\n\n // p:spPr\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new Transform2D({\n x: convertPixelsToEmu(options.x ?? 0),\n y: convertPixelsToEmu(options.y ?? 0),\n width: convertPixelsToEmu(options.width ?? 0),\n height: convertPixelsToEmu(options.height ?? 0),\n }),\n new PresetGeometry({ preset: \"rect\" }),\n ],\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n\n public get Animation(): IAnimationOptions | undefined {\n return this.animationOptions;\n }\n\n public override prepForXml(context: IContext) {\n (context.fileData as File)?.Media.addMedia(this.audioData.fileName, this.audioData);\n return super.prepForXml(context);\n }\n}\n","import type { IAnimationOptions } from \"@file/animation/types\";\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { Transform2D } from \"@file/drawingml/transform-2d\";\nimport type { File } from \"@file/file\";\nimport type { IMediaData } from \"@file/media/data\";\nimport { BuilderElement, type IContext, XmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nconst MEDIA_EXT_URI = \"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}\";\n\n/** Minimal 1x1 transparent PNG (67 bytes). */\nconst MINIMAL_PNG = new Uint8Array([\n 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0,\n 0, 0, 31, 21, 196, 137, 0, 0, 0, 13, 73, 68, 65, 84, 8, 215, 99, 24, 5, 163, 0, 0, 0, 2, 0, 1,\n 226, 33, 188, 51, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130,\n]);\n\nexport type VideoType = \"mp4\" | \"mov\" | \"wmv\" | \"avi\";\nexport type PosterType = \"png\" | \"jpg\";\n\nexport interface IVideoFrameOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly data: Uint8Array;\n readonly type: VideoType;\n readonly name?: string;\n readonly poster?: Uint8Array;\n readonly posterType?: PosterType;\n readonly animation?: IAnimationOptions;\n}\n\n/**\n * p:pic — A video frame on a slide.\n *\n * Uses three relationships:\n * - Image relationship for poster frame (via {posterFileName} placeholder)\n * - Video relationship for video file (via {video:fileName} placeholder in a:videoFile r:link)\n * - Media relationship for video file (via {media:fileName} placeholder in p14:media r:embed)\n */\nexport class VideoFrame extends XmlComponent {\n private static nextId = 100;\n private readonly posterData: IMediaData;\n private readonly videoData: IMediaData;\n private readonly shapeId: number;\n private readonly animationOptions?: IAnimationOptions;\n\n public constructor(options: IVideoFrameOptions) {\n super(\"p:pic\");\n\n const id = VideoFrame.nextId++;\n this.shapeId = id;\n this.animationOptions = options.animation;\n const name = options.name ?? `Video ${id}`;\n const mediaFileName = `${name.replace(/\\s+/g, \"_\")}.${options.type}`;\n const posterBytes = options.poster ?? MINIMAL_PNG;\n const posterType = options.posterType ?? \"png\";\n const posterFileName = `${name.replace(/\\s+/g, \"_\")}_poster.${posterType}`;\n\n this.videoData = {\n type: options.type,\n fileName: mediaFileName,\n transformation: {\n pixels: { x: options.width ?? 0, y: options.height ?? 0 },\n emus: {\n x: convertPixelsToEmu(options.width ?? 0),\n y: convertPixelsToEmu(options.height ?? 0),\n },\n },\n data: options.data,\n };\n\n this.posterData = {\n type: posterType === \"jpg\" ? \"jpg\" : \"png\",\n fileName: posterFileName,\n transformation: {\n pixels: { x: options.width ?? 0, y: options.height ?? 0 },\n emus: {\n x: convertPixelsToEmu(options.width ?? 0),\n y: convertPixelsToEmu(options.height ?? 0),\n },\n },\n data: posterBytes,\n };\n\n // p:nvPicPr with a:videoFile + p14:media\n const nvPrChildren: BuilderElement[] = [\n new BuilderElement({\n name: \"a:videoFile\",\n attributes: {\n \"r:link\": { key: \"r:link\", value: `{video:${mediaFileName}}` },\n },\n }),\n new BuilderElement({\n name: \"p:extLst\",\n children: [\n new BuilderElement({\n name: \"p:ext\",\n attributes: { uri: { key: \"uri\", value: MEDIA_EXT_URI } },\n children: [\n new BuilderElement({\n name: \"p14:media\",\n attributes: {\n \"r:embed\": {\n key: \"r:embed\",\n value: `{media:${mediaFileName}}`,\n },\n \"xmlns:p14\": {\n key: \"xmlns:p14\",\n value: \"http://schemas.microsoft.com/office/powerpoint/2010/main\",\n },\n },\n }),\n ],\n }),\n ],\n }),\n ];\n\n this.root.push(\n new BuilderElement({\n name: \"p:nvPicPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n descr: { key: \"descr\", value: \"\" },\n },\n }),\n new BuilderElement({\n name: \"p:cNvPicPr\",\n children: [\n new BuilderElement({\n name: \"a:picLocks\",\n attributes: {\n noChangeAspect: { key: \"noChangeAspect\", value: \"1\" },\n },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: nvPrChildren,\n }),\n ],\n }),\n );\n\n // p:blipFill with poster image (required by PowerPoint)\n this.root.push(\n new BuilderElement({\n name: \"p:blipFill\",\n children: [\n new BuilderElement({\n name: \"a:blip\",\n attributes: {\n \"r:embed\": { key: \"r:embed\", value: `{${posterFileName}}` },\n },\n }),\n new BuilderElement({\n name: \"a:stretch\",\n children: [new BuilderElement({ name: \"a:fillRect\" })],\n }),\n ],\n }),\n );\n\n // p:spPr\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new Transform2D({\n x: convertPixelsToEmu(options.x ?? 0),\n y: convertPixelsToEmu(options.y ?? 0),\n width: convertPixelsToEmu(options.width ?? 0),\n height: convertPixelsToEmu(options.height ?? 0),\n }),\n new PresetGeometry({ preset: \"rect\" }),\n ],\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n\n public get Animation(): IAnimationOptions | undefined {\n return this.animationOptions;\n }\n\n public override prepForXml(context: IContext) {\n const file = context.fileData as File;\n file?.Media.addImage(this.posterData.fileName, this.posterData);\n file?.Media.addMedia(this.videoData.fileName, this.videoData);\n return super.prepForXml(context);\n }\n}\n","import {\n createOutline,\n PresetDash,\n LineEndType,\n LineEndWidth,\n LineEndLength,\n} from \"@office-open/core/drawingml\";\nimport type {\n OutlineOptions as CoreOutlineOptions,\n LineEndOptions as CoreLineEndOptions,\n} from \"@office-open/core/drawingml\";\n\n/**\n * PPTX-specific outline options (backward-compatible API).\n */\nexport interface OutlineOptions {\n readonly width?: number;\n readonly color?: string;\n readonly dashStyle?: \"solid\" | \"dash\" | \"dashDot\" | \"lgDash\" | \"sysDot\" | \"sysDash\";\n}\n\nexport type { CoreOutlineOptions as OutlineOptionsCore };\n\nconst DASH_STYLE_MAP: Record<string, keyof typeof PresetDash> = {\n solid: \"SOLID\",\n dash: \"DASH\",\n dashDot: \"DASH_DOT\",\n lgDash: \"LG_DASH\",\n sysDot: \"SYS_DOT\",\n sysDash: \"SYS_DASH\",\n};\n\nconst ARROWHEAD_MAP: Record<string, keyof typeof LineEndType> = {\n triangle: \"TRIANGLE\",\n stealth: \"STEALTH\",\n diamond: \"DIAMOND\",\n oval: \"OVAL\",\n open: \"ARROW\",\n};\n\nconst ARROWHEAD_SIZE_MAP: Record<string, keyof typeof LineEndWidth> = {\n sm: \"SMALL\",\n med: \"MEDIUM\",\n lg: \"LARGE\",\n};\n\nfunction toCoreLineEnd(type: string, width?: string, length?: string): CoreLineEndOptions {\n return {\n type: ARROWHEAD_MAP[type] ?? \"TRIANGLE\",\n ...(width ? { width: ARROWHEAD_SIZE_MAP[width] as keyof typeof LineEndWidth } : {}),\n ...(length ? { length: ARROWHEAD_SIZE_MAP[length] as keyof typeof LineEndLength } : {}),\n };\n}\n\n/**\n * Creates an outline element using pptx's simplified API.\n */\nexport const createOutlineCompat = (\n options: OutlineOptions = {},\n arrowheads?: {\n readonly beginType?: string;\n readonly endType?: string;\n readonly width?: string;\n readonly length?: string;\n },\n) =>\n createOutline({\n width: options.width,\n ...(options.color\n ? { type: \"solidFill\" as const, color: { value: options.color.replace(\"#\", \"\") } }\n : { type: \"noFill\" as const }),\n ...(options.dashStyle && {\n dash: DASH_STYLE_MAP[options.dashStyle] ?? \"SOLID\",\n }),\n ...(arrowheads?.endType\n ? { headEnd: toCoreLineEnd(arrowheads.endType, arrowheads.width, arrowheads.length) }\n : {}),\n ...(arrowheads?.beginType\n ? { tailEnd: toCoreLineEnd(arrowheads.beginType, arrowheads.width, arrowheads.length) }\n : {}),\n } satisfies CoreOutlineOptions);\n","import type { File } from \"@file/file\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { createPptxEffectList, buildScene3D, buildShape3D, type IEffectsOptions } from \"./effects\";\nimport { buildFill, extractBlipFillMedia } from \"./fill\";\nimport type { FillOptions } from \"./fill\";\nimport { createOutlineCompat } from \"./outline\";\nimport type { OutlineOptions } from \"./outline\";\nimport { PresetGeometry } from \"./preset-geometry\";\nimport { Transform2D } from \"./transform-2d\";\n\nexport interface IConnectionSiteOptions {\n readonly x: number;\n readonly y: number;\n readonly angle?: number;\n}\n\nexport interface IShapePropertiesOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly flipHorizontal?: boolean;\n readonly rotation?: number;\n readonly geometry?: string;\n readonly fill?: FillOptions;\n readonly outline?: OutlineOptions;\n readonly effects?: IEffectsOptions;\n readonly connectionSites?: readonly IConnectionSiteOptions[];\n}\n\n/**\n * p:spPr — Shape properties (transform, geometry, fill, outline, effects).\n * Lazy: stores options, builds XML object directly in prepForXml.\n */\nexport class ShapeProperties extends BaseXmlComponent {\n private readonly options: IShapePropertiesOptions;\n\n public constructor(options: IShapePropertiesOptions) {\n super(\"p:spPr\");\n this.options = options;\n }\n\n public prepForXml(context: IContext<File>): IXmlableObject | undefined {\n const opts = this.options;\n const children: IXmlableObject[] = [];\n\n // Transform2D\n if (\n opts.x !== undefined ||\n opts.y !== undefined ||\n opts.width !== undefined ||\n opts.height !== undefined ||\n opts.flipHorizontal !== undefined ||\n opts.rotation !== undefined\n ) {\n const xfrmObj = new Transform2D(opts).prepForXml(context);\n if (xfrmObj) children.push(xfrmObj);\n }\n\n // PresetGeometry\n const geomObj = new PresetGeometry({ preset: opts.geometry ?? \"rect\" }).prepForXml(context);\n if (geomObj) children.push(geomObj);\n\n // Fill (register blipFill media — B-level side effect)\n const media = opts.fill ? extractBlipFillMedia(opts.fill) : undefined;\n if (media) {\n context.fileData?.Media.addImage(media.fileName, {\n data: media.data,\n fileName: media.fileName,\n type: media.type as \"png\",\n transformation: { pixels: { x: 0, y: 0 }, emus: { x: 0, y: 0 } },\n });\n }\n\n const fillComponent = buildFill(opts.fill !== undefined ? opts.fill : { type: \"none\" });\n const fillObj = fillComponent.prepForXml(context);\n if (fillObj) children.push(fillObj);\n\n // Outline\n if (opts.outline) {\n const outlineObj = createOutlineCompat(opts.outline).prepForXml(context);\n if (outlineObj) children.push(outlineObj);\n }\n\n // Effects\n if (opts.effects) {\n const effectObj = createPptxEffectList(opts.effects);\n if (effectObj) {\n const effectXmlObj = effectObj.prepForXml(context);\n if (effectXmlObj) children.push(effectXmlObj);\n }\n\n const scene3d = buildScene3D(opts.effects);\n if (scene3d) {\n const sceneObj = scene3d.prepForXml(context);\n if (sceneObj) children.push(sceneObj);\n }\n\n const shape3d = buildShape3D(opts.effects);\n if (shape3d) {\n const shapeObj = shape3d.prepForXml(context);\n if (shapeObj) children.push(shapeObj);\n }\n }\n\n // Connection sites\n if (opts.connectionSites && opts.connectionSites.length > 0) {\n const cxnChildren: IXmlableObject[] = [];\n for (const site of opts.connectionSites) {\n const siteAttrs: Record<string, string | number> = { pos: `${site.x} ${site.y}` };\n if (site.angle !== undefined) siteAttrs.ang = site.angle;\n cxnChildren.push({ \"a:cxn\": { _attr: siteAttrs } });\n }\n children.push({ \"a:cxnLst\": cxnChildren });\n }\n\n return { \"p:spPr\": children };\n }\n}\n","import type { IAnimationOptions } from \"@file/animation/types\";\nimport type { IEffectsOptions } from \"@file/drawingml/effects\";\nimport type { OutlineOptions } from \"@file/drawingml/outline\";\nimport { ShapeProperties } from \"@file/drawingml/shape-properties\";\nimport type { IShapePropertiesOptions } from \"@file/drawingml/shape-properties\";\nimport type { File } from \"@file/file\";\nimport { XmlComponent as Xc } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { attrs, escapeXml, xml } from \"@office-open/xml\";\n\nimport { Paragraph } from \"./paragraph/paragraph\";\nimport { TextBody } from \"./text-body\";\nimport type { ITextBodyOptions } from \"./text-body\";\n\nexport interface IShapeOptions {\n readonly id?: number;\n readonly name?: string;\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly geometry?: string;\n readonly fill?: IShapePropertiesOptions[\"fill\"];\n readonly outline?: OutlineOptions;\n readonly effects?: IEffectsOptions;\n readonly flipHorizontal?: boolean;\n readonly rotation?: number;\n readonly text?: string;\n readonly paragraphs?: ITextBodyOptions[\"paragraphs\"];\n readonly textVertical?: ITextBodyOptions[\"vertical\"];\n readonly textAnchor?: ITextBodyOptions[\"anchor\"];\n readonly textAutoFit?: ITextBodyOptions[\"autoFit\"];\n readonly textWrap?: ITextBodyOptions[\"wrap\"];\n readonly textMargins?: ITextBodyOptions[\"margins\"];\n readonly textColumns?: ITextBodyOptions[\"columns\"];\n readonly textColumnSpacing?: ITextBodyOptions[\"columnSpacing\"];\n readonly animation?: IAnimationOptions;\n readonly placeholder?: \"title\" | \"body\" | \"subTitle\" | \"sldNum\" | \"dt\" | \"ftr\" | \"hdr\" | \"obj\";\n readonly placeholderIndex?: number;\n}\n\n/**\n * Pure function: builds p:ph element for placeholder.\n */\nfunction buildPlaceholder(type: string, index?: number): IXmlableObject {\n const attrs: Record<string, string | number> = { type };\n if (index !== undefined) attrs.idx = index;\n return { \"p:ph\": { _attr: attrs } };\n}\n\n/**\n * p:sp — A shape on a slide.\n * Lazy: stores options, builds XML object in prepForXml.\n *\n * x/y/width/height accept pixel values and are internally converted to EMUs.\n */\nexport class Shape extends Xc {\n private static nextId = 2;\n private readonly shapeId: number;\n private readonly animationOptions?: IAnimationOptions;\n private readonly options: IShapeOptions;\n\n public constructor(options: IShapeOptions = {}) {\n super(\"p:sp\");\n\n const id = options.id ?? Shape.nextId++;\n this.shapeId = id;\n this.animationOptions = options.animation;\n this.options = { ...options, id };\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n\n public get Animation(): IAnimationOptions | undefined {\n return this.animationOptions;\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n const opts = this.options;\n const id = this.shapeId;\n const name = opts.name ?? `Shape ${id}`;\n const children: IXmlableObject[] = [];\n\n // nvSpPr\n const nvPrChildren: IXmlableObject[] = [];\n if (opts.placeholder) {\n nvPrChildren.push(buildPlaceholder(opts.placeholder, opts.placeholderIndex));\n }\n children.push({\n \"p:nvSpPr\": [\n { \"p:cNvPr\": { _attr: { id, name } } },\n { \"p:cNvSpPr\": {} },\n { \"p:nvPr\": nvPrChildren.length > 0 ? nvPrChildren : {} },\n ],\n });\n\n // spPr (ShapeProperties)\n const shapeProps: IShapePropertiesOptions = {\n x: opts.x !== undefined ? convertPixelsToEmu(opts.x) : undefined,\n y: opts.y !== undefined ? convertPixelsToEmu(opts.y) : undefined,\n width: opts.width !== undefined ? convertPixelsToEmu(opts.width) : undefined,\n height: opts.height !== undefined ? convertPixelsToEmu(opts.height) : undefined,\n geometry: opts.geometry,\n fill: opts.fill,\n outline: opts.outline,\n effects: opts.effects,\n flipHorizontal: opts.flipHorizontal,\n rotation: opts.rotation,\n };\n const spPr = new ShapeProperties(shapeProps);\n const spPrObj = spPr.prepForXml(context as IContext<File>);\n if (spPrObj) children.push(spPrObj);\n\n // txBody (TextBody)\n const textBodyOptions: ITextBodyOptions = {\n paragraphs:\n opts.paragraphs ?? (opts.text ? [new Paragraph({ text: opts.text })] : undefined),\n vertical: opts.textVertical,\n anchor: opts.textAnchor,\n autoFit: opts.textAutoFit,\n wrap: opts.textWrap,\n margins: opts.textMargins,\n columns: opts.textColumns,\n columnSpacing: opts.textColumnSpacing,\n };\n const txBody = new TextBody(textBodyOptions);\n const txBodyObj = txBody.prepForXml(context);\n if (txBodyObj) children.push(txBodyObj);\n\n return { \"p:sp\": children };\n }\n\n public override toXml(context: IContext): string {\n const opts = this.options;\n const id = this.shapeId;\n const name = escapeXml(opts.name ?? `Shape ${id}`);\n\n let s = \"<p:sp><p:nvSpPr>\";\n s += `<p:cNvPr${attrs({ id, name })}/>`;\n s += \"<p:cNvSpPr/>\";\n\n if (opts.placeholder) {\n const phAttrs: Record<string, string | number | undefined> = { type: opts.placeholder };\n if (opts.placeholderIndex !== undefined) phAttrs.idx = opts.placeholderIndex;\n s += `<p:nvPr><p:ph${attrs(phAttrs)}/></p:nvPr>`;\n } else {\n s += \"<p:nvPr/>\";\n }\n s += \"</p:nvSpPr>\";\n\n // spPr — use prepForXml + xml (ShapeProperties not yet converted)\n const spPr = new ShapeProperties({\n x: opts.x !== undefined ? convertPixelsToEmu(opts.x) : undefined,\n y: opts.y !== undefined ? convertPixelsToEmu(opts.y) : undefined,\n width: opts.width !== undefined ? convertPixelsToEmu(opts.width) : undefined,\n height: opts.height !== undefined ? convertPixelsToEmu(opts.height) : undefined,\n geometry: opts.geometry,\n fill: opts.fill,\n outline: opts.outline,\n effects: opts.effects,\n flipHorizontal: opts.flipHorizontal,\n rotation: opts.rotation,\n });\n const spPrObj = spPr.prepForXml(context as IContext<File>);\n if (spPrObj) {\n s += xml(spPrObj);\n }\n\n // txBody\n const txBodyOpts: ITextBodyOptions = {\n paragraphs:\n opts.paragraphs ?? (opts.text ? [new Paragraph({ text: opts.text })] : undefined),\n vertical: opts.textVertical,\n anchor: opts.textAnchor,\n autoFit: opts.textAutoFit,\n wrap: opts.textWrap,\n margins: opts.textMargins,\n columns: opts.textColumns,\n columnSpacing: opts.textColumnSpacing,\n };\n s += new TextBody(txBodyOpts).toXml(context);\n\n s += \"</p:sp>\";\n return s;\n }\n}\n","import type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\n\nconst ORIENT_TYPES = new Set([\"blinds\", \"checker\", \"comb\", \"randomBar\"]);\n\nconst SIDE_DIR_TYPES = new Set([\"push\", \"wipe\"]);\n\nconst EIGHT_DIR_TYPES = new Set([\"cover\", \"pull\"]);\n\nexport type TransitionType =\n | \"fade\"\n | \"push\"\n | \"wipe\"\n | \"split\"\n | \"blinds\"\n | \"checker\"\n | \"comb\"\n | \"randomBar\"\n | \"cover\"\n | \"pull\"\n | \"strips\"\n | \"wheel\"\n | \"zoom\"\n | \"circle\"\n | \"dissolve\"\n | \"diamond\"\n | \"newsflash\"\n | \"plus\"\n | \"wedge\"\n | \"random\"\n | \"cut\";\n\nexport interface ITransitionOptions {\n readonly type?: TransitionType;\n readonly speed?: \"slow\" | \"med\" | \"fast\";\n readonly advanceOnClick?: boolean;\n readonly advanceAfterTime?: number;\n readonly dir?: string;\n readonly orient?: \"horz\" | \"vert\";\n readonly thruBlk?: boolean;\n readonly spokes?: number;\n}\n\nfunction buildTransitionElement(\n type: TransitionType,\n dir?: string,\n orient?: string,\n thruBlk?: boolean,\n spokes?: number,\n): IXmlableObject {\n const attrs: Record<string, string | number> = {};\n\n if (ORIENT_TYPES.has(type) && dir) {\n attrs.dir = dir;\n } else if (SIDE_DIR_TYPES.has(type) && dir) {\n attrs.dir = dir;\n } else if (EIGHT_DIR_TYPES.has(type) && dir) {\n attrs.dir = dir;\n } else if (type === \"strips\" && dir) {\n attrs.dir = dir;\n } else if ((type === \"fade\" || type === \"cut\") && thruBlk !== undefined) {\n attrs.thruBlk = thruBlk ? 1 : 0;\n } else if (type === \"split\") {\n attrs.orient = orient ?? \"horz\";\n attrs.dir = dir ?? \"out\";\n } else if (type === \"wheel\") {\n attrs.spokes = spokes ?? 4;\n } else if (type === \"zoom\" && dir) {\n attrs.dir = dir;\n }\n\n return { [`p:${type}`]: Object.keys(attrs).length > 0 ? { _attr: attrs } : {} };\n}\n\nexport function buildTransition(options: ITransitionOptions): IXmlableObject {\n const children: IXmlableObject[] = [];\n const attrs: Record<string, string | number> = {};\n if (options.speed) attrs.spd = options.speed;\n if (options.advanceOnClick !== undefined) attrs.advClick = options.advanceOnClick ? 1 : 0;\n if (options.advanceAfterTime !== undefined) attrs.advTm = options.advanceAfterTime;\n if (Object.keys(attrs).length > 0) children.push({ _attr: attrs });\n\n if (options.type) {\n children.push(\n buildTransitionElement(\n options.type,\n options.dir,\n options.orient,\n options.thruBlk,\n options.spokes,\n ),\n );\n }\n\n return { \"p:transition\": children.length === 0 ? {} : children };\n}\n\n/**\n * p:transition — Slide transition effect.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class Transition extends BaseXmlComponent {\n private readonly options: ITransitionOptions;\n\n public constructor(options: ITransitionOptions = {}) {\n super(\"p:transition\");\n this.options = options;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n return buildTransition(this.options);\n }\n}\n","import { SlideTiming } from \"@file/animation/timing\";\nimport type { IAnimationOptions } from \"@file/animation/types\";\nimport type { Background } from \"@file/background/background\";\nimport type { IHeaderFooterOptions } from \"@file/header-footer/header-footer\";\nimport { AudioFrame } from \"@file/media/audio-frame\";\nimport { VideoFrame } from \"@file/media/video-frame\";\nimport { Shape } from \"@file/shape/shape\";\nimport type { ITransitionOptions } from \"@file/transition/transition\";\nimport { buildTransition } from \"@file/transition/transition\";\nimport { BaseXmlComponent, XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { xml } from \"@office-open/xml\";\n\nconst NV_GRP_SP_PR = '<p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr>';\n\nconst GRP_SP_PR =\n '<p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>';\n\nconst CLR_MAP_OVR = \"<p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr>\";\n\nconst XMLNS =\n ' xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"';\n\nfunction collectAnimations(children: readonly BaseXmlComponent[]): Array<{\n readonly spid: number;\n readonly options: IAnimationOptions;\n}> {\n const entries: Array<{ readonly spid: number; readonly options: IAnimationOptions }> = [];\n for (const child of children) {\n let anim: IAnimationOptions | undefined;\n let spid: number | undefined;\n if (child instanceof Shape) {\n anim = child.Animation;\n spid = child.ShapeId;\n } else if (child instanceof VideoFrame) {\n anim = child.Animation;\n spid = child.ShapeId;\n } else if (child instanceof AudioFrame) {\n anim = child.Animation;\n spid = child.ShapeId;\n }\n if (anim && spid !== undefined) {\n entries.push({ spid, options: anim });\n }\n }\n return entries;\n}\n\n/**\n * p:sld — A slide in a presentation.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class Slide extends XmlComponent {\n private readonly children: readonly BaseXmlComponent[];\n private readonly background?: Background;\n private readonly transition?: ITransitionOptions;\n public readonly HeaderFooter?: IHeaderFooterOptions;\n\n public constructor(\n children: readonly BaseXmlComponent[],\n background?: Background,\n transition?: ITransitionOptions,\n headerFooter?: IHeaderFooterOptions,\n ) {\n super(\"p:sld\");\n this.children = children;\n this.background = background;\n this.transition = transition;\n this.HeaderFooter = headerFooter;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const children: IXmlableObject[] = [];\n\n // xmlns attributes\n children.push({\n _attr: {\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:p\": \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n });\n\n // p:cSld — common slide data (background + shape tree)\n const cSldChildren: IXmlableObject[] = [];\n if (this.background) {\n const bgObj = this.background.prepForXml(context);\n if (bgObj) cSldChildren.push(bgObj);\n }\n\n // p:spTree — shape tree\n const spTreeChildren: IXmlableObject[] = [\n {\n \"p:nvGrpSpPr\": [\n { \"p:cNvPr\": { _attr: { id: 1, name: \"\" } } },\n { \"p:cNvGrpSpPr\": {} },\n { \"p:nvPr\": {} },\n ],\n },\n {\n \"p:grpSpPr\": {\n \"a:xfrm\": [\n { \"a:off\": { _attr: { x: 0, y: 0 } } },\n { \"a:ext\": { _attr: { cx: 0, cy: 0 } } },\n { \"a:chOff\": { _attr: { x: 0, y: 0 } } },\n { \"a:chExt\": { _attr: { cx: 0, cy: 0 } } },\n ],\n },\n },\n ];\n for (const child of this.children) {\n const obj = child.prepForXml(context);\n if (obj) spTreeChildren.push(obj);\n }\n cSldChildren.push({ \"p:spTree\": spTreeChildren });\n\n children.push({ \"p:cSld\": cSldChildren });\n\n // p:clrMapOvr\n children.push({ \"p:clrMapOvr\": [{ \"a:masterClrMapping\": {} }] });\n\n // p:transition (optional)\n if (this.transition) {\n const transObj = buildTransition(this.transition);\n if (transObj) children.push(transObj);\n }\n\n // p:timing (animation)\n const animations = collectAnimations(this.children);\n if (animations.length > 0) {\n const timing = new SlideTiming(animations);\n const timingObj = timing.prepForXml(context);\n if (timingObj) children.push(timingObj);\n }\n\n return { \"p:sld\": children };\n }\n\n public toXml(context: IContext): string {\n let s = `<p:sld${XMLNS}>`;\n\n // p:cSld\n s += \"<p:cSld>\";\n if (this.background) {\n const bgObj = this.background.prepForXml(context);\n if (bgObj) s += xml(bgObj);\n }\n\n // p:spTree\n s += \"<p:spTree>\";\n s += NV_GRP_SP_PR;\n s += GRP_SP_PR;\n for (const child of this.children) {\n if (typeof (child as unknown as { toXml?: Function }).toXml === \"function\") {\n s += (child as unknown as { toXml(ctx: IContext): string }).toXml(context);\n } else {\n const obj = child.prepForXml(context);\n if (obj) s += xml(obj);\n }\n }\n s += \"</p:spTree></p:cSld>\";\n\n s += CLR_MAP_OVR;\n\n if (this.transition) {\n const transObj = buildTransition(this.transition);\n if (transObj) s += xml(transObj);\n }\n\n const animations = collectAnimations(this.children);\n if (animations.length > 0) {\n const timing = new SlideTiming(animations);\n const timingObj = timing.prepForXml(context);\n if (timingObj) s += xml(timingObj);\n }\n\n s += \"</p:sld>\";\n return s;\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nconst TABLE_STYLES_XML = `<a:tblStyleLst xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\"/>`;\n\nexport class TableStyles extends ImportedXmlComponent {\n private static instance = ImportedXmlComponent.fromXmlString(TABLE_STYLES_XML);\n\n public constructor() {\n super(\"a:tblStyleLst\");\n }\n\n public prepForXml() {\n return TableStyles.instance.prepForXml({ stack: [] });\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\ninterface IColorSchemeOptions {\n dark1?: string;\n light1?: string;\n dark2?: string;\n light2?: string;\n accent1?: string;\n accent2?: string;\n accent3?: string;\n accent4?: string;\n accent5?: string;\n accent6?: string;\n hyperlink?: string;\n followedHyperlink?: string;\n}\n\ninterface IFontSchemeOptions {\n majorFont?: string;\n minorFont?: string;\n majorFontAsian?: string;\n minorFontAsian?: string;\n}\n\nexport interface IThemeOptions {\n name?: string;\n colors?: IColorSchemeOptions;\n fonts?: IFontSchemeOptions;\n}\n\nconst DEFAULT_COLORS: Required<IColorSchemeOptions> = {\n dark1: \"000000\",\n light1: \"FFFFFF\",\n dark2: \"44546A\",\n light2: \"E7E6E6\",\n accent1: \"4472C4\",\n accent2: \"ED7D31\",\n accent3: \"A5A5A5\",\n accent4: \"FFC000\",\n accent5: \"5B9BD5\",\n accent6: \"70AD47\",\n hyperlink: \"0563C1\",\n followedHyperlink: \"954F72\",\n};\n\nfunction buildThemeXml(options?: IThemeOptions): string {\n const name = options?.name ?? \"Office Theme\";\n const c = { ...DEFAULT_COLORS, ...options?.colors };\n const f = options?.fonts;\n\n const majorFont = f?.majorFont ?? \"Calibri Light\";\n const minorFont = f?.minorFont ?? \"Calibri\";\n const majorFontAsian = f?.majorFontAsian ?? \"\";\n const minorFontAsian = f?.minorFontAsian ?? \"\";\n\n // dk1/lt1 use sysClr in Office theme; srgbClr override when customized\n const dk1 =\n options?.colors?.dark1 !== undefined\n ? `<a:srgbClr val=\"${c.dark1}\"/>`\n : `<a:sysClr val=\"windowText\" lastClr=\"000000\"/>`;\n const lt1 =\n options?.colors?.light1 !== undefined\n ? `<a:srgbClr val=\"${c.light1}\"/>`\n : `<a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>`;\n\n return `<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"${name}\">\n <a:themeElements>\n <a:clrScheme name=\"${name}\">\n <a:dk1>${dk1}</a:dk1>\n <a:lt1>${lt1}</a:lt1>\n <a:dk2><a:srgbClr val=\"${c.dark2}\"/></a:dk2>\n <a:lt2><a:srgbClr val=\"${c.light2}\"/></a:lt2>\n <a:accent1><a:srgbClr val=\"${c.accent1}\"/></a:accent1>\n <a:accent2><a:srgbClr val=\"${c.accent2}\"/></a:accent2>\n <a:accent3><a:srgbClr val=\"${c.accent3}\"/></a:accent3>\n <a:accent4><a:srgbClr val=\"${c.accent4}\"/></a:accent4>\n <a:accent5><a:srgbClr val=\"${c.accent5}\"/></a:accent5>\n <a:accent6><a:srgbClr val=\"${c.accent6}\"/></a:accent6>\n <a:hlink><a:srgbClr val=\"${c.hyperlink}\"/></a:hlink>\n <a:folHlink><a:srgbClr val=\"${c.followedHyperlink}\"/></a:folHlink>\n </a:clrScheme>\n <a:fontScheme name=\"${name}\">\n <a:majorFont>\n <a:latin typeface=\"${majorFont}\"/>\n <a:ea typeface=\"${majorFontAsian}\"/>\n <a:cs typeface=\"\"/>\n </a:majorFont>\n <a:minorFont>\n <a:latin typeface=\"${minorFont}\"/>\n <a:ea typeface=\"${minorFontAsian}\"/>\n <a:cs typeface=\"\"/>\n </a:minorFont>\n </a:fontScheme>\n <a:fmtScheme name=\"Office\">\n <a:fillStyleLst>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n </a:fillStyleLst>\n <a:lnStyleLst>\n <a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln>\n <a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln>\n <a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln>\n </a:lnStyleLst>\n <a:effectStyleLst>\n <a:effectStyle><a:effectLst/></a:effectStyle>\n <a:effectStyle><a:effectLst/></a:effectStyle>\n <a:effectStyle><a:effectLst/></a:effectStyle>\n </a:effectStyleLst>\n <a:bgFillStyleLst>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n </a:bgFillStyleLst>\n </a:fmtScheme>\n </a:themeElements>\n <a:objectDefaults/>\n <a:extraClrSchemeLst/>\n</a:theme>`;\n}\n\nexport class DefaultTheme extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n private readonly cacheKey: string;\n\n public constructor(options?: IThemeOptions) {\n super(\"a:theme\");\n this.cacheKey = options ? JSON.stringify(options) : \"\";\n if (!DefaultTheme.cache.has(this.cacheKey)) {\n DefaultTheme.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(buildThemeXml(options)),\n );\n }\n }\n\n public prepForXml() {\n return DefaultTheme.cache.get(this.cacheKey)!.prepForXml({ stack: [] });\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nconst VIEW_PROPS_XML = `<p:viewPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\n <p:normalViewPr>\n <p:restoredLeft sz=\"14996\" autoAdjust=\"0\"/>\n <p:restoredTop sz=\"94660\"/>\n </p:normalViewPr>\n <p:slideViewPr>\n <p:cSldViewPr snapToGrid=\"0\">\n <p:cViewPr varScale=\"1\">\n <p:scale><a:sx n=\"90\" d=\"100\"/><a:sy n=\"90\" d=\"100\"/></p:scale>\n <p:origin x=\"1200\" y=\"72\"/>\n </p:cViewPr>\n <p:guideLst/>\n </p:cSldViewPr>\n </p:slideViewPr>\n <p:notesTextViewPr>\n <p:cViewPr>\n <p:scale><a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale>\n <p:origin x=\"0\" y=\"0\"/>\n </p:cViewPr>\n </p:notesTextViewPr>\n <p:gridSpacing cx=\"72008\" cy=\"72008\"/>\n</p:viewPr>`;\n\nexport class ViewProperties extends ImportedXmlComponent {\n private static instance = ImportedXmlComponent.fromXmlString(VIEW_PROPS_XML);\n\n public constructor() {\n super(\"p:viewPr\");\n }\n\n public prepForXml() {\n return ViewProperties.instance.prepForXml({ stack: [] });\n }\n}\n","import { AppProperties } from \"@file/app-properties/app-properties\";\nimport { Background, type IBackgroundOptions } from \"@file/background/background\";\nimport { ChartCollection } from \"@file/chart/chart-collection\";\nimport { CommentAuthorList } from \"@file/comment/comment-author-list\";\nimport type { AuthorEntry } from \"@file/comment/comment-author-list\";\nimport { SlideCommentList } from \"@file/comment/slide-comment-list\";\nimport { ContentTypes } from \"@file/content-types/content-types\";\nimport { CoreProperties, type ICorePropertiesOptions } from \"@file/core-properties/properties\";\nimport type { IHeaderFooterOptions } from \"@file/header-footer/header-footer\";\nimport { HyperlinkCollection } from \"@file/hyperlink-collection\";\nimport { Media } from \"@file/media/media\";\nimport { NotesSlide } from \"@file/notes/notes-slide\";\nimport { PresentationProperties } from \"@file/presentation-properties\";\nimport { PresentationWrapper } from \"@file/presentation/presentation-wrapper\";\nimport { Relationships } from \"@file/relationships/relationships\";\nimport { SlideLayout, type SlideLayoutType } from \"@file/slide-layout/slide-layout\";\nimport {\n DefaultSlideMaster,\n type IMasterPlaceholderPosition,\n type ISlideMasterOptions,\n} from \"@file/slide-master/slide-master\";\nimport { Slide } from \"@file/slide/slide\";\nimport { SmartArtCollection } from \"@file/smartart/smartart-collection\";\nimport { TableStyles } from \"@file/table-styles\";\nimport { DefaultTheme, type IThemeOptions } from \"@file/theme/theme\";\nimport type { ITransitionOptions } from \"@file/transition/transition\";\nimport { ViewProperties } from \"@file/view-properties\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\nimport type { RelationshipType } from \"@office-open/core\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\n// ── Public interfaces ──\n\nexport type SlideSize = \"16:9\" | \"4:3\" | { readonly width: number; readonly height: number };\n\nexport interface ILayoutPlaceholderOptions {\n readonly title?: IMasterPlaceholderPosition | false;\n readonly body?: IMasterPlaceholderPosition | false;\n readonly subtitle?: IMasterPlaceholderPosition | false;\n readonly date?: IMasterPlaceholderPosition | false;\n readonly footer?: IMasterPlaceholderPosition | false;\n readonly slideNumber?: IMasterPlaceholderPosition | false;\n}\n\nexport interface ILayoutDefinition {\n readonly type?: SlideLayoutType;\n readonly name?: string;\n readonly placeholders?: ILayoutPlaceholderOptions;\n readonly children?: readonly BaseXmlComponent[];\n}\n\nexport interface IMasterDefinition extends ISlideMasterOptions {\n readonly name?: string;\n readonly theme?: IThemeOptions;\n readonly layouts?: readonly ILayoutDefinition[];\n}\n\nexport interface ICommentOptions {\n readonly author: string;\n readonly text: string;\n readonly x: number;\n readonly y: number;\n readonly initials?: string;\n readonly date?: string;\n}\n\nexport interface ISlideOptions {\n readonly children?: readonly BaseXmlComponent[];\n readonly background?: IBackgroundOptions;\n readonly notes?: string;\n readonly transition?: ITransitionOptions;\n readonly headerFooter?: IHeaderFooterOptions;\n readonly comments?: readonly ICommentOptions[];\n readonly layout?: SlideLayoutType | string;\n readonly master?: string;\n}\n\nexport interface IShowOptions {\n readonly loop?: boolean;\n readonly kiosk?: boolean;\n readonly showNarration?: boolean;\n readonly useTimings?: boolean;\n}\n\nexport interface IPresentationOptions extends ICorePropertiesOptions {\n readonly size?: SlideSize;\n readonly masters?: readonly IMasterDefinition[];\n readonly slides?: readonly ISlideOptions[];\n readonly show?: IShowOptions;\n}\n\ninterface RelEntry {\n readonly id: number | string;\n readonly type: RelationshipType;\n readonly target: string;\n readonly mode?: string;\n}\n\nfunction buildRelationships(entries: readonly RelEntry[]): Relationships {\n const rels = new Relationships();\n for (const e of entries) {\n rels.addRelationship(e.id, e.type, e.target, e.mode as \"External\" | undefined);\n }\n return rels;\n}\n\nfunction deriveInitials(name: string): string {\n const parts = name.trim().split(/\\s+/);\n return parts.length >= 2\n ? (parts[0][0] + parts[parts.length - 1][0]).toUpperCase()\n : name.slice(0, 2).toUpperCase();\n}\n\nfunction resolveSlideSize(size?: SlideSize): { width: number; height: number } {\n if (!size || size === \"16:9\") return { width: 12192000, height: 6858000 };\n if (size === \"4:3\") return { width: 9144000, height: 6858000 };\n return { width: convertPixelsToEmu(size.width), height: convertPixelsToEmu(size.height) };\n}\n\ninterface LayoutInfo {\n readonly key: string;\n readonly index: number;\n readonly masterIndex: number;\n readonly layout: SlideLayout;\n}\n\ninterface MasterInfo {\n readonly name: string;\n readonly index: number;\n readonly definition: IMasterDefinition;\n readonly master: DefaultSlideMaster;\n readonly theme: DefaultTheme;\n readonly layouts: LayoutInfo[];\n readonly masterRels: Relationships;\n readonly layoutRels: Relationships[];\n}\n\nexport class File {\n private readonly slideOptions: readonly ISlideOptions[];\n private readonly corePropsOptions: ICorePropertiesOptions;\n private readonly showOptions?: IShowOptions;\n private readonly slideWidthEmus: number;\n private readonly slideHeightEmus: number;\n private readonly masterDefs: readonly IMasterDefinition[];\n\n // Lazy components\n private coreProperties?: CoreProperties;\n private appProperties?: AppProperties;\n private contentTypes?: ContentTypes;\n private media?: Media;\n private charts?: ChartCollection;\n private smartArts?: SmartArtCollection;\n private hyperlinks?: HyperlinkCollection;\n private presentationWrapper?: PresentationWrapper;\n private tableStyles?: TableStyles;\n private presProps?: PresentationProperties;\n private viewProps?: ViewProperties;\n private notesMasterRels?: Relationships;\n\n // Multi-master support\n private masterMap?: MasterInfo[];\n private allLayouts?: readonly LayoutInfo[];\n private allLayoutRels?: readonly Relationships[];\n\n // Lazy slide data\n private slides?: Slide[];\n private slideWrappers?: Array<{ readonly View: Slide; readonly Relationships: Relationships }>;\n private notesSlides?: NotesSlide[];\n private commentAuthorList?: CommentAuthorList;\n private slideCommentLists?: (SlideCommentList | undefined)[];\n\n // Lazy relationship data\n private fileRels?: Relationships;\n\n public constructor(options: IPresentationOptions) {\n this.slideOptions = options.slides ?? [];\n this.corePropsOptions = options;\n this.showOptions = options.show;\n this.masterDefs = options.masters ?? [];\n const sz = resolveSlideSize(options.size);\n this.slideWidthEmus = sz.width;\n this.slideHeightEmus = sz.height;\n }\n\n // ── Master / Layout resolution ──\n\n private getMasterMap(): MasterInfo[] {\n if (this.masterMap) return this.masterMap;\n\n const defs = this.masterDefs.length > 0 ? this.masterDefs : [{} as IMasterDefinition];\n const slideMasterLookup = new Map<number, number>();\n\n // Build slide → master index lookup\n for (let si = 0; si < this.slideOptions.length; si++) {\n const masterName = this.slideOptions[si].master;\n if (masterName === undefined) {\n slideMasterLookup.set(si, 0);\n continue;\n }\n const mi = defs.findIndex((d) => d.name === masterName);\n slideMasterLookup.set(si, mi >= 0 ? mi : 0);\n }\n\n let globalLayoutIndex = 0;\n const masters: MasterInfo[] = [];\n\n for (let mi = 0; mi < defs.length; mi++) {\n const def = defs[mi];\n const name = def.name ?? `master${mi + 1}`;\n\n // Collect layout types needed for this master\n const layoutDefs = def.layouts;\n let layoutKeys: readonly string[];\n if (layoutDefs && layoutDefs.length > 0) {\n layoutKeys = layoutDefs.map(\n (ld) => ld.type ?? ld.name ?? `layout${mi}_${layoutDefs.indexOf(ld)}`,\n );\n } else {\n // Auto-derive from slides referencing this master\n const seen = new Set<string>();\n const keys: string[] = [];\n for (let si = 0; si < this.slideOptions.length; si++) {\n if (slideMasterLookup.get(si) === mi) {\n const lt = this.slideOptions[si].layout ?? \"blank\";\n if (!seen.has(lt)) {\n seen.add(lt);\n keys.push(lt);\n }\n }\n }\n layoutKeys = keys.length > 0 ? keys : [\"blank\"];\n }\n\n const hf = this.slideOptions.find((s) => s.headerFooter)?.headerFooter;\n const master = new DefaultSlideMaster(\n layoutKeys.length,\n hf,\n def,\n this.slideWidthEmus,\n mi,\n );\n const theme = new DefaultTheme(def.theme);\n\n const layouts: LayoutInfo[] = [];\n const layoutRels: Relationships[] = [];\n\n for (let li = 0; li < layoutKeys.length; li++) {\n const key = layoutKeys[li];\n const layoutDef = layoutDefs?.[li];\n const slideLayoutType = (layoutDef?.type ?? key) as SlideLayoutType;\n layouts.push({\n key,\n index: globalLayoutIndex,\n masterIndex: mi,\n layout: new SlideLayout(slideLayoutType, this.slideWidthEmus, layoutDef),\n });\n layoutRels.push(\n buildRelationships([\n {\n id: 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\",\n target: `../slideMasters/slideMaster${mi + 1}.xml`,\n },\n ]),\n );\n globalLayoutIndex++;\n }\n\n // Master rels: layouts + theme\n const masterRelsEntries: RelEntry[] = [];\n for (let li = 0; li < layouts.length; li++) {\n masterRelsEntries.push({\n id: li + 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\",\n target: `../slideLayouts/slideLayout${layouts[li].index + 1}.xml`,\n });\n }\n masterRelsEntries.push({\n id: layouts.length + 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n target: `../theme/theme${mi + 1}.xml`,\n });\n\n masters.push({\n name,\n index: mi,\n definition: def,\n master,\n theme,\n layouts,\n masterRels: buildRelationships(masterRelsEntries),\n layoutRels,\n });\n }\n\n this.masterMap = masters;\n this.allLayouts = masters.flatMap((m) => m.layouts);\n this.allLayoutRels = masters.flatMap((m) => m.layoutRels);\n return this.masterMap;\n }\n\n private findLayoutForSlide(slideIndex: number): LayoutInfo {\n const opts = this.slideOptions[slideIndex];\n const masters = this.getMasterMap();\n const mi =\n opts.master !== undefined\n ? Math.max(\n 0,\n masters.findIndex((m) => m.name === opts.master),\n )\n : 0;\n const master = masters[mi];\n const layoutKey = opts.layout ?? \"blank\";\n const li = master.layouts.find((l) => l.key === layoutKey);\n return li ?? master.layouts[0];\n }\n\n // ── Lazy getters ──\n\n public get CoreProperties(): CoreProperties {\n return (this.coreProperties ??= new CoreProperties(this.corePropsOptions));\n }\n\n public get AppProperties(): AppProperties {\n return (this.appProperties ??= new AppProperties());\n }\n\n public get ContentTypes(): ContentTypes {\n if (!this.contentTypes) {\n this.contentTypes = new ContentTypes();\n let hasComments = false;\n for (let i = 0; i < this.slideOptions.length; i++) {\n this.contentTypes.addSlide(i + 1);\n if (this.slideOptions[i].notes) {\n this.contentTypes.addNotesSlide(i + 1);\n }\n if (this.slideOptions[i].comments && this.slideOptions[i].comments!.length > 0) {\n this.contentTypes.addComments(i + 1);\n hasComments = true;\n }\n }\n if (hasComments) {\n this.contentTypes.addCommentAuthors();\n }\n }\n return this.contentTypes;\n }\n\n public get FileRelationships(): Relationships {\n if (!this.fileRels) {\n this.fileRels = buildRelationships([\n {\n id: 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n target: \"ppt/presentation.xml\",\n },\n {\n id: 2,\n type: \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n target: \"docProps/core.xml\",\n },\n {\n id: 3,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n target: \"docProps/app.xml\",\n },\n ]);\n }\n return this.fileRels;\n }\n\n public get Media(): Media {\n return (this.media ??= new Media());\n }\n\n public get Charts(): ChartCollection {\n return (this.charts ??= new ChartCollection());\n }\n\n public get SmartArts(): SmartArtCollection {\n return (this.smartArts ??= new SmartArtCollection());\n }\n\n public get Hyperlinks(): HyperlinkCollection {\n return (this.hyperlinks ??= new HyperlinkCollection());\n }\n\n public get PresentationWrapper(): PresentationWrapper {\n if (!this.presentationWrapper) {\n const masters = this.getMasterMap();\n this.presentationWrapper = new PresentationWrapper({\n slideWidth: this.slideWidthEmus,\n slideHeight: this.slideHeightEmus,\n slideIds: this.slideOptions.map((_, i) => 256 + i),\n masterCount: masters.length,\n });\n const presRels = this.PresentationWrapper.Relationships;\n let rid = 1;\n // Masters\n for (let mi = 0; mi < masters.length; mi++) {\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\",\n `slideMasters/slideMaster${mi + 1}.xml`,\n );\n }\n // Slides\n for (let i = 0; i < this.slideOptions.length; i++) {\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\",\n `slides/slide${i + 1}.xml`,\n );\n }\n // Static parts\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\",\n \"presProps.xml\",\n );\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\",\n \"viewProps.xml\",\n );\n for (let mi = 0; mi < masters.length; mi++) {\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n `theme/theme${mi + 1}.xml`,\n );\n }\n presRels.addRelationship(\n rid,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\",\n \"tableStyles.xml\",\n );\n }\n return this.presentationWrapper;\n }\n\n public get Themes(): readonly DefaultTheme[] {\n return this.getMasterMap().map((m) => m.theme);\n }\n\n public get TableStyles(): TableStyles {\n return (this.tableStyles ??= new TableStyles());\n }\n\n public get PresProps(): PresentationProperties {\n return (this.presProps ??= new PresentationProperties(this.showOptions));\n }\n\n public get ViewProps(): ViewProperties {\n return (this.viewProps ??= new ViewProperties());\n }\n\n public get SlideMasters(): readonly DefaultSlideMaster[] {\n return this.getMasterMap().map((m) => m.master);\n }\n\n public get SlideMasterRelsArray(): readonly Relationships[] {\n return this.getMasterMap().map((m) => m.masterRels);\n }\n\n public get AllLayouts(): readonly LayoutInfo[] {\n this.getMasterMap();\n return this.allLayouts!;\n }\n\n public get AllLayoutRelsArray(): readonly Relationships[] {\n this.getMasterMap();\n return this.allLayoutRels!;\n }\n\n public get Slides(): readonly Slide[] {\n if (!this.slides) {\n this.slides = [];\n for (const s of this.slideOptions) {\n this.slides.push(\n new Slide(\n s.children ?? [],\n s.background ? new Background(s.background) : undefined,\n s.transition,\n s.headerFooter,\n ),\n );\n }\n }\n return this.slides;\n }\n\n public get SlideWrappers(): Array<{\n readonly View: Slide;\n readonly Relationships: Relationships;\n }> {\n if (!this.slideWrappers) {\n this.slideWrappers = [];\n for (let i = 0; i < this.slideOptions.length; i++) {\n const layout = this.findLayoutForSlide(i);\n this.slideWrappers.push({\n View: this.Slides[i],\n Relationships: buildRelationships([\n {\n id: 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\",\n target: `../slideLayouts/slideLayout${layout.index + 1}.xml`,\n },\n ]),\n });\n }\n }\n return this.slideWrappers;\n }\n\n public get NotesSlides(): readonly NotesSlide[] {\n if (!this.notesSlides) {\n this.notesSlides = [];\n for (let i = 0; i < this.slideOptions.length; i++) {\n if (this.slideOptions[i].notes) {\n this.notesSlides.push(new NotesSlide({ text: this.slideOptions[i].notes }));\n }\n }\n }\n return this.notesSlides;\n }\n\n public get NotesMasterRelationships(): Relationships {\n return (this.notesMasterRels ??= new Relationships());\n }\n\n public get CommentAuthorList(): CommentAuthorList | undefined {\n if (!this.commentAuthorList && !this.slideCommentLists) {\n this.buildComments();\n }\n return this.commentAuthorList;\n }\n\n public get SlideCommentLists(): readonly (SlideCommentList | undefined)[] {\n if (!this.slideCommentLists) {\n this.buildComments();\n }\n return this.slideCommentLists!;\n }\n\n private buildComments(): void {\n const authorMap = new Map<\n string,\n { id: number; name: string; initials: string; clrIdx: number; commentCount: number }\n >();\n let nextAuthorId = 0;\n\n this.slideCommentLists = Array.from<SlideCommentList | undefined>({\n length: this.slideOptions.length,\n });\n\n for (let i = 0; i < this.slideOptions.length; i++) {\n const slideComments = this.slideOptions[i].comments;\n if (!slideComments || slideComments.length === 0) continue;\n\n const commentEntries: Array<{\n readonly authorId: number;\n readonly idx: number;\n readonly date?: string;\n readonly x: number;\n readonly y: number;\n readonly text: string;\n }> = [];\n\n for (const c of slideComments) {\n let author = authorMap.get(c.author);\n if (!author) {\n const id = nextAuthorId++;\n author = {\n id,\n name: c.author,\n initials: c.initials || deriveInitials(c.author),\n clrIdx: id,\n commentCount: 0,\n };\n authorMap.set(c.author, author);\n }\n author.commentCount++;\n\n commentEntries.push({\n authorId: author.id,\n idx: author.commentCount,\n date: c.date,\n x: c.x,\n y: c.y,\n text: c.text,\n });\n }\n\n this.slideCommentLists[i] = new SlideCommentList(commentEntries);\n }\n\n if (authorMap.size > 0) {\n const authors: AuthorEntry[] = [...authorMap.values()].map((a) => ({\n id: a.id,\n name: a.name,\n initials: a.initials,\n clrIdx: a.clrIdx,\n lastIdx: a.commentCount,\n }));\n this.commentAuthorList = new CommentAuthorList(authors);\n }\n }\n}\n","import { StringContainer } from \"@file/xml-components\";\n\n/**\n * a:t — Text content within a run.\n */\nexport class Text extends StringContainer {\n public constructor(value: string) {\n super(\"a:t\", value);\n }\n}\n","import {\n NextAttributeComponent,\n BuilderElement,\n StringContainer,\n XmlComponent,\n} from \"@file/xml-components\";\n\n/**\n * a:fld — A field element for dynamic content in slide text.\n *\n * Used in slide master placeholders for slide numbers, dates, etc.\n */\nexport class Field extends XmlComponent {\n public constructor(fieldType: string, displayText: string) {\n super(\"a:fld\");\n\n this.root.push(\n new NextAttributeComponent({\n id: { key: \"id\", value: `{${crypto.randomUUID()}}` },\n type: { key: \"type\", value: fieldType },\n }),\n );\n\n this.root.push(\n new BuilderElement({\n name: \"a:rPr\",\n attributes: {\n lang: { key: \"lang\", value: \"en-US\" },\n smtClean: { key: \"smtClean\", value: 0 },\n },\n }),\n );\n\n this.root.push(new StringContainer(\"a:t\", displayText));\n }\n}\n\n/**\n * Slide number field — outputs current slide number.\n */\nexport class SlideNumberField extends Field {\n public constructor(displayText = \"<#>\") {\n super(\"slidenum\", displayText);\n }\n}\n\n/**\n * Date/time field — outputs formatted date.\n */\nexport class DateTimeField extends Field {\n public constructor(displayText?: string, format?: string) {\n super(format ?? \"datetimeFigureOut\", displayText ?? \"\");\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport { createBlip, Stretch } from \"@office-open/core/drawingml\";\n\n/**\n * a:blipFill — Image fill with stretch mode.\n * Uses core createBlip for the blip element.\n */\nexport class BlipFill extends XmlComponent {\n public constructor(fileName: string) {\n super(\"a:blipFill\");\n this.root.push(createBlip({ referenceId: fileName }));\n this.root.push(new Stretch());\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\n\n/**\n * a:cNvPr — Non-visual drawing properties (id, name).\n */\nexport class NonVisualDrawingProperties extends BuilderElement<{\n readonly id: number;\n readonly name: string;\n}> {\n public constructor(id: number, name: string) {\n super({\n name: \"a:cNvPr\",\n attributes: { id: { key: \"id\", value: id }, name: { key: \"name\", value: name } },\n });\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\n/**\n * p:cNvSpPr — Non-visual shape properties.\n * Uses p: prefix in PresentationML context.\n */\nexport class NonVisualShapeProperties extends XmlComponent {\n public constructor() {\n super(\"p:cNvSpPr\");\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\n/**\n * a:cNvPicPr — Non-visual picture drawing properties.\n * Uses a: prefix (DrawingML type) but referenced via p:cNvPicPr in PML context.\n */\nexport class NonVisualPictureProperties extends XmlComponent {\n public constructor() {\n super(\"a:cNvPicPr\");\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nexport interface IGroupShapeOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly rotation?: number;\n readonly flipHorizontal?: boolean;\n readonly children: readonly BaseXmlComponent[];\n}\n\n/**\n * p:grpSp — Group shape containing child shapes.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class GroupShape extends BaseXmlComponent {\n private static nextId = 100;\n private readonly id: number;\n private readonly options: IGroupShapeOptions;\n\n public constructor(options: IGroupShapeOptions) {\n super(\"p:grpSp\");\n this.id = GroupShape.nextId++;\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const opts = this.options;\n const id = this.id;\n const name = `Group ${id}`;\n const children: IXmlableObject[] = [];\n\n // p:nvGrpSpPr\n children.push({\n \"p:nvGrpSpPr\": [\n { \"p:cNvPr\": { _attr: { id, name } } },\n { \"p:cNvGrpSpPr\": {} },\n { \"p:nvPr\": {} },\n ],\n });\n\n // p:grpSpPr\n const xfrmChildren: IXmlableObject[] = [];\n const xfrmAttrs: Record<string, string | number> = {};\n if (opts.flipHorizontal !== undefined) xfrmAttrs.flipH = opts.flipHorizontal ? 1 : 0;\n if (opts.rotation !== undefined) xfrmAttrs.rot = opts.rotation;\n if (Object.keys(xfrmAttrs).length > 0) xfrmChildren.push({ _attr: xfrmAttrs });\n xfrmChildren.push({\n \"a:off\": {\n _attr: {\n x: opts.x !== undefined ? convertPixelsToEmu(opts.x) : 0,\n y: opts.y !== undefined ? convertPixelsToEmu(opts.y) : 0,\n },\n },\n });\n xfrmChildren.push({\n \"a:ext\": {\n _attr: {\n cx: opts.width !== undefined ? convertPixelsToEmu(opts.width) : 0,\n cy: opts.height !== undefined ? convertPixelsToEmu(opts.height) : 0,\n },\n },\n });\n xfrmChildren.push({ \"a:chOff\": { _attr: { x: 0, y: 0 } } });\n xfrmChildren.push({ \"a:chExt\": { _attr: { cx: 0, cy: 0 } } });\n children.push({ \"p:grpSpPr\": { \"a:xfrm\": xfrmChildren } });\n\n // Child shapes — direct children of p:grpSp (after nvGrpSpPr and grpSpPr)\n for (const child of opts.children) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"p:grpSp\": children };\n }\n}\n","import type { FillOptions } from \"@file/drawingml/fill\";\nimport { buildFill } from \"@file/drawingml/fill\";\nimport { NonVisualShapeProperties } from \"@file/drawingml/non-visual-shape-props\";\nimport { createOutlineCompat, type OutlineOptions } from \"@file/drawingml/outline\";\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { BuilderElement, XmlComponent as Xc } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\n/**\n * p:sp — A line shape on a slide.\n */\nexport class LineShape extends Xc {\n private static nextId = 2;\n private readonly shapeId: number;\n\n public constructor(options: ILineShapeOptions = {}) {\n super(\"p:sp\");\n\n const id = options.id ?? LineShape.nextId++;\n this.shapeId = id;\n const name = options.name ?? `Line ${id}`;\n\n const x1 = convertPixelsToEmu(options.x1 ?? 0);\n const y1 = convertPixelsToEmu(options.y1 ?? 0);\n const x2 = convertPixelsToEmu(options.x2 ?? 100);\n const y2 = convertPixelsToEmu(options.y2 ?? 100);\n\n this.root.push(\n new BuilderElement({\n name: \"p:nvSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n new NonVisualShapeProperties(),\n new BuilderElement({ name: \"p:nvPr\" }),\n ],\n }),\n );\n\n const offX = Math.min(x1, x2);\n const offY = Math.min(y1, y2);\n\n const xfrmAttrs:\n | Record<string, { readonly key: string; readonly value: string | number }>\n | undefined =\n x1 > x2 || y1 > y2\n ? (() => {\n const a: Record<\n string,\n { readonly key: string; readonly value: string | number }\n > = {};\n if (x1 > x2) a.flipH = { key: \"flipH\", value: 1 };\n if (y1 > y2) a.flipV = { key: \"flipV\", value: 1 };\n return a;\n })()\n : undefined;\n\n const spPrChildren: BuilderElement<{}>[] = [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: { x: { key: \"x\", value: offX }, y: { key: \"y\", value: offY } },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: Math.abs(x2 - x1) },\n cy: { key: \"cy\", value: Math.abs(y2 - y1) },\n },\n }),\n ],\n attributes: xfrmAttrs,\n }),\n new PresetGeometry({ preset: \"line\" }),\n ];\n\n if (options.fill !== undefined) {\n spPrChildren.push(buildFill(options.fill));\n }\n if (options.outline) {\n spPrChildren.push(createOutlineCompat(options.outline));\n }\n\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: spPrChildren,\n }),\n );\n\n this.root.push(\n new BuilderElement({\n name: \"p:txBody\",\n children: [\n new BuilderElement({\n name: \"a:bodyPr\",\n attributes: { wrap: { key: \"wrap\", value: \"square\" } },\n }),\n new BuilderElement({ name: \"a:lstStyle\" }),\n new BuilderElement({ name: \"a:p\" }),\n ],\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n}\n\nexport interface ILineShapeOptions {\n readonly id?: number;\n readonly name?: string;\n readonly x1?: number;\n readonly y1?: number;\n readonly x2?: number;\n readonly y2?: number;\n readonly fill?: FillOptions;\n readonly outline?: OutlineOptions;\n}\n\nexport type ArrowheadType = \"triangle\" | \"stealth\" | \"diamond\" | \"oval\" | \"open\" | \"none\";\n\n/**\n * p:cxnSp — A connector shape on a slide (line with optional arrowheads).\n */\nexport class ConnectorShape extends Xc {\n private static nextId = 2;\n private readonly shapeId: number;\n\n public constructor(options: IConnectorShapeOptions = {}) {\n super(\"p:cxnSp\");\n\n const id = options.id ?? ConnectorShape.nextId++;\n this.shapeId = id;\n const name = options.name ?? `Connector ${id}`;\n\n const x1 = convertPixelsToEmu(options.x1 ?? 0);\n const y1 = convertPixelsToEmu(options.y1 ?? 0);\n const x2 = convertPixelsToEmu(options.x2 ?? 100);\n const y2 = convertPixelsToEmu(options.y2 ?? 100);\n\n this.root.push(\n new BuilderElement({\n name: \"p:nvCxnSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n new BuilderElement({ name: \"p:cNvCxnSpPr\" }),\n new BuilderElement({ name: \"p:nvPr\" }),\n ],\n }),\n );\n\n const offX = Math.min(x1, x2);\n const offY = Math.min(y1, y2);\n\n const xfrmAttrs:\n | Record<string, { readonly key: string; readonly value: string | number }>\n | undefined =\n x1 > x2 || y1 > y2\n ? (() => {\n const a: Record<\n string,\n { readonly key: string; readonly value: string | number }\n > = {};\n if (x1 > x2) a.flipH = { key: \"flipH\", value: 1 };\n if (y1 > y2) a.flipV = { key: \"flipV\", value: 1 };\n return a;\n })()\n : undefined;\n\n const spPrChildren: BuilderElement<{}>[] = [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: { x: { key: \"x\", value: offX }, y: { key: \"y\", value: offY } },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: Math.abs(x2 - x1) },\n cy: { key: \"cy\", value: Math.abs(y2 - y1) },\n },\n }),\n ],\n attributes: xfrmAttrs,\n }),\n new PresetGeometry({ preset: \"line\" }),\n ];\n\n if (options.fill !== undefined) {\n spPrChildren.push(buildFill(options.fill));\n }\n\n // Arrowheads + outline: headEnd/tailEnd must be inside a:ln per XSD\n const hasArrowheads = options.beginArrowhead || options.endArrowhead;\n if (options.outline || hasArrowheads) {\n spPrChildren.push(\n createOutlineCompat(\n options.outline ?? {},\n hasArrowheads\n ? {\n beginType: options.beginArrowhead,\n endType: options.endArrowhead,\n width: options.arrowheadWidth,\n length: options.arrowheadLength,\n }\n : undefined,\n ),\n );\n }\n\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: spPrChildren,\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n}\n\nexport interface IConnectorShapeOptions {\n readonly id?: number;\n readonly name?: string;\n readonly x1?: number;\n readonly y1?: number;\n readonly x2?: number;\n readonly y2?: number;\n readonly fill?: FillOptions;\n readonly outline?: OutlineOptions;\n readonly beginArrowhead?: ArrowheadType;\n readonly endArrowhead?: ArrowheadType;\n readonly arrowheadWidth?: \"sm\" | \"med\" | \"lg\";\n readonly arrowheadLength?: \"sm\" | \"med\" | \"lg\";\n}\n","import { GroupShapeProperties } from \"@file/drawingml/group-shape-properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { GroupShapeNonVisualProperties } from \"./group-shape-non-visual\";\n\n/**\n * p:spTree — Shape tree containing all shapes on a slide.\n */\nexport class ShapeTree extends XmlComponent {\n public constructor(children: readonly XmlComponent[]) {\n super(\"p:spTree\");\n this.root.push(new GroupShapeNonVisualProperties());\n this.root.push(new GroupShapeProperties());\n this.root.push(...children);\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nconst NOTES_MASTER_XML = `<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\n <p:cSld>\n <p:bg>\n <p:bgRef idx=\"1001\">\n <a:schemeClr val=\"bg1\"/>\n </p:bgRef>\n </p:bg>\n <p:spTree>\n <p:nvGrpSpPr>\n <p:cNvPr id=\"1\" name=\"\"/>\n <p:cNvGrpSpPr/>\n <p:nvPr/>\n </p:nvGrpSpPr>\n <p:grpSpPr>\n <a:xfrm>\n <a:off x=\"0\" y=\"0\"/>\n <a:ext cx=\"0\" cy=\"0\"/>\n <a:chOff x=\"0\" y=\"0\"/>\n <a:chExt cx=\"0\" cy=\"0\"/>\n </a:xfrm>\n </p:grpSpPr>\n </p:spTree>\n </p:cSld>\n <p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>\n</p:notesMaster>`;\n\nexport class DefaultNotesMaster extends ImportedXmlComponent {\n private static instance = ImportedXmlComponent.fromXmlString(NOTES_MASTER_XML);\n\n public constructor() {\n super(\"p:notesMaster\");\n }\n\n public prepForXml() {\n return DefaultNotesMaster.instance.prepForXml({ stack: [] });\n }\n}\n","import {\n BuilderElement,\n NextAttributeComponent,\n StringContainer,\n XmlComponent,\n} from \"@file/xml-components\";\n\nexport interface IHeaderFooterOptions {\n readonly slideNumber?: boolean;\n readonly dateTime?: boolean;\n readonly footer?: string | boolean;\n readonly header?: boolean;\n}\n\n/**\n * p:hf — Slide header/footer settings.\n *\n * CT_HeaderFooter has boolean attributes (sldNum, hdr, ftr, dt) for visibility.\n * Footer text content is passed as p:ftr child element (legacy support).\n */\nexport class HeaderFooter extends XmlComponent {\n public constructor(options: IHeaderFooterOptions = {}) {\n super(\"p:hf\");\n\n // Boolean visibility attributes\n const attrs: Record<string, { readonly key: string; readonly value: number }> = {};\n if (options.slideNumber !== false) attrs.sldNum = { key: \"sldNum\", value: 1 };\n if (options.dateTime !== false) attrs.dt = { key: \"dt\", value: 1 };\n // Only set hdr when explicitly true (no header placeholder in default slide master)\n if (options.header === true) attrs.hdr = { key: \"hdr\", value: 1 };\n // Only set ftr when explicitly true or footer has string content\n if (options.footer !== false && options.footer !== undefined)\n attrs.ftr = { key: \"ftr\", value: 1 };\n\n if (Object.keys(attrs).length > 0) {\n this.root.push(new NextAttributeComponent(attrs));\n }\n\n // Footer text content as child element\n if (typeof options.footer === \"string\") {\n this.root.push(\n new BuilderElement({\n name: \"p:ftr\",\n children: [\n new BuilderElement({\n name: \"p:txBody\",\n children: [\n new BuilderElement({ name: \"a:bodyPr\" }),\n new BuilderElement({ name: \"a:lstStyle\" }),\n new BuilderElement({\n name: \"a:p\",\n children: [\n new BuilderElement({\n name: \"a:r\",\n children: [new StringContainer(\"a:t\", options.footer)],\n }),\n new BuilderElement({\n name: \"a:endParaRPr\",\n attributes: { lang: { key: \"lang\", value: \"en-US\" } },\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n }\n }\n}\n","import { NonVisualPictureProperties } from \"@file/drawingml/non-visual-picture-props\";\nimport { BuilderElement, XmlComponent } from \"@file/xml-components\";\n\n/**\n * p:nvPicPr — Non-visual picture properties for p:pic.\n */\nexport class PictureNonVisual extends XmlComponent {\n public constructor(id: number, name: string) {\n super(\"p:nvPicPr\");\n this.root.push(\n new BuilderElement({\n name: \"a:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n descr: { key: \"descr\", value: \"\" },\n },\n }),\n );\n this.root.push(new NonVisualPictureProperties());\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n","import { BlipFill } from \"@file/drawingml/blip-fill\";\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { Transform2D } from \"@file/drawingml/transform-2d\";\nimport type { File } from \"@file/file\";\nimport type { IMediaData } from \"@file/media/data\";\nimport { BuilderElement, type IContext, XmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nimport { PictureNonVisual } from \"./picture-non-visual\";\n\nexport interface IPictureOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly data: Uint8Array;\n readonly type: \"png\" | \"jpg\" | \"gif\" | \"bmp\" | \"emf\" | \"wmf\";\n readonly name?: string;\n}\n\n/**\n * p:pic — A picture on a slide.\n *\n * Registers image with Media collection via prepForXml.\n * The ImageReplacer replaces `{fileName}` placeholder with actual rId.\n */\nexport class Picture extends XmlComponent {\n private static nextId = 100;\n private readonly imageData: IMediaData;\n\n public constructor(options: IPictureOptions) {\n super(\"p:pic\");\n\n const id = Picture.nextId++;\n const name = options.name ?? `Picture ${id}`;\n const fileName = `${name.replace(/\\s+/g, \"_\")}.${options.type}`;\n\n this.imageData = {\n type: options.type,\n fileName,\n transformation: {\n pixels: {\n x: options.width ?? 0,\n y: options.height ?? 0,\n },\n emus: {\n x: convertPixelsToEmu(options.width ?? 0),\n y: convertPixelsToEmu(options.height ?? 0),\n },\n },\n data: options.data,\n };\n\n this.root.push(new PictureNonVisual(id, name));\n\n this.root.push(new BlipFill(fileName));\n\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new Transform2D({\n x: convertPixelsToEmu(options.x ?? 0),\n y: convertPixelsToEmu(options.y ?? 0),\n width: convertPixelsToEmu(options.width ?? 0),\n height: convertPixelsToEmu(options.height ?? 0),\n }),\n new PresetGeometry({ preset: \"rect\" }),\n ],\n }),\n );\n }\n\n public override prepForXml(context: IContext) {\n (context.fileData as File)?.Media.addImage(this.imageData.fileName, this.imageData);\n return super.prepForXml(context);\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\n/**\n * a:graphic > a:graphicData — DrawingML graphic wrapper for table.\n * Lazy: stores table reference, builds IXmlableObject in prepForXml.\n */\nexport class Graphic extends BaseXmlComponent {\n private readonly table: BaseXmlComponent;\n\n public constructor(table: BaseXmlComponent) {\n super(\"a:graphic\");\n this.table = table;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const tableObj = this.table.prepForXml(context);\n const graphicDataChildren: IXmlableObject[] = [\n { _attr: { uri: \"http://schemas.openxmlformats.org/drawingml/2006/table\" } },\n ];\n if (tableObj) graphicDataChildren.push(tableObj);\n return {\n \"a:graphic\": [{ \"a:graphicData\": graphicDataChildren }],\n };\n }\n}\n","import { BuilderElement, XmlComponent } from \"@file/xml-components\";\n\n/**\n * p:nvGraphicFramePr — Non-visual properties for graphic frame.\n */\nexport class GraphicFrameNonVisual extends XmlComponent {\n private static nextId = 1024;\n\n public constructor() {\n super(\"p:nvGraphicFramePr\");\n const id = GraphicFrameNonVisual.nextId++;\n this.root.push(\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: `Table ${id}` },\n },\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:cNvGraphicFramePr\",\n children: [\n new BuilderElement({\n name: \"a:graphicFrameLocks\",\n attributes: { noGrp: { key: \"noGrp\", value: 1 } },\n }),\n ],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\n/**\n * a:tblGrid — Table grid with column width definitions.\n * Lazy: stores widths, builds IXmlableObject in prepForXml.\n */\nexport class TableGrid extends BaseXmlComponent {\n private readonly columnWidths: readonly number[];\n\n public constructor(columnWidths: readonly number[]) {\n super(\"a:tblGrid\");\n this.columnWidths = columnWidths;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n const children = this.columnWidths.map((w) => ({\n \"a:gridCol\": { _attr: { w } },\n }));\n return { \"a:tblGrid\": children };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\n/**\n * a:tblPr — Table properties (firstRow, bandRow, etc.).\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableProperties extends BaseXmlComponent {\n private readonly options?: {\n readonly firstRow?: boolean;\n readonly lastRow?: boolean;\n readonly bandRow?: boolean;\n readonly firstCol?: boolean;\n readonly lastCol?: boolean;\n readonly bandCol?: boolean;\n };\n\n public constructor(options?: {\n readonly firstRow?: boolean;\n readonly lastRow?: boolean;\n readonly bandRow?: boolean;\n readonly firstCol?: boolean;\n readonly lastCol?: boolean;\n readonly bandCol?: boolean;\n }) {\n super(\"a:tblPr\");\n this.options = options;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n if (!this.options) return { \"a:tblPr\": {} };\n\n const attrs: Record<string, string | number> = {};\n const opts = this.options;\n if (opts.firstRow !== undefined) attrs.firstRow = opts.firstRow ? 1 : 0;\n if (opts.lastRow !== undefined) attrs.lastRow = opts.lastRow ? 1 : 0;\n if (opts.bandRow !== undefined) attrs.bandRow = opts.bandRow ? 1 : 0;\n if (opts.firstCol !== undefined) attrs.firstCol = opts.firstCol ? 1 : 0;\n if (opts.lastCol !== undefined) attrs.lastCol = opts.lastCol ? 1 : 0;\n if (opts.bandCol !== undefined) attrs.bandCol = opts.bandCol ? 1 : 0;\n\n return { \"a:tblPr\": Object.keys(attrs).length > 0 ? { _attr: attrs } : {} };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { TableCell, type ITableCellOptions } from \"./table-cell\";\n\nexport interface ITableRowOptions {\n readonly height?: number;\n readonly cells: readonly ITableCellOptions[];\n}\n\n/**\n * a:tr — Table row containing cells.\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableRow extends BaseXmlComponent {\n private readonly options: ITableRowOptions;\n\n public constructor(options: ITableRowOptions) {\n super(\"a:tr\");\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const children: IXmlableObject[] = [];\n children.push({ _attr: { h: this.options.height ?? 0 } });\n\n for (const cell of this.options.cells) {\n const tc = new TableCell(cell);\n const obj = tc.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"a:tr\": children };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport type { ICellBorderOptions } from \"./table-cell-properties\";\nimport { TableGrid } from \"./table-grid\";\nimport { TableProperties } from \"./table-properties\";\nimport { TableRow, type ITableRowOptions } from \"./table-row\";\n\nexport interface ITableOptions {\n readonly rows: readonly ITableRowOptions[];\n readonly columnWidths?: readonly number[];\n readonly firstRow?: boolean;\n readonly lastRow?: boolean;\n readonly bandRow?: boolean;\n readonly firstCol?: boolean;\n readonly lastCol?: boolean;\n readonly bandCol?: boolean;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n}\n\n/**\n * a:tbl — DrawingML table element.\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class Table extends BaseXmlComponent {\n private readonly options: ITableOptions;\n\n public constructor(options: ITableOptions) {\n super(\"a:tbl\");\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const opts = this.options;\n const children: IXmlableObject[] = [];\n\n // a:tblPr\n const tblPr = new TableProperties({\n firstRow: opts.firstRow,\n lastRow: opts.lastRow,\n bandRow: opts.bandRow,\n firstCol: opts.firstCol,\n lastCol: opts.lastCol,\n bandCol: opts.bandCol,\n });\n const tblPrObj = tblPr.prepForXml(context);\n if (tblPrObj) children.push(tblPrObj);\n\n // a:tblGrid\n const colWidths =\n opts.columnWidths && opts.columnWidths.length > 0\n ? [...opts.columnWidths]\n : Array.from({ length: opts.rows[0]?.cells.length ?? 1 }, () => 0);\n const grid = new TableGrid(colWidths);\n const gridObj = grid.prepForXml(context);\n if (gridObj) children.push(gridObj);\n\n // a:tr rows — distribute table-level borders to edge cells\n const tb = opts.borders;\n const rowCount = opts.rows.length;\n for (let ri = 0; ri < rowCount; ri++) {\n const row = opts.rows[ri];\n const colCount = row.cells.length;\n const cells = tb\n ? row.cells.map((cell, ci) => {\n const b = { ...cell.borders };\n if (ri === 0 && tb.top && !b.top) b.top = tb.top;\n if (ri === rowCount - 1 && tb.bottom && !b.bottom) b.bottom = tb.bottom;\n if (ci === 0 && tb.left && !b.left) b.left = tb.left;\n if (ci === colCount - 1 && tb.right && !b.right) b.right = tb.right;\n return Object.keys(b).length === 0 ? cell : { ...cell, borders: b };\n })\n : row.cells;\n const tr = new TableRow({ ...row, cells });\n const trObj = tr.prepForXml(context);\n if (trObj) children.push(trObj);\n }\n\n return { \"a:tbl\": children };\n }\n}\n","import { Transform2D } from \"@file/drawingml/transform-2d\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nimport { Graphic } from \"./graphic\";\nimport { GraphicFrameNonVisual } from \"./graphic-frame-non-visual\";\nimport type { ITableOptions } from \"./table\";\nimport { Table } from \"./table\";\n\nexport interface ITableFrameOptions extends ITableOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n}\n\n/**\n * p:graphicFrame — Slide-level graphic frame wrapping a table.\n *\n * x/y/width/height accept pixel values, converted to EMUs internally.\n */\nexport class TableFrame extends XmlComponent {\n public constructor(options: ITableFrameOptions) {\n super(\"p:graphicFrame\");\n\n this.root.push(new GraphicFrameNonVisual());\n\n this.root.push(\n new Transform2D(\n {\n x: convertPixelsToEmu(options.x ?? 0),\n y: convertPixelsToEmu(options.y ?? 0),\n width: convertPixelsToEmu(options.width ?? 0),\n height: convertPixelsToEmu(options.height ?? 0),\n },\n \"p\",\n ),\n );\n\n const table = new Table(options);\n this.root.push(new Graphic(table));\n }\n}\n","import { Transform2D } from \"@file/drawingml/transform-2d\";\nimport { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nimport { ChartCollection } from \"./chart-collection\";\nimport type { IChartSpaceOptions } from \"./chart-space\";\nimport { ChartSpace } from \"./chart-space\";\n\nlet nextChartFrameId = 2048;\n\nexport interface IChartFrameOptions extends IChartSpaceOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n}\n\n/**\n * p:graphicFrame — Slide-level graphic frame wrapping a chart.\n *\n * The chart is stored as a separate part (ppt/charts/chart{n}.xml)\n * and referenced via a relationship ID placeholder {chart:key}.\n */\nexport class ChartFrame extends XmlComponent {\n private readonly chartOptions: IChartSpaceOptions;\n private readonly chartKey: string;\n\n public constructor(options: IChartFrameOptions) {\n super(\"p:graphicFrame\");\n\n this.chartOptions = options;\n this.chartKey = `chart_${nextChartFrameId++}`;\n\n const id = nextChartFrameId++;\n this.root.push(new GraphicFrameNonVisual(id));\n this.root.push(\n new Transform2D(\n {\n x: convertPixelsToEmu(options.x ?? 0),\n y: convertPixelsToEmu(options.y ?? 0),\n width: convertPixelsToEmu(options.width ?? 0),\n height: convertPixelsToEmu(options.height ?? 0),\n },\n \"p\",\n ),\n );\n\n this.root.push(new ChartGraphic(this.chartKey));\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const file = context.fileData as { Charts: ChartCollection };\n if (file?.Charts) {\n file.Charts.addChart(this.chartKey, {\n chartSpace: new ChartSpace(this.chartOptions),\n key: this.chartKey,\n });\n }\n\n return super.prepForXml(context);\n }\n\n public get ChartKey(): string {\n return this.chartKey;\n }\n}\n\nclass GraphicFrameNonVisual extends XmlComponent {\n public constructor(id: number) {\n super(\"p:nvGraphicFramePr\");\n this.root.push(\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: `Chart ${id}` },\n },\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:cNvGraphicFramePr\",\n children: [\n new BuilderElement({\n name: \"a:graphicFrameLocks\",\n attributes: { noGrp: { key: \"noGrp\", value: 1 } },\n }),\n ],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n\nclass ChartGraphic extends XmlComponent {\n public constructor(chartKey: string) {\n super(\"a:graphic\");\n this.root.push(new ChartGraphicData(chartKey));\n }\n}\n\nclass ChartGraphicData extends XmlComponent {\n public constructor(chartKey: string) {\n super(\"a:graphicData\");\n this.root.push(\n new NextAttributeComponent({\n uri: {\n key: \"uri\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/chart\",\n },\n }),\n );\n this.root.push(new ChartRef(chartKey));\n }\n}\n\nclass ChartRef extends XmlComponent {\n public constructor(chartKey: string) {\n super(\"c:chart\");\n this.root.push(\n new NextAttributeComponent({\n xmlnsC: {\n key: \"xmlns:c\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/chart\",\n },\n xmlnsR: {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n rId: { key: \"r:id\", value: `{chart:${chartKey}}` },\n }),\n );\n }\n}\n","import { Transform2D } from \"@file/drawingml/transform-2d\";\nimport {\n BuilderElement,\n NextAttributeComponent,\n type IContext,\n type IXmlableObject,\n XmlComponent,\n} from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nimport type { SmartArtCollection } from \"./smartart-collection\";\nimport { createDataModel, type ITreeNode } from \"./tree-to-model\";\n\nlet nextSmartArtFrameId = 1024;\n\nexport interface ISmartArtFrameOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly nodes: readonly ITreeNode[];\n readonly name?: string;\n /** Layout ID (e.g. \"default\", \"process1\", \"hierarchy1\") */\n readonly layout?: string;\n /** Quick style ID (e.g. \"simple1\", \"moderate1\") */\n readonly style?: string;\n /** Color transform ID (e.g. \"accent1_2\", \"colorful1\") */\n readonly color?: string;\n}\n\n/**\n * p:graphicFrame — Slide-level graphic frame wrapping a SmartArt diagram.\n */\nexport class SmartArtFrame extends XmlComponent {\n private readonly smartArtKey: string;\n private readonly dataModel: ReturnType<typeof createDataModel>;\n private readonly layoutId: string;\n private readonly styleId: string;\n private readonly colorId: string;\n\n public constructor(options: ISmartArtFrameOptions) {\n super(\"p:graphicFrame\");\n\n this.smartArtKey = `smartart_${nextSmartArtFrameId++}`;\n this.layoutId = options.layout ?? \"default\";\n this.styleId = options.style ?? \"simple1\";\n this.colorId = options.color ?? \"accent1_2\";\n this.dataModel = createDataModel(options.nodes, this.layoutId, this.styleId, this.colorId);\n\n const id = nextSmartArtFrameId++;\n const name = options.name ?? `Diagram ${id}`;\n\n this.root.push(new GraphicFrameNonVisual(id, name));\n this.root.push(\n new Transform2D(\n {\n x: convertPixelsToEmu(options.x ?? 0),\n y: convertPixelsToEmu(options.y ?? 0),\n width: convertPixelsToEmu(options.width ?? 0),\n height: convertPixelsToEmu(options.height ?? 0),\n },\n \"p\",\n ),\n );\n this.root.push(new SmartArtGraphic(this.smartArtKey));\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const file = context.fileData as { SmartArts: SmartArtCollection };\n if (file?.SmartArts) {\n file.SmartArts.addSmartArt(this.smartArtKey, {\n key: this.smartArtKey,\n dataModel: this.dataModel,\n layout: this.layoutId,\n style: this.styleId,\n color: this.colorId,\n });\n }\n return super.prepForXml(context);\n }\n}\n\nclass GraphicFrameNonVisual extends XmlComponent {\n public constructor(id: number, name: string) {\n super(\"p:nvGraphicFramePr\");\n this.root.push(\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:cNvGraphicFramePr\",\n children: [\n new BuilderElement({\n name: \"a:graphicFrameLocks\",\n attributes: { noGrp: { key: \"noGrp\", value: 1 } },\n }),\n ],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n\nclass SmartArtGraphic extends XmlComponent {\n public constructor(smartArtKey: string) {\n super(\"a:graphic\");\n this.root.push(new SmartArtGraphicData(smartArtKey));\n }\n}\n\nclass SmartArtGraphicData extends XmlComponent {\n public constructor(smartArtKey: string) {\n super(\"a:graphicData\");\n this.root.push(\n new NextAttributeComponent({\n uri: {\n key: \"uri\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/diagram\",\n },\n }),\n );\n this.root.push(new DiagramRelIds(smartArtKey));\n }\n}\n\nclass DiagramRelIds extends XmlComponent {\n public constructor(smartArtKey: string) {\n super(\"dgm:relIds\");\n this.root.push(\n new NextAttributeComponent({\n xmlnsDgm: {\n key: \"xmlns:dgm\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/diagram\",\n },\n xmlnsR: {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n rDm: { key: \"r:dm\", value: `{smartart:${smartArtKey}}` },\n rLo: { key: \"r:lo\", value: `{smartart-lo:${smartArtKey}}` },\n rQs: { key: \"r:qs\", value: `{smartart-qs:${smartArtKey}}` },\n rCs: { key: \"r:cs\", value: `{smartart-cs:${smartArtKey}}` },\n }),\n );\n }\n}\n","export {\n File,\n type IPresentationOptions,\n type ISlideOptions,\n type ICommentOptions,\n type IMasterDefinition,\n type ILayoutDefinition,\n type ILayoutPlaceholderOptions,\n type SlideSize,\n} from \"./file\";\nexport { Presentation } from \"./presentation/presentation\";\nexport type { IPresentationOptions as IPresentationXmlOptions } from \"./presentation/presentation\";\nexport { Shape, type IShapeOptions } from \"./shape/shape\";\nexport { TextBody, type ITextBodyOptions } from \"./shape/text-body\";\nexport { Paragraph, type IParagraphOptions } from \"./shape/paragraph/paragraph\";\nexport { TextRun, type IRunOptions } from \"./shape/paragraph/run\";\nexport { Text } from \"./shape/paragraph/text\";\nexport {\n RunProperties,\n UnderlineStyle,\n StrikeStyle,\n TextCapitalization,\n type IRunPropertiesOptions,\n type IHyperlinkOptions,\n} from \"./shape/paragraph/run-properties\";\nexport {\n ParagraphProperties,\n TextAlignment,\n type IParagraphPropertiesOptions,\n} from \"./shape/paragraph/paragraph-properties\";\nexport { EndParagraphRunProperties } from \"./shape/paragraph/end-paragraph-run\";\nexport { Field, SlideNumberField, DateTimeField } from \"./shape/paragraph/field\";\n\n// DrawingML — re-exports from core\nexport {\n createOutline,\n type OutlineOptions as CoreOutlineOptions,\n} from \"@office-open/core/drawingml\";\nexport {\n createGradientFill,\n createGradientStop,\n type GradientFillOptions as CoreGradientFillOptions,\n type IGradientStop,\n PathShadeType,\n TileFlipMode,\n} from \"@office-open/core/drawingml\";\nexport {\n LineCap,\n CompoundLine,\n PenAlignment,\n PresetDash,\n LineJoin,\n} from \"@office-open/core/drawingml\";\nexport { createScene3D, type Scene3DOptions } from \"@office-open/core/drawingml\";\nexport {\n createShape3D,\n type Shape3DOptions,\n PresetMaterialType,\n} from \"@office-open/core/drawingml\";\nexport {\n createBevel,\n createBottomBevel,\n type BevelOptions,\n BevelPresetType,\n} from \"@office-open/core/drawingml\";\nexport { createEffectList, type EffectListOptions } from \"@office-open/core/drawingml\";\nexport { createColorElement } from \"@office-open/core/drawingml\";\nexport { createColorTransforms, type ColorTransformOptions } from \"@office-open/core/drawingml\";\n\n// DrawingML — fill API\nexport {\n buildFill,\n extractBlipFillMedia,\n type BlipFillConfigOptions,\n type BlipFillMediaData,\n type FillOptions,\n type GradientStopOptions,\n} from \"./drawingml/fill\";\nexport { createOutlineCompat, type OutlineOptions } from \"./drawingml/outline\";\n\n// DrawingML — local implementations (pptx-specific)\nexport { BlipFill } from \"./drawingml/blip-fill\";\nexport { Transform2D, type ITransform2DOptions } from \"./drawingml/transform-2d\";\nexport { PresetGeometry } from \"./drawingml/preset-geometry\";\nexport { ShapeProperties, type IShapePropertiesOptions } from \"./drawingml/shape-properties\";\nexport {\n createPptxEffectList,\n ReflectionAlignment,\n type IEffectsOptions,\n type IShadowOptions,\n type IGlowOptions,\n type IReflectionOptions,\n type ISoftEdgeOptions,\n} from \"./drawingml/effects\";\nexport { NonVisualDrawingProperties } from \"./drawingml/non-visual-drawing-props\";\nexport { NonVisualShapeProperties } from \"./drawingml/non-visual-shape-props\";\nexport { NonVisualPictureProperties } from \"./drawingml/non-visual-picture-props\";\nexport { GroupShapeProperties } from \"./drawingml/group-shape-properties\";\nexport { GroupTransform2D, type IGroupTransform2DOptions } from \"./drawingml/group-transform-2d\";\n\nexport { GroupShape, type IGroupShapeOptions } from \"./shape/group-shape\";\nexport { LineShape, type ILineShapeOptions } from \"./shape/line-shape\";\nexport { ConnectorShape, type IConnectorShapeOptions } from \"./shape/line-shape\";\nexport { Media } from \"./media/media\";\nexport { createTransformation, type IMediaTransformation } from \"./media/media\";\nexport type { IMediaData, IMediaDataTransformation } from \"./media/data\";\nexport {\n VideoFrame,\n type IVideoFrameOptions,\n type VideoType,\n type PosterType,\n} from \"./media/video-frame\";\nexport { AudioFrame, type IAudioFrameOptions, type AudioType } from \"./media/audio-frame\";\nexport { CoreProperties, type ICorePropertiesOptions } from \"./core-properties/properties\";\nexport { AppProperties } from \"./app-properties/app-properties\";\nexport { ContentTypes } from \"./content-types/content-types\";\nexport { Relationships } from \"./relationships/relationships\";\nexport { type RelationshipType } from \"./relationships/relationship/relationship\";\nexport { Slide } from \"./slide/slide\";\nexport { ShapeTree } from \"./shape-tree/shape-tree\";\nexport { DefaultTheme, type IThemeOptions } from \"./theme/theme\";\nexport {\n DefaultSlideMaster,\n type ISlideMasterOptions,\n type IMasterPlaceholderOptions,\n type IMasterPlaceholderPosition,\n} from \"./slide-master/slide-master\";\nexport { DefaultSlideLayout, SlideLayout, type SlideLayoutType } from \"./slide-layout/slide-layout\";\nexport { DefaultNotesMaster } from \"./notes-master/notes-master\";\nexport { NotesSlide, type INotesSlideOptions } from \"./notes/notes-slide\";\nexport { HeaderFooter, type IHeaderFooterOptions } from \"./header-footer/header-footer\";\nexport { PresentationWrapper, type IViewWrapper } from \"./presentation/presentation-wrapper\";\nexport { Picture, type IPictureOptions } from \"./picture/picture\";\nexport { Background, type IBackgroundOptions } from \"./background/background\";\nexport { TableFrame, type ITableFrameOptions } from \"./table/table-frame\";\nexport { Table, type ITableOptions } from \"./table/table\";\nexport { TableRow, type ITableRowOptions } from \"./table/table-row\";\nexport { TableCell, VerticalAlignment, type ITableCellOptions } from \"./table/table-cell\";\nexport { TableProperties } from \"./table/table-properties\";\nexport { TableCellProperties, type ICellBorderOptions } from \"./table/table-cell-properties\";\nexport { ChartFrame, type IChartFrameOptions } from \"./chart/chart-frame\";\nexport { ChartCollection, type IChartData } from \"./chart/chart-collection\";\nexport { ChartSpace, type IChartSpaceOptions, type IChartSeriesData } from \"./chart/chart-space\";\nexport type { ChartType } from \"./chart/chart-types/create-chart-type\";\nexport { SmartArtFrame, type ISmartArtFrameOptions, type ITreeNode } from \"./smartart\";\nexport { Transition, type ITransitionOptions, type TransitionType } from \"./transition/transition\";\nexport {\n type AnimationType,\n type AnimationTrigger,\n type AnimationDirection,\n type AnimationClass,\n type EmphasisType,\n type PathAnimationType,\n type MediaAnimationType,\n type AnimationCalcMode,\n type AnimationValueType,\n type IAnimationOptions,\n} from \"./animation/types\";\n","import { escapeRegex, formatId } from \"@office-open/core\";\n\nexport function replaceHyperlinkPlaceholders(\n xml: string,\n hyperlinks: readonly { readonly key: string }[],\n offset: number,\n): string {\n let result = xml;\n hyperlinks.forEach((h, i) => {\n result = result.replace(\n new RegExp(`\\\\{hlink:${escapeRegex(h.key)}\\\\}`, \"g\"),\n formatId(offset, i, \"rId\"),\n );\n });\n return result;\n}\n","import { escapeRegex, formatId } from \"@office-open/core\";\n\nexport function replaceMediaPlaceholders(\n xml: string,\n mediaData: readonly { readonly fileName: string }[],\n offset: number,\n): string {\n let result = xml;\n mediaData.forEach((m, i) => {\n result = result.replace(\n new RegExp(`\\\\{media:${escapeRegex(m.fileName)}\\\\}`, \"g\"),\n formatId(offset, i, \"rId\"),\n );\n });\n return result;\n}\n\nexport function replaceVideoPlaceholders(\n xml: string,\n mediaData: readonly { readonly fileName: string }[],\n offset: number,\n): string {\n let result = xml;\n mediaData.forEach((m, i) => {\n result = result.replace(\n new RegExp(`\\\\{video:${escapeRegex(m.fileName)}\\\\}`, \"g\"),\n formatId(offset, i, \"rId\"),\n );\n });\n return result;\n}\n\nexport function getMediaRefs(\n xml: string,\n mediaArray: readonly { readonly fileName: string }[],\n): readonly { readonly fileName: string }[] {\n return collectRefs(xml, \"media:\", mediaArray);\n}\n\nexport function getVideoRefs(\n xml: string,\n mediaArray: readonly { readonly fileName: string }[],\n): readonly { readonly fileName: string }[] {\n return collectRefs(xml, \"video:\", mediaArray);\n}\n\nfunction collectRefs(\n xml: string,\n prefix: string,\n mediaArray: readonly { readonly fileName: string }[],\n): readonly { readonly fileName: string }[] {\n const pattern = new RegExp(`\\\\{${escapeRegex(prefix)}([^}]+)\\\\}`, \"g\");\n const keys = new Set<string>();\n for (const match of xml.matchAll(pattern)) {\n keys.add(match[1]);\n }\n return mediaArray.filter((m) => keys.has(m.fileName));\n}\n","import { Formatter } from \"@export/formatter\";\nimport type { File } from \"@file/file\";\nimport { DefaultNotesMaster } from \"@file/notes-master/notes-master\";\nimport {\n DEFAULT_DRAWING_XML,\n getColorXml,\n getLayoutXml,\n getStyleXml,\n} from \"@file/smartart/built-in-definitions\";\nimport type { IContext } from \"@file/xml-components\";\nimport {\n addSmartArtRelationships,\n collectPlaceholderKeys,\n getReferencedMedia,\n hasPlaceholders,\n replaceChartPlaceholders,\n replaceImagePlaceholders,\n replaceSmartArtPlaceholders,\n} from \"@office-open/core\";\nimport type { IXmlifyedFile } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\nimport type { Zippable } from \"fflate\";\n\ninterface IXmlifyedFileMapping {\n [key: string]: { data: string; path: string };\n}\n\nimport { replaceHyperlinkPlaceholders } from \"./hyperlink-placeholders\";\nimport {\n getMediaRefs,\n getVideoRefs,\n replaceMediaPlaceholders,\n replaceVideoPlaceholders,\n} from \"./media-placeholders\";\n\nexport class Compiler {\n private readonly formatter = new Formatter();\n\n public compile(\n file: File,\n prettifyXml?: string,\n overrides: readonly IXmlifyedFile[] = [],\n ): Zippable {\n const declaration = true;\n const indent = prettifyXml;\n const context: IContext = { fileData: file, stack: [] };\n\n const mapping: IXmlifyedFileMapping = {\n AppProperties: {\n data: xml(this.formatter.format(file.AppProperties, context), { declaration }),\n path: \"docProps/app.xml\",\n },\n Properties: {\n data: xml(this.formatter.format(file.CoreProperties, context), {\n declaration,\n indent,\n }),\n path: \"docProps/core.xml\",\n },\n FileRelationships: {\n data: xml(this.formatter.format(file.FileRelationships, context), {\n declaration: false,\n }),\n path: \"_rels/.rels\",\n },\n };\n\n // Static singletons (ImportedXmlComponent.toXml uses sourceXml directly)\n // Themes (one per master)\n const themes = file.Themes;\n for (let ti = 0; ti < themes.length; ti++) {\n mapping[`Theme${ti}`] = {\n data: this.formatter.formatToXml(themes[ti], context, declaration),\n path: `ppt/theme/theme${ti + 1}.xml`,\n };\n }\n\n mapping[\"TableStyles\"] = {\n data: this.formatter.formatToXml(file.TableStyles, context, declaration),\n path: \"ppt/tableStyles.xml\",\n };\n\n mapping[\"PresProps\"] = {\n data: this.formatter.formatToXml(file.PresProps, context, declaration),\n path: \"ppt/presProps.xml\",\n };\n\n mapping[\"ViewProps\"] = {\n data: this.formatter.formatToXml(file.ViewProps, context, declaration),\n path: \"ppt/viewProps.xml\",\n };\n\n // Slide Masters\n const masters = file.SlideMasters;\n const masterRels = file.SlideMasterRelsArray;\n for (let mi = 0; mi < masters.length; mi++) {\n mapping[`SlideMaster${mi}`] = {\n data: this.formatter.formatToXml(masters[mi], context, declaration),\n path: `ppt/slideMasters/slideMaster${mi + 1}.xml`,\n };\n mapping[`SlideMasterRels${mi}`] = {\n data: xml(this.formatter.format(masterRels[mi], context), {\n declaration: false,\n }),\n path: `ppt/slideMasters/_rels/slideMaster${mi + 1}.xml.rels`,\n };\n }\n\n // Slide Layouts\n const layouts = file.AllLayouts;\n const layoutRels = file.AllLayoutRelsArray;\n for (let li = 0; li < layouts.length; li++) {\n mapping[`SlideLayout${li}`] = {\n data: this.formatter.formatToXml(layouts[li].layout, context, declaration),\n path: `ppt/slideLayouts/slideLayout${li + 1}.xml`,\n };\n mapping[`SlideLayoutRels${li}`] = {\n data: xml(this.formatter.format(layoutRels[li], context), {\n declaration: false,\n }),\n path: `ppt/slideLayouts/_rels/slideLayout${li + 1}.xml.rels`,\n };\n }\n\n // Register layout content types\n for (let i = 0; i < layouts.length; i++) {\n file.ContentTypes.addSlideLayout(i + 1);\n }\n // Register master + theme content types\n for (let mi = 0; mi < masters.length; mi++) {\n file.ContentTypes.addSlideMaster(mi + 1);\n file.ContentTypes.addTheme(mi + 1);\n }\n\n // Notes Master — only when notes slides exist\n if (file.NotesSlides.length > 0) {\n file.PresentationWrapper.Relationships.addRelationship(\n file.PresentationWrapper.Relationships.RelationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\",\n \"notesMasters/notesMaster1.xml\",\n );\n mapping[\"NotesMaster\"] = {\n data: xml(this.formatter.format(new DefaultNotesMaster(), context), {\n declaration,\n indent,\n }),\n path: \"ppt/notesMasters/notesMaster1.xml\",\n };\n mapping[\"NotesMasterRelationships\"] = {\n data: xml(this.formatter.format(file.NotesMasterRelationships, context), {\n declaration: false,\n }),\n path: \"ppt/notesMasters/_rels/notesMaster1.xml.rels\",\n };\n }\n\n // Comment Authors — only when comments exist\n if (file.CommentAuthorList) {\n file.PresentationWrapper.Relationships.addRelationship(\n file.PresentationWrapper.Relationships.RelationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors\",\n \"commentAuthors.xml\",\n );\n }\n\n // Presentation + its relationships\n const presentationXml = this.formatter.formatToXml(\n file.PresentationWrapper.View,\n context,\n declaration,\n );\n let currentImageCount = 0;\n\n const mediaData = getReferencedMedia(presentationXml, file.Media.Array);\n const presImageOffset = file.PresentationWrapper.Relationships.RelationshipCount + 1;\n mediaData.forEach((image, idx) => {\n file.PresentationWrapper.Relationships.addRelationship(\n presImageOffset + idx,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `../media/${image.fileName}`,\n );\n });\n\n const replacedPresentationXml = replaceImagePlaceholders(\n presentationXml,\n mediaData,\n presImageOffset,\n );\n currentImageCount += mediaData.length;\n\n mapping[\"Presentation\"] = {\n data: replacedPresentationXml,\n path: \"ppt/presentation.xml\",\n };\n\n mapping[\"PresentationRelationships\"] = {\n data: xml(this.formatter.format(file.PresentationWrapper.Relationships, context), {\n declaration: false,\n }),\n path: \"ppt/_rels/presentation.xml.rels\",\n };\n\n // Slides — format BEFORE ContentTypes so ChartFrame.prepForXml() populates Charts\n for (let i = 0; i < file.Slides.length; i++) {\n const slideWrapper = file.SlideWrappers[i];\n const slideXml = this.formatter.formatToXml(slideWrapper.View, context, declaration);\n\n const slideMediaData = getReferencedMedia(slideXml, file.Media.Array);\n const slideImageOffset = slideWrapper.Relationships.RelationshipCount + 1;\n slideMediaData.forEach((image, idx) => {\n slideWrapper.Relationships.addRelationship(\n slideImageOffset + idx,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `../media/${image.fileName}`,\n );\n });\n\n let replacedSlideXml = replaceImagePlaceholders(\n slideXml,\n slideMediaData,\n slideImageOffset,\n );\n currentImageCount += slideMediaData.length;\n\n // Placeholder replacement — single pre-check avoids 4 regex scans when none exist\n if (hasPlaceholders(replacedSlideXml)) {\n // Chart placeholder replacement\n const slideChartKeys = collectPlaceholderKeys(replacedSlideXml, \"chart:\");\n if (slideChartKeys.length > 0) {\n const slideChartOffset = slideWrapper.Relationships.RelationshipCount + 1;\n const slideCharts = file.Charts.Array.filter((c) =>\n slideChartKeys.includes(c.key),\n );\n\n replacedSlideXml = replaceChartPlaceholders(\n replacedSlideXml,\n slideCharts.map((c) => c.key),\n slideChartOffset,\n );\n\n slideCharts.forEach((chartData, ci) => {\n const globalIndex = file.Charts.Array.indexOf(chartData);\n slideWrapper.Relationships.addRelationship(\n slideChartOffset + ci,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\",\n `../charts/chart${globalIndex + 1}.xml`,\n );\n });\n }\n\n // SmartArt placeholder replacement\n const slideSmartArtKeys = collectPlaceholderKeys(replacedSlideXml, \"smartart:\");\n if (slideSmartArtKeys.length > 0) {\n const slideSmartArts = file.SmartArts.Array.filter((s) =>\n slideSmartArtKeys.includes(s.key),\n );\n const saOffset = slideWrapper.Relationships.RelationshipCount + 1;\n\n replacedSlideXml = replaceSmartArtPlaceholders(\n replacedSlideXml,\n slideSmartArts.map((s) => s.key),\n saOffset,\n );\n\n const saGlobalStart = file.SmartArts.Array.indexOf(slideSmartArts[0]);\n addSmartArtRelationships(\n slideSmartArts.map((s) => s.key),\n (id, type, target) => {\n slideWrapper.Relationships.addRelationship(id, type, target);\n },\n saOffset,\n saGlobalStart,\n {\n pathPrefix: \"../\",\n styleRelType:\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle\",\n },\n );\n }\n\n // Hyperlink placeholder replacement\n const slideHlinkKeys = collectPlaceholderKeys(replacedSlideXml, \"hlink:\");\n if (slideHlinkKeys.length > 0) {\n const slideHlinks = file.Hyperlinks.Array.filter((h) =>\n slideHlinkKeys.includes(h.key),\n );\n const hlinkOffset = slideWrapper.Relationships.RelationshipCount + 1;\n\n replacedSlideXml = replaceHyperlinkPlaceholders(\n replacedSlideXml,\n slideHlinks,\n hlinkOffset,\n );\n\n slideHlinks.forEach((hlink, hi) => {\n slideWrapper.Relationships.addRelationship(\n hlinkOffset + hi,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n hlink.url,\n \"External\",\n );\n });\n }\n\n // Media (video/audio) placeholder replacement\n const slideMediaRefs = getMediaRefs(replacedSlideXml, file.Media.Array);\n const slideVideoRefs = getVideoRefs(replacedSlideXml, file.Media.Array);\n\n if (slideMediaRefs.length > 0 || slideVideoRefs.length > 0) {\n const mediaOffset = slideWrapper.Relationships.RelationshipCount + 1;\n const videoOffset = mediaOffset + slideMediaRefs.length;\n\n replacedSlideXml = replaceMediaPlaceholders(\n replacedSlideXml,\n slideMediaRefs,\n mediaOffset,\n );\n\n replacedSlideXml = replaceVideoPlaceholders(\n replacedSlideXml,\n slideVideoRefs,\n videoOffset,\n );\n\n slideMediaRefs.forEach((media, mi) => {\n slideWrapper.Relationships.addRelationship(\n mediaOffset + mi,\n \"http://schemas.microsoft.com/office/2007/relationships/media\",\n `../media/${media.fileName}`,\n );\n });\n\n slideVideoRefs.forEach((video, vi) => {\n slideWrapper.Relationships.addRelationship(\n videoOffset + vi,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video\",\n `../media/${video.fileName}`,\n );\n });\n }\n }\n\n mapping[`Slide${i}`] = {\n data: replacedSlideXml,\n path: `ppt/slides/slide${i + 1}.xml`,\n };\n\n // Add comment relationship for this slide\n const slideComments = file.SlideCommentLists[i];\n if (slideComments) {\n slideWrapper.Relationships.addRelationship(\n slideWrapper.Relationships.RelationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\",\n `../comments/comment${i + 1}.xml`,\n );\n }\n\n mapping[`SlideRelationships${i}`] = {\n data: xml(this.formatter.format(slideWrapper.Relationships, context), {\n declaration: false,\n }),\n path: `ppt/slides/_rels/slide${i + 1}.xml.rels`,\n };\n }\n\n // ContentTypes — AFTER slides so Charts.Array is populated\n file.Charts.Array.forEach((_, i) => {\n file.ContentTypes.addChart(i + 1);\n });\n file.SmartArts.Array.forEach((_, i) => {\n file.ContentTypes.addDiagramData(i + 1);\n file.ContentTypes.addDiagramLayout(i + 1);\n file.ContentTypes.addDiagramStyle(i + 1);\n file.ContentTypes.addDiagramColors(i + 1);\n file.ContentTypes.addDiagramDrawing(i + 1);\n });\n mapping[\"ContentTypes\"] = {\n data: xml(this.formatter.format(file.ContentTypes, context), {\n declaration: false,\n }),\n path: \"[Content_Types].xml\",\n };\n\n // Convert mapping to Zippable (XML files: STORE, no compression benefit)\n const files: Zippable = {};\n for (const key of Object.keys(mapping)) {\n const entry = mapping[key];\n files[entry.path] = [textToUint8Array(entry.data), { level: 0 }];\n }\n\n // Add overrides\n for (const override of overrides) {\n files[override.path] =\n override.data instanceof Uint8Array\n ? override.data\n : textToUint8Array(override.data);\n }\n\n // Add chart parts (STORE — XML, no compression benefit)\n for (let i = 0; i < file.Charts.Array.length; i++) {\n const chartData = file.Charts.Array[i];\n files[`ppt/charts/chart${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(chartData.chartSpace, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n files[`ppt/charts/_rels/chart${i + 1}.xml.rels`] = [\n textToUint8Array(\n xml(\n {\n Relationships: {\n _attr: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n },\n },\n { declaration: { encoding: \"UTF-8\", standalone: \"yes\" } },\n ),\n ),\n { level: 0 },\n ];\n }\n\n // Add SmartArt diagram parts (STORE)\n for (let i = 0; i < file.SmartArts.Array.length; i++) {\n const smartArtData = file.SmartArts.Array[i];\n files[`ppt/diagrams/data${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(smartArtData.dataModel, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n files[`ppt/diagrams/layout${i + 1}.xml`] = [\n textToUint8Array(getLayoutXml(smartArtData.layout)),\n { level: 0 },\n ];\n files[`ppt/diagrams/quickStyle${i + 1}.xml`] = [\n textToUint8Array(getStyleXml(smartArtData.style)),\n { level: 0 },\n ];\n files[`ppt/diagrams/colors${i + 1}.xml`] = [\n textToUint8Array(getColorXml(smartArtData.color)),\n { level: 0 },\n ];\n files[`ppt/diagrams/drawing${i + 1}.xml`] = [\n textToUint8Array(DEFAULT_DRAWING_XML),\n { level: 0 },\n ];\n }\n\n // Add notes slides (STORE)\n for (let i = 0; i < file.NotesSlides.length; i++) {\n const notesSlide = file.NotesSlides[i];\n files[`ppt/notesSlides/notesSlide${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(notesSlide, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n files[`ppt/notesSlides/_rels/notesSlide${i + 1}.xml.rels`] = [\n textToUint8Array(\n xml(\n {\n Relationships: {\n _attr: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n },\n },\n { declaration: { encoding: \"UTF-8\", standalone: \"yes\" } },\n ),\n ),\n { level: 0 },\n ];\n }\n\n // Add comment authors (STORE)\n if (file.CommentAuthorList) {\n files[\"ppt/commentAuthors.xml\"] = [\n textToUint8Array(\n xml(this.formatter.format(file.CommentAuthorList, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n }\n\n // Add slide comments (STORE)\n const commentLists = file.SlideCommentLists;\n for (let i = 0; i < commentLists.length; i++) {\n if (commentLists[i]) {\n files[`ppt/comments/comment${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(commentLists[i]!, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n }\n }\n\n // Add media files (STORE compression)\n for (const image of file.Media.Array) {\n files[`ppt/media/${image.fileName}`] = [image.data, { level: 0 }];\n if (image.type === \"svg\" && \"fallback\" in image) {\n const fallback = (\n image as import(\"@file/media/data\").IMediaData & {\n readonly fallback: { readonly fileName: string; readonly data: Uint8Array };\n }\n ).fallback;\n files[`ppt/media/${fallback.fileName}`] = [fallback.data, { level: 0 }];\n }\n }\n\n return files;\n }\n}\n\nfunction textToUint8Array(data: string | Uint8Array): Uint8Array {\n if (data instanceof Uint8Array) {\n return data;\n }\n return new TextEncoder().encode(data);\n}\n","import { Readable } from \"stream\";\n\nimport type { File } from \"@file/file\";\nimport { convertOutput, convertPrettifyType, OoxmlMimeType, PrettifyType } from \"@office-open/core\";\nexport { PrettifyType } from \"@office-open/core\";\nimport type { IXmlifyedFile, OutputByType, OutputType } from \"@office-open/core\";\nimport { type ZipOptions, Zip, ZipDeflate, ZipPassThrough, zipSync } from \"fflate\";\n\nimport { Compiler } from \"./next-compiler\";\n\nexport class Packer {\n public static async pack<T extends OutputType>(\n file: File,\n type: T,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<OutputByType[T]> {\n const files = this.compiler.compile(file, convertPrettifyType(prettify), overrides);\n const zipped = zipSync(files, { level: 6 });\n return convertOutput(zipped, type, OoxmlMimeType.PPTX);\n }\n\n public static async toString(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<string> {\n return Packer.pack(file, \"string\", prettify, overrides);\n }\n\n public static toArrayBuffer(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<ArrayBuffer> {\n return Packer.pack(file, \"arraybuffer\", prettify, overrides);\n }\n\n public static toBuffer(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<Buffer> {\n return Packer.pack(file, \"nodebuffer\", prettify, overrides);\n }\n\n public static toBlob(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<Blob> {\n return Packer.pack(file, \"blob\", prettify, overrides);\n }\n\n public static toBase64String(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<string> {\n return Packer.pack(file, \"base64\", prettify, overrides);\n }\n\n public static toStream(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Readable {\n const stream = new Readable({ read() {} });\n\n try {\n const files = this.compiler.compile(file, convertPrettifyType(prettify), overrides);\n\n const zip = new Zip((err, chunk, final) => {\n if (err) {\n stream.destroy(err);\n return;\n }\n if (!stream.destroyed) {\n stream.push(Buffer.from(chunk));\n }\n if (final) {\n stream.push(null);\n }\n });\n\n for (const [name, data] of Object.entries(files)) {\n const raw = Array.isArray(data) ? (data[0] as Uint8Array) : (data as Uint8Array);\n const level = Array.isArray(data) ? ((data[1] as ZipOptions).level ?? 6) : 6;\n const entry =\n level === 0 ? new ZipPassThrough(name) : new ZipDeflate(name, { level });\n zip.add(entry);\n entry.push(raw, true);\n }\n\n zip.end();\n } catch (err) {\n stream.destroy(err instanceof Error ? err : new Error(String(err)));\n }\n\n return stream;\n }\n\n private static readonly compiler = new Compiler();\n}\n","export {\n convertPixelsToEmu,\n convertEmuToPixels,\n convertInchesToEmu,\n convertEmuToInches,\n convertPointsToEmu,\n convertEmuToPoints,\n} from \"@office-open/core\";\n\n/** Convert percentage to thousandths of a percent (used in some OOXML attributes) */\nexport const percentToTHousandths = (percent: number): number => Math.round(percent * 1000);\n\n/** Common slide size presets (in pixels at 96 DPI) */\nexport const SlideSizePreset = {\n WIDE: { width: 960, height: 540 },\n STANDARD_4X3: { width: 720, height: 540 },\n WIDESCREEN_16X10: { width: 960, height: 600 },\n WIDESCREEN_16X9: { width: 960, height: 540 },\n} as const;\n","export * from \"./convenience-functions\";\nexport * from \"./types\";\nexport * from \"./values\";\n","import type { ParsedDocument } from \"@office-open/core\";\nimport { parseDocument } from \"@office-open/core\";\nimport type { Element } from \"@office-open/xml\";\nimport { attr } from \"@office-open/xml\";\n\nexport { parseDocument };\n\n/**\n * All part paths extracted from the PPTX package.\n * Field names correspond directly to the OOXML directory structure.\n */\nexport interface PptxPartRefs {\n /** ppt/theme/themeN.xml */\n themes: string[];\n /** ppt/notesMasters/notesMasterN.xml */\n notesMasters: string[];\n /** ppt/commentAuthors.xml */\n commentAuthors?: string;\n /** ppt/comments/commentN.xml (from slide rels) */\n comments: string[];\n /** ppt/charts/chartN.xml (from slide rels) */\n charts: string[];\n /** ppt/diagrams/dataN.xml (from slide rels) */\n diagramData: string[];\n /** ppt/media/* (all media files) */\n media: string[];\n}\n\nexport interface PptxDocument {\n doc: ParsedDocument;\n /** ppt/presentation.xml root element (p:presentation) */\n presentation?: Element;\n /** ppt/slides/slideN.xml */\n slides: string[];\n /** ppt/slideMasters/slideMasterN.xml */\n slideMasters: string[];\n /** ppt/slideLayouts/slideLayoutN.xml */\n slideLayouts: string[];\n /** ppt/notesSlides/notesSlideN.xml */\n notesSlides: string[];\n partRefs: PptxPartRefs;\n /** ppt/presProps.xml */\n presProps?: string;\n /** ppt/viewProps.xml */\n viewProps?: string;\n /** ppt/tableStyles.xml */\n tableStyles?: string;\n /** docProps/core.xml */\n coreProps?: string;\n /** docProps/app.xml */\n appProps?: string;\n}\n\nfunction resolveRelsPath(target: string): string {\n if (target.startsWith(\"/\")) return target.slice(1);\n if (target.startsWith(\"../\")) return target.replace(\"../\", \"\");\n return `ppt/${target}`;\n}\n\nfunction sortByNumber(paths: string[]): string[] {\n return paths.sort((a, b) => {\n const numA = parseInt(a.match(/(\\d+)/)?.[1] ?? \"0\", 10);\n const numB = parseInt(b.match(/(\\d+)/)?.[1] ?? \"0\", 10);\n return numA - numB;\n });\n}\n\nfunction xmlKeys(keys: string[]): string[] {\n return keys.filter((k) => k.endsWith(\".xml\"));\n}\n\nfunction parseRootRels(doc: ParsedDocument): { coreProps?: string; appProps?: string } {\n const relsEl = doc.get(\"_rels/.rels\");\n if (!relsEl) return {};\n\n let coreProps: string | undefined;\n let appProps: string | undefined;\n\n for (const child of relsEl.elements ?? []) {\n if (child.name !== \"Relationship\") continue;\n const type = attr(child, \"Type\") ?? \"\";\n const target = attr(child, \"Target\") ?? \"\";\n if (!target) continue;\n\n const path = target.startsWith(\"/\") ? target.slice(1) : target;\n\n if (type.includes(\"/core-properties\")) {\n coreProps = path;\n } else if (type.includes(\"/extended-properties\")) {\n appProps = path;\n }\n }\n\n return { coreProps, appProps };\n}\n\nfunction parseSlideRels(doc: ParsedDocument, slidePaths: string[], refs: PptxPartRefs): void {\n for (const slidePath of slidePaths) {\n const parts = slidePath.split(\"/\");\n const fileName = parts.pop()!;\n const relsPath = `${parts.join(\"/\")}/_rels/${fileName}.rels`;\n\n const relsEl = doc.get(relsPath);\n if (!relsEl) continue;\n\n for (const child of relsEl.elements ?? []) {\n if (child.name !== \"Relationship\") continue;\n const type = attr(child, \"Type\") ?? \"\";\n const target = attr(child, \"Target\") ?? \"\";\n if (!target) continue;\n\n const path = resolveRelsPath(target);\n\n if (type.includes(\"/comments\") && !type.includes(\"commentAuthors\")) {\n if (!refs.comments.includes(path)) refs.comments.push(path);\n } else if (type.includes(\"/chart\")) {\n if (!refs.charts.includes(path)) refs.charts.push(path);\n } else if (type.includes(\"/diagramData\")) {\n if (!refs.diagramData.includes(path)) refs.diagramData.push(path);\n } else if (\n type.includes(\"/image\") ||\n type.includes(\"/video\") ||\n type.includes(\"/media\")\n ) {\n if (!refs.media.includes(path)) refs.media.push(path);\n }\n }\n }\n}\n\nexport function parsePptx(data: Uint8Array): PptxDocument {\n const doc = parseDocument(data);\n\n const presentation = doc.get(\"ppt/presentation.xml\");\n\n const relsXml = doc.get(\"ppt/_rels/presentation.xml.rels\");\n const slides: string[] = [];\n const slideMasters: string[] = [];\n const themes: string[] = [];\n const notesMasters: string[] = [];\n let presProps: string | undefined;\n let viewProps: string | undefined;\n let tableStyles: string | undefined;\n let commentAuthors: string | undefined;\n\n if (relsXml) {\n for (const child of relsXml.elements ?? []) {\n if (child.name !== \"Relationship\") continue;\n const type = attr(child, \"Type\") ?? \"\";\n const target = attr(child, \"Target\") ?? \"\";\n if (!target) continue;\n\n const path = resolveRelsPath(target);\n\n if (type.includes(\"/slideMaster\")) {\n slideMasters.push(path);\n } else if (\n type.includes(\"/slide\") &&\n !type.includes(\"slideLayout\") &&\n !type.includes(\"slideMaster\")\n ) {\n slides.push(path);\n } else if (type.includes(\"/theme\")) {\n themes.push(path);\n } else if (type.includes(\"/notesMaster\")) {\n notesMasters.push(path);\n } else if (type.includes(\"/presProps\")) {\n presProps = path;\n } else if (type.includes(\"/viewProps\")) {\n viewProps = path;\n } else if (type.includes(\"/tableStyles\")) {\n tableStyles = path;\n } else if (type.includes(\"/commentAuthors\")) {\n commentAuthors = path;\n }\n }\n }\n\n sortByNumber(slides);\n sortByNumber(slideMasters);\n sortByNumber(themes);\n sortByNumber(notesMasters);\n\n const slideLayouts = sortByNumber(xmlKeys(doc.keys(\"ppt/slideLayouts/\")));\n const notesSlides = sortByNumber(xmlKeys(doc.keys(\"ppt/notesSlides/\")));\n\n const partRefs: PptxPartRefs = {\n themes,\n notesMasters,\n commentAuthors,\n comments: [],\n charts: [],\n diagramData: [],\n media: doc.keys(\"ppt/media/\"),\n };\n\n parseSlideRels(doc, slides, partRefs);\n sortByNumber(partRefs.comments);\n sortByNumber(partRefs.charts);\n sortByNumber(partRefs.diagramData);\n\n const { coreProps, appProps } = parseRootRels(doc);\n\n return {\n doc,\n presentation,\n slides,\n slideMasters,\n slideLayouts,\n notesSlides,\n partRefs,\n presProps,\n viewProps,\n tableStyles,\n coreProps,\n appProps,\n };\n}\n","export { File as Presentation } from \"./file\";\nexport * from \"./file\";\nexport * from \"./export\";\nexport * from \"./util\";\nexport * from \"./parse\";\n"],"mappings":";;;;;;;;;;AAyHA,SAAS,QAAQ,OAAgB,OAAgB;AAC7C,KAAI,CAAC,MAAO,QAAO;EAAE,OAAO;EAAU,QAAQ,SAAS,MAAM;EAAM;AACnE,QAAO;EAAE,OAAO,MAAM,QAAQ,KAAK,GAAG;EAAE,QAAQ,SAAS,MAAM;EAAM;;;AAIzE,SAAS,cAAc,MAAsB;AACzC,QAAO;EACH,YAAY,KAAK;EACjB,UAAU,KAAK;EACf,WAAW,KAAK;EAChB,cAAc,KAAK,oBAAoB,QAAQ,QAAQ,KAAA;EACvD,OAAO,QAAQ,KAAK,OAAO,KAAK,MAAM;EACzC;;;AAIL,SAAS,cAAc,MAAsB;AACzC,QAAO;EACH,YAAY,KAAK;EACjB,UAAU,KAAK;EACf,WAAW,KAAK;EAChB,OAAO,QAAQ,KAAK,OAAO,KAAK,MAAM;EACzC;;;AAIL,SAAS,OAAO,MAAoB;AAChC,QAAO;EACH,QAAQ,KAAK,UAAU;EACvB,OAA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,KAAK,SAAS,SAAS,CAC9B,QAAO,KAAK,KAAK;WACV,KAAK,SAAS,eAAe,CACpC,cAAa,KAAK,KAAK;WAChB,KAAK,SAAS,aAAa,CAClC,aAAY;WACL,KAAK,SAAS,aAAa,CAClC,aAAY;WACL,KAAK,SAAS,eAAe,CACpC,eAAc;WACP,KAAK,SAAS,kBAAkB,CACvC,kBAAiB;;AAK7B,cAAa,OAAO;AACpB,cAAa,aAAa;AAC1B,cAAa,OAAO;AACpB,cAAa,aAAa;CAE1B,MAAM,eAAe,aAAa,QAAQ,IAAI,KAAK,oBAAoB,CAAC,CAAC;CACzE,MAAM,cAAc,aAAa,QAAQ,IAAI,KAAK,mBAAmB,CAAC,CAAC;CAEvE,MAAM,WAAyB;EAC3B;EACA;EACA;EACA,UAAU,EAAE;EACZ,QAAQ,EAAE;EACV,aAAa,EAAE;EACf,OAAO,IAAI,KAAK,aAAa;EAChC;AAED,gBAAe,KAAK,QAAQ,SAAS;AACrC,cAAa,SAAS,SAAS;AAC/B,cAAa,SAAS,OAAO;AAC7B,cAAa,SAAS,YAAY;CAElC,MAAM,EAAE,WAAW,aAAa,cAAc,IAAI;AAElD,QAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACH"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["createScene3D","createShape3D","createEffectList","convertPixelsToEmu","createOutline","createEffectList","SW_REF","sx","convertPixelsToEmu","buildChildrenXml","convertPixelsToEmu","convertPixelsToEmu","createOutline","convertPixelsToEmu","Xc","convertPixelsToEmu","Xc","convertPixelsToEmu","convertPixelsToEmu","MEDIA_EXT_URI","convertPixelsToEmu","GraphicFrameNonVisual","GraphicFrameNonVisual","GraphicFrameNonVisual"],"sources":["../src/file/drawingml/effects.ts","../src/file/drawingml/fill.ts","../src/file/xml-components/base.ts","../src/file/xml-components/index.ts","../src/file/background/background.ts","../src/file/chart/chart-collection.ts","../src/file/comment/comment-author-list.ts","../src/file/comment/slide-comment-list.ts","../src/file/content-types/content-types.ts","../src/file/core-properties/properties.ts","../src/file/hyperlink-collection.ts","../src/file/media/media.ts","../src/file/drawingml/group-transform-2d.ts","../src/file/drawingml/group-shape-properties.ts","../src/file/shape-tree/group-shape-non-visual.ts","../src/file/shape/paragraph/end-paragraph-run.ts","../src/file/shape/paragraph/paragraph-properties.ts","../src/file/constants.ts","../src/file/shape/paragraph/run-properties.ts","../src/file/shape/paragraph/run.ts","../src/file/shape/paragraph/paragraph.ts","../src/file/table/table-cell-properties.ts","../src/file/table/table-cell.ts","../src/file/shape/text-body.ts","../src/file/notes/notes-slide.ts","../src/file/presentation-properties.ts","../src/file/presentation/presentation.ts","../src/file/presentation/presentation-wrapper.ts","../src/file/slide-layout/slide-layout.ts","../src/file/slide-master/slide-master.ts","../src/file/animation/timing.ts","../src/file/transition/transition.ts","../src/file/slide/slide.ts","../src/file/table-styles.ts","../src/file/theme/theme.ts","../src/file/view-properties.ts","../src/file/file.ts","../src/file/drawingml/outline.ts","../src/file/drawingml/transform-2d.ts","../src/file/drawingml/shape-properties.ts","../src/util/position.ts","../src/file/shape/shape.ts","../src/file/shape/paragraph/text.ts","../src/file/shape/paragraph/field.ts","../src/file/drawingml/blip-fill.ts","../src/file/drawingml/non-visual-drawing-props.ts","../src/file/drawingml/non-visual-shape-props.ts","../src/file/drawingml/non-visual-picture-props.ts","../src/file/shape/group-shape.ts","../src/file/shape/line-shape.ts","../src/file/media/media-frame-base.ts","../src/file/media/video-frame.ts","../src/file/media/audio-frame.ts","../src/file/shape-tree/shape-tree.ts","../src/file/notes-master/notes-master.ts","../src/file/header-footer/header-footer.ts","../src/file/picture/picture-non-visual.ts","../src/file/picture/picture.ts","../src/file/table/graphic.ts","../src/file/table/graphic-frame-non-visual.ts","../src/file/table/table-grid.ts","../src/file/table/table-properties.ts","../src/file/table/table-row.ts","../src/file/table/table.ts","../src/file/table/table-frame.ts","../src/file/chart/chart-frame.ts","../src/file/smartart/smartart-frame.ts","../src/file/index.ts","../src/export/packer/hyperlink-placeholders.ts","../src/export/packer/media-placeholders.ts","../src/export/packer/next-compiler.ts","../src/export/packer/packer.ts","../src/util/types.ts","../src/util/index.ts","../src/parse.ts","../src/index.ts"],"sourcesContent":["import {\n createEffectList,\n createScene3D,\n createShape3D,\n type EffectListOptions,\n type Scene3DOptions,\n type Shape3DOptions,\n type BevelOptions,\n} from \"@office-open/core/drawingml\";\n\nexport type EffectType = \"outerShadow\" | \"innerShadow\" | \"glow\" | \"reflection\" | \"softEdge\";\n\nexport const ReflectionAlignment = {\n TOP_LEFT: \"tl\",\n TOP: \"t\",\n TOP_RIGHT: \"tr\",\n LEFT: \"l\",\n CENTER: \"ctr\",\n RIGHT: \"r\",\n BOTTOM_LEFT: \"bl\",\n BOTTOM: \"b\",\n BOTTOM_RIGHT: \"br\",\n} as const;\n\nexport interface IShadowOptions {\n readonly blur?: number;\n readonly distance?: number;\n readonly direction?: number;\n readonly color?: string;\n readonly alpha?: number;\n readonly rotateWithShape?: boolean;\n}\n\nexport interface IGlowOptions {\n readonly radius?: number;\n readonly color?: string;\n readonly alpha?: number;\n}\n\nexport interface IReflectionOptions {\n readonly blurRadius?: number;\n readonly distance?: number;\n readonly direction?: number;\n readonly startAlpha?: number;\n readonly startPosition?: number;\n readonly endAlpha?: number;\n readonly endPosition?: number;\n readonly fadeDirection?: number;\n readonly scaleX?: number;\n readonly scaleY?: number;\n readonly skewX?: number;\n readonly skewY?: number;\n readonly alignment?: keyof typeof ReflectionAlignment;\n readonly rotateWithShape?: boolean;\n}\n\nexport interface ISoftEdgeOptions {\n readonly radius?: number;\n}\n\nexport interface IBevelOptions {\n readonly width?: number;\n readonly height?: number;\n}\n\nexport interface IRotation3DOptions {\n readonly x?: number;\n readonly y?: number;\n readonly z?: number;\n readonly perspective?: number;\n}\n\nexport interface IEffectsOptions {\n readonly outerShadow?: IShadowOptions;\n readonly innerShadow?: IShadowOptions;\n readonly glow?: IGlowOptions;\n readonly reflection?: IReflectionOptions;\n readonly softEdge?: ISoftEdgeOptions;\n readonly rotation3D?: IRotation3DOptions;\n readonly bevelTop?: IBevelOptions;\n readonly bevelBottom?: IBevelOptions;\n readonly extrusionH?: number;\n readonly material?:\n | \"plastic\"\n | \"metal\"\n | \"matte\"\n | \"warmMatte\"\n | \"softEdge\"\n | \"flat\"\n | \"powder\";\n readonly lighting?:\n | \"flat\"\n | \"legacyFlat1\"\n | \"legacyFlat2\"\n | \"legacyFlat3\"\n | \"legacyFlat4\"\n | \"legacyHarsh1\"\n | \"legacyHarsh2\"\n | \"legacyHarsh3\"\n | \"legacyHarsh4\"\n | \"legacyNormal1\"\n | \"legacyNormal2\"\n | \"legacyNormal3\"\n | \"legacyNormal4\"\n | \"threePt\"\n | \"balanced\"\n | \"soft\"\n | \"harsh\"\n | \"flood\"\n | \"contrasting\"\n | \"morning\"\n | \"sunrise\"\n | \"sunset\"\n | \"chilly\"\n | \"freezing\"\n | \"twoPt\"\n | \"brightRoom\"\n | \"gallery\";\n}\n\n/** Convert PPTX simple color to core SolidFillOptions. */\nfunction toColor(color?: string, alpha?: number) {\n if (!color) return { value: \"000000\", alpha: (alpha ?? 40) * 1000 };\n return { value: color.replace(\"#\", \"\"), alpha: (alpha ?? 40) * 1000 };\n}\n\n/** Convert PPTX IShadowOptions to core OuterShadowEffectOptions. */\nfunction toOuterShadow(opts: IShadowOptions) {\n return {\n blurRadius: opts.blur,\n distance: opts.distance,\n direction: opts.direction,\n rotWithShape: opts.rotateWithShape === false ? false : undefined,\n color: toColor(opts.color, opts.alpha),\n };\n}\n\n/** Convert PPTX IShadowOptions to core InnerShadowEffectOptions. */\nfunction toInnerShadow(opts: IShadowOptions) {\n return {\n blurRadius: opts.blur,\n distance: opts.distance,\n direction: opts.direction,\n color: toColor(opts.color, opts.alpha),\n };\n}\n\n/** Convert PPTX IGlowOptions to core GlowEffectOptions. */\nfunction toGlow(opts: IGlowOptions) {\n return {\n radius: opts.radius ?? 152400,\n color: toColor(opts.color, opts.alpha),\n };\n}\n\n/** Convert PPTX IReflectionOptions to core ReflectionEffectOptions. */\nfunction toReflection(opts: IReflectionOptions) {\n const result: Record<string, number | string> = {};\n if (opts.blurRadius !== undefined) result.blurRadius = opts.blurRadius;\n if (opts.distance !== undefined) result.distance = opts.distance;\n if (opts.direction !== undefined) result.direction = opts.direction;\n if (opts.startAlpha !== undefined) result.startAlpha = opts.startAlpha * 1000;\n if (opts.startPosition !== undefined) result.startPosition = opts.startPosition * 1000;\n if (opts.endAlpha !== undefined) result.endAlpha = opts.endAlpha * 1000;\n if (opts.endPosition !== undefined) result.endPosition = opts.endPosition * 1000;\n if (opts.fadeDirection !== undefined) result.fadeDirection = opts.fadeDirection * 60000;\n if (opts.scaleX !== undefined) result.scaleX = opts.scaleX * 1000;\n if (opts.scaleY !== undefined) result.scaleY = opts.scaleY * 1000;\n if (opts.skewX !== undefined) result.skewX = opts.skewX * 60000;\n if (opts.skewY !== undefined) result.skewY = opts.skewY * 60000;\n if (opts.alignment !== undefined) result.alignment = ReflectionAlignment[opts.alignment];\n if (opts.rotateWithShape === false) result.rotWithShape = 0;\n return result;\n}\n\n/** Convert PPTX IBevelOptions to core BevelOptions. */\nfunction toBevel(opts: IBevelOptions): BevelOptions {\n return {\n ...(opts.width !== undefined && { w: opts.width * 12700 }),\n ...(opts.height !== undefined && { h: opts.height * 12700 }),\n };\n}\n\n/** Map PPTX IEffectsOptions to core EffectListOptions. */\nfunction toEffectListOptions(opts: IEffectsOptions): EffectListOptions | undefined {\n const hasEffects =\n opts.outerShadow || opts.innerShadow || opts.glow || opts.reflection || opts.softEdge;\n if (!hasEffects) return undefined;\n\n return {\n outerShadow: opts.outerShadow ? toOuterShadow(opts.outerShadow) : undefined,\n innerShadow: opts.innerShadow ? toInnerShadow(opts.innerShadow) : undefined,\n glow: opts.glow ? toGlow(opts.glow) : undefined,\n reflection: opts.reflection ? toReflection(opts.reflection) : undefined,\n softEdge: opts.softEdge ? (opts.softEdge.radius ?? 50800) : undefined,\n };\n}\n\n/** Map PPTX IEffectsOptions to core Scene3DOptions, or null if not needed. */\nexport function buildScene3D(options: IEffectsOptions): ReturnType<typeof createScene3D> | null {\n if (!options.rotation3D && !options.lighting) return null;\n\n const cameraPreset = options.rotation3D?.perspective\n ? \"legacyPerspectiveFront\"\n : \"orthographicFront\";\n const cameraOpts = {\n preset: cameraPreset,\n ...(options.rotation3D?.perspective && { fov: options.rotation3D.perspective }),\n ...(options.rotation3D && {\n rotation: {\n lat: (options.rotation3D.x ?? 0) * 60000,\n lon: (options.rotation3D.y ?? 0) * 60000,\n rev: (options.rotation3D.z ?? 0) * 60000,\n },\n }),\n };\n\n return createScene3D({\n camera: cameraOpts as Scene3DOptions[\"camera\"],\n lightRig: { rig: options.lighting ?? \"threePt\", direction: \"t\" },\n });\n}\n\n/** Map PPTX IEffectsOptions to core Shape3DOptions, or null if not needed. */\nexport function buildShape3D(options: IEffectsOptions): ReturnType<typeof createShape3D> | null {\n if (!options.extrusionH && !options.bevelTop && !options.bevelBottom && !options.material)\n return null;\n\n const shape3dOpts: Shape3DOptions = {\n ...(options.bevelTop ? { bevelT: toBevel(options.bevelTop) } : {}),\n ...(options.bevelBottom ? { bevelB: toBevel(options.bevelBottom) } : {}),\n ...(options.extrusionH !== undefined ? { extrusionH: options.extrusionH } : {}),\n ...(options.material\n ? { prstMaterial: options.material as Shape3DOptions[\"prstMaterial\"] }\n : {}),\n };\n\n return createShape3D(shape3dOpts);\n}\n\n/** Create a:effectLst from PPTX simplified IEffectsOptions. */\nexport function createPptxEffectList(options: IEffectsOptions) {\n const effectListOpts = toEffectListOptions(options);\n return effectListOpts ? createEffectList(effectListOpts) : null;\n}\n\n// Re-export core types for advanced users\nexport type { EffectListOptions, Scene3DOptions, Shape3DOptions, BevelOptions };\n","export {\n buildFill,\n extractBlipFillMedia,\n type BlipFillConfigOptions,\n type BlipFillMediaData,\n type FillOptions,\n type GradientStopOptions,\n} from \"@office-open/core/drawingml\";\n","/**\n * Base XML Component infrastructure for PPTX documents.\n * Re-exports from core for local path alias usage.\n *\n * @module\n */\nexport { BaseXmlComponent } from \"@office-open/core\";\nexport type { IContext, IXmlableObject } from \"@office-open/core\";\n","/**\n * XML Components module — re-exports from core + pptx-specific additions.\n *\n * @module\n */\n// Core re-exports\nexport { BaseXmlComponent } from \"./base\";\nexport type { IContext, IXmlableObject } from \"./base\";\nexport { XmlComponent, IgnoreIfEmptyXmlComponent, EMPTY_OBJECT } from \"@office-open/core\";\nexport { XmlAttributeComponent, NextAttributeComponent } from \"@office-open/core\";\nexport type { AttributeMap, AttributeData, AttributePayload } from \"@office-open/core\";\nexport {\n OnOffElement,\n HpsMeasureElement,\n EmptyElement,\n StringValueElement,\n NumberValueElement,\n StringEnumValueElement,\n StringContainer,\n BuilderElement,\n chartAttr,\n wrapEl,\n} from \"@office-open/core\";\nexport {\n ImportedXmlComponent,\n ImportedRootElementAttributes,\n convertToXmlComponent,\n} from \"@office-open/core\";\nexport { InitializableXmlComponent } from \"@office-open/core\";\n","import type { IEffectsOptions } from \"@file/drawingml/effects\";\nimport { createPptxEffectList } from \"@file/drawingml/effects\";\nimport type { FillOptions } from \"@file/drawingml/fill\";\nimport { buildFill } from \"@file/drawingml/fill\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nexport interface IBackgroundOptions {\n readonly fill?: FillOptions;\n readonly effects?: IEffectsOptions;\n readonly shadeToTitle?: boolean;\n}\n\n/**\n * p:bg — Slide background.\n */\nexport class Background extends XmlComponent {\n public constructor(options: IBackgroundOptions = {}) {\n super(\"p:bg\");\n this.root.push(new BackgroundProperties(options));\n }\n}\n\nclass BackgroundProperties extends XmlComponent {\n private readonly shadeToTitle: boolean;\n\n public constructor(options: IBackgroundOptions) {\n super(\"p:bgPr\");\n this.shadeToTitle = !!options.shadeToTitle;\n this.root.push(\n options.fill !== undefined ? buildFill(options.fill) : buildFill({ type: \"none\" }),\n );\n if (options.effects) {\n const el = createPptxEffectList(options.effects);\n if (el) this.root.push(el);\n }\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n const obj = super.prepForXml(context);\n if (!obj) return undefined;\n // shadeToTitle is an attribute of p:bgPr, not a child element\n if (this.shadeToTitle && \"p:bgPr\" in obj) {\n const children = (obj as Record<string, unknown>)[\"p:bgPr\"] as Record<\n string,\n unknown\n >[];\n for (const child of children) {\n if (\"_attr\" in child) {\n (child as { _attr: Record<string, unknown> })._attr.shadeToTitle = 1;\n return obj;\n }\n }\n // No _attr found — insert one\n children.unshift({ _attr: { shadeToTitle: 1 } });\n }\n return obj;\n }\n}\n","export { ChartCollection, type IChartData } from \"@office-open/core/chart\";\n","import { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\n\nexport interface AuthorEntry {\n readonly id: number;\n readonly name: string;\n readonly initials: string;\n readonly clrIdx: number;\n readonly lastIdx: number;\n}\n\n/**\n * p:cmAuthorLst — Comment author list stored in `ppt/commentAuthors.xml`.\n */\nexport class CommentAuthorList extends XmlComponent {\n public constructor(authors: readonly AuthorEntry[]) {\n super(\"p:cmAuthorLst\");\n this.root.push(\n new NextAttributeComponent({\n \"xmlns:p\": {\n key: \"xmlns:p\",\n value: \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n }),\n );\n for (const author of authors) {\n this.root.push(\n new BuilderElement({\n name: \"p:cmAuthor\",\n attributes: {\n id: { key: \"id\", value: author.id },\n name: { key: \"name\", value: author.name },\n initials: { key: \"initials\", value: author.initials },\n clrIdx: { key: \"clrIdx\", value: author.clrIdx },\n lastIdx: { key: \"lastIdx\", value: author.lastIdx },\n },\n }),\n );\n }\n }\n}\n","import { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\n\nexport interface CommentEntry {\n readonly authorId: number;\n readonly idx: number;\n readonly date?: string;\n readonly x: number;\n readonly y: number;\n readonly text: string;\n}\n\n/**\n * p:cmLst — Comment list stored in `ppt/comments/slideN.xml`.\n */\nexport class SlideCommentList extends XmlComponent {\n public constructor(comments: readonly CommentEntry[]) {\n super(\"p:cmLst\");\n this.root.push(\n new NextAttributeComponent({\n \"xmlns:p\": {\n key: \"xmlns:p\",\n value: \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n }),\n );\n for (const comment of comments) {\n this.root.push(\n new BuilderElement({\n name: \"p:cm\",\n attributes: {\n authorId: { key: \"authorId\", value: comment.authorId },\n idx: { key: \"idx\", value: comment.idx },\n ...(comment.date != null ? { dt: { key: \"dt\", value: comment.date } } : {}),\n },\n children: [\n new BuilderElement({\n name: \"p:pos\",\n attributes: {\n x: { key: \"x\", value: comment.x },\n y: { key: \"y\", value: comment.y },\n },\n }),\n new BuilderElement({\n name: \"p:text\",\n children: [comment.text],\n }),\n ],\n }),\n );\n }\n }\n}\n","/**\n * Content Types module for PPTX packages.\n *\n * @module\n */\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nconst PPTX_MAIN =\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\";\nconst PPTX_SLIDE = \"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\";\nconst PPTX_SLIDE_MASTER =\n \"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\";\nconst PPTX_SLIDE_LAYOUT =\n \"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\";\nconst PPTX_THEME = \"application/vnd.openxmlformats-officedocument.theme+xml\";\nconst PPTX_NOTES = \"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\";\nconst PPTX_COMMENTS = \"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\";\nconst PPTX_COMMENT_AUTHORS =\n \"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml\";\nconst PPTX_CHART = \"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\";\nconst PPTX_PRES_PROPS =\n \"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml\";\nconst PPTX_VIEW_PROPS =\n \"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml\";\nconst PPTX_TABLE_STYLES =\n \"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml\";\n\ntype EntryType = \"Default\" | \"Override\";\n\ninterface ContentEntry {\n readonly type: EntryType;\n readonly contentType: string;\n readonly key: string;\n}\n\nconst STATIC_ENTRIES: readonly ContentEntry[] = [\n {\n type: \"Default\",\n contentType: \"application/vnd.openxmlformats-package.relationships+xml\",\n key: \"rels\",\n },\n { type: \"Default\", contentType: \"application/xml\", key: \"xml\" },\n { type: \"Default\", contentType: \"image/png\", key: \"png\" },\n { type: \"Default\", contentType: \"image/jpeg\", key: \"jpeg\" },\n { type: \"Default\", contentType: \"image/jpeg\", key: \"jpg\" },\n { type: \"Default\", contentType: \"video/mp4\", key: \"mp4\" },\n { type: \"Override\", contentType: PPTX_MAIN, key: \"/ppt/presentation.xml\" },\n {\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-package.core-properties+xml\",\n key: \"/docProps/core.xml\",\n },\n {\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n key: \"/docProps/app.xml\",\n },\n { type: \"Override\", contentType: PPTX_THEME, key: \"/ppt/theme/theme1.xml\" },\n { type: \"Override\", contentType: PPTX_PRES_PROPS, key: \"/ppt/presProps.xml\" },\n { type: \"Override\", contentType: PPTX_VIEW_PROPS, key: \"/ppt/viewProps.xml\" },\n { type: \"Override\", contentType: PPTX_TABLE_STYLES, key: \"/ppt/tableStyles.xml\" },\n];\n\nconst STATIC_CHILDREN: IXmlableObject[] = [\n { _attr: { xmlns: \"http://schemas.openxmlformats.org/package/2006/content-types\" } },\n ...STATIC_ENTRIES.map((e) => {\n if (e.type === \"Default\") {\n return { Default: { _attr: { ContentType: e.contentType, Extension: e.key } } };\n }\n return { Override: { _attr: { ContentType: e.contentType, PartName: e.key } } };\n }),\n];\n\nexport class ContentTypes extends BaseXmlComponent {\n private readonly dynamicEntries: ContentEntry[] = [];\n\n public constructor() {\n super(\"Types\");\n }\n\n public addSlide(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_SLIDE,\n key: `/ppt/slides/slide${index}.xml`,\n });\n }\n\n public addNotesSlide(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_NOTES,\n key: `/ppt/notesSlides/notesSlide${index}.xml`,\n });\n }\n\n public addComments(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_COMMENTS,\n key: `/ppt/comments/comment${index}.xml`,\n });\n }\n\n public addCommentAuthors(): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_COMMENT_AUTHORS,\n key: \"/ppt/commentAuthors.xml\",\n });\n }\n\n public addChart(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_CHART,\n key: `/ppt/charts/chart${index}.xml`,\n });\n }\n\n public addDiagramData(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml\",\n key: `/ppt/diagrams/data${index}.xml`,\n });\n }\n\n public addDiagramLayout(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType:\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml\",\n key: `/ppt/diagrams/layout${index}.xml`,\n });\n }\n\n public addDiagramStyle(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: \"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml\",\n key: `/ppt/diagrams/quickStyle${index}.xml`,\n });\n }\n\n public addDiagramColors(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType:\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml\",\n key: `/ppt/diagrams/colors${index}.xml`,\n });\n }\n\n public addDiagramDrawing(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: \"application/vnd.ms-office.drawingml.diagramDrawing+xml\",\n key: `/ppt/diagrams/drawing${index}.xml`,\n });\n }\n\n public addSlideLayout(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_SLIDE_LAYOUT,\n key: `/ppt/slideLayouts/slideLayout${index}.xml`,\n });\n }\n\n public addSlideMaster(index: number): void {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_SLIDE_MASTER,\n key: `/ppt/slideMasters/slideMaster${index}.xml`,\n });\n }\n\n public addTheme(index: number): void {\n if (index !== 1) {\n this.dynamicEntries.push({\n type: \"Override\",\n contentType: PPTX_THEME,\n key: `/ppt/theme/theme${index}.xml`,\n });\n }\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n const children = [...STATIC_CHILDREN];\n for (const e of this.dynamicEntries) {\n if (e.type === \"Default\") {\n children.push({\n Default: { _attr: { ContentType: e.contentType, Extension: e.key } },\n });\n } else {\n children.push({\n Override: { _attr: { ContentType: e.contentType, PartName: e.key } },\n });\n }\n }\n return { Types: children };\n }\n}\n","/**\n * Core Properties module for PresentationML documents.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCore.xsd\n *\n * @module\n */\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { buildCorePropertiesXml } from \"@office-open/core\";\n\nexport interface ICorePropertiesOptions {\n readonly title?: string;\n readonly subject?: string;\n readonly creator?: string;\n readonly keywords?: string;\n readonly description?: string;\n readonly lastModifiedBy?: string;\n readonly revision?: number;\n}\n\nexport class CoreProperties extends BaseXmlComponent {\n private readonly options: ICorePropertiesOptions;\n\n public constructor(options: ICorePropertiesOptions) {\n super(\"cp:coreProperties\");\n this.options = options;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n return buildCorePropertiesXml(this.options);\n }\n}\n","export interface IHyperlinkData {\n readonly key: string;\n readonly url: string;\n readonly tooltip?: string;\n}\n\nexport class HyperlinkCollection {\n private readonly map = new Map<string, IHyperlinkData>();\n\n public addHyperlink(key: string, url: string, tooltip?: string): void {\n this.map.set(key, { key, url, tooltip });\n }\n\n public get Array(): readonly IHyperlinkData[] {\n return [...this.map.values()];\n }\n}\n","/**\n * Media module for PresentationML documents.\n *\n * @module\n */\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nimport type { IMediaDataTransformation } from \"./data\";\nimport type { IMediaData } from \"./data\";\n\nexport interface IMediaTransformation {\n readonly offset?: {\n readonly top?: number;\n readonly left?: number;\n };\n readonly width: number;\n readonly height: number;\n readonly flip?: {\n readonly vertical?: boolean;\n readonly horizontal?: boolean;\n };\n readonly rotation?: number;\n}\n\nexport const createTransformation = (options: IMediaTransformation): IMediaDataTransformation => ({\n emus: {\n x: convertPixelsToEmu(options.width),\n y: convertPixelsToEmu(options.height),\n },\n pixels: {\n x: Math.round(options.width),\n y: Math.round(options.height),\n },\n flip: options.flip,\n rotation: options.rotation ? options.rotation * 60_000 : undefined,\n});\n\nexport class Media {\n private readonly map: Map<string, IMediaData>;\n\n public constructor() {\n this.map = new Map<string, IMediaData>();\n }\n\n public addImage(key: string, mediaData: IMediaData): void {\n this.map.set(key, mediaData);\n }\n\n public addMedia(key: string, mediaData: IMediaData): void {\n this.map.set(key, mediaData);\n }\n\n public get Array(): readonly IMediaData[] {\n return [...this.map.values()];\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport {\n createGroupTransform2D,\n type GroupTransform2DOptions as CoreGroupTransform2DOptions,\n} from \"@office-open/core/drawingml\";\n\nexport type IGroupTransform2DOptions = CoreGroupTransform2DOptions;\n\n/**\n * a:xfrm — Group transform (CT_GroupTransform2D).\n * Extends regular Transform2D with child offset (chOff) and child extent (chExt).\n * Delegates to core createGroupTransform2D.\n */\nexport class GroupTransform2D extends XmlComponent {\n private readonly core: XmlComponent;\n\n public constructor(options: IGroupTransform2DOptions, prefix: \"a\" | \"p\" = \"a\") {\n super(`${prefix}:xfrm`);\n this.core = createGroupTransform2D(options, `${prefix}:xfrm`);\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n return this.core[\"prepForXml\"]?.(context);\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\nimport { GroupTransform2D, type IGroupTransform2DOptions } from \"./group-transform-2d\";\n\n/**\n * p:grpSpPr — Group shape properties with CT_GroupTransform2D.\n */\nexport class GroupShapeProperties extends XmlComponent {\n public constructor(options?: IGroupTransform2DOptions) {\n super(\"p:grpSpPr\");\n this.root.push(new GroupTransform2D(options ?? {}));\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\n\n/**\n * p:nvGrpSpPr — Non-visual properties for a group shape.\n */\nexport class GroupShapeNonVisualProperties extends BuilderElement<{}> {\n public constructor(id: number = 1, name: string = \"\") {\n super({\n name: \"p:nvGrpSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n new BuilderElement({ name: \"p:cNvGrpSpPr\" }),\n new BuilderElement({ name: \"p:nvPr\" }),\n ],\n });\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Pure function: builds a:endParaRPr XML object.\n */\nexport function buildEndParagraphRunProperties(lang: string = \"en-US\"): IXmlableObject {\n return { \"a:endParaRPr\": { _attr: { lang } } };\n}\n\n/**\n * a:endParaRPr — End paragraph run properties.\n * Lazy: stores lang, builds XML object in prepForXml.\n */\nexport class EndParagraphRunProperties extends BuilderElement<{\n readonly lang: string;\n}> {\n private readonly lang: string;\n\n public constructor(lang: string = \"en-US\") {\n super({ name: \"a:endParaRPr\" });\n this.lang = lang;\n }\n\n public override prepForXml(\n _context: import(\"@file/xml-components\").IContext,\n ): IXmlableObject | undefined {\n return buildEndParagraphRunProperties(this.lang);\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\n\nexport const TextAlignment = {\n LEFT: \"l\",\n CENTER: \"ctr\",\n RIGHT: \"r\",\n JUSTIFY: \"just\",\n} as const;\n\nexport type BulletCharOptions = {\n readonly type: \"char\";\n readonly char?: string;\n readonly color?: string;\n readonly size?: number;\n};\n\nexport type BulletAutoNumOptions = {\n readonly type: \"autoNum\";\n readonly format?: string;\n readonly startAt?: number;\n readonly color?: string;\n readonly size?: number;\n};\n\nexport type BulletNoneOption = {\n readonly type: \"none\";\n};\n\nexport type BulletOptions = BulletCharOptions | BulletAutoNumOptions | BulletNoneOption;\n\nexport interface IParagraphPropertiesOptions {\n readonly alignment?: keyof typeof TextAlignment;\n readonly indentLevel?: number;\n readonly marginBottom?: number;\n readonly marginTop?: number;\n readonly bullet?: BulletOptions;\n /** @deprecated Use bullet: { type: \"none\" } instead */\n readonly bulletNone?: boolean;\n readonly lineSpacing?: number;\n readonly lineSpacingPoints?: number;\n readonly marginIndent?: number;\n readonly marginRight?: number;\n readonly defTabSize?: number;\n}\n\nfunction buildBulletChildren(options: BulletOptions): IXmlableObject[] {\n const children: IXmlableObject[] = [];\n\n if (options.type === \"none\") {\n children.push({ \"a:buNone\": {} });\n return children;\n }\n\n if (options.color) {\n children.push({\n \"a:buClr\": [{ \"a:srgbClr\": { _attr: { val: options.color.replace(\"#\", \"\") } } }],\n });\n }\n\n if (options.size !== undefined) {\n children.push({ \"a:buSzPct\": { _attr: { val: `${options.size}%` } } });\n }\n\n children.push({\n \"a:buFont\": {\n _attr: {\n typeface: \"Arial\",\n panose: \"020B0604020202020204\",\n pitchFamily: \"34\",\n charset: \"0\",\n },\n },\n });\n\n if (options.type === \"char\") {\n children.push({ \"a:buChar\": { _attr: { char: options.char ?? \"•\" } } });\n } else if (options.type === \"autoNum\") {\n const buAttrs: Record<string, string | number> = { type: options.format ?? \"arabicPeriod\" };\n if (options.startAt !== undefined) buAttrs.startAt = options.startAt;\n children.push({ \"a:buAutoNum\": { _attr: buAttrs } });\n }\n\n return children;\n}\n\n/**\n * Pure function: builds a:pPr XML object from options.\n * Returns undefined when no meaningful content (empty → omitted from output).\n */\nexport function buildParagraphProperties(\n options: IParagraphPropertiesOptions,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const attrs: Record<string, string | number> = {};\n if (options.alignment) attrs.algn = TextAlignment[options.alignment];\n if (options.indentLevel !== undefined) attrs.lvl = options.indentLevel;\n if (options.marginIndent !== undefined) attrs.marL = options.marginIndent;\n if (options.marginRight !== undefined) attrs.marR = options.marginRight;\n if (options.defTabSize !== undefined) attrs.defTabSz = options.defTabSize;\n if (Object.keys(attrs).length > 0) children.push({ _attr: attrs });\n\n if (options.lineSpacing !== undefined) {\n children.push({\n \"a:lnSpc\": [{ \"a:spcPct\": { _attr: { val: options.lineSpacing * 1000 } } }],\n });\n }\n\n if (options.lineSpacingPoints !== undefined) {\n children.push({\n \"a:lnSpc\": [{ \"a:spcPts\": { _attr: { val: options.lineSpacingPoints * 100 } } }],\n });\n }\n\n if (options.marginBottom !== undefined || options.marginTop !== undefined) {\n children.push({\n \"a:spcAft\": [{ \"a:spcPts\": { _attr: { val: options.marginBottom ?? 0 } } }],\n });\n }\n\n if (options.marginTop !== undefined) {\n children.push({\n \"a:spcBef\": [{ \"a:spcPts\": { _attr: { val: options.marginTop } } }],\n });\n }\n\n if (options.bullet) {\n children.push(...buildBulletChildren(options.bullet));\n } else if (options.bulletNone !== false) {\n children.push({ \"a:buNone\": {} });\n }\n\n if (children.length === 0) return undefined;\n\n return {\n \"a:pPr\": children.length === 1 && \"_attr\" in children[0] ? children[0] : children,\n };\n}\n\n/**\n * a:pPr — Paragraph properties (alignment, indent, spacing).\n * Lazy: stores options, builds XML object in prepForXml.\n * Omitted from output when completely empty.\n */\nexport class ParagraphProperties extends XmlComponent {\n private readonly options: IParagraphPropertiesOptions;\n\n public constructor(options: IParagraphPropertiesOptions = {}) {\n super(\"a:pPr\");\n this.options = options;\n }\n\n public prepForXml(\n _context: import(\"@file/xml-components\").IContext,\n ): IXmlableObject | undefined {\n return buildParagraphProperties(this.options);\n }\n}\n","/**\n * OOXML magic-number constants for PPTX generation.\n *\n * Values are in EMU (English Metric Units) or hundredths of a point,\n * as defined by the OOXML specification.\n * @module\n */\n\n// ── Outline defaults (a:ln) ──\n\n/** Default outline width: 1pt = 12700 EMU */\nexport const DEFAULT_OUTLINE_WIDTH = 12700;\n\n// ── Shadow defaults (a:outerShdw) ──\n\n/** Default shadow blur radius: ~4pt = 50800 EMU */\nexport const DEFAULT_SHADOW_BLUR_RADIUS = 50800;\n\n/** Default shadow distance: ~3pt = 38100 EMU */\nexport const DEFAULT_SHADOW_DISTANCE = 38100;\n\n/** Default shadow direction: 270° = 2700000 (60,000ths of a degree) */\nexport const DEFAULT_SHADOW_DIRECTION = 2700000;\n\n/** Default shadow alpha: 40% = 40000 (100,000ths of a percent) */\nexport const DEFAULT_SHADOW_ALPHA = 40000;\n\n// ── Angle / percentage multipliers ──\n\n/** Degrees to OOXML angle units: 1° = 60,000 */\nexport const DEGREE_MULTIPLIER = 60000;\n\n/** Font size to OOXML units: 1pt = 100 hundredths */\nexport const FONT_SIZE_MULTIPLIER = 100;\n\n/** Percentage to OOXML units: 1% = 1,000 */\nexport const PERCENTAGE_MULTIPLIER = 1000;\n","import {\n DEFAULT_OUTLINE_WIDTH,\n DEFAULT_SHADOW_ALPHA,\n DEFAULT_SHADOW_BLUR_RADIUS,\n DEFAULT_SHADOW_DIRECTION,\n DEFAULT_SHADOW_DISTANCE,\n} from \"@file/constants\";\nimport type { FillOptions } from \"@file/drawingml/fill\";\nimport { buildFill } from \"@file/drawingml/fill\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { createEffectList, createOutline } from \"@office-open/core/drawingml\";\n\nlet nextHyperlinkId = 1;\n\nexport const UnderlineStyle = {\n SINGLE: \"sng\",\n DOUBLE: \"dbl\",\n NONE: \"none\",\n} as const;\n\nexport const StrikeStyle = {\n SINGLE: \"sngStrike\",\n DOUBLE: \"dblStrike\",\n NONE: \"noStrike\",\n} as const;\n\nexport const TextCapitalization = {\n NONE: \"none\",\n ALL: \"all\",\n SMALL: \"small\",\n} as const;\n\nexport interface IHyperlinkOptions {\n readonly url: string;\n readonly tooltip?: string;\n}\n\nexport interface IRunPropertiesOptions {\n /** Font size in points. Serialized as OOXML `a:sz` (hundredths of a point). */\n readonly fontSize?: number;\n readonly bold?: boolean;\n readonly italic?: boolean;\n readonly underline?: keyof typeof UnderlineStyle;\n readonly font?: string;\n readonly lang?: string;\n readonly fill?: FillOptions;\n readonly hyperlink?: IHyperlinkOptions;\n readonly strike?: keyof typeof StrikeStyle;\n readonly baseline?: number;\n readonly spacing?: number;\n readonly capitalization?: keyof typeof TextCapitalization;\n readonly shadow?: boolean;\n readonly outline?: boolean;\n readonly rightToLeft?: boolean;\n readonly noProof?: boolean;\n readonly dirty?: boolean;\n}\n\n/**\n * Pure function: builds a:rPr XML object from options.\n * @param hyperlinkKey - pre-generated key for hyperlink placeholder\n * @param fillObject - pre-built fill IXmlableObject (from buildFill)\n */\nexport function buildRunProperties(\n options: IRunPropertiesOptions,\n hyperlinkKey?: string,\n fillObject?: IXmlableObject,\n effectListObject?: IXmlableObject,\n outlineObject?: IXmlableObject,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const attrs: Record<string, string | number | boolean> = {};\n if (options.fontSize) attrs.sz = options.fontSize * 100;\n if (options.bold !== undefined) attrs.b = options.bold;\n if (options.italic !== undefined) attrs.i = options.italic;\n if (options.underline) attrs.u = UnderlineStyle[options.underline];\n if (options.lang) attrs.lang = options.lang;\n if (options.strike) attrs.strike = StrikeStyle[options.strike];\n if (options.baseline !== undefined) attrs.baseline = options.baseline;\n if (options.capitalization)\n attrs.cap = TextCapitalization[options.capitalization] ?? options.capitalization;\n if (options.spacing !== undefined) attrs.spc = options.spacing;\n if (options.noProof !== undefined) attrs.noProof = options.noProof;\n if (options.dirty !== undefined) attrs.dirty = options.dirty;\n if (Object.keys(attrs).length > 0) children.push({ _attr: attrs });\n\n if (options.font) {\n children.push({ \"a:latin\": { _attr: { typeface: options.font } } });\n children.push({ \"a:ea\": { _attr: { typeface: options.font } } });\n }\n\n if (options.hyperlink && hyperlinkKey) {\n const hlinkAttrs: Record<string, string> = { \"r:id\": `{hlink:${hyperlinkKey}}` };\n if (options.hyperlink.tooltip) hlinkAttrs.tooltip = options.hyperlink.tooltip;\n children.push({ \"a:hlinkClick\": { _attr: hlinkAttrs } });\n }\n\n if (options.rightToLeft !== undefined) {\n children.push({ \"a:rtl\": { _attr: { val: options.rightToLeft ? 1 : 0 } } });\n }\n\n if (fillObject) {\n children.push(fillObject);\n }\n\n if (outlineObject) {\n children.push(outlineObject);\n }\n\n if (effectListObject) {\n children.push(effectListObject);\n }\n\n if (children.length === 0) return undefined;\n\n return {\n \"a:rPr\": children.length === 1 && \"_attr\" in children[0] ? children[0] : children,\n };\n}\n\n/**\n * a:rPr — Run properties (font, size, color, etc.).\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class RunProperties extends XmlComponent {\n private readonly options: IRunPropertiesOptions;\n\n public static hasProperties(options: IRunPropertiesOptions): boolean {\n return !!(\n options.fontSize ||\n options.bold !== undefined ||\n options.italic !== undefined ||\n options.underline ||\n options.font ||\n options.lang ||\n options.fill ||\n options.hyperlink ||\n options.strike ||\n options.baseline !== undefined ||\n options.spacing !== undefined ||\n options.capitalization ||\n options.shadow !== undefined ||\n options.outline !== undefined ||\n options.rightToLeft !== undefined ||\n options.noProof !== undefined ||\n options.dirty !== undefined\n );\n }\n\n public constructor(options: IRunPropertiesOptions = {}) {\n super(\"a:rPr\");\n this.options = options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const opts = this.options;\n\n // Register hyperlinks (B-level: side effect on context)\n let hyperlinkKey: string | undefined;\n if (opts.hyperlink) {\n hyperlinkKey = `hlink_${nextHyperlinkId++}`;\n const file = context.fileData as {\n Hyperlinks?: { addHyperlink(key: string, url: string, tooltip?: string): void };\n };\n file?.Hyperlinks?.addHyperlink(\n hyperlinkKey,\n opts.hyperlink.url,\n opts.hyperlink.tooltip,\n );\n }\n\n // Handle fill (needs context for prepForXml)\n let fillObj: IXmlableObject | undefined;\n if (opts.fill !== undefined) {\n fillObj = buildFill(opts.fill).prepForXml(context) ?? undefined;\n }\n\n // Handle outline\n let outlineObj: IXmlableObject | undefined;\n if (opts.outline) {\n outlineObj =\n createOutline({\n width: DEFAULT_OUTLINE_WIDTH,\n type: \"solidFill\",\n color: { value: \"000000\" },\n }).prepForXml(context) ?? undefined;\n }\n\n // Handle shadow\n let effectListObj: IXmlableObject | undefined;\n if (opts.shadow) {\n effectListObj =\n createEffectList({\n outerShadow: {\n blurRadius: DEFAULT_SHADOW_BLUR_RADIUS,\n distance: DEFAULT_SHADOW_DISTANCE,\n direction: DEFAULT_SHADOW_DIRECTION,\n color: { value: \"000000\", transforms: { alpha: DEFAULT_SHADOW_ALPHA } },\n },\n }).prepForXml(context) ?? undefined;\n }\n\n return buildRunProperties(opts, hyperlinkKey, fillObj, effectListObj, outlineObj);\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport type { IRunPropertiesOptions } from \"./run-properties\";\nimport { RunProperties } from \"./run-properties\";\n\nexport interface IRunOptions extends IRunPropertiesOptions {\n readonly text?: string;\n}\n\n/**\n * a:r — A run of text with properties.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class TextRun extends XmlComponent {\n private readonly options: IRunOptions;\n\n public constructor(options: IRunOptions | string = {}) {\n super(\"a:r\");\n this.options = typeof options === \"string\" ? { text: options } : options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (RunProperties.hasProperties(this.options)) {\n const rPr = new RunProperties(this.options);\n const rPrObj = rPr.prepForXml(context);\n if (rPrObj) children.push(rPrObj);\n }\n\n if (this.options.text) {\n children.push({ \"a:t\": [this.options.text] });\n }\n\n return {\n \"a:r\":\n children.length === 0\n ? {}\n : children.length === 1 && \"_attr\" in children[0]\n ? children[0]\n : children,\n };\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { buildEndParagraphRunProperties } from \"./end-paragraph-run\";\nimport type { IParagraphPropertiesOptions } from \"./paragraph-properties\";\nimport { buildParagraphProperties } from \"./paragraph-properties\";\nimport { TextRun } from \"./run\";\n\nexport interface IParagraphOptions {\n /** Simple text content for the paragraph. Creates a single TextRun. */\n readonly text?: string;\n readonly properties?: IParagraphPropertiesOptions;\n readonly children?: readonly (TextRun | XmlComponent)[];\n}\n\n/**\n * a:p — A paragraph in a text body.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class Paragraph extends XmlComponent {\n private readonly options: IParagraphOptions;\n\n public constructor(options: string | IParagraphOptions = {}) {\n super(\"a:p\");\n this.options = typeof options === \"string\" ? { text: options } : options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const pPr = buildParagraphProperties(this.options.properties ?? {});\n if (pPr) children.push(pPr);\n\n if (this.options.text) {\n const obj = new TextRun(this.options.text).prepForXml(context);\n if (obj) children.push(obj);\n }\n\n if (this.options.children) {\n for (const child of this.options.children) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n }\n\n children.push(buildEndParagraphRunProperties());\n\n return { \"a:p\": children };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { buildFill } from \"../drawingml/fill\";\nimport type { FillOptions } from \"../drawingml/fill\";\n\nexport interface ICellBorderOptions {\n readonly width?: number;\n readonly color?: string;\n readonly dashStyle?: \"solid\" | \"dash\" | \"dashDot\" | \"lgDash\" | \"sysDot\" | \"sysDash\";\n}\n\nfunction buildBorderLine(name: string, options: ICellBorderOptions): IXmlableObject {\n const attrs: Record<string, string | number> = {};\n const children: IXmlableObject[] = [];\n\n if (options.width !== undefined) attrs.w = options.width;\n if (options.color) {\n children.push({\n \"a:solidFill\": [{ \"a:srgbClr\": { _attr: { val: options.color.replace(\"#\", \"\") } } }],\n });\n }\n if (options.dashStyle) {\n children.push({ \"a:prstDash\": { _attr: { val: options.dashStyle } } });\n }\n\n return { [name]: Object.keys(attrs).length > 0 ? [{ _attr: attrs }, ...children] : children };\n}\n\n/**\n * a:tcPr — Table cell properties (borders + fill).\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableCellProperties extends BaseXmlComponent {\n private readonly options?: {\n readonly fill?: FillOptions;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n readonly verticalAlign?: \"t\" | \"ctr\" | \"b\";\n };\n\n public constructor(options?: {\n readonly fill?: FillOptions;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n readonly verticalAlign?: \"t\" | \"ctr\" | \"b\";\n }) {\n super(\"a:tcPr\");\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const children: IXmlableObject[] = [];\n const opts = this.options;\n\n if (opts?.verticalAlign) {\n children.push({ _attr: { anchor: opts.verticalAlign } });\n }\n\n if (opts?.borders) {\n if (opts.borders.left) children.push(buildBorderLine(\"a:lnL\", opts.borders.left));\n if (opts.borders.right) children.push(buildBorderLine(\"a:lnR\", opts.borders.right));\n if (opts.borders.top) children.push(buildBorderLine(\"a:lnT\", opts.borders.top));\n if (opts.borders.bottom) children.push(buildBorderLine(\"a:lnB\", opts.borders.bottom));\n }\n\n if (opts?.fill !== undefined) {\n const fillComp = buildFill(opts.fill);\n const fillObj = fillComp.prepForXml(context);\n if (fillObj) children.push(fillObj);\n }\n\n return {\n \"a:tcPr\":\n children.length === 0\n ? {}\n : children.length === 1 && \"_attr\" in children[0]\n ? children[0]\n : children,\n };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport type { FillOptions } from \"../drawingml/fill\";\nimport { Paragraph } from \"../shape/paragraph/paragraph\";\nimport { TextRun } from \"../shape/paragraph/run\";\nimport { TableCellProperties, type ICellBorderOptions } from \"./table-cell-properties\";\n\nexport const VerticalAlignment = {\n TOP: \"t\",\n CENTER: \"ctr\",\n BOTTOM: \"b\",\n} as const;\n\nexport interface ITableCellOptions {\n readonly text?: string;\n readonly children?: readonly BaseXmlComponent[];\n readonly fill?: FillOptions;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n readonly columnSpan?: number;\n readonly rowSpan?: number;\n readonly verticalAlign?: keyof typeof VerticalAlignment;\n readonly margins?: {\n readonly top?: number;\n readonly bottom?: number;\n readonly left?: number;\n readonly right?: number;\n };\n}\n\n/**\n * a:tc — Table cell with text body and properties.\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableCell extends BaseXmlComponent {\n private readonly options: ITableCellOptions;\n private readonly paragraphs?: readonly BaseXmlComponent[];\n\n public constructor(options: ITableCellOptions = {}) {\n super(\"a:tc\");\n this.options = options;\n this.paragraphs =\n options.children ??\n (options.text !== undefined\n ? [\n new Paragraph({\n properties: { bulletNone: false },\n children: [new TextRun({ text: options.text })],\n }),\n ]\n : undefined);\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const opts = this.options;\n const children: IXmlableObject[] = [];\n\n // gridSpan and rowSpan attributes\n const tcAttrs: Record<string, number> = {};\n if (opts.columnSpan !== undefined && opts.columnSpan > 1)\n tcAttrs.gridSpan = opts.columnSpan;\n if (opts.rowSpan !== undefined && opts.rowSpan > 1) tcAttrs.rowSpan = opts.rowSpan;\n if (Object.keys(tcAttrs).length > 0) children.push({ _attr: tcAttrs });\n\n // a:txBody\n const txBodyChildren: IXmlableObject[] = [];\n const margins = opts.margins;\n const bodyPrAttrs: Record<string, number> = {};\n if (margins?.top !== undefined) bodyPrAttrs.tIns = margins.top;\n if (margins?.bottom !== undefined) bodyPrAttrs.bIns = margins.bottom;\n if (margins?.left !== undefined) bodyPrAttrs.lIns = margins.left;\n if (margins?.right !== undefined) bodyPrAttrs.rIns = margins.right;\n txBodyChildren.push({\n \"a:bodyPr\": Object.keys(bodyPrAttrs).length > 0 ? { _attr: bodyPrAttrs } : {},\n });\n txBodyChildren.push({ \"a:lstStyle\": {} });\n\n if (this.paragraphs) {\n for (const p of this.paragraphs) {\n const pObj = p.prepForXml(context);\n if (pObj) txBodyChildren.push(pObj);\n }\n } else {\n txBodyChildren.push({ \"a:p\": [] });\n }\n children.push({ \"a:txBody\": txBodyChildren });\n\n // a:tcPr\n const tcPr = new TableCellProperties({\n fill: opts.fill,\n borders: opts.borders,\n verticalAlign: opts.verticalAlign ? VerticalAlignment[opts.verticalAlign] : undefined,\n });\n const tcPrObj = tcPr.prepForXml(context);\n if (tcPrObj) children.push(tcPrObj);\n\n return { \"a:tc\": children };\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { VerticalAlignment } from \"../table/table-cell\";\nimport { Paragraph } from \"./paragraph/paragraph\";\nimport { TextRun } from \"./paragraph/run\";\n\nexport interface ITextBodyOptions {\n readonly paragraphs?: readonly (Paragraph | string)[];\n readonly vertical?: \"vert\" | \"vert270\" | \"horz\" | \"wordArtVert\";\n readonly anchor?: keyof typeof VerticalAlignment;\n readonly autoFit?: \"normal\" | \"shape\" | \"none\";\n readonly wrap?: \"square\" | \"none\";\n readonly margins?: {\n readonly top?: number;\n readonly bottom?: number;\n readonly left?: number;\n readonly right?: number;\n };\n readonly columns?: number;\n readonly columnSpacing?: number;\n}\n\n/**\n * Pure function: builds a:bodyPr content.\n */\nfunction buildBodyPr(options: ITextBodyOptions): IXmlableObject {\n const bodyPrChildren: IXmlableObject[] = [];\n\n if (options.autoFit === \"normal\") bodyPrChildren.push({ \"a:normAutofit\": {} });\n else if (options.autoFit === \"shape\") bodyPrChildren.push({ \"a:spAutoFit\": {} });\n else if (options.autoFit === \"none\") bodyPrChildren.push({ \"a:noAutofit\": {} });\n\n const bodyPrContent: IXmlableObject[] = [];\n\n const attrs: Record<string, string | number> = {};\n if (options.vertical) attrs.vert = options.vertical;\n if (options.anchor) attrs.anchor = VerticalAlignment[options.anchor];\n if (options.wrap) attrs.wrap = options.wrap;\n if (options.margins?.top !== undefined) attrs.tIns = options.margins.top;\n if (options.margins?.bottom !== undefined) attrs.bIns = options.margins.bottom;\n if (options.margins?.left !== undefined) attrs.lIns = options.margins.left;\n if (options.margins?.right !== undefined) attrs.rIns = options.margins.right;\n if (options.columns !== undefined) attrs.numCol = options.columns;\n if (options.columnSpacing !== undefined) attrs.spcCol = options.columnSpacing * 100;\n if (Object.keys(attrs).length > 0) bodyPrContent.push({ _attr: attrs });\n\n bodyPrContent.push(...bodyPrChildren);\n\n return {\n \"a:bodyPr\":\n bodyPrContent.length === 1 && \"_attr\" in bodyPrContent[0]\n ? bodyPrContent[0]\n : bodyPrContent.length > 0\n ? bodyPrContent\n : {},\n };\n}\n\n/**\n * p:txBody — Text body within a shape.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class TextBody extends XmlComponent {\n private readonly options: ITextBodyOptions;\n\n public constructor(options: ITextBodyOptions = {}) {\n super(\"p:txBody\");\n this.options = options;\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n children.push(buildBodyPr(this.options));\n children.push({ \"a:lstStyle\": {} });\n\n if (this.options.paragraphs) {\n for (const p of this.options.paragraphs) {\n const para =\n typeof p === \"string\"\n ? new Paragraph({ children: [new TextRun({ text: p })] })\n : p;\n const obj = para.prepForXml(context);\n if (obj) children.push(obj);\n }\n } else {\n const obj = new Paragraph().prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"p:txBody\": children };\n }\n}\n","import { GroupShapeProperties } from \"@file/drawingml/group-shape-properties\";\nimport { GroupShapeNonVisualProperties } from \"@file/shape-tree/group-shape-non-visual\";\nimport { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\n\nimport { Paragraph } from \"../shape/paragraph/paragraph\";\nimport { TextRun } from \"../shape/paragraph/run\";\nimport { TextBody } from \"../shape/text-body\";\n\nexport interface INotesSlideOptions {\n readonly text?: string;\n}\n\n/**\n * p:notes — A notes slide associated with a presentation slide.\n *\n * Contains a slide image placeholder and a body text area for speaker notes.\n */\nexport class NotesSlide extends XmlComponent {\n public constructor(options: INotesSlideOptions = {}) {\n super(\"p:notes\");\n\n this.root.push(\n new NextAttributeComponent({\n \"xmlns:a\": {\n key: \"xmlns:a\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n },\n \"xmlns:r\": {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n \"xmlns:p\": {\n key: \"xmlns:p\",\n value: \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n }),\n );\n\n this.root.push(new NotesCommonSlideData(options.text));\n this.root.push(\n new BuilderElement({\n name: \"p:clrMapOvr\",\n children: [new BuilderElement({ name: \"a:masterClrMapping\" })],\n }),\n );\n }\n}\n\nclass NotesCommonSlideData extends XmlComponent {\n public constructor(text?: string) {\n super(\"p:cSld\");\n this.root.push(new NotesShapeTree(text));\n }\n}\n\nclass NotesShapeTree extends XmlComponent {\n public constructor(text?: string) {\n super(\"p:spTree\");\n this.root.push(new GroupShapeNonVisualProperties());\n this.root.push(new GroupShapeProperties());\n this.root.push(new SlideImagePlaceholder());\n this.root.push(new NotesBodyPlaceholder(text));\n }\n}\n\nclass SlideImagePlaceholder extends XmlComponent {\n public constructor() {\n super(\"p:sp\");\n this.root.push(\n new BuilderElement({\n name: \"p:nvSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: 2 },\n name: { key: \"name\", value: \"Slide Image Placeholder 1\" },\n },\n }),\n new BuilderElement({ name: \"p:cNvSpPr\" }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: [\n new BuilderElement({\n name: \"p:ph\",\n attributes: { type: { key: \"type\", value: \"sldImg\" } },\n }),\n ],\n }),\n ],\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: {\n x: { key: \"x\", value: 685800 },\n y: { key: \"y\", value: 1600200 },\n },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: 5486400 },\n cy: { key: \"cy\", value: 3086100 },\n },\n }),\n ],\n }),\n ],\n }),\n );\n }\n}\n\nclass NotesBodyPlaceholder extends XmlComponent {\n public constructor(text?: string) {\n super(\"p:sp\");\n this.root.push(\n new BuilderElement({\n name: \"p:nvSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: 3 },\n name: { key: \"name\", value: \"Notes Placeholder 1\" },\n },\n }),\n new BuilderElement({ name: \"p:cNvSpPr\" }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: [\n new BuilderElement({\n name: \"p:ph\",\n attributes: {\n type: { key: \"type\", value: \"body\" },\n idx: { key: \"idx\", value: 1 },\n },\n }),\n ],\n }),\n ],\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: {\n x: { key: \"x\", value: 685800 },\n y: { key: \"y\", value: 4800600 },\n },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: 5486400 },\n cy: { key: \"cy\", value: 3600450 },\n },\n }),\n ],\n }),\n ],\n }),\n );\n\n const textBodyOptions = text\n ? { paragraphs: [new Paragraph({ children: [new TextRun({ text })] })] }\n : undefined;\n this.root.push(new TextBody(textBodyOptions));\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nexport interface IShowOptions {\n readonly loop?: boolean;\n readonly kiosk?: boolean;\n readonly showNarration?: boolean;\n readonly useTimings?: boolean;\n}\n\nfunction buildPresPropsXml(showOptions?: IShowOptions): string {\n const showPrXml = showOptions\n ? `<p:showPr${[\n showOptions.loop ? ' loop=\"1\"' : \"\",\n showOptions.kiosk ? ' kiosk=\"1\"' : \"\",\n showOptions.showNarration === false ? ' showNarration=\"0\"' : \"\",\n showOptions.useTimings ? ' useTimings=\"1\"' : \"\",\n ].join(\"\")}><p:present/></p:showPr>`\n : \"\";\n return `<p:presentationPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">${showPrXml}</p:presentationPr>`;\n}\n\nexport class PresentationProperties extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n\n public constructor(showOptions?: IShowOptions) {\n super(\"p:presentationPr\");\n const key = showOptions ? JSON.stringify(showOptions) : \"\";\n if (!PresentationProperties.cache.has(key)) {\n PresentationProperties.cache.set(\n key,\n ImportedXmlComponent.fromXmlString(buildPresPropsXml(showOptions)),\n );\n }\n }\n\n public prepForXml() {\n const key = this.showOptions ? JSON.stringify(this.showOptions) : \"\";\n return PresentationProperties.cache.get(key)!.prepForXml({ stack: [] });\n }\n\n private readonly showOptions?: IShowOptions;\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport { ImportedXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nexport interface IPresentationOptions {\n readonly slideWidth?: number;\n readonly slideHeight?: number;\n readonly slideIds: readonly number[];\n readonly masterCount: number;\n}\n\nconst DEFAULT_TEXT_STYLE_XML = `<p:defaultTextStyle xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">\n <a:defPPr><a:defRPr/></a:defPPr>\n <a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl1pPr>\n <a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl2pPr>\n <a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl3pPr>\n <a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl4pPr>\n <a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl5pPr>\n <a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl6pPr>\n <a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl7pPr>\n <a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl8pPr>\n <a:lvl9pPr marL=\"3657600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\">\n <a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr>\n </a:lvl9pPr>\n</p:defaultTextStyle>`;\n\nconst DEFAULT_TEXT_STYLE_OBJ: IXmlableObject = ImportedXmlComponent.fromXmlString(\n DEFAULT_TEXT_STYLE_XML,\n).prepForXml({ stack: [] })!;\n\n/**\n * p:presentation — Root element of a PPTX file.\n * Lazy: stores options, builds XML object directly in prepForXml.\n */\nexport class Presentation extends XmlComponent {\n private readonly options: IPresentationOptions;\n\n public constructor(options: IPresentationOptions) {\n super(\"p:presentation\");\n this.options = options;\n }\n\n public prepForXml(_context: IContext): IXmlableObject | undefined {\n const opts = this.options;\n\n const children: IXmlableObject[] = [];\n\n // xmlns attributes\n children.push({\n _attr: {\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:p\": \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n });\n\n // sldMasterIdLst (dynamic — supports multiple masters)\n const masterIds = Array.from({ length: opts.masterCount }, (_, i) => ({\n \"p:sldMasterId\": { _attr: { id: 2147483648 + i * 12, \"r:id\": `rId${i + 1}` } },\n }));\n children.push({ \"p:sldMasterIdLst\": masterIds });\n\n // sldIdLst (dynamic) — rIds follow after master rIds\n const slideRidOffset = opts.masterCount + 1;\n const sldIds = opts.slideIds.map((id, i) => ({\n \"p:sldId\": { _attr: { id, \"r:id\": `rId${slideRidOffset + i}` } },\n }));\n children.push({ \"p:sldIdLst\": sldIds });\n\n // sldSz\n const cx = opts.slideWidth ?? 12192000;\n const cy = opts.slideHeight ?? 6858000;\n children.push({\n \"p:sldSz\": {\n _attr: {\n cx,\n cy,\n },\n },\n });\n\n // notesSz\n children.push({\n \"p:notesSz\": { _attr: { cx: 6858000, cy: 9144000 } },\n });\n\n // defaultTextStyle (cached static singleton)\n children.push(DEFAULT_TEXT_STYLE_OBJ);\n\n return { \"p:presentation\": children };\n }\n\n public toXml(_context: IContext): string {\n const opts = this.options;\n\n const cx = opts.slideWidth ?? 12192000;\n const cy = opts.slideHeight ?? 6858000;\n\n let s = `<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">`;\n s += \"<p:sldMasterIdLst>\";\n for (let mi = 0; mi < opts.masterCount; mi++) {\n s += `<p:sldMasterId id=\"${2147483648 + mi * 12}\" r:id=\"rId${mi + 1}\"/>`;\n }\n s += \"</p:sldMasterIdLst>\";\n s += \"<p:sldIdLst>\";\n const sRidOff = opts.masterCount + 1;\n for (let i = 0; i < opts.slideIds.length; i++) {\n s += `<p:sldId id=\"${opts.slideIds[i]}\" r:id=\"rId${sRidOff + i}\"/>`;\n }\n s += \"</p:sldIdLst>\";\n s += `<p:sldSz cx=\"${cx}\" cy=\"${cy}\"/>`;\n s += '<p:notesSz cx=\"6858000\" cy=\"9144000\"/>';\n s += DEFAULT_TEXT_STYLE_XML;\n s += \"</p:presentation>\";\n return s;\n }\n}\n","import { Relationships } from \"@file/relationships/relationships\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\n\nimport { Presentation } from \"./presentation\";\nimport type { IPresentationOptions } from \"./presentation\";\n\nexport interface IViewWrapper {\n readonly View: BaseXmlComponent;\n readonly Relationships: Relationships;\n}\n\nexport class PresentationWrapper implements IViewWrapper {\n private readonly presentation: Presentation;\n private readonly relationships: Relationships;\n\n public constructor(options: IPresentationOptions) {\n this.presentation = new Presentation(options);\n this.relationships = new Relationships();\n }\n\n public get View(): Presentation {\n return this.presentation;\n }\n\n public get Relationships(): Relationships {\n return this.relationships;\n }\n}\n","import type { ILayoutDefinition } from \"@file/file\";\nimport type { IMasterPlaceholderPosition } from \"@file/slide-master/slide-master\";\nimport type { IContext } from \"@file/xml-components\";\nimport { ImportedXmlComponent } from \"@file/xml-components\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\n\nexport type SlideLayoutType =\n | \"blank\"\n | \"title\"\n | \"tx\"\n | \"twoColTx\"\n | \"titleOnly\"\n | \"obj\"\n | \"secHead\"\n | \"chart\"\n | \"tbl\"\n | \"picTx\"\n | \"twoObj\"\n | \"twoTxTwoObj\"\n | \"objTx\"\n | \"vertTx\"\n | \"vertTitleAndTx\";\n\nconst NS = `xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"`;\n\nconst SP_TREE_HEADER = `<p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>`;\n\n// 16:9 reference slide width\nconst SW_REF = 12192000;\nconst sx = (refX: number, sw: number) => Math.round((refX * sw) / SW_REF);\n\n// ── Placeholder XML builders ──\n\n// No xfrm — inherited from master\nfunction dtPlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Date Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{5BCAD085-E8A6-8845-BD4E-CB4CCA059FC4}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/27/13</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction ftrPlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Footer Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction sldNumPlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Slide Number Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C1FF6DA9-008F-8B48-92A6-B652298478BF}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// title — no idx, no xfrm (inherited)\nfunction titlePlaceholder(id: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Body (generic) idx, no xfrm (inherited)\nfunction bodyPlaceholder(id: number, idx: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Content Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Body with xfrm (positioned)\nfunction bodyPlaceholderAt(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Content Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Body with explicit type=\"body\" and xfrm\nfunction typedBodyPlaceholder(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Text Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Title with xfrm\nfunction titlePlaceholderAt(id: number, x: number, y: number, cx: number, cy: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// ctrTitle — centered title for title layout\nfunction ctrTitlePlaceholder(id: number, x: number, y: number, cx: number, cy: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ctrTitle\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"ctr\"><a:defRPr sz=\"6000\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// subTitle for title layout\nfunction subTitlePlaceholder(id: number, x: number, y: number, cx: number, cy: number): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Subtitle 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"subTitle\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL=\"0\" indent=\"0\" algn=\"ctr\"><a:buNone/><a:defRPr sz=\"2400\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// Pic placeholder\nfunction picPlaceholder(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Picture Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"pic\" idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\n// ── Layout definitions (16:9 reference positions) ──\n\ninterface LayoutDef {\n type: SlideLayoutType;\n name: string;\n buildShapes: (sw: number) => string;\n}\n\nconst LAYOUT_DEFS: Record<SlideLayoutType, LayoutDef> = {\n // 1. title — ctrTitle + subTitle\n title: {\n type: \"title\",\n name: \"Title Slide\",\n buildShapes: (sw) =>\n ctrTitlePlaceholder(2, sx(1524000, sw), 1122363, sx(9144000, sw), 2387600) +\n subTitlePlaceholder(3, sx(1524000, sw), 3602038, sx(9144000, sw), 1655762),\n },\n // 2. obj — title + body (generic content)\n obj: {\n type: \"obj\",\n name: \"Title and Content\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n // 3. secHead — title + body (both positioned)\n secHead: {\n type: \"secHead\",\n name: \"Section Header\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(831850, sw), 1709738, sx(10515600, sw), 2852737) +\n typedBodyPlaceholder(3, 1, sx(831850, sw), 4589463, sx(10515600, sw), 1500187),\n },\n // 4. twoObj — title + 2 body columns\n twoObj: {\n type: \"twoObj\",\n name: \"Two Content\",\n buildShapes: (sw) =>\n titlePlaceholder(2) +\n bodyPlaceholderAt(3, 1, sx(838200, sw), 1825625, sx(5181600, sw), 4351338) +\n bodyPlaceholderAt(4, 2, sx(6172200, sw), 1825625, sx(5181600, sw), 4351338),\n },\n // 5. twoTxTwoObj — title + 4 quadrants (2 text, 2 content)\n twoTxTwoObj: {\n type: \"twoTxTwoObj\",\n name: \"Comparison\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(839788, sw), 365125, sx(10515600, sw), 1325563) +\n typedBodyPlaceholder(3, 1, sx(839788, sw), 1681163, sx(5157787, sw), 823912) +\n bodyPlaceholderAt(4, 2, sx(839788, sw), 2505075, sx(5157787, sw), 3684588) +\n typedBodyPlaceholder(5, 3, sx(6172200, sw), 1681163, sx(5183188, sw), 823912) +\n bodyPlaceholderAt(6, 4, sx(6172200, sw), 2505075, sx(5183188, sw), 3684588),\n },\n // 6. titleOnly — title only\n titleOnly: {\n type: \"titleOnly\",\n name: \"Title Only\",\n buildShapes: () => titlePlaceholder(2),\n },\n // 7. blank — no content placeholders\n blank: {\n type: \"blank\",\n name: \"Blank\",\n buildShapes: () => \"\",\n },\n // 8. objTx — title + body + text (object and text)\n objTx: {\n type: \"objTx\",\n name: \"Content with Caption\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(839788, sw), 457200, sx(3932237, sw), 1600200) +\n bodyPlaceholderAt(3, 1, sx(5183188, sw), 987425, sx(6172200, sw), 4873625) +\n typedBodyPlaceholder(4, 2, sx(839788, sw), 2057400, sx(3932237, sw), 3811588),\n },\n // 9. picTx — title + pic + text\n picTx: {\n type: \"picTx\",\n name: \"Picture with Caption\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(839788, sw), 457200, sx(3932237, sw), 1600200) +\n picPlaceholder(3, 1, sx(5183188, sw), 987425, sx(6172200, sw), 4873625) +\n typedBodyPlaceholder(4, 2, sx(839788, sw), 2057400, sx(3932237, sw), 3811588),\n },\n // 10. vertTx — title + body (vertical text)\n vertTx: {\n type: \"vertTx\",\n name: \"Vertical Text\",\n buildShapes: () =>\n titlePlaceholder(2) +\n `<p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Text Placeholder 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`,\n },\n // 11. vertTitleAndTx — vertical title + body\n vertTitleAndTx: {\n type: \"vertTitleAndTx\",\n name: \"Vertical Title and Text\",\n buildShapes: (sw) =>\n titlePlaceholderAt(2, sx(8724900, sw), 365125, sx(2628900, sw), 5811838) +\n typedBodyPlaceholder(3, 1, sx(838200, sw), 365125, sx(7734300, sw), 5811838),\n },\n // Aliases / simplified versions\n tx: {\n type: \"tx\",\n name: \"Title and Text\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n chart: {\n type: \"chart\",\n name: \"Content with Caption\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n tbl: {\n type: \"tbl\",\n name: \"Content with Caption\",\n buildShapes: () => titlePlaceholder(2) + bodyPlaceholder(3, 1),\n },\n twoColTx: {\n type: \"twoColTx\",\n name: \"Two Content\",\n buildShapes: (sw) =>\n titlePlaceholder(2) +\n bodyPlaceholderAt(3, 1, sx(838200, sw), 1825625, sx(5181600, sw), 4351338) +\n bodyPlaceholderAt(4, 2, sx(6172200, sw), 1825625, sx(5181600, sw), 4351338),\n },\n};\n\nfunction buildLayoutXml(layoutType: SlideLayoutType, slideWidth: number = SW_REF): string {\n const def = LAYOUT_DEFS[layoutType];\n const contentShapes = def.buildShapes(slideWidth);\n // Count content shapes to determine starting ID for footer placeholders\n const contentCount = contentShapes ? (contentShapes.match(/<p:sp>/g) || []).length : 0;\n const footerStartId = 2 + contentCount;\n\n const footerShapes =\n dtPlaceholder(footerStartId) +\n ftrPlaceholder(footerStartId + 1) +\n sldNumPlaceholder(footerStartId + 2);\n\n return `<p:sldLayout ${NS} type=\"${layoutType}\" preserve=\"1\"><p:cSld name=\"${def.name}\"><p:spTree>${SP_TREE_HEADER}${contentShapes}${footerShapes}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;\n}\n\n// ── Custom layout builder ──\n\nfunction posToEmu(pos: IMasterPlaceholderPosition) {\n return {\n x: convertPixelsToEmu(pos.x),\n y: convertPixelsToEmu(pos.y),\n cx: convertPixelsToEmu(pos.width),\n cy: convertPixelsToEmu(pos.height),\n };\n}\n\nfunction positionedTitlePlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Title 1\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"title\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedSubtitlePlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Subtitle 2\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"subTitle\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedBodyPlaceholder(\n id: number,\n idx: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Content Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph idx=\"${idx}\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedDatePlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Date Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"half\" idx=\"10\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{5BCAD085-E8A6-8845-BD4E-CB4CCA059FC4}\" type=\"datetimeFigureOut\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>1/27/13</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedFooterPlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Footer Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"ftr\" sz=\"quarter\" idx=\"11\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction positionedSldNumPlaceholder(\n id: number,\n x: number,\n y: number,\n cx: number,\n cy: number,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"Slide Number Placeholder ${id - 1}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"12\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id=\"{C1FF6DA9-008F-8B48-92A6-B652298478BF}\" type=\"slidenum\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang=\"en-US\"/></a:p></p:txBody></p:sp>`;\n}\n\nfunction buildChildrenXml(children?: readonly BaseXmlComponent[]): string {\n if (!children || children.length === 0) return \"\";\n const ctx: IContext = { stack: [] };\n let result = \"\";\n for (const child of children) {\n const obj = child.prepForXml(ctx);\n if (obj) result += xml(obj);\n }\n return result;\n}\n\nfunction buildCustomLayoutXml(def: ILayoutDefinition): string {\n const ph = def.placeholders ?? {};\n const layoutType = def.type ?? \"blank\";\n const displayName = def.name ?? LAYOUT_DEFS[layoutType]?.name ?? layoutType;\n\n const shapes: string[] = [];\n let nextId = 2;\n\n // Content placeholders\n if (ph.title !== false) {\n const titlePos = ph.title ? posToEmu(ph.title) : null;\n if (titlePos) {\n shapes.push(\n positionedTitlePlaceholder(\n nextId++,\n titlePos.x,\n titlePos.y,\n titlePos.cx,\n titlePos.cy,\n ),\n );\n } else {\n shapes.push(titlePlaceholder(nextId++));\n }\n }\n\n if (ph.subtitle !== false && ph.subtitle !== undefined) {\n const subPos = posToEmu(ph.subtitle);\n shapes.push(\n positionedSubtitlePlaceholder(nextId++, subPos.x, subPos.y, subPos.cx, subPos.cy),\n );\n }\n\n if (ph.body !== false && ph.body !== undefined) {\n const bodyPos = ph.body ? posToEmu(ph.body) : null;\n if (bodyPos) {\n shapes.push(\n positionedBodyPlaceholder(\n nextId++,\n 1,\n bodyPos.x,\n bodyPos.y,\n bodyPos.cx,\n bodyPos.cy,\n ),\n );\n } else {\n shapes.push(bodyPlaceholder(nextId++, 1));\n }\n }\n\n // Footer placeholders\n if (ph.date !== false && ph.date !== undefined) {\n const datePos = ph.date ? posToEmu(ph.date) : null;\n if (datePos) {\n shapes.push(\n positionedDatePlaceholder(nextId++, datePos.x, datePos.y, datePos.cx, datePos.cy),\n );\n } else {\n shapes.push(dtPlaceholder(nextId++));\n }\n }\n\n if (ph.footer !== false && ph.footer !== undefined) {\n const ftrPos = ph.footer ? posToEmu(ph.footer) : null;\n if (ftrPos) {\n shapes.push(\n positionedFooterPlaceholder(nextId++, ftrPos.x, ftrPos.y, ftrPos.cx, ftrPos.cy),\n );\n } else {\n shapes.push(ftrPlaceholder(nextId++));\n }\n }\n\n if (ph.slideNumber !== false && ph.slideNumber !== undefined) {\n const sldPos = ph.slideNumber ? posToEmu(ph.slideNumber) : null;\n if (sldPos) {\n shapes.push(\n positionedSldNumPlaceholder(nextId++, sldPos.x, sldPos.y, sldPos.cx, sldPos.cy),\n );\n } else {\n shapes.push(sldNumPlaceholder(nextId++));\n }\n }\n\n // Children shapes — shift ids\n const childrenXml = buildChildrenXml(def.children);\n if (childrenXml) {\n const offset = nextId - 1;\n shapes.push(childrenXml.replace(/ id=\"(\\d+)\"/g, (_, n) => ` id=\"${parseInt(n) + offset}\"`));\n }\n\n return `<p:sldLayout ${NS} type=\"${layoutType}\" preserve=\"1\"><p:cSld name=\"${displayName}\"><p:spTree>${SP_TREE_HEADER}${shapes.join(\"\")}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;\n}\n\nexport class SlideLayout extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n public readonly layoutType: SlideLayoutType;\n private readonly cacheKey: string;\n\n public constructor(\n layoutType: SlideLayoutType = \"blank\",\n slideWidth: number = SW_REF,\n definition?: ILayoutDefinition,\n ) {\n super(\"p:sldLayout\");\n this.layoutType = layoutType;\n\n const hasCustom =\n definition &&\n (definition.placeholders !== undefined ||\n (definition.children !== undefined && definition.children.length > 0));\n\n if (hasCustom) {\n // Custom layouts are not cached (may contain dynamic children)\n this.cacheKey = `custom:${layoutType}:${slideWidth}:${Date.now()}:${Math.random()}`;\n SlideLayout.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(buildCustomLayoutXml(definition!)),\n );\n } else {\n this.cacheKey = `${layoutType}:${slideWidth}`;\n if (!SlideLayout.cache.has(this.cacheKey)) {\n SlideLayout.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(buildLayoutXml(layoutType, slideWidth)),\n );\n }\n }\n }\n\n public prepForXml() {\n return SlideLayout.cache.get(this.cacheKey)!.prepForXml({ stack: [] });\n }\n}\n\nexport class DefaultSlideLayout extends SlideLayout {\n public constructor() {\n super(\"blank\");\n }\n}\n","import type { IBackgroundOptions } from \"@file/background/background\";\nimport type { IHeaderFooterOptions } from \"@file/header-footer/header-footer\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext } from \"@file/xml-components\";\nimport { ImportedXmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\n\nexport interface IMasterPlaceholderPosition {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\nexport interface IMasterPlaceholderOptions {\n readonly title?: boolean | IMasterPlaceholderPosition;\n readonly body?: boolean | IMasterPlaceholderPosition;\n readonly date?: boolean | IMasterPlaceholderPosition;\n readonly footer?: boolean | IMasterPlaceholderPosition;\n readonly slideNumber?: boolean | IMasterPlaceholderPosition;\n}\n\nexport interface ISlideMasterOptions {\n readonly background?: IBackgroundOptions;\n readonly children?: readonly BaseXmlComponent[];\n readonly placeholders?: IMasterPlaceholderOptions;\n}\n\n// Reference positions (16:9 master, slideWidth = 12192000 EMU)\nconst SW_REF = 12192000;\nconst sx = (refX: number, sw: number) => Math.round((refX * sw) / SW_REF);\n\nconst REF_TITLE = { x: 838200, y: 365125, cx: 10515600, cy: 1325563 };\nconst REF_BODY = { x: 838200, y: 1825625, cx: 10515600, cy: 4351338 };\nconst REF_DATE = { x: 838200, y: 6356350, cx: 2743200, cy: 365125 };\nconst REF_FOOTER = { x: 4038600, y: 6356350, cx: 4114800, cy: 365125 };\nconst REF_SLDNUM = { x: 8610600, y: 6356350, cx: 2743200, cy: 365125 };\n\nfunction toEmu(pos: IMasterPlaceholderPosition) {\n return {\n x: convertPixelsToEmu(pos.x),\n y: convertPixelsToEmu(pos.y),\n cx: convertPixelsToEmu(pos.width),\n cy: convertPixelsToEmu(pos.height),\n };\n}\n\nfunction resolvePos(\n opt: boolean | IMasterPlaceholderPosition | undefined,\n ref: { x: number; y: number; cx: number; cy: number },\n): { x: number; y: number; cx: number; cy: number } | null {\n if (opt === false) return null;\n if (opt === undefined || opt === true) return ref;\n return toEmu(opt);\n}\n\nfunction phSp(\n id: number,\n name: string,\n phAttrs: string,\n x: number,\n y: number,\n cx: number,\n cy: number,\n bodyContent: string,\n): string {\n return `<p:sp><p:nvSpPr><p:cNvPr id=\"${id}\" name=\"${name}\"/><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph ${phAttrs}/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"${x}\" y=\"${y}\"/><a:ext cx=\"${cx}\" cy=\"${cy}\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody>${bodyContent}</p:txBody></p:sp>`;\n}\n\nconst BODY_DEFAULT = `<a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang=\"en-US\"/></a:p>`;\n\nfunction footerBody(algn: string, fldType: string, fldId: string, fldText: string): string {\n const fld =\n fldType && fldId\n ? `<a:fld id=\"${fldId}\" type=\"${fldType}\"><a:rPr lang=\"en-US\" smtClean=\"0\"/><a:t>${fldText}</a:t></a:fld>`\n : \"\";\n return `<a:bodyPr/><a:lstStyle><a:lvl1pPr algn=\"${algn}\"><a:defRPr sz=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"><a:tint val=\"75000\"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p>${fld}<a:endParaRPr lang=\"en-US\"/></a:p>`;\n}\n\nfunction buildBackgroundXml(bg?: IBackgroundOptions): string {\n if (!bg) return `<p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef>`;\n const { Background } = require(\"@file/background/background\") as {\n Background: new (o?: IBackgroundOptions) => { prepForXml(ctx: IContext): unknown };\n };\n const bgObj = new Background(bg);\n const obj = bgObj.prepForXml({ stack: [] });\n if (!obj) return `<p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef>`;\n // Background prepForXml returns { \"p:bg\": [...] }, xml() wraps it in <p:bg>.\n // Strip the outer <p:bg> since the caller already provides the wrapper.\n const full = xml(obj);\n return full.replace(/^<p:bg[^>]*>/, \"\").replace(/<\\/p:bg>$/, \"\");\n}\n\nfunction buildChildrenXml(children?: readonly BaseXmlComponent[]): string {\n if (!children || children.length === 0) return \"\";\n const ctx: IContext = { stack: [] };\n let result = \"\";\n for (const child of children) {\n const obj = child.prepForXml(ctx);\n if (obj) result += xml(obj);\n }\n return result;\n}\n\nfunction buildSlideMasterXml(\n layoutCount: number,\n headerFooter?: IHeaderFooterOptions,\n masterOptions?: ISlideMasterOptions,\n slideWidth: number = SW_REF,\n masterIndex: number = 0,\n): string {\n const hfXml = headerFooter ? `<p:hf dt=\"0\" hdr=\"0\" ftr=\"0\" sldNum=\"0\"/>` : \"\";\n const ph = masterOptions?.placeholders ?? {};\n\n // Layout IDs must be globally unique across all masters.\n // Master ID = 2147483648 + masterIndex * 12; layouts start at masterId + 1.\n const layoutIdBase = 2147483648 + masterIndex * 12 + 1;\n const layoutIdEntries: string[] = [];\n for (let i = 0; i < layoutCount; i++) {\n layoutIdEntries.push(`<p:sldLayoutId id=\"${layoutIdBase + i}\" r:id=\"rId${i + 1}\"/>`);\n }\n\n // Scaled reference positions (x/cx scaled, y/cy fixed)\n const sRef = (r: { x: number; y: number; cx: number; cy: number }) => ({\n x: sx(r.x, slideWidth),\n y: r.y,\n cx: sx(r.cx, slideWidth),\n cy: r.cy,\n });\n\n // Build placeholders\n const shapes: string[] = [];\n let nextId = 2;\n\n const titlePos = resolvePos(ph.title, sRef(REF_TITLE));\n if (titlePos) {\n shapes.push(\n phSp(\n nextId++,\n \"Title Placeholder 1\",\n 'type=\"title\"',\n titlePos.x,\n titlePos.y,\n titlePos.cx,\n titlePos.cy,\n BODY_DEFAULT,\n ),\n );\n }\n\n const bodyPos = resolvePos(ph.body, sRef(REF_BODY));\n if (bodyPos) {\n shapes.push(\n phSp(\n nextId++,\n \"Text Placeholder 2\",\n 'type=\"body\" idx=\"1\"',\n bodyPos.x,\n bodyPos.y,\n bodyPos.cx,\n bodyPos.cy,\n BODY_DEFAULT,\n ),\n );\n }\n\n const datePos = resolvePos(ph.date, sRef(REF_DATE));\n if (datePos) {\n shapes.push(\n phSp(\n nextId++,\n \"Date Placeholder 3\",\n 'type=\"dt\" sz=\"half\" idx=\"2\"',\n datePos.x,\n datePos.y,\n datePos.cx,\n datePos.cy,\n footerBody(\n \"l\",\n \"datetimeFigureOut\",\n \"{5BCAD085-E8A6-8845-BD4E-CB4CCA059FC4}\",\n \"1/27/13\",\n ),\n ),\n );\n }\n\n const footerPos = resolvePos(ph.footer, sRef(REF_FOOTER));\n if (footerPos) {\n shapes.push(\n phSp(\n nextId++,\n \"Footer Placeholder 4\",\n 'type=\"ftr\" sz=\"quarter\" idx=\"3\"',\n footerPos.x,\n footerPos.y,\n footerPos.cx,\n footerPos.cy,\n footerBody(\"ctr\", \"\", \"\", \"\"),\n ),\n );\n }\n\n const sldNumPos = resolvePos(ph.slideNumber, sRef(REF_SLDNUM));\n if (sldNumPos) {\n shapes.push(\n phSp(\n nextId++,\n \"Slide Number Placeholder 5\",\n 'type=\"sldNum\" sz=\"quarter\" idx=\"4\"',\n sldNumPos.x,\n sldNumPos.y,\n sldNumPos.cx,\n sldNumPos.cy,\n footerBody(\"r\", \"slidenum\", \"{C1FF6DA9-008F-8B48-92A6-B652298478BF}\", \"‹#›\"),\n ),\n );\n }\n\n // Custom children shapes — shift ids to avoid conflicts with placeholder ids\n const childrenXml = buildChildrenXml(masterOptions?.children);\n if (childrenXml) {\n const offset = nextId - 1;\n shapes.push(childrenXml.replace(/ id=\"(\\d+)\"/g, (_, n) => ` id=\"${parseInt(n) + offset}\"`));\n }\n\n // Background\n const bgInnerXml = buildBackgroundXml(masterOptions?.background);\n\n return `<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld><p:bg>${bgInnerXml}</p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>${shapes.join(\"\")}</p:spTree></p:cSld><p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/><p:sldLayoutIdLst>${layoutIdEntries.join(\"\")}</p:sldLayoutIdLst>${hfXml}<p:txStyles><p:titleStyle><a:lvl1pPr algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPct val=\"0\"/></a:spcBef><a:buNone/><a:defRPr sz=\"4400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mj-lt\"/><a:ea typeface=\"+mj-ea\"/><a:cs typeface=\"+mj-cs\"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr marL=\"228600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPct val=\"0\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"685800\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2400\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"1143000\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"2000\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1600200\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"2057400\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2514600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2971800\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3429000\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3886200\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:lnSpc><a:spcPct val=\"90000\"/></a:lnSpc><a:spcBef><a:spcPts val=\"500\"/></a:spcBef><a:buFont typeface=\"Arial\" panose=\"020B0604020202020204\" pitchFamily=\"34\" charset=\"0\"/><a:buChar char=\"•\"/><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr/></a:defPPr><a:lvl1pPr marL=\"0\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL=\"457200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL=\"914400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL=\"1371600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL=\"1828800\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL=\"2286000\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL=\"2743200\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL=\"3200400\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL=\"3657600\" indent=\"-228600\" algn=\"l\" defTabSz=\"914400\" rtl=\"0\" eaLnBrk=\"1\" latinLnBrk=\"0\" hangingPunct=\"1\"><a:defRPr sz=\"1800\" kern=\"1200\"><a:solidFill><a:schemeClr val=\"tx1\"/></a:solidFill><a:latin typeface=\"+mn-lt\"/><a:ea typeface=\"+mn-ea\"/><a:cs typeface=\"+mn-cs\"/></a:defRPr></a:lvl9pPr></p:otherStyle></p:txStyles></p:sldMaster>`;\n}\n\nexport class DefaultSlideMaster extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n private readonly cacheKey: string;\n\n public constructor(\n layoutCount: number = 1,\n headerFooter?: IHeaderFooterOptions,\n masterOptions?: ISlideMasterOptions,\n slideWidth: number = SW_REF,\n masterIndex: number = 0,\n ) {\n super(\"p:sldMaster\");\n this.cacheKey = `${layoutCount}:${headerFooter ? JSON.stringify(headerFooter) : \"\"}:${masterOptions ? JSON.stringify(masterOptions) : \"\"}:${slideWidth}:${masterIndex}`;\n if (!DefaultSlideMaster.cache.has(this.cacheKey)) {\n DefaultSlideMaster.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(\n buildSlideMasterXml(\n layoutCount,\n headerFooter,\n masterOptions,\n slideWidth,\n masterIndex,\n ),\n ),\n );\n }\n }\n\n public prepForXml() {\n return DefaultSlideMaster.cache.get(this.cacheKey)!.prepForXml({ stack: [] });\n }\n}\n","import { BuilderElement, StringContainer, XmlComponent } from \"@file/xml-components\";\n\nimport type {\n AnimationClass,\n AnimationType,\n EmphasisType,\n IAnimationOptions,\n PathAnimationType,\n} from \"./types\";\n\n// --- Preset ID mappings ---\n\nconst ENTR_PRESET_IDS: Record<AnimationType, number> = {\n appear: 1,\n fade: 10,\n fly: 2,\n wipe: 22,\n dissolve: 34,\n split: 21,\n blinds: 25,\n checker: 26,\n randomBars: 24,\n wheel: 27,\n zoom: 10,\n cover: 28,\n push: 19,\n strips: 23,\n};\n\nconst EXIT_PRESET_IDS: Record<AnimationType, number> = {\n appear: 53,\n fade: 59,\n fly: 51,\n wipe: 72,\n dissolve: 84,\n split: 71,\n blinds: 75,\n checker: 76,\n randomBars: 74,\n wheel: 77,\n zoom: 60,\n cover: 78,\n push: 69,\n strips: 73,\n};\n\nconst EMPH_PRESET_IDS: Record<EmphasisType, number> = {\n growShrink: 53,\n spin: 54,\n growWithTurn: 56,\n colorChange: 29,\n transparency: 57,\n boldFlash: 50,\n wave: 55,\n pulse: 58,\n};\n\nconst PATH_PRESET_IDS: Record<PathAnimationType, number> = {\n customPath: 200,\n arc: 201,\n bounce: 202,\n circle: 203,\n curve: 204,\n figureEight: 205,\n line: 206,\n loop: 207,\n};\n\nconst DIRECTION_SUBTYPES: Record<string, number> = {\n left: 4,\n right: 8,\n up: 2,\n down: 1,\n horizontal: 16,\n vertical: 32,\n};\n\nconst FILTER_MAP: Record<string, string> = {\n fade: \"fade\",\n fly: \"fly\",\n wipe: \"wipe\",\n dissolve: \"dissolve\",\n split: \"split\",\n blinds: \"blinds\",\n checker: \"checkerboard\",\n randomBars: \"randombars\",\n wheel: \"wheel\",\n zoom: \"zoom\",\n cover: \"cover\",\n push: \"push\",\n strips: \"strips\",\n};\n\nconst DIRECTION_FILTER: Record<string, Record<string, string>> = {\n fly: { left: \"fromLeft\", right: \"fromRight\", up: \"fromTop\", down: \"fromBottom\" },\n wipe: { left: \"right\", right: \"left\", up: \"down\", down: \"up\" },\n split: { horizontal: \"horizontal\", vertical: \"vertical\" },\n blinds: { horizontal: \"horizontal\", vertical: \"vertical\" },\n checker: { horizontal: \"horizontal\", vertical: \"vertical\" },\n randomBars: { horizontal: \"horizontal\", vertical: \"vertical\" },\n cover: { left: \"left\", right: \"right\", up: \"top\", down: \"bottom\" },\n push: { left: \"left\", right: \"right\", up: \"top\", down: \"bottom\" },\n strips: {\n left: \"fromBottomLeft\",\n right: \"fromTopRight\",\n up: \"fromBottomRight\",\n down: \"fromTopLeft\",\n },\n wheel: {},\n};\n\nconst PATH_STRINGS: Record<PathAnimationType, string> = {\n customPath: \"\",\n arc: \"M 0 0 C 50 -100 100 -100 150 0\",\n bounce: \"M 0 0 L 50 0 C 50 -30 30 -50 0 -50 C -30 -50 -50 -30 -50 0 L 50 0\",\n circle: \"M 0 0 C 50 -50 100 0 50 50 C 0 100 -50 50 0 0\",\n curve: \"M 0 0 C 50 -80 100 -80 150 0 C 200 80 250 80 300 0\",\n figureEight:\n \"M 0 0 C 50 -50 100 0 50 50 C 0 100 -50 50 0 0 C -50 -50 -100 0 -50 50 C 0 100 50 50 0 0\",\n line: \"M 0 0 L 200 0\",\n loop: \"M 0 0 C 50 -80 100 0 50 80 C 0 160 -50 80 0 0\",\n};\n\n// --- Helper functions ---\n\nfunction resolvePresetId(options: IAnimationOptions): number {\n if (options.mediaType) return 1;\n if (options.attributeName) return 0;\n const cls: AnimationClass = options.class ?? \"entr\";\n\n if (cls === \"emph\" && options.emphasisType) {\n return EMPH_PRESET_IDS[options.emphasisType] ?? 0;\n }\n\n if (options.pathType) {\n return PATH_PRESET_IDS[options.pathType] ?? 200;\n }\n\n const type = options.type ?? \"appear\";\n const map = cls === \"exit\" ? EXIT_PRESET_IDS : ENTR_PRESET_IDS;\n return map[type] ?? 0;\n}\n\nfunction resolvePresetClass(options: IAnimationOptions): AnimationClass {\n if (options.mediaType) return \"mediacall\";\n if (options.attributeName) return \"entr\";\n if (options.pathType) return \"emph\";\n return options.class ?? \"entr\";\n}\n\nfunction resolvePresetSubtype(options: IAnimationOptions): number {\n if (options.direction) {\n return DIRECTION_SUBTYPES[options.direction] ?? 0;\n }\n return 0;\n}\n\nfunction buildTargetElement(spid: number, options?: IAnimationOptions): XmlComponent {\n const spTgtChildren: XmlComponent[] = [];\n if (options?.charRange) {\n spTgtChildren.push(\n new BuilderElement({\n name: \"p:txEl\",\n children: [\n new BuilderElement({\n name: \"p:charRg\",\n attributes: {\n st: { key: \"st\", value: options.charRange[0] },\n end: { key: \"end\", value: options.charRange[1] },\n },\n }),\n ],\n }),\n );\n } else if (options?.paragraphRange) {\n spTgtChildren.push(\n new BuilderElement({\n name: \"p:txEl\",\n children: [\n new BuilderElement({\n name: \"p:pRg\",\n attributes: {\n st: { key: \"st\", value: options.paragraphRange[0] },\n end: { key: \"end\", value: options.paragraphRange[1] },\n },\n }),\n ],\n }),\n );\n }\n\n return new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n children: spTgtChildren.length > 0 ? spTgtChildren : undefined,\n }),\n ],\n });\n}\n\nfunction buildEntrOrExitEffects(\n options: IAnimationOptions,\n spid: number,\n ids: { set: number; effect: number },\n): XmlComponent[] {\n const children: XmlComponent[] = [];\n\n // p:set — make shape visible (entr) or hidden (exit)\n const cls = options.class ?? \"entr\";\n const visibility = cls === \"exit\" ? \"hidden\" : \"visible\";\n children.push(\n new BuilderElement({\n name: \"p:set\",\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.set },\n dur: { key: \"dur\", value: \"1\" },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: { delay: { key: \"delay\", value: \"0\" } },\n }),\n ],\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:attrNameLst\",\n children: [new StringContainer(\"p:attrName\", \"style.visibility\")],\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:to\",\n children: [\n new BuilderElement({\n name: \"p:strVal\",\n attributes: { val: { key: \"val\", value: visibility } },\n }),\n ],\n }),\n ],\n }),\n );\n\n // p:animEffect for non-appear types\n if (options.type !== \"appear\") {\n const filterBase = FILTER_MAP[options.type ?? \"fade\"];\n const dirMap = DIRECTION_FILTER[options.type ?? \"fade\"];\n const dirFilter = options.direction && dirMap ? dirMap[options.direction] : undefined;\n\n let filter = filterBase;\n if (options.type === \"wheel\") {\n filter = \"wheel(4)\";\n } else if (options.type === \"split\") {\n const dir = options.direction ?? \"horizontal\";\n filter = `split(${dir})`;\n } else if (dirFilter) {\n filter = `${filterBase}(${dirFilter})`;\n }\n\n const transition = cls === \"exit\" ? \"out\" : \"in\";\n\n children.push(\n new BuilderElement({\n name: \"p:animEffect\",\n attributes: {\n transition: { key: \"transition\", value: transition },\n filter: { key: \"filter\", value: filter },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: String(options.duration ?? 500) },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n }\n\n return children;\n}\n\nfunction buildEmphasisEffects(\n options: IAnimationOptions,\n spid: number,\n ids: { set: number; effect: number },\n): XmlComponent[] {\n const emphType = options.emphasisType ?? \"growShrink\";\n const children: XmlComponent[] = [];\n const dur = String(options.duration ?? 500);\n\n // Common target element\n const tgtEl = new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:spTgt\",\n attributes: { spid: { key: \"spid\", value: spid } },\n }),\n ],\n });\n\n switch (emphType) {\n case \"growShrink\":\n children.push(\n new BuilderElement({\n name: \"p:animScale\",\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n ...(options.autoReverse\n ? { autoRev: { key: \"autoRev\", value: 1 } }\n : {}),\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"0\" },\n },\n }),\n ],\n }),\n ],\n }),\n tgtEl,\n ],\n }),\n new BuilderElement({\n name: \"p:by\",\n attributes: {\n x: { key: \"x\", value: \"150000\" },\n y: { key: \"y\", value: \"150000\" },\n },\n }),\n ],\n }),\n );\n break;\n\n case \"spin\":\n children.push(\n new BuilderElement({\n name: \"p:animRot\",\n attributes: { by: { key: \"by\", value: \"3600000\" } },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"0\" },\n },\n }),\n ],\n }),\n ],\n }),\n tgtEl,\n ],\n }),\n ],\n }),\n );\n break;\n\n case \"colorChange\": {\n const color = options.color ?? \"FF0000\";\n children.push(\n new BuilderElement({\n name: \"p:animClr\",\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"0\" },\n },\n }),\n ],\n }),\n ],\n }),\n tgtEl,\n ],\n }),\n new BuilderElement({\n name: \"p:to\",\n children: [\n new BuilderElement({\n name: \"a:srgbClr\",\n attributes: { val: { key: \"val\", value: color } },\n }),\n ],\n }),\n ],\n }),\n );\n break;\n }\n\n case \"transparency\":\n children.push(\n new BuilderElement({\n name: \"p:anim\",\n attributes: {\n calcmode: { key: \"calcmode\", value: \"lin\" },\n valueType: { key: \"valueType\", value: \"num\" },\n from: { key: \"from\", value: \"0\" },\n to: { key: \"to\", value: \"1\" },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n tgtEl,\n new BuilderElement({\n name: \"p:attrNameLst\",\n children: [new StringContainer(\"p:attrName\", \"style.opacity\")],\n }),\n ],\n }),\n ],\n }),\n );\n break;\n\n default:\n // boldFlash, wave, pulse, growWithTurn — use p:animEffect with emph filter\n children.push(\n new BuilderElement({\n name: \"p:animEffect\",\n attributes: {\n transition: { key: \"transition\", value: \"in\" },\n filter: { key: \"filter\", value: emphType },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n tgtEl,\n ],\n }),\n ],\n }),\n );\n break;\n }\n\n return children;\n}\n\nfunction buildPathEffects(\n options: IAnimationOptions,\n spid: number,\n ids: { set: number; effect: number },\n): XmlComponent[] {\n const pathStr = options.path ?? PATH_STRINGS[options.pathType ?? \"customPath\"] ?? \"\";\n const dur = String(options.duration ?? 1000);\n\n return [\n new BuilderElement({\n name: \"p:animMotion\",\n attributes: {\n origin: { key: \"origin\", value: \"layout\" },\n path: { key: \"path\", value: pathStr },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.effect },\n dur: { key: \"dur\", value: dur },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: { delay: { key: \"delay\", value: \"0\" } },\n }),\n ],\n }),\n ],\n }),\n buildTargetElement(spid, options),\n ],\n }),\n ],\n }),\n ];\n}\n\n/**\n * Build p:cmd for media play/pause/stop (goes inside the animation sequence).\n * PowerPoint uses p:cmd type=\"call\" cmd=\"playFrom(0.0)\" for video play.\n */\nfunction buildMediaPlayCommand(\n options: IAnimationOptions,\n spid: number,\n ids: { cmd: number },\n): XmlComponent {\n const cmdStr = options.fullScreen ? \"playFrom(0.0,1.0)\" : \"playFrom(0.0)\";\n\n return new BuilderElement({\n name: \"p:cmd\",\n attributes: {\n type: { key: \"type\", value: \"call\" },\n cmd: { key: \"cmd\", value: cmdStr },\n },\n children: [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.cmd },\n dur: { key: \"dur\", value: String(options.duration ?? 10000) },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n buildTargetElement(spid),\n ],\n }),\n ],\n });\n}\n\n/**\n * Build p:video/p:audio with p:cMediaNode (goes as sibling of p:seq).\n * This is the media state controller, separate from the play command.\n */\nfunction buildMediaStateNode(\n options: IAnimationOptions,\n spid: number,\n ids: { mediaCtn: number },\n): XmlComponent {\n const isVideo = options.mediaType === \"playVideo\";\n const elementName = isVideo ? \"p:video\" : \"p:audio\";\n\n const mediaAttrs: Record<string, { key: string; value: string | number | boolean }> = {};\n if (!isVideo && options.isNarration) {\n mediaAttrs.isNarration = { key: \"isNarration\", value: true };\n }\n if (isVideo && options.fullScreen) {\n mediaAttrs.fullScrn = { key: \"fullScrn\", value: true };\n }\n\n const cMediaNodeAttrs: Record<string, { key: string; value: string | number }> = {};\n if (options.volume !== undefined) {\n cMediaNodeAttrs.vol = { key: \"vol\", value: options.volume * 1000 };\n } else {\n cMediaNodeAttrs.vol = { key: \"vol\", value: 80000 };\n }\n if (options.mute) {\n cMediaNodeAttrs.mute = { key: \"mute\", value: 1 };\n }\n\n return new BuilderElement({\n name: elementName,\n attributes: Object.keys(mediaAttrs).length > 0 ? mediaAttrs : undefined,\n children: [\n new BuilderElement({\n name: \"p:cMediaNode\",\n attributes: cMediaNodeAttrs,\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.mediaCtn },\n fill: { key: \"fill\", value: \"hold\" },\n display: { key: \"display\", value: \"0\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: \"indefinite\" },\n },\n }),\n ],\n }),\n ],\n }),\n buildTargetElement(spid),\n ],\n }),\n ],\n });\n}\n\nfunction buildPropertyAnimation(\n options: IAnimationOptions,\n spid: number,\n ids: { cBhvr: number },\n): XmlComponent {\n const attrs: Record<string, { key: string; value: string }> = {};\n if (options.calcMode) attrs.calcmode = { key: \"calcmode\", value: options.calcMode };\n if (options.valueType) attrs.valueType = { key: \"valueType\", value: options.valueType };\n if (options.from !== undefined) attrs.from = { key: \"from\", value: options.from };\n if (options.to !== undefined) attrs.to = { key: \"to\", value: options.to };\n if (options.animBy !== undefined) attrs.by = { key: \"by\", value: options.animBy };\n\n const cBhvrChildren: XmlComponent[] = [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: ids.cBhvr },\n dur: { key: \"dur\", value: String(options.duration ?? 500) },\n fill: { key: \"fill\", value: \"hold\" },\n },\n }),\n buildTargetElement(spid, options),\n ];\n\n if (options.attributeName) {\n cBhvrChildren.push(\n new BuilderElement({\n name: \"p:attrNameLst\",\n children: [new StringContainer(\"p:attrName\", options.attributeName)],\n }),\n );\n }\n\n const animChildren: XmlComponent[] = [\n new BuilderElement({\n name: \"p:cBhvr\",\n children: cBhvrChildren,\n }),\n ];\n\n // Build tavLst if from/to are specified\n if (options.from !== undefined || options.to !== undefined) {\n const tavList: XmlComponent[] = [];\n if (options.from !== undefined) {\n tavList.push(\n new BuilderElement({\n name: \"p:tav\",\n attributes: { tm: { key: \"tm\", value: \"0\" } },\n children: [\n new BuilderElement({\n name: \"p:val\",\n children: [\n new BuilderElement({\n name: \"p:strVal\",\n attributes: { val: { key: \"val\", value: options.from } },\n }),\n ],\n }),\n ],\n }),\n );\n }\n if (options.to !== undefined) {\n tavList.push(\n new BuilderElement({\n name: \"p:tav\",\n attributes: { tm: { key: \"tm\", value: \"100000\" } },\n children: [\n new BuilderElement({\n name: \"p:val\",\n children: [\n new BuilderElement({\n name: \"p:strVal\",\n attributes: { val: { key: \"val\", value: options.to } },\n }),\n ],\n }),\n ],\n }),\n );\n }\n if (tavList.length > 0) {\n animChildren.push(\n new BuilderElement({\n name: \"p:tavLst\",\n children: tavList,\n }),\n );\n }\n }\n\n return new BuilderElement({\n name: \"p:anim\",\n attributes: Object.keys(attrs).length > 0 ? attrs : undefined,\n children: animChildren,\n });\n}\n\n// --- Main class ---\n\ninterface IAnimationEntry {\n readonly spid: number;\n readonly options: IAnimationOptions;\n}\n\n/**\n * p:timing — Slide timing for shape animations.\n */\nexport class SlideTiming extends XmlComponent {\n public constructor(entries: readonly IAnimationEntry[]) {\n super(\"p:timing\");\n\n if (entries.length === 0) return;\n\n let id = 1;\n const rootCtnId = id++;\n const seqCtnId = id++;\n\n const animationNodes: XmlComponent[] = [];\n const mediaStateNodes: XmlComponent[] = [];\n let clickGroupDelay = 0;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n const { spid, options } = entry;\n\n const nodeType =\n options.trigger === \"withPrevious\"\n ? \"withEffect\"\n : options.trigger === \"afterPrevious\"\n ? \"afterEffect\"\n : \"clickEffect\";\n\n if (options.trigger === \"afterPrevious\" && i > 0) {\n clickGroupDelay += (options.duration ?? 500) + (options.delay ?? 0);\n }\n if (options.trigger === \"onClick\" || options.trigger === undefined) {\n clickGroupDelay = 0;\n }\n\n const groupCtnId = id++;\n const effectCtnId = id++;\n const setCtnId = id++;\n const effectCtnId2 = id++;\n\n const presetId = resolvePresetId(options);\n const presetClass = resolvePresetClass(options);\n const presetSubtype = resolvePresetSubtype(options);\n\n // Build effect children based on animation class\n let effectChildren: XmlComponent[];\n\n if (options.mediaType) {\n effectChildren = [buildMediaPlayCommand(options, spid, { cmd: effectCtnId2 })];\n // Generate media state node (p:video/p:audio) as sibling of p:seq\n const mediaStateId = id++;\n mediaStateNodes.push(\n buildMediaStateNode(options, spid, { mediaCtn: mediaStateId }),\n );\n } else if (options.attributeName) {\n effectChildren = [buildPropertyAnimation(options, spid, { cBhvr: effectCtnId2 })];\n } else if (options.pathType) {\n effectChildren = buildPathEffects(options, spid, {\n set: setCtnId,\n effect: effectCtnId2,\n });\n } else if (presetClass === \"emph\") {\n effectChildren = buildEmphasisEffects(options, spid, {\n set: setCtnId,\n effect: effectCtnId2,\n });\n } else {\n effectChildren = buildEntrOrExitEffects(options, spid, {\n set: setCtnId,\n effect: effectCtnId2,\n });\n }\n\n // Build cTn attributes with optional speed/repeatCount/autoReverse\n const cTnAttrs: Record<string, { key: string; value: string | number }> = {\n id: { key: \"id\", value: effectCtnId },\n fill: { key: \"fill\", value: \"hold\" },\n nodeType: { key: \"nodeType\", value: nodeType },\n };\n if (!options.mediaType && !options.attributeName) {\n cTnAttrs.presetID = { key: \"presetID\", value: presetId };\n cTnAttrs.presetClass = { key: \"presetClass\", value: presetClass };\n cTnAttrs.presetSubtype = { key: \"presetSubtype\", value: presetSubtype };\n }\n if (options.mediaType) {\n cTnAttrs.presetID = { key: \"presetID\", value: presetId };\n cTnAttrs.presetClass = { key: \"presetClass\", value: presetClass };\n cTnAttrs.presetSubtype = { key: \"presetSubtype\", value: presetSubtype };\n }\n if (options.speed !== undefined)\n cTnAttrs.spd = { key: \"spd\", value: String(options.speed) };\n if (options.repeatCount !== undefined)\n cTnAttrs.repeatCount = { key: \"repeatCount\", value: String(options.repeatCount) };\n if (options.autoReverse) cTnAttrs.autoRev = { key: \"autoRev\", value: 1 };\n\n // Build effect cTn\n const effectCtn = new BuilderElement({\n name: \"p:cTn\",\n attributes: cTnAttrs,\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n delay: { key: \"delay\", value: String(options.delay ?? 0) },\n },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:childTnLst\",\n children: effectChildren,\n }),\n ],\n });\n\n // Wrap in inner par\n const innerPar = new BuilderElement({\n name: \"p:par\",\n children: [effectCtn],\n });\n\n // Wrap in outer par (click group)\n const outerPar = new BuilderElement({\n name: \"p:par\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: groupCtnId },\n fill: { key: \"fill\", value: \"hold\" },\n },\n children: [\n new BuilderElement({\n name: \"p:stCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: { delay: { key: \"delay\", value: \"0\" } },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:childTnLst\",\n children: [innerPar],\n }),\n ],\n }),\n ],\n });\n\n animationNodes.push(outerPar);\n }\n\n // Assemble the full timing tree\n this.root.push(\n new BuilderElement({\n name: \"p:tnLst\",\n children: [\n new BuilderElement({\n name: \"p:par\",\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: rootCtnId },\n dur: { key: \"dur\", value: \"indefinite\" },\n restart: { key: \"restart\", value: \"never\" },\n nodeType: { key: \"nodeType\", value: \"tmRoot\" },\n },\n children: [\n new BuilderElement({\n name: \"p:childTnLst\",\n children: [\n new BuilderElement({\n name: \"p:seq\",\n attributes: {\n concurrent: { key: \"concurrent\", value: 1 },\n nextAc: { key: \"nextAc\", value: \"seek\" },\n },\n children: [\n new BuilderElement({\n name: \"p:cTn\",\n attributes: {\n id: { key: \"id\", value: seqCtnId },\n dur: {\n key: \"dur\",\n value: \"indefinite\",\n },\n nodeType: {\n key: \"nodeType\",\n value: \"mainSeq\",\n },\n },\n children: [\n new BuilderElement({\n name: \"p:childTnLst\",\n children: animationNodes,\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:prevCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n evt: {\n key: \"evt\",\n value: \"onPrev\",\n },\n delay: {\n key: \"delay\",\n value: \"0\",\n },\n },\n children: [\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:sldTgt\",\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:nextCondLst\",\n children: [\n new BuilderElement({\n name: \"p:cond\",\n attributes: {\n evt: {\n key: \"evt\",\n value: \"onNext\",\n },\n delay: {\n key: \"delay\",\n value: \"0\",\n },\n },\n children: [\n new BuilderElement({\n name: \"p:tgtEl\",\n children: [\n new BuilderElement({\n name: \"p:sldTgt\",\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n ...mediaStateNodes,\n ],\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n }\n}\n","import type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\n\nconst ORIENT_TYPES = new Set([\"blinds\", \"checker\", \"comb\", \"randomBar\"]);\n\nconst SIDE_DIR_TYPES = new Set([\"push\", \"wipe\"]);\n\nconst EIGHT_DIR_TYPES = new Set([\"cover\", \"pull\"]);\n\nexport type TransitionType =\n | \"fade\"\n | \"push\"\n | \"wipe\"\n | \"split\"\n | \"blinds\"\n | \"checker\"\n | \"comb\"\n | \"randomBar\"\n | \"cover\"\n | \"pull\"\n | \"strips\"\n | \"wheel\"\n | \"zoom\"\n | \"circle\"\n | \"dissolve\"\n | \"diamond\"\n | \"newsflash\"\n | \"plus\"\n | \"wedge\"\n | \"random\"\n | \"cut\";\n\nexport interface ITransitionOptions {\n readonly type?: TransitionType;\n readonly speed?: \"slow\" | \"med\" | \"fast\";\n readonly advanceOnClick?: boolean;\n readonly advanceAfterTime?: number;\n readonly dir?: string;\n readonly orient?: \"horz\" | \"vert\";\n readonly thruBlk?: boolean;\n readonly spokes?: number;\n}\n\nfunction buildTransitionElement(\n type: TransitionType,\n dir?: string,\n orient?: string,\n thruBlk?: boolean,\n spokes?: number,\n): IXmlableObject {\n const attrs: Record<string, string | number> = {};\n\n if (ORIENT_TYPES.has(type) && dir) {\n attrs.dir = dir;\n } else if (SIDE_DIR_TYPES.has(type) && dir) {\n attrs.dir = dir;\n } else if (EIGHT_DIR_TYPES.has(type) && dir) {\n attrs.dir = dir;\n } else if (type === \"strips\" && dir) {\n attrs.dir = dir;\n } else if ((type === \"fade\" || type === \"cut\") && thruBlk !== undefined) {\n attrs.thruBlk = thruBlk ? 1 : 0;\n } else if (type === \"split\") {\n attrs.orient = orient ?? \"horz\";\n attrs.dir = dir ?? \"out\";\n } else if (type === \"wheel\") {\n attrs.spokes = spokes ?? 4;\n } else if (type === \"zoom\" && dir) {\n attrs.dir = dir;\n }\n\n return { [`p:${type}`]: Object.keys(attrs).length > 0 ? { _attr: attrs } : {} };\n}\n\nexport function buildTransition(options: ITransitionOptions): IXmlableObject {\n const children: IXmlableObject[] = [];\n const attrs: Record<string, string | number> = {};\n if (options.speed) attrs.spd = options.speed;\n if (options.advanceOnClick !== undefined) attrs.advClick = options.advanceOnClick ? 1 : 0;\n if (options.advanceAfterTime !== undefined) attrs.advTm = options.advanceAfterTime;\n if (Object.keys(attrs).length > 0) children.push({ _attr: attrs });\n\n if (options.type) {\n children.push(\n buildTransitionElement(\n options.type,\n options.dir,\n options.orient,\n options.thruBlk,\n options.spokes,\n ),\n );\n }\n\n return { \"p:transition\": children.length === 0 ? {} : children };\n}\n\n/**\n * p:transition — Slide transition effect.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class Transition extends BaseXmlComponent {\n private readonly options: ITransitionOptions;\n\n public constructor(options: ITransitionOptions = {}) {\n super(\"p:transition\");\n this.options = options;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n return buildTransition(this.options);\n }\n}\n","import { SlideTiming } from \"@file/animation/timing\";\nimport type { IAnimationOptions } from \"@file/animation/types\";\nimport type { Background } from \"@file/background/background\";\nimport type { IHeaderFooterOptions } from \"@file/header-footer/header-footer\";\nimport type { ITransitionOptions } from \"@file/transition/transition\";\nimport { buildTransition } from \"@file/transition/transition\";\nimport { BaseXmlComponent, XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\ninterface IAnimatable {\n readonly ShapeId: number;\n readonly Animation?: IAnimationOptions;\n}\n\nfunction isAnimatable(child: BaseXmlComponent): child is BaseXmlComponent & IAnimatable {\n return \"ShapeId\" in child && \"Animation\" in child;\n}\n\nfunction collectAnimations(children: readonly BaseXmlComponent[]): Array<{\n readonly spid: number;\n readonly options: IAnimationOptions;\n}> {\n const entries: Array<{ readonly spid: number; readonly options: IAnimationOptions }> = [];\n for (const child of children) {\n if (isAnimatable(child)) {\n const anim = child.Animation;\n if (anim) {\n entries.push({ spid: child.ShapeId, options: anim });\n }\n }\n }\n return entries;\n}\n\n/**\n * p:sld — A slide in a presentation.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class Slide extends XmlComponent {\n private readonly children: readonly BaseXmlComponent[];\n private readonly background?: Background;\n private readonly transition?: ITransitionOptions;\n public readonly HeaderFooter?: IHeaderFooterOptions;\n\n public constructor(\n children: readonly BaseXmlComponent[],\n background?: Background,\n transition?: ITransitionOptions,\n headerFooter?: IHeaderFooterOptions,\n ) {\n super(\"p:sld\");\n this.children = children;\n this.background = background;\n this.transition = transition;\n this.HeaderFooter = headerFooter;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const children: IXmlableObject[] = [];\n\n // xmlns attributes\n children.push({\n _attr: {\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:p\": \"http://schemas.openxmlformats.org/presentationml/2006/main\",\n },\n });\n\n // p:cSld — common slide data (background + shape tree)\n const cSldChildren: IXmlableObject[] = [];\n if (this.background) {\n const bgObj = this.background.prepForXml(context);\n if (bgObj) cSldChildren.push(bgObj);\n }\n\n // p:spTree — shape tree\n const spTreeChildren: IXmlableObject[] = [\n {\n \"p:nvGrpSpPr\": [\n { \"p:cNvPr\": { _attr: { id: 1, name: \"\" } } },\n { \"p:cNvGrpSpPr\": {} },\n { \"p:nvPr\": {} },\n ],\n },\n {\n \"p:grpSpPr\": {\n \"a:xfrm\": [\n { \"a:off\": { _attr: { x: 0, y: 0 } } },\n { \"a:ext\": { _attr: { cx: 0, cy: 0 } } },\n { \"a:chOff\": { _attr: { x: 0, y: 0 } } },\n { \"a:chExt\": { _attr: { cx: 0, cy: 0 } } },\n ],\n },\n },\n ];\n for (const child of this.children) {\n const obj = child.prepForXml(context);\n if (obj) spTreeChildren.push(obj);\n }\n cSldChildren.push({ \"p:spTree\": spTreeChildren });\n\n children.push({ \"p:cSld\": cSldChildren });\n\n // p:clrMapOvr\n children.push({ \"p:clrMapOvr\": [{ \"a:masterClrMapping\": {} }] });\n\n // p:transition (optional)\n if (this.transition) {\n const transObj = buildTransition(this.transition);\n if (transObj) children.push(transObj);\n }\n\n // p:timing (animation)\n const animations = collectAnimations(this.children);\n if (animations.length > 0) {\n const timing = new SlideTiming(animations);\n const timingObj = timing.prepForXml(context);\n if (timingObj) children.push(timingObj);\n }\n\n return { \"p:sld\": children };\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nconst TABLE_STYLES_XML = `<a:tblStyleLst xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\"/>`;\n\nexport class TableStyles extends ImportedXmlComponent {\n private static instance = ImportedXmlComponent.fromXmlString(TABLE_STYLES_XML);\n\n public constructor() {\n super(\"a:tblStyleLst\");\n }\n\n public prepForXml() {\n return TableStyles.instance.prepForXml({ stack: [] });\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\ninterface IColorSchemeOptions {\n dark1?: string;\n light1?: string;\n dark2?: string;\n light2?: string;\n accent1?: string;\n accent2?: string;\n accent3?: string;\n accent4?: string;\n accent5?: string;\n accent6?: string;\n hyperlink?: string;\n followedHyperlink?: string;\n}\n\ninterface IFontSchemeOptions {\n majorFont?: string;\n minorFont?: string;\n majorFontAsian?: string;\n minorFontAsian?: string;\n}\n\nexport interface IThemeOptions {\n name?: string;\n colors?: IColorSchemeOptions;\n fonts?: IFontSchemeOptions;\n}\n\nconst DEFAULT_COLORS: Required<IColorSchemeOptions> = {\n dark1: \"000000\",\n light1: \"FFFFFF\",\n dark2: \"44546A\",\n light2: \"E7E6E6\",\n accent1: \"4472C4\",\n accent2: \"ED7D31\",\n accent3: \"A5A5A5\",\n accent4: \"FFC000\",\n accent5: \"5B9BD5\",\n accent6: \"70AD47\",\n hyperlink: \"0563C1\",\n followedHyperlink: \"954F72\",\n};\n\nfunction buildThemeXml(options?: IThemeOptions): string {\n const name = options?.name ?? \"Office Theme\";\n const c = { ...DEFAULT_COLORS, ...options?.colors };\n const f = options?.fonts;\n\n const majorFont = f?.majorFont ?? \"Calibri Light\";\n const minorFont = f?.minorFont ?? \"Calibri\";\n const majorFontAsian = f?.majorFontAsian ?? \"\";\n const minorFontAsian = f?.minorFontAsian ?? \"\";\n\n // dk1/lt1 use sysClr in Office theme; srgbClr override when customized\n const dk1 =\n options?.colors?.dark1 !== undefined\n ? `<a:srgbClr val=\"${c.dark1}\"/>`\n : `<a:sysClr val=\"windowText\" lastClr=\"000000\"/>`;\n const lt1 =\n options?.colors?.light1 !== undefined\n ? `<a:srgbClr val=\"${c.light1}\"/>`\n : `<a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>`;\n\n return `<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"${name}\">\n <a:themeElements>\n <a:clrScheme name=\"${name}\">\n <a:dk1>${dk1}</a:dk1>\n <a:lt1>${lt1}</a:lt1>\n <a:dk2><a:srgbClr val=\"${c.dark2}\"/></a:dk2>\n <a:lt2><a:srgbClr val=\"${c.light2}\"/></a:lt2>\n <a:accent1><a:srgbClr val=\"${c.accent1}\"/></a:accent1>\n <a:accent2><a:srgbClr val=\"${c.accent2}\"/></a:accent2>\n <a:accent3><a:srgbClr val=\"${c.accent3}\"/></a:accent3>\n <a:accent4><a:srgbClr val=\"${c.accent4}\"/></a:accent4>\n <a:accent5><a:srgbClr val=\"${c.accent5}\"/></a:accent5>\n <a:accent6><a:srgbClr val=\"${c.accent6}\"/></a:accent6>\n <a:hlink><a:srgbClr val=\"${c.hyperlink}\"/></a:hlink>\n <a:folHlink><a:srgbClr val=\"${c.followedHyperlink}\"/></a:folHlink>\n </a:clrScheme>\n <a:fontScheme name=\"${name}\">\n <a:majorFont>\n <a:latin typeface=\"${majorFont}\"/>\n <a:ea typeface=\"${majorFontAsian}\"/>\n <a:cs typeface=\"\"/>\n </a:majorFont>\n <a:minorFont>\n <a:latin typeface=\"${minorFont}\"/>\n <a:ea typeface=\"${minorFontAsian}\"/>\n <a:cs typeface=\"\"/>\n </a:minorFont>\n </a:fontScheme>\n <a:fmtScheme name=\"Office\">\n <a:fillStyleLst>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n </a:fillStyleLst>\n <a:lnStyleLst>\n <a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln>\n <a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln>\n <a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln>\n </a:lnStyleLst>\n <a:effectStyleLst>\n <a:effectStyle><a:effectLst/></a:effectStyle>\n <a:effectStyle><a:effectLst/></a:effectStyle>\n <a:effectStyle><a:effectLst/></a:effectStyle>\n </a:effectStyleLst>\n <a:bgFillStyleLst>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n <a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>\n </a:bgFillStyleLst>\n </a:fmtScheme>\n </a:themeElements>\n <a:objectDefaults/>\n <a:extraClrSchemeLst/>\n</a:theme>`;\n}\n\nexport class DefaultTheme extends ImportedXmlComponent {\n private static cache = new Map<string, ImportedXmlComponent>();\n private readonly cacheKey: string;\n\n public constructor(options?: IThemeOptions) {\n super(\"a:theme\");\n this.cacheKey = options ? JSON.stringify(options) : \"\";\n if (!DefaultTheme.cache.has(this.cacheKey)) {\n DefaultTheme.cache.set(\n this.cacheKey,\n ImportedXmlComponent.fromXmlString(buildThemeXml(options)),\n );\n }\n }\n\n public prepForXml() {\n return DefaultTheme.cache.get(this.cacheKey)!.prepForXml({ stack: [] });\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nconst VIEW_PROPS_XML = `<p:viewPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\n <p:normalViewPr>\n <p:restoredLeft sz=\"14996\" autoAdjust=\"0\"/>\n <p:restoredTop sz=\"94660\"/>\n </p:normalViewPr>\n <p:slideViewPr>\n <p:cSldViewPr snapToGrid=\"0\">\n <p:cViewPr varScale=\"1\">\n <p:scale><a:sx n=\"90\" d=\"100\"/><a:sy n=\"90\" d=\"100\"/></p:scale>\n <p:origin x=\"1200\" y=\"72\"/>\n </p:cViewPr>\n <p:guideLst/>\n </p:cSldViewPr>\n </p:slideViewPr>\n <p:notesTextViewPr>\n <p:cViewPr>\n <p:scale><a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale>\n <p:origin x=\"0\" y=\"0\"/>\n </p:cViewPr>\n </p:notesTextViewPr>\n <p:gridSpacing cx=\"72008\" cy=\"72008\"/>\n</p:viewPr>`;\n\nexport class ViewProperties extends ImportedXmlComponent {\n private static instance = ImportedXmlComponent.fromXmlString(VIEW_PROPS_XML);\n\n public constructor() {\n super(\"p:viewPr\");\n }\n\n public prepForXml() {\n return ViewProperties.instance.prepForXml({ stack: [] });\n }\n}\n","import { AppProperties } from \"@file/app-properties/app-properties\";\nimport { Background, type IBackgroundOptions } from \"@file/background/background\";\nimport { ChartCollection } from \"@file/chart/chart-collection\";\nimport { CommentAuthorList } from \"@file/comment/comment-author-list\";\nimport type { AuthorEntry } from \"@file/comment/comment-author-list\";\nimport { SlideCommentList } from \"@file/comment/slide-comment-list\";\nimport { ContentTypes } from \"@file/content-types/content-types\";\nimport { CoreProperties, type ICorePropertiesOptions } from \"@file/core-properties/properties\";\nimport type { IHeaderFooterOptions } from \"@file/header-footer/header-footer\";\nimport { HyperlinkCollection } from \"@file/hyperlink-collection\";\nimport { Media } from \"@file/media/media\";\nimport { NotesSlide } from \"@file/notes/notes-slide\";\nimport { PresentationProperties } from \"@file/presentation-properties\";\nimport { PresentationWrapper } from \"@file/presentation/presentation-wrapper\";\nimport { Relationships } from \"@file/relationships/relationships\";\nimport { SlideLayout, type SlideLayoutType } from \"@file/slide-layout/slide-layout\";\nimport {\n DefaultSlideMaster,\n type IMasterPlaceholderPosition,\n type ISlideMasterOptions,\n} from \"@file/slide-master/slide-master\";\nimport { Slide } from \"@file/slide/slide\";\nimport { SmartArtCollection } from \"@file/smartart/smartart-collection\";\nimport { TableStyles } from \"@file/table-styles\";\nimport { DefaultTheme, type IThemeOptions } from \"@file/theme/theme\";\nimport type { ITransitionOptions } from \"@file/transition/transition\";\nimport { ViewProperties } from \"@file/view-properties\";\nimport type { BaseXmlComponent } from \"@file/xml-components\";\nimport type { RelationshipType } from \"@office-open/core\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\n// ── Public interfaces ──\n\nexport type SlideSize = \"16:9\" | \"4:3\" | { readonly width: number; readonly height: number };\n\nexport interface ILayoutPlaceholderOptions {\n readonly title?: IMasterPlaceholderPosition | false;\n readonly body?: IMasterPlaceholderPosition | false;\n readonly subtitle?: IMasterPlaceholderPosition | false;\n readonly date?: IMasterPlaceholderPosition | false;\n readonly footer?: IMasterPlaceholderPosition | false;\n readonly slideNumber?: IMasterPlaceholderPosition | false;\n}\n\nexport interface ILayoutDefinition {\n readonly type?: SlideLayoutType;\n readonly name?: string;\n readonly placeholders?: ILayoutPlaceholderOptions;\n readonly children?: readonly BaseXmlComponent[];\n}\n\nexport interface IMasterDefinition extends ISlideMasterOptions {\n readonly name?: string;\n readonly theme?: IThemeOptions;\n readonly layouts?: readonly ILayoutDefinition[];\n}\n\nexport interface ICommentOptions {\n readonly author: string;\n readonly text: string;\n readonly x: number;\n readonly y: number;\n readonly initials?: string;\n readonly date?: string;\n}\n\nexport interface ISlideOptions {\n readonly children?: readonly BaseXmlComponent[];\n readonly background?: IBackgroundOptions;\n readonly notes?: string;\n readonly transition?: ITransitionOptions;\n readonly headerFooter?: IHeaderFooterOptions;\n readonly comments?: readonly ICommentOptions[];\n readonly layout?: SlideLayoutType | string;\n readonly master?: string;\n}\n\nexport interface IShowOptions {\n readonly loop?: boolean;\n readonly kiosk?: boolean;\n readonly showNarration?: boolean;\n readonly useTimings?: boolean;\n}\n\nexport interface IPresentationOptions extends ICorePropertiesOptions {\n readonly size?: SlideSize;\n readonly masters?: readonly IMasterDefinition[];\n readonly slides?: readonly ISlideOptions[];\n readonly show?: IShowOptions;\n}\n\ninterface RelEntry {\n readonly id: number | string;\n readonly type: RelationshipType;\n readonly target: string;\n readonly mode?: string;\n}\n\nfunction buildRelationships(entries: readonly RelEntry[]): Relationships {\n const rels = new Relationships();\n for (const e of entries) {\n rels.addRelationship(e.id, e.type, e.target, e.mode as \"External\" | undefined);\n }\n return rels;\n}\n\nfunction deriveInitials(name: string): string {\n const parts = name.trim().split(/\\s+/);\n return parts.length >= 2\n ? (parts[0][0] + parts[parts.length - 1][0]).toUpperCase()\n : name.slice(0, 2).toUpperCase();\n}\n\nfunction resolveSlideSize(size?: SlideSize): { width: number; height: number } {\n if (!size || size === \"16:9\") return { width: 12192000, height: 6858000 };\n if (size === \"4:3\") return { width: 9144000, height: 6858000 };\n return { width: convertPixelsToEmu(size.width), height: convertPixelsToEmu(size.height) };\n}\n\ninterface LayoutInfo {\n readonly key: string;\n readonly index: number;\n readonly masterIndex: number;\n readonly layout: SlideLayout;\n}\n\ninterface MasterInfo {\n readonly name: string;\n readonly index: number;\n readonly definition: IMasterDefinition;\n readonly master: DefaultSlideMaster;\n readonly theme: DefaultTheme;\n readonly layouts: LayoutInfo[];\n readonly masterRels: Relationships;\n readonly layoutRels: Relationships[];\n}\n\nexport class File {\n private readonly slideOptions: readonly ISlideOptions[];\n private readonly corePropsOptions: ICorePropertiesOptions;\n private readonly showOptions?: IShowOptions;\n private readonly slideWidthEmus: number;\n private readonly slideHeightEmus: number;\n private readonly masterDefs: readonly IMasterDefinition[];\n\n // Lazy components\n private coreProperties?: CoreProperties;\n private appProperties?: AppProperties;\n private contentTypes?: ContentTypes;\n private media?: Media;\n private charts?: ChartCollection;\n private smartArts?: SmartArtCollection;\n private hyperlinks?: HyperlinkCollection;\n private presentationWrapper?: PresentationWrapper;\n private tableStyles?: TableStyles;\n private presProps?: PresentationProperties;\n private viewProps?: ViewProperties;\n private notesMasterRels?: Relationships;\n\n // Multi-master support\n private masterMap?: MasterInfo[];\n private allLayouts?: readonly LayoutInfo[];\n private allLayoutRels?: readonly Relationships[];\n\n // Lazy slide data\n private slides?: Slide[];\n private slideWrappers?: Array<{ readonly View: Slide; readonly Relationships: Relationships }>;\n private notesSlides?: NotesSlide[];\n private commentAuthorList?: CommentAuthorList;\n private slideCommentLists?: (SlideCommentList | undefined)[];\n\n // Lazy relationship data\n private fileRels?: Relationships;\n\n public constructor(options: IPresentationOptions) {\n this.slideOptions = options.slides ?? [];\n this.corePropsOptions = options;\n this.showOptions = options.show;\n this.masterDefs = options.masters ?? [];\n const sz = resolveSlideSize(options.size);\n this.slideWidthEmus = sz.width;\n this.slideHeightEmus = sz.height;\n }\n\n // ── Master / Layout resolution ──\n\n private getMasterMap(): MasterInfo[] {\n if (this.masterMap) return this.masterMap;\n\n const defs = this.masterDefs.length > 0 ? this.masterDefs : [{} as IMasterDefinition];\n const slideMasterLookup = new Map<number, number>();\n\n // Build slide → master index lookup\n for (let si = 0; si < this.slideOptions.length; si++) {\n const masterName = this.slideOptions[si].master;\n if (masterName === undefined) {\n slideMasterLookup.set(si, 0);\n continue;\n }\n const mi = defs.findIndex((d) => d.name === masterName);\n slideMasterLookup.set(si, mi >= 0 ? mi : 0);\n }\n\n let globalLayoutIndex = 0;\n const masters: MasterInfo[] = [];\n\n for (let mi = 0; mi < defs.length; mi++) {\n const def = defs[mi];\n const name = def.name ?? `master${mi + 1}`;\n\n // Collect layout types needed for this master\n const layoutDefs = def.layouts;\n let layoutKeys: readonly string[];\n if (layoutDefs && layoutDefs.length > 0) {\n layoutKeys = layoutDefs.map(\n (ld) => ld.type ?? ld.name ?? `layout${mi}_${layoutDefs.indexOf(ld)}`,\n );\n } else {\n // Auto-derive from slides referencing this master\n const seen = new Set<string>();\n const keys: string[] = [];\n for (let si = 0; si < this.slideOptions.length; si++) {\n if (slideMasterLookup.get(si) === mi) {\n const lt = this.slideOptions[si].layout ?? \"blank\";\n if (!seen.has(lt)) {\n seen.add(lt);\n keys.push(lt);\n }\n }\n }\n layoutKeys = keys.length > 0 ? keys : [\"blank\"];\n }\n\n const hf = this.slideOptions.find((s) => s.headerFooter)?.headerFooter;\n const master = new DefaultSlideMaster(\n layoutKeys.length,\n hf,\n def,\n this.slideWidthEmus,\n mi,\n );\n const theme = new DefaultTheme(def.theme);\n\n const layouts: LayoutInfo[] = [];\n const layoutRels: Relationships[] = [];\n\n for (let li = 0; li < layoutKeys.length; li++) {\n const key = layoutKeys[li];\n const layoutDef = layoutDefs?.[li];\n const slideLayoutType = (layoutDef?.type ?? key) as SlideLayoutType;\n layouts.push({\n key,\n index: globalLayoutIndex,\n masterIndex: mi,\n layout: new SlideLayout(slideLayoutType, this.slideWidthEmus, layoutDef),\n });\n layoutRels.push(\n buildRelationships([\n {\n id: 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\",\n target: `../slideMasters/slideMaster${mi + 1}.xml`,\n },\n ]),\n );\n globalLayoutIndex++;\n }\n\n // Master rels: layouts + theme\n const masterRelsEntries: RelEntry[] = [];\n for (let li = 0; li < layouts.length; li++) {\n masterRelsEntries.push({\n id: li + 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\",\n target: `../slideLayouts/slideLayout${layouts[li].index + 1}.xml`,\n });\n }\n masterRelsEntries.push({\n id: layouts.length + 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n target: `../theme/theme${mi + 1}.xml`,\n });\n\n masters.push({\n name,\n index: mi,\n definition: def,\n master,\n theme,\n layouts,\n masterRels: buildRelationships(masterRelsEntries),\n layoutRels,\n });\n }\n\n this.masterMap = masters;\n this.allLayouts = masters.flatMap((m) => m.layouts);\n this.allLayoutRels = masters.flatMap((m) => m.layoutRels);\n return this.masterMap;\n }\n\n private findLayoutForSlide(slideIndex: number): LayoutInfo {\n const opts = this.slideOptions[slideIndex];\n const masters = this.getMasterMap();\n const mi =\n opts.master !== undefined\n ? Math.max(\n 0,\n masters.findIndex((m) => m.name === opts.master),\n )\n : 0;\n const master = masters[mi];\n const layoutKey = opts.layout ?? \"blank\";\n const li = master.layouts.find((l) => l.key === layoutKey);\n return li ?? master.layouts[0];\n }\n\n // ── Lazy getters ──\n\n public get CoreProperties(): CoreProperties {\n return (this.coreProperties ??= new CoreProperties(this.corePropsOptions));\n }\n\n public get AppProperties(): AppProperties {\n return (this.appProperties ??= new AppProperties());\n }\n\n public get ContentTypes(): ContentTypes {\n if (!this.contentTypes) {\n this.contentTypes = new ContentTypes();\n let hasComments = false;\n for (let i = 0; i < this.slideOptions.length; i++) {\n this.contentTypes.addSlide(i + 1);\n if (this.slideOptions[i].notes) {\n this.contentTypes.addNotesSlide(i + 1);\n }\n if (this.slideOptions[i].comments && this.slideOptions[i].comments!.length > 0) {\n this.contentTypes.addComments(i + 1);\n hasComments = true;\n }\n }\n if (hasComments) {\n this.contentTypes.addCommentAuthors();\n }\n }\n return this.contentTypes;\n }\n\n public get FileRelationships(): Relationships {\n if (!this.fileRels) {\n this.fileRels = buildRelationships([\n {\n id: 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n target: \"ppt/presentation.xml\",\n },\n {\n id: 2,\n type: \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n target: \"docProps/core.xml\",\n },\n {\n id: 3,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n target: \"docProps/app.xml\",\n },\n ]);\n }\n return this.fileRels;\n }\n\n public get Media(): Media {\n return (this.media ??= new Media());\n }\n\n public get Charts(): ChartCollection {\n return (this.charts ??= new ChartCollection());\n }\n\n public get SmartArts(): SmartArtCollection {\n return (this.smartArts ??= new SmartArtCollection());\n }\n\n public get Hyperlinks(): HyperlinkCollection {\n return (this.hyperlinks ??= new HyperlinkCollection());\n }\n\n public get PresentationWrapper(): PresentationWrapper {\n if (!this.presentationWrapper) {\n const masters = this.getMasterMap();\n this.presentationWrapper = new PresentationWrapper({\n slideWidth: this.slideWidthEmus,\n slideHeight: this.slideHeightEmus,\n slideIds: this.slideOptions.map((_, i) => 256 + i),\n masterCount: masters.length,\n });\n const presRels = this.PresentationWrapper.Relationships;\n let rid = 1;\n // Masters\n for (let mi = 0; mi < masters.length; mi++) {\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\",\n `slideMasters/slideMaster${mi + 1}.xml`,\n );\n }\n // Slides\n for (let i = 0; i < this.slideOptions.length; i++) {\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\",\n `slides/slide${i + 1}.xml`,\n );\n }\n // Static parts\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\",\n \"presProps.xml\",\n );\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\",\n \"viewProps.xml\",\n );\n for (let mi = 0; mi < masters.length; mi++) {\n presRels.addRelationship(\n rid++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n `theme/theme${mi + 1}.xml`,\n );\n }\n presRels.addRelationship(\n rid,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\",\n \"tableStyles.xml\",\n );\n }\n return this.presentationWrapper;\n }\n\n public get Themes(): readonly DefaultTheme[] {\n return this.getMasterMap().map((m) => m.theme);\n }\n\n public get TableStyles(): TableStyles {\n return (this.tableStyles ??= new TableStyles());\n }\n\n public get PresProps(): PresentationProperties {\n return (this.presProps ??= new PresentationProperties(this.showOptions));\n }\n\n public get ViewProps(): ViewProperties {\n return (this.viewProps ??= new ViewProperties());\n }\n\n public get SlideMasters(): readonly DefaultSlideMaster[] {\n return this.getMasterMap().map((m) => m.master);\n }\n\n public get SlideMasterRelsArray(): readonly Relationships[] {\n return this.getMasterMap().map((m) => m.masterRels);\n }\n\n public get AllLayouts(): readonly LayoutInfo[] {\n this.getMasterMap();\n return this.allLayouts!;\n }\n\n public get AllLayoutRelsArray(): readonly Relationships[] {\n this.getMasterMap();\n return this.allLayoutRels!;\n }\n\n public get Slides(): readonly Slide[] {\n if (!this.slides) {\n this.slides = [];\n for (const s of this.slideOptions) {\n this.slides.push(\n new Slide(\n s.children ?? [],\n s.background ? new Background(s.background) : undefined,\n s.transition,\n s.headerFooter,\n ),\n );\n }\n }\n return this.slides;\n }\n\n public get SlideWrappers(): Array<{\n readonly View: Slide;\n readonly Relationships: Relationships;\n }> {\n if (!this.slideWrappers) {\n this.slideWrappers = [];\n for (let i = 0; i < this.slideOptions.length; i++) {\n const layout = this.findLayoutForSlide(i);\n this.slideWrappers.push({\n View: this.Slides[i],\n Relationships: buildRelationships([\n {\n id: 1,\n type: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\",\n target: `../slideLayouts/slideLayout${layout.index + 1}.xml`,\n },\n ]),\n });\n }\n }\n return this.slideWrappers;\n }\n\n public get NotesSlides(): readonly NotesSlide[] {\n if (!this.notesSlides) {\n this.notesSlides = [];\n for (let i = 0; i < this.slideOptions.length; i++) {\n if (this.slideOptions[i].notes) {\n this.notesSlides.push(new NotesSlide({ text: this.slideOptions[i].notes }));\n }\n }\n }\n return this.notesSlides;\n }\n\n public get NotesMasterRelationships(): Relationships {\n return (this.notesMasterRels ??= new Relationships());\n }\n\n public get CommentAuthorList(): CommentAuthorList | undefined {\n if (!this.commentAuthorList && !this.slideCommentLists) {\n this.buildComments();\n }\n return this.commentAuthorList;\n }\n\n public get SlideCommentLists(): readonly (SlideCommentList | undefined)[] {\n if (!this.slideCommentLists) {\n this.buildComments();\n }\n return this.slideCommentLists!;\n }\n\n private buildComments(): void {\n const authorMap = new Map<\n string,\n { id: number; name: string; initials: string; clrIdx: number; commentCount: number }\n >();\n let nextAuthorId = 0;\n\n this.slideCommentLists = Array.from<SlideCommentList | undefined>({\n length: this.slideOptions.length,\n });\n\n for (let i = 0; i < this.slideOptions.length; i++) {\n const slideComments = this.slideOptions[i].comments;\n if (!slideComments || slideComments.length === 0) continue;\n\n const commentEntries: Array<{\n readonly authorId: number;\n readonly idx: number;\n readonly date?: string;\n readonly x: number;\n readonly y: number;\n readonly text: string;\n }> = [];\n\n for (const c of slideComments) {\n let author = authorMap.get(c.author);\n if (!author) {\n const id = nextAuthorId++;\n author = {\n id,\n name: c.author,\n initials: c.initials || deriveInitials(c.author),\n clrIdx: id,\n commentCount: 0,\n };\n authorMap.set(c.author, author);\n }\n author.commentCount++;\n\n commentEntries.push({\n authorId: author.id,\n idx: author.commentCount,\n date: c.date,\n x: c.x,\n y: c.y,\n text: c.text,\n });\n }\n\n this.slideCommentLists[i] = new SlideCommentList(commentEntries);\n }\n\n if (authorMap.size > 0) {\n const authors: AuthorEntry[] = [...authorMap.values()].map((a) => ({\n id: a.id,\n name: a.name,\n initials: a.initials,\n clrIdx: a.clrIdx,\n lastIdx: a.commentCount,\n }));\n this.commentAuthorList = new CommentAuthorList(authors);\n }\n }\n}\n","import {\n createOutline,\n PresetDash,\n LineEndType,\n LineEndWidth,\n LineEndLength,\n} from \"@office-open/core/drawingml\";\nimport type {\n OutlineOptions as CoreOutlineOptions,\n LineEndOptions as CoreLineEndOptions,\n} from \"@office-open/core/drawingml\";\n\n/**\n * PPTX-specific outline options (backward-compatible API).\n */\nexport interface OutlineOptions {\n readonly width?: number;\n readonly color?: string;\n readonly dashStyle?: \"solid\" | \"dash\" | \"dashDot\" | \"lgDash\" | \"sysDot\" | \"sysDash\";\n}\n\nexport type { CoreOutlineOptions as OutlineOptionsCore };\n\nconst DASH_STYLE_MAP: Record<string, keyof typeof PresetDash> = {\n solid: \"SOLID\",\n dash: \"DASH\",\n dashDot: \"DASH_DOT\",\n lgDash: \"LG_DASH\",\n sysDot: \"SYS_DOT\",\n sysDash: \"SYS_DASH\",\n};\n\nconst ARROWHEAD_MAP: Record<string, keyof typeof LineEndType> = {\n triangle: \"TRIANGLE\",\n stealth: \"STEALTH\",\n diamond: \"DIAMOND\",\n oval: \"OVAL\",\n open: \"ARROW\",\n};\n\nconst ARROWHEAD_SIZE_MAP: Record<string, keyof typeof LineEndWidth> = {\n sm: \"SMALL\",\n med: \"MEDIUM\",\n lg: \"LARGE\",\n};\n\nfunction toCoreLineEnd(type: string, width?: string, length?: string): CoreLineEndOptions {\n return {\n type: ARROWHEAD_MAP[type] ?? \"TRIANGLE\",\n ...(width ? { width: ARROWHEAD_SIZE_MAP[width] as keyof typeof LineEndWidth } : {}),\n ...(length ? { length: ARROWHEAD_SIZE_MAP[length] as keyof typeof LineEndLength } : {}),\n };\n}\n\n/**\n * Creates an outline element using pptx's simplified API.\n */\nexport const createOutlineCompat = (\n options: OutlineOptions = {},\n arrowheads?: {\n readonly beginType?: string;\n readonly endType?: string;\n readonly width?: string;\n readonly length?: string;\n },\n) =>\n createOutline({\n width: options.width,\n ...(options.color\n ? { type: \"solidFill\" as const, color: { value: options.color.replace(\"#\", \"\") } }\n : { type: \"noFill\" as const }),\n ...(options.dashStyle && {\n dash: DASH_STYLE_MAP[options.dashStyle] ?? \"SOLID\",\n }),\n ...(arrowheads?.endType\n ? { headEnd: toCoreLineEnd(arrowheads.endType, arrowheads.width, arrowheads.length) }\n : {}),\n ...(arrowheads?.beginType\n ? { tailEnd: toCoreLineEnd(arrowheads.beginType, arrowheads.width, arrowheads.length) }\n : {}),\n } satisfies CoreOutlineOptions);\n","import { XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport {\n createTransform2D,\n type Transform2DOptions as CoreTransform2DOptions,\n} from \"@office-open/core/drawingml\";\n\nexport type ITransform2DOptions = CoreTransform2DOptions;\n\n/**\n * a:xfrm / p:xfrm — 2D transform for shapes and graphic frames (position + size in EMUs).\n * Delegates to core createTransform2D.\n */\nexport class Transform2D extends XmlComponent {\n private readonly core: XmlComponent;\n\n public constructor(options: ITransform2DOptions, prefix: \"a\" | \"p\" = \"a\") {\n super(`${prefix}:xfrm`);\n this.core = createTransform2D(options, `${prefix}:xfrm`);\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n return this.core[\"prepForXml\"]?.(context);\n }\n}\n","import type { File } from \"@file/file\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { createPptxEffectList, buildScene3D, buildShape3D, type IEffectsOptions } from \"./effects\";\nimport { buildFill, extractBlipFillMedia } from \"./fill\";\nimport type { FillOptions } from \"./fill\";\nimport { createOutlineCompat } from \"./outline\";\nimport type { OutlineOptions } from \"./outline\";\nimport { PresetGeometry } from \"./preset-geometry\";\nimport { Transform2D } from \"./transform-2d\";\n\nexport interface IConnectionSiteOptions {\n readonly x: number;\n readonly y: number;\n readonly angle?: number;\n}\n\nexport interface IShapePropertiesOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly flipHorizontal?: boolean;\n readonly rotation?: number;\n readonly geometry?: string;\n readonly fill?: FillOptions;\n readonly outline?: OutlineOptions;\n readonly effects?: IEffectsOptions;\n readonly connectionSites?: readonly IConnectionSiteOptions[];\n}\n\n/**\n * p:spPr — Shape properties (transform, geometry, fill, outline, effects).\n * Lazy: stores options, builds XML object directly in prepForXml.\n */\nexport class ShapeProperties extends BaseXmlComponent {\n private readonly options: IShapePropertiesOptions;\n\n public constructor(options: IShapePropertiesOptions) {\n super(\"p:spPr\");\n this.options = options;\n }\n\n public prepForXml(context: IContext<File>): IXmlableObject | undefined {\n const opts = this.options;\n const children: IXmlableObject[] = [];\n\n // Transform2D\n if (\n opts.x !== undefined ||\n opts.y !== undefined ||\n opts.width !== undefined ||\n opts.height !== undefined ||\n opts.flipHorizontal !== undefined ||\n opts.rotation !== undefined\n ) {\n const xfrmObj = new Transform2D(opts).prepForXml(context);\n if (xfrmObj) children.push(xfrmObj);\n }\n\n // PresetGeometry\n const geomObj = new PresetGeometry({ preset: opts.geometry ?? \"rect\" }).prepForXml(context);\n if (geomObj) children.push(geomObj);\n\n // Fill (register blipFill media — B-level side effect)\n const media = opts.fill ? extractBlipFillMedia(opts.fill) : undefined;\n if (media) {\n context.fileData?.Media.addImage(media.fileName, {\n data: media.data,\n fileName: media.fileName,\n type: media.type as \"png\",\n transformation: { pixels: { x: 0, y: 0 }, emus: { x: 0, y: 0 } },\n });\n }\n\n const fillComponent = buildFill(opts.fill !== undefined ? opts.fill : { type: \"none\" });\n const fillObj = fillComponent.prepForXml(context);\n if (fillObj) children.push(fillObj);\n\n // Outline\n if (opts.outline) {\n const outlineObj = createOutlineCompat(opts.outline).prepForXml(context);\n if (outlineObj) children.push(outlineObj);\n }\n\n // Effects\n if (opts.effects) {\n const effectObj = createPptxEffectList(opts.effects);\n if (effectObj) {\n const effectXmlObj = effectObj.prepForXml(context);\n if (effectXmlObj) children.push(effectXmlObj);\n }\n\n const scene3d = buildScene3D(opts.effects);\n if (scene3d) {\n const sceneObj = scene3d.prepForXml(context);\n if (sceneObj) children.push(sceneObj);\n }\n\n const shape3d = buildShape3D(opts.effects);\n if (shape3d) {\n const shapeObj = shape3d.prepForXml(context);\n if (shapeObj) children.push(shapeObj);\n }\n }\n\n // Connection sites\n if (opts.connectionSites && opts.connectionSites.length > 0) {\n const cxnChildren: IXmlableObject[] = [];\n for (const site of opts.connectionSites) {\n const siteAttrs: Record<string, string | number> = { pos: `${site.x} ${site.y}` };\n if (site.angle !== undefined) siteAttrs.ang = site.angle;\n cxnChildren.push({ \"a:cxn\": { _attr: siteAttrs } });\n }\n children.push({ \"a:cxnLst\": cxnChildren });\n }\n\n return { \"p:spPr\": children };\n }\n}\n","/**\n * Position/size conversion utilities for PPTX components.\n * @module\n */\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\n/**\n * Pixel position options accepted by most positioned components.\n */\nexport interface IPositionOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n}\n\n/**\n * Converts pixel position/size values to EMU, defaulting missing values to 0.\n *\n * Used by components that always need a transform (ChartFrame, Picture,\n * TableFrame, SmartArtFrame, MediaFrameBase, etc.).\n */\nexport function emuPosition(opts: IPositionOptions): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n return {\n x: convertPixelsToEmu(opts.x ?? 0),\n y: convertPixelsToEmu(opts.y ?? 0),\n width: convertPixelsToEmu(opts.width ?? 0),\n height: convertPixelsToEmu(opts.height ?? 0),\n };\n}\n\n/**\n * Converts pixel position/size values to EMU, preserving undefined.\n *\n * Used by Shape which may omit position to let PowerPoint auto-layout.\n */\nexport function emuPositionOptional(opts: IPositionOptions): {\n x: number | undefined;\n y: number | undefined;\n width: number | undefined;\n height: number | undefined;\n} {\n return {\n x: opts.x !== undefined ? convertPixelsToEmu(opts.x) : undefined,\n y: opts.y !== undefined ? convertPixelsToEmu(opts.y) : undefined,\n width: opts.width !== undefined ? convertPixelsToEmu(opts.width) : undefined,\n height: opts.height !== undefined ? convertPixelsToEmu(opts.height) : undefined,\n };\n}\n","import type { IAnimationOptions } from \"@file/animation/types\";\nimport type { IEffectsOptions } from \"@file/drawingml/effects\";\nimport type { OutlineOptions } from \"@file/drawingml/outline\";\nimport { ShapeProperties } from \"@file/drawingml/shape-properties\";\nimport type { IShapePropertiesOptions } from \"@file/drawingml/shape-properties\";\nimport type { File } from \"@file/file\";\nimport { XmlComponent as Xc } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { emuPositionOptional } from \"@util/position\";\n\nimport { Paragraph } from \"./paragraph/paragraph\";\nimport { TextBody } from \"./text-body\";\nimport type { ITextBodyOptions } from \"./text-body\";\n\nexport interface IShapeOptions {\n readonly id?: number;\n readonly name?: string;\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly geometry?: string;\n readonly fill?: IShapePropertiesOptions[\"fill\"];\n readonly outline?: OutlineOptions;\n readonly effects?: IEffectsOptions;\n readonly flipHorizontal?: boolean;\n readonly rotation?: number;\n readonly text?: string;\n readonly paragraphs?: ITextBodyOptions[\"paragraphs\"];\n readonly textVertical?: ITextBodyOptions[\"vertical\"];\n readonly textAnchor?: ITextBodyOptions[\"anchor\"];\n readonly textAutoFit?: ITextBodyOptions[\"autoFit\"];\n readonly textWrap?: ITextBodyOptions[\"wrap\"];\n readonly textMargins?: ITextBodyOptions[\"margins\"];\n readonly textColumns?: ITextBodyOptions[\"columns\"];\n readonly textColumnSpacing?: ITextBodyOptions[\"columnSpacing\"];\n readonly animation?: IAnimationOptions;\n readonly placeholder?: \"title\" | \"body\" | \"subTitle\" | \"sldNum\" | \"dt\" | \"ftr\" | \"hdr\" | \"obj\";\n readonly placeholderIndex?: number;\n}\n\n/**\n * Pure function: builds p:ph element for placeholder.\n */\nfunction buildPlaceholder(type: string, index?: number): IXmlableObject {\n const attrs: Record<string, string | number> = { type };\n if (index !== undefined) attrs.idx = index;\n return { \"p:ph\": { _attr: attrs } };\n}\n\n/**\n * p:sp — A shape on a slide.\n * Lazy: stores options, builds XML object in prepForXml.\n *\n * x/y/width/height accept pixel values and are internally converted to EMUs.\n */\nexport class Shape extends Xc {\n private static nextId = 2;\n private readonly shapeId: number;\n private readonly animationOptions?: IAnimationOptions;\n private readonly options: IShapeOptions;\n\n public constructor(options: IShapeOptions = {}) {\n super(\"p:sp\");\n\n const id = options.id ?? Shape.nextId++;\n this.shapeId = id;\n this.animationOptions = options.animation;\n this.options = { ...options, id };\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n\n public get Animation(): IAnimationOptions | undefined {\n return this.animationOptions;\n }\n\n public override prepForXml(context: IContext): IXmlableObject | undefined {\n const opts = this.options;\n const id = this.shapeId;\n const name = opts.name ?? `Shape ${id}`;\n const children: IXmlableObject[] = [];\n\n // nvSpPr\n const nvPrChildren: IXmlableObject[] = [];\n if (opts.placeholder) {\n nvPrChildren.push(buildPlaceholder(opts.placeholder, opts.placeholderIndex));\n }\n children.push({\n \"p:nvSpPr\": [\n { \"p:cNvPr\": { _attr: { id, name } } },\n { \"p:cNvSpPr\": {} },\n { \"p:nvPr\": nvPrChildren.length > 0 ? nvPrChildren : {} },\n ],\n });\n\n // spPr (ShapeProperties)\n const shapeProps: IShapePropertiesOptions = {\n ...emuPositionOptional(opts),\n geometry: opts.geometry,\n fill: opts.fill,\n outline: opts.outline,\n effects: opts.effects,\n flipHorizontal: opts.flipHorizontal,\n rotation: opts.rotation,\n };\n const spPr = new ShapeProperties(shapeProps);\n const spPrObj = spPr.prepForXml(context as IContext<File>);\n if (spPrObj) children.push(spPrObj);\n\n // txBody (TextBody)\n const textBodyOptions: ITextBodyOptions = {\n paragraphs:\n opts.paragraphs ?? (opts.text ? [new Paragraph({ text: opts.text })] : undefined),\n vertical: opts.textVertical,\n anchor: opts.textAnchor,\n autoFit: opts.textAutoFit,\n wrap: opts.textWrap,\n margins: opts.textMargins,\n columns: opts.textColumns,\n columnSpacing: opts.textColumnSpacing,\n };\n const txBody = new TextBody(textBodyOptions);\n const txBodyObj = txBody.prepForXml(context);\n if (txBodyObj) children.push(txBodyObj);\n\n return { \"p:sp\": children };\n }\n}\n","import { StringContainer } from \"@file/xml-components\";\n\n/**\n * a:t — Text content within a run.\n */\nexport class Text extends StringContainer {\n public constructor(value: string) {\n super(\"a:t\", value);\n }\n}\n","import {\n NextAttributeComponent,\n BuilderElement,\n StringContainer,\n XmlComponent,\n} from \"@file/xml-components\";\n\n/**\n * a:fld — A field element for dynamic content in slide text.\n *\n * Used in slide master placeholders for slide numbers, dates, etc.\n */\nexport class Field extends XmlComponent {\n public constructor(fieldType: string, displayText: string) {\n super(\"a:fld\");\n\n this.root.push(\n new NextAttributeComponent({\n id: { key: \"id\", value: `{${crypto.randomUUID()}}` },\n type: { key: \"type\", value: fieldType },\n }),\n );\n\n this.root.push(\n new BuilderElement({\n name: \"a:rPr\",\n attributes: {\n lang: { key: \"lang\", value: \"en-US\" },\n smtClean: { key: \"smtClean\", value: 0 },\n },\n }),\n );\n\n this.root.push(new StringContainer(\"a:t\", displayText));\n }\n}\n\n/**\n * Slide number field — outputs current slide number.\n */\nexport class SlideNumberField extends Field {\n public constructor(displayText = \"<#>\") {\n super(\"slidenum\", displayText);\n }\n}\n\n/**\n * Date/time field — outputs formatted date.\n */\nexport class DateTimeField extends Field {\n public constructor(displayText?: string, format?: string) {\n super(format ?? \"datetimeFigureOut\", displayText ?? \"\");\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\nimport { createBlip, Stretch } from \"@office-open/core/drawingml\";\n\n/**\n * a:blipFill — Image fill with stretch mode.\n * Uses core createBlip for the blip element.\n */\nexport class BlipFill extends XmlComponent {\n public constructor(fileName: string) {\n super(\"a:blipFill\");\n this.root.push(createBlip({ referenceId: fileName }));\n this.root.push(new Stretch());\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\n\n/**\n * a:cNvPr — Non-visual drawing properties (id, name).\n */\nexport class NonVisualDrawingProperties extends BuilderElement<{\n readonly id: number;\n readonly name: string;\n}> {\n public constructor(id: number, name: string) {\n super({\n name: \"a:cNvPr\",\n attributes: { id: { key: \"id\", value: id }, name: { key: \"name\", value: name } },\n });\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\n/**\n * p:cNvSpPr — Non-visual shape properties.\n * Uses p: prefix in PresentationML context.\n */\nexport class NonVisualShapeProperties extends XmlComponent {\n public constructor() {\n super(\"p:cNvSpPr\");\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\n/**\n * a:cNvPicPr — Non-visual picture drawing properties.\n * Uses a: prefix (DrawingML type) but referenced via p:cNvPicPr in PML context.\n */\nexport class NonVisualPictureProperties extends XmlComponent {\n public constructor() {\n super(\"a:cNvPicPr\");\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\nexport interface IGroupShapeOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly rotation?: number;\n readonly flipHorizontal?: boolean;\n readonly children: readonly BaseXmlComponent[];\n}\n\n/**\n * p:grpSp — Group shape containing child shapes.\n * Lazy: stores options, builds XML object in prepForXml.\n */\nexport class GroupShape extends BaseXmlComponent {\n private static nextId = 100;\n private readonly id: number;\n private readonly options: IGroupShapeOptions;\n\n public constructor(options: IGroupShapeOptions) {\n super(\"p:grpSp\");\n this.id = GroupShape.nextId++;\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const opts = this.options;\n const id = this.id;\n const name = `Group ${id}`;\n const children: IXmlableObject[] = [];\n\n // p:nvGrpSpPr\n children.push({\n \"p:nvGrpSpPr\": [\n { \"p:cNvPr\": { _attr: { id, name } } },\n { \"p:cNvGrpSpPr\": {} },\n { \"p:nvPr\": {} },\n ],\n });\n\n // p:grpSpPr\n const xfrmChildren: IXmlableObject[] = [];\n const xfrmAttrs: Record<string, string | number> = {};\n if (opts.flipHorizontal !== undefined) xfrmAttrs.flipH = opts.flipHorizontal ? 1 : 0;\n if (opts.rotation !== undefined) xfrmAttrs.rot = opts.rotation;\n if (Object.keys(xfrmAttrs).length > 0) xfrmChildren.push({ _attr: xfrmAttrs });\n xfrmChildren.push({\n \"a:off\": {\n _attr: {\n x: opts.x !== undefined ? convertPixelsToEmu(opts.x) : 0,\n y: opts.y !== undefined ? convertPixelsToEmu(opts.y) : 0,\n },\n },\n });\n xfrmChildren.push({\n \"a:ext\": {\n _attr: {\n cx: opts.width !== undefined ? convertPixelsToEmu(opts.width) : 0,\n cy: opts.height !== undefined ? convertPixelsToEmu(opts.height) : 0,\n },\n },\n });\n xfrmChildren.push({ \"a:chOff\": { _attr: { x: 0, y: 0 } } });\n xfrmChildren.push({ \"a:chExt\": { _attr: { cx: 0, cy: 0 } } });\n children.push({ \"p:grpSpPr\": { \"a:xfrm\": xfrmChildren } });\n\n // Child shapes — direct children of p:grpSp (after nvGrpSpPr and grpSpPr)\n for (const child of opts.children) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"p:grpSp\": children };\n }\n}\n","import type { FillOptions } from \"@file/drawingml/fill\";\nimport { buildFill } from \"@file/drawingml/fill\";\nimport { NonVisualShapeProperties } from \"@file/drawingml/non-visual-shape-props\";\nimport { createOutlineCompat, type OutlineOptions } from \"@file/drawingml/outline\";\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { BuilderElement, XmlComponent as Xc } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\n\n/**\n * p:sp — A line shape on a slide.\n */\nexport class LineShape extends Xc {\n private static nextId = 2;\n private readonly shapeId: number;\n\n public constructor(options: ILineShapeOptions = {}) {\n super(\"p:sp\");\n\n const id = options.id ?? LineShape.nextId++;\n this.shapeId = id;\n const name = options.name ?? `Line ${id}`;\n\n const x1 = convertPixelsToEmu(options.x1 ?? 0);\n const y1 = convertPixelsToEmu(options.y1 ?? 0);\n const x2 = convertPixelsToEmu(options.x2 ?? 100);\n const y2 = convertPixelsToEmu(options.y2 ?? 100);\n\n this.root.push(\n new BuilderElement({\n name: \"p:nvSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n new NonVisualShapeProperties(),\n new BuilderElement({ name: \"p:nvPr\" }),\n ],\n }),\n );\n\n const offX = Math.min(x1, x2);\n const offY = Math.min(y1, y2);\n\n const xfrmAttrs:\n | Record<string, { readonly key: string; readonly value: string | number }>\n | undefined =\n x1 > x2 || y1 > y2\n ? (() => {\n const a: Record<\n string,\n { readonly key: string; readonly value: string | number }\n > = {};\n if (x1 > x2) a.flipH = { key: \"flipH\", value: 1 };\n if (y1 > y2) a.flipV = { key: \"flipV\", value: 1 };\n return a;\n })()\n : undefined;\n\n const spPrChildren: BuilderElement<{}>[] = [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: { x: { key: \"x\", value: offX }, y: { key: \"y\", value: offY } },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: Math.abs(x2 - x1) },\n cy: { key: \"cy\", value: Math.abs(y2 - y1) },\n },\n }),\n ],\n attributes: xfrmAttrs,\n }),\n new PresetGeometry({ preset: \"line\" }),\n ];\n\n if (options.fill !== undefined) {\n spPrChildren.push(buildFill(options.fill));\n }\n if (options.outline) {\n spPrChildren.push(createOutlineCompat(options.outline));\n }\n\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: spPrChildren,\n }),\n );\n\n this.root.push(\n new BuilderElement({\n name: \"p:txBody\",\n children: [\n new BuilderElement({\n name: \"a:bodyPr\",\n attributes: { wrap: { key: \"wrap\", value: \"square\" } },\n }),\n new BuilderElement({ name: \"a:lstStyle\" }),\n new BuilderElement({ name: \"a:p\" }),\n ],\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n}\n\nexport interface ILineShapeOptions {\n readonly id?: number;\n readonly name?: string;\n readonly x1?: number;\n readonly y1?: number;\n readonly x2?: number;\n readonly y2?: number;\n readonly fill?: FillOptions;\n readonly outline?: OutlineOptions;\n}\n\nexport type ArrowheadType = \"triangle\" | \"stealth\" | \"diamond\" | \"oval\" | \"open\" | \"none\";\n\n/**\n * p:cxnSp — A connector shape on a slide (line with optional arrowheads).\n */\nexport class ConnectorShape extends Xc {\n private static nextId = 2;\n private readonly shapeId: number;\n\n public constructor(options: IConnectorShapeOptions = {}) {\n super(\"p:cxnSp\");\n\n const id = options.id ?? ConnectorShape.nextId++;\n this.shapeId = id;\n const name = options.name ?? `Connector ${id}`;\n\n const x1 = convertPixelsToEmu(options.x1 ?? 0);\n const y1 = convertPixelsToEmu(options.y1 ?? 0);\n const x2 = convertPixelsToEmu(options.x2 ?? 100);\n const y2 = convertPixelsToEmu(options.y2 ?? 100);\n\n this.root.push(\n new BuilderElement({\n name: \"p:nvCxnSpPr\",\n children: [\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n new BuilderElement({ name: \"p:cNvCxnSpPr\" }),\n new BuilderElement({ name: \"p:nvPr\" }),\n ],\n }),\n );\n\n const offX = Math.min(x1, x2);\n const offY = Math.min(y1, y2);\n\n const xfrmAttrs:\n | Record<string, { readonly key: string; readonly value: string | number }>\n | undefined =\n x1 > x2 || y1 > y2\n ? (() => {\n const a: Record<\n string,\n { readonly key: string; readonly value: string | number }\n > = {};\n if (x1 > x2) a.flipH = { key: \"flipH\", value: 1 };\n if (y1 > y2) a.flipV = { key: \"flipV\", value: 1 };\n return a;\n })()\n : undefined;\n\n const spPrChildren: BuilderElement<{}>[] = [\n new BuilderElement({\n name: \"a:xfrm\",\n children: [\n new BuilderElement({\n name: \"a:off\",\n attributes: { x: { key: \"x\", value: offX }, y: { key: \"y\", value: offY } },\n }),\n new BuilderElement({\n name: \"a:ext\",\n attributes: {\n cx: { key: \"cx\", value: Math.abs(x2 - x1) },\n cy: { key: \"cy\", value: Math.abs(y2 - y1) },\n },\n }),\n ],\n attributes: xfrmAttrs,\n }),\n new PresetGeometry({ preset: \"line\" }),\n ];\n\n if (options.fill !== undefined) {\n spPrChildren.push(buildFill(options.fill));\n }\n\n // Arrowheads + outline: headEnd/tailEnd must be inside a:ln per XSD\n const hasArrowheads = options.beginArrowhead || options.endArrowhead;\n if (options.outline || hasArrowheads) {\n spPrChildren.push(\n createOutlineCompat(\n options.outline ?? {},\n hasArrowheads\n ? {\n beginType: options.beginArrowhead,\n endType: options.endArrowhead,\n width: options.arrowheadWidth,\n length: options.arrowheadLength,\n }\n : undefined,\n ),\n );\n }\n\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: spPrChildren,\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n}\n\nexport interface IConnectorShapeOptions {\n readonly id?: number;\n readonly name?: string;\n readonly x1?: number;\n readonly y1?: number;\n readonly x2?: number;\n readonly y2?: number;\n readonly fill?: FillOptions;\n readonly outline?: OutlineOptions;\n readonly beginArrowhead?: ArrowheadType;\n readonly endArrowhead?: ArrowheadType;\n readonly arrowheadWidth?: \"sm\" | \"med\" | \"lg\";\n readonly arrowheadLength?: \"sm\" | \"med\" | \"lg\";\n}\n","import type { IAnimationOptions } from \"@file/animation/types\";\n/**\n * Shared base class for media frames (video, audio) on slides.\n * @module\n */\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { Transform2D } from \"@file/drawingml/transform-2d\";\nimport type { File } from \"@file/file\";\nimport type { IMediaData } from \"@file/media/data\";\nimport { BuilderElement, type IContext, XmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { emuPosition } from \"@util/position\";\n\n/**\n * Common options for all media frames.\n * @internal\n */\nexport interface IMediaFrameBaseOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly data: Uint8Array;\n readonly type: IMediaData[\"type\"];\n readonly name?: string;\n readonly animation?: IAnimationOptions;\n}\n\n/**\n * Builds an IMediaData object from pixel dimensions and raw data.\n * Generic parameter preserves the specific type literal for correct union narrowing.\n */\nfunction buildMediaData<T extends IMediaData[\"type\"]>(\n type: T,\n fileName: string,\n width: number,\n height: number,\n data: Uint8Array,\n): IMediaData & { readonly type: T } {\n return {\n type,\n fileName,\n transformation: {\n pixels: { x: width, y: height },\n emus: { x: convertPixelsToEmu(width), y: convertPixelsToEmu(height) },\n },\n data,\n } as IMediaData & { readonly type: T };\n}\n\n/**\n * Base class for media frames (video, audio) on slides.\n *\n * Encapsulates the common structure: ID assignment, media data building,\n * p:spPr (Transform2D + PresetGeometry), p:blipFill, p:nvPicPr parts,\n * and media registration in prepForXml.\n */\nexport abstract class MediaFrameBase extends XmlComponent {\n private readonly shapeId: number;\n private readonly animationOptions?: IAnimationOptions;\n protected readonly mediaData: IMediaData;\n protected readonly posterData?: IMediaData;\n\n protected constructor(\n options: IMediaFrameBaseOptions,\n id: number,\n mediaFileName: string,\n params: {\n readonly extUri: string;\n readonly cNvPrPrefix: string;\n readonly nvPrExtraChildren?: BuilderElement[];\n readonly posterBytes?: Uint8Array;\n readonly posterType?: string;\n readonly posterFileName?: string;\n },\n ) {\n super(\"p:pic\");\n\n this.shapeId = id;\n this.animationOptions = options.animation;\n\n const name = options.name ?? `Media ${id}`;\n const w = options.width ?? 0;\n const h = options.height ?? 0;\n\n this.mediaData = buildMediaData(options.type, mediaFileName, w, h, options.data);\n\n // Poster data (video only)\n if (params.posterBytes) {\n const pt = params.posterType ?? \"png\";\n const pfn = params.posterFileName ?? `${name.replace(/\\s+/g, \"_\")}_poster.${pt}`;\n this.posterData = buildMediaData(\n pt === \"jpg\" ? \"jpg\" : \"png\",\n pfn,\n w,\n h,\n params.posterBytes,\n );\n }\n\n // p:nvPicPr\n const nvPrChildren: BuilderElement[] = [...(params.nvPrExtraChildren ?? [])];\n nvPrChildren.push(\n new BuilderElement({\n name: \"p:extLst\",\n children: [\n new BuilderElement({\n name: \"p:ext\",\n attributes: { uri: { key: \"uri\", value: params.extUri } },\n children: [\n new BuilderElement({\n name: \"p14:media\",\n attributes: {\n \"r:embed\": {\n key: \"r:embed\",\n value: `{media:${mediaFileName}}`,\n },\n \"xmlns:p14\": {\n key: \"xmlns:p14\",\n value: \"http://schemas.microsoft.com/office/powerpoint/2010/main\",\n },\n },\n }),\n ],\n }),\n ],\n }),\n );\n\n this.root.push(\n new BuilderElement({\n name: \"p:nvPicPr\",\n children: [\n new BuilderElement({\n name: `${params.cNvPrPrefix}:cNvPr`,\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n descr: { key: \"descr\", value: \"\" },\n },\n }),\n new BuilderElement({\n name: `${params.cNvPrPrefix}:cNvPicPr`,\n children: [\n new BuilderElement({\n name: \"a:picLocks\",\n attributes: {\n noChangeAspect: { key: \"noChangeAspect\", value: \"1\" },\n },\n }),\n ],\n }),\n new BuilderElement({\n name: \"p:nvPr\",\n children: nvPrChildren,\n }),\n ],\n }),\n );\n\n // p:blipFill\n const blipFillChildren: BuilderElement[] = [];\n if (this.posterData) {\n blipFillChildren.push(\n new BuilderElement({\n name: \"a:blip\",\n attributes: {\n \"r:embed\": { key: \"r:embed\", value: `{${this.posterData.fileName}}` },\n },\n }),\n );\n }\n blipFillChildren.push(\n new BuilderElement({\n name: \"a:stretch\",\n children: [new BuilderElement({ name: \"a:fillRect\" })],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:blipFill\", children: blipFillChildren }));\n\n // p:spPr\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new Transform2D({\n ...emuPosition(options),\n }),\n new PresetGeometry({ preset: \"rect\" }),\n ],\n }),\n );\n }\n\n public get ShapeId(): number {\n return this.shapeId;\n }\n\n public get Animation(): IAnimationOptions | undefined {\n return this.animationOptions;\n }\n\n public override prepForXml(context: IContext) {\n const file = context.fileData as File;\n if (this.posterData) {\n file?.Media.addImage(this.posterData.fileName, this.posterData);\n }\n file?.Media.addMedia(this.mediaData.fileName, this.mediaData);\n return super.prepForXml(context);\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\n\nimport { MediaFrameBase, type IMediaFrameBaseOptions } from \"./media-frame-base\";\n\nconst MEDIA_EXT_URI = \"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}\";\n\n/** Minimal 1x1 transparent PNG (67 bytes). */\nconst MINIMAL_PNG = new Uint8Array([\n 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0,\n 0, 0, 31, 21, 196, 137, 0, 0, 0, 13, 73, 68, 65, 84, 8, 215, 99, 24, 5, 163, 0, 0, 0, 2, 0, 1,\n 226, 33, 188, 51, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130,\n]);\n\nexport type VideoType = \"mp4\" | \"mov\" | \"wmv\" | \"avi\";\nexport type PosterType = \"png\" | \"jpg\";\n\nexport interface IVideoFrameOptions extends IMediaFrameBaseOptions {\n readonly type: VideoType;\n readonly poster?: Uint8Array;\n readonly posterType?: PosterType;\n}\n\n/**\n * p:pic — A video frame on a slide.\n *\n * Uses three relationships:\n * - Image relationship for poster frame (via {posterFileName} placeholder)\n * - Video relationship for video file (via {video:fileName} placeholder in a:videoFile r:link)\n * - Media relationship for video file (via {media:fileName} placeholder in p14:media r:embed)\n */\nexport class VideoFrame extends MediaFrameBase {\n private static nextId = 100;\n\n public constructor(options: IVideoFrameOptions) {\n const id = VideoFrame.nextId++;\n const name = options.name ?? `Video ${id}`;\n const mediaFileName = `${name.replace(/\\s+/g, \"_\")}.${options.type}`;\n const posterBytes = options.poster ?? MINIMAL_PNG;\n const posterType = options.posterType ?? \"png\";\n const posterFileName = `${name.replace(/\\s+/g, \"_\")}_poster.${posterType}`;\n\n super(options, id, mediaFileName, {\n extUri: MEDIA_EXT_URI,\n cNvPrPrefix: \"p\",\n nvPrExtraChildren: [\n new BuilderElement({\n name: \"a:videoFile\",\n attributes: {\n \"r:link\": { key: \"r:link\", value: `{video:${mediaFileName}}` },\n },\n }),\n ],\n posterBytes,\n posterType,\n posterFileName,\n });\n }\n}\n","import { MediaFrameBase, type IMediaFrameBaseOptions } from \"./media-frame-base\";\n\nconst MEDIA_EXT_URI = \"{CF1602FD-DB20-4165-A070-5F299619DA56}\";\n\nexport type AudioType = \"mp3\" | \"wav\" | \"wma\" | \"aac\";\n\nexport interface IAudioFrameOptions extends IMediaFrameBaseOptions {\n readonly type: AudioType;\n}\n\n/**\n * p:pic — An audio frame on a slide.\n *\n * Uses a media relationship for the audio file (via {media:fileName} placeholder).\n */\nexport class AudioFrame extends MediaFrameBase {\n private static nextId = 200;\n\n public constructor(options: IAudioFrameOptions) {\n const id = AudioFrame.nextId++;\n const name = options.name ?? `Audio ${id}`;\n const mediaFileName = `${name.replace(/\\s+/g, \"_\")}.${options.type}`;\n\n super(options, id, mediaFileName, {\n extUri: MEDIA_EXT_URI,\n cNvPrPrefix: \"a\",\n });\n }\n}\n","import { GroupShapeProperties } from \"@file/drawingml/group-shape-properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { GroupShapeNonVisualProperties } from \"./group-shape-non-visual\";\n\n/**\n * p:spTree — Shape tree containing all shapes on a slide.\n */\nexport class ShapeTree extends XmlComponent {\n public constructor(children: readonly XmlComponent[]) {\n super(\"p:spTree\");\n this.root.push(new GroupShapeNonVisualProperties());\n this.root.push(new GroupShapeProperties());\n this.root.push(...children);\n }\n}\n","import { ImportedXmlComponent } from \"@file/xml-components\";\n\nconst NOTES_MASTER_XML = `<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\n <p:cSld>\n <p:bg>\n <p:bgRef idx=\"1001\">\n <a:schemeClr val=\"bg1\"/>\n </p:bgRef>\n </p:bg>\n <p:spTree>\n <p:nvGrpSpPr>\n <p:cNvPr id=\"1\" name=\"\"/>\n <p:cNvGrpSpPr/>\n <p:nvPr/>\n </p:nvGrpSpPr>\n <p:grpSpPr>\n <a:xfrm>\n <a:off x=\"0\" y=\"0\"/>\n <a:ext cx=\"0\" cy=\"0\"/>\n <a:chOff x=\"0\" y=\"0\"/>\n <a:chExt cx=\"0\" cy=\"0\"/>\n </a:xfrm>\n </p:grpSpPr>\n </p:spTree>\n </p:cSld>\n <p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>\n</p:notesMaster>`;\n\nexport class DefaultNotesMaster extends ImportedXmlComponent {\n private static instance = ImportedXmlComponent.fromXmlString(NOTES_MASTER_XML);\n\n public constructor() {\n super(\"p:notesMaster\");\n }\n\n public prepForXml() {\n return DefaultNotesMaster.instance.prepForXml({ stack: [] });\n }\n}\n","import {\n BuilderElement,\n NextAttributeComponent,\n StringContainer,\n XmlComponent,\n} from \"@file/xml-components\";\n\nexport interface IHeaderFooterOptions {\n readonly slideNumber?: boolean;\n readonly dateTime?: boolean;\n readonly footer?: string | boolean;\n readonly header?: boolean;\n}\n\n/**\n * p:hf — Slide header/footer settings.\n *\n * CT_HeaderFooter has boolean attributes (sldNum, hdr, ftr, dt) for visibility.\n * Footer text content is passed as p:ftr child element (legacy support).\n */\nexport class HeaderFooter extends XmlComponent {\n public constructor(options: IHeaderFooterOptions = {}) {\n super(\"p:hf\");\n\n // Boolean visibility attributes\n const attrs: Record<string, { readonly key: string; readonly value: number }> = {};\n if (options.slideNumber !== false) attrs.sldNum = { key: \"sldNum\", value: 1 };\n if (options.dateTime !== false) attrs.dt = { key: \"dt\", value: 1 };\n // Only set hdr when explicitly true (no header placeholder in default slide master)\n if (options.header === true) attrs.hdr = { key: \"hdr\", value: 1 };\n // Only set ftr when explicitly true or footer has string content\n if (options.footer !== false && options.footer !== undefined)\n attrs.ftr = { key: \"ftr\", value: 1 };\n\n if (Object.keys(attrs).length > 0) {\n this.root.push(new NextAttributeComponent(attrs));\n }\n\n // Footer text content as child element\n if (typeof options.footer === \"string\") {\n this.root.push(\n new BuilderElement({\n name: \"p:ftr\",\n children: [\n new BuilderElement({\n name: \"p:txBody\",\n children: [\n new BuilderElement({ name: \"a:bodyPr\" }),\n new BuilderElement({ name: \"a:lstStyle\" }),\n new BuilderElement({\n name: \"a:p\",\n children: [\n new BuilderElement({\n name: \"a:r\",\n children: [new StringContainer(\"a:t\", options.footer)],\n }),\n new BuilderElement({\n name: \"a:endParaRPr\",\n attributes: { lang: { key: \"lang\", value: \"en-US\" } },\n }),\n ],\n }),\n ],\n }),\n ],\n }),\n );\n }\n }\n}\n","import { NonVisualPictureProperties } from \"@file/drawingml/non-visual-picture-props\";\nimport { BuilderElement, XmlComponent } from \"@file/xml-components\";\n\n/**\n * p:nvPicPr — Non-visual picture properties for p:pic.\n */\nexport class PictureNonVisual extends XmlComponent {\n public constructor(id: number, name: string) {\n super(\"p:nvPicPr\");\n this.root.push(\n new BuilderElement({\n name: \"a:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n descr: { key: \"descr\", value: \"\" },\n },\n }),\n );\n this.root.push(new NonVisualPictureProperties());\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n","import { BlipFill } from \"@file/drawingml/blip-fill\";\nimport { PresetGeometry } from \"@file/drawingml/preset-geometry\";\nimport { Transform2D } from \"@file/drawingml/transform-2d\";\nimport type { File } from \"@file/file\";\nimport type { IMediaData } from \"@file/media/data\";\nimport { BuilderElement, type IContext, XmlComponent } from \"@file/xml-components\";\nimport { convertPixelsToEmu } from \"@office-open/core\";\nimport { emuPosition } from \"@util/position\";\n\nimport { PictureNonVisual } from \"./picture-non-visual\";\n\nexport interface IPictureOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly data: Uint8Array;\n readonly type: \"png\" | \"jpg\" | \"gif\" | \"bmp\" | \"emf\" | \"wmf\";\n readonly name?: string;\n}\n\n/**\n * p:pic — A picture on a slide.\n *\n * Registers image with Media collection via prepForXml.\n * The ImageReplacer replaces `{fileName}` placeholder with actual rId.\n */\nexport class Picture extends XmlComponent {\n private static nextId = 100;\n private readonly imageData: IMediaData;\n\n public constructor(options: IPictureOptions) {\n super(\"p:pic\");\n\n const id = Picture.nextId++;\n const name = options.name ?? `Picture ${id}`;\n const fileName = `${name.replace(/\\s+/g, \"_\")}.${options.type}`;\n\n this.imageData = {\n type: options.type,\n fileName,\n transformation: {\n pixels: {\n x: options.width ?? 0,\n y: options.height ?? 0,\n },\n emus: {\n x: convertPixelsToEmu(options.width ?? 0),\n y: convertPixelsToEmu(options.height ?? 0),\n },\n },\n data: options.data,\n };\n\n this.root.push(new PictureNonVisual(id, name));\n\n this.root.push(new BlipFill(fileName));\n\n this.root.push(\n new BuilderElement({\n name: \"p:spPr\",\n children: [\n new Transform2D({\n ...emuPosition(options),\n }),\n new PresetGeometry({ preset: \"rect\" }),\n ],\n }),\n );\n }\n\n public override prepForXml(context: IContext) {\n (context.fileData as File)?.Media.addImage(this.imageData.fileName, this.imageData);\n return super.prepForXml(context);\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\n/**\n * a:graphic > a:graphicData — DrawingML graphic wrapper for table.\n * Lazy: stores table reference, builds IXmlableObject in prepForXml.\n */\nexport class Graphic extends BaseXmlComponent {\n private readonly table: BaseXmlComponent;\n\n public constructor(table: BaseXmlComponent) {\n super(\"a:graphic\");\n this.table = table;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const tableObj = this.table.prepForXml(context);\n const graphicDataChildren: IXmlableObject[] = [\n { _attr: { uri: \"http://schemas.openxmlformats.org/drawingml/2006/table\" } },\n ];\n if (tableObj) graphicDataChildren.push(tableObj);\n return {\n \"a:graphic\": [{ \"a:graphicData\": graphicDataChildren }],\n };\n }\n}\n","import { BuilderElement, XmlComponent } from \"@file/xml-components\";\n\n/**\n * p:nvGraphicFramePr — Non-visual properties for graphic frame.\n */\nexport class GraphicFrameNonVisual extends XmlComponent {\n private static nextId = 1024;\n\n public constructor() {\n super(\"p:nvGraphicFramePr\");\n const id = GraphicFrameNonVisual.nextId++;\n this.root.push(\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: `Table ${id}` },\n },\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:cNvGraphicFramePr\",\n children: [\n new BuilderElement({\n name: \"a:graphicFrameLocks\",\n attributes: { noGrp: { key: \"noGrp\", value: 1 } },\n }),\n ],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\n/**\n * a:tblGrid — Table grid with column width definitions.\n * Lazy: stores widths, builds IXmlableObject in prepForXml.\n */\nexport class TableGrid extends BaseXmlComponent {\n private readonly columnWidths: readonly number[];\n\n public constructor(columnWidths: readonly number[]) {\n super(\"a:tblGrid\");\n this.columnWidths = columnWidths;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n const children = this.columnWidths.map((w) => ({\n \"a:gridCol\": { _attr: { w } },\n }));\n return { \"a:tblGrid\": children };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\n/**\n * a:tblPr — Table properties (firstRow, bandRow, etc.).\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableProperties extends BaseXmlComponent {\n private readonly options?: {\n readonly firstRow?: boolean;\n readonly lastRow?: boolean;\n readonly bandRow?: boolean;\n readonly firstCol?: boolean;\n readonly lastCol?: boolean;\n readonly bandCol?: boolean;\n };\n\n public constructor(options?: {\n readonly firstRow?: boolean;\n readonly lastRow?: boolean;\n readonly bandRow?: boolean;\n readonly firstCol?: boolean;\n readonly lastCol?: boolean;\n readonly bandCol?: boolean;\n }) {\n super(\"a:tblPr\");\n this.options = options;\n }\n\n public override prepForXml(_context: IContext): IXmlableObject {\n if (!this.options) return { \"a:tblPr\": {} };\n\n const attrs: Record<string, string | number> = {};\n const opts = this.options;\n if (opts.firstRow !== undefined) attrs.firstRow = opts.firstRow ? 1 : 0;\n if (opts.lastRow !== undefined) attrs.lastRow = opts.lastRow ? 1 : 0;\n if (opts.bandRow !== undefined) attrs.bandRow = opts.bandRow ? 1 : 0;\n if (opts.firstCol !== undefined) attrs.firstCol = opts.firstCol ? 1 : 0;\n if (opts.lastCol !== undefined) attrs.lastCol = opts.lastCol ? 1 : 0;\n if (opts.bandCol !== undefined) attrs.bandCol = opts.bandCol ? 1 : 0;\n\n return { \"a:tblPr\": Object.keys(attrs).length > 0 ? { _attr: attrs } : {} };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport { TableCell, type ITableCellOptions } from \"./table-cell\";\n\nexport interface ITableRowOptions {\n readonly height?: number;\n readonly cells: readonly ITableCellOptions[];\n}\n\n/**\n * a:tr — Table row containing cells.\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class TableRow extends BaseXmlComponent {\n private readonly options: ITableRowOptions;\n\n public constructor(options: ITableRowOptions) {\n super(\"a:tr\");\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const children: IXmlableObject[] = [];\n children.push({ _attr: { h: this.options.height ?? 0 } });\n\n for (const cell of this.options.cells) {\n const tc = new TableCell(cell);\n const obj = tc.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"a:tr\": children };\n }\n}\n","import { BaseXmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\n\nimport type { ICellBorderOptions } from \"./table-cell-properties\";\nimport { TableGrid } from \"./table-grid\";\nimport { TableProperties } from \"./table-properties\";\nimport { TableRow, type ITableRowOptions } from \"./table-row\";\n\nexport interface ITableOptions {\n readonly rows: readonly ITableRowOptions[];\n readonly columnWidths?: readonly number[];\n readonly firstRow?: boolean;\n readonly lastRow?: boolean;\n readonly bandRow?: boolean;\n readonly firstCol?: boolean;\n readonly lastCol?: boolean;\n readonly bandCol?: boolean;\n readonly borders?: {\n readonly top?: ICellBorderOptions;\n readonly bottom?: ICellBorderOptions;\n readonly left?: ICellBorderOptions;\n readonly right?: ICellBorderOptions;\n };\n}\n\n/**\n * a:tbl — DrawingML table element.\n * Lazy: stores options, builds IXmlableObject in prepForXml.\n */\nexport class Table extends BaseXmlComponent {\n private readonly options: ITableOptions;\n\n public constructor(options: ITableOptions) {\n super(\"a:tbl\");\n this.options = options;\n }\n\n public override prepForXml(context: IContext): IXmlableObject {\n const opts = this.options;\n const children: IXmlableObject[] = [];\n\n // a:tblPr\n const tblPr = new TableProperties({\n firstRow: opts.firstRow,\n lastRow: opts.lastRow,\n bandRow: opts.bandRow,\n firstCol: opts.firstCol,\n lastCol: opts.lastCol,\n bandCol: opts.bandCol,\n });\n const tblPrObj = tblPr.prepForXml(context);\n if (tblPrObj) children.push(tblPrObj);\n\n // a:tblGrid\n const colWidths =\n opts.columnWidths && opts.columnWidths.length > 0\n ? [...opts.columnWidths]\n : Array.from({ length: opts.rows[0]?.cells.length ?? 1 }, () => 0);\n const grid = new TableGrid(colWidths);\n const gridObj = grid.prepForXml(context);\n if (gridObj) children.push(gridObj);\n\n // a:tr rows — distribute table-level borders to edge cells\n const tb = opts.borders;\n const rowCount = opts.rows.length;\n for (let ri = 0; ri < rowCount; ri++) {\n const row = opts.rows[ri];\n const colCount = row.cells.length;\n const cells = tb\n ? row.cells.map((cell, ci) => {\n const b = { ...cell.borders };\n if (ri === 0 && tb.top && !b.top) b.top = tb.top;\n if (ri === rowCount - 1 && tb.bottom && !b.bottom) b.bottom = tb.bottom;\n if (ci === 0 && tb.left && !b.left) b.left = tb.left;\n if (ci === colCount - 1 && tb.right && !b.right) b.right = tb.right;\n return Object.keys(b).length === 0 ? cell : { ...cell, borders: b };\n })\n : row.cells;\n const tr = new TableRow({ ...row, cells });\n const trObj = tr.prepForXml(context);\n if (trObj) children.push(trObj);\n }\n\n return { \"a:tbl\": children };\n }\n}\n","import { Transform2D } from \"@file/drawingml/transform-2d\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport { emuPosition } from \"@util/position\";\n\nimport { Graphic } from \"./graphic\";\nimport { GraphicFrameNonVisual } from \"./graphic-frame-non-visual\";\nimport type { ITableOptions } from \"./table\";\nimport { Table } from \"./table\";\n\nexport interface ITableFrameOptions extends ITableOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n}\n\n/**\n * p:graphicFrame — Slide-level graphic frame wrapping a table.\n *\n * x/y/width/height accept pixel values, converted to EMUs internally.\n */\nexport class TableFrame extends XmlComponent {\n public constructor(options: ITableFrameOptions) {\n super(\"p:graphicFrame\");\n\n this.root.push(new GraphicFrameNonVisual());\n\n this.root.push(\n new Transform2D(\n {\n ...emuPosition(options),\n },\n \"p\",\n ),\n );\n\n const table = new Table(options);\n this.root.push(new Graphic(table));\n }\n}\n","import { Transform2D } from \"@file/drawingml/transform-2d\";\nimport { BuilderElement, NextAttributeComponent, XmlComponent } from \"@file/xml-components\";\nimport type { IContext, IXmlableObject } from \"@file/xml-components\";\nimport { emuPosition } from \"@util/position\";\n\nimport { ChartCollection } from \"./chart-collection\";\nimport type { IChartSpaceOptions } from \"./chart-space\";\nimport { ChartSpace } from \"./chart-space\";\n\nlet nextChartFrameId = 2048;\n\nexport interface IChartFrameOptions extends IChartSpaceOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n}\n\n/**\n * p:graphicFrame — Slide-level graphic frame wrapping a chart.\n *\n * The chart is stored as a separate part (ppt/charts/chart{n}.xml)\n * and referenced via a relationship ID placeholder {chart:key}.\n */\nexport class ChartFrame extends XmlComponent {\n private readonly chartOptions: IChartSpaceOptions;\n private readonly chartKey: string;\n\n public constructor(options: IChartFrameOptions) {\n super(\"p:graphicFrame\");\n\n this.chartOptions = options;\n this.chartKey = `chart_${nextChartFrameId++}`;\n\n const id = nextChartFrameId++;\n this.root.push(new GraphicFrameNonVisual(id));\n this.root.push(\n new Transform2D(\n {\n ...emuPosition(options),\n },\n \"p\",\n ),\n );\n\n this.root.push(new ChartGraphic(this.chartKey));\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const file = context.fileData as { Charts: ChartCollection };\n if (file?.Charts) {\n file.Charts.addChart(this.chartKey, {\n chartSpace: new ChartSpace(this.chartOptions),\n key: this.chartKey,\n });\n }\n\n return super.prepForXml(context);\n }\n\n public get ChartKey(): string {\n return this.chartKey;\n }\n}\n\nclass GraphicFrameNonVisual extends XmlComponent {\n public constructor(id: number) {\n super(\"p:nvGraphicFramePr\");\n this.root.push(\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: `Chart ${id}` },\n },\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:cNvGraphicFramePr\",\n children: [\n new BuilderElement({\n name: \"a:graphicFrameLocks\",\n attributes: { noGrp: { key: \"noGrp\", value: 1 } },\n }),\n ],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n\nclass ChartGraphic extends XmlComponent {\n public constructor(chartKey: string) {\n super(\"a:graphic\");\n this.root.push(new ChartGraphicData(chartKey));\n }\n}\n\nclass ChartGraphicData extends XmlComponent {\n public constructor(chartKey: string) {\n super(\"a:graphicData\");\n this.root.push(\n new NextAttributeComponent({\n uri: {\n key: \"uri\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/chart\",\n },\n }),\n );\n this.root.push(new ChartRef(chartKey));\n }\n}\n\nclass ChartRef extends XmlComponent {\n public constructor(chartKey: string) {\n super(\"c:chart\");\n this.root.push(\n new NextAttributeComponent({\n xmlnsC: {\n key: \"xmlns:c\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/chart\",\n },\n xmlnsR: {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n rId: { key: \"r:id\", value: `{chart:${chartKey}}` },\n }),\n );\n }\n}\n","import { Transform2D } from \"@file/drawingml/transform-2d\";\nimport {\n BuilderElement,\n NextAttributeComponent,\n type IContext,\n type IXmlableObject,\n XmlComponent,\n} from \"@file/xml-components\";\nimport { emuPosition } from \"@util/position\";\n\nimport type { SmartArtCollection } from \"./smartart-collection\";\nimport { createDataModel, type ITreeNode } from \"./tree-to-model\";\n\nlet nextSmartArtFrameId = 1024;\n\nexport interface ISmartArtFrameOptions {\n readonly x?: number;\n readonly y?: number;\n readonly width?: number;\n readonly height?: number;\n readonly nodes: readonly ITreeNode[];\n readonly name?: string;\n /** Layout ID (e.g. \"default\", \"process1\", \"hierarchy1\") */\n readonly layout?: string;\n /** Quick style ID (e.g. \"simple1\", \"moderate1\") */\n readonly style?: string;\n /** Color transform ID (e.g. \"accent1_2\", \"colorful1\") */\n readonly color?: string;\n}\n\n/**\n * p:graphicFrame — Slide-level graphic frame wrapping a SmartArt diagram.\n */\nexport class SmartArtFrame extends XmlComponent {\n private readonly smartArtKey: string;\n private readonly dataModel: ReturnType<typeof createDataModel>;\n private readonly layoutId: string;\n private readonly styleId: string;\n private readonly colorId: string;\n\n public constructor(options: ISmartArtFrameOptions) {\n super(\"p:graphicFrame\");\n\n this.smartArtKey = `smartart_${nextSmartArtFrameId++}`;\n this.layoutId = options.layout ?? \"default\";\n this.styleId = options.style ?? \"simple1\";\n this.colorId = options.color ?? \"accent1_2\";\n this.dataModel = createDataModel(options.nodes, this.layoutId, this.styleId, this.colorId);\n\n const id = nextSmartArtFrameId++;\n const name = options.name ?? `Diagram ${id}`;\n\n this.root.push(new GraphicFrameNonVisual(id, name));\n this.root.push(\n new Transform2D(\n {\n ...emuPosition(options),\n },\n \"p\",\n ),\n );\n this.root.push(new SmartArtGraphic(this.smartArtKey));\n }\n\n public prepForXml(context: IContext): IXmlableObject | undefined {\n const file = context.fileData as { SmartArts: SmartArtCollection };\n if (file?.SmartArts) {\n file.SmartArts.addSmartArt(this.smartArtKey, {\n key: this.smartArtKey,\n dataModel: this.dataModel,\n layout: this.layoutId,\n style: this.styleId,\n color: this.colorId,\n });\n }\n return super.prepForXml(context);\n }\n}\n\nclass GraphicFrameNonVisual extends XmlComponent {\n public constructor(id: number, name: string) {\n super(\"p:nvGraphicFramePr\");\n this.root.push(\n new BuilderElement({\n name: \"p:cNvPr\",\n attributes: {\n id: { key: \"id\", value: id },\n name: { key: \"name\", value: name },\n },\n }),\n );\n this.root.push(\n new BuilderElement({\n name: \"p:cNvGraphicFramePr\",\n children: [\n new BuilderElement({\n name: \"a:graphicFrameLocks\",\n attributes: { noGrp: { key: \"noGrp\", value: 1 } },\n }),\n ],\n }),\n );\n this.root.push(new BuilderElement({ name: \"p:nvPr\" }));\n }\n}\n\nclass SmartArtGraphic extends XmlComponent {\n public constructor(smartArtKey: string) {\n super(\"a:graphic\");\n this.root.push(new SmartArtGraphicData(smartArtKey));\n }\n}\n\nclass SmartArtGraphicData extends XmlComponent {\n public constructor(smartArtKey: string) {\n super(\"a:graphicData\");\n this.root.push(\n new NextAttributeComponent({\n uri: {\n key: \"uri\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/diagram\",\n },\n }),\n );\n this.root.push(new DiagramRelIds(smartArtKey));\n }\n}\n\nclass DiagramRelIds extends XmlComponent {\n public constructor(smartArtKey: string) {\n super(\"dgm:relIds\");\n this.root.push(\n new NextAttributeComponent({\n xmlnsDgm: {\n key: \"xmlns:dgm\",\n value: \"http://schemas.openxmlformats.org/drawingml/2006/diagram\",\n },\n xmlnsR: {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n rDm: { key: \"r:dm\", value: `{smartart:${smartArtKey}}` },\n rLo: { key: \"r:lo\", value: `{smartart-lo:${smartArtKey}}` },\n rQs: { key: \"r:qs\", value: `{smartart-qs:${smartArtKey}}` },\n rCs: { key: \"r:cs\", value: `{smartart-cs:${smartArtKey}}` },\n }),\n );\n }\n}\n","export {\n File,\n type IPresentationOptions,\n type ISlideOptions,\n type ICommentOptions,\n type IMasterDefinition,\n type ILayoutDefinition,\n type ILayoutPlaceholderOptions,\n type SlideSize,\n} from \"./file\";\nexport { Presentation } from \"./presentation/presentation\";\nexport type { IPresentationOptions as IPresentationXmlOptions } from \"./presentation/presentation\";\nexport { Shape, type IShapeOptions } from \"./shape/shape\";\nexport { TextBody, type ITextBodyOptions } from \"./shape/text-body\";\nexport { Paragraph, type IParagraphOptions } from \"./shape/paragraph/paragraph\";\nexport { TextRun, type IRunOptions } from \"./shape/paragraph/run\";\nexport { Text } from \"./shape/paragraph/text\";\nexport {\n RunProperties,\n UnderlineStyle,\n StrikeStyle,\n TextCapitalization,\n type IRunPropertiesOptions,\n type IHyperlinkOptions,\n} from \"./shape/paragraph/run-properties\";\nexport {\n ParagraphProperties,\n TextAlignment,\n type IParagraphPropertiesOptions,\n} from \"./shape/paragraph/paragraph-properties\";\nexport { EndParagraphRunProperties } from \"./shape/paragraph/end-paragraph-run\";\nexport { Field, SlideNumberField, DateTimeField } from \"./shape/paragraph/field\";\n\n// DrawingML — re-exports from core\nexport {\n createOutline,\n type OutlineOptions as CoreOutlineOptions,\n} from \"@office-open/core/drawingml\";\nexport {\n createGradientFill,\n createGradientStop,\n type GradientFillOptions as CoreGradientFillOptions,\n type IGradientStop,\n PathShadeType,\n TileFlipMode,\n} from \"@office-open/core/drawingml\";\nexport {\n LineCap,\n CompoundLine,\n PenAlignment,\n PresetDash,\n LineJoin,\n} from \"@office-open/core/drawingml\";\nexport { createScene3D, type Scene3DOptions } from \"@office-open/core/drawingml\";\nexport {\n createShape3D,\n type Shape3DOptions,\n PresetMaterialType,\n} from \"@office-open/core/drawingml\";\nexport {\n createBevel,\n createBottomBevel,\n type BevelOptions,\n BevelPresetType,\n} from \"@office-open/core/drawingml\";\nexport { createEffectList, type EffectListOptions } from \"@office-open/core/drawingml\";\nexport { createColorElement } from \"@office-open/core/drawingml\";\nexport { createColorTransforms, type ColorTransformOptions } from \"@office-open/core/drawingml\";\n\n// DrawingML — fill API\nexport {\n buildFill,\n extractBlipFillMedia,\n type BlipFillConfigOptions,\n type BlipFillMediaData,\n type FillOptions,\n type GradientStopOptions,\n} from \"./drawingml/fill\";\nexport { createOutlineCompat, type OutlineOptions } from \"./drawingml/outline\";\n\n// DrawingML — local implementations (pptx-specific)\nexport { BlipFill } from \"./drawingml/blip-fill\";\nexport { Transform2D, type ITransform2DOptions } from \"./drawingml/transform-2d\";\nexport { PresetGeometry } from \"./drawingml/preset-geometry\";\nexport { ShapeProperties, type IShapePropertiesOptions } from \"./drawingml/shape-properties\";\nexport {\n createPptxEffectList,\n ReflectionAlignment,\n type IEffectsOptions,\n type IShadowOptions,\n type IGlowOptions,\n type IReflectionOptions,\n type ISoftEdgeOptions,\n} from \"./drawingml/effects\";\nexport { NonVisualDrawingProperties } from \"./drawingml/non-visual-drawing-props\";\nexport { NonVisualShapeProperties } from \"./drawingml/non-visual-shape-props\";\nexport { NonVisualPictureProperties } from \"./drawingml/non-visual-picture-props\";\nexport { GroupShapeProperties } from \"./drawingml/group-shape-properties\";\nexport { GroupTransform2D, type IGroupTransform2DOptions } from \"./drawingml/group-transform-2d\";\n\nexport { GroupShape, type IGroupShapeOptions } from \"./shape/group-shape\";\nexport { LineShape, type ILineShapeOptions } from \"./shape/line-shape\";\nexport { ConnectorShape, type IConnectorShapeOptions } from \"./shape/line-shape\";\nexport { Media } from \"./media/media\";\nexport { createTransformation, type IMediaTransformation } from \"./media/media\";\nexport type { IMediaData, IMediaDataTransformation } from \"./media/data\";\nexport {\n VideoFrame,\n type IVideoFrameOptions,\n type VideoType,\n type PosterType,\n} from \"./media/video-frame\";\nexport { AudioFrame, type IAudioFrameOptions, type AudioType } from \"./media/audio-frame\";\nexport { CoreProperties, type ICorePropertiesOptions } from \"./core-properties/properties\";\nexport { AppProperties } from \"./app-properties/app-properties\";\nexport { ContentTypes } from \"./content-types/content-types\";\nexport { Relationships } from \"./relationships/relationships\";\nexport { type RelationshipType } from \"./relationships/relationship/relationship\";\nexport { Slide } from \"./slide/slide\";\nexport { ShapeTree } from \"./shape-tree/shape-tree\";\nexport { DefaultTheme, type IThemeOptions } from \"./theme/theme\";\nexport {\n DefaultSlideMaster,\n type ISlideMasterOptions,\n type IMasterPlaceholderOptions,\n type IMasterPlaceholderPosition,\n} from \"./slide-master/slide-master\";\nexport { DefaultSlideLayout, SlideLayout, type SlideLayoutType } from \"./slide-layout/slide-layout\";\nexport { DefaultNotesMaster } from \"./notes-master/notes-master\";\nexport { NotesSlide, type INotesSlideOptions } from \"./notes/notes-slide\";\nexport { HeaderFooter, type IHeaderFooterOptions } from \"./header-footer/header-footer\";\nexport { PresentationWrapper, type IViewWrapper } from \"./presentation/presentation-wrapper\";\nexport { Picture, type IPictureOptions } from \"./picture/picture\";\nexport { Background, type IBackgroundOptions } from \"./background/background\";\nexport { TableFrame, type ITableFrameOptions } from \"./table/table-frame\";\nexport { Table, type ITableOptions } from \"./table/table\";\nexport { TableRow, type ITableRowOptions } from \"./table/table-row\";\nexport { TableCell, VerticalAlignment, type ITableCellOptions } from \"./table/table-cell\";\nexport { TableProperties } from \"./table/table-properties\";\nexport { TableCellProperties, type ICellBorderOptions } from \"./table/table-cell-properties\";\nexport { ChartFrame, type IChartFrameOptions } from \"./chart/chart-frame\";\nexport { ChartCollection, type IChartData } from \"./chart/chart-collection\";\nexport { ChartSpace, type IChartSpaceOptions, type IChartSeriesData } from \"./chart/chart-space\";\nexport type { ChartType } from \"./chart/chart-types/create-chart-type\";\nexport { SmartArtFrame, type ISmartArtFrameOptions, type ITreeNode } from \"./smartart\";\nexport { Transition, type ITransitionOptions, type TransitionType } from \"./transition/transition\";\nexport {\n type AnimationType,\n type AnimationTrigger,\n type AnimationDirection,\n type AnimationClass,\n type EmphasisType,\n type PathAnimationType,\n type MediaAnimationType,\n type AnimationCalcMode,\n type AnimationValueType,\n type IAnimationOptions,\n} from \"./animation/types\";\n","import { escapeRegex, formatId } from \"@office-open/core\";\n\nexport function replaceHyperlinkPlaceholders(\n xml: string,\n hyperlinks: readonly { readonly key: string }[],\n offset: number,\n): string {\n let result = xml;\n hyperlinks.forEach((h, i) => {\n result = result.replace(\n new RegExp(`\\\\{hlink:${escapeRegex(h.key)}\\\\}`, \"g\"),\n formatId(offset, i, \"rId\"),\n );\n });\n return result;\n}\n","import { escapeRegex, formatId } from \"@office-open/core\";\n\nexport function replaceMediaPlaceholders(\n xml: string,\n mediaData: readonly { readonly fileName: string }[],\n offset: number,\n): string {\n let result = xml;\n mediaData.forEach((m, i) => {\n result = result.replace(\n new RegExp(`\\\\{media:${escapeRegex(m.fileName)}\\\\}`, \"g\"),\n formatId(offset, i, \"rId\"),\n );\n });\n return result;\n}\n\nexport function replaceVideoPlaceholders(\n xml: string,\n mediaData: readonly { readonly fileName: string }[],\n offset: number,\n): string {\n let result = xml;\n mediaData.forEach((m, i) => {\n result = result.replace(\n new RegExp(`\\\\{video:${escapeRegex(m.fileName)}\\\\}`, \"g\"),\n formatId(offset, i, \"rId\"),\n );\n });\n return result;\n}\n\nexport function getMediaRefs(\n xml: string,\n mediaArray: readonly { readonly fileName: string }[],\n): readonly { readonly fileName: string }[] {\n return collectRefs(xml, \"media:\", mediaArray);\n}\n\nexport function getVideoRefs(\n xml: string,\n mediaArray: readonly { readonly fileName: string }[],\n): readonly { readonly fileName: string }[] {\n return collectRefs(xml, \"video:\", mediaArray);\n}\n\nfunction collectRefs(\n xml: string,\n prefix: string,\n mediaArray: readonly { readonly fileName: string }[],\n): readonly { readonly fileName: string }[] {\n const pattern = new RegExp(`\\\\{${escapeRegex(prefix)}([^}]+)\\\\}`, \"g\");\n const keys = new Set<string>();\n for (const match of xml.matchAll(pattern)) {\n keys.add(match[1]);\n }\n return mediaArray.filter((m) => keys.has(m.fileName));\n}\n","import { Formatter } from \"@export/formatter\";\nimport type { File } from \"@file/file\";\nimport { DefaultNotesMaster } from \"@file/notes-master/notes-master\";\nimport {\n DEFAULT_DRAWING_XML,\n getColorXml,\n getLayoutXml,\n getStyleXml,\n} from \"@file/smartart/built-in-definitions\";\nimport type { IContext } from \"@file/xml-components\";\nimport {\n addSmartArtRelationships,\n collectPlaceholderKeys,\n getReferencedMedia,\n hasPlaceholders,\n replaceChartPlaceholders,\n replaceImagePlaceholders,\n replaceSmartArtPlaceholders,\n} from \"@office-open/core\";\nimport type { IXmlifyedFile } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\nimport type { Zippable } from \"fflate\";\n\ninterface IXmlifyedFileMapping {\n [key: string]: { data: string; path: string };\n}\n\nimport { replaceHyperlinkPlaceholders } from \"./hyperlink-placeholders\";\nimport {\n getMediaRefs,\n getVideoRefs,\n replaceMediaPlaceholders,\n replaceVideoPlaceholders,\n} from \"./media-placeholders\";\n\nexport class Compiler {\n private readonly formatter = new Formatter();\n\n public compile(\n file: File,\n prettifyXml?: string,\n overrides: readonly IXmlifyedFile[] = [],\n ): Zippable {\n const declaration = true;\n const indent = prettifyXml;\n const context: IContext = { fileData: file, stack: [] };\n\n const mapping: IXmlifyedFileMapping = {\n AppProperties: {\n data: xml(this.formatter.format(file.AppProperties, context), { declaration }),\n path: \"docProps/app.xml\",\n },\n Properties: {\n data: xml(this.formatter.format(file.CoreProperties, context), {\n declaration,\n indent,\n }),\n path: \"docProps/core.xml\",\n },\n FileRelationships: {\n data: xml(this.formatter.format(file.FileRelationships, context), {\n declaration: false,\n }),\n path: \"_rels/.rels\",\n },\n };\n\n // Static singletons (ImportedXmlComponent.toXml uses sourceXml directly)\n // Themes (one per master)\n const themes = file.Themes;\n for (let ti = 0; ti < themes.length; ti++) {\n mapping[`Theme${ti}`] = {\n data: this.formatter.formatToXml(themes[ti], context, declaration),\n path: `ppt/theme/theme${ti + 1}.xml`,\n };\n }\n\n mapping[\"TableStyles\"] = {\n data: this.formatter.formatToXml(file.TableStyles, context, declaration),\n path: \"ppt/tableStyles.xml\",\n };\n\n mapping[\"PresProps\"] = {\n data: this.formatter.formatToXml(file.PresProps, context, declaration),\n path: \"ppt/presProps.xml\",\n };\n\n mapping[\"ViewProps\"] = {\n data: this.formatter.formatToXml(file.ViewProps, context, declaration),\n path: \"ppt/viewProps.xml\",\n };\n\n // Slide Masters\n const masters = file.SlideMasters;\n const masterRels = file.SlideMasterRelsArray;\n for (let mi = 0; mi < masters.length; mi++) {\n mapping[`SlideMaster${mi}`] = {\n data: this.formatter.formatToXml(masters[mi], context, declaration),\n path: `ppt/slideMasters/slideMaster${mi + 1}.xml`,\n };\n mapping[`SlideMasterRels${mi}`] = {\n data: xml(this.formatter.format(masterRels[mi], context), {\n declaration: false,\n }),\n path: `ppt/slideMasters/_rels/slideMaster${mi + 1}.xml.rels`,\n };\n }\n\n // Slide Layouts\n const layouts = file.AllLayouts;\n const layoutRels = file.AllLayoutRelsArray;\n for (let li = 0; li < layouts.length; li++) {\n mapping[`SlideLayout${li}`] = {\n data: this.formatter.formatToXml(layouts[li].layout, context, declaration),\n path: `ppt/slideLayouts/slideLayout${li + 1}.xml`,\n };\n mapping[`SlideLayoutRels${li}`] = {\n data: xml(this.formatter.format(layoutRels[li], context), {\n declaration: false,\n }),\n path: `ppt/slideLayouts/_rels/slideLayout${li + 1}.xml.rels`,\n };\n }\n\n // Register layout content types\n for (let i = 0; i < layouts.length; i++) {\n file.ContentTypes.addSlideLayout(i + 1);\n }\n // Register master + theme content types\n for (let mi = 0; mi < masters.length; mi++) {\n file.ContentTypes.addSlideMaster(mi + 1);\n file.ContentTypes.addTheme(mi + 1);\n }\n\n // Notes Master — only when notes slides exist\n if (file.NotesSlides.length > 0) {\n file.PresentationWrapper.Relationships.addRelationship(\n file.PresentationWrapper.Relationships.RelationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\",\n \"notesMasters/notesMaster1.xml\",\n );\n mapping[\"NotesMaster\"] = {\n data: xml(this.formatter.format(new DefaultNotesMaster(), context), {\n declaration,\n indent,\n }),\n path: \"ppt/notesMasters/notesMaster1.xml\",\n };\n mapping[\"NotesMasterRelationships\"] = {\n data: xml(this.formatter.format(file.NotesMasterRelationships, context), {\n declaration: false,\n }),\n path: \"ppt/notesMasters/_rels/notesMaster1.xml.rels\",\n };\n }\n\n // Comment Authors — only when comments exist\n if (file.CommentAuthorList) {\n file.PresentationWrapper.Relationships.addRelationship(\n file.PresentationWrapper.Relationships.RelationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors\",\n \"commentAuthors.xml\",\n );\n }\n\n // Presentation + its relationships\n const presentationXml = this.formatter.formatToXml(\n file.PresentationWrapper.View,\n context,\n declaration,\n );\n let currentImageCount = 0;\n\n const mediaData = getReferencedMedia(presentationXml, file.Media.Array);\n const presImageOffset = file.PresentationWrapper.Relationships.RelationshipCount + 1;\n mediaData.forEach((image, idx) => {\n file.PresentationWrapper.Relationships.addRelationship(\n presImageOffset + idx,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `../media/${image.fileName}`,\n );\n });\n\n const replacedPresentationXml = replaceImagePlaceholders(\n presentationXml,\n mediaData,\n presImageOffset,\n );\n currentImageCount += mediaData.length;\n\n mapping[\"Presentation\"] = {\n data: replacedPresentationXml,\n path: \"ppt/presentation.xml\",\n };\n\n mapping[\"PresentationRelationships\"] = {\n data: xml(this.formatter.format(file.PresentationWrapper.Relationships, context), {\n declaration: false,\n }),\n path: \"ppt/_rels/presentation.xml.rels\",\n };\n\n // Slides — format BEFORE ContentTypes so ChartFrame.prepForXml() populates Charts\n for (let i = 0; i < file.Slides.length; i++) {\n const slideWrapper = file.SlideWrappers[i];\n const slideXml = this.formatter.formatToXml(slideWrapper.View, context, declaration);\n\n const slideMediaData = getReferencedMedia(slideXml, file.Media.Array);\n const slideImageOffset = slideWrapper.Relationships.RelationshipCount + 1;\n slideMediaData.forEach((image, idx) => {\n slideWrapper.Relationships.addRelationship(\n slideImageOffset + idx,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `../media/${image.fileName}`,\n );\n });\n\n let replacedSlideXml = replaceImagePlaceholders(\n slideXml,\n slideMediaData,\n slideImageOffset,\n );\n currentImageCount += slideMediaData.length;\n\n // Placeholder replacement — single pre-check avoids 4 regex scans when none exist\n if (hasPlaceholders(replacedSlideXml)) {\n // Chart placeholder replacement\n const slideChartKeys = collectPlaceholderKeys(replacedSlideXml, \"chart:\");\n if (slideChartKeys.length > 0) {\n const slideChartOffset = slideWrapper.Relationships.RelationshipCount + 1;\n const slideCharts = file.Charts.Array.filter((c) =>\n slideChartKeys.includes(c.key),\n );\n\n replacedSlideXml = replaceChartPlaceholders(\n replacedSlideXml,\n slideCharts.map((c) => c.key),\n slideChartOffset,\n );\n\n slideCharts.forEach((chartData, ci) => {\n const globalIndex = file.Charts.Array.indexOf(chartData);\n slideWrapper.Relationships.addRelationship(\n slideChartOffset + ci,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\",\n `../charts/chart${globalIndex + 1}.xml`,\n );\n });\n }\n\n // SmartArt placeholder replacement\n const slideSmartArtKeys = collectPlaceholderKeys(replacedSlideXml, \"smartart:\");\n if (slideSmartArtKeys.length > 0) {\n const slideSmartArts = file.SmartArts.Array.filter((s) =>\n slideSmartArtKeys.includes(s.key),\n );\n const saOffset = slideWrapper.Relationships.RelationshipCount + 1;\n\n replacedSlideXml = replaceSmartArtPlaceholders(\n replacedSlideXml,\n slideSmartArts.map((s) => s.key),\n saOffset,\n );\n\n const saGlobalStart = file.SmartArts.Array.indexOf(slideSmartArts[0]);\n addSmartArtRelationships(\n slideSmartArts.map((s) => s.key),\n (id, type, target) => {\n slideWrapper.Relationships.addRelationship(id, type, target);\n },\n saOffset,\n saGlobalStart,\n {\n pathPrefix: \"../\",\n styleRelType:\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle\",\n },\n );\n }\n\n // Hyperlink placeholder replacement\n const slideHlinkKeys = collectPlaceholderKeys(replacedSlideXml, \"hlink:\");\n if (slideHlinkKeys.length > 0) {\n const slideHlinks = file.Hyperlinks.Array.filter((h) =>\n slideHlinkKeys.includes(h.key),\n );\n const hlinkOffset = slideWrapper.Relationships.RelationshipCount + 1;\n\n replacedSlideXml = replaceHyperlinkPlaceholders(\n replacedSlideXml,\n slideHlinks,\n hlinkOffset,\n );\n\n slideHlinks.forEach((hlink, hi) => {\n slideWrapper.Relationships.addRelationship(\n hlinkOffset + hi,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n hlink.url,\n \"External\",\n );\n });\n }\n\n // Media (video/audio) placeholder replacement\n const slideMediaRefs = getMediaRefs(replacedSlideXml, file.Media.Array);\n const slideVideoRefs = getVideoRefs(replacedSlideXml, file.Media.Array);\n\n if (slideMediaRefs.length > 0 || slideVideoRefs.length > 0) {\n const mediaOffset = slideWrapper.Relationships.RelationshipCount + 1;\n const videoOffset = mediaOffset + slideMediaRefs.length;\n\n replacedSlideXml = replaceMediaPlaceholders(\n replacedSlideXml,\n slideMediaRefs,\n mediaOffset,\n );\n\n replacedSlideXml = replaceVideoPlaceholders(\n replacedSlideXml,\n slideVideoRefs,\n videoOffset,\n );\n\n slideMediaRefs.forEach((media, mi) => {\n slideWrapper.Relationships.addRelationship(\n mediaOffset + mi,\n \"http://schemas.microsoft.com/office/2007/relationships/media\",\n `../media/${media.fileName}`,\n );\n });\n\n slideVideoRefs.forEach((video, vi) => {\n slideWrapper.Relationships.addRelationship(\n videoOffset + vi,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video\",\n `../media/${video.fileName}`,\n );\n });\n }\n }\n\n mapping[`Slide${i}`] = {\n data: replacedSlideXml,\n path: `ppt/slides/slide${i + 1}.xml`,\n };\n\n // Add comment relationship for this slide\n const slideComments = file.SlideCommentLists[i];\n if (slideComments) {\n slideWrapper.Relationships.addRelationship(\n slideWrapper.Relationships.RelationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\",\n `../comments/comment${i + 1}.xml`,\n );\n }\n\n mapping[`SlideRelationships${i}`] = {\n data: xml(this.formatter.format(slideWrapper.Relationships, context), {\n declaration: false,\n }),\n path: `ppt/slides/_rels/slide${i + 1}.xml.rels`,\n };\n }\n\n // ContentTypes — AFTER slides so Charts.Array is populated\n file.Charts.Array.forEach((_, i) => {\n file.ContentTypes.addChart(i + 1);\n });\n file.SmartArts.Array.forEach((_, i) => {\n file.ContentTypes.addDiagramData(i + 1);\n file.ContentTypes.addDiagramLayout(i + 1);\n file.ContentTypes.addDiagramStyle(i + 1);\n file.ContentTypes.addDiagramColors(i + 1);\n file.ContentTypes.addDiagramDrawing(i + 1);\n });\n mapping[\"ContentTypes\"] = {\n data: xml(this.formatter.format(file.ContentTypes, context), {\n declaration: false,\n }),\n path: \"[Content_Types].xml\",\n };\n\n // Convert mapping to Zippable (XML files: STORE, no compression benefit)\n const files: Zippable = {};\n for (const key of Object.keys(mapping)) {\n const entry = mapping[key];\n files[entry.path] = [textToUint8Array(entry.data), { level: 0 }];\n }\n\n // Add overrides\n for (const override of overrides) {\n files[override.path] =\n override.data instanceof Uint8Array\n ? override.data\n : textToUint8Array(override.data);\n }\n\n // Add chart parts (STORE — XML, no compression benefit)\n for (let i = 0; i < file.Charts.Array.length; i++) {\n const chartData = file.Charts.Array[i];\n files[`ppt/charts/chart${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(chartData.chartSpace, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n files[`ppt/charts/_rels/chart${i + 1}.xml.rels`] = [\n textToUint8Array(\n xml(\n {\n Relationships: {\n _attr: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n },\n },\n { declaration: { encoding: \"UTF-8\", standalone: \"yes\" } },\n ),\n ),\n { level: 0 },\n ];\n }\n\n // Add SmartArt diagram parts (STORE)\n for (let i = 0; i < file.SmartArts.Array.length; i++) {\n const smartArtData = file.SmartArts.Array[i];\n files[`ppt/diagrams/data${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(smartArtData.dataModel, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n files[`ppt/diagrams/layout${i + 1}.xml`] = [\n textToUint8Array(getLayoutXml(smartArtData.layout)),\n { level: 0 },\n ];\n files[`ppt/diagrams/quickStyle${i + 1}.xml`] = [\n textToUint8Array(getStyleXml(smartArtData.style)),\n { level: 0 },\n ];\n files[`ppt/diagrams/colors${i + 1}.xml`] = [\n textToUint8Array(getColorXml(smartArtData.color)),\n { level: 0 },\n ];\n files[`ppt/diagrams/drawing${i + 1}.xml`] = [\n textToUint8Array(DEFAULT_DRAWING_XML),\n { level: 0 },\n ];\n }\n\n // Add notes slides (STORE)\n for (let i = 0; i < file.NotesSlides.length; i++) {\n const notesSlide = file.NotesSlides[i];\n files[`ppt/notesSlides/notesSlide${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(notesSlide, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n files[`ppt/notesSlides/_rels/notesSlide${i + 1}.xml.rels`] = [\n textToUint8Array(\n xml(\n {\n Relationships: {\n _attr: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n },\n },\n { declaration: { encoding: \"UTF-8\", standalone: \"yes\" } },\n ),\n ),\n { level: 0 },\n ];\n }\n\n // Add comment authors (STORE)\n if (file.CommentAuthorList) {\n files[\"ppt/commentAuthors.xml\"] = [\n textToUint8Array(\n xml(this.formatter.format(file.CommentAuthorList, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n }\n\n // Add slide comments (STORE)\n const commentLists = file.SlideCommentLists;\n for (let i = 0; i < commentLists.length; i++) {\n if (commentLists[i]) {\n files[`ppt/comments/comment${i + 1}.xml`] = [\n textToUint8Array(\n xml(this.formatter.format(commentLists[i]!, context), {\n declaration,\n indent,\n }),\n ),\n { level: 0 },\n ];\n }\n }\n\n // Add media files (STORE compression)\n for (const image of file.Media.Array) {\n files[`ppt/media/${image.fileName}`] = [image.data, { level: 0 }];\n if (image.type === \"svg\" && \"fallback\" in image) {\n const fallback = (\n image as import(\"@file/media/data\").IMediaData & {\n readonly fallback: { readonly fileName: string; readonly data: Uint8Array };\n }\n ).fallback;\n files[`ppt/media/${fallback.fileName}`] = [fallback.data, { level: 0 }];\n }\n }\n\n return files;\n }\n}\n\nfunction textToUint8Array(data: string | Uint8Array): Uint8Array {\n if (data instanceof Uint8Array) {\n return data;\n }\n return new TextEncoder().encode(data);\n}\n","import { Readable } from \"stream\";\n\nimport type { File } from \"@file/file\";\nimport { convertOutput, convertPrettifyType, OoxmlMimeType, PrettifyType } from \"@office-open/core\";\nexport { PrettifyType } from \"@office-open/core\";\nimport type { IXmlifyedFile, OutputByType, OutputType } from \"@office-open/core\";\nimport { type ZipOptions, Zip, ZipDeflate, ZipPassThrough, zipSync } from \"fflate\";\n\nimport { Compiler } from \"./next-compiler\";\n\nexport class Packer {\n public static async pack<T extends OutputType>(\n file: File,\n type: T,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<OutputByType[T]> {\n const files = this.compiler.compile(file, convertPrettifyType(prettify), overrides);\n const zipped = zipSync(files, { level: 6 });\n return convertOutput(zipped, type, OoxmlMimeType.PPTX);\n }\n\n public static async toString(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<string> {\n return Packer.pack(file, \"string\", prettify, overrides);\n }\n\n public static toArrayBuffer(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<ArrayBuffer> {\n return Packer.pack(file, \"arraybuffer\", prettify, overrides);\n }\n\n public static toBuffer(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<Buffer> {\n return Packer.pack(file, \"nodebuffer\", prettify, overrides);\n }\n\n public static toBlob(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<Blob> {\n return Packer.pack(file, \"blob\", prettify, overrides);\n }\n\n public static toBase64String(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Promise<string> {\n return Packer.pack(file, \"base64\", prettify, overrides);\n }\n\n public static toStream(\n file: File,\n prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],\n overrides: readonly IXmlifyedFile[] = [],\n ): Readable {\n const stream = new Readable({ read() {} });\n\n try {\n const files = this.compiler.compile(file, convertPrettifyType(prettify), overrides);\n\n const zip = new Zip((err, chunk, final) => {\n if (err) {\n stream.destroy(err);\n return;\n }\n if (!stream.destroyed) {\n stream.push(Buffer.from(chunk));\n }\n if (final) {\n stream.push(null);\n }\n });\n\n for (const [name, data] of Object.entries(files)) {\n const raw = Array.isArray(data) ? (data[0] as Uint8Array) : (data as Uint8Array);\n const level = Array.isArray(data) ? ((data[1] as ZipOptions).level ?? 6) : 6;\n const entry =\n level === 0 ? new ZipPassThrough(name) : new ZipDeflate(name, { level });\n zip.add(entry);\n entry.push(raw, true);\n }\n\n zip.end();\n } catch (err) {\n stream.destroy(err instanceof Error ? err : new Error(String(err)));\n }\n\n return stream;\n }\n\n private static readonly compiler = new Compiler();\n}\n","export {\n convertPixelsToEmu,\n convertEmuToPixels,\n convertInchesToEmu,\n convertEmuToInches,\n convertPointsToEmu,\n convertEmuToPoints,\n} from \"@office-open/core\";\n\n/** Convert percentage to thousandths of a percent (used in some OOXML attributes) */\nexport const percentToTHousandths = (percent: number): number => Math.round(percent * 1000);\n\n/** Common slide size presets (in pixels at 96 DPI) */\nexport const SlideSizePreset = {\n WIDE: { width: 960, height: 540 },\n STANDARD_4X3: { width: 720, height: 540 },\n WIDESCREEN_16X10: { width: 960, height: 600 },\n WIDESCREEN_16X9: { width: 960, height: 540 },\n} as const;\n","export * from \"./convenience-functions\";\nexport * from \"./types\";\nexport * from \"./values\";\n","import type { ParsedDocument } from \"@office-open/core\";\nimport { parseDocument } from \"@office-open/core\";\nimport type { Element } from \"@office-open/xml\";\nimport { attr } from \"@office-open/xml\";\n\nexport { parseDocument };\n\n/**\n * All part paths extracted from the PPTX package.\n * Field names correspond directly to the OOXML directory structure.\n */\nexport interface PptxPartRefs {\n /** ppt/theme/themeN.xml */\n themes: string[];\n /** ppt/notesMasters/notesMasterN.xml */\n notesMasters: string[];\n /** ppt/commentAuthors.xml */\n commentAuthors?: string;\n /** ppt/comments/commentN.xml (from slide rels) */\n comments: string[];\n /** ppt/charts/chartN.xml (from slide rels) */\n charts: string[];\n /** ppt/diagrams/dataN.xml (from slide rels) */\n diagramData: string[];\n /** ppt/media/* (all media files) */\n media: string[];\n}\n\nexport interface PptxDocument {\n doc: ParsedDocument;\n /** ppt/presentation.xml root element (p:presentation) */\n presentation?: Element;\n /** ppt/slides/slideN.xml */\n slides: string[];\n /** ppt/slideMasters/slideMasterN.xml */\n slideMasters: string[];\n /** ppt/slideLayouts/slideLayoutN.xml */\n slideLayouts: string[];\n /** ppt/notesSlides/notesSlideN.xml */\n notesSlides: string[];\n partRefs: PptxPartRefs;\n /** ppt/presProps.xml */\n presProps?: string;\n /** ppt/viewProps.xml */\n viewProps?: string;\n /** ppt/tableStyles.xml */\n tableStyles?: string;\n /** docProps/core.xml */\n coreProps?: string;\n /** docProps/app.xml */\n appProps?: string;\n}\n\nfunction resolveRelsPath(target: string): string {\n if (target.startsWith(\"/\")) return target.slice(1);\n if (target.startsWith(\"../\")) return target.replace(\"../\", \"\");\n return `ppt/${target}`;\n}\n\nfunction sortByNumber(paths: string[]): string[] {\n return paths.sort((a, b) => {\n const numA = parseInt(a.match(/(\\d+)/)?.[1] ?? \"0\", 10);\n const numB = parseInt(b.match(/(\\d+)/)?.[1] ?? \"0\", 10);\n return numA - numB;\n });\n}\n\nfunction xmlKeys(keys: string[]): string[] {\n return keys.filter((k) => k.endsWith(\".xml\"));\n}\n\nfunction parseRootRels(doc: ParsedDocument): { coreProps?: string; appProps?: string } {\n const relsEl = doc.get(\"_rels/.rels\");\n if (!relsEl) return {};\n\n let coreProps: string | undefined;\n let appProps: string | undefined;\n\n for (const child of relsEl.elements ?? []) {\n if (child.name !== \"Relationship\") continue;\n const type = attr(child, \"Type\") ?? \"\";\n const target = attr(child, \"Target\") ?? \"\";\n if (!target) continue;\n\n const path = target.startsWith(\"/\") ? target.slice(1) : target;\n\n if (type.includes(\"/core-properties\")) {\n coreProps = path;\n } else if (type.includes(\"/extended-properties\")) {\n appProps = path;\n }\n }\n\n return { coreProps, appProps };\n}\n\nfunction parseSlideRels(doc: ParsedDocument, slidePaths: string[], refs: PptxPartRefs): void {\n for (const slidePath of slidePaths) {\n const parts = slidePath.split(\"/\");\n const fileName = parts.pop()!;\n const relsPath = `${parts.join(\"/\")}/_rels/${fileName}.rels`;\n\n const relsEl = doc.get(relsPath);\n if (!relsEl) continue;\n\n for (const child of relsEl.elements ?? []) {\n if (child.name !== \"Relationship\") continue;\n const type = attr(child, \"Type\") ?? \"\";\n const target = attr(child, \"Target\") ?? \"\";\n if (!target) continue;\n\n const path = resolveRelsPath(target);\n\n if (type.includes(\"/comments\") && !type.includes(\"commentAuthors\")) {\n if (!refs.comments.includes(path)) refs.comments.push(path);\n } else if (type.includes(\"/chart\")) {\n if (!refs.charts.includes(path)) refs.charts.push(path);\n } else if (type.includes(\"/diagramData\")) {\n if (!refs.diagramData.includes(path)) refs.diagramData.push(path);\n } else if (\n type.includes(\"/image\") ||\n type.includes(\"/video\") ||\n type.includes(\"/media\")\n ) {\n if (!refs.media.includes(path)) refs.media.push(path);\n }\n }\n }\n}\n\nexport function parsePptx(data: Uint8Array): PptxDocument {\n const doc = parseDocument(data);\n\n const presentation = doc.get(\"ppt/presentation.xml\");\n\n const relsXml = doc.get(\"ppt/_rels/presentation.xml.rels\");\n const slides: string[] = [];\n const slideMasters: string[] = [];\n const themes: string[] = [];\n const notesMasters: string[] = [];\n let presProps: string | undefined;\n let viewProps: string | undefined;\n let tableStyles: string | undefined;\n let commentAuthors: string | undefined;\n\n if (relsXml) {\n for (const child of relsXml.elements ?? []) {\n if (child.name !== \"Relationship\") continue;\n const type = attr(child, \"Type\") ?? \"\";\n const target = attr(child, \"Target\") ?? \"\";\n if (!target) continue;\n\n const path = resolveRelsPath(target);\n\n if (type.includes(\"/slideMaster\")) {\n slideMasters.push(path);\n } else if (\n type.includes(\"/slide\") &&\n !type.includes(\"slideLayout\") &&\n !type.includes(\"slideMaster\")\n ) {\n slides.push(path);\n } else if (type.includes(\"/theme\")) {\n themes.push(path);\n } else if (type.includes(\"/notesMaster\")) {\n notesMasters.push(path);\n } else if (type.includes(\"/presProps\")) {\n presProps = path;\n } else if (type.includes(\"/viewProps\")) {\n viewProps = path;\n } else if (type.includes(\"/tableStyles\")) {\n tableStyles = path;\n } else if (type.includes(\"/commentAuthors\")) {\n commentAuthors = path;\n }\n }\n }\n\n sortByNumber(slides);\n sortByNumber(slideMasters);\n sortByNumber(themes);\n sortByNumber(notesMasters);\n\n const slideLayouts = sortByNumber(xmlKeys(doc.keys(\"ppt/slideLayouts/\")));\n const notesSlides = sortByNumber(xmlKeys(doc.keys(\"ppt/notesSlides/\")));\n\n const partRefs: PptxPartRefs = {\n themes,\n notesMasters,\n commentAuthors,\n comments: [],\n charts: [],\n diagramData: [],\n media: doc.keys(\"ppt/media/\"),\n };\n\n parseSlideRels(doc, slides, partRefs);\n sortByNumber(partRefs.comments);\n sortByNumber(partRefs.charts);\n sortByNumber(partRefs.diagramData);\n\n const { coreProps, appProps } = parseRootRels(doc);\n\n return {\n doc,\n presentation,\n slides,\n slideMasters,\n slideLayouts,\n notesSlides,\n partRefs,\n presProps,\n viewProps,\n tableStyles,\n coreProps,\n appProps,\n };\n}\n","export { File as Presentation } from \"./file\";\nexport * from \"./file\";\nexport * from \"./export\";\nexport * from \"./util\";\nexport * from \"./parse\";\n"],"mappings":";;;;;;;;;;AAyHA,SAAS,QAAQ,OAAgB,OAAgB;AAC7C,KAAI,CAAC,MAAO,QAAO;EAAE,OAAO;EAAU,QAAQ,SAAS,MAAM;EAAM;AACnE,QAAO;EAAE,OAAO,MAAM,QAAQ,KAAK,GAAG;EAAE,QAAQ,SAAS,MAAM;EAAM;;;AAIzE,SAAS,cAAc,MAAsB;AACzC,QAAO;EACH,YAAY,KAAK;EACjB,UAAU,KAAK;EACf,WAAW,KAAK;EAChB,cAAc,KAAK,oBAAoB,QAAQ,QAAQ,KAAA;EACvD,OAAO,QAAQ,KAAK,OAAO,KAAK,MAAM;EACzC;;;AAIL,SAAS,cAAc,MAAsB;AACzC,QAAO;EACH,YAAY,KAAK;EACjB,UAAU,KAAK;EACf,WAAW,KAAK;EAChB,OAAO,QAA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