@office-open/core 0.12.3 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/chart/index.d.mts +2 -2
  2. package/dist/chart/index.mjs +1 -1
  3. package/dist/{chart-DEIF3VZn.mjs → chart-Bn_McAo-.mjs} +4 -4
  4. package/dist/chart-Bn_McAo-.mjs.map +1 -0
  5. package/dist/drawing/index.d.mts +2 -2
  6. package/dist/drawing/index.mjs +1 -1
  7. package/dist/{drawing-BVwCkNXB.mjs → drawing-DJ363Awy.mjs} +102 -108
  8. package/dist/drawing-DJ363Awy.mjs.map +1 -0
  9. package/dist/{ext-uri-BHBcIrW7.mjs → ext-uri-BR1ouCh3.mjs} +6 -11
  10. package/dist/ext-uri-BR1ouCh3.mjs.map +1 -0
  11. package/dist/{index-DRggxtp7.d.mts → index-6_MYd0cg.d.mts} +3 -3
  12. package/dist/{index-DRggxtp7.d.mts.map → index-6_MYd0cg.d.mts.map} +1 -1
  13. package/dist/{index-DPkf_CtG.d.mts → index-BDeoFmTS.d.mts} +146 -149
  14. package/dist/index-BDeoFmTS.d.mts.map +1 -0
  15. package/dist/{index-DfFszyH1.d.mts → index-Cd0lFS5x.d.mts} +9 -17
  16. package/dist/index-Cd0lFS5x.d.mts.map +1 -0
  17. package/dist/{index-DcukVskh.d.mts → index-DOtPArpl.d.mts} +2 -2
  18. package/dist/{index-DcukVskh.d.mts.map → index-DOtPArpl.d.mts.map} +1 -1
  19. package/dist/{index-BwRtWyaP.d.mts → index-Dg0nIw2S.d.mts} +7 -7
  20. package/dist/{index-BwRtWyaP.d.mts.map → index-Dg0nIw2S.d.mts.map} +1 -1
  21. package/dist/{index-L6AXewfV.d.mts → index-DkJrkIVp.d.mts} +2 -3
  22. package/dist/index-DkJrkIVp.d.mts.map +1 -0
  23. package/dist/index.d.mts +8 -8
  24. package/dist/index.mjs +30 -10
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/patch-AkQY17CD.mjs.map +1 -1
  27. package/dist/smartart/index.d.mts +1 -1
  28. package/dist/smartart/index.mjs +1 -1
  29. package/dist/{smartart-YH87Emca.mjs → smartart-D-8KBdQ_.mjs} +4 -4
  30. package/dist/{smartart-YH87Emca.mjs.map → smartart-D-8KBdQ_.mjs.map} +1 -1
  31. package/dist/{style-matrix-DjhMuuQg.mjs → style-matrix-B6YSVw6a.mjs} +2 -2
  32. package/dist/{style-matrix-DjhMuuQg.mjs.map → style-matrix-B6YSVw6a.mjs.map} +1 -1
  33. package/dist/theme/index.d.mts +3 -3
  34. package/dist/theme/index.mjs +2 -2
  35. package/dist/{theme-Dx0Db9bX.mjs → theme-BdqG5lmO.mjs} +3 -3
  36. package/dist/theme-BdqG5lmO.mjs.map +1 -0
  37. package/dist/{theme-options-kO89NUEX.d.mts → theme-options-wZX4i_xx.d.mts} +2 -2
  38. package/dist/{theme-options-kO89NUEX.d.mts.map → theme-options-wZX4i_xx.d.mts.map} +1 -1
  39. package/dist/util/index.d.mts +2 -2
  40. package/dist/util/index.mjs +3 -3
  41. package/dist/{util-iHHKF2Rx.mjs → util-BGfk-gE0.mjs} +2 -2
  42. package/dist/{util-iHHKF2Rx.mjs.map → util-BGfk-gE0.mjs.map} +1 -1
  43. package/dist/vector/index.d.mts +2 -2
  44. package/dist/vector/index.mjs +2 -2
  45. package/dist/{vector-DZ_OteHJ.mjs → vector-BhETDAdp.mjs} +2 -9
  46. package/dist/vector-BhETDAdp.mjs.map +1 -0
  47. package/package.json +2 -2
  48. package/dist/chart-DEIF3VZn.mjs.map +0 -1
  49. package/dist/drawing-BVwCkNXB.mjs.map +0 -1
  50. package/dist/ext-uri-BHBcIrW7.mjs.map +0 -1
  51. package/dist/index-DPkf_CtG.d.mts.map +0 -1
  52. package/dist/index-DfFszyH1.d.mts.map +0 -1
  53. package/dist/index-L6AXewfV.d.mts.map +0 -1
  54. package/dist/theme-Dx0Db9bX.mjs.map +0 -1
  55. package/dist/vector-DZ_OteHJ.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"patch-AkQY17CD.mjs","names":[],"sources":["../src/opc/core.ts","../src/patch/xml-namespace.ts","../src/patch/xml-patch-utils.ts","../src/patch/paragraph-split-inject.ts","../src/patch/paragraph-token-replacer.ts","../src/patch/run-renderer.ts","../src/patch/xml-traverser.ts","../src/patch/xml-replacer.ts","../src/patch/content-types-manager.ts","../src/patch/relationship-manager.ts","../src/patch/core-properties-override.ts"],"sourcesContent":["import { textOf, escapeXml } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\n/**\n * Core document properties (docProps/core.xml).\n *\n * Shared across docx/pptx/xlsx: each format's top-level Options extends this,\n * parse emits the same shape, and patch overrides it — read/write symmetry\n * (CONTRIBUTING §Property Naming). Field names follow the OPC core-properties\n * XSD element local names (`creator` = dc:creator, … — never `author`).\n */\nexport interface CorePropertiesOptions {\n title?: string;\n subject?: string;\n creator?: string;\n keywords?: string;\n description?: string;\n lastModifiedBy?: string;\n revision?: number;\n lastPrinted?: string;\n /**\n * Creation timestamp (W3CDTF), round-tripped from dcterms:created. null =\n * the source core.xml carried none — emit nothing; undefined (fresh) =\n * default to now.\n */\n created?: string | null;\n /** Last modified timestamp (W3CDTF); same null/undefined semantics as {@link created}. */\n modified?: string | null;\n /** Document category, round-tripped from cp:category. */\n category?: string;\n /** Document status (e.g. \"Draft\"), round-tripped from cp:contentStatus. */\n contentStatus?: string;\n /** Content type (e.g. \"Document\"), round-tripped from cp:contentType. */\n contentType?: string;\n /** Unique document identifier, round-tripped from dc:identifier. */\n identifier?: string;\n /** Document language (RFC 3066), round-tripped from dc:language. */\n language?: string;\n /** Document version number, round-tripped from cp:version. */\n version?: string;\n /**\n * Emit the core-properties vocabulary as the default namespace — the ISO\n * strict binding, where the source root is `<coreProperties xmlns=…>` and\n * cp:-prefixed children appear prefix-less (dc:/dcterms: keep their\n * prefixes). Round-trip only.\n */\n defaultNamespace?: true;\n}\n\nconst FIELD_MAP: Array<{ name: string; key: keyof CorePropertiesOptions }> = [\n { name: \"dc:title\", key: \"title\" },\n { name: \"dc:subject\", key: \"subject\" },\n { name: \"dc:creator\", key: \"creator\" },\n { name: \"dc:description\", key: \"description\" },\n { name: \"cp:keywords\", key: \"keywords\" },\n { name: \"cp:lastModifiedBy\", key: \"lastModifiedBy\" },\n { name: \"cp:lastPrinted\", key: \"lastPrinted\" },\n { name: \"dcterms:created\", key: \"created\" },\n { name: \"dcterms:modified\", key: \"modified\" },\n { name: \"cp:category\", key: \"category\" },\n { name: \"cp:contentStatus\", key: \"contentStatus\" },\n { name: \"cp:contentType\", key: \"contentType\" },\n { name: \"dc:identifier\", key: \"identifier\" },\n { name: \"dc:language\", key: \"language\" },\n { name: \"cp:version\", key: \"version\" },\n];\n\n/**\n * Parse core properties from an already-parsed XML element.\n * Shared by docx/pptx/xlsx to extract Dublin Core metadata into the unified\n * {@link CorePropertiesOptions} shape.\n */\nexport function parseCorePropsElement(el: Element | undefined): CorePropertiesOptions {\n if (!el) return {};\n\n const props: CorePropertiesOptions = {};\n // ISO/strict binds the core-properties namespace as the default — a\n // prefix-less root means stringify must re-emit that form.\n if (el.name === \"coreProperties\") props.defaultNamespace = true;\n\n for (const field of FIELD_MAP) {\n // ISO/strict files bind the core-properties namespace as the DEFAULT\n // namespace, so cp:/dcterms: children appear prefix-less — match by\n // local name too (field local names are unique across the map).\n const localName = field.name.slice(field.name.indexOf(\":\") + 1);\n const child = el.elements?.find(\n (e) => e.type === \"element\" && (e.name === field.name || e.name === localName),\n );\n // Presence-based: Word writes whitespace-only text (\"<dc:title>\\n</dc:title>\"),\n // which the XML parser reduces to an empty element — capture \"\" so the\n // field survives round-trip instead of being silently dropped.\n if (child) (props as Record<string, unknown>)[field.key] = textOf(child);\n }\n\n const revEl = el.elements?.find((e) => e.name === \"cp:revision\" || e.name === \"revision\");\n if (revEl) {\n const rev = textOf(revEl);\n if (rev) {\n const n = Number(rev);\n if (!Number.isNaN(n)) props.revision = n;\n }\n }\n\n // A parsed core part that carries no timestamps marks them explicitly\n // absent (null) — the emit path then omits them instead of defaulting to\n // now, which a fresh document (undefined) still does.\n if (props.created === undefined) props.created = null;\n if (props.modified === undefined) props.modified = null;\n\n return props;\n}\n\n/**\n * Build a cp:coreProperties XML string directly (fast path).\n *\n * Shared by pptx and xlsx to bypass the toXml() → xml() pipeline.\n * created/modified default to now when not supplied; all other fields emit\n * only when present.\n */\nexport function buildCorePropertiesXmlString(opts: CorePropertiesOptions): string {\n // ISO/strict round-trip: the core-properties namespace is the default, so\n // its children carry no prefix (dc:/dcterms: keep theirs).\n const cp = (name: string): string => (opts.defaultNamespace ? name : `cp:${name}`);\n const p: string[] = opts.defaultNamespace\n ? [\n '<coreProperties xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\">',\n ]\n : [\n '<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">',\n ];\n // Empty-string values are meaningful (element present, text empty) — only\n // undefined omits the element.\n if (opts.title !== undefined) p.push(`<dc:title>${escapeXml(opts.title)}</dc:title>`);\n if (opts.subject !== undefined) p.push(`<dc:subject>${escapeXml(opts.subject)}</dc:subject>`);\n if (opts.creator !== undefined) p.push(`<dc:creator>${escapeXml(opts.creator)}</dc:creator>`);\n if (opts.keywords !== undefined)\n p.push(`<${cp(\"keywords\")}>${escapeXml(opts.keywords)}</${cp(\"keywords\")}>`);\n if (opts.description !== undefined)\n p.push(`<dc:description>${escapeXml(opts.description)}</dc:description>`);\n if (opts.lastPrinted !== undefined)\n p.push(`<${cp(\"lastPrinted\")}>${escapeXml(opts.lastPrinted)}</${cp(\"lastPrinted\")}>`);\n if (opts.lastModifiedBy !== undefined)\n p.push(`<${cp(\"lastModifiedBy\")}>${escapeXml(opts.lastModifiedBy)}</${cp(\"lastModifiedBy\")}>`);\n if (opts.revision !== undefined)\n p.push(`<${cp(\"revision\")}>${opts.revision}</${cp(\"revision\")}>`);\n\n const now = new Date().toISOString();\n if (opts.created !== null)\n p.push(`<dcterms:created xsi:type=\"dcterms:W3CDTF\">${opts.created ?? now}</dcterms:created>`);\n if (opts.modified !== null)\n p.push(\n `<dcterms:modified xsi:type=\"dcterms:W3CDTF\">${opts.modified ?? now}</dcterms:modified>`,\n );\n // Trailing slots mirror Word's emission order (category last in real files).\n if (opts.category !== undefined)\n p.push(`<${cp(\"category\")}>${escapeXml(opts.category)}</${cp(\"category\")}>`);\n if (opts.contentStatus !== undefined)\n p.push(`<${cp(\"contentStatus\")}>${escapeXml(opts.contentStatus)}</${cp(\"contentStatus\")}>`);\n if (opts.contentType !== undefined)\n p.push(`<${cp(\"contentType\")}>${escapeXml(opts.contentType)}</${cp(\"contentType\")}>`);\n if (opts.identifier !== undefined)\n p.push(`<dc:identifier>${escapeXml(opts.identifier)}</dc:identifier>`);\n if (opts.language !== undefined) p.push(`<dc:language>${escapeXml(opts.language)}</dc:language>`);\n if (opts.version !== undefined)\n p.push(`<${cp(\"version\")}>${escapeXml(opts.version)}</${cp(\"version\")}>`);\n p.push(`</${cp(\"coreProperties\")}>`);\n return p.join(\"\");\n}\n","/**\n * Namespace configuration for XML patch operations.\n *\n * Parameterises element names so the same patch algorithm works for both\n * DOCX (`w:*`) and PPTX (`a:*`) documents.\n */\n\nexport interface XmlNamespaceOptions {\n paragraph: string;\n run: string;\n text: string;\n runProperties: string;\n}\n\nexport const DOCX_NS: XmlNamespaceOptions = {\n paragraph: \"w:p\",\n run: \"w:r\",\n text: \"w:t\",\n runProperties: \"w:rPr\",\n};\n\nexport const PPTX_NS: XmlNamespaceOptions = {\n paragraph: \"a:p\",\n run: \"a:r\",\n text: \"a:t\",\n runProperties: \"a:rPr\",\n};\n","/**\n * XML utility functions for patch operations.\n */\nimport { parse } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nexport const toJson = (xmlData: string): Element => {\n const xmlObj = parse(xmlData, {\n captureSpacesBetweenElements: true,\n compact: false,\n }) as Element;\n return xmlObj;\n};\n\n/**\n * Creates the inner content of a text element (`w:t` / `a:t`).\n *\n * Returns `[{ type: \"text\", text }]` for non-empty text, `[]` for empty.\n * The `xml:space` attribute is handled separately by `patchSpaceAttribute`.\n */\nexport const createTextElementContents = (text: string): Element[] =>\n text === \"\" ? [] : [{ text, type: \"text\" }];\n\nexport const patchSpaceAttribute = (element: Element): Element => ({\n ...element,\n attributes: {\n \"xml:space\": \"preserve\",\n },\n});\n\nexport const getFirstLevelElements = (relationships: Element, id: string): Element[] =>\n relationships.elements?.find((e) => e.name === id)?.elements ?? [];\n\n/**\n * Next sequential numeric id: the largest `attr` value among direct children\n * named `childName`, plus one. `seed` is the floor — e.g. PPTX `<p:sldId>`\n * values start at 255, so the first appended id is at least 256.\n *\n * Unifies the per-package `maxCommentId` / `maxSldId` / `maxSheetId` helpers.\n */\nexport const nextNumericId = (\n parent: Element | undefined,\n childName: string,\n attr: string,\n seed = 0,\n): number => {\n let maxId = seed;\n for (const child of parent?.elements ?? []) {\n if (child.name !== childName) continue;\n const id = Number(child.attributes?.[attr]);\n if (Number.isFinite(id)) maxId = Math.max(maxId, id);\n }\n return maxId + 1;\n};\n","/**\n * Paragraph split and inject utilities for run-level text replacement.\n *\n * Parameterised by `XmlNamespaceOptions` so it works for both DOCX and PPTX.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\nimport { patchSpaceAttribute } from \"./xml-patch-utils\";\n\nexport class TokenNotFoundError extends Error {\n public constructor(token: string) {\n super(`Token ${token} not found`);\n this.name = \"TokenNotFoundError\";\n }\n}\n\nexport function createSplitInject(\n ns: XmlNamespaceOptions,\n createTextElementContents: (text: string) => Element[],\n options?: { readonly preserveSpace?: boolean },\n) {\n const preserveSpace = options?.preserveSpace ?? true;\n const findRunElementIndexWithToken = (paragraphElement: Element, token: string): number => {\n for (const [i, element] of (paragraphElement.elements ?? []).entries()) {\n if (element.type === \"element\" && element.name === ns.run) {\n const textElement = (element.elements ?? []).filter(\n (e) => e.type === \"element\" && e.name === ns.text,\n );\n\n for (const text of textElement) {\n const firstChild = text.elements?.[0];\n if (!firstChild) {\n continue;\n }\n\n if ((firstChild.text as string).includes(token)) {\n return i;\n }\n }\n }\n }\n\n throw new TokenNotFoundError(token);\n };\n\n const splitRunElement = (\n runElement: Element,\n token: string,\n ): { readonly left: Element; readonly right: Element } => {\n let splitIndex = -1;\n\n const splitElements =\n runElement.elements\n ?.map((e, i) => {\n if (splitIndex !== -1) {\n return e;\n }\n\n if (e.type === \"element\" && e.name === ns.text) {\n const text = (e.elements?.[0]?.text as string) ?? \"\";\n const splitText = text.split(token);\n const newElements = splitText.map((t) => ({\n ...e,\n ...(preserveSpace ? patchSpaceAttribute(e) : {}),\n elements: createTextElementContents(t),\n }));\n\n if (splitText.length > 1) {\n splitIndex = i;\n }\n\n return newElements;\n } else {\n return e;\n }\n })\n .flat() ?? [];\n\n const leftRunElement: Element = {\n ...runElement,\n elements: splitElements.slice(0, splitIndex + 1),\n };\n\n const rightRunElement: Element = {\n ...runElement,\n elements: splitElements.slice(splitIndex + 1),\n };\n\n return { left: leftRunElement, right: rightRunElement };\n };\n\n return { findRunElementIndexWithToken, splitRunElement };\n}\n","/**\n * Paragraph token replacer for substituting text within paragraph runs.\n *\n * Fully generic — operates on Element nodes without namespace-specific logic.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { RenderedParagraphNode } from \"./run-renderer\";\nimport { patchSpaceAttribute } from \"./xml-patch-utils\";\n\nconst ReplaceMode = {\n START: 0,\n MIDDLE: 1,\n END: 2,\n} as const;\n\nexport function createTokenReplacer(\n createTextElementContents: (text: string) => Element[],\n options?: { readonly preserveSpace?: boolean },\n) {\n const preserveSpace = options?.preserveSpace ?? true;\n\n const patchTextElement = (element: Element, text: string): Element => {\n element.elements = createTextElementContents(text);\n return element;\n };\n\n return ({\n paragraphElement,\n renderedParagraph,\n originalText,\n replacementText,\n }: {\n paragraphElement: Element;\n renderedParagraph: RenderedParagraphNode;\n originalText: string;\n replacementText: string;\n }): Element => {\n const startIndex = renderedParagraph.text.indexOf(originalText);\n const endIndex = startIndex + originalText.length - 1;\n\n let replaceMode: (typeof ReplaceMode)[keyof typeof ReplaceMode] = ReplaceMode.START;\n\n for (const run of renderedParagraph.runs) {\n const runChildren = paragraphElement.elements?.[run.index]?.elements;\n if (!runChildren) continue;\n for (const { text, index, start, end } of run.parts) {\n const partElement = runChildren[index];\n if (!partElement) continue;\n switch (replaceMode) {\n case ReplaceMode.START: {\n if (startIndex >= start && startIndex <= end) {\n const offsetStartIndex = startIndex - start;\n const offsetEndIndex = Math.min(endIndex, end) - start;\n const partToReplace = text.substring(offsetStartIndex, offsetEndIndex + 1);\n if (partToReplace === \"\") {\n continue;\n }\n\n const firstPart = text.replace(partToReplace, replacementText);\n patchTextElement(partElement, firstPart);\n replaceMode = ReplaceMode.MIDDLE;\n continue;\n }\n break;\n }\n case ReplaceMode.MIDDLE: {\n if (endIndex <= end) {\n const lastPart = text.substring(endIndex - start + 1);\n patchTextElement(partElement, lastPart);\n runChildren[index] = preserveSpace ? patchSpaceAttribute(partElement) : partElement;\n replaceMode = ReplaceMode.END;\n } else {\n patchTextElement(partElement, \"\");\n }\n break;\n }\n }\n }\n }\n\n return paragraphElement;\n };\n}\n","/**\n * Run renderer for extracting text content from OOXML paragraph structures.\n *\n * Parameterised by `XmlNamespaceOptions` so it works for both DOCX and PPTX.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\n\nexport interface ElementWrapper {\n element: Element;\n index: number;\n parent: ElementWrapper | undefined;\n}\n\nexport interface RenderedParagraphNode {\n text: string;\n runs: readonly RenderedRunNode[];\n index: number;\n pathToParagraph: readonly number[];\n}\n\ninterface StartAndEnd {\n start: number;\n end: number;\n}\n\ntype IParts = {\n text: string;\n index: number;\n} & StartAndEnd;\n\nexport type RenderedRunNode = {\n text: string;\n parts: readonly IParts[];\n index: number;\n} & StartAndEnd;\n\nexport function createRunRenderer(ns: XmlNamespaceOptions) {\n const renderParagraphNode = (node: ElementWrapper): RenderedParagraphNode => {\n if (node.element.name !== ns.paragraph) {\n throw new Error(`Invalid node type: ${node.element.name}`);\n }\n\n if (!node.element.elements) {\n return {\n index: -1,\n pathToParagraph: [],\n runs: [],\n text: \"\",\n };\n }\n\n let currentRunStringLength = 0;\n\n const runs: RenderedRunNode[] = [];\n for (const [i, element] of node.element.elements.entries()) {\n if (element.name === ns.run) {\n const renderedRunNode = renderRunNode(element, i, currentRunStringLength);\n currentRunStringLength += renderedRunNode.text.length;\n runs.push(renderedRunNode);\n }\n }\n\n const text = runs.reduce((acc, curr) => acc + curr.text, \"\");\n\n return {\n index: node.index,\n pathToParagraph: buildNodePath(node),\n runs,\n text,\n };\n };\n\n const renderRunNode = (\n node: Element,\n index: number,\n currentRunStringIndex: number,\n ): RenderedRunNode => {\n if (!node.elements) {\n return {\n end: currentRunStringIndex,\n index: -1,\n parts: [],\n start: currentRunStringIndex,\n text: \"\",\n };\n }\n\n let currentTextStringIndex = currentRunStringIndex;\n\n const parts: IParts[] = [];\n for (const [i, element] of node.elements.entries()) {\n if (element.name !== ns.text) continue;\n const textChildren = element.elements;\n if (!textChildren || textChildren.length === 0) continue;\n const firstChild = textChildren[0];\n if (!firstChild) continue;\n const text = firstChild.text ?? \"\";\n const textStr = String(text);\n const partStart = currentTextStringIndex;\n currentTextStringIndex += textStr.length;\n parts.push({ end: currentTextStringIndex - 1, index: i, start: partStart, text: textStr });\n }\n\n const text = parts.reduce((acc, curr) => acc + curr.text, \"\");\n\n return {\n end: currentTextStringIndex - 1,\n index,\n parts,\n start: currentRunStringIndex,\n text,\n };\n };\n\n return renderParagraphNode;\n}\n\nconst buildNodePath = (node: ElementWrapper): readonly number[] => {\n const path: number[] = [];\n let current: ElementWrapper | undefined = node;\n while (current) {\n path.push(current.index);\n current = current.parent;\n }\n path.reverse();\n return path;\n};\n","/**\n * XML traverser for searching paragraph content in OOXML documents.\n *\n * Parameterised by `XmlNamespaceOptions` so it works for both DOCX and PPTX.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { createRunRenderer, type ElementWrapper, type RenderedParagraphNode } from \"./run-renderer\";\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\n\nexport function createTraverser(ns: XmlNamespaceOptions) {\n const renderParagraphNode = createRunRenderer(ns);\n\n const traverse = (node: Element): readonly RenderedParagraphNode[] => {\n const renderedParagraphs: RenderedParagraphNode[] = [];\n const queue: ElementWrapper[] = [];\n\n // Seed with root as virtual wrapper so paths include the root level\n const rootChildren = node.elements;\n if (rootChildren) {\n const root: ElementWrapper = { element: node, index: 0, parent: undefined };\n for (const [i, child] of rootChildren.entries()) {\n queue.push({ element: child, index: i, parent: root });\n }\n }\n\n let qi = 0;\n while (qi < queue.length) {\n const current = queue[qi++];\n if (!current) break;\n\n if (current.element.name === ns.paragraph) {\n renderedParagraphs.push(renderParagraphNode(current));\n }\n\n const children = current.element.elements;\n if (children) {\n for (const [i, child] of children.entries()) {\n queue.push({ element: child, index: i, parent: current });\n }\n }\n }\n\n return renderedParagraphs;\n };\n\n const findLocationOfText = (node: Element, text: string): readonly RenderedParagraphNode[] =>\n traverse(node).filter((p) => p.text.includes(text));\n\n return { traverse, findLocationOfText };\n}\n","/**\n * Parameterised XML replacer for placeholder substitution in OOXML documents.\n *\n * Accepts namespace config and a format callback so both DOCX and PPTX can\n * use the same replacement algorithm.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { createSplitInject } from \"./paragraph-split-inject\";\nimport { createTokenReplacer } from \"./paragraph-token-replacer\";\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\nimport { createTextElementContents } from \"./xml-patch-utils\";\nimport { createTraverser } from \"./xml-traverser\";\n\nexport interface ReplacerOptions {\n ns: XmlNamespaceOptions;\n formatChild: (child: unknown, context: unknown) => Element[];\n preserveSpace?: boolean;\n}\n\ninterface ReplacerResult {\n element: Element;\n didFindOccurrence: boolean;\n}\n\nconst SPLIT_TOKEN = \"\\u0275\";\n\nexport function createReplacer(config: ReplacerOptions) {\n const { ns, formatChild } = config;\n const { findLocationOfText } = createTraverser(ns);\n\n const replaceTokenInParagraphElement = createTokenReplacer(createTextElementContents, {\n preserveSpace: config.preserveSpace,\n });\n const { findRunElementIndexWithToken, splitRunElement } = createSplitInject(\n ns,\n createTextElementContents,\n { preserveSpace: config.preserveSpace },\n );\n\n const replacer = ({\n json,\n patch,\n patchText,\n context,\n keepOriginalStyles = true,\n }: {\n json: Element;\n patch: {\n type: string;\n children: readonly unknown[];\n };\n patchText: string;\n context: unknown;\n keepOriginalStyles?: boolean;\n }): ReplacerResult => {\n const renderedParagraphs = findLocationOfText(json, patchText);\n\n if (renderedParagraphs.length === 0) {\n return { didFindOccurrence: false, element: json };\n }\n\n for (const renderedParagraph of renderedParagraphs) {\n const textJson = patch.children.flatMap((c) => formatChild(c, context));\n\n switch (patch.type) {\n case \"document\": {\n const parentElement = goToParentElementFromPath(json, renderedParagraph.pathToParagraph);\n const elementIndex = getLastElementIndexFromPath(renderedParagraph.pathToParagraph);\n parentElement.elements!.splice(elementIndex, 1, ...textJson);\n break;\n }\n case \"paragraph\":\n default: {\n const paragraphElement = goToElementFromPath(json, renderedParagraph.pathToParagraph);\n replaceTokenInParagraphElement({\n originalText: patchText,\n paragraphElement,\n renderedParagraph,\n replacementText: SPLIT_TOKEN,\n });\n\n const index = findRunElementIndexWithToken(paragraphElement, SPLIT_TOKEN);\n\n const runElementToBeReplaced = paragraphElement.elements![index];\n if (!runElementToBeReplaced) break;\n const { left, right } = splitRunElement(runElementToBeReplaced, SPLIT_TOKEN);\n\n let newRunElements = textJson;\n let patchedRightElement = right;\n\n if (keepOriginalStyles) {\n const runElementNonTextualElements = runElementToBeReplaced.elements!.filter(\n (e) => e.type === \"element\" && e.name === ns.runProperties,\n );\n\n newRunElements = textJson.map((e) => {\n if (\n e.type !== \"element\" ||\n e.name !== ns.run ||\n e.elements?.some((c) => c.type === \"element\" && c.name === ns.runProperties)\n ) {\n return e;\n }\n return {\n ...e,\n elements: [...runElementNonTextualElements, ...(e.elements ?? [])],\n };\n });\n\n patchedRightElement = {\n ...right,\n elements: [...runElementNonTextualElements, ...right.elements!],\n };\n }\n\n paragraphElement.elements!.splice(index, 1, left, ...newRunElements, patchedRightElement);\n break;\n }\n }\n }\n\n return { didFindOccurrence: true, element: json };\n };\n\n return replacer;\n}\n\nconst goToElementFromPath = (json: Element, path: readonly number[]): Element => {\n let element = json;\n for (let i = 1; i < path.length; i++) {\n const index = path[i];\n if (index === undefined) break;\n const nextElements = element.elements!;\n const next = nextElements[index];\n if (!next) break;\n element = next;\n }\n return element;\n};\n\nconst goToParentElementFromPath = (json: Element, path: readonly number[]): Element =>\n goToElementFromPath(json, path.slice(0, -1));\n\n// pathToParagraph is built by the renderer and always non-empty; the `!` is a contract narrow.\nconst getLastElementIndexFromPath = (path: readonly number[]): number => path[path.length - 1]!;\n","/**\n * Content types manager for OOXML [Content_Types].xml management.\n */\nimport type { Element } from \"@office-open/xml\";\n\n/**\n * The `<Types>` child array, initialized in place when absent (so a `<Default>`\n * or `<Override>` can always be appended). Returns `undefined` if `element` has\n * no `<Types>` child (malformed `[Content_Types].xml`).\n */\nconst typesChildren = (element: Element): Element[] | undefined => {\n const types = element.elements?.find((e) => e.name === \"Types\");\n if (!types) return undefined;\n return types.elements ?? (types.elements = []);\n};\n\nexport const appendContentType = (\n element: Element,\n contentType: string,\n extension: string,\n): void => {\n const els = typesChildren(element);\n if (!els) return;\n\n // OPC Default Extension matching is case-insensitive (ECMA-376-2 §10.1.2):\n // an existing `JPG` must block a colliding `jpg`, or Word rejects the package.\n const exist = els.some(\n (el) =>\n el.type === \"element\" &&\n el.name === \"Default\" &&\n String(el?.attributes?.Extension ?? \"\").toLowerCase() === extension.toLowerCase(),\n );\n if (exist) {\n return;\n }\n\n els.push({\n attributes: {\n ContentType: contentType,\n Extension: extension,\n },\n name: \"Default\",\n type: \"element\",\n });\n};\n\n/**\n * Append an `<Override>` element to a `[Content_Types].xml` root, deduped by\n * `PartName`. Sibling to {@link appendContentType} (which handles `<Default>`):\n * unifies the per-package Override-dedup blocks in docx/pptx/xlsx patchers.\n */\nexport const appendOverride = (element: Element, partName: string, contentType: string): void => {\n const els = typesChildren(element);\n if (!els) return;\n\n // OPC Override PartName matching is case-insensitive (ECMA-376-2 §10.1.4).\n const exists = els.some(\n (el) =>\n el.type === \"element\" &&\n el.name === \"Override\" &&\n String(el?.attributes?.PartName ?? \"\").toLowerCase() === partName.toLowerCase(),\n );\n if (exists) return;\n\n els.push({\n attributes: {\n PartName: partName,\n ContentType: contentType,\n },\n name: \"Override\",\n type: \"element\",\n });\n};\n\n/**\n * Remove an `<Override>` from a `[Content_Types].xml` root by `PartName`\n * (case-insensitive). Sibling to {@link appendOverride} for patch paths that\n * drop a part from the package.\n */\nexport const removeOverride = (element: Element, partName: string): void => {\n const els = typesChildren(element);\n if (!els) return;\n\n const kept = els.filter(\n (el) =>\n !(\n el.type === \"element\" &&\n el.name === \"Override\" &&\n String(el?.attributes?.PartName ?? \"\").toLowerCase() === partName.toLowerCase()\n ),\n );\n if (kept.length !== els.length) {\n element.elements!.find((e) => e.name === \"Types\")!.elements = kept;\n }\n};\n","/**\n * Relationship manager for OOXML .rels file management.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { getFirstLevelElements } from \"./xml-patch-utils\";\n\nconst getIdFromRelationshipId = (relationshipId: string): number => {\n const output = parseInt(relationshipId.substring(3), 10);\n return isNaN(output) ? 0 : output;\n};\n\nexport const getNextRelationshipIndex = (relationships: Element): number => {\n const relationshipElements = getFirstLevelElements(relationships, \"Relationships\");\n\n return (\n relationshipElements\n .map((e) => getIdFromRelationshipId(e.attributes?.Id?.toString() ?? \"\"))\n .reduce((acc, curr) => Math.max(acc, curr), 0) + 1\n );\n};\n\nexport const appendRelationship = (\n relationships: Element,\n id: number | string,\n type: string,\n target: string,\n targetMode?: string,\n): readonly Element[] => {\n const relationshipElements = getFirstLevelElements(relationships, \"Relationships\");\n relationshipElements.push({\n attributes: {\n Id: `rId${id}`,\n Target: target,\n TargetMode: targetMode,\n Type: type,\n },\n name: \"Relationship\",\n type: \"element\",\n });\n\n return relationshipElements;\n};\n","/**\n * Merge core-properties overrides onto an existing docProps/core.xml document.\n *\n * The patch layer unzips docProps/core.xml into an parse document structure\n * (its `.elements` holds the `cp:coreProperties` root). This helper parses the\n * existing values, layers `overrides` on top (override wins), and returns the\n * re-serialized XML — without the XML declaration, which the caller prepends.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { buildCorePropertiesXmlString, parseCorePropsElement } from \"../opc/core\";\nimport type { CorePropertiesOptions } from \"../opc/core\";\n\nexport function applyCorePropertiesOverride(\n corePropsDoc: Element,\n overrides: Partial<CorePropertiesOptions>,\n): string {\n const rootEl = (corePropsDoc.elements?.find((e) => e.name === \"cp:coreProperties\") ??\n corePropsDoc) as Element;\n const existing = parseCorePropsElement(rootEl);\n const merged: CorePropertiesOptions = { ...existing, ...overrides };\n return buildCorePropertiesXmlString(merged);\n}\n"],"mappings":";;AAiDA,MAAM,YAAuE;CAC3E;EAAE,MAAM;EAAY,KAAK;CAAQ;CACjC;EAAE,MAAM;EAAc,KAAK;CAAU;CACrC;EAAE,MAAM;EAAc,KAAK;CAAU;CACrC;EAAE,MAAM;EAAkB,KAAK;CAAc;CAC7C;EAAE,MAAM;EAAe,KAAK;CAAW;CACvC;EAAE,MAAM;EAAqB,KAAK;CAAiB;CACnD;EAAE,MAAM;EAAkB,KAAK;CAAc;CAC7C;EAAE,MA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,eAAe,eAG7C,CAAC,CACjB,KAAK,MAAM,wBAAwB,EAAE,YAAY,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CACvE,QAAQ,KAAK,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,CAAC,IAAI;AAEvD;AAEA,MAAa,sBACX,eACA,IACA,MACA,QACA,eACuB;CACvB,MAAM,uBAAuB,sBAAsB,eAAe,eAAe;CACjF,qBAAqB,KAAK;EACxB,YAAY;GACV,IAAI,MAAM;GACV,QAAQ;GACR,YAAY;GACZ,MAAM;EACR;EACA,MAAM;EACN,MAAM;CACR,CAAC;CAED,OAAO;AACT;;;AC7BA,SAAgB,4BACd,cACA,WACQ;CAKR,OAAO,6BAA6B;EADI,GADvB,sBAFD,aAAa,UAAU,MAAM,MAAM,EAAE,SAAS,mBAAmB,KAC/E,YAEgD;EAAG,GAAG;CACpB,CAAM;AAC5C"}
1
+ {"version":3,"file":"patch-AkQY17CD.mjs","names":[],"sources":["../src/opc/core.ts","../src/patch/xml-namespace.ts","../src/patch/xml-patch-utils.ts","../src/patch/paragraph-split-inject.ts","../src/patch/paragraph-token-replacer.ts","../src/patch/run-renderer.ts","../src/patch/xml-traverser.ts","../src/patch/xml-replacer.ts","../src/patch/content-types-manager.ts","../src/patch/relationship-manager.ts","../src/patch/core-properties-override.ts"],"sourcesContent":["import { textOf, escapeXml } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\n/**\n * Core document properties (docProps/core.xml).\n *\n * Shared across docx/pptx/xlsx: each format's top-level Options extends this,\n * parse emits the same shape, and patch overrides it — read/write symmetry\n * (CONTRIBUTING §Property Naming). Field names follow the OPC core-properties\n * XSD element local names (`creator` = dc:creator, … — never `author`).\n */\nexport interface CorePropertiesOptions {\n title?: string;\n subject?: string;\n creator?: string;\n keywords?: string;\n description?: string;\n lastModifiedBy?: string;\n revision?: number;\n lastPrinted?: string;\n /**\n * Creation timestamp (W3CDTF), round-tripped from dcterms:created. null =\n * the source core.xml carried none — emit nothing; undefined (fresh) =\n * default to now.\n */\n created?: string | null;\n /** Last modified timestamp (W3CDTF); same null/undefined semantics as the created field. */\n modified?: string | null;\n /** Document category, round-tripped from cp:category. */\n category?: string;\n /** Document status (e.g. \"Draft\"), round-tripped from cp:contentStatus. */\n contentStatus?: string;\n /** Content type (e.g. \"Document\"), round-tripped from cp:contentType. */\n contentType?: string;\n /** Unique document identifier, round-tripped from dc:identifier. */\n identifier?: string;\n /** Document language (RFC 3066), round-tripped from dc:language. */\n language?: string;\n /** Document version number, round-tripped from cp:version. */\n version?: string;\n /**\n * Emit the core-properties vocabulary as the default namespace — the ISO\n * strict binding, where the source root is `<coreProperties xmlns=…>` and\n * cp:-prefixed children appear prefix-less (dc:/dcterms: keep their\n * prefixes). Round-trip only.\n */\n defaultNamespace?: true;\n}\n\nconst FIELD_MAP: Array<{ name: string; key: keyof CorePropertiesOptions }> = [\n { name: \"dc:title\", key: \"title\" },\n { name: \"dc:subject\", key: \"subject\" },\n { name: \"dc:creator\", key: \"creator\" },\n { name: \"dc:description\", key: \"description\" },\n { name: \"cp:keywords\", key: \"keywords\" },\n { name: \"cp:lastModifiedBy\", key: \"lastModifiedBy\" },\n { name: \"cp:lastPrinted\", key: \"lastPrinted\" },\n { name: \"dcterms:created\", key: \"created\" },\n { name: \"dcterms:modified\", key: \"modified\" },\n { name: \"cp:category\", key: \"category\" },\n { name: \"cp:contentStatus\", key: \"contentStatus\" },\n { name: \"cp:contentType\", key: \"contentType\" },\n { name: \"dc:identifier\", key: \"identifier\" },\n { name: \"dc:language\", key: \"language\" },\n { name: \"cp:version\", key: \"version\" },\n];\n\n/**\n * Parse core properties from an already-parsed XML element.\n * Shared by docx/pptx/xlsx to extract Dublin Core metadata into the unified\n * {@link CorePropertiesOptions} shape.\n */\nexport function parseCorePropsElement(el: Element | undefined): CorePropertiesOptions {\n if (!el) return {};\n\n const props: CorePropertiesOptions = {};\n // ISO/strict binds the core-properties namespace as the default — a\n // prefix-less root means stringify must re-emit that form.\n if (el.name === \"coreProperties\") props.defaultNamespace = true;\n\n for (const field of FIELD_MAP) {\n // ISO/strict files bind the core-properties namespace as the DEFAULT\n // namespace, so cp:/dcterms: children appear prefix-less — match by\n // local name too (field local names are unique across the map).\n const localName = field.name.slice(field.name.indexOf(\":\") + 1);\n const child = el.elements?.find(\n (e) => e.type === \"element\" && (e.name === field.name || e.name === localName),\n );\n // Presence-based: Word writes whitespace-only text (\"<dc:title>\\n</dc:title>\"),\n // which the XML parser reduces to an empty element — capture \"\" so the\n // field survives round-trip instead of being silently dropped.\n if (child) (props as Record<string, unknown>)[field.key] = textOf(child);\n }\n\n const revEl = el.elements?.find((e) => e.name === \"cp:revision\" || e.name === \"revision\");\n if (revEl) {\n const rev = textOf(revEl);\n if (rev) {\n const n = Number(rev);\n if (!Number.isNaN(n)) props.revision = n;\n }\n }\n\n // A parsed core part that carries no timestamps marks them explicitly\n // absent (null) — the emit path then omits them instead of defaulting to\n // now, which a fresh document (undefined) still does.\n if (props.created === undefined) props.created = null;\n if (props.modified === undefined) props.modified = null;\n\n return props;\n}\n\n/**\n * Build a cp:coreProperties XML string directly (fast path).\n *\n * Shared by pptx and xlsx to bypass the toXml() → xml() pipeline.\n * created/modified default to now when not supplied; all other fields emit\n * only when present.\n */\nexport function buildCorePropertiesXmlString(opts: CorePropertiesOptions): string {\n // ISO/strict round-trip: the core-properties namespace is the default, so\n // its children carry no prefix (dc:/dcterms: keep theirs).\n const cp = (name: string): string => (opts.defaultNamespace ? name : `cp:${name}`);\n const p: string[] = opts.defaultNamespace\n ? [\n '<coreProperties xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\">',\n ]\n : [\n '<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">',\n ];\n // Empty-string values are meaningful (element present, text empty) — only\n // undefined omits the element.\n if (opts.title !== undefined) p.push(`<dc:title>${escapeXml(opts.title)}</dc:title>`);\n if (opts.subject !== undefined) p.push(`<dc:subject>${escapeXml(opts.subject)}</dc:subject>`);\n if (opts.creator !== undefined) p.push(`<dc:creator>${escapeXml(opts.creator)}</dc:creator>`);\n if (opts.keywords !== undefined)\n p.push(`<${cp(\"keywords\")}>${escapeXml(opts.keywords)}</${cp(\"keywords\")}>`);\n if (opts.description !== undefined)\n p.push(`<dc:description>${escapeXml(opts.description)}</dc:description>`);\n if (opts.lastPrinted !== undefined)\n p.push(`<${cp(\"lastPrinted\")}>${escapeXml(opts.lastPrinted)}</${cp(\"lastPrinted\")}>`);\n if (opts.lastModifiedBy !== undefined)\n p.push(`<${cp(\"lastModifiedBy\")}>${escapeXml(opts.lastModifiedBy)}</${cp(\"lastModifiedBy\")}>`);\n if (opts.revision !== undefined)\n p.push(`<${cp(\"revision\")}>${opts.revision}</${cp(\"revision\")}>`);\n\n const now = new Date().toISOString();\n if (opts.created !== null)\n p.push(`<dcterms:created xsi:type=\"dcterms:W3CDTF\">${opts.created ?? now}</dcterms:created>`);\n if (opts.modified !== null)\n p.push(\n `<dcterms:modified xsi:type=\"dcterms:W3CDTF\">${opts.modified ?? now}</dcterms:modified>`,\n );\n // Trailing slots mirror Word's emission order (category last in real files).\n if (opts.category !== undefined)\n p.push(`<${cp(\"category\")}>${escapeXml(opts.category)}</${cp(\"category\")}>`);\n if (opts.contentStatus !== undefined)\n p.push(`<${cp(\"contentStatus\")}>${escapeXml(opts.contentStatus)}</${cp(\"contentStatus\")}>`);\n if (opts.contentType !== undefined)\n p.push(`<${cp(\"contentType\")}>${escapeXml(opts.contentType)}</${cp(\"contentType\")}>`);\n if (opts.identifier !== undefined)\n p.push(`<dc:identifier>${escapeXml(opts.identifier)}</dc:identifier>`);\n if (opts.language !== undefined) p.push(`<dc:language>${escapeXml(opts.language)}</dc:language>`);\n if (opts.version !== undefined)\n p.push(`<${cp(\"version\")}>${escapeXml(opts.version)}</${cp(\"version\")}>`);\n p.push(`</${cp(\"coreProperties\")}>`);\n return p.join(\"\");\n}\n","/**\n * Namespace configuration for XML patch operations.\n *\n * Parameterises element names so the same patch algorithm works for both\n * DOCX (`w:*`) and PPTX (`a:*`) documents.\n */\n\nexport interface XmlNamespaceOptions {\n paragraph: string;\n run: string;\n text: string;\n runProperties: string;\n}\n\nexport const DOCX_NS: XmlNamespaceOptions = {\n paragraph: \"w:p\",\n run: \"w:r\",\n text: \"w:t\",\n runProperties: \"w:rPr\",\n};\n\nexport const PPTX_NS: XmlNamespaceOptions = {\n paragraph: \"a:p\",\n run: \"a:r\",\n text: \"a:t\",\n runProperties: \"a:rPr\",\n};\n","/**\n * XML utility functions for patch operations.\n */\nimport { parse } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nexport const toJson = (xmlData: string): Element => {\n const xmlObj = parse(xmlData, {\n captureSpacesBetweenElements: true,\n compact: false,\n }) as Element;\n return xmlObj;\n};\n\n/**\n * Creates the inner content of a text element (`w:t` / `a:t`).\n *\n * Returns `[{ type: \"text\", text }]` for non-empty text, `[]` for empty.\n * The `xml:space` attribute is handled separately by `patchSpaceAttribute`.\n */\nexport const createTextElementContents = (text: string): Element[] =>\n text === \"\" ? [] : [{ text, type: \"text\" }];\n\nexport const patchSpaceAttribute = (element: Element): Element => ({\n ...element,\n attributes: {\n \"xml:space\": \"preserve\",\n },\n});\n\nexport const getFirstLevelElements = (relationships: Element, id: string): Element[] =>\n relationships.elements?.find((e) => e.name === id)?.elements ?? [];\n\n/**\n * Next sequential numeric id: the largest `attr` value among direct children\n * named `childName`, plus one. `seed` is the floor — e.g. PPTX `<p:sldId>`\n * values start at 255, so the first appended id is at least 256.\n *\n * Unifies the per-package `maxCommentId` / `maxSldId` / `maxSheetId` helpers.\n */\nexport const nextNumericId = (\n parent: Element | undefined,\n childName: string,\n attr: string,\n seed = 0,\n): number => {\n let maxId = seed;\n for (const child of parent?.elements ?? []) {\n if (child.name !== childName) continue;\n const id = Number(child.attributes?.[attr]);\n if (Number.isFinite(id)) maxId = Math.max(maxId, id);\n }\n return maxId + 1;\n};\n","/**\n * Paragraph split and inject utilities for run-level text replacement.\n *\n * Parameterised by `XmlNamespaceOptions` so it works for both DOCX and PPTX.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\nimport { patchSpaceAttribute } from \"./xml-patch-utils\";\n\nexport class TokenNotFoundError extends Error {\n public constructor(token: string) {\n super(`Token ${token} not found`);\n this.name = \"TokenNotFoundError\";\n }\n}\n\nexport function createSplitInject(\n ns: XmlNamespaceOptions,\n createTextElementContents: (text: string) => Element[],\n options?: { readonly preserveSpace?: boolean },\n) {\n const preserveSpace = options?.preserveSpace ?? true;\n const findRunElementIndexWithToken = (paragraphElement: Element, token: string): number => {\n for (const [i, element] of (paragraphElement.elements ?? []).entries()) {\n if (element.type === \"element\" && element.name === ns.run) {\n const textElement = (element.elements ?? []).filter(\n (e) => e.type === \"element\" && e.name === ns.text,\n );\n\n for (const text of textElement) {\n const firstChild = text.elements?.[0];\n if (!firstChild) {\n continue;\n }\n\n if ((firstChild.text as string).includes(token)) {\n return i;\n }\n }\n }\n }\n\n throw new TokenNotFoundError(token);\n };\n\n const splitRunElement = (\n runElement: Element,\n token: string,\n ): { readonly left: Element; readonly right: Element } => {\n let splitIndex = -1;\n\n const splitElements =\n runElement.elements\n ?.map((e, i) => {\n if (splitIndex !== -1) {\n return e;\n }\n\n if (e.type === \"element\" && e.name === ns.text) {\n const text = (e.elements?.[0]?.text as string) ?? \"\";\n const splitText = text.split(token);\n const newElements = splitText.map((t) => ({\n ...e,\n ...(preserveSpace ? patchSpaceAttribute(e) : {}),\n elements: createTextElementContents(t),\n }));\n\n if (splitText.length > 1) {\n splitIndex = i;\n }\n\n return newElements;\n } else {\n return e;\n }\n })\n .flat() ?? [];\n\n const leftRunElement: Element = {\n ...runElement,\n elements: splitElements.slice(0, splitIndex + 1),\n };\n\n const rightRunElement: Element = {\n ...runElement,\n elements: splitElements.slice(splitIndex + 1),\n };\n\n return { left: leftRunElement, right: rightRunElement };\n };\n\n return { findRunElementIndexWithToken, splitRunElement };\n}\n","/**\n * Paragraph token replacer for substituting text within paragraph runs.\n *\n * Fully generic — operates on Element nodes without namespace-specific logic.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { RenderedParagraphNode } from \"./run-renderer\";\nimport { patchSpaceAttribute } from \"./xml-patch-utils\";\n\nconst ReplaceMode = {\n START: 0,\n MIDDLE: 1,\n END: 2,\n} as const;\n\nexport function createTokenReplacer(\n createTextElementContents: (text: string) => Element[],\n options?: { readonly preserveSpace?: boolean },\n) {\n const preserveSpace = options?.preserveSpace ?? true;\n\n const patchTextElement = (element: Element, text: string): Element => {\n element.elements = createTextElementContents(text);\n return element;\n };\n\n return ({\n paragraphElement,\n renderedParagraph,\n originalText,\n replacementText,\n }: {\n paragraphElement: Element;\n renderedParagraph: RenderedParagraphNode;\n originalText: string;\n replacementText: string;\n }): Element => {\n const startIndex = renderedParagraph.text.indexOf(originalText);\n const endIndex = startIndex + originalText.length - 1;\n\n let replaceMode: (typeof ReplaceMode)[keyof typeof ReplaceMode] = ReplaceMode.START;\n\n for (const run of renderedParagraph.runs) {\n const runChildren = paragraphElement.elements?.[run.index]?.elements;\n if (!runChildren) continue;\n for (const { text, index, start, end } of run.parts) {\n const partElement = runChildren[index];\n if (!partElement) continue;\n switch (replaceMode) {\n case ReplaceMode.START: {\n if (startIndex >= start && startIndex <= end) {\n const offsetStartIndex = startIndex - start;\n const offsetEndIndex = Math.min(endIndex, end) - start;\n const partToReplace = text.substring(offsetStartIndex, offsetEndIndex + 1);\n if (partToReplace === \"\") {\n continue;\n }\n\n const firstPart = text.replace(partToReplace, replacementText);\n patchTextElement(partElement, firstPart);\n replaceMode = ReplaceMode.MIDDLE;\n continue;\n }\n break;\n }\n case ReplaceMode.MIDDLE: {\n if (endIndex <= end) {\n const lastPart = text.substring(endIndex - start + 1);\n patchTextElement(partElement, lastPart);\n runChildren[index] = preserveSpace ? patchSpaceAttribute(partElement) : partElement;\n replaceMode = ReplaceMode.END;\n } else {\n patchTextElement(partElement, \"\");\n }\n break;\n }\n }\n }\n }\n\n return paragraphElement;\n };\n}\n","/**\n * Run renderer for extracting text content from OOXML paragraph structures.\n *\n * Parameterised by `XmlNamespaceOptions` so it works for both DOCX and PPTX.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\n\nexport interface ElementWrapper {\n element: Element;\n index: number;\n parent: ElementWrapper | undefined;\n}\n\nexport interface RenderedParagraphNode {\n text: string;\n runs: readonly RenderedRunNode[];\n index: number;\n pathToParagraph: readonly number[];\n}\n\ninterface StartAndEnd {\n start: number;\n end: number;\n}\n\ntype IParts = {\n text: string;\n index: number;\n} & StartAndEnd;\n\nexport type RenderedRunNode = {\n text: string;\n parts: readonly IParts[];\n index: number;\n} & StartAndEnd;\n\nexport function createRunRenderer(ns: XmlNamespaceOptions) {\n const renderParagraphNode = (node: ElementWrapper): RenderedParagraphNode => {\n if (node.element.name !== ns.paragraph) {\n throw new Error(`Invalid node type: ${node.element.name}`);\n }\n\n if (!node.element.elements) {\n return {\n index: -1,\n pathToParagraph: [],\n runs: [],\n text: \"\",\n };\n }\n\n let currentRunStringLength = 0;\n\n const runs: RenderedRunNode[] = [];\n for (const [i, element] of node.element.elements.entries()) {\n if (element.name === ns.run) {\n const renderedRunNode = renderRunNode(element, i, currentRunStringLength);\n currentRunStringLength += renderedRunNode.text.length;\n runs.push(renderedRunNode);\n }\n }\n\n const text = runs.reduce((acc, curr) => acc + curr.text, \"\");\n\n return {\n index: node.index,\n pathToParagraph: buildNodePath(node),\n runs,\n text,\n };\n };\n\n const renderRunNode = (\n node: Element,\n index: number,\n currentRunStringIndex: number,\n ): RenderedRunNode => {\n if (!node.elements) {\n return {\n end: currentRunStringIndex,\n index: -1,\n parts: [],\n start: currentRunStringIndex,\n text: \"\",\n };\n }\n\n let currentTextStringIndex = currentRunStringIndex;\n\n const parts: IParts[] = [];\n for (const [i, element] of node.elements.entries()) {\n if (element.name !== ns.text) continue;\n const textChildren = element.elements;\n if (!textChildren || textChildren.length === 0) continue;\n const firstChild = textChildren[0];\n if (!firstChild) continue;\n const text = firstChild.text ?? \"\";\n const textStr = String(text);\n const partStart = currentTextStringIndex;\n currentTextStringIndex += textStr.length;\n parts.push({ end: currentTextStringIndex - 1, index: i, start: partStart, text: textStr });\n }\n\n const text = parts.reduce((acc, curr) => acc + curr.text, \"\");\n\n return {\n end: currentTextStringIndex - 1,\n index,\n parts,\n start: currentRunStringIndex,\n text,\n };\n };\n\n return renderParagraphNode;\n}\n\nconst buildNodePath = (node: ElementWrapper): readonly number[] => {\n const path: number[] = [];\n let current: ElementWrapper | undefined = node;\n while (current) {\n path.push(current.index);\n current = current.parent;\n }\n path.reverse();\n return path;\n};\n","/**\n * XML traverser for searching paragraph content in OOXML documents.\n *\n * Parameterised by `XmlNamespaceOptions` so it works for both DOCX and PPTX.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { createRunRenderer, type ElementWrapper, type RenderedParagraphNode } from \"./run-renderer\";\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\n\nexport function createTraverser(ns: XmlNamespaceOptions) {\n const renderParagraphNode = createRunRenderer(ns);\n\n const traverse = (node: Element): readonly RenderedParagraphNode[] => {\n const renderedParagraphs: RenderedParagraphNode[] = [];\n const queue: ElementWrapper[] = [];\n\n // Seed with root as virtual wrapper so paths include the root level\n const rootChildren = node.elements;\n if (rootChildren) {\n const root: ElementWrapper = { element: node, index: 0, parent: undefined };\n for (const [i, child] of rootChildren.entries()) {\n queue.push({ element: child, index: i, parent: root });\n }\n }\n\n let qi = 0;\n while (qi < queue.length) {\n const current = queue[qi++];\n if (!current) break;\n\n if (current.element.name === ns.paragraph) {\n renderedParagraphs.push(renderParagraphNode(current));\n }\n\n const children = current.element.elements;\n if (children) {\n for (const [i, child] of children.entries()) {\n queue.push({ element: child, index: i, parent: current });\n }\n }\n }\n\n return renderedParagraphs;\n };\n\n const findLocationOfText = (node: Element, text: string): readonly RenderedParagraphNode[] =>\n traverse(node).filter((p) => p.text.includes(text));\n\n return { traverse, findLocationOfText };\n}\n","/**\n * Parameterised XML replacer for placeholder substitution in OOXML documents.\n *\n * Accepts namespace config and a format callback so both DOCX and PPTX can\n * use the same replacement algorithm.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { createSplitInject } from \"./paragraph-split-inject\";\nimport { createTokenReplacer } from \"./paragraph-token-replacer\";\nimport type { XmlNamespaceOptions } from \"./xml-namespace\";\nimport { createTextElementContents } from \"./xml-patch-utils\";\nimport { createTraverser } from \"./xml-traverser\";\n\nexport interface ReplacerOptions {\n ns: XmlNamespaceOptions;\n formatChild: (child: unknown, context: unknown) => Element[];\n preserveSpace?: boolean;\n}\n\ninterface ReplacerResult {\n element: Element;\n didFindOccurrence: boolean;\n}\n\nconst SPLIT_TOKEN = \"\\u0275\";\n\nexport function createReplacer(config: ReplacerOptions) {\n const { ns, formatChild } = config;\n const { findLocationOfText } = createTraverser(ns);\n\n const replaceTokenInParagraphElement = createTokenReplacer(createTextElementContents, {\n preserveSpace: config.preserveSpace,\n });\n const { findRunElementIndexWithToken, splitRunElement } = createSplitInject(\n ns,\n createTextElementContents,\n { preserveSpace: config.preserveSpace },\n );\n\n const replacer = ({\n json,\n patch,\n patchText,\n context,\n keepOriginalStyles = true,\n }: {\n json: Element;\n patch: {\n type: string;\n children: readonly unknown[];\n };\n patchText: string;\n context: unknown;\n keepOriginalStyles?: boolean;\n }): ReplacerResult => {\n const renderedParagraphs = findLocationOfText(json, patchText);\n\n if (renderedParagraphs.length === 0) {\n return { didFindOccurrence: false, element: json };\n }\n\n for (const renderedParagraph of renderedParagraphs) {\n const textJson = patch.children.flatMap((c) => formatChild(c, context));\n\n switch (patch.type) {\n case \"document\": {\n const parentElement = goToParentElementFromPath(json, renderedParagraph.pathToParagraph);\n const elementIndex = getLastElementIndexFromPath(renderedParagraph.pathToParagraph);\n parentElement.elements!.splice(elementIndex, 1, ...textJson);\n break;\n }\n case \"paragraph\":\n default: {\n const paragraphElement = goToElementFromPath(json, renderedParagraph.pathToParagraph);\n replaceTokenInParagraphElement({\n originalText: patchText,\n paragraphElement,\n renderedParagraph,\n replacementText: SPLIT_TOKEN,\n });\n\n const index = findRunElementIndexWithToken(paragraphElement, SPLIT_TOKEN);\n\n const runElementToBeReplaced = paragraphElement.elements![index];\n if (!runElementToBeReplaced) break;\n const { left, right } = splitRunElement(runElementToBeReplaced, SPLIT_TOKEN);\n\n let newRunElements = textJson;\n let patchedRightElement = right;\n\n if (keepOriginalStyles) {\n const runElementNonTextualElements = runElementToBeReplaced.elements!.filter(\n (e) => e.type === \"element\" && e.name === ns.runProperties,\n );\n\n newRunElements = textJson.map((e) => {\n if (\n e.type !== \"element\" ||\n e.name !== ns.run ||\n e.elements?.some((c) => c.type === \"element\" && c.name === ns.runProperties)\n ) {\n return e;\n }\n return {\n ...e,\n elements: [...runElementNonTextualElements, ...(e.elements ?? [])],\n };\n });\n\n patchedRightElement = {\n ...right,\n elements: [...runElementNonTextualElements, ...right.elements!],\n };\n }\n\n paragraphElement.elements!.splice(index, 1, left, ...newRunElements, patchedRightElement);\n break;\n }\n }\n }\n\n return { didFindOccurrence: true, element: json };\n };\n\n return replacer;\n}\n\nconst goToElementFromPath = (json: Element, path: readonly number[]): Element => {\n let element = json;\n for (let i = 1; i < path.length; i++) {\n const index = path[i];\n if (index === undefined) break;\n const nextElements = element.elements!;\n const next = nextElements[index];\n if (!next) break;\n element = next;\n }\n return element;\n};\n\nconst goToParentElementFromPath = (json: Element, path: readonly number[]): Element =>\n goToElementFromPath(json, path.slice(0, -1));\n\n// pathToParagraph is built by the renderer and always non-empty; the `!` is a contract narrow.\nconst getLastElementIndexFromPath = (path: readonly number[]): number => path[path.length - 1]!;\n","/**\n * Content types manager for OOXML [Content_Types].xml management.\n */\nimport type { Element } from \"@office-open/xml\";\n\n/**\n * The `<Types>` child array, initialized in place when absent (so a `<Default>`\n * or `<Override>` can always be appended). Returns `undefined` if `element` has\n * no `<Types>` child (malformed `[Content_Types].xml`).\n */\nconst typesChildren = (element: Element): Element[] | undefined => {\n const types = element.elements?.find((e) => e.name === \"Types\");\n if (!types) return undefined;\n return types.elements ?? (types.elements = []);\n};\n\nexport const appendContentType = (\n element: Element,\n contentType: string,\n extension: string,\n): void => {\n const els = typesChildren(element);\n if (!els) return;\n\n // OPC Default Extension matching is case-insensitive (ECMA-376-2 §10.1.2):\n // an existing `JPG` must block a colliding `jpg`, or Word rejects the package.\n const exist = els.some(\n (el) =>\n el.type === \"element\" &&\n el.name === \"Default\" &&\n String(el?.attributes?.Extension ?? \"\").toLowerCase() === extension.toLowerCase(),\n );\n if (exist) {\n return;\n }\n\n els.push({\n attributes: {\n ContentType: contentType,\n Extension: extension,\n },\n name: \"Default\",\n type: \"element\",\n });\n};\n\n/**\n * Append an `<Override>` element to a `[Content_Types].xml` root, deduped by\n * `PartName`. Sibling to {@link appendContentType} (which handles `<Default>`):\n * unifies the per-package Override-dedup blocks in docx/pptx/xlsx patchers.\n */\nexport const appendOverride = (element: Element, partName: string, contentType: string): void => {\n const els = typesChildren(element);\n if (!els) return;\n\n // OPC Override PartName matching is case-insensitive (ECMA-376-2 §10.1.4).\n const exists = els.some(\n (el) =>\n el.type === \"element\" &&\n el.name === \"Override\" &&\n String(el?.attributes?.PartName ?? \"\").toLowerCase() === partName.toLowerCase(),\n );\n if (exists) return;\n\n els.push({\n attributes: {\n PartName: partName,\n ContentType: contentType,\n },\n name: \"Override\",\n type: \"element\",\n });\n};\n\n/**\n * Remove an `<Override>` from a `[Content_Types].xml` root by `PartName`\n * (case-insensitive). Sibling to {@link appendOverride} for patch paths that\n * drop a part from the package.\n */\nexport const removeOverride = (element: Element, partName: string): void => {\n const els = typesChildren(element);\n if (!els) return;\n\n const kept = els.filter(\n (el) =>\n !(\n el.type === \"element\" &&\n el.name === \"Override\" &&\n String(el?.attributes?.PartName ?? \"\").toLowerCase() === partName.toLowerCase()\n ),\n );\n if (kept.length !== els.length) {\n element.elements!.find((e) => e.name === \"Types\")!.elements = kept;\n }\n};\n","/**\n * Relationship manager for OOXML .rels file management.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { getFirstLevelElements } from \"./xml-patch-utils\";\n\nconst getIdFromRelationshipId = (relationshipId: string): number => {\n const output = parseInt(relationshipId.substring(3), 10);\n return isNaN(output) ? 0 : output;\n};\n\nexport const getNextRelationshipIndex = (relationships: Element): number => {\n const relationshipElements = getFirstLevelElements(relationships, \"Relationships\");\n\n return (\n relationshipElements\n .map((e) => getIdFromRelationshipId(e.attributes?.Id?.toString() ?? \"\"))\n .reduce((acc, curr) => Math.max(acc, curr), 0) + 1\n );\n};\n\nexport const appendRelationship = (\n relationships: Element,\n id: number | string,\n type: string,\n target: string,\n targetMode?: string,\n): readonly Element[] => {\n const relationshipElements = getFirstLevelElements(relationships, \"Relationships\");\n relationshipElements.push({\n attributes: {\n Id: `rId${id}`,\n Target: target,\n TargetMode: targetMode,\n Type: type,\n },\n name: \"Relationship\",\n type: \"element\",\n });\n\n return relationshipElements;\n};\n","/**\n * Merge core-properties overrides onto an existing docProps/core.xml document.\n *\n * The patch layer unzips docProps/core.xml into an parse document structure\n * (its `.elements` holds the `cp:coreProperties` root). This helper parses the\n * existing values, layers `overrides` on top (override wins), and returns the\n * re-serialized XML — without the XML declaration, which the caller prepends.\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport { buildCorePropertiesXmlString, parseCorePropsElement } from \"../opc/core\";\nimport type { CorePropertiesOptions } from \"../opc/core\";\n\nexport function applyCorePropertiesOverride(\n corePropsDoc: Element,\n overrides: Partial<CorePropertiesOptions>,\n): string {\n const rootEl = (corePropsDoc.elements?.find((e) => e.name === \"cp:coreProperties\") ??\n corePropsDoc) as Element;\n const existing = parseCorePropsElement(rootEl);\n const merged: CorePropertiesOptions = { ...existing, ...overrides };\n return buildCorePropertiesXmlString(merged);\n}\n"],"mappings":";;AAiDA,MAAM,YAAuE;CAC3E;EAAE,MAAM;EAAY,KAAK;CAAQ;CACjC;EAAE,MAAM;EAAc,KAAK;CAAU;CACrC;EAAE,MAAM;EAAc,KAAK;CAAU;CACrC;EAAE,MAAM;EAAkB,KAAK;CAAc;CAC7C;EAAE,MAAM;EAAe,KAAK;CAAW;CACvC;EAAE,MAAM;EAAqB,KAAK;CAAiB;CACnD;EAAE,MAAM;EAAkB,KAAK;CAAc;CAC7C;EAAE,MAAM;EAAmB,KAAK;CAAU;CAC1C;EAAE,MAAM;EAAoB,KAAK;CAAW;CAC5C;EAAE,MAAM;EAAe,KAAK;CAAW;CACvC;EAAE,MAAM;EAAoB,KAAK;CAAgB;CACjD;EAAE,MAAM;EAAkB,KAAK;CAAc;CAC7C;EAAE,MAAM;EAAiB,KAAK;CAAa;CAC3C;EAAE,MAAM;EAAe,KAAK;CAAW;CACvC;EAAE,MAAM;EAAc,KAAK;CAAU;AACvC;;;;;;AAOA,SAAgB,sBAAsB,IAAgD;CACpF,IAAI,CAAC,IAAI,OAAO,CAAC;CAEjB,MAAM,QAA+B,CAAC;CAGtC,IAAI,GAAG,SAAS,kBAAkB,MAAM,mBAAmB;CAE3D,KAAK,MAAM,SAAS,WAAW;EAI7B,MAAM,YAAY,MAAM,KAAK,MAAM,MAAM,KAAK,QAAQ,GAAG,IAAI,CAAC;EAC9D,MAAM,QAAQ,GAAG,UAAU,MACxB,MAAM,EAAE,SAAS,cAAc,EAAE,SAAS,MAAM,QAAQ,EAAE,SAAS,UACtE;EAIA,IAAI,OAAO,MAAmC,MAAM,OAAO,OAAO,KAAK;CACzE;CAEA,M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AOA,MAAa,kBAAkB,SAAkB,aAA2B;CAC1E,MAAM,MAAM,cAAc,OAAO;CACjC,IAAI,CAAC,KAAK;CAEV,MAAM,OAAO,IAAI,QACd,OACC,EACE,GAAG,SAAS,aACZ,GAAG,SAAS,cACZ,OAAO,IAAI,YAAY,YAAY,EAAE,CAAC,CAAC,YAAY,MAAM,SAAS,YAAY,EAEpF;CACA,IAAI,KAAK,WAAW,IAAI,QACtB,QAAQ,SAAU,MAAM,MAAM,EAAE,SAAS,OAAO,CAAC,CAAE,WAAW;AAElE;;;ACvFA,MAAM,2BAA2B,mBAAmC;CAClE,MAAM,SAAS,SAAS,eAAe,UAAU,CAAC,GAAG,EAAE;CACvD,OAAO,MAAM,MAAM,IAAI,IAAI;AAC7B;AAEA,MAAa,4BAA4B,kBAAmC;CAG1E,OAF6B,sBAAsB,eAAe,eAG7C,CAAC,CACjB,KAAK,MAAM,wBAAwB,EAAE,YAAY,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CACvE,QAAQ,KAAK,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,CAAC,IAAI;AAEvD;AAEA,MAAa,sBACX,eACA,IACA,MACA,QACA,eACuB;CACvB,MAAM,uBAAuB,sBAAsB,eAAe,eAAe;CACjF,qBAAqB,KAAK;EACxB,YAAY;GACV,IAAI,MAAM;GACV,QAAQ;GACR,YAAY;GACZ,MAAM;EACR;EACA,MAAM;EACN,MAAM;CACR,CAAC;CAED,OAAO;AACT;;;AC7BA,SAAgB,4BACd,cACA,WACQ;CAKR,OAAO,6BAA6B;EADI,GADvB,sBAFD,aAAa,UAAU,MAAM,MAAM,EAAE,SAAS,mBAAmB,KAC/E,YAEgD;EAAG,GAAG;CACpB,CAAM;AAC5C"}
@@ -1,2 +1,2 @@
1
- import { $ as stringifyConnection, A as LayoutNodeChild, B as parseLayoutDefinition, C as ConstraintOptions, D as DiagramIterationOptions, E as DiagramDirection, F as ResizeHandles, G as ModelConnectionOptions, H as stringifyLayoutDefinitionPart, I as SampleDataOptions, J as stringifyDataModel, K as ModelPointOptions, L as VariableListOptions, M as LayoutRuleOptions, N as LayoutShapeOptions, O as ForEachOptions, P as OtherwiseOptions, Q as stringifyTransPoint, R as WhenOptions, S as ConstraintOperator, T as ConstraintType, U as withDiagramNamespaces, V as stringifyLayoutDefinition, W as DataModelOptions, X as PointPropertySetOptions, Y as stringifyDataModelOptions, Z as stringifyPoint, _ as AlgorithmType, a as SmartArtRawParts, at as DEFAULT_DRAWING_XML, b as ConditionFunction, c as StyleLabelOptions, ct as getStyleXml, d as stringifyStyleDefinition, dt as STYLE_CATEGORIES, et as ColorDefinitionOptions, f as stringifyStyleDefinitionPart, g as AlgorithmParameterType, h as AlgorithmParameterOptions, i as SmartArtData, it as stringifyColorDefinitionPart, j as LayoutNodeOptions, k as LayoutDefinitionOptions, l as TextProperties3DOptions, lt as COLOR_CATEGORIES, m as AlgorithmOptions, n as createDataModel, nt as parseColorDefinition, o as definitionId, ot as getColorXml, p as styleDefDesc, q as parseDataModelOptions, r as SmartArtCollection, rt as stringifyColorDefinition, s as StyleDefinitionOptions, st as getLayoutXml, t as TreeNode, tt as colorsDefDesc, u as parseStyleDefinition, ut as LAYOUT_CATEGORIES, v as ChildOrder, w as ConstraintRelationship, x as ConditionOperator, y as ChooseOptions, z as layoutDefDesc } from "../index-DRggxtp7.mjs";
1
+ import { $ as stringifyConnection, A as LayoutNodeChild, B as parseLayoutDefinition, C as ConstraintOptions, D as DiagramIterationOptions, E as DiagramDirection, F as ResizeHandles, G as ModelConnectionOptions, H as stringifyLayoutDefinitionPart, I as SampleDataOptions, J as stringifyDataModel, K as ModelPointOptions, L as VariableListOptions, M as LayoutRuleOptions, N as LayoutShapeOptions, O as ForEachOptions, P as OtherwiseOptions, Q as stringifyTransPoint, R as WhenOptions, S as ConstraintOperator, T as ConstraintType, U as withDiagramNamespaces, V as stringifyLayoutDefinition, W as DataModelOptions, X as PointPropertySetOptions, Y as stringifyDataModelOptions, Z as stringifyPoint, _ as AlgorithmType, a as SmartArtRawParts, at as DEFAULT_DRAWING_XML, b as ConditionFunction, c as StyleLabelOptions, ct as getStyleXml, d as stringifyStyleDefinition, dt as STYLE_CATEGORIES, et as ColorDefinitionOptions, f as stringifyStyleDefinitionPart, g as AlgorithmParameterType, h as AlgorithmParameterOptions, i as SmartArtData, it as stringifyColorDefinitionPart, j as LayoutNodeOptions, k as LayoutDefinitionOptions, l as TextProperties3DOptions, lt as COLOR_CATEGORIES, m as AlgorithmOptions, n as createDataModel, nt as parseColorDefinition, o as definitionId, ot as getColorXml, p as styleDefDesc, q as parseDataModelOptions, r as SmartArtCollection, rt as stringifyColorDefinition, s as StyleDefinitionOptions, st as getLayoutXml, t as TreeNode, tt as colorsDefDesc, u as parseStyleDefinition, ut as LAYOUT_CATEGORIES, v as ChildOrder, w as ConstraintRelationship, x as ConditionOperator, y as ChooseOptions, z as layoutDefDesc } from "../index-6_MYd0cg.mjs";
2
2
  export { AlgorithmOptions, AlgorithmParameterOptions, AlgorithmParameterType, AlgorithmType, COLOR_CATEGORIES, ChildOrder, ChooseOptions, ColorDefinitionOptions, ConditionFunction, ConditionOperator, ConstraintOperator, ConstraintOptions, ConstraintRelationship, ConstraintType, DEFAULT_DRAWING_XML, DataModelOptions, DiagramDirection, DiagramIterationOptions, ForEachOptions, LAYOUT_CATEGORIES, LayoutDefinitionOptions, LayoutNodeChild, LayoutNodeOptions, LayoutRuleOptions, LayoutShapeOptions, ModelConnectionOptions, ModelPointOptions, OtherwiseOptions, PointPropertySetOptions, ResizeHandles, STYLE_CATEGORIES, SampleDataOptions, SmartArtCollection, SmartArtData, SmartArtRawParts, StyleDefinitionOptions, StyleLabelOptions, TextProperties3DOptions, TreeNode, VariableListOptions, WhenOptions, colorsDefDesc, createDataModel, definitionId, getColorXml, getLayoutXml, getStyleXml, layoutDefDesc, parseColorDefinition, parseDataModelOptions, parseLayoutDefinition, parseStyleDefinition, stringifyColorDefinition, stringifyColorDefinitionPart, stringifyConnection, stringifyDataModel, stringifyDataModelOptions, stringifyLayoutDefinition, stringifyLayoutDefinitionPart, stringifyPoint, stringifyStyleDefinition, stringifyStyleDefinitionPart, stringifyTransPoint, styleDefDesc, withDiagramNamespaces };
@@ -1,2 +1,2 @@
1
- import { C as stringifyDataModelOptions, D as COLOR_CATEGORIES, E as stringifyConnection, O as LAYOUT_CATEGORIES, S as stringifyDataModel, T as stringifyTransPoint, _ as parseLayoutDefinition, a as getColorXml, b as withDiagramNamespaces, c as parseStyleDefinition, d as styleDefDesc, f as colorsDefDesc, g as layoutDefDesc, h as stringifyColorDefinitionPart, i as DEFAULT_DRAWING_XML, k as STYLE_CATEGORIES, l as stringifyStyleDefinition, m as stringifyColorDefinition, n as SmartArtCollection, o as getLayoutXml, p as parseColorDefinition, r as definitionId, s as getStyleXml, t as createDataModel, u as stringifyStyleDefinitionPart, v as stringifyLayoutDefinition, w as stringifyPoint, x as parseDataModelOptions, y as stringifyLayoutDefinitionPart } from "../smartart-YH87Emca.mjs";
1
+ import { C as stringifyDataModelOptions, D as COLOR_CATEGORIES, E as stringifyConnection, O as LAYOUT_CATEGORIES, S as stringifyDataModel, T as stringifyTransPoint, _ as parseLayoutDefinition, a as getColorXml, b as withDiagramNamespaces, c as parseStyleDefinition, d as styleDefDesc, f as colorsDefDesc, g as layoutDefDesc, h as stringifyColorDefinitionPart, i as DEFAULT_DRAWING_XML, k as STYLE_CATEGORIES, l as stringifyStyleDefinition, m as stringifyColorDefinition, n as SmartArtCollection, o as getLayoutXml, p as parseColorDefinition, r as definitionId, s as getStyleXml, t as createDataModel, u as stringifyStyleDefinitionPart, v as stringifyLayoutDefinition, w as stringifyPoint, x as parseDataModelOptions, y as stringifyLayoutDefinitionPart } from "../smartart-D-8KBdQ_.mjs";
2
2
  export { COLOR_CATEGORIES, DEFAULT_DRAWING_XML, LAYOUT_CATEGORIES, STYLE_CATEGORIES, SmartArtCollection, colorsDefDesc, createDataModel, definitionId, getColorXml, getLayoutXml, getStyleXml, layoutDefDesc, parseColorDefinition, parseDataModelOptions, parseLayoutDefinition, parseStyleDefinition, stringifyColorDefinition, stringifyColorDefinitionPart, stringifyConnection, stringifyDataModel, stringifyDataModelOptions, stringifyLayoutDefinition, stringifyLayoutDefinitionPart, stringifyPoint, stringifyStyleDefinition, stringifyStyleDefinitionPart, stringifyTransPoint, styleDefDesc, withDiagramNamespaces };
@@ -1,6 +1,6 @@
1
- import { $ as xsdDiagramDirection, L as xsdAnimLevel, Zt as parseOnOff, rt as xsdHierBranch, xt as xsdResizeHandles } from "./ext-uri-BHBcIrW7.mjs";
2
- import { En as shape3DDesc, Ln as parseColorList, On as createColorList, Tn as scene3DDesc } from "./drawing-BVwCkNXB.mjs";
3
- import { i as stringifyShapeStyle, n as parseShapeStyle } from "./style-matrix-DjhMuuQg.mjs";
1
+ import { I as xsdAnimLevel, Jt as parseOnOff, Z as xsdDiagramDirection, tt as xsdHierBranch, vt as xsdResizeHandles } from "./ext-uri-BR1ouCh3.mjs";
2
+ import { En as shape3DDesc, Ln as parseColorList, On as createColorList, Tn as scene3DDesc } from "./drawing-DJ363Awy.mjs";
3
+ import { i as stringifyShapeStyle, n as parseShapeStyle } from "./style-matrix-B6YSVw6a.mjs";
4
4
  import { OOXML_XML_DECLARATION, attr, attrBool, attrNum, attrs, escapeXml, findChild, stringify } from "@office-open/xml";
5
5
  //#region src/smartart/categories.ts
6
6
  /** Layout ID → OOXML category type */
@@ -1651,4 +1651,4 @@ const createDataModel = (nodes, layout = "default", style = "simple1", color = "
1651
1651
  //#endregion
1652
1652
  export { stringifyDataModelOptions as C, COLOR_CATEGORIES as D, stringifyConnection as E, LAYOUT_CATEGORIES as O, stringifyDataModel as S, stringifyTransPoint as T, parseLayoutDefinition as _, getColorXml as a, withDiagramNamespaces as b, parseStyleDefinition as c, styleDefDesc as d, colorsDefDesc as f, layoutDefDesc as g, stringifyColorDefinitionPart as h, DEFAULT_DRAWING_XML as i, STYLE_CATEGORIES as k, stringifyStyleDefinition as l, stringifyColorDefinition as m, SmartArtCollection as n, getLayoutXml as o, parseColorDefinition as p, definitionId as r, getStyleXml as s, createDataModel as t, stringifyStyleDefinitionPart as u, stringifyLayoutDefinition as v, stringifyPoint as w, parseDataModelOptions as x, stringifyLayoutDefinitionPart as y };
1653
1653
 
1654
- //# sourceMappingURL=smartart-YH87Emca.mjs.map
1654
+ //# sourceMappingURL=smartart-D-8KBdQ_.mjs.map