@office-open/docx 0.6.6 → 0.6.7
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 +12 -12
- package/dist/{index.d.ts → index.d.mts} +2 -1
- package/dist/index.d.mts.map +1 -0
- package/dist/{index.js → index.mjs} +576 -607
- package/dist/index.mjs.map +1 -0
- package/package.json +7 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- /package/dist/{chunk-DJOrGtkp.js → chunk-090QGkrx.mjs} +0 -0
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["XmlAttributeComponent","BuilderElement","stringValObj","onOffObj","numberValObj","hpsMeasureObj","stringEnumValObj","uniqueNumericIdCreator","HYPERLINK_RELATIONSHIP_TYPE","md","createWrapPolygon","Math","Math","MathCls","FootnoteRefCls","EndnoteRefCls","PageBreakCls","ColumnBreakCls","Footer","Footer","Header","Header","NumberFormat","encoder","Formatter","_parseSectionChildren","findDeep"],"sources":["../src/file/xml-components/base.ts","../src/file/xml-components/attributes.ts","../src/file/xml-components/simple-elements.ts","../src/file/xml-components/index.ts","../src/file/paragraph/formatting/alignment.ts","../src/util/values.ts","../src/file/border/border.ts","../src/file/border/index.ts","../src/file/paragraph/formatting/border.ts","../src/file/paragraph/formatting/cnf-style.ts","../src/file/paragraph/formatting/indent.ts","../src/file/paragraph/run/break.ts","../src/file/paragraph/run/form-field.ts","../src/file/paragraph/run/field.ts","../src/file/paragraph/run/page-number.ts","../src/file/shading/shading.ts","../src/file/shading/index.ts","../src/file/track-revision/track-revision-components/deletion-track-change.ts","../src/file/track-revision/track-revision-components/insertion-track-change.ts","../src/file/paragraph/run/east-asian-layout.ts","../src/file/paragraph/run/emphasis-mark.ts","../src/file/paragraph/run/formatting.ts","../src/file/paragraph/run/language.ts","../src/file/paragraph/run/run-fonts.ts","../src/file/paragraph/run/underline.ts","../src/file/paragraph/run/properties.ts","../src/file/shared/alignment.ts","../src/file/shared/number-format.ts","../src/file/shared/space-type.ts","../src/file/shared/index.ts","../src/file/paragraph/run/run-components/text.ts","../src/file/paragraph/run/run.ts","../src/file/paragraph/run/text-run.ts","../src/file/paragraph/run/run-components/symbol.ts","../src/file/paragraph/run/symbol-run.ts","../src/util/convenience-functions.ts","../src/file/drawing/floating/floating-position.ts","../src/file/drawing/floating/simple-pos.ts","../src/file/drawing/floating/align.ts","../src/file/drawing/floating/position-offset.ts","../src/file/drawing/floating/horizontal-position.ts","../src/file/drawing/floating/vertical-position.ts","../src/file/drawing/floating/index.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/custom-geometry/custom-geometry.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/effect-dag.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/effect-list.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/three-d/scene-3d.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/three-d/shape-3d.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts","../src/file/drawing/inline/graphic/graphic-data/wps/body-properties.ts","../src/file/drawing/inline/graphic/graphic-data/wps/non-visual-shape-properties.ts","../src/file/drawing/inline/graphic/graphic-data/wps/text-box-content.ts","../src/file/drawing/inline/graphic/graphic-data/wps/wps-text-box.ts","../src/file/drawing/inline/graphic/graphic-data/wps/wps-shape.ts","../src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts","../src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/child-non-visual-pic-properties/child-non-visual-pic-properties.ts","../src/file/drawing/doc-properties/doc-properties-children.ts","../src/file/paragraph/links/hyperlink.ts","../src/file/relationships/relationship/relationship.ts","../src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties.ts","../src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-pic-properties.ts","../src/file/drawing/inline/graphic/graphic-data/pic/pic.ts","../src/file/drawing/inline/graphic/graphic-data/pic/index.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts","../src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts","../src/file/drawing/inline/graphic/graphic-data/wpg/wpg-group.ts","../src/file/drawing/inline/graphic/graphic-data/graphic-data.ts","../src/file/drawing/inline/graphic/graphic-data/index.ts","../src/file/drawing/inline/graphic/graphic.ts","../src/file/drawing/inline/graphic/index.ts","../src/file/drawing/text-wrap/text-wrapping.ts","../src/file/drawing/text-wrap/wrap-none.ts","../src/file/drawing/text-wrap/wrap-square.ts","../src/file/drawing/text-wrap/wrap-tight.ts","../src/file/drawing/text-wrap/wrap-through.ts","../src/file/drawing/text-wrap/wrap-top-and-bottom.ts","../src/file/drawing/text-wrap/index.ts","../src/file/drawing/doc-properties/doc-properties.ts","../src/file/drawing/effect-extent/effect-extent.ts","../src/file/drawing/extent/extent.ts","../src/file/drawing/graphic-frame/graphic-frame-locks/graphic-frame-locks.ts","../src/file/drawing/graphic-frame/graphic-frame-properties.ts","../src/file/drawing/anchor/anchor.ts","../src/file/drawing/anchor/index.ts","../src/file/drawing/inline/inline.ts","../src/file/drawing/inline/index.ts","../src/file/drawing/drawing.ts","../src/file/drawing/index.ts","../src/file/media/media.ts","../src/file/media/data.ts","../src/file/media/index.ts","../src/file/paragraph/run/image-run.ts","../src/file/chart/chart-space.ts","../src/file/paragraph/run/chart-run.ts","../src/file/smartart/tree-to-model.ts","../src/file/paragraph/run/smartart-run.ts","../src/file/paragraph/run/wps-shape-run.ts","../src/file/paragraph/run/wpg-group-run.ts","../src/file/paragraph/run/sequential-identifier-instruction.ts","../src/file/paragraph/run/sequential-identifier.ts","../src/file/paragraph/run/simple-field.ts","../src/file/relationships/relationships.ts","../src/file/relationships/index.ts","../src/file/fonts/font.ts","../src/file/fonts/create-regular-font.ts","../src/file/fonts/font-table.ts","../src/file/fonts/font-wrapper.ts","../src/file/track-revision/track-revision-components/deleted-page-number.ts","../src/file/track-revision/track-revision-components/deleted-text.ts","../src/file/track-revision/track-revision-components/deleted-text-run.ts","../src/file/track-revision/track-revision-components/inserted-text-run.ts","../src/file/paragraph/links/bookmark.ts","../src/file/paragraph/links/move-bookmark.ts","../src/file/paragraph/links/div-id.ts","../src/file/paragraph/links/numbered-item-ref.ts","../src/file/paragraph/links/outline-level.ts","../src/file/paragraph/links/pageref-field-instruction.ts","../src/file/paragraph/links/pageref.ts","../src/file/paragraph/links/bidi.ts","../src/file/paragraph/links/index.ts","../src/file/paragraph/math/n-ary/math-accent-character.ts","../src/file/paragraph/math/n-ary/math-base.ts","../src/file/paragraph/math/n-ary/math-limit-location.ts","../src/file/paragraph/math/n-ary/math-sub-script-hide.ts","../src/file/paragraph/math/n-ary/math-super-script-hide.ts","../src/file/paragraph/math/n-ary/math-n-ary-properties.ts","../src/file/paragraph/math/n-ary/math-sub-script.ts","../src/file/paragraph/math/n-ary/math-super-script.ts","../src/file/paragraph/math/n-ary/math-sum.ts","../src/file/paragraph/math/n-ary/math-integral.ts","../src/file/paragraph/math/n-ary/math-limit.ts","../src/file/paragraph/math/math-control-properties.ts","../src/file/paragraph/math/n-ary/math-limit-upper-properties.ts","../src/file/paragraph/math/n-ary/math-limit-upper.ts","../src/file/paragraph/math/n-ary/math-limit-low-properties.ts","../src/file/paragraph/math/n-ary/math-limit-lower.ts","../src/file/paragraph/math/n-ary/index.ts","../src/file/paragraph/math/accent/math-accent-properties.ts","../src/file/paragraph/math/accent/math-accent.ts","../src/file/paragraph/math/accent/index.ts","../src/file/paragraph/math/bar/math-bar-pos.ts","../src/file/paragraph/math/bar/math-bar-properties.ts","../src/file/paragraph/math/bar/math-bar.ts","../src/file/paragraph/math/bar/index.ts","../src/file/paragraph/math/border-box/math-border-box-properties.ts","../src/file/paragraph/math/border-box/math-border-box.ts","../src/file/paragraph/math/border-box/index.ts","../src/file/paragraph/math/box/math-box-properties.ts","../src/file/paragraph/math/box/math-box.ts","../src/file/paragraph/math/box/index.ts","../src/file/paragraph/math/brackets/math-beginning-character.ts","../src/file/paragraph/math/brackets/math-ending-char.ts","../src/file/paragraph/math/brackets/math-bracket-properties.ts","../src/file/paragraph/math/brackets/math-round-brackets.ts","../src/file/paragraph/math/brackets/math-square-brackets.ts","../src/file/paragraph/math/brackets/math-curly-brackets.ts","../src/file/paragraph/math/brackets/math-angled-brackets.ts","../src/file/paragraph/math/brackets/index.ts","../src/file/paragraph/math/eq-arr/math-eq-arr-properties.ts","../src/file/paragraph/math/eq-arr/math-eq-arr.ts","../src/file/paragraph/math/eq-arr/index.ts","../src/file/paragraph/math/fraction/math-denominator.ts","../src/file/paragraph/math/fraction/math-fraction-properties.ts","../src/file/paragraph/math/fraction/math-numerator.ts","../src/file/paragraph/math/fraction/math-fraction.ts","../src/file/paragraph/math/fraction/index.ts","../src/file/paragraph/math/function/math-function-name.ts","../src/file/paragraph/math/function/math-function-properties.ts","../src/file/paragraph/math/function/math-function.ts","../src/file/paragraph/math/function/index.ts","../src/file/paragraph/math/group-chr/math-group-chr-properties.ts","../src/file/paragraph/math/group-chr/math-group-chr.ts","../src/file/paragraph/math/group-chr/index.ts","../src/file/paragraph/math/math-run-properties.ts","../src/file/paragraph/math/math-text.ts","../src/file/paragraph/math/math-run.ts","../src/file/paragraph/math/matrix/math-matrix-properties.ts","../src/file/paragraph/math/matrix/math-matrix.ts","../src/file/paragraph/math/phant/math-phant-properties.ts","../src/file/paragraph/math/phant/math-phant.ts","../src/file/paragraph/math/radical/math-degree.ts","../src/file/paragraph/math/radical/math-degree-hide.ts","../src/file/paragraph/math/radical/math-radical-properties.ts","../src/file/paragraph/math/radical/math-radical.ts","../src/file/paragraph/math/script/super-script/math-super-script-function-properties.ts","../src/file/paragraph/math/script/super-script/math-super-script-function.ts","../src/file/paragraph/math/script/super-script/index.ts","../src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.ts","../src/file/paragraph/math/script/sub-script/math-sub-script-function.ts","../src/file/paragraph/math/script/sub-script/index.ts","../src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.ts","../src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.ts","../src/file/paragraph/math/script/sub-super-script/index.ts","../src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.ts","../src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.ts","../src/file/paragraph/math/script/pre-sub-super-script/index.ts","../src/file/paragraph/math/script/index.ts","../src/file/paragraph/math/math-coerce.ts","../src/file/paragraph/math/math.ts","../src/file/paragraph/math/math-parse.ts","../src/file/paragraph/math/math-component.ts","../src/file/paragraph/math/math-para.ts","../src/file/paragraph/math/math-pr.ts","../src/file/paragraph/math/matrix/index.ts","../src/file/paragraph/math/phant/index.ts","../src/file/paragraph/math/radical/index.ts","../src/file/paragraph/math/index.ts","../src/file/endnotes/endnote/run/reference-run.ts","../src/file/footnotes/footnote/run/reference-run.ts","../src/file/paragraph/formatting/spacing.ts","../src/file/paragraph/formatting/style.ts","../src/file/paragraph/formatting/tab-stop.ts","../src/file/paragraph/formatting/unordered-list.ts","../src/file/paragraph/formatting/word-wrap.ts","../src/file/paragraph/frame/frame-properties.ts","../src/file/paragraph/properties.ts","../src/file/paragraph/paragraph.ts","../src/file/paragraph/run/comment-run.ts","../src/file/paragraph/run/empty-children.ts","../src/file/paragraph/run/positional-tab.ts","../src/file/paragraph/run/ruby.ts","../src/file/paragraph/run/index.ts","../src/file/paragraph/formatting/break.ts","../src/file/paragraph/formatting/index.ts","../src/file/paragraph/frame/index.ts","../src/file/paragraph/index.ts","../src/file/alt-chunk/alt-chunk.ts","../src/file/table-of-contents/field-instruction.ts","../src/file/table-of-contents/sdt-content.ts","../src/file/table-of-contents/sdt-properties.ts","../src/file/table-of-contents/table-of-contents.ts","../src/file/table-of-contents/table-of-contents-properties.ts","../src/file/table-of-contents/index.ts","../src/file/sdt/sdt.ts","../src/file/sub-doc/sub-doc.ts","../src/file/sdt/sdt-cell.ts","../src/file/track-revision/track-revision-components/moved-text-run.ts","../src/file/track-revision/track-revision-components/inserted-table-row.ts","../src/file/track-revision/track-revision-components/deleted-table-row.ts","../src/file/track-revision/track-revision-components/inserted-table-cell.ts","../src/file/track-revision/track-revision-components/deleted-table-cell.ts","../src/file/track-revision/track-revision-components/cell-merge.ts","../src/file/track-revision/index.ts","../src/file/vertical-align/vertical-align.ts","../src/file/vertical-align/index.ts","../src/file/table/table-cell/table-cell-components.ts","../src/file/table/table-cell/index.ts","../src/file/table/table-cell-spacing.ts","../src/file/table/table-width.ts","../src/file/table/table-properties/table-borders.ts","../src/file/table/table-properties/table-float-properties.ts","../src/file/table/table-properties/table-layout.ts","../src/file/table/table-properties/table-look.ts","../src/file/table/table-properties/table-properties.ts","../src/file/table/table-properties/table-property-exceptions.ts","../src/file/table/table-properties/index.ts","../src/file/table/table-row/table-row-height.ts","../src/file/table/table-row/table-row-properties.ts","../src/file/table/table-row/table-row.ts","../src/file/table/table-row/index.ts","../src/file/table/index.ts","../src/file/table/table-properties/table-cell-margin.ts","../src/file/table/table-cell/table-cell-properties.ts","../src/file/table/table-cell/table-cell.ts","../src/file/sdt/sdt-row.ts","../src/file/sdt/index.ts","../src/file/table/grid.ts","../src/file/table/table.ts","../src/file/textbox/pict-element/pict-element.ts","../src/file/textbox/texbox-content/textbox-content.ts","../src/file/textbox/vml-textbox/vml-texbox.ts","../src/file/textbox/shape/shape.ts","../src/file/textbox/textbox.ts","../src/file/coerce.ts","../src/file/alt-chunk/alt-chunk-collection.ts","../src/file/bibliography/bibliography.ts","../src/file/content-types/content-types.ts","../src/file/document/document-attributes.ts","../src/file/core-properties/properties.ts","../src/file/custom-properties/custom-property.ts","../src/file/custom-properties/custom-properties.ts","../src/file/document/body/section-properties/properties/columns.ts","../src/file/document/body/section-properties/properties/doc-grid.ts","../src/file/document/body/section-properties/properties/footnote-endnote-properties.ts","../src/file/document/body/section-properties/properties/header-footer-reference.ts","../src/file/document/body/section-properties/properties/line-number.ts","../src/file/document/body/section-properties/properties/page-borders.ts","../src/file/document/body/section-properties/properties/page-margin.ts","../src/file/document/body/section-properties/properties/page-number.ts","../src/file/document/body/section-properties/properties/page-size.ts","../src/file/document/body/section-properties/properties/page-text-direction.ts","../src/file/document/body/section-properties/properties/section-type.ts","../src/file/document/body/section-properties/section-properties.ts","../src/file/document/body/body.ts","../src/file/document/body/section-properties/properties/column.ts","../src/file/document/document-background/document-background.ts","../src/file/document/document.ts","../src/file/document-wrapper.ts","../src/file/footnotes/footnote/run/continuation-seperator.ts","../src/file/footnotes/footnote/run/continuation-seperator-run.ts","../src/file/footnotes/footnote/run/seperator.ts","../src/file/footnotes/footnote/run/seperator-run.ts","../src/file/endnotes/endnote/run/endnote-ref-run.ts","../src/file/endnotes/endnote/endnote.ts","../src/file/endnotes/endnotes.ts","../src/file/endnotes-wrapper.ts","../src/file/header-footer-base.ts","../src/file/footer/footer.ts","../src/file/footer-wrapper.ts","../src/file/footnotes/footnote/run/footnote-ref.ts","../src/file/footnotes/footnote/run/footnote-ref-run.ts","../src/file/footnotes/footnote/footnote.ts","../src/file/footnotes/footnotes.ts","../src/file/footnotes-wrapper.ts","../src/file/header.ts","../src/file/header/header.ts","../src/file/header-wrapper.ts","../src/file/numbering/level.ts","../src/file/numbering/multi-level-type.ts","../src/file/numbering/abstract-numbering.ts","../src/file/numbering/num.ts","../src/file/numbering/numbering.ts","../src/file/settings/compatibility-setting/compatibility-setting.ts","../src/file/settings/compatibility.ts","../src/file/settings/settings.ts","../src/file/styles/style/components.ts","../src/file/styles/style/table-style-override.ts","../src/file/styles/style/style.ts","../src/file/styles/style/paragraph-style.ts","../src/file/styles/style/character-style.ts","../src/file/styles/style/default-styles.ts","../src/file/styles/styles.ts","../src/file/styles/defaults/paragraph-properties.ts","../src/file/styles/defaults/run-properties.ts","../src/file/styles/defaults/document-defaults.ts","../src/file/styles/external-styles-factory.ts","../src/file/styles/factory.ts","../src/file/sub-doc/sub-doc-collection.ts","../src/file/file.ts","../src/file/footnotes/footnote/run/index.ts","../src/file/endnotes/endnote/run/index.ts","../src/file/checkbox/checkbox-symbol.ts","../src/file/checkbox/checkbox-util.ts","../src/file/checkbox/checkbox.ts","../src/file/permissions/perm-start.ts","../src/file/alt-chunk/index.ts","../src/file/sub-doc/index.ts","../src/file/fonts/index.ts","../src/file/textbox/index.ts","../src/file/chart/index.ts","../src/file/smartart/index.ts","../src/file/index.ts","../src/file/fonts/obfuscate-ttf-to-odttf.ts","../src/export/packer/numbering-placeholders.ts","../src/export/packer/next-compiler.ts","../src/export/packer/packer.ts","../src/util/index.ts","../src/patcher/from-docx.ts","../src/patcher/patch-detector.ts","../src/file/drawing/drawing-parse.ts","../src/file/paragraph/run/run-parse.ts","../src/file/paragraph/paragraph-parse.ts","../src/file/alt-chunk/alt-chunk-parse.ts","../src/file/sdt/sdt-parse.ts","../src/file/sub-doc/sub-doc-parse.ts","../src/file/table-of-contents/toc-parse.ts","../src/file/table/table-parse.ts","../src/file/textbox/textbox-parse.ts","../src/parse/context.ts","../src/parse/body.ts","../src/parse/custom-properties.ts","../src/parse/numbering.ts","../src/parse/settings.ts","../src/parse/styles.ts","../src/parse.ts","../src/index.ts"],"sourcesContent":["import type { Context as CoreContext } from \"@office-open/core\";\n\n/**\n * Docx-specific XML Component bridge.\n *\n * Re-exports BaseXmlComponent from core and defines the docx-specific Context\n * that extends core's generic context with typed file and viewWrapper access.\n *\n * @module\n */\nimport type { ViewWrapper } from \"../document-wrapper\";\nimport type { File } from \"../file\";\n\nexport type { IXmlableObject } from \"@office-open/core\";\nexport { BaseXmlComponent } from \"@office-open/core\";\n\n/**\n * Docx-specific serialization context.\n *\n * Extends core's generic Context with typed file and viewWrapper access.\n * The `file` field is a convenience alias for `fileData`.\n */\nexport interface Context extends CoreContext<File> {\n /** The root File object being serialized. */\n readonly file: File;\n /** Access to document relationships and other document parts. */\n readonly viewWrapper: ViewWrapper;\n}\n","/**\n * Common XML attributes module for WordprocessingML elements.\n *\n * This module provides a reusable Attributes class with commonly used\n * WordprocessingML attribute mappings.\n *\n * @module\n */\nimport { XmlAttributeComponent } from \"@office-open/core\";\n\n/**\n * Common XML attributes used across WordprocessingML elements.\n *\n * This class provides a convenient way to add common attributes to XML elements.\n * It automatically maps JavaScript-friendly property names to their corresponding\n * w: (WordprocessingML) namespace prefixed XML attribute names.\n *\n * @example\n * ```typescript\n * // Create an element with a value attribute\n * new Attributes({ val: \"someValue\" });\n * // Generates: <element w:val=\"someValue\"/>\n *\n * // Multiple attributes\n * new Attributes({ color: \"FF0000\", sz: \"24\" });\n * // Generates: <element w:color=\"FF0000\" w:sz=\"24\"/>\n * ```\n */\nexport class Attributes extends XmlAttributeComponent<{\n /** Generic value attribute (w:val). */\n readonly val?: string | number | boolean;\n /** Color value (w:color). */\n readonly color?: string;\n /** Fill color (w:fill). */\n readonly fill?: string;\n /** Space preservation (w:space). */\n readonly space?: string;\n /** Size value (w:sz). */\n readonly sz?: string;\n /** Type specification (w:type). */\n readonly type?: string;\n /** Revision ID for run content (w:rsidR). */\n readonly rsidR?: string;\n /** Revision ID for run properties (w:rsidRPr). */\n readonly rsidRPr?: string;\n /** Revision ID for section (w:rsidSect). */\n readonly rsidSect?: string;\n /** Width (w:w). */\n readonly w?: string;\n /** Height (w:h). */\n readonly h?: string;\n /** Top margin/spacing (w:top). */\n readonly top?: string;\n /** Right margin/spacing (w:right). */\n readonly right?: string;\n /** Bottom margin/spacing (w:bottom). */\n readonly bottom?: string;\n /** Left margin/spacing (w:left). */\n readonly left?: string;\n /** Header margin (w:header). */\n readonly header?: string;\n /** Footer margin (w:footer). */\n readonly footer?: string;\n /** Gutter margin (w:gutter). */\n readonly gutter?: string;\n /** Line pitch (w:linePitch). */\n readonly linePitch?: string;\n /** Position value (w:pos). */\n readonly pos?: string | number;\n /** Theme color reference (w:themeColor). */\n readonly themeColor?: string;\n /** Theme color tint (w:themeTint). */\n readonly themeTint?: string;\n /** Theme color shade (w:themeShade). */\n readonly themeShade?: string;\n}> {\n protected readonly xmlKeys = {\n bottom: \"w:bottom\",\n color: \"w:color\",\n fill: \"w:fill\",\n footer: \"w:footer\",\n gutter: \"w:gutter\",\n h: \"w:h\",\n header: \"w:header\",\n left: \"w:left\",\n linePitch: \"w:linePitch\",\n pos: \"w:pos\",\n right: \"w:right\",\n rsidR: \"w:rsidR\",\n rsidRPr: \"w:rsidRPr\",\n rsidSect: \"w:rsidSect\",\n space: \"w:space\",\n sz: \"w:sz\",\n themeColor: \"w:themeColor\",\n themeShade: \"w:themeShade\",\n themeTint: \"w:themeTint\",\n top: \"w:top\",\n type: \"w:type\",\n val: \"w:val\",\n w: \"w:w\",\n };\n}\n","/**\n * Docx-specific simple element helpers.\n *\n * @module\n */\nimport { BuilderElement } from \"@office-open/core\";\nimport type { XmlComponent } from \"@office-open/core\";\n\n/**\n * Creates a WordprocessingML string value element with a `w:val` attribute.\n *\n * @param name - Element name (e.g., \"w:pStyle\")\n * @param value - String value for the `w:val` attribute\n */\nexport const createStringElement = (name: string, value: string): XmlComponent =>\n new BuilderElement({\n attributes: {\n value: { key: \"w:val\", value },\n },\n name,\n });\n","/**\n * XML Components module — re-exports from core + docx-specific additions.\n *\n * @module\n */\n// Core re-exports\nexport { BaseXmlComponent } from \"./base\";\nexport type { Context, IXmlableObject } from \"./base\";\nimport type { BaseXmlComponent as BaseXmlComp, IXmlableObject as XmlObj } from \"./base\";\n/** Union type for values that can be children of an XML element. */\nexport type BuilderChild = BaseXmlComp | XmlObj | string;\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 EmptyElement,\n BuilderElement,\n chartAttr,\n wrapEl,\n onOffObj,\n stringValObj,\n numberValObj,\n stringEnumValObj,\n hpsMeasureObj,\n stringContainerObj,\n attrObj,\n} from \"@office-open/core\";\nexport {\n ImportedXmlComponent,\n ImportedRootElementAttributes,\n convertToXmlComponent,\n} from \"@office-open/core\";\nexport { InitializableXmlComponent } from \"@office-open/core\";\n\n// Docx-specific\nexport * from \"./attributes\";\nexport { createStringElement } from \"./simple-elements\";\n","/**\n * Paragraph and table alignment module for WordprocessingML documents.\n *\n * This module provides justification (alignment) options for paragraphs and tables.\n *\n * Reference: http://officeopenxml.com/WPalignment.php\n *\n * @see http://officeopenxml.com/WPtableAlignment.php\n * @see http://www.datypic.com/sc/ooxml/t-w_ST_Jc.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Paragraph justification (alignment) types.\n *\n * Specifies the horizontal alignment of text within a paragraph.\n *\n * Reference: http://officeopenxml.com/WPalignment.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Jc\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"start\"/>\n * <xsd:enumeration value=\"center\"/>\n * <xsd:enumeration value=\"end\"/>\n * <xsd:enumeration value=\"both\"/>\n * <xsd:enumeration value=\"mediumKashida\"/>\n * <xsd:enumeration value=\"distribute\"/>\n * <xsd:enumeration value=\"numTab\"/>\n * <xsd:enumeration value=\"highKashida\"/>\n * <xsd:enumeration value=\"lowKashida\"/>\n * <xsd:enumeration value=\"thaiDistribute\"/>\n * <xsd:enumeration value=\"left\"/>\n * <xsd:enumeration value=\"right\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const AlignmentType = {\n /** Align Start */\n START: \"start\",\n /** Align Center */\n CENTER: \"center\",\n /** End */\n END: \"end\",\n /** Justified */\n BOTH: \"both\",\n /** Medium Kashida Length */\n MEDIUM_KASHIDA: \"mediumKashida\",\n /** Distribute All Characters Equally */\n DISTRIBUTE: \"distribute\",\n /** Align to List Tab */\n NUM_TAB: \"numTab\",\n /** Widest Kashida Length */\n HIGH_KASHIDA: \"highKashida\",\n /** Low Kashida Length */\n LOW_KASHIDA: \"lowKashida\",\n /** Thai Language Justification */\n THAI_DISTRIBUTE: \"thaiDistribute\",\n /** Align Left */\n LEFT: \"left\",\n /** Align Right */\n RIGHT: \"right\",\n /** Justified */\n JUSTIFIED: \"both\",\n} as const;\n\n/**\n * Creates paragraph alignment (justification) element for a WordprocessingML document.\n *\n * The jc element specifies the horizontal alignment of all text in the paragraph.\n *\n * Reference: http://officeopenxml.com/WPalignment.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Jc\">\n * <xsd:attribute name=\"val\" type=\"ST_Jc\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * alignment: AlignmentType.CENTER,\n * children: [new TextRun(\"Centered text\")],\n * });\n * ```\n */\nexport const createAlignment = (\n type: (typeof AlignmentType)[keyof typeof AlignmentType],\n): XmlComponent =>\n new BuilderElement<{ readonly val: (typeof AlignmentType)[keyof typeof AlignmentType] }>({\n attributes: {\n val: { key: \"w:val\", value: type },\n },\n name: \"w:jc\",\n });\n","export * from \"@office-open/core/values\";\n","/**\n * Border module for WordprocessingML documents.\n *\n * Borders are used in multiple contexts (paragraphs, tables, table cells, sections)\n * and share the same CT_Border type definition. This module provides the createBorderElement\n * factory function and BorderStyle constants used throughout the document structure.\n *\n * Reference: http://officeopenxml.com/WPborders.php\n *\n * @see http://officeopenxml.com/WPtableBorders.php\n * @see http://officeopenxml.com/WPtableCellProperties-Borders.php\n * @see http://officeopenxml.com/WPsectionBorders.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Border\">\n * <xsd:attribute name=\"val\" type=\"ST_Border\" use=\"required\"/>\n * <xsd:attribute name=\"color\" type=\"ST_HexColor\" use=\"optional\" default=\"auto\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"sz\" type=\"ST_EighthPointMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"space\" type=\"ST_PointMeasure\" use=\"optional\" default=\"0\"/>\n * <xsd:attribute name=\"shadow\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"frame\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport {\n eighthPointMeasureValue,\n hexColorValue,\n pointMeasureValue,\n uCharHexNumber,\n} from \"@util/values\";\nimport type { ThemeColor } from \"@util/values\";\n\n/**\n * Options for configuring a border element.\n *\n * @property style - The border style (single, dashed, dotted, etc.)\n * @property color - Border color in hex format (e.g., \"FF00AA\" for purple)\n * @property size - Border thickness in eighths of a point (1/8 pt)\n * @property space - Spacing offset from the content in points\n */\nexport interface BorderOptions {\n readonly style: (typeof BorderStyle)[keyof typeof BorderStyle];\n /** Border color, in hex (eg 'FF00AA') */\n readonly color?: string;\n /** Theme color reference */\n readonly themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme color tint (2-char hex) */\n readonly themeTint?: string;\n /** Theme color shade (2-char hex) */\n readonly themeShade?: string;\n /** Border shadow */\n readonly shadow?: boolean;\n /** Border frame */\n readonly frame?: boolean;\n /** Size of the border in 1/8 pt */\n readonly size?: number;\n /** Spacing offset. Values are specified in pt */\n readonly space?: number;\n}\n\n/**\n * Build a border element as IXmlableObject without allocating XmlComponent tree.\n *\n * Directly constructs the XML object, filtering out undefined attributes.\n */\nexport const buildBorderObj = (\n elementName: string,\n { color, size, space, style, themeColor, themeTint, themeShade, shadow, frame }: BorderOptions,\n): IXmlableObject => {\n const attrs: Record<string, string | number | boolean> = {};\n if (style !== undefined) attrs[\"w:val\"] = style;\n if (color !== undefined) attrs[\"w:color\"] = hexColorValue(color);\n if (size !== undefined) attrs[\"w:sz\"] = eighthPointMeasureValue(size);\n if (space !== undefined) attrs[\"w:space\"] = pointMeasureValue(space);\n if (themeColor !== undefined) attrs[\"w:themeColor\"] = themeColor;\n if (themeTint !== undefined) attrs[\"w:themeTint\"] = uCharHexNumber(themeTint);\n if (themeShade !== undefined) attrs[\"w:themeShade\"] = uCharHexNumber(themeShade);\n if (shadow !== undefined) attrs[\"w:shadow\"] = shadow;\n if (frame !== undefined) attrs[\"w:frame\"] = frame;\n return { [elementName]: { _attr: attrs } };\n};\n\n/**\n * Creates a border element for a WordprocessingML document.\n *\n * Used to create border specifications for paragraphs, tables, table cells,\n * and sections. The element name is specified to create different border\n * types (top, bottom, left, right, etc.).\n *\n * @example\n * ```typescript\n * // Create a top border\n * createBorderElement(\"w:top\", {\n * style: BorderStyle.SINGLE,\n * color: \"FF0000\",\n * size: 24,\n * space: 1,\n * });\n * ```\n */\nexport const createBorderElement = (\n elementName: string,\n { color, size, space, style, themeColor, themeTint, themeShade, shadow, frame }: BorderOptions,\n): XmlComponent =>\n new BuilderElement<BorderOptions>({\n attributes: {\n color: {\n key: \"w:color\",\n value: color === undefined ? undefined : hexColorValue(color),\n },\n frame: { key: \"w:frame\", value: frame },\n shadow: { key: \"w:shadow\", value: shadow },\n size: {\n key: \"w:sz\",\n value: size === undefined ? undefined : eighthPointMeasureValue(size),\n },\n space: {\n key: \"w:space\",\n value: space === undefined ? undefined : pointMeasureValue(space),\n },\n style: { key: \"w:val\", value: style },\n themeColor: { key: \"w:themeColor\", value: themeColor },\n themeShade: {\n key: \"w:themeShade\",\n value: themeShade === undefined ? undefined : uCharHexNumber(themeShade),\n },\n themeTint: {\n key: \"w:themeTint\",\n value: themeTint === undefined ? undefined : uCharHexNumber(themeTint),\n },\n },\n name: elementName,\n });\n\n/**\n * Table borders are defined with the <w:tblBorders> element. Child elements of this element specify the kinds of `border`:\n *\n * `bottom`, `end` (`right` in the previous version of the standard), `insideH`, `insideV`, `start` (`left` in the previous version of the standard), and `top`.\n *\n * Reference: http://officeopenxml.com/WPtableBorders.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Border\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"single\"/>\n * <xsd:enumeration value=\"dashDotStroked\"/>\n * <xsd:enumeration value=\"dashed\"/>\n * <xsd:enumeration value=\"dashSmallGap\"/>\n * <xsd:enumeration value=\"dotDash\"/>\n * <xsd:enumeration value=\"dotDotDash\"/>\n * <xsd:enumeration value=\"dotted\"/>\n * <xsd:enumeration value=\"double\"/>\n * <xsd:enumeration value=\"doubleWave\"/>\n * <xsd:enumeration value=\"inset\"/>\n * <xsd:enumeration value=\"nil\"/>\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"outset\"/>\n * <xsd:enumeration value=\"thick\"/>\n * <xsd:enumeration value=\"thickThinLargeGap\"/>\n * <xsd:enumeration value=\"thickThinMediumGap\"/>\n * <xsd:enumeration value=\"thickThinSmallGap\"/>\n * <xsd:enumeration value=\"thinThickLargeGap\"/>\n * <xsd:enumeration value=\"thinThickMediumGap\"/>\n * <xsd:enumeration value=\"thinThickSmallGap\"/>\n * <xsd:enumeration value=\"thinThickThinLargeGap\"/>\n * <xsd:enumeration value=\"thinThickThinMediumGap\"/>\n * <xsd:enumeration value=\"thinThickThinSmallGap\"/>\n * <xsd:enumeration value=\"threeDEmboss\"/>\n * <xsd:enumeration value=\"threeDEngrave\"/>\n * <xsd:enumeration value=\"triple\"/>\n * <xsd:enumeration value=\"wave\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const BorderStyle = {\n /** A single line */\n SINGLE: \"single\",\n /** A line with a series of alternating thin and thick strokes */\n DASH_DOT_STROKED: \"dashDotStroked\",\n /** A dashed line */\n DASHED: \"dashed\",\n /** A dashed line with small gaps */\n DASH_SMALL_GAP: \"dashSmallGap\",\n /** A line with alternating dots and dashes */\n DOT_DASH: \"dotDash\",\n /** A line with a repeating dot - dot - dash sequence */\n DOT_DOT_DASH: \"dotDotDash\",\n /** A dotted line */\n DOTTED: \"dotted\",\n /** A double line */\n DOUBLE: \"double\",\n /** A double wavy line */\n DOUBLE_WAVE: \"doubleWave\",\n /** An inset set of lines */\n INSET: \"inset\",\n /** No border */\n NIL: \"nil\",\n /** No border */\n NONE: \"none\",\n /** An outset set of lines */\n OUTSET: \"outset\",\n /** A single line */\n THICK: \"thick\",\n /** A thick line contained within a thin line with a large-sized intermediate gap */\n THICK_THIN_LARGE_GAP: \"thickThinLargeGap\",\n /** A thick line contained within a thin line with a medium-sized intermediate gap */\n THICK_THIN_MEDIUM_GAP: \"thickThinMediumGap\",\n /** A thick line contained within a thin line with a small intermediate gap */\n THICK_THIN_SMALL_GAP: \"thickThinSmallGap\",\n /** A thin line contained within a thick line with a large-sized intermediate gap */\n THIN_THICK_LARGE_GAP: \"thinThickLargeGap\",\n /** A thick line contained within a thin line with a medium-sized intermediate gap */\n THIN_THICK_MEDIUM_GAP: \"thinThickMediumGap\",\n /** A thick line contained within a thin line with a small intermediate gap */\n THIN_THICK_SMALL_GAP: \"thinThickSmallGap\",\n /** A thin-thick-thin line with a large gap */\n THIN_THICK_THIN_LARGE_GAP: \"thinThickThinLargeGap\",\n /** A thin-thick-thin line with a medium gap */\n THIN_THICK_THIN_MEDIUM_GAP: \"thinThickThinMediumGap\",\n /** A thin-thick-thin line with a small gap */\n THIN_THICK_THIN_SMALL_GAP: \"thinThickThinSmallGap\",\n /** A three-staged gradient line, getting darker towards the paragraph */\n THREE_D_EMBOSS: \"threeDEmboss\",\n /** A three-staged gradient like, getting darker away from the paragraph */\n THREE_D_ENGRAVE: \"threeDEngrave\",\n /** A triple line */\n TRIPLE: \"triple\",\n /** A wavy line */\n WAVE: \"wave\",\n} as const;\n","/**\n * Border module exports.\n *\n * @module\n */\nexport * from \"./border\";\n","/**\n * Paragraph border module for WordprocessingML documents.\n *\n * This module provides border options for paragraphs.\n *\n * Reference: http://officeopenxml.com/WPborders.php\n *\n * @module\n */\nimport { BorderStyle, buildBorderObj, createBorderElement } from \"@file/border\";\nimport type { BorderOptions } from \"@file/border\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { IgnoreIfEmptyXmlComponent, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Build paragraph borders (w:pBdr) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildParagraphBorders(options: BordersOptions): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (options.top) children.push(buildBorderObj(\"w:top\", options.top));\n if (options.left) children.push(buildBorderObj(\"w:left\", options.left));\n if (options.bottom) children.push(buildBorderObj(\"w:bottom\", options.bottom));\n if (options.right) children.push(buildBorderObj(\"w:right\", options.right));\n if (options.between) children.push(buildBorderObj(\"w:between\", options.between));\n\n return children.length > 0 ? { \"w:pBdr\": children } : undefined;\n}\n\n/**\n * Build thematic break (w:pBdr with bottom border) as IXmlableObject.\n */\nexport function buildThematicBreakObj(): IXmlableObject {\n return {\n \"w:pBdr\": [\n buildBorderObj(\"w:bottom\", {\n color: \"auto\",\n size: 6,\n space: 1,\n style: BorderStyle.SINGLE,\n }),\n ],\n };\n}\n\n/**\n * Options for configuring paragraph borders.\n *\n * Borders can be applied to top, bottom, left, right, and between paragraphs.\n *\n * @property top - Border for the top edge of the paragraph\n * @property bottom - Border for the bottom edge of the paragraph\n * @property left - Border for the left edge of the paragraph\n * @property right - Border for the right edge of the paragraph\n * @property between - Border between consecutive paragraphs with the same border settings\n */\nexport interface BordersOptions {\n /** Border for the top edge of the paragraph */\n readonly top?: BorderOptions;\n /** Border for the bottom edge of the paragraph */\n readonly bottom?: BorderOptions;\n /** Border for the left edge of the paragraph */\n readonly left?: BorderOptions;\n /** Border for the right edge of the paragraph */\n readonly right?: BorderOptions;\n /** Border between consecutive paragraphs with the same border settings */\n readonly between?: BorderOptions;\n}\n\n/**\n * Represents paragraph borders in a WordprocessingML document.\n *\n * The pBdr element specifies borders that surround the paragraph.\n *\n * Reference: http://officeopenxml.com/WPborders.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PBdr\">\n * <xsd:sequence>\n * <xsd:element name=\"top\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"left\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"bottom\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"right\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"between\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"bar\" type=\"CT_Border\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * border: {\n * top: { style: BorderStyle.SINGLE, size: 6, color: \"FF0000\" },\n * bottom: { style: BorderStyle.SINGLE, size: 6, color: \"FF0000\" },\n * },\n * children: [new TextRun(\"Paragraph with top and bottom borders\")],\n * });\n * ```\n */\nexport class Border extends IgnoreIfEmptyXmlComponent {\n public constructor(options: BordersOptions) {\n super(\"w:pBdr\");\n\n if (options.top) {\n this.root.push(createBorderElement(\"w:top\", options.top));\n }\n\n if (options.left) {\n this.root.push(createBorderElement(\"w:left\", options.left));\n }\n\n if (options.bottom) {\n this.root.push(createBorderElement(\"w:bottom\", options.bottom));\n }\n\n if (options.right) {\n this.root.push(createBorderElement(\"w:right\", options.right));\n }\n\n if (options.between) {\n this.root.push(createBorderElement(\"w:between\", options.between));\n }\n }\n}\n\n/**\n * Represents a thematic break (horizontal rule) in a WordprocessingML document.\n *\n * Creates a horizontal line across the paragraph using a bottom border.\n *\n * Reference: http://officeopenxml.com/WPborders.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PBdr\">\n * <xsd:sequence>\n * <xsd:element name=\"bottom\" type=\"CT_Border\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * thematicBreak: true,\n * children: [new TextRun(\"Paragraph with horizontal rule below\")],\n * });\n * ```\n */\nexport class ThematicBreak extends XmlComponent {\n public constructor() {\n super(\"w:pBdr\");\n const bottom = createBorderElement(\"w:bottom\", {\n color: \"auto\",\n size: 6,\n space: 1,\n style: BorderStyle.SINGLE,\n });\n this.root.push(bottom);\n }\n}\n","/**\n * Conditional formatting style module for WordprocessingML documents.\n *\n * This module provides the conditional formatting style element (w:cnfStyle)\n * which specifies conditional formatting for table cells based on their position.\n *\n * Reference: http://officeopenxml.com/WPtableCellProperties.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for conditional formatting style.\n *\n * These options specify which conditions apply to the element based on\n * its position within a table (first/last row, first/last column, bands).\n */\nexport interface CnfConditionalOptions {\n /** Whether this is the first row in the table */\n readonly firstRow?: boolean;\n /** Whether this is the last row in the table */\n readonly lastRow?: boolean;\n /** Whether this is the first column in the table */\n readonly firstColumn?: boolean;\n /** Whether this is the last column in the table */\n readonly lastColumn?: boolean;\n /** Whether this is an odd vertical band */\n readonly oddVBand?: boolean;\n /** Whether this is an even vertical band */\n readonly evenVBand?: boolean;\n /** Whether this is an odd horizontal band */\n readonly oddHBand?: boolean;\n /** Whether this is an even horizontal band */\n readonly evenHBand?: boolean;\n /** Whether this is the first row and first column (top-left corner) */\n readonly firstRowFirstColumn?: boolean;\n /** Whether this is the first row and last column (top-right corner) */\n readonly firstRowLastColumn?: boolean;\n /** Whether this is the last row and first column (bottom-left corner) */\n readonly lastRowFirstColumn?: boolean;\n /** Whether this is the last row and last column (bottom-right corner) */\n readonly lastRowLastColumn?: boolean;\n}\n\n/**\n * Creates a conditional formatting style element (w:cnfStyle).\n *\n * This element specifies conditional formatting properties based on the\n * position of a cell within a table. It's used to apply different styles\n * to header rows, footer rows, banded rows/columns, and corner cells.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Cnf\">\n * <xsd:attribute name=\"firstRow\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"lastRow\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"firstColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"lastColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"oddVBand\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"evenVBand\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"oddHBand\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"evenHBand\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"firstRowFirstColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"firstRowLastColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"lastRowFirstColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"lastRowLastColumn\" type=\"s:ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Apply style to first row\n * createCnfStyle({ firstRow: true });\n *\n * // Apply style to odd horizontal bands\n * createCnfStyle({ oddHBand: true });\n *\n * // Apply style to top-left corner cell\n * createCnfStyle({ firstRow: true, firstColumn: true, firstRowFirstColumn: true });\n * ```\n */\nexport const createCnfStyle = (options: CnfConditionalOptions): XmlComponent => {\n const attributes: Record<string, { key: string; value: string }> = {};\n\n if (options.firstRow !== undefined) {\n attributes.firstRow = { key: \"w:firstRow\", value: options.firstRow ? \"1\" : \"0\" };\n }\n if (options.lastRow !== undefined) {\n attributes.lastRow = { key: \"w:lastRow\", value: options.lastRow ? \"1\" : \"0\" };\n }\n if (options.firstColumn !== undefined) {\n attributes.firstColumn = { key: \"w:firstColumn\", value: options.firstColumn ? \"1\" : \"0\" };\n }\n if (options.lastColumn !== undefined) {\n attributes.lastColumn = { key: \"w:lastColumn\", value: options.lastColumn ? \"1\" : \"0\" };\n }\n if (options.oddVBand !== undefined) {\n attributes.oddVBand = { key: \"w:oddVBand\", value: options.oddVBand ? \"1\" : \"0\" };\n }\n if (options.evenVBand !== undefined) {\n attributes.evenVBand = { key: \"w:evenVBand\", value: options.evenVBand ? \"1\" : \"0\" };\n }\n if (options.oddHBand !== undefined) {\n attributes.oddHBand = { key: \"w:oddHBand\", value: options.oddHBand ? \"1\" : \"0\" };\n }\n if (options.evenHBand !== undefined) {\n attributes.evenHBand = { key: \"w:evenHBand\", value: options.evenHBand ? \"1\" : \"0\" };\n }\n if (options.firstRowFirstColumn !== undefined) {\n attributes.firstRowFirstColumn = {\n key: \"w:firstRowFirstColumn\",\n value: options.firstRowFirstColumn ? \"1\" : \"0\",\n };\n }\n if (options.firstRowLastColumn !== undefined) {\n attributes.firstRowLastColumn = {\n key: \"w:firstRowLastColumn\",\n value: options.firstRowLastColumn ? \"1\" : \"0\",\n };\n }\n if (options.lastRowFirstColumn !== undefined) {\n attributes.lastRowFirstColumn = {\n key: \"w:lastRowFirstColumn\",\n value: options.lastRowFirstColumn ? \"1\" : \"0\",\n };\n }\n if (options.lastRowLastColumn !== undefined) {\n attributes.lastRowLastColumn = {\n key: \"w:lastRowLastColumn\",\n value: options.lastRowLastColumn ? \"1\" : \"0\",\n };\n }\n\n return new BuilderElement({\n attributes,\n name: \"w:cnfStyle\",\n });\n};\n\nexport const buildCnfStyleObj = (options: CnfConditionalOptions): IXmlableObject =>\n attrObj(\"w:cnfStyle\", {\n \"w:firstRow\": options.firstRow !== undefined ? (options.firstRow ? \"1\" : \"0\") : undefined,\n \"w:lastRow\": options.lastRow !== undefined ? (options.lastRow ? \"1\" : \"0\") : undefined,\n \"w:firstColumn\":\n options.firstColumn !== undefined ? (options.firstColumn ? \"1\" : \"0\") : undefined,\n \"w:lastColumn\": options.lastColumn !== undefined ? (options.lastColumn ? \"1\" : \"0\") : undefined,\n \"w:oddVBand\": options.oddVBand !== undefined ? (options.oddVBand ? \"1\" : \"0\") : undefined,\n \"w:evenVBand\": options.evenVBand !== undefined ? (options.evenVBand ? \"1\" : \"0\") : undefined,\n \"w:oddHBand\": options.oddHBand !== undefined ? (options.oddHBand ? \"1\" : \"0\") : undefined,\n \"w:evenHBand\": options.evenHBand !== undefined ? (options.evenHBand ? \"1\" : \"0\") : undefined,\n \"w:firstRowFirstColumn\":\n options.firstRowFirstColumn !== undefined\n ? options.firstRowFirstColumn\n ? \"1\"\n : \"0\"\n : undefined,\n \"w:firstRowLastColumn\":\n options.firstRowLastColumn !== undefined\n ? options.firstRowLastColumn\n ? \"1\"\n : \"0\"\n : undefined,\n \"w:lastRowFirstColumn\":\n options.lastRowFirstColumn !== undefined\n ? options.lastRowFirstColumn\n ? \"1\"\n : \"0\"\n : undefined,\n \"w:lastRowLastColumn\":\n options.lastRowLastColumn !== undefined ? (options.lastRowLastColumn ? \"1\" : \"0\") : undefined,\n });\n","/**\n * Paragraph indentation module for WordprocessingML documents.\n *\n * This module provides indentation options for paragraphs including left, right,\n * hanging, and first line indentation.\n *\n * Reference: http://officeopenxml.com/WPindentation.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber, signedTwipsMeasureValue, twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure, UniversalMeasure } from \"@util/values\";\n\n/**\n * Properties for configuring paragraph indentation.\n *\n * Values can be specified as numbers (in twips) or as universal measures (e.g., \"1in\", \"2.5cm\").\n */\nexport interface IndentAttributesProperties {\n readonly start?: number | UniversalMeasure;\n readonly startChars?: number;\n readonly end?: number | UniversalMeasure;\n readonly endChars?: number;\n readonly left?: number | UniversalMeasure;\n readonly leftChars?: number;\n readonly right?: number | UniversalMeasure;\n readonly rightChars?: number;\n readonly hanging?: number | PositiveUniversalMeasure;\n readonly hangingChars?: number;\n readonly firstLine?: number | PositiveUniversalMeasure;\n readonly firstLineChars?: number;\n}\n\n/**\n * Creates paragraph indentation element for a WordprocessingML document.\n *\n * The ind element specifies the indentation of the paragraph from the margins.\n *\n * Reference: http://officeopenxml.com/WPindentation.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Ind\">\n * <xsd:attribute name=\"start\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"startChars\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"end\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"endChars\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"left\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"leftChars\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"right\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"rightChars\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"hanging\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"hangingChars\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"firstLine\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"firstLineChars\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createIndent = ({\n start,\n startChars,\n end,\n endChars,\n left,\n leftChars,\n right,\n rightChars,\n hanging,\n hangingChars,\n firstLine,\n firstLineChars,\n}: IndentAttributesProperties): XmlComponent =>\n new BuilderElement<IndentAttributesProperties>({\n attributes: {\n end: {\n key: \"w:end\",\n value: end === undefined ? undefined : signedTwipsMeasureValue(end),\n },\n endChars: {\n key: \"w:endChars\",\n value: endChars === undefined ? undefined : decimalNumber(endChars),\n },\n firstLine: {\n key: \"w:firstLine\",\n value: firstLine === undefined ? undefined : twipsMeasureValue(firstLine),\n },\n firstLineChars: {\n key: \"w:firstLineChars\",\n value: firstLineChars === undefined ? undefined : decimalNumber(firstLineChars),\n },\n hanging: {\n key: \"w:hanging\",\n value: hanging === undefined ? undefined : twipsMeasureValue(hanging),\n },\n hangingChars: {\n key: \"w:hangingChars\",\n value: hangingChars === undefined ? undefined : decimalNumber(hangingChars),\n },\n left: {\n key: \"w:left\",\n value: left === undefined ? undefined : signedTwipsMeasureValue(left),\n },\n leftChars: {\n key: \"w:leftChars\",\n value: leftChars === undefined ? undefined : decimalNumber(leftChars),\n },\n right: {\n key: \"w:right\",\n value: right === undefined ? undefined : signedTwipsMeasureValue(right),\n },\n rightChars: {\n key: \"w:rightChars\",\n value: rightChars === undefined ? undefined : decimalNumber(rightChars),\n },\n start: {\n key: \"w:start\",\n value: start === undefined ? undefined : signedTwipsMeasureValue(start),\n },\n startChars: {\n key: \"w:startChars\",\n value: startChars === undefined ? undefined : decimalNumber(startChars),\n },\n },\n name: \"w:ind\",\n });\n\nexport const buildIndentObj = ({\n start,\n startChars,\n end,\n endChars,\n left,\n leftChars,\n right,\n rightChars,\n hanging,\n hangingChars,\n firstLine,\n firstLineChars,\n}: IndentAttributesProperties): IXmlableObject =>\n attrObj(\"w:ind\", {\n \"w:start\": start !== undefined ? signedTwipsMeasureValue(start) : undefined,\n \"w:startChars\": startChars !== undefined ? decimalNumber(startChars) : undefined,\n \"w:end\": end !== undefined ? signedTwipsMeasureValue(end) : undefined,\n \"w:endChars\": endChars !== undefined ? decimalNumber(endChars) : undefined,\n \"w:left\": left !== undefined ? signedTwipsMeasureValue(left) : undefined,\n \"w:leftChars\": leftChars !== undefined ? decimalNumber(leftChars) : undefined,\n \"w:right\": right !== undefined ? signedTwipsMeasureValue(right) : undefined,\n \"w:rightChars\": rightChars !== undefined ? decimalNumber(rightChars) : undefined,\n \"w:hanging\": hanging !== undefined ? twipsMeasureValue(hanging) : undefined,\n \"w:hangingChars\": hangingChars !== undefined ? decimalNumber(hangingChars) : undefined,\n \"w:firstLine\": firstLine !== undefined ? twipsMeasureValue(firstLine) : undefined,\n \"w:firstLineChars\": firstLineChars !== undefined ? decimalNumber(firstLineChars) : undefined,\n });\n","/**\n * Break module for WordprocessingML documents.\n *\n * This module provides support for line breaks within a run. A break element\n * represents a line break (line feed) within text content.\n *\n * Reference: http://officeopenxml.com/WPtextSpecialContent-break.php\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Br\">\n * <xsd:attribute name=\"type\" type=\"ST_BrType\" use=\"optional\"/>\n * <xsd:attribute name=\"clear\" type=\"ST_BrClear\" use=\"optional\"/>\n * </xsd:complexType>\n *\n * <xsd:simpleType name=\"ST_BrType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"page\"/>\n * <xsd:enumeration value=\"column\"/>\n * <xsd:enumeration value=\"textWrapping\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n *\n * <xsd:simpleType name=\"ST_BrClear\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"left\"/>\n * <xsd:enumeration value=\"right\"/>\n * <xsd:enumeration value=\"all\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates a line break element for a WordprocessingML document.\n *\n * The Break element inserts a line break (carriage return/line feed) within a run.\n * This forces text to continue on the next line without starting a new paragraph.\n *\n * Reference: http://officeopenxml.com/WPtextSpecialContent-break.php\n *\n * @example\n * ```typescript\n * // Add line breaks in a run\n * new Run({\n * children: [\n * \"First line\",\n * createBreak(),\n * \"Second line\",\n * createBreak(),\n * \"Third line\",\n * ],\n * });\n *\n * // Break with clear attribute\n * createBreak({ clear: \"all\" });\n * ```\n */\nexport const createBreak = (options?: {\n /** How text reflows after the break: \"none\", \"left\", \"right\", or \"all\" */\n readonly clear?: \"none\" | \"left\" | \"right\" | \"all\";\n}): XmlComponent =>\n new BuilderElement({\n name: \"w:br\",\n attributes: options?.clear ? [{ key: \"w:clear\", value: options.clear }] : undefined,\n });\n","/**\n * Form field module for WordprocessingML documents.\n *\n * Form fields allow creating interactive controls (checkboxes, dropdown lists,\n * text inputs) within a document. Each form field is wrapped in a field code\n * region delimited by fldChar elements (begin/separate/end), with ffData\n * attached to the begin fldChar.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_FFData, CT_FFCheckBox, CT_FFDDList, CT_FFTextInput\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Text input field type (ST_FFTextType).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_FFTextType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"regular\"/>\n * <xsd:enumeration value=\"number\"/>\n * <xsd:enumeration value=\"date\"/>\n * <xsd:enumeration value=\"currentTime\"/>\n * <xsd:enumeration value=\"currentDate\"/>\n * <xsd:enumeration value=\"calculated\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const FormFieldTextType = {\n /** Regular text input */\n REGULAR: \"regular\",\n /** Numeric input */\n NUMBER: \"number\",\n /** Date input */\n DATE: \"date\",\n /** Current time */\n CURRENT_TIME: \"currentTime\",\n /** Current date */\n CURRENT_DATE: \"currentDate\",\n /** Calculated value */\n CALCULATED: \"calculated\",\n} as const;\n\n/**\n * Options for a checkbox form field.\n */\nexport interface CheckBoxOptions {\n /**\n * Checkbox size in half-points.\n *\n * Mutually exclusive with `sizeAuto`.\n */\n readonly size?: number;\n /**\n * Whether to auto-size the checkbox to match surrounding text.\n *\n * Mutually exclusive with `size`.\n */\n readonly sizeAuto?: boolean;\n /** Default checked state */\n readonly default?: boolean;\n /** Current checked state */\n readonly checked?: boolean;\n}\n\n/**\n * Options for a dropdown list form field.\n */\nexport interface DropDownListOptions {\n /** Items in the dropdown list */\n readonly entries: readonly string[];\n /** Index of the currently selected entry */\n readonly result?: number;\n /** Index of the default entry */\n readonly default?: number;\n}\n\n/**\n * Options for a text input form field.\n */\nexport interface TextInputOptions {\n /** Text input type */\n readonly type?: (typeof FormFieldTextType)[keyof typeof FormFieldTextType];\n /** Default text value */\n readonly default?: string;\n /** Maximum character length */\n readonly maxLength?: number;\n /** Format string */\n readonly format?: string;\n}\n\n/**\n * Help or status text options.\n */\nexport interface FormFieldTextOptions {\n /** Text type: \"text\" for custom text, \"autoText\" for auto text reference */\n readonly type: \"text\" | \"autoText\";\n /** The text value */\n readonly value: string;\n}\n\n/**\n * Common options for all form field types.\n */\nexport interface FormFieldCommonOptions {\n /** Field name (max 65 characters) */\n readonly name?: string;\n /** Numeric label */\n readonly label?: number;\n /** Tab order index */\n readonly tabIndex?: number;\n /** Whether the field is enabled */\n readonly enabled?: boolean;\n /** Recalculate fields when exiting */\n readonly calcOnExit?: boolean;\n /** Entry macro name */\n readonly entryMacro?: string;\n /** Exit macro name */\n readonly exitMacro?: string;\n /** Help text shown when the user presses F1 */\n readonly helpText?: FormFieldTextOptions;\n /** Status bar text */\n readonly statusText?: FormFieldTextOptions;\n}\n\n/**\n * Options for a form field definition (CT_FFData).\n *\n * Exactly one of `checkBox`, `dropDownList`, or `textInput` must be specified.\n */\nexport interface FormFieldOptions extends FormFieldCommonOptions {\n /** Checkbox form field */\n readonly checkBox?: CheckBoxOptions;\n /** Dropdown list form field */\n readonly dropDownList?: DropDownListOptions;\n /** Text input form field */\n readonly textInput?: TextInputOptions;\n}\n\n/**\n * Creates a help or status text element.\n */\nconst createFormFieldText = (name: string, options: FormFieldTextOptions): XmlComponent =>\n new BuilderElement<{ readonly type: string; readonly val: string }>({\n attributes: {\n type: { key: \"w:type\", value: options.type },\n val: { key: \"w:val\", value: options.value },\n },\n name,\n });\n\n/**\n * Creates a checkbox form field element (w:checkBox).\n */\nconst createCheckBox = (options: CheckBoxOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.size !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: options.size } },\n name: \"w:size\",\n }),\n );\n } else if (options.sizeAuto !== undefined) {\n children.push(onOffObj(\"w:sizeAuto\", options.sizeAuto));\n }\n\n if (options.default !== undefined) {\n children.push(onOffObj(\"w:default\", options.default));\n }\n if (options.checked !== undefined) {\n children.push(onOffObj(\"w:checked\", options.checked));\n }\n\n return new BuilderElement({\n children,\n name: \"w:checkBox\",\n });\n};\n\n/**\n * Creates a dropdown list form field element (w:ddList).\n */\nconst createDropDownList = (options: DropDownListOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.result !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: options.result } },\n name: \"w:result\",\n }),\n );\n }\n if (options.default !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: options.default } },\n name: \"w:default\",\n }),\n );\n }\n for (const entry of options.entries) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: entry } },\n name: \"w:listEntry\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"w:ddList\",\n });\n};\n\n/**\n * Creates a text input form field element (w:textInput).\n */\nconst createTextInput = (options: TextInputOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.type !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: options.type } },\n name: \"w:type\",\n }),\n );\n }\n if (options.default !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: options.default } },\n name: \"w:default\",\n }),\n );\n }\n if (options.maxLength !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: options.maxLength } },\n name: \"w:maxLength\",\n }),\n );\n }\n if (options.format !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: options.format } },\n name: \"w:format\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"w:textInput\",\n });\n};\n\n/**\n * Creates a form field data element (w:ffData).\n *\n * This element contains the definition for an interactive form field\n * (checkbox, dropdown list, or text input) within a document.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FFData\">\n * <xsd:choice maxOccurs=\"unbounded\">\n * <xsd:element name=\"name\" type=\"CT_FFName\"/>\n * <xsd:element name=\"label\" type=\"CT_DecimalNumber\"/>\n * <xsd:element name=\"tabIndex\" type=\"CT_UnsignedDecimalNumber\"/>\n * <xsd:element name=\"enabled\" type=\"CT_OnOff\"/>\n * <xsd:element name=\"calcOnExit\" type=\"CT_OnOff\"/>\n * <xsd:element name=\"entryMacro\" type=\"CT_MacroName\"/>\n * <xsd:element name=\"exitMacro\" type=\"CT_MacroName\"/>\n * <xsd:element name=\"helpText\" type=\"CT_FFHelpText\"/>\n * <xsd:element name=\"statusText\" type=\"CT_FFStatusText\"/>\n * <xsd:choice>\n * <xsd:element name=\"checkBox\" type=\"CT_FFCheckBox\"/>\n * <xsd:element name=\"ddList\" type=\"CT_FFDDList\"/>\n * <xsd:element name=\"textInput\" type=\"CT_FFTextInput\"/>\n * </xsd:choice>\n * </xsd:choice>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Checkbox\n * createFormFieldData({\n * name: \"Check1\",\n * checkBox: { checked: true, sizeAuto: true },\n * });\n *\n * // Dropdown\n * createFormFieldData({\n * name: \"DropDown1\",\n * dropDownList: { entries: [\"Option A\", \"Option B\", \"Option C\"], result: 0 },\n * });\n *\n * // Text input\n * createFormFieldData({\n * name: \"Text1\",\n * textInput: { type: \"regular\", default: \"Enter text here\" },\n * });\n * ```\n */\nexport const createFormFieldData = (options: FormFieldOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.name !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: options.name } },\n name: \"w:name\",\n }),\n );\n }\n if (options.label !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: options.label } },\n name: \"w:label\",\n }),\n );\n }\n if (options.tabIndex !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: options.tabIndex } },\n name: \"w:tabIndex\",\n }),\n );\n }\n if (options.enabled !== undefined) {\n children.push(onOffObj(\"w:enabled\", options.enabled));\n }\n if (options.calcOnExit !== undefined) {\n children.push(onOffObj(\"w:calcOnExit\", options.calcOnExit));\n }\n if (options.entryMacro !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: options.entryMacro } },\n name: \"w:entryMacro\",\n }),\n );\n }\n if (options.exitMacro !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: options.exitMacro } },\n name: \"w:exitMacro\",\n }),\n );\n }\n if (options.helpText) {\n children.push(createFormFieldText(\"w:helpText\", options.helpText));\n }\n if (options.statusText) {\n children.push(createFormFieldText(\"w:statusText\", options.statusText));\n }\n\n // Exactly one of the three mutually exclusive form field types\n if (options.checkBox) {\n children.push(createCheckBox(options.checkBox));\n } else if (options.dropDownList) {\n children.push(createDropDownList(options.dropDownList));\n } else if (options.textInput) {\n children.push(createTextInput(options.textInput));\n }\n\n return new BuilderElement({\n children,\n name: \"w:ffData\",\n });\n};\n","/**\n * Field module for WordprocessingML documents.\n *\n * This module provides support for complex fields, which are regions of text\n * that can contain dynamic content such as page numbers, dates, or mail merge fields.\n * Fields are delimited by field character elements (begin, separate, end).\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport type { FormFieldOptions } from \"./form-field\";\nimport { createFormFieldData } from \"./form-field\";\n\n/**\n * Field character types that delimit field regions.\n *\n * @internal\n */\nconst FieldCharacterType = {\n BEGIN: \"begin\",\n END: \"end\",\n SEPARATE: \"separate\",\n} as const;\n\ninterface FieldCharAttributes {\n readonly type: (typeof FieldCharacterType)[keyof typeof FieldCharacterType];\n readonly dirty?: boolean;\n}\n\n/**\n * Creates a field character element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FldChar\">\n * <xsd:sequence>\n * <xsd:element name=\"fldData\" type=\"CT_Text\" minOccurs=\"0\"/>\n * <xsd:element name=\"ffData\" type=\"CT_FFData\" minOccurs=\"0\"/>\n * <xsd:element name=\"numberingChange\" type=\"CT_TrackChangeNumbering\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"fldCharType\" type=\"ST_FldCharType\" use=\"required\"/>\n * <xsd:attribute name=\"fldLock\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"dirty\" type=\"s:ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n * @internal\n */\nconst createFieldChar = (\n type: (typeof FieldCharacterType)[keyof typeof FieldCharacterType],\n dirty?: boolean,\n ffData?: XmlComponent,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n if (ffData) {\n children.push(ffData);\n }\n return new BuilderElement<FieldCharAttributes>({\n attributes: {\n dirty: { key: \"w:dirty\", value: dirty },\n type: { key: \"w:fldCharType\", value: type },\n },\n children: children.length > 0 ? children : undefined,\n name: \"w:fldChar\",\n });\n};\n\n/**\n * Creates the beginning of a complex field.\n *\n * The Begin element marks the start of a field. A field consists of a begin character,\n * field instructions, an optional separate character, field result, and an end character.\n *\n * For form fields, pass `formField` to embed `w:ffData` within the begin `w:fldChar`.\n *\n * @param dirty - Whether the field should be recalculated\n * @param formField - Optional form field data to embed in the begin character\n *\n * @example\n * ```typescript\n * // Simple field begin\n * createBegin();\n *\n * // Form field (checkbox)\n * createBegin(false, {\n * name: \"Check1\",\n * checkBox: { checked: true, sizeAuto: true },\n * });\n * ```\n */\nexport const createBegin = (dirty?: boolean, formField?: FormFieldOptions): XmlComponent =>\n createFieldChar(\n FieldCharacterType.BEGIN,\n dirty,\n formField ? createFormFieldData(formField) : undefined,\n );\n\n/**\n * Creates the separator between field code and field result in a complex field.\n *\n * The Separate element divides the field code (instructions) from the field result\n * (the computed value).\n */\nexport const createSeparate = (dirty?: boolean): XmlComponent =>\n createFieldChar(FieldCharacterType.SEPARATE, dirty);\n\n/**\n * Creates the end of a complex field.\n *\n * The End element marks the end of a field. Every field that begins with a Begin\n * element must be terminated with an End element.\n */\nexport const createEnd = (dirty?: boolean): XmlComponent =>\n createFieldChar(FieldCharacterType.END, dirty);\n","/**\n * Page number field instruction module for WordprocessingML documents.\n *\n * This module provides field instruction elements for displaying\n * page numbers, page counts, and section information.\n *\n * Reference: http://officeopenxml.com/WPfields.php\n *\n * @module\n */\nimport type { IXmlableObject } from \"@file/xml-components\";\n\nconst INSTR_TEXT_ATTRS = { _attr: { \"xml:space\": \"preserve\" } };\n\n/**\n * Builds a w:instrText element for field instructions.\n *\n * @internal\n */\nfunction buildInstrText(instruction: string): IXmlableObject {\n return { \"w:instrText\": [INSTR_TEXT_ATTRS, instruction] };\n}\n\n/**\n * Builds a PAGE field instruction.\n *\n * @internal\n */\nexport const buildPage = () => buildInstrText(\"PAGE\");\n\n/**\n * Builds a NUMPAGES field instruction.\n *\n * @internal\n */\nexport const buildNumberOfPages = () => buildInstrText(\"NUMPAGES\");\n\n/**\n * Builds a SECTIONPAGES field instruction.\n *\n * @internal\n */\nexport const buildNumberOfPagesSection = () => buildInstrText(\"SECTIONPAGES\");\n\n/**\n * Builds a SECTION field instruction.\n *\n * @internal\n */\nexport const buildCurrentSection = () => buildInstrText(\"SECTION\");\n","/**\n * Shading module for WordprocessingML documents.\n *\n * Shading is used to apply background colors and patterns to paragraphs,\n * table cells, and text runs. The shading type is identical in all places.\n *\n * Reference: http://officeopenxml.com/WPshading.php\n *\n * @see http://officeopenxml.com/WPtableShading.php\n * @see http://officeopenxml.com/WPtableCellProperties-Shading.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Shd\">\n * <xsd:attribute name=\"val\" type=\"ST_Shd\" use=\"required\"/>\n * <xsd:attribute name=\"color\" type=\"ST_HexColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"fill\" type=\"ST_HexColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFill\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFillTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFillShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { hexColorValue, uCharHexNumber } from \"@util/values\";\nimport type { ThemeColor } from \"@util/values\";\n\n/**\n * Properties for configuring shading.\n *\n * @property fill - Background fill color in hex format (e.g., \"FF0000\" for red)\n * @property color - Pattern color in hex format\n * @property type - Shading pattern type\n */\nexport interface ShadingAttributesProperties {\n readonly fill?: string;\n readonly color?: string;\n readonly type?: (typeof ShadingType)[keyof typeof ShadingType];\n /** Theme color reference */\n readonly themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme color tint (2-char hex) */\n readonly themeTint?: string;\n /** Theme color shade (2-char hex) */\n readonly themeShade?: string;\n /** Theme fill color reference */\n readonly themeFill?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme fill tint (2-char hex) */\n readonly themeFillTint?: string;\n /** Theme fill shade (2-char hex) */\n readonly themeFillShade?: string;\n}\n\n/**\n * Creates a shading element for a WordprocessingML document.\n *\n * The shd element specifies the shading applied to the paragraph,\n * table cell, or text run.\n *\n * Reference: http://officeopenxml.com/WPshading.php\n */\nexport const createShading = ({\n fill,\n color,\n type,\n themeColor,\n themeTint,\n themeShade,\n themeFill,\n themeFillTint,\n themeFillShade,\n}: ShadingAttributesProperties): XmlComponent =>\n new BuilderElement<ShadingAttributesProperties>({\n attributes: {\n color: {\n key: \"w:color\",\n value: color === undefined ? undefined : hexColorValue(color),\n },\n fill: { key: \"w:fill\", value: fill === undefined ? undefined : hexColorValue(fill) },\n themeColor: { key: \"w:themeColor\", value: themeColor },\n themeFill: { key: \"w:themeFill\", value: themeFill },\n themeFillShade: {\n key: \"w:themeFillShade\",\n value: themeFillShade === undefined ? undefined : uCharHexNumber(themeFillShade),\n },\n themeFillTint: {\n key: \"w:themeFillTint\",\n value: themeFillTint === undefined ? undefined : uCharHexNumber(themeFillTint),\n },\n themeShade: {\n key: \"w:themeShade\",\n value: themeShade === undefined ? undefined : uCharHexNumber(themeShade),\n },\n themeTint: {\n key: \"w:themeTint\",\n value: themeTint === undefined ? undefined : uCharHexNumber(themeTint),\n },\n type: { key: \"w:val\", value: type ?? \"clear\" },\n },\n name: \"w:shd\",\n });\n\nexport const buildShadingObj = ({\n fill,\n color,\n type,\n themeColor,\n themeTint,\n themeShade,\n themeFill,\n themeFillTint,\n themeFillShade,\n}: ShadingAttributesProperties): IXmlableObject =>\n attrObj(\"w:shd\", {\n \"w:val\": type ?? \"clear\",\n \"w:color\": color !== undefined ? hexColorValue(color) : undefined,\n \"w:fill\": fill !== undefined ? hexColorValue(fill) : undefined,\n \"w:themeColor\": themeColor,\n \"w:themeTint\": themeTint !== undefined ? uCharHexNumber(themeTint) : undefined,\n \"w:themeShade\": themeShade !== undefined ? uCharHexNumber(themeShade) : undefined,\n \"w:themeFill\": themeFill,\n \"w:themeFillTint\": themeFillTint !== undefined ? uCharHexNumber(themeFillTint) : undefined,\n \"w:themeFillShade\": themeFillShade !== undefined ? uCharHexNumber(themeFillShade) : undefined,\n });\n\n/**\n * Shading pattern types.\n *\n * Specifies the pattern used for shading. The pattern combines the fill\n * color and the pattern color.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Shd\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"nil\"/>\n * <xsd:enumeration value=\"clear\"/>\n * <xsd:enumeration value=\"solid\"/>\n * <xsd:enumeration value=\"horzStripe\"/>\n * <xsd:enumeration value=\"vertStripe\"/>\n * <xsd:enumeration value=\"reverseDiagStripe\"/>\n * <xsd:enumeration value=\"diagStripe\"/>\n * <xsd:enumeration value=\"horzCross\"/>\n * <xsd:enumeration value=\"diagCross\"/>\n * <!-- ... percent values ... -->\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const ShadingType = {\n /** Clear shading - no pattern, fill color only */\n CLEAR: \"clear\",\n DIAGONAL_CROSS: \"diagCross\",\n DIAGONAL_STRIPE: \"diagStripe\",\n HORIZONTAL_CROSS: \"horzCross\",\n HORIZONTAL_STRIPE: \"horzStripe\",\n NIL: \"nil\",\n PERCENT_10: \"pct10\",\n PERCENT_12: \"pct12\",\n PERCENT_15: \"pct15\",\n PERCENT_20: \"pct20\",\n PERCENT_25: \"pct25\",\n PERCENT_30: \"pct30\",\n PERCENT_35: \"pct35\",\n PERCENT_37: \"pct37\",\n PERCENT_40: \"pct40\",\n PERCENT_45: \"pct45\",\n PERCENT_5: \"pct5\",\n PERCENT_50: \"pct50\",\n PERCENT_55: \"pct55\",\n PERCENT_60: \"pct60\",\n PERCENT_62: \"pct62\",\n PERCENT_65: \"pct65\",\n PERCENT_70: \"pct70\",\n PERCENT_75: \"pct75\",\n PERCENT_80: \"pct80\",\n PERCENT_85: \"pct85\",\n PERCENT_87: \"pct87\",\n PERCENT_90: \"pct90\",\n PERCENT_95: \"pct95\",\n REVERSE_DIAGONAL_STRIPE: \"reverseDiagStripe\",\n SOLID: \"solid\",\n THIN_DIAGONAL_CROSS: \"thinDiagCross\",\n THIN_DIAGONAL_STRIPE: \"thinDiagStripe\",\n THIN_HORIZONTAL_CROSS: \"thinHorzCross\",\n THIN_REVERSE_DIAGONAL_STRIPE: \"thinReverseDiagStripe\",\n THIN_VERTICAL_STRIPE: \"thinVertStripe\",\n VERTICAL_STRIPE: \"vertStripe\",\n} as const;\n","/**\n * Shading module exports.\n *\n * @module\n */\nexport * from \"./shading\";\n","import { XmlComponent } from \"@file/xml-components\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\nexport class DeletionTrackChange extends XmlComponent {\n public constructor(options: ChangedAttributesProperties) {\n super(\"w:del\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\nexport class InsertionTrackChange extends XmlComponent {\n public constructor(options: ChangedAttributesProperties) {\n super(\"w:ins\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n }\n}\n","/**\n * East Asian layout module for WordprocessingML run properties.\n *\n * Specifies East Asian typography settings for a run, including\n * character combination, vertical text, and compression.\n *\n * Reference: ISO/IEC 29500-4, CT_EastAsianLayout\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Bracket types for combined characters in East Asian layout.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_CombineBrackets\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"round\"/>\n * <xsd:enumeration value=\"square\"/>\n * <xsd:enumeration value=\"angle\"/>\n * <xsd:enumeration value=\"curly\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const CombineBracketsType = {\n /** No brackets */\n NONE: \"none\",\n /** Round brackets (parentheses) */\n ROUND: \"round\",\n /** Square brackets */\n SQUARE: \"square\",\n /** Angle brackets */\n ANGLE: \"angle\",\n /** Curly brackets (braces) */\n CURLY: \"curly\",\n} as const;\n\n/**\n * Options for East Asian layout properties.\n */\nexport interface EastAsianLayoutOptions {\n /** Character combination ID (referencing a combined character entry) */\n readonly id?: number;\n /** Whether to combine characters */\n readonly combine?: boolean;\n /** Bracket type for combined characters */\n readonly combineBrackets?: (typeof CombineBracketsType)[keyof typeof CombineBracketsType];\n /** Whether to render text vertically */\n readonly vert?: boolean;\n /** Whether to compress characters in vertical text */\n readonly vertCompress?: boolean;\n}\n\n/**\n * Creates an East Asian layout element (w:eastAsianLayout) for a run.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EastAsianLayout\">\n * <xsd:attribute name=\"id\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"combine\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"combineBrackets\" type=\"ST_CombineBrackets\" use=\"optional\"/>\n * <xsd:attribute name=\"vert\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"vertCompress\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createEastAsianLayout = ({\n id,\n combine,\n combineBrackets,\n vert,\n vertCompress,\n}: EastAsianLayoutOptions): XmlComponent =>\n new BuilderElement<EastAsianLayoutOptions>({\n attributes: {\n combine: { key: \"w:combine\", value: combine },\n combineBrackets: { key: \"w:combineBrackets\", value: combineBrackets },\n id: { key: \"w:id\", value: id === undefined ? undefined : decimalNumber(id) },\n vert: { key: \"w:vert\", value: vert },\n vertCompress: { key: \"w:vertCompress\", value: vertCompress },\n },\n name: \"w:eastAsianLayout\",\n });\n\n/**\n * Build East Asian layout (w:eastAsianLayout) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildEastAsianLayoutObj = ({\n id,\n combine,\n combineBrackets,\n vert,\n vertCompress,\n}: EastAsianLayoutOptions): IXmlableObject =>\n attrObj(\"w:eastAsianLayout\", {\n \"w:combine\": combine,\n \"w:combineBrackets\": combineBrackets,\n \"w:id\": id === undefined ? undefined : decimalNumber(id),\n \"w:vert\": vert,\n \"w:vertCompress\": vertCompress,\n });\n","/**\n * Emphasis mark module for WordprocessingML run properties.\n *\n * This module provides support for East Asian emphasis marks, which are\n * characters placed above or below text to emphasize it.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Emphasis mark types.\n *\n * Defines the types of emphasis marks that can be applied to text.\n * Emphasis marks are commonly used in East Asian typography.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Em\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"dot\"/>\n * <xsd:enumeration value=\"comma\"/>\n * <xsd:enumeration value=\"circle\"/>\n * <xsd:enumeration value=\"underDot\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const EmphasisMarkType = {\n /** No emphasis mark */\n NONE: \"none\",\n /** Comma emphasis mark */\n COMMA: \"comma\",\n /** Circle emphasis mark */\n CIRCLE: \"circle\",\n /** Dot emphasis mark */\n DOT: \"dot\",\n /** Under dot emphasis mark */\n UNDER_DOT: \"underDot\",\n} as const;\n\ninterface EmphasisMarkAttributes {\n readonly val: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType];\n}\n\n/**\n * Creates an emphasis mark element for a WordprocessingML document.\n *\n * Emphasis marks are characters (typically dots or circles) placed above or below\n * text to emphasize it. This is commonly used in East Asian typography.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Em\">\n * <xsd:attribute name=\"val\" type=\"ST_Em\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Apply dot emphasis mark\n * createEmphasisMark(EmphasisMarkType.DOT);\n *\n * // Default to dot\n * createEmphasisMark();\n * ```\n */\nexport const createEmphasisMark = (\n emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType] = EmphasisMarkType.DOT,\n): XmlComponent =>\n new BuilderElement<EmphasisMarkAttributes>({\n attributes: {\n val: { key: \"w:val\", value: emphasisMarkType },\n },\n name: \"w:em\",\n });\n\n/**\n * Creates a dot emphasis mark.\n *\n * Convenience function for applying a dot emphasis mark to text.\n */\nexport const createDotEmphasisMark = (): XmlComponent => createEmphasisMark(EmphasisMarkType.DOT);\n\n/**\n * Build emphasis mark (w:em) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildEmphasisMarkObj = (\n emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType] = EmphasisMarkType.DOT,\n): IXmlableObject => attrObj(\"w:em\", { \"w:val\": emphasisMarkType });\n","/**\n * Run formatting module for WordprocessingML documents.\n *\n * This module provides character-level formatting elements including\n * spacing, color, and highlighting.\n *\n * Reference: http://officeopenxml.com/WPtextFormatting.php\n *\n * @module\n */\nimport { XmlComponent, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { hexColorValue, signedTwipsMeasureValue, uCharHexNumber } from \"@util/values\";\nimport type { ThemeColor, UniversalMeasure } from \"@util/values\";\n\n/**\n * Options for theme color configuration.\n *\n * @property val - Explicit hex color value (e.g., \"FF0000\" or \"auto\")\n * @property themeColor - Theme color reference\n * @property themeTint - Theme color tint (2-char hex, e.g., \"99\")\n * @property themeShade - Theme color shade (2-char hex, e.g., \"BF\")\n */\nexport interface ColorOptions {\n readonly val?: string;\n readonly themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor];\n readonly themeTint?: string;\n readonly themeShade?: string;\n}\n\n/**\n * Represents character spacing (tracking) in a run.\n *\n * Adjusts the space between characters in the text.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SignedTwipsMeasure\">\n * <xsd:attribute name=\"val\" type=\"ST_SignedTwipsMeasure\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new CharacterSpacing(20); // 20 twips (1 point)\n * new CharacterSpacing(\"0.5pt\"); // Half point\n * ```\n *\n * @internal\n */\nexport class CharacterSpacing extends XmlComponent {\n public constructor(value: number | UniversalMeasure) {\n super(\"w:spacing\");\n this.root.push({ _attr: { \"w:val\": signedTwipsMeasureValue(value) } });\n }\n}\n\n/**\n * Represents text color in a run.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Color\">\n * <xsd:attribute name=\"val\" type=\"ST_HexColor\" use=\"required\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Color(\"FF0000\"); // Red text (backward compatible)\n * new Color(\"auto\"); // Automatic color\n * new Color({ themeColor: ThemeColor.ACCENT1, themeTint: \"99\" }); // Theme color with tint\n * ```\n *\n * @internal\n */\nexport class Color extends XmlComponent {\n public constructor(colorOrOptions: string | ColorOptions) {\n super(\"w:color\");\n\n if (typeof colorOrOptions === \"string\") {\n this.root.push({ _attr: { \"w:val\": hexColorValue(colorOrOptions) } });\n return;\n }\n\n const opts = colorOrOptions;\n const attrs: Record<string, string> = {};\n if (opts.val !== undefined) {\n attrs[\"w:val\"] = hexColorValue(opts.val);\n }\n if (opts.themeColor !== undefined) {\n attrs[\"w:themeColor\"] = opts.themeColor;\n }\n if (opts.themeTint !== undefined) {\n attrs[\"w:themeTint\"] = uCharHexNumber(opts.themeTint);\n }\n if (opts.themeShade !== undefined) {\n attrs[\"w:themeShade\"] = uCharHexNumber(opts.themeShade);\n }\n this.root.push({ _attr: attrs });\n }\n}\n\n/**\n * Represents text highlighting in a run.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_HighlightColor\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"black\"/>\n * <xsd:enumeration value=\"blue\"/>\n * <xsd:enumeration value=\"cyan\"/>\n * <xsd:enumeration value=\"green\"/>\n * <xsd:enumeration value=\"magenta\"/>\n * <xsd:enumeration value=\"red\"/>\n * <xsd:enumeration value=\"yellow\"/>\n * <xsd:enumeration value=\"white\"/>\n * <xsd:enumeration value=\"darkBlue\"/>\n * <xsd:enumeration value=\"darkCyan\"/>\n * <xsd:enumeration value=\"darkGreen\"/>\n * <xsd:enumeration value=\"darkMagenta\"/>\n * <xsd:enumeration value=\"darkRed\"/>\n * <xsd:enumeration value=\"darkYellow\"/>\n * <xsd:enumeration value=\"darkGray\"/>\n * <xsd:enumeration value=\"lightGray\"/>\n * <xsd:enumeration value=\"none\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @example\n * ```typescript\n * new Highlight(\"yellow\"); // Yellow highlight\n * new Highlight(\"cyan\"); // Cyan highlight\n * ```\n *\n * @internal\n */\nexport class Highlight extends XmlComponent {\n public constructor(color: string) {\n super(\"w:highlight\");\n this.root.push({ _attr: { \"w:val\": color } });\n }\n}\n\n/**\n * Represents text highlighting for complex scripts.\n *\n * Used for highlighting text in complex script languages\n * (e.g., Arabic, Hebrew, Thai).\n *\n * @internal\n */\nexport class HighlightComplexScript extends XmlComponent {\n public constructor(color: string) {\n super(\"w:highlightCs\");\n this.root.push({ _attr: { \"w:val\": color } });\n }\n}\n\n/**\n * Build character spacing (w:spacing) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildCharacterSpacingObj = (value: number | UniversalMeasure): IXmlableObject =>\n attrObj(\"w:spacing\", { \"w:val\": signedTwipsMeasureValue(value) });\n\n/**\n * Build text color (w:color) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildColorObj = (colorOrOptions: string | ColorOptions): IXmlableObject => {\n if (typeof colorOrOptions === \"string\") {\n return attrObj(\"w:color\", { \"w:val\": hexColorValue(colorOrOptions) });\n }\n\n const opts = colorOrOptions;\n return attrObj(\"w:color\", {\n \"w:val\": opts.val === undefined ? undefined : hexColorValue(opts.val),\n \"w:themeColor\": opts.themeColor,\n \"w:themeTint\": opts.themeTint === undefined ? undefined : uCharHexNumber(opts.themeTint),\n \"w:themeShade\": opts.themeShade === undefined ? undefined : uCharHexNumber(opts.themeShade),\n });\n};\n\n/**\n * Build highlight (w:highlight) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildHighlightObj = (color: string): IXmlableObject =>\n attrObj(\"w:highlight\", { \"w:val\": color });\n\n/**\n * Build complex script highlight (w:highlightCs) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildHighlightComplexScriptObj = (color: string): IXmlableObject =>\n attrObj(\"w:highlightCs\", { \"w:val\": color });\n","/**\n * Language module for WordprocessingML run properties.\n *\n * This module provides support for specifying the language of text content,\n * which affects spell checking, grammar checking, and hyphenation.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for language settings.\n *\n * Specifies the language for different text types within a run.\n * Language codes should follow RFC 1766 (e.g., \"en-US\", \"fr-FR\", \"ja-JP\").\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Language\">\n * <xsd:attribute name=\"val\" type=\"s:ST_Lang\" use=\"optional\"/>\n * <xsd:attribute name=\"eastAsia\" type=\"s:ST_Lang\" use=\"optional\"/>\n * <xsd:attribute name=\"bidi\" type=\"s:ST_Lang\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @property value - Language for Latin and complex script text (e.g., \"en-US\")\n * @property eastAsia - Language for East Asian text (e.g., \"ja-JP\", \"zh-CN\")\n * @property bidirectional - Language for bidirectional text (e.g., \"ar-SA\", \"he-IL\")\n */\nexport interface LanguageOptions {\n /** Language for Latin and complex script text (RFC 1766 format, e.g., \"en-US\") */\n readonly value?: string;\n /** Language for East Asian text (RFC 1766 format, e.g., \"ja-JP\") */\n readonly eastAsia?: string;\n /** Language for bidirectional text (RFC 1766 format, e.g., \"ar-SA\") */\n readonly bidirectional?: string;\n}\n\n/**\n * Creates a language component for run properties.\n *\n * This function creates a language element that specifies the language for text content.\n * The language setting affects spell checking, grammar checking, and hyphenation.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @param options - Language options for different text types\n * @returns XmlComponent representing the language element\n *\n * @example\n * ```typescript\n * // Set language for English (US)\n * createLanguageComponent({ value: \"en-US\" });\n *\n * // Set different languages for different scripts\n * createLanguageComponent({\n * value: \"en-US\",\n * eastAsia: \"ja-JP\",\n * bidirectional: \"ar-SA\",\n * });\n * ```\n */\nexport const createLanguageComponent = (options: LanguageOptions): XmlComponent =>\n new BuilderElement<{\n readonly value?: string;\n readonly eastAsia?: string;\n readonly bidirectional?: string;\n }>({\n attributes: {\n bidirectional: {\n key: \"w:bidi\",\n value: options.bidirectional,\n },\n eastAsia: {\n key: \"w:eastAsia\",\n value: options.eastAsia,\n },\n value: {\n key: \"w:val\",\n value: options.value,\n },\n },\n name: \"w:lang\",\n });\n\n/**\n * Build language (w:lang) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildLanguageObj = (options: LanguageOptions): IXmlableObject =>\n attrObj(\"w:lang\", {\n \"w:bidi\": options.bidirectional,\n \"w:eastAsia\": options.eastAsia,\n \"w:val\": options.value,\n });\n","/**\n * Run fonts module for WordprocessingML documents.\n *\n * This module provides support for specifying fonts for different character sets\n * within a run. Fonts can be specified separately for ASCII, complex script (CS),\n * East Asian, and high ANSI character ranges.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport type { ThemeFont } from \"@util/values\";\n\n/**\n * Options for font attributes across different character sets.\n *\n * @property ascii - Font for ASCII characters (0x00-0x7F)\n * @property cs - Font for complex script characters\n * @property eastAsia - Font for East Asian characters\n * @property hAnsi - Font for high ANSI characters (0x80-0xFF)\n * @property hint - Hint for font selection algorithm\n * @property asciiTheme - Theme font for ASCII characters\n * @property hAnsiTheme - Theme font for high ANSI characters\n * @property eastAsiaTheme - Theme font for East Asian characters\n * @property cstheme - Theme font for complex script characters\n */\nexport interface FontAttributesProperties {\n /** Font for ASCII characters (0x00-0x7F) */\n readonly ascii?: string;\n /** Font for complex script characters */\n readonly cs?: string;\n /** Font for East Asian characters */\n readonly eastAsia?: string;\n /** Font for high ANSI characters (0x80-0xFF) */\n readonly hAnsi?: string;\n /** Hint for font selection algorithm */\n readonly hint?: string;\n /** Theme font for ASCII characters */\n readonly asciiTheme?: (typeof ThemeFont)[keyof typeof ThemeFont];\n /** Theme font for high ANSI characters */\n readonly hAnsiTheme?: (typeof ThemeFont)[keyof typeof ThemeFont];\n /** Theme font for East Asian characters */\n readonly eastAsiaTheme?: (typeof ThemeFont)[keyof typeof ThemeFont];\n /** Theme font for complex script characters */\n readonly cstheme?: (typeof ThemeFont)[keyof typeof ThemeFont];\n}\n\n/**\n * Creates font settings for a run in a WordprocessingML document.\n *\n * The rFonts element specifies which fonts should be used for different character\n * ranges in a run. This allows documents to use different fonts for ASCII, complex\n * script, East Asian, and high ANSI characters.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Fonts\">\n * <xsd:attribute name=\"hint\" type=\"ST_Hint\"/>\n * <xsd:attribute name=\"ascii\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"hAnsi\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"eastAsia\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"cs\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"asciiTheme\" type=\"ST_Theme\"/>\n * <xsd:attribute name=\"hAnsiTheme\" type=\"ST_Theme\"/>\n * <xsd:attribute name=\"eastAsiaTheme\" type=\"ST_Theme\"/>\n * <xsd:attribute name=\"cstheme\" type=\"ST_Theme\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Use same font for all character sets\n * createRunFonts(\"Arial\");\n *\n * // Specify different fonts for different character sets\n * createRunFonts({\n * ascii: \"Arial\",\n * eastAsia: \"MS Mincho\",\n * cs: \"Arial\",\n * hAnsi: \"Arial\",\n * });\n * ```\n */\nexport const createRunFonts = (\n nameOrAttrs: string | FontAttributesProperties,\n hint?: string,\n): XmlComponent => {\n if (typeof nameOrAttrs === \"string\") {\n const name = nameOrAttrs;\n return new BuilderElement<FontAttributesProperties>({\n attributes: {\n ascii: { key: \"w:ascii\", value: name },\n cs: { key: \"w:cs\", value: name },\n eastAsia: { key: \"w:eastAsia\", value: name },\n hAnsi: { key: \"w:hAnsi\", value: name },\n hint: { key: \"w:hint\", value: hint },\n },\n name: \"w:rFonts\",\n });\n }\n\n const attrs = nameOrAttrs;\n return new BuilderElement<FontAttributesProperties>({\n attributes: {\n ascii: { key: \"w:ascii\", value: attrs.ascii },\n asciiTheme: { key: \"w:asciiTheme\", value: attrs.asciiTheme },\n cs: { key: \"w:cs\", value: attrs.cs },\n cstheme: { key: \"w:cstheme\", value: attrs.cstheme },\n eastAsia: { key: \"w:eastAsia\", value: attrs.eastAsia },\n eastAsiaTheme: { key: \"w:eastAsiaTheme\", value: attrs.eastAsiaTheme },\n hAnsi: { key: \"w:hAnsi\", value: attrs.hAnsi },\n hAnsiTheme: { key: \"w:hAnsiTheme\", value: attrs.hAnsiTheme },\n hint: { key: \"w:hint\", value: attrs.hint },\n },\n name: \"w:rFonts\",\n });\n};\n\n/**\n * Build run fonts (w:rFonts) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildRunFontsObj = (\n nameOrAttrs: string | FontAttributesProperties,\n hint?: string,\n): IXmlableObject => {\n if (typeof nameOrAttrs === \"string\") {\n const name = nameOrAttrs;\n return attrObj(\"w:rFonts\", {\n \"w:ascii\": name,\n \"w:cs\": name,\n \"w:eastAsia\": name,\n \"w:hAnsi\": name,\n \"w:hint\": hint,\n });\n }\n\n const attrs = nameOrAttrs;\n return attrObj(\"w:rFonts\", {\n \"w:ascii\": attrs.ascii,\n \"w:asciiTheme\": attrs.asciiTheme,\n \"w:cs\": attrs.cs,\n \"w:cstheme\": attrs.cstheme,\n \"w:eastAsia\": attrs.eastAsia,\n \"w:eastAsiaTheme\": attrs.eastAsiaTheme,\n \"w:hAnsi\": attrs.hAnsi,\n \"w:hAnsiTheme\": attrs.hAnsiTheme,\n \"w:hint\": attrs.hint,\n });\n};\n","/**\n * Underline module for WordprocessingML documents.\n *\n * This module provides support for underlining text with various styles and colors.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { hexColorValue, uCharHexNumber } from \"@util/values\";\nimport type { ThemeColor } from \"@util/values\";\n\n/**\n * Underline style types for text.\n *\n * Defines the various underline patterns that can be applied to text runs.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Underline\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"single\"/>\n * <xsd:enumeration value=\"words\"/>\n * <xsd:enumeration value=\"double\"/>\n * <xsd:enumeration value=\"thick\"/>\n * <xsd:enumeration value=\"dotted\"/>\n * <xsd:enumeration value=\"dottedHeavy\"/>\n * <xsd:enumeration value=\"dash\"/>\n * <xsd:enumeration value=\"dashedHeavy\"/>\n * <xsd:enumeration value=\"dashLong\"/>\n * <xsd:enumeration value=\"dashLongHeavy\"/>\n * <xsd:enumeration value=\"dotDash\"/>\n * <xsd:enumeration value=\"dashDotHeavy\"/>\n * <xsd:enumeration value=\"dotDotDash\"/>\n * <xsd:enumeration value=\"dashDotDotHeavy\"/>\n * <xsd:enumeration value=\"wave\"/>\n * <xsd:enumeration value=\"wavyHeavy\"/>\n * <xsd:enumeration value=\"wavyDouble\"/>\n * <xsd:enumeration value=\"none\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const UnderlineType = {\n /** Single underline */\n SINGLE: \"single\",\n /** Underline words only (not spaces) */\n WORDS: \"words\",\n /** Double underline */\n DOUBLE: \"double\",\n /** Thick single underline */\n THICK: \"thick\",\n /** Dotted underline */\n DOTTED: \"dotted\",\n /** Heavy dotted underline */\n DOTTEDHEAVY: \"dottedHeavy\",\n /** Dashed underline */\n DASH: \"dash\",\n /** Heavy dashed underline */\n DASHEDHEAVY: \"dashedHeavy\",\n /** Long dashed underline */\n DASHLONG: \"dashLong\",\n /** Heavy long dashed underline */\n DASHLONGHEAVY: \"dashLongHeavy\",\n /** Dot-dash underline */\n DOTDASH: \"dotDash\",\n /** Heavy dot-dash underline */\n DASHDOTHEAVY: \"dashDotHeavy\",\n /** Dot-dot-dash underline */\n DOTDOTDASH: \"dotDotDash\",\n /** Heavy dot-dot-dash underline */\n DASHDOTDOTHEAVY: \"dashDotDotHeavy\",\n /** Wave underline */\n WAVE: \"wave\",\n /** Heavy wave underline */\n WAVYHEAVY: \"wavyHeavy\",\n /** Double wave underline */\n WAVYDOUBLE: \"wavyDouble\",\n /** No underline */\n NONE: \"none\",\n} as const;\n\ninterface UnderlineAttributes {\n readonly val: (typeof UnderlineType)[keyof typeof UnderlineType];\n readonly color?: string;\n readonly themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor];\n readonly themeTint?: string;\n readonly themeShade?: string;\n}\n\n/**\n * Creates underline formatting for a run in a WordprocessingML document.\n *\n * The u element specifies the style and optional color of underline\n * formatting applied to text.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Underline\">\n * <xsd:attribute name=\"val\" type=\"ST_Underline\" use=\"required\"/>\n * <xsd:attribute name=\"color\" type=\"ST_HexColor\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple single underline\n * createUnderline();\n *\n * // Double underline\n * createUnderline(UnderlineType.DOUBLE);\n *\n * // Red wavy underline\n * createUnderline(UnderlineType.WAVE, \"FF0000\");\n * ```\n */\nexport const createUnderline = (\n underlineType: (typeof UnderlineType)[keyof typeof UnderlineType] = UnderlineType.SINGLE,\n color?: string,\n themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor],\n themeTint?: string,\n themeShade?: string,\n): XmlComponent =>\n new BuilderElement<UnderlineAttributes>({\n attributes: {\n color: {\n key: \"w:color\",\n value: color === undefined ? undefined : hexColorValue(color),\n },\n themeColor: { key: \"w:themeColor\", value: themeColor },\n themeShade: {\n key: \"w:themeShade\",\n value: themeShade === undefined ? undefined : uCharHexNumber(themeShade),\n },\n themeTint: {\n key: \"w:themeTint\",\n value: themeTint === undefined ? undefined : uCharHexNumber(themeTint),\n },\n val: { key: \"w:val\", value: underlineType },\n },\n name: \"w:u\",\n });\n\n/**\n * Build underline (w:u) as IXmlableObject without allocating XmlComponent tree.\n */\nexport const buildUnderlineObj = (\n underlineType: (typeof UnderlineType)[keyof typeof UnderlineType] = UnderlineType.SINGLE,\n color?: string,\n themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor],\n themeTint?: string,\n themeShade?: string,\n): IXmlableObject =>\n attrObj(\"w:u\", {\n \"w:color\": color === undefined ? undefined : hexColorValue(color),\n \"w:themeColor\": themeColor,\n \"w:themeShade\": themeShade === undefined ? undefined : uCharHexNumber(themeShade),\n \"w:themeTint\": themeTint === undefined ? undefined : uCharHexNumber(themeTint),\n \"w:val\": underlineType,\n });\n","/**\n * Run properties module for WordprocessingML documents.\n *\n * This module provides the run properties (rPr) element which specifies\n * the formatting applied to a run of text.\n *\n * Reference: https://www.ecma-international.org/wp-content/uploads/ECMA-376-1_5th_edition_december_2016.zip\n * Section 17.3.2.21 (page 297)\n *\n * @module\n */\nimport { buildBorderObj } from \"@file/border\";\nimport type { BorderOptions } from \"@file/border\";\nimport { buildShadingObj } from \"@file/shading\";\nimport type { ShadingAttributesProperties } from \"@file/shading\";\nimport type { ChangedAttributesProperties } from \"@file/track-revision/track-revision\";\nimport { DeletionTrackChange } from \"@file/track-revision/track-revision-components/deletion-track-change\";\nimport { InsertionTrackChange } from \"@file/track-revision/track-revision-components/insertion-track-change\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { IgnoreIfEmptyXmlComponent, XmlComponent } from \"@file/xml-components\";\nimport {\n onOffObj,\n hpsMeasureObj,\n stringEnumValObj,\n stringValObj,\n numberValObj,\n} from \"@office-open/core\";\nimport type { PositiveUniversalMeasure, UniversalMeasure } from \"@util/values\";\n\nimport { buildEastAsianLayoutObj } from \"./east-asian-layout\";\nimport type { EastAsianLayoutOptions } from \"./east-asian-layout\";\nimport { buildEmphasisMarkObj } from \"./emphasis-mark\";\nimport type { EmphasisMarkType } from \"./emphasis-mark\";\nimport {\n buildCharacterSpacingObj,\n buildColorObj,\n buildHighlightObj,\n buildHighlightComplexScriptObj,\n} from \"./formatting\";\nimport type { ColorOptions } from \"./formatting\";\nimport { buildLanguageObj } from \"./language\";\nimport type { LanguageOptions } from \"./language\";\nimport { buildRunFontsObj } from \"./run-fonts\";\nimport type { FontAttributesProperties } from \"./run-fonts\";\nimport { buildUnderlineObj } from \"./underline\";\nimport type { UnderlineType } from \"./underline\";\n\ninterface RunFontReference {\n readonly name: string;\n readonly hint?: string;\n}\n\n/**\n * Text animation effect types.\n *\n * These effects specify animations that can be applied to text. Note that\n * these effects are deprecated and may not be supported by all applications.\n *\n * Reference: http://officeopenxml.com/WPtextFormatting.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TextEffect\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"blinkBackground\"/>\n * <xsd:enumeration value=\"lights\"/>\n * <xsd:enumeration value=\"antsBlack\"/>\n * <xsd:enumeration value=\"antsRed\"/>\n * <xsd:enumeration value=\"shimmer\"/>\n * <xsd:enumeration value=\"sparkle\"/>\n * <xsd:enumeration value=\"none\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const TextEffect = {\n /** Blinking background animation */\n BLINK_BACKGROUND: \"blinkBackground\",\n /** Lights animation effect */\n LIGHTS: \"lights\",\n /** Black marching ants animation */\n ANTS_BLACK: \"antsBlack\",\n /** Red marching ants animation */\n ANTS_RED: \"antsRed\",\n /** Shimmer animation effect */\n SHIMMER: \"shimmer\",\n /** Sparkle animation effect */\n SPARKLE: \"sparkle\",\n /** No text effect */\n NONE: \"none\",\n} as const;\n\n/**\n * Highlight color values for text highlighting.\n *\n * These colors specify the background highlight color that can be applied to text.\n *\n * Reference: http://officeopenxml.com/WPtextShading.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_HighlightColor\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"black\"/>\n * <xsd:enumeration value=\"blue\"/>\n * <xsd:enumeration value=\"cyan\"/>\n * <xsd:enumeration value=\"green\"/>\n * <xsd:enumeration value=\"magenta\"/>\n * <xsd:enumeration value=\"red\"/>\n * <xsd:enumeration value=\"yellow\"/>\n * <xsd:enumeration value=\"white\"/>\n * <xsd:enumeration value=\"darkBlue\"/>\n * <xsd:enumeration value=\"darkCyan\"/>\n * <xsd:enumeration value=\"darkGreen\"/>\n * <xsd:enumeration value=\"darkMagenta\"/>\n * <xsd:enumeration value=\"darkRed\"/>\n * <xsd:enumeration value=\"darkYellow\"/>\n * <xsd:enumeration value=\"darkGray\"/>\n * <xsd:enumeration value=\"lightGray\"/>\n * <xsd:enumeration value=\"none\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const HighlightColor = {\n /** Black highlight */\n BLACK: \"black\",\n /** Blue highlight */\n BLUE: \"blue\",\n /** Cyan highlight */\n CYAN: \"cyan\",\n /** Dark blue highlight */\n DARK_BLUE: \"darkBlue\",\n /** Dark cyan highlight */\n DARK_CYAN: \"darkCyan\",\n /** Dark gray highlight */\n DARK_GRAY: \"darkGray\",\n /** Dark green highlight */\n DARK_GREEN: \"darkGreen\",\n /** Dark magenta highlight */\n DARK_MAGENTA: \"darkMagenta\",\n /** Dark red highlight */\n DARK_RED: \"darkRed\",\n /** Dark yellow highlight */\n DARK_YELLOW: \"darkYellow\",\n /** Green highlight */\n GREEN: \"green\",\n /** Light gray highlight */\n LIGHT_GRAY: \"lightGray\",\n /** Magenta highlight */\n MAGENTA: \"magenta\",\n /** No highlight */\n NONE: \"none\",\n /** Red highlight */\n RED: \"red\",\n /** White highlight */\n WHITE: \"white\",\n /** Yellow highlight */\n YELLOW: \"yellow\",\n} as const;\n\n/**\n * Run style properties options.\n *\n * These properties define the formatting that can be applied to a run of text,\n * including font, size, bold, italic, underline, color, and other character formatting.\n *\n * Reference: http://officeopenxml.com/WPtextFormatting.php\n */\nexport interface RunStylePropertiesOptions {\n readonly noProof?: boolean;\n readonly bold?: boolean;\n readonly boldComplexScript?: boolean;\n readonly italics?: boolean;\n readonly italicsComplexScript?: boolean;\n readonly underline?: {\n readonly color?: string;\n readonly type?: (typeof UnderlineType)[keyof typeof UnderlineType];\n };\n readonly effect?: (typeof TextEffect)[keyof typeof TextEffect];\n readonly emphasisMark?: {\n readonly type?: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType];\n };\n readonly color?: string | ColorOptions;\n readonly kern?: number | PositiveUniversalMeasure;\n readonly position?: UniversalMeasure;\n readonly size?: number | PositiveUniversalMeasure;\n readonly sizeComplexScript?: boolean | number | PositiveUniversalMeasure;\n readonly rightToLeft?: boolean;\n readonly smallCaps?: boolean;\n readonly allCaps?: boolean;\n readonly strike?: boolean;\n readonly doubleStrike?: boolean;\n readonly subScript?: boolean;\n readonly superScript?: boolean;\n readonly font?: string | RunFontReference | FontAttributesProperties;\n readonly highlight?: (typeof HighlightColor)[keyof typeof HighlightColor];\n readonly highlightComplexScript?: boolean | string;\n readonly characterSpacing?: number;\n readonly shading?: ShadingAttributesProperties;\n readonly emboss?: boolean;\n readonly imprint?: boolean;\n readonly revision?: IRunPropertiesChangeOptions;\n readonly language?: LanguageOptions;\n readonly border?: BorderOptions;\n readonly snapToGrid?: boolean;\n readonly vanish?: boolean;\n readonly specVanish?: boolean;\n readonly scale?: number;\n readonly math?: boolean;\n readonly outline?: boolean;\n readonly shadow?: boolean;\n readonly webHidden?: boolean;\n readonly fitText?: number;\n readonly complexScript?: boolean;\n readonly eastAsianLayout?: EastAsianLayoutOptions;\n}\n\n/**\n * Options for configuring run properties.\n *\n * Extends RunStylePropertiesOptions with a style reference.\n */\nexport type RunPropertiesOptions = {\n /** Reference to a character style by name */\n readonly style?: string;\n} & RunStylePropertiesOptions;\n\n/**\n * Options for run properties change tracking.\n *\n * Used for revision tracking when run properties have been modified.\n */\nexport type IRunPropertiesChangeOptions = {} & RunPropertiesOptions & ChangedAttributesProperties;\n\nexport type IParagraphRunPropertiesOptions = {\n readonly insertion?: ChangedAttributesProperties;\n readonly deletion?: ChangedAttributesProperties;\n} & RunPropertiesOptions;\n\n/**\n * Represents run properties (rPr) in a WordprocessingML document.\n *\n * Run properties specify all character-level formatting applied to text,\n * such as bold, italic, font, size, color, underline, and other text effects.\n *\n * Reference: http://officeopenxml.com/WPtextFormatting.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RPr\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_RPrContent\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * The EG_RPrBase group includes elements like rStyle, rFonts, b, bCs, i, iCs,\n * caps, smallCaps, strike, dstrike, outline, shadow, emboss, imprint, noProof,\n * snapToGrid, vanish, color, spacing, w, kern, position, sz, szCs, highlight,\n * u, effect, bdr, shd, vertAlign, rtl, em, lang, and more.\n */\nexport class RunProperties extends IgnoreIfEmptyXmlComponent {\n public constructor(options?: RunPropertiesOptions) {\n super(\"w:rPr\");\n\n if (!options) {\n return;\n }\n\n const result = buildRunProperties(options);\n if (result) {\n const children = result[\"w:rPr\"];\n if (Array.isArray(children)) {\n this.root.push(...children);\n }\n }\n }\n\n public push(item: XmlComponent): void {\n this.root.push(item);\n }\n}\n\nexport class ParagraphRunProperties extends RunProperties {\n public constructor(options?: IParagraphRunPropertiesOptions) {\n super(options);\n\n if (options?.insertion) {\n this.push(new InsertionTrackChange(options.insertion));\n }\n\n if (options?.deletion) {\n this.push(new DeletionTrackChange(options.deletion));\n }\n }\n}\n\n/**\n * Represents a run properties change element for revision tracking.\n *\n * This element is used to track changes to run properties when revision\n * tracking is enabled in the document.\n */\nexport class RunPropertiesChange extends XmlComponent {\n public constructor(options: IRunPropertiesChangeOptions) {\n super(\"w:rPrChange\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n this.addChildElement(new RunProperties(options as RunPropertiesOptions));\n }\n}\n\n/**\n * Build run properties (w:rPr) as IXmlableObject without allocating XmlComponent tree.\n * Used by Run.prepForXml for O(1) construction.\n */\nexport function buildRunProperties(options?: RunPropertiesOptions): IXmlableObject | undefined {\n if (!options) return undefined;\n\n const children: IXmlableObject[] = [];\n\n if (options.style) {\n children.push(stringValObj(\"w:rStyle\", options.style));\n }\n\n if (options.font) {\n if (typeof options.font === \"string\") {\n children.push(buildRunFontsObj(options.font));\n } else if (\"name\" in options.font) {\n children.push(buildRunFontsObj(options.font.name, options.font.hint));\n } else {\n children.push(buildRunFontsObj(options.font));\n }\n }\n\n if (options.bold !== undefined) children.push(onOffObj(\"w:b\", options.bold));\n\n if (\n (options.boldComplexScript === undefined && options.bold !== undefined) ||\n options.boldComplexScript\n ) {\n children.push(onOffObj(\"w:bCs\", options.boldComplexScript ?? options.bold));\n }\n\n if (options.italics !== undefined) children.push(onOffObj(\"w:i\", options.italics));\n\n if (\n (options.italicsComplexScript === undefined && options.italics !== undefined) ||\n options.italicsComplexScript\n ) {\n children.push(onOffObj(\"w:iCs\", options.italicsComplexScript ?? options.italics));\n }\n\n if (options.smallCaps !== undefined) {\n children.push(onOffObj(\"w:smallCaps\", options.smallCaps));\n } else if (options.allCaps !== undefined) {\n children.push(onOffObj(\"w:caps\", options.allCaps));\n }\n\n if (options.strike !== undefined) children.push(onOffObj(\"w:strike\", options.strike));\n if (options.doubleStrike !== undefined)\n children.push(onOffObj(\"w:dstrike\", options.doubleStrike));\n if (options.emboss !== undefined) children.push(onOffObj(\"w:emboss\", options.emboss));\n if (options.imprint !== undefined) children.push(onOffObj(\"w:imprint\", options.imprint));\n if (options.outline !== undefined) children.push(onOffObj(\"w:outline\", options.outline));\n if (options.shadow !== undefined) children.push(onOffObj(\"w:shadow\", options.shadow));\n if (options.webHidden !== undefined) children.push(onOffObj(\"w:webHidden\", options.webHidden));\n if (options.noProof !== undefined) children.push(onOffObj(\"w:noProof\", options.noProof));\n if (options.snapToGrid !== undefined) children.push(onOffObj(\"w:snapToGrid\", options.snapToGrid));\n\n if (options.vanish) {\n children.push(onOffObj(\"w:vanish\", options.vanish));\n }\n\n if (options.color) {\n children.push(buildColorObj(options.color));\n }\n\n if (options.characterSpacing) {\n children.push(buildCharacterSpacingObj(options.characterSpacing));\n }\n\n if (options.scale !== undefined) {\n children.push(numberValObj(\"w:w\", options.scale));\n }\n\n if (options.kern) {\n children.push(hpsMeasureObj(\"w:kern\", options.kern));\n }\n\n if (options.position) {\n children.push(stringValObj(\"w:position\", options.position));\n }\n\n if (options.size !== undefined) {\n children.push(hpsMeasureObj(\"w:sz\", options.size));\n }\n const szCs =\n options.sizeComplexScript === undefined || options.sizeComplexScript === true\n ? options.size\n : options.sizeComplexScript;\n if (szCs) {\n children.push(hpsMeasureObj(\"w:szCs\", szCs));\n }\n\n if (options.highlight) {\n children.push(buildHighlightObj(options.highlight));\n }\n if (options.highlightComplexScript === true) {\n if (options.highlight) {\n children.push(buildHighlightComplexScriptObj(options.highlight));\n }\n } else if (\n options.highlightComplexScript !== undefined &&\n options.highlightComplexScript !== false\n ) {\n children.push(buildHighlightComplexScriptObj(options.highlightComplexScript));\n }\n\n if (options.underline) {\n children.push(buildUnderlineObj(options.underline.type, options.underline.color));\n }\n\n if (options.effect) {\n children.push(stringValObj(\"w:effect\", options.effect));\n }\n\n if (options.border) {\n children.push(buildBorderObj(\"w:bdr\", options.border));\n }\n\n if (options.shading) {\n children.push(buildShadingObj(options.shading));\n }\n\n if (options.subScript) {\n children.push(stringEnumValObj(\"w:vertAlign\", \"subscript\"));\n }\n\n if (options.superScript) {\n children.push(stringEnumValObj(\"w:vertAlign\", \"superscript\"));\n }\n\n if (options.rightToLeft !== undefined) {\n children.push(onOffObj(\"w:rtl\", options.rightToLeft));\n }\n\n if (options.emphasisMark) {\n children.push(buildEmphasisMarkObj(options.emphasisMark.type));\n }\n\n if (options.language) {\n children.push(buildLanguageObj(options.language));\n }\n\n if (options.specVanish) {\n children.push(onOffObj(\"w:specVanish\", options.specVanish));\n }\n\n if (options.math) {\n children.push(onOffObj(\"w:oMath\", options.math));\n }\n\n if (options.fitText !== undefined) {\n children.push(numberValObj(\"w:fitText\", options.fitText));\n }\n\n if (options.complexScript !== undefined) {\n children.push(onOffObj(\"w:cs\", options.complexScript));\n }\n\n if (options.eastAsianLayout) {\n children.push(buildEastAsianLayoutObj(options.eastAsianLayout));\n }\n\n if (options.revision) {\n const rev = options.revision;\n const { author: _, date: __, id: ___, ...originalProps } = rev;\n const rPrChangeChildren: (IXmlableObject | { _attr: Record<string, string | number> })[] = [\n { _attr: { \"w:author\": rev.author, \"w:date\": rev.date, \"w:id\": rev.id } },\n ];\n const innerRPr = buildRunProperties(originalProps as RunPropertiesOptions);\n if (innerRPr) rPrChangeChildren.push(innerRPr);\n children.push({ \"w:rPrChange\": rPrChangeChildren });\n }\n\n return children.length > 0 ? { \"w:rPr\": children } : undefined;\n}\n","/**\n * Alignment constants for DrawingML positioning.\n *\n * This module provides horizontal and vertical alignment options\n * for floating drawings.\n *\n * @module\n */\n\n/**\n * Horizontal alignment options for floating drawings.\n *\n * Reference: https://www.datypic.com/sc/ooxml/t-wp_ST_AlignH.html\n *\n * @publicApi\n */\nexport const HorizontalPositionAlign = {\n /** Center horizontally */\n CENTER: \"center\",\n /** Align to inside margin (left on odd, right on even pages) */\n INSIDE: \"inside\",\n /** Align to left */\n LEFT: \"left\",\n /** Align to outside margin (right on odd, left on even pages) */\n OUTSIDE: \"outside\",\n /** Align to right */\n RIGHT: \"right\",\n} as const;\n\n/**\n * Vertical alignment options for floating drawings.\n *\n * Reference: https://www.datypic.com/sc/ooxml/t-wp_ST_AlignV.html\n *\n * @publicApi\n */\nexport const VerticalPositionAlign = {\n /** Align to bottom */\n BOTTOM: \"bottom\",\n /** Center vertically */\n CENTER: \"center\",\n /** Align to inside margin */\n INSIDE: \"inside\",\n /** Align to outside margin */\n OUTSIDE: \"outside\",\n /** Align to top */\n TOP: \"top\",\n} as const;\n","/**\n * Number format module for WordprocessingML documents.\n *\n * This module provides number format constants for page numbers,\n * list numbering, and other numbered elements.\n *\n * Reference: http://officeopenxml.com/WPnumbering-numFmt.php\n *\n * @module\n */\n\n/**\n * Number format types for page numbers and list numbering.\n *\n * Provides international number formats including decimal, Roman numerals,\n * alphabetic, and various Asian numbering systems.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_NumberFormat\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"decimal\"/>\n * <xsd:enumeration value=\"upperRoman\"/>\n * <xsd:enumeration value=\"lowerRoman\"/>\n * <xsd:enumeration value=\"upperLetter\"/>\n * <xsd:enumeration value=\"lowerLetter\"/>\n * <!-- ... many more formats ... -->\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @example\n * ```typescript\n * // Arabic numerals (1, 2, 3)\n * NumberFormat.DECIMAL;\n *\n * // Roman numerals (I, II, III)\n * NumberFormat.UPPER_ROMAN;\n *\n * // Letters (a, b, c)\n * NumberFormat.LOWER_LETTER;\n * ```\n *\n * @publicApi\n */\nexport const NumberFormat = {\n AIUEO: \"aiueo\",\n AIUEO_FULL_WIDTH: \"aiueoFullWidth\",\n ARABIC_ABJAD: \"arabicAbjad\",\n ARABIC_ALPHA: \"arabicAlpha\",\n BAHT_TEXT: \"bahtText\",\n BULLET: \"bullet\",\n CARDINAL_TEXT: \"cardinalText\",\n CHICAGO: \"chicago\",\n CHINESE_COUNTING: \"chineseCounting\",\n CHINESE_COUNTING_TEN_THOUSAND: \"chineseCountingThousand\",\n CHINESE_LEGAL_SIMPLIFIED: \"chineseLegalSimplified\",\n CHOSUNG: \"chosung\",\n DECIMAL: \"decimal\",\n DECIMAL_ENCLOSED_CIRCLE: \"decimalEnclosedCircle\",\n DECIMAL_ENCLOSED_CIRCLE_CHINESE: \"decimalEnclosedCircleChinese\",\n DECIMAL_ENCLOSED_FULL_STOP: \"decimalEnclosedFullstop\",\n DECIMAL_ENCLOSED_PAREN: \"decimalEnclosedParen\",\n DECIMAL_FULL_WIDTH: \"decimalFullWidth\",\n DECIMAL_FULL_WIDTH_2: \"decimalFullWidth2\",\n DECIMAL_HALF_WIDTH: \"decimalHalfWidth\",\n DECIMAL_ZERO: \"decimalZero\",\n DOLLAR_TEXT: \"dollarText\",\n GANADA: \"ganada\",\n HEBREW_1: \"hebrew1\",\n HEBREW_2: \"hebrew2\",\n HEX: \"hex\",\n HINDI_CONSONANTS: \"hindiConsonants\",\n HINDI_COUNTING: \"hindiCounting\",\n HINDI_NUMBERS: \"hindiNumbers\",\n HINDI_VOWELS: \"hindiVowels\",\n IDEOGRAPH_DIGITAL: \"ideographDigital\",\n IDEOGRAPH_ENCLOSED_CIRCLE: \"ideographEnclosedCircle\",\n IDEOGRAPH_LEGAL_TRADITIONAL: \"ideographLegalTraditional\",\n IDEOGRAPH_TRADITIONAL: \"ideographTraditional\",\n IDEOGRAPH_ZODIAC: \"ideographZodiac\",\n IDEOGRAPH_ZODIAC_TRADITIONAL: \"ideographZodiacTraditional\",\n IROHA: \"iroha\",\n IROHA_FULL_WIDTH: \"irohaFullWidth\",\n JAPANESE_COUNTING: \"japaneseCounting\",\n JAPANESE_DIGITAL_TEN_THOUSAND: \"japaneseDigitalTenThousand\",\n JAPANESE_LEGAL: \"japaneseLegal\",\n KOREAN_COUNTING: \"koreanCounting\",\n KOREAN_DIGITAL: \"koreanDigital\",\n KOREAN_DIGITAL_2: \"koreanDigital2\",\n KOREAN_LEGAL: \"koreanLegal\",\n LOWER_LETTER: \"lowerLetter\",\n LOWER_ROMAN: \"lowerRoman\",\n NONE: \"none\",\n NUMBER_IN_DASH: \"numberInDash\",\n ORDINAL: \"ordinal\",\n ORDINAL_TEXT: \"ordinalText\",\n RUSSIAN_LOWER: \"russianLower\",\n RUSSIAN_UPPER: \"russianUpper\",\n TAIWANESE_COUNTING: \"taiwaneseCounting\",\n TAIWANESE_COUNTING_THOUSAND: \"taiwaneseCountingThousand\",\n TAIWANESE_DIGITAL: \"taiwaneseDigital\",\n THAI_COUNTING: \"thaiCounting\",\n THAI_LETTERS: \"thaiLetters\",\n THAI_NUMBERS: \"thaiNumbers\",\n UPPER_LETTER: \"upperLetter\",\n UPPER_ROMAN: \"upperRoman\",\n VIETNAMESE_COUNTING: \"vietnameseCounting\",\n // <xsd:enumeration value=\"custom\"/>\n} as const;\n","/**\n * Space type module for WordprocessingML documents.\n *\n * This module provides the xml:space attribute values for\n * controlling whitespace handling in text elements.\n *\n * @module\n */\n\n/**\n * XML space handling modes.\n *\n * Controls how whitespace is handled in text elements.\n *\n * @example\n * ```typescript\n * // Preserve whitespace (spaces, newlines)\n * SpaceType.PRESERVE;\n *\n * // Default whitespace handling\n * SpaceType.DEFAULT;\n * ```\n *\n * @publicApi\n */\nexport const SpaceType = {\n DEFAULT: \"default\",\n PRESERVE: \"preserve\",\n} as const;\n","/**\n * Shared module exports.\n *\n * @module\n */\nexport * from \"./alignment\";\nexport * from \"./number-format\";\nexport * from \"./space-type\";\n","/**\n * Text module for WordprocessingML run content.\n *\n * This module provides the buildText function for text content within runs.\n *\n * @module\n */\nimport { SpaceType } from \"@file/shared\";\nimport type { IXmlableObject } from \"@file/xml-components\";\n\ninterface TextOptions {\n readonly space?: (typeof SpaceType)[keyof typeof SpaceType];\n readonly text?: string;\n}\n\n/**\n * Builds a text element XML object.\n *\n * @param options - Text string or options with space/text\n * @returns IXmlableObject for the w:t element\n *\n * @internal\n */\nexport function buildText(options: string | TextOptions): IXmlableObject {\n if (typeof options === \"string\") {\n return {\n \"w:t\": [{ _attr: { \"xml:space\": SpaceType.PRESERVE } }, options],\n };\n }\n return {\n \"w:t\": [{ _attr: { \"xml:space\": options.space ?? SpaceType.DEFAULT } }, options.text ?? \"\"],\n };\n}\n","/**\n * Run module for WordprocessingML documents.\n *\n * A run is a region of text with a common set of properties. It is the primary\n * unit of inline content in a paragraph.\n *\n * Reference: http://officeopenxml.com/WPtext.php\n *\n * @module\n */\nimport type { FootnoteReferenceRun } from \"@file/footnotes/footnote/run/reference-run\";\nimport type { FieldInstruction } from \"@file/table-of-contents/field-instruction\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { xml } from \"@office-open/xml\";\n\nimport { createBreak } from \"./break\";\nimport type {\n AnnotationReference,\n CarriageReturn,\n ContinuationSeparator,\n DayLong,\n DayShort,\n EndnoteReference,\n FootnoteReferenceElement,\n LastRenderedPageBreak,\n MonthLong,\n MonthShort,\n NoBreakHyphen,\n PageNumberElement,\n Separator,\n SoftHyphen,\n Tab,\n YearLong,\n YearShort,\n} from \"./empty-children\";\nimport { createBegin, createEnd, createSeparate } from \"./field\";\nimport {\n buildCurrentSection,\n buildNumberOfPages,\n buildNumberOfPagesSection,\n buildPage,\n} from \"./page-number\";\nimport { buildRunProperties } from \"./properties\";\nimport type { IParagraphRunPropertiesOptions, RunPropertiesOptions } from \"./properties\";\nimport { buildText } from \"./run-components/text\";\n\ninterface RunOptionsBase {\n readonly children?: readonly (\n | FieldInstruction\n | (typeof PageNumber)[keyof typeof PageNumber]\n | FootnoteReferenceRun\n | string\n | AnnotationReference\n | CarriageReturn\n | ContinuationSeparator\n | DayLong\n | DayShort\n | EndnoteReference\n | FootnoteReferenceElement\n | LastRenderedPageBreak\n | MonthLong\n | MonthShort\n | NoBreakHyphen\n | PageNumberElement\n | Separator\n | SoftHyphen\n | Tab\n | YearLong\n | YearShort\n | BaseXmlComponent\n | IXmlableObject\n )[];\n readonly break?: number;\n readonly text?: string;\n}\n\n/**\n * Options for creating a Run element.\n *\n * The run element specifies a region of text with a common set of properties.\n * The children property can contain various inline content elements.\n *\n * @see {@link Run}\n */\nexport type RunOptions = RunOptionsBase & RunPropertiesOptions;\n\nexport type IParagraphRunOptions = RunOptionsBase & IParagraphRunPropertiesOptions;\n\n/**\n * Constants for page number field types.\n *\n * These values are used to insert dynamic page number fields into a document.\n *\n * Reference: http://officeopenxml.com/WPfields.php\n *\n * @publicApi\n */\nexport const PageNumber = {\n /** Inserts the current page number */\n CURRENT: \"CURRENT\",\n /** Inserts the total number of pages in the document */\n TOTAL_PAGES: \"TOTAL_PAGES\",\n /** Inserts the total number of pages in the current section */\n TOTAL_PAGES_IN_SECTION: \"TOTAL_PAGES_IN_SECTION\",\n /** Inserts the current section number */\n CURRENT_SECTION: \"SECTION\",\n} as const;\n\n/**\n * Represents a run of text with uniform formatting in a WordprocessingML document.\n *\n * A run is the lowest level unit of text in a paragraph. All content within a run\n * shares the same formatting properties (bold, italic, font, size, etc.).\n *\n * Pre-computes run properties and text at construction time to minimise\n * allocation during serialization.\n */\nexport class Run extends BaseXmlComponent {\n private readonly options: RunOptions;\n protected extraChildren: (BaseXmlComponent | IXmlableObject)[] = [];\n\n // Cached at construction time — options never change.\n private readonly _prebuilt: IXmlableObject | undefined;\n\n public constructor(options: RunOptions) {\n super(\"w:r\");\n this.options = options;\n\n // Pre-build the entire IXmlableObject for the simple case:\n // text-only (no children array, no break, no extra children).\n // This eliminates all object allocation in prepForXml for the hot path.\n if (!options.children && !options.break) {\n const rPr = buildRunProperties(options);\n const text = options.text !== undefined ? buildText(options.text) : undefined;\n if (rPr || text) {\n const children: IXmlableObject[] = [];\n if (rPr) children.push(rPr);\n if (text) children.push(text);\n this._prebuilt = { \"w:r\": children };\n }\n }\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n // Fast path: return pre-built object (zero allocation).\n // Only valid when no extraChildren were added by subclasses.\n if (this._prebuilt && this.extraChildren.length === 0) return this._prebuilt;\n\n // Slow path: complex children, breaks, or extra children.\n const rPr = buildRunProperties(this.options);\n const children: IXmlableObject[] = [];\n if (rPr) children.push(rPr);\n\n if (this.options.break) {\n for (let i = 0; i < this.options.break; i++) {\n children.push(createBreak().prepForXml(context) as IXmlableObject);\n }\n }\n\n if (this.options.children) {\n for (const child of this.options.children) {\n if (typeof child === \"string\") {\n switch (child) {\n case PageNumber.CURRENT: {\n children.push(createBegin().prepForXml(context) as IXmlableObject);\n children.push(buildPage());\n children.push(createSeparate().prepForXml(context) as IXmlableObject);\n children.push(createEnd().prepForXml(context) as IXmlableObject);\n break;\n }\n case PageNumber.TOTAL_PAGES: {\n children.push(createBegin().prepForXml(context) as IXmlableObject);\n children.push(buildNumberOfPages());\n children.push(createSeparate().prepForXml(context) as IXmlableObject);\n children.push(createEnd().prepForXml(context) as IXmlableObject);\n break;\n }\n case PageNumber.TOTAL_PAGES_IN_SECTION: {\n children.push(createBegin().prepForXml(context) as IXmlableObject);\n children.push(buildNumberOfPagesSection());\n children.push(createSeparate().prepForXml(context) as IXmlableObject);\n children.push(createEnd().prepForXml(context) as IXmlableObject);\n break;\n }\n case PageNumber.CURRENT_SECTION: {\n children.push(createBegin().prepForXml(context) as IXmlableObject);\n children.push(buildCurrentSection());\n children.push(createSeparate().prepForXml(context) as IXmlableObject);\n children.push(createEnd().prepForXml(context) as IXmlableObject);\n break;\n }\n default: {\n children.push(buildText(child));\n break;\n }\n }\n continue;\n }\n\n if (child instanceof BaseXmlComponent) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n } else {\n children.push(child);\n }\n }\n } else if (this.options.text !== undefined) {\n children.push(buildText(this.options.text));\n }\n\n for (const child of this.extraChildren) {\n if (child instanceof BaseXmlComponent) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n } else {\n children.push(child);\n }\n }\n\n return { \"w:r\": children.length > 0 ? children : {} };\n }\n\n /**\n * Fast path: pre-built object → xml() string. Slow path: prepForXml → xml.\n */\n public override toXml(context: Context): string {\n if (this._prebuilt && this.extraChildren.length === 0) {\n return xml(this._prebuilt);\n }\n const obj = this.prepForXml(context);\n return obj ? xml(obj) : \"\";\n }\n}\n","import { Run } from \"./run\";\nimport type { RunOptions } from \"./run\";\n\n/**\n * Represents a text run in a WordprocessingML document.\n *\n * TextRun is a convenience class that extends Run, allowing you to pass\n * either a string or full run options. This is the most common way to\n * add text content to a paragraph.\n *\n * Reference: http://officeopenxml.com/WPtext.php\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * // Simple text\n * new TextRun(\"Hello World\");\n *\n * // Formatted text\n * new TextRun({ text: \"Bold Text\", bold: true });\n * ```\n */\nexport class TextRun extends Run {\n public constructor(options: RunOptions | string) {\n super(typeof options === \"string\" ? { text: options } : options);\n }\n}\n","/**\n * Symbol module for WordprocessingML run content.\n *\n * This module provides support for inserting symbol characters\n * from symbol fonts like Wingdings or Symbol.\n *\n * @module\n */\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Builds a symbol element XML object.\n *\n * @param char - Character code (hex value)\n * @param symbolfont - Symbol font name (default: \"Wingdings\")\n * @returns IXmlableObject for the w:sym element\n *\n * @internal\n */\nexport function buildSymbol(char: string = \"\", symbolfont: string = \"Wingdings\"): IXmlableObject {\n return {\n \"w:sym\": { _attr: { \"w:char\": char, \"w:font\": symbolfont } },\n };\n}\n","/**\n * SymbolRun module for WordprocessingML documents.\n *\n * This module provides support for inserting symbol characters into documents.\n *\n * @module\n */\nimport { Run } from \"./run\";\nimport type { RunOptions } from \"./run\";\nimport { buildSymbol } from \"./run-components/symbol\";\n\n/**\n * Options for creating a SymbolRun.\n *\n * @see {@link SymbolRun}\n */\nexport type ISymbolRunOptions = {\n /** The Unicode character code for the symbol */\n readonly char: string;\n /** The font to use for the symbol (e.g., \"Wingdings\", \"Symbol\") */\n readonly symbolfont?: string;\n} & RunOptions;\n\n/**\n * Represents a symbol character in a WordprocessingML document.\n *\n * SymbolRun is used to insert special characters from symbol fonts.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new SymbolRun({\n * char: \"F04A\",\n * symbolfont: \"Wingdings\",\n * });\n * ```\n */\nexport class SymbolRun extends Run {\n public constructor(options: ISymbolRunOptions | string) {\n if (typeof options === \"string\") {\n super({});\n this.extraChildren.push(buildSymbol(options));\n return this;\n }\n\n super(options);\n this.extraChildren.push(buildSymbol(options.char, options.symbolfont));\n }\n}\n","/**\n * Convenience utility functions — re-exports from core + docx-specific generators.\n *\n * @module\n */\n// Re-export from core\nexport { convertMillimetersToTwip, convertInchesToTwip } from \"@office-open/core\";\nexport { uniqueNumericIdCreator, uniqueId, hashedId, uniqueUuid } from \"@office-open/core\";\nexport type { UniqueNumericIdCreator } from \"@office-open/core\";\n\n// Docx-specific generators\nimport { uniqueNumericIdCreator } from \"@office-open/core\";\n\nexport const abstractNumUniqueNumericIdGen = (): (() => number) => uniqueNumericIdCreator();\n\nexport const concreteNumUniqueNumericIdGen = (): (() => number) => uniqueNumericIdCreator(1);\n\nexport const docPropertiesUniqueNumericIdGen = (): (() => number) => uniqueNumericIdCreator();\n\nexport const bookmarkUniqueNumericIdGen = (): (() => number) => uniqueNumericIdCreator();\n","/**\n * Floating position module for DrawingML elements.\n *\n * This module provides positioning options for floating/anchored drawings,\n * including horizontal and vertical relative positioning.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-position.php\n *\n * @module\n */\nimport type { HorizontalPositionAlign, VerticalPositionAlign } from \"@file/shared/alignment\";\nexport { HorizontalPositionAlign, VerticalPositionAlign } from \"@file/shared/alignment\";\n\nimport type { TextWrapping } from \"../text-wrap\";\n\n/**\n * Horizontal Relative Positioning.\n *\n * Specifies the horizontal base from which the drawing position is calculated.\n *\n * Reference: https://www.datypic.com/sc/ooxml/t-wp_ST_RelFromH.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_RelFromH\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"margin\"/>\n * <xsd:enumeration value=\"page\"/>\n * <xsd:enumeration value=\"column\"/>\n * <xsd:enumeration value=\"character\"/>\n * <xsd:enumeration value=\"leftMargin\"/>\n * <xsd:enumeration value=\"rightMargin\"/>\n * <xsd:enumeration value=\"insideMargin\"/>\n * <xsd:enumeration value=\"outsideMargin\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const HorizontalPositionRelativeFrom = {\n /**\n * ## Character\n *\n * Specifies that the horizontal positioning shall be relative to the position of the anchor within its run content.\n */\n CHARACTER: \"character\",\n /**\n * ## Column\n *\n * Specifies that the horizontal positioning shall be relative to the extents of the column which contains its anchor.\n */\n COLUMN: \"column\",\n /**\n * ## Inside Margin\n *\n * Specifies that the horizontal positioning shall be relative to the inside margin of the current page (the left margin on odd pages, right on even pages).\n */\n INSIDE_MARGIN: \"insideMargin\",\n /**\n * ## Left Margin\n *\n * Specifies that the horizontal positioning shall be relative to the left margin of the page.\n */\n LEFT_MARGIN: \"leftMargin\",\n /**\n * ## Page Margin\n *\n * Specifies that the horizontal positioning shall be relative to the page margins.\n */\n MARGIN: \"margin\",\n /**\n * ## Outside Margin\n *\n * Specifies that the horizontal positioning shall be relative to the outside margin of the current page (the right margin on odd pages, left on even pages).\n */\n OUTSIDE_MARGIN: \"outsideMargin\",\n /**\n * ## Page Edge\n *\n * Specifies that the horizontal positioning shall be relative to the edge of the page.\n */\n PAGE: \"page\",\n /**\n * ## Right Margin\n *\n * Specifies that the horizontal positioning shall be relative to the right margin of the page.\n */\n RIGHT_MARGIN: \"rightMargin\",\n} as const;\n\n/**\n * Vertical Relative Positioning.\n *\n * Specifies the vertical base from which the drawing position is calculated.\n *\n * Reference: https://www.datypic.com/sc/ooxml/t-wp_ST_RelFromV.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_RelFromV\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"margin\"/>\n * <xsd:enumeration value=\"page\"/>\n * <xsd:enumeration value=\"paragraph\"/>\n * <xsd:enumeration value=\"line\"/>\n * <xsd:enumeration value=\"topMargin\"/>\n * <xsd:enumeration value=\"bottomMargin\"/>\n * <xsd:enumeration value=\"insideMargin\"/>\n * <xsd:enumeration value=\"outsideMargin\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const VerticalPositionRelativeFrom = {\n /**\n * ## Bottom Margin\n *\n * Specifies that the vertical positioning shall be relative to the bottom margin of the current page.\n */\n BOTTOM_MARGIN: \"bottomMargin\",\n /**\n * ## Inside Margin\n *\n * Specifies that the vertical positioning shall be relative to the inside margin of the current page.\n */\n INSIDE_MARGIN: \"insideMargin\",\n /**\n * ## Line\n *\n * Specifies that the vertical positioning shall be relative to the line containing the anchor character.\n */\n LINE: \"line\",\n /**\n * ## Page Margin\n *\n * Specifies that the vertical positioning shall be relative to the page margins.\n */\n MARGIN: \"margin\",\n /**\n * ## Outside Margin\n *\n * Specifies that the vertical positioning shall be relative to the outside margin of the current page.\n */\n OUTSIDE_MARGIN: \"outsideMargin\",\n /**\n * ## Page Edge\n *\n * Specifies that the vertical positioning shall be relative to the edge of the page.\n */\n PAGE: \"page\",\n /**\n * ## Paragraph\n *\n * Specifies that the vertical positioning shall be relative to the paragraph which contains the drawing anchor.\n */\n PARAGRAPH: \"paragraph\",\n /**\n * ## Top Margin\n *\n * Specifies that the vertical positioning shall be relative to the top margin of the current page.\n */\n TOP_MARGIN: \"topMargin\",\n} as const;\n\n/**\n * Options for horizontal positioning of a floating drawing.\n */\nexport interface HorizontalPositionOptions {\n /** The base from which horizontal position is calculated */\n readonly relative?: (typeof HorizontalPositionRelativeFrom)[keyof typeof HorizontalPositionRelativeFrom];\n /** Alignment relative to the horizontal base */\n readonly align?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];\n /** Offset in EMUs from the horizontal base */\n readonly offset?: number;\n}\n\n/**\n * Options for vertical positioning of a floating drawing.\n */\nexport interface VerticalPositionOptions {\n /** The base from which vertical position is calculated */\n readonly relative?: (typeof VerticalPositionRelativeFrom)[keyof typeof VerticalPositionRelativeFrom];\n /** Alignment relative to the vertical base */\n readonly align?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];\n /** Offset in EMUs from the vertical base */\n readonly offset?: number;\n}\n\n/**\n * Margin distances around a floating drawing in EMUs.\n */\nexport interface Margins {\n readonly left?: number;\n readonly bottom?: number;\n readonly top?: number;\n readonly right?: number;\n}\n\n/**\n * Configuration options for a floating/anchored drawing.\n *\n * @see {@link Anchor}\n */\nexport interface Floating {\n readonly horizontalPosition: HorizontalPositionOptions;\n readonly verticalPosition: VerticalPositionOptions;\n readonly allowOverlap?: boolean;\n readonly lockAnchor?: boolean;\n readonly behindDocument?: boolean;\n readonly layoutInCell?: boolean;\n readonly margins?: Margins;\n readonly wrap?: TextWrapping;\n readonly zIndex?: number;\n}\n","// http://officeopenxml.com/drwPicFloating-position.php\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * # Simple Positioning Coordinates\n *\n * This element specifies the coordinates at which a DrawingML object shall be positioned relative to the top-left edge of its page, when the `simplePos` attribute is specified on the <anchor> element (§5.5.2.3).\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_simplePos_topic_ID0E5K6OB.html\n * - http://officeopenxml.com/drwPicFloating-position.php\n *\n * ## XSD Schema\n *\n * ```xml\n * <xsd:complexType name=\"CT_Point2D\">\n * <xsd:attribute name=\"x\" type=\"ST_Coordinate\" use=\"required\"/>\n * <xsd:attribute name=\"y\" type=\"ST_Coordinate\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createSimplePos = (): XmlComponent =>\n new BuilderElement<{\n /**\n * ## X-Axis Coordinate\n *\n * Specifies a coordinate on the x-axis. The origin point for this coordinate shall be specified by the parent XML element.\n *\n * ### Example\n *\n * ```xml\n * <wp:... x=\"0\" y=\"100\" />\n * ```\n *\n * The `x` attribute defines an x-coordinate of 0.\n *\n * The possible values for this attribute are defined by the `ST_Coordinate` simple type (§5.1.12.16).\n */\n readonly x: number;\n /**\n * ## Y-Axis Coordinate\n *\n * Specifies a coordinate on the x-axis. The origin point for this coordinate shall be specified by the parent XML element.\n *\n * ### Example\n * ```xml\n * <wp:... x=\"0\" y=\"100\" />\n * ```\n *\n * The `y` attribute defines a y-coordinate of 100.\n *\n * The possible values for this attribute are defined by the `ST_Coordinate` simple type (§5.1.12.16).\n */\n readonly y: number;\n }>({\n name: \"wp:simplePos\",\n // NOTE: It's not fully supported in Microsoft Word, but this element is needed anyway\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: 0 },\n },\n });\n","import type { HorizontalPositionAlign, VerticalPositionAlign } from \"@file/shared/alignment\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * # Relative Horizontal/Vertical Alignment\n *\n * This element specifies how a DrawingML object shall be horizontally/vertically aligned relative to the horizontal/vertical alignment base defined by the parent element. Once an alignment base is defined, this element shall determine how the DrawingML object shall be aligned relative to that location.\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_align_topic_ID0EYZZOB.html\n * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_align_topic_ID0ET4ZOB.html\n * - http://officeopenxml.com/drwPicFloating-position.php\n */\nexport const createAlign = (\n value:\n | (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign]\n | (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign],\n): XmlComponent =>\n new BuilderElement({\n children: [value as any],\n name: \"wp:align\",\n });\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * # Absolute Position Offset\n *\n * This element specifies an absolute measurement for the positioning of a floating DrawingML object within a WordprocessingML document. This measurement shall be calculated relative to the top left edge of the positioning base specified by the parent element's `relativeFrom` attribute.\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_posOffset_topic_ID0EMG6OB.html\n * - http://officeopenxml.com/drwPicFloating-position.php\n */\nexport const createPositionOffset = (offsetValue: number): XmlComponent =>\n new BuilderElement({\n children: [offsetValue.toString() as any],\n name: \"wp:posOffset\",\n });\n","/**\n * Horizontal position module for floating drawings in WordprocessingML documents.\n *\n * This module provides horizontal positioning for floating drawing objects,\n * specifying the horizontal placement relative to a base element.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-position.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { createAlign } from \"./align\";\nimport { HorizontalPositionAlign, HorizontalPositionRelativeFrom } from \"./floating-position\";\nimport type { HorizontalPositionOptions } from \"./floating-position\";\nimport { createPositionOffset } from \"./position-offset\";\n\n/**\n * Creates a horizontal position element for floating drawings.\n *\n * The positionH element specifies the horizontal positioning of a floating\n * object relative to a base element (page, margin, column, etc.).\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-wp_positionH-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PosH\">\n * <xsd:choice>\n * <xsd:element name=\"align\" type=\"ST_AlignH\"/>\n * <xsd:element name=\"posOffset\" type=\"ST_PositionOffset\"/>\n * </xsd:choice>\n * <xsd:attribute name=\"relativeFrom\" type=\"ST_RelFromH\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Horizontal position configuration\n * @returns The positionH XML element\n *\n * @example\n * ```typescript\n * // Align to the left of the page\n * createHorizontalPosition({\n * relative: HorizontalPositionRelativeFrom.PAGE,\n * align: HorizontalPositionAlign.LEFT,\n * });\n *\n * // Offset from the margin\n * createHorizontalPosition({\n * relative: HorizontalPositionRelativeFrom.MARGIN,\n * offset: 914400, // 1 inch in EMUs\n * });\n * ```\n */\nexport const createHorizontalPosition = ({\n relative,\n align,\n offset,\n}: HorizontalPositionOptions): XmlComponent =>\n new BuilderElement<{\n /** Horizontal Position Relative Base */\n readonly relativeFrom: (typeof HorizontalPositionRelativeFrom)[keyof typeof HorizontalPositionRelativeFrom];\n }>({\n attributes: {\n relativeFrom: {\n key: \"relativeFrom\",\n value: relative ?? HorizontalPositionRelativeFrom.PAGE,\n },\n },\n children: [\n (() => {\n if (align) {\n return createAlign(align);\n }\n if (offset !== undefined) {\n return createPositionOffset(offset);\n }\n return createAlign(HorizontalPositionAlign.LEFT);\n })(),\n ],\n name: \"wp:positionH\",\n });\n","/**\n * Vertical position module for floating drawings in WordprocessingML documents.\n *\n * This module provides vertical positioning for floating drawing objects,\n * specifying the vertical placement relative to a base element.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-position.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { createAlign } from \"./align\";\nimport { VerticalPositionAlign, VerticalPositionRelativeFrom } from \"./floating-position\";\nimport type { VerticalPositionOptions } from \"./floating-position\";\nimport { createPositionOffset } from \"./position-offset\";\n\n/**\n * Creates a vertical position element for floating drawings.\n *\n * The positionV element specifies the vertical positioning of a floating\n * object relative to a base element (page, margin, paragraph, line, etc.).\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-wp_positionV-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PosV\">\n * <xsd:choice>\n * <xsd:element name=\"align\" type=\"ST_AlignV\"/>\n * <xsd:element name=\"posOffset\" type=\"ST_PositionOffset\"/>\n * </xsd:choice>\n * <xsd:attribute name=\"relativeFrom\" type=\"ST_RelFromV\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Vertical position configuration\n * @returns The positionV XML element\n *\n * @example\n * ```typescript\n * // Align to the top of the page\n * createVerticalPosition({\n * relative: VerticalPositionRelativeFrom.PAGE,\n * align: VerticalPositionAlign.TOP,\n * });\n *\n * // Offset from the paragraph\n * createVerticalPosition({\n * relative: VerticalPositionRelativeFrom.PARAGRAPH,\n * offset: 457200, // 0.5 inch in EMUs\n * });\n * ```\n */\nexport const createVerticalPosition = ({\n relative,\n align,\n offset,\n}: VerticalPositionOptions): XmlComponent =>\n new BuilderElement<{\n /** Vertical Position Relative Base */\n readonly relativeFrom: (typeof VerticalPositionRelativeFrom)[keyof typeof VerticalPositionRelativeFrom];\n }>({\n attributes: {\n relativeFrom: {\n key: \"relativeFrom\",\n value: relative ?? VerticalPositionRelativeFrom.PAGE,\n },\n },\n children: [\n (() => {\n if (align) {\n return createAlign(align);\n }\n if (offset !== undefined) {\n return createPositionOffset(offset);\n }\n return createAlign(VerticalPositionAlign.TOP);\n })(),\n ],\n name: \"wp:positionV\",\n });\n","/**\n * Floating drawing position module exports.\n *\n * @module\n */\nexport * from \"./floating-position\";\nexport * from \"./simple-pos\";\nexport * from \"./horizontal-position\";\nexport * from \"./vertical-position\";\n","/**\n * Custom geometry module for DrawingML shapes.\n *\n * Provides CT_CustomGeometry2D — user-defined 2D geometry with paths,\n * guides, adjust handles, connection sites, and a text insertion rectangle.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_CustomGeometry2D\n *\n * @module\n */\n\nexport { createCustomGeometry } from \"@office-open/core/drawingml\";\nexport type {\n CustomGeometryOptions,\n PathOptions,\n PathCommand,\n PathFillMode,\n ConnectionSite,\n GeomRect,\n} from \"@office-open/core/drawingml\";\n","/**\n * Effect container (effectDag) for DrawingML shapes.\n *\n * Provides CT_EffectContainer — a directed acyclic graph (DAG) of effects\n * supporting 28 effect types including alpha/color operations, nested containers,\n * and all effects from CT_EffectList.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_EffectContainer, EG_Effect\n *\n * @module\n */\n\nexport { createEffectDag } from \"@office-open/core/drawingml\";\nexport type { EffectDagOptions, EffectContainerType } from \"@office-open/core/drawingml\";\n","/**\n * Effect list container for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_EffectList, EG_EffectProperties\n *\n * @module\n */\n\nexport { createEffectList } from \"@office-open/core/drawingml\";\nexport type { EffectListOptions, BlurEffectOptions } from \"@office-open/core/drawingml\";\n","/**\n * Outline (line) properties for DrawingML shapes.\n *\n * This module provides support for configuring outline properties including\n * width, cap style, compound line types, fill properties, dash, and join.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_LineProperties\n *\n * @module\n */\n\nexport { createOutline } from \"@office-open/core/drawingml\";\nexport type { OutlineOptions, OutlineFillProperties } from \"@office-open/core/drawingml\";\nexport {\n LineCap,\n CompoundLine,\n PenAlignment,\n PresetDash,\n LineJoin,\n} from \"@office-open/core/drawingml\";\n","/**\n * Preset geometry module for DrawingML shapes.\n *\n * This module provides predefined shape geometries that can be applied\n * to pictures and shapes without requiring custom path definitions.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PresetGeometry2D\n *\n * @module\n */\n\nexport { PresetGeometry } from \"@office-open/core/drawingml\";\nexport type { PresetGeometryOptions } from \"@office-open/core/drawingml\";\n","/**\n * 3D scene module for DrawingML shapes.\n *\n * Provides CT_Scene3D — the 3D scene properties including camera, light rig,\n * and optional backdrop that define how a 3D shape is rendered.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Scene3D\n *\n * @module\n */\n\nexport { createScene3D } from \"@office-open/core/drawingml\";\nexport type {\n Scene3DOptions,\n CameraOptions,\n LightRigOptions,\n BackdropOptions,\n SphereCoords,\n Point3D,\n Vector3D,\n} from \"@office-open/core/drawingml\";\n","/**\n * 3D shape properties for DrawingML.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Shape3D\n *\n * @module\n */\n\nexport { createShape3D } from \"@office-open/core/drawingml\";\nexport type { Shape3DOptions } from \"@office-open/core/drawingml\";\nexport { PresetMaterialType } from \"@office-open/core/drawingml\";\n","/**\n * Shape properties for DrawingML pictures.\n *\n * This module provides the shape properties element which defines visual\n * characteristics of a picture including transformation, geometry, fill, outline,\n * effects, and 3D properties.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_ShapeProperties\n *\n * @module\n */\nimport type { MediaDataTransformation } from \"@file/media\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport {\n buildFill,\n createTransform2D,\n extractBlipFillMedia,\n type FillOptions,\n} from \"@office-open/core/drawingml\";\n\nimport { createCustomGeometry } from \"./custom-geometry/custom-geometry\";\nimport type { CustomGeometryOptions } from \"./custom-geometry/custom-geometry\";\nimport { createEffectDag } from \"./effects/effect-dag\";\nimport type { EffectDagOptions } from \"./effects/effect-dag\";\nimport { createEffectList } from \"./effects/effect-list\";\nimport type { EffectListOptions } from \"./effects/effect-list\";\nimport { createOutline } from \"./outline/outline\";\nimport type { OutlineOptions } from \"./outline/outline\";\nimport { PresetGeometry } from \"./preset-geometry/preset-geometry\";\nimport type { PresetGeometryOptions } from \"./preset-geometry/preset-geometry\";\nimport { createScene3D } from \"./three-d/scene-3d\";\nimport type { Scene3DOptions } from \"./three-d/scene-3d\";\nimport { createShape3D } from \"./three-d/shape-3d\";\nimport type { Shape3DOptions } from \"./three-d/shape-3d\";\n\n/**\n * Represents shape properties for a DrawingML picture.\n *\n * This element defines the visual formatting of a picture, including\n * its transform (size, position, rotation, flip), geometry preset,\n * fill, outline, effects, and 3D properties.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_ShapeProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"xfrm\" type=\"CT_Transform2D\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_Geometry\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_FillProperties\" minOccurs=\"0\"/>\n * <xsd:element name=\"ln\" type=\"CT_LineProperties\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_EffectProperties\" minOccurs=\"0\"/>\n * <xsd:element name=\"scene3d\" type=\"CT_Scene3D\" minOccurs=\"0\"/>\n * <xsd:element name=\"sp3d\" type=\"CT_Shape3D\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"bwMode\" type=\"ST_BlackWhiteMode\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const shapeProps = new ShapeProperties({\n * element: \"pic\",\n * transform: { emus: { x: 914400, y: 914400 } },\n * effects: {\n * glow: { radius: 50800, color: { value: \"FF0000\" } },\n * },\n * });\n * ```\n */\nexport class ShapeProperties extends XmlComponent {\n private readonly fillOptions?: FillOptions;\n\n public constructor({\n element,\n customGeometry,\n effectDag,\n effects,\n fill,\n outline,\n presetGeometry,\n scene3d,\n shape3d,\n transform,\n }: {\n readonly element: string;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly presetGeometry?: PresetGeometryOptions;\n /** Custom geometry (mutually exclusive with presetGeometry). */\n readonly customGeometry?: CustomGeometryOptions;\n /** Effect DAG container (mutually exclusive with effects). */\n readonly effectDag?: EffectDagOptions;\n readonly effects?: EffectListOptions;\n readonly scene3d?: Scene3DOptions;\n readonly shape3d?: Shape3DOptions;\n readonly transform: MediaDataTransformation;\n }) {\n super(`${element}:spPr`);\n\n this.fillOptions = fill;\n\n this.root.push({ _attr: { bwMode: \"auto\" } });\n\n this.root.push(\n createTransform2D({\n x: transform.offset?.emus?.x ?? 0,\n y: transform.offset?.emus?.y ?? 0,\n width: transform.emus.x,\n height: transform.emus.y,\n flipHorizontal: transform.flip?.horizontal,\n flipVertical: transform.flip?.vertical,\n rotation: transform.rotation,\n }),\n );\n\n // EG_Geometry: custGeom and prstGeom are mutually exclusive\n if (customGeometry) {\n this.root.push(createCustomGeometry(customGeometry));\n } else {\n this.root.push(new PresetGeometry(presetGeometry));\n }\n\n if (fill !== undefined) {\n this.root.push(buildFill(fill));\n }\n\n if (outline) {\n this.root.push(createOutline(outline));\n }\n\n // EG_EffectProperties: effectDag and effectLst are mutually exclusive\n if (effectDag) {\n this.root.push(createEffectDag(effectDag));\n } else if (effects) {\n this.root.push(createEffectList(effects));\n }\n\n if (scene3d) {\n this.root.push(createScene3D(scene3d));\n }\n\n if (shape3d) {\n this.root.push(createShape3D(shape3d));\n }\n }\n\n public override prepForXml(context: Context): IXmlableObject | undefined {\n const media = this.fillOptions ? extractBlipFillMedia(this.fillOptions) : undefined;\n if (media) {\n context.file.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 return super.prepForXml(context);\n }\n}\n","/**\n * Text body properties for DrawingML shapes.\n *\n * Provides CT_TextBodyProperties — defines how text is laid out within a shape,\n * including margins, alignment, autofit, vertical text, overflow, columns, and 3D.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TextBodyProperties\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport type { Scene3DOptions } from \"../pic/shape-properties/three-d/scene-3d\";\nimport { createScene3D } from \"../pic/shape-properties/three-d/scene-3d\";\nimport type { Shape3DOptions } from \"../pic/shape-properties/three-d/shape-3d\";\nimport { createShape3D } from \"../pic/shape-properties/three-d/shape-3d\";\n\n// ─── Constants ──────────────────────────────────────────────────────────────\n\n/**\n * Text anchoring type (ST_TextAnchoringType).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TextAnchoringType\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"t\"/>\n * <xsd:enumeration value=\"ctr\"/>\n * <xsd:enumeration value=\"b\"/>\n * <xsd:enumeration value=\"just\"/>\n * <xsd:enumeration value=\"dist\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport enum VerticalAnchor {\n TOP = \"t\",\n CENTER = \"ctr\",\n BOTTOM = \"b\",\n JUSTIFY = \"just\",\n DISTRIBUTED = \"dist\",\n}\n\n/**\n * Text vertical overflow type (ST_TextVertOverflowType).\n */\nexport const TextVertOverflowType = {\n OVERFLOW: \"overflow\",\n ELLIPSIS: \"ellipsis\",\n CLIP: \"clip\",\n} as const;\n\n/**\n * Text horizontal overflow type (ST_TextHorzOverflowType).\n */\nexport const TextHorzOverflowType = {\n OVERFLOW: \"overflow\",\n CLIP: \"clip\",\n} as const;\n\n/**\n * Text vertical type (ST_TextVerticalType).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TextVerticalType\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"horz\"/>\n * <xsd:enumeration value=\"vert\"/>\n * <xsd:enumeration value=\"vert270\"/>\n * <xsd:enumeration value=\"wordArtVert\"/>\n * <xsd:enumeration value=\"eaVert\"/>\n * <xsd:enumeration value=\"mongolianVert\"/>\n * <xsd:enumeration value=\"wordArtVertRtl\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const TextVerticalType = {\n HORIZONTAL: \"horz\",\n VERTICAL: \"vert\",\n VERTICAL_270: \"vert270\",\n WORD_ART_VERTICAL: \"wordArtVert\",\n EAST_ASIAN_VERTICAL: \"eaVert\",\n MONGOLIAN_VERTICAL: \"mongolianVert\",\n WORD_ART_VERTICAL_RTL: \"wordArtVertRtl\",\n} as const;\n\n/**\n * Text body wrapping type (ST_TextWrappingType).\n *\n * This is different from text wrapping around shapes (ST_WrapText).\n */\nexport const TextBodyWrappingType = {\n NONE: \"none\",\n SQUARE: \"square\",\n} as const;\n\n// ─── Sub-element Options ────────────────────────────────────────────────────\n\n/**\n * Normal autofit options (CT_TextNormalAutofit).\n *\n * Scales text and line spacing to fit the shape.\n */\nexport interface NormalAutofitOptions {\n /** Font scale percentage (e.g., 100000 = 100%) */\n readonly fontScale?: number;\n /** Line spacing reduction percentage */\n readonly lnSpcReduction?: number;\n}\n\n/**\n * Preset text warp options (CT_PresetTextShape).\n */\nexport interface PresetTextShapeOptions {\n /** Preset shape type (e.g., \"textArchUp\", \"textCircle\") */\n readonly preset: string;\n /** Optional adjustment values */\n readonly adjustments?: readonly { readonly name: string; readonly formula: string }[];\n}\n\n/**\n * Flat text options (CT_FlatText).\n */\nexport interface FlatTextOptions {\n /** Z-offset in EMUs */\n readonly z?: number;\n}\n\n// ─── Main Options ───────────────────────────────────────────────────────────\n\n/**\n * Options for text body properties (CT_TextBodyProperties).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TextBodyProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"prstTxWarp\" type=\"CT_PresetTextShape\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_TextAutofit\" minOccurs=\"0\"/>\n * <xsd:element name=\"scene3d\" type=\"CT_Scene3D\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_Text3D\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <!-- 19 attributes -->\n * </xsd:complexType>\n * ```\n */\nexport interface BodyPropertiesOptions {\n // ── Attributes ──\n\n /** Text rotation angle in 60,000ths of a degree */\n readonly rotation?: number;\n /** Whether to use spcFirstLastPara behavior */\n readonly spcFirstLastPara?: boolean;\n /** Vertical text overflow behavior */\n readonly vertOverflow?: (typeof TextVertOverflowType)[keyof typeof TextVertOverflowType];\n /** Horizontal text overflow behavior */\n readonly horzOverflow?: (typeof TextHorzOverflowType)[keyof typeof TextHorzOverflowType];\n /** Text vertical direction */\n readonly vert?: (typeof TextVerticalType)[keyof typeof TextVerticalType];\n /** Text wrapping type */\n readonly wrap?: (typeof TextBodyWrappingType)[keyof typeof TextBodyWrappingType];\n /** Left inset in EMUs */\n readonly lIns?: number;\n /** Top inset in EMUs */\n readonly tIns?: number;\n /** Right inset in EMUs */\n readonly rIns?: number;\n /** Bottom inset in EMUs */\n readonly bIns?: number;\n /** Number of text columns (1-16) */\n readonly numCol?: number;\n /** Spacing between columns in EMUs */\n readonly spcCol?: number;\n /** Whether columns are right-to-left */\n readonly rtlCol?: boolean;\n /** Whether text is from WordArt */\n readonly fromWordArt?: boolean;\n /** Text anchor position */\n readonly anchor?: (typeof VerticalAnchor)[keyof typeof VerticalAnchor];\n /** Whether to anchor at center */\n readonly anchorCtr?: boolean;\n /** Whether to force anti-aliasing */\n readonly forceAA?: boolean;\n /** Whether text is upright (default false) */\n readonly upright?: boolean;\n /** Whether to use compatible line spacing */\n readonly compatLnSpc?: boolean;\n\n // ── Convenience aliases (backward compatible) ──\n\n /** Vertical anchor position (alias for `anchor`) */\n readonly verticalAnchor?: VerticalAnchor;\n /** Margins shorthand */\n readonly margins?: {\n readonly top?: number;\n readonly bottom?: number;\n readonly left?: number;\n readonly right?: number;\n };\n\n // ── Child elements ──\n\n /** Preset text warp shape */\n readonly prstTxWarp?: PresetTextShapeOptions;\n /** Disable autofit (EG_TextAutofit choice) */\n readonly noAutoFit?: boolean;\n /** Normal autofit (EG_TextAutofit choice) */\n readonly normAutofit?: NormalAutofitOptions;\n /** Shape autofit (EG_TextAutofit choice) */\n readonly spAutoFit?: boolean;\n /** 3D scene */\n readonly scene3d?: Scene3DOptions;\n /** 3D shape properties (EG_Text3D choice) */\n readonly sp3d?: Shape3DOptions;\n /** Flat text (EG_Text3D choice) */\n readonly flatTx?: FlatTextOptions;\n}\n\n// ─── Internal Helpers ───────────────────────────────────────────────────────\n\nconst buildOptionalAttributes = (\n options: Record<string, unknown>,\n): Record<string, { readonly key: string; readonly value: string | number | boolean }> => {\n const attrs: Record<string, { readonly key: string; readonly value: string | number | boolean }> =\n {};\n for (const [key, value] of Object.entries(options)) {\n if (value !== undefined) {\n attrs[key] = { key, value: value as string | number | boolean };\n }\n }\n return attrs;\n};\n\n// ─── Preset Text Warp ───────────────────────────────────────────────────────\n\nconst createPresetTextShape = (options: PresetTextShapeOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n if (options.adjustments) {\n for (const adj of options.adjustments) {\n children.push(\n new BuilderElement<{ readonly name: string; readonly fmla: string }>({\n name: \"a:avLst\",\n children: [\n new BuilderElement<{ readonly name: string; readonly fmla: string }>({\n name: \"a:gd\",\n attributes: {\n name: { key: \"name\", value: adj.name },\n fmla: { key: \"fmla\", value: adj.formula },\n },\n }),\n ],\n }),\n );\n }\n }\n\n return new BuilderElement<{ readonly prst: string }>({\n name: \"a:prstTxWarp\",\n attributes: { prst: { key: \"prst\", value: options.preset } },\n children: children.length > 0 ? children : undefined,\n });\n};\n\n// ─── Main Factory ───────────────────────────────────────────────────────────\n\n/**\n * Creates a text body properties element (wps:bodyPr).\n *\n * Supports all 19 CT_TextBodyProperties attributes and all child elements\n * including preset text warp, autofit variants, 3D scene, and text 3D.\n *\n * @example\n * ```typescript\n * // Simple margins and anchor\n * createBodyProperties({\n * margins: { top: 100, bottom: 100, left: 200, right: 200 },\n * verticalAnchor: VerticalAnchor.CENTER,\n * });\n *\n * // Full options with vertical text and autofit\n * createBodyProperties({\n * vert: TextVerticalType.VERTICAL,\n * wrap: TextBodyWrappingType.NONE,\n * normAutofit: { fontScale: 80000 },\n * numCol: 2,\n * anchor: VerticalAnchor.TOP,\n * });\n * ```\n */\nexport const createBodyProperties = (options: BodyPropertiesOptions = {}): XmlComponent => {\n // Resolve anchor (direct `anchor` takes precedence over `verticalAnchor`)\n const anchor = options.anchor ?? options.verticalAnchor;\n\n // Resolve margins\n const lIns = options.lIns ?? options.margins?.left;\n const tIns = options.tIns ?? options.margins?.top;\n const rIns = options.rIns ?? options.margins?.right;\n const bIns = options.bIns ?? options.margins?.bottom;\n\n const attrs = buildOptionalAttributes({\n rot: options.rotation,\n spcFirstLastPara: options.spcFirstLastPara,\n vertOverflow: options.vertOverflow,\n horzOverflow: options.horzOverflow,\n vert: options.vert,\n wrap: options.wrap,\n lIns,\n tIns,\n rIns,\n bIns,\n numCol: options.numCol,\n spcCol: options.spcCol,\n rtlCol: options.rtlCol,\n fromWordArt: options.fromWordArt,\n anchor,\n anchorCtr: options.anchorCtr,\n forceAA: options.forceAA,\n upright: options.upright,\n compatLnSpc: options.compatLnSpc,\n });\n\n // Build children in XSD sequence order\n const children: BuilderChild[] = [];\n\n // a:prstTxWarp\n if (options.prstTxWarp) {\n children.push(createPresetTextShape(options.prstTxWarp));\n }\n\n // EG_TextAutofit (mutually exclusive)\n if (options.noAutoFit) {\n children.push(onOffObj(\"a:noAutofit\", options.noAutoFit));\n } else if (options.normAutofit) {\n const normAttrs = buildOptionalAttributes({\n fontScale: options.normAutofit.fontScale,\n lnSpcReduction: options.normAutofit.lnSpcReduction,\n });\n children.push(\n new BuilderElement({\n name: \"a:normAutofit\",\n attributes: Object.keys(normAttrs).length > 0 ? normAttrs : undefined,\n }),\n );\n } else if (options.spAutoFit) {\n children.push(onOffObj(\"a:spAutoFit\", options.spAutoFit));\n }\n\n // a:scene3d\n if (options.scene3d) {\n children.push(createScene3D(options.scene3d));\n }\n\n // EG_Text3D (mutually exclusive)\n if (options.sp3d) {\n children.push(createShape3D(options.sp3d));\n } else if (options.flatTx) {\n const flatAttrs = buildOptionalAttributes({ z: options.flatTx.z });\n children.push(\n new BuilderElement({\n name: \"a:flatTx\",\n attributes: Object.keys(flatAttrs).length > 0 ? flatAttrs : undefined,\n }),\n );\n }\n\n return new BuilderElement({\n name: \"wps:bodyPr\",\n attributes: Object.keys(attrs).length > 0 ? (attrs as never) : undefined,\n children: children.length > 0 ? children : undefined,\n });\n};\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nexport interface NonVisualShapePropertiesOptions {\n readonly txBox: string;\n}\n\nexport const createNonVisualShapeProperties = (\n options: NonVisualShapePropertiesOptions = { txBox: \"1\" },\n): XmlComponent =>\n new BuilderElement<{ readonly txBox: string }>({\n attributes: {\n txBox: { key: \"txBox\", value: options.txBox },\n },\n name: \"wps:cNvSpPr\",\n });\n","import type { FileChild } from \"@file/file-child\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nexport const createTextBoxContent = (children: readonly FileChild[]): XmlComponent =>\n new BuilderElement({\n children: [...children],\n name: \"wps:txbxContent\",\n });\n","import type { Paragraph } from \"@file/paragraph\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { createTextBoxContent } from \"./text-box-content\";\n\nexport const createWpsTextBox = (children: readonly Paragraph[]): XmlComponent =>\n new BuilderElement({\n children: [createTextBoxContent(children)],\n name: \"wps:txbx\",\n });\n","import type { MediaDataTransformation } from \"@file/media\";\nimport type { Paragraph } from \"@file/paragraph\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\n\nimport type { CustomGeometryOptions } from \"../pic/shape-properties/custom-geometry/custom-geometry\";\nimport type { EffectDagOptions } from \"../pic/shape-properties/effects/effect-dag\";\nimport type { EffectListOptions } from \"../pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"../pic/shape-properties/outline/outline\";\nimport { ShapeProperties } from \"../pic/shape-properties/shape-properties\";\nimport type { Scene3DOptions } from \"../pic/shape-properties/three-d/scene-3d\";\nimport type { Shape3DOptions } from \"../pic/shape-properties/three-d/shape-3d\";\nimport { createBodyProperties } from \"./body-properties\";\nimport type { BodyPropertiesOptions } from \"./body-properties\";\nimport { createNonVisualShapeProperties } from \"./non-visual-shape-properties\";\nimport type { NonVisualShapePropertiesOptions } from \"./non-visual-shape-properties\";\nimport { createWpsTextBox } from \"./wps-text-box\";\n\nexport interface WpsShapeCoreOptions {\n readonly children: readonly Paragraph[];\n readonly nonVisualProperties?: NonVisualShapePropertiesOptions;\n readonly bodyProperties?: BodyPropertiesOptions;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly customGeometry?: CustomGeometryOptions;\n readonly effectDag?: EffectDagOptions;\n readonly effects?: EffectListOptions;\n readonly scene3d?: Scene3DOptions;\n readonly shape3d?: Shape3DOptions;\n}\n\nexport type WpsShapeOptions = WpsShapeCoreOptions & {\n readonly transformation: MediaDataTransformation;\n};\n\nexport const createWpsShape = (options: WpsShapeOptions): XmlComponent =>\n new BuilderElement({\n children: [\n createNonVisualShapeProperties(options.nonVisualProperties),\n new ShapeProperties({\n element: \"wps\",\n customGeometry: options.customGeometry,\n effectDag: options.effectDag,\n effects: options.effects,\n fill: options.fill,\n outline: options.outline,\n scene3d: options.scene3d,\n shape3d: options.shape3d,\n transform: options.transformation,\n }),\n createWpsTextBox(options.children),\n createBodyProperties(options.bodyProperties),\n ],\n name: \"wps:wsp\",\n });\n","export { createBlipFill } from \"@office-open/core/drawingml\";\nexport type { BlipFillOptions, BlipOptions } from \"@office-open/core/drawingml\";\n","/**\n * Child non-visual picture properties module.\n *\n * This module provides picture-specific non-visual properties including\n * locking settings that control operations on the picture.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * @module\n */\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Builds the non-visual picture drawing properties object.\n *\n * This element specifies the non-visual properties specific to a picture.\n * These properties include picture-specific locking settings that control\n * which operations are allowed on the picture.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_NonVisualPictureProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"picLocks\" type=\"CT_PictureLocking\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"preferRelativeResize\" type=\"xsd:boolean\" use=\"optional\" default=\"true\"/>\n * </xsd:complexType>\n * ```\n */\nexport const buildChildNonVisualPropertiesObj = (): IXmlableObject => ({\n \"pic:cNvPicPr\": [\n { _attr: { preferRelativeResize: true } },\n { \"a:picLocks\": { _attr: { noChangeArrowheads: 1, noChangeAspect: 1 } } },\n ],\n});\n","/**\n * Child elements for document properties.\n *\n * This module provides hyperlink elements that can be attached to\n * drawing elements for interactive behavior.\n *\n * @module\n */\n// <sequence>\n// <element name=\"hlinkClick\" type=\"CT_Hyperlink\" minOccurs=\"0\" maxOccurs=\"1\" />\n// <element name=\"hlinkHover\" type=\"CT_Hyperlink\" minOccurs=\"0\" maxOccurs=\"1\" />\n// <element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\" maxOccurs=\"1\" />\n// </sequence>\n\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n// <xsd:complexType name=\"CT_Hyperlink\">\n// <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\n// <xsd:attribute name=\"tgtFrame\" type=\"s:ST_String\" use=\"optional\" />\n// <xsd:attribute name=\"tooltip\" type=\"s:ST_String\" use=\"optional\" />\n// <xsd:attribute name=\"docLocation\" type=\"s:ST_String\" use=\"optional\" />\n// <xsd:attribute name=\"history\" type=\"s:ST_OnOff\" use=\"optional\" />\n// <xsd:attribute name=\"anchor\" type=\"s:ST_String\" use=\"optional\" />\n// <xsd:attribute ref=\"r:id\" />\n// </xsd:complexType>\n\n// TODO: Implement the rest of the attributes\n\n/**\n * Builds a click hyperlink object for a drawing.\n *\n * This element defines what happens when a user clicks on a drawing element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Hyperlink\">\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute name=\"tgtFrame\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"tooltip\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"docLocation\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"history\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"anchor\" type=\"s:ST_String\"/>\n * <xsd:attribute ref=\"r:id\"/>\n * </xsd:complexType>\n * ```\n *\n * @param linkId - The relationship ID for the hyperlink target\n * @param hasXmlNs - Whether to include the XML namespace declaration\n * @returns An IXmlableObject representing the click hyperlink\n */\nexport const buildHyperlinkClickObj = (linkId: string, hasXmlNs: boolean): IXmlableObject => ({\n \"a:hlinkClick\": {\n _attr: {\n ...(hasXmlNs ? { \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\" } : {}),\n \"r:id\": `rId${linkId}`,\n },\n },\n});\n\n/**\n * Builds a hover hyperlink object for a drawing.\n *\n * This element defines what happens when a user hovers over a drawing element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Hyperlink\">\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute name=\"tgtFrame\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"tooltip\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"docLocation\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"history\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"anchor\" type=\"s:ST_String\"/>\n * <xsd:attribute ref=\"r:id\"/>\n * </xsd:complexType>\n * ```\n *\n * @param linkId - The relationship ID for the hyperlink target\n * @param hasXmlNs - Whether to include the XML namespace declaration\n * @returns An IXmlableObject representing the hover hyperlink\n */\nexport const buildHyperlinkHoverObj = (linkId: string, hasXmlNs: boolean): IXmlableObject => ({\n \"a:hlinkHover\": {\n _attr: {\n ...(hasXmlNs ? { \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\" } : {}),\n \"r:id\": `rId${linkId}`,\n },\n },\n});\n","/**\n * Hyperlink module for WordprocessingML documents.\n *\n * This module provides hyperlink functionality for internal and external links.\n *\n * Reference: http://officeopenxml.com/WPhyperlink.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { uniqueId } from \"@util/convenience-functions\";\n\nimport type { ParagraphChild } from \"../paragraph\";\n\ninterface HyperlinkAttributesProperties {\n readonly id?: string;\n readonly anchor?: string;\n readonly history: number;\n readonly tooltip?: string;\n readonly tgtFrame?: string;\n readonly docLocation?: string;\n}\n\n/**\n * Hyperlink type enumeration.\n *\n * Defines the types of hyperlinks supported in WordprocessingML documents.\n *\n * @publicApi\n */\nexport const HyperlinkType = {\n /** Internal hyperlink to a bookmark within the document */\n INTERNAL: \"INTERNAL\",\n /** External hyperlink to a URL outside the document */\n EXTERNAL: \"EXTERNAL\",\n} as const;\n\n/**\n * Options for creating an internal hyperlink.\n *\n * @property children - Array of paragraph children (usually TextRun elements) that form the hyperlink text\n * @property anchor - Name of the bookmark to link to within the document\n */\nexport interface InternalHyperlinkOptions {\n /** Array of paragraph children that form the hyperlink text */\n readonly children: readonly ParagraphChild[];\n /** Name of the bookmark to link to within the document */\n readonly anchor: string;\n /** Screen tip text shown when hovering over the hyperlink */\n readonly tooltip?: string;\n}\n\n/**\n * Options for creating an external hyperlink.\n *\n * @property children - Array of paragraph children (usually TextRun elements) that form the hyperlink text\n * @property link - URL to link to outside the document\n * @property tooltip - Screen tip text shown when hovering over the hyperlink\n * @property tgtFrame - Target frame for the hyperlink (e.g., \"_blank\", \"_self\")\n */\nexport interface ExternalHyperlinkOptions {\n /** Array of paragraph children that form the hyperlink text */\n readonly children: readonly ParagraphChild[];\n /** URL to link to outside the document */\n readonly link: string;\n /** Screen tip text shown when hovering over the hyperlink */\n readonly tooltip?: string;\n /** Target frame for the hyperlink (e.g., \"_blank\", \"_self\") */\n readonly tgtFrame?: string;\n}\n\n/**\n * Represents a concrete hyperlink in a WordprocessingML document.\n *\n * This class is the low-level implementation of hyperlinks used internally.\n * Use InternalHyperlink or ExternalHyperlink for creating hyperlinks in documents.\n *\n * Reference: http://officeopenxml.com/WPhyperlink.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"hyperlink\" type=\"CT_Hyperlink\"/>\n *\n * <xsd:complexType name=\"CT_Hyperlink\">\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute name=\"tgtFrame\" type=\"s:ST_String\" use=\"optional\"/>\n * <xsd:attribute name=\"tooltip\" type=\"s:ST_String\" use=\"optional\"/>\n * <xsd:attribute name=\"docLocation\" type=\"s:ST_String\" use=\"optional\"/>\n * <xsd:attribute name=\"history\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"anchor\" type=\"s:ST_String\" use=\"optional\"/>\n * <xsd:attribute ref=\"r:id\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface ConcreteHyperlinkOptions {\n readonly anchor?: string;\n readonly tooltip?: string;\n readonly tgtFrame?: string;\n}\n\nexport class ConcreteHyperlink extends XmlComponent {\n public readonly linkId: string;\n\n public constructor(\n children: readonly ParagraphChild[],\n relationshipId: string,\n options?: ConcreteHyperlinkOptions,\n ) {\n super(\"w:hyperlink\");\n\n this.linkId = relationshipId;\n\n const anchor = options?.anchor;\n const tooltip = options?.tooltip;\n const tgtFrame = options?.tgtFrame;\n\n const props: HyperlinkAttributesProperties = {\n anchor: anchor ? anchor : undefined,\n history: 1,\n id: !anchor ? `rId${this.linkId}` : undefined,\n tooltip,\n tgtFrame,\n };\n\n const attr: Record<string, string | number> = {};\n if (props.anchor !== undefined) {\n attr[\"w:anchor\"] = props.anchor;\n }\n attr[\"w:history\"] = props.history;\n if (props.id !== undefined) {\n attr[\"r:id\"] = props.id;\n }\n if (props.tooltip !== undefined) {\n attr[\"w:tooltip\"] = props.tooltip;\n }\n if (props.tgtFrame !== undefined) {\n attr[\"w:tgtFrame\"] = props.tgtFrame;\n }\n this.root.push({ _attr: attr });\n children.forEach((child) => {\n this.root.push(child);\n });\n }\n}\n\n/**\n * Represents an internal hyperlink to a bookmark within the document.\n *\n * Internal hyperlinks use the anchor attribute to reference a bookmark by name.\n * The bookmark must exist in the document for the hyperlink to function.\n *\n * Reference: http://officeopenxml.com/WPhyperlink.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"hyperlink\" type=\"CT_Hyperlink\"/>\n *\n * <xsd:complexType name=\"CT_Hyperlink\">\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute name=\"anchor\" type=\"s:ST_String\" use=\"optional\"/>\n * <xsd:attribute name=\"history\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a bookmark\n * new Bookmark({\n * id: \"section1\",\n * children: [new TextRun(\"Section 1\")],\n * });\n *\n * // Link to the bookmark\n * new InternalHyperlink({\n * children: [new TextRun({ text: \"Go to Section 1\", style: \"Hyperlink\" })],\n * anchor: \"section1\",\n * });\n * ```\n */\nexport class InternalHyperlink extends ConcreteHyperlink {\n public constructor(options: InternalHyperlinkOptions) {\n super(options.children, uniqueId(), { anchor: options.anchor, tooltip: options.tooltip });\n }\n}\n\n/**\n * Represents an external hyperlink to a URL outside the document.\n *\n * External hyperlinks create a relationship to an external resource (URL).\n * The relationship is created during document preparation and the hyperlink\n * is converted to a ConcreteHyperlink with the relationship ID.\n *\n * Reference: http://officeopenxml.com/WPhyperlink.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"hyperlink\" type=\"CT_Hyperlink\"/>\n *\n * <xsd:complexType name=\"CT_Hyperlink\">\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute ref=\"r:id\"/>\n * <xsd:attribute name=\"history\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new ExternalHyperlink({\n * children: [new TextRun({ text: \"Visit Example\", style: \"Hyperlink\" })],\n * link: \"https://example.com\",\n * });\n * ```\n */\nexport class ExternalHyperlink extends XmlComponent {\n public constructor(public readonly options: ExternalHyperlinkOptions) {\n super(\"w:externalHyperlink\");\n }\n}\n","export { TargetModeType } from \"@office-open/core\";\nexport type { RelationshipType } from \"@office-open/core\";\n","/**\n * Non-visual drawing properties module.\n *\n * This module provides basic metadata for drawing elements including\n * ID, name, description, and hyperlink support.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * @module\n */\nimport type { HyperlinkOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport {\n buildHyperlinkClickObj,\n buildHyperlinkHoverObj,\n} from \"@file/drawing/doc-properties/doc-properties-children\";\nimport { ConcreteHyperlink } from \"@file/paragraph/links/hyperlink\";\nimport { TargetModeType } from \"@file/relationships/relationship/relationship\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { uniqueId } from \"@util/convenience-functions\";\n\nconst HYPERLINK_RELATIONSHIP_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\";\n\n/**\n * Represents non-visual drawing properties for pictures.\n *\n * This element specifies non-visual properties for a DrawingML object.\n * These include identification, naming, description, and hyperlink properties.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_NonVisualDrawingProps\">\n * <xsd:sequence>\n * <xsd:element name=\"hlinkClick\" type=\"CT_Hyperlink\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"hlinkHover\" type=\"CT_Hyperlink\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"id\" type=\"ST_DrawingElementId\" use=\"required\"/>\n * <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\"/>\n * <xsd:attribute name=\"descr\" type=\"xsd:string\" use=\"optional\" default=\"\"/>\n * <xsd:attribute name=\"hidden\" type=\"xsd:boolean\" use=\"optional\" default=\"false\"/>\n * <xsd:attribute name=\"title\" type=\"xsd:string\" use=\"optional\" default=\"\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const cNvPr = new NonVisualProperties();\n * ```\n */\nexport class NonVisualProperties extends XmlComponent {\n private readonly hyperlink?: HyperlinkOptions;\n\n public constructor(hyperlink?: HyperlinkOptions) {\n super(\"pic:cNvPr\");\n\n this.hyperlink = hyperlink;\n\n this.root.push({ _attr: { id: 0, name: \"\", descr: \"\" } });\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n // Stack-based detection (backward compatible with ConcreteHyperlink wrapping)\n let hasStackClick = false;\n for (let i = context.stack.length - 1; i >= 0; i--) {\n const element = context.stack[i];\n if (!(element instanceof ConcreteHyperlink)) {\n continue;\n }\n\n this.root.push(buildHyperlinkClickObj(element.linkId, false));\n hasStackClick = true;\n\n break;\n }\n\n // Explicit hyperlink options take precedence over stack-based detection\n if (this.hyperlink) {\n if (this.hyperlink.click && !hasStackClick) {\n const linkId = uniqueId();\n context.viewWrapper.relationships.addRelationship(\n linkId,\n HYPERLINK_RELATIONSHIP_TYPE,\n this.hyperlink.click,\n TargetModeType.EXTERNAL,\n );\n this.root.push(buildHyperlinkClickObj(linkId, false));\n }\n\n if (this.hyperlink.hover) {\n const linkId = uniqueId();\n context.viewWrapper.relationships.addRelationship(\n linkId,\n HYPERLINK_RELATIONSHIP_TYPE,\n this.hyperlink.hover,\n TargetModeType.EXTERNAL,\n );\n this.root.push(buildHyperlinkHoverObj(linkId, false));\n }\n }\n\n return super.prepForXml(context);\n }\n}\n","/**\n * Non-visual picture properties module.\n *\n * This module provides metadata and locking settings for pictures\n * that don't affect their visual appearance.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * @module\n */\nimport type { HyperlinkOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { buildChildNonVisualPropertiesObj } from \"./child-non-visual-pic-properties/child-non-visual-pic-properties\";\nimport { NonVisualProperties } from \"./non-visual-properties/non-visual-properties\";\n\n/**\n * Represents non-visual picture properties.\n *\n * This element specifies non-visual properties for a picture. These properties\n * include metadata like name, description, and locking settings that don't affect\n * the visual appearance of the picture.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PictureNonVisual\">\n * <xsd:sequence>\n * <xsd:element name=\"cNvPr\" type=\"a:CT_NonVisualDrawingProps\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * <xsd:element name=\"cNvPicPr\" type=\"a:CT_NonVisualPictureProperties\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const nvPicPr = new NonVisualPicProperties();\n * ```\n */\nexport class NonVisualPicProperties extends XmlComponent {\n public constructor(hyperlink?: HyperlinkOptions) {\n super(\"pic:nvPicPr\");\n\n this.root.push(new NonVisualProperties(hyperlink));\n this.root.push(buildChildNonVisualPropertiesObj());\n }\n}\n","/**\n * Picture module for DrawingML elements.\n *\n * This module provides the picture element that represents an image\n * within a DrawingML graphic.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * @module\n */\n// http://officeopenxml.com/drwPic.php\nimport type { HyperlinkOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { IMediaData, MediaDataTransformation } from \"@file/media\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { FillOptions, TileOptions } from \"@office-open/core/drawingml\";\n\nimport type { BlipOptions } from \"./blip/blip\";\nimport type { BlipEffectsOptions } from \"./blip/blip-effects\";\nimport { createBlipFill } from \"./blip/blip-fill\";\nimport { NonVisualPicProperties } from \"./non-visual-pic-properties/non-visual-pic-properties\";\nimport type { EffectListOptions } from \"./shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"./shape-properties/outline/outline\";\nimport { ShapeProperties } from \"./shape-properties/shape-properties\";\n\n/**\n * Represents a picture element in DrawingML.\n *\n * A picture contains non-visual properties, image data (blip fill),\n * and shape properties that define how the image is displayed.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Picture\">\n * <xsd:sequence>\n * <xsd:element name=\"nvPicPr\" type=\"CT_PictureNonVisual\"/>\n * <xsd:element name=\"blipFill\" type=\"CT_BlipFillProperties\"/>\n * <xsd:element name=\"spPr\" type=\"a:CT_ShapeProperties\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const pic = new Pic({\n * mediaData: imageData,\n * transform: { emus: { x: 914400, y: 914400 } },\n * outline: { color: \"000000\", width: 9525 }\n * });\n * ```\n */\nexport class Pic extends XmlComponent {\n public constructor({\n mediaData,\n transform,\n outline,\n fill,\n effects,\n blipEffects,\n tile,\n hyperlink,\n }: {\n readonly mediaData: IMediaData;\n readonly transform: MediaDataTransformation;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly effects?: EffectListOptions;\n readonly blipEffects?: BlipEffectsOptions;\n readonly tile?: TileOptions;\n readonly hyperlink?: HyperlinkOptions;\n }) {\n super(\"pic:pic\");\n\n this.root.push({\n _attr: {\n \"xmlns:pic\": \"http://schemas.openxmlformats.org/drawingml/2006/picture\",\n },\n });\n\n this.root.push(new NonVisualPicProperties(hyperlink));\n const blipOptions: BlipOptions = {\n referenceId: mediaData.fileName,\n type: mediaData.type,\n fallbackFileName: \"fallback\" in mediaData ? mediaData.fallback.fileName : undefined,\n };\n this.root.push(createBlipFill(blipOptions, { blipEffects, tile, srcRect: mediaData.srcRect }));\n this.root.push(new ShapeProperties({ element: \"pic\", effects, fill, outline, transform }));\n }\n}\n","/**\n * Picture module exports.\n *\n * @module\n */\nexport * from \"./pic\";\n","/**\n * Extents (size) element for DrawingML shapes.\n *\n * This module defines the size of a shape or picture in EMUs.\n *\n * Reference: http://officeopenxml.com/drwSp-size.php\n *\n * @module\n */\n// http://officeopenxml.com/drwSp-size.php\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents the extents (size) of a DrawingML shape.\n *\n * Defines the width and height of the shape in English Metric Units (EMUs).\n * One EMU equals 1/914,400 of an inch.\n *\n * Reference: http://officeopenxml.com/drwSp-size.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PositiveSize2D\">\n * <xsd:attribute name=\"cx\" type=\"ST_PositiveCoordinate\" use=\"required\"/>\n * <xsd:attribute name=\"cy\" type=\"ST_PositiveCoordinate\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a 1-inch by 1-inch shape\n * const extents = new Extents(914400, 914400);\n * ```\n */\nexport class Extents extends XmlComponent {\n public constructor(x: number, y: number) {\n super(\"a:ext\");\n\n this.root.push({ _attr: { cx: x, cy: y } });\n }\n}\n","/**\n * Offset (position) element for DrawingML shapes.\n *\n * This module defines the position of a shape or picture in EMUs.\n *\n * Reference: http://officeopenxml.com/drwSp-size.php\n *\n * @module\n */\n// http://officeopenxml.com/drwSp-size.php\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents the offset (position) of a DrawingML shape.\n *\n * Defines the x and y coordinates of the shape's position in\n * English Metric Units (EMUs). One EMU equals 1/914,400 of an inch.\n *\n * Reference: http://officeopenxml.com/drwSp-size.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Point2D\">\n * <xsd:attribute name=\"x\" type=\"ST_Coordinate\" use=\"required\"/>\n * <xsd:attribute name=\"y\" type=\"ST_Coordinate\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const offset = new Offset();\n * ```\n */\nexport class Offset extends XmlComponent {\n public constructor(x: number | undefined, y: number | undefined) {\n super(\"a:off\");\n\n this.root.push({ _attr: { x: x ?? 0, y: y ?? 0 } });\n }\n}\n","import type { MediaDataTransformation } from \"@file/media\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\nimport { buildFill, type FillOptions } from \"@office-open/core/drawingml\";\n\nimport { createEffectList } from \"../pic/shape-properties/effects/effect-list\";\nimport type { EffectListOptions } from \"../pic/shape-properties/effects/effect-list\";\nimport { Extents } from \"../pic/shape-properties/form/extents/extents\";\nimport { Offset } from \"../pic/shape-properties/form/offset/off\";\n\nexport type GroupChild = XmlComponent;\n\n/**\n * Child coordinate offset (CT_Point2D).\n */\nexport interface ChildOffset {\n readonly x: number;\n readonly y: number;\n}\n\n/**\n * Child coordinate extent (CT_PositiveSize2D).\n */\nexport interface ChildExtent {\n readonly cx: number;\n readonly cy: number;\n}\n\nexport interface WpgGroupCoreOptions {\n readonly children: readonly GroupChild[];\n}\n\nexport type WpgGroupOptions = WpgGroupCoreOptions & {\n readonly transformation: MediaDataTransformation;\n /** Child coordinate offset (chOff) */\n readonly chOff?: ChildOffset;\n /** Child coordinate extent (chExt) */\n readonly chExt?: ChildExtent;\n /** Group fill */\n readonly fill?: FillOptions;\n /** Group effects */\n readonly effects?: EffectListOptions;\n};\n\n/**\n * Creates a group transform element (a:xfrm) with optional chOff/chExt.\n *\n * This uses CT_GroupTransform2D which extends CT_Transform2D with\n * child offset and extent elements.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GroupTransform2D\">\n * <xsd:sequence>\n * <xsd:element name=\"off\" type=\"CT_Point2D\" minOccurs=\"0\"/>\n * <xsd:element name=\"ext\" type=\"CT_PositiveSize2D\" minOccurs=\"0\"/>\n * <xsd:element name=\"chOff\" type=\"CT_Point2D\" minOccurs=\"0\"/>\n * <xsd:element name=\"chExt\" type=\"CT_PositiveSize2D\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"rot\" type=\"ST_Angle\" default=\"0\"/>\n * <xsd:attribute name=\"flipH\" type=\"xsd:boolean\" default=\"false\"/>\n * <xsd:attribute name=\"flipV\" type=\"xsd:boolean\" default=\"false\"/>\n * </xsd:complexType>\n * ```\n */\nconst createGroupForm = (\n transform: MediaDataTransformation,\n chOff?: ChildOffset,\n chExt?: ChildExtent,\n): XmlComponent => {\n const children: BuilderChild[] = [\n new Offset(transform.offset?.emus?.x, transform.offset?.emus?.y),\n new Extents(transform.emus.x, transform.emus.y),\n ];\n\n if (chOff) {\n children.push(\n new BuilderElement<{ readonly x: number; readonly y: number }>({\n attributes: {\n x: { key: \"x\", value: chOff.x },\n y: { key: \"y\", value: chOff.y },\n },\n name: \"a:chOff\",\n }),\n );\n }\n\n if (chExt) {\n children.push(\n new BuilderElement<{ readonly cx: number; readonly cy: number }>({\n attributes: {\n cx: { key: \"cx\", value: chExt.cx },\n cy: { key: \"cy\", value: chExt.cy },\n },\n name: \"a:chExt\",\n }),\n );\n }\n\n const hasAttributes =\n transform.flip?.horizontal !== undefined ||\n transform.flip?.vertical !== undefined ||\n transform.rotation !== undefined;\n\n const attributes = hasAttributes\n ? {\n ...(transform.flip?.horizontal !== undefined && {\n flipH: { key: \"flipH\", value: transform.flip.horizontal },\n }),\n ...(transform.flip?.vertical !== undefined && {\n flipV: { key: \"flipV\", value: transform.flip.vertical },\n }),\n ...(transform.rotation !== undefined && {\n rot: { key: \"rot\", value: transform.rotation },\n }),\n }\n : undefined;\n\n return new BuilderElement({\n attributes: attributes as never,\n children,\n name: \"a:xfrm\",\n });\n};\n\nconst createGroupProperties = (options: WpgGroupOptions): XmlComponent => {\n const children: BuilderChild[] = [\n createGroupForm(options.transformation, options.chOff, options.chExt),\n ];\n\n if (options.fill !== undefined) {\n children.push(buildFill(options.fill));\n }\n\n if (options.effects) {\n children.push(createEffectList(options.effects));\n }\n\n return new BuilderElement({\n children,\n name: \"wpg:grpSpPr\",\n });\n};\n\nconst createNonVisualGroupProperties = (): XmlComponent =>\n new BuilderElement({\n name: \"wpg:cNvGrpSpPr\",\n });\n\nexport const createWpgGroup = (options: WpgGroupOptions): XmlComponent =>\n new BuilderElement({\n children: [\n createNonVisualGroupProperties(),\n createGroupProperties(options),\n ...options.children,\n ],\n name: \"wpg:wgp\",\n });\n","import type { HyperlinkOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport { createWpsShape } from \"@file/drawing/inline/graphic/graphic-data/wps/wps-shape\";\nimport type {\n ChartMediaData,\n IExtendedMediaData,\n IMediaData,\n MediaDataTransformation,\n SmartArtMediaData,\n WpgMediaData,\n} from \"@file/media\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\n\nimport { Pic } from \"./pic\";\nimport type { BlipEffectsOptions } from \"./pic/blip/blip-effects\";\nimport type { TileOptions } from \"./pic/blip/tile\";\nimport type { EffectListOptions } from \"./pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"./pic/shape-properties/outline/outline\";\nimport { createWpgGroup } from \"./wpg/wpg-group\";\n\n/**\n * Represents graphical data within a DrawingML graphic element.\n *\n * GraphicData contains the actual picture, chart, or other graphical\n * content referenced by a graphic element. It uses a URI to identify\n * the type of content being stored.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GraphicalObjectData\">\n * <xsd:sequence>\n * <xsd:any minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"strict\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"uri\" type=\"xsd:token\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const graphicData = new GraphicData({\n * mediaData: imageData,\n * transform: transformation,\n * outline: { color: \"000000\", width: 9525 }\n * });\n * ```\n */\nexport class GraphicData extends XmlComponent {\n // Private readonly pic: Pic;\n\n public constructor({\n mediaData,\n transform,\n outline,\n fill,\n effects,\n blipEffects,\n tile,\n hyperlink,\n }: {\n readonly mediaData: IExtendedMediaData;\n readonly transform: MediaDataTransformation;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly effects?: EffectListOptions;\n readonly blipEffects?: BlipEffectsOptions;\n readonly tile?: TileOptions;\n readonly hyperlink?: HyperlinkOptions;\n }) {\n super(\"a:graphicData\");\n\n if (mediaData.type === \"wps\") {\n this.root.push({\n _attr: { uri: \"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" },\n });\n const wps = createWpsShape({\n ...mediaData.data,\n outline,\n fill,\n transformation: transform,\n });\n this.root.push(wps);\n } else if (mediaData.type === \"wpg\") {\n this.root.push({\n _attr: { uri: \"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" },\n });\n const md = mediaData as WpgMediaData;\n const children = md.children.map((child) => {\n if (child.type === \"wps\") {\n return createWpsShape({\n ...child.data,\n outline: child.outline,\n fill: child.fill,\n transformation: child.transformation,\n });\n } else {\n return new Pic({\n mediaData: child,\n outline: child.outline,\n transform: child.transformation,\n });\n }\n });\n // Const wps = new WpsShape({ ...mediaData.data, transformation: transform, outline, solidFill });\n const wpg = createWpgGroup({\n children,\n transformation: transform,\n chOff: md.chOff,\n chExt: md.chExt,\n fill: md.fill,\n effects: md.effects,\n });\n this.root.push(wpg);\n } else if (mediaData.type === \"chart\") {\n this.root.push({ _attr: { uri: \"http://schemas.openxmlformats.org/drawingml/2006/chart\" } });\n const md = mediaData as ChartMediaData;\n const chartRef = new (class extends XmlComponent {\n public constructor() {\n super(\"c:chart\");\n }\n })();\n chartRef[\"root\"].push({\n _attr: {\n \"xmlns:c\": \"http://schemas.openxmlformats.org/drawingml/2006/chart\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"r:id\": `{chart:${md.chartKey}}`,\n },\n });\n this.root.push(chartRef);\n } else if (mediaData.type === \"smartart\") {\n this.root.push({\n _attr: { uri: \"http://schemas.openxmlformats.org/drawingml/2006/diagram\" },\n });\n const md = mediaData as SmartArtMediaData;\n const relIds = new (class extends XmlComponent {\n public constructor() {\n super(\"dgm:relIds\");\n }\n })();\n relIds[\"root\"].push({\n _attr: {\n \"xmlns:dgm\": \"http://schemas.openxmlformats.org/drawingml/2006/diagram\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"r:cs\": `{smartart-cs:${md.smartArtKey}}`,\n \"r:dm\": `{smartart:${md.smartArtKey}}`,\n \"r:lo\": `{smartart-lo:${md.smartArtKey}}`,\n \"r:qs\": `{smartart-qs:${md.smartArtKey}}`,\n },\n });\n this.root.push(relIds);\n } else {\n this.root.push({\n _attr: { uri: \"http://schemas.openxmlformats.org/drawingml/2006/picture\" },\n });\n const md = mediaData as IMediaData;\n const pic = new Pic({\n blipEffects,\n effects,\n hyperlink,\n mediaData: md,\n outline,\n fill,\n tile,\n transform,\n });\n this.root.push(pic);\n }\n\n // If (mediaData.type !== \"wps\") {\n // Const pic = new Pic({ mediaData, transform, outline });\n // This.root.push(pic);\n // } else {\n // Const wps = new WpsShape({ ...mediaData.data, transformation: transform, outline, solidFill });\n // This.root.push(wps);\n // }\n }\n}\n","/**\n * Graphic data module exports.\n *\n * @module\n */\nexport * from \"./graphic-data\";\n","import type { HyperlinkOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { IExtendedMediaData, MediaDataTransformation } from \"@file/media\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\n\nimport { GraphicData } from \"./graphic-data\";\nimport type { BlipEffectsOptions } from \"./graphic-data/pic/blip/blip-effects\";\nimport type { TileOptions } from \"./graphic-data/pic/blip/tile\";\nimport type { EffectListOptions } from \"./graphic-data/pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"./graphic-data/pic/shape-properties/outline/outline\";\n\n/**\n * Represents a graphic element in DrawingML.\n *\n * Graphic is the container for graphical content such as\n * pictures, shapes, and charts within a drawing.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GraphicalObject\">\n * <xsd:sequence>\n * <xsd:element name=\"graphicData\" type=\"CT_GraphicalObjectData\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const graphic = new Graphic({\n * mediaData: imageData,\n * transform: transformation,\n * outline: { color: \"FF0000\", width: 9525 }\n * });\n * ```\n */\nexport class Graphic extends XmlComponent {\n private readonly data: GraphicData;\n\n public constructor({\n mediaData,\n transform,\n outline,\n fill,\n effects,\n blipEffects,\n tile,\n hyperlink,\n }: {\n readonly mediaData: IExtendedMediaData;\n readonly transform: MediaDataTransformation;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly effects?: EffectListOptions;\n readonly blipEffects?: BlipEffectsOptions;\n readonly tile?: TileOptions;\n readonly hyperlink?: HyperlinkOptions;\n }) {\n super(\"a:graphic\");\n this.root.push({\n _attr: {\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n },\n });\n\n this.data = new GraphicData({\n blipEffects,\n effects,\n hyperlink,\n mediaData,\n outline,\n fill,\n tile,\n transform,\n });\n\n this.root.push(this.data);\n }\n}\n","/**\n * Graphic module exports.\n *\n * @module\n */\nexport * from \"./graphic\";\n","/**\n * Text wrapping module for DrawingML elements.\n *\n * This module provides text wrapping options for floating/anchored drawings.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @module\n */\nimport type { Distance } from \"../drawing\";\n\n/**\n * Enumeration of text wrapping types for floating drawings.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @publicApi\n */\nexport const TextWrappingType = {\n NONE: 0,\n SQUARE: 1,\n TIGHT: 2,\n TOP_AND_BOTTOM: 3,\n THROUGH: 4,\n} as const;\n\n/**\n * Enumeration of text wrapping sides for floating drawings.\n *\n * Specifies on which side(s) text can wrap around the drawing.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @publicApi\n */\nexport const TextWrappingSide = {\n /** Text wraps on both sides of the drawing */\n BOTH_SIDES: \"bothSides\",\n /** Text wraps only on the left side */\n LEFT: \"left\",\n /** Text wraps only on the right side */\n RIGHT: \"right\",\n /** Text wraps on the side with more space */\n LARGEST: \"largest\",\n} as const;\n\n/**\n * Options for configuring text wrapping around a drawing.\n */\nexport interface TextWrapping {\n readonly type: (typeof TextWrappingType)[keyof typeof TextWrappingType];\n readonly side?: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];\n readonly margins?: Distance;\n}\n","/**\n * Wrap None module for DrawingML text wrapping.\n *\n * This module provides no text wrapping for floating drawings\n * where text does not wrap around the drawing.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates no text wrapping for a floating drawing.\n *\n * WrapNone causes text to flow behind or in front of the drawing\n * without wrapping around it.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n */\nexport const createWrapNone = (): XmlComponent =>\n new BuilderElement({\n name: \"wp:wrapNone\",\n });\n","/**\n * Wrap Square module for DrawingML text wrapping.\n *\n * This module provides square text wrapping for floating drawings\n * where text wraps around a rectangular bounding box.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { Distance } from \"../drawing\";\nimport type { Margins } from \"../floating\";\nimport { TextWrappingSide } from \"./text-wrapping\";\nimport type { TextWrapping } from \"./text-wrapping\";\n\ntype IWrapSquareAttributes = {\n readonly wrapText?: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];\n} & Distance;\n\n/**\n * Creates square text wrapping for a floating drawing.\n *\n * WrapSquare causes text to wrap around the rectangular bounding box\n * of the drawing on the specified side(s).\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_WrapSquare\">\n * <xsd:sequence>\n * <xsd:element name=\"effectExtent\" type=\"CT_EffectExtent\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"wrapText\" type=\"ST_WrapText\" use=\"required\"/>\n * <xsd:attribute name=\"distT\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distB\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distL\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distR\" type=\"ST_WrapDistance\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createWrapSquare = (\n textWrapping: TextWrapping,\n margins: Margins = {\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n): XmlComponent =>\n new BuilderElement<IWrapSquareAttributes>({\n attributes: {\n distB: { key: \"distB\", value: margins.bottom },\n distL: { key: \"distL\", value: margins.left },\n distR: { key: \"distR\", value: margins.right },\n distT: { key: \"distT\", value: margins.top },\n wrapText: { key: \"wrapText\", value: textWrapping.side || TextWrappingSide.BOTH_SIDES },\n },\n name: \"wp:wrapSquare\",\n });\n","/**\n * Wrap Tight module for DrawingML text wrapping.\n *\n * This module provides tight text wrapping for floating drawings\n * where text wraps closely around the image shape.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { Margins } from \"../floating\";\nimport { TextWrappingSide } from \"./text-wrapping\";\nimport type { TextWrapping } from \"./text-wrapping\";\n\ninterface WrapTightAttributes {\n readonly wrapText: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];\n readonly distL?: number;\n readonly distR?: number;\n}\n\n/**\n * Creates a default rectangular wrap polygon matching the image extent.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_WrapPath\">\n * <xsd:sequence>\n * <xsd:element name=\"start\" type=\"a:CT_Point2D\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * <xsd:element name=\"lineTo\" type=\"a:CT_Point2D\" minOccurs=\"2\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"edited\" type=\"xsd:boolean\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nconst createWrapPolygon = (cx: number, cy: number): XmlComponent =>\n new BuilderElement({\n attributes: {\n edited: { key: \"edited\", value: \"0\" },\n },\n children: [\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: 0 },\n },\n name: \"wp:start\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: -cy },\n },\n name: \"wp:lineTo\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: cx },\n y: { key: \"y\", value: -cy },\n },\n name: \"wp:lineTo\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: cx },\n y: { key: \"y\", value: 0 },\n },\n name: \"wp:lineTo\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: 0 },\n },\n name: \"wp:lineTo\",\n }),\n ],\n name: \"wp:wrapPolygon\",\n });\n\n/**\n * Creates tight text wrapping for a floating drawing.\n *\n * WrapTight causes text to wrap closely around the contours\n * of the drawing rather than its rectangular bounding box.\n * A default rectangular wrap polygon matching the image extent is generated.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_WrapTight\">\n * <xsd:sequence>\n * <xsd:element name=\"wrapPolygon\" type=\"CT_WrapPath\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"wrapText\" type=\"ST_WrapText\" use=\"required\"/>\n * <xsd:attribute name=\"distL\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distR\" type=\"ST_WrapDistance\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createWrapTight = (\n textWrapping: TextWrapping,\n margins: Margins = {\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n extent: { x: number; y: number },\n): XmlComponent =>\n new BuilderElement<WrapTightAttributes>({\n attributes: {\n distL: { key: \"distL\", value: margins.left },\n distR: { key: \"distR\", value: margins.right },\n wrapText: { key: \"wrapText\", value: textWrapping.side || TextWrappingSide.BOTH_SIDES },\n },\n children: [createWrapPolygon(extent.x, extent.y)],\n name: \"wp:wrapTight\",\n });\n","/**\n * Wrap Through module for DrawingML text wrapping.\n *\n * This module provides \"through\" text wrapping for floating drawings\n * where text wraps through the image contours, filling any concave areas.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { Margins } from \"../floating\";\nimport { TextWrappingSide } from \"./text-wrapping\";\nimport type { TextWrapping } from \"./text-wrapping\";\n\ninterface WrapThroughAttributes {\n readonly wrapText: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];\n readonly distL?: number;\n readonly distR?: number;\n}\n\n/**\n * Creates a default rectangular wrap polygon matching the image extent.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_WrapPath\">\n * <xsd:sequence>\n * <xsd:element name=\"start\" type=\"a:CT_Point2D\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * <xsd:element name=\"lineTo\" type=\"a:CT_Point2D\" minOccurs=\"2\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"edited\" type=\"xsd:boolean\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nconst createWrapPolygon = (cx: number, cy: number): XmlComponent =>\n new BuilderElement({\n attributes: {\n edited: { key: \"edited\", value: \"0\" },\n },\n children: [\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: 0 },\n },\n name: \"wp:start\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: -cy },\n },\n name: \"wp:lineTo\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: cx },\n y: { key: \"y\", value: -cy },\n },\n name: \"wp:lineTo\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: cx },\n y: { key: \"y\", value: 0 },\n },\n name: \"wp:lineTo\",\n }),\n new BuilderElement({\n attributes: {\n x: { key: \"x\", value: 0 },\n y: { key: \"y\", value: 0 },\n },\n name: \"wp:lineTo\",\n }),\n ],\n name: \"wp:wrapPolygon\",\n });\n\n/**\n * Creates \"through\" text wrapping for a floating drawing.\n *\n * WrapThrough is similar to WrapTight but allows text to wrap through\n * the concave portions of the drawing shape (e.g., the inside of the letter \"O\").\n * A default rectangular wrap polygon matching the image extent is generated.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_WrapThrough\">\n * <xsd:sequence>\n * <xsd:element name=\"wrapPolygon\" type=\"CT_WrapPath\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"wrapText\" type=\"ST_WrapText\" use=\"required\"/>\n * <xsd:attribute name=\"distL\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distR\" type=\"ST_WrapDistance\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createWrapThrough = (\n textWrapping: TextWrapping,\n margins: Margins = {\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n },\n extent: { x: number; y: number },\n): XmlComponent =>\n new BuilderElement<WrapThroughAttributes>({\n attributes: {\n distL: { key: \"distL\", value: margins.left },\n distR: { key: \"distR\", value: margins.right },\n wrapText: { key: \"wrapText\", value: textWrapping.side || TextWrappingSide.BOTH_SIDES },\n },\n children: [createWrapPolygon(extent.x, extent.y)],\n name: \"wp:wrapThrough\",\n });\n","/**\n * Wrap Top and Bottom module for DrawingML text wrapping.\n *\n * This module provides top-and-bottom text wrapping for floating drawings\n * where text appears above and below the drawing but not beside it.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { Margins } from \"../floating\";\n\ninterface WrapTopAndBottomAttributes {\n readonly distT?: number;\n readonly distB?: number;\n}\n\n/**\n * Creates top-and-bottom text wrapping for a floating drawing.\n *\n * WrapTopAndBottom causes text to appear above and below the drawing\n * without wrapping beside it, creating a line break effect.\n *\n * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_WrapTopBottom\">\n * <xsd:sequence>\n * <xsd:element name=\"effectExtent\" type=\"CT_EffectExtent\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"distT\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distB\" type=\"ST_WrapDistance\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createWrapTopAndBottom = (\n margins: Margins = {\n bottom: 0,\n top: 0,\n },\n): XmlComponent =>\n new BuilderElement<WrapTopAndBottomAttributes>({\n attributes: {\n distB: { key: \"distB\", value: margins.bottom },\n distT: { key: \"distT\", value: margins.top },\n },\n name: \"wp:wrapTopAndBottom\",\n });\n","/**\n * Text wrap module exports.\n *\n * @module\n */\nexport * from \"./text-wrapping\";\nexport * from \"./wrap-none\";\nexport * from \"./wrap-square\";\nexport * from \"./wrap-tight\";\nexport * from \"./wrap-through\";\nexport * from \"./wrap-top-and-bottom\";\n","/**\n * Document Properties module for DrawingML elements.\n *\n * This module provides non-visual properties for drawing elements,\n * including name, description, accessibility information, and hyperlinks.\n *\n * Reference: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docPr_topic_ID0ES32OB.html\n *\n * @module\n */\nimport { ConcreteHyperlink } from \"@file/paragraph/links/hyperlink\";\nimport { TargetModeType } from \"@file/relationships/relationship/relationship\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { docPropertiesUniqueNumericIdGen, uniqueId } from \"@util/convenience-functions\";\n\nimport { buildHyperlinkClickObj, buildHyperlinkHoverObj } from \"./doc-properties-children\";\n\n// <complexType name=\"CT_NonVisualDrawingProps\">\n// <sequence>\n// <element name=\"hlinkClick\" type=\"CT_Hyperlink\" minOccurs=\"0\" maxOccurs=\"1\" />\n// <element name=\"hlinkHover\" type=\"CT_Hyperlink\" minOccurs=\"0\" maxOccurs=\"1\" />\n// <element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\" maxOccurs=\"1\" />\n// </sequence>\n// <attribute name=\"id\" type=\"ST_DrawingElementId\" use=\"required\" />\n// <attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n// <attribute name=\"descr\" type=\"xsd:string\" use=\"optional\" default=\"\" />\n// <attribute name=\"hidden\" type=\"xsd:boolean\" use=\"optional\" default=\"false\" />\n// </complexType>\n\n/**\n * Options for hyperlinks on a drawing element.\n */\nexport interface HyperlinkOptions {\n /** URL for click hyperlink */\n readonly click?: string;\n /** URL for hover hyperlink */\n readonly hover?: string;\n}\n\n/**\n * Options for configuring document properties of a drawing.\n *\n * @see {@link DocProperties}\n */\nexport interface DocPropertiesOptions {\n /** Name of the drawing element (used for identification) */\n readonly name: string;\n /** Description/alt text for accessibility */\n readonly description?: string;\n /** Title of the drawing element */\n readonly title?: string;\n readonly id?: string;\n /** Hyperlink options for click and hover actions */\n readonly hyperlink?: HyperlinkOptions;\n}\n\nconst HYPERLINK_RELATIONSHIP_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\";\n\n/**\n * Represents non-visual drawing properties in a WordprocessingML document.\n *\n * DocProperties contains metadata about a drawing element such as\n * its name, description (alt text), and title for accessibility.\n *\n * Reference: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docPr_topic_ID0ES32OB.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_NonVisualDrawingProps\">\n * <xsd:sequence>\n * <xsd:element name=\"hlinkClick\" type=\"CT_Hyperlink\" minOccurs=\"0\"/>\n * <xsd:element name=\"hlinkHover\" type=\"CT_Hyperlink\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"id\" type=\"ST_DrawingElementId\" use=\"required\"/>\n * <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\"/>\n * <xsd:attribute name=\"descr\" type=\"xsd:string\"/>\n * <xsd:attribute name=\"hidden\" type=\"xsd:boolean\"/>\n * </xsd:complexType>\n * ```\n */\nlet globalDocPropertiesIdGen = docPropertiesUniqueNumericIdGen();\n\n/** Reset the global doc properties ID generator (for testing). */\nexport const resetDocPropertiesIdGen = (): void => {\n globalDocPropertiesIdGen = docPropertiesUniqueNumericIdGen();\n};\n\nexport class DocProperties extends XmlComponent {\n private readonly hyperlink?: HyperlinkOptions;\n\n public constructor(\n { name, description, title, id, hyperlink }: DocPropertiesOptions = {\n description: \"\",\n name: \"\",\n title: \"\",\n },\n ) {\n super(\"wp:docPr\");\n\n this.hyperlink = hyperlink;\n\n const attributes: Record<string, string | number> = {\n id: id ?? globalDocPropertiesIdGen(),\n name,\n };\n\n if (description !== null && description !== undefined) {\n attributes.descr = description;\n }\n\n if (title !== null && title !== undefined) {\n attributes.title = title;\n }\n\n this.root.push({ _attr: attributes });\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n // Stack-based detection (backward compatible with ConcreteHyperlink wrapping)\n let hasStackClick = false;\n for (let i = context.stack.length - 1; i >= 0; i--) {\n const element = context.stack[i];\n if (!(element instanceof ConcreteHyperlink)) {\n continue;\n }\n\n this.root.push(buildHyperlinkClickObj(element.linkId, true));\n hasStackClick = true;\n break;\n }\n\n // Explicit hyperlink options take precedence over stack-based detection\n if (this.hyperlink) {\n if (this.hyperlink.click && !hasStackClick) {\n const linkId = uniqueId();\n context.viewWrapper.relationships.addRelationship(\n linkId,\n HYPERLINK_RELATIONSHIP_TYPE,\n this.hyperlink.click,\n TargetModeType.EXTERNAL,\n );\n this.root.push(buildHyperlinkClickObj(linkId, true));\n }\n\n if (this.hyperlink.hover) {\n const linkId = uniqueId();\n context.viewWrapper.relationships.addRelationship(\n linkId,\n HYPERLINK_RELATIONSHIP_TYPE,\n this.hyperlink.hover,\n TargetModeType.EXTERNAL,\n );\n this.root.push(buildHyperlinkHoverObj(linkId, true));\n }\n }\n\n return super.prepForXml(context);\n }\n}\n","/**\n * Effect extent for DrawingML objects.\n *\n * This module provides support for defining additional extent to compensate\n * for drawing effects applied to objects.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_effectExtent_topic_ID0E5O3OB.html\n *\n * @module\n */\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Attributes for effect extent.\n */\nexport interface EffectExtentAttributes {\n /**\n * ## Additional Extent on Top Edge\n *\n * Specifies the additional length, in EMUs, which shall be added to the top edge of the DrawingML object to determine its actual top edge including effects.\n */\n readonly top: number;\n /**\n * ## Additional Extent on Right Edge\n *\n * Specifies the additional length, in EMUs, which shall be added to the right edge of the DrawingML object to determine its actual right edge including effects.\n */\n readonly right: number;\n /**\n * ## Additional Extent on Bottom Edge\n *\n * Specifies the additional length, in EMUs, which shall be added to the bottom edge of the DrawingML object to determine its actual bottom edge including effects.\n */\n readonly bottom: number;\n /**\n * ## Additional Extent on Left Edge\n *\n * Specifies the additional length, in EMUs, which shall be added to the left edge of the DrawingML object to determine its actual left edge including effects.\n */\n readonly left: number;\n}\n\n/**\n * Creates an effect extent element.\n *\n * This element specifies the additional extent which shall be added to each\n * edge of the image (top, bottom, left, right) in order to compensate for any\n * drawing effects applied to the DrawingML object.\n *\n * The extent element specifies the size of the actual DrawingML object; however,\n * an object may have effects applied which change its overall size. This element\n * accounts for that additional space.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_effectExtent_topic_ID0E5O3OB.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EffectExtent\">\n * <xsd:attribute name=\"l\" type=\"a:ST_Coordinate\" use=\"required\"/>\n * <xsd:attribute name=\"t\" type=\"a:ST_Coordinate\" use=\"required\"/>\n * <xsd:attribute name=\"r\" type=\"a:ST_Coordinate\" use=\"required\"/>\n * <xsd:attribute name=\"b\" type=\"a:ST_Coordinate\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const effectExtent = buildEffectExtentObj({\n * top: 0,\n * right: 0,\n * bottom: 0,\n * left: 0\n * });\n * ```\n */\nexport const buildEffectExtentObj = ({\n top,\n right,\n bottom,\n left,\n}: EffectExtentAttributes): IXmlableObject => ({\n \"wp:effectExtent\": { _attr: { t: top, r: right, b: bottom, l: left } },\n});\n","/**\n * Extent (size) for DrawingML objects.\n *\n * This module provides support for defining the size of DrawingML objects\n * in inline drawings.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_extent_topic_ID0EQB4OB.html\n *\n * @module\n */\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Attributes for extent.\n */\ninterface ExtentAttributes {\n /**\n * ## Extent Length\n *\n * Specifies the length of the extents rectangle in EMUs. This rectangle shall dictate the size of the object as displayed (the result of any scaling to the original object).\n *\n *\n * ### Example\n *\n * ```xml\n * <... cx=\"1828800\" cy=\"200000\"/>\n * ```\n *\n * The `cx` attributes specifies that this object has a height of `1828800` EMUs (English Metric Units).\n *\n * The possible values for this attribute are defined by the `ST_PositiveCoordinate` simple type (§5.1.12.42).\n */\n readonly x?: number;\n /**\n * ## Extent Width\n *\n * Specifies the width of the extents rectangle in EMUs. This rectangle shall dictate the size of the object as displayed (the result of any scaling to the original object).\n *\n * ### Example\n *\n * ```xml\n * <... cx=\"1828800\" cy=\"200000\"/>\n * ```\n *\n * The `cy` attribute specifies that this object has a width of `200000` EMUs (English Metric Units).\n *\n * The possible values for this attribute are defined by the `ST_PositiveCoordinate` simple type (§5.1.12.42).\n */\n readonly y?: number;\n}\n\n/**\n * Creates an extent element for inline drawings.\n *\n * This element specifies the extents of the parent DrawingML object within\n * the document (i.e. its final height and width).\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_extent_topic_ID0EQB4OB.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PositiveSize2D\">\n * <xsd:attribute name=\"cx\" type=\"ST_PositiveCoordinate\" use=\"required\"/>\n * <xsd:attribute name=\"cy\" type=\"ST_PositiveCoordinate\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a 1-inch by 1-inch extent\n * const extent = buildExtentObj({\n * x: 914400,\n * y: 914400\n * });\n * ```\n */\nexport const buildExtentObj = ({ x, y }: ExtentAttributes): IXmlableObject => ({\n \"wp:extent\": { _attr: { cx: x, cy: y } },\n});\n","import type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Builds graphic frame locking properties object.\n *\n * This element specifies all locking properties for a graphic frame. These properties\n * inform the generating application about which operations are forbidden on the parent\n * graphic frame.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GraphicalObjectFrameLocking\">\n * <xsd:sequence>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"noGrp\" type=\"xsd:boolean\" use=\"optional\"/>\n * <xsd:attribute name=\"noDrilldown\" type=\"xsd:boolean\" use=\"optional\"/>\n * <xsd:attribute name=\"noSelect\" type=\"xsd:boolean\" use=\"optional\"/>\n * <xsd:attribute name=\"noChangeAspect\" type=\"xsd:boolean\" use=\"optional\"/>\n * <xsd:attribute name=\"noMove\" type=\"xsd:boolean\" use=\"optional\"/>\n * <xsd:attribute name=\"noResize\" type=\"xsd:boolean\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport const buildGraphicFrameLocksObj = (): IXmlableObject => ({\n \"a:graphicFrameLocks\": {\n _attr: {\n noChangeAspect: 1,\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n },\n },\n});\n","import type { IXmlableObject } from \"@file/xml-components\";\n\nimport { buildGraphicFrameLocksObj } from \"./graphic-frame-locks/graphic-frame-locks\";\n\n/**\n * # Common DrawingML Non-Visual Properties\n *\n * This element specifies common non-visual DrawingML object properties for the parent DrawingML object. These properties are specified as child elements of this element.\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_cNvGraphicFramePr_topic_ID0E6U2OB.html\n *\n * ## XSD Schema\n *\n * ```xml\n * <xsd:complexType name=\"CT_NonVisualGraphicFrameProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"graphicFrameLocks\" type=\"CT_GraphicalObjectFrameLocking\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const buildGraphicFramePropertiesObj = (): IXmlableObject => ({\n \"wp:cNvGraphicFramePr\": [buildGraphicFrameLocksObj()],\n});\n","// http://officeopenxml.com/drwPicFloating.php\nimport type { IExtendedMediaData, MediaDataTransformation } from \"@file/media\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { DrawingOptions } from \"../drawing\";\nimport { createHorizontalPosition, createSimplePos, createVerticalPosition } from \"../floating\";\nimport type { Floating } from \"../floating\";\nimport { Graphic } from \"../inline/graphic\";\nimport {\n TextWrappingType,\n createWrapNone,\n createWrapSquare,\n createWrapTight,\n createWrapThrough,\n createWrapTopAndBottom,\n} from \"../text-wrap\";\nimport { DocProperties } from \"./../doc-properties/doc-properties\";\nimport { buildEffectExtentObj } from \"./../effect-extent/effect-extent\";\nimport { buildExtentObj } from \"./../extent/extent\";\nimport { buildGraphicFramePropertiesObj } from \"./../graphic-frame/graphic-frame-properties\";\n\n// <xsd:complexType name=\"CT_Anchor\">\n// <xsd:sequence>\n// <xsd:element name=\"simplePos\" type=\"a:CT_Point2D\"/>\n// <xsd:element name=\"positionH\" type=\"CT_PosH\"/>\n// <xsd:element name=\"positionV\" type=\"CT_PosV\"/>\n// <xsd:element name=\"extent\" type=\"a:CT_PositiveSize2D\"/>\n// <xsd:element name=\"effectExtent\" type=\"CT_EffectExtent\" minOccurs=\"0\"/>\n// <xsd:group ref=\"EG_WrapType\"/>\n// <xsd:element name=\"docPr\" type=\"a:CT_NonVisualDrawingProps\" minOccurs=\"1\" maxOccurs=\"1\"/>\n// <xsd:element name=\"cNvGraphicFramePr\" type=\"a:CT_NonVisualGraphicFrameProperties\"\n// MinOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element ref=\"a:graphic\" minOccurs=\"1\" maxOccurs=\"1\"/>\n// </xsd:sequence>\n// <xsd:attribute name=\"distT\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"distB\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"distL\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"distR\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"simplePos\" type=\"xsd:boolean\"/>\n// <xsd:attribute name=\"relativeHeight\" type=\"xsd:unsignedInt\" use=\"required\"/>\n// <xsd:attribute name=\"behindDoc\" type=\"xsd:boolean\" use=\"required\"/>\n// <xsd:attribute name=\"locked\" type=\"xsd:boolean\" use=\"required\"/>\n// <xsd:attribute name=\"layoutInCell\" type=\"xsd:boolean\" use=\"required\"/>\n// <xsd:attribute name=\"hidden\" type=\"xsd:boolean\" use=\"optional\"/>\n// <xsd:attribute name=\"allowOverlap\" type=\"xsd:boolean\" use=\"required\"/>\n// </xsd:complexType>\n/**\n * Represents an anchored/floating drawing in a WordprocessingML document.\n *\n * Anchored drawings can be positioned relative to the page, margin, column,\n * paragraph, character, or line. They support text wrapping options.\n *\n * Reference: http://officeopenxml.com/drwPicFloating.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Anchor\">\n * <xsd:sequence>\n * <xsd:element name=\"simplePos\" type=\"a:CT_Point2D\"/>\n * <xsd:element name=\"positionH\" type=\"CT_PosH\"/>\n * <xsd:element name=\"positionV\" type=\"CT_PosV\"/>\n * <xsd:element name=\"extent\" type=\"a:CT_PositiveSize2D\"/>\n * <xsd:element name=\"effectExtent\" type=\"CT_EffectExtent\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_WrapType\"/>\n * <xsd:element name=\"docPr\" type=\"a:CT_NonVisualDrawingProps\"/>\n * <xsd:element name=\"cNvGraphicFramePr\" type=\"a:CT_NonVisualGraphicFrameProperties\" minOccurs=\"0\"/>\n * <xsd:element ref=\"a:graphic\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"distT\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distB\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distL\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"distR\" type=\"ST_WrapDistance\"/>\n * <xsd:attribute name=\"simplePos\" type=\"xsd:boolean\"/>\n * <xsd:attribute name=\"relativeHeight\" type=\"xsd:unsignedInt\" use=\"required\"/>\n * <xsd:attribute name=\"behindDoc\" type=\"xsd:boolean\" use=\"required\"/>\n * <xsd:attribute name=\"locked\" type=\"xsd:boolean\" use=\"required\"/>\n * <xsd:attribute name=\"layoutInCell\" type=\"xsd:boolean\" use=\"required\"/>\n * <xsd:attribute name=\"hidden\" type=\"xsd:boolean\"/>\n * <xsd:attribute name=\"allowOverlap\" type=\"xsd:boolean\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport class Anchor extends XmlComponent {\n public constructor({\n mediaData,\n transform,\n drawingOptions,\n }: {\n readonly mediaData: IExtendedMediaData;\n readonly transform: MediaDataTransformation;\n readonly drawingOptions: DrawingOptions;\n }) {\n super(\"wp:anchor\");\n\n const floating: Floating = {\n allowOverlap: true,\n behindDocument: false,\n horizontalPosition: {},\n layoutInCell: true,\n lockAnchor: false,\n verticalPosition: {},\n ...drawingOptions.floating,\n };\n\n this.root.push({\n _attr: {\n distT: floating.margins ? floating.margins.top || 0 : 0,\n distB: floating.margins ? floating.margins.bottom || 0 : 0,\n distL: floating.margins ? floating.margins.left || 0 : 0,\n distR: floating.margins ? floating.margins.right || 0 : 0,\n simplePos: \"0\", // Note: word doesn't fully support - so we use 0\n allowOverlap: floating.allowOverlap === true ? \"1\" : \"0\",\n behindDoc: floating.behindDocument === true ? \"1\" : \"0\",\n locked: floating.lockAnchor === true ? \"1\" : \"0\",\n layoutInCell: floating.layoutInCell === true ? \"1\" : \"0\",\n relativeHeight: floating.zIndex ? floating.zIndex : transform.emus.y,\n },\n });\n\n this.root.push(createSimplePos());\n this.root.push(createHorizontalPosition(floating.horizontalPosition));\n this.root.push(createVerticalPosition(floating.verticalPosition));\n this.root.push(buildExtentObj({ x: transform.emus.x, y: transform.emus.y }));\n this.root.push(buildEffectExtentObj({ bottom: 0, left: 0, right: 0, top: 0 }));\n\n if (drawingOptions.floating !== undefined && drawingOptions.floating.wrap !== undefined) {\n switch (drawingOptions.floating.wrap.type) {\n case TextWrappingType.SQUARE: {\n this.root.push(\n createWrapSquare(drawingOptions.floating.wrap, drawingOptions.floating.margins),\n );\n break;\n }\n case TextWrappingType.TIGHT: {\n this.root.push(\n createWrapTight(drawingOptions.floating.wrap, drawingOptions.floating.margins, {\n x: transform.emus.x,\n y: transform.emus.y,\n }),\n );\n break;\n }\n case TextWrappingType.THROUGH: {\n this.root.push(\n createWrapThrough(drawingOptions.floating.wrap, drawingOptions.floating.margins, {\n x: transform.emus.x,\n y: transform.emus.y,\n }),\n );\n break;\n }\n case TextWrappingType.TOP_AND_BOTTOM: {\n this.root.push(createWrapTopAndBottom(drawingOptions.floating.margins));\n break;\n }\n case TextWrappingType.NONE:\n default: {\n this.root.push(createWrapNone());\n }\n }\n } else {\n this.root.push(createWrapNone());\n }\n\n this.root.push(new DocProperties(drawingOptions.docProperties));\n this.root.push(buildGraphicFramePropertiesObj());\n this.root.push(\n new Graphic({\n blipEffects: drawingOptions.blipEffects,\n effects: drawingOptions.effects,\n hyperlink: drawingOptions.docProperties?.hyperlink,\n mediaData,\n outline: drawingOptions.outline,\n fill: drawingOptions.fill,\n tile: drawingOptions.tile,\n transform,\n }),\n );\n }\n}\n","/**\n * Drawing anchor module exports.\n *\n * @module\n */\nexport * from \"./anchor\";\n","// http://officeopenxml.com/drwPicInline.php\nimport type { IExtendedMediaData, MediaDataTransformation } from \"@file/media\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\n\nimport { DocProperties } from \"./../doc-properties/doc-properties\";\nimport type { DocPropertiesOptions } from \"./../doc-properties/doc-properties\";\nimport { buildEffectExtentObj } from \"./../effect-extent/effect-extent\";\nimport { buildExtentObj } from \"./../extent/extent\";\nimport { buildGraphicFramePropertiesObj } from \"./../graphic-frame/graphic-frame-properties\";\nimport { Graphic } from \"./../inline/graphic\";\nimport type { BlipEffectsOptions } from \"./graphic/graphic-data/pic/blip/blip-effects\";\nimport type { TileOptions } from \"./graphic/graphic-data/pic/blip/tile\";\nimport type { EffectListOptions } from \"./graphic/graphic-data/pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"./graphic/graphic-data/pic/shape-properties/outline/outline\";\n\n/**\n * Options for creating an inline drawing element.\n */\ninterface InlineOptions {\n readonly mediaData: IExtendedMediaData;\n readonly transform: MediaDataTransformation;\n readonly docProperties?: DocPropertiesOptions;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly effects?: EffectListOptions;\n readonly blipEffects?: BlipEffectsOptions;\n readonly tile?: TileOptions;\n}\n\n// <xsd:complexType name=\"CT_Inline\">\n// <xsd:sequence>\n// <xsd:element name=\"extent\" type=\"a:CT_PositiveSize2D\"/>\n// <xsd:element name=\"effectExtent\" type=\"CT_EffectExtent\" minOccurs=\"0\"/>\n// <xsd:element name=\"docPr\" type=\"a:CT_NonVisualDrawingProps\" minOccurs=\"1\" maxOccurs=\"1\"/>\n// <xsd:element name=\"cNvGraphicFramePr\" type=\"a:CT_NonVisualGraphicFrameProperties\"\n// MinOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element ref=\"a:graphic\" minOccurs=\"1\" maxOccurs=\"1\"/>\n// </xsd:sequence>\n// <xsd:attribute name=\"distT\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"distB\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"distL\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// <xsd:attribute name=\"distR\" type=\"ST_WrapDistance\" use=\"optional\"/>\n// </xsd:complexType>\nexport const createInline = ({\n mediaData,\n transform,\n docProperties,\n outline,\n fill,\n effects,\n blipEffects,\n tile,\n}: InlineOptions): XmlComponent =>\n new BuilderElement({\n attributes: {\n distanceBottom: {\n key: \"distB\",\n value: 0,\n },\n distanceLeft: {\n key: \"distL\",\n value: 0,\n },\n distanceRight: {\n key: \"distR\",\n value: 0,\n },\n distanceTop: {\n key: \"distT\",\n value: 0,\n },\n },\n children: [\n buildExtentObj({ x: transform.emus.x, y: transform.emus.y }),\n buildEffectExtentObj(\n outline\n ? {\n bottom: (outline.width ?? 9525) * 2,\n left: (outline.width ?? 9525) * 2,\n right: (outline.width ?? 9525) * 2,\n top: (outline.width ?? 9525) * 2,\n }\n : { bottom: 0, left: 0, right: 0, top: 0 },\n ),\n new DocProperties(docProperties),\n buildGraphicFramePropertiesObj(),\n new Graphic({\n blipEffects,\n effects,\n hyperlink: docProperties?.hyperlink,\n mediaData,\n outline,\n fill,\n tile,\n transform,\n }),\n ],\n name: \"wp:inline\",\n });\n","/**\n * Inline drawing module exports.\n *\n * @module\n */\nexport * from \"./inline\";\n","import type { IExtendedMediaData } from \"@file/media\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\n\nimport { Anchor } from \"./anchor\";\nimport type { DocPropertiesOptions } from \"./doc-properties/doc-properties\";\nimport type { Floating } from \"./floating\";\nimport { createInline } from \"./inline\";\nimport type { BlipEffectsOptions } from \"./inline/graphic/graphic-data/pic/blip/blip-effects\";\nimport type { TileOptions } from \"./inline/graphic/graphic-data/pic/blip/tile\";\nimport type { EffectListOptions } from \"./inline/graphic/graphic-data/pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"./inline/graphic/graphic-data/pic/shape-properties/outline/outline\";\n\n/**\n * Distance options for drawing elements.\n *\n * Specifies the margins around a drawing element.\n */\nexport interface Distance {\n readonly distT?: number;\n readonly distB?: number;\n readonly distL?: number;\n readonly distR?: number;\n}\n\n/**\n * Options for configuring a drawing element.\n *\n * @see {@link Drawing}\n */\nexport interface DrawingOptions {\n readonly floating?: Floating;\n readonly docProperties?: DocPropertiesOptions;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly effects?: EffectListOptions;\n readonly blipEffects?: BlipEffectsOptions;\n readonly tile?: TileOptions;\n}\n\n/**\n * Represents a drawing element in a WordprocessingML document.\n *\n * Drawings can be either inline (positioned as part of the text flow) or\n * anchored (positioned relative to the page, column, or paragraph).\n *\n * Reference: http://officeopenxml.com/drwOverview.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Drawing\">\n * <xsd:choice minOccurs=\"1\" maxOccurs=\"unbounded\">\n * <xsd:element ref=\"wp:anchor\" minOccurs=\"0\"/>\n * <xsd:element ref=\"wp:inline\" minOccurs=\"0\"/>\n * </xsd:choice>\n * </xsd:complexType>\n * ```\n */\nexport class Drawing extends XmlComponent {\n public constructor(imageData: IExtendedMediaData, drawingOptions: DrawingOptions = {}) {\n super(\"w:drawing\");\n\n if (!drawingOptions.floating) {\n this.root.push(\n createInline({\n blipEffects: drawingOptions.blipEffects,\n docProperties: drawingOptions.docProperties,\n effects: drawingOptions.effects,\n mediaData: imageData,\n outline: drawingOptions.outline,\n fill: drawingOptions.fill,\n tile: drawingOptions.tile,\n transform: imageData.transformation,\n }),\n );\n } else {\n this.root.push(\n new Anchor({\n drawingOptions,\n mediaData: imageData,\n transform: imageData.transformation,\n }),\n );\n }\n }\n}\n","/**\n * Drawing module exports.\n *\n * @module\n */\nexport * from \"./drawing\";\nexport * from \"./text-wrap\";\nexport * from \"./floating\";\n","import { convertPixelsToEmu } from \"@office-open/core\";\n\n/**\n * Media module for WordprocessingML documents.\n *\n * This module provides support for managing embedded media (images)\n * within a document.\n *\n * @module\n */\nimport type { MediaDataTransformation } from \"./data\";\nimport type { IMediaData } from \"./data\";\n\n/**\n * Transformation options for media display.\n *\n * Specifies how an image should be transformed when displayed in the document.\n */\nexport interface MediaTransformation {\n readonly offset?: {\n readonly top?: number;\n readonly left?: number;\n };\n readonly width: number;\n /** Display height in pixels */\n readonly height: number;\n /** Optional flip transformations */\n readonly flip?: {\n /** Whether to flip the image vertically */\n readonly vertical?: boolean;\n /** Whether to flip the image horizontally */\n readonly horizontal?: boolean;\n };\n /** Optional rotation angle in degrees */\n readonly rotation?: number;\n}\n\n/**\n * Converts user-facing transformation options (pixels) to internal\n * transformation data (pixels + EMUs).\n *\n * @param options - User-facing transformation in pixels\n * @returns Internal transformation data with both pixel and EMU values\n */\nexport const createTransformation = (options: MediaTransformation): MediaDataTransformation => ({\n emus: {\n x: convertPixelsToEmu(options.width),\n y: convertPixelsToEmu(options.height),\n },\n flip: options.flip,\n offset: {\n emus: {\n x: convertPixelsToEmu(options.offset?.left ?? 0),\n y: convertPixelsToEmu(options.offset?.top ?? 0),\n },\n pixels: {\n x: Math.round(options.offset?.left ?? 0),\n y: Math.round(options.offset?.top ?? 0),\n },\n },\n pixels: {\n x: Math.round(options.width),\n y: Math.round(options.height),\n },\n rotation: options.rotation ? options.rotation * 60_000 : undefined,\n});\n\n/**\n * Manages embedded media (images) in a document.\n *\n * Media stores all images referenced in the document and provides\n * access to their data for packaging into the DOCX file. Each image\n * is stored with a unique key for retrieval.\n *\n * @example\n * ```typescript\n * const media = new Media();\n * media.addImage(\"image1\", {\n * type: \"png\",\n * fileName: \"image1.png\",\n * transformation: {\n * pixels: { x: 200, y: 100 },\n * emus: { x: 1828800, y: 914400 }\n * },\n * data: imageBuffer\n * });\n * const allImages = media.Array;\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 /**\n * Adds an image to the media collection.\n *\n * @param key - Unique identifier for this image\n * @param mediaData - Complete image data including file name, transformation, and raw data\n */\n public addImage(key: string, mediaData: IMediaData): void {\n this.map.set(key, mediaData);\n }\n\n /**\n * Gets all images as an array.\n *\n * @returns Read-only array of all media data in the collection\n */\n public get array(): readonly IMediaData[] {\n return [...this.map.values()];\n }\n}\n","import type { SourceRectangleOptions } from \"@file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle\";\nimport type { EffectListOptions } from \"@file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"@file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline\";\nimport type {\n ChildExtent,\n ChildOffset,\n} from \"@file/drawing/inline/graphic/graphic-data/wpg/wpg-group\";\nimport type { WpsShapeCoreOptions } from \"@file/drawing/inline/graphic/graphic-data/wps\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\n\nexport interface MediaDataTransformation {\n readonly offset?: {\n readonly pixels: {\n readonly x: number;\n readonly y: number;\n };\n readonly emus?: {\n readonly x: number;\n readonly y: number;\n };\n };\n readonly pixels: {\n /** Width in pixels */\n readonly x: number;\n /** Height in pixels */\n readonly y: number;\n };\n /** Display dimensions in EMUs (English Metric Units) */\n readonly emus: {\n /** Width in EMUs (1 inch = 914400 EMUs) */\n readonly x: number;\n /** Height in EMUs (1 inch = 914400 EMUs) */\n readonly y: number;\n };\n /** Optional flip transformations */\n readonly flip?: {\n /** Whether to flip the image vertically */\n readonly vertical?: boolean;\n /** Whether to flip the image horizontally */\n readonly horizontal?: boolean;\n };\n /** Optional rotation angle in degrees */\n readonly rotation?: number;\n}\n\n/**\n * Core properties shared by all media data types.\n */\ninterface CoreMediaData {\n /** File name for the media in the package */\n readonly fileName: string;\n /** Transformation settings for display */\n readonly transformation: MediaDataTransformation;\n /** Raw image data */\n readonly data: Uint8Array;\n /** Source rectangle for image cropping */\n readonly srcRect?: SourceRectangleOptions;\n}\n\n/**\n * Regular raster image formats.\n */\ninterface RegularMediaData {\n /** Image format type */\n readonly type: \"jpg\" | \"png\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\";\n}\n\n/**\n * SVG image format with fallback support.\n */\ninterface SvgMediaData {\n /** SVG image type */\n readonly type: \"svg\";\n /**\n * Fallback image for Word processors that do not support SVG.\n * This ensures the document displays correctly in all viewers.\n */\n readonly fallback: RegularMediaData & CoreMediaData;\n}\n\nexport interface WpsMediaData {\n readonly type: \"wps\";\n readonly transformation: MediaDataTransformation;\n readonly data: WpsShapeCoreOptions;\n}\n\nexport interface WpgCommonMediaData {\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n}\n\nexport type IGroupChildMediaData = (WpsMediaData | IMediaData) & WpgCommonMediaData;\n\nexport interface WpgMediaData {\n readonly type: \"wpg\";\n readonly transformation: MediaDataTransformation;\n readonly children: readonly IGroupChildMediaData[];\n /** Child coordinate offset */\n readonly chOff?: ChildOffset;\n /** Child coordinate extent */\n readonly chExt?: ChildExtent;\n /** Group fill */\n readonly fill?: FillOptions;\n /** Group effects */\n readonly effects?: EffectListOptions;\n}\n\n/**\n * Chart media data — references a chart part via placeholder.\n */\nexport interface ChartMediaData {\n readonly type: \"chart\";\n readonly transformation: MediaDataTransformation;\n readonly chartKey: string;\n}\n\n/**\n * SmartArt media data — references a diagram data part via placeholder.\n */\nexport interface SmartArtMediaData {\n readonly type: \"smartart\";\n readonly transformation: MediaDataTransformation;\n readonly smartArtKey: string;\n}\n\nexport type IExtendedMediaData =\n | IMediaData\n | WpsMediaData\n | WpgMediaData\n | ChartMediaData\n | SmartArtMediaData;\n\nexport type IMediaData = (RegularMediaData | SvgMediaData) & CoreMediaData;\n\n// Needed because of: https://github.com/s-panferov/awesome-typescript-loader/issues/432\n/**\n * @ignore\n */\nexport const WORKAROUND2 = \"\";\n","/**\n * Media module exports.\n *\n * @module\n */\nexport * from \"./media\";\nexport * from \"./data\";\n","/**\n * ImageRun module for WordprocessingML documents.\n *\n * This module provides support for inserting images into documents.\n *\n * Reference: http://officeopenxml.com/drwPicInline.php\n *\n * @module\n */\nimport type { DocPropertiesOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport type { FillOptions } from \"@office-open/core/drawingml\";\nimport { hashedId } from \"@util/convenience-functions\";\nimport type { DataType } from \"undio\";\nimport { toUint8Array } from \"undio\";\n\nimport { Drawing } from \"../../drawing\";\nimport type { Floating } from \"../../drawing\";\nimport type { BlipEffectsOptions } from \"../../drawing/inline/graphic/graphic-data/pic/blip/blip-effects\";\nimport type { SourceRectangleOptions } from \"../../drawing/inline/graphic/graphic-data/pic/blip/source-rectangle\";\nimport type { TileOptions } from \"../../drawing/inline/graphic/graphic-data/pic/blip/tile\";\nimport type { EffectListOptions } from \"../../drawing/inline/graphic/graphic-data/pic/shape-properties/effects/effect-list\";\nimport type { OutlineOptions } from \"../../drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline\";\nimport type { MediaTransformation } from \"../../media\";\nimport { createTransformation } from \"../../media\";\nimport type { IMediaData } from \"../../media/data\";\nimport { Run } from \"../run\";\n\n/**\n * Core options for image configuration.\n */\ninterface CoreImageOptions {\n readonly transformation: MediaTransformation;\n readonly floating?: Floating;\n readonly altText?: DocPropertiesOptions;\n readonly outline?: OutlineOptions;\n readonly fill?: FillOptions;\n readonly effects?: EffectListOptions;\n readonly blipEffects?: BlipEffectsOptions;\n readonly srcRect?: SourceRectangleOptions;\n readonly tile?: TileOptions;\n}\n\ninterface RegularImageOptions {\n readonly type: \"jpg\" | \"png\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\";\n readonly data: DataType;\n}\n\ninterface SvgMediaOptions {\n readonly type: \"svg\";\n readonly data: DataType;\n /**\n * Required in case the Word processor does not support SVG.\n */\n readonly fallback: RegularImageOptions;\n}\n\n/**\n * Options for creating an ImageRun.\n *\n * @see {@link ImageRun}\n */\nexport type IImageOptions = (RegularImageOptions | SvgMediaOptions) & CoreImageOptions;\n\nconst createImageData = (\n data: Uint8Array,\n transformation: MediaTransformation,\n key: string,\n srcRect?: SourceRectangleOptions,\n): Pick<IMediaData, \"data\" | \"fileName\" | \"transformation\" | \"srcRect\"> => ({\n data,\n fileName: key,\n srcRect,\n transformation: createTransformation(transformation),\n});\n\n/**\n * Represents an image in a WordprocessingML document.\n *\n * ImageRun embeds an image within a run, supporting various formats\n * including JPG, PNG, GIF, BMP, and SVG.\n *\n * Reference: http://officeopenxml.com/drwPicInline.php\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new ImageRun({\n * data: fs.readFileSync(\"./image.png\"),\n * transformation: {\n * width: 100,\n * height: 100,\n * },\n * type: \"png\",\n * });\n * ```\n */\nexport class ImageRun extends Run {\n private readonly imageData: IMediaData;\n\n public constructor(options: IImageOptions) {\n super({});\n\n const rawData = toUint8Array(options.data) as Uint8Array;\n const hash = hashedId(rawData);\n const key = `${hash}.${options.type}`;\n\n if (options.type === \"svg\") {\n const fallbackData = toUint8Array(options.fallback.data) as Uint8Array;\n this.imageData = {\n type: options.type,\n ...createImageData(rawData, options.transformation, key, options.srcRect),\n fallback: {\n type: options.fallback.type,\n ...createImageData(\n fallbackData,\n options.transformation,\n `${hashedId(fallbackData)}.${options.fallback.type}`,\n ),\n },\n };\n } else {\n this.imageData = {\n type: options.type,\n ...createImageData(rawData, options.transformation, key, options.srcRect),\n };\n }\n const drawing = new Drawing(this.imageData, {\n blipEffects: options.blipEffects,\n docProperties: options.altText,\n floating: options.floating,\n outline: options.outline,\n fill: options.fill,\n effects: options.effects,\n tile: options.tile,\n });\n\n this.extraChildren.push(drawing);\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n context.file.media.addImage(this.imageData.fileName, this.imageData);\n\n if (this.imageData.type === \"svg\") {\n context.file.media.addImage(this.imageData.fallback.fileName, this.imageData.fallback);\n }\n\n return super.prepForXml(context);\n }\n}\n","export { ChartSpace } from \"@office-open/core/chart\";\nexport type { ChartSpaceOptions } from \"@office-open/core/chart\";\nexport type { ChartSeriesData } from \"@office-open/core/chart\";\n","/**\n * ChartRun module for embedding charts in WordprocessingML documents.\n *\n * Charts are stored as independent XML parts (word/charts/chart{n}.xml)\n * and referenced from document.xml via drawing relationships.\n *\n * @module\n */\nimport { ChartSpace } from \"@file/chart/chart-space\";\nimport { Drawing } from \"@file/drawing\";\nimport type { Floating } from \"@file/drawing\";\nimport type { DocPropertiesOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { MediaTransformation } from \"@file/media\";\nimport { createTransformation } from \"@file/media\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport { Run } from \"../run\";\n\n/**\n * Options for creating a ChartRun.\n *\n * @publicApi\n */\nexport interface ChartOptions {\n /** Chart type */\n readonly type: \"column\" | \"bar\" | \"line\" | \"pie\" | \"area\" | \"scatter\";\n /** Chart data */\n readonly data: {\n readonly categories: readonly string[];\n readonly series: readonly { name: string; values: readonly number[] }[];\n };\n /** Display dimensions */\n readonly transformation: MediaTransformation;\n /** Floating positioning */\n readonly floating?: Floating;\n /** Alternative text for accessibility */\n readonly altText?: DocPropertiesOptions;\n /** Chart title */\n readonly title?: string;\n /** Show legend (default: true) */\n readonly showLegend?: boolean;\n /** Chart style preset (2-48) */\n readonly style?: number;\n}\n\n/**\n * Represents an embedded chart in a WordprocessingML document.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new ChartRun({\n * type: \"column\",\n * data: {\n * categories: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n * series: [\n * { name: \"Sales\", values: [100, 200, 300, 400] },\n * ],\n * },\n * transformation: { width: 500, height: 300 },\n * title: \"Quarterly Sales\",\n * });\n * ```\n */\nexport class ChartRun extends Run {\n private readonly chartOptions: ChartOptions;\n private readonly chartKey: string;\n\n public constructor(options: ChartOptions) {\n super({});\n this.chartOptions = options;\n\n // Generate a unique key based on chart data\n const hash = this.hashChartData(options);\n this.chartKey = `chart_${hash}`;\n\n // Create media data for the drawing system\n const mediaData = {\n chartKey: this.chartKey,\n transformation: createTransformation(options.transformation),\n type: \"chart\" as const,\n };\n\n const drawing = new Drawing(mediaData, {\n docProperties: options.altText,\n floating: options.floating,\n });\n\n this.extraChildren.push(drawing);\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n // Register chart with the file's chart collection\n const chartSpace = new ChartSpace({\n categories: this.chartOptions.data.categories,\n series: this.chartOptions.data.series,\n showLegend: this.chartOptions.showLegend,\n style: this.chartOptions.style,\n title: this.chartOptions.title,\n type: this.chartOptions.type,\n });\n\n context.file.charts.addChart(this.chartKey, {\n chartSpace,\n key: this.chartKey,\n });\n\n return super.prepForXml(context);\n }\n\n private hashChartData(options: ChartOptions): number {\n const data = `${options.type}:${JSON.stringify(options.data)}`;\n let hash = 0;\n for (let i = 0; i < data.length; i++) {\n const char = data.charCodeAt(i);\n hash = ((hash << 5) - hash + char) | 0;\n }\n return Math.abs(hash);\n }\n}\n","export type { TreeNode } from \"@office-open/core/smartart\";\nexport { createDataModel } from \"@office-open/core/smartart\";\n","/**\n * SmartArtRun module for embedding SmartArt diagrams in WordprocessingML documents.\n *\n * SmartArt data is stored in `word/diagrams/data{n}.xml`.\n * Layout, style, and colors reference Word's built-in definitions.\n *\n * @module\n */\nimport { Drawing } from \"@file/drawing\";\nimport type { Floating } from \"@file/drawing\";\nimport type { DocPropertiesOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { MediaTransformation } from \"@file/media\";\nimport { createTransformation } from \"@file/media\";\nimport type { SmartArtData } from \"@file/smartart/smartart-collection\";\nimport { createDataModel } from \"@file/smartart/tree-to-model\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport { Run } from \"../run\";\n\n/**\n * A tree node for SmartArt data.\n */\nexport interface SmartArtNode {\n readonly text: string;\n readonly children?: readonly SmartArtNode[];\n}\n\n/**\n * Options for creating a SmartArtRun.\n *\n * @publicApi\n */\nexport interface SmartArtOptions {\n /** Tree-shaped data for the diagram */\n readonly data: {\n readonly nodes: readonly SmartArtNode[];\n };\n /** Display dimensions */\n readonly transformation: MediaTransformation;\n /** Floating positioning */\n readonly floating?: Floating;\n /** Alternative text for accessibility */\n readonly altText?: DocPropertiesOptions;\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 * Represents an embedded SmartArt diagram in a WordprocessingML document.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new SmartArtRun({\n * data: {\n * nodes: [\n * { text: \"Main\", children: [\n * { text: \"Sub 1\" },\n * { text: \"Sub 2\" },\n * ]},\n * ],\n * },\n * transformation: { width: 500, height: 300 },\n * });\n * ```\n */\nexport class SmartArtRun extends Run {\n private readonly smartArtOptions: SmartArtOptions;\n private readonly smartArtKey: string;\n\n public constructor(options: SmartArtOptions) {\n super({});\n this.smartArtOptions = options;\n\n // Generate a unique key\n const hash = this.hashSmartArtData(options);\n this.smartArtKey = `smartart_${hash}`;\n\n // Create media data for the drawing system\n const mediaData = {\n smartArtKey: this.smartArtKey,\n transformation: createTransformation(options.transformation),\n type: \"smartart\" as const,\n };\n\n const drawing = new Drawing(mediaData, {\n docProperties: options.altText,\n floating: options.floating,\n });\n\n this.extraChildren.push(drawing);\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n const layoutId = this.smartArtOptions.layout ?? \"default\";\n const styleId = this.smartArtOptions.style ?? \"simple1\";\n const colorId = this.smartArtOptions.color ?? \"accent1_2\";\n\n const dataModel = createDataModel(this.smartArtOptions.data.nodes, layoutId, styleId, colorId);\n\n const smartArtData: SmartArtData = {\n dataModel,\n key: this.smartArtKey,\n layout: layoutId,\n style: styleId,\n color: colorId,\n };\n\n context.file.smartArts.addSmartArt(this.smartArtKey, smartArtData);\n\n return super.prepForXml(context);\n }\n\n private hashSmartArtData(options: SmartArtOptions): number {\n const data = JSON.stringify(options.data);\n let hash = 0;\n for (let i = 0; i < data.length; i++) {\n const char = data.charCodeAt(i);\n hash = ((hash << 5) - hash + char) | 0;\n }\n return Math.abs(hash);\n }\n}\n","import type { DocPropertiesOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { WpsShapeCoreOptions } from \"@file/drawing/inline/graphic/graphic-data/wps\";\n\nimport { Drawing } from \"../../drawing\";\nimport type { Floating } from \"../../drawing\";\nimport type { MediaTransformation, WpsMediaData } from \"../../media\";\nimport { createTransformation } from \"../../media\";\nimport { Run } from \"../run\";\n\nexport * from \"@file/drawing/inline/graphic/graphic-data/wps/body-properties\";\n\ninterface CoreShapeOptions {\n readonly transformation: MediaTransformation;\n readonly floating?: Floating;\n readonly altText?: DocPropertiesOptions;\n}\n\n/**\n * @publicApi\n */\nexport type IWpsShapeOptions = WpsShapeCoreOptions & { readonly type: \"wps\" } & CoreShapeOptions;\n\n/**\n * @publicApi\n */\nexport class WpsShapeRun extends Run {\n private readonly wpsShapeData: WpsMediaData;\n\n public constructor(options: IWpsShapeOptions) {\n super({});\n\n this.wpsShapeData = {\n data: { ...options },\n transformation: createTransformation(options.transformation),\n type: options.type,\n };\n const drawing = new Drawing(this.wpsShapeData, {\n docProperties: options.altText,\n floating: options.floating,\n outline: options.outline,\n fill: options.fill,\n });\n\n this.extraChildren.push(drawing);\n }\n}\n","import type { DocPropertiesOptions } from \"@file/drawing/doc-properties/doc-properties\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport { Run } from \".\";\nimport { Drawing } from \"../../drawing\";\nimport type { Floating } from \"../../drawing\";\nimport type {\n IGroupChildMediaData,\n IMediaData,\n MediaTransformation,\n WpgMediaData,\n} from \"../../media\";\nimport { createTransformation } from \"../../media\";\n\nexport * from \"@file/drawing/inline/graphic/graphic-data/wps/body-properties\";\n\ninterface CoreGroupOptions {\n readonly children: readonly IGroupChildMediaData[];\n readonly transformation: MediaTransformation;\n readonly floating?: Floating;\n readonly altText?: DocPropertiesOptions;\n}\n\n/**\n * @publicApi\n */\nexport type IWpgGroupOptions = { readonly type: \"wpg\" } & CoreGroupOptions;\n\n/**\n * @publicApi\n */\nexport class WpgGroupRun extends Run {\n private readonly wpgGroupData: WpgMediaData;\n private readonly mediaDatas: readonly IMediaData[];\n\n public constructor(options: IWpgGroupOptions) {\n super({});\n\n this.wpgGroupData = {\n children: options.children,\n transformation: createTransformation(options.transformation),\n type: options.type,\n };\n const drawing = new Drawing(this.wpgGroupData, {\n docProperties: options.altText,\n floating: options.floating,\n });\n\n this.mediaDatas = options.children\n .filter((child) => child.type !== \"wps\")\n .map((child) => child as IMediaData);\n\n this.extraChildren.push(drawing);\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n this.mediaDatas.forEach((child) => {\n context.file.media.addImage(child.fileName, child);\n\n if (child.type === \"svg\") {\n context.file.media.addImage(child.fallback.fileName, child.fallback);\n }\n });\n return super.prepForXml(context);\n }\n}\n","/**\n * Sequential identifier instruction module for WordprocessingML documents.\n *\n * This module provides the SEQ field instruction for creating\n * auto-numbered sequences like figure numbers, table numbers, etc.\n *\n * Reference: http://officeopenxml.com/WPfieldInstructions.php\n *\n * @module\n */\nimport { SpaceType } from \"@file/shared\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a SEQ field instruction.\n *\n * The SEQ field inserts an automatically incrementing sequence number,\n * useful for numbering figures, tables, equations, or custom sequences.\n *\n * @example\n * ```typescript\n * // Create a figure number sequence\n * new SequentialIdentifierInstruction(\"Figure\");\n *\n * // Create a table number sequence\n * new SequentialIdentifierInstruction(\"Table\");\n * ```\n *\n * @internal\n */\nexport class SequentialIdentifierInstruction extends XmlComponent {\n public constructor(identifier: string) {\n super(\"w:instrText\");\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n this.root.push(`SEQ ${identifier}`);\n }\n}\n","/**\n * Sequential identifier module for WordprocessingML documents.\n *\n * This module provides support for SEQ (sequence) fields, which are used to\n * automatically number items in a document such as figures, tables, and equations.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { Run } from \"@file/paragraph/run\";\nimport { createBegin, createEnd, createSeparate } from \"@file/paragraph/run/field\";\n\nimport { SequentialIdentifierInstruction } from \"./sequential-identifier-instruction\";\n\n/**\n * Represents a sequential identifier field in a WordprocessingML document.\n *\n * SequentialIdentifier creates a SEQ field that automatically numbers items in a document.\n * Each identifier maintains its own sequence, allowing you to have separate numbering\n * for figures, tables, equations, etc.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_R\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_RunInnerContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a figure number\n * new SequentialIdentifier(\"Figure\");\n *\n * // Create a table number\n * new SequentialIdentifier(\"Table\");\n *\n * // Create an equation number\n * new SequentialIdentifier(\"Equation\");\n * ```\n */\nexport class SequentialIdentifier extends Run {\n public constructor(identifier: string) {\n super({});\n this.extraChildren.push(createBegin(true));\n this.extraChildren.push(new SequentialIdentifierInstruction(identifier));\n this.extraChildren.push(createSeparate());\n this.extraChildren.push(createEnd());\n }\n}\n","/**\n * Simple field module for WordprocessingML documents.\n *\n * This module provides support for simple fields, which are self-contained field\n * elements that include both the field code and optional cached result in a single element.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_fldSimple-1.html\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { TextRun } from \"./text-run\";\n\n/**\n * Represents a simple field in a WordprocessingML document.\n *\n * A simple field (fldSimple) contains both the field code and the optional cached value\n * in a single element, unlike complex fields which use separate begin/end markers.\n * Simple fields are typically used for fields that don't require complex nesting.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_fldSimple-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SimpleField\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"instr\" type=\"s:ST_String\" use=\"required\"/>\n * <xsd:attribute name=\"fldLock\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"dirty\" type=\"s:ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple field with instruction\n * new SimpleField(\"DATE\");\n *\n * // Simple field with cached value\n * new SimpleField(\"DATE\", \"2024-01-01\");\n * ```\n */\nexport class SimpleField extends XmlComponent {\n public constructor(instruction: string, cachedValue?: string) {\n super(\"w:fldSimple\");\n this.root.push({ _attr: { \"w:instr\": instruction } });\n if (cachedValue !== undefined) {\n this.root.push(new TextRun(cachedValue));\n }\n }\n}\n\n/**\n * Represents a mail merge field in a WordprocessingML document.\n *\n * SimpleMailMergeField is a specialized simple field for mail merge operations.\n * It creates a MERGEFIELD that will be populated with data during mail merge.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @example\n * ```typescript\n * // Creates a merge field for \"FirstName\"\n * new SimpleMailMergeField(\"FirstName\");\n * // Renders as: MERGEFIELD FirstName with placeholder «FirstName»\n * ```\n */\nexport class SimpleMailMergeField extends SimpleField {\n public constructor(fieldName: string) {\n super(` MERGEFIELD ${fieldName} `, `«${fieldName}»`);\n }\n}\n","export { Relationships } from \"@office-open/core\";\n","/**\n * Relationships module exports.\n *\n * @module\n */\nexport * from \"./relationships\";\n","/**\n * Font module for WordprocessingML documents.\n *\n * Provides support for font definitions and embedded fonts.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_font-1.html\n *\n * @module\n */\nimport { BuilderElement, createStringElement, onOffObj } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for a font relationship (embedded font).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_embedRegular-1.html\n *\n * @property id - Relationship to Part\n * @property fontKey - Embedded Font Obfuscation Key (GUID)\n * @property subsetted - Whether the embedded font is subsetted\n */\nexport interface FontRelationshipOptions {\n /** Relationship to Part */\n readonly id: string;\n /** Embedded Font Obfuscation Key (GUID) */\n readonly fontKey?: string;\n /** Whether the embedded font is subsetted */\n readonly subsetted?: boolean;\n}\n\n/**\n * Character set constants for font definitions.\n * Maps character set names to their hexadecimal identifiers.\n *\n * @publicApi\n */\nexport const CharacterSet = {\n ANSI: \"00\",\n ARABIC: \"B2\",\n BALTIC: \"BA\",\n CHINESEBIG5: \"88\",\n DEFAULT: \"01\",\n EASTEUROPE: \"EE\",\n GB_2312: \"86\",\n GREEK: \"A1\",\n HANGUL: \"81\",\n HEBREW: \"B1\",\n JIS: \"80\",\n JOHAB: \"82\",\n MAC: \"4D\",\n OEM: \"FF\",\n RUSSIAN: \"CC\",\n SYMBOL: \"02\",\n THAI: \"DE\",\n TURKISH: \"A2\",\n VIETNAMESE: \"A3\",\n} as const;\n\n/**\n * Options for defining a font in the document.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_font-1.html\n *\n * @property name - Font name (required)\n * @property altName - Alternative font name\n * @property panose1 - PANOSE-1 classification\n * @property charset - Character set identifier\n * @property family - Font family\n * @property notTrueType - Whether this is not a TrueType font\n * @property pitch - Font pitch\n * @property sig - Font signature (Unicode and code page ranges)\n * @property embedRegular - Embedded regular font relationship\n * @property embedBold - Embedded bold font relationship\n * @property embedItalic - Embedded italic font relationship\n * @property embedBoldItalic - Embedded bold-italic font relationship\n */\nexport interface FontEntry {\n /** Font name (required) */\n readonly name: string;\n /** Alternative font name */\n readonly altName?: string;\n /** PANOSE-1 classification */\n readonly panose1?: string;\n /** Character set identifier */\n readonly charset?: (typeof CharacterSet)[keyof typeof CharacterSet];\n /** Font family */\n readonly family?: string;\n /** Whether this is not a TrueType font */\n readonly notTrueType?: boolean;\n /** Font pitch */\n readonly pitch?: string;\n /** Font signature (Unicode and code page ranges) */\n readonly sig?: {\n /** Unicode Subset Bitfield 0 */\n readonly usb0: string;\n /** Unicode Subset Bitfield 1 */\n readonly usb1: string;\n /** Unicode Subset Bitfield 2 */\n readonly usb2: string;\n /** Unicode Subset Bitfield 3 */\n readonly usb3: string;\n /** Code Page Bitfield 0 */\n readonly csb0: string;\n /** Code Page Bitfield 1 */\n readonly csb1: string;\n };\n /** Embedded regular font relationship */\n readonly embedRegular?: FontRelationshipOptions;\n /** Embedded bold font relationship */\n readonly embedBold?: FontRelationshipOptions;\n /** Embedded italic font relationship */\n readonly embedItalic?: FontRelationshipOptions;\n /** Embedded bold-italic font relationship */\n readonly embedBoldItalic?: FontRelationshipOptions;\n}\n\n/**\n * Creates a font relationship element for embedding fonts.\n */\nconst createFontRelationship = (\n { id, fontKey, subsetted }: FontRelationshipOptions,\n name: string,\n): XmlComponent =>\n new BuilderElement({\n attributes: {\n id: { key: \"r:id\", value: id },\n ...(fontKey ? { fontKey: { key: \"w:fontKey\", value: `{${fontKey}}` } } : {}),\n },\n children: subsetted ? [onOffObj(\"w:subsetted\", subsetted)] : [],\n name,\n });\n\n/**\n * Creates a font element with the specified options.\n *\n * This function builds a complete font definition including optional embedded font files,\n * font signature, character set, and other font properties.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_font-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Font\">\n * <xsd:sequence>\n * <xsd:element name=\"altName\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"panose1\" type=\"CT_Panose\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"charset\" type=\"CT_Charset\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"family\" type=\"CT_FontFamily\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"notTrueType\" type=\"CT_OnOff\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"pitch\" type=\"CT_Pitch\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"sig\" type=\"CT_FontSig\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"embedRegular\" type=\"CT_FontRel\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"embedBold\" type=\"CT_FontRel\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"embedItalic\" type=\"CT_FontRel\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"embedBoldItalic\" type=\"CT_FontRel\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"name\" type=\"s:ST_String\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const font = createFont({\n * name: \"Arial\",\n * family: \"swiss\",\n * pitch: \"variable\",\n * charset: CharacterSet.ANSI\n * });\n * ```\n */\nexport const createFont = ({\n name,\n altName,\n panose1,\n charset,\n family,\n notTrueType,\n pitch,\n sig,\n embedRegular,\n embedBold,\n embedItalic,\n embedBoldItalic,\n}: FontEntry): XmlComponent =>\n new BuilderElement({\n attributes: {\n name: { key: \"w:name\", value: name },\n },\n children: [\n // http://www.datypic.com/sc/ooxml/e-w_altName-1.html\n ...(altName ? [createStringElement(\"w:altName\", altName)] : []),\n // http://www.datypic.com/sc/ooxml/e-w_panose1-1.html\n ...(panose1 ? [createStringElement(\"w:panose1\", panose1)] : []),\n // http://www.datypic.com/sc/ooxml/e-w_charset-1.html\n ...(charset ? [createStringElement(\"w:charset\", charset)] : []),\n // http://www.datypic.com/sc/ooxml/e-w_family-1.html\n ...(family ? [createStringElement(\"w:family\", family)] : []),\n // http://www.datypic.com/sc/ooxml/e-w_notTrueType-1.html\n ...(notTrueType ? [onOffObj(\"w:notTrueType\", notTrueType)] : []),\n ...(pitch ? [createStringElement(\"w:pitch\", pitch)] : []),\n // http://www.datypic.com/sc/ooxml/e-w_sig-1.html\n ...(sig\n ? [\n new BuilderElement({\n attributes: {\n csb0: { key: \"w:csb0\", value: sig.csb0 },\n csb1: { key: \"w:csb1\", value: sig.csb1 },\n usb0: { key: \"w:usb0\", value: sig.usb0 },\n usb1: { key: \"w:usb1\", value: sig.usb1 },\n usb2: { key: \"w:usb2\", value: sig.usb2 },\n usb3: { key: \"w:usb3\", value: sig.usb3 },\n },\n name: \"w:sig\",\n }),\n ]\n : []),\n // http://www.datypic.com/sc/ooxml/e-w_embedRegular-1.html\n ...(embedRegular ? [createFontRelationship(embedRegular, \"w:embedRegular\")] : []),\n // http://www.datypic.com/sc/ooxml/e-w_embedBold-1.html\n ...(embedBold ? [createFontRelationship(embedBold, \"w:embedBold\")] : []),\n // http://www.datypic.com/sc/ooxml/e-w_embedItalic-1.html\n ...(embedItalic ? [createFontRelationship(embedItalic, \"w:embedItalic\")] : []),\n // http://www.datypic.com/sc/ooxml/e-w_embedBoldItalic-1.html\n ...(embedBoldItalic ? [createFontRelationship(embedBoldItalic, \"w:embedBoldItalic\")] : []),\n ],\n name: \"w:font\",\n });\n","/**\n * Create Regular Font module for WordprocessingML documents.\n *\n * Provides a helper to create regular (non-bold, non-italic) embedded fonts\n * with default font signature settings.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_font-1.html\n *\n * @module\n */\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { createFont } from \"./font\";\nimport type { CharacterSet } from \"./font\";\n\n/**\n * Creates a regular embedded font with default settings.\n *\n * This helper function creates a font definition with standard font signature\n * values that work for most common fonts. The signature specifies Unicode\n * and code page ranges supported by the font.\n *\n * @param options - Font creation options\n * @param options.name - Font name\n * @param options.index - Font relationship index\n * @param options.fontKey - Unique font key (GUID) for obfuscation\n * @param options.characterSet - Optional character set identifier\n *\n * @returns XmlComponent representing the font definition\n *\n * @example\n * ```typescript\n * const font = createRegularFont({\n * name: \"Arial\",\n * index: 1,\n * fontKey: \"12345678-1234-1234-1234-123456789012\"\n * });\n * ```\n */\nexport const createRegularFont = ({\n name,\n index,\n fontKey,\n characterSet,\n}: {\n readonly name: string;\n readonly index: number;\n readonly fontKey: string;\n readonly characterSet?: (typeof CharacterSet)[keyof typeof CharacterSet];\n}): XmlComponent =>\n createFont({\n charset: characterSet,\n embedRegular: {\n fontKey,\n id: `rId${index}`,\n },\n family: \"auto\",\n name,\n pitch: \"variable\",\n sig: {\n csb0: \"000001FF\",\n csb1: \"00000000\",\n usb0: \"E0002AFF\",\n usb1: \"C000247B\",\n usb2: \"00000009\",\n usb3: \"00000000\",\n },\n });\n","/**\n * Font Table module for WordprocessingML documents.\n *\n * This module provides support for embedding fonts in the document.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_fonts.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { createRegularFont } from \"./create-regular-font\";\nimport type { CharacterSet } from \"./font\";\nimport type { EmbeddedFontOptionsWithKey } from \"./font-wrapper\";\n\n// <xsd:complexType name=\"CT_FontsList\">\n// <xsd:sequence>\n// <xsd:element name=\"font\" type=\"CT_Font\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n// </xsd:sequence>\n// </xsd:complexType>\n\n/**\n * Options for embedding a font in the document.\n */\nexport interface EmbeddedFontOptions {\n /** Font family name */\n readonly name: string;\n /** Font file data (TTF, OTF, etc.) */\n readonly data: Buffer;\n /** Character set/encoding for the font */\n readonly characterSet?: (typeof CharacterSet)[keyof typeof CharacterSet];\n}\n\n/**\n * Creates a font table element containing embedded fonts.\n *\n * The font table allows custom fonts to be embedded in the document\n * so they display correctly even if not installed on the viewer's system.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_fonts.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FontsList\">\n * <xsd:sequence>\n * <xsd:element name=\"font\" type=\"CT_Font\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createFontTable = (fonts: readonly EmbeddedFontOptionsWithKey[]): XmlComponent =>\n // https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Font_topic_ID0ERNCU.html\n // http://www.datypic.com/sc/ooxml/e-w_fonts.html\n new BuilderElement({\n attributes: {\n Ignorable: { key: \"mc:Ignorable\", value: \"w14 w15 w16se w16cid w16 w16cex w16sdtdh\" },\n mc: {\n key: \"xmlns:mc\",\n value: \"http://schemas.openxmlformats.org/markup-compatibility/2006\",\n },\n r: {\n key: \"xmlns:r\",\n value: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n },\n w: {\n key: \"xmlns:w\",\n value: \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\",\n },\n w14: {\n key: \"xmlns:w14\",\n value: \"http://schemas.microsoft.com/office/word/2010/wordml\",\n },\n w15: {\n key: \"xmlns:w15\",\n value: \"http://schemas.microsoft.com/office/word/2012/wordml\",\n },\n w16: {\n key: \"xmlns:w16\",\n value: \"http://schemas.microsoft.com/office/word/2018/wordml\",\n },\n w16cex: {\n key: \"xmlns:w16cex\",\n value: \"http://schemas.microsoft.com/office/word/2018/wordml/cex\",\n },\n w16cid: {\n key: \"xmlns:w16cid\",\n value: \"http://schemas.microsoft.com/office/word/2016/wordml/cid\",\n },\n w16sdtdh: {\n key: \"xmlns:w16sdtdh\",\n value: \"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash\",\n },\n w16se: {\n key: \"xmlns:w16se\",\n value: \"http://schemas.microsoft.com/office/word/2015/wordml/symex\",\n },\n },\n children: fonts.map((font, i) =>\n createRegularFont({\n characterSet: font.characterSet,\n fontKey: font.fontKey,\n index: i + 1,\n name: font.name,\n }),\n ),\n name: \"w:fonts\",\n });\n","/**\n * Font Wrapper module for WordprocessingML documents.\n *\n * Manages font table and relationships for embedded fonts.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_fonts.html\n *\n * @module\n */\nimport type { ViewWrapper } from \"@file/document-wrapper\";\nimport { Relationships } from \"@file/relationships\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { uniqueUuid } from \"@util/convenience-functions\";\n\nimport { createFontTable } from \"./font-table\";\nimport type { EmbeddedFontOptions } from \"./font-table\";\n\n/**\n * Font options extended with a unique font key.\n */\nexport type EmbeddedFontOptionsWithKey = EmbeddedFontOptions & { readonly fontKey: string };\n\n/**\n * Wrapper class for managing the font table and its relationships.\n *\n * Creates a font table with embedded font files and manages the relationships\n * required for font embedding. Each font is assigned a unique key for obfuscation.\n *\n * @example\n * ```typescript\n * const fontWrapper = new FontWrapper([\n * { name: \"CustomFont\", data: fontBuffer }\n * ]);\n * ```\n */\nexport class FontWrapper implements ViewWrapper {\n private readonly fontTable: XmlComponent;\n public readonly relationships: Relationships;\n public readonly fontOptionsWithKey: readonly EmbeddedFontOptionsWithKey[] = [];\n\n public constructor(public readonly options: readonly EmbeddedFontOptions[]) {\n this.fontOptionsWithKey = options.map((o) => ({ ...o, fontKey: uniqueUuid() }));\n this.fontTable = createFontTable(this.fontOptionsWithKey);\n this.relationships = new Relationships();\n\n for (let i = 0; i < options.length; i++) {\n this.relationships.addRelationship(\n i + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font\",\n `fonts/${options[i].name}.odttf`,\n );\n }\n }\n\n public get view(): XmlComponent {\n return this.fontTable;\n }\n}\n","/**\n * Deleted instruction text elements for field codes in track changes.\n *\n * Provides deleted versions of page number and page count field instructions.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @module\n */\nimport { SpaceType } from \"@file/shared\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a deleted PAGE field instruction.\n *\n * This element contains the field instruction code for the current page number\n * within a deletion. Uses w:delInstrText instead of w:instrText to mark it as\n * part of a tracked deletion.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"delInstrText\" type=\"CT_Text\"/>\n *\n * <xsd:complexType name=\"CT_Text\">\n * <xsd:simpleContent>\n * <xsd:extension base=\"s:ST_String\">\n * <xsd:attribute ref=\"xml:space\" use=\"optional\"/>\n * </xsd:extension>\n * </xsd:simpleContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Used internally within DeletedTextRun for page number fields\n * new DeletedPage(); // Creates <w:delInstrText>PAGE</w:delInstrText>\n * ```\n */\nexport class DeletedPage extends XmlComponent {\n public constructor() {\n super(\"w:delInstrText\");\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n this.root.push(\"PAGE\");\n }\n}\n\n/**\n * Represents a deleted NUMPAGES field instruction.\n *\n * This element contains the field instruction code for the total number of pages\n * in the document within a deletion. Uses w:delInstrText instead of w:instrText\n * to mark it as part of a tracked deletion.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"delInstrText\" type=\"CT_Text\"/>\n *\n * <xsd:complexType name=\"CT_Text\">\n * <xsd:simpleContent>\n * <xsd:extension base=\"s:ST_String\">\n * <xsd:attribute ref=\"xml:space\" use=\"optional\"/>\n * </xsd:extension>\n * </xsd:simpleContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Used internally within DeletedTextRun for total pages field\n * new DeletedNumberOfPages(); // Creates <w:delInstrText>NUMPAGES</w:delInstrText>\n * ```\n */\nexport class DeletedNumberOfPages extends XmlComponent {\n public constructor() {\n super(\"w:delInstrText\");\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n this.root.push(\"NUMPAGES\");\n }\n}\n\n/**\n * Represents a deleted SECTIONPAGES field instruction.\n *\n * This element contains the field instruction code for the total number of pages\n * in the current section within a deletion. Uses w:delInstrText instead of\n * w:instrText to mark it as part of a tracked deletion.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"delInstrText\" type=\"CT_Text\"/>\n *\n * <xsd:complexType name=\"CT_Text\">\n * <xsd:simpleContent>\n * <xsd:extension base=\"s:ST_String\">\n * <xsd:attribute ref=\"xml:space\" use=\"optional\"/>\n * </xsd:extension>\n * </xsd:simpleContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Used internally within DeletedTextRun for section pages field\n * new DeletedNumberOfPagesSection(); // Creates <w:delInstrText>SECTIONPAGES</w:delInstrText>\n * ```\n */\nexport class DeletedNumberOfPagesSection extends XmlComponent {\n public constructor() {\n super(\"w:delInstrText\");\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n this.root.push(\"SECTIONPAGES\");\n }\n}\n","/**\n * Deleted text element module for track changes.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @module\n */\nimport { SpaceType } from \"@file/shared\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents deleted text content within a tracked deletion.\n *\n * This element contains the actual text that was deleted. Unlike regular text\n * (w:t), deleted text uses the w:delText element to distinguish it as part of\n * a deletion. The xml:space=\"preserve\" attribute ensures whitespace is maintained.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"delText\" type=\"CT_Text\"/>\n *\n * <xsd:complexType name=\"CT_Text\">\n * <xsd:simpleContent>\n * <xsd:extension base=\"s:ST_String\">\n * <xsd:attribute ref=\"xml:space\" use=\"optional\"/>\n * </xsd:extension>\n * </xsd:simpleContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Used internally within DeletedTextRun\n * new DeletedText(\"This text was removed\");\n * ```\n */\nexport class DeletedText extends XmlComponent {\n public constructor(text: string) {\n super(\"w:delText\");\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n\n this.root.push(text);\n }\n}\n","/**\n * Deleted text run module for track changes.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { createBreak } from \"../../paragraph/run/break\";\nimport { createBegin, createEnd, createSeparate } from \"../../paragraph/run/field\";\nimport { RunProperties } from \"../../paragraph/run/properties\";\nimport { PageNumber } from \"../../paragraph/run/run\";\nimport type { RunOptions } from \"../../paragraph/run/run\";\nimport type { ChangedAttributesProperties } from \"../track-revision\";\nimport {\n DeletedNumberOfPages,\n DeletedNumberOfPagesSection,\n DeletedPage,\n} from \"./deleted-page-number\";\nimport { DeletedText } from \"./deleted-text\";\n\n/**\n * Options for creating a deleted text run.\n *\n * Combines run formatting options with track change metadata.\n *\n * @property id - Unique identifier for this deletion\n * @property author - Name of the author who deleted the text\n * @property date - Date and time when the deletion was made (ISO 8601 format)\n */\ntype IDeletedRunOptions = RunOptions & ChangedAttributesProperties;\n\n/**\n * Represents a deleted text run in a tracked changes document.\n *\n * A deletion marks text that has been removed from the document as part of\n * revision tracking. It wraps a text run with metadata about who made the\n * deletion and when. Deleted text is typically shown with strikethrough\n * formatting in applications that support track changes.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"del\" type=\"CT_RunTrackChange\" minOccurs=\"0\"/>\n *\n * <xsd:complexType name=\"CT_RunTrackChange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TrackChange\">\n * <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n * <xsd:group ref=\"EG_ContentRunContent\"/>\n * <xsd:group ref=\"m:EG_OMathMathElements\"/>\n * </xsd:choice>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a deleted text run\n * new DeletedTextRun({\n * id: 2,\n * author: \"Jane Smith\",\n * date: \"2024-01-15T11:00:00Z\",\n * text: \"This text was removed\",\n * italics: true\n * });\n *\n * // Deleted run with page number field\n * new DeletedTextRun({\n * id: 3,\n * author: \"John Doe\",\n * date: \"2024-01-15T12:00:00Z\",\n * children: [PageNumber.CURRENT]\n * });\n * ```\n */\nexport class DeletedTextRun extends XmlComponent {\n protected readonly deletedTextRunWrapper: DeletedTextRunWrapper;\n\n public constructor(options: IDeletedRunOptions) {\n super(\"w:del\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n this.deletedTextRunWrapper = new DeletedTextRunWrapper(options);\n this.addChildElement(this.deletedTextRunWrapper);\n }\n}\n\n/**\n * Internal wrapper for the run element within a deletion.\n *\n * Wraps the actual run content (text, fields, etc.) within a w:r element\n * that appears inside the w:del element. Handles special cases like page\n * numbers and other field codes using deleted-specific element types.\n *\n * @internal\n */\nclass DeletedTextRunWrapper extends XmlComponent {\n public constructor(options: RunOptions) {\n super(\"w:r\");\n this.root.push(new RunProperties(options));\n\n if (options.children) {\n for (const child of options.children) {\n if (typeof child === \"string\") {\n switch (child) {\n case PageNumber.CURRENT: {\n this.root.push(createBegin());\n this.root.push(new DeletedPage());\n this.root.push(createSeparate());\n this.root.push(createEnd());\n break;\n }\n case PageNumber.TOTAL_PAGES: {\n this.root.push(createBegin());\n this.root.push(new DeletedNumberOfPages());\n this.root.push(createSeparate());\n this.root.push(createEnd());\n break;\n }\n case PageNumber.TOTAL_PAGES_IN_SECTION: {\n this.root.push(createBegin());\n this.root.push(new DeletedNumberOfPagesSection());\n this.root.push(createSeparate());\n this.root.push(createEnd());\n break;\n }\n default: {\n this.root.push(new DeletedText(child));\n break;\n }\n }\n continue;\n }\n\n this.root.push(child);\n }\n } else if (options.text) {\n this.root.push(new DeletedText(options.text));\n }\n\n if (options.break) {\n for (let i = 0; i < options.break; i++) {\n this.root.splice(1, 0, createBreak());\n }\n }\n }\n}\n","/**\n * Inserted text run module for track changes.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { TextRun } from \"../../paragraph/run\";\nimport type { RunOptions } from \"../../paragraph/run\";\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\n/**\n * Options for creating an inserted text run.\n *\n * Combines run formatting options with track change metadata.\n *\n * @property id - Unique identifier for this insertion\n * @property author - Name of the author who inserted the text\n * @property date - Date and time when the insertion was made (ISO 8601 format)\n */\ntype IInsertedRunOptions = ChangedAttributesProperties & RunOptions;\n\n/**\n * Represents an inserted text run in a tracked changes document.\n *\n * An insertion marks text that has been added to the document as part of\n * revision tracking. It wraps a standard text run with metadata about who\n * made the insertion and when.\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"ins\" type=\"CT_RunTrackChange\" minOccurs=\"0\"/>\n *\n * <xsd:complexType name=\"CT_RunTrackChange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TrackChange\">\n * <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n * <xsd:group ref=\"EG_ContentRunContent\"/>\n * <xsd:group ref=\"m:EG_OMathMathElements\"/>\n * </xsd:choice>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create an inserted text run\n * new InsertedTextRun({\n * id: 1,\n * author: \"John Doe\",\n * date: \"2024-01-15T10:30:00Z\",\n * text: \"This text was added\",\n * bold: true\n * });\n * ```\n */\nexport class InsertedTextRun extends XmlComponent {\n public constructor(options: IInsertedRunOptions) {\n super(\"w:ins\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n this.addChildElement(new TextRun(options as RunOptions));\n }\n}\n","/**\n * Bookmark module for WordprocessingML documents.\n *\n * Bookmarks are used to identify a location or selection of text within a document.\n * They can be used as targets for hyperlinks.\n *\n * Reference: http://officeopenxml.com/WPbookmark.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { bookmarkUniqueNumericIdGen } from \"@util/convenience-functions\";\n\nimport type { ParagraphChild } from \"../paragraph\";\n\n/**\n * Options for creating a bookmark.\n *\n * @property id - The bookmark name used for reference\n * @property children - Array of paragraph children contained within the bookmark range\n */\nexport interface BookmarkOptions {\n /** The bookmark name used for reference */\n readonly id: string;\n /** Array of paragraph children contained within the bookmark range */\n readonly children: readonly ParagraphChild[];\n}\n\n/**\n * Represents a bookmark in a WordprocessingML document.\n *\n * A bookmark identifies a location or range of content that can be referenced\n * elsewhere, such as from a hyperlink or table of contents. The bookmark consists\n * of a start marker, content, and an end marker.\n *\n * Reference: http://officeopenxml.com/WPbookmark.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"bookmarkStart\" type=\"CT_Bookmark\"/>\n * <xsd:element name=\"bookmarkEnd\" type=\"CT_MarkupRange\"/>\n *\n * <xsd:complexType name=\"CT_Bookmark\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_BookmarkRange\">\n * <xsd:attribute name=\"name\" type=\"s:ST_String\" use=\"required\"/>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a bookmark around a heading\n * new Bookmark({\n * id: \"section1\",\n * children: [new TextRun(\"Section 1 Heading\")],\n * });\n *\n * // Link to the bookmark from elsewhere\n * new InternalHyperlink({\n * children: [new TextRun(\"Go to Section 1\")],\n * anchor: \"section1\",\n * });\n * ```\n */\nexport class Bookmark {\n private readonly bookmarkUniqueNumericId = bookmarkUniqueNumericIdGen();\n\n public readonly start: BookmarkStart;\n public readonly children: readonly ParagraphChild[];\n public readonly end: BookmarkEnd;\n\n public constructor(options: BookmarkOptions) {\n const linkId = this.bookmarkUniqueNumericId();\n\n this.start = new BookmarkStart(options.id, linkId);\n this.children = options.children;\n this.end = new BookmarkEnd(linkId);\n }\n}\n\n/**\n * Represents the start marker of a bookmark range.\n *\n * This element marks the beginning of a bookmarked region in the document.\n * It must be paired with a corresponding BookmarkEnd element with the same id.\n *\n * Reference: http://officeopenxml.com/WPbookmark.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"bookmarkStart\" type=\"CT_Bookmark\"/>\n *\n * <xsd:complexType name=\"CT_Bookmark\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_BookmarkRange\">\n * <xsd:attribute name=\"name\" type=\"s:ST_String\" use=\"required\"/>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new BookmarkStart(\"myBookmark\", 1);\n * ```\n */\nexport class BookmarkStart extends XmlComponent {\n public constructor(id: string, linkId: number) {\n super(\"w:bookmarkStart\");\n\n this.root.push({ _attr: { \"w:id\": linkId, \"w:name\": id } });\n }\n}\n\n/**\n * Represents the end marker of a bookmark range.\n *\n * This element marks the end of a bookmarked region in the document.\n * It must be paired with a corresponding BookmarkStart element with the same id.\n *\n * Reference: http://officeopenxml.com/WPbookmark.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"bookmarkEnd\" type=\"CT_MarkupRange\"/>\n *\n * <xsd:complexType name=\"CT_MarkupRange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_Markup\">\n * <xsd:attribute name=\"displacedByCustomXml\" type=\"ST_DisplacedByCustomXml\" use=\"optional\"/>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new BookmarkEnd(1);\n * ```\n */\nexport class BookmarkEnd extends XmlComponent {\n public constructor(linkId: number) {\n super(\"w:bookmarkEnd\");\n\n this.root.push({ _attr: { \"w:id\": linkId } });\n }\n}\n","/**\n * Move bookmark range markers for WordprocessingML track changes.\n *\n * These elements mark the source and destination ranges of content moves\n * in track-revised documents.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_MoveBookmark\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/** Builds move bookmark attributes with optional fields omitted when undefined. */\nconst buildMoveBookmarkAttr = (\n id: number,\n name?: string,\n author?: string,\n date?: string,\n): { readonly _attr: Record<string, string | number> } => {\n const attrs: Record<string, string | number> = { \"w:id\": id };\n if (name !== undefined) attrs[\"w:name\"] = name;\n if (author !== undefined) attrs[\"w:author\"] = author;\n if (date !== undefined) attrs[\"w:date\"] = date;\n return { _attr: attrs };\n};\n\n/**\n * Marks the start of a move source range.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveFromRangeStart (CT_MoveBookmark)\n *\n * @example\n * ```typescript\n * new MoveFromRangeStart(0, \"movedPara\", \"John\", \"2024-01-01T00:00:00Z\");\n * ```\n */\nexport class MoveFromRangeStart extends XmlComponent {\n public constructor(id: number, name?: string, author?: string, date?: string) {\n super(\"w:moveFromRangeStart\");\n this.root.push(buildMoveBookmarkAttr(id, name, author, date));\n }\n}\n\n/**\n * Marks the end of a move source range.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveFromRangeEnd (CT_MarkupRange)\n */\nexport class MoveFromRangeEnd extends XmlComponent {\n public constructor(id: number) {\n super(\"w:moveFromRangeEnd\");\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n\n/**\n * Marks the start of a move destination range.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveToRangeStart (CT_MoveBookmark)\n *\n * @example\n * ```typescript\n * new MoveToRangeStart(0, \"movedPara\", \"John\", \"2024-01-01T00:00:00Z\");\n * ```\n */\nexport class MoveToRangeStart extends XmlComponent {\n public constructor(id: number, name?: string, author?: string, date?: string) {\n super(\"w:moveToRangeStart\");\n this.root.push(buildMoveBookmarkAttr(id, name, author, date));\n }\n}\n\n/**\n * Marks the end of a move destination range.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveToRangeEnd (CT_MarkupRange)\n */\nexport class MoveToRangeEnd extends XmlComponent {\n public constructor(id: number) {\n super(\"w:moveToRangeEnd\");\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n","/**\n * Div ID module for WordprocessingML documents.\n *\n * This module provides the div ID element which specifies\n * a reference to an HTML div element.\n *\n * Reference: http://officeopenxml.com/WPparagraph.php\n *\n * @module\n */\nimport { BuilderElement, numberValObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates a div ID element for a paragraph.\n *\n * The div ID references an HTML div element for HTML conversion purposes.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DecimalNumber\">\n * <xsd:attribute name=\"val\" type=\"xsd:integer\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set div ID to 1\n * createDivId(1);\n * ```\n */\nexport const createDivId = (id: number): XmlComponent =>\n new BuilderElement<{ readonly val: number }>({\n attributes: {\n val: { key: \"w:val\", value: id },\n },\n name: \"w:divId\",\n });\n\nexport const buildDivIdObj = (id: number): IXmlableObject => numberValObj(\"w:divId\", id);\n","/**\n * Numbered item reference module for WordprocessingML documents.\n *\n * This module provides cross-references to numbered items (such as\n * numbered paragraphs, list items, or headings) within a document.\n *\n * Reference: https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/7088a8ce-e784-49d4-94b8-cba6ef8fce78\n *\n * @module\n */\nimport { SimpleField } from \"../run/simple-field\";\n\n/**\n * Format options for numbered item references.\n *\n * Specifies how the paragraph number should be displayed when referenced.\n */\nexport enum NumberedItemReferenceFormat {\n NONE = \"none\",\n /**\n * \\r option - inserts the paragraph number of the bookmarked paragraph in relative context, or relative to its position in the numbering scheme\n */\n RELATIVE = \"relative\",\n /**\n * \\n option - causes the field result to be the paragraph number without trailing periods. No information about prior numbered levels is displayed unless it is included as part of the current level.\n */\n NO_CONTEXT = \"no_context\",\n /**\n * \\w option - causes the field result to be the entire paragraph number without trailing periods, regardless of the location of the REF field.\n */\n FULL_CONTEXT = \"full_context\",\n}\n\nexport interface NumberedItemReferenceOptions {\n /**\n * \\h option - Creates a hyperlink to the bookmarked paragraph.\n * @default true\n */\n readonly hyperlink?: boolean;\n /**\n * Which switch to use for the reference format\n * @default NumberedItemReferenceFormat.FULL_CONTEXT\n */\n readonly referenceFormat?: NumberedItemReferenceFormat;\n}\n\ntype Switch = \"\\\\h\" | \"\\\\r\" | \"\\\\n\" | \"\\\\w\";\n\nconst SWITCH_MAP: Record<NumberedItemReferenceFormat, Switch | undefined> = {\n [NumberedItemReferenceFormat.RELATIVE]: \"\\\\r\",\n [NumberedItemReferenceFormat.NO_CONTEXT]: \"\\\\n\",\n [NumberedItemReferenceFormat.FULL_CONTEXT]: \"\\\\w\",\n [NumberedItemReferenceFormat.NONE]: undefined,\n};\n\n/**\n * Creates a field/cross reference to a numbered item in the document.\n *\n * The REF field displays the text or page number of a bookmarked paragraph,\n * particularly useful for referencing numbered headings or list items.\n *\n * @example\n * ```typescript\n * // Reference a numbered heading\n * new NumberedItemReference(\"heading_1_bookmark\", \"1.2.3\", {\n * hyperlink: true,\n * referenceFormat: NumberedItemReferenceFormat.FULL_CONTEXT,\n * });\n * ```\n */\nexport class NumberedItemReference extends SimpleField {\n public constructor(\n bookmarkId: string,\n // TODO: It would be nice if the cached value could be automatically generated\n /**\n * The cached value of the field. This is used to display the field result in the document.\n */\n cachedValue?: string,\n options: NumberedItemReferenceOptions = {},\n ) {\n const { hyperlink = true, referenceFormat = NumberedItemReferenceFormat.FULL_CONTEXT } =\n options;\n const baseInstruction = `REF ${bookmarkId}`;\n\n const switches: readonly Switch[] = [\n ...(hyperlink ? [\"\\\\h\" as Switch] : []),\n ...[SWITCH_MAP[referenceFormat]].filter((a): a is Switch => Boolean(a)),\n ];\n\n const instruction = `${baseInstruction} ${switches.join(\" \")}`;\n\n super(instruction, cachedValue);\n }\n}\n","/**\n * Outline level module for WordprocessingML documents.\n *\n * This module provides the outline level element which specifies\n * the outline level of a paragraph for document outline/TOC purposes.\n *\n * Reference: http://officeopenxml.com/WPparagraph.php\n *\n * @module\n */\nimport { BuilderElement, numberValObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates an outline level element for a paragraph.\n *\n * The outline level determines the paragraph's position in the document\n * outline and affects table of contents generation. Level 0 corresponds\n * to Heading 1, level 1 to Heading 2, etc.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DecimalNumber\">\n * <xsd:attribute name=\"val\" type=\"xsd:integer\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set outline level to 0 (Heading 1)\n * createOutlineLevel(0);\n *\n * // Set outline level to 2 (Heading 3)\n * createOutlineLevel(2);\n * ```\n */\nexport const createOutlineLevel = (level: number): XmlComponent =>\n new BuilderElement<{ readonly val: number }>({\n attributes: {\n val: { key: \"w:val\", value: level },\n },\n name: \"w:outlineLvl\",\n });\n\nexport const buildOutlineLevelObj = (level: number): IXmlableObject =>\n numberValObj(\"w:outlineLvl\", level);\n","/**\n * Page reference field instruction module for WordprocessingML documents.\n *\n * This module provides the field instruction element for page references,\n * which displays the page number of a bookmarked location.\n *\n * Reference: http://officeopenxml.com/WPfields.php\n *\n * @module\n */\nimport { SpaceType } from \"@file/shared\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { PageReferenceOptions } from \"./pageref\";\n\n/**\n * Represents a PAGEREF field instruction.\n *\n * The PAGEREF field inserts the page number of the page containing\n * the specified bookmark. It can optionally create a hyperlink\n * and display relative positioning (e.g., \"on the previous page\").\n *\n * @example\n * ```typescript\n * // Basic page reference\n * new PageReferenceFieldInstruction(\"figure_1\");\n *\n * // Page reference with hyperlink and relative position\n * new PageReferenceFieldInstruction(\"table_1\", {\n * hyperlink: true,\n * useRelativePosition: true,\n * });\n * ```\n *\n * @internal\n */\nexport class PageReferenceFieldInstruction extends XmlComponent {\n public constructor(bookmarkId: string, options: PageReferenceOptions = {}) {\n super(\"w:instrText\");\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n\n let instruction = `PAGEREF ${bookmarkId}`;\n\n if (options.hyperlink) {\n instruction = `${instruction} \\\\h`;\n }\n if (options.useRelativePosition) {\n instruction = `${instruction} \\\\p`;\n }\n\n this.root.push(instruction);\n }\n}\n","/**\n * Page reference module for WordprocessingML documents.\n *\n * This module provides page reference elements for cross-referencing\n * the page number of a bookmarked location.\n *\n * Reference: https://www.ecma-international.org/publications/standards/Ecma-376.htm (Part 1, Page 1234)\n *\n * @module\n */\nimport { createBegin, createEnd } from \"@file/paragraph/run/field\";\n\nimport { Run } from \"../run\";\nimport { PageReferenceFieldInstruction } from \"./pageref-field-instruction\";\n\n/**\n * Options for page reference fields.\n *\n * @see {@link PageReference}\n */\nexport interface PageReferenceOptions {\n /**\n * \\h option - Creates a hyperlink to the bookmarked paragraph.\n */\n readonly hyperlink?: boolean;\n /**\n * \\p option - Causes the field to display its position relative to the source\n * bookmark. If the PAGEREF field is on the same page as the\n * bookmark, it omits \"on page #\" and returns \"above\" or \"below\"\n * only. If the PAGEREF field is not on the same page as the\n * bookmark, the string \"on page #\" is used.\n */\n readonly useRelativePosition?: boolean;\n}\n\n/**\n * Represents a page reference (PAGEREF) field.\n *\n * The PAGEREF field displays the page number of the page containing\n * the specified bookmark, useful for cross-references like \"see page 5\".\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * // Simple page reference\n * new PageReference(\"figure_1_bookmark\");\n *\n * // With hyperlink\n * new PageReference(\"table_2\", { hyperlink: true });\n *\n * // With relative position (e.g., \"above\" or \"on page 5\")\n * new PageReference(\"section_3\", {\n * hyperlink: true,\n * useRelativePosition: true,\n * });\n * ```\n */\nexport class PageReference extends Run {\n public constructor(bookmarkId: string, options: PageReferenceOptions = {}) {\n super({\n children: [\n createBegin(true),\n new PageReferenceFieldInstruction(bookmarkId, options),\n createEnd(),\n ],\n });\n }\n}\n","/**\n * Bidirectional text override elements for WordprocessingML documents.\n *\n * These elements allow overriding the default text direction for inline content,\n * used for embedding LTR text inside RTL paragraphs or vice versa.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_DirContentRun, CT_BdoContentRun\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { ParagraphChild } from \"../paragraph\";\n\n/**\n * Options for directional text override.\n */\nexport interface DirOptions {\n /** Array of paragraph children inside the direction override */\n readonly children: readonly ParagraphChild[];\n /** Text direction: \"ltr\" or \"rtl\" */\n readonly val: \"ltr\" | \"rtl\";\n}\n\n/**\n * Overrides the default bidirectional text direction for inline content.\n *\n * Unlike `w:bdo`, this respects the Unicode bidirectional algorithm\n * and only provides a hint.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, w:dir (CT_DirContentRun)\n *\n * @example\n * ```typescript\n * new Dir({ val: \"rtl\", children: [new TextRun(\"مرحبا\")] });\n * ```\n */\nexport class Dir extends XmlComponent {\n public constructor(options: DirOptions) {\n super(\"w:dir\");\n this.root.push({ _attr: { \"w:val\": options.val } });\n for (const child of options.children) {\n this.root.push(child);\n }\n }\n}\n\n/**\n * Strong bidirectional override for inline content.\n *\n * Forces the specified direction regardless of the Unicode bidi algorithm.\n * Contains full paragraph content (runs, breaks, etc.).\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, w:bdo (CT_BdoContentRun)\n *\n * @example\n * ```typescript\n * new Bdo({ val: \"ltr\", children: [new TextRun(\"Hello\")] });\n * ```\n */\nexport class Bdo extends XmlComponent {\n public constructor(options: DirOptions) {\n super(\"w:bdo\");\n this.root.push({ _attr: { \"w:val\": options.val } });\n for (const child of options.children) {\n this.root.push(child);\n }\n }\n}\n","/**\n * Links module exports.\n *\n * @module\n */\nexport * from \"./hyperlink\";\nexport * from \"./bookmark\";\nexport * from \"./move-bookmark\";\nexport * from \"./div-id\";\nexport * from \"./numbered-item-ref\";\nexport * from \"./outline-level\";\nexport * from \"./pageref\";\nexport * from \"./bidi\";\n","/**\n * Math Accent Character module for Office MathML.\n *\n * This module provides the accent character for n-ary operators.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_chr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating an accent character element.\n */\ninterface MathAccentCharacterOptions {\n /** The n-ary operator character (e.g., \"∑\", \"∫\", \"∏\") */\n readonly accent: string;\n}\n\n/**\n * Creates an accent character element for n-ary operators.\n *\n * This element specifies the character used for the n-ary operator,\n * such as summation (∑), integral (∫), or product (∏) symbols.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_chr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Char\">\n * <xsd:attribute name=\"val\" type=\"ST_Char\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathAccentCharacter = ({ accent }: MathAccentCharacterOptions): XmlComponent =>\n new BuilderElement<MathAccentCharacterOptions>({\n attributes: {\n accent: { key: \"m:val\", value: accent },\n },\n name: \"m:chr\",\n });\n","/**\n * Math Base module for Office MathML.\n *\n * This module provides the base element (m:e) that contains\n * the primary content of math structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_e-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Options for creating a math base element.\n */\nexport interface MathBaseOptions {\n /** The content of the base */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Creates a math base element.\n *\n * The math base (m:e) is used within math structures like fractions,\n * radicals, and n-ary operators to contain the primary expression.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_e-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathArg\">\n * <xsd:sequence>\n * <xsd:element name=\"argPr\" type=\"CT_OMathArgPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_OMathMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBase = ({ children }: MathBaseOptions): XmlComponent =>\n new BuilderElement({\n children,\n name: \"m:e\",\n });\n","/**\n * Math Limit Location module for Office MathML.\n *\n * This module provides the limit location property for n-ary operators.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limLoc-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating a limit location element.\n */\ninterface MathLimitLocationOptions {\n /** Location: \"undOvr\" (under/over) or \"subSup\" (subscript/superscript). Defaults to \"undOvr\". */\n readonly value?: string;\n}\n\n/**\n * Creates a limit location element for n-ary operators.\n *\n * This element specifies where limits appear relative to the operator:\n * - \"undOvr\": limits appear directly above and below the operator\n * - \"subSup\": limits appear as superscript and subscript\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limLoc-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LimLoc\">\n * <xsd:attribute name=\"val\" type=\"ST_LimLoc\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathLimitLocation = ({ value }: MathLimitLocationOptions): XmlComponent =>\n new BuilderElement<Required<MathLimitLocationOptions>>({\n attributes: {\n value: { key: \"m:val\", value: value || \"undOvr\" },\n },\n name: \"m:limLoc\",\n });\n","/**\n * Math SubScript Hide module for Office MathML.\n *\n * This module provides the element to hide subscripts in n-ary operators.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_subHide-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates a subscript hide element for n-ary operators.\n *\n * This element indicates that the subscript (lower limit) should be hidden\n * in n-ary operators when no subscript is provided.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_subHide-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OnOff\">\n * <xsd:attribute name=\"val\" type=\"ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSubScriptHide = (): XmlComponent =>\n new BuilderElement<{ readonly hide: number }>({\n attributes: {\n hide: { key: \"m:val\", value: 1 },\n },\n name: \"m:subHide\",\n });\n","/**\n * Math SuperScript Hide module for Office MathML.\n *\n * This module provides the element to hide superscripts in n-ary operators.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_supHide-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates a superscript hide element for n-ary operators.\n *\n * This element indicates that the superscript (upper limit) should be hidden\n * in n-ary operators when no superscript is provided.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_supHide-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OnOff\">\n * <xsd:attribute name=\"val\" type=\"ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSuperScriptHide = (): XmlComponent =>\n new BuilderElement<{ readonly hide: number }>({\n attributes: {\n hide: { key: \"m:val\", value: 1 },\n },\n name: \"m:supHide\",\n });\n","/**\n * Math N-Ary Properties module for Office MathML.\n *\n * This module provides properties for n-ary operators (sum, integral, etc.) in math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_naryPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport { createMathAccentCharacter } from \"./math-accent-character\";\nimport { createMathLimitLocation } from \"./math-limit-location\";\nimport { createMathSubScriptHide } from \"./math-sub-script-hide\";\nimport { createMathSuperScriptHide } from \"./math-super-script-hide\";\n\n/**\n * Options for creating n-ary properties.\n *\n * @see {@link createMathNAryProperties}\n */\nexport interface MathNAryPropertiesOptions {\n /** The n-ary operator character (e.g., \"∑\" for sum, \"∫\" for integral) */\n readonly accent: string;\n /** Whether the n-ary has a superscript (upper limit) */\n readonly hasSuperScript: boolean;\n /** Whether the n-ary has a subscript (lower limit) */\n readonly hasSubScript: boolean;\n /** Location of limits: \"undOvr\" (under/over) or \"subSup\" (subscript/superscript) */\n readonly limitLocationVal?: string;\n /** Whether the operator grows to match its content */\n readonly grow?: boolean;\n}\n\n/**\n * Creates properties for n-ary operator structures.\n *\n * This element specifies properties for n-ary objects like summations\n * and integrals, including the operator character and limit positioning.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_naryPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_NaryPr\">\n * <xsd:sequence>\n * <xsd:element name=\"chr\" type=\"CT_Char\" minOccurs=\"0\"/>\n * <xsd:element name=\"limLoc\" type=\"CT_LimLoc\" minOccurs=\"0\"/>\n * <xsd:element name=\"grow\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"subHide\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"supHide\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathNAryProperties = ({\n accent,\n hasSuperScript,\n hasSubScript,\n limitLocationVal,\n grow,\n}: MathNAryPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (accent) {\n children.push(createMathAccentCharacter({ accent }));\n }\n children.push(createMathLimitLocation({ value: limitLocationVal }));\n if (grow !== undefined) {\n children.push(onOffObj(\"m:grow\", grow));\n }\n if (!hasSubScript) {\n children.push(createMathSubScriptHide());\n }\n if (!hasSuperScript) {\n children.push(createMathSuperScriptHide());\n }\n\n return new BuilderElement({\n children,\n name: \"m:naryPr\",\n });\n};\n","/**\n * Math SubScript Element module for Office MathML.\n *\n * This module provides the subscript element for n-ary operators and other structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sub-3.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Options for creating a subscript element.\n */\ninterface MathSubScriptElementOptions {\n /** The content of the subscript */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Creates a subscript element for math structures.\n *\n * This element contains the subscript content, used in n-ary operators,\n * script objects, and other structures that support subscripts.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sub-3.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathArg\">\n * <xsd:sequence>\n * <xsd:element name=\"argPr\" type=\"CT_OMathArgPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_OMathMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSubScriptElement = ({\n children,\n}: MathSubScriptElementOptions): XmlComponent =>\n new BuilderElement({\n children,\n name: \"m:sub\",\n });\n","/**\n * Math SuperScript Element module for Office MathML.\n *\n * This module provides the superscript element for n-ary operators and other structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sup-3.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Options for creating a superscript element.\n */\ninterface MathSuperScriptElementOptions {\n /** The content of the superscript */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Creates a superscript element for math structures.\n *\n * This element contains the superscript content, used in n-ary operators,\n * script objects, and other structures that support superscripts.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sup-3.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathArg\">\n * <xsd:sequence>\n * <xsd:element name=\"argPr\" type=\"CT_OMathArgPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_OMathMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSuperScriptElement = ({\n children,\n}: MathSuperScriptElementOptions): XmlComponent =>\n new BuilderElement({\n children,\n name: \"m:sup\",\n });\n","/**\n * Math Sum module for Office MathML.\n *\n * This module provides the MathSum class for summation (Σ) expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_nary-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"./math-base\";\nimport { createMathNAryProperties } from \"./math-n-ary-properties\";\nimport { createMathSubScriptElement } from \"./math-sub-script\";\nimport { createMathSuperScriptElement } from \"./math-super-script\";\n\n/**\n * Options for creating a MathSum.\n *\n * @see {@link MathSum}\n */\nexport interface MathSumOptions {\n /** The expression being summed */\n readonly children: readonly MathComponent[];\n /** Optional lower bound (subscript) of the sum */\n readonly subScript?: readonly MathComponent[];\n /** Optional upper bound (superscript) of the sum */\n readonly superScript?: readonly MathComponent[];\n}\n\n/**\n * Represents a summation (Σ) expression in a math equation.\n *\n * MathSum displays the summation symbol with optional lower and upper bounds.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_nary-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Nary\">\n * <xsd:sequence>\n * <xsd:element name=\"naryPr\" type=\"CT_NaryPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"sub\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sup\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Sum from i=1 to n\n * new MathSum({\n * children: [new MathRun(\"x\")],\n * subScript: [new MathRun(\"i=1\")],\n * superScript: [new MathRun(\"n\")],\n * });\n * ```\n */\nexport class MathSum extends XmlComponent {\n public constructor(options: MathSumOptions) {\n super(\"m:nary\");\n\n this.root.push(\n createMathNAryProperties({\n accent: \"∑\",\n hasSubScript: Boolean(options.subScript),\n hasSuperScript: Boolean(options.superScript),\n }),\n );\n\n this.root.push(createMathSubScriptElement({ children: options.subScript ?? [] }));\n\n this.root.push(createMathSuperScriptElement({ children: options.superScript ?? [] }));\n\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math Integral module for Office MathML.\n *\n * This module provides the MathIntegral class for integral (∫) expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_nary-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"./math-base\";\nimport { createMathNAryProperties } from \"./math-n-ary-properties\";\nimport { createMathSubScriptElement } from \"./math-sub-script\";\nimport { createMathSuperScriptElement } from \"./math-super-script\";\n\n/**\n * Options for creating a MathIntegral.\n *\n * @see {@link MathIntegral}\n */\nexport interface MathIntegralOptions {\n /** The integrand expression */\n readonly children: readonly MathComponent[];\n /** Optional lower bound of integration */\n readonly subScript?: readonly MathComponent[];\n /** Optional upper bound of integration */\n readonly superScript?: readonly MathComponent[];\n}\n\n/**\n * Represents an integral (∫) expression in a math equation.\n *\n * MathIntegral displays the integral symbol with optional bounds.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_nary-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Nary\">\n * <xsd:sequence>\n * <xsd:element name=\"naryPr\" type=\"CT_NaryPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"sub\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sup\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Definite integral from 0 to 1\n * new MathIntegral({\n * children: [new MathRun(\"f(x) dx\")],\n * subScript: [new MathRun(\"0\")],\n * superScript: [new MathRun(\"1\")],\n * });\n * ```\n */\nexport class MathIntegral extends XmlComponent {\n public constructor(options: MathIntegralOptions) {\n super(\"m:nary\");\n\n this.root.push(\n createMathNAryProperties({\n accent: \"\",\n hasSubScript: Boolean(options.subScript),\n hasSuperScript: Boolean(options.superScript),\n limitLocationVal: \"subSup\",\n }),\n );\n\n this.root.push(createMathSubScriptElement({ children: options.subScript ?? [] }));\n\n this.root.push(createMathSuperScriptElement({ children: options.superScript ?? [] }));\n\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math Limit module for Office MathML.\n *\n * This module provides the limit element for under/over limit structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_lim-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Represents a limit in a math equation.\n *\n * MathLimit is used within limit structures to specify the limit\n * expression that appears above or below the base.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_lim-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathArg\">\n * <xsd:sequence>\n * <xsd:element name=\"argPr\" type=\"CT_OMathArgPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_OMathMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @internal\n */\nexport class MathLimit extends XmlComponent {\n public constructor(children: readonly MathComponent[]) {\n super(\"m:lim\");\n\n for (const child of children) {\n this.root.push(child);\n }\n }\n}\n","/**\n * Math Control Properties module for Office MathML.\n *\n * This module provides the control properties element (m:ctrlPr)\n * used in various math structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_ctrlPr-1.html\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math control properties.\n *\n * @see {@link createMathControlProperties}\n */\nexport interface MathControlPropertiesOptions {\n /** Insertion tracking reference */\n readonly insertionReference?: string;\n /** Deletion tracking reference */\n readonly deletionReference?: string;\n}\n\n/**\n * Creates math control properties element (m:ctrlPr).\n *\n * This element specifies control properties for math elements,\n * including tracking changes for insertions and deletions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_ctrlPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_CtrlPr\">\n * <xsd:sequence>\n * <xsd:group ref=\"w:EG_RPrMath\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathControlProperties = (\n options?: MathControlPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options?.insertionReference !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { id: { key: \"w:id\", value: options.insertionReference } },\n name: \"w:ins\",\n }),\n );\n }\n\n if (options?.deletionReference !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { id: { key: \"w:id\", value: options.deletionReference } },\n name: \"w:del\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:ctrlPr\",\n });\n};\n","/**\n * Math Upper Limit Properties module for Office MathML.\n *\n * This module provides properties for upper limit structures (CT_LimUppPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limUppPr-1.html\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport {\n createMathControlProperties,\n type MathControlPropertiesOptions,\n} from \"../math-control-properties\";\n\n/**\n * Options for math upper limit properties.\n *\n * @see {@link createMathLimitUpperProperties}\n */\nexport interface MathLimitUpperPropertiesOptions {\n /** Control properties (tracking changes) */\n readonly controlProperties?: MathControlPropertiesOptions;\n}\n\n/**\n * Creates properties for an upper limit structure (m:limUppPr).\n *\n * This element specifies properties for the upper limit object.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limUppPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LimUppPr\">\n * <xsd:sequence>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathLimitUpperProperties = (\n options?: MathLimitUpperPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options?.controlProperties !== undefined) {\n children.push(createMathControlProperties(options.controlProperties));\n }\n\n return new BuilderElement({\n children,\n name: \"m:limUppPr\",\n });\n};\n","/**\n * Math Upper Limit module for Office MathML.\n *\n * This module provides the upper limit structure for math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limUpp-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"./math-base\";\nimport { MathLimit } from \"./math-limit\";\nimport {\n createMathLimitUpperProperties,\n type MathLimitUpperPropertiesOptions,\n} from \"./math-limit-upper-properties\";\n\n/**\n * Options for creating a MathLimitUpper.\n *\n * @see {@link MathLimitUpper}\n */\nexport interface MathLimitUpperOptions {\n /** Properties for the upper limit structure */\n readonly properties?: MathLimitUpperPropertiesOptions;\n /** The base expression */\n readonly children: readonly MathComponent[];\n /** The limit expression that appears above the base */\n readonly limit: readonly MathComponent[];\n}\n\n/**\n * Represents an upper limit structure in a math equation.\n *\n * MathLimitUpper displays content with a limit above,\n * commonly used for mathematical notation like lim with conditions above.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limUpp-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LimUpp\">\n * <xsd:sequence>\n * <xsd:element name=\"limUppPr\" type=\"CT_LimUppPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"lim\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Expression with limit above\n * new MathLimitUpper({\n * children: [new MathRun(\"max\")],\n * limit: [new MathRun(\"x∈S\")],\n * });\n * ```\n */\nexport class MathLimitUpper extends XmlComponent {\n public constructor(options: MathLimitUpperOptions) {\n super(\"m:limUpp\");\n\n if (options.properties) {\n this.root.push(createMathLimitUpperProperties(options.properties));\n }\n\n this.root.push(createMathBase({ children: options.children }));\n this.root.push(new MathLimit(options.limit));\n }\n}\n","/**\n * Math Lower Limit Properties module for Office MathML.\n *\n * This module provides properties for lower limit structures (CT_LimLowPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limLowPr-1.html\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport {\n createMathControlProperties,\n type MathControlPropertiesOptions,\n} from \"../math-control-properties\";\n\n/**\n * Options for math lower limit properties.\n *\n * @see {@link createMathLimitLowProperties}\n */\nexport interface MathLimitLowPropertiesOptions {\n /** Control properties (tracking changes) */\n readonly controlProperties?: MathControlPropertiesOptions;\n}\n\n/**\n * Creates properties for a lower limit structure (m:limLowPr).\n *\n * This element specifies properties for the lower limit object.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limLowPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LimLowPr\">\n * <xsd:sequence>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathLimitLowProperties = (\n options?: MathLimitLowPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options?.controlProperties !== undefined) {\n children.push(createMathControlProperties(options.controlProperties));\n }\n\n return new BuilderElement({\n children,\n name: \"m:limLowPr\",\n });\n};\n","/**\n * Math Lower Limit module for Office MathML.\n *\n * This module provides the lower limit structure for math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limLow-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"./math-base\";\nimport { MathLimit } from \"./math-limit\";\nimport {\n createMathLimitLowProperties,\n type MathLimitLowPropertiesOptions,\n} from \"./math-limit-low-properties\";\n\n/**\n * Options for creating a MathLimitLower.\n *\n * @see {@link MathLimitLower}\n */\nexport interface MathLimitLowerOptions {\n /** Properties for the lower limit structure */\n readonly properties?: MathLimitLowPropertiesOptions;\n /** The base expression */\n readonly children: readonly MathComponent[];\n /** The limit expression that appears below the base */\n readonly limit: readonly MathComponent[];\n}\n\n/**\n * Represents a lower limit structure in a math equation.\n *\n * MathLimitLower displays content with a limit underneath,\n * commonly used for limits in calculus (e.g., lim with x→0 below).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_limLow-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LimLow\">\n * <xsd:sequence>\n * <xsd:element name=\"limLowPr\" type=\"CT_LimLowPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"lim\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // lim with x→0 underneath\n * new MathLimitLower({\n * children: [new MathRun(\"lim\")],\n * limit: [new MathRun(\"x→0\")],\n * });\n * ```\n */\nexport class MathLimitLower extends XmlComponent {\n public constructor(options: MathLimitLowerOptions) {\n super(\"m:limLow\");\n\n if (options.properties) {\n this.root.push(createMathLimitLowProperties(options.properties));\n }\n\n this.root.push(createMathBase({ children: options.children }));\n this.root.push(new MathLimit(options.limit));\n }\n}\n","/**\n * Math n-ary module exports.\n *\n * @module\n */\nexport * from \"./math-accent-character\";\nexport * from \"./math-base\";\nexport * from \"./math-limit-location\";\nexport * from \"./math-n-ary-properties\";\nexport * from \"./math-sub-script\";\nexport * from \"./math-sum\";\nexport * from \"./math-integral\";\nexport * from \"./math-super-script\";\nexport * from \"./math-limit\";\nexport * from \"./math-limit-upper\";\nexport * from \"./math-limit-upper-properties\";\nexport * from \"./math-limit-lower\";\nexport * from \"./math-limit-low-properties\";\n","/**\n * Math Accent Properties module for Office MathML.\n *\n * This module provides properties for the math accent element.\n *\n * Reference: ISO/IEC 29500-4, shared-math.xsd, CT_AccPr\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math accent properties.\n */\nexport interface MathAccentPropertiesOptions {\n /**\n * Accent character (e.g., \"\\u0302\" for hat, \"\\u0303\" for tilde).\n *\n * Common accent characters:\n * - `\\u0302` - circumflex accent (hat): x̂\n * - `\\u0303` - tilde: x̃\n * - `\\u0307` - dot above: ẋ\n * - `\\u0308` - diaeresis (double dot): ẍ\n * - `\\u0304` - macron (bar): x̄\n * - `\\u0305` - overline: x̅\n * - `\\u20D7` - right arrow: x⃗\n * - `\\u030C` - caron (háček): x̌\n * - `\\u0306` - breve: x̆\n * - `\\u030A` - ring above: x̊\n */\n readonly accentCharacter: string;\n}\n\n/**\n * Creates math accent properties element (m:accPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_AccPr\">\n * <xsd:sequence>\n * <xsd:element name=\"chr\" type=\"CT_Char\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathAccentProperties = (options: MathAccentPropertiesOptions): XmlComponent =>\n new BuilderElement({\n children: [\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: { key: \"m:val\", value: options.accentCharacter },\n },\n name: \"m:chr\",\n }),\n ],\n name: \"m:accPr\",\n });\n","/**\n * Math Accent module for Office MathML.\n *\n * This module provides the math accent element (e.g., hat, tilde, dot).\n *\n * Reference: ISO/IEC 29500-4, shared-math.xsd, CT_Acc\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathAccentProperties } from \"./math-accent-properties\";\n\n/**\n * Options for creating a math accent element.\n */\nexport interface MathAccentOptions {\n /**\n * Accent character (e.g., \"\\u0302\" for hat, \"\\u0303\" for tilde, \"\\u0307\" for dot).\n * If not specified, defaults to hat accent.\n */\n readonly accentCharacter?: string;\n /** Content to place the accent over */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Creates a math accent element (m:acc).\n *\n * An accent places a symbol over (or under) the base expression,\n * such as hat (^), tilde (~), dot (.), arrow (→), etc.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Acc\">\n * <xsd:sequence>\n * <xsd:element name=\"accPr\" type=\"CT_AccPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Hat accent (default)\n * createMathAccent({ children: [new MathRun(\"x\")] });\n * // Tilde accent\n * createMathAccent({ accentCharacter: \"\\u0303\", children: [new MathRun(\"x\")] });\n * // Dot accent\n * createMathAccent({ accentCharacter: \"\\u0307\", children: [new MathRun(\"x\")] });\n * ```\n */\nexport const createMathAccent = ({\n accentCharacter,\n children,\n}: MathAccentOptions): XmlComponent => {\n const accentProps = accentCharacter ? [createMathAccentProperties({ accentCharacter })] : [];\n return new BuilderElement({\n children: [...accentProps, createMathBase({ children })],\n name: \"m:acc\",\n });\n};\n","/**\n * Math accent module exports.\n *\n * @module\n */\nexport * from \"./math-accent\";\nexport * from \"./math-accent-properties\";\n","/**\n * Math Bar Position module for Office MathML.\n *\n * This module provides the position property for bar structures.\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-m_pos-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating a bar position element.\n */\ninterface MathBarPosOptions {\n /** Position value: \"top\" for overline, \"bot\" for underline */\n readonly val: string;\n}\n\n/**\n * Creates a position element for bar structures.\n *\n * This element specifies whether the bar appears above (top) or below (bot)\n * the base expression.\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-m_pos-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TopBot\">\n * <xsd:attribute name=\"val\" type=\"ST_TopBot\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBarPos = ({ val }: MathBarPosOptions): XmlComponent =>\n new BuilderElement<MathBarPosOptions>({\n attributes: {\n val: { key: \"m:val\", value: val },\n },\n name: \"m:pos\",\n });\n","/**\n * Math Bar Properties module for Office MathML.\n *\n * This module provides properties for bar (overline/underline) structures in math equations.\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-m_barPr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { createMathBarPos } from \"./math-bar-pos\";\n\n/**\n * Creates properties for a math bar structure.\n *\n * This element specifies properties for the bar object,\n * primarily the position (top for overline, bottom for underline).\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-m_barPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_BarPr\">\n * <xsd:sequence>\n * <xsd:element name=\"pos\" type=\"CT_TopBot\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBarProperties = ({ type }: { readonly type: string }): XmlComponent =>\n new BuilderElement({\n children: [createMathBarPos({ val: type })],\n name: \"m:barPr\",\n });\n","/**\n * Math Bar module for Office MathML.\n *\n * This module provides the math bar (overline/underline) element.\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-m_bar-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBarProperties } from \"./math-bar-properties\";\n\n/**\n * Options for creating a math bar element.\n */\ninterface MathBarOptions {\n /** Position of the bar: \"top\" for overline, \"bot\" for underline */\n readonly type: \"top\" | \"bot\";\n /** Content under/over the bar */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Creates a math bar (overline or underline) element.\n *\n * Math bars are used for mathematical notation like vector symbols\n * (overline) or underlining expressions.\n *\n * Reference: https://www.datypic.com/sc/ooxml/e-m_bar-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Bar\">\n * <xsd:sequence>\n * <xsd:element name=\"barPr\" type=\"CT_BarPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBar = ({ type, children }: MathBarOptions): XmlComponent =>\n new BuilderElement({\n children: [createMathBarProperties({ type }), createMathBase({ children })],\n name: \"m:bar\",\n });\n","/**\n * Math bar module exports.\n *\n * @module\n */\nexport * from \"./math-bar\";\nexport * from \"./math-bar-properties\";\n","/**\n * Math Border Box Properties module for Office MathML.\n *\n * This module provides properties for the math border box element (CT_BorderBoxPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_borderBoxPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math border box properties.\n *\n * @see {@link createMathBorderBoxProperties}\n */\nexport interface MathBorderBoxPropertiesOptions {\n /** Hide top border */\n readonly hideTop?: boolean;\n /** Hide bottom border */\n readonly hideBottom?: boolean;\n /** Hide left border */\n readonly hideLeft?: boolean;\n /** Hide right border */\n readonly hideRight?: boolean;\n /** Horizontal strike-through */\n readonly strikeHorizontal?: boolean;\n /** Vertical strike-through */\n readonly strikeVertical?: boolean;\n /** Bottom-left to top-right diagonal strike */\n readonly strikeDiagonalUp?: boolean;\n /** Top-left to bottom-right diagonal strike */\n readonly strikeDiagonalDown?: boolean;\n}\n\n/**\n * Creates math border box properties element (m:borderBoxPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_BorderBoxPr\">\n * <xsd:sequence>\n * <xsd:element name=\"hideTop\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"hideBot\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"hideLeft\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"hideRight\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"strikeH\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"strikeV\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"strikeBLTR\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"strikeTLBR\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBorderBoxProperties = (\n options: MathBorderBoxPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.hideTop !== undefined) {\n children.push(onOffObj(\"m:hideTop\", options.hideTop));\n }\n if (options.hideBottom !== undefined) {\n children.push(onOffObj(\"m:hideBot\", options.hideBottom));\n }\n if (options.hideLeft !== undefined) {\n children.push(onOffObj(\"m:hideLeft\", options.hideLeft));\n }\n if (options.hideRight !== undefined) {\n children.push(onOffObj(\"m:hideRight\", options.hideRight));\n }\n if (options.strikeHorizontal !== undefined) {\n children.push(onOffObj(\"m:strikeH\", options.strikeHorizontal));\n }\n if (options.strikeVertical !== undefined) {\n children.push(onOffObj(\"m:strikeV\", options.strikeVertical));\n }\n if (options.strikeDiagonalUp !== undefined) {\n children.push(onOffObj(\"m:strikeBLTR\", options.strikeDiagonalUp));\n }\n if (options.strikeDiagonalDown !== undefined) {\n children.push(onOffObj(\"m:strikeTLBR\", options.strikeDiagonalDown));\n }\n\n return new BuilderElement({\n children,\n name: \"m:borderBoxPr\",\n });\n};\n","/**\n * Math Border Box module for Office MathML.\n *\n * This module provides the math border box element (m:borderBox) which\n * draws borders around math expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_borderBox-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBorderBoxProperties } from \"./math-border-box-properties\";\nimport type { MathBorderBoxPropertiesOptions } from \"./math-border-box-properties\";\n\n/**\n * Options for creating a math border box element.\n *\n * @see {@link MathBorderBox}\n */\nexport interface MathBorderBoxOptions {\n /** Border box properties */\n readonly properties?: MathBorderBoxPropertiesOptions;\n /** Content to be bordered */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Represents a math border box in a math equation.\n *\n * The border box element draws visible borders around math expressions,\n * with options to hide specific sides or add strike-through lines.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_borderBox-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_BorderBox\">\n * <xsd:sequence>\n * <xsd:element name=\"borderBoxPr\" type=\"CT_BorderBoxPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport class MathBorderBox extends XmlComponent {\n public constructor(options: MathBorderBoxOptions) {\n super(\"m:borderBox\");\n\n if (options.properties) {\n this.root.push(createMathBorderBoxProperties(options.properties));\n }\n\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math border box module exports.\n *\n * @module\n */\nexport * from \"./math-border-box\";\nexport * from \"./math-border-box-properties\";\n","/**\n * Math Box Properties module for Office MathML.\n *\n * This module provides properties for the math box element (CT_BoxPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_boxPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math box properties.\n *\n * @see {@link createMathBoxProperties}\n */\nexport interface MathBoxPropertiesOptions {\n /** Operator emulation */\n readonly opEmu?: boolean;\n /** No break */\n readonly noBreak?: boolean;\n /** Differential */\n readonly diff?: boolean;\n /** Alignment */\n readonly aln?: boolean;\n}\n\n/**\n * Creates math box properties element (m:boxPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_BoxPr\">\n * <xsd:sequence>\n * <xsd:element name=\"opEmu\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"noBreak\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"diff\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"brk\" type=\"CT_ManualBreak\" minOccurs=\"0\"/>\n * <xsd:element name=\"aln\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBoxProperties = (options: MathBoxPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.opEmu !== undefined) {\n children.push(onOffObj(\"m:opEmu\", options.opEmu));\n }\n if (options.noBreak !== undefined) {\n children.push(onOffObj(\"m:noBreak\", options.noBreak));\n }\n if (options.diff !== undefined) {\n children.push(onOffObj(\"m:diff\", options.diff));\n }\n if (options.aln !== undefined) {\n children.push(onOffObj(\"m:aln\", options.aln));\n }\n\n return new BuilderElement({\n children,\n name: \"m:boxPr\",\n });\n};\n","/**\n * Math Box module for Office MathML.\n *\n * This module provides the math box element (m:box) which groups\n * math expressions as a single entity.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_box-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBoxProperties } from \"./math-box-properties\";\nimport type { MathBoxPropertiesOptions } from \"./math-box-properties\";\n\n/**\n * Options for creating a math box element.\n *\n * @see {@link MathBox}\n */\nexport interface MathBoxOptions {\n /** Box properties */\n readonly properties?: MathBoxPropertiesOptions;\n /** Content to be boxed */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Represents a math box in a math equation.\n *\n * The box element groups math expressions as a single entity,\n * controlling line breaking, alignment, and other grouping behavior.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_box-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Box\">\n * <xsd:sequence>\n * <xsd:element name=\"boxPr\" type=\"CT_BoxPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport class MathBox extends XmlComponent {\n public constructor(options: MathBoxOptions) {\n super(\"m:box\");\n\n if (options.properties) {\n this.root.push(createMathBoxProperties(options.properties));\n }\n\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math box module exports.\n *\n * @module\n */\nexport * from \"./math-box\";\nexport * from \"./math-box-properties\";\n","/**\n * Math Beginning Character module for Office MathML.\n *\n * This module provides the beginning (opening) character for bracket delimiters.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_begChr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating a beginning character element.\n */\ninterface MathBeginningCharacterOptions {\n /** The opening bracket character */\n readonly character: string;\n}\n\n/**\n * Creates a beginning character element for bracket delimiters.\n *\n * This element specifies the opening/beginning character for a delimiter object,\n * such as \"(\", \"[\", \"{\", or \"⟨\".\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_begChr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Char\">\n * <xsd:attribute name=\"val\" type=\"ST_Char\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBeginningCharacter = ({\n character,\n}: MathBeginningCharacterOptions): XmlComponent =>\n new BuilderElement<MathBeginningCharacterOptions>({\n attributes: {\n character: { key: \"m:val\", value: character },\n },\n name: \"m:begChr\",\n });\n","/**\n * Math Ending Character module for Office MathML.\n *\n * This module provides the ending (closing) character for bracket delimiters.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_endChr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating an ending character element.\n */\ninterface MathEndingCharacterOptions {\n /** The closing bracket character */\n readonly character: string;\n}\n\n/**\n * Creates an ending character element for bracket delimiters.\n *\n * This element specifies the closing/ending character for a delimiter object,\n * such as \")\", \"]\", \"}\", or \"⟩\".\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_endChr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Char\">\n * <xsd:attribute name=\"val\" type=\"ST_Char\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createMathEndingCharacter = ({\n character,\n}: MathEndingCharacterOptions): XmlComponent =>\n new BuilderElement<MathEndingCharacterOptions>({\n attributes: {\n character: { key: \"m:val\", value: character },\n },\n name: \"m:endChr\",\n });\n","/**\n * Math Bracket Properties module for Office MathML.\n *\n * This module provides properties for bracket delimiters in math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_dPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport { createMathBeginningCharacter } from \"./math-beginning-character\";\nimport { createMathEndingCharacter } from \"./math-ending-char\";\n\n/**\n * Options for creating math bracket properties.\n *\n * @see {@link createMathBracketProperties}\n */\nexport interface MathBracketPropertiesOptions {\n /** Optional custom characters for bracket delimiters */\n readonly characters?: {\n /** The opening/beginning bracket character */\n readonly beginningCharacter: string;\n /** The closing/ending bracket character */\n readonly endingCharacter: string;\n };\n /** Separator character for multiple arguments */\n readonly separatorCharacter?: string;\n /** Whether the delimiters grow to match their content */\n readonly grow?: boolean;\n /** Delimiter shape: \"centered\" or \"match\" */\n readonly shape?: \"centered\" | \"match\";\n}\n\n/**\n * Creates bracket properties for math delimiter objects.\n *\n * This element specifies properties for the delimiter object,\n * including custom beginning and ending characters.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_dPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DPr\">\n * <xsd:sequence>\n * <xsd:element name=\"begChr\" type=\"CT_Char\" minOccurs=\"0\"/>\n * <xsd:element name=\"sepChr\" type=\"CT_Char\" minOccurs=\"0\"/>\n * <xsd:element name=\"endChr\" type=\"CT_Char\" minOccurs=\"0\"/>\n * <xsd:element name=\"grow\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"shp\" type=\"CT_Shp\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathBracketProperties = ({\n characters,\n separatorCharacter,\n grow,\n shape,\n}: MathBracketPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (characters) {\n children.push(createMathBeginningCharacter({ character: characters.beginningCharacter }));\n }\n if (separatorCharacter !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: separatorCharacter } },\n name: \"m:sepChr\",\n }),\n );\n }\n if (characters) {\n children.push(createMathEndingCharacter({ character: characters.endingCharacter }));\n }\n if (grow !== undefined) {\n children.push(onOffObj(\"m:grow\", grow));\n }\n if (shape !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: shape } },\n name: \"m:shp\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:dPr\",\n });\n};\n","/**\n * Math Round Brackets module for Office MathML.\n *\n * This module provides the MathRoundBrackets class for parentheses.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBracketProperties } from \"./math-bracket-properties\";\n\n/**\n * Represents round brackets (parentheses) in a math equation.\n *\n * MathRoundBrackets displays content surrounded by parentheses ( ).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_D\">\n * <xsd:sequence>\n * <xsd:element name=\"dPr\" type=\"CT_DPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new MathRoundBrackets({ children: [new MathRun(\"x + y\")] });\n * ```\n */\nexport class MathRoundBrackets extends XmlComponent {\n public constructor(options: { readonly children: readonly MathComponent[] }) {\n super(\"m:d\");\n\n this.root.push(createMathBracketProperties({}));\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math Square Brackets module for Office MathML.\n *\n * This module provides the MathSquareBrackets class for square brackets.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBracketProperties } from \"./math-bracket-properties\";\n\n/**\n * Represents square brackets in a math equation.\n *\n * MathSquareBrackets displays content surrounded by square brackets [ ].\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new MathSquareBrackets({ children: [new MathRun(\"x + y\")] });\n * ```\n */\nexport class MathSquareBrackets extends XmlComponent {\n public constructor(options: { readonly children: readonly MathComponent[] }) {\n super(\"m:d\");\n\n this.root.push(\n createMathBracketProperties({\n characters: {\n beginningCharacter: \"[\",\n endingCharacter: \"]\",\n },\n }),\n );\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math Curly Brackets module for Office MathML.\n *\n * This module provides the MathCurlyBrackets class for curly braces.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBracketProperties } from \"./math-bracket-properties\";\n\n/**\n * Represents curly braces in a math equation.\n *\n * MathCurlyBrackets displays content surrounded by curly braces { }.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new MathCurlyBrackets({ children: [new MathRun(\"x + y\")] });\n * ```\n */\nexport class MathCurlyBrackets extends XmlComponent {\n public constructor(options: { readonly children: readonly MathComponent[] }) {\n super(\"m:d\");\n\n this.root.push(\n createMathBracketProperties({\n characters: {\n beginningCharacter: \"{\",\n endingCharacter: \"}\",\n },\n }),\n );\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math Angled Brackets module for Office MathML.\n *\n * This module provides the MathAngledBrackets class for angle brackets.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathBracketProperties } from \"./math-bracket-properties\";\n\n/**\n * Options for MathAngledBrackets.\n */\ninterface MathAngledBracketsOptions {\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Represents angle brackets in a math equation.\n *\n * MathAngledBrackets displays content surrounded by angle brackets ⟨ ⟩.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_d-1.html\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new MathAngledBrackets({ children: [new MathRun(\"x, y\")] });\n * ```\n */\nexport class MathAngledBrackets extends XmlComponent {\n public constructor(options: MathAngledBracketsOptions) {\n super(\"m:d\");\n\n this.root.push(\n createMathBracketProperties({\n characters: {\n beginningCharacter: \"〈\",\n endingCharacter: \"〉\",\n },\n }),\n );\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math brackets module exports.\n *\n * @module\n */\nexport * from \"./math-round-brackets\";\nexport * from \"./math-square-brackets\";\nexport * from \"./math-curly-brackets\";\nexport * from \"./math-angled-brackets\";\n","/**\n * Math Equation Array Properties module for Office MathML.\n *\n * This module provides properties for the equation array element (CT_EqArrPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_eqArrPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math equation array properties.\n *\n * @see {@link createMathEqArrProperties}\n */\nexport interface MathEqArrPropertiesOptions {\n /** Base justification (vertical alignment) */\n readonly baseJc?: \"top\" | \"bot\" | \"center\";\n /** Maximum distance between equations */\n readonly maxDist?: boolean;\n /** Object distance */\n readonly objDist?: boolean;\n /** Row spacing rule */\n readonly rSpRule?: \"single\" | \"1.5\" | \"double\" | \"exactly\" | \"multiple\";\n /** Row spacing value */\n readonly rSp?: number;\n}\n\n/**\n * Creates math equation array properties element (m:eqArrPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EqArrPr\">\n * <xsd:sequence>\n * <xsd:element name=\"baseJc\" type=\"CT_YAlign\" minOccurs=\"0\"/>\n * <xsd:element name=\"maxDist\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"objDist\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"rSpRule\" type=\"CT_SpacingRule\" minOccurs=\"0\"/>\n * <xsd:element name=\"rSp\" type=\"CT_UnSignedInteger\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathEqArrProperties = (options: MathEqArrPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.baseJc !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.baseJc } },\n name: \"m:baseJc\",\n }),\n );\n }\n if (options.maxDist !== undefined) {\n children.push(onOffObj(\"m:maxDist\", options.maxDist));\n }\n if (options.objDist !== undefined) {\n children.push(onOffObj(\"m:objDist\", options.objDist));\n }\n if (options.rSpRule !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.rSpRule } },\n name: \"m:rSpRule\",\n }),\n );\n }\n if (options.rSp !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.rSp } },\n name: \"m:rSp\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:eqArrPr\",\n });\n};\n","/**\n * Math Equation Array module for Office MathML.\n *\n * This module provides the equation array element (m:eqArr) which\n * displays multiple equations stacked vertically.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_eqArr-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathEqArrProperties } from \"./math-eq-arr-properties\";\nimport type { MathEqArrPropertiesOptions } from \"./math-eq-arr-properties\";\n\n/**\n * Options for creating a math equation array element.\n *\n * @see {@link MathEqArr}\n */\nexport interface MathEqArrOptions {\n /** Equation array properties */\n readonly properties?: MathEqArrPropertiesOptions;\n /** Equations to stack (each row becomes an m:e element) */\n readonly rows: readonly (readonly MathComponent[])[];\n}\n\n/**\n * Represents a math equation array in a math equation.\n *\n * The equation array stacks multiple equations vertically with\n * configurable alignment and spacing.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_eqArr-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EqArr\">\n * <xsd:sequence>\n * <xsd:element name=\"eqArrPr\" type=\"CT_EqArrPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport class MathEqArr extends XmlComponent {\n public constructor(options: MathEqArrOptions) {\n super(\"m:eqArr\");\n\n if (options.properties) {\n this.root.push(createMathEqArrProperties(options.properties));\n }\n\n for (const row of options.rows) {\n this.root.push(createMathBase({ children: row }));\n }\n }\n}\n","/**\n * Math equation array module exports.\n *\n * @module\n */\nexport * from \"./math-eq-arr\";\nexport * from \"./math-eq-arr-properties\";\n","/**\n * Math Denominator module for Office MathML fractions.\n *\n * This module provides the denominator element for fractions.\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Represents the denominator (bottom part) of a fraction.\n *\n * @internal\n */\nexport class MathDenominator extends XmlComponent {\n public constructor(children: readonly MathComponent[]) {\n super(\"m:den\");\n\n for (const child of children) {\n this.root.push(child);\n }\n }\n}\n","/**\n * Math Fraction Properties module for Office MathML.\n *\n * This module provides properties for the math fraction element.\n *\n * Reference: ISO/IEC 29500-4, shared-math.xsd, CT_FPr\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Fraction type (how the fraction bar is displayed).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_FType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"bar\"/>\n * <xsd:enumeration value=\"skw\"/>\n * <xsd:enumeration value=\"lin\"/>\n * <xsd:enumeration value=\"noBar\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const FractionType = {\n /** Standard fraction with horizontal bar: a/b */\n BAR: \"bar\",\n /** Skewed fraction: a/b (diagonal) */\n SKEWED: \"skw\",\n /** Linear fraction: a/b (horizontal, no bar) */\n LINEAR: \"lin\",\n /** No bar fraction: a b (stacked, no bar) */\n NO_BAR: \"noBar\",\n} as const;\n\n/**\n * Options for math fraction properties.\n */\nexport interface MathFractionPropertiesOptions {\n /** Fraction type (bar, skewed, linear, or no bar) */\n readonly fractionType?: (typeof FractionType)[keyof typeof FractionType];\n}\n\n/**\n * Creates math fraction properties element (m:fPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FPr\">\n * <xsd:sequence>\n * <xsd:element name=\"type\" type=\"CT_FType\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathFractionProperties = (\n options: MathFractionPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.fractionType) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: { key: \"m:val\", value: options.fractionType },\n },\n name: \"m:type\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:fPr\",\n });\n};\n","/**\n * Math Numerator module for Office MathML fractions.\n *\n * This module provides the numerator element for fractions.\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Represents the numerator (top part) of a fraction.\n *\n * @internal\n */\nexport class MathNumerator extends XmlComponent {\n public constructor(children: readonly MathComponent[]) {\n super(\"m:num\");\n\n for (const child of children) {\n this.root.push(child);\n }\n }\n}\n","/**\n * Math Fraction module for Office MathML.\n *\n * This module provides the MathFraction class for fraction expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_f-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { MathDenominator } from \"./math-denominator\";\nimport { createMathFractionProperties } from \"./math-fraction-properties\";\nimport type { MathFractionPropertiesOptions } from \"./math-fraction-properties\";\nimport { MathNumerator } from \"./math-numerator\";\n\n/**\n * Options for creating a MathFraction.\n *\n * @see {@link MathFraction}\n */\nexport interface MathFractionOptions {\n /** Math components for the numerator (top) of the fraction */\n readonly numerator: readonly MathComponent[];\n /** Math components for the denominator (bottom) of the fraction */\n readonly denominator: readonly MathComponent[];\n /** Fraction type (bar, skewed, linear, or no bar) */\n readonly fractionType?: MathFractionPropertiesOptions[\"fractionType\"];\n}\n\n/**\n * Represents a fraction in a math equation.\n *\n * MathFraction displays a numerator over a denominator with a fraction bar.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_f-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_F\">\n * <xsd:sequence>\n * <xsd:element name=\"fPr\" type=\"CT_FPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"num\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"den\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new MathFraction({\n * numerator: [new MathRun(\"a + b\")],\n * denominator: [new MathRun(\"c\")],\n * });\n * ```\n */\nexport class MathFraction extends XmlComponent {\n public constructor(options: MathFractionOptions) {\n super(\"m:f\");\n\n if (options.fractionType) {\n this.root.push(createMathFractionProperties({ fractionType: options.fractionType }));\n }\n this.root.push(new MathNumerator(options.numerator));\n this.root.push(new MathDenominator(options.denominator));\n }\n}\n","/**\n * Math fraction module exports.\n *\n * @module\n */\nexport * from \"./math-fraction\";\nexport * from \"./math-fraction-properties\";\nexport * from \"./math-denominator\";\nexport * from \"./math-numerator\";\n","/**\n * Math Function Name module for Office MathML.\n *\n * This module provides the function name element for function structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_fName-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Represents a function name in a math equation.\n *\n * MathFunctionName contains the function name (e.g., sin, cos, log)\n * that appears before the function argument.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_fName-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathArg\">\n * <xsd:sequence>\n * <xsd:element name=\"argPr\" type=\"CT_OMathArgPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_OMathMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @internal\n */\nexport class MathFunctionName extends XmlComponent {\n public constructor(children: readonly MathComponent[]) {\n super(\"m:fName\");\n\n for (const child of children) {\n this.root.push(child);\n }\n }\n}\n","/**\n * Math Function Properties module for Office MathML.\n *\n * This module provides properties for function structures in math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_funcPr-1.html\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\nimport {\n createMathControlProperties,\n type MathControlPropertiesOptions,\n} from \"../math-control-properties\";\n\n/**\n * Options for math function properties.\n *\n * @see {@link createMathFunctionProperties}\n */\nexport interface MathFunctionPropertiesOptions {\n /** Control properties (tracking changes) */\n readonly controlProperties?: MathControlPropertiesOptions;\n}\n\n/**\n * Creates properties for a math function structure (m:funcPr).\n *\n * This element specifies properties for the function object,\n * such as function name alignment and spacing.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_funcPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FuncPr\">\n * <xsd:sequence>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathFunctionProperties = (\n options?: MathFunctionPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options?.controlProperties !== undefined) {\n children.push(createMathControlProperties(options.controlProperties));\n }\n\n return new BuilderElement({\n children,\n name: \"m:funcPr\",\n });\n};\n","/**\n * Math Function module for Office MathML.\n *\n * This module provides the MathFunction class for function expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_func-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { MathFunctionName } from \"./math-function-name\";\nimport {\n createMathFunctionProperties,\n type MathFunctionPropertiesOptions,\n} from \"./math-function-properties\";\n\n/**\n * Options for creating a MathFunction.\n *\n * @see {@link MathFunction}\n */\nexport interface MathFunctionOptions {\n /** Properties for the function structure */\n readonly properties?: MathFunctionPropertiesOptions;\n /** The function argument (e.g., the expression inside sin(...)) */\n readonly children: readonly MathComponent[];\n /** The function name (e.g., \"sin\", \"cos\", \"log\") */\n readonly name: readonly MathComponent[];\n}\n\n/**\n * Represents a mathematical function in a math equation.\n *\n * MathFunction displays a function name followed by its argument,\n * such as sin(x), cos(θ), or log(n).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_func-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Func\">\n * <xsd:sequence>\n * <xsd:element name=\"funcPr\" type=\"CT_FuncPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"fName\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // sin(x)\n * new MathFunction({\n * name: [new MathRun(\"sin\")],\n * children: [new MathRun(\"x\")],\n * });\n * ```\n */\nexport class MathFunction extends XmlComponent {\n public constructor(options: MathFunctionOptions) {\n super(\"m:func\");\n\n if (options.properties) {\n this.root.push(createMathFunctionProperties(options.properties));\n }\n\n this.root.push(new MathFunctionName(options.name));\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math function module exports.\n *\n * @module\n */\nexport * from \"./math-function\";\nexport * from \"./math-function-name\";\nexport * from \"./math-function-properties\";\n","/**\n * Math Group Character Properties module for Office MathML.\n *\n * This module provides properties for the group character element (CT_GroupChrPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_groupChrPr-1.html\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math group character properties.\n *\n * @see {@link createMathGroupChrProperties}\n */\nexport interface MathGroupChrPropertiesOptions {\n /** Character to display (e.g., \"\\u23DF\" for bottom curly bracket) */\n readonly chr?: string;\n /** Position of the character: \"top\" or \"bot\" */\n readonly pos?: \"top\" | \"bot\";\n /** Vertical justification: \"top\" or \"bot\" */\n readonly vertJc?: \"top\" | \"bot\";\n}\n\n/**\n * Creates math group character properties element (m:groupChrPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GroupChrPr\">\n * <xsd:sequence>\n * <xsd:element name=\"chr\" type=\"CT_Char\" minOccurs=\"0\"/>\n * <xsd:element name=\"pos\" type=\"CT_TopBot\" minOccurs=\"0\"/>\n * <xsd:element name=\"vertJc\" type=\"CT_TopBot\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathGroupChrProperties = (\n options: MathGroupChrPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.chr !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.chr } },\n name: \"m:chr\",\n }),\n );\n }\n if (options.pos !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.pos } },\n name: \"m:pos\",\n }),\n );\n }\n if (options.vertJc !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.vertJc } },\n name: \"m:vertJc\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:groupChrPr\",\n });\n};\n","/**\n * Math Group Character module for Office MathML.\n *\n * This module provides the group character element (m:groupChr) which\n * places a character (like brace or bracket) over or under an expression.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_groupChr-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathGroupChrProperties } from \"./math-group-chr-properties\";\nimport type { MathGroupChrPropertiesOptions } from \"./math-group-chr-properties\";\n\n/**\n * Options for creating a math group character element.\n *\n * @see {@link MathGroupChr}\n */\nexport interface MathGroupChrOptions {\n /** Group character properties */\n readonly properties?: MathGroupChrPropertiesOptions;\n /** Content under/over the group character */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Represents a math group character in a math equation.\n *\n * The group character places a character (such as a brace, bracket,\n * or arrow) over or under a math expression.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_groupChr-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GroupChr\">\n * <xsd:sequence>\n * <xsd:element name=\"groupChrPr\" type=\"CT_GroupChrPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport class MathGroupChr extends XmlComponent {\n public constructor(options: MathGroupChrOptions) {\n super(\"m:groupChr\");\n\n if (options.properties) {\n this.root.push(createMathGroupChrProperties(options.properties));\n }\n\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math group character module exports.\n *\n * @module\n */\nexport * from \"./math-group-chr\";\nexport * from \"./math-group-chr-properties\";\n","/**\n * Math Run Properties module for Office MathML.\n *\n * This module provides properties for math run elements (m:r).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_rPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Script type for math run properties.\n *\n * - \"roman\" - Roman script (default)\n * - \"script\" - Script (calligraphic)\n * - \"fraktur\" - Fraktur (Gothic)\n * - \"double-struck\" - Double-struck (blackboard bold)\n * - \"sans-serif\" - Sans-serif\n * - \"monospace\" - Monospace\n */\nexport type MathScriptType =\n | \"roman\"\n | \"script\"\n | \"fraktur\"\n | \"double-struck\"\n | \"sans-serif\"\n | \"monospace\";\n\n/**\n * Style type for math run properties.\n *\n * - \"p\" - Plain (normal)\n * - \"b\" - Bold\n * - \"i\" - Italic\n * - \"bi\" - Bold italic\n */\nexport type MathStyleType = \"p\" | \"b\" | \"i\" | \"bi\";\n\n/**\n * Options for math run properties.\n *\n * @see {@link createMathRunProperties}\n */\nexport interface MathRunPropertiesOptions {\n /** Whether the text is displayed in literal form */\n readonly lit?: boolean;\n /** Use normal text rendering instead of math italic */\n readonly normal?: boolean;\n /** Script type for the text */\n readonly script?: MathScriptType;\n /** Style type for the text */\n readonly style?: MathStyleType;\n /** Alignment point for manual break (1-255) */\n readonly breakAlignment?: number;\n /** Whether the text is aligned */\n readonly align?: boolean;\n}\n\n/**\n * Creates properties for a math run element (m:rPr).\n *\n * This element specifies run properties for math text,\n * including script style, literal rendering, and alignment.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_rPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RPR\">\n * <xsd:sequence>\n * <xsd:element name=\"lit\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:choice>\n * <xsd:element name=\"nor\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ScriptStyle\"/> <!-- scr + sty -->\n * </xsd:sequence>\n * </xsd:choice>\n * <xsd:element name=\"brk\" type=\"CT_ManualBreak\" minOccurs=\"0\"/>\n * <xsd:element name=\"aln\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathRunProperties = (options: MathRunPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.lit !== undefined) {\n children.push(onOffObj(\"m:lit\", options.lit));\n }\n\n if (options.normal !== undefined) {\n children.push(onOffObj(\"m:nor\", options.normal));\n } else if (options.script !== undefined || options.style !== undefined) {\n if (options.script !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.script } },\n name: \"m:scr\",\n }),\n );\n }\n if (options.style !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.style } },\n name: \"m:sty\",\n }),\n );\n }\n }\n\n if (options.breakAlignment !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { alnAt: { key: \"m:alnAt\", value: options.breakAlignment.toString() } },\n name: \"m:brk\",\n }),\n );\n }\n\n if (options.align !== undefined) {\n children.push(onOffObj(\"m:aln\", options.align));\n }\n\n return new BuilderElement({\n children,\n name: \"m:rPr\",\n });\n};\n","/**\n * Math Text module for Office MathML.\n *\n * This module provides the MathText class for text content within math runs.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_t-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents text content within a math run.\n *\n * MathText is the leaf element containing actual text characters\n * within a MathRun. It corresponds to the `<m:t>` element.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_t-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Text\">\n * <xsd:simpleContent>\n * <xsd:extension base=\"s:ST_String\">\n * <xsd:attribute ref=\"xml:space\" use=\"optional\"/>\n * </xsd:extension>\n * </xsd:simpleContent>\n * </xsd:complexType>\n * ```\n */\nexport class MathText extends XmlComponent {\n public constructor(text: string) {\n super(\"m:t\");\n\n this.root.push(text);\n }\n}\n","/**\n * Math Run module for Office MathML.\n *\n * This module provides the MathRun class for text content within math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_r-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { createMathRunProperties, type MathRunPropertiesOptions } from \"./math-run-properties\";\nimport { MathText } from \"./math-text\";\n\n/**\n * Options for creating a math run.\n *\n * @see {@link MathRun}\n */\nexport interface MathRunOptions {\n /** The text content */\n readonly text: string;\n /** Optional run properties */\n readonly properties?: MathRunPropertiesOptions;\n}\n\n/**\n * Represents a run of text within a math equation.\n *\n * MathRun is the container for text content in Office MathML,\n * similar to how Run contains text in regular paragraphs.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_r-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_R\">\n * <xsd:sequence>\n * <xsd:element name=\"rPr\" type=\"CT_RPR\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_ScriptStyle\" minOccurs=\"0\"/>\n * <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n * <xsd:element ref=\"w:br\"/>\n * <xsd:element name=\"t\" type=\"CT_Text\"/>\n * </xsd:choice>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple text\n * new MathRun(\"x + y\");\n *\n * // With properties\n * new MathRun({ text: \"x\", properties: { script: \"fraktur\", style: \"b\" } });\n * ```\n */\nexport class MathRun extends XmlComponent {\n public constructor(textOrOptions: string | MathRunOptions) {\n super(\"m:r\");\n\n const options = typeof textOrOptions === \"string\" ? { text: textOrOptions } : textOrOptions;\n\n if (options.properties) {\n this.root.push(createMathRunProperties(options.properties));\n }\n\n this.root.push(new MathText(options.text));\n }\n}\n","/**\n * Math Matrix Properties module for Office MathML.\n *\n * This module provides properties for the matrix element (CT_MPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_mPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math matrix properties.\n *\n * @see {@link createMathMatrixProperties}\n */\nexport interface MathMatrixPropertiesOptions {\n /** Base justification (vertical alignment of cells) */\n readonly baseJc?: \"top\" | \"bot\" | \"center\";\n /** Hide place holders */\n readonly plcHide?: boolean;\n /** Row spacing rule */\n readonly rSpRule?: \"single\" | \"1.5\" | \"double\" | \"exactly\" | \"multiple\";\n /** Column gap rule */\n readonly cGpRule?: \"single\" | \"1.5\" | \"double\" | \"exactly\" | \"multiple\";\n /** Row spacing */\n readonly rSp?: number;\n /** Column spacing */\n readonly cSp?: number;\n /** Column group spacing */\n readonly cGp?: number;\n}\n\n/**\n * Creates math matrix properties element (m:mPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_MPr\">\n * <xsd:sequence>\n * <xsd:element name=\"baseJc\" type=\"CT_YAlign\" minOccurs=\"0\"/>\n * <xsd:element name=\"plcHide\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"rSpRule\" type=\"CT_SpacingRule\" minOccurs=\"0\"/>\n * <xsd:element name=\"cGpRule\" type=\"CT_SpacingRule\" minOccurs=\"0\"/>\n * <xsd:element name=\"rSp\" type=\"CT_UnSignedInteger\" minOccurs=\"0\"/>\n * <xsd:element name=\"cSp\" type=\"CT_UnSignedInteger\" minOccurs=\"0\"/>\n * <xsd:element name=\"cGp\" type=\"CT_UnSignedInteger\" minOccurs=\"0\"/>\n * <xsd:element name=\"mcs\" type=\"CT_MCS\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathMatrixProperties = (options: MathMatrixPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.baseJc !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.baseJc } },\n name: \"m:baseJc\",\n }),\n );\n }\n if (options.plcHide !== undefined) {\n children.push(onOffObj(\"m:plcHide\", options.plcHide));\n }\n if (options.rSpRule !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.rSpRule } },\n name: \"m:rSpRule\",\n }),\n );\n }\n if (options.cGpRule !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.cGpRule } },\n name: \"m:cGpRule\",\n }),\n );\n }\n if (options.rSp !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.rSp } },\n name: \"m:rSp\",\n }),\n );\n }\n if (options.cSp !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.cSp } },\n name: \"m:cSp\",\n }),\n );\n }\n if (options.cGp !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.cGp } },\n name: \"m:cGp\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:mPr\",\n });\n};\n","/**\n * Math Matrix module for Office MathML.\n *\n * This module provides the matrix element (m:m) for displaying\n * mathematical matrices.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_m-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathMatrixProperties } from \"./math-matrix-properties\";\nimport type { MathMatrixPropertiesOptions } from \"./math-matrix-properties\";\n\n/**\n * Options for creating a math matrix element.\n *\n * @see {@link MathMatrix}\n */\nexport interface MathMatrixOptions {\n /** Matrix properties */\n readonly properties?: MathMatrixPropertiesOptions;\n /** Matrix rows (each row is an array of math components) */\n readonly rows: readonly (readonly MathComponent[])[];\n}\n\n/**\n * Represents a math matrix in a math equation.\n *\n * The matrix element displays a grid of math expressions arranged\n * in rows and columns.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_m-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_M\">\n * <xsd:sequence>\n * <xsd:element name=\"mPr\" type=\"CT_MPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"mr\" type=\"CT_MR\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport class MathMatrix extends XmlComponent {\n public constructor(options: MathMatrixOptions) {\n super(\"m:m\");\n\n if (options.properties) {\n this.root.push(createMathMatrixProperties(options.properties));\n }\n\n for (const row of options.rows) {\n this.root.push(\n new BuilderElement({\n children: row.map((cell) =>\n createMathBase({ children: Array.isArray(cell) ? cell : [cell] }),\n ),\n name: \"m:mr\",\n }),\n );\n }\n }\n}\n","/**\n * Math Phantom Properties module for Office MathML.\n *\n * This module provides properties for the phantom element (CT_PhantPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_phantPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math phantom properties.\n *\n * @see {@link createMathPhantProperties}\n */\nexport interface MathPhantPropertiesOptions {\n /** Show the phantom content */\n readonly show?: boolean;\n /** Zero width */\n readonly zeroWid?: boolean;\n /** Zero ascent */\n readonly zeroAsc?: boolean;\n /** Zero descent */\n readonly zeroDesc?: boolean;\n /** Transparent */\n readonly transp?: boolean;\n}\n\n/**\n * Creates math phantom properties element (m:phantPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PhantPr\">\n * <xsd:sequence>\n * <xsd:element name=\"show\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"zeroWid\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"zeroAsc\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"zeroDesc\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"transp\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathPhantProperties = (options: MathPhantPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.show !== undefined) {\n children.push(onOffObj(\"m:show\", options.show));\n }\n if (options.zeroWid !== undefined) {\n children.push(onOffObj(\"m:zeroWid\", options.zeroWid));\n }\n if (options.zeroAsc !== undefined) {\n children.push(onOffObj(\"m:zeroAsc\", options.zeroAsc));\n }\n if (options.zeroDesc !== undefined) {\n children.push(onOffObj(\"m:zeroDesc\", options.zeroDesc));\n }\n if (options.transp !== undefined) {\n children.push(onOffObj(\"m:transp\", options.transp));\n }\n\n return new BuilderElement({\n children,\n name: \"m:phantPr\",\n });\n};\n","/**\n * Math Phantom module for Office MathML.\n *\n * This module provides the phantom element (m:phant) which makes\n * content invisible while preserving spacing.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_phant-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { createMathPhantProperties } from \"./math-phant-properties\";\nimport type { MathPhantPropertiesOptions } from \"./math-phant-properties\";\n\n/**\n * Options for creating a math phantom element.\n *\n * @see {@link MathPhant}\n */\nexport interface MathPhantOptions {\n /** Phantom properties */\n readonly properties?: MathPhantPropertiesOptions;\n /** Content to be made invisible */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Represents a math phantom in a math equation.\n *\n * The phantom element makes its content invisible while preserving\n * the spacing the content would normally occupy.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_phant-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Phant\">\n * <xsd:sequence>\n * <xsd:element name=\"phantPr\" type=\"CT_PhantPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport class MathPhant extends XmlComponent {\n public constructor(options: MathPhantOptions) {\n super(\"m:phant\");\n\n if (options.properties) {\n this.root.push(createMathPhantProperties(options.properties));\n }\n\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math Degree module for Office MathML.\n *\n * This module provides the degree element for radical structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_deg-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\n\n/**\n * Represents the degree of a radical (root) in a math equation.\n *\n * MathDegree specifies the degree of the root, such as 3 for cube root.\n * For square roots, this element is typically hidden.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_deg-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathArg\">\n * <xsd:sequence>\n * <xsd:element name=\"argPr\" type=\"CT_OMathArgPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_OMathMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @internal\n */\nexport class MathDegree extends XmlComponent {\n public constructor(children?: readonly MathComponent[]) {\n super(\"m:deg\");\n\n if (children) {\n for (const child of children) {\n this.root.push(child);\n }\n }\n }\n}\n","/**\n * Math Degree Hide module for Office MathML.\n *\n * This module provides the element to hide the degree in radical structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_degHide-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a property to hide the degree in a radical.\n *\n * MathDegreeHide is used in radical properties to hide the degree,\n * typically for square roots where the degree (2) is not displayed.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_degHide-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OnOff\">\n * <xsd:attribute name=\"val\" type=\"ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n *\n * @internal\n */\nexport class MathDegreeHide extends XmlComponent {\n public constructor() {\n super(\"m:degHide\");\n\n this.root.push({ _attr: { \"m:val\": 1 } });\n }\n}\n","/**\n * Math Radical Properties module for Office MathML.\n *\n * This module provides properties for radical (root) structures in math equations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_radPr-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { MathDegreeHide } from \"./math-degree-hide\";\n\n/**\n * Represents properties for a radical structure.\n *\n * This element specifies properties for the radical object,\n * such as whether to hide the degree (for square roots).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_radPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RadPr\">\n * <xsd:sequence>\n * <xsd:element name=\"degHide\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @internal\n */\nexport class MathRadicalProperties extends XmlComponent {\n public constructor(hasDegree: boolean) {\n super(\"m:radPr\");\n\n if (!hasDegree) {\n this.root.push(new MathDegreeHide());\n }\n }\n}\n","/**\n * Math Radical module for Office MathML.\n *\n * This module provides the MathRadical class for radical (root) expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_rad-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../math-component\";\nimport { createMathBase } from \"../n-ary\";\nimport { MathDegree } from \"./math-degree\";\nimport { MathRadicalProperties } from \"./math-radical-properties\";\n\n/**\n * Options for creating a MathRadical.\n *\n * @see {@link MathRadical}\n */\nexport interface MathRadicalOptions {\n /** The content under the radical sign */\n readonly children: readonly MathComponent[];\n /** Optional degree of the root (e.g., 3 for cube root). If omitted, square root is assumed. */\n readonly degree?: readonly MathComponent[];\n}\n\n/**\n * Represents a radical (root) expression in a math equation.\n *\n * MathRadical displays a radical symbol (√) with optional degree for\n * n-th roots (cube root, fourth root, etc.).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_rad-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Rad\">\n * <xsd:sequence>\n * <xsd:element name=\"radPr\" type=\"CT_RadPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"deg\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Square root of x\n * new MathRadical({ children: [new MathRun(\"x\")] });\n *\n * // Cube root of x\n * new MathRadical({\n * children: [new MathRun(\"x\")],\n * degree: [new MathRun(\"3\")],\n * });\n * ```\n */\nexport class MathRadical extends XmlComponent {\n public constructor(options: MathRadicalOptions) {\n super(\"m:rad\");\n\n this.root.push(new MathRadicalProperties(Boolean(options.degree)));\n this.root.push(new MathDegree(options.degree));\n this.root.push(createMathBase({ children: options.children }));\n }\n}\n","/**\n * Math SuperScript Properties module for Office MathML.\n *\n * This module provides properties for superscript structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSupPr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates properties for a superscript structure.\n *\n * This element specifies properties for the superscript object.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSupPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SSupPr\">\n * <xsd:sequence>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSuperScriptProperties = (): XmlComponent =>\n new BuilderElement({\n name: \"m:sSupPr\",\n });\n","/**\n * Math SuperScript module for Office MathML.\n *\n * This module provides the MathSuperScript class for superscript expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSup-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../../math-component\";\nimport { createMathBase, createMathSuperScriptElement } from \"../../n-ary\";\nimport { createMathSuperScriptProperties } from \"./math-super-script-function-properties\";\n\n/**\n * Options for creating a MathSuperScript.\n *\n * @see {@link MathSuperScript}\n */\nexport interface MathSuperScriptOptions {\n /** The base expression */\n readonly children: readonly MathComponent[];\n /** The superscript (exponent) expression */\n readonly superScript: readonly MathComponent[];\n}\n\n/**\n * Represents a superscript expression in a math equation.\n *\n * MathSuperScript displays a base with an exponent, like x².\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSup-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SSup\">\n * <xsd:sequence>\n * <xsd:element name=\"sSupPr\" type=\"CT_SSupPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sup\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // x squared\n * new MathSuperScript({\n * children: [new MathRun(\"x\")],\n * superScript: [new MathRun(\"2\")],\n * });\n * ```\n */\nexport class MathSuperScript extends XmlComponent {\n public constructor(options: MathSuperScriptOptions) {\n super(\"m:sSup\");\n\n this.root.push(createMathSuperScriptProperties());\n this.root.push(createMathBase({ children: options.children }));\n this.root.push(createMathSuperScriptElement({ children: options.superScript }));\n }\n}\n","/**\n * Math super-script module exports.\n *\n * @module\n */\nexport * from \"./math-super-script-function\";\nexport * from \"./math-super-script-function-properties\";\n","/**\n * Math SubScript Properties module for Office MathML.\n *\n * This module provides properties for subscript structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSubPr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates properties for a subscript structure.\n *\n * This element specifies properties for the subscript object.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSubPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SSubPr\">\n * <xsd:sequence>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSubScriptProperties = (): XmlComponent =>\n new BuilderElement({\n name: \"m:sSubPr\",\n });\n","/**\n * Math SubScript module for Office MathML.\n *\n * This module provides the MathSubScript class for subscript expressions.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSub-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../../math-component\";\nimport { createMathBase, createMathSubScriptElement } from \"../../n-ary\";\nimport { createMathSubScriptProperties } from \"./math-sub-script-function-properties\";\n\n/**\n * Options for creating a MathSubScript.\n *\n * @see {@link MathSubScript}\n */\nexport interface MathSubScriptOptions {\n /** The base expression */\n readonly children: readonly MathComponent[];\n /** The subscript expression */\n readonly subScript: readonly MathComponent[];\n}\n\n/**\n * Represents a subscript expression in a math equation.\n *\n * MathSubScript displays a base with a subscript, like x₁.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSub-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SSub\">\n * <xsd:sequence>\n * <xsd:element name=\"sSubPr\" type=\"CT_SSubPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sub\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // x with subscript 1\n * new MathSubScript({\n * children: [new MathRun(\"x\")],\n * subScript: [new MathRun(\"1\")],\n * });\n * ```\n */\nexport class MathSubScript extends XmlComponent {\n public constructor(options: MathSubScriptOptions) {\n super(\"m:sSub\");\n\n this.root.push(createMathSubScriptProperties());\n this.root.push(createMathBase({ children: options.children }));\n this.root.push(createMathSubScriptElement({ children: options.subScript }));\n }\n}\n","/**\n * Math sub-script module exports.\n *\n * @module\n */\nexport * from \"./math-sub-script-function\";\nexport * from \"./math-sub-script-function-properties\";\n","/**\n * Math Sub-Super-Script Properties module for Office MathML.\n *\n * This module provides properties for combined subscript and superscript structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSubSupPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for math sub-super-script properties.\n *\n * @see {@link createMathSubSuperScriptProperties}\n */\nexport interface MathSubSuperScriptPropertiesOptions {\n /** Align scripts to the same vertical position */\n readonly alignScripts?: boolean;\n}\n\n/**\n * Creates properties for a combined subscript and superscript structure.\n *\n * This element specifies properties for the subscript-superscript object.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSubSupPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SSubSupPr\">\n * <xsd:sequence>\n * <xsd:element name=\"alnScr\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathSubSuperScriptProperties = (\n options?: MathSubSuperScriptPropertiesOptions,\n): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options?.alignScripts !== undefined) {\n children.push(onOffObj(\"m:alnScr\", options.alignScripts));\n }\n\n return new BuilderElement({\n children,\n name: \"m:sSubSupPr\",\n });\n};\n","/**\n * Math SubSuperScript module for Office MathML.\n *\n * This module provides the MathSubSuperScript class for combined subscript/superscript.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSubSup-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../../math-component\";\nimport {\n createMathBase,\n createMathSubScriptElement,\n createMathSuperScriptElement,\n} from \"../../n-ary\";\nimport { createMathSubSuperScriptProperties } from \"./math-sub-super-script-function-properties\";\n\n/**\n * Options for creating a MathSubSuperScript.\n *\n * @see {@link MathSubSuperScript}\n */\nexport interface MathSubSuperScriptOptions {\n /** The base expression */\n readonly children: readonly MathComponent[];\n /** The subscript expression */\n readonly subScript: readonly MathComponent[];\n /** The superscript expression */\n readonly superScript: readonly MathComponent[];\n}\n\n/**\n * Represents a combined subscript and superscript expression in a math equation.\n *\n * MathSubSuperScript displays a base with both a subscript and superscript,\n * commonly used for tensor notation or indexed variables with exponents.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sSubSup-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SSubSup\">\n * <xsd:sequence>\n * <xsd:element name=\"sSubSupPr\" type=\"CT_SSubSupPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sub\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sup\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // x with subscript i and superscript 2\n * new MathSubSuperScript({\n * children: [new MathRun(\"x\")],\n * subScript: [new MathRun(\"i\")],\n * superScript: [new MathRun(\"2\")],\n * });\n * ```\n */\nexport class MathSubSuperScript extends XmlComponent {\n public constructor(options: MathSubSuperScriptOptions) {\n super(\"m:sSubSup\");\n\n this.root.push(createMathSubSuperScriptProperties());\n this.root.push(createMathBase({ children: options.children }));\n this.root.push(createMathSubScriptElement({ children: options.subScript }));\n this.root.push(createMathSuperScriptElement({ children: options.superScript }));\n }\n}\n","/**\n * Math sub-super-script module exports.\n *\n * @module\n */\nexport * from \"./math-sub-super-script-function\";\nexport * from \"./math-sub-super-script-function-properties\";\n","/**\n * Math Pre-Sub-Super-Script Properties module for Office MathML.\n *\n * This module provides properties for pre-script structures.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sPrePr-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates properties for a pre-subscript and pre-superscript structure.\n *\n * This element specifies properties for the pre-script object.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sPrePr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SPrePr\">\n * <xsd:sequence>\n * <xsd:element name=\"ctrlPr\" type=\"CT_CtrlPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathPreSubSuperScriptProperties = (): XmlComponent =>\n new BuilderElement({\n name: \"m:sPrePr\",\n });\n","/**\n * Math Pre-Sub-Super-Script module for Office MathML.\n *\n * This module provides pre-scripts with both subscript and superscript,\n * where the scripts appear before (to the left of) the base.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sPre-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"../../math-component\";\nimport {\n createMathBase,\n createMathSubScriptElement,\n createMathSuperScriptElement,\n} from \"../../n-ary\";\nimport { createMathPreSubSuperScriptProperties } from \"./math-pre-sub-super-script-function-properties\";\n\n/**\n * Options for creating a MathPreSubSuperScript.\n *\n * @see {@link MathPreSubSuperScript}\n */\nexport interface MathPreSubSuperScriptOptions {\n /** The base expression */\n readonly children: readonly MathComponent[];\n /** The pre-subscript expression (appears lower-left of base) */\n readonly subScript: readonly MathComponent[];\n /** The pre-superscript expression (appears upper-left of base) */\n readonly superScript: readonly MathComponent[];\n}\n\n/**\n * Represents a pre-subscript and pre-superscript expression in a math equation.\n *\n * MathPreSubSuperScript displays a base with both subscript and superscript\n * positioned before (to the left of) the base, commonly used in tensor notation.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_sPre-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SPre\">\n * <xsd:sequence>\n * <xsd:element name=\"sPrePr\" type=\"CT_SPrePr\" minOccurs=\"0\"/>\n * <xsd:element name=\"sub\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"sup\" type=\"CT_OMathArg\"/>\n * <xsd:element name=\"e\" type=\"CT_OMathArg\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Pre-scripts for tensor notation\n * new MathPreSubSuperScript({\n * children: [new MathRun(\"T\")],\n * subScript: [new MathRun(\"i\")],\n * superScript: [new MathRun(\"j\")],\n * });\n * ```\n */\nexport class MathPreSubSuperScript extends BuilderElement {\n public constructor({ children, subScript, superScript }: MathPreSubSuperScriptOptions) {\n super({\n children: [\n createMathPreSubSuperScriptProperties(),\n createMathSubScriptElement({ children: subScript }),\n createMathSuperScriptElement({ children: superScript }),\n createMathBase({ children: children }),\n ],\n name: \"m:sPre\",\n });\n }\n}\n","/**\n * Math pre-sub-super-script module exports.\n *\n * @module\n */\nexport * from \"./math-pre-sub-super-script-function\";\nexport * from \"./math-pre-sub-super-script-function-properties\";\n","/**\n * Math script module exports.\n *\n * @module\n */\nexport * from \"./super-script\";\nexport * from \"./sub-script\";\nexport * from \"./sub-super-script\";\nexport * from \"./pre-sub-super-script\";\n","/**\n * JSON API types and coercion for math components.\n *\n * Provides a recursive JSON representation of math components and a coercion\n * function that converts JSON objects to class instances.\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { createMathAccent } from \"./accent/math-accent\";\nimport { createMathBar } from \"./bar/math-bar\";\nimport { MathBorderBox } from \"./border-box/math-border-box\";\nimport type { MathBorderBoxPropertiesOptions } from \"./border-box/math-border-box-properties\";\nimport { MathBox } from \"./box/math-box\";\nimport type { MathBoxPropertiesOptions } from \"./box/math-box-properties\";\nimport {\n MathAngledBrackets,\n MathCurlyBrackets,\n MathRoundBrackets,\n MathSquareBrackets,\n} from \"./brackets\";\nimport { MathEqArr } from \"./eq-arr/math-eq-arr\";\nimport type { MathEqArrPropertiesOptions } from \"./eq-arr/math-eq-arr-properties\";\nimport { MathFraction } from \"./fraction/math-fraction\";\nimport type { FractionType } from \"./fraction/math-fraction-properties\";\nimport { MathFunction } from \"./function/math-function\";\nimport type { MathFunctionPropertiesOptions } from \"./function/math-function-properties\";\nimport { MathGroupChr } from \"./group-chr/math-group-chr\";\nimport type { MathGroupChrPropertiesOptions } from \"./group-chr/math-group-chr-properties\";\nimport type { MathComponent } from \"./math-component\";\nimport { MathRun } from \"./math-run\";\nimport type { MathRunPropertiesOptions } from \"./math-run-properties\";\nimport { MathMatrix } from \"./matrix/math-matrix\";\nimport type { MathMatrixPropertiesOptions } from \"./matrix/math-matrix-properties\";\nimport { MathIntegral, MathLimitLower, MathLimitUpper, MathSum } from \"./n-ary\";\nimport type { MathLimitLowPropertiesOptions } from \"./n-ary/math-limit-low-properties\";\nimport type { MathLimitUpperPropertiesOptions } from \"./n-ary/math-limit-upper-properties\";\nimport { MathPhant } from \"./phant/math-phant\";\nimport type { MathPhantPropertiesOptions } from \"./phant/math-phant-properties\";\nimport { MathRadical } from \"./radical/math-radical\";\nimport { MathSubScript, MathSubSuperScript, MathSuperScript } from \"./script\";\n\n/**\n * Recursive JSON representation of math components.\n *\n * Each discriminated union member uses a unique key name to identify the component type.\n * Supports mixing JSON objects with class instances.\n *\n * @example\n * ```typescript\n * const children: MathJson[] = [\n * \"x\", // MathRun shorthand\n * { fraction: { numerator: [\"a\"], denominator: [\"b\"] } }, // Fraction\n * { superScript: { children: [\"x\"], superScript: [\"2\"] } }, // x²\n * ];\n * ```\n */\nexport type MathJson =\n | MathComponent\n | string\n | { readonly text: string; readonly properties?: MathRunPropertiesOptions }\n | {\n readonly fraction: {\n readonly numerator: readonly MathJson[];\n readonly denominator: readonly MathJson[];\n readonly fractionType?: (typeof FractionType)[keyof typeof FractionType];\n };\n }\n | {\n readonly superScript: {\n readonly children: readonly MathJson[];\n readonly superScript: readonly MathJson[];\n };\n }\n | {\n readonly subScript: {\n readonly children: readonly MathJson[];\n readonly subScript: readonly MathJson[];\n };\n }\n | {\n readonly subSuperScript: {\n readonly children: readonly MathJson[];\n readonly subScript: readonly MathJson[];\n readonly superScript: readonly MathJson[];\n };\n }\n | {\n readonly radical: {\n readonly children: readonly MathJson[];\n readonly degree?: readonly MathJson[];\n };\n }\n | {\n readonly sum: {\n readonly children: readonly MathJson[];\n readonly subScript?: readonly MathJson[];\n readonly superScript?: readonly MathJson[];\n };\n }\n | {\n readonly integral: {\n readonly children: readonly MathJson[];\n readonly subScript?: readonly MathJson[];\n readonly superScript?: readonly MathJson[];\n };\n }\n | {\n readonly limitLower: {\n readonly children: readonly MathJson[];\n readonly limit: readonly MathJson[];\n readonly properties?: MathLimitLowPropertiesOptions;\n };\n }\n | {\n readonly limitUpper: {\n readonly children: readonly MathJson[];\n readonly limit: readonly MathJson[];\n readonly properties?: MathLimitUpperPropertiesOptions;\n };\n }\n | {\n readonly function: {\n readonly children: readonly MathJson[];\n readonly name: readonly MathJson[];\n readonly properties?: MathFunctionPropertiesOptions;\n };\n }\n | {\n readonly matrix: {\n readonly rows: readonly (readonly MathJson[])[];\n readonly properties?: MathMatrixPropertiesOptions;\n };\n }\n | { readonly roundBrackets: readonly MathJson[] | { readonly children: readonly MathJson[] } }\n | { readonly curlyBrackets: readonly MathJson[] | { readonly children: readonly MathJson[] } }\n | { readonly angledBrackets: readonly MathJson[] | { readonly children: readonly MathJson[] } }\n | { readonly squareBrackets: readonly MathJson[] | { readonly children: readonly MathJson[] } }\n | {\n readonly borderBox: {\n readonly children: readonly MathJson[];\n readonly properties?: MathBorderBoxPropertiesOptions;\n };\n }\n | {\n readonly box: {\n readonly children: readonly MathJson[];\n readonly properties?: MathBoxPropertiesOptions;\n };\n }\n | {\n readonly groupChr: {\n readonly children: readonly MathJson[];\n readonly properties?: MathGroupChrPropertiesOptions;\n };\n }\n | {\n readonly phant: {\n readonly children: readonly MathJson[];\n readonly properties?: MathPhantPropertiesOptions;\n };\n }\n | {\n readonly eqArr: {\n readonly rows: readonly (readonly MathJson[])[];\n readonly properties?: MathEqArrPropertiesOptions;\n };\n }\n | {\n readonly accent: {\n readonly children: readonly MathJson[];\n readonly accentCharacter?: string;\n };\n }\n | {\n readonly bar: {\n readonly children: readonly MathJson[];\n readonly type: \"top\" | \"bot\";\n };\n };\n\n/** Coerce an array of MathJson values to MathComponent instances. */\nfunction coerceArray(items: readonly MathJson[] | undefined): readonly MathComponent[] {\n if (!items) return [];\n return items.map((v) => coerceMathJson(v)) as readonly MathComponent[];\n}\n\n/** Coerce bracket shorthand to children array. */\nfunction bracketChildren(\n v: readonly MathJson[] | { readonly children: readonly MathJson[] },\n): readonly MathComponent[] {\n if (Array.isArray(v)) return coerceArray(v);\n return coerceArray((v as { readonly children: readonly MathJson[] }).children);\n}\n\n/**\n * Coerce a MathJson value to an XmlComponent instance.\n *\n * Handles string → MathRun, class instances pass-through, and recursive\n * conversion of all discriminated JSON object types.\n */\nexport function coerceMathJson(value: MathJson): XmlComponent {\n // String → MathRun\n if (typeof value === \"string\") return new MathRun(value);\n\n // MathComponent instances pass through\n if (value instanceof XmlComponent) return value;\n\n // Discriminated union: check unique keys (order matters)\n // subSuperScript before superScript/subScript to avoid false match\n if (\"subSuperScript\" in value) {\n const opts = value.subSuperScript;\n return new MathSubSuperScript({\n children: coerceArray(opts.children),\n subScript: coerceArray(opts.subScript),\n superScript: coerceArray(opts.superScript),\n });\n }\n\n if (\"superScript\" in value) {\n const opts = value.superScript;\n return new MathSuperScript({\n children: coerceArray(opts.children),\n superScript: coerceArray(opts.superScript),\n });\n }\n\n if (\"subScript\" in value) {\n const opts = value.subScript;\n return new MathSubScript({\n children: coerceArray(opts.children),\n subScript: coerceArray(opts.subScript),\n });\n }\n\n if (\"fraction\" in value) {\n const opts = value.fraction;\n return new MathFraction({\n numerator: coerceArray(opts.numerator),\n denominator: coerceArray(opts.denominator),\n ...(opts.fractionType ? { fractionType: opts.fractionType } : {}),\n });\n }\n\n if (\"radical\" in value) {\n const opts = value.radical;\n return new MathRadical({\n children: coerceArray(opts.children),\n ...(opts.degree ? { degree: coerceArray(opts.degree) } : {}),\n });\n }\n\n if (\"sum\" in value) {\n const opts = value.sum;\n return new MathSum({\n children: coerceArray(opts.children),\n ...(opts.subScript ? { subScript: coerceArray(opts.subScript) } : {}),\n ...(opts.superScript ? { superScript: coerceArray(opts.superScript) } : {}),\n });\n }\n\n if (\"integral\" in value) {\n const opts = value.integral;\n return new MathIntegral({\n children: coerceArray(opts.children),\n ...(opts.subScript ? { subScript: coerceArray(opts.subScript) } : {}),\n ...(opts.superScript ? { superScript: coerceArray(opts.superScript) } : {}),\n });\n }\n\n if (\"limitLower\" in value) {\n const opts = value.limitLower;\n return new MathLimitLower({\n children: coerceArray(opts.children),\n limit: coerceArray(opts.limit),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"limitUpper\" in value) {\n const opts = value.limitUpper;\n return new MathLimitUpper({\n children: coerceArray(opts.children),\n limit: coerceArray(opts.limit),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"function\" in value) {\n const opts = value.function;\n return new MathFunction({\n children: coerceArray(opts.children),\n name: coerceArray(opts.name),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"matrix\" in value) {\n const opts = value.matrix;\n return new MathMatrix({\n rows: opts.rows.map((row) => coerceArray(row)) as readonly (readonly MathComponent[])[],\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n // Bracket types: support shorthand (array) or full ({ children })\n if (\"roundBrackets\" in value) {\n return new MathRoundBrackets({ children: bracketChildren(value.roundBrackets) });\n }\n\n if (\"curlyBrackets\" in value) {\n return new MathCurlyBrackets({ children: bracketChildren(value.curlyBrackets) });\n }\n\n if (\"angledBrackets\" in value) {\n return new MathAngledBrackets({ children: bracketChildren(value.angledBrackets) });\n }\n\n if (\"squareBrackets\" in value) {\n return new MathSquareBrackets({ children: bracketChildren(value.squareBrackets) });\n }\n\n if (\"borderBox\" in value) {\n const opts = value.borderBox;\n return new MathBorderBox({\n children: coerceArray(opts.children),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"box\" in value) {\n const opts = value.box;\n return new MathBox({\n children: coerceArray(opts.children),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"groupChr\" in value) {\n const opts = value.groupChr;\n return new MathGroupChr({\n children: coerceArray(opts.children),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"phant\" in value) {\n const opts = value.phant;\n return new MathPhant({\n children: coerceArray(opts.children),\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"eqArr\" in value) {\n const opts = value.eqArr;\n return new MathEqArr({\n rows: opts.rows.map((row) => coerceArray(row)) as readonly (readonly MathComponent[])[],\n ...(opts.properties ? { properties: opts.properties } : {}),\n });\n }\n\n if (\"accent\" in value) {\n const opts = value.accent;\n return createMathAccent({\n children: coerceArray(opts.children) as readonly MathComponent[],\n ...(opts.accentCharacter ? { accentCharacter: opts.accentCharacter } : {}),\n });\n }\n\n if (\"bar\" in value) {\n const opts = value.bar;\n return createMathBar({\n children: coerceArray(opts.children) as readonly MathComponent[],\n type: opts.type,\n });\n }\n\n // Fallback: { text: string; properties?: ... } → MathRun\n return new MathRun({ text: value.text, properties: value.properties });\n}\n","/**\n * Office Math module for WordprocessingML documents.\n *\n * This module provides support for mathematical equations and expressions\n * using Office MathML (OMML).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_oMath-1.html\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { MathComponent } from \"./math-component\";\n\n/**\n * Options for creating a Math element.\n *\n * @see {@link Math}\n */\nexport interface MathOptions {\n /** Array of math components (fractions, radicals, runs, etc.) */\n readonly children: readonly MathComponent[];\n}\n\n/**\n * Represents a mathematical equation in a WordprocessingML document.\n *\n * Math is the container for Office MathML (OMML) content, supporting\n * fractions, radicals, integrals, sums, scripts, and more.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_oMath-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMath\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_OMathElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Math({\n * children: [\n * new MathFraction({\n * numerator: [new MathRun(\"a\")],\n * denominator: [new MathRun(\"b\")],\n * }),\n * ],\n * });\n * ```\n */\nexport class Math extends XmlComponent {\n public constructor(options: MathOptions) {\n super(\"m:oMath\");\n\n for (const child of options.children) {\n this.root.push(child);\n }\n }\n}\n","/**\n * OMML XML parser for math components.\n *\n * Parses m:oMath Element trees into MathJson format for round-trip support.\n *\n * @module\n */\nimport { attr, children, findChild, textOf } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { MathJson } from \"./math-coerce\";\n\n/**\n * Parse all math children from an m:oMath (or similar container) element.\n *\n * Iterates over child elements and dispatches to specific parsers based on\n * element name. Unknown elements are returned as-is for passthrough.\n */\nexport function parseMathChildren(el: Element): MathJson[] {\n const result: MathJson[] = [];\n for (const child of el.elements ?? []) {\n const parsed = parseMathElement(child);\n if (parsed !== undefined) result.push(parsed);\n }\n return result;\n}\n\n/**\n * Parse a single math element into its MathJson representation.\n *\n * Returns `undefined` for property elements (m:*Pr) that are not standalone content.\n */\nfunction parseMathElement(el: Element): MathJson | undefined {\n switch (el.name) {\n // m:r → text run\n case \"m:r\":\n return parseMathRun(el);\n\n // m:f → fraction\n case \"m:f\":\n return parseMathFraction(el);\n\n // m:rad → radical (root)\n case \"m:rad\":\n return parseMathRadical(el);\n\n // m:sSup → superscript\n case \"m:sSup\":\n return parseMathSuperScript(el);\n\n // m:sSub → subscript\n case \"m:sSub\":\n return parseMathSubScript(el);\n\n // m:sSubSup → combined sub/superscript\n case \"m:sSubSup\":\n return parseMathSubSuperScript(el);\n\n // m:nary → n-ary operator (sum, integral, etc.)\n case \"m:nary\":\n return parseMathNAry(el);\n\n // m:func → named function\n case \"m:func\":\n return parseMathFunction(el);\n\n // m:d → delimiter (brackets)\n case \"m:d\":\n return parseMathDelimiter(el);\n\n // m:m → matrix\n case \"m:m\":\n return parseMathMatrix(el);\n\n // m:acc → accent\n case \"m:acc\":\n return parseMathAccent(el);\n\n // m:bar → overline/underline bar\n case \"m:bar\":\n return parseMathBar(el);\n\n // m:borderBox → border box\n case \"m:borderBox\":\n return { borderBox: { children: parseMathArg(el, \"m:e\") } };\n\n // m:box → box\n case \"m:box\":\n return { box: { children: parseMathArg(el, \"m:e\") } };\n\n // m:groupChr → group character\n case \"m:groupChr\":\n return { groupChr: { children: parseMathArg(el, \"m:e\") } };\n\n // m:phant → phantom\n case \"m:phant\":\n return { phant: { children: parseMathArg(el, \"m:e\") } };\n\n // m:eqArr → equation array\n case \"m:eqArr\":\n return parseMathEqArr(el);\n\n // m:limLow → lower limit\n case \"m:limLow\":\n return parseMathLimitLower(el);\n\n // m:limUpp → upper limit\n case \"m:limUpp\":\n return parseMathLimitUpper(el);\n\n // Skip property elements — they are not standalone content\n case \"m:rPr\":\n case \"m:fPr\":\n case \"m:radPr\":\n case \"m:sSupPr\":\n case \"m:sSubPr\":\n case \"m:sSubSupPr\":\n case \"m:naryPr\":\n case \"m:funcPr\":\n case \"m:dPr\":\n case \"m:mPr\":\n case \"m:accPr\":\n case \"m:barPr\":\n case \"m:borderBoxPr\":\n case \"m:boxPr\":\n case \"m:groupChrPr\":\n case \"m:phantPr\":\n case \"m:eqArrPr\":\n case \"m:limLowPr\":\n case \"m:limUppPr\":\n case \"m:ctrlPr\":\n return undefined;\n\n default:\n // Skip non-math elements and text nodes\n return undefined;\n }\n}\n\n// ─── Specific parsers ──────────────────────────────────────────────────────\n\n/** Parse m:r → string or { text } */\nfunction parseMathRun(el: Element): MathJson {\n const text = textOf(findChild(el, \"m:t\"));\n if (text) return text;\n return text;\n}\n\n/** Parse m:f → { fraction: { numerator, denominator } } */\nfunction parseMathFraction(el: Element): MathJson {\n return {\n fraction: {\n numerator: parseMathArg(el, \"m:num\"),\n denominator: parseMathArg(el, \"m:den\"),\n },\n };\n}\n\n/** Parse m:rad → { radical: { children, degree? } } */\nfunction parseMathRadical(el: Element): MathJson {\n const degree = parseMathArg(el, \"m:deg\");\n const mathChildren = parseMathArg(el, \"m:e\");\n return {\n radical: {\n children: mathChildren,\n ...(degree.length > 0 ? { degree } : {}),\n },\n };\n}\n\n/** Parse m:sSup → { superScript: { children, superScript } } */\nfunction parseMathSuperScript(el: Element): MathJson {\n return {\n superScript: {\n children: parseMathArg(el, \"m:e\"),\n superScript: parseMathArg(el, \"m:sup\"),\n },\n };\n}\n\n/** Parse m:sSub → { subScript: { children, subScript } } */\nfunction parseMathSubScript(el: Element): MathJson {\n return {\n subScript: {\n children: parseMathArg(el, \"m:e\"),\n subScript: parseMathArg(el, \"m:sub\"),\n },\n };\n}\n\n/** Parse m:sSubSup → { subSuperScript: { children, subScript, superScript } } */\nfunction parseMathSubSuperScript(el: Element): MathJson {\n return {\n subSuperScript: {\n children: parseMathArg(el, \"m:e\"),\n subScript: parseMathArg(el, \"m:sub\"),\n superScript: parseMathArg(el, \"m:sup\"),\n },\n };\n}\n\n/**\n * Parse m:nary → { sum: ... } | { integral: ... }\n *\n * Distinguishes between sum and integral based on m:naryPr/m:chr/@m:val:\n * - \"∑\" → sum\n * - \"∫\" or empty → integral\n */\nfunction parseMathNAry(el: Element): MathJson {\n const naryPr = findChild(el, \"m:naryPr\");\n const chrEl = naryPr ? findChild(naryPr, \"m:chr\") : undefined;\n const chrVal = chrEl ? attr(chrEl, \"m:val\") : undefined;\n\n const baseChildren = parseMathArg(el, \"m:e\");\n const sub = parseMathArg(el, \"m:sub\");\n const sup = parseMathArg(el, \"m:sup\");\n\n const common = {\n children: baseChildren,\n ...(sub.length > 0 ? { subScript: sub } : {}),\n ...(sup.length > 0 ? { superScript: sup } : {}),\n };\n\n if (chrVal === \"∑\") {\n return { sum: common };\n }\n\n // Default to integral for \"∫\" or any other character\n return { integral: common };\n}\n\n/** Parse m:func → { function: { name, children } } */\nfunction parseMathFunction(el: Element): MathJson {\n return {\n function: {\n name: parseMathArg(el, \"m:fName\"),\n children: parseMathArg(el, \"m:e\"),\n },\n };\n}\n\n/**\n * Parse m:d → { roundBrackets | squareBrackets | curlyBrackets | angledBrackets }\n *\n * Determines bracket type from m:dPr/m:begChr/@m:val:\n * - \"(\" → roundBrackets\n * - \"[\" → squareBrackets\n * - \"{\" → curlyBrackets\n * - default → roundBrackets (parentheses are the default delimiter)\n */\nfunction parseMathDelimiter(el: Element): MathJson {\n const dPr = findChild(el, \"m:dPr\");\n const begChrEl = dPr ? findChild(dPr, \"m:begChr\") : undefined;\n const begChr = begChrEl ? attr(begChrEl, \"m:val\") : \"(\";\n\n const mathChildren = parseMathArg(el, \"m:e\");\n\n switch (begChr) {\n case \"[\":\n return { squareBrackets: mathChildren };\n case \"{\":\n return { curlyBrackets: mathChildren };\n case \"<\":\n case \"⟨\":\n return { angledBrackets: mathChildren };\n default:\n return { roundBrackets: mathChildren };\n }\n}\n\n/** Parse m:m → { matrix: { rows } } */\nfunction parseMathMatrix(el: Element): MathJson {\n const rows: MathJson[][] = [];\n for (const mr of children(el, \"m:mr\")) {\n rows.push(parseMathArg(mr, \"m:e\"));\n }\n return { matrix: { rows } };\n}\n\n/**\n * Parse m:acc → { accent: { children, accentCharacter? } }\n *\n * Reads accent character from m:accPr/m:chr/@m:val.\n */\nfunction parseMathAccent(el: Element): MathJson {\n const accPr = findChild(el, \"m:accPr\");\n const chrEl = accPr ? findChild(accPr, \"m:chr\") : undefined;\n const accentChar = chrEl ? attr(chrEl, \"m:val\") : undefined;\n\n return {\n accent: {\n children: parseMathArg(el, \"m:e\"),\n ...(accentChar ? { accentCharacter: accentChar } : {}),\n },\n };\n}\n\n/** Parse m:bar → { bar: { children, type } } */\nfunction parseMathBar(el: Element): MathJson {\n const barPr = findChild(el, \"m:barPr\");\n const posEl = barPr ? findChild(barPr, \"m:pos\") : undefined;\n const pos = posEl ? attr(posEl, \"m:val\") : \"top\";\n\n return {\n bar: {\n children: parseMathArg(el, \"m:e\"),\n type: (pos as \"top\" | \"bot\") ?? \"top\",\n },\n };\n}\n\n/** Parse m:eqArr → { eqArr: { rows } } */\nfunction parseMathEqArr(el: Element): MathJson {\n const rows: MathJson[][] = [];\n for (const e of children(el, \"m:e\")) {\n rows.push(parseMathChildren(e));\n }\n return { eqArr: { rows } };\n}\n\n/** Parse m:limLow → { limitLower: { children, limit } } */\nfunction parseMathLimitLower(el: Element): MathJson {\n return {\n limitLower: {\n children: parseMathArg(el, \"m:e\"),\n limit: parseMathArg(el, \"m:lim\"),\n },\n };\n}\n\n/** Parse m:limUpp → { limitUpper: { children, limit } } */\nfunction parseMathLimitUpper(el: Element): MathJson {\n return {\n limitUpper: {\n children: parseMathArg(el, \"m:e\"),\n limit: parseMathArg(el, \"m:lim\"),\n },\n };\n}\n\n// ─── Helpers ───────────────────────────────────────────────────────────────\n\n/**\n * Parse a container element's math children.\n *\n * Used for m:e, m:num, m:den, m:sub, m:sup, m:lim, m:fName, m:deg\n * — all of which are CT_OMathArg containers that hold math child elements.\n */\nfunction parseMathArg(parent: Element, childName: string): MathJson[] {\n const container = findChild(parent, childName);\n if (!container) return [];\n return parseMathChildren(container);\n}\n","/**\n * Math component types module.\n *\n * This module defines the union type of all valid math components\n * that can appear within a Math element.\n *\n * @module\n */\nimport type { MathBorderBox } from \"./border-box\";\nimport type { MathBox } from \"./box\";\nimport type {\n MathAngledBrackets,\n MathCurlyBrackets,\n MathRoundBrackets,\n MathSquareBrackets,\n} from \"./brackets\";\nimport type { MathEqArr } from \"./eq-arr\";\nimport type { MathFraction } from \"./fraction\";\nimport type { MathFunction } from \"./function\";\nimport type { MathGroupChr } from \"./group-chr\";\nimport type { MathRun } from \"./math-run\";\nimport type { MathMatrix } from \"./matrix\";\nimport type { MathIntegral, MathLimitLower, MathLimitUpper, MathSum } from \"./n-ary\";\nimport type { MathPhant } from \"./phant\";\nimport type { MathRadical } from \"./radical\";\nimport type { MathSubScript, MathSubSuperScript, MathSuperScript } from \"./script\";\n\n/**\n * Union type of all valid math components.\n *\n * MathComponent represents any element that can appear within a Math equation,\n * including runs, fractions, radicals, integrals, sums, scripts, brackets,\n * boxes, matrices, and more.\n */\nexport type MathComponent =\n | MathRun\n | MathFraction\n | MathSum\n | MathIntegral\n | MathSuperScript\n | MathSubScript\n | MathSubSuperScript\n | MathRadical\n | MathFunction\n | MathRoundBrackets\n | MathCurlyBrackets\n | MathAngledBrackets\n | MathSquareBrackets\n | MathBox\n | MathBorderBox\n | MathEqArr\n | MathGroupChr\n | MathLimitLower\n | MathLimitUpper\n | MathMatrix\n | MathPhant;\n\n// Needed because of: https://github.com/s-panferov/awesome-typescript-loader/issues/432\n/**\n * @ignore\n */\nexport const WORKAROUND4 = \"\";\n","/**\n * Office Math Paragraph module for WordprocessingML documents.\n *\n * This module provides the math paragraph element (m:oMathPara) which\n * is a container for one or more math equations with paragraph-level\n * formatting.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_oMathPara-1.html\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { Math } from \"./math\";\nimport type { MathOptions } from \"./math\";\n\n/**\n * Math paragraph justification types.\n */\nexport type MathJustification = \"left\" | \"right\" | \"center\" | \"centerGroup\";\n\n/**\n * Options for creating a MathParagraph element.\n *\n * @see {@link MathParagraph}\n */\nexport interface MathParagraphOptions {\n /** Justification for the math paragraph */\n readonly justification?: MathJustification;\n /** Math equations in this paragraph */\n readonly children: readonly MathOptions[];\n}\n\n/**\n * Creates math paragraph properties element (m:oMathParaPr).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathParaPr\">\n * <xsd:sequence>\n * <xsd:element name=\"jc\" type=\"CT_OMathJc\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nconst createMathParagraphProperties = (justification: MathJustification): XmlComponent =>\n new BuilderElement({\n children: [\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: justification } },\n name: \"m:jc\",\n }),\n ],\n name: \"m:oMathParaPr\",\n });\n\n/**\n * Represents a math paragraph in a WordprocessingML document.\n *\n * MathParagraph is a container for one or more math equations with\n * paragraph-level alignment. It groups math equations and applies\n * consistent justification.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_oMathPara-1.html\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OMathPara\">\n * <xsd:sequence>\n * <xsd:element name=\"oMathParaPr\" type=\"CT_OMathParaPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"oMath\" type=\"CT_OMath\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new MathParagraph({\n * justification: \"center\",\n * children: [\n * { children: [new MathRun(\"x + y = z\")] },\n * ],\n * });\n * ```\n */\nexport class MathParagraph extends XmlComponent {\n public constructor(options: MathParagraphOptions) {\n super(\"m:oMathPara\");\n\n if (options.justification) {\n this.root.push(createMathParagraphProperties(options.justification));\n }\n\n for (const child of options.children) {\n this.root.push(new Math(child));\n }\n }\n}\n","/**\n * Math Properties module for Office MathML.\n *\n * This module provides global math document properties (m:mathPr).\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_mathPr-1.html\n *\n * @module\n */\nimport { BuilderElement, onOffObj } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Binary operator break position.\n *\n * - \"before\" - Break before binary operator\n * - \"after\" - Break after binary operator\n * - \"repeat\" - Repeat binary operator on each line\n */\nexport type MathBreakBin = \"before\" | \"after\" | \"repeat\";\n\n/**\n * Binary operator subtraction break position.\n *\n * - \"--\" - Minus on both lines\n * - \"-+\" - Minus on first, plus on second\n * - \"+-\" - Plus on first, minus on second\n */\nexport type MathBreakBinSub = \"--\" | \"-+\" | \"+-\";\n\n/**\n * Math justification type for global math properties.\n *\n * - \"left\" - Left justify\n * - \"right\" - Right justify\n * - \"center\" - Center\n * - \"centerGroup\" - Center group\n */\nexport type MathPropertiesJustification = \"left\" | \"right\" | \"center\" | \"centerGroup\";\n\n/**\n * Options for global math properties.\n *\n * @see {@link createMathProperties}\n */\nexport interface MathPropertiesOptions {\n /** Math font name */\n readonly mathFont?: string;\n /** Binary operator break position */\n readonly breakBin?: MathBreakBin;\n /** Binary operator subtraction break position */\n readonly breakBinSub?: MathBreakBinSub;\n /** Use small fractions */\n readonly smallFrac?: boolean;\n /** Display default */\n readonly displayDefault?: boolean;\n /** Left margin in twips */\n readonly leftMargin?: number;\n /** Right margin in twips */\n readonly rightMargin?: number;\n /** Default justification */\n readonly defaultJustification?: MathPropertiesJustification;\n /** Pre-spacing in twips */\n readonly preSpacing?: number;\n /** Post-spacing in twips */\n readonly postSpacing?: number;\n /** Inter-spacing in twips */\n readonly interSpacing?: number;\n /** Intra-spacing in twips */\n readonly intraSpacing?: number;\n /** Wrap indent in twips */\n readonly wrapIndent?: number;\n /** Wrap right */\n readonly wrapRight?: boolean;\n /** Integral limit location: \"undOvr\" (under/over) or \"subSup\" (subscript/superscript) */\n readonly integralLimitLocation?: string;\n /** N-ary limit location: \"undOvr\" (under/over) or \"subSup\" (subscript/superscript) */\n readonly naryLimitLocation?: string;\n}\n\n/**\n * Creates global math properties element (m:mathPr).\n *\n * This element specifies global math properties for the document,\n * including fonts, spacing, justification, and limit locations.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-m_mathPr-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_MathPr\">\n * <xsd:sequence>\n * <xsd:element name=\"mathFont\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"brkBin\" type=\"CT_BreakBin\" minOccurs=\"0\"/>\n * <xsd:element name=\"brkBinSub\" type=\"CT_BreakBinSub\" minOccurs=\"0\"/>\n * <xsd:element name=\"smallFrac\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"dispDef\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"lMargin\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"rMargin\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"defJc\" type=\"CT_OMathJc\" minOccurs=\"0\"/>\n * <xsd:element name=\"preSp\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"postSp\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"interSp\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"intraSp\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:choice minOccurs=\"0\">\n * <xsd:element name=\"wrapIndent\" type=\"CT_TwipsMeasure\"/>\n * <xsd:element name=\"wrapRight\" type=\"CT_OnOff\"/>\n * </xsd:choice>\n * <xsd:element name=\"intLim\" type=\"CT_LimLoc\" minOccurs=\"0\"/>\n * <xsd:element name=\"naryLim\" type=\"CT_LimLoc\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createMathProperties = (options: MathPropertiesOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.mathFont !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.mathFont } },\n name: \"m:mathFont\",\n }),\n );\n }\n if (options.breakBin !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.breakBin } },\n name: \"m:brkBin\",\n }),\n );\n }\n if (options.breakBinSub !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.breakBinSub } },\n name: \"m:brkBinSub\",\n }),\n );\n }\n if (options.smallFrac !== undefined) {\n children.push(onOffObj(\"m:smallFrac\", options.smallFrac));\n }\n if (options.displayDefault !== undefined) {\n children.push(onOffObj(\"m:dispDef\", options.displayDefault));\n }\n if (options.leftMargin !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.leftMargin.toString() } },\n name: \"m:lMargin\",\n }),\n );\n }\n if (options.rightMargin !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.rightMargin.toString() } },\n name: \"m:rMargin\",\n }),\n );\n }\n if (options.defaultJustification !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.defaultJustification } },\n name: \"m:defJc\",\n }),\n );\n }\n if (options.preSpacing !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.preSpacing.toString() } },\n name: \"m:preSp\",\n }),\n );\n }\n if (options.postSpacing !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.postSpacing.toString() } },\n name: \"m:postSp\",\n }),\n );\n }\n if (options.interSpacing !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.interSpacing.toString() } },\n name: \"m:interSp\",\n }),\n );\n }\n if (options.intraSpacing !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.intraSpacing.toString() } },\n name: \"m:intraSp\",\n }),\n );\n }\n if (options.wrapIndent !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.wrapIndent.toString() } },\n name: \"m:wrapIndent\",\n }),\n );\n }\n if (options.wrapRight !== undefined) {\n children.push(onOffObj(\"m:wrapRight\", options.wrapRight));\n }\n if (options.integralLimitLocation !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.integralLimitLocation } },\n name: \"m:intLim\",\n }),\n );\n }\n if (options.naryLimitLocation !== undefined) {\n children.push(\n new BuilderElement({\n attributes: { val: { key: \"m:val\", value: options.naryLimitLocation } },\n name: \"m:naryLim\",\n }),\n );\n }\n\n return new BuilderElement({\n children,\n name: \"m:mathPr\",\n });\n};\n","/**\n * Math matrix module exports.\n *\n * @module\n */\nexport * from \"./math-matrix\";\nexport * from \"./math-matrix-properties\";\n","/**\n * Math phantom module exports.\n *\n * @module\n */\nexport * from \"./math-phant\";\nexport * from \"./math-phant-properties\";\n","/**\n * Math radical module exports.\n *\n * @module\n */\nexport * from \"./math-degree\";\nexport * from \"./math-radical\";\nexport * from \"./math-radical-properties\";\n","/**\n * Math module exports.\n *\n * @module\n */\nexport * from \"./accent\";\nexport * from \"./bar\";\nexport * from \"./border-box\";\nexport * from \"./box\";\nexport * from \"./brackets\";\nexport * from \"./eq-arr\";\nexport * from \"./fraction\";\nexport * from \"./function\";\nexport * from \"./group-chr\";\nexport * from \"./math-coerce\";\nexport * from \"./math\";\nexport * from \"./math-parse\";\nexport * from \"./math-component\";\nexport * from \"./math-control-properties\";\nexport * from \"./math-para\";\nexport * from \"./math-pr\";\nexport * from \"./math-run\";\nexport * from \"./math-run-properties\";\nexport * from \"./matrix\";\nexport * from \"./n-ary\";\nexport * from \"./phant\";\nexport * from \"./radical\";\nexport * from \"./script\";\n","import { Run } from \"@file/paragraph/run\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nexport class EndnoteIdReference extends XmlComponent {\n public constructor(id: number) {\n super(\"w:endnoteReference\");\n\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n\nexport class EndnoteReferenceRun extends Run {\n public constructor(id: number) {\n super({ style: \"EndnoteReference\" });\n\n this.extraChildren.push(new EndnoteIdReference(id));\n }\n}\n","/**\n * Footnote reference run module for WordprocessingML documents.\n *\n * This module provides the footnote reference marker that appears in the\n * main document text to indicate a footnote.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { Run } from \"@file/paragraph/run\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a footnote reference element in WordprocessingML.\n *\n * FootnoteReference creates the link between the main document text\n * and the footnote content by using a unique identifier.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FtnEdnRef\">\n * <xsd:attribute name=\"customMarkFollows\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"id\" use=\"required\" type=\"ST_DecimalNumber\"/>\n * </xsd:complexType>\n * ```\n *\n * @internal\n */\nexport class FootnoteReference extends XmlComponent {\n public constructor(id: number) {\n super(\"w:footnoteReference\");\n\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n\n/**\n * Represents a footnote reference run in a WordprocessingML document.\n *\n * FootnoteReferenceRun creates a run containing a footnote reference marker\n * (typically a superscript number) that appears in the main document text.\n * Clicking this marker navigates to the corresponding footnote content.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * // Add a footnote reference in a paragraph\n * new Paragraph({\n * children: [\n * new TextRun(\"This text has a footnote\"),\n * new FootnoteReferenceRun(1),\n * ],\n * });\n * ```\n */\nexport class FootnoteReferenceRun extends Run {\n /**\n * Creates a new footnote reference run.\n *\n * @param id - Unique identifier linking to the footnote content\n */\n public constructor(id: number) {\n super({ style: \"FootnoteReference\" });\n\n this.extraChildren.push(new FootnoteReference(id));\n }\n}\n","/**\n * Paragraph spacing module for WordprocessingML documents.\n *\n * This module provides spacing options for paragraphs including space before,\n * space after, and line spacing.\n *\n * Reference: http://officeopenxml.com/WPspacing.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Line spacing rule types.\n *\n * Specifies how the line height is calculated.\n *\n * @publicApi\n */\nexport const LineRuleType = {\n /** Line spacing is at least the specified value */\n AT_LEAST: \"atLeast\",\n /** Line spacing is exactly the specified value */\n EXACTLY: \"exactly\",\n /** Line spacing is exactly the specified value (alias for EXACTLY) */\n EXACT: \"exact\",\n /** Line spacing is automatically determined based on content */\n AUTO: \"auto\",\n} as const;\n\n/**\n * Properties for configuring paragraph spacing.\n *\n * All values are in twips (twentieths of a point) unless otherwise specified.\n *\n * @property after - Spacing after the paragraph in twips\n * @property before - Spacing before the paragraph in twips\n * @property line - Line spacing value in twips (interpretation depends on lineRule)\n * @property lineRule - How to interpret the line spacing value\n * @property beforeAutoSpacing - Use automatic spacing before the paragraph\n * @property afterAutoSpacing - Use automatic spacing after the paragraph\n */\nexport interface SpacingProperties {\n /** Spacing after the paragraph in twips */\n readonly after?: number;\n /** Spacing before the paragraph in twips */\n readonly before?: number;\n /** Line spacing value in twips (interpretation depends on lineRule) */\n readonly line?: number;\n /** How to interpret the line spacing value */\n readonly lineRule?: (typeof LineRuleType)[keyof typeof LineRuleType];\n /** Use automatic spacing before the paragraph */\n readonly beforeAutoSpacing?: boolean;\n /** Use automatic spacing after the paragraph */\n readonly afterAutoSpacing?: boolean;\n /** Spacing before the paragraph in line units */\n readonly beforeLines?: number;\n /** Spacing after the paragraph in line units */\n readonly afterLines?: number;\n}\n\n/**\n * Creates paragraph spacing element for a WordprocessingML document.\n *\n * The spacing element specifies the spacing between lines and paragraphs.\n *\n * Reference: http://officeopenxml.com/WPspacing.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Spacing\">\n * <xsd:attribute name=\"before\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"beforeLines\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"beforeAutospacing\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"after\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"afterLines\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"afterAutospacing\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"line\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"lineRule\" type=\"ST_LineSpacingRule\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * spacing: {\n * before: 200,\n * after: 200,\n * line: 360,\n * lineRule: LineRuleType.AT_LEAST,\n * },\n * children: [new TextRun(\"Paragraph with custom spacing\")],\n * });\n * ```\n */\nexport const createSpacing = ({\n after,\n before,\n line,\n lineRule,\n beforeAutoSpacing,\n afterAutoSpacing,\n beforeLines,\n afterLines,\n}: SpacingProperties): XmlComponent =>\n new BuilderElement<SpacingProperties>({\n attributes: {\n after: { key: \"w:after\", value: after },\n afterAutoSpacing: { key: \"w:afterAutospacing\", value: afterAutoSpacing },\n afterLines: {\n key: \"w:afterLines\",\n value: afterLines === undefined ? undefined : decimalNumber(afterLines),\n },\n before: { key: \"w:before\", value: before },\n beforeAutoSpacing: { key: \"w:beforeAutospacing\", value: beforeAutoSpacing },\n beforeLines: {\n key: \"w:beforeLines\",\n value: beforeLines === undefined ? undefined : decimalNumber(beforeLines),\n },\n line: { key: \"w:line\", value: line },\n lineRule: { key: \"w:lineRule\", value: lineRule },\n },\n name: \"w:spacing\",\n });\n\nexport const buildSpacingObj = ({\n after,\n before,\n line,\n lineRule,\n beforeAutoSpacing,\n afterAutoSpacing,\n beforeLines,\n afterLines,\n}: SpacingProperties): IXmlableObject =>\n attrObj(\"w:spacing\", {\n \"w:after\": after,\n \"w:afterAutospacing\": afterAutoSpacing,\n \"w:afterLines\": afterLines !== undefined ? decimalNumber(afterLines) : undefined,\n \"w:before\": before,\n \"w:beforeAutospacing\": beforeAutoSpacing,\n \"w:beforeLines\": beforeLines !== undefined ? decimalNumber(beforeLines) : undefined,\n \"w:line\": line,\n \"w:lineRule\": lineRule,\n });\n","/**\n * Paragraph style module for WordprocessingML documents.\n *\n * This module provides paragraph style references including heading levels.\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Built-in heading level styles.\n *\n * These are the standard heading styles available in Word documents.\n *\n * @publicApi\n */\nexport const HeadingLevel = {\n /** Heading 1 style */\n HEADING_1: \"Heading1\",\n /** Heading 2 style */\n HEADING_2: \"Heading2\",\n /** Heading 3 style */\n HEADING_3: \"Heading3\",\n /** Heading 4 style */\n HEADING_4: \"Heading4\",\n /** Heading 5 style */\n HEADING_5: \"Heading5\",\n /** Heading 6 style */\n HEADING_6: \"Heading6\",\n /** Title style */\n TITLE: \"Title\",\n} as const;\n\n/**\n * Creates a paragraph style reference for a WordprocessingML document.\n *\n * The pStyle element specifies the paragraph style to apply to the paragraph.\n *\n * Reference: http://officeopenxml.com/WPstyle.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_String\">\n * <xsd:attribute name=\"val\" type=\"s:ST_String\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Using a built-in heading style\n * new Paragraph({\n * style: HeadingLevel.HEADING_1,\n * children: [new TextRun(\"Chapter 1\")],\n * });\n *\n * // Using a custom style\n * new Paragraph({\n * style: \"MyCustomStyle\",\n * children: [new TextRun(\"Styled text\")],\n * });\n * ```\n */\nexport const createParagraphStyle = (styleId: string): XmlComponent =>\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: { key: \"w:val\", value: styleId },\n },\n name: \"w:pStyle\",\n });\n","/**\n * Tab stop module for WordprocessingML documents.\n *\n * This module provides tab stop definitions for paragraphs.\n *\n * Reference: http://officeopenxml.com/WPtab.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Definition for a single tab stop.\n *\n * @property type - The type of tab stop alignment\n * @property position - The position of the tab stop in twips\n * @property leader - Optional leader character to fill space before the tab\n *\n * @see {@link TabStop}\n */\nexport interface TabStopDefinition {\n /** The type of tab stop alignment */\n readonly type: (typeof TabStopType)[keyof typeof TabStopType];\n /** The position of the tab stop in twips */\n readonly position: number | (typeof TabStopPosition)[keyof typeof TabStopPosition];\n /** Optional leader character to fill space before the tab */\n readonly leader?: (typeof LeaderType)[keyof typeof LeaderType];\n}\n\n/**\n * Tab stop alignment types.\n *\n * Specifies the type of tab stop and how text aligns to it.\n *\n * @publicApi\n */\nexport const TabStopType = {\n /** Left-aligned tab stop */\n LEFT: \"left\",\n /** Right-aligned tab stop */\n RIGHT: \"right\",\n /** Center-aligned tab stop */\n CENTER: \"center\",\n /** Bar tab stop - inserts a vertical bar at the position */\n BAR: \"bar\",\n /** Clears a tab stop at the specified position */\n CLEAR: \"clear\",\n /** Decimal-aligned tab stop - aligns on decimal point */\n DECIMAL: \"decimal\",\n /** End-aligned tab stop (right-to-left equivalent) */\n END: \"end\",\n /** List tab stop for numbered lists */\n NUM: \"num\",\n /** Start-aligned tab stop (left-to-right equivalent) */\n START: \"start\",\n} as const;\n\n/**\n * Tab stop leader character types.\n *\n * Specifies the character used to fill the space before the tab stop.\n *\n * @publicApi\n */\nexport const LeaderType = {\n /** Dot leader (....) */\n DOT: \"dot\",\n /** Heavy leader */\n HEAVY: \"heavy\",\n /** Hyphen leader (----) */\n HYPHEN: \"hyphen\",\n /** Middle dot leader (····) */\n MIDDLE_DOT: \"middleDot\",\n /** No leader */\n NONE: \"none\",\n /** Underscore leader (____) */\n UNDERSCORE: \"underscore\",\n} as const;\n\n/**\n * Predefined tab stop positions.\n *\n * @publicApi\n */\nexport const TabStopPosition = {\n /** Maximum tab stop position (right margin) */\n MAX: 9026,\n} as const;\n\n/**\n * Creates a single tab stop item element.\n *\n * Reference: http://officeopenxml.com/WPtab.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TabStop\">\n * <xsd:attribute name=\"val\" type=\"ST_TabJc\" use=\"required\"/>\n * <xsd:attribute name=\"leader\" type=\"ST_TabTlc\" use=\"optional\"/>\n * <xsd:attribute name=\"pos\" type=\"ST_SignedTwipsMeasure\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createTabStopItem = ({ type, position, leader }: TabStopDefinition): XmlComponent =>\n new BuilderElement<{\n readonly val: (typeof TabStopType)[keyof typeof TabStopType];\n readonly pos: string | number;\n readonly leader?: (typeof LeaderType)[keyof typeof LeaderType];\n }>({\n attributes: {\n leader: { key: \"w:leader\", value: leader },\n pos: { key: \"w:pos\", value: position },\n val: { key: \"w:val\", value: type },\n },\n name: \"w:tab\",\n });\n\n/**\n * Creates a collection of tab stops for a WordprocessingML document.\n *\n * Tab stops define the positions where text will align when a tab character is used.\n *\n * Reference: http://officeopenxml.com/WPtab.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Tabs\">\n * <xsd:sequence>\n * <xsd:element name=\"tab\" type=\"CT_TabStop\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * tabStops: [\n * { type: TabStopType.LEFT, position: 2000 },\n * { type: TabStopType.CENTER, position: 4000 },\n * { type: TabStopType.RIGHT, position: TabStopPosition.MAX, leader: LeaderType.DOT },\n * ],\n * children: [new TextRun(\"Text\\twith\\ttabs\")],\n * });\n * ```\n */\nexport const createTabStop = (tabDefinitions: readonly TabStopDefinition[]): XmlComponent =>\n new BuilderElement({\n children: tabDefinitions.map((tabDefinition) => createTabStopItem(tabDefinition)),\n name: \"w:tabs\",\n });\n\nexport const buildTabStopObj = (tabDefinitions: readonly TabStopDefinition[]): IXmlableObject => ({\n \"w:tabs\": tabDefinitions.map(({ type, position, leader }) =>\n attrObj(\"w:tab\", {\n \"w:val\": type,\n \"w:pos\": position,\n \"w:leader\": leader,\n }),\n ),\n});\n","/**\n * Numbering properties module for WordprocessingML documents.\n *\n * This module provides numbering and list properties for paragraphs.\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * Represents numbering properties for a paragraph.\n *\n * The numPr element specifies the numbering definition instance and level\n * for the paragraph, enabling numbered and bulleted lists.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_NumPr\">\n * <xsd:sequence>\n * <xsd:element name=\"ilvl\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"numId\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"numberingChange\" type=\"CT_TrackChangeNumbering\" minOccurs=\"0\"/>\n * <xsd:element name=\"ins\" type=\"CT_TrackChange\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a bulleted list item at level 0\n * new Paragraph({\n * numbering: {\n * reference: \"my-bullet-list\",\n * level: 0,\n * },\n * children: [new TextRun(\"First item\")],\n * });\n *\n * // Create a numbered list item at level 1\n * new Paragraph({\n * numbering: {\n * reference: \"my-numbered-list\",\n * level: 1,\n * },\n * children: [new TextRun(\"Nested item\")],\n * });\n * ```\n */\n/**\n * Build numbering properties (w:numPr) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildNumberProperties(\n numberId: number | string,\n indentLevel: number,\n): IXmlableObject {\n return {\n \"w:numPr\": [\n { \"w:ilvl\": { _attr: { \"w:val\": Math.min(indentLevel, 9) } } },\n {\n \"w:numId\": {\n _attr: { \"w:val\": typeof numberId === \"string\" ? `{${numberId}}` : numberId },\n },\n },\n ],\n };\n}\n\nexport class NumberProperties extends XmlComponent {\n public constructor(numberId: number | string, indentLevel: number) {\n super(\"w:numPr\");\n this.root.push(new IndentLevel(indentLevel));\n this.root.push(new NumberId(numberId));\n }\n}\n\n/**\n * Represents the indentation level (ilvl) for a numbered or bulleted list.\n *\n * The ilvl element specifies the list level (0-9) for the paragraph.\n *\n * @internal\n */\nclass IndentLevel extends XmlComponent {\n public constructor(level: number) {\n super(\"w:ilvl\");\n\n this.root.push({ _attr: { \"w:val\": Math.min(level, 9) } });\n }\n}\n\n/**\n * Represents the numbering definition ID (numId) for a numbered or bulleted list.\n *\n * The numId element specifies which numbering definition to use for the paragraph.\n *\n * @internal\n */\nclass NumberId extends XmlComponent {\n public constructor(id: number | string) {\n super(\"w:numId\");\n this.root.push({ _attr: { \"w:val\": typeof id === \"string\" ? `{${id}}` : id } });\n }\n}\n","/**\n * Word wrap module for WordprocessingML documents.\n *\n * This module provides word wrap settings for paragraphs.\n *\n * Reference: http://officeopenxml.com/WPalignment.php\n *\n * @see http://officeopenxml.com/WPtableAlignment.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates word wrap settings element for a WordprocessingML document.\n *\n * The wordWrap element specifies whether word wrap should be disabled\n * for the paragraph.\n */\nexport const createWordWrap = (): XmlComponent =>\n new BuilderElement<{ readonly val: 0 }>({\n attributes: {\n val: { key: \"w:val\", value: 0 },\n },\n name: \"w:wordWrap\",\n });\n","/**\n * Frame properties module for paragraph text frames in WordprocessingML documents.\n *\n * Frames allow paragraphs to be positioned absolutely on the page, enabling text wrapping\n * and drop cap effects. They are commonly used for floating text boxes and decorative elements.\n *\n * Reference: http://officeopenxml.com/WPparagraph-textFrames.php\n *\n * @module\n */\nimport type { HorizontalPositionAlign, VerticalPositionAlign } from \"@file/shared/alignment\";\nimport type { HeightRule } from \"@file/table\";\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Drop cap types for paragraph frames.\n *\n * Drop caps are decorative large initial letters that span multiple lines at the\n * beginning of a paragraph. This enum defines how the drop cap should be positioned.\n */\nexport const DropCapType = {\n /** No drop cap effect */\n NONE: \"none\",\n /** Drop cap that drops down into the paragraph text */\n DROP: \"drop\",\n /** Drop cap that extends into the margin */\n MARGIN: \"margin\",\n} as const;\n\n/**\n * Frame anchor types specifying what the frame should be anchored relative to.\n *\n * Determines the reference point for frame positioning (horizontal and vertical).\n */\nexport const FrameAnchorType = {\n /** Anchor relative to the page margin */\n MARGIN: \"margin\",\n /** Anchor relative to the page edge */\n PAGE: \"page\",\n /** Anchor relative to the text column */\n TEXT: \"text\",\n} as const;\n\n/**\n * Text wrapping types for frames.\n *\n * Controls how surrounding text wraps around the frame.\n */\nexport const FrameWrap = {\n /** Wrap text around the frame on all sides */\n AROUND: \"around\",\n /** Automatic wrapping based on available space */\n AUTO: \"auto\",\n /** No text wrapping */\n NONE: \"none\",\n /** Do not allow text beside the frame */\n NOT_BESIDE: \"notBeside\",\n /** Allow text to flow through the frame */\n THROUGH: \"through\",\n /** Wrap text tightly around the frame */\n TIGHT: \"tight\",\n} as const;\n\n/**\n * Base options shared by all frame types.\n *\n * @property anchorLock - Lock the anchor position to prevent it from moving\n * @property dropCap - Drop cap effect type\n * @property width - Frame width in twips\n * @property height - Frame height in twips\n * @property wrap - Text wrapping behavior around the frame\n * @property lines - Number of lines for drop cap effect\n * @property anchor - Anchor reference points for horizontal and vertical positioning\n * @property space - Spacing between frame and surrounding text\n * @property rule - Height rule determining how frame height is calculated\n */\ninterface BaseFrameOptions {\n /** Lock the anchor position to prevent it from moving */\n readonly anchorLock?: boolean;\n /** Drop cap effect type */\n readonly dropCap?: (typeof DropCapType)[keyof typeof DropCapType];\n /** Frame width in twips */\n readonly width: number;\n /** Frame height in twips */\n readonly height: number;\n /** Text wrapping behavior around the frame */\n readonly wrap?: (typeof FrameWrap)[keyof typeof FrameWrap];\n /** Number of lines for drop cap effect */\n readonly lines?: number;\n /** Anchor reference points for horizontal and vertical positioning */\n readonly anchor: {\n /** Horizontal anchor reference point */\n readonly horizontal: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n /** Vertical anchor reference point */\n readonly vertical: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n };\n /** Spacing between frame and surrounding text in twips */\n readonly space?: {\n /** Horizontal spacing in twips */\n readonly horizontal: number;\n /** Vertical spacing in twips */\n readonly vertical: number;\n };\n /** Height rule determining how frame height is calculated */\n readonly rule?: (typeof HeightRule)[keyof typeof HeightRule];\n}\n\n/**\n * Options for frames positioned using absolute X/Y coordinates.\n *\n * Use this type when you need precise control over frame positioning using\n * specific coordinate values.\n *\n * @property type - Must be \"absolute\" for coordinate-based positioning\n * @property position - Absolute X and Y coordinates in twips\n */\nexport type IXYFrameOptions = {\n /** Must be \"absolute\" for coordinate-based positioning */\n readonly type: \"absolute\";\n /** Absolute X and Y coordinates in twips */\n readonly position: {\n /** Horizontal position in twips from the anchor point */\n readonly x: number;\n /** Vertical position in twips from the anchor point */\n readonly y: number;\n };\n} & BaseFrameOptions;\n\n/**\n * Options for frames positioned using alignment values.\n *\n * Use this type when you want to position the frame relative to the anchor\n * using standard alignment positions (e.g., left, center, right, top, bottom).\n *\n * @property type - Must be \"alignment\" for alignment-based positioning\n * @property alignment - Horizontal and vertical alignment values\n */\nexport type IAlignmentFrameOptions = {\n /** Must be \"alignment\" for alignment-based positioning */\n readonly type: \"alignment\";\n /** Horizontal and vertical alignment values */\n readonly alignment: {\n /** Horizontal alignment relative to the anchor */\n readonly x: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];\n /** Vertical alignment relative to the anchor */\n readonly y: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];\n };\n} & BaseFrameOptions;\n\n/**\n * Union type for all frame positioning options.\n *\n * A frame can be positioned using either absolute coordinates (IXYFrameOptions)\n * or alignment values (IAlignmentFrameOptions).\n *\n * Note: Be wary of TypeScript's Open types when using discriminated unions.\n * Reference: https://stackoverflow.com/q/46370222/3481582\n */\nexport type IFrameOptions = IXYFrameOptions | IAlignmentFrameOptions;\n\n/**\n * Internal attributes type for the frame properties XML element.\n *\n * This type maps the high-level IFrameOptions to the actual XML attributes\n * used in the OOXML format.\n *\n * @property anchorLock - Lock the anchor position\n * @property dropCap - Drop cap effect type\n * @property width - Frame width in twips\n * @property height - Frame height in twips\n * @property x - Absolute horizontal position in twips (for coordinate-based positioning)\n * @property y - Absolute vertical position in twips (for coordinate-based positioning)\n * @property wrap - Text wrapping behavior\n * @property lines - Number of lines for drop cap\n * @property anchorHorizontal - Horizontal anchor reference point\n * @property anchorVertical - Vertical anchor reference point\n * @property spaceHorizontal - Horizontal spacing in twips\n * @property spaceVertical - Vertical spacing in twips\n * @property rule - Height rule\n * @property alignmentX - Horizontal alignment (for alignment-based positioning)\n * @property alignmentY - Vertical alignment (for alignment-based positioning)\n */\ninterface FramePropertiesAttributes {\n /** Lock the anchor position */\n readonly anchorLock?: boolean;\n /** Drop cap effect type */\n readonly dropCap?: (typeof DropCapType)[keyof typeof DropCapType];\n /** Frame width in twips */\n readonly width: number;\n /** Frame height in twips */\n readonly height: number;\n /** Absolute horizontal position in twips (for coordinate-based positioning) */\n readonly x?: number;\n /** Absolute vertical position in twips (for coordinate-based positioning) */\n readonly y?: number;\n /** Text wrapping behavior */\n readonly wrap?: (typeof FrameWrap)[keyof typeof FrameWrap];\n /** Number of lines for drop cap */\n readonly lines?: number;\n /** Horizontal anchor reference point */\n readonly anchorHorizontal?: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n /** Vertical anchor reference point */\n readonly anchorVertical?: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n /** Horizontal spacing in twips */\n readonly spaceHorizontal?: number;\n /** Vertical spacing in twips */\n readonly spaceVertical?: number;\n /** Height rule */\n readonly rule?: (typeof HeightRule)[keyof typeof HeightRule];\n /** Horizontal alignment (for alignment-based positioning) */\n readonly alignmentX?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];\n /** Vertical alignment (for alignment-based positioning) */\n readonly alignmentY?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];\n}\n\n/**\n * Creates a frame properties XML component for paragraph text frames.\n *\n * Frames allow paragraphs to be positioned absolutely on the page with text wrapping.\n * They support both coordinate-based and alignment-based positioning, along with\n * drop cap effects and various text wrapping options.\n *\n * Reference: http://officeopenxml.com/WPparagraph-textFrames.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FramePr\">\n * <xsd:attribute name=\"dropCap\" type=\"ST_DropCap\" use=\"optional\"/>\n * <xsd:attribute name=\"lines\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"w\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"h\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"vSpace\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"hSpace\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"wrap\" type=\"ST_Wrap\" use=\"optional\"/>\n * <xsd:attribute name=\"hAnchor\" type=\"ST_HAnchor\" use=\"optional\"/>\n * <xsd:attribute name=\"vAnchor\" type=\"ST_VAnchor\" use=\"optional\"/>\n * <xsd:attribute name=\"x\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"xAlign\" type=\"s:ST_XAlign\" use=\"optional\"/>\n * <xsd:attribute name=\"y\" type=\"ST_SignedTwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"yAlign\" type=\"s:ST_YAlign\" use=\"optional\"/>\n * <xsd:attribute name=\"hRule\" type=\"ST_HeightRule\" use=\"optional\"/>\n * <xsd:attribute name=\"anchorLock\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Frame with absolute positioning\n * createFrameProperties({\n * type: \"absolute\",\n * position: { x: 1440, y: 1440 }, // 1 inch from anchor\n * width: 2880, // 2 inches\n * height: 1440, // 1 inch\n * anchor: {\n * horizontal: FrameAnchorType.PAGE,\n * vertical: FrameAnchorType.PAGE,\n * },\n * wrap: FrameWrap.AROUND,\n * });\n *\n * // Frame with alignment positioning and drop cap\n * createFrameProperties({\n * type: \"alignment\",\n * alignment: {\n * x: HorizontalPositionAlign.LEFT,\n * y: VerticalPositionAlign.TOP,\n * },\n * width: 1440,\n * height: 1440,\n * anchor: {\n * horizontal: FrameAnchorType.TEXT,\n * vertical: FrameAnchorType.TEXT,\n * },\n * dropCap: DropCapType.DROP,\n * lines: 3,\n * });\n * ```\n *\n * @param options - Frame positioning and formatting options\n * @returns XmlComponent representing the frame properties element\n */\nexport const createFrameProperties = (options: IFrameOptions): XmlComponent =>\n new BuilderElement<FramePropertiesAttributes>({\n attributes: {\n alignmentX: {\n key: \"w:xAlign\",\n value: (options as IAlignmentFrameOptions).alignment\n ? (options as IAlignmentFrameOptions).alignment.x\n : undefined,\n },\n alignmentY: {\n key: \"w:yAlign\",\n value: (options as IAlignmentFrameOptions).alignment\n ? (options as IAlignmentFrameOptions).alignment.y\n : undefined,\n },\n anchorHorizontal: {\n key: \"w:hAnchor\",\n value: options.anchor.horizontal,\n },\n anchorLock: {\n key: \"w:anchorLock\",\n value: options.anchorLock,\n },\n anchorVertical: {\n key: \"w:vAnchor\",\n value: options.anchor.vertical,\n },\n dropCap: {\n key: \"w:dropCap\",\n value: options.dropCap,\n },\n height: {\n key: \"w:h\",\n value: options.height,\n },\n lines: {\n key: \"w:lines\",\n value: options.lines,\n },\n rule: {\n key: \"w:hRule\",\n value: options.rule,\n },\n spaceHorizontal: {\n key: \"w:hSpace\",\n value: options.space?.horizontal,\n },\n spaceVertical: {\n key: \"w:vSpace\",\n value: options.space?.vertical,\n },\n width: {\n key: \"w:w\",\n value: options.width,\n },\n wrap: {\n key: \"w:wrap\",\n value: options.wrap,\n },\n x: {\n key: \"w:x\",\n value: (options as IXYFrameOptions).position\n ? (options as IXYFrameOptions).position.x\n : undefined,\n },\n y: {\n key: \"w:y\",\n value: (options as IXYFrameOptions).position\n ? (options as IXYFrameOptions).position.y\n : undefined,\n },\n },\n name: \"w:framePr\",\n });\n\nexport const buildFramePropertiesObj = (options: IFrameOptions): IXmlableObject =>\n attrObj(\"w:framePr\", {\n \"w:xAlign\": (options as IAlignmentFrameOptions).alignment\n ? (options as IAlignmentFrameOptions).alignment.x\n : undefined,\n \"w:yAlign\": (options as IAlignmentFrameOptions).alignment\n ? (options as IAlignmentFrameOptions).alignment.y\n : undefined,\n \"w:hAnchor\": options.anchor.horizontal,\n \"w:anchorLock\": options.anchorLock,\n \"w:vAnchor\": options.anchor.vertical,\n \"w:dropCap\": options.dropCap,\n \"w:h\": options.height,\n \"w:lines\": options.lines,\n \"w:hRule\": options.rule,\n \"w:hSpace\": options.space?.horizontal,\n \"w:vSpace\": options.space?.vertical,\n \"w:w\": options.width,\n \"w:wrap\": options.wrap,\n \"w:x\": (options as IXYFrameOptions).position\n ? (options as IXYFrameOptions).position.x\n : undefined,\n \"w:y\": (options as IXYFrameOptions).position\n ? (options as IXYFrameOptions).position.y\n : undefined,\n });\n","/**\n * Paragraph properties module for WordprocessingML documents.\n *\n * This module provides the paragraph properties (pPr) element which specifies\n * the formatting applied to a paragraph.\n *\n * Reference: http://officeopenxml.com/WPparagraphProperties.php\n *\n * @see https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_suppressLineNumbers_topic_ID0ECJAO.html\n *\n * @module\n */\nimport type { ChangedAttributesProperties } from \"@file/track-revision/track-revision\";\nimport {\n BuilderElement,\n IgnoreIfEmptyXmlComponent,\n XmlComponent,\n numberValObj,\n onOffObj,\n stringEnumValObj,\n stringValObj,\n} from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport type { IParagraphRunOptions } from \".\";\nimport { FontWrapper } from \"../fonts/font-wrapper\";\nimport { buildShadingObj, createShading } from \"../shading\";\nimport type { ShadingAttributesProperties } from \"../shading\";\nimport { createAlignment } from \"./formatting/alignment\";\nimport type { AlignmentType } from \"./formatting/alignment\";\nimport {\n Border,\n ThematicBreak,\n buildParagraphBorders,\n buildThematicBreakObj,\n} from \"./formatting/border\";\nimport type { BordersOptions } from \"./formatting/border\";\nimport { PageBreakBefore } from \"./formatting/break\";\nimport { buildCnfStyleObj, createCnfStyle } from \"./formatting/cnf-style\";\nimport type { CnfConditionalOptions } from \"./formatting/cnf-style\";\nimport { buildIndentObj, createIndent } from \"./formatting/indent\";\nimport type { IndentAttributesProperties } from \"./formatting/indent\";\nimport { buildSpacingObj, createSpacing } from \"./formatting/spacing\";\nimport type { SpacingProperties } from \"./formatting/spacing\";\nimport { createParagraphStyle } from \"./formatting/style\";\nimport type { HeadingLevel } from \"./formatting/style\";\nimport { buildTabStopObj, TabStopType, createTabStop } from \"./formatting/tab-stop\";\nimport type { TabStopDefinition } from \"./formatting/tab-stop\";\nimport { NumberProperties, buildNumberProperties } from \"./formatting/unordered-list\";\nimport { createWordWrap } from \"./formatting/word-wrap\";\nimport { buildFramePropertiesObj, createFrameProperties } from \"./frame/frame-properties\";\nimport type { IFrameOptions } from \"./frame/frame-properties\";\nimport { buildDivIdObj, buildOutlineLevelObj, createDivId, createOutlineLevel } from \"./links\";\nimport { buildRunProperties, ParagraphRunProperties } from \"./run/properties\";\n\n/**\n * Vertical text alignment types for paragraphs.\n *\n * Specifies the vertical alignment of text within the paragraph.\n *\n * @publicApi\n */\nexport const TextAlignmentType = {\n /** Align text to the top */\n TOP: \"top\",\n /** Align text to the center */\n CENTER: \"center\",\n /** Align text to the baseline */\n BASELINE: \"baseline\",\n /** Align text to the bottom */\n BOTTOM: \"bottom\",\n /** Automatically determine vertical alignment */\n AUTO: \"auto\",\n} as const;\n\n/**\n * Textbox tight wrap types for paragraphs.\n *\n * Specifies how tightly text wraps around a textbox.\n *\n * @publicApi\n */\nexport const TextboxTightWrapType = {\n /** No tight wrapping */\n NONE: \"none\",\n /** Tight wrap on all lines */\n ALL_LINES: \"allLines\",\n /** Tight wrap on first and last lines */\n FIRST_AND_LAST_LINE: \"firstAndLastLine\",\n /** Tight wrap on first line only */\n FIRST_LINE_ONLY: \"firstLineOnly\",\n /** Tight wrap on last line only */\n LAST_LINE_ONLY: \"lastLineOnly\",\n} as const;\n\n/**\n * Paragraph style properties for numbering levels.\n *\n * These properties are used when defining paragraph styles within numbering level definitions.\n */\nexport interface LevelParagraphStylePropertiesOptions {\n /** Paragraph text alignment (left, right, center, justified, etc.) */\n readonly alignment?: (typeof AlignmentType)[keyof typeof AlignmentType];\n /** Whether to render text right-to-left for bidirectional languages */\n readonly bidirectional?: boolean;\n /** Whether to insert a page break before this paragraph */\n readonly pageBreakBefore?: boolean;\n /** Custom tab stop positions and alignments */\n readonly tabStops?: readonly TabStopDefinition[];\n /** Whether to display a horizontal line (thematic break) below the paragraph */\n readonly thematicBreak?: boolean;\n /** Whether to prevent single lines at top/bottom of page (widow/orphan control), defaults to true */\n readonly widowControl?: boolean;\n /** Whether to ignore spacing before/after when adjacent paragraphs have the same style */\n readonly contextualSpacing?: boolean;\n /** Position in twips for a right-aligned tab stop */\n readonly rightTabStop?: number;\n /** Position in twips for a left-aligned tab stop */\n readonly leftTabStop?: number;\n /** Indentation settings for the paragraph */\n readonly indent?: IndentAttributesProperties;\n /** Spacing before/after paragraph and between lines */\n readonly spacing?: SpacingProperties;\n /**\n * Specifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible. If multiple paragraphs are to be kept together but they exceed a page, then the set of paragraphs begin on a new page and page breaks are used thereafter as needed.\n */\n readonly keepNext?: boolean;\n /**\n * Specifies that all lines of the paragraph are to be kept on a single page when possible.\n */\n readonly keepLines?: boolean;\n /** Frame properties for positioning the paragraph */\n readonly frame?: IFrameOptions;\n /** Whether to suppress line numbers for this paragraph */\n readonly suppressLineNumbers?: boolean;\n /** Whether to allow word wrapping */\n readonly wordWrap?: boolean;\n /** Whether to allow punctuation to extend beyond text margins */\n readonly overflowPunctuation?: boolean;\n /**\n * This element specifies whether inter-character spacing shall automatically be adjusted between regions of numbers and regions of East Asian text in the current paragraph. These regions shall be determined by the Unicode character values of the text content within the paragraph.\n * This only works in Microsoft Word. It is not part of the ECMA-376 OOXML standard.\n */\n readonly autoSpaceEastAsianText?: boolean;\n /** Whether to prevent text frames from overlapping */\n readonly suppressOverlap?: boolean;\n /** Whether to disable automatic hyphenation for this paragraph */\n readonly suppressAutoHyphens?: boolean;\n /** Whether to automatically adjust right indent for document grid */\n readonly adjustRightInd?: boolean;\n /** Whether to snap the current paragraph to the document grid */\n readonly snapToGrid?: boolean;\n /** Whether to swap left and right indent positions on odd pages for mirrored layouts */\n readonly mirrorIndents?: boolean;\n /** Whether to use Kinsoku forbidden character overflow rules */\n readonly kinsoku?: boolean;\n /** Whether to compress punctuation at the start of a line */\n readonly topLinePunct?: boolean;\n /** Whether to automatically add space between East Asian and Latin text */\n readonly autoSpaceDE?: boolean;\n /** Vertical text alignment within the paragraph */\n readonly textAlignment?: (typeof TextAlignmentType)[keyof typeof TextAlignmentType];\n /** Textbox tight wrap setting */\n readonly textboxTightWrap?: (typeof TextboxTightWrapType)[keyof typeof TextboxTightWrapType];\n /** Text direction for the paragraph (lr, rl, tb, tbV, rlV, lrV) */\n readonly textDirection?: \"lr\" | \"rl\" | \"tb\" | \"tbV\" | \"rlV\" | \"lrV\";\n /** Outline level for table of contents and document outline (0-9) */\n readonly outlineLevel?: number;\n /** HTML div ID reference */\n readonly divId?: number;\n /** Conditional formatting style for table rows/cells */\n readonly cnfStyle?: CnfConditionalOptions;\n}\n\n/**\n * Paragraph style properties options.\n *\n * These properties are used when defining paragraph styles and include\n * border, shading, and numbering options in addition to level properties.\n */\nexport type IParagraphStylePropertiesOptions = {\n /** Border settings for the paragraph */\n readonly border?: BordersOptions;\n /** Background shading/fill color for the paragraph */\n readonly shading?: ShadingAttributesProperties;\n /** Numbering configuration for lists, or false to remove numbering */\n readonly numbering?:\n | {\n /** Reference ID of the numbering definition to use */\n readonly reference: string;\n /** Level in the numbering hierarchy (0-8) */\n readonly level: number;\n /** Instance number for multiple lists with same reference */\n readonly instance?: number;\n /** Whether this is a custom numbering definition */\n readonly custom?: boolean;\n }\n | false;\n} & LevelParagraphStylePropertiesOptions;\n\nexport type IParagraphPropertiesOptionsBase = {\n /** Heading level (Heading1, Heading2, etc.) - applies predefined heading style */\n readonly heading?: (typeof HeadingLevel)[keyof typeof HeadingLevel];\n /** Style ID to apply to this paragraph */\n readonly style?: string;\n /** Bullet list configuration */\n readonly bullet?: {\n /** Indentation level for the bullet (0-8) */\n readonly level: number;\n };\n /**\n * Run properties to apply to all runs in the paragraph.\n * Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.1.29.\n */\n readonly run?: IParagraphRunOptions;\n} & IParagraphStylePropertiesOptions;\n\nexport type IParagraphPropertiesChangeOptions = ChangedAttributesProperties &\n IParagraphPropertiesOptionsBase;\n\n/**\n * Options for configuring paragraph properties.\n *\n * These options control all aspects of paragraph formatting including\n * alignment, spacing, indentation, borders, numbering, and more.\n *\n * Reference: http://officeopenxml.com/WPparagraphProperties.php\n */\nexport type ParagraphPropertiesOptions = {\n readonly revision?: IParagraphPropertiesChangeOptions;\n readonly includeIfEmpty?: boolean;\n} & IParagraphPropertiesOptionsBase;\n\n/**\n * Result of building paragraph properties.\n * Includes the XML object and any numbering references that need to be registered.\n */\nexport interface ParagraphPropertiesResult {\n readonly xml: IXmlableObject | undefined;\n readonly numberingReferences: readonly {\n readonly reference: string;\n readonly instance: number;\n }[];\n}\n\n/**\n * Build paragraph properties (w:pPr) as IXmlableObject without allocating XmlComponent tree.\n * Returns both the XML object and any numbering references that need to be registered\n * with the document's numbering context.\n */\nexport function buildParagraphProperties(\n options?: ParagraphPropertiesOptions,\n): ParagraphPropertiesResult {\n const numberingReferences: { reference: string; instance: number }[] = [];\n\n if (!options) {\n return { xml: undefined, numberingReferences };\n }\n\n const children: IXmlableObject[] = [];\n\n if (options.heading) {\n children.push(stringValObj(\"w:pStyle\", options.heading));\n }\n\n if (options.bullet) {\n children.push(stringValObj(\"w:pStyle\", \"ListParagraph\"));\n }\n\n if (options.numbering) {\n if (!options.style && !options.heading) {\n if (!options.numbering.custom) {\n children.push(stringValObj(\"w:pStyle\", \"ListParagraph\"));\n }\n }\n }\n\n if (options.style) {\n children.push(stringValObj(\"w:pStyle\", options.style));\n }\n\n if (options.keepNext !== undefined) {\n children.push(onOffObj(\"w:keepNext\", options.keepNext));\n }\n\n if (options.keepLines !== undefined) {\n children.push(onOffObj(\"w:keepLines\", options.keepLines));\n }\n\n if (options.pageBreakBefore) {\n children.push(onOffObj(\"w:pageBreakBefore\", true));\n }\n\n if (options.frame) {\n children.push(buildFramePropertiesObj(options.frame));\n }\n\n if (options.widowControl !== undefined) {\n children.push(onOffObj(\"w:widowControl\", options.widowControl));\n }\n\n if (options.bullet) {\n children.push(buildNumberProperties(1, options.bullet.level));\n }\n\n if (options.numbering) {\n numberingReferences.push({\n instance: options.numbering.instance ?? 0,\n reference: options.numbering.reference,\n });\n\n children.push(\n buildNumberProperties(\n `${options.numbering.reference}-${options.numbering.instance ?? 0}`,\n options.numbering.level,\n ),\n );\n } else if (options.numbering === false) {\n children.push(buildNumberProperties(0, 0));\n }\n\n if (options.border) {\n const border = buildParagraphBorders(options.border);\n if (border) children.push(border);\n }\n\n if (options.thematicBreak) {\n children.push(buildThematicBreakObj());\n }\n\n if (options.shading) {\n children.push(buildShadingObj(options.shading));\n }\n\n if (options.wordWrap) {\n children.push(numberValObj(\"w:wordWrap\", 0));\n }\n\n if (options.overflowPunctuation) {\n children.push(onOffObj(\"w:overflowPunct\", options.overflowPunctuation));\n }\n\n const tabDefinitions: readonly TabStopDefinition[] = [\n ...(options.rightTabStop !== undefined\n ? [{ position: options.rightTabStop, type: TabStopType.RIGHT }]\n : []),\n ...(options.tabStops ? options.tabStops : []),\n ...(options.leftTabStop !== undefined\n ? [{ position: options.leftTabStop, type: TabStopType.LEFT }]\n : []),\n ];\n\n if (tabDefinitions.length > 0) {\n children.push(buildTabStopObj(tabDefinitions));\n }\n\n if (options.bidirectional !== undefined) {\n children.push(onOffObj(\"w:bidi\", options.bidirectional));\n }\n\n if (options.spacing) {\n children.push(buildSpacingObj(options.spacing));\n }\n\n if (options.indent) {\n children.push(buildIndentObj(options.indent));\n }\n\n if (options.contextualSpacing !== undefined) {\n children.push(onOffObj(\"w:contextualSpacing\", options.contextualSpacing));\n }\n\n if (options.alignment) {\n children.push(stringEnumValObj(\"w:jc\", options.alignment));\n }\n\n if (options.outlineLevel !== undefined) {\n children.push(buildOutlineLevelObj(options.outlineLevel));\n }\n\n if (options.divId !== undefined) {\n children.push(buildDivIdObj(options.divId));\n }\n\n if (options.cnfStyle !== undefined) {\n children.push(buildCnfStyleObj(options.cnfStyle));\n }\n\n if (options.suppressLineNumbers !== undefined) {\n children.push(onOffObj(\"w:suppressLineNumbers\", options.suppressLineNumbers));\n }\n\n if (options.autoSpaceEastAsianText !== undefined) {\n children.push(onOffObj(\"w:autoSpaceDN\", options.autoSpaceEastAsianText));\n }\n\n if (options.suppressAutoHyphens !== undefined) {\n children.push(onOffObj(\"w:suppressAutoHyphens\", options.suppressAutoHyphens));\n }\n\n if (options.adjustRightInd !== undefined) {\n children.push(onOffObj(\"w:adjustRightInd\", options.adjustRightInd));\n }\n\n if (options.snapToGrid !== undefined) {\n children.push(onOffObj(\"w:snapToGrid\", options.snapToGrid));\n }\n\n if (options.mirrorIndents !== undefined) {\n children.push(onOffObj(\"w:mirrorIndents\", options.mirrorIndents));\n }\n\n if (options.kinsoku !== undefined) {\n children.push(onOffObj(\"w:kinsoku\", options.kinsoku));\n }\n\n if (options.topLinePunct !== undefined) {\n children.push(onOffObj(\"w:topLinePunct\", options.topLinePunct));\n }\n\n if (options.autoSpaceDE !== undefined) {\n children.push(onOffObj(\"w:autoSpaceDE\", options.autoSpaceDE));\n }\n\n if (options.textAlignment !== undefined) {\n children.push(stringEnumValObj(\"w:textAlignment\", options.textAlignment));\n }\n\n if (options.textboxTightWrap !== undefined) {\n children.push(stringEnumValObj(\"w:textboxTightWrap\", options.textboxTightWrap));\n }\n\n if (options.textDirection !== undefined) {\n children.push(stringEnumValObj(\"w:textDirection\", options.textDirection));\n }\n\n if (options.suppressOverlap !== undefined) {\n children.push(onOffObj(\"w:suppressOverlap\", options.suppressOverlap));\n }\n\n if (options.run) {\n const rPr = buildRunProperties(options.run);\n if (rPr) {\n const rPrChildren = rPr[\"w:rPr\"] as IXmlableObject[];\n if (options.run.insertion) {\n const { id, author, date } = options.run.insertion;\n rPrChildren.push({\n \"w:ins\": [{ _attr: { \"w:id\": id, \"w:author\": author, \"w:date\": date } }],\n });\n }\n if (options.run.deletion) {\n const { id, author, date } = options.run.deletion;\n rPrChildren.push({\n \"w:del\": [{ _attr: { \"w:id\": id, \"w:author\": author, \"w:date\": date } }],\n });\n }\n children.push(rPr);\n }\n }\n\n if (options.revision) {\n const rev = options.revision;\n const { author: _, date: __, id: ___, ...originalProps } = rev;\n const pPrChangeChildren: (IXmlableObject | { _attr: Record<string, string | number> })[] = [\n { _attr: { \"w:author\": rev.author, \"w:date\": rev.date, \"w:id\": rev.id } },\n ];\n // PPr is required (minOccurs=\"1\") even if empty — use original properties from revision\n const innerPPr = buildParagraphProperties({ ...originalProps, includeIfEmpty: true });\n if (innerPPr?.xml) pPrChangeChildren.push(innerPPr.xml);\n children.push({ \"w:pPrChange\": pPrChangeChildren });\n }\n\n const xml = options.includeIfEmpty || children.length > 0 ? { \"w:pPr\": children } : undefined;\n\n return { xml, numberingReferences };\n}\n\n/**\n * Represents paragraph properties (pPr) in a WordprocessingML document.\n *\n * The paragraph properties element specifies all formatting applied to a paragraph,\n * including alignment, spacing, indentation, borders, numbering, and style references.\n *\n * Reference: http://officeopenxml.com/WPparagraphProperties.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PPr\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_PPrBase\">\n * <xsd:sequence>\n * <xsd:element name=\"rPr\" type=\"CT_ParaRPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"sectPr\" type=\"CT_SectPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"pPrChange\" type=\"CT_PPrChange\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * The base type CT_PPrBase contains:\n * ```xml\n * <xsd:complexType name=\"CT_PPrBase\">\n * <xsd:sequence>\n * <xsd:element name=\"pStyle\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"keepNext\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"keepLines\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"pageBreakBefore\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"framePr\" type=\"CT_FramePr\" minOccurs=\"0\"/>\n * <xsd:element name=\"widowControl\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"numPr\" type=\"CT_NumPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"suppressLineNumbers\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"pBdr\" type=\"CT_PBdr\" minOccurs=\"0\"/>\n * <xsd:element name=\"shd\" type=\"CT_Shd\" minOccurs=\"0\"/>\n * <xsd:element name=\"tabs\" type=\"CT_Tabs\" minOccurs=\"0\"/>\n * <xsd:element name=\"suppressAutoHyphens\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"kinsoku\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"wordWrap\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"overflowPunct\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"topLinePunct\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"autoSpaceDE\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"autoSpaceDN\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"bidi\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"adjustRightInd\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"snapToGrid\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"spacing\" type=\"CT_Spacing\" minOccurs=\"0\"/>\n * <xsd:element name=\"ind\" type=\"CT_Ind\" minOccurs=\"0\"/>\n * <xsd:element name=\"contextualSpacing\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"mirrorIndents\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"suppressOverlap\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"jc\" type=\"CT_Jc\" minOccurs=\"0\"/>\n * <xsd:element name=\"textDirection\" type=\"CT_TextDirection\" minOccurs=\"0\"/>\n * <xsd:element name=\"textAlignment\" type=\"CT_TextAlignment\" minOccurs=\"0\"/>\n * <xsd:element name=\"textboxTightWrap\" type=\"CT_TextboxTightWrap\" minOccurs=\"0\"/>\n * <xsd:element name=\"outlineLvl\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"divId\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"cnfStyle\" type=\"CT_Cnf\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Basic paragraph with alignment\n * new ParagraphProperties({\n * alignment: AlignmentType.CENTER,\n * });\n *\n * // Formatted paragraph with spacing and indentation\n * new ParagraphProperties({\n * alignment: AlignmentType.JUSTIFIED,\n * spacing: { before: 200, after: 200, line: 360 },\n * indent: { left: 720, right: 720 },\n * });\n *\n * // Heading with outline level\n * new ParagraphProperties({\n * heading: HeadingLevel.HEADING_1,\n * outlineLevel: 0,\n * keepNext: true,\n * });\n *\n * // Numbered list item\n * new ParagraphProperties({\n * numbering: {\n * reference: \"my-numbering\",\n * level: 0,\n * instance: 0,\n * },\n * });\n *\n * // Paragraph with borders and shading\n * new ParagraphProperties({\n * border: {\n * top: { style: BorderStyle.SINGLE, size: 6, color: \"000000\" },\n * bottom: { style: BorderStyle.SINGLE, size: 6, color: \"000000\" },\n * },\n * shading: { fill: \"EEEEEE\" },\n * });\n * ```\n */\nexport class ParagraphProperties extends IgnoreIfEmptyXmlComponent {\n private readonly numberingReferences: {\n readonly reference: string;\n readonly instance: number;\n }[] = [];\n\n public constructor(options?: ParagraphPropertiesOptions) {\n super(\"w:pPr\", options?.includeIfEmpty);\n\n if (!options) {\n return this;\n }\n\n if (options.heading) {\n this.root.push(createParagraphStyle(options.heading));\n }\n\n if (options.bullet) {\n this.root.push(createParagraphStyle(\"ListParagraph\"));\n }\n\n if (options.numbering) {\n if (!options.style && !options.heading) {\n if (!options.numbering.custom) {\n this.root.push(createParagraphStyle(\"ListParagraph\"));\n }\n }\n }\n\n if (options.style) {\n this.root.push(createParagraphStyle(options.style));\n }\n\n if (options.keepNext !== undefined) {\n this.root.push(onOffObj(\"w:keepNext\", options.keepNext));\n }\n\n if (options.keepLines !== undefined) {\n this.root.push(onOffObj(\"w:keepLines\", options.keepLines));\n }\n\n if (options.pageBreakBefore) {\n this.root.push(new PageBreakBefore());\n }\n\n if (options.frame) {\n this.root.push(createFrameProperties(options.frame));\n }\n\n if (options.widowControl !== undefined) {\n this.root.push(onOffObj(\"w:widowControl\", options.widowControl));\n }\n\n if (options.bullet) {\n this.root.push(new NumberProperties(1, options.bullet.level));\n }\n\n if (options.numbering) {\n this.numberingReferences.push({\n instance: options.numbering.instance ?? 0,\n reference: options.numbering.reference,\n });\n\n this.root.push(\n new NumberProperties(\n `${options.numbering.reference}-${options.numbering.instance ?? 0}`,\n options.numbering.level,\n ),\n );\n } else if (options.numbering === false) {\n this.root.push(new NumberProperties(0, 0));\n }\n\n if (options.border) {\n this.root.push(new Border(options.border));\n }\n\n if (options.thematicBreak) {\n this.root.push(new ThematicBreak());\n }\n\n if (options.shading) {\n this.root.push(createShading(options.shading));\n }\n\n if (options.wordWrap) {\n this.root.push(createWordWrap());\n }\n\n if (options.overflowPunctuation) {\n this.root.push(onOffObj(\"w:overflowPunct\", options.overflowPunctuation));\n }\n\n /**\n * FIX: Multitab support for Libre Writer\n * Ensure there is only one w:tabs tag with multiple w:tab\n */\n const tabDefinitions: readonly TabStopDefinition[] = [\n ...(options.rightTabStop !== undefined\n ? [{ position: options.rightTabStop, type: TabStopType.RIGHT }]\n : []),\n ...(options.tabStops ? options.tabStops : []),\n ...(options.leftTabStop !== undefined\n ? [{ position: options.leftTabStop, type: TabStopType.LEFT }]\n : []),\n ];\n\n if (tabDefinitions.length > 0) {\n this.root.push(createTabStop(tabDefinitions));\n }\n /**\n * FIX - END\n */\n\n if (options.bidirectional !== undefined) {\n this.root.push(onOffObj(\"w:bidi\", options.bidirectional));\n }\n\n if (options.spacing) {\n this.root.push(createSpacing(options.spacing));\n }\n\n if (options.indent) {\n this.root.push(createIndent(options.indent));\n }\n\n if (options.contextualSpacing !== undefined) {\n this.root.push(onOffObj(\"w:contextualSpacing\", options.contextualSpacing));\n }\n\n if (options.alignment) {\n this.root.push(createAlignment(options.alignment));\n }\n\n if (options.outlineLevel !== undefined) {\n this.root.push(createOutlineLevel(options.outlineLevel));\n }\n\n if (options.divId !== undefined) {\n this.root.push(createDivId(options.divId));\n }\n\n if (options.cnfStyle !== undefined) {\n this.root.push(createCnfStyle(options.cnfStyle));\n }\n\n if (options.suppressLineNumbers !== undefined) {\n this.root.push(onOffObj(\"w:suppressLineNumbers\", options.suppressLineNumbers));\n }\n\n if (options.autoSpaceEastAsianText !== undefined) {\n this.root.push(onOffObj(\"w:autoSpaceDN\", options.autoSpaceEastAsianText));\n }\n\n if (options.suppressAutoHyphens !== undefined) {\n this.root.push(onOffObj(\"w:suppressAutoHyphens\", options.suppressAutoHyphens));\n }\n\n if (options.adjustRightInd !== undefined) {\n this.root.push(onOffObj(\"w:adjustRightInd\", options.adjustRightInd));\n }\n\n if (options.snapToGrid !== undefined) {\n this.root.push(onOffObj(\"w:snapToGrid\", options.snapToGrid));\n }\n\n if (options.mirrorIndents !== undefined) {\n this.root.push(onOffObj(\"w:mirrorIndents\", options.mirrorIndents));\n }\n\n if (options.kinsoku !== undefined) {\n this.root.push(onOffObj(\"w:kinsoku\", options.kinsoku));\n }\n\n if (options.topLinePunct !== undefined) {\n this.root.push(onOffObj(\"w:topLinePunct\", options.topLinePunct));\n }\n\n if (options.autoSpaceDE !== undefined) {\n this.root.push(onOffObj(\"w:autoSpaceDE\", options.autoSpaceDE));\n }\n\n if (options.textAlignment !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: { key: \"w:val\", value: options.textAlignment },\n },\n name: \"w:textAlignment\",\n }),\n );\n }\n\n if (options.textboxTightWrap !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: { key: \"w:val\", value: options.textboxTightWrap },\n },\n name: \"w:textboxTightWrap\",\n }),\n );\n }\n\n if (options.textDirection !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: { key: \"w:val\", value: options.textDirection },\n },\n name: \"w:textDirection\",\n }),\n );\n }\n\n if (options.suppressOverlap !== undefined) {\n this.root.push(onOffObj(\"w:suppressOverlap\", options.suppressOverlap));\n }\n\n if (options.run) {\n this.root.push(new ParagraphRunProperties(options.run));\n }\n\n if (options.revision) {\n this.root.push(new ParagraphPropertiesChange(options.revision));\n }\n }\n\n /**\n * Adds a property element to the paragraph properties.\n *\n * @param item - The XML component to add to the paragraph properties\n */\n public push(item: XmlComponent): void {\n this.root.push(item);\n }\n\n /**\n * Prepares the paragraph properties for XML serialization.\n *\n * This method creates concrete numbering instances for any numbering references\n * before the properties are converted to XML.\n *\n * @param context - The XML context containing document and file information\n * @returns The prepared XML object, or undefined if the component should be ignored\n */\n public prepForXml(context: Context): IXmlableObject | undefined {\n if (!(context.viewWrapper instanceof FontWrapper)) {\n for (const reference of this.numberingReferences) {\n context.file.numbering.createConcreteNumberingInstance(\n reference.reference,\n reference.instance,\n );\n }\n }\n\n return super.prepForXml(context);\n }\n\n /**\n * Register numbering references (side effect) before serialization.\n * toXml() bypasses prepForXml(), so numbering registration must be\n * triggered explicitly here.\n */\n public override toXml(context: Context): string {\n // Trigger the same side effects as prepForXml() for numbering registration\n if (!(context.viewWrapper instanceof FontWrapper)) {\n for (const reference of this.numberingReferences) {\n context.file.numbering.createConcreteNumberingInstance(\n reference.reference,\n reference.instance,\n );\n }\n }\n return super.toXml(context);\n }\n}\n\nexport class ParagraphPropertiesChange extends XmlComponent {\n public constructor(options: IParagraphPropertiesChangeOptions) {\n super(\"w:pPrChange\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n // PPr is required (minOccurs=\"1\") even if empty\n this.root.push(new ParagraphProperties({ ...options, includeIfEmpty: true }));\n }\n}\n","import type { FootnoteReferenceRun } from \"@file/footnotes\";\n/**\n * Paragraph module for WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPparagraph.php\n *\n * @module\n */\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { xml } from \"@office-open/xml\";\nimport { uniqueId } from \"@util/convenience-functions\";\n\nimport type { AltChunk } from \"../alt-chunk\";\nimport type { CheckBox } from \"../checkbox\";\nimport type { SectionProperties } from \"../document/body/section-properties/section-properties\";\nimport type { FileChild } from \"../file-child\";\nimport { FontWrapper } from \"../fonts/font-wrapper\";\nimport type { PermEnd, PermStart } from \"../permissions\";\nimport { TargetModeType } from \"../relationships/relationship/relationship\";\nimport type { StructuredDocumentTagRun } from \"../sdt\";\nimport type { SubDoc } from \"../sub-doc\";\nimport type { MovedFromTextRun, MovedToTextRun } from \"../track-revision\";\nimport type { ChangedAttributesProperties } from \"../track-revision/track-revision\";\nimport { DeletedTextRun } from \"../track-revision/track-revision-components/deleted-text-run\";\n// Import from specific submodule to avoid circular dependency:\n// paragraph.ts → track-revision barrel → inserted-text-run → ../../index (paragraph barrel)\nimport { InsertedTextRun } from \"../track-revision/track-revision-components/inserted-text-run\";\nimport type { ColumnBreak, PageBreak } from \"./formatting/break\";\nimport { PageBreak as PageBreakCls, ColumnBreak as ColumnBreakCls } from \"./formatting/break\";\nimport {\n Bookmark,\n BookmarkEnd,\n BookmarkStart,\n ConcreteHyperlink,\n ExternalHyperlink,\n InternalHyperlink,\n} from \"./links\";\nimport type { Dir, Bdo } from \"./links/bidi\";\nimport type {\n MoveFromRangeEnd,\n MoveFromRangeStart,\n MoveToRangeEnd,\n MoveToRangeStart,\n} from \"./links/move-bookmark\";\nimport { Math as MathCls } from \"./math\";\nimport type { MathOptions, MathComponent } from \"./math\";\nimport { coerceMathJson, type MathJson } from \"./math/math-coerce\";\ntype Math = InstanceType<typeof MathCls>;\n// Same pattern for endnotes — specific submodule avoids barrel circular dependency.\nimport { EndnoteReferenceRun as EndnoteRefCls } from \"@file/endnotes/endnote/run/reference-run\";\n// Import from specific submodule to avoid circular dependency:\n// paragraph.ts → @file/footnotes barrel → footnotes.ts → imports Paragraph → paragraph.ts\n// But @file/footnotes/footnote/run/reference-run only imports Run from @file/paragraph/run — no cycle.\nimport { FootnoteReferenceRun as FootnoteRefCls } from \"@file/footnotes/footnote/run/reference-run\";\n\nimport { buildParagraphProperties } from \"./properties\";\nimport type { ParagraphPropertiesOptions } from \"./properties\";\nimport { TextRun } from \"./run\";\nimport type { Run, SequentialIdentifier, SimpleField, SimpleMailMergeField } from \"./run\";\nimport type { RunOptions } from \"./run\";\nimport type {\n ChartRun as ChartRunType,\n ImageRun as ImageRunType,\n SmartArtRun as SmartArtRunType,\n} from \"./run\";\nimport { ChartRun } from \"./run/chart-run\";\nimport type { ChartOptions } from \"./run/chart-run\";\nimport { Comment, CommentRangeEnd, CommentRangeStart, CommentReference } from \"./run/comment-run\";\nimport type { Comments } from \"./run/comment-run\";\nimport { ImageRun } from \"./run/image-run\";\nimport type { IImageOptions } from \"./run/image-run\";\nimport { SmartArtRun } from \"./run/smartart-run\";\nimport type { SmartArtOptions } from \"./run/smartart-run\";\nimport { SymbolRun } from \"./run/symbol-run\";\nimport type { ISymbolRunOptions } from \"./run/symbol-run\";\n\n/**\n * The types of children that can be contained within a Paragraph element.\n * This union type represents all valid inline content elements that can appear\n * within a paragraph in WordprocessingML.\n */\nexport type ParagraphChild =\n | TextRun\n | ImageRunType\n | SymbolRun\n | Bookmark\n | PageBreak\n | ColumnBreak\n | SequentialIdentifier\n | FootnoteReferenceRun\n | InternalHyperlink\n | ExternalHyperlink\n | InsertedTextRun\n | DeletedTextRun\n | Math\n | SimpleField\n | SimpleMailMergeField\n | ChartRunType\n | SmartArtRunType\n | Comments\n | Comment\n | CommentRangeStart\n | CommentRangeEnd\n | CommentReference\n | CheckBox\n | StructuredDocumentTagRun\n | MoveFromRangeStart\n | MoveFromRangeEnd\n | MoveToRangeStart\n | MoveToRangeEnd\n | MovedFromTextRun\n | MovedToTextRun\n | PermStart\n | PermEnd\n | Dir\n | Bdo\n | AltChunk\n | SubDoc;\n\n/** JSON-friendly wrapper for ChartRun options in paragraph children. */\nexport interface ChartChild {\n readonly chart: ChartOptions;\n}\n\n/** JSON-friendly wrapper for SmartArtRun options in paragraph children. */\nexport interface SmartArtChild {\n readonly smartArt: SmartArtOptions;\n}\n\n/** JSON-friendly wrapper for ImageRun options in paragraph children. */\nexport interface ImageChild {\n readonly image: IImageOptions;\n}\n\n/** JSON-friendly wrapper for Math options in paragraph children.\n * Unlike MathOptions, children accept recursive JSON objects via {@link MathJson}. */\nexport interface MathChild {\n readonly math: Omit<MathOptions, \"children\"> & {\n readonly children?: readonly MathJson[];\n };\n}\n\n/** JSON-friendly wrappers for simple paragraph child types (JSON API). */\nexport type IParagraphJsonChild =\n | ChartChild\n | SmartArtChild\n | ImageChild\n | MathChild\n | { readonly symbolRun: ISymbolRunOptions }\n | { readonly footnoteReference: number }\n | { readonly endnoteReference: number }\n | { readonly pageBreak: true }\n | { readonly columnBreak: true }\n | { readonly commentRangeStart: number }\n | { readonly commentRangeEnd: number }\n | { readonly commentReference: number }\n | { readonly insertion: RunOptions & ChangedAttributesProperties }\n | { readonly deletion: RunOptions & ChangedAttributesProperties }\n | {\n readonly hyperlink: {\n readonly link?: string;\n readonly anchor?: string;\n readonly tooltip?: string;\n readonly children?: readonly (RunOptions | string)[];\n };\n }\n | { readonly bookmarkStart: { readonly id: number; readonly name: string } }\n | { readonly bookmarkEnd: number };\n\n/**\n * Options for creating a Paragraph element.\n *\n * @property text - Simple text content for the paragraph (creates a single TextRun)\n * @property children - Array of child elements (runs, hyperlinks, bookmarks, etc.)\n */\nexport type ParagraphOptions = {\n /** Simple text content for the paragraph. Creates a single TextRun. */\n readonly text?: string;\n /** Array of child elements such as TextRun, ImageRun, Hyperlink, Bookmark, etc.\n * Accepts class instances, plain RunOptions objects (coerced to TextRun),\n * strings (coerced to TextRun), or JSON-friendly wrappers\n * ({ chart }, { smartArt }, { image }, { math }, { symbolRun }, etc.). */\n readonly children?: readonly (ParagraphChild | RunOptions | IParagraphJsonChild | string)[];\n} & ParagraphPropertiesOptions;\n\n/**\n * Represents a paragraph in a WordprocessingML document.\n *\n * A paragraph is the primary unit of block-level content in a document and can contain\n * various inline elements such as text runs, images, hyperlinks, and bookmarks.\n *\n * Reference: http://officeopenxml.com/WPparagraph.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_P\">\n * <xsd:sequence>\n * <xsd:element name=\"pPr\" type=\"CT_PPr\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_PContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"rsidRPr\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidR\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidDel\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidP\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidRDefault\" type=\"ST_LongHexNumber\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple paragraph with text\n * new Paragraph(\"Hello World\");\n *\n * // Paragraph with options\n * new Paragraph({\n * children: [new TextRun(\"Hello\"), new TextRun({ text: \"World\", bold: true })],\n * alignment: AlignmentType.CENTER,\n * });\n * ```\n */\nexport class Paragraph extends BaseXmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n private readonly options: ParagraphOptions;\n private frontRuns: Run[] = [];\n private sectionProperties?: SectionProperties;\n\n // Cached at construction time — options never change.\n private readonly _props: ReturnType<typeof buildParagraphProperties>;\n // Pre-created TextRun for options.text shorthand (avoids allocation in prepForXml).\n private readonly _textRun: TextRun | undefined;\n\n public constructor(options: string | ParagraphOptions) {\n super(\"w:p\");\n\n if (typeof options === \"string\") {\n this.options = { text: options };\n } else {\n this.options = options;\n }\n\n this._props = buildParagraphProperties(this.options);\n this._textRun = this.options.text ? new TextRun(this.options.text) : undefined;\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n // Use cached paragraph properties\n const { xml: pPrObj, numberingReferences } = this._props;\n\n // Register numbering references (same logic as ParagraphProperties.prepForXml)\n if (!(context.viewWrapper instanceof FontWrapper)) {\n for (const reference of numberingReferences) {\n context.file.numbering.createConcreteNumberingInstance(\n reference.reference,\n reference.instance,\n );\n }\n }\n\n // Append section properties to pPr children if present\n let finalPPrObj = pPrObj;\n if (this.sectionProperties) {\n const sectPrObj = this.sectionProperties.prepForXml(context);\n if (sectPrObj) {\n if (finalPPrObj) {\n (finalPPrObj[\"w:pPr\"] as IXmlableObject[]).push(sectPrObj);\n } else {\n finalPPrObj = { \"w:pPr\": [sectPrObj] };\n }\n }\n }\n\n if (finalPPrObj) children.push(finalPPrObj);\n\n // Front runs (added via addRunToFront)\n for (const run of this.frontRuns) {\n const obj = run.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n // Simple text shorthand — use pre-created TextRun\n if (this._textRun) {\n const obj = this._textRun.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n // Children\n if (this.options.children) {\n for (const rawChild of this.options.children) {\n // Bookmark and ExternalHyperlink are NOT BaseXmlComponent subclasses\n // — they need special handling before coerce.\n if (rawChild instanceof ExternalHyperlink) {\n const concreteHyperlink = new ConcreteHyperlink(rawChild.options.children, uniqueId(), {\n tooltip: rawChild.options.tooltip as string | undefined,\n });\n context.viewWrapper.relationships.addRelationship(\n concreteHyperlink.linkId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n rawChild.options.link,\n TargetModeType.EXTERNAL,\n );\n const obj = concreteHyperlink.prepForXml(context);\n if (obj) children.push(obj);\n continue;\n }\n if (rawChild instanceof Bookmark) {\n const startObj = rawChild.start.prepForXml(context);\n if (startObj) children.push(startObj);\n for (const textRun of rawChild.children) {\n if (textRun instanceof BaseXmlComponent) {\n const obj = textRun.prepForXml(context);\n if (obj) children.push(obj);\n }\n }\n const endObj = rawChild.end.prepForXml(context);\n if (endObj) children.push(endObj);\n continue;\n }\n\n // Coerce strings, JSON wrappers, and plain RunOptions into Run instances\n let child: BaseXmlComponent;\n if (typeof rawChild === \"string\") {\n child = new TextRun(rawChild);\n } else if (rawChild instanceof BaseXmlComponent) {\n child = rawChild;\n } else if (\"chart\" in rawChild) {\n child = new ChartRun(rawChild.chart);\n } else if (\"smartArt\" in rawChild) {\n child = new SmartArtRun(rawChild.smartArt);\n } else if (\"image\" in rawChild) {\n child = new ImageRun(rawChild.image);\n } else if (typeof rawChild === \"object\" && rawChild !== null && \"hyperlink\" in rawChild) {\n // JSON API: { text: \"...\", hyperlink: { link?, anchor?, tooltip?, children? }, ...formatting }\n const { hyperlink, ...runOpts } = rawChild as Record<string, unknown> & {\n hyperlink: Record<string, unknown>;\n };\n const hlChildren = hyperlink.children as readonly (RunOptions | string)[] | undefined;\n const textRuns: TextRun[] = [];\n if (hlChildren && hlChildren.length > 0) {\n for (const rc of hlChildren) {\n textRuns.push(new TextRun(rc as RunOptions));\n }\n } else {\n textRuns.push(new TextRun(runOpts as RunOptions));\n }\n\n if (\"link\" in hyperlink) {\n const ext = new ExternalHyperlink({\n link: hyperlink.link as string,\n tooltip: hyperlink.tooltip as string | undefined,\n children: textRuns,\n });\n const concrete = new ConcreteHyperlink(ext.options.children, uniqueId(), {\n tooltip: ext.options.tooltip as string | undefined,\n });\n context.viewWrapper.relationships.addRelationship(\n concrete.linkId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n ext.options.link,\n TargetModeType.EXTERNAL,\n );\n const obj = concrete.prepForXml(context);\n if (obj) children.push(obj);\n } else if (\"anchor\" in hyperlink) {\n const internal = new InternalHyperlink({\n anchor: hyperlink.anchor as string,\n tooltip: hyperlink.tooltip as string | undefined,\n children: textRuns,\n });\n const obj = internal.prepForXml(context);\n if (obj) children.push(obj);\n }\n continue;\n } else if (\n \"math\" in rawChild &&\n typeof rawChild === \"object\" &&\n rawChild !== null &&\n typeof rawChild.math === \"object\" &&\n rawChild.math !== null\n ) {\n // Coerce MathJson values (strings, plain objects, class instances)\n // to MathComponent instances via recursive coerceMathJson.\n const mathOpts = rawChild.math as Omit<MathOptions, \"children\"> & {\n readonly children?: readonly MathJson[];\n };\n const coercedChildren = mathOpts.children?.map(coerceMathJson) as\n | readonly MathComponent[]\n | undefined;\n child = new MathCls(coercedChildren ? { children: coercedChildren } : { children: [] });\n } else if (\"symbolRun\" in rawChild) {\n child = new SymbolRun(rawChild.symbolRun);\n } else if (\"footnoteReference\" in rawChild) {\n child = new FootnoteRefCls(rawChild.footnoteReference);\n } else if (\"endnoteReference\" in rawChild) {\n child = new EndnoteRefCls(rawChild.endnoteReference);\n } else if (\"pageBreak\" in rawChild) {\n child = new PageBreakCls();\n } else if (\"columnBreak\" in rawChild) {\n child = new ColumnBreakCls();\n } else if (\"commentRangeStart\" in rawChild) {\n child = new CommentRangeStart(rawChild.commentRangeStart);\n } else if (\"commentRangeEnd\" in rawChild) {\n child = new CommentRangeEnd(rawChild.commentRangeEnd);\n } else if (\"commentReference\" in rawChild) {\n child = new TextRun({ children: [new CommentReference(rawChild.commentReference)] });\n } else if (\"bookmarkStart\" in rawChild) {\n const startEl = new BookmarkStart(rawChild.bookmarkStart.name, rawChild.bookmarkStart.id);\n const startObj = startEl.prepForXml(context);\n if (startObj) children.push(startObj);\n continue;\n } else if (\"bookmarkEnd\" in rawChild) {\n const endEl = new BookmarkEnd(rawChild.bookmarkEnd);\n const endObj = endEl.prepForXml(context);\n if (endObj) children.push(endObj);\n continue;\n } else if (\"insertion\" in rawChild) {\n child = new InsertedTextRun(rawChild.insertion);\n } else if (\"deletion\" in rawChild) {\n child = new DeletedTextRun(rawChild.deletion);\n } else {\n child = new TextRun(rawChild as RunOptions);\n }\n\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n }\n\n return { \"w:p\": children.length > 0 ? children : {} };\n }\n\n public addRunToFront(run: Run): Paragraph {\n this.frontRuns.push(run);\n return this;\n }\n\n /** @internal Used by Body to attach section properties for non-last sections. */\n public setSectionProperties(section: SectionProperties): void {\n this.sectionProperties = section;\n }\n\n /**\n * Direct XML serialization — bypasses IXmlableObject tree construction.\n * Coerces children and calls their toXml() methods for zero-allocation output.\n */\n public override toXml(context: Context): string {\n const parts: string[] = [];\n\n // 1. Numbering registration (side effect — same as prepForXml)\n if (!(context.viewWrapper instanceof FontWrapper)) {\n for (const reference of this._props.numberingReferences) {\n context.file.numbering.createConcreteNumberingInstance(\n reference.reference,\n reference.instance,\n );\n }\n }\n\n // 2. Paragraph properties (pre-built IXmlableObject → xml())\n let finalPPrObj = this._props.xml;\n if (this.sectionProperties) {\n const sectPrObj = this.sectionProperties.prepForXml(context);\n if (sectPrObj) {\n if (finalPPrObj) {\n (finalPPrObj[\"w:pPr\"] as IXmlableObject[]).push(sectPrObj);\n } else {\n finalPPrObj = { \"w:pPr\": [sectPrObj] };\n }\n }\n }\n if (finalPPrObj) {\n parts.push(xml(finalPPrObj));\n }\n\n // 3. Front runs\n for (const run of this.frontRuns) {\n const s = run.toXml(context);\n if (s) parts.push(s);\n }\n\n // 4. Pre-created textRun\n if (this._textRun) {\n const s = this._textRun.toXml(context);\n if (s) parts.push(s);\n }\n\n // 5. Children\n if (this.options.children) {\n for (const rawChild of this.options.children) {\n for (const s of this.serializeChild(rawChild, context)) {\n if (s) parts.push(s);\n }\n }\n }\n\n const body = parts.join(\"\");\n return body ? `<w:p>${body}</w:p>` : \"<w:p/>\";\n }\n\n /**\n * Serialize a single child element, handling all type coercions and side effects.\n * Returns an array of XML strings (Bookmark yields 3 parts: start + children + end).\n */\n private serializeChild(\n rawChild: ParagraphChild | RunOptions | IParagraphJsonChild | string,\n context: Context,\n ): string[] {\n // ExternalHyperlink — side effect: register relationship\n if (rawChild instanceof ExternalHyperlink) {\n const concreteHyperlink = new ConcreteHyperlink(rawChild.options.children, uniqueId(), {\n tooltip: rawChild.options.tooltip as string | undefined,\n });\n context.viewWrapper.relationships.addRelationship(\n concreteHyperlink.linkId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n rawChild.options.link,\n TargetModeType.EXTERNAL,\n );\n return [concreteHyperlink.toXml(context)];\n }\n\n // Bookmark — split into start + children + end\n if (rawChild instanceof Bookmark) {\n const parts: string[] = [];\n parts.push(rawChild.start.toXml(context));\n for (const textRun of rawChild.children) {\n if (textRun instanceof BaseXmlComponent) {\n parts.push(textRun.toXml(context));\n }\n }\n parts.push(rawChild.end.toXml(context));\n return parts;\n }\n\n // JSON hyperlink wrapper — side effect: register relationship\n if (typeof rawChild === \"object\" && rawChild !== null && \"hyperlink\" in rawChild) {\n const { hyperlink, ...runOpts } = rawChild as Record<string, unknown> & {\n hyperlink: Record<string, unknown>;\n };\n const hlChildren = hyperlink.children as readonly (RunOptions | string)[] | undefined;\n const textRuns: TextRun[] = [];\n if (hlChildren && hlChildren.length > 0) {\n for (const rc of hlChildren) {\n textRuns.push(new TextRun(rc as RunOptions));\n }\n } else {\n textRuns.push(new TextRun(runOpts as RunOptions));\n }\n\n if (\"link\" in hyperlink) {\n const ext = new ExternalHyperlink({\n link: hyperlink.link as string,\n tooltip: hyperlink.tooltip as string | undefined,\n children: textRuns,\n });\n const concrete = new ConcreteHyperlink(ext.options.children, uniqueId(), {\n tooltip: ext.options.tooltip as string | undefined,\n });\n context.viewWrapper.relationships.addRelationship(\n concrete.linkId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n ext.options.link,\n TargetModeType.EXTERNAL,\n );\n return [concrete.toXml(context)];\n }\n if (\"anchor\" in hyperlink) {\n const internal = new InternalHyperlink({\n anchor: hyperlink.anchor as string,\n tooltip: hyperlink.tooltip as string | undefined,\n children: textRuns,\n });\n return [internal.toXml(context)];\n }\n return [];\n }\n\n // bookmarkStart/bookmarkEnd JSON wrappers — direct serialization\n if (typeof rawChild === \"object\" && rawChild !== null && \"bookmarkStart\" in rawChild) {\n const startEl = new BookmarkStart(rawChild.bookmarkStart.name, rawChild.bookmarkStart.id);\n return [startEl.toXml(context)];\n }\n if (typeof rawChild === \"object\" && rawChild !== null && \"bookmarkEnd\" in rawChild) {\n const endEl = new BookmarkEnd(rawChild.bookmarkEnd);\n return [endEl.toXml(context)];\n }\n\n // Coerce to BaseXmlComponent and serialize\n const child = this.coerceChild(rawChild);\n return child ? [child.toXml(context)] : [];\n }\n\n /** Coerce a raw child option into a BaseXmlComponent instance. */\n private coerceChild(\n rawChild: ParagraphChild | RunOptions | IParagraphJsonChild | string,\n ): BaseXmlComponent | undefined {\n if (typeof rawChild === \"string\") return new TextRun(rawChild);\n if (rawChild instanceof BaseXmlComponent) return rawChild;\n if (\"chart\" in rawChild) return new ChartRun(rawChild.chart);\n if (\"smartArt\" in rawChild) return new SmartArtRun(rawChild.smartArt);\n if (\"image\" in rawChild) return new ImageRun(rawChild.image);\n if (\n \"math\" in rawChild &&\n typeof rawChild === \"object\" &&\n rawChild !== null &&\n typeof rawChild.math === \"object\" &&\n rawChild.math !== null\n ) {\n const mathOpts = rawChild.math as Omit<MathOptions, \"children\"> & {\n readonly children?: readonly MathJson[];\n };\n const coercedChildren = mathOpts.children?.map(coerceMathJson) as\n | readonly MathComponent[]\n | undefined;\n return new MathCls(coercedChildren ? { children: coercedChildren } : { children: [] });\n }\n if (\"symbolRun\" in rawChild) return new SymbolRun(rawChild.symbolRun);\n if (\"footnoteReference\" in rawChild) return new FootnoteRefCls(rawChild.footnoteReference);\n if (\"endnoteReference\" in rawChild) return new EndnoteRefCls(rawChild.endnoteReference);\n if (\"pageBreak\" in rawChild) return new PageBreakCls();\n if (\"columnBreak\" in rawChild) return new ColumnBreakCls();\n if (\"commentRangeStart\" in rawChild) return new CommentRangeStart(rawChild.commentRangeStart);\n if (\"commentRangeEnd\" in rawChild) return new CommentRangeEnd(rawChild.commentRangeEnd);\n if (\"commentReference\" in rawChild)\n return new TextRun({ children: [new CommentReference(rawChild.commentReference)] });\n if (\"insertion\" in rawChild) return new InsertedTextRun(rawChild.insertion);\n if (\"deletion\" in rawChild) return new DeletedTextRun(rawChild.deletion);\n // hyperlink/bookmarkStart/bookmarkEnd are handled in serializeChild\n if (\"hyperlink\" in rawChild || \"bookmarkStart\" in rawChild || \"bookmarkEnd\" in rawChild) {\n return undefined;\n }\n return new TextRun(rawChild as RunOptions);\n }\n}\n","/**\n * Comment module for WordprocessingML documents.\n *\n * This module provides support for comments (annotations) in documents. Comments\n * consist of comment ranges (start/end markers), comment references, and the\n * actual comment content.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { Paragraph } from \"@file/paragraph/paragraph\";\nimport type { ParagraphOptions } from \"@file/paragraph/paragraph\";\nimport { Relationships } from \"@file/relationships\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating a single comment.\n *\n * @property id - Unique identifier for the comment\n * @property children - Content of the comment (typically paragraphs)\n * @property initials - Initials of the comment author\n * @property author - Name of the comment author\n * @property date - Date and time the comment was created\n */\nexport interface CommentOptions {\n /** Unique identifier for the comment */\n readonly id: number;\n /** Content of the comment (typically paragraphs).\n * Accepts class instances, plain ParagraphOptions objects, or strings (coerced to Paragraph). */\n readonly children: readonly (FileChild | ParagraphOptions | string)[];\n /** Initials of the comment author */\n readonly initials?: string;\n /** Name of the comment author */\n readonly author?: string;\n /** Date and time the comment was created. Accepts Date or ISO string. */\n readonly date?: Date | string;\n}\n\n/**\n * Options for creating a comments container.\n *\n * @property children - Array of comment definitions\n */\nexport interface CommentsOptions {\n /** Array of comment definitions */\n readonly children: readonly CommentOptions[];\n}\n\n/**\n * Represents the start of a comment range in a WordprocessingML document.\n *\n * Marks the beginning of a region of text that is associated with a comment.\n * Must be paired with a CommentRangeEnd with the same ID.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_MarkupRange\">\n * <xsd:attribute name=\"id\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new CommentRangeStart(0);\n * ```\n */\nexport class CommentRangeStart extends XmlComponent {\n public constructor(id: number) {\n super(\"w:commentRangeStart\");\n\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n\n/**\n * Represents the end of a comment range in a WordprocessingML document.\n *\n * Marks the end of a region of text that is associated with a comment.\n * Must be paired with a CommentRangeStart with the same ID.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_MarkupRange\">\n * <xsd:attribute name=\"id\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new CommentRangeEnd(0);\n * ```\n */\nexport class CommentRangeEnd extends XmlComponent {\n public constructor(id: number) {\n super(\"w:commentRangeEnd\");\n\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n\n/**\n * Represents a reference to a comment in a WordprocessingML document.\n *\n * This element is placed within a run to create a link to a comment.\n * It should be placed after the CommentRangeEnd element.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Markup\">\n * <xsd:attribute name=\"id\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new CommentReference(0);\n * ```\n */\nexport class CommentReference extends XmlComponent {\n public constructor(id: number) {\n super(\"w:commentReference\");\n\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n\n/**\n * Represents a single comment in a WordprocessingML document.\n *\n * Contains the actual content of a comment, including author information\n * and the comment text (typically paragraphs).\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Comment\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"initials\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"author\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"date\" type=\"s:ST_DateTime\"/>\n * <xsd:attribute name=\"id\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Comment({\n * id: 0,\n * author: \"John Doe\",\n * initials: \"JD\",\n * children: [new Paragraph(\"This is a comment\")],\n * });\n * ```\n */\nexport class Comment extends XmlComponent {\n public constructor({ id, initials, author, date = new Date(), children }: CommentOptions) {\n super(\"w:comment\");\n\n const dateStr = typeof date === \"string\" ? date : date.toISOString();\n const attr: Record<string, string | number> = { \"w:id\": id, \"w:date\": dateStr };\n if (author !== undefined) {\n attr[\"w:author\"] = author;\n }\n if (initials !== undefined) {\n attr[\"w:initials\"] = initials;\n }\n this.root.push({ _attr: attr });\n\n for (const rawChild of children) {\n if (rawChild instanceof Paragraph) {\n this.root.push(rawChild);\n } else {\n this.root.push(new Paragraph(rawChild as string | ParagraphOptions));\n }\n }\n }\n}\n\n/**\n * Represents the comments container in a WordprocessingML document.\n *\n * This is the root element for the comments.xml file that stores all\n * comment definitions in the document.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"comments\" type=\"CT_Comments\"/>\n * <xsd:complexType name=\"CT_Comments\">\n * <xsd:sequence>\n * <xsd:element name=\"comment\" type=\"CT_Comment\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Comments({\n * children: [\n * {\n * id: 0,\n * author: \"John Doe\",\n * children: [new Paragraph(\"First comment\")],\n * },\n * {\n * id: 1,\n * author: \"Jane Smith\",\n * children: [new Paragraph(\"Second comment\")],\n * },\n * ],\n * });\n * ```\n */\nexport class Comments extends XmlComponent {\n public readonly relationships: Relationships;\n\n public constructor({ children }: CommentsOptions) {\n super(\"w:comments\");\n\n this.root.push({\n _attr: {\n \"xmlns:aink\": \"http://schemas.microsoft.com/office/drawing/2016/ink\",\n \"xmlns:am3d\": \"http://schemas.microsoft.com/office/drawing/2017/model3d\",\n \"xmlns:cx\": \"http://schemas.microsoft.com/office/drawing/2014/chartex\",\n \"xmlns:cx1\": \"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\",\n \"xmlns:cx2\": \"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\",\n \"xmlns:cx3\": \"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\",\n \"xmlns:cx4\": \"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\",\n \"xmlns:cx5\": \"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\",\n \"xmlns:cx6\": \"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\",\n \"xmlns:cx7\": \"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\",\n \"xmlns:cx8\": \"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\",\n \"xmlns:m\": \"http://schemas.openxmlformats.org/officeDocument/2006/math\",\n \"xmlns:mc\": \"http://schemas.openxmlformats.org/markup-compatibility/2006\",\n \"xmlns:o\": \"urn:schemas-microsoft-com:office:office\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:v\": \"urn:schemas-microsoft-com:vml\",\n \"xmlns:w\": \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\",\n \"xmlns:w10\": \"urn:schemas-microsoft-com:office:word\",\n \"xmlns:w14\": \"http://schemas.microsoft.com/office/word/2010/wordml\",\n \"xmlns:w15\": \"http://schemas.microsoft.com/office/word/2012/wordml\",\n \"xmlns:w16\": \"http://schemas.microsoft.com/office/word/2018/wordml\",\n \"xmlns:w16cex\": \"http://schemas.microsoft.com/office/word/2018/wordml/cex\",\n \"xmlns:w16cid\": \"http://schemas.microsoft.com/office/word/2016/wordml/cid\",\n \"xmlns:w16sdtdh\": \"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash\",\n \"xmlns:w16se\": \"http://schemas.microsoft.com/office/word/2015/wordml/symex\",\n \"xmlns:wne\": \"http://schemas.microsoft.com/office/word/2006/wordml\",\n \"xmlns:wp\": \"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\",\n \"xmlns:wp14\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\",\n \"xmlns:wpg\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\",\n \"xmlns:wpi\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\",\n \"xmlns:wps\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\",\n },\n });\n\n for (const child of children) {\n this.root.push(new Comment(child));\n }\n\n this.relationships = new Relationships();\n }\n}\n","/**\n * Empty children module for WordprocessingML run elements.\n *\n * This module provides support for various empty (self-closing) elements that can\n * appear within a run. These elements represent special characters, references,\n * and separators that don't require additional content.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { EmptyElement } from \"@file/xml-components\";\n\n// XSD Schema reference for EG_RunInnerContent group:\n// <xsd:group name=\"EG_RunInnerContent\">\n// <xsd:element name=\"noBreakHyphen\" type=\"CT_Empty\"/>\n// <xsd:element name=\"softHyphen\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"dayShort\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"monthShort\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"yearShort\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"dayLong\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"monthLong\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"yearLong\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"annotationRef\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"footnoteRef\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"endnoteRef\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"separator\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"continuationSeparator\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"pgNum\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"cr\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"tab\" type=\"CT_Empty\" minOccurs=\"0\" />\n// <xsd:element name=\"lastRenderedPageBreak\" type=\"CT_Empty\" minOccurs=\"0\" maxOccurs=\"1\" />\n// </xsd:group>\n\n/**\n * Represents a non-breaking hyphen character.\n *\n * Inserts a hyphen that prevents line breaking at that position.\n */\nexport class NoBreakHyphen extends EmptyElement {\n public constructor() {\n super(\"w:noBreakHyphen\");\n }\n}\n\n/**\n * Represents a soft hyphen (optional hyphen) character.\n *\n * Inserts a hyphen that only appears when a word is broken across lines.\n */\nexport class SoftHyphen extends EmptyElement {\n public constructor() {\n super(\"w:softHyphen\");\n }\n}\n\n/**\n * Represents the current day in short format (e.g., \"1\", \"15\").\n *\n * Inserts a dynamic field showing the day portion of the current date.\n */\nexport class DayShort extends EmptyElement {\n public constructor() {\n super(\"w:dayShort\");\n }\n}\n\n/**\n * Represents the current month in short format (e.g., \"1\", \"12\").\n *\n * Inserts a dynamic field showing the month portion of the current date.\n */\nexport class MonthShort extends EmptyElement {\n public constructor() {\n super(\"w:monthShort\");\n }\n}\n\n/**\n * Represents the current year in short format (e.g., \"24\").\n *\n * Inserts a dynamic field showing the year portion of the current date in two digits.\n */\nexport class YearShort extends EmptyElement {\n public constructor() {\n super(\"w:yearShort\");\n }\n}\n\n/**\n * Represents the current day in long format (e.g., \"01\", \"15\").\n *\n * Inserts a dynamic field showing the day portion of the current date with leading zeros.\n */\nexport class DayLong extends EmptyElement {\n public constructor() {\n super(\"w:dayLong\");\n }\n}\n\n/**\n * Represents the current month in long format (e.g., \"January\", \"December\").\n *\n * Inserts a dynamic field showing the full month name of the current date.\n */\nexport class MonthLong extends EmptyElement {\n public constructor() {\n super(\"w:monthLong\");\n }\n}\n\n/**\n * Represents the current year in long format (e.g., \"2024\").\n *\n * Inserts a dynamic field showing the year portion of the current date in four digits.\n */\nexport class YearLong extends EmptyElement {\n public constructor() {\n super(\"w:yearLong\");\n }\n}\n\n/**\n * Represents a reference to an annotation (comment).\n *\n * Used internally within comment ranges to mark comment references.\n */\nexport class AnnotationReference extends EmptyElement {\n public constructor() {\n super(\"w:annotationRef\");\n }\n}\n\n/**\n * Represents a reference to a footnote.\n *\n * Used within footnote content to refer back to the footnote marker.\n */\nexport class FootnoteReferenceElement extends EmptyElement {\n public constructor() {\n super(\"w:footnoteRef\");\n }\n}\n\n/**\n * Represents a reference to an endnote.\n *\n * Used within endnote content to refer back to the endnote marker.\n */\nexport class EndnoteReference extends EmptyElement {\n public constructor() {\n super(\"w:endnoteRef\");\n }\n}\n\n/**\n * Represents a separator line for footnotes or endnotes.\n *\n * Used to create the separator line between document content and footnotes/endnotes.\n */\nexport class Separator extends EmptyElement {\n public constructor() {\n super(\"w:separator\");\n }\n}\n\n/**\n * Represents a continuation separator for footnotes or endnotes.\n *\n * Used when footnotes/endnotes continue across multiple pages.\n */\nexport class ContinuationSeparator extends EmptyElement {\n public constructor() {\n super(\"w:continuationSeparator\");\n }\n}\n\n/**\n * Represents a page number field element.\n *\n * Inserts the current page number at this position.\n */\nexport class PageNumberElement extends EmptyElement {\n public constructor() {\n super(\"w:pgNum\");\n }\n}\n\n/**\n * Represents a carriage return character.\n *\n * Inserts a carriage return, which may be rendered differently than a standard line break.\n */\nexport class CarriageReturn extends EmptyElement {\n public constructor() {\n super(\"w:cr\");\n }\n}\n\n/**\n * Represents a tab character.\n *\n * Inserts a tab stop, advancing to the next tab position in the paragraph.\n *\n * @publicApi\n */\nexport class Tab extends EmptyElement {\n public constructor() {\n super(\"w:tab\");\n }\n}\n\n/**\n * Represents the last rendered page break location.\n *\n * Used internally by Word to track where page breaks occurred in the last rendering.\n * This is typically generated by Word and not created manually.\n */\nexport class LastRenderedPageBreak extends EmptyElement {\n public constructor() {\n super(\"w:lastRenderedPageBreak\");\n }\n}\n","/**\n * Positional tab module for WordprocessingML documents.\n *\n * This module provides support for positional tabs, which are absolute position\n * tab stops used primarily in paragraphs with bidirectional text.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Positional tab alignment types.\n *\n * Specifies how text is aligned at the positional tab stop.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PTabAlignment\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"left\" />\n * <xsd:enumeration value=\"center\" />\n * <xsd:enumeration value=\"right\" />\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PositionalTabAlignment = {\n /** Left-aligned tab */\n LEFT: \"left\",\n /** Center-aligned tab */\n CENTER: \"center\",\n /** Right-aligned tab */\n RIGHT: \"right\",\n} as const;\n\n/**\n * Positional tab relative positioning types.\n *\n * Specifies what the positional tab position is relative to.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PTabRelativeTo\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"margin\" />\n * <xsd:enumeration value=\"indent\" />\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PositionalTabRelativeTo = {\n /** Position relative to margin */\n MARGIN: \"margin\",\n /** Position relative to indent */\n INDENT: \"indent\",\n} as const;\n\n/**\n * Positional tab leader character types.\n *\n * Specifies the character used to fill the space before the tab.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PTabLeader\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"none\" />\n * <xsd:enumeration value=\"dot\" />\n * <xsd:enumeration value=\"hyphen\" />\n * <xsd:enumeration value=\"underscore\" />\n * <xsd:enumeration value=\"middleDot\" />\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PositionalTabLeader = {\n /** No leader character */\n NONE: \"none\",\n /** Dot leader (...) */\n DOT: \"dot\",\n /** Hyphen leader (---) */\n HYPHEN: \"hyphen\",\n /** Underscore leader (___) */\n UNDERSCORE: \"underscore\",\n /** Middle dot leader (···) */\n MIDDLE_DOT: \"middleDot\",\n} as const;\n\n/**\n * Options for creating a PositionalTab.\n *\n * @property alignment - How text is aligned at the tab stop\n * @property relativeTo - What the tab position is relative to\n * @property leader - Character used to fill space before the tab\n */\nexport interface PositionalTabOptions {\n /** How text is aligned at the tab stop */\n readonly alignment: (typeof PositionalTabAlignment)[keyof typeof PositionalTabAlignment];\n /** What the tab position is relative to */\n readonly relativeTo: (typeof PositionalTabRelativeTo)[keyof typeof PositionalTabRelativeTo];\n /** Character used to fill space before the tab */\n readonly leader: (typeof PositionalTabLeader)[keyof typeof PositionalTabLeader];\n}\n\n/**\n * Represents a positional tab element for a WordprocessingML document.\n *\n * A positional tab is an absolute position tab stop that is typically used\n * in bidirectional text scenarios. Unlike normal tabs, positional tabs specify\n * an exact alignment and position within the paragraph.\n *\n * Reference: http://officeopenxml.com/WPrun.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PTab\">\n * <xsd:attribute name=\"alignment\" type=\"ST_PTabAlignment\" use=\"required\" />\n * <xsd:attribute name=\"relativeTo\" type=\"ST_PTabRelativeTo\" use=\"required\" />\n * <xsd:attribute name=\"leader\" type=\"ST_PTabLeader\" use=\"required\" />\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a centered positional tab\n * new PositionalTab({\n * alignment: PositionalTabAlignment.CENTER,\n * relativeTo: PositionalTabRelativeTo.MARGIN,\n * leader: PositionalTabLeader.DOT,\n * });\n * ```\n */\nexport class PositionalTab extends XmlComponent {\n public constructor(options: PositionalTabOptions) {\n super(\"w:ptab\");\n\n this.root.push({\n _attr: {\n \"w:alignment\": options.alignment,\n \"w:leader\": options.leader,\n \"w:relativeTo\": options.relativeTo,\n },\n });\n }\n}\n","/**\n * Ruby annotation module for WordprocessingML documents.\n *\n * Ruby annotations are small text rendered above or below base text,\n * commonly used for pronunciation guides in East Asian languages (furigana\n * in Japanese, pinyin in Chinese, etc.).\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_Ruby\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { buildText } from \"./run-components/text\";\n\n/**\n * Ruby alignment options.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_RubyAlign\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"center\"/>\n * <xsd:enumeration value=\"distributeLetter\"/>\n * <xsd:enumeration value=\"distributeSpace\"/>\n * <xsd:enumeration value=\"left\"/>\n * <xsd:enumeration value=\"right\"/>\n * <xsd:enumeration value=\"rightVertical\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const RubyAlign = {\n /** Center alignment */\n CENTER: \"center\",\n /** Distribute letters evenly */\n DISTRIBUTE_LETTER: \"distributeLetter\",\n /** Distribute space evenly */\n DISTRIBUTE_SPACE: \"distributeSpace\",\n /** Left alignment */\n LEFT: \"left\",\n /** Right alignment */\n RIGHT: \"right\",\n /** Right vertical alignment */\n RIGHT_VERTICAL: \"rightVertical\",\n} as const;\n\n/**\n * Options for a Ruby annotation.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Ruby\">\n * <xsd:sequence>\n * <xsd:element name=\"rubyPr\" type=\"CT_RubyPr\"/>\n * <xsd:element name=\"rt\" type=\"CT_RubyContent\"/>\n * <xsd:element name=\"rubyBase\" type=\"CT_RubyContent\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport interface RubyOptions {\n /** Ruby annotation text (e.g., furigana, pinyin) */\n readonly text: string;\n /** Base text being annotated */\n readonly base: string;\n /**\n * Ruby alignment (defaults to \"center\").\n */\n readonly alignment?: (typeof RubyAlign)[keyof typeof RubyAlign];\n /**\n * Font size for the ruby annotation text in half-points (e.g., 20 = 10pt).\n *\n * Defaults to half the base text size if not specified.\n */\n readonly fontSize?: number;\n /**\n * Vertical offset for the ruby annotation in half-points.\n *\n * How far the annotation is raised above (or below) the base text.\n */\n readonly raise?: number;\n /**\n * Font size for the base text in half-points.\n *\n * Used to calculate the ruby annotation positioning.\n */\n readonly baseFontSize?: number;\n /**\n * Language identifier for the ruby annotation (e.g., \"ja-JP\").\n */\n readonly languageId?: string;\n /**\n * Whether the ruby annotation is dirty (needs recalculation).\n */\n readonly dirty?: boolean;\n}\n\n/**\n * Creates a ruby content element (w:rt or w:rubyBase).\n *\n * Ruby content contains a run with text.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RubyContent\">\n * <xsd:group ref=\"EG_RubyContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:complexType>\n * ```\n */\nconst createRubyContent = (name: string, text: string): XmlComponent =>\n new BuilderElement({\n children: [\n new BuilderElement({\n children: [buildText(text)],\n name: \"w:r\",\n }),\n ],\n name,\n });\n\n/**\n * Creates a Ruby annotation element (w:ruby).\n *\n * Ruby annotations provide pronunciation guides for East Asian text,\n * commonly used for furigana in Japanese and pinyin in Chinese.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Ruby\">\n * <xsd:sequence>\n * <xsd:element name=\"rubyPr\" type=\"CT_RubyPr\"/>\n * <xsd:element name=\"rt\" type=\"CT_RubyContent\"/>\n * <xsd:element name=\"rubyBase\" type=\"CT_RubyContent\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Japanese furigana\n * createRuby({\n * text: \"かな\",\n * base: \"漢字\",\n * alignment: \"CENTER\",\n * fontSize: 20,\n * raise: 20,\n * languageId: \"ja-JP\",\n * });\n * ```\n */\nexport const createRuby = (options: RubyOptions): XmlComponent => {\n const align = options.alignment ?? \"center\";\n const hps = options.fontSize ?? 20;\n const hpsRaise = options.raise ?? 20;\n const hpsBaseText = options.baseFontSize ?? 40;\n\n const rubyPr = new BuilderElement({\n children: [\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: align } },\n name: \"w:rubyAlign\",\n }),\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: hps } },\n name: \"w:hps\",\n }),\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: hpsRaise } },\n name: \"w:hpsRaise\",\n }),\n new BuilderElement<{ readonly val: number }>({\n attributes: { val: { key: \"w:val\", value: hpsBaseText } },\n name: \"w:hpsBaseText\",\n }),\n new BuilderElement<{ readonly val: string }>({\n attributes: {\n val: {\n key: \"w:val\",\n value: options.languageId ?? \"ja-JP\",\n },\n },\n name: \"w:lid\",\n }),\n ...(options.dirty !== undefined\n ? [\n new BuilderElement({\n name: \"w:dirty\",\n }),\n ]\n : []),\n ],\n name: \"w:rubyPr\",\n });\n\n const rt = createRubyContent(\"w:rt\", options.text);\n const rubyBase = createRubyContent(\"w:rubyBase\", options.base);\n\n return new BuilderElement({\n children: [rubyPr, rt, rubyBase],\n name: \"w:ruby\",\n });\n};\n","/**\n * Run module exports.\n *\n * @module\n */\nexport * from \"./run\";\nexport * from \"./properties\";\nexport * from \"./text-run\";\nexport * from \"./symbol-run\";\nexport * from \"./image-run\";\nexport * from \"./chart-run\";\nexport * from \"./smartart-run\";\nexport * from \"./wps-shape-run\";\nexport * from \"./wpg-group-run\";\nexport * from \"./run-fonts\";\nexport * from \"./sequential-identifier\";\nexport * from \"./underline\";\nexport * from \"./emphasis-mark\";\nexport * from \"./simple-field\";\nexport * from \"./comment-run\";\nexport * from \"./empty-children\";\nexport * from \"./positional-tab\";\nexport * from \"./ruby\";\nexport * from \"./form-field\";\nexport * from \"./break\";\n","/**\n * Break elements module for WordprocessingML documents.\n *\n * This module provides page break and column break functionality.\n *\n * Reference: http://officeopenxml.com/WPtextSpecialContent-break.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { Run } from \"../run\";\n\n/**\n * Break type values.\n * @internal\n */\nconst BreakType = {\n /** Column break - text continues at the beginning of the next column */\n COLUMN: \"column\",\n /** Page break - text continues at the beginning of the next page */\n PAGE: \"page\",\n // TextWrapping breaks are the default and already exposed via the \"Run\" class\n} as const;\n\n/**\n * Represents a break element in a WordprocessingML document.\n * @internal\n */\nclass Break extends XmlComponent {\n public constructor(type: (typeof BreakType)[keyof typeof BreakType]) {\n super(\"w:br\");\n this.root.push({ _attr: { \"w:type\": type } });\n }\n}\n\n/**\n * Represents a page break in a WordprocessingML document.\n *\n * A page break forces text to continue at the beginning of the next page.\n *\n * Reference: http://officeopenxml.com/WPtextSpecialContent-break.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Br\">\n * <xsd:attribute name=\"type\" type=\"ST_BrType\" use=\"optional\"/>\n * <xsd:attribute name=\"clear\" type=\"ST_BrClear\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * children: [new PageBreak()],\n * });\n * ```\n */\nexport class PageBreak extends Run {\n public constructor() {\n super({});\n this.extraChildren.push(new Break(BreakType.PAGE));\n }\n}\n\n/**\n * Represents a column break in a WordprocessingML document.\n *\n * A column break forces text to continue at the beginning of the next column.\n *\n * Reference: http://officeopenxml.com/WPtextSpecialContent-break.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Br\">\n * <xsd:attribute name=\"type\" type=\"ST_BrType\" use=\"optional\"/>\n * <xsd:attribute name=\"clear\" type=\"ST_BrClear\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * children: [new ColumnBreak()],\n * });\n * ```\n */\nexport class ColumnBreak extends Run {\n public constructor() {\n super({});\n this.extraChildren.push(new Break(BreakType.COLUMN));\n }\n}\n\n/**\n * Represents a page break before setting for paragraph properties.\n *\n * When applied to a paragraph, ensures the paragraph begins on a new page.\n *\n * Reference: http://officeopenxml.com/WPparagraphProperties.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OnOff\">\n * <xsd:attribute name=\"val\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Paragraph({\n * pageBreakBefore: true,\n * children: [new TextRun(\"This text starts on a new page\")],\n * });\n * ```\n */\nexport class PageBreakBefore extends XmlComponent {\n public constructor() {\n super(\"w:pageBreakBefore\");\n }\n}\n","/**\n * Paragraph formatting module exports.\n *\n * @module\n */\nexport * from \"./alignment\";\nexport * from \"./border\";\nexport * from \"./cnf-style\";\nexport * from \"./indent\";\nexport * from \"./break\";\nexport * from \"./spacing\";\nexport * from \"./style\";\nexport * from \"./tab-stop\";\nexport * from \"./unordered-list\";\n","/**\n * Paragraph frame module exports.\n *\n * @module\n */\nexport * from \"./frame-properties\";\n","/**\n * Paragraph module exports.\n *\n * @module\n */\nexport * from \"./formatting\";\nexport * from \"./paragraph\";\nexport * from \"./properties\";\nexport * from \"./run\";\nexport * from \"./links\";\nexport * from \"./math\";\nexport * from \"./frame\";\n","import type { FileChild } from \"@file/file-child\";\nimport { EmptyElement, XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { uniqueId } from \"@util/convenience-functions\";\n/**\n * Alternative format chunk module for WordprocessingML documents.\n *\n * AltChunk (w:altChunk) embeds content from alternative formats (HTML, RTF, plain text)\n * into a Word document. The content is stored as a separate part in the DOCX package\n * and referenced via a relationship.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_AltChunk\n *\n * @module\n */\n\n/**\n * Options for creating an AltChunk element.\n */\nexport interface AltChunkOptions {\n /** Content data to embed (string or binary) */\n readonly data: Uint8Array | string;\n /** MIME content type of the data */\n readonly contentType: \"text/html\" | \"application/rtf\" | \"text/plain\";\n /** File extension for the part */\n readonly extension: \"html\" | \"rtf\" | \"txt\";\n /** Whether to match source formatting */\n readonly matchSrc?: boolean;\n}\n\nconst ALTCHUNK_RELATIONSHIP_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk\";\n\n/**\n * An alternative format chunk element (CT_AltChunk).\n *\n * Embeds content from an alternative format (HTML, RTF, plain text) into\n * a Word document. The content is stored as a separate part and referenced\n * via an `r:id` relationship.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_AltChunk\n *\n * @example\n * ```typescript\n * new AltChunk({\n * data: \"<p>Hello HTML</p>\",\n * contentType: \"text/html\",\n * extension: \"html\",\n * });\n * ```\n */\nexport class AltChunk extends XmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n private readonly options: AltChunkOptions;\n\n public constructor(options: AltChunkOptions) {\n super(\"w:altChunk\");\n this.options = options;\n\n if (options.matchSrc) {\n const altChunkPr = new EmptyElement(\"w:altChunkPr\");\n altChunkPr.addChildElement(new EmptyElement(\"w:matchSrc\"));\n this.root.push(altChunkPr);\n }\n }\n\n public prepForXml(context: Context): IXmlableObject {\n const relId = uniqueId();\n const extension = this.options.extension;\n\n this.root.splice(0, 0, { _attr: { \"r:id\": `rId${relId}` } });\n\n const partPath = `afchunks/afchunk${relId}.${extension}`;\n const rawData =\n typeof this.options.data === \"string\"\n ? new TextEncoder().encode(this.options.data)\n : this.options.data;\n const data =\n this.options.contentType === \"text/html\" && typeof this.options.data === \"string\"\n ? new TextEncoder().encode(wrapHtmlDocument(this.options.data))\n : rawData;\n\n context.viewWrapper.relationships.addRelationship(relId, ALTCHUNK_RELATIONSHIP_TYPE, partPath);\n\n context.file.altChunks.addAltChunk(relId, {\n key: relId,\n data,\n path: partPath,\n extension,\n contentType: this.options.contentType,\n });\n\n context.file.contentTypes.addAltChunk(`/word/${partPath}`, this.options.contentType, extension);\n\n return super.prepForXml(context) as IXmlableObject;\n }\n}\n\nfunction wrapHtmlDocument(fragment: string): string {\n if (/<(!DOCTYPE|html|HTML)/i.test(fragment)) {\n return fragment;\n }\n return `<!DOCTYPE html>\\n<html><head><meta charset=\"utf-8\"></head>\\n<body>${fragment}</body></html>`;\n}\n","/**\n * Field Instruction module for Table of Contents.\n *\n * This module handles the generation of TOC field instruction text\n * that controls how the table of contents is built.\n *\n * Reference: http://officeopenxml.com/WPfieldInstructions.php\n *\n * @module\n */\nimport { SpaceType } from \"@file/shared\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { TableOfContentsOptions } from \"./table-of-contents-properties\";\n\n/**\n * Represents a field instruction for a Table of Contents.\n *\n * The FieldInstruction class generates the TOC field code string that Word uses\n * to determine how to build the table of contents, including which headings to include,\n * formatting options, and other TOC-specific settings.\n *\n * Reference: http://officeopenxml.com/WPfieldInstructions.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"instrText\" type=\"CT_Text\"/>\n * ```\n *\n * @example\n * ```typescript\n * // Basic TOC field instruction\n * new FieldInstruction({ headingStyleRange: \"1-3\" });\n *\n * // TOC with hyperlinks and custom styles\n * new FieldInstruction({\n * hyperlink: true,\n * headingStyleRange: \"1-3\",\n * stylesWithLevels: [new StyleLevel(\"CustomStyle\", 2)],\n * });\n * ```\n */\nexport class FieldInstruction extends XmlComponent {\n private readonly properties: TableOfContentsOptions;\n\n public constructor(properties: TableOfContentsOptions = {}) {\n super(\"w:instrText\");\n\n this.properties = properties;\n\n this.root.push({ _attr: { \"xml:space\": SpaceType.PRESERVE } });\n let instruction = \"TOC\";\n\n if (this.properties.captionLabel) {\n instruction = `${instruction} \\\\a \"${this.properties.captionLabel}\"`;\n }\n if (this.properties.entriesFromBookmark) {\n instruction = `${instruction} \\\\b \"${this.properties.entriesFromBookmark}\"`;\n }\n if (this.properties.captionLabelIncludingNumbers) {\n instruction = `${instruction} \\\\c \"${this.properties.captionLabelIncludingNumbers}\"`;\n }\n if (this.properties.sequenceAndPageNumbersSeparator) {\n instruction = `${instruction} \\\\d \"${this.properties.sequenceAndPageNumbersSeparator}\"`;\n }\n if (this.properties.tcFieldIdentifier) {\n instruction = `${instruction} \\\\f \"${this.properties.tcFieldIdentifier}\"`;\n }\n if (this.properties.hyperlink) {\n instruction = `${instruction} \\\\h`;\n }\n if (this.properties.tcFieldLevelRange) {\n instruction = `${instruction} \\\\l \"${this.properties.tcFieldLevelRange}\"`;\n }\n if (this.properties.pageNumbersEntryLevelsRange) {\n instruction = `${instruction} \\\\n \"${this.properties.pageNumbersEntryLevelsRange}\"`;\n }\n if (this.properties.headingStyleRange) {\n instruction = `${instruction} \\\\o \"${this.properties.headingStyleRange}\"`;\n }\n if (this.properties.entryAndPageNumberSeparator) {\n instruction = `${instruction} \\\\p \"${this.properties.entryAndPageNumberSeparator}\"`;\n }\n if (this.properties.seqFieldIdentifierForPrefix) {\n instruction = `${instruction} \\\\s \"${this.properties.seqFieldIdentifierForPrefix}\"`;\n }\n if (this.properties.stylesWithLevels && this.properties.stylesWithLevels.length) {\n const styles = this.properties.stylesWithLevels\n .map((sl) => `${sl.styleName},${sl.level}`)\n .join(\",\");\n instruction = `${instruction} \\\\t \"${styles}\"`;\n }\n if (this.properties.useAppliedParagraphOutlineLevel) {\n instruction = `${instruction} \\\\u`;\n }\n if (this.properties.preserveTabInEntries) {\n instruction = `${instruction} \\\\w`;\n }\n if (this.properties.preserveNewLineInEntries) {\n instruction = `${instruction} \\\\x`;\n }\n if (this.properties.hideTabAndPageNumbersInWebView) {\n instruction = `${instruction} \\\\z`;\n }\n this.root.push(instruction);\n }\n}\n","/**\n * Structured Document Tag Content module.\n *\n * This module represents the content container for structured document tags,\n * including table of contents elements.\n *\n * Reference: http://officeopenxml.com/WPtableOfContents.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents the content portion of a Structured Document Tag.\n *\n * The StructuredDocumentTagContent contains the actual content elements\n * (paragraphs, tables, etc.) within a structured document tag, such as\n * the paragraphs that make up a table of contents.\n *\n * Reference: http://officeopenxml.com/WPtableOfContents.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtContentBlock\">\n * <xsd:group ref=\"EG_ContentBlockContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const content = new StructuredDocumentTagContent();\n * content.addChildElement(new Paragraph(\"Content\"));\n * ```\n */\nexport class StructuredDocumentTagContent extends XmlComponent {\n public constructor() {\n super(\"w:sdtContent\");\n }\n}\n","/**\n * Structured Document Tag Properties module.\n *\n * Represents CT_SdtPr — the properties of a structured document tag (content control).\n * Supports all SDT types defined in the OOXML specification: comboBox, dropDownList,\n * date, text, equation,richText, picture, citation, group, bibliography, docPartObj,\n * docPartList.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_SdtPr\n *\n * @module\n */\nimport { BuilderElement, XmlComponent, onOffObj, stringValObj } from \"@file/xml-components\";\nimport type { BuilderChild } from \"@file/xml-components\";\n\n// ─── Lock ───────────────────────────────────────────────────────────────────\n\n/**\n * SDT lock type (ST_Lock).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Lock\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"sdtLocked\"/>\n * <xsd:enumeration value=\"contentLocked\"/>\n * <xsd:enumeration value=\"unlocked\"/>\n * <xsd:enumeration value=\"sdtContentLocked\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const SdtLock = {\n /** Lock the SDT itself (cannot delete the control) */\n SDT_LOCKED: \"sdtLocked\",\n /** Lock the content (cannot edit content within the control) */\n CONTENT_LOCKED: \"contentLocked\",\n /** No locking */\n UNLOCKED: \"unlocked\",\n /** Lock both SDT and content */\n SDT_CONTENT_LOCKED: \"sdtContentLocked\",\n} as const;\n\n// ─── Supporting Types ───────────────────────────────────────────────────────\n\n/**\n * A list item for comboBox or dropDownList SDTs (CT_SdtListItem).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtListItem\">\n * <xsd:attribute name=\"displayText\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"value\" type=\"s:ST_String\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SdtListItem {\n /** Display text shown in the UI */\n readonly displayText?: string;\n /** Underlying value */\n readonly value?: string;\n}\n\n/**\n * Options for comboBox SDT type (CT_SdtComboBox).\n *\n * A comboBox allows users to either select from a list or type custom text.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtComboBox\">\n * <xsd:sequence>\n * <xsd:element name=\"listItem\" type=\"CT_SdtListItem\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"lastValue\" type=\"s:ST_String\" use=\"optional\" default=\"\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SdtComboBoxOptions {\n /** List items */\n readonly items?: readonly SdtListItem[];\n /** Last selected value */\n readonly lastValue?: string;\n}\n\n/**\n * Options for dropDownList SDT type (CT_SdtDropDownList).\n *\n * A dropDownList restricts users to selecting from a predefined list.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtDropDownList\">\n * <xsd:sequence>\n * <xsd:element name=\"listItem\" type=\"CT_SdtListItem\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"lastValue\" type=\"s:ST_String\" use=\"optional\" default=\"\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SdtDropDownListOptions {\n /** List items */\n readonly items?: readonly SdtListItem[];\n /** Last selected value */\n readonly lastValue?: string;\n}\n\n/**\n * Date mapping type (ST_SdtDateMappingType).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_SdtDateMappingType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"text\"/>\n * <xsd:enumeration value=\"date\"/>\n * <xsd:enumeration value=\"dateTime\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const SdtDateMappingType = {\n TEXT: \"text\",\n DATE: \"date\",\n DATE_TIME: \"dateTime\",\n} as const;\n\n/**\n * Options for date SDT type (CT_SdtDate).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtDate\">\n * <xsd:sequence>\n * <xsd:element name=\"dateFormat\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"lid\" type=\"CT_Lang\" minOccurs=\"0\"/>\n * <xsd:element name=\"storeMappedDataAs\" type=\"CT_SdtDateMappingType\" minOccurs=\"0\"/>\n * <xsd:element name=\"calendar\" type=\"CT_CalendarType\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"fullDate\" type=\"ST_DateTime\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SdtDateOptions {\n /** Date format string (e.g., \"yyyy-MM-dd\") */\n readonly dateFormat?: string;\n /** Language ID (e.g., \"en-US\") */\n readonly languageId?: string;\n /** How the date value is stored */\n readonly storeMappedDataAs?: (typeof SdtDateMappingType)[keyof typeof SdtDateMappingType];\n /** Calendar type */\n readonly calendar?: string;\n /** Full date value (ISO 8601) */\n readonly fullDate?: string;\n}\n\n/**\n * Options for plain text SDT type (CT_SdtText).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtText\">\n * <xsd:attribute name=\"multiLine\" type=\"s:ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SdtTextOptions {\n /** Whether the text control supports multiple lines */\n readonly multiLine?: boolean;\n}\n\n/**\n * Data binding options (CT_DataBinding).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DataBinding\">\n * <xsd:attribute name=\"prefixMappings\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"xpath\" type=\"s:ST_String\" use=\"required\"/>\n * <xsd:attribute name=\"storeItemID\" type=\"s:ST_String\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SdtDataBindingOptions {\n /** XML namespace prefix mappings */\n readonly prefixMappings?: string;\n /** XPath expression (required) */\n readonly xpath: string;\n /** Custom XML store item ID (required) */\n readonly storeItemID: string;\n}\n\n/**\n * Options for CT_SdtPr — structured document tag properties.\n *\n * Exactly zero or one type discriminator from the `xsd:choice` group may be specified:\n * `comboBox`, `dropDownList`, `date`, `text`, `equation`, `richText`, `picture`,\n * `citation`, `group`, `bibliography`, `docPartObj`, `docPartList`.\n */\nexport interface SdtPropertiesOptions {\n /** Display name */\n readonly alias?: string;\n /**\n * Application-specific tag.\n *\n * While optional per XSD, Microsoft Word requires this property\n * for SDTs to function correctly. Omitting it may cause the\n * document to fail to open in Word.\n */\n readonly tag?: string;\n /** Unique ID */\n readonly id?: number;\n /** Lock behavior */\n readonly lock?: (typeof SdtLock)[keyof typeof SdtLock];\n /** Whether the control is temporary */\n readonly temporary?: boolean;\n /** Whether the placeholder text is currently shown */\n readonly showingPlaceholder?: boolean;\n /** Placeholder content (block-level content: paragraphs, tables, etc.) */\n readonly placeholder?: XmlComponent[];\n /** Data binding to custom XML */\n readonly dataBinding?: SdtDataBindingOptions;\n /** Numeric label */\n readonly label?: number;\n /** Tab order index */\n readonly tabIndex?: number;\n /** SDT content run properties (rPr) */\n readonly runProperties?: XmlComponent;\n\n // ─── Type discriminators (xsd:choice, at most one) ───\n\n /** Equation SDT */\n readonly equation?: boolean;\n /** ComboBox SDT (allows free-text entry) */\n readonly comboBox?: SdtComboBoxOptions;\n /** Date SDT */\n readonly date?: SdtDateOptions;\n /** Document part object SDT */\n readonly docPartObj?: {\n readonly gallery?: string;\n readonly category?: string;\n readonly unique?: boolean;\n };\n /** Document part list SDT */\n readonly docPartList?: {\n readonly gallery?: string;\n readonly category?: string;\n readonly unique?: boolean;\n };\n /** DropDownList SDT (selection only) */\n readonly dropDownList?: SdtDropDownListOptions;\n /** Picture SDT */\n readonly picture?: boolean;\n /** Rich text SDT */\n readonly richText?: boolean;\n /** Plain text SDT */\n readonly text?: SdtTextOptions;\n /** Citation SDT */\n readonly citation?: boolean;\n /** Group SDT */\n readonly group?: boolean;\n /** Bibliography SDT */\n readonly bibliography?: boolean;\n}\n\n// ─── Helpers ────────────────────────────────────────────────────────────────\n\n/** Creates a list item element (w:listItem).\n *\n * Note: Word requires `w:value` on every listItem inside w:dropDownList,\n * even though the XSD marks it as optional. When value is not provided,\n * it defaults to displayText.\n */\nconst createListItem = (item: SdtListItem, forceValue?: boolean): XmlComponent => {\n const attrs: Record<string, { readonly key: string; readonly value: string }> = {};\n if (item.displayText !== undefined) {\n attrs.displayText = { key: \"w:displayText\", value: item.displayText };\n }\n const value = item.value ?? (forceValue ? item.displayText : undefined);\n if (value !== undefined) {\n attrs.value = { key: \"w:value\", value };\n }\n return new BuilderElement({ name: \"w:listItem\", attributes: attrs });\n};\n\n/** Creates a comboBox or dropDownList element. */\nconst createListType = (\n name: string,\n options: { readonly items?: readonly SdtListItem[]; readonly lastValue?: string },\n): XmlComponent => {\n const children: BuilderChild[] = [];\n if (options.items) {\n for (const item of options.items) {\n children.push(createListItem(item, name === \"w:dropDownList\"));\n }\n }\n const attrs: Record<string, { readonly key: string; readonly value: string }> = {};\n if (options.lastValue !== undefined) {\n attrs.lastValue = { key: \"w:lastValue\", value: options.lastValue };\n }\n return new BuilderElement({\n name,\n attributes: Object.keys(attrs).length > 0 ? attrs : undefined,\n children: children.length > 0 ? children : undefined,\n });\n};\n\n/** Creates a date SDT element (w:date). */\nconst createDate = (options: SdtDateOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n if (options.dateFormat !== undefined) {\n children.push(stringValObj(\"w:dateFormat\", options.dateFormat));\n }\n if (options.languageId !== undefined) {\n children.push(stringValObj(\"w:lid\", options.languageId));\n }\n if (options.storeMappedDataAs !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n name: \"w:storeMappedDataAs\",\n attributes: { val: { key: \"w:val\", value: options.storeMappedDataAs } },\n }),\n );\n }\n if (options.calendar !== undefined) {\n children.push(\n new BuilderElement<{ readonly val: string }>({\n name: \"w:calendar\",\n attributes: { val: { key: \"w:val\", value: options.calendar } },\n }),\n );\n }\n const attrs: Record<string, { readonly key: string; readonly value: string }> = {};\n if (options.fullDate !== undefined) {\n attrs.fullDate = { key: \"w:fullDate\", value: options.fullDate };\n }\n return new BuilderElement({\n name: \"w:date\",\n attributes: Object.keys(attrs).length > 0 ? attrs : undefined,\n children: children.length > 0 ? children : undefined,\n });\n};\n\n/** Creates a dataBinding element (w:dataBinding). */\nconst createDataBinding = (options: SdtDataBindingOptions): XmlComponent => {\n const attrs: Record<string, { readonly key: string; readonly value: string }> = {\n xpath: { key: \"w:xpath\", value: options.xpath },\n storeItemID: { key: \"w:storeItemID\", value: options.storeItemID },\n };\n if (options.prefixMappings !== undefined) {\n attrs.prefixMappings = { key: \"w:prefixMappings\", value: options.prefixMappings };\n }\n return new BuilderElement({ name: \"w:dataBinding\", attributes: attrs });\n};\n\n/** Creates a docPart element (w:docPartObj or w:docPartList). */\nconst createDocPart = (\n name: string,\n options: { readonly gallery?: string; readonly category?: string; readonly unique?: boolean },\n): XmlComponent => {\n const children: BuilderChild[] = [];\n if (options.gallery !== undefined) {\n children.push(stringValObj(\"w:docPartGallery\", options.gallery));\n }\n if (options.category !== undefined) {\n children.push(stringValObj(\"w:docPartCategory\", options.category));\n }\n if (options.unique !== undefined) {\n children.push(onOffObj(\"w:docPartUnique\", options.unique));\n }\n return new BuilderElement({ name, children: children.length > 0 ? children : undefined });\n};\n\n// ─── Main Class ─────────────────────────────────────────────────────────────\n\n/**\n * Represents the properties of a Structured Document Tag (CT_SdtPr).\n *\n * Supports the full CT_SdtPr schema including all SDT type discriminators\n * (comboBox, dropDownList, date, text, etc.) defined in the `xsd:choice` group.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtPr\">\n * <xsd:sequence>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"alias\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"tag\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"id\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"lock\" type=\"CT_Lock\" minOccurs=\"0\"/>\n * <xsd:element name=\"placeholder\" type=\"CT_Placeholder\" minOccurs=\"0\"/>\n * <xsd:element name=\"temporary\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"showingPlcHdr\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"dataBinding\" type=\"CT_DataBinding\" minOccurs=\"0\"/>\n * <xsd:element name=\"label\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"tabIndex\" type=\"CT_UnsignedDecimalNumber\" minOccurs=\"0\"/>\n * <xsd:choice minOccurs=\"0\" maxOccurs=\"1\">\n * <xsd:element name=\"equation\" type=\"CT_Empty\"/>\n * <xsd:element name=\"comboBox\" type=\"CT_SdtComboBox\"/>\n * <xsd:element name=\"date\" type=\"CT_SdtDate\"/>\n * <xsd:element name=\"docPartObj\" type=\"CT_SdtDocPart\"/>\n * <xsd:element name=\"docPartList\" type=\"CT_SdtDocPart\"/>\n * <xsd:element name=\"dropDownList\" type=\"CT_SdtDropDownList\"/>\n * <xsd:element name=\"picture\" type=\"CT_Empty\"/>\n * <xsd:element name=\"richText\" type=\"CT_Empty\"/>\n * <xsd:element name=\"text\" type=\"CT_SdtText\"/>\n * <xsd:element name=\"citation\" type=\"CT_Empty\"/>\n * <xsd:element name=\"group\" type=\"CT_Empty\"/>\n * <xsd:element name=\"bibliography\" type=\"CT_Empty\"/>\n * </xsd:choice>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple alias (backward compatible)\n * new StructuredDocumentTagProperties(\"Table of Contents\");\n *\n * // Full options with comboBox type\n * new StructuredDocumentTagProperties({\n * alias: \"Pick a color\",\n * comboBox: { items: [{ displayText: \"Red\", value: \"r\" }, { displayText: \"Blue\", value: \"b\" }] },\n * });\n * ```\n */\nexport class StructuredDocumentTagProperties extends XmlComponent {\n public constructor(aliasOrOptions?: string | SdtPropertiesOptions) {\n super(\"w:sdtPr\");\n\n // Backward compatibility: accept a plain string alias\n const options: SdtPropertiesOptions | undefined =\n typeof aliasOrOptions === \"string\" ? { alias: aliasOrOptions } : aliasOrOptions;\n\n if (!options) {\n return;\n }\n\n // CT_SdtPr children in XSD sequence order\n if (options.runProperties) {\n this.root.push(options.runProperties);\n }\n if (options.alias !== undefined) {\n this.root.push(stringValObj(\"w:alias\", options.alias));\n }\n if (options.tag !== undefined) {\n this.root.push(stringValObj(\"w:tag\", options.tag));\n }\n if (options.id !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:id\",\n attributes: { val: { key: \"w:val\", value: options.id } },\n }),\n );\n }\n if (options.lock !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: string }>({\n name: \"w:lock\",\n attributes: { val: { key: \"w:val\", value: options.lock } },\n }),\n );\n }\n if (options.placeholder !== undefined) {\n this.root.push(\n new BuilderElement({\n name: \"w:placeholder\",\n children: options.placeholder.length > 0 ? options.placeholder : undefined,\n }),\n );\n }\n if (options.temporary !== undefined) {\n this.root.push(onOffObj(\"w:temporary\", options.temporary));\n }\n // When placeholder has content, showingPlcHdr must be true for Word to render correctly\n const effectiveShowingPlcHdr =\n options.showingPlaceholder ??\n (options.placeholder !== undefined && options.placeholder.length > 0);\n if (options.showingPlaceholder !== undefined || effectiveShowingPlcHdr) {\n this.root.push(onOffObj(\"w:showingPlcHdr\", effectiveShowingPlcHdr));\n }\n if (options.dataBinding) {\n this.root.push(createDataBinding(options.dataBinding));\n }\n if (options.label !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:label\",\n attributes: { val: { key: \"w:val\", value: options.label } },\n }),\n );\n }\n if (options.tabIndex !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:tabIndex\",\n attributes: { val: { key: \"w:val\", value: options.tabIndex } },\n }),\n );\n }\n\n // Type discriminator (xsd:choice — at most one)\n if (options.equation) {\n this.root.push(new BuilderElement({ name: \"w:equation\" }));\n } else if (options.comboBox) {\n this.root.push(createListType(\"w:comboBox\", options.comboBox));\n } else if (options.date) {\n this.root.push(createDate(options.date));\n } else if (options.docPartObj) {\n this.root.push(createDocPart(\"w:docPartObj\", options.docPartObj));\n } else if (options.docPartList) {\n this.root.push(createDocPart(\"w:docPartList\", options.docPartList));\n } else if (options.dropDownList) {\n this.root.push(createListType(\"w:dropDownList\", options.dropDownList));\n } else if (options.picture) {\n this.root.push(new BuilderElement({ name: \"w:picture\" }));\n } else if (options.richText) {\n this.root.push(new BuilderElement({ name: \"w:richText\" }));\n } else if (options.text !== undefined) {\n const textAttrs: Record<string, { readonly key: string; readonly value: string | boolean }> =\n {};\n if (options.text.multiLine !== undefined) {\n textAttrs.multiLine = { key: \"w:multiLine\", value: options.text.multiLine };\n } else {\n // Word requires at least one attribute on w:text when showingPlcHdr is true;\n // explicitly emit the default to avoid generating an empty <w:text/> element\n textAttrs.multiLine = { key: \"w:multiLine\", value: false };\n }\n this.root.push(\n new BuilderElement({\n name: \"w:text\",\n attributes: textAttrs,\n }),\n );\n } else if (options.citation) {\n this.root.push(new BuilderElement({ name: \"w:citation\" }));\n } else if (options.group) {\n this.root.push(new BuilderElement({ name: \"w:group\" }));\n } else if (options.bibliography) {\n this.root.push(new BuilderElement({ name: \"w:bibliography\" }));\n }\n }\n}\n","/**\n * Table of Contents module for WordprocessingML documents.\n *\n * This module provides support for generating a table of contents\n * based on heading styles in the document.\n *\n * Reference: http://officeopenxml.com/WPtableOfContents.php\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { InternalHyperlink, Paragraph } from \"@file/paragraph\";\nimport type { TabStopDefinition } from \"@file/paragraph\";\nimport { Run, Tab } from \"@file/paragraph/run\";\nimport { createBegin, createEnd, createSeparate } from \"@file/paragraph/run/field\";\nimport { buildText } from \"@file/paragraph/run/run-components/text\";\nimport { BaseXmlComponent, XmlComponent } from \"@file/xml-components\";\n\nimport { FieldInstruction } from \"./field-instruction\";\nimport { StructuredDocumentTagContent } from \"./sdt-content\";\nimport { StructuredDocumentTagProperties } from \"./sdt-properties\";\nimport type { TableOfContentsOptions } from \"./table-of-contents-properties\";\n\ninterface ToCEntry {\n readonly title: string;\n readonly level: number;\n readonly page?: number;\n readonly href?: string;\n}\n\n/**\n * Represents a Table of Contents in a WordprocessingML document.\n *\n * TableOfContents creates an auto-generated list of document headings\n * with page numbers. It uses a TOC field code to generate entries.\n *\n * Reference: http://officeopenxml.com/WPtableOfContents.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtBlock\">\n * <xsd:sequence>\n * <xsd:element name=\"sdtPr\" type=\"CT_SdtPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"sdtEndPr\" type=\"CT_SdtEndPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"sdtContent\" type=\"CT_SdtContentBlock\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new TableOfContents(\"Contents\", {\n * hyperlink: true,\n * headingStyleRange: \"1-3\",\n * });\n * ```\n */\nexport class TableOfContents extends XmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n public constructor(\n alias: string = \"Table of Contents\",\n {\n contentChildren = [],\n cachedEntries = [],\n beginDirty = true,\n ...properties\n }: TableOfContentsOptions & {\n readonly contentChildren?: readonly (BaseXmlComponent | string)[];\n /**\n * Use this to provide pre-generated entries for the Table of Contents.\n *\n * Note that indentation should come from the paragraph styles defined on the document. By default the styles are TOC1, TOC2, etc. These can be overridden with stylesWithLevels (\\t)\n */\n readonly cachedEntries?: readonly ToCEntry[];\n readonly beginDirty?: boolean;\n } = {},\n ) {\n super(\"w:sdt\");\n this.root.push(\n new StructuredDocumentTagProperties({\n alias,\n docPartObj: { gallery: \"Table of Contents\" },\n }),\n );\n\n const content = new StructuredDocumentTagContent();\n\n const beginParagraphMandatoryChildren = [\n new Run({\n children: [createBegin(beginDirty), new FieldInstruction(properties), createSeparate()],\n }),\n ];\n\n const endParagraphMandatoryChildren = [\n new Run({\n children: [createEnd()],\n }),\n ];\n\n const hasCachedContent = cachedEntries !== undefined && cachedEntries.length > 0;\n\n if (hasCachedContent) {\n const { stylesWithLevels } = properties;\n const cachedParagraphs = cachedEntries.map((entry, i) => {\n const contentChild = this.buildCachedContentParagraphChild(entry, properties);\n const style =\n stylesWithLevels?.find((s) => s.level === entry.level)?.styleName ?? `TOC${entry.level}`;\n const children =\n i === 0\n ? [...beginParagraphMandatoryChildren, contentChild]\n : i === cachedEntries.length - 1\n ? [contentChild, ...endParagraphMandatoryChildren]\n : [contentChild];\n\n return new Paragraph({\n children,\n style,\n tabStops: this.getTabStopsForLevel(entry.level),\n });\n });\n\n let paragraphs = cachedParagraphs;\n if (cachedEntries.length <= 1) {\n paragraphs = [\n ...cachedParagraphs,\n new Paragraph({\n children: endParagraphMandatoryChildren,\n }),\n ];\n }\n\n for (const paragraph of paragraphs) {\n content.addChildElement(paragraph);\n }\n } else {\n const beginParagraph = new Paragraph({\n children: beginParagraphMandatoryChildren,\n });\n\n content.addChildElement(beginParagraph);\n\n for (const child of contentChildren) {\n content.addChildElement(child);\n }\n\n const endParagraph = new Paragraph({\n children: endParagraphMandatoryChildren,\n });\n\n content.addChildElement(endParagraph);\n }\n\n this.root.push(content);\n }\n\n private getTabStopsForLevel(\n level: number,\n pageWidth: number = 9025,\n ): readonly TabStopDefinition[] {\n const levelSpace = 240;\n const levelPosition = pageWidth + 1 - (level - 1) * levelSpace; // TODO: should be equal to page width + 1 - level margin\n return [\n {\n position: levelPosition,\n type: \"clear\",\n },\n {\n leader: \"dot\",\n position: pageWidth,\n type: \"right\",\n },\n ];\n }\n\n private buildCachedContentRun(entry: ToCEntry, properties?: TableOfContentsOptions): Run {\n return new Run({\n // TODO: The IndexLink style might always need to be set regardless of the hyperlink property. This needs to be verified.\n children: [\n buildText({\n text: entry.title,\n }),\n new Tab(),\n buildText({\n text: entry.page?.toString() ?? \"\",\n }),\n ],\n style: properties?.hyperlink && entry.href !== undefined ? \"IndexLink\" : undefined,\n });\n }\n\n private buildCachedContentParagraphChild(\n entry: ToCEntry,\n properties?: TableOfContentsOptions,\n ): Run | InternalHyperlink {\n const run = this.buildCachedContentRun(entry, properties);\n if (properties?.hyperlink && entry.href !== undefined) {\n return new InternalHyperlink({\n anchor: entry.href,\n children: [run],\n });\n }\n\n return run;\n }\n}\n","/**\n * Table of Contents Properties module.\n *\n * This module defines configuration options for table of contents generation,\n * including field switches and style mappings.\n *\n * Reference: http://officeopenxml.com/WPtableOfContents.php\n *\n * @module\n */\n\n/**\n * Represents a style-to-level mapping for table of contents entries.\n *\n * StyleLevel associates a paragraph style name with a TOC level, allowing\n * custom styles to be included in the table of contents at specific levels.\n *\n * @publicApi\n */\nexport class StyleLevel {\n /** The name of the paragraph style. */\n public readonly styleName: string;\n /** The TOC level (1-9) to assign to this style. */\n public readonly level: number;\n\n public constructor(styleName: string, level: number) {\n this.styleName = styleName;\n this.level = level;\n }\n}\n\n/**\n * Options for configuring a Table of Contents.\n *\n * These options control which content is included in the TOC and how it is formatted.\n * Options correspond to field switches in the TOC field code.\n *\n * Reference:\n * - https://www.ecma-international.org/publications/standards/Ecma-376.htm (Part 1, Page 1251)\n * - http://officeopenxml.com/WPtableOfContents.php\n */\nexport interface TableOfContentsOptions {\n /**\n * \\a option - Includes captioned items, but omits caption labels and numbers.\n * The identifier designated by text in this switch's field-argument corresponds to the caption label.\n * Use captionLabelIncludingNumbers (\\c) to build a table of captions with labels and numbers.\n */\n readonly captionLabel?: string;\n\n /**\n * \\b option - Includes entries only from the portion of the document marked by\n * the bookmark named by text in this switch's field-argument.\n */\n readonly entriesFromBookmark?: string;\n\n /**\n * \\c option - Includes figures, tables, charts, and other items that are numbered\n * by a SEQ field (§17.16.5.56). The sequence identifier designated by text in this switch's\n * field-argument, which corresponds to the caption label, shall match the identifier in the\n * corresponding SEQ field.\n */\n readonly captionLabelIncludingNumbers?: string;\n\n /**\n * \\d option - When used with \\s, the text in this switch's field-argument defines\n * the separator between sequence and page numbers. The default separator is a hyphen (-).\n */\n readonly sequenceAndPageNumbersSeparator?: string;\n\n /**\n * \\f option - Includes only those TC fields whose identifier exactly matches the\n * text in this switch's field-argument (which is typically a letter).\n */\n readonly tcFieldIdentifier?: string;\n\n /**\n * \\h option - Makes the table of contents entries hyperlinks.\n */\n readonly hyperlink?: boolean;\n\n /**\n * \\l option - Includes TC fields that assign entries to one of the levels specified\n * by text in this switch's field-argument as a range having the form startLevel-endLevel,\n * where startLevel and endLevel are integers, and startLevel has a value equal-to or less-than endLevel.\n * TC fields that assign entries to lower levels are skipped.\n */\n readonly tcFieldLevelRange?: string;\n\n /**\n * \\n option - Without field-argument, omits page numbers from the table of contents.\n * Page numbers are omitted from all levels unless a range of entry levels is specified by\n * text in this switch's field-argument. A range is specified as for \\l.\n */\n readonly pageNumbersEntryLevelsRange?: string;\n\n /**\n * \\o option - Uses paragraphs formatted with all or the specified range of builtin\n * heading styles. Headings in a style range are specified by text in this switch's\n * field-argument using the notation specified as for \\l, where each integer corresponds\n * to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1).\n * If no heading range is specified, all heading levels used in the document are listed.\n */\n readonly headingStyleRange?: string;\n\n /**\n * \\p option - Text in this switch's field-argument specifies a sequence of characters\n * that separate an entry and its page number. The default is a tab with leader dots.\n */\n readonly entryAndPageNumberSeparator?: string;\n\n /**\n * \\s option - For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number.\n * The prefix depends on the type of entry. text in this switch's field-argument shall match the\n * identifier in the SEQ field.\n */\n readonly seqFieldIdentifierForPrefix?: string;\n\n /**\n * \\t field-argument Uses paragraphs formatted with styles other than the built-in heading styles.\n * Text in this switch's field-argument specifies those styles as a set of comma-separated doublets,\n * with each doublet being a comma-separated set of style name and table of content level.\n * \\t can be combined with \\o.\n */\n readonly stylesWithLevels?: readonly StyleLevel[];\n\n /**\n * \\u Uses the applied paragraph outline level.\n */\n readonly useAppliedParagraphOutlineLevel?: boolean;\n\n /**\n * \\w Preserves tab entries within table entries.\n */\n readonly preserveTabInEntries?: boolean;\n\n /**\n * \\x Preserves newline characters within table entries.\n */\n readonly preserveNewLineInEntries?: boolean;\n\n /**\n * \\z Hides tab leader and page numbers in web page view (§17.18.102).\n */\n readonly hideTabAndPageNumbersInWebView?: boolean;\n}\n","/**\n * Table of Contents exports.\n *\n * This module provides all public APIs for creating and configuring\n * table of contents in WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPtableOfContents.php\n *\n * @module\n */\nexport * from \"./table-of-contents\";\nexport * from \"./table-of-contents-properties\";\nexport * from \"./sdt-properties\";\nexport * from \"./sdt-content\";\n","/**\n * Structured Document Tag (SDT) module for WordprocessingML documents.\n *\n * SDTs (content controls) are containers that wrap content with metadata and\n * behavior. They exist at multiple levels: inline (run), block, row, and cell.\n *\n * This module provides:\n * - `StructuredDocumentTagRun` — inline SDT (CT_SdtRun) for use within paragraphs\n * - Re-exports of SDT property types from the table-of-contents module\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_SdtRun, CT_SdtBlock\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { BaseXmlComponent, XmlComponent } from \"@file/xml-components\";\n\nimport {\n StructuredDocumentTagContent,\n StructuredDocumentTagProperties,\n} from \"../table-of-contents\";\nimport type { SdtPropertiesOptions } from \"../table-of-contents\";\n\n/**\n * Options for creating an inline Structured Document Tag (CT_SdtRun).\n */\nexport interface SdtRunOptions {\n /** SDT properties (alias, tag, type discriminator, etc.) */\n readonly properties: SdtPropertiesOptions;\n /** Content children (runs, text runs, etc.) to place inside the SDT */\n readonly children?: readonly BaseXmlComponent[];\n}\n\n/**\n * An inline Structured Document Tag (CT_SdtRun).\n *\n * Represents a content control that appears within a paragraph, alongside\n * runs and other inline elements. The SDT wraps its content in `w:sdtContent`.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtRun\">\n * <xsd:sequence>\n * <xsd:element name=\"sdtPr\" type=\"CT_SdtPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"sdtEndPr\" type=\"CT_SdtEndPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"sdtContent\" type=\"CT_SdtContentRun\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Plain text content control\n * new StructuredDocumentTagRun({\n * properties: { text: { multiLine: true }, alias: \"Description\" },\n * children: [new TextRun(\"Default text\")],\n * });\n *\n * // ComboBox content control\n * new StructuredDocumentTagRun({\n * properties: {\n * alias: \"Color\",\n * comboBox: { items: [{ displayText: \"Red\" }, { displayText: \"Blue\" }] },\n * },\n * children: [new TextRun(\"Red\")],\n * });\n * ```\n */\nexport class StructuredDocumentTagRun extends XmlComponent {\n public constructor(options: SdtRunOptions) {\n super(\"w:sdt\");\n this.root.push(new StructuredDocumentTagProperties(options.properties));\n if (options.children && options.children.length > 0) {\n const content = new StructuredDocumentTagContent();\n for (const child of options.children) {\n content.addChildElement(child);\n }\n this.root.push(content);\n }\n }\n}\n\n/**\n * Options for creating a block-level Structured Document Tag (CT_SdtBlock).\n */\nexport interface SdtBlockOptions {\n /** SDT properties */\n readonly properties: SdtPropertiesOptions;\n /** Content children (paragraphs, tables, etc.) to place inside the SDT */\n readonly children?: readonly FileChild[];\n}\n\n/**\n * A block-level Structured Document Tag (CT_SdtBlock).\n *\n * Represents a content control at the block level (alongside paragraphs and tables).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtBlock\">\n * <xsd:sequence>\n * <xsd:element name=\"sdtPr\" type=\"CT_SdtPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"sdtEndPr\" type=\"CT_SdtEndPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"sdtContent\" type=\"CT_SdtContentBlock\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Block-level rich text SDT\n * new StructuredDocumentTagBlock({\n * properties: { richText: true, alias: \"Block Content\" },\n * children: [new Paragraph({ text: \"Content here\" })],\n * });\n * ```\n */\nexport class StructuredDocumentTagBlock extends XmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n public constructor(options: SdtBlockOptions) {\n super(\"w:sdt\");\n this.root.push(new StructuredDocumentTagProperties(options.properties));\n if (options.children && options.children.length > 0) {\n const content = new StructuredDocumentTagContent();\n for (const child of options.children) {\n content.addChildElement(child);\n }\n this.root.push(content);\n }\n }\n}\n","/**\n * Sub-document reference module for WordprocessingML documents.\n *\n * SubDoc (w:subDoc) references an external Word document (.docx) that\n * is included as part of the current document. The referenced document\n * is stored as a separate part in the DOCX package.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_Rel (w:subDoc)\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { uniqueId } from \"@util/convenience-functions\";\n\nconst SUBDOC_RELATIONSHIP_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/subDocument\";\n\n/**\n * Options for creating a SubDoc element.\n */\nexport interface SubDocOptions {\n /** The sub-document data (raw bytes of a .docx file) */\n readonly data: Uint8Array | string;\n}\n\n/**\n * A sub-document reference element (w:subDoc).\n *\n * References an external Word document that is stored as a separate part\n * in the DOCX package and linked via a relationship.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_Rel\n *\n * @example\n * ```typescript\n * new SubDoc({\n * data: fs.readFileSync(\"chapter1.docx\"),\n * });\n * ```\n */\nexport class SubDoc extends XmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n private readonly options: SubDocOptions;\n\n public constructor(options: SubDocOptions) {\n super(\"w:subDoc\");\n this.options = options;\n }\n\n public prepForXml(context: Context): IXmlableObject {\n const relId = uniqueId();\n const partPath = `subdocs/subdoc${relId}.docx`;\n\n this.root.splice(0, 0, { _attr: { \"r:id\": `rId${relId}` } });\n\n const data =\n typeof this.options.data === \"string\"\n ? new TextEncoder().encode(this.options.data)\n : this.options.data;\n\n context.viewWrapper.relationships.addRelationship(relId, SUBDOC_RELATIONSHIP_TYPE, partPath);\n\n context.file.subDocs.addSubDoc(relId, {\n data,\n path: partPath,\n });\n\n context.file.contentTypes.addSubDoc(`/word/${partPath}`);\n\n return super.prepForXml(context) as IXmlableObject;\n }\n}\n","/**\n * Cell-level Structured Document Tag (SDT) for WordprocessingML documents.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_SdtCell\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { TableCellOptions, TableCell } from \"../table\";\nimport {\n StructuredDocumentTagContent,\n StructuredDocumentTagProperties,\n} from \"../table-of-contents\";\nimport type { SdtPropertiesOptions } from \"../table-of-contents\";\n\n/**\n * Options for creating a cell-level Structured Document Tag (CT_SdtCell).\n */\nexport interface SdtCellOptions {\n readonly properties: SdtPropertiesOptions;\n readonly children?: readonly TableCell[];\n}\n\n/**\n * A cell-level Structured Document Tag (CT_SdtCell).\n *\n * Represents a content control within a table cell. The SDT wraps\n * `TableCell` children in `w:sdtContent`.\n *\n * @example\n * ```typescript\n * new StructuredDocumentTagCell({\n * properties: { alias: \"Controlled Cell\" },\n * children: [new TableCell({ children: [new Paragraph(\"Cell\")] })],\n * });\n * ```\n */\nexport class StructuredDocumentTagCell extends XmlComponent {\n public readonly options: TableCellOptions;\n\n public constructor(sdtOptions: SdtCellOptions) {\n super(\"w:sdt\");\n this.options = { children: [] };\n this.root.push(new StructuredDocumentTagProperties(sdtOptions.properties));\n if (sdtOptions.children && sdtOptions.children.length > 0) {\n const content = new StructuredDocumentTagContent();\n for (const child of sdtOptions.children) {\n content.addChildElement(child);\n }\n this.root.push(content);\n }\n }\n}\n","/**\n * Moved text run module for track changes.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveFrom/moveTo (CT_RunTrackChange)\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { createBreak } from \"../../paragraph/run/break\";\nimport { createBegin, createEnd, createSeparate } from \"../../paragraph/run/field\";\nimport { RunProperties } from \"../../paragraph/run/properties\";\nimport { PageNumber } from \"../../paragraph/run/run\";\nimport type { RunOptions } from \"../../paragraph/run/run\";\nimport { buildText } from \"../../paragraph/run/run-components/text\";\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\ntype IMovedRunOptions = RunOptions & ChangedAttributesProperties;\n\n/**\n * Represents a move source run in a tracked changes document.\n *\n * Marks text that has been moved from this location. Content uses\n * `w:t` (standard text element).\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveFrom (CT_RunTrackChange)\n *\n * @example\n * ```typescript\n * new MovedFromTextRun({\n * id: 1,\n * author: \"John\",\n * date: \"2024-01-01T00:00:00Z\",\n * text: \"Moved text\",\n * });\n * ```\n */\nexport class MovedFromTextRun extends XmlComponent {\n public constructor(options: IMovedRunOptions) {\n super(\"w:moveFrom\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n this.addChildElement(new MovedFromRunWrapper(options));\n }\n}\n\n/**\n * Represents a move destination run in a tracked changes document.\n *\n * Marks text that has been moved to this location. Content uses\n * standard `w:t` text element.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, moveTo (CT_RunTrackChange)\n *\n * @example\n * ```typescript\n * new MovedToTextRun({\n * id: 1,\n * author: \"John\",\n * date: \"2024-01-01T00:00:00Z\",\n * text: \"Moved text\",\n * });\n * ```\n */\nexport class MovedToTextRun extends XmlComponent {\n public constructor(options: IMovedRunOptions) {\n super(\"w:moveTo\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n this.addChildElement(new MovedToRunWrapper(options));\n }\n}\n\n/**\n * Internal wrapper for the run element within a move source.\n * Uses `w:t` (standard text) — moveFrom is a move, not a deletion.\n *\n * @internal\n */\nclass MovedFromRunWrapper extends XmlComponent {\n public constructor(options: RunOptions) {\n super(\"w:r\");\n this.root.push(new RunProperties(options));\n\n if (options.children) {\n for (const child of options.children) {\n if (typeof child === \"string\") {\n switch (child) {\n case PageNumber.CURRENT: {\n this.root.push(createBegin());\n this.root.push(buildText(\"PAGE\"));\n this.root.push(createSeparate());\n this.root.push(createEnd());\n break;\n }\n case PageNumber.TOTAL_PAGES: {\n this.root.push(createBegin());\n this.root.push(buildText(\"NUMPAGES\"));\n this.root.push(createSeparate());\n this.root.push(createEnd());\n break;\n }\n case PageNumber.TOTAL_PAGES_IN_SECTION: {\n this.root.push(createBegin());\n this.root.push(buildText(\"SECTIONPAGES\"));\n this.root.push(createSeparate());\n this.root.push(createEnd());\n break;\n }\n default: {\n this.root.push(buildText(child));\n break;\n }\n }\n continue;\n }\n\n this.root.push(child);\n }\n } else if (options.text) {\n this.root.push(buildText(options.text));\n }\n\n if (options.break) {\n for (let i = 0; i < options.break; i++) {\n this.root.splice(1, 0, createBreak());\n }\n }\n }\n}\n\n/**\n * Internal wrapper for the run element within a move destination.\n * Uses standard `w:t` text element.\n *\n * @internal\n */\nclass MovedToRunWrapper extends XmlComponent {\n public constructor(options: RunOptions) {\n super(\"w:r\");\n this.root.push(new RunProperties(options));\n\n if (options.children) {\n for (const child of options.children) {\n this.root.push(child);\n }\n } else if (options.text) {\n this.root.push(buildText(options.text));\n }\n\n if (options.break) {\n for (let i = 0; i < options.break; i++) {\n this.root.splice(1, 0, createBreak());\n }\n }\n }\n}\n","import type { IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\nexport function buildInsertedTableRowObj(options: ChangedAttributesProperties): IXmlableObject {\n return {\n \"w:ins\": { _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id } },\n };\n}\n\nexport class InsertedTableRow extends XmlComponent {\n public constructor(options: ChangedAttributesProperties) {\n super(\"w:ins\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n }\n}\n","import type { IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\nexport function buildDeletedTableRowObj(options: ChangedAttributesProperties): IXmlableObject {\n return {\n \"w:del\": { _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id } },\n };\n}\n\nexport class DeletedTableRow extends XmlComponent {\n public constructor(options: ChangedAttributesProperties) {\n super(\"w:del\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n }\n}\n","import type { IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\nexport function buildInsertedTableCellObj(options: ChangedAttributesProperties): IXmlableObject {\n return {\n \"w:cellIns\": {\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n },\n };\n}\n\nexport class InsertedTableCell extends XmlComponent {\n public constructor(options: ChangedAttributesProperties) {\n super(\"w:cellIns\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n }\n}\n","import type { IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\nexport function buildDeletedTableCellObj(options: ChangedAttributesProperties): IXmlableObject {\n return {\n \"w:cellDel\": {\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n },\n };\n}\n\nexport class DeletedTableCell extends XmlComponent {\n public constructor(options: ChangedAttributesProperties) {\n super(\"w:cellDel\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n }\n}\n","import type { IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport { xsdVerticalMergeRev } from \"@office-open/core\";\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\n/**\n * Vertical merge revision types.\n */\nexport const VerticalMergeRevisionType = {\n /**\n * Cell that is merged with upper one.\n */\n CONTINUE: \"continue\",\n /**\n * Cell that is starting the vertical merge.\n */\n RESTART: \"restart\",\n} as const;\n\nexport type ICellMergeAttributes = ChangedAttributesProperties & {\n readonly verticalMerge?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];\n readonly verticalMergeOriginal?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];\n};\n\nexport function buildCellMergeObj(options: ICellMergeAttributes): IXmlableObject {\n const attrs: Record<string, string | number> = {\n \"w:author\": options.author,\n \"w:date\": options.date,\n \"w:id\": options.id,\n };\n if (options.verticalMerge !== undefined) {\n attrs[\"w:vMerge\"] = xsdVerticalMergeRev.to(options.verticalMerge);\n }\n if (options.verticalMergeOriginal !== undefined) {\n attrs[\"w:vMergeOrig\"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);\n }\n return { \"w:cellMerge\": { _attr: attrs } };\n}\n\nexport class CellMerge extends XmlComponent {\n public constructor(options: ICellMergeAttributes) {\n super(\"w:cellMerge\");\n\n const attrs: Record<string, string | number> = {\n \"w:author\": options.author,\n \"w:date\": options.date,\n \"w:id\": options.id,\n };\n if (options.verticalMerge !== undefined) {\n attrs[\"w:vMerge\"] = xsdVerticalMergeRev.to(options.verticalMerge);\n }\n if (options.verticalMergeOriginal !== undefined) {\n attrs[\"w:vMergeOrig\"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);\n }\n this.root.push({ _attr: attrs });\n }\n}\n","/**\n * Track Revision module for WordprocessingML documents.\n *\n * Provides components for tracking changes in documents including insertions,\n * deletions, and their associated metadata (author, date, id).\n *\n * Reference: http://officeopenxml.com/WPtrackChanges.php\n *\n * @module\n */\nexport * from \"./track-revision-components/inserted-text-run\";\nexport * from \"./track-revision-components/deleted-text-run\";\nexport * from \"./track-revision-components/moved-text-run\";\nexport * from \"./track-revision-components/inserted-table-row\";\nexport * from \"./track-revision-components/deleted-table-row\";\nexport * from \"./track-revision-components/inserted-table-cell\";\nexport * from \"./track-revision-components/deleted-table-cell\";\nexport * from \"./track-revision-components/cell-merge\";\n","/**\n * Vertical alignment module for WordprocessingML documents.\n *\n * This module provides vertical alignment options for table cells and sections.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_VerticalJc\">\n * <xsd:attribute name=\"val\" type=\"ST_VerticalJc\" use=\"required\"/>\n * </xsd:complexType>\n *\n * <xsd:simpleType name=\"ST_VerticalJc\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"both\"/>\n * <xsd:enumeration value=\"top\"/>\n * <xsd:enumeration value=\"center\"/>\n * <xsd:enumeration value=\"bottom\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Enumeration for table-cell vertical alignment. Only `top`, `center`, `bottom`\n * are valid according to ECMA-376 (§17.18.87 ST_VerticalJc within `<w:tcPr>`).\n *\n * @publicApi\n */\nexport const VerticalAlignTable = {\n BOTTOM: \"bottom\",\n CENTER: \"center\",\n TOP: \"top\",\n} as const;\n\n/**\n * Enumeration for section (<w:sectPr>) vertical alignment. Adds `both` on top of\n * the table-cell set (§17.18.87 ST_VerticalJc within <w:sectPr>).\n *\n * @publicApi\n */\nexport const VerticalAlignSection = {\n ...VerticalAlignTable,\n BOTH: \"both\",\n} as const;\n\nexport type TableVerticalAlign = (typeof VerticalAlignTable)[keyof typeof VerticalAlignTable];\n\nexport type SectionVerticalAlign = (typeof VerticalAlignSection)[keyof typeof VerticalAlignSection];\n\n/**\n * Creates a vertical alignment element in a WordprocessingML document.\n *\n * Used in table cells and sections to control vertical text positioning.\n *\n * @example\n * ```typescript\n * createVerticalAlign(VerticalAlignTable.CENTER);\n * ```\n */\nexport const createVerticalAlign = (\n value: TableVerticalAlign | SectionVerticalAlign,\n): XmlComponent =>\n new BuilderElement<{\n readonly verticalAlign: TableVerticalAlign | SectionVerticalAlign;\n }>({\n attributes: {\n verticalAlign: { key: \"w:val\", value },\n },\n name: \"w:vAlign\",\n });\n","/**\n * Vertical align module exports.\n *\n * @module\n */\nexport * from \"./vertical-align\";\n","/**\n * Table cell components module for WordprocessingML documents.\n *\n * This module provides XML components for table cell properties including borders,\n * grid span (column span), vertical merge, and text direction.\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * @module\n */\nimport { buildBorderObj, createBorderElement } from \"@file/border\";\nimport type { BorderOptions } from \"@file/border\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport {\n IgnoreIfEmptyXmlComponent,\n XmlComponent,\n numberValObj,\n stringEnumValObj,\n} from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Options for configuring table cell borders.\n *\n * Defines border settings for individual edges of a table cell. Border settings\n * can be specified for top, bottom, left, right, start, and end edges.\n *\n * @see {@link TableCellBorders}\n */\nexport interface TableCellBordersOptions {\n /** Border for the top edge of the cell */\n readonly top?: BorderOptions;\n /** Border for the start edge (left in LTR, right in RTL) */\n readonly start?: BorderOptions;\n /** Border for the left edge of the cell */\n readonly left?: BorderOptions;\n /** Border for the bottom edge of the cell */\n readonly bottom?: BorderOptions;\n /** Border for the end edge (right in LTR, left in RTL) */\n readonly end?: BorderOptions;\n /** Border for the right edge of the cell */\n readonly right?: BorderOptions;\n}\n\n/**\n * Represents table cell borders (tcBorders) in a WordprocessingML document.\n *\n * The tcBorders element specifies the borders for a single table cell. Each border\n * can be configured independently with different styles, colors, and widths.\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TcBorders\">\n * <xsd:sequence>\n * <xsd:element name=\"top\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"start\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"left\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"bottom\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"end\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"right\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"insideH\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"insideV\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"tl2br\" type=\"CT_Border\" minOccurs=\"0\"/>\n * <xsd:element name=\"tr2bl\" type=\"CT_Border\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new TableCellBorders({\n * top: { style: BorderStyle.SINGLE, size: 6, color: \"FF0000\" },\n * bottom: { style: BorderStyle.SINGLE, size: 6, color: \"0000FF\" },\n * });\n * ```\n */\n/**\n * Build table cell borders (w:tcBorders) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTableCellBorders(\n options: TableCellBordersOptions,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (options.top) children.push(buildBorderObj(\"w:top\", options.top));\n if (options.start) children.push(buildBorderObj(\"w:start\", options.start));\n if (options.left) children.push(buildBorderObj(\"w:left\", options.left));\n if (options.bottom) children.push(buildBorderObj(\"w:bottom\", options.bottom));\n if (options.end) children.push(buildBorderObj(\"w:end\", options.end));\n if (options.right) children.push(buildBorderObj(\"w:right\", options.right));\n\n return children.length > 0 ? { \"w:tcBorders\": children } : undefined;\n}\n\nexport class TableCellBorders extends IgnoreIfEmptyXmlComponent {\n public constructor(options: TableCellBordersOptions) {\n super(\"w:tcBorders\");\n\n if (options.top) {\n this.root.push(createBorderElement(\"w:top\", options.top));\n }\n if (options.start) {\n this.root.push(createBorderElement(\"w:start\", options.start));\n }\n if (options.left) {\n this.root.push(createBorderElement(\"w:left\", options.left));\n }\n if (options.bottom) {\n this.root.push(createBorderElement(\"w:bottom\", options.bottom));\n }\n if (options.end) {\n this.root.push(createBorderElement(\"w:end\", options.end));\n }\n if (options.right) {\n this.root.push(createBorderElement(\"w:right\", options.right));\n }\n }\n}\n\n/**\n * Build grid span (w:gridSpan) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildGridSpan(value: number): IXmlableObject {\n return numberValObj(\"w:gridSpan\", decimalNumber(value));\n}\n\n/**\n * Represents a grid span (gridSpan) element in a WordprocessingML document.\n *\n * The gridSpan element specifies the number of logical columns this cell spans\n * in the table grid. This is used to merge cells horizontally (column span).\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DecimalNumber\">\n * <xsd:attribute name=\"val\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Cell spanning 3 columns\n * new GridSpan(3);\n * ```\n */\nexport class GridSpan extends XmlComponent {\n public constructor(value: number) {\n super(\"w:gridSpan\");\n\n this.root.push({ _attr: { \"w:val\": decimalNumber(value) } });\n }\n}\n\n/**\n * Vertical merge types for table cells.\n *\n * Defines the merge behavior for vertically merged cells (row span).\n */\nexport const VerticalMergeType = {\n /**\n * Cell that is merged with upper one.\n * This cell continues a vertical merge started by a cell above it.\n */\n CONTINUE: \"continue\",\n /**\n * Cell that is starting the vertical merge.\n * This cell begins a new vertical merge region.\n */\n RESTART: \"restart\",\n} as const;\n\n/**\n * Build vertical merge (w:vMerge) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildVerticalMerge(\n value: (typeof VerticalMergeType)[keyof typeof VerticalMergeType],\n): IXmlableObject {\n return stringEnumValObj(\"w:vMerge\", value);\n}\n\n/**\n * Represents a vertical merge (vMerge) element in a WordprocessingML document.\n *\n * The vMerge element specifies that this cell is part of a vertically merged region.\n * Cells can either restart a new merge region or continue an existing one from above.\n * This is used to create row spans in tables.\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_VMerge\">\n * <xsd:attribute name=\"val\" type=\"ST_Merge\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // First cell in a vertical merge\n * new VerticalMerge(VerticalMergeType.RESTART);\n *\n * // Subsequent cells that continue the merge\n * new VerticalMerge(VerticalMergeType.CONTINUE);\n * ```\n */\nexport class VerticalMerge extends XmlComponent {\n public constructor(value: (typeof VerticalMergeType)[keyof typeof VerticalMergeType]) {\n super(\"w:vMerge\");\n\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Text direction values for table cells.\n *\n * Specifies the direction in which text flows within a table cell.\n */\nexport const TextDirection = {\n /** Text flows from bottom to top, left to right */\n BOTTOM_TO_TOP_LEFT_TO_RIGHT: \"btLr\",\n /** Text flows from left to right, top to bottom (default) */\n LEFT_TO_RIGHT_TOP_TO_BOTTOM: \"lrTb\",\n /** Text flows from top to bottom, right to left */\n TOP_TO_BOTTOM_RIGHT_TO_LEFT: \"tbRl\",\n} as const;\n\n/**\n * Build text direction (w:textDirection) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTextDirection(\n value: (typeof TextDirection)[keyof typeof TextDirection],\n): IXmlableObject {\n return stringEnumValObj(\"w:textDirection\", value);\n}\n\n/**\n * Represents a text direction (textDirection) element in a WordprocessingML document.\n *\n * The textDirection element specifies the flow of text within a table cell. This is\n * useful for creating rotated text or supporting different writing systems.\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TextDirection\">\n * <xsd:attribute name=\"val\" type=\"ST_TextDirection\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Vertical text flowing from top to bottom\n * new TDirection(TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT);\n * ```\n */\nexport class TDirection extends XmlComponent {\n public constructor(value: (typeof TextDirection)[keyof typeof TextDirection]) {\n super(\"w:textDirection\");\n\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n","/**\n * Table cell module exports.\n *\n * @module\n */\nexport * from \"./table-cell\";\nexport * from \"./table-cell-components\";\n","/**\n * Table cell spacing module for WordprocessingML documents.\n *\n * This module provides cell spacing settings for tables, controlling\n * the space between cells in a table.\n *\n * Reference: http://officeopenxml.com/WPtableCellSpacing.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { measurementOrPercentValue } from \"@util/values\";\nimport type { Percentage, UniversalMeasure } from \"@util/values\";\n\n/**\n * Cell spacing measurement types.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TblCellSpacing\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"nil\"/>\n * <xsd:enumeration value=\"dxa\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const CellSpacingType = {\n /** Value is in twentieths of a point */\n DXA: \"dxa\",\n /** No (empty) value. */\n NIL: \"nil\",\n} as const;\n\n/**\n * Properties for table cell spacing.\n *\n * @see {@link createTableCellSpacing}\n */\nexport interface TableCellSpacingProperties {\n /** The spacing value (in twips, percentage, or universal measure) */\n readonly value: number | Percentage | UniversalMeasure;\n /** The type of measurement (defaults to DXA/twips) */\n readonly type?: (typeof CellSpacingType)[keyof typeof CellSpacingType];\n}\n\n/**\n * Creates table cell spacing in a WordprocessingML document.\n *\n * The tblCellSpacing element specifies the spacing between cells in a table.\n *\n * Reference: http://officeopenxml.com/WPtableCellSpacing.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblCellSpacing\">\n * <xsd:attribute name=\"w\" type=\"ST_MeasurementOrPercent\"/>\n * <xsd:attribute name=\"type\" type=\"ST_TblCellSpacing\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * createTableCellSpacing({ value: 100, type: CellSpacingType.DXA });\n * ```\n */\nexport const createTableCellSpacing = ({\n type = CellSpacingType.DXA,\n value,\n}: TableCellSpacingProperties): XmlComponent =>\n new BuilderElement<TableCellSpacingProperties>({\n attributes: {\n type: { key: \"w:type\", value: type },\n value: { key: \"w:w\", value: measurementOrPercentValue(value) },\n },\n name: \"w:tblCellSpacing\",\n });\n","/**\n * Table width module for WordprocessingML documents.\n *\n * This module provides width specifications for tables and cells.\n *\n * Reference: http://officeopenxml.com/WPtableWidth.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { measurementOrPercentValue } from \"@util/values\";\nimport type { Percentage, UniversalMeasure } from \"@util/values\";\n\n/**\n * Width type values for tables and cells.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TblWidth\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"nil\"/>\n * <xsd:enumeration value=\"pct\"/>\n * <xsd:enumeration value=\"dxa\"/>\n * <xsd:enumeration value=\"auto\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const WidthType = {\n /** Auto. */\n AUTO: \"auto\",\n /** Value is in twentieths of a point */\n DXA: \"dxa\",\n /** No (empty) value. */\n NIL: \"nil\",\n /** Value is in percentage. */\n PERCENTAGE: \"pct\",\n} as const;\n\n/**\n * Properties for specifying table or cell width.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblWidth\">\n * <xsd:attribute name=\"w\" type=\"ST_MeasurementOrPercent\"/>\n * <xsd:attribute name=\"type\" type=\"ST_TblWidth\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface TableWidthProperties {\n readonly size: number | Percentage | UniversalMeasure;\n readonly type?: (typeof WidthType)[keyof typeof WidthType];\n}\n\n/**\n * Creates a table width element in a WordprocessingML document.\n *\n * Used for specifying widths of tables, cells, margins, and indentation.\n *\n * Reference: http://officeopenxml.com/WPtableWidth.php\n *\n * @example\n * ```typescript\n * createTableWidthElement(\"w:tblW\", { size: 5000, type: WidthType.DXA });\n * createTableWidthElement(\"w:tcW\", { size: 50, type: WidthType.PERCENTAGE });\n * ```\n */\nexport const buildTableWidthObj = (\n name: string,\n { type = WidthType.AUTO, size }: TableWidthProperties,\n): IXmlableObject => {\n let tableWidthValue = size;\n if (type === WidthType.PERCENTAGE && typeof size === \"number\") {\n tableWidthValue = `${size}%`;\n }\n return {\n [name]: {\n _attr: {\n ...(tableWidthValue !== undefined && { \"w:w\": measurementOrPercentValue(tableWidthValue) }),\n \"w:type\": type,\n },\n },\n };\n};\n\nexport const createTableWidthElement = (\n name: string,\n { type = WidthType.AUTO, size }: TableWidthProperties,\n): XmlComponent => {\n let tableWidthValue = size;\n if (type === WidthType.PERCENTAGE && typeof size === \"number\") {\n tableWidthValue = `${size}%`;\n }\n\n return new BuilderElement<TableWidthProperties>({\n attributes: {\n size: { key: \"w:w\", value: measurementOrPercentValue(tableWidthValue) },\n type: { key: \"w:type\", value: type },\n },\n name,\n });\n};\n","/**\n * Table borders module for WordprocessingML documents.\n *\n * This module provides border options for tables.\n *\n * Reference: http://officeopenxml.com/WPtableBorders.php\n *\n * @module\n */\nimport { BorderStyle, buildBorderObj, createBorderElement } from \"@file/border\";\nimport type { BorderOptions } from \"@file/border\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for configuring table borders.\n *\n * Borders can be applied to the outside edges (top, bottom, left, right)\n * and inside lines (insideHorizontal, insideVertical) of the table.\n */\nexport interface TableBordersOptions {\n readonly top?: BorderOptions;\n readonly bottom?: BorderOptions;\n readonly left?: BorderOptions;\n readonly right?: BorderOptions;\n readonly insideHorizontal?: BorderOptions;\n readonly insideVertical?: BorderOptions;\n}\n\nconst NONE_BORDER: BorderOptions = {\n color: \"auto\",\n size: 0,\n style: BorderStyle.NONE,\n};\n\nconst DEFAULT_BORDER: BorderOptions = {\n color: \"auto\",\n size: 4,\n style: BorderStyle.SINGLE,\n};\n\n/**\n * Represents table borders in a WordprocessingML document.\n *\n * The tblBorders element specifies the borders for all cells in the table.\n *\n * Reference: http://officeopenxml.com/WPtableBorders.php\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new TableBorders({\n * top: { style: BorderStyle.SINGLE, size: 6, color: \"000000\" },\n * bottom: { style: BorderStyle.SINGLE, size: 6, color: \"000000\" },\n * });\n *\n * // To remove all borders\n * new TableBorders(TableBorders.NONE);\n * ```\n */\n/**\n * Build table borders (w:tblBorders) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTableBorders(options: TableBordersOptions): IXmlableObject {\n return {\n \"w:tblBorders\": [\n buildBorderObj(\"w:top\", options.top ?? DEFAULT_BORDER),\n buildBorderObj(\"w:left\", options.left ?? DEFAULT_BORDER),\n buildBorderObj(\"w:bottom\", options.bottom ?? DEFAULT_BORDER),\n buildBorderObj(\"w:right\", options.right ?? DEFAULT_BORDER),\n buildBorderObj(\"w:insideH\", options.insideHorizontal ?? DEFAULT_BORDER),\n buildBorderObj(\"w:insideV\", options.insideVertical ?? DEFAULT_BORDER),\n ],\n };\n}\n\nexport class TableBorders extends XmlComponent {\n public static readonly NONE: TableBordersOptions = {\n bottom: NONE_BORDER,\n insideHorizontal: NONE_BORDER,\n insideVertical: NONE_BORDER,\n left: NONE_BORDER,\n right: NONE_BORDER,\n top: NONE_BORDER,\n };\n\n public constructor(options: TableBordersOptions) {\n super(\"w:tblBorders\");\n\n this.root.push(createBorderElement(\"w:top\", options.top ?? DEFAULT_BORDER));\n this.root.push(createBorderElement(\"w:left\", options.left ?? DEFAULT_BORDER));\n this.root.push(createBorderElement(\"w:bottom\", options.bottom ?? DEFAULT_BORDER));\n this.root.push(createBorderElement(\"w:right\", options.right ?? DEFAULT_BORDER));\n this.root.push(createBorderElement(\"w:insideH\", options.insideHorizontal ?? DEFAULT_BORDER));\n this.root.push(createBorderElement(\"w:insideV\", options.insideVertical ?? DEFAULT_BORDER));\n }\n}\n","/**\n * Table float properties module for WordprocessingML documents.\n *\n * This module provides floating table positioning options, allowing tables\n * to float with text wrapping around them.\n *\n * Reference: http://officeopenxml.com/WPtableFloating.php\n *\n * @module\n */\nimport { BuilderElement, attrObj } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\nimport { signedTwipsMeasureValue, twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure, UniversalMeasure } from \"@util/values\";\n\n/**\n * Anchor types for floating table positioning.\n *\n * Specifies the base object from which positioning is determined.\n */\nexport const TableAnchorType = {\n MARGIN: \"margin\",\n PAGE: \"page\",\n TEXT: \"text\",\n} as const;\n\n/**\n * Relative horizontal position values for floating tables.\n */\nexport const RelativeHorizontalPosition = {\n CENTER: \"center\",\n INSIDE: \"inside\",\n LEFT: \"left\",\n OUTSIDE: \"outside\",\n RIGHT: \"right\",\n} as const;\n\n/**\n * Relative vertical position values for floating tables.\n */\nexport const RelativeVerticalPosition = {\n BOTTOM: \"bottom\",\n CENTER: \"center\",\n INLINE: \"inline\",\n INSIDE: \"inside\",\n OUTSIDE: \"outside\",\n TOP: \"top\",\n} as const;\n\n/**\n * Table overlap behavior types.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TblOverlap\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"never\"/>\n * <xsd:enumeration value=\"overlap\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const OverlapType = {\n NEVER: \"never\",\n OVERLAP: \"overlap\",\n} as const;\n\nexport interface TableFloatOptions {\n /* CSpell:disable */\n /**\n * Specifies the horizontal anchor or the base object from which the horizontal positioning in the\n * tblpX or tblpXSpec attribute should be determined.\n * margin - relative to the vertical edge of the text margin before any text runs (left edge for left-to-right paragraphs)\n * page - relative to the vertical edge of the page before any text runs (left edge for left-to-right paragraphs)\n * text - relative to the vertical edge of the text margin for the column in which the anchor paragraph is located\n * If omitted, the value is assumed to be page.\n */\n /* CSpell:enable */\n readonly horizontalAnchor?: (typeof TableAnchorType)[keyof typeof TableAnchorType];\n\n /**\n * Specifies an absolute horizontal position for the table, relative to the horizontalAnchor.\n * The value is in twentieths of a point. Note that the value can be negative, in which case the\n * table is positioned before the anchor object in the direction of horizontal text flow.\n * If relativeHorizontalPosition is also specified, then the absoluteHorizontalPosition attribute is ignored.\n * If the attribute is omitted, the value is assumed to be zero.\n */\n readonly absoluteHorizontalPosition?: number | UniversalMeasure;\n\n /**\n * Specifies a relative horizontal position for the table, relative to the horizontalAnchor attribute.\n * This will supersede the absoluteHorizontalPosition attribute.\n * Possible values are:\n * center - the table should be horizontally centered with respect to the anchor\n * inside - the table should be inside of the anchor\n * left - the table should be left aligned with respect to the anchor\n * outside - the table should be outside of the anchor\n * right - the table should be right aligned with respect to the anchor\n */\n readonly relativeHorizontalPosition?: (typeof RelativeHorizontalPosition)[keyof typeof RelativeHorizontalPosition];\n\n /**\n * Specifies the vertical anchor or the base object from which the vertical positioning\n * in the absoluteVerticalPosition attribute should be determined. Possible values are:\n * margin - relative to the horizontal edge of the text margin before any text runs (top edge for top-to-bottom paragraphs)\n * page - relative to the horizontal edge of the page before any text runs (top edge for top-to-bottom paragraphs)\n * text - relative to the horizontal edge of the text margin for the column in which the anchor paragraph is located\n * If omitted, the value is assumed to be page.\n */\n readonly verticalAnchor?: (typeof TableAnchorType)[keyof typeof TableAnchorType];\n\n /**\n * Specifies an absolute vertical position for the table, relative to the verticalAnchor anchor.\n * The value is in twentieths of a point. Note that the value can be negative, in which case the table is\n * positioned before the anchor object in the direction of vertical text flow.\n * If relativeVerticalPosition is also specified, then the absoluteVerticalPosition attribute is ignored.\n * If the attribute is omitted, the value is assumed to be zero.\n */\n readonly absoluteVerticalPosition?: number | UniversalMeasure;\n\n /**\n * Specifies a relative vertical position for the table, relative to the verticalAnchor attribute.\n * This will supersede the absoluteVerticalPosition attribute. Possible values are:\n * center - the table should be vertically centered with respect to the anchor\n * inside - the table should be vertically aligned to the edge of the anchor and inside the anchor\n * bottom - the table should be vertically aligned to the bottom edge of the anchor\n * outside - the table should be vertically aligned to the edge of the anchor and outside the anchor\n * inline - the table should be vertically aligned in line with the surrounding text (so as to not allow any text wrapping around it)\n * top - the table should be vertically aligned to the top edge of the anchor\n */\n readonly relativeVerticalPosition?: (typeof RelativeVerticalPosition)[keyof typeof RelativeVerticalPosition];\n\n /**\n * Specifies the minimum distance to be maintained between the table and the top of text in the paragraph\n * below the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.\n */\n readonly bottomFromText?: number | PositiveUniversalMeasure;\n\n /**\n * Specifies the minimum distance to be maintained between the table and the bottom edge of text in the paragraph\n * above the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.\n */\n readonly topFromText?: number | PositiveUniversalMeasure;\n\n /**\n * Specifies the minimum distance to be maintained between the table and the edge of text in the paragraph\n * to the left of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.\n */\n readonly leftFromText?: number | PositiveUniversalMeasure;\n\n /**\n * Specifies the minimum distance to be maintained between the table and the edge of text in the paragraph\n * to the right of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.\n */\n readonly rightFromText?: number | PositiveUniversalMeasure;\n readonly overlap?: (typeof OverlapType)[keyof typeof OverlapType];\n}\n\n/**\n * Creates a table overlap element.\n *\n * @internal\n */\nconst createOverlapElement = (\n overlap: (typeof OverlapType)[keyof typeof OverlapType],\n): XmlComponent =>\n new BuilderElement<{ readonly val: (typeof OverlapType)[keyof typeof OverlapType] }>({\n attributes: {\n val: { key: \"w:val\", value: overlap },\n },\n name: \"w:tblOverlap\",\n });\n\n/**\n * Creates floating table properties in a WordprocessingML document.\n *\n * This element specifies the positioning of a floating table,\n * including anchor points, offsets, and text wrapping behavior.\n *\n * Reference: http://officeopenxml.com/WPtableFloating.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblPPr\">\n * <xsd:attribute name=\"leftFromText\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"rightFromText\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"topFromText\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"bottomFromText\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"vertAnchor\" type=\"ST_VAnchor\"/>\n * <xsd:attribute name=\"horzAnchor\" type=\"ST_HAnchor\"/>\n * <xsd:attribute name=\"tblpXSpec\" type=\"s:ST_XAlign\"/>\n * <xsd:attribute name=\"tblpX\" type=\"ST_SignedTwipsMeasure\"/>\n * <xsd:attribute name=\"tblpYSpec\" type=\"s:ST_YAlign\"/>\n * <xsd:attribute name=\"tblpY\" type=\"ST_SignedTwipsMeasure\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * createTableFloatProperties({\n * horizontalAnchor: TableAnchorType.MARGIN,\n * relativeHorizontalPosition: RelativeHorizontalPosition.CENTER,\n * topFromText: 200,\n * bottomFromText: 200,\n * });\n * ```\n */\nexport const createTableFloatProperties = ({\n horizontalAnchor,\n verticalAnchor,\n absoluteHorizontalPosition,\n relativeHorizontalPosition,\n absoluteVerticalPosition,\n relativeVerticalPosition,\n bottomFromText,\n topFromText,\n leftFromText,\n rightFromText,\n}: TableFloatOptions): XmlComponent =>\n new BuilderElement<Omit<TableFloatOptions, \"overlap\">>({\n attributes: {\n absoluteHorizontalPosition: {\n key: \"w:tblpX\",\n value:\n absoluteHorizontalPosition === undefined\n ? undefined\n : signedTwipsMeasureValue(absoluteHorizontalPosition),\n },\n absoluteVerticalPosition: {\n key: \"w:tblpY\",\n value:\n absoluteVerticalPosition === undefined\n ? undefined\n : signedTwipsMeasureValue(absoluteVerticalPosition),\n },\n bottomFromText: {\n key: \"w:bottomFromText\",\n value: bottomFromText === undefined ? undefined : twipsMeasureValue(bottomFromText),\n },\n horizontalAnchor: {\n key: \"w:horzAnchor\",\n value: horizontalAnchor,\n },\n leftFromText: {\n key: \"w:leftFromText\",\n value: leftFromText === undefined ? undefined : twipsMeasureValue(leftFromText),\n },\n relativeHorizontalPosition: {\n key: \"w:tblpXSpec\",\n value: relativeHorizontalPosition,\n },\n relativeVerticalPosition: {\n key: \"w:tblpYSpec\",\n value: relativeVerticalPosition,\n },\n rightFromText: {\n key: \"w:rightFromText\",\n value: rightFromText === undefined ? undefined : twipsMeasureValue(rightFromText),\n },\n topFromText: {\n key: \"w:topFromText\",\n value: topFromText === undefined ? undefined : twipsMeasureValue(topFromText),\n },\n verticalAnchor: {\n key: \"w:vertAnchor\",\n value: verticalAnchor,\n },\n },\n name: \"w:tblpPr\",\n });\n\nexport const buildTableFloatPropertiesObj = ({\n horizontalAnchor,\n verticalAnchor,\n absoluteHorizontalPosition,\n relativeHorizontalPosition,\n absoluteVerticalPosition,\n relativeVerticalPosition,\n bottomFromText,\n topFromText,\n leftFromText,\n rightFromText,\n}: TableFloatOptions): IXmlableObject =>\n attrObj(\"w:tblpPr\", {\n \"w:horzAnchor\": horizontalAnchor,\n \"w:vertAnchor\": verticalAnchor,\n \"w:tblpX\":\n absoluteHorizontalPosition !== undefined\n ? signedTwipsMeasureValue(absoluteHorizontalPosition)\n : undefined,\n \"w:tblpXSpec\": relativeHorizontalPosition,\n \"w:tblpY\":\n absoluteVerticalPosition !== undefined\n ? signedTwipsMeasureValue(absoluteVerticalPosition)\n : undefined,\n \"w:tblpYSpec\": relativeVerticalPosition,\n \"w:bottomFromText\":\n bottomFromText !== undefined ? twipsMeasureValue(bottomFromText) : undefined,\n \"w:topFromText\": topFromText !== undefined ? twipsMeasureValue(topFromText) : undefined,\n \"w:leftFromText\": leftFromText !== undefined ? twipsMeasureValue(leftFromText) : undefined,\n \"w:rightFromText\": rightFromText !== undefined ? twipsMeasureValue(rightFromText) : undefined,\n });\n\nexport const createTableOverlap = (\n overlap: (typeof OverlapType)[keyof typeof OverlapType],\n): XmlComponent => createOverlapElement(overlap);\n","/**\n * Table layout module for WordprocessingML documents.\n *\n * This module provides table layout algorithm settings.\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Table layout algorithm types.\n *\n * Specifies how the table width is calculated.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TblLayoutType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"fixed\"/>\n * <xsd:enumeration value=\"autofit\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const TableLayoutType = {\n /** Auto-fit layout - column widths are adjusted based on content */\n AUTOFIT: \"autofit\",\n /** Fixed layout - column widths are fixed as specified */\n FIXED: \"fixed\",\n} as const;\n\n/**\n * Creates table layout settings in a WordprocessingML document.\n *\n * The tblLayout element specifies the algorithm used to lay out the table.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblLayoutType\">\n * <xsd:attribute name=\"type\" type=\"ST_TblLayoutType\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * createTableLayout(TableLayoutType.FIXED);\n * ```\n */\nexport const createTableLayout = (\n type: (typeof TableLayoutType)[keyof typeof TableLayoutType],\n): XmlComponent =>\n new BuilderElement<{ readonly type: (typeof TableLayoutType)[keyof typeof TableLayoutType] }>({\n attributes: {\n type: { key: \"w:type\", value: type },\n },\n name: \"w:tblLayout\",\n });\n","/**\n * Table look module for WordprocessingML documents.\n *\n * Table look specifies conditional formatting settings that determine which\n * special formatting is applied to a table. These settings control whether\n * special formatting is applied to the first row, last row, first column,\n * last column, and whether to display horizontal or vertical banding.\n *\n * Reference: http://officeopenxml.com/WPtblLook.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblLook\">\n * <xsd:attribute name=\"firstRow\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"lastRow\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"firstColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"lastColumn\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"noHBand\" type=\"s:ST_OnOff\"/>\n * <xsd:attribute name=\"noVBand\" type=\"s:ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for configuring table look conditional formatting.\n *\n * These options control which conditional formatting styles are applied\n * to the table. When a table style defines special formatting for these\n * regions (e.g., bold headers, alternating row colors), these flags\n * determine whether that special formatting is visible.\n *\n * @example\n * ```typescript\n * // Apply header row and first column formatting with horizontal banding\n * const tableLook: TableLookOptions = {\n * firstRow: true, // Apply header row formatting\n * firstColumn: true, // Apply first column formatting\n * noHBand: false, // Enable horizontal row banding\n * noVBand: true, // Disable vertical column banding\n * };\n * ```\n */\nexport interface TableLookOptions {\n /**\n * Apply first row conditional formatting.\n * When true, the first row of the table uses the special formatting\n * defined for header rows in the table style.\n */\n readonly firstRow?: boolean;\n\n /**\n * Apply last row conditional formatting.\n * When true, the last row of the table uses the special formatting\n * defined for total/footer rows in the table style.\n */\n readonly lastRow?: boolean;\n\n /**\n * Apply first column conditional formatting.\n * When true, the first column of the table uses the special formatting\n * defined for first columns in the table style.\n */\n readonly firstColumn?: boolean;\n\n /**\n * Apply last column conditional formatting.\n * When true, the last column of the table uses the special formatting\n * defined for last columns in the table style.\n */\n readonly lastColumn?: boolean;\n\n /**\n * Disable horizontal row banding.\n * When true, horizontal banding (alternating row colors) is disabled.\n * When false or undefined, horizontal banding is enabled if defined in the table style.\n */\n readonly noHBand?: boolean;\n\n /**\n * Disable vertical column banding.\n * When true, vertical banding (alternating column colors) is disabled.\n * When false or undefined, vertical banding is enabled if defined in the table style.\n */\n readonly noVBand?: boolean;\n}\n\n/**\n * Creates a table look element for conditional formatting settings.\n *\n * The tblLook element specifies which conditional formatting settings\n * are active for a table. These settings work in conjunction with table\n * styles to apply special formatting to specific regions of the table.\n *\n * Reference: http://officeopenxml.com/WPtblLook.php\n *\n * @example\n * ```typescript\n * // Table with header row formatting and alternating row colors\n * new Table({\n * rows: [...],\n * tableLook: {\n * firstRow: true,\n * noHBand: false,\n * noVBand: true,\n * },\n * });\n * ```\n */\nexport const createTableLook = ({\n firstRow,\n lastRow,\n firstColumn,\n lastColumn,\n noHBand,\n noVBand,\n}: TableLookOptions): XmlComponent =>\n new BuilderElement<TableLookOptions>({\n attributes: {\n firstColumn: { key: \"w:firstColumn\", value: firstColumn },\n firstRow: { key: \"w:firstRow\", value: firstRow },\n lastColumn: { key: \"w:lastColumn\", value: lastColumn },\n lastRow: { key: \"w:lastRow\", value: lastRow },\n noHBand: { key: \"w:noHBand\", value: noHBand },\n noVBand: { key: \"w:noVBand\", value: noVBand },\n },\n name: \"w:tblLook\",\n });\n","/**\n * Table properties module for WordprocessingML documents.\n *\n * This module provides table-level properties including width, borders,\n * layout, alignment, and margins.\n *\n * Reference: http://officeopenxml.com/WPtableProperties.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblPrBase\">\n * <xsd:sequence>\n * <xsd:element name=\"tblStyle\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"tblpPr\" type=\"CT_TblPPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblOverlap\" type=\"CT_TblOverlap\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"bidiVisual\" type=\"CT_OnOff\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblStyleRowBandSize\" type=\"CT_DecimalNumber\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblStyleColBandSize\" type=\"CT_DecimalNumber\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblW\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"jc\" type=\"CT_JcTable\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblCellSpacing\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblInd\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblBorders\" type=\"CT_TblBorders\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"shd\" type=\"CT_Shd\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblLayout\" type=\"CT_TblLayoutType\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblCellMar\" type=\"CT_TblCellMar\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblLook\" type=\"CT_TblLook\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblCaption\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblDescription\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n *\n * <xsd:complexType name=\"CT_TblPrChange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TrackChange\">\n * <xsd:sequence>\n * <xsd:element name=\"tblPr\" type=\"CT_TblPrBase\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport type { ChangedAttributesProperties } from \"@file/track-revision/track-revision\";\nimport {\n BuilderElement,\n IgnoreIfEmptyXmlComponent,\n XmlComponent,\n attrObj,\n numberValObj,\n onOffObj,\n stringEnumValObj,\n stringValObj,\n} from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport { measurementOrPercentValue } from \"@util/values\";\n\nimport { createAlignment } from \"../../paragraph\";\nimport type { AlignmentType } from \"../../paragraph\";\nimport { buildShadingObj, createShading } from \"../../shading\";\nimport type { ShadingAttributesProperties } from \"../../shading\";\nimport { createTableCellSpacing } from \"../table-cell-spacing\";\nimport type { TableCellSpacingProperties } from \"../table-cell-spacing\";\nimport { buildTableWidthObj, createTableWidthElement } from \"../table-width\";\nimport type { TableWidthProperties } from \"../table-width\";\nimport { TableBorders, buildTableBorders } from \"./table-borders\";\nimport type { TableBordersOptions } from \"./table-borders\";\nimport { buildTableCellMarginObj, createTableCellMargin } from \"./table-cell-margin\";\nimport type { TableCellMarginOptions } from \"./table-cell-margin\";\nimport {\n buildTableFloatPropertiesObj,\n createTableFloatProperties,\n createTableOverlap,\n} from \"./table-float-properties\";\nimport type { TableFloatOptions } from \"./table-float-properties\";\nimport { createTableLayout } from \"./table-layout\";\nimport type { TableLayoutType } from \"./table-layout\";\nimport { createTableLook } from \"./table-look\";\nimport type { TableLookOptions } from \"./table-look\";\n\nexport interface TablePropertiesOptionsBase {\n readonly width?: TableWidthProperties;\n readonly indent?: TableWidthProperties;\n readonly layout?: (typeof TableLayoutType)[keyof typeof TableLayoutType];\n readonly borders?: TableBordersOptions;\n readonly float?: TableFloatOptions;\n readonly shading?: ShadingAttributesProperties;\n readonly style?: string;\n readonly alignment?: (typeof AlignmentType)[keyof typeof AlignmentType];\n readonly cellMargin?: TableCellMarginOptions;\n readonly visuallyRightToLeft?: boolean;\n readonly tableLook?: TableLookOptions;\n readonly cellSpacing?: TableCellSpacingProperties;\n /** Number of rows in each band for table style (tblStyleRowBandSize) */\n readonly styleRowBandSize?: number;\n /** Number of columns in each band for table style (tblStyleColBandSize) */\n readonly styleColBandSize?: number;\n /** Table caption for accessibility (tblCaption) */\n readonly caption?: string;\n /** Table description for accessibility (tblDescription) */\n readonly description?: string;\n}\n\nexport type ITablePropertiesChangeOptions = ITablePropertiesOptions & ChangedAttributesProperties;\n\n/**\n * Options for configuring table properties.\n *\n * @see {@link TableProperties}\n */\nexport type ITablePropertiesOptions = {\n readonly revision?: ITablePropertiesChangeOptions;\n readonly includeIfEmpty?: boolean;\n} & TablePropertiesOptionsBase;\n\n/**\n * Build table properties change (w:tblPrChange) as IXmlableObject without allocating XmlComponent tree.\n */\nfunction buildTablePropertiesChangeObj(options: ITablePropertiesChangeOptions): IXmlableObject {\n const innerPr = buildTableProperties({ ...options, includeIfEmpty: true })!;\n return {\n \"w:tblPrChange\": [\n { _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id } },\n innerPr,\n ],\n };\n}\n\n/**\n * Build table properties (w:tblPr) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTableProperties(options: ITablePropertiesOptions): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (options.style) {\n children.push(stringValObj(\"w:tblStyle\", options.style));\n }\n\n if (options.float) {\n children.push(buildTableFloatPropertiesObj(options.float));\n if (options.float.overlap) {\n children.push(stringEnumValObj(\"w:tblOverlap\", options.float.overlap));\n }\n }\n\n if (options.visuallyRightToLeft !== undefined) {\n children.push(onOffObj(\"w:bidiVisual\", options.visuallyRightToLeft));\n }\n\n if (options.styleRowBandSize !== undefined) {\n children.push(numberValObj(\"w:tblStyleRowBandSize\", options.styleRowBandSize));\n }\n\n if (options.styleColBandSize !== undefined) {\n children.push(numberValObj(\"w:tblStyleColBandSize\", options.styleColBandSize));\n }\n\n if (options.width) {\n children.push(buildTableWidthObj(\"w:tblW\", options.width));\n }\n\n if (options.alignment) {\n children.push(stringEnumValObj(\"w:jc\", options.alignment));\n }\n\n if (options.indent) {\n children.push(buildTableWidthObj(\"w:tblInd\", options.indent));\n }\n\n if (options.borders) {\n children.push(buildTableBorders(options.borders));\n }\n\n if (options.shading) {\n children.push(buildShadingObj(options.shading));\n }\n\n if (options.layout) {\n children.push(stringEnumValObj(\"w:tblLayout\", options.layout));\n }\n\n if (options.cellMargin) {\n const cellMargin = buildTableCellMarginObj(options.cellMargin);\n if (cellMargin) {\n children.push(cellMargin);\n }\n }\n\n if (options.tableLook) {\n children.push(\n attrObj(\"w:tblLook\", {\n \"w:firstRow\": options.tableLook.firstRow,\n \"w:lastRow\": options.tableLook.lastRow,\n \"w:firstColumn\": options.tableLook.firstColumn,\n \"w:lastColumn\": options.tableLook.lastColumn,\n \"w:noHBand\": options.tableLook.noHBand,\n \"w:noVBand\": options.tableLook.noVBand,\n }),\n );\n }\n\n if (options.cellSpacing) {\n children.push(\n attrObj(\"w:tblCellSpacing\", {\n \"w:w\": measurementOrPercentValue(options.cellSpacing.value),\n \"w:type\": options.cellSpacing.type,\n }),\n );\n }\n\n if (options.caption !== undefined) {\n children.push(stringValObj(\"w:tblCaption\", options.caption));\n }\n\n if (options.description !== undefined) {\n children.push(stringValObj(\"w:tblDescription\", options.description));\n }\n\n if (options.revision) {\n children.push(buildTablePropertiesChangeObj(options.revision));\n }\n\n if (options.includeIfEmpty || children.length > 0) {\n return { \"w:tblPr\": children };\n }\n\n return undefined;\n}\n\n/**\n * Represents table properties (tblPr) in a WordprocessingML document.\n *\n * The tblPr element specifies the properties for a table including width,\n * alignment, borders, margins, and layout.\n *\n * Reference: http://officeopenxml.com/WPtableProperties.php\n */\nexport class TableProperties extends IgnoreIfEmptyXmlComponent {\n public constructor(options: ITablePropertiesOptions) {\n super(\"w:tblPr\", options.includeIfEmpty);\n\n if (options.style) {\n this.root.push(stringValObj(\"w:tblStyle\", options.style));\n }\n\n if (options.float) {\n this.root.push(createTableFloatProperties(options.float));\n if (options.float.overlap) {\n this.root.push(createTableOverlap(options.float.overlap));\n }\n }\n\n if (options.visuallyRightToLeft !== undefined) {\n this.root.push(onOffObj(\"w:bidiVisual\", options.visuallyRightToLeft));\n }\n\n if (options.styleRowBandSize !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:tblStyleRowBandSize\",\n attributes: { val: { key: \"w:val\", value: options.styleRowBandSize } },\n }),\n );\n }\n\n if (options.styleColBandSize !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:tblStyleColBandSize\",\n attributes: { val: { key: \"w:val\", value: options.styleColBandSize } },\n }),\n );\n }\n\n if (options.width) {\n this.root.push(createTableWidthElement(\"w:tblW\", options.width));\n }\n\n if (options.alignment) {\n this.root.push(createAlignment(options.alignment));\n }\n\n if (options.indent) {\n this.root.push(createTableWidthElement(\"w:tblInd\", options.indent));\n }\n\n if (options.borders) {\n this.root.push(new TableBorders(options.borders));\n }\n\n if (options.shading) {\n this.root.push(createShading(options.shading));\n }\n\n if (options.layout) {\n this.root.push(createTableLayout(options.layout));\n }\n\n if (options.cellMargin) {\n const cellMargin = createTableCellMargin(options.cellMargin);\n if (cellMargin) {\n this.root.push(cellMargin);\n }\n }\n\n if (options.tableLook) {\n this.root.push(createTableLook(options.tableLook));\n }\n\n if (options.cellSpacing) {\n this.root.push(createTableCellSpacing(options.cellSpacing));\n }\n\n if (options.caption !== undefined) {\n this.root.push(stringValObj(\"w:tblCaption\", options.caption));\n }\n\n if (options.description !== undefined) {\n this.root.push(stringValObj(\"w:tblDescription\", options.description));\n }\n\n if (options.revision) {\n this.root.push(new TablePropertiesChange(options.revision));\n }\n }\n}\n\nclass TablePropertiesChange extends XmlComponent {\n public constructor(options: ITablePropertiesChangeOptions) {\n super(\"w:tblPrChange\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n // TblPr is required even if empty (minOccurs=\"0\" is missing)\n this.root.push(new TableProperties({ ...options, includeIfEmpty: true }));\n }\n}\n","/**\n * Table property exceptions module for WordprocessingML documents.\n *\n * Property exceptions allow overriding table properties at the row level.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_TblPrExBase\n *\n * @module\n */\nimport { IgnoreIfEmptyXmlComponent } from \"@file/xml-components\";\n\nimport { createAlignment } from \"../../paragraph\";\nimport type { AlignmentType } from \"../../paragraph\";\nimport { createShading } from \"../../shading\";\nimport type { ShadingAttributesProperties } from \"../../shading\";\nimport { createTableCellSpacing } from \"../table-cell-spacing\";\nimport type { TableCellSpacingProperties } from \"../table-cell-spacing\";\nimport { createTableWidthElement } from \"../table-width\";\nimport type { TableWidthProperties } from \"../table-width\";\nimport { TableBorders } from \"./table-borders\";\nimport type { TableBordersOptions } from \"./table-borders\";\nimport { createTableCellMargin } from \"./table-cell-margin\";\nimport type { TableCellMarginOptions } from \"./table-cell-margin\";\nimport { createTableLayout } from \"./table-layout\";\nimport type { TableLayoutType } from \"./table-layout\";\nimport { createTableLook } from \"./table-look\";\nimport type { TableLookOptions } from \"./table-look\";\n\n/**\n * Options for table property exceptions (w:tblPrEx).\n *\n * These override the parent table's properties for a specific row.\n * Subset of TablePropertiesOptionsBase — excludes style, float, bidiVisual,\n * styleRowBandSize, styleColBandSize, caption, description.\n */\nexport interface TablePropertyExOptions {\n readonly width?: TableWidthProperties;\n readonly indent?: TableWidthProperties;\n readonly layout?: (typeof TableLayoutType)[keyof typeof TableLayoutType];\n readonly borders?: TableBordersOptions;\n readonly shading?: ShadingAttributesProperties;\n readonly alignment?: (typeof AlignmentType)[keyof typeof AlignmentType];\n readonly cellMargin?: TableCellMarginOptions;\n readonly tableLook?: TableLookOptions;\n readonly cellSpacing?: TableCellSpacingProperties;\n}\n\n/**\n * Represents table property exceptions (w:tblPrEx) in a WordprocessingML document.\n *\n * Allows overriding table-level properties for a specific row.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_TblPrEx\n */\nexport class TablePropertyExceptions extends IgnoreIfEmptyXmlComponent {\n public constructor(options: TablePropertyExOptions) {\n super(\"w:tblPrEx\", true);\n\n if (options.width) {\n this.root.push(createTableWidthElement(\"w:tblW\", options.width));\n }\n\n if (options.alignment) {\n this.root.push(createAlignment(options.alignment));\n }\n\n if (options.cellSpacing) {\n this.root.push(createTableCellSpacing(options.cellSpacing));\n }\n\n if (options.indent) {\n this.root.push(createTableWidthElement(\"w:tblInd\", options.indent));\n }\n\n if (options.borders) {\n this.root.push(new TableBorders(options.borders));\n }\n\n if (options.shading) {\n this.root.push(createShading(options.shading));\n }\n\n if (options.layout) {\n this.root.push(createTableLayout(options.layout));\n }\n\n if (options.cellMargin) {\n const cellMargin = createTableCellMargin(options.cellMargin);\n if (cellMargin) {\n this.root.push(cellMargin);\n }\n }\n\n if (options.tableLook) {\n this.root.push(createTableLook(options.tableLook));\n }\n }\n}\n","/**\n * Table properties module exports.\n *\n * @module\n */\nexport * from \"./table-properties\";\nexport * from \"./table-float-properties\";\nexport * from \"./table-layout\";\nexport * from \"./table-borders\";\nexport * from \"./table-look\";\nexport * from \"./table-property-exceptions\";\n","/**\n * Table row height module for WordprocessingML documents.\n *\n * This module provides row height configuration including rules for how height should be applied.\n *\n * Reference: http://officeopenxml.com/WPtableRow.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\n\n/**\n * Height rules for table rows.\n *\n * Specifies how the height value should be interpreted.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_HeightRule\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"auto\"/>\n * <xsd:enumeration value=\"exact\"/>\n * <xsd:enumeration value=\"atLeast\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const HeightRule = {\n /** Height is determined based on the content, so value is ignored. */\n AUTO: \"auto\",\n /** At least the value specified */\n ATLEAST: \"atLeast\",\n /** Exactly the value specified */\n EXACT: \"exact\",\n} as const;\n\n/**\n * Creates table row height (trHeight) in a WordprocessingML document.\n *\n * The trHeight element specifies the height of a table row, along with a rule\n * determining how the height should be applied.\n *\n * Reference: http://officeopenxml.com/WPtableRow.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Height\">\n * <xsd:attribute name=\"val\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"hRule\" type=\"ST_HeightRule\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * createTableRowHeight(1000, HeightRule.EXACT);\n * ```\n */\nexport const createTableRowHeight = (\n value: number | PositiveUniversalMeasure,\n rule: (typeof HeightRule)[keyof typeof HeightRule],\n): XmlComponent =>\n new BuilderElement<{\n readonly value: number | string;\n readonly rule: (typeof HeightRule)[keyof typeof HeightRule];\n }>({\n attributes: {\n rule: { key: \"w:hRule\", value: rule },\n value: { key: \"w:val\", value: twipsMeasureValue(value) },\n },\n name: \"w:trHeight\",\n });\n","/**\n * Table row properties module for WordprocessingML documents.\n *\n * This module provides row-level properties including height and header row settings.\n *\n * Reference: http://officeopenxml.com/WPtableRowProperties.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TrPrBase\">\n * <xsd:choice maxOccurs=\"unbounded\">\n * <xsd:element name=\"cnfStyle\" type=\"CT_Cnf\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"divId\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"gridBefore\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"gridAfter\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"wBefore\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"wAfter\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"cantSplit\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"trHeight\" type=\"CT_Height\" minOccurs=\"0\"/>\n * <xsd:element name=\"tblHeader\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"tblCellSpacing\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"jc\" type=\"CT_JcTable\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"hidden\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * </xsd:choice>\n * </xsd:complexType>\n * <xsd:complexType name=\"CT_TrPr\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TrPrBase\">\n * <xsd:sequence>\n * <xsd:element name=\"ins\" type=\"CT_TrackChange\" minOccurs=\"0\"/>\n * <xsd:element name=\"del\" type=\"CT_TrackChange\" minOccurs=\"0\"/>\n * <xsd:element name=\"trPrChange\" type=\"CT_TrPrChange\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * <xsd:complexType name=\"CT_TrPrChange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TrackChange\">\n * <xsd:sequence>\n * <xsd:element name=\"trPr\" type=\"CT_TrPrBase\" minOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport {\n DeletedTableRow,\n InsertedTableRow,\n buildDeletedTableRowObj,\n buildInsertedTableRowObj,\n} from \"@file/track-revision\";\nimport type { ChangedAttributesProperties } from \"@file/track-revision/track-revision\";\nimport {\n BuilderElement,\n IgnoreIfEmptyXmlComponent,\n XmlComponent,\n attrObj,\n numberValObj,\n onOffObj,\n stringEnumValObj,\n} from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\nimport { measurementOrPercentValue, twipsMeasureValue } from \"@util/values\";\n\nimport { createAlignment } from \"../../paragraph\";\nimport type { AlignmentType } from \"../../paragraph\";\nimport { createTableCellSpacing } from \"../table-cell-spacing\";\nimport type { TableCellSpacingProperties } from \"../table-cell-spacing\";\nimport { buildTableWidthObj, createTableWidthElement } from \"../table-width\";\nimport type { TableWidthProperties } from \"../table-width\";\nimport { createTableRowHeight } from \"./table-row-height\";\nimport type { HeightRule } from \"./table-row-height\";\n\n/**\n * Options for CT_Cnf — conditional formatting style.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Cnf\">\n * <xsd:attribute name=\"val\" type=\"s:ST_String\" use=\"required\"/>\n * <xsd:attribute name=\"changed\" type=\"s:ST_OnOff\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface CnfStyleOptions {\n /** Conditional format string (required) */\n readonly val: string;\n /** Whether the property was changed */\n readonly changed?: boolean;\n}\n\nexport interface TableRowPropertiesOptionsBase {\n /** Conditional formatting style (cnfStyle) */\n readonly cnfStyle?: CnfStyleOptions;\n /** Whether the row can be split across pages (cantSplit) */\n readonly cantSplit?: boolean;\n /** Whether the row should be repeated as a header row on each page (tblHeader) */\n readonly tableHeader?: boolean;\n /** Row height configuration (trHeight) */\n readonly height?: {\n /** Height value in twips or as a PositiveUniversalMeasure */\n readonly value: number | PositiveUniversalMeasure;\n /** Height rule determining how the height value is applied */\n readonly rule: (typeof HeightRule)[keyof typeof HeightRule];\n };\n /** Spacing between cells in the row (tblCellSpacing) */\n readonly cellSpacing?: TableCellSpacingProperties;\n /** div ID for HTML compatibility (divId) */\n readonly divId?: number;\n /** Number of grid columns before the first cell (gridBefore) */\n readonly gridBefore?: number;\n /** Number of grid columns after the last cell (gridAfter) */\n readonly gridAfter?: number;\n /** Preferred width before the row (wBefore) */\n readonly widthBefore?: TableWidthProperties;\n /** Preferred width after the row (wAfter) */\n readonly widthAfter?: TableWidthProperties;\n /** Row alignment (jc) */\n readonly rowAlignment?: (typeof AlignmentType)[keyof typeof AlignmentType];\n /** Whether the row is hidden (hidden) */\n readonly hidden?: boolean;\n}\n\n/**\n * Options for configuring table row properties.\n *\n * @see {@link TableRowProperties}\n */\nexport type ITableRowPropertiesOptions = TableRowPropertiesOptionsBase & {\n readonly insertion?: ChangedAttributesProperties;\n readonly deletion?: ChangedAttributesProperties;\n readonly revision?: ITableRowPropertiesChangeOptions;\n readonly includeIfEmpty?: boolean;\n};\n\nexport type ITableRowPropertiesChangeOptions = TableRowPropertiesOptionsBase &\n ChangedAttributesProperties;\n\n/**\n * Build table row properties change (w:trPrChange) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTableRowPropertiesChangeObj(\n options: ITableRowPropertiesChangeOptions,\n): IXmlableObject {\n const innerPr = buildTableRowProperties({ ...options, includeIfEmpty: true })!;\n return {\n \"w:trPrChange\": [\n { _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id } },\n innerPr,\n ],\n };\n}\n\n/**\n * Build table row properties (w:trPr) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTableRowProperties(\n options: ITableRowPropertiesOptions,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (options.cnfStyle !== undefined) {\n const attrs: Record<string, string | boolean> = { \"w:val\": options.cnfStyle.val };\n if (options.cnfStyle.changed !== undefined) {\n attrs[\"w:changed\"] = options.cnfStyle.changed;\n }\n children.push({ \"w:cnfStyle\": { _attr: attrs } });\n }\n\n if (options.divId !== undefined) {\n children.push(numberValObj(\"w:divId\", options.divId));\n }\n\n if (options.gridBefore !== undefined) {\n children.push(numberValObj(\"w:gridBefore\", options.gridBefore));\n }\n\n if (options.gridAfter !== undefined) {\n children.push(numberValObj(\"w:gridAfter\", options.gridAfter));\n }\n\n if (options.widthBefore) {\n children.push(buildTableWidthObj(\"w:wBefore\", options.widthBefore));\n }\n\n if (options.widthAfter) {\n children.push(buildTableWidthObj(\"w:wAfter\", options.widthAfter));\n }\n\n if (options.cantSplit !== undefined) {\n children.push(onOffObj(\"w:cantSplit\", options.cantSplit));\n }\n\n if (options.tableHeader !== undefined) {\n children.push(onOffObj(\"w:tblHeader\", options.tableHeader));\n }\n\n if (options.height) {\n children.push(\n attrObj(\"w:trHeight\", {\n \"w:val\": twipsMeasureValue(options.height.value),\n \"w:hRule\": options.height.rule,\n }),\n );\n }\n\n if (options.cellSpacing) {\n children.push(\n attrObj(\"w:tblCellSpacing\", {\n \"w:w\": measurementOrPercentValue(options.cellSpacing.value),\n \"w:type\": options.cellSpacing.type,\n }),\n );\n }\n\n if (options.rowAlignment) {\n children.push(stringEnumValObj(\"w:jc\", options.rowAlignment));\n }\n\n if (options.hidden !== undefined) {\n children.push(onOffObj(\"w:hidden\", options.hidden));\n }\n\n if (options.insertion) {\n children.push(buildInsertedTableRowObj(options.insertion));\n }\n\n if (options.deletion) {\n children.push(buildDeletedTableRowObj(options.deletion));\n }\n\n if (options.revision) {\n children.push(buildTableRowPropertiesChangeObj(options.revision));\n }\n\n if (options.includeIfEmpty || children.length > 0) {\n return { \"w:trPr\": children };\n }\n\n return undefined;\n}\n\n/**\n * Represents table row properties (trPr) in a WordprocessingML document.\n *\n * The trPr element specifies properties for a table row including height,\n * whether it can split across pages, and whether it's a header row.\n *\n * Reference: http://officeopenxml.com/WPtableRowProperties.php\n *\n * @example\n * ```typescript\n * new TableRowProperties({\n * cantSplit: true,\n * tableHeader: true,\n * height: {\n * value: 1000,\n * rule: HeightRule.EXACT,\n * },\n * });\n * ```\n */\nexport class TableRowProperties extends IgnoreIfEmptyXmlComponent {\n public constructor(options: ITableRowPropertiesOptions) {\n super(\"w:trPr\", options.includeIfEmpty);\n\n if (options.cnfStyle !== undefined) {\n const attrs: Record<string, { readonly key: string; readonly value: string | boolean }> = {\n val: { key: \"w:val\", value: options.cnfStyle.val },\n };\n if (options.cnfStyle.changed !== undefined) {\n attrs.changed = { key: \"w:changed\", value: options.cnfStyle.changed };\n }\n this.root.push(new BuilderElement({ name: \"w:cnfStyle\", attributes: attrs }));\n }\n\n if (options.divId !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:divId\",\n attributes: { val: { key: \"w:val\", value: options.divId } },\n }),\n );\n }\n\n if (options.gridBefore !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:gridBefore\",\n attributes: { val: { key: \"w:val\", value: options.gridBefore } },\n }),\n );\n }\n\n if (options.gridAfter !== undefined) {\n this.root.push(\n new BuilderElement<{ readonly val: number }>({\n name: \"w:gridAfter\",\n attributes: { val: { key: \"w:val\", value: options.gridAfter } },\n }),\n );\n }\n\n if (options.widthBefore) {\n this.root.push(createTableWidthElement(\"w:wBefore\", options.widthBefore));\n }\n\n if (options.widthAfter) {\n this.root.push(createTableWidthElement(\"w:wAfter\", options.widthAfter));\n }\n\n if (options.cantSplit !== undefined) {\n this.root.push(onOffObj(\"w:cantSplit\", options.cantSplit));\n }\n\n if (options.tableHeader !== undefined) {\n this.root.push(onOffObj(\"w:tblHeader\", options.tableHeader));\n }\n\n if (options.height) {\n this.root.push(createTableRowHeight(options.height.value, options.height.rule));\n }\n\n if (options.cellSpacing) {\n this.root.push(createTableCellSpacing(options.cellSpacing));\n }\n\n if (options.rowAlignment) {\n this.root.push(createAlignment(options.rowAlignment));\n }\n\n if (options.hidden !== undefined) {\n this.root.push(onOffObj(\"w:hidden\", options.hidden));\n }\n\n if (options.insertion) {\n this.root.push(new InsertedTableRow(options.insertion));\n }\n\n if (options.deletion) {\n this.root.push(new DeletedTableRow(options.deletion));\n }\n\n if (options.revision) {\n this.root.push(new TableRowPropertiesChange(options.revision));\n }\n }\n}\n\nexport class TableRowPropertiesChange extends XmlComponent {\n public constructor(options: ITableRowPropertiesChangeOptions) {\n super(\"w:trPrChange\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n // TrPr is required (minOccurs=\"1\") even if empty\n this.root.push(new TableRowProperties({ ...options, includeIfEmpty: true }));\n }\n}\n","/**\n * Table row module for WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPtableRow.php\n *\n * @module\n */\nimport { BaseXmlComponent, EMPTY_OBJECT } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { xml } from \"@office-open/xml\";\n\nimport { StructuredDocumentTagCell } from \"../../sdt\";\nimport { StructuredDocumentTagRow } from \"../../sdt\";\nimport { TableCell } from \"../table-cell\";\nimport type { TableCellOptions } from \"../table-cell\";\nimport { TablePropertyExceptions } from \"../table-properties/table-property-exceptions\";\nimport type { TablePropertyExOptions } from \"../table-properties/table-property-exceptions\";\nimport { buildTableRowProperties } from \"./table-row-properties\";\nimport type { ITableRowPropertiesOptions } from \"./table-row-properties\";\n\n/**\n * Options for creating a TableRow element.\n *\n * @see {@link TableRow}\n */\nexport type TableRowOptions = {\n /** Array of TableCell elements or plain options that make up the row */\n readonly children: readonly (\n | TableCell\n | StructuredDocumentTagCell\n | StructuredDocumentTagRow\n | TableCellOptions\n )[];\n /** Table property exceptions for this row (override table-level properties) */\n readonly propertyExceptions?: TablePropertyExOptions;\n} & ITableRowPropertiesOptions;\n\n/**\n * Represents a table row in a WordprocessingML document.\n *\n * A table row is a single row of cells within a table. Each row contains\n * one or more table cells that hold the actual content.\n *\n * Reference: http://officeopenxml.com/WPtableRow.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Row\">\n * <xsd:sequence>\n * <xsd:element name=\"tblPrEx\" type=\"CT_TblPrEx\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"trPr\" type=\"CT_TrPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:group ref=\"EG_ContentCellContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"rsidRPr\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidR\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidDel\" type=\"ST_LongHexNumber\"/>\n * <xsd:attribute name=\"rsidTr\" type=\"ST_LongHexNumber\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new TableRow({\n * children: [\n * new TableCell({ children: [new Paragraph(\"Cell 1\")] }),\n * new TableCell({ children: [new Paragraph(\"Cell 2\")] }),\n * ],\n * });\n * ```\n */\nexport class TableRow extends BaseXmlComponent {\n // Extra cells inserted by Table's row-span CONTINUE logic\n private extraCells: { cell: TableCell; columnIndex: number }[] = [];\n\n // Coerced children: plain TableCellOptions are converted to TableCell instances\n private readonly coercedChildren: readonly (\n | TableCell\n | StructuredDocumentTagCell\n | StructuredDocumentTagRow\n )[];\n\n public constructor(private readonly options: TableRowOptions) {\n super(\"w:tr\");\n this.coercedChildren = options.children.map((child) =>\n child instanceof TableCell ||\n child instanceof StructuredDocumentTagCell ||\n child instanceof StructuredDocumentTagRow\n ? child\n : new TableCell(child),\n );\n }\n\n public get cellCount(): number {\n return this.coercedChildren.length;\n }\n\n public get cells(): readonly TableCell[] {\n return this.coercedChildren.filter((child): child is TableCell => child instanceof TableCell);\n }\n\n /** @internal Used by Table to insert CONTINUE cells for vertical merge. */\n public addCellToColumnIndex(cell: TableCell, columnIndex: number): void {\n this.extraCells.push({ cell, columnIndex });\n }\n\n public rootIndexToColumnIndex(rootIndex: number): number {\n // rootIndex is 0-based in XmlComponent root (0 = trPr, 1+ = cells)\n const cellIndex = rootIndex - 1;\n if (cellIndex < 0 || cellIndex >= this.coercedChildren.length) {\n throw new Error(`cell 'rootIndex' should between 1 to ${this.coercedChildren.length}`);\n }\n let colIdx = 0;\n for (let i = 0; i < cellIndex; i++) {\n const child = this.coercedChildren[i];\n colIdx += child instanceof TableCell ? child.options.columnSpan || 1 : 1;\n }\n return colIdx;\n }\n\n public columnIndexToRootIndex(columnIndex: number, allowEndNewCell: boolean = false): number {\n if (columnIndex < 0) {\n throw new Error(`cell 'columnIndex' should not less than zero`);\n }\n let colIdx = 0;\n let idx = 0;\n while (colIdx <= columnIndex) {\n if (idx >= this.coercedChildren.length) {\n if (allowEndNewCell) {\n return this.coercedChildren.length + 1;\n } else {\n throw new Error(`cell 'columnIndex' should not great than ${colIdx - 1}`);\n }\n }\n const child = this.coercedChildren[idx];\n idx += 1;\n colIdx += child instanceof TableCell ? child.options.columnSpan || 1 : 1;\n }\n return idx;\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (this.options.propertyExceptions) {\n const obj = new TablePropertyExceptions(this.options.propertyExceptions).prepForXml(context);\n if (obj) children.push(obj);\n }\n\n const trPrObj = buildTableRowProperties(this.options);\n if (trPrObj) children.push(trPrObj);\n\n const prefixCount = children.length;\n\n for (const child of this.coercedChildren) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n // Insert extra CONTINUE cells at their designated column positions\n if (this.extraCells.length > 0) {\n for (const { cell, columnIndex } of this.extraCells) {\n const insertIdx = this.findInsertIndex(columnIndex, prefixCount);\n const obj = cell.prepForXml(context);\n if (obj) children.splice(insertIdx, 0, obj);\n }\n }\n\n return { \"w:tr\": children.length ? children : EMPTY_OBJECT };\n }\n\n public override toXml(context: Context): string {\n const parts: string[] = [];\n\n if (this.options.propertyExceptions) {\n parts.push(new TablePropertyExceptions(this.options.propertyExceptions).toXml(context));\n }\n\n const trPrObj = buildTableRowProperties(this.options);\n if (trPrObj) parts.push(xml(trPrObj));\n\n const prefixCount = parts.length;\n\n for (const child of this.coercedChildren) {\n parts.push(child.toXml(context));\n }\n\n // Insert extra CONTINUE cells at their designated column positions\n if (this.extraCells.length > 0) {\n for (const { cell, columnIndex } of this.extraCells) {\n const insertIdx = this.findInsertIndex(columnIndex, prefixCount);\n parts.splice(insertIdx, 0, cell.toXml(context));\n }\n }\n\n return parts.length ? `<w:tr>${parts.join(\"\")}</w:tr>` : \"<w:tr/>\";\n }\n\n private findInsertIndex(columnIndex: number, prefixCount: number): number {\n let colIdx = 0;\n for (let i = 0; i < this.coercedChildren.length; i++) {\n const child = this.coercedChildren[i];\n colIdx += child instanceof TableCell ? child.options.columnSpan || 1 : 1;\n if (colIdx > columnIndex) {\n return i + prefixCount;\n }\n }\n return this.coercedChildren.length + prefixCount;\n }\n}\n","/**\n * Table row module exports.\n *\n * @module\n */\nexport * from \"./table-row\";\nexport * from \"./table-row-properties\";\nexport * from \"./table-row-height\";\n","/**\n * Table module exports.\n *\n * @module\n */\nexport * from \"./table\";\nexport * from \"./table-cell\";\nexport * from \"./table-properties\";\nexport * from \"./table-row\";\nexport * from \"./table-width\";\n","/**\n * Table cell margin module for WordprocessingML documents.\n *\n * This module provides cell margin settings for tables and individual cells.\n * Margins define the padding between cell content and cell borders.\n *\n * Reference: http://officeopenxml.com/WPtableCellProperties-Margins.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblCellMar\">\n * <xsd:sequence>\n * <xsd:element name=\"top\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"start\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"left\" type=\"CT_TblWidth\" minOccurs=\"0\"/>\n * <xsd:element name=\"bottom\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"end\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"right\" type=\"CT_TblWidth\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport { WidthType, buildTableWidthObj, createTableWidthElement } from \"@file/table\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { IXmlableObject, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for configuring table cell margins.\n *\n * All margin values are specified in the units defined by `marginUnitType`.\n * If `marginUnitType` is not specified, values are in DXA (twentieths of a point).\n *\n * @example\n * ```typescript\n * // Set uniform margins of 100 twips on all sides\n * const margins: TableCellMarginOptions = {\n * top: 100,\n * bottom: 100,\n * left: 100,\n * right: 100,\n * };\n *\n * // Set margins using percentage-based width\n * const percentMargins: TableCellMarginOptions = {\n * marginUnitType: WidthType.PERCENTAGE,\n * left: 5,\n * right: 5,\n * };\n * ```\n */\nexport interface TableCellMarginOptions {\n /**\n * The unit type for margin values.\n * Defaults to DXA (twentieths of a point) if not specified.\n *\n * @default WidthType.DXA\n */\n readonly marginUnitType?: (typeof WidthType)[keyof typeof WidthType];\n\n /**\n * Top margin (padding above cell content).\n * Value is in units specified by `marginUnitType`.\n */\n readonly top?: number;\n\n /**\n * Bottom margin (padding below cell content).\n * Value is in units specified by `marginUnitType`.\n */\n readonly bottom?: number;\n\n /**\n * Left margin (padding to the left of cell content).\n * Value is in units specified by `marginUnitType`.\n */\n readonly left?: number;\n\n /**\n * Right margin (padding to the right of cell content).\n * Value is in units specified by `marginUnitType`.\n */\n readonly right?: number;\n}\n\n/**\n * Builds an array of margin child elements based on the provided options.\n *\n * @internal\n */\nconst buildMarginChildren = ({\n marginUnitType = WidthType.DXA,\n top,\n left,\n bottom,\n right,\n}: TableCellMarginOptions): readonly XmlComponent[] =>\n (\n [\n { name: \"w:top\", size: top },\n { name: \"w:left\", size: left },\n { name: \"w:bottom\", size: bottom },\n { name: \"w:right\", size: right },\n ] as const\n )\n .filter(\n (entry): entry is { readonly name: typeof entry.name; readonly size: number } =>\n entry.size !== undefined,\n )\n .map(({ name, size }) => createTableWidthElement(name, { size, type: marginUnitType }));\n\n/**\n * Creates a table-level cell margin element (tblCellMar).\n *\n * The tblCellMar element specifies the default cell margins for all cells\n * in the table. Individual cells can override these defaults using\n * cell-level margins (tcMar).\n *\n * Reference: http://officeopenxml.com/WPtableCellProperties-Margins.php\n *\n * @param options - The margin options\n * @returns An XmlComponent representing the tblCellMar element, or undefined if no margins specified\n *\n * @example\n * ```typescript\n * // Table with 100 twip margins on all sides\n * new Table({\n * rows: [...],\n * margins: {\n * top: 100,\n * bottom: 100,\n * left: 100,\n * right: 100,\n * },\n * });\n * ```\n */\nexport const createTableCellMargin = (\n options: TableCellMarginOptions,\n): XmlComponent | undefined => {\n const children = buildMarginChildren(options);\n\n if (children.length === 0) {\n return undefined;\n }\n\n return new BuilderElement({\n children,\n name: \"w:tblCellMar\",\n });\n};\n\n/**\n * Creates a cell-level margin element (tcMar).\n *\n * The tcMar element specifies the margins for a specific table cell,\n * overriding any table-level default margins (tblCellMar).\n *\n * Reference: http://officeopenxml.com/WPtableCellProperties-Margins.php\n *\n * @param options - The margin options\n * @returns An XmlComponent representing the tcMar element, or undefined if no margins specified\n *\n * @example\n * ```typescript\n * // Cell with custom margins\n * new TableCell({\n * children: [...],\n * margins: {\n * top: 50,\n * bottom: 50,\n * left: 100,\n * right: 100,\n * },\n * });\n * ```\n */\nexport const createCellMargin = (options: TableCellMarginOptions): XmlComponent | undefined => {\n const children = buildMarginChildren(options);\n\n if (children.length === 0) {\n return undefined;\n }\n\n return new BuilderElement({\n children,\n name: \"w:tcMar\",\n });\n};\n\nconst buildMarginChildrenObjs = ({\n marginUnitType = WidthType.DXA,\n top,\n left,\n bottom,\n right,\n}: TableCellMarginOptions): IXmlableObject[] => {\n const children: IXmlableObject[] = [];\n if (top !== undefined)\n children.push(buildTableWidthObj(\"w:top\", { size: top, type: marginUnitType }));\n if (left !== undefined)\n children.push(buildTableWidthObj(\"w:left\", { size: left, type: marginUnitType }));\n if (bottom !== undefined)\n children.push(buildTableWidthObj(\"w:bottom\", { size: bottom, type: marginUnitType }));\n if (right !== undefined)\n children.push(buildTableWidthObj(\"w:right\", { size: right, type: marginUnitType }));\n return children;\n};\n\nexport const buildTableCellMarginObj = (\n options: TableCellMarginOptions,\n): IXmlableObject | undefined => {\n const children = buildMarginChildrenObjs(options);\n return children.length > 0 ? { \"w:tblCellMar\": children } : undefined;\n};\n\nexport const buildCellMarginObj = (options: TableCellMarginOptions): IXmlableObject | undefined => {\n const children = buildMarginChildrenObjs(options);\n return children.length > 0 ? { \"w:tcMar\": children } : undefined;\n};\n","/**\n * Table cell properties module for WordprocessingML documents.\n *\n * This module provides cell-level properties including width, borders,\n * shading, margins, and merge settings.\n *\n * Reference: http://officeopenxml.com/WPtableCellProperties.php\n *\n * @module\n */\nimport {\n CellMerge,\n DeletedTableCell,\n InsertedTableCell,\n buildCellMergeObj,\n buildDeletedTableCellObj,\n buildInsertedTableCellObj,\n} from \"@file/track-revision\";\nimport type { ICellMergeAttributes } from \"@file/track-revision\";\nimport type { ChangedAttributesProperties } from \"@file/track-revision/track-revision\";\nimport { createVerticalAlign } from \"@file/vertical-align\";\nimport type { TableVerticalAlign } from \"@file/vertical-align\";\nimport {\n BuilderElement,\n IgnoreIfEmptyXmlComponent,\n XmlComponent,\n onOffObj,\n stringEnumValObj,\n} from \"@file/xml-components\";\nimport type { IXmlableObject } from \"@file/xml-components\";\n\nimport { buildShadingObj, createShading } from \"../../shading\";\nimport type { ShadingAttributesProperties } from \"../../shading\";\nimport { buildCellMarginObj, createCellMargin } from \"../table-properties/table-cell-margin\";\nimport type { TableCellMarginOptions } from \"../table-properties/table-cell-margin\";\nimport type { CnfStyleOptions } from \"../table-row/table-row-properties\";\nimport { buildTableWidthObj, createTableWidthElement } from \"../table-width\";\nimport type { TableWidthProperties } from \"../table-width\";\nimport {\n GridSpan,\n TDirection,\n TableCellBorders,\n VerticalMerge,\n VerticalMergeType,\n buildGridSpan,\n buildTableCellBorders,\n buildTextDirection,\n buildVerticalMerge,\n} from \"./table-cell-components\";\nimport type { TableCellBordersOptions, TextDirection } from \"./table-cell-components\";\n\nexport interface TableCellPropertiesOptionsBase {\n /** Conditional formatting style (cnfStyle) */\n readonly cnfStyle?: CnfStyleOptions;\n /** Shading (background color/pattern) for the cell */\n readonly shading?: ShadingAttributesProperties;\n /** Cell margins (padding) for the cell content */\n readonly margins?: TableCellMarginOptions;\n /** Vertical alignment of content within the cell */\n readonly verticalAlign?: TableVerticalAlign;\n /** Text direction/flow within the cell */\n readonly textDirection?: (typeof TextDirection)[keyof typeof TextDirection];\n /** Vertical merge setting for the cell */\n readonly verticalMerge?: (typeof VerticalMergeType)[keyof typeof VerticalMergeType];\n /** Width specification for the cell */\n readonly width?: TableWidthProperties;\n /** Number of columns this cell spans (horizontal merge) */\n readonly columnSpan?: number;\n /** Number of rows this cell spans (vertical merge) */\n readonly rowSpan?: number;\n /** Border settings for the cell edges */\n readonly borders?: TableCellBordersOptions;\n /** Horizontal merge setting (hMerge) */\n readonly horizontalMerge?: \"continue\" | \"restart\";\n /** Whether the cell content does not wrap (noWrap) */\n readonly noWrap?: boolean;\n /** Whether text is auto-fit to cell width (tcFitText) */\n readonly fitText?: boolean;\n /** Whether the cell end mark is hidden (hideMark) */\n readonly hideMark?: boolean;\n /** Header cells associated with this cell (headers) */\n readonly headers?: string[];\n readonly insertion?: ChangedAttributesProperties;\n readonly deletion?: ChangedAttributesProperties;\n readonly cellMerge?: ICellMergeAttributes;\n}\n\n/**\n * Options for configuring table cell properties.\n *\n * @see {@link TableCellProperties}\n */\nexport type ITableCellPropertiesOptions = {\n readonly revision?: ITableCellPropertiesChangeOptions;\n readonly includeIfEmpty?: boolean;\n} & TableCellPropertiesOptionsBase;\n\nexport type ITableCellPropertiesChangeOptions = TableCellPropertiesOptionsBase &\n ChangedAttributesProperties;\n\n/**\n * Build table cell properties change (w:tcPrChange) as IXmlableObject without allocating XmlComponent tree.\n */\nfunction buildTableCellPropertiesChangeObj(\n options: ITableCellPropertiesChangeOptions,\n): IXmlableObject {\n const innerPr = buildTableCellProperties({ ...options, includeIfEmpty: true })!;\n return {\n \"w:tcPrChange\": [\n { _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id } },\n innerPr,\n ],\n };\n}\n\n/**\n * Build table cell properties (w:tcPr) as IXmlableObject without allocating XmlComponent tree.\n */\nexport function buildTableCellProperties(\n options: ITableCellPropertiesOptions,\n): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n if (options.cnfStyle !== undefined) {\n const attrs: Record<string, string | boolean> = { \"w:val\": options.cnfStyle.val };\n if (options.cnfStyle.changed !== undefined) {\n attrs[\"w:changed\"] = options.cnfStyle.changed;\n }\n children.push({ \"w:cnfStyle\": { _attr: attrs } });\n }\n\n if (options.width) {\n children.push(buildTableWidthObj(\"w:tcW\", options.width));\n }\n\n if (options.columnSpan) {\n children.push(buildGridSpan(options.columnSpan));\n }\n\n if (options.verticalMerge) {\n children.push(buildVerticalMerge(options.verticalMerge));\n } else if (options.rowSpan && options.rowSpan > 1) {\n children.push(buildVerticalMerge(VerticalMergeType.RESTART));\n }\n\n if (options.borders) {\n const borders = buildTableCellBorders(options.borders);\n if (borders) children.push(borders);\n }\n\n if (options.shading) {\n children.push(buildShadingObj(options.shading));\n }\n\n if (options.margins) {\n const cellMargin = buildCellMarginObj(options.margins);\n if (cellMargin) {\n children.push(cellMargin);\n }\n }\n\n if (options.textDirection) {\n children.push(buildTextDirection(options.textDirection));\n }\n\n if (options.verticalAlign) {\n children.push(stringEnumValObj(\"w:vAlign\", options.verticalAlign));\n }\n\n if (options.horizontalMerge !== undefined) {\n if (options.horizontalMerge === \"restart\") {\n children.push({ \"w:hMerge\": { _attr: { \"w:val\": \"restart\" } } });\n } else {\n children.push({ \"w:hMerge\": {} });\n }\n }\n\n if (options.noWrap !== undefined) {\n children.push(onOffObj(\"w:noWrap\", options.noWrap));\n }\n\n if (options.fitText !== undefined) {\n children.push(onOffObj(\"w:tcFitText\", options.fitText));\n }\n\n if (options.hideMark !== undefined) {\n children.push(onOffObj(\"w:hideMark\", options.hideMark));\n }\n\n if (options.headers !== undefined) {\n const headerChildren: IXmlableObject[] = options.headers.map((h) => ({\n \"w:header\": { _attr: { \"w:val\": h } },\n }));\n children.push({ \"w:headers\": headerChildren });\n }\n\n if (options.insertion) {\n children.push(buildInsertedTableCellObj(options.insertion));\n }\n\n if (options.deletion) {\n children.push(buildDeletedTableCellObj(options.deletion));\n }\n\n if (options.revision) {\n children.push(buildTableCellPropertiesChangeObj(options.revision));\n }\n\n if (options.cellMerge) {\n children.push(buildCellMergeObj(options.cellMerge));\n }\n\n if (options.includeIfEmpty || children.length > 0) {\n return { \"w:tcPr\": children };\n }\n\n return undefined;\n}\n\n/**\n * Represents table cell properties (tcPr) in a WordprocessingML document.\n *\n * The tcPr element specifies properties for a table cell including width,\n * borders, shading, margins, text direction, vertical alignment, and merge settings.\n * These properties control the appearance and behavior of individual table cells.\n *\n * Reference: http://officeopenxml.com/WPtableCellProperties.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TcPr\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TcPrInner\">\n * <xsd:sequence>\n * <xsd:element name=\"tcPrChange\" type=\"CT_TcPrChange\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n *\n * <xsd:complexType name=\"CT_TcPrInner\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TcPrBase\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_CellMarkupElements\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n *\n * <xsd:complexType name=\"CT_TcPrBase\">\n * <xsd:sequence>\n * <xsd:element name=\"cnfStyle\" type=\"CT_Cnf\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tcW\" type=\"CT_TblWidth\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"gridSpan\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"hMerge\" type=\"CT_HMerge\" minOccurs=\"0\"/>\n * <xsd:element name=\"vMerge\" type=\"CT_VMerge\" minOccurs=\"0\"/>\n * <xsd:element name=\"tcBorders\" type=\"CT_TcBorders\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"shd\" type=\"CT_Shd\" minOccurs=\"0\"/>\n * <xsd:element name=\"noWrap\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"tcMar\" type=\"CT_TcMar\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"textDirection\" type=\"CT_TextDirection\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tcFitText\" type=\"CT_OnOff\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"vAlign\" type=\"CT_VerticalJc\" minOccurs=\"0\"/>\n * <xsd:element name=\"hideMark\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"headers\" type=\"CT_Headers\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n *\n * <xsd:group name=\"EG_CellMarkupElements\">\n * <xsd:choice>\n * <xsd:element name=\"cellIns\" type=\"CT_TrackChange\" minOccurs=\"0\"/>\n * <xsd:element name=\"cellDel\" type=\"CT_TrackChange\" minOccurs=\"0\"/>\n * <xsd:element name=\"cellMerge\" type=\"CT_CellMergeTrackChange\" minOccurs=\"0\"/>\n * </xsd:choice>\n * </xsd:group>\n *\n * <xsd:complexType name=\"CT_TcPrChange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_TrackChange\">\n * <xsd:sequence>\n * <xsd:element name=\"tcPr\" type=\"CT_TcPrInner\" minOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new TableCellProperties({\n * width: { size: 3000, type: WidthType.DXA },\n * shading: { fill: \"EEEEEE\" },\n * verticalAlign: VerticalAlign.CENTER,\n * columnSpan: 2,\n * });\n * ```\n */\nexport class TableCellProperties extends IgnoreIfEmptyXmlComponent {\n public constructor(options: ITableCellPropertiesOptions) {\n super(\"w:tcPr\", options.includeIfEmpty);\n\n if (options.cnfStyle !== undefined) {\n const attrs: Record<string, { readonly key: string; readonly value: string | boolean }> = {\n val: { key: \"w:val\", value: options.cnfStyle.val },\n };\n if (options.cnfStyle.changed !== undefined) {\n attrs.changed = { key: \"w:changed\", value: options.cnfStyle.changed };\n }\n this.root.push(new BuilderElement({ name: \"w:cnfStyle\", attributes: attrs }));\n }\n\n if (options.width) {\n this.root.push(createTableWidthElement(\"w:tcW\", options.width));\n }\n\n if (options.columnSpan) {\n this.root.push(new GridSpan(options.columnSpan));\n }\n\n if (options.verticalMerge) {\n this.root.push(new VerticalMerge(options.verticalMerge));\n } else if (options.rowSpan && options.rowSpan > 1) {\n // If cell already have a `verticalMerge`, don't handle `rowSpan`\n this.root.push(new VerticalMerge(VerticalMergeType.RESTART));\n }\n\n if (options.borders) {\n this.root.push(new TableCellBorders(options.borders));\n }\n\n if (options.shading) {\n this.root.push(createShading(options.shading));\n }\n\n if (options.margins) {\n const cellMargin = createCellMargin(options.margins);\n if (cellMargin) {\n this.root.push(cellMargin);\n }\n }\n\n if (options.textDirection) {\n this.root.push(new TDirection(options.textDirection));\n }\n\n if (options.verticalAlign) {\n this.root.push(createVerticalAlign(options.verticalAlign));\n }\n\n if (options.horizontalMerge !== undefined) {\n const attrs: Record<string, { readonly key: string; readonly value: string }> = {};\n if (options.horizontalMerge === \"restart\") {\n attrs.val = { key: \"w:val\", value: \"restart\" };\n }\n this.root.push(\n new BuilderElement({\n name: \"w:hMerge\",\n attributes: Object.keys(attrs).length > 0 ? attrs : undefined,\n }),\n );\n }\n\n if (options.noWrap !== undefined) {\n this.root.push(onOffObj(\"w:noWrap\", options.noWrap));\n }\n\n if (options.fitText !== undefined) {\n this.root.push(onOffObj(\"w:tcFitText\", options.fitText));\n }\n\n if (options.hideMark !== undefined) {\n this.root.push(onOffObj(\"w:hideMark\", options.hideMark));\n }\n\n if (options.headers !== undefined) {\n const children = options.headers.map(\n (h) =>\n new BuilderElement<{ readonly val: string }>({\n name: \"w:header\",\n attributes: { val: { key: \"w:val\", value: h } },\n }),\n );\n this.root.push(new BuilderElement({ name: \"w:headers\", children }));\n }\n\n if (options.insertion) {\n this.root.push(new InsertedTableCell(options.insertion));\n }\n\n if (options.deletion) {\n this.root.push(new DeletedTableCell(options.deletion));\n }\n\n if (options.revision) {\n this.root.push(new TableCellPropertiesChange(options.revision));\n }\n\n if (options.cellMerge) {\n this.root.push(new CellMerge(options.cellMerge));\n }\n }\n}\n\nexport class TableCellPropertiesChange extends XmlComponent {\n public constructor(options: ITableCellPropertiesChangeOptions) {\n super(\"w:tcPrChange\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n // TcPr is required (minOccurs=\"1\") even if empty\n this.root.push(new TableCellProperties({ ...options, includeIfEmpty: true }));\n }\n}\n","/**\n * Table cell module for WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { Paragraph } from \"@file/paragraph\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { xml } from \"@office-open/xml\";\n\nimport type { StructuredDocumentTagCell } from \"../../sdt\";\nimport type { SectionChild } from \"../../section-child\";\nimport { buildTableCellProperties } from \"./table-cell-properties\";\nimport type { ITableCellPropertiesOptions } from \"./table-cell-properties\";\n\n// Lazy import to avoid circular dependency: coerce.ts → Table → TableRow → TableCell → coerce.ts\ntype CoerceFn = (child: SectionChild) => FileChild;\nlet _coerce: CoerceFn | undefined;\n\nfunction lazyCoerce(child: SectionChild): FileChild {\n if (!_coerce) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n _coerce = require(\"../../coerce\").coerceSectionChild;\n }\n return _coerce!(child);\n}\n\n/**\n * Options for creating a TableCell element.\n *\n * @see {@link TableCell}\n */\nexport type TableCellOptions = {\n /** Array of Paragraph, Table, or plain objects that make up the cell content */\n readonly children: readonly (SectionChild | StructuredDocumentTagCell)[];\n} & ITableCellPropertiesOptions;\n\n/**\n * Represents a table cell in a WordprocessingML document.\n *\n * A table cell is the basic unit of content within a table. Each cell can contain\n * paragraphs, nested tables, or other block-level content. Cells must always end\n * with a paragraph element.\n *\n * Reference: http://officeopenxml.com/WPtableCell.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Tc\">\n * <xsd:sequence>\n * <xsd:element name=\"tcPr\" type=\"CT_TcPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"id\" type=\"s:ST_String\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new TableCell({\n * children: [new Paragraph(\"Cell content\")],\n * width: { size: 3000, type: WidthType.DXA },\n * });\n * ```\n */\nexport class TableCell extends BaseXmlComponent {\n public constructor(public readonly options: TableCellOptions) {\n super(\"w:tc\");\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const tPrObj = buildTableCellProperties(this.options);\n if (tPrObj) children.push(tPrObj);\n\n const coerced = this.options.children.map((c) =>\n c instanceof BaseXmlComponent ? c : lazyCoerce(c),\n );\n\n for (const child of coerced) {\n const obj = child.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n // Cells must end with a paragraph\n const last = coerced[coerced.length - 1];\n if (!(last instanceof Paragraph)) {\n children.push(new Paragraph({}).prepForXml(context)!);\n }\n\n return { \"w:tc\": children };\n }\n\n public override toXml(context: Context): string {\n const parts: string[] = [];\n\n const tPrObj = buildTableCellProperties(this.options);\n if (tPrObj) parts.push(xml(tPrObj));\n\n const coerced = this.options.children.map((c) =>\n c instanceof BaseXmlComponent ? c : lazyCoerce(c),\n );\n\n for (const child of coerced) {\n parts.push(child.toXml(context));\n }\n\n // Cells must end with a paragraph\n const last = coerced[coerced.length - 1];\n if (!(last instanceof Paragraph)) {\n parts.push(new Paragraph({}).toXml(context));\n }\n\n return `<w:tc>${parts.join(\"\")}</w:tc>`;\n }\n}\n","/**\n * Row-level Structured Document Tag (SDT) for WordprocessingML documents.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_SdtRow\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { TableRow } from \"../table\";\nimport {\n StructuredDocumentTagContent,\n StructuredDocumentTagProperties,\n} from \"../table-of-contents\";\nimport type { SdtPropertiesOptions } from \"../table-of-contents\";\nimport { TableCell } from \"../table/table-cell/table-cell\";\n\n/**\n * Options for creating a row-level Structured Document Tag (CT_SdtRow).\n */\nexport interface SdtRowOptions {\n readonly properties: SdtPropertiesOptions;\n readonly children?: readonly TableRow[];\n}\n\n/**\n * A row-level Structured Document Tag (CT_SdtRow).\n *\n * Represents a content control within a table row. The SDT wraps\n * `TableRow` children in `w:sdtContent`.\n *\n * @example\n * ```typescript\n * new StructuredDocumentTagRow({\n * properties: { alias: \"Controlled Row\" },\n * children: [\n * new TableRow({ children: [new TableCell({ children: [new Paragraph(\"Cell\")] })] }),\n * ],\n * });\n * ```\n */\nexport class StructuredDocumentTagRow extends XmlComponent {\n private readonly rows: readonly TableRow[];\n\n public constructor(options: SdtRowOptions) {\n super(\"w:sdt\");\n this.rows = options.children ?? [];\n this.root.push(new StructuredDocumentTagProperties(options.properties));\n if (this.rows.length > 0) {\n const content = new StructuredDocumentTagContent();\n for (const row of this.rows) {\n content.addChildElement(row);\n }\n this.root.push(content);\n }\n }\n\n public get cellCount(): number {\n return Math.max(...this.rows.map((r) => r.cellCount), 0);\n }\n\n public get cells(): readonly TableCell[] {\n return this.rows.flatMap((r) => r.cells);\n }\n\n public addCellToColumnIndex(cell: TableCell, columnIndex: number): void {\n if (this.rows.length > 0) {\n this.rows[0].addCellToColumnIndex(cell, columnIndex);\n }\n }\n}\n","/**\n * Structured Document Tag (SDT) module exports.\n *\n * @module\n */\nexport * from \"./sdt\";\nexport * from \"./sdt-cell\";\nexport * from \"./sdt-row\";\n","/**\n * Table grid module for WordprocessingML documents.\n *\n * The table grid defines the column structure of a table.\n *\n * Reference: http://officeopenxml.com/WPtableGrid.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblGridCol\">\n * <xsd:attribute name=\"w\" type=\"s:ST_TwipsMeasure\"/>\n * </xsd:complexType>\n * <xsd:complexType name=\"CT_TblGridBase\">\n * <xsd:sequence>\n * <xsd:element name=\"gridCol\" type=\"CT_TblGridCol\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * <xsd:complexType name=\"CT_TblGridChange\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_Markup\">\n * <xsd:sequence>\n * <xsd:element name=\"tblGrid\" type=\"CT_TblGridBase\"/>\n * </xsd:sequence>\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport { BuilderElement, XmlComponent } from \"@file/xml-components\";\nimport { twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\n\nexport interface TableGridChangeOptions {\n readonly id: number;\n readonly columnWidths: readonly number[] | readonly PositiveUniversalMeasure[];\n}\n\n/**\n * Creates a single column in the table grid.\n *\n * The gridCol element specifies the width of a single column.\n */\nexport const createGridCol = (width?: number | PositiveUniversalMeasure): XmlComponent =>\n new BuilderElement<{ readonly width?: number | PositiveUniversalMeasure }>({\n attributes:\n width !== undefined\n ? {\n width: { key: \"w:w\", value: twipsMeasureValue(width) },\n }\n : undefined,\n name: \"w:gridCol\",\n });\n\n/**\n * Creates the table grid for a WordprocessingML document.\n *\n * The tblGrid element defines the number and width of columns in the table.\n *\n * Reference: http://officeopenxml.com/WPtableGrid.php\n */\nexport class TableGrid extends XmlComponent {\n public constructor(\n widths: readonly number[] | readonly PositiveUniversalMeasure[],\n revision?: TableGridChangeOptions,\n ) {\n super(\"w:tblGrid\");\n for (const width of widths) {\n this.root.push(createGridCol(width));\n }\n if (revision) {\n this.root.push(new TableGridChange(revision));\n }\n }\n}\n\nexport class TableGridChange extends XmlComponent {\n public constructor(options: TableGridChangeOptions) {\n super(\"w:tblGridChange\");\n this.root.push({ _attr: { \"w:id\": options.id } });\n this.root.push(new TableGrid(options.columnWidths));\n }\n}\n","/**\n * Table module for WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPtableGrid.php\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { BaseXmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport type { AlignmentType } from \"../paragraph\";\nimport { StructuredDocumentTagRow } from \"../sdt\";\nimport { TableGrid } from \"./grid\";\nimport type { TableGridChangeOptions } from \"./grid\";\nimport { TableCell, VerticalMergeType } from \"./table-cell\";\nimport type { TableCellSpacingProperties } from \"./table-cell-spacing\";\nimport { TableProperties } from \"./table-properties\";\nimport type {\n TableBordersOptions,\n TableFloatOptions,\n ITablePropertiesChangeOptions,\n} from \"./table-properties\";\nimport type { TableCellMarginOptions } from \"./table-properties/table-cell-margin\";\nimport type { TableLayoutType } from \"./table-properties/table-layout\";\nimport type { TableLookOptions } from \"./table-properties/table-look\";\nimport { TableRow } from \"./table-row\";\nimport type { TableRowOptions } from \"./table-row\";\nimport type { TableWidthProperties } from \"./table-width\";\n\n/**\n * Options for creating a Table element.\n *\n * Note: 0-width columns don't get rendered correctly, so we need\n * to give them some value. A reasonable default would be\n * ~6in / numCols, but if we do that it becomes very hard\n * to resize the table using setWidth, unless the layout\n * algorithm is set to 'fixed'. Instead, the approach here\n * means even in 'auto' layout, setting a width on the\n * table will make it look reasonable, as the layout\n * algorithm will expand columns to fit its content.\n *\n * @see {@link Table}\n */\nexport interface TableOptions {\n readonly rows: readonly (TableRow | StructuredDocumentTagRow | TableRowOptions)[];\n readonly width?: TableWidthProperties;\n readonly columnWidths?: readonly number[];\n readonly columnWidthsRevision?: TableGridChangeOptions;\n readonly margins?: TableCellMarginOptions;\n readonly indent?: TableWidthProperties;\n readonly float?: TableFloatOptions;\n readonly layout?: (typeof TableLayoutType)[keyof typeof TableLayoutType];\n readonly style?: string;\n readonly borders?: TableBordersOptions;\n readonly alignment?: (typeof AlignmentType)[keyof typeof AlignmentType];\n readonly visuallyRightToLeft?: boolean;\n readonly tableLook?: TableLookOptions;\n readonly cellSpacing?: TableCellSpacingProperties;\n readonly styleRowBandSize?: number;\n readonly styleColBandSize?: number;\n readonly caption?: string;\n readonly description?: string;\n readonly revision?: ITablePropertiesChangeOptions;\n}\n\n/**\n * Represents a table in a WordprocessingML document.\n *\n * A table is a set of paragraphs (and other block-level content) arranged in rows and columns.\n * Tables are used to organize content into a grid structure.\n *\n * Reference: http://officeopenxml.com/WPtable.php\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Tbl\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_RangeMarkupElements\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"tblPr\" type=\"CT_TblPr\"/>\n * <xsd:element name=\"tblGrid\" type=\"CT_TblGrid\"/>\n * <xsd:group ref=\"EG_ContentRowContent\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * new Table({\n * rows: [\n * new TableRow({\n * children: [\n * new TableCell({ children: [new Paragraph(\"Cell 1\")] }),\n * new TableCell({ children: [new Paragraph(\"Cell 2\")] }),\n * ],\n * }),\n * ],\n * });\n * ```\n */\nexport class Table extends BaseXmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n\n private readonly options: TableOptions;\n private readonly columnWidths: readonly number[];\n // Coerced rows: plain TableRowOptions are converted to TableRow instances\n private readonly rows: readonly (TableRow | StructuredDocumentTagRow)[];\n\n public constructor(options: TableOptions) {\n super(\"w:tbl\");\n this.options = options;\n\n // Coerce plain TableRowOptions objects into TableRow instances\n this.rows = options.rows.map((row) =>\n row instanceof TableRow || row instanceof StructuredDocumentTagRow ? row : new TableRow(row),\n );\n\n this.columnWidths =\n options.columnWidths ??\n Array<number>(Math.max(...this.rows.map((row) => row.cellCount))).fill(100);\n\n // Register CONTINUE cells on subsequent rows for vertical merge\n this.rows.forEach((row, rowIndex) => {\n if (rowIndex === this.rows.length - 1) return;\n if (!(row instanceof TableRow)) return;\n\n let columnIndex = 0;\n row.cells.forEach((cell) => {\n if (cell.options.rowSpan && cell.options.rowSpan > 1) {\n const nextRow = this.rows[rowIndex + 1];\n if (nextRow instanceof TableRow) {\n const continueCell = new TableCell({\n borders: cell.options.borders,\n children: [],\n columnSpan: cell.options.columnSpan,\n rowSpan: cell.options.rowSpan - 1,\n verticalMerge: VerticalMergeType.CONTINUE,\n });\n nextRow.addCellToColumnIndex(continueCell, columnIndex);\n }\n }\n columnIndex += cell.options.columnSpan || 1;\n });\n });\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n const children: IXmlableObject[] = [];\n\n const tblPr = new TableProperties({\n alignment: this.options.alignment,\n borders: this.options.borders ?? {},\n caption: this.options.caption,\n cellMargin: this.options.margins,\n cellSpacing: this.options.cellSpacing,\n description: this.options.description,\n float: this.options.float,\n indent: this.options.indent,\n layout: this.options.layout,\n revision: this.options.revision,\n style: this.options.style,\n styleColBandSize: this.options.styleColBandSize,\n styleRowBandSize: this.options.styleRowBandSize,\n tableLook: this.options.tableLook,\n visuallyRightToLeft: this.options.visuallyRightToLeft,\n width: this.options.width ?? { size: 100 },\n });\n const tblPrObj = tblPr.prepForXml(context);\n if (tblPrObj) children.push(tblPrObj);\n\n const gridObj = new TableGrid(this.columnWidths, this.options.columnWidthsRevision).prepForXml(\n context,\n );\n if (gridObj) children.push(gridObj);\n\n for (const row of this.rows) {\n const obj = row.prepForXml(context);\n if (obj) children.push(obj);\n }\n\n return { \"w:tbl\": children };\n }\n\n public override toXml(context: Context): string {\n const parts: string[] = [];\n\n const tblPr = new TableProperties({\n alignment: this.options.alignment,\n borders: this.options.borders ?? {},\n caption: this.options.caption,\n cellMargin: this.options.margins,\n cellSpacing: this.options.cellSpacing,\n description: this.options.description,\n float: this.options.float,\n indent: this.options.indent,\n layout: this.options.layout,\n revision: this.options.revision,\n style: this.options.style,\n styleColBandSize: this.options.styleColBandSize,\n styleRowBandSize: this.options.styleRowBandSize,\n tableLook: this.options.tableLook,\n visuallyRightToLeft: this.options.visuallyRightToLeft,\n width: this.options.width ?? { size: 100 },\n });\n parts.push(tblPr.toXml(context));\n\n parts.push(new TableGrid(this.columnWidths, this.options.columnWidthsRevision).toXml(context));\n\n for (const row of this.rows) {\n parts.push(row.toXml(context));\n }\n\n return `<w:tbl>${parts.join(\"\")}</w:tbl>`;\n }\n}\n","/**\n * Picture element module for WordprocessingML documents.\n *\n * Provides functionality for creating pict (picture) elements that contain VML shapes.\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating a picture element.\n *\n * @property shape - The VML shape to be contained within the picture element\n */\nexport interface PictElement {\n /** The VML shape to be contained within the picture element */\n readonly shape: XmlComponent;\n}\n\n/**\n * Creates a picture element containing a VML shape.\n *\n * The picture element (w:pict) is a container for VML (Vector Markup Language) content\n * within WordprocessingML documents, commonly used for textboxes and other drawing objects.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Picture\">\n * <xsd:sequence>\n * <xsd:sequence maxOccurs=\"unbounded\">\n * <xsd:any processContents=\"lax\" namespace=\"urn:schemas-microsoft-com:vml\" minOccurs=\"0\"\n * maxOccurs=\"unbounded\"/>\n * <xsd:any processContents=\"lax\" namespace=\"urn:schemas-microsoft-com:office:office\"\n * minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:element name=\"movie\" type=\"CT_Rel\" minOccurs=\"0\"/>\n * <xsd:element name=\"control\" type=\"CT_Control\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @param options - Configuration options containing the VML shape\n * @returns An XmlComponent representing the w:pict element\n *\n * @example\n * ```typescript\n * const pictElement = createPictElement({\n * shape: createShape({\n * id: \"shape1\",\n * children: [new TextRun(\"Hello\")]\n * })\n * });\n * ```\n */\nexport const createPictElement = ({ shape }: PictElement): XmlComponent =>\n new BuilderElement<{ readonly style?: string }>({\n children: [shape],\n name: \"w:pict\",\n });\n","/**\n * Textbox content module for WordprocessingML documents.\n *\n * Provides functionality for creating textbox content elements that contain block-level content.\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Creates a textbox content element containing block-level content.\n *\n * The textbox content element (w:txbxContent) represents the content container within a VML textbox.\n * It can contain block-level elements such as paragraphs and tables.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TxbxContent\">\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Configuration options\n * @param options.children - Array of block-level children to include in the textbox content\n * @returns An XmlComponent representing the w:txbxContent element\n *\n * @example\n * ```typescript\n * const content = createTextboxContent({\n * children: [new Paragraph(\"Hello World\")]\n * });\n * ```\n */\nexport const createTextboxContent = ({\n children = [],\n}: {\n readonly children?: readonly FileChild[];\n}): XmlComponent =>\n new BuilderElement<{ readonly style?: string }>({\n children,\n name: \"w:txbxContent\",\n });\n","/**\n * VML textbox module for WordprocessingML documents.\n *\n * Provides functionality for creating VML textbox elements that define text containers within shapes.\n *\n * Reference: http://webapp.docx4java.org/OnlineDemo/ecma376/VML/textbox.html\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport type { InsetMode } from \"@util/types\";\n\nimport { createTextboxContent } from \"../texbox-content/textbox-content\";\nimport type { LengthUnit } from \"../types\";\n\n// Type VMLTextboxStyle = {\n// Readonly fontWeight?: \"normal\" | \"lighter\" | 100 | 200 | 300 | 400 | \"bold\" | \"bolder\" | 500 | 600 | 700 | 800 | 900;\n// }\n\n/**\n * Options for creating a VML textbox element.\n *\n * @property style - CSS-style string for textbox styling\n * @property children - Array of paragraph children to include in the textbox\n * @property inset - Custom inset margins for the textbox content\n */\nexport interface VTextboxOptions {\n /** CSS-style string for textbox styling */\n readonly style?: string;\n /** Array of block-level children to include in the textbox */\n readonly children?: readonly FileChild[];\n /** Custom inset margins for the textbox content (top, left, bottom, right) */\n readonly inset?: {\n /** Top inset margin */\n readonly top: LengthUnit;\n /** Left inset margin */\n readonly left: LengthUnit;\n /** Bottom inset margin */\n readonly bottom: LengthUnit;\n /** Right inset margin */\n readonly right: LengthUnit;\n };\n}\n\n/**\n * Creates a VML textbox element.\n *\n * The VML textbox element (v:textbox) defines a text container within a VML shape.\n * It supports custom styling and inset margins to control text positioning within the shape.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Textbox\">\n * <xsd:choice>\n * <xsd:element ref=\"w:txbxContent\" minOccurs=\"0\"/>\n * <xsd:any namespace=\"##local\" processContents=\"skip\"/>\n * </xsd:choice>\n * <xsd:attributeGroup ref=\"AG_Id\"/>\n * <xsd:attributeGroup ref=\"AG_Style\"/>\n * <xsd:attribute name=\"inset\" type=\"xsd:string\" use=\"optional\"/>\n * <xsd:attribute ref=\"o:singleclick\"/>\n * <xsd:attribute ref=\"o:insetmode\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Configuration options for the VML textbox\n * @returns An XmlComponent representing the v:textbox element\n *\n * @example\n * ```typescript\n * const vmlTextbox = createVmlTextbox({\n * style: \"mso-fit-shape-to-text:t;\",\n * children: [new TextRun(\"Hello World\")],\n * inset: {\n * top: \"0.1in\",\n * left: \"0.1in\",\n * bottom: \"0.1in\",\n * right: \"0.1in\"\n * }\n * });\n * ```\n */\nexport const createVmlTextbox = ({ style, children, inset }: VTextboxOptions): XmlComponent =>\n new BuilderElement<{\n readonly style?: string;\n readonly inset?: string;\n readonly insetMode?: InsetMode;\n }>({\n attributes: {\n inset: {\n key: \"inset\",\n value: inset ? `${inset.left}, ${inset.top}, ${inset.right}, ${inset.bottom}` : undefined,\n },\n insetMode: {\n key: \"insetmode\",\n value: inset ? \"custom\" : \"auto\",\n },\n style: {\n key: \"style\",\n value: style,\n },\n },\n children: [createTextboxContent({ children })],\n name: \"v:textbox\",\n });\n","/**\n * VML shape module for WordprocessingML documents.\n *\n * Provides functionality for creating VML shape elements with customizable styling and positioning.\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part3/OOXML_P3_Primer_OfficeArt_topic_ID0ELU5O.html\n * - http://webapp.docx4java.org/OnlineDemo/ecma376/VML/shape.html\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { LengthUnit } from \"../types\";\nimport { createVmlTextbox } from \"../vml-textbox/vml-texbox\";\n\nconst SHAPE_TYPE = \"#_x0000_t202\";\n\n/**\n * Maps VmlShapeStyle property names to their corresponding CSS-style property names.\n * Used internally for converting TypeScript-friendly property names to VML style attributes.\n */\nconst styleToKeyMap: Record<keyof VmlShapeStyle, string> = {\n flip: \"flip\",\n height: \"height\",\n left: \"left\",\n marginBottom: \"margin-bottom\",\n marginLeft: \"margin-left\",\n marginRight: \"margin-right\",\n marginTop: \"margin-top\",\n position: \"position\",\n positionHorizontal: \"mso-position-horizontal\",\n positionHorizontalRelative: \"mso-position-horizontal-relative\",\n positionVertical: \"mso-position-vertical\",\n positionVerticalRelative: \"mso-position-vertical-relative\",\n rotation: \"rotation\",\n top: \"top\",\n visibility: \"visibility\",\n width: \"width\",\n wrapDistanceBottom: \"mso-wrap-distance-bottom\",\n wrapDistanceLeft: \"mso-wrap-distance-left\",\n wrapDistanceRight: \"mso-wrap-distance-right\",\n wrapDistanceTop: \"mso-wrap-distance-top\",\n wrapEdited: \"mso-wrap-edited\",\n wrapStyle: \"mso-wrap-style\",\n zIndex: \"z-index\",\n};\n\n/**\n * Styling options for VML shapes.\n *\n * This type defines all available CSS-like styling properties for positioning, sizing,\n * and configuring VML shapes in WordprocessingML documents. These properties control\n * the shape's appearance, layout, and interaction with surrounding text.\n */\nexport interface VmlShapeStyle {\n /** Specifies that the orientation of a shape is flipped. Default is no value. */\n readonly flip?: \"x\" | \"y\" | \"xy\" | \"yx\";\n /** Specifies the height of the containing block of the shape. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. */\n readonly height?: LengthUnit;\n /** Specifies the position of the left of the containing block of the shape relative to the element left of it in the flow of the page. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. This property shall not be used for shapes anchored inline. */\n readonly left?: LengthUnit;\n /** Specifies the position of the bottom of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. */\n readonly marginBottom?: LengthUnit;\n /** Specifies the position of the left of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. */\n readonly marginLeft?: LengthUnit;\n /** Specifies the position of the right of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. */\n readonly marginRight?: LengthUnit;\n /** Specifies the position of the top of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. */\n readonly marginTop?: LengthUnit;\n /** Specifies the horizontal positioning data for objects in WordprocessingML documents. Default is absolute. */\n readonly positionHorizontal?: \"absolute\" | \"left\" | \"center\" | \"right\" | \"inside\" | \"outside\";\n /** Specifies relative horizontal position data for objects in WordprocessingML documents. This modifies the mso-position-horizontal property. Default is text. */\n readonly positionHorizontalRelative?: \"margin\" | \"page\" | \"text\" | \"char\";\n /** Specifies the vertical positioning data for objects in WordprocessingML documents. Default is absolute. */\n readonly positionVertical?: \"absolute\" | \"left\" | \"center\" | \"right\" | \"inside\" | \"outside\";\n /** Specifies relative vertical position data for objects in WordprocessingML documents. This modifies the mso-position-vertical property. Default is text. */\n readonly positionVerticalRelative?: \"margin\" | \"page\" | \"text\" | \"char\";\n /** Specifies the distance from the bottom of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin. */\n readonly wrapDistanceBottom?: number;\n /** Specifies the distance from the left side of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin. */\n readonly wrapDistanceLeft?: number;\n /** Specifies the distance from the right side of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin. */\n readonly wrapDistanceRight?: number;\n /** Specifies the distance from the top of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin. */\n readonly wrapDistanceTop?: number;\n /** Specifies whether the wrap coordinates were customized by the user. If the wrap coordinates are generated by an editor, this property is true; otherwise they were customized by a user. Default is false. */\n readonly wrapEdited?: boolean;\n /** Specifies the wrapping mode for text in shapes in WordprocessingML documents. Default is square. */\n readonly wrapStyle?: \"square\" | \"none\";\n /** Specifies the type of positioning used to place an element. Default is static. When the element is contained inside a group, this property must be absolute. */\n readonly position?: \"static\" | \"absolute\" | \"relative\";\n /** Specifies the angle that a shape is rotated, in degrees. Default is 0. Positive angles are clockwise. */\n readonly rotation?: number;\n /** Specifies the position of the top of the containing block of the shape relative to the element above it in the flow of the page. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. This property shall not be used for shapes anchored inline. */\n readonly top?: LengthUnit;\n /** Specifies whether a shape is displayed. Only inherit and hidden are used; any other values are mapped to inherit. Default is inherit. */\n readonly visibility?: \"hidden\" | \"inherit\";\n /** Specifies the width of the containing block of the shape. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. */\n readonly width: LengthUnit;\n /** Specifies the display order of overlapping shapes. Default is 0. This property shall not be used for shapes anchored inline. */\n readonly zIndex?: \"auto\" | number;\n}\n\n/**\n * Formats VmlShapeStyle object into a CSS-style string for VML shape attributes.\n *\n * @param style - The VmlShapeStyle object to format\n * @returns A CSS-style string (e.g., \"width:100pt;height:50pt;\") or undefined if no style provided\n * @internal\n */\nconst formatShapeStyle = (style?: VmlShapeStyle): string | undefined =>\n style\n ? Object.entries(style)\n .map(([key, value]) => `${styleToKeyMap[key as keyof VmlShapeStyle]}:${value}`)\n .join(\";\")\n : undefined;\n\n/**\n * Options for creating a VML shape.\n *\n * @property id - Unique identifier for the shape\n * @property children - Array of paragraph children to include in the shape's textbox\n * @property type - VML shape type identifier (default: \"#_x0000_t202\" for text rectangle)\n * @property style - Styling properties for the shape\n */\ninterface ShapeOptions {\n /** Unique identifier for the shape */\n readonly id: string;\n /** Array of block-level children to include in the shape's textbox */\n readonly children?: readonly FileChild[];\n /** VML shape type identifier (default: \"#_x0000_t202\" for text rectangle) */\n readonly type?: string;\n /** Styling properties for the shape */\n readonly style?: VmlShapeStyle;\n}\n\n/**\n * Creates a VML shape element with textbox content.\n *\n * The VML shape element (v:shape) represents a vector graphics shape in WordprocessingML documents.\n * This function creates shapes configured for text display (textbox shapes), which are commonly\n * used for creating floating text boxes with custom positioning and styling.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Shape\">\n * <xsd:choice maxOccurs=\"unbounded\">\n * <xsd:group ref=\"EG_ShapeElements\"/>\n * <xsd:element ref=\"o:ink\"/>\n * <xsd:element ref=\"pvml:iscomment\"/>\n * <xsd:element ref=\"o:equationxml\"/>\n * </xsd:choice>\n * <xsd:attributeGroup ref=\"AG_AllCoreAttributes\"/>\n * <xsd:attributeGroup ref=\"AG_AllShapeAttributes\"/>\n * <xsd:attributeGroup ref=\"AG_Type\"/>\n * <xsd:attributeGroup ref=\"AG_Adj\"/>\n * <xsd:attributeGroup ref=\"AG_Path\"/>\n * <xsd:attribute ref=\"o:gfxdata\"/>\n * <xsd:attribute name=\"equationxml\" type=\"xsd:string\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Configuration options for the shape\n * @returns An XmlComponent representing the v:shape element\n *\n * @example\n * ```typescript\n * const shape = createShape({\n * id: \"textbox1\",\n * children: [new TextRun(\"Hello World\")],\n * style: {\n * width: \"3in\",\n * height: \"1in\",\n * position: \"absolute\",\n * left: \"1in\",\n * top: \"1in\"\n * }\n * });\n * ```\n */\nexport const createShape = ({\n id,\n children,\n type = SHAPE_TYPE,\n style,\n}: ShapeOptions): XmlComponent =>\n new BuilderElement<\n Pick<ShapeOptions, \"id\" | \"type\"> & {\n readonly style?: string;\n }\n >({\n attributes: {\n id: {\n key: \"id\",\n value: id,\n },\n style: {\n key: \"style\",\n value: formatShapeStyle(style),\n },\n type: {\n key: \"type\",\n value: type,\n },\n },\n children: [createVmlTextbox({ children, style: \"mso-fit-shape-to-text:t;\" })],\n name: \"v:shape\",\n });\n","/**\n * Textbox module for WordprocessingML documents.\n *\n * This module provides support for text boxes using VML shapes. Textboxes allow for\n * creating floating text containers with custom positioning and styling.\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { ParagraphProperties } from \"@file/paragraph\";\nimport type { ParagraphOptions } from \"@file/paragraph\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport { uniqueId } from \"@util/convenience-functions\";\n\nimport { createPictElement } from \"./pict-element/pict-element\";\nimport { createShape } from \"./shape/shape\";\nimport type { VmlShapeStyle } from \"./shape/shape\";\n\n/**\n * Options for creating a Textbox.\n *\n * Extends paragraph options while replacing the style property with VML shape styling.\n *\n * @property style - VML shape style properties for positioning and sizing\n * @property children - Array of child elements (text runs, hyperlinks, etc.)\n */\nexport type ITextboxOptions = Omit<ParagraphOptions, \"style\" | \"children\"> & {\n /** VML shape style properties for the textbox (positioning, sizing, wrapping, etc.) */\n readonly style?: VmlShapeStyle;\n /** Array of block-level content elements (paragraphs, tables, etc.) */\n readonly children?: readonly FileChild[];\n};\n\n/**\n * Represents a textbox in a WordprocessingML document.\n *\n * A Textbox creates a floating text container using VML shapes that can be positioned\n * anywhere on the page. Unlike regular paragraphs, textboxes support absolute positioning,\n * custom dimensions, and text wrapping control.\n *\n * The textbox is implemented as a paragraph containing a picture element (w:pict) with\n * a VML shape (v:shape) that contains a VML textbox (v:textbox) with the actual content.\n *\n * @publicApi\n *\n * ## XSD Schema\n * The Textbox combines multiple OOXML elements:\n * - w:p (paragraph container)\n * - w:pict (picture element containing VML)\n * - v:shape (VML shape with styling)\n * - v:textbox (VML textbox content container)\n * - w:txbxContent (WordprocessingML textbox content)\n *\n * @example\n * ```typescript\n * // Simple textbox with text\n * new Textbox({\n * children: [new TextRun(\"Hello World\")],\n * style: {\n * width: \"3in\",\n * height: \"1in\"\n * }\n * });\n *\n * // Positioned textbox with wrapping\n * new Textbox({\n * children: [\n * new TextRun({ text: \"Floating Text\", bold: true }),\n * new TextRun({ text: \" in a textbox\", break: 1 })\n * ],\n * style: {\n * width: \"2.5in\",\n * height: \"1.5in\",\n * position: \"absolute\",\n * left: \"1in\",\n * top: \"2in\",\n * wrapStyle: \"square\"\n * }\n * });\n * ```\n */\nexport class Textbox extends XmlComponent implements FileChild {\n public readonly fileChild = Symbol();\n public constructor({ style, children, ...rest }: ITextboxOptions) {\n super(\"w:p\");\n this.root.push(new ParagraphProperties(rest));\n\n this.root.push(\n createPictElement({\n shape: createShape({\n children,\n id: uniqueId(),\n style: style,\n }),\n }),\n );\n }\n}\n","/**\n * Coerce function for SectionChild type.\n *\n * Converts plain-object representations into their corresponding class\n * instances, enabling a JSON-friendly API.\n *\n * @module\n */\nimport { AltChunk } from \"./alt-chunk/alt-chunk\";\nimport type { FileChild } from \"./file-child\";\nimport { Paragraph } from \"./paragraph/paragraph\";\nimport { StructuredDocumentTagBlock } from \"./sdt/sdt\";\nimport type { SectionChild } from \"./section-child\";\nimport { SubDoc } from \"./sub-doc/sub-doc\";\nimport { TableOfContents } from \"./table-of-contents/table-of-contents\";\nimport { Table } from \"./table/table\";\nimport { Textbox } from \"./textbox/textbox\";\nimport { BaseXmlComponent } from \"./xml-components\";\n\n/**\n * Coerces a `SectionChild` (plain object or class instance) into a `FileChild`.\n *\n * - Class instances pass through unchanged.\n * - Plain objects are mapped to their corresponding constructor.\n */\nexport function coerceSectionChild(child: SectionChild): FileChild {\n if (child instanceof BaseXmlComponent) return child as FileChild;\n if (\"paragraph\" in child) return new Paragraph(child.paragraph);\n if (\"table\" in child) return new Table(child.table);\n if (\"toc\" in child) {\n const { alias, ...options } = child.toc;\n return new TableOfContents(alias, options);\n }\n if (\"textbox\" in child) {\n const { children, ...rest } = child.textbox;\n return new Textbox({ ...rest, children: children?.map(coerceSectionChild) });\n }\n if (\"sdt\" in child) {\n const { properties, children } = child.sdt;\n return new StructuredDocumentTagBlock({\n properties,\n children: children?.map(coerceSectionChild),\n });\n }\n if (\"altChunk\" in child) return new AltChunk(child.altChunk);\n if (\"subDoc\" in child) return new SubDoc(child.subDoc);\n throw new Error(\"Unknown section child type\");\n}\n","/**\n * AltChunk collection module for managing alternative format content parts.\n *\n * @module\n */\n\n/**\n * Stores alternative format chunk data for later serialization by the compiler.\n */\nexport interface AltChunkData {\n /** Unique key for this alt chunk (e.g., relId) */\n readonly key: string;\n /** Raw content data */\n readonly data: Uint8Array;\n /** Part sub-path within word/ (e.g., \"afchunks/afchunk1.html\") */\n readonly path: string;\n /** File extension (e.g., \"html\", \"rtf\", \"txt\") */\n readonly extension: string;\n /** MIME content type (e.g., \"text/html\", \"application/rtf\") */\n readonly contentType: string;\n}\n\n/**\n * Manages alternative format chunk parts in a document.\n *\n * Stores external content (HTML, RTF, plain text) that will be\n * serialized into separate parts in the DOCX package.\n */\nexport class AltChunkCollection {\n private readonly map: Map<string, AltChunkData>;\n\n public constructor() {\n this.map = new Map<string, AltChunkData>();\n }\n\n public addAltChunk(key: string, data: AltChunkData): void {\n this.map.set(key, data);\n }\n\n public get array(): readonly AltChunkData[] {\n return [...this.map.values()];\n }\n}\n","/**\n * Bibliography module for WordprocessingML documents.\n *\n * This module provides support for bibliography sources in documents.\n * Bibliography data is stored in a separate `word/bibliography.xml` part\n * within the DOCX package.\n *\n * Reference: ISO/IEC 29500-4, shared-bibliography.xsd, CT_Sources, CT_SourceType\n *\n * @module\n */\nimport { Relationships } from \"@file/relationships\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for a single bibliography source entry.\n *\n * Maps to CT_SourceType in the bibliography XSD schema.\n * All fields are optional — include only the relevant ones for each source type.\n *\n * @property type - Source type (Book, JournalArticle, ConferenceProceedings, etc.)\n * @property title - Title of the work\n * @property author - Author names (plain text, semicolon-separated)\n * @property year - Publication year\n * @property month - Publication month\n * @property day - Publication day\n * @property bookTitle - Title of the book (for book sections, articles in collections)\n * @property journal - Journal name (JournalName in XSD)\n * @property volume - Volume number\n * @property issue - Issue number\n * @property pages - Page range\n * @property publisher - Publisher name\n * @property city - City of publication\n * @property url - URL for internet sources\n * @property edition - Edition number or description\n * @property institution - Institution (for theses, reports)\n */\nexport interface SourceTypeOptions {\n readonly type?: string;\n readonly title?: string;\n readonly author?: string;\n readonly year?: string;\n readonly month?: string;\n readonly day?: string;\n readonly bookTitle?: string;\n readonly journal?: string;\n readonly volume?: string;\n readonly issue?: string;\n readonly pages?: string;\n readonly publisher?: string;\n readonly city?: string;\n readonly url?: string;\n readonly edition?: string;\n readonly institution?: string;\n}\n\n/**\n * Options for creating a bibliography container.\n *\n * @property sources - Array of bibliography source entries\n * @property styleName - Bibliography style name (e.g., \"APA\", \"Chicago\", \"IEEE\")\n */\nexport interface BibliographyOptions {\n readonly sources: readonly SourceTypeOptions[];\n readonly styleName?: string;\n}\n\n/**\n * XML element containing text content with bibliography namespace prefix.\n *\n * @internal\n */\nclass BibliographyString extends XmlComponent {\n public constructor(tagName: string, value: string) {\n super(`b:${tagName}`);\n this.root.push(value);\n }\n}\n\n/**\n * Represents a single bibliography source (CT_SourceType).\n *\n * Each source is a collection of named text fields corresponding to\n * the elements defined in shared-bibliography.xsd.\n *\n * @internal\n */\nclass Source extends XmlComponent {\n public constructor(options: SourceTypeOptions) {\n super(\"b:Source\");\n\n const fields: [string, string | undefined][] = [\n [\"SourceType\", options.type],\n [\"Title\", options.title],\n [\"Author\", options.author],\n [\"Year\", options.year],\n [\"Month\", options.month],\n [\"Day\", options.day],\n [\"BookTitle\", options.bookTitle],\n [\"JournalName\", options.journal],\n [\"Volume\", options.volume],\n [\"Issue\", options.issue],\n [\"Pages\", options.pages],\n [\"Publisher\", options.publisher],\n [\"City\", options.city],\n [\"URL\", options.url],\n [\"Edition\", options.edition],\n [\"Institution\", options.institution],\n ];\n\n for (const [tagName, value] of fields) {\n if (value !== undefined) {\n this.root.push(new BibliographyString(tagName, value));\n }\n }\n }\n}\n\n/**\n * Represents the bibliography sources container (CT_Sources).\n *\n * This is the root element for the `word/bibliography.xml` part that stores\n * all bibliography source definitions in the document.\n *\n * Reference: ISO/IEC 29500-4, shared-bibliography.xsd\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"Sources\" type=\"CT_Sources\"/>\n * <xsd:complexType name=\"CT_Sources\">\n * <xsd:sequence>\n * <xsd:element name=\"Source\" type=\"CT_SourceType\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"SelectedStyle\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"StyleName\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"URI\" type=\"s:ST_String\"/>\n * </xsd:complexType>\n * ```\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * new Bibliography({\n * styleName: \"APA\",\n * sources: [\n * {\n * type: \"Book\",\n * title: \"The Design of Everyday Things\",\n * author: \"Norman, Donald\",\n * year: \"2013\",\n * publisher: \"Basic Books\",\n * city: \"New York\",\n * edition: \"Revised\",\n * },\n * ],\n * });\n * ```\n */\nexport class Bibliography extends XmlComponent {\n public readonly relationships: Relationships;\n\n public constructor(options: BibliographyOptions) {\n super(\"b:Sources\");\n\n this.root.push({\n _attr: {\n \"xmlns:b\": \"http://schemas.openxmlformats.org/officeDocument/2006/bibliography\",\n ...(options.styleName !== undefined ? { StyleName: options.styleName } : {}),\n },\n });\n\n for (const source of options.sources) {\n this.root.push(new Source(source));\n }\n\n this.relationships = new Relationships();\n }\n}\n","/**\n * Content Types module for Open Packaging Conventions.\n *\n * This module provides the [Content_Types].xml part which defines\n * the content types for all parts in the DOCX package.\n *\n * Reference: http://officeopenxml.com/anatomyofOOXML.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { createDefault } from \"./default/default\";\nimport { createOverride } from \"./override/override\";\n\n/**\n * Represents the Content Types part of an OPC package.\n *\n * ContentTypes maps file extensions and specific paths to their\n * MIME content types, enabling applications to process each part correctly.\n *\n * Reference: http://officeopenxml.com/anatomyofOOXML.php\n *\n * @example\n * ```typescript\n * const contentTypes = new ContentTypes();\n * contentTypes.addHeader(1); // Add header1.xml\n * contentTypes.addFooter(1); // Add footer1.xml\n * ```\n */\nexport class ContentTypes extends XmlComponent {\n public constructor() {\n super(\"Types\");\n\n this.root.push({\n _attr: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/content-types\",\n },\n });\n\n this.root.push(createDefault(\"image/png\", \"png\"));\n this.root.push(createDefault(\"image/jpeg\", \"jpeg\"));\n this.root.push(createDefault(\"image/jpeg\", \"jpg\"));\n this.root.push(createDefault(\"image/bmp\", \"bmp\"));\n this.root.push(createDefault(\"image/gif\", \"gif\"));\n this.root.push(createDefault(\"image/tiff\", \"tif\"));\n this.root.push(createDefault(\"image/tiff\", \"tiff\"));\n this.root.push(createDefault(\"image/x-emf\", \"emf\"));\n this.root.push(createDefault(\"image/x-wmf\", \"wmf\"));\n this.root.push(createDefault(\"image/x-icon\", \"ico\"));\n this.root.push(createDefault(\"image/svg+xml\", \"svg\"));\n this.root.push(\n createDefault(\"application/vnd.openxmlformats-package.relationships+xml\", \"rels\"),\n );\n this.root.push(createDefault(\"application/xml\", \"xml\"));\n this.root.push(\n createDefault(\"application/vnd.openxmlformats-officedocument.obfuscatedFont\", \"odttf\"),\n );\n\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n \"/word/document.xml\",\n ),\n );\n\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\",\n \"/word/styles.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-package.core-properties+xml\",\n \"/docProps/core.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.custom-properties+xml\",\n \"/docProps/custom.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.extended-properties+xml\",\n \"/docProps/app.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\",\n \"/word/numbering.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\",\n \"/word/footnotes.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\",\n \"/word/endnotes.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\",\n \"/word/settings.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\",\n \"/word/comments.xml\",\n ),\n );\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\",\n \"/word/fontTable.xml\",\n ),\n );\n }\n\n /**\n * Registers a bibliography part in the content types.\n */\n public addBibliography(): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.bibliography+xml\",\n \"/word/bibliography.xml\",\n ),\n );\n }\n\n /**\n * Registers a footer part in the content types.\n *\n * @param index - Footer index number (e.g., 1 for footer1.xml)\n */\n public addFooter(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\",\n `/word/footer${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers a header part in the content types.\n *\n * @param index - Header index number (e.g., 1 for header1.xml)\n */\n public addHeader(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\",\n `/word/header${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers a chart part in the content types.\n *\n * @param index - Chart index number (e.g., 1 for charts/chart1.xml)\n */\n public addChart(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\",\n `/word/charts/chart${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers a diagram data part in the content types.\n *\n * @param index - Diagram data index number\n */\n public addDiagramData(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml\",\n `/word/diagrams/data${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers a diagram layout part in the content types.\n *\n * @param index - Diagram layout index number\n */\n public addDiagramLayout(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml\",\n `/word/diagrams/layout${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers a diagram style part in the content types.\n *\n * @param index - Diagram style index number\n */\n public addDiagramStyle(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml\",\n `/word/diagrams/quickStyle${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers a diagram colors part in the content types.\n *\n * @param index - Diagram colors index number\n */\n public addDiagramColors(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml\",\n `/word/diagrams/colors${index}.xml`,\n ),\n );\n }\n\n public addDiagramDrawing(index: number): void {\n this.root.push(\n createOverride(\n \"application/vnd.ms-office.drawingml.diagramDrawing+xml\",\n `/word/diagrams/drawing${index}.xml`,\n ),\n );\n }\n\n /**\n * Registers an alternative format chunk part in the content types.\n *\n * @param path - Part path (e.g., \"word/afchunks/afchunk1.html\")\n * @param contentType - MIME content type\n * @param extension - File extension for the default entry\n */\n public addAltChunk(path: string, contentType: string, _extension: string): void {\n this.root.push(createOverride(contentType, path));\n }\n\n /**\n * Registers a sub-document part in the content types.\n */\n public addSubDoc(path: string): void {\n this.root.push(\n createOverride(\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\",\n path,\n ),\n );\n }\n}\n","/**\n * Document attributes module for WordprocessingML documents.\n *\n * This module defines the XML namespace declarations used in OOXML documents.\n * These namespaces are required for proper document parsing and generation.\n *\n * Reference: http://officeopenxml.com/anatomyofOOXML.php\n *\n * @module\n */\nimport type { IXmlableObject } from \"@file/xml-components\";\n\n/**\n * XML namespace URIs used in WordprocessingML documents.\n *\n * These namespaces define the various XML schemas that can be referenced\n * in a document, including WordprocessingML, DrawingML, VML, and others.\n */\n/* CSpell:disable */\nexport const DocumentAttributeNamespaces = {\n aink: \"http://schemas.microsoft.com/office/drawing/2016/ink\",\n am3d: \"http://schemas.microsoft.com/office/drawing/2017/model3d\",\n cp: \"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\",\n cx: \"http://schemas.microsoft.com/office/drawing/2014/chartex\",\n cx1: \"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\",\n cx2: \"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\",\n cx3: \"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\",\n cx4: \"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\",\n cx5: \"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\",\n cx6: \"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\",\n cx7: \"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\",\n cx8: \"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\",\n dc: \"http://purl.org/dc/elements/1.1/\",\n dcmitype: \"http://purl.org/dc/dcmitype/\",\n dcterms: \"http://purl.org/dc/terms/\",\n m: \"http://schemas.openxmlformats.org/officeDocument/2006/math\",\n mc: \"http://schemas.openxmlformats.org/markup-compatibility/2006\",\n o: \"urn:schemas-microsoft-com:office:office\",\n r: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n v: \"urn:schemas-microsoft-com:vml\",\n w: \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\",\n w10: \"urn:schemas-microsoft-com:office:word\",\n w14: \"http://schemas.microsoft.com/office/word/2010/wordml\",\n w15: \"http://schemas.microsoft.com/office/word/2012/wordml\",\n w16: \"http://schemas.microsoft.com/office/word/2018/wordml\",\n w16cex: \"http://schemas.microsoft.com/office/word/2018/wordml/cex\",\n w16cid: \"http://schemas.microsoft.com/office/word/2016/wordml/cid\",\n w16sdtdh: \"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash\",\n w16se: \"http://schemas.microsoft.com/office/word/2015/wordml/symex\",\n wne: \"http://schemas.microsoft.com/office/word/2006/wordml\",\n wp: \"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\",\n wp14: \"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\",\n wpc: \"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\",\n wpg: \"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\",\n wpi: \"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\",\n wps: \"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\",\n xsi: \"http://www.w3.org/2001/XMLSchema-instance\",\n};\n/* CSpell:enable */\n\n/**\n * Type representing valid namespace keys.\n */\nexport type DocumentAttributeNamespace = keyof typeof DocumentAttributeNamespaces;\n\nconst attrsCache = new Map<string, IXmlableObject>();\n\n/**\n * Builds XML namespace attributes for a WordprocessingML document.\n *\n * Results are cached by (namespaces + ignorable) key.\n *\n * @internal\n */\nexport function buildDocumentAttributes(\n ns: readonly DocumentAttributeNamespace[],\n Ignorable?: string,\n): IXmlableObject {\n const cacheKey = `${ns.join(\",\")}:${Ignorable ?? \"\"}`;\n const cached = attrsCache.get(cacheKey);\n if (cached) return cached;\n\n const attrs: Record<string, string> = {};\n if (Ignorable !== undefined) {\n attrs[\"mc:Ignorable\"] = Ignorable;\n }\n for (const n of ns) {\n attrs[`xmlns:${n}`] = DocumentAttributeNamespaces[n];\n }\n const result = { _attr: attrs };\n attrsCache.set(cacheKey, result);\n return result;\n}\n","import type { BibliographyOptions } from \"@file/bibliography\";\n/**\n * Core Properties module for WordprocessingML documents.\n *\n * Provides support for document metadata based on Dublin Core properties.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCore.xsd\n *\n * @module\n */\nimport type { EmbeddedFontOptions } from \"@file/fonts/font-table\";\nimport type { CommentsOptions } from \"@file/paragraph/run/comment-run\";\nimport type { HyphenationOptions } from \"@file/settings\";\nimport type { CompatibilityOptions } from \"@file/settings/compatibility\";\nimport type {\n DocumentProtectionOptions,\n SettingsOptions,\n WriteProtectionOptions,\n} from \"@file/settings/settings\";\nimport { XmlComponent, stringContainerObj } from \"@file/xml-components\";\nimport { dateTimeValue } from \"@util/values\";\n\nimport type { CustomPropertyOptions } from \"../custom-properties\";\nimport type { DocumentBackgroundOptions } from \"../document\";\nimport { buildDocumentAttributes } from \"../document/document-attributes\";\nimport type { SectionOptions } from \"../file\";\nimport type { NumberingOptions } from \"../numbering\";\nimport type { ParagraphOptions, Paragraph } from \"../paragraph\";\nimport type { StylesOptions } from \"../styles\";\n\n/**\n * Options for configuring document properties.\n *\n * @property sections - Document section configurations\n * @property title - Document title\n * @property subject - Document subject\n * @property creator - Document creator/author\n * @property keywords - Document keywords for searchability\n * @property description - Document description\n * @property lastModifiedBy - User who last modified the document\n * @property revision - Revision number\n * @property externalStyles - External stylesheet reference\n * @property styles - Document styles configuration\n * @property numbering - Numbering configuration\n * @property comments - Document comments configuration\n * @property bibliography - Document bibliography sources\n * @property footnotes - Document footnotes\n * @property background - Document background settings\n * @property features - Document features like track changes\n * @property compatabilityModeVersion - Compatibility mode version\n * @property compatibility - Compatibility settings\n * @property customProperties - Custom document properties\n * @property evenAndOddHeaderAndFooters - Enable different headers/footers for even/odd pages\n * @property defaultTabStop - Default tab stop width\n * @property fonts - Font configurations\n * @property hyphenation - Hyphenation settings\n */\nexport interface PropertiesOptions {\n readonly sections: readonly SectionOptions[];\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 readonly externalStyles?: string;\n readonly styles?: StylesOptions;\n readonly numbering?: NumberingOptions;\n readonly comments?: CommentsOptions;\n readonly bibliography?: BibliographyOptions;\n readonly footnotes?: Readonly<\n Record<\n string,\n {\n readonly children: readonly (Paragraph | ParagraphOptions | string)[];\n }\n >\n >;\n readonly endnotes?: Readonly<\n Record<\n string,\n {\n readonly children: readonly (Paragraph | ParagraphOptions | string)[];\n }\n >\n >;\n readonly background?: DocumentBackgroundOptions;\n readonly features?: {\n readonly trackRevisions?: boolean;\n readonly updateFields?: boolean;\n readonly documentProtection?: DocumentProtectionOptions;\n };\n readonly compatabilityModeVersion?: number;\n readonly compatibility?: CompatibilityOptions;\n readonly customProperties?: readonly CustomPropertyOptions[];\n readonly evenAndOddHeaderAndFooters?: boolean;\n readonly defaultTabStop?: number;\n readonly fonts?: readonly EmbeddedFontOptions[];\n readonly hyphenation?: HyphenationOptions;\n /** Controls whether punctuation is compressed at line ends */\n readonly characterSpacingControl?: \"compressPunctuation\" | \"doNotCompress\";\n /** Default document view mode */\n readonly view?: \"none\" | \"print\" | \"outline\" | \"masterPages\" | \"normal\" | \"web\";\n /** Default zoom level (percentage) and type */\n readonly zoom?: {\n readonly percent?: number;\n readonly val?: \"none\" | \"fullPage\" | \"bestFit\" | \"textFit\";\n };\n /** Write protection recommendation (not enforcement) */\n readonly writeProtection?: WriteProtectionOptions;\n /** Whether to display the background shape in print layout */\n readonly displayBackgroundShape?: boolean;\n /** Whether to embed TrueType fonts in the document */\n readonly embedTrueTypeFonts?: boolean;\n /** Whether to embed system fonts in the document */\n readonly embedSystemFonts?: boolean;\n /** Whether to save only a subset of the embedded fonts */\n readonly saveSubsetFonts?: boolean;\n /** Document variables (key-value pairs stored in the document) */\n readonly docVars?: readonly { readonly name: string; readonly val: string }[];\n /** Theme color scheme remapping */\n readonly colorSchemeMapping?: SettingsOptions[\"colorSchemeMapping\"];\n}\n\n/**\n * Represents the core properties of a WordprocessingML document.\n *\n * Core properties contain document metadata based on Dublin Core elements,\n * including title, subject, creator, keywords, description, and modification tracking.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCore.xsd\n *\n * ## XSD Schema\n * ```xml\n * <xs:complexType name=\"CT_CoreProperties\">\n * <xs:all>\n * <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\"/>\n * <xs:element name=\"contentStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\"/>\n * <xs:element ref=\"dcterms:created\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element ref=\"dc:creator\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element ref=\"dc:description\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element ref=\"dc:identifier\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element name=\"keywords\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CT_Keywords\"/>\n * <xs:element ref=\"dc:language\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element name=\"lastModifiedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\"/>\n * <xs:element name=\"lastPrinted\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:dateTime\"/>\n * <xs:element ref=\"dcterms:modified\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element name=\"revision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\"/>\n * <xs:element ref=\"dc:subject\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element ref=\"dc:title\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\"/>\n * </xs:all>\n * </xs:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const coreProps = new CoreProperties({\n * title: \"My Document\",\n * subject: \"Sample Document\",\n * creator: \"John Doe\",\n * keywords: \"docx, example\",\n * description: \"A sample document\",\n * lastModifiedBy: \"Jane Doe\",\n * revision: 1\n * });\n * ```\n */\nexport class CoreProperties extends XmlComponent {\n public constructor(options: Omit<PropertiesOptions, \"sections\">) {\n super(\"cp:coreProperties\");\n this.root.push(buildDocumentAttributes([\"cp\", \"dc\", \"dcterms\", \"dcmitype\", \"xsi\"]));\n if (options.title) {\n this.root.push(stringContainerObj(\"dc:title\", options.title));\n }\n if (options.subject) {\n this.root.push(stringContainerObj(\"dc:subject\", options.subject));\n }\n if (options.creator) {\n this.root.push(stringContainerObj(\"dc:creator\", options.creator));\n }\n if (options.keywords) {\n this.root.push(stringContainerObj(\"cp:keywords\", options.keywords));\n }\n if (options.description) {\n this.root.push(stringContainerObj(\"dc:description\", options.description));\n }\n if (options.lastModifiedBy) {\n this.root.push(stringContainerObj(\"cp:lastModifiedBy\", options.lastModifiedBy));\n }\n if (options.revision) {\n this.root.push(stringContainerObj(\"cp:revision\", String(options.revision)));\n }\n this.root.push(new TimestampElement(\"dcterms:created\"));\n this.root.push(new TimestampElement(\"dcterms:modified\"));\n }\n}\n\n/**\n * Represents a timestamp element (created or modified date).\n * Uses W3C DateTime Format (dcterms:W3CDTF) for dates.\n */\nclass TimestampElement extends XmlComponent {\n public constructor(name: string) {\n super(name);\n this.root.push({ _attr: { \"xsi:type\": \"dcterms:W3CDTF\" } });\n this.root.push(dateTimeValue(new Date()));\n }\n}\n","/**\n * Custom Property module for WordprocessingML documents.\n *\n * Provides support for individual custom document properties.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCustom.xsd\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Options for creating a custom property.\n *\n * @property name - The property name\n * @property value - The property value (as string)\n */\nexport interface CustomPropertyOptions {\n /** The property name */\n readonly name: string;\n /** The property value (as string) */\n readonly value: string;\n}\n\n/**\n * Represents a single custom document property.\n *\n * Custom properties allow storing arbitrary key-value pairs in the document metadata.\n * Each property has a unique name and a string value.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCustom.xsd\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Property\">\n * <xsd:sequence>\n * <xsd:element name=\"lpwstr\" type=\"xsd:string\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"fmtid\" type=\"ST_Guid\" use=\"required\"/>\n * <xsd:attribute name=\"pid\" type=\"xsd:int\" use=\"required\"/>\n * <xsd:attribute name=\"name\" type=\"xsd:string\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const customProp = new CustomProperty(2, {\n * name: \"Department\",\n * value: \"Engineering\"\n * });\n * ```\n */\nexport class CustomProperty extends XmlComponent {\n public constructor(id: number, properties: CustomPropertyOptions) {\n super(\"property\");\n this.root.push({\n _attr: {\n fmtid: \"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}\",\n name: properties.name,\n pid: id.toString(),\n },\n });\n this.root.push(new CustomPropertyValue(properties.value));\n }\n}\n\n/**\n * Represents the value of a custom property.\n * Uses the variant type \"long pointer to wide string\" for string values.\n */\nexport class CustomPropertyValue extends XmlComponent {\n public constructor(value: string) {\n super(\"vt:lpwstr\");\n this.root.push(value);\n }\n}\n","/**\n * Custom Properties module for WordprocessingML documents.\n *\n * Provides support for managing custom document properties collection.\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCustom.xsd\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport { CustomProperty } from \"./custom-property\";\nimport type { CustomPropertyOptions } from \"./custom-property\";\n\n/**\n * Represents the collection of custom document properties.\n *\n * Custom properties allow storing arbitrary metadata as name-value pairs.\n * Each property is assigned a unique ID starting from 2 (per Office specification).\n *\n * Reference: ISO-IEC29500-4_2016 shared-documentPropertiesCustom.xsd\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_CustomProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"property\" type=\"CT_Property\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const customProps = new CustomProperties([\n * { name: \"Department\", value: \"Engineering\" },\n * { name: \"Project\", value: \"Alpha\" }\n * ]);\n * ```\n */\nexport class CustomProperties extends XmlComponent {\n private nextId: number;\n private readonly properties: CustomProperty[] = [];\n\n public constructor(properties: readonly CustomPropertyOptions[]) {\n super(\"Properties\");\n\n this.root.push({\n _attr: {\n xmlns: \"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\",\n \"xmlns:vt\": \"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\",\n },\n });\n\n // I'm not sure why, but every example I have seen starts with 2\n // https://docs.microsoft.com/en-us/office/open-xml/how-to-set-a-custom-property-in-a-word-processing-document\n this.nextId = 2;\n\n for (const property of properties) {\n this.addCustomProperty(property);\n }\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n this.properties.forEach((x) => this.root.push(x));\n return super.prepForXml(context);\n }\n\n public addCustomProperty(property: CustomPropertyOptions): void {\n this.properties.push(new CustomProperty(this.nextId++, property));\n }\n}\n","/**\n * Columns module for WordprocessingML section properties.\n *\n * Defines multi-column layouts within document sections.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber, twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\n\nimport type { Column } from \"./column\";\n\n/**\n * Options for configuring column layout in a section.\n *\n * @property space - Spacing between columns in twips (default: 425)\n * @property count - Number of columns (default: 1)\n * @property separate - Whether to draw vertical separator lines between columns\n * @property equalWidth - Whether all columns have equal width\n * @property children - Individual column definitions (used when equalWidth is false)\n */\nexport interface ColumnsAttributes {\n /** Spacing between columns in twips (default: 720) */\n readonly space?: number | PositiveUniversalMeasure;\n /** Number of columns (default: 1) */\n readonly count?: number;\n /** Whether to draw vertical separator lines between columns */\n readonly separate?: boolean;\n /** Whether all columns have equal width */\n readonly equalWidth?: boolean;\n /** Individual column definitions (used when equalWidth is false, max: 45) */\n readonly children?: readonly Column[];\n}\n\n/**\n * Creates column layout settings (cols) for a document section.\n *\n * This element defines the multi-column layout properties for a section,\n * including column count, spacing, and whether columns have equal or custom widths.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Columns\">\n * <xsd:sequence minOccurs=\"0\">\n * <xsd:element name=\"col\" type=\"CT_Column\" maxOccurs=\"45\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"equalWidth\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"space\" type=\"s:ST_TwipsMeasure\" use=\"optional\" default=\"720\"/>\n * <xsd:attribute name=\"num\" type=\"ST_DecimalNumber\" use=\"optional\" default=\"1\"/>\n * <xsd:attribute name=\"sep\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Two equal-width columns with separator\n * createColumns({\n * count: 2,\n * space: 720,\n * separate: true,\n * equalWidth: true\n * });\n *\n * // Custom column widths\n * createColumns({\n * equalWidth: false,\n * children: [\n * { width: 3000, space: 720 },\n * { width: 4000, space: 0 }\n * ]\n * });\n * ```\n */\nexport const createColumns = ({\n space,\n count,\n separate,\n equalWidth,\n children,\n}: ColumnsAttributes): XmlComponent =>\n new BuilderElement<Omit<ColumnsAttributes, \"children\">>({\n attributes: {\n count: { key: \"w:num\", value: count === undefined ? undefined : decimalNumber(count) },\n equalWidth: { key: \"w:equalWidth\", value: equalWidth },\n separate: { key: \"w:sep\", value: separate },\n space: {\n key: \"w:space\",\n value: space === undefined ? undefined : twipsMeasureValue(space),\n },\n },\n children: !equalWidth && children ? children : undefined,\n name: \"w:cols\",\n });\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Specifies the type of the current document grid, which defines the grid behavior.\n *\n * The grid can define a grid which snaps all East Asian characters to grid positions, but leaves Latin text with its default spacing; a grid which adds the specified character pitch to all characters on each row; or a grid which affects only the line pitch for the current section.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_DocGrid_topic_ID0ELYP2.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_DocGrid\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"default\"/>\n * <xsd:enumeration value=\"lines\"/>\n * <xsd:enumeration value=\"linesAndChars\"/>\n * <xsd:enumeration value=\"snapToChars\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const DocumentGridType = {\n /**\n * Specifies that no document grid shall be applied to the contents of the current section in the document.\n */\n DEFAULT: \"default\",\n /**\n * Specifies that the parent section shall have additional line pitch added to each line within it (as specified on the <docGrid> element (§2.6.5)) in order to maintain the specified number of lines per page.\n */\n LINES: \"lines\",\n /**\n * Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the <docGrid> element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line.\n *\n * When this value is set, the input specified via the user interface may be allowed in exact number of line/character pitch units. */\n LINES_AND_CHARS: \"linesAndChars\",\n /**\n * Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the <docGrid> element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line.\n *\n * When this value is set, the input specified via the user interface may be restricted to the number of lines per page and characters per line, with the consumer or producer translating this information based on the current font data to get the resulting line and character pitch values\n */\n SNAP_TO_CHARS: \"snapToChars\",\n} as const;\n\nexport interface DocGridAttributesProperties {\n /**\n * Specifies the type of the current document grid, which defines the grid behavior.\n *\n * The grid can define a grid which snaps all East Asian characters to grid positions, but leaves Latin text with its default spacing; a grid which adds the specified character pitch to each character on each row; or a grid which affects only the line pitch for the current section.\n */\n readonly type?: (typeof DocumentGridType)[keyof typeof DocumentGridType];\n /**\n * Specifies the number of lines to be allowed on the document grid for the current page assuming all lines have equal line pitch applied to them. This line pitch shall not be added to any line which appears within a table cell unless the <adjustLineHeightInTable> element (§2.15.3.1) is present in the document's compatibility settings.\n *\n * This attribute is specified in twentieths of a point, and defines the pitch for each line of text on this page such that the desired number of single spaced lines of text fits on the current page.\n *\n * ```xml\n * <w:docGrid w:linePitch=\"684\" …/>\n * ```\n *\n * The `linePitch` attribute specifies that 34.2 points is to the amount of pitch allowed for each line on this page in order to maintain the specific document grid. ]\n *\n * Individual paragraphs can override the line pitch information specified for the document grid by either:\n *\n * Specifying an exact line spacing value using the `lineRule` attribute of value exact on the <spacing> element (§2.3.1.33).\n *\n * Specifying that the paragraph text shall not snap to the document grid via the <snapToGrid> element (§2.3.1.32).\n *\n * The possible values for this attribute are defined by the ST_DecimalNumber simple type (§2.18.16).\n */\n readonly linePitch: number;\n /**\n * Specifies the number of characters to be allowed on the document grid for each line in this section.\n *\n * This attribute's value shall be specified by multiplying the difference between the desired character pitch and the character pitch for that character in the font size of the Normal font by 4096.\n *\n * This value shall then be used to add the character pitch for the specified point size to each character in the section [: This results in text in the Normal style having a specific number of characters per line. ]\n *\n * ```xml\n * <w:docGrid w:charSize=\"40960\" …/>\n * ```\n * The `charSpace` attribute specifies a value of 40960, which means that the delta between the character pitch of each character in the grid and the Normal font is 10 points, resulting in a character pitch of 11+10 = 21 points for all characters in this section. ]\n *\n * Individual runs of text can override the line pitch information specified for the document grid by specifying that the run text shall not snap to the document grid via the <snapToGrid> element (§2.3.2.32).\n *\n * The possible values for this attribute are defined by the `ST_DecimalNumber` simple type (§2.18.16).\n */\n readonly charSpace?: number;\n}\n\n/**\n * This element specifies the settings for the document grid, which enables precise layout of full-width East Asian language characters within a document by specifying the desired number of characters per line and lines per page for all East Asian text content in this section.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docGrid_topic_ID0EHU5S.html\n *\n * ```xml\n * <xsd:complexType name=\"CT_DocGrid\">\n * <xsd:attribute name=\"type\" type=\"ST_DocGrid\"/>\n * <xsd:attribute name=\"linePitch\" type=\"ST_DecimalNumber\"/>\n * <xsd:attribute name=\"charSpace\" type=\"ST_DecimalNumber\"/>\n * </xsd:complexType>\n * ```\n * @returns\n */\nexport const createDocumentGrid = ({\n type,\n linePitch,\n charSpace,\n}: DocGridAttributesProperties): XmlComponent =>\n new BuilderElement<DocGridAttributesProperties>({\n attributes: {\n charSpace: {\n key: \"w:charSpace\",\n value: charSpace ? decimalNumber(charSpace) : undefined,\n },\n linePitch: { key: \"w:linePitch\", value: decimalNumber(linePitch) },\n type: { key: \"w:type\", value: type },\n },\n name: \"w:docGrid\",\n });\n","import type { NumberFormat } from \"@file/shared/number-format\";\n/**\n * Footnote and endnote properties module for WordprocessingML section properties.\n *\n * Specifies footnote/endnote placement and numbering format within a section.\n *\n * Reference: ISO/IEC 29500-4, CT_FtnProps / CT_EdnProps\n *\n * @module\n */\nimport { BuilderElement, IgnoreIfEmptyXmlComponent, XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Footnote position types.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_FtnPos\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"pageBottom\"/>\n * <xsd:enumeration value=\"beneathText\"/>\n * <xsd:enumeration value=\"sectEnd\"/>\n * <xsd:enumeration value=\"docEnd\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const FootnotePositionType = {\n /** Footnotes at bottom of the page */\n PAGE_BOTTOM: \"pageBottom\",\n /** Footnotes beneath text on the page */\n BENEATH_TEXT: \"beneathText\",\n /** Footnotes at the end of the section */\n SECT_END: \"sectEnd\",\n /** Footnotes at the end of the document */\n DOC_END: \"docEnd\",\n} as const;\n\n/**\n * Endnote position types.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_EdnPos\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"sectEnd\"/>\n * <xsd:enumeration value=\"docEnd\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const EndnotePositionType = {\n /** Endnotes at the end of the section */\n SECT_END: \"sectEnd\",\n /** Endnotes at the end of the document */\n DOC_END: \"docEnd\",\n} as const;\n\n/**\n * Number restart types for footnotes/endnotes.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_RestartNumber\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"continuous\"/>\n * <xsd:enumeration value=\"eachSect\"/>\n * <xsd:enumeration value=\"eachPage\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const NumberRestartType = {\n /** Continuous numbering throughout the document */\n CONTINUOUS: \"continuous\",\n /** Restart numbering at each section */\n EACH_SECT: \"eachSect\",\n /** Restart numbering at each page */\n EACH_PAGE: \"eachPage\",\n} as const;\n\n/**\n * Common options for footnote and endnote number properties.\n */\ninterface NumberPropertiesOptions {\n /** Number format (decimal, roman, letter, etc.) */\n readonly formatType?: (typeof NumberFormat)[keyof typeof NumberFormat];\n /** Custom number format string (overrides formatType when specified) */\n readonly format?: string;\n /** Starting number */\n readonly numStart?: number;\n /** When to restart numbering */\n readonly numRestart?: (typeof NumberRestartType)[keyof typeof NumberRestartType];\n}\n\n/**\n * Options for footnote properties.\n */\nexport interface FootnotePropertiesOptions extends NumberPropertiesOptions {\n /** Footnote placement */\n readonly pos?: (typeof FootnotePositionType)[keyof typeof FootnotePositionType];\n}\n\n/**\n * Options for endnote properties.\n */\nexport interface EndnotePropertiesOptions extends NumberPropertiesOptions {\n /** Endnote placement */\n readonly pos?: (typeof EndnotePositionType)[keyof typeof EndnotePositionType];\n}\n\n/**\n * Creates footnote properties element (w:footnotePr) for a section.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FtnProps\">\n * <xsd:sequence>\n * <xsd:element name=\"pos\" type=\"CT_FtnPos\" minOccurs=\"0\"/>\n * <xsd:element name=\"numFmt\" type=\"CT_NumFmt\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_FtnEdnNumProps\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createFootnoteProperties = ({\n pos,\n formatType,\n format,\n numStart,\n numRestart,\n}: FootnotePropertiesOptions): XmlComponent => {\n const container = new FootnoteProperties();\n\n if (pos !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: pos } },\n name: \"w:pos\",\n }),\n );\n }\n\n if (formatType !== undefined || format !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val?: string; readonly format?: string }>({\n attributes: {\n format: { key: \"w:format\", value: format },\n val: { key: \"w:fmt\", value: formatType },\n },\n name: \"w:numFmt\",\n }),\n );\n }\n\n if (numStart !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val: number }>({\n attributes: {\n val: { key: \"w:val\", value: decimalNumber(numStart) },\n },\n name: \"w:numStart\",\n }),\n );\n }\n\n if (numRestart !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: numRestart } },\n name: \"w:numRestart\",\n }),\n );\n }\n\n return container;\n};\n\n/**\n * Footnote properties container element.\n */\nclass FootnoteProperties extends IgnoreIfEmptyXmlComponent {\n public constructor() {\n super(\"w:footnotePr\", true);\n }\n}\n\n/**\n * Creates endnote properties element (w:endnotePr) for a section.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EdnProps\">\n * <xsd:sequence>\n * <xsd:element name=\"pos\" type=\"CT_EdnPos\" minOccurs=\"0\"/>\n * <xsd:element name=\"numFmt\" type=\"CT_NumFmt\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_FtnEdnNumProps\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createEndnoteProperties = ({\n pos,\n formatType,\n format,\n numStart,\n numRestart,\n}: EndnotePropertiesOptions): XmlComponent => {\n const container = new EndnoteProperties();\n\n if (pos !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: pos } },\n name: \"w:pos\",\n }),\n );\n }\n\n if (formatType !== undefined || format !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val?: string; readonly format?: string }>({\n attributes: {\n format: { key: \"w:format\", value: format },\n val: { key: \"w:fmt\", value: formatType },\n },\n name: \"w:numFmt\",\n }),\n );\n }\n\n if (numStart !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val: number }>({\n attributes: {\n val: { key: \"w:val\", value: decimalNumber(numStart) },\n },\n name: \"w:numStart\",\n }),\n );\n }\n\n if (numRestart !== undefined) {\n container.addChildElement(\n new BuilderElement<{ readonly val: string }>({\n attributes: { val: { key: \"w:val\", value: numRestart } },\n name: \"w:numRestart\",\n }),\n );\n }\n\n return container;\n};\n\n/**\n * Endnote properties container element.\n */\nclass EndnoteProperties extends IgnoreIfEmptyXmlComponent {\n public constructor() {\n super(\"w:endnotePr\", true);\n }\n}\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * This simple type specifies the possible types of headers and footers which may be specified for a given header or footer reference in a document. This value determines the page(s) on which the current header or footer shall be displayed.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_HdrFtr_topic_ID0E2UW2.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_HdrFtr\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"even\"/>\n * <xsd:enumeration value=\"default\"/>\n * <xsd:enumeration value=\"first\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const HeaderFooterReferenceType = {\n /** Specifies that this header or footer shall appear on every page in this section which is not overridden with a specific `even` or `first` page header/footer. In a section with all three types specified, this type shall be used on all odd numbered pages (counting from the `first` page in the section, not the section numbering). */\n DEFAULT: \"default\",\n /** Specifies that this header or footer shall appear on the first page in this section. The appearance of this header or footer is contingent on the setting of the `titlePg` element (§2.10.6). */\n FIRST: \"first\",\n /** Specifies that this header or footer shall appear on all even numbered pages in this section (counting from the first page in the section, not the section numbering). The appearance of this header or footer is contingent on the setting of the `evenAndOddHeaders` element (§2.10.1). */\n EVEN: \"even\",\n} as const;\n\n// <xsd:group name=\"EG_HdrFtrReferences\">\n// <xsd:choice>\n// <xsd:element name=\"headerReference\" type=\"CT_HdrFtrRef\" minOccurs=\"0\"/>\n// <xsd:element name=\"footerReference\" type=\"CT_HdrFtrRef\" minOccurs=\"0\"/>\n// </xsd:choice>\n// </xsd:group>\n\n// <xsd:complexType name=\"CT_HdrFtrRef\">\n// <xsd:complexContent>\n// <xsd:extension base=\"CT_Rel\">\n// <xsd:attribute name=\"type\" type=\"ST_HdrFtr\" use=\"required\"/>\n// </xsd:extension>\n// </xsd:complexContent>\n\n// <xsd:complexType name=\"CT_Rel\">\n// <xsd:attribute ref=\"r:id\" use=\"required\"/>\n// </xsd:complexType>\n\nexport interface HeaderFooterReferenceOptions {\n readonly type?: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];\n readonly id?: number;\n}\n\ninterface HeaderFooterReferenceAttributes {\n readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];\n readonly id: string;\n}\n\nexport const HeaderFooterType = {\n FOOTER: \"w:footerReference\",\n HEADER: \"w:headerReference\",\n} as const;\n\nexport const createHeaderFooterReference = (\n type: (typeof HeaderFooterType)[keyof typeof HeaderFooterType],\n options: HeaderFooterReferenceOptions,\n): XmlComponent =>\n new BuilderElement<HeaderFooterReferenceAttributes>({\n attributes: {\n id: { key: \"r:id\", value: `rId${options.id}` },\n type: { key: \"w:type\", value: options.type || HeaderFooterReferenceType.DEFAULT },\n },\n name: type,\n });\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber, twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\n\n/**\n * This simple type specifies when the line numbering in the parent section shall be reset to its restart value. The line numbering increments for each line (even if the line number itself is not displayed) until it reaches the restart point specified by this element.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_LineNumberRestart_topic_ID0EUS42.html\n *\n * ## XSD Schema\n *\n * ```xml\n * <xsd:simpleType name=\"ST_LineNumberRestart\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"newPage\"/>\n * <xsd:enumeration value=\"newSection\"/>\n * <xsd:enumeration value=\"continuous\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const LineNumberRestartFormat = {\n /**\n * ## Restart Line Numbering on Each Page\n *\n * Specifies that line numbering for the parent section shall restart to the starting value whenever a new page is displayed.\n */\n NEW_PAGE: \"newPage\",\n /**\n * ## Restart Line Numbering for Each Section\n *\n * Specifies that line numbering for the parent section shall restart to the starting value whenever the parent begins.\n */\n NEW_SECTION: \"newSection\",\n /**\n * ## Continue Line Numbering From Previous Section\n *\n * Specifies that line numbering for the parent section shall continue from the line numbering from the end of the previous section, if any.\n */\n CONTINUOUS: \"continuous\",\n} as const;\n\nexport interface LineNumberAttributes {\n /**\n * Specifies the line number increments to be displayed in the current document.\n *\n * Although each line has an associated line number, only lines which are an even multiple of this value shall be displayed.\n *\n * ### Example\n *\n * ```xml\n * <w:lnNumType … w:countBy=\"5\"/>\n * ```\n *\n * This setting ensures that only lines whose number is a multiple of (e.g. 5, 10, and 15) will have a line number displayed. ]\n *\n * The possible values for this attribute are defined by the ST_DecimalNumber simple type (§2.18.16).\n */\n readonly countBy?: number;\n /**\n * ## Line Numbering Starting Value\n *\n * Specifies the starting value used for the first line whenever the line numbering is restarted by use of the `restart` attribute.\n *\n * ### Example\n *\n * ```xml\n * <w:lnNumType w:start=\"3\" w:countBy=\"5\"/>\n * ```\n *\n * The `start` attribute specifies that line numbers shall be counted starting from the number 3.\n *\n * The possible values for this attribute are defined by the ST_DecimalNumber simple type (§2.18.16).\n */\n readonly start?: number;\n /**\n * ## Line Numbering Restart Setting\n *\n * Specifies when the line numbering in this section shall be reset to the line number specified by the `start` attribute's value.\n *\n * The line numbering increments for each line (even if it is not displayed) until it reaches the restart point specified by this element.\n *\n * ### Example\n *\n * ```xml\n * <w:sectPr>\n * ...\n * <w:lnNumType w:restart=\"newPage\" ... />\n * </w:sectPr>\n * ```\n *\n * The value of `newPage` specifies that the line numbers shall restart at the top of each page to the value specified by the `start` attribute. In this case, `newPage` is the default, so this value could have been omitted entirely.\n *\n * The possible values for this attribute are defined by the ST_LineNumberRestart simple type (§2.18.54).\n */\n readonly restart?: (typeof LineNumberRestartFormat)[keyof typeof LineNumberRestartFormat];\n /**\n * Specifies the distance between the text margin and the edge of any line numbers appearing in that section.\n *\n * ```xml\n * <w:lnNumType ... w:distance=\"720\"/>\n * ```\n *\n * The possible values for this attribute are defined by the ST_TwipsMeasure simple type (§2.18.105).\n */\n readonly distance?: number | PositiveUniversalMeasure;\n}\n\n/**\n * This element specifies the settings for line numbering to be displayed before each column of text in this section in the document.\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_lnNumType_topic_ID0EVRAT.html\n * - http://officeopenxml.com/WPsectionLineNumbering.php\n *\n * ## XSD Schema\n *\n * ```xml\n * <xsd:complexType name=\"CT_LineNumber\">\n * <xsd:attribute name=\"countBy\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"start\" type=\"ST_DecimalNumber\" use=\"optional\" default=\"1\"/>\n * <xsd:attribute name=\"distance\" type=\"s:ST_TwipsMeasure\" use=\"optional\"/>\n * <xsd:attribute name=\"restart\" type=\"ST_LineNumberRestart\" use=\"optional\" default=\"newPage\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createLineNumberType = ({\n countBy,\n start,\n restart,\n distance,\n}: LineNumberAttributes): XmlComponent =>\n new BuilderElement<LineNumberAttributes>({\n attributes: {\n countBy: {\n key: \"w:countBy\",\n value: countBy === undefined ? undefined : decimalNumber(countBy),\n },\n distance: {\n key: \"w:distance\",\n value: distance === undefined ? undefined : twipsMeasureValue(distance),\n },\n restart: { key: \"w:restart\", value: restart },\n start: {\n key: \"w:start\",\n value: start === undefined ? undefined : decimalNumber(start),\n },\n },\n name: \"w:lnNumType\",\n });\n","/**\n * Page borders module for WordprocessingML section properties.\n *\n * Defines borders around pages in a document section.\n *\n * Reference: http://officeopenxml.com/WPsectionBorders.php\n *\n * @module\n */\nimport { createBorderElement } from \"@file/border\";\nimport type { BorderOptions } from \"@file/border\";\nimport { IgnoreIfEmptyXmlComponent } from \"@file/xml-components\";\n\n/**\n * Specifies which pages display the page border.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PageBorderDisplay\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"allPages\"/>\n * <xsd:enumeration value=\"firstPage\"/>\n * <xsd:enumeration value=\"notFirstPage\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PageBorderDisplay = {\n /** Display border on all pages */\n ALL_PAGES: \"allPages\",\n /** Display border only on first page */\n FIRST_PAGE: \"firstPage\",\n /** Display border on all pages except first page */\n NOT_FIRST_PAGE: \"notFirstPage\",\n} as const;\n\n/**\n * Specifies whether page border is positioned relative to page edge or text.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PageBorderOffset\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"page\"/>\n * <xsd:enumeration value=\"text\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PageBorderOffsetFrom = {\n /** Position border relative to page edge */\n PAGE: \"page\",\n /** Position border relative to text (default) */\n TEXT: \"text\",\n} as const;\n\n/**\n * Specifies z-order of page border relative to intersecting objects.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PageBorderZOrder\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"front\"/>\n * <xsd:enumeration value=\"back\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PageBorderZOrder = {\n /** Display border behind page contents */\n BACK: \"back\",\n /** Display border in front of page contents (default) */\n FRONT: \"front\",\n} as const;\n\n/**\n * Options for configuring page borders.\n *\n * @property display - Which pages display the border\n * @property offsetFrom - Whether border is positioned relative to page or text\n * @property zOrder - Whether border appears in front or behind page contents\n * @property top - Top border styling\n * @property right - Right border styling\n * @property bottom - Bottom border styling\n * @property left - Left border styling\n */\nexport interface PageBordersOptions {\n /** Which pages display the border */\n readonly display?: (typeof PageBorderDisplay)[keyof typeof PageBorderDisplay];\n /** Whether border is positioned relative to page or text (default: text) */\n readonly offsetFrom?: (typeof PageBorderOffsetFrom)[keyof typeof PageBorderOffsetFrom];\n /** Whether border appears in front or behind page contents (default: front) */\n readonly zOrder?: (typeof PageBorderZOrder)[keyof typeof PageBorderZOrder];\n /** Top border styling */\n readonly top?: BorderOptions;\n /** Right border styling */\n readonly right?: BorderOptions;\n /** Bottom border styling */\n readonly bottom?: BorderOptions;\n /** Left border styling */\n readonly left?: BorderOptions;\n}\n\n/**\n * Represents page borders (pgBorders) for a document section.\n *\n * This element specifies the borders to display around pages in a section,\n * including which pages display the borders and how they are positioned.\n *\n * Reference: http://officeopenxml.com/WPsectionBorders.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PageBorders\">\n * <xsd:sequence>\n * <xsd:element name=\"top\" type=\"CT_TopPageBorder\" minOccurs=\"0\"/>\n * <xsd:element name=\"left\" type=\"CT_PageBorder\" minOccurs=\"0\"/>\n * <xsd:element name=\"bottom\" type=\"CT_BottomPageBorder\" minOccurs=\"0\"/>\n * <xsd:element name=\"right\" type=\"CT_PageBorder\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"zOrder\" type=\"ST_PageBorderZOrder\" use=\"optional\" default=\"front\"/>\n * <xsd:attribute name=\"display\" type=\"ST_PageBorderDisplay\" use=\"optional\"/>\n * <xsd:attribute name=\"offsetFrom\" type=\"ST_PageBorderOffset\" use=\"optional\" default=\"text\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Add page borders to all pages\n * new PageBorders({\n * display: PageBorderDisplay.ALL_PAGES,\n * offsetFrom: PageBorderOffsetFrom.PAGE,\n * zOrder: PageBorderZOrder.FRONT,\n * top: { style: BorderStyle.SINGLE, size: 24, color: \"000000\" },\n * bottom: { style: BorderStyle.SINGLE, size: 24, color: \"000000\" }\n * });\n * ```\n */\nexport class PageBorders extends IgnoreIfEmptyXmlComponent {\n public constructor(options?: PageBordersOptions) {\n super(\"w:pgBorders\");\n\n if (!options) {\n return this;\n }\n\n const hasAttributes =\n options.display !== undefined ||\n options.offsetFrom !== undefined ||\n options.zOrder !== undefined;\n if (hasAttributes) {\n this.root.push({\n _attr: {\n ...(options.display !== undefined ? { \"w:display\": options.display } : {}),\n ...(options.offsetFrom !== undefined ? { \"w:offsetFrom\": options.offsetFrom } : {}),\n ...(options.zOrder !== undefined ? { \"w:zOrder\": options.zOrder } : {}),\n },\n });\n } else {\n this.root.push({ _attr: {} });\n }\n\n if (options.top) {\n this.root.push(createBorderElement(\"w:top\", options.top));\n }\n if (options.left) {\n this.root.push(createBorderElement(\"w:left\", options.left));\n }\n if (options.bottom) {\n this.root.push(createBorderElement(\"w:bottom\", options.bottom));\n }\n if (options.right) {\n this.root.push(createBorderElement(\"w:right\", options.right));\n }\n }\n}\n","/**\n * Page margin module for WordprocessingML section properties.\n *\n * Defines page margins for document sections.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { signedTwipsMeasureValue, twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure, UniversalMeasure } from \"@util/values\";\n\n/**\n * Options for configuring page margins.\n *\n * All measurements are in twips (1/20th of a point) or universal measure.\n *\n * @property top - Top margin\n * @property right - Right margin\n * @property bottom - Bottom margin\n * @property left - Left margin\n * @property header - Header margin (distance from top of page to header)\n * @property footer - Footer margin (distance from bottom of page to footer)\n * @property gutter - Gutter margin for binding\n */\nexport interface PageMarginAttributes {\n /** Top margin in twips or universal measure */\n readonly top?: number | UniversalMeasure;\n /** Right margin in twips or universal measure */\n readonly right?: number | PositiveUniversalMeasure;\n /** Bottom margin in twips or universal measure */\n readonly bottom?: number | UniversalMeasure;\n /** Left margin in twips or universal measure */\n readonly left?: number | PositiveUniversalMeasure;\n /** Header margin (distance from top of page to header) in twips or universal measure */\n readonly header?: number | PositiveUniversalMeasure;\n /** Footer margin (distance from bottom of page to footer) in twips or universal measure */\n readonly footer?: number | PositiveUniversalMeasure;\n /** Gutter margin for binding in twips or universal measure */\n readonly gutter?: number | PositiveUniversalMeasure;\n}\n\n/**\n * Creates page margins (pgMar) for a document section.\n *\n * This element specifies the page margins for all pages in a section,\n * including top, bottom, left, right, header, footer, and gutter margins.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PageMar\">\n * <xsd:attribute name=\"top\" type=\"ST_SignedTwipsMeasure\" use=\"required\"/>\n * <xsd:attribute name=\"right\" type=\"s:ST_TwipsMeasure\" use=\"required\"/>\n * <xsd:attribute name=\"bottom\" type=\"ST_SignedTwipsMeasure\" use=\"required\"/>\n * <xsd:attribute name=\"left\" type=\"s:ST_TwipsMeasure\" use=\"required\"/>\n * <xsd:attribute name=\"header\" type=\"s:ST_TwipsMeasure\" use=\"required\"/>\n * <xsd:attribute name=\"footer\" type=\"s:ST_TwipsMeasure\" use=\"required\"/>\n * <xsd:attribute name=\"gutter\" type=\"s:ST_TwipsMeasure\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create page margins with 1 inch margins (1440 twips = 1 inch)\n * createPageMargin(1440, 1440, 1440, 1440, 720, 720, 0);\n * ```\n */\nexport const createPageMargin = (\n top: number | UniversalMeasure,\n right: number | PositiveUniversalMeasure,\n bottom: number | UniversalMeasure,\n left: number | PositiveUniversalMeasure,\n header: number | PositiveUniversalMeasure,\n footer: number | PositiveUniversalMeasure,\n gutter: number | PositiveUniversalMeasure,\n): XmlComponent =>\n new BuilderElement<PageMarginAttributes>({\n attributes: {\n bottom: { key: \"w:bottom\", value: signedTwipsMeasureValue(bottom) },\n footer: { key: \"w:footer\", value: twipsMeasureValue(footer) },\n gutter: { key: \"w:gutter\", value: twipsMeasureValue(gutter) },\n header: { key: \"w:header\", value: twipsMeasureValue(header) },\n left: { key: \"w:left\", value: twipsMeasureValue(left) },\n right: { key: \"w:right\", value: twipsMeasureValue(right) },\n top: { key: \"w:top\", value: signedTwipsMeasureValue(top) },\n },\n name: \"w:pgMar\",\n });\n","/**\n * Page number module for WordprocessingML section properties.\n *\n * Defines page numbering format and starting value for document sections.\n *\n * Reference: http://officeopenxml.com/WPSectionPgNumType.php\n *\n * @module\n */\nimport type { NumberFormat } from \"@file/shared/number-format\";\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Specifies the separator character between chapter number and page number.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_ChapterSep\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"hyphen\"/>\n * <xsd:enumeration value=\"period\"/>\n * <xsd:enumeration value=\"colon\"/>\n * <xsd:enumeration value=\"emDash\"/>\n * <xsd:enumeration value=\"enDash\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PageNumberSeparator = {\n /** Hyphen separator (-) */\n HYPHEN: \"hyphen\",\n /** Period separator (.) */\n PERIOD: \"period\",\n /** Colon separator (:) */\n COLON: \"colon\",\n /** Em dash separator (—) */\n EM_DASH: \"emDash\",\n /** En dash separator (–) */\n EN_DASH: \"enDash\",\n} as const;\n\n/**\n * Options for configuring page numbering.\n *\n * @property start - Starting page number for the section\n * @property formatType - Number format (decimal, roman, letter, etc.)\n * @property separator - Separator between chapter and page number\n */\nexport interface PageNumberTypeAttributes {\n /** Starting page number for the section */\n readonly start?: number;\n /** Number format (decimal, roman, letter, etc., default: decimal) */\n readonly formatType?: (typeof NumberFormat)[keyof typeof NumberFormat];\n /** Separator between chapter and page number (default: hyphen) */\n readonly separator?: (typeof PageNumberSeparator)[keyof typeof PageNumberSeparator];\n /** Heading style ID for chapter numbering */\n readonly chapStyle?: number;\n}\n\n/**\n * Creates page numbering settings (pgNumType) for a document section.\n *\n * This element specifies the page numbering format and starting value\n * for all pages in a section.\n *\n * Reference: http://officeopenxml.com/WPSectionPgNumType.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PageNumber\">\n * <xsd:attribute name=\"fmt\" type=\"ST_NumberFormat\" use=\"optional\" default=\"decimal\"/>\n * <xsd:attribute name=\"start\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"chapStyle\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"chapSep\" type=\"ST_ChapterSep\" use=\"optional\" default=\"hyphen\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Start page numbering at 5 with lowercase roman numerals\n * createPageNumberType({\n * start: 5,\n * formatType: NumberFormat.LOWER_ROMAN\n * });\n * ```\n */\nexport const createPageNumberType = ({\n start,\n formatType,\n separator,\n chapStyle,\n}: PageNumberTypeAttributes): XmlComponent =>\n new BuilderElement<PageNumberTypeAttributes>({\n attributes: {\n chapStyle: {\n key: \"w:chapStyle\",\n value: chapStyle === undefined ? undefined : decimalNumber(chapStyle),\n },\n formatType: { key: \"w:fmt\", value: formatType },\n separator: { key: \"w:chapSep\", value: separator },\n start: {\n key: \"w:start\",\n value: start === undefined ? undefined : decimalNumber(start),\n },\n },\n name: \"w:pgNumType\",\n });\n","import { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\nimport { twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\n\n/**\n * This simple type specifies the orientation of all pages in the parent section. This information is used to determine the actual paper size to use when printing the file.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_PageOrientation_topic_ID0EKBK3.html\n *\n * ## XSD Schema\n *\n * ```xml\n * <xsd:simpleType name=\"ST_PageOrientation\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"portrait\"/>\n * <xsd:enumeration value=\"landscape\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PageOrientation = {\n /**\n * ## Portrait Mode\n *\n * Specifies that pages in this section shall be printed in portrait mode.\n */\n PORTRAIT: \"portrait\",\n /**\n * ## Landscape Mode\n *\n * Specifies that pages in this section shall be printed in landscape mode, which prints the page contents with a 90 degree rotation with respect to the normal page orientation.\n */\n LANDSCAPE: \"landscape\",\n} as const;\n\nexport interface PageSizeAttributes {\n /**\n * ## Page Width\n *\n * This attribute indicates the width (in twentieths of a point) for all pages in the current section.\n *\n * ### Example\n *\n * ```xml\n * <w:pgSz w:w=\"15840\" w:h=\"12240\" />\n * ```\n *\n * All pages in this section are displayed on a page that is 15840 twentieths of a point (11\") wide.\n *\n * The possible values for this attribute are defined by the ST_TwipsMeasure simple type (§2.18.105).\n */\n readonly width: number | PositiveUniversalMeasure;\n /**\n * ## Page Height\n *\n * Specifies the height (in twentieths of a point) for all pages in the current section.\n *\n * ### Example\n *\n * ```xml\n * <w:pgSz w:w=\"15840\" w:h=\"12240\" />\n * ```\n *\n * All pages in this section are displayed on a page that is `12240` twentieths of a point (`8.5\"`) tall.\n *\n * The possible values for this attribute are defined by the `ST_TwipsMeasure` simple type (§2.18.105).\n */\n readonly height: number | PositiveUniversalMeasure;\n /**\n * ## Page Orientation\n *\n * Specifies the orientation of all pages in this section.\n *\n * This information is used to determine the actual paper size to use on the printer.\n *\n * This implies that the actual paper size width and height are reversed for pages in this section. If this attribute is omitted, then portrait shall be implied.\n *\n * ### Example\n *\n * ```xml\n * <w:pgSz w:w=\"15840\" w:h=\"12240\" w:orient=\"landscape\" />\n * ```\n *\n * Although the page width is 11\", and page height is 8.5\", according to the `w` and `h` attributes, because the `orient` attribute is set to landscape, pages in this section are printed on 8.5x11\" paper in landscape mode.\n *\n * The possible values for this attribute are defined by the `ST_PageOrientation` simple type (§2.18.71).\n */\n readonly orientation?: (typeof PageOrientation)[keyof typeof PageOrientation];\n /**\n * ## Printer Paper Code\n *\n * Specifies a printer-specific paper code for the paper type, which shall be used by the printer for pages in this section.\n *\n * This code is stored to ensure the proper paper type is chosen if the specified paper size matches the sizes of multiple paper types supported by the current printer.\n *\n * It will be sent to the printer and used by the printer to determine the appropriate paper type to use when printing.\n *\n * This value is not interpreted or modified other than storing it as specified by the printer.\n *\n * The possible values for this attribute are defined by the `ST_DecimalNumber` simple type (§2.18.16).\n */\n readonly code?: number;\n}\n\n/**\n * This element specifies the properties (size and orientation) for all pages in the current section.\n *\n * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_pgSz_topic_ID0ENEDT.html?hl=pgsz%2Cpage%2Csize\n *\n * ## XSD Schema\n *\n * ```xml\n * <xsd:complexType name=\"CT_PageSz\">\n * <xsd:attribute name=\"w\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"h\" type=\"s:ST_TwipsMeasure\"/>\n * <xsd:attribute name=\"orient\" type=\"ST_PageOrientation\" use=\"optional\"/>\n * <xsd:attribute name=\"code\" type=\"ST_DecimalNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createPageSize = ({\n width,\n height,\n orientation,\n code,\n}: PageSizeAttributes): XmlComponent => {\n const widthTwips = twipsMeasureValue(width);\n const heightTwips = twipsMeasureValue(height);\n return new BuilderElement<PageSizeAttributes>({\n attributes: {\n code: { key: \"w:code\", value: code },\n height: {\n key: \"w:h\",\n value: orientation === PageOrientation.LANDSCAPE ? widthTwips : heightTwips,\n },\n orientation: { key: \"w:orient\", value: orientation },\n width: {\n key: \"w:w\",\n value: orientation === PageOrientation.LANDSCAPE ? heightTwips : widthTwips,\n },\n },\n name: \"w:pgSz\",\n });\n};\n","/**\n * Page text direction module for WordprocessingML section properties.\n *\n * Defines text flow direction for pages in a section.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Specifies the text flow direction for pages in a section.\n *\n * This controls whether text flows horizontally (left-to-right) or\n * vertically (top-to-bottom), commonly used for East Asian languages.\n */\nexport const PageTextDirectionType = {\n /** Left-to-right, top-to-bottom (standard Western text flow) */\n LEFT_TO_RIGHT_TOP_TO_BOTTOM: \"lrTb\",\n /** Top-to-bottom, right-to-left (vertical East Asian text flow) */\n TOP_TO_BOTTOM_RIGHT_TO_LEFT: \"tbRl\",\n} as const;\n\n/**\n * Represents text direction (textDirection) for pages in a section.\n *\n * This element specifies the direction and orientation of text flow\n * for all pages in a section.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * @example\n * ```typescript\n * // Horizontal text flow (left-to-right, top-to-bottom)\n * new PageTextDirection(PageTextDirectionType.LEFT_TO_RIGHT_TOP_TO_BOTTOM);\n *\n * // Vertical text flow (top-to-bottom, right-to-left)\n * new PageTextDirection(PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT);\n * ```\n */\nexport class PageTextDirection extends XmlComponent {\n public constructor(value: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType]) {\n super(\"w:textDirection\");\n\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n","/**\n * Section type module for WordprocessingML section properties.\n *\n * Defines how a section begins relative to the previous section.\n *\n * Reference: http://officeopenxml.com/WPsection.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Specifies the type of section break.\n *\n * This determines where the section begins relative to the previous section.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_SectionMark\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"nextPage\"/>\n * <xsd:enumeration value=\"nextColumn\"/>\n * <xsd:enumeration value=\"continuous\"/>\n * <xsd:enumeration value=\"evenPage\"/>\n * <xsd:enumeration value=\"oddPage\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const SectionType = {\n /** Section begins on the next page */\n NEXT_PAGE: \"nextPage\",\n /** Section begins on the next column */\n NEXT_COLUMN: \"nextColumn\",\n /** Section begins immediately following the previous section */\n CONTINUOUS: \"continuous\",\n /** Section begins on the next even-numbered page */\n EVEN_PAGE: \"evenPage\",\n /** Section begins on the next odd-numbered page */\n ODD_PAGE: \"oddPage\",\n} as const;\n\ninterface SectionTypeAttributes {\n readonly val: (typeof SectionType)[keyof typeof SectionType];\n}\n\n/**\n * Creates section type (type) for a document section.\n *\n * This element specifies the type of section break, which determines\n * where the new section begins relative to the previous section.\n *\n * Reference: http://officeopenxml.com/WPsection.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SectType\">\n * <xsd:attribute name=\"val\" type=\"ST_SectionMark\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a continuous section (no page break)\n * createSectionType(SectionType.CONTINUOUS);\n *\n * // Create a section that starts on next odd page\n * createSectionType(SectionType.ODD_PAGE);\n * ```\n */\nexport const createSectionType = (\n value: (typeof SectionType)[keyof typeof SectionType],\n): XmlComponent =>\n new BuilderElement<SectionTypeAttributes>({\n attributes: {\n val: { key: \"w:val\", value: value },\n },\n name: \"w:type\",\n });\n","// <xsd:complexType name=\"CT_SectPr\">\n// <xsd:sequence>\n// <xsd:group ref=\"EG_HdrFtrReferences\" minOccurs=\"0\" maxOccurs=\"6\"/>\n// <xsd:group ref=\"EG_SectPrContents\" minOccurs=\"0\"/>\n// <xsd:element name=\"sectPrChange\" type=\"CT_SectPrChange\" minOccurs=\"0\"/>\n// </xsd:sequence>\n// <xsd:attributeGroup ref=\"AG_SectPrAttributes\"/>\n// </xsd:complexType>\n\n// <xsd:group name=\"EG_SectPrContents\">\n// <xsd:sequence>\n// <xsd:element name=\"footnotePr\" type=\"CT_FtnProps\" minOccurs=\"0\"/>\n// <xsd:element name=\"endnotePr\" type=\"CT_EdnProps\" minOccurs=\"0\"/>\n// <xsd:element name=\"type\" type=\"CT_SectType\" minOccurs=\"0\"/>\n// <xsd:element name=\"pgSz\" type=\"CT_PageSz\" minOccurs=\"0\"/>\n// <xsd:element name=\"pgMar\" type=\"CT_PageMar\" minOccurs=\"0\"/>\n// <xsd:element name=\"paperSrc\" type=\"CT_PaperSource\" minOccurs=\"0\"/>\n// <xsd:element name=\"pgBorders\" type=\"CT_PageBorders\" minOccurs=\"0\"/>\n// <xsd:element name=\"lnNumType\" type=\"CT_LineNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"pgNumType\" type=\"CT_PageNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"cols\" type=\"CT_Columns\" minOccurs=\"0\"/>\n// <xsd:element name=\"formProt\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"vAlign\" type=\"CT_VerticalJc\" minOccurs=\"0\"/>\n// <xsd:element name=\"noEndnote\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"titlePg\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"textDirection\" type=\"CT_TextDirection\" minOccurs=\"0\"/>\n// <xsd:element name=\"bidi\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"rtlGutter\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"docGrid\" type=\"CT_DocGrid\" minOccurs=\"0\"/>\n// <xsd:element name=\"printerSettings\" type=\"CT_Rel\" minOccurs=\"0\"/>\n// </xsd:sequence>\n// </xsd:group>\n\n/**\n * Section properties module for WordprocessingML documents.\n *\n * Section properties define page layout including page size, margins,\n * headers/footers, columns, and page numbering.\n *\n * Reference: http://officeopenxml.com/WPsection.php\n *\n * @module\n */\nimport type { FooterWrapper } from \"@file/footer-wrapper\";\nimport type { HeaderWrapper } from \"@file/header-wrapper\";\nimport type { ChangedAttributesProperties } from \"@file/track-revision/track-revision\";\nimport { createVerticalAlign } from \"@file/vertical-align\";\nimport type { SectionVerticalAlign } from \"@file/vertical-align\";\nimport { BuilderElement, XmlComponent, onOffObj } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\nimport { createColumns } from \"./properties/columns\";\nimport type { ColumnsAttributes } from \"./properties/columns\";\nimport { createDocumentGrid } from \"./properties/doc-grid\";\nimport type { DocGridAttributesProperties } from \"./properties/doc-grid\";\nimport {\n createEndnoteProperties,\n createFootnoteProperties,\n} from \"./properties/footnote-endnote-properties\";\nimport type {\n EndnotePropertiesOptions,\n FootnotePropertiesOptions,\n} from \"./properties/footnote-endnote-properties\";\nimport {\n HeaderFooterReferenceType,\n HeaderFooterType,\n createHeaderFooterReference,\n} from \"./properties/header-footer-reference\";\nimport { createLineNumberType } from \"./properties/line-number\";\nimport type { LineNumberAttributes } from \"./properties/line-number\";\nimport { PageBorders } from \"./properties/page-borders\";\nimport type { PageBordersOptions } from \"./properties/page-borders\";\nimport { createPageMargin } from \"./properties/page-margin\";\nimport type { PageMarginAttributes } from \"./properties/page-margin\";\nimport { createPageNumberType } from \"./properties/page-number\";\nimport type { PageNumberTypeAttributes } from \"./properties/page-number\";\nimport { PageOrientation, createPageSize } from \"./properties/page-size\";\nimport type { PageSizeAttributes } from \"./properties/page-size\";\nimport { PageTextDirection } from \"./properties/page-text-direction\";\nimport type { PageTextDirectionType } from \"./properties/page-text-direction\";\nimport { createSectionType } from \"./properties/section-type\";\nimport type { SectionType } from \"./properties/section-type\";\n\n/**\n * Header/footer group for specifying different headers/footers\n * for default, first, and even pages.\n *\n * @property default - Header/footer for default pages (odd pages when even headers are used)\n * @property first - Header/footer for first page (requires titlePage setting)\n * @property even - Header/footer for even pages (requires evenAndOddHeaders setting)\n */\nexport interface HeaderFooterGroup<T> {\n /** Header/footer for default pages (odd pages when even headers are used) */\n readonly default?: T;\n /** Header/footer for first page (requires titlePage setting) */\n readonly first?: T;\n /** Header/footer for even pages (requires evenAndOddHeaders setting) */\n readonly even?: T;\n}\n\nexport interface SectionPropertiesOptionsBase {\n /** Page-level settings including size, margins, borders, and text direction */\n readonly page?: {\n /** Page size and orientation */\n readonly size?: Partial<PageSizeAttributes>;\n /** Page margins (top, bottom, left, right, header, footer, gutter) */\n readonly margin?: PageMarginAttributes;\n /** Page numbering format and starting value */\n readonly pageNumbers?: PageNumberTypeAttributes;\n /** Page border settings */\n readonly borders?: PageBordersOptions;\n /** Text flow direction (horizontal or vertical) */\n readonly textDirection?: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType];\n };\n /** Document grid settings for precise East Asian character layout */\n readonly grid?: Partial<DocGridAttributesProperties>;\n /** Header definitions for default, first, and even pages */\n readonly headerWrapperGroup?: HeaderFooterGroup<HeaderWrapper>;\n /** Footer definitions for default, first, and even pages */\n readonly footerWrapperGroup?: HeaderFooterGroup<FooterWrapper>;\n /** Line numbering settings for the section */\n readonly lineNumbers?: LineNumberAttributes;\n /** Whether first page has different header/footer */\n readonly titlePage?: boolean;\n /** Vertical alignment of text on page (top, center, bottom, justified) */\n readonly verticalAlign?: SectionVerticalAlign;\n /** Column layout settings (count, spacing, equal width) */\n readonly column?: ColumnsAttributes;\n /** Section break type (next page, continuous, even page, odd page) */\n readonly type?: (typeof SectionType)[keyof typeof SectionType];\n /** Whether to suppress endnotes in this section */\n readonly noEndnote?: boolean;\n /** Whether form protection is enabled for this section */\n readonly formProtection?: boolean;\n /** Whether text direction is right-to-left for this section */\n readonly bidi?: boolean;\n /** Whether gutter is on the right side for right-to-left sections */\n readonly rtlGutter?: boolean;\n /** Paper source settings for the section */\n readonly paperSrc?: {\n /** Paper tray for the first page */\n readonly first?: number;\n /** Paper tray for subsequent pages */\n readonly other?: number;\n };\n /** Footnote properties for the section */\n readonly footnotePr?: FootnotePropertiesOptions;\n /** Endnote properties for the section */\n readonly endnotePr?: EndnotePropertiesOptions;\n /** Printer settings reference ID */\n readonly printerSettingsId?: string;\n}\n\nexport type ISectionPropertiesChangeOptions = ChangedAttributesProperties &\n SectionPropertiesOptionsBase;\n\n/**\n * Options for configuring section properties.\n *\n * This type defines all possible configuration options for a document section,\n * including page layout, margins, headers/footers, and numbering.\n *\n * @property page - Page-level settings (size, margins, borders, numbering, text direction)\n * @property grid - Document grid settings for East Asian typography\n * @property headerWrapperGroup - Header definitions for default, first, and even pages\n * @property footerWrapperGroup - Footer definitions for default, first, and even pages\n * @property lineNumbers - Line numbering settings\n * @property titlePage - Whether first page has different header/footer\n * @property verticalAlign - Vertical alignment of text on page\n * @property column - Column layout settings\n * @property type - Section break type (next page, continuous, etc.)\n *\n * @see {@link SectionProperties}\n */\nexport type ISectionPropertiesOptions = {\n readonly revision?: ISectionPropertiesChangeOptions;\n} & SectionPropertiesOptionsBase;\n\n/**\n * Default margin values for sections (in twips).\n *\n * Standard margins are 1 inch (1440 twips) on all sides.\n * Header/footer margins are from page edge.\n *\n * @property TOP - Top margin: 1440 twips (1 inch)\n * @property RIGHT - Right margin: 1800 twips (1.25 inches)\n * @property BOTTOM - Bottom margin: 1440 twips (1 inch)\n * @property LEFT - Left margin: 1800 twips (1.25 inches)\n * @property HEADER - Header margin: 851 twips (0.59 inches)\n * @property FOOTER - Footer margin: 992 twips (0.69 inches)\n * @property GUTTER - Gutter margin: 0 twips\n */\nexport const sectionMarginDefaults = {\n /** Top margin: 1440 twips (1 inch) */\n TOP: 1440,\n /** Right margin: 1800 twips (1.25 inches) */\n RIGHT: 1800,\n /** Bottom margin: 1440 twips (1 inch) */\n BOTTOM: 1440,\n /** Left margin: 1800 twips (1.25 inches) */\n LEFT: 1800,\n /** Header margin from top: 851 twips */\n HEADER: 851,\n /** Footer margin from bottom: 992 twips */\n FOOTER: 992,\n /** Gutter margin for binding: 0 twips */\n GUTTER: 0,\n};\n\n/**\n * Default page size values (in twips, A4 portrait).\n *\n * A4 size is 210mm x 297mm (8.27\" x 11.69\").\n *\n * @property WIDTH - Page width: 11906 twips (8.27 inches, 210mm)\n * @property HEIGHT - Page height: 16838 twips (11.69 inches, 297mm)\n * @property ORIENTATION - Page orientation: portrait\n */\nexport const sectionPageSizeDefaults = {\n /** Page width: 11906 twips (8.27 inches, 210mm) */\n WIDTH: 11_906,\n /** Page height: 16838 twips (11.69 inches, 297mm) */\n HEIGHT: 16_838,\n /** Page orientation: portrait */\n ORIENTATION: PageOrientation.PORTRAIT,\n};\n\n/**\n * Represents section properties (sectPr) in a WordprocessingML document.\n *\n * Section properties define the page layout for a section of the document,\n * including page size, margins, headers/footers, columns, and page numbering.\n * A document can contain multiple sections with different properties.\n *\n * Reference: http://officeopenxml.com/WPsection.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SectPr\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_HdrFtrReferences\" minOccurs=\"0\" maxOccurs=\"6\"/>\n * <xsd:group ref=\"EG_SectPrContents\" minOccurs=\"0\"/>\n * <xsd:element name=\"sectPrChange\" type=\"CT_SectPrChange\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attributeGroup ref=\"AG_SectPrAttributes\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create section with custom page size and margins\n * new SectionProperties({\n * page: {\n * size: {\n * width: 12240,\n * height: 15840,\n * orientation: PageOrientation.PORTRAIT\n * },\n * margin: {\n * top: 1440,\n * right: 1440,\n * bottom: 1440,\n * left: 1440\n * },\n * pageNumbers: {\n * start: 1,\n * formatType: NumberFormat.DECIMAL\n * }\n * },\n * column: {\n * count: 2,\n * space: 720\n * }\n * });\n * ```\n */\nexport class SectionProperties extends XmlComponent {\n public constructor({\n page: {\n size: {\n width = sectionPageSizeDefaults.WIDTH,\n height = sectionPageSizeDefaults.HEIGHT,\n orientation = sectionPageSizeDefaults.ORIENTATION,\n } = {},\n margin: {\n top = sectionMarginDefaults.TOP,\n right = sectionMarginDefaults.RIGHT,\n bottom = sectionMarginDefaults.BOTTOM,\n left = sectionMarginDefaults.LEFT,\n header = sectionMarginDefaults.HEADER,\n footer = sectionMarginDefaults.FOOTER,\n gutter = sectionMarginDefaults.GUTTER,\n } = {},\n pageNumbers = {},\n borders,\n textDirection,\n } = {},\n grid: { linePitch = 312, charSpace = 0, type: gridType = \"lines\" } = {},\n headerWrapperGroup = {},\n footerWrapperGroup = {},\n lineNumbers,\n titlePage,\n verticalAlign,\n column,\n type,\n revision,\n noEndnote,\n formProtection,\n bidi,\n rtlGutter,\n paperSrc,\n footnotePr,\n endnotePr,\n printerSettingsId,\n }: ISectionPropertiesOptions = {}) {\n super(\"w:sectPr\");\n\n this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);\n this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);\n\n if (footnotePr) {\n this.root.push(createFootnoteProperties(footnotePr));\n }\n\n if (endnotePr) {\n this.root.push(createEndnoteProperties(endnotePr));\n }\n\n if (type) {\n this.root.push(createSectionType(type));\n }\n\n this.root.push(createPageSize({ height, orientation, width }));\n this.root.push(createPageMargin(top, right, bottom, left, header, footer, gutter));\n\n if (borders) {\n this.root.push(new PageBorders(borders));\n }\n\n if (lineNumbers) {\n this.root.push(createLineNumberType(lineNumbers));\n }\n\n this.root.push(createPageNumberType(pageNumbers));\n\n if (column) {\n this.root.push(createColumns(column));\n }\n\n if (verticalAlign) {\n this.root.push(createVerticalAlign(verticalAlign));\n }\n\n if (titlePage !== undefined) {\n this.root.push(onOffObj(\"w:titlePg\", titlePage));\n }\n\n if (textDirection) {\n this.root.push(new PageTextDirection(textDirection));\n }\n\n if (noEndnote !== undefined) {\n this.root.push(onOffObj(\"w:noEndnote\", noEndnote));\n }\n\n if (formProtection !== undefined) {\n this.root.push(onOffObj(\"w:formProt\", formProtection));\n }\n\n if (bidi !== undefined) {\n this.root.push(onOffObj(\"w:bidi\", bidi));\n }\n\n if (rtlGutter !== undefined) {\n this.root.push(onOffObj(\"w:rtlGutter\", rtlGutter));\n }\n\n if (paperSrc) {\n this.root.push(\n new BuilderElement<{ readonly first?: number; readonly other?: number }>({\n attributes: {\n first: {\n key: \"w:first\",\n value: paperSrc.first === undefined ? undefined : decimalNumber(paperSrc.first),\n },\n other: {\n key: \"w:other\",\n value: paperSrc.other === undefined ? undefined : decimalNumber(paperSrc.other),\n },\n },\n name: \"w:paperSrc\",\n }),\n );\n }\n\n if (printerSettingsId !== undefined) {\n this.root.push(\n new BuilderElement({\n attributes: { id: { key: \"r:id\", value: printerSettingsId } },\n name: \"w:printerSettings\",\n }),\n );\n }\n\n this.root.push(createDocumentGrid({ charSpace, linePitch, type: gridType }));\n\n if (revision) {\n this.root.push(new SectionPropertiesChange(revision));\n }\n }\n\n private addHeaderFooterGroup(\n type: (typeof HeaderFooterType)[keyof typeof HeaderFooterType],\n group: HeaderFooterGroup<HeaderWrapper> | HeaderFooterGroup<FooterWrapper>,\n ): void {\n if (group.default) {\n this.root.push(\n createHeaderFooterReference(type, {\n id: group.default.view.referenceId,\n type: HeaderFooterReferenceType.DEFAULT,\n }),\n );\n }\n\n if (group.first) {\n this.root.push(\n createHeaderFooterReference(type, {\n id: group.first.view.referenceId,\n type: HeaderFooterReferenceType.FIRST,\n }),\n );\n }\n\n if (group.even) {\n this.root.push(\n createHeaderFooterReference(type, {\n id: group.even.view.referenceId,\n type: HeaderFooterReferenceType.EVEN,\n }),\n );\n }\n }\n}\n\nexport class SectionPropertiesChange extends XmlComponent {\n public constructor(options: ISectionPropertiesChangeOptions) {\n super(\"w:sectPrChange\");\n this.root.push({\n _attr: { \"w:author\": options.author, \"w:date\": options.date, \"w:id\": options.id },\n });\n this.root.push(new SectionProperties(options));\n }\n}\n","/**\n * Document body module for WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPdocument.php\n *\n * @module\n */\nimport { Paragraph } from \"@file/paragraph\";\nimport { BaseXmlComponent, XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\n\nimport { SectionProperties } from \"./section-properties/section-properties\";\nimport type { ISectionPropertiesOptions } from \"./section-properties/section-properties\";\n\n/**\n * Represents the document body in a WordprocessingML document.\n *\n * The body element is the container for all block-level content in the document.\n * This includes paragraphs, tables, and section properties that define page layout.\n *\n * The body supports multiple sections, where each section (except the last one) must\n * have its section properties stored in a paragraph's properties at the end of that\n * section. The last section's properties are stored as a direct child of the body element.\n *\n * Reference: http://officeopenxml.com/WPdocument.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Body\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"sectPr\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CT_SectPr\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Body is typically created internally by the Document class\n * const doc = new Document({});\n * const body = doc.Body;\n *\n * // Add content to the body via Document.add()\n * doc.add(new Paragraph(\"Content in first section\"));\n *\n * // Add a new section\n * body.addSection({\n * page: {\n * size: { width: 12240, height: 15840 },\n * },\n * });\n *\n * // Content after addSection belongs to the new section\n * doc.add(new Paragraph(\"Content in second section\"));\n * ```\n */\nexport class Body extends XmlComponent {\n private readonly sections: SectionProperties[] = [];\n\n public constructor() {\n super(\"w:body\");\n }\n\n /**\n * Adds new section properties to the document body.\n *\n * Creates a new section by moving the previous section's properties into a paragraph\n * at the end of that section, and then adding the new section as the current section.\n *\n * According to the OOXML specification:\n * - Section properties for all sections except the last must be stored in a paragraph's\n * properties (pPr/sectPr) at the end of each section\n * - The last section's properties are stored as a direct child of the body element (w:body/w:sectPr)\n *\n * @param options - Section properties configuration (page size, margins, headers, footers, etc.)\n */\n public addSection(options: ISectionPropertiesOptions): void {\n const currentSection = this.sections.pop() as SectionProperties;\n this.root.push(this.createSectionParagraph(currentSection));\n\n this.sections.push(new SectionProperties(options));\n }\n\n /**\n * Prepares the body element for XML serialization.\n *\n * Ensures that the last section's properties are placed as a direct child of the body\n * element, as required by the OOXML specification.\n *\n * @param context - The XML serialization context\n * @returns The prepared XML object or undefined\n */\n public prepForXml(context: Context): IXmlableObject | undefined {\n if (this.sections.length === 1) {\n this.root.splice(0, 1);\n this.root.push(this.sections.pop() as SectionProperties);\n }\n\n return super.prepForXml(context);\n }\n\n /**\n * Adds a block-level component to the body.\n *\n * This method is used internally by the Document class to add paragraphs,\n * tables, and other block-level elements to the document body.\n *\n * @param component - The XML component to add (paragraph, table, etc.)\n */\n public push(component: BaseXmlComponent | string): void {\n this.root.push(component as BaseXmlComponent);\n }\n\n private createSectionParagraph(section: SectionProperties): Paragraph {\n const paragraph = new Paragraph({});\n paragraph.setSectionProperties(section);\n return paragraph;\n }\n}\n","/**\n * Column module for WordprocessingML section properties.\n *\n * Defines individual column properties within multi-column layouts.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Column\">\n * <xsd:attribute name=\"w\" type=\"s:ST_TwipsMeasure\" use=\"optional\" />\n * <xsd:attribute name=\"space\" type=\"s:ST_TwipsMeasure\" use=\"optional\" default=\"0\" />\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { twipsMeasureValue } from \"@util/values\";\nimport type { PositiveUniversalMeasure } from \"@util/values\";\n\n/**\n * Options for configuring individual column properties.\n *\n * @property width - Column width in twips or universal measure\n * @property space - Space after column in twips or universal measure (default: 0)\n */\nexport interface ColumnAttributes {\n /** Column width in twips or universal measure */\n readonly width: number | PositiveUniversalMeasure;\n /** Space after column in twips or universal measure (default: 0) */\n readonly space?: number | PositiveUniversalMeasure;\n}\n\n/**\n * Represents a column definition (col) for a multi-column section layout.\n *\n * This element defines the width and spacing for an individual column when\n * using unequal column widths in a section.\n *\n * Reference: http://officeopenxml.com/WPsectionPr.php\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * // Create a column with specific width and spacing\n * new Column({\n * width: 3000,\n * space: 720\n * });\n * ```\n */\nexport class Column extends XmlComponent {\n public constructor(options: ColumnAttributes) {\n super(\"w:col\");\n\n this.root.push({\n _attr: {\n \"w:w\": twipsMeasureValue(options.width),\n ...(options.space !== undefined ? { \"w:space\": twipsMeasureValue(options.space) } : {}),\n },\n });\n }\n}\n","/**\n * Document background module for WordprocessingML documents.\n *\n * This module provides functionality for setting document background colors,\n * theme-based backgrounds, and background images.\n *\n * Background images use VML (Vector Markup Language) via `v:background` and `v:fill`,\n * which is how Word implements page background images. The `v:fill` element references\n * the image through a relationship (`r:id`).\n *\n * Reference: http://officeopenxml.com/WPdocument.php\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport { hashedId } from \"@util/convenience-functions\";\nimport { hexColorValue, uCharHexNumber } from \"@util/values\";\nimport type { DataType } from \"undio\";\nimport { toUint8Array } from \"undio\";\n\n/**\n * Image options for document background.\n *\n * Specifies the image data and type for a background image.\n * The image is rendered as a full-page background using VML `v:fill`.\n */\nexport interface BackgroundImageOptions {\n /** Raw image data (Uint8Array, base64 string, etc.) */\n readonly data: DataType;\n /** Image format type */\n readonly type: \"jpg\" | \"png\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\";\n}\n\n/**\n * Options for creating a document background.\n *\n * @see {@link DocumentBackground}\n */\nexport interface DocumentBackgroundOptions {\n /** Background color in hex format (e.g., \"FF0000\" for red) */\n readonly color?: string;\n /** Theme color name (e.g., \"accent1\", \"dark1\") */\n readonly themeColor?: string;\n /** Theme shade value (darkens the theme color) */\n readonly themeShade?: string;\n /** Theme tint value (lightens the theme color) */\n readonly themeTint?: string;\n /** Background image rendered as a full-page VML fill */\n readonly image?: BackgroundImageOptions;\n}\n\ninterface ImageData {\n readonly fileName: string;\n readonly data: Uint8Array;\n readonly type: string;\n}\n\n/**\n * Represents a document background in a WordprocessingML document.\n *\n * The background element specifies the background color or theme color\n * for the document, and optionally a background image.\n *\n * Background images use VML `v:background` with `v:fill` to create a true\n * page background (not just a drawing behind text). This is the same approach\n * Word uses for page background images.\n *\n * Reference: http://officeopenxml.com/WPdocument.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Background\">\n * <xsd:sequence>\n * <xsd:element name=\"drawing\" type=\"CT_Drawing\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"color\" type=\"ST_HexColor\" use=\"optional\" default=\"auto\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * Note: Background images use VML (`v:background`/`v:fill`) rather than DrawingML\n * (`w:drawing`/`wp:anchor`), as VML is how Word implements true page backgrounds.\n *\n * @example\n * ```typescript\n * new DocumentBackground({ color: \"FFFF00\" }); // Yellow background\n * new DocumentBackground({ themeColor: \"accent1\" }); // Theme accent color\n * new DocumentBackground({\n * color: \"E8E8E8\",\n * image: { data: fs.readFileSync(\"bg.png\"), type: \"png\" },\n * });\n * ```\n */\nexport class DocumentBackground extends XmlComponent {\n private readonly imageData?: ImageData;\n\n public constructor(options: DocumentBackgroundOptions) {\n super(\"w:background\");\n\n const attr: Record<string, string> = {};\n if (options.color !== undefined) {\n attr[\"w:color\"] = hexColorValue(options.color);\n }\n if (options.themeColor !== undefined) {\n attr[\"w:themeColor\"] = options.themeColor;\n }\n if (options.themeShade !== undefined) {\n attr[\"w:themeShade\"] = uCharHexNumber(options.themeShade);\n }\n if (options.themeTint !== undefined) {\n attr[\"w:themeTint\"] = uCharHexNumber(options.themeTint);\n }\n this.root.push({ _attr: attr });\n\n if (options.image) {\n const rawData = toUint8Array(options.image.data) as Uint8Array;\n const hash = hashedId(rawData);\n this.imageData = {\n data: rawData,\n fileName: `${hash}.${options.image.type}`,\n type: options.image.type,\n };\n }\n }\n\n public prepForXml(context: Context): IXmlableObject | undefined {\n if (this.imageData) {\n // Register the image with the media collection for packaging\n context.file.media.addImage(this.imageData.fileName, {\n type: this.imageData.type as \"jpg\" | \"png\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\",\n data: this.imageData.data,\n fileName: this.imageData.fileName,\n transformation: {\n emus: { x: 0, y: 0 },\n pixels: { x: 0, y: 0 },\n },\n });\n\n // VML background with fill referencing the image via relationship\n // Word uses v:background + v:fill for true page background images\n this.root.push(\n new BuilderElement({\n attributes: {\n id: { key: \"id\", value: \"_x0000_s1025\" },\n },\n children: [\n new BuilderElement({\n attributes: {\n id: {\n key: \"r:id\",\n value: `{${this.imageData.fileName}}`,\n },\n title: {\n key: \"o:title\",\n value: this.imageData.fileName.split(\".\")[0],\n },\n recolor: { key: \"recolor\", value: \"t\" },\n type: { key: \"type\", value: \"frame\" },\n },\n name: \"v:fill\",\n }),\n ],\n name: \"v:background\",\n }),\n );\n }\n\n return super.prepForXml(context);\n }\n}\n","/**\n * Document module for WordprocessingML documents.\n *\n * Reference: http://officeopenxml.com/WPdocument.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport type { FileChild } from \"../file-child\";\nimport type { ConcreteHyperlink } from \"../paragraph\";\nimport { Body } from \"./body\";\nimport { buildDocumentAttributes } from \"./document-attributes\";\nimport { DocumentBackground } from \"./document-background\";\nimport type { DocumentBackgroundOptions } from \"./document-background\";\n\n/**\n * Options for creating a Document element.\n *\n * @property background - Optional background settings for the document\n *\n * @see {@link Document}\n */\nexport interface DocumentOptions {\n /** Optional background settings for the document */\n readonly background?: DocumentBackgroundOptions;\n}\n\n/**\n * Represents the main document element in a WordprocessingML document.\n *\n * The document element is the root element of the main document part. It contains\n * the body element which holds all the content of the document.\n *\n * Reference: http://officeopenxml.com/WPdocument.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"document\" type=\"CT_Document\"/>\n *\n * <xsd:complexType name=\"CT_Document\">\n * <xsd:complexContent>\n * <xsd:extension base=\"CT_DocumentBase\">\n * <xsd:sequence>\n * <xsd:element name=\"body\" type=\"CT_Body\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"conformance\" type=\"s:ST_ConformanceClass\"/>\n * <xsd:attribute ref=\"mc:Ignorable\" use=\"optional\" />\n * </xsd:extension>\n * </xsd:complexContent>\n * </xsd:complexType>\n *\n * <xsd:complexType name=\"CT_DocumentBase\">\n * <xsd:sequence>\n * <xsd:element name=\"background\" type=\"CT_Background\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a document with default options\n * const doc = new Document({});\n *\n * // Create a document with background\n * const doc = new Document({\n * background: {\n * color: \"FF0000\",\n * },\n * });\n *\n * // Add content to the document\n * doc.add(new Paragraph(\"Hello World\"));\n * doc.add(new Table({ rows: [...] }));\n * ```\n */\nexport class Document extends XmlComponent {\n public readonly body: Body;\n\n public constructor(options: DocumentOptions) {\n super(\"w:document\");\n this.root.push(\n buildDocumentAttributes(\n [\n \"wpc\",\n \"mc\",\n \"o\",\n \"r\",\n \"m\",\n \"v\",\n \"wp14\",\n \"wp\",\n \"w10\",\n \"w\",\n \"w14\",\n \"w15\",\n \"wpg\",\n \"wpi\",\n \"wne\",\n \"wps\",\n \"cx\",\n \"cx1\",\n \"cx2\",\n \"cx3\",\n \"cx4\",\n \"cx5\",\n \"cx6\",\n \"cx7\",\n \"cx8\",\n \"aink\",\n \"am3d\",\n \"w16cex\",\n \"w16cid\",\n \"w16\",\n \"w16sdtdh\",\n \"w16se\",\n ],\n \"w14 w15 wp14\",\n ),\n );\n this.body = new Body();\n if (options.background) {\n this.root.push(new DocumentBackground(options.background));\n }\n this.root.push(this.body);\n }\n\n /**\n * Adds a block-level element to the document body.\n *\n * @param item - The element to add (paragraph, table, table of contents, or hyperlink)\n * @returns The Document instance for method chaining\n */\n public add(item: FileChild | ConcreteHyperlink): Document {\n this.body.push(item);\n return this;\n }\n}\n","/**\n * Document wrapper module for WordprocessingML documents.\n *\n * This module provides wrappers that combine the main document/header/footer\n * views with their associated relationships, enabling proper management of\n * document parts and their references.\n *\n * @module\n */\nimport { Document } from \"./document\";\nimport type { DocumentOptions } from \"./document\";\nimport type { Endnotes } from \"./endnotes\";\nimport type { Footer } from \"./footer/footer\";\nimport type { FootNotes } from \"./footnotes\";\nimport type { Header } from \"./header/header\";\nimport { Relationships } from \"./relationships\";\nimport type { XmlComponent } from \"./xml-components\";\n\n/**\n * Interface for document view wrappers.\n *\n * ViewWrappers combine a document part (view) with its relationships,\n * providing a unified interface for managing document components.\n *\n * @property view - The document part (Document, Header, Footer, etc.)\n * @property relationships - The relationships associated with this view\n */\nexport interface ViewWrapper {\n readonly view: Document | Footer | Header | FootNotes | Endnotes | XmlComponent;\n readonly relationships: Relationships;\n}\n\n/**\n * Wrapper for the main document body.\n *\n * DocumentWrapper combines the main Document view with its Relationships,\n * managing the primary content of the .docx file along with references to\n * images, hyperlinks, and other linked resources.\n *\n * @example\n * ```typescript\n * const wrapper = new DocumentWrapper({\n * sections: [{\n * children: [new Paragraph(\"Hello World\")],\n * }],\n * });\n * ```\n */\nexport class DocumentWrapper implements ViewWrapper {\n private readonly document: Document;\n public readonly relationships: Relationships;\n\n public constructor(options: DocumentOptions) {\n this.document = new Document(options);\n this.relationships = new Relationships();\n }\n\n public get view(): Document {\n return this.document;\n }\n}\n","/**\n * Footnote continuation separator module for WordprocessingML documents.\n *\n * This module provides the continuation separator element that defines\n * the line used when footnotes span multiple pages.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a footnote continuation separator in WordprocessingML.\n *\n * ContinuationSeperator creates the separator line that appears when\n * footnotes continue from a previous page to the current page.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"continuationSeparator\" type=\"CT_Empty\" minOccurs=\"0\"/>\n * ```\n *\n * @internal\n */\nexport class ContinuationSeperator extends XmlComponent {\n public constructor() {\n super(\"w:continuationSeparator\");\n }\n}\n","/**\n * Footnote continuation separator run module for WordprocessingML documents.\n *\n * This module provides the run containing the continuation separator element.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { Run } from \"@file/paragraph\";\n\nimport { ContinuationSeperator } from \"./continuation-seperator\";\n\n/**\n * Represents a footnote continuation separator run in WordprocessingML.\n *\n * ContinuationSeperatorRun creates a run containing the continuation\n * separator element that defines the line used when footnotes continue\n * from a previous page.\n *\n * @internal\n */\nexport class ContinuationSeperatorRun extends Run {\n public constructor() {\n super({});\n\n this.extraChildren.push(new ContinuationSeperator());\n }\n}\n","/**\n * Footnote separator module for WordprocessingML documents.\n *\n * This module provides the separator element that defines the line\n * separating body text from footnotes.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a footnote separator in WordprocessingML.\n *\n * Seperator creates the separator line that appears between the main\n * document text and the footnote area at the bottom of the page.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"separator\" type=\"CT_Empty\" minOccurs=\"0\"/>\n * ```\n *\n * @internal\n */\nexport class Seperator extends XmlComponent {\n public constructor() {\n super(\"w:separator\");\n }\n}\n","/**\n * Footnote separator run module for WordprocessingML documents.\n *\n * This module provides the run containing the separator element.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { Run } from \"@file/paragraph\";\n\nimport { Seperator } from \"./seperator\";\n\n/**\n * Represents a footnote separator run in WordprocessingML.\n *\n * SeperatorRun creates a run containing the separator element that\n * defines the horizontal line between body text and footnotes.\n *\n * @internal\n */\nexport class SeperatorRun extends Run {\n public constructor() {\n super({});\n\n this.extraChildren.push(new Seperator());\n }\n}\n","import { EndnoteReference } from \"@file/paragraph/run/empty-children\";\nimport { Run } from \"@file/paragraph/run/run\";\n\nexport class EndnoteRefRun extends Run {\n public constructor() {\n super({\n style: \"EndnoteReference\",\n });\n\n this.extraChildren.push(new EndnoteReference());\n }\n}\n","import type { FileChild } from \"@file/file-child\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { EndnoteRefRun } from \"./run/endnote-ref-run\";\n\nexport const EndnoteType = {\n CONTINUATION_SEPARATOR: \"continuationSeparator\",\n\n SEPARATOR: \"separator\",\n} as const;\n\nexport interface EndnoteOptions {\n readonly id: number;\n readonly type?: (typeof EndnoteType)[keyof typeof EndnoteType];\n readonly children: readonly FileChild[];\n}\n\nexport class Endnote extends XmlComponent {\n public constructor(options: EndnoteOptions) {\n super(\"w:endnote\");\n const attr: Record<string, string | number> = { \"w:id\": options.id };\n if (options.type !== undefined) {\n attr[\"w:type\"] = options.type;\n }\n this.root.push({ _attr: attr });\n\n for (let i = 0; i < options.children.length; i++) {\n const child = options.children[i];\n\n if (i === 0 && \"addRunToFront\" in child) {\n (child as any).addRunToFront(new EndnoteRefRun());\n }\n\n this.root.push(child);\n }\n }\n}\n","import { XmlComponent } from \"@file/xml-components\";\n\nimport { ContinuationSeperatorRun } from \"../footnotes/footnote/run/continuation-seperator-run\";\nimport { SeperatorRun } from \"../footnotes/footnote/run/seperator-run\";\nimport { LineRuleType, Paragraph } from \"../paragraph\";\nimport { Endnote, EndnoteType } from \"./endnote/endnote\";\n\nexport class Endnotes extends XmlComponent {\n public constructor() {\n super(\"w:endnotes\");\n\n this.root.push({\n _attr: {\n \"mc:Ignorable\": \"w14 w15 wp14\",\n \"xmlns:m\": \"http://schemas.openxmlformats.org/officeDocument/2006/math\",\n \"xmlns:mc\": \"http://schemas.openxmlformats.org/markup-compatibility/2006\",\n \"xmlns:o\": \"urn:schemas-microsoft-com:office:office\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:v\": \"urn:schemas-microsoft-com:vml\",\n \"xmlns:w\": \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\",\n \"xmlns:w10\": \"urn:schemas-microsoft-com:office:word\",\n \"xmlns:w14\": \"http://schemas.microsoft.com/office/word/2010/wordml\",\n \"xmlns:w15\": \"http://schemas.microsoft.com/office/word/2012/wordml\",\n \"xmlns:wne\": \"http://schemas.microsoft.com/office/word/2006/wordml\",\n \"xmlns:wp\": \"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\",\n \"xmlns:wp14\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\",\n \"xmlns:wpc\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\",\n \"xmlns:wpg\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\",\n \"xmlns:wpi\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\",\n \"xmlns:wps\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\",\n },\n });\n\n const begin = new Endnote({\n children: [\n new Paragraph({\n children: [new SeperatorRun()],\n spacing: {\n after: 0,\n line: 240,\n lineRule: LineRuleType.AUTO,\n },\n }),\n ],\n id: -1,\n type: EndnoteType.SEPARATOR,\n });\n\n this.root.push(begin);\n\n const spacing = new Endnote({\n children: [\n new Paragraph({\n children: [new ContinuationSeperatorRun()],\n spacing: {\n after: 0,\n line: 240,\n lineRule: LineRuleType.AUTO,\n },\n }),\n ],\n id: 0,\n type: EndnoteType.CONTINUATION_SEPARATOR,\n });\n\n this.root.push(spacing);\n }\n\n public createEndnote(id: number, paragraph: readonly Paragraph[]): void {\n const endnote = new Endnote({\n children: paragraph,\n id: id,\n });\n\n this.root.push(endnote);\n }\n}\n","import type { ViewWrapper } from \"./document-wrapper\";\nimport { Endnotes } from \"./endnotes/endnotes\";\nimport { Relationships } from \"./relationships\";\n\nexport class EndnotesWrapper implements ViewWrapper {\n private readonly endnotes: Endnotes;\n public readonly relationships: Relationships;\n\n public constructor() {\n this.endnotes = new Endnotes();\n this.relationships = new Relationships();\n }\n\n public get view(): Endnotes {\n return this.endnotes;\n }\n}\n","/**\n * Shared base class for header and footer XML components.\n *\n * @module\n */\nimport { InitializableXmlComponent } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport {\n buildDocumentAttributes,\n type DocumentAttributeNamespace,\n} from \"./document/document-attributes\";\nimport type { FileChild } from \"./file-child\";\n\n/**\n * Namespace keys used by header elements.\n * @internal\n */\nexport const HEADER_NAMESPACES: readonly DocumentAttributeNamespace[] = [\n \"cx\",\n \"cx1\",\n \"cx2\",\n \"cx3\",\n \"cx4\",\n \"cx5\",\n \"cx6\",\n \"cx7\",\n \"cx8\",\n \"m\",\n \"mc\",\n \"o\",\n \"r\",\n \"v\",\n \"w\",\n \"w10\",\n \"w14\",\n \"w15\",\n \"w16cid\",\n \"w16se\",\n \"wne\",\n \"wp\",\n \"wp14\",\n \"wpc\",\n \"wpg\",\n \"wpi\",\n \"wps\",\n];\n\n/**\n * Namespace keys used by footer elements.\n * @internal\n */\nexport const FOOTER_NAMESPACES: readonly DocumentAttributeNamespace[] = [\n \"m\",\n \"mc\",\n \"o\",\n \"r\",\n \"v\",\n \"w\",\n \"w10\",\n \"w14\",\n \"w15\",\n \"wne\",\n \"wp\",\n \"wp14\",\n \"wpc\",\n \"wpg\",\n \"wpi\",\n \"wps\",\n];\n\n/**\n * Base class for header (w:hdr) and footer (w:ftr) XML components.\n *\n * Both share the same structure: namespace attributes, reference ID,\n * and block-level child elements. This base class eliminates the\n * duplication between Header and Footer internal implementations.\n */\nexport abstract class HeaderFooterBase extends InitializableXmlComponent {\n private readonly refId: number;\n\n protected constructor(\n tagName: string,\n referenceNumber: number,\n namespaces: readonly DocumentAttributeNamespace[],\n initContent?: XmlComponent,\n ) {\n super(tagName, initContent);\n\n this.refId = referenceNumber;\n if (!initContent) {\n this.root.push(buildDocumentAttributes(namespaces));\n }\n }\n\n public get referenceId(): number {\n return this.refId;\n }\n\n public add(item: FileChild): void {\n this.root.push(item);\n }\n}\n","/**\n * Footer module for WordprocessingML documents.\n *\n * Footers are repeated at the bottom of each page in a section.\n *\n * Reference: http://officeopenxml.com/WPfooters.php\n *\n * @module\n */\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { HeaderFooterBase, FOOTER_NAMESPACES } from \"../header-footer-base\";\n\n/**\n * Represents a footer in a WordprocessingML document.\n *\n * A footer is the portion of the document that appears at the bottom of each page in a section.\n * Footers can contain block-level elements such as paragraphs and tables. Each section can\n * have up to three different footers: first page, even pages, and odd pages.\n *\n * Reference: http://officeopenxml.com/WPfooters.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_HdrFtr\">\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * </xsd:complexType>\n *\n * <xsd:element name=\"ftr\" type=\"CT_HdrFtr\"/>\n * ```\n *\n * @example\n * ```typescript\n * // Create a simple footer with page numbers\n * const footer = new Footer(1);\n * footer.add(new Paragraph({\n * alignment: AlignmentType.CENTER,\n * children: [new TextRun(\"Page \"), PageNumber.CURRENT]\n * }));\n *\n * // Create a footer with a table\n * const footer = new Footer(2);\n * footer.add(new Table({\n * rows: [\n * new TableRow({\n * children: [new TableCell({ children: [new Paragraph(\"Footer Content\")] })]\n * })\n * ]\n * }));\n * ```\n */\nexport class Footer extends HeaderFooterBase {\n public constructor(referenceNumber: number, initContent?: XmlComponent) {\n super(\"w:ftr\", referenceNumber, FOOTER_NAMESPACES, initContent);\n }\n}\n","/**\n * Footer wrapper module for WordprocessingML documents.\n *\n * This module provides a wrapper for document footers, managing footer content\n * along with their relationships and media. Footers can be configured for\n * different pages (first, even, odd, default).\n *\n * Reference: http://officeopenxml.com/WPfooter.php\n *\n * @module\n */\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { HeaderFooterReferenceType } from \"./document\";\nimport type { ViewWrapper } from \"./document-wrapper\";\nimport type { FileChild } from \"./file-child\";\nimport { Footer } from \"./footer/footer\";\nimport type { Media } from \"./media\";\nimport { Relationships } from \"./relationships\";\n\n/**\n * Configuration for a document footer.\n *\n * @property footer - The FooterWrapper instance containing the footer content\n * @property type - The footer type (default, first page, even pages)\n */\nexport interface DocumentFooter {\n readonly footer: FooterWrapper;\n readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];\n}\n\n/**\n * Wrapper for document footers.\n *\n * FooterWrapper combines a Footer view with its Relationships and Media,\n * enabling footers to contain paragraphs, tables, images, and hyperlinks.\n * Each section can have multiple footers for different page types.\n *\n * Reference: http://officeopenxml.com/WPfooter.php\n *\n * @example\n * ```typescript\n * const footerWrapper = new FooterWrapper(media, 1);\n * footerWrapper.add(new Paragraph(\"Page Footer\"));\n * footerWrapper.add(new Table({\n * rows: [new TableRow({ children: [new TableCell({ children: [new Paragraph(\"Cell\")] })] })],\n * }));\n * ```\n */\nexport class FooterWrapper implements ViewWrapper {\n private readonly footer: Footer;\n public readonly relationships: Relationships;\n public readonly media: Media;\n\n public constructor(media: Media, referenceId: number, initContent?: XmlComponent) {\n this.media = media;\n this.footer = new Footer(referenceId, initContent);\n this.relationships = new Relationships();\n }\n\n public add(item: FileChild): void {\n this.footer.add(item);\n }\n\n public addChildElement(childElement: XmlComponent): void {\n this.footer.addChildElement(childElement);\n }\n\n public get view(): Footer {\n return this.footer;\n }\n}\n","/**\n * Footnote reference marker module for WordprocessingML documents.\n *\n * This module provides the automatic footnote reference marker that appears\n * at the beginning of footnote content.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents a footnote reference marker in WordprocessingML.\n *\n * FootnoteRef creates the automatic reference mark (typically a superscript\n * number) that appears at the beginning of the footnote content itself.\n * This corresponds to the w:footnoteRef element in OOXML.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"footnoteRef\" type=\"CT_Empty\" minOccurs=\"0\"/>\n * ```\n *\n * @internal\n */\nexport class FootnoteRef extends XmlComponent {\n public constructor() {\n super(\"w:footnoteRef\");\n }\n}\n","/**\n * Footnote Reference Run module for WordprocessingML documents.\n *\n * This module provides the footnote reference marker that appears\n * at the start of a footnote.\n *\n * @module\n */\nimport { Run } from \"@file/paragraph\";\n\nimport { FootnoteRef } from \"./footnote-ref\";\n\n/**\n * Represents a footnote reference run in a WordprocessingML document.\n *\n * FootnoteRefRun displays the footnote reference mark (usually a superscript\n * number) at the beginning of the footnote content.\n *\n * @internal\n */\nexport class FootnoteRefRun extends Run {\n public constructor() {\n super({\n style: \"FootnoteReference\",\n });\n\n this.extraChildren.push(new FootnoteRef());\n }\n}\n","/**\n * Footnote module for WordprocessingML documents.\n *\n * This module provides support for footnotes that appear at the bottom\n * of the page referenced from the main document text.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport type { FileChild } from \"@file/file-child\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { FootnoteRefRun } from \"./run/footnote-ref-run\";\n\n/**\n * Enumeration of footnote types.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @publicApi\n */\nexport const FootnoteType = {\n /** Separator line between body text and footnotes */\n SEPERATOR: \"separator\",\n /** Continuation separator for footnotes spanning pages */\n CONTINUATION_SEPERATOR: \"continuationSeparator\",\n} as const;\n\n/**\n * Options for creating a Footnote.\n *\n * @property id - Unique numeric identifier for this footnote\n * @property type - Type of footnote (separator, continuationSeparator, or normal)\n * @property children - Array of paragraphs that make up the footnote content\n *\n * @see {@link Footnote}\n */\nexport interface FootnoteOptions {\n /** Unique numeric identifier for this footnote */\n readonly id: number;\n /** Type of footnote (separator or continuation separator) */\n readonly type?: (typeof FootnoteType)[keyof typeof FootnoteType];\n /** Content of the footnote (paragraphs, tables, etc.) */\n readonly children: readonly FileChild[];\n}\n\n/**\n * Represents a footnote in a WordprocessingML document.\n *\n * Footnotes appear at the bottom of the page and are referenced\n * from the main document text using footnote reference marks.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FtnEdn\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"type\" type=\"ST_FtnEdn\"/>\n * <xsd:attribute name=\"id\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a footnote with content\n * const footnote = new Footnote({\n * id: 1,\n * children: [\n * new Paragraph({\n * children: [\n * new TextRun(\"This is the footnote content.\"),\n * ],\n * }),\n * ],\n * });\n * ```\n */\nexport class Footnote extends XmlComponent {\n public constructor(options: FootnoteOptions) {\n super(\"w:footnote\");\n const attr: Record<string, string | number> = { \"w:id\": options.id };\n if (options.type !== undefined) {\n attr[\"w:type\"] = options.type;\n }\n this.root.push({ _attr: attr });\n\n for (let i = 0; i < options.children.length; i++) {\n const child = options.children[i];\n\n if (i === 0 && \"addRunToFront\" in child) {\n (child as any).addRunToFront(new FootnoteRefRun());\n }\n\n this.root.push(child);\n }\n }\n}\n","/**\n * Footnotes module for WordprocessingML documents.\n *\n * This module manages the collection of footnotes in a document, including\n * separator and continuation separator footnotes that appear by default.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { LineRuleType, Paragraph } from \"../paragraph\";\nimport { Footnote, FootnoteType } from \"./footnote/footnote\";\nimport { ContinuationSeperatorRun } from \"./footnote/run/continuation-seperator-run\";\nimport { SeperatorRun } from \"./footnote/run/seperator-run\";\n\n/**\n * Represents the footnotes collection in a WordprocessingML document.\n *\n * FootNotes manages all footnotes in a document and automatically creates\n * the required separator and continuation separator footnotes. These special\n * footnotes define the line that separates body text from footnotes and the\n * line used when footnotes continue across pages.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Footnotes\">\n * <xsd:sequence maxOccurs=\"unbounded\">\n * <xsd:element name=\"footnote\" type=\"CT_FtnEdn\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // FootNotes is typically managed internally by the Document class\n * // Users create footnotes through the Document API\n * const doc = new Document({\n * sections: [{\n * children: [\n * new Paragraph({\n * children: [\n * new TextRun(\"Text with footnote\"),\n * new FootnoteReferenceRun(1),\n * ],\n * }),\n * ],\n * footnotes: {\n * 1: {\n * children: [new Paragraph(\"Footnote content\")],\n * },\n * },\n * }],\n * });\n * ```\n */\nexport class FootNotes extends XmlComponent {\n public constructor() {\n super(\"w:footnotes\");\n\n this.root.push({\n _attr: {\n \"mc:Ignorable\": \"w14 w15 wp14\",\n \"xmlns:m\": \"http://schemas.openxmlformats.org/officeDocument/2006/math\",\n \"xmlns:mc\": \"http://schemas.openxmlformats.org/markup-compatibility/2006\",\n \"xmlns:o\": \"urn:schemas-microsoft-com:office:office\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:v\": \"urn:schemas-microsoft-com:vml\",\n \"xmlns:w\": \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\",\n \"xmlns:w10\": \"urn:schemas-microsoft-com:office:word\",\n \"xmlns:w14\": \"http://schemas.microsoft.com/office/word/2010/wordml\",\n \"xmlns:w15\": \"http://schemas.microsoft.com/office/word/2012/wordml\",\n \"xmlns:wne\": \"http://schemas.microsoft.com/office/word/2006/wordml\",\n \"xmlns:wp\": \"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\",\n \"xmlns:wp14\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\",\n \"xmlns:wpc\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\",\n \"xmlns:wpg\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\",\n \"xmlns:wpi\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\",\n \"xmlns:wps\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\",\n },\n });\n\n const begin = new Footnote({\n children: [\n new Paragraph({\n children: [new SeperatorRun()],\n spacing: {\n after: 0,\n line: 240,\n lineRule: LineRuleType.AUTO,\n },\n }),\n ],\n id: -1,\n type: FootnoteType.SEPERATOR,\n });\n\n this.root.push(begin);\n\n const spacing = new Footnote({\n children: [\n new Paragraph({\n children: [new ContinuationSeperatorRun()],\n spacing: {\n after: 0,\n line: 240,\n lineRule: LineRuleType.AUTO,\n },\n }),\n ],\n id: 0,\n type: FootnoteType.CONTINUATION_SEPERATOR,\n });\n\n this.root.push(spacing);\n }\n\n /**\n * Creates and adds a new footnote to the collection.\n *\n * @param id - Unique numeric identifier for the footnote\n * @param paragraph - Array of paragraphs that make up the footnote content\n */\n public createFootNote(id: number, paragraph: readonly Paragraph[]): void {\n const footnote = new Footnote({\n children: paragraph,\n id: id,\n });\n\n this.root.push(footnote);\n }\n}\n","/**\n * Footnotes wrapper module for WordprocessingML documents.\n *\n * This module provides a wrapper for managing footnotes and their\n * associated relationships in a document.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport type { ViewWrapper } from \"./document-wrapper\";\nimport { FootNotes } from \"./footnotes/footnotes\";\nimport { Relationships } from \"./relationships\";\n\n/**\n * Wrapper class for managing footnotes in a document.\n *\n * Encapsulates the footnotes collection and its relationships,\n * implementing the ViewWrapper interface for consistent access.\n *\n * @example\n * ```typescript\n * const wrapper = new FootnotesWrapper();\n * const footnotes = wrapper.view;\n * const relationships = wrapper.relationships;\n * ```\n */\nexport class FootnotesWrapper implements ViewWrapper {\n private readonly footnotes: FootNotes;\n public readonly relationships: Relationships;\n\n public constructor() {\n this.footnotes = new FootNotes();\n this.relationships = new Relationships();\n }\n\n public get view(): FootNotes {\n return this.footnotes;\n }\n}\n","/**\n * Header and footer module for WordprocessingML documents.\n *\n * This module provides classes for creating headers and footers\n * that can be attached to document sections.\n *\n * Reference: http://officeopenxml.com/WPSectionHeaderFooters.php\n *\n * @module\n */\nimport type { SectionChild } from \"./section-child\";\n\n/**\n * Options for creating a header or footer.\n *\n * @see {@link Header}\n * @see {@link Footer}\n */\nexport interface HeaderOptions {\n /** The content elements (paragraphs, tables, etc.) for the header/footer */\n readonly children: readonly SectionChild[];\n}\n\n/**\n * Represents a document header.\n *\n * Headers appear at the top of each page in a section and can contain\n * paragraphs, tables, images, and other content.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * const header = new Header({\n * children: [\n * new Paragraph({ children: [new TextRun(\"Company Name\")] }),\n * ],\n * });\n * ```\n */\nexport class Header {\n public readonly options: HeaderOptions;\n\n public constructor(options: HeaderOptions = { children: [] }) {\n this.options = options;\n }\n}\n\n/**\n * Represents a document footer.\n *\n * Footers appear at the bottom of each page in a section and can contain\n * paragraphs, tables, images, and other content.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * const footer = new Footer({\n * children: [\n * new Paragraph({ children: [new TextRun(\"Page \"), PageNumber.CURRENT] }),\n * ],\n * });\n * ```\n */\nexport class Footer {\n public readonly options: HeaderOptions;\n\n public constructor(options: HeaderOptions = { children: [] }) {\n this.options = options;\n }\n}\n","/**\n * Header module for WordprocessingML documents.\n *\n * Headers are repeated at the top of each page in a section.\n *\n * Reference: http://officeopenxml.com/WPheaders.php\n *\n * @module\n */\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport { HeaderFooterBase, HEADER_NAMESPACES } from \"../header-footer-base\";\n\n/**\n * Represents a header in a WordprocessingML document.\n *\n * A header is the portion of the document that appears at the top of each page in a section.\n * Headers can contain block-level elements such as paragraphs and tables. Each section can\n * have up to three different headers: first page, even pages, and odd pages.\n *\n * Reference: http://officeopenxml.com/WPheaders.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_HdrFtr\">\n * <xsd:group ref=\"EG_BlockLevelElts\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * </xsd:complexType>\n *\n * <xsd:element name=\"hdr\" type=\"CT_HdrFtr\"/>\n * ```\n *\n * @example\n * ```typescript\n * // Create a simple header\n * const header = new Header(1);\n * header.add(new Paragraph(\"Company Name\"));\n *\n * // Create a header with a table\n * const header = new Header(2);\n * header.add(new Table({\n * rows: [\n * new TableRow({\n * children: [new TableCell({ children: [new Paragraph(\"Header Content\")] })]\n * })\n * ]\n * }));\n * ```\n */\nexport class Header extends HeaderFooterBase {\n public constructor(referenceNumber: number, initContent?: XmlComponent) {\n super(\"w:hdr\", referenceNumber, HEADER_NAMESPACES, initContent);\n }\n}\n","/**\n * Header wrapper module for WordprocessingML documents.\n *\n * This module provides a wrapper for document headers, managing header content\n * along with their relationships and media. Headers can be configured for\n * different pages (first, even, odd, default).\n *\n * Reference: http://officeopenxml.com/WPheader.php\n *\n * @module\n */\nimport type { XmlComponent } from \"@file/xml-components\";\n\nimport type { HeaderFooterReferenceType } from \"./document\";\nimport type { ViewWrapper } from \"./document-wrapper\";\nimport type { FileChild } from \"./file-child\";\nimport { Header } from \"./header/header\";\nimport type { Media } from \"./media\";\nimport { Relationships } from \"./relationships\";\n\n/**\n * Configuration for a document header.\n *\n * @property header - The HeaderWrapper instance containing the header content\n * @property type - The header type (default, first page, even pages)\n */\nexport interface DocumentHeader {\n readonly header: HeaderWrapper;\n readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];\n}\n\n/**\n * Wrapper for document headers.\n *\n * HeaderWrapper combines a Header view with its Relationships and Media,\n * enabling headers to contain paragraphs, tables, images, and hyperlinks.\n * Each section can have multiple headers for different page types.\n *\n * Reference: http://officeopenxml.com/WPheader.php\n *\n * @example\n * ```typescript\n * const headerWrapper = new HeaderWrapper(media, 1);\n * headerWrapper.add(new Paragraph(\"Page Header\"));\n * headerWrapper.add(new Table({\n * rows: [new TableRow({ children: [new TableCell({ children: [new Paragraph(\"Cell\")] })] })],\n * }));\n * ```\n */\nexport class HeaderWrapper implements ViewWrapper {\n private readonly header: Header;\n public readonly relationships: Relationships;\n public readonly media: Media;\n\n public constructor(media: Media, referenceId: number, initContent?: XmlComponent) {\n this.media = media;\n this.header = new Header(referenceId, initContent);\n this.relationships = new Relationships();\n }\n\n public add(item: FileChild): HeaderWrapper {\n this.header.add(item);\n\n return this;\n }\n\n public addChildElement(childElement: XmlComponent | string): void {\n this.header.addChildElement(childElement);\n }\n\n public get view(): Header {\n return this.header;\n }\n}\n","/**\n * Numbering level definitions module for WordprocessingML documents.\n *\n * This module defines the formatting and behavior of individual levels within\n * a numbered or bulleted list hierarchy.\n *\n * Reference: http://officeopenxml.com/WPnumbering-numFmt.php\n *\n * @module\n */\nimport { XmlComponent, numberValObj } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\nimport { AlignmentType } from \"../paragraph/formatting\";\nimport { ParagraphProperties } from \"../paragraph/properties\";\nimport type { LevelParagraphStylePropertiesOptions } from \"../paragraph/properties\";\nimport { RunProperties } from \"../paragraph/run/properties\";\nimport type { RunStylePropertiesOptions } from \"../paragraph/run/properties\";\n\n/**\n * Number format types for list levels.\n *\n * Defines the various numbering formats available for list levels, including\n * decimal, roman numerals, letters, and various international formats.\n *\n * Reference: http://officeopenxml.com/WPnumbering-numFmt.php\n *\n * @example\n * ```typescript\n * // Use decimal numbering (1, 2, 3...)\n * format: LevelFormat.DECIMAL\n *\n * // Use lowercase roman numerals (i, ii, iii...)\n * format: LevelFormat.LOWER_ROMAN\n *\n * // Use bullet points\n * format: LevelFormat.BULLET\n * ```\n *\n * @publicApi\n */\nexport const LevelFormat = {\n /** Decimal numbering (1, 2, 3...). */\n DECIMAL: \"decimal\",\n /** Uppercase roman numerals (I, II, III...). */\n UPPER_ROMAN: \"upperRoman\",\n /** Lowercase roman numerals (i, ii, iii...). */\n LOWER_ROMAN: \"lowerRoman\",\n /** Uppercase letters (A, B, C...). */\n UPPER_LETTER: \"upperLetter\",\n /** Lowercase letters (a, b, c...). */\n LOWER_LETTER: \"lowerLetter\",\n /** Ordinal numbers (1st, 2nd, 3rd...). */\n ORDINAL: \"ordinal\",\n /** Cardinal text (one, two, three...). */\n CARDINAL_TEXT: \"cardinalText\",\n /** Ordinal text (first, second, third...). */\n ORDINAL_TEXT: \"ordinalText\",\n /** Hexadecimal numbering. */\n HEX: \"hex\",\n /** Chicago Manual of Style numbering. */\n CHICAGO: \"chicago\",\n /** Ideograph digital numbering. */\n IDEOGRAPH__DIGITAL: \"ideographDigital\",\n /** Japanese counting system. */\n JAPANESE_COUNTING: \"japaneseCounting\",\n /** Japanese aiueo ordering. */\n AIUEO: \"aiueo\",\n /** Japanese iroha ordering. */\n IROHA: \"iroha\",\n /** Full-width decimal numbering. */\n DECIMAL_FULL_WIDTH: \"decimalFullWidth\",\n /** Half-width decimal numbering. */\n DECIMAL_HALF_WIDTH: \"decimalHalfWidth\",\n /** Japanese legal numbering. */\n JAPANESE_LEGAL: \"japaneseLegal\",\n /** Japanese digital ten thousand numbering. */\n JAPANESE_DIGITAL_TEN_THOUSAND: \"japaneseDigitalTenThousand\",\n /** Decimal numbers enclosed in circles. */\n DECIMAL_ENCLOSED_CIRCLE: \"decimalEnclosedCircle\",\n /** Full-width decimal numbering variant 2. */\n DECIMAL_FULL_WIDTH2: \"decimalFullWidth2\",\n /** Full-width aiueo ordering. */\n AIUEO_FULL_WIDTH: \"aiueoFullWidth\",\n /** Full-width iroha ordering. */\n IROHA_FULL_WIDTH: \"irohaFullWidth\",\n /** Decimal with leading zeros. */\n DECIMAL_ZERO: \"decimalZero\",\n /** Bullet points. */\n BULLET: \"bullet\",\n /** Korean ganada ordering. */\n GANADA: \"ganada\",\n /** Korean chosung ordering. */\n CHOSUNG: \"chosung\",\n /** Decimal enclosed with fullstop. */\n DECIMAL_ENCLOSED_FULLSTOP: \"decimalEnclosedFullstop\",\n /** Decimal enclosed in parentheses. */\n DECIMAL_ENCLOSED_PARENTHESES: \"decimalEnclosedParen\",\n /** Decimal enclosed in circles (Chinese). */\n DECIMAL_ENCLOSED_CIRCLE_CHINESE: \"decimalEnclosedCircleChinese\",\n /** Ideograph enclosed in circles. */\n IDEOGRAPH_ENCLOSED_CIRCLE: \"ideographEnclosedCircle\",\n /** Traditional ideograph numbering. */\n IDEOGRAPH_TRADITIONAL: \"ideographTraditional\",\n /** Ideograph zodiac numbering. */\n IDEOGRAPH_ZODIAC: \"ideographZodiac\",\n /** Traditional ideograph zodiac numbering. */\n IDEOGRAPH_ZODIAC_TRADITIONAL: \"ideographZodiacTraditional\",\n /** Taiwanese counting system. */\n TAIWANESE_COUNTING: \"taiwaneseCounting\",\n /** Traditional ideograph legal numbering. */\n IDEOGRAPH_LEGAL_TRADITIONAL: \"ideographLegalTraditional\",\n /** Taiwanese counting thousand system. */\n TAIWANESE_COUNTING_THOUSAND: \"taiwaneseCountingThousand\",\n /** Taiwanese digital numbering. */\n TAIWANESE_DIGITAL: \"taiwaneseDigital\",\n /** Chinese counting system. */\n CHINESE_COUNTING: \"chineseCounting\",\n /** Simplified Chinese legal numbering. */\n CHINESE_LEGAL_SIMPLIFIED: \"chineseLegalSimplified\",\n /** Chinese counting thousand system. */\n CHINESE_COUNTING_THOUSAND: \"chineseCountingThousand\",\n /** Korean digital numbering. */\n KOREAN_DIGITAL: \"koreanDigital\",\n /** Korean counting system. */\n KOREAN_COUNTING: \"koreanCounting\",\n /** Korean legal numbering. */\n KOREAN_LEGAL: \"koreanLegal\",\n /** Korean digital numbering variant 2. */\n KOREAN_DIGITAL2: \"koreanDigital2\",\n /** Vietnamese counting system. */\n VIETNAMESE_COUNTING: \"vietnameseCounting\",\n /** Russian lowercase numbering. */\n RUSSIAN_LOWER: \"russianLower\",\n /** Russian uppercase numbering. */\n RUSSIAN_UPPER: \"russianUpper\",\n /** No numbering. */\n NONE: \"none\",\n /** Number enclosed in dashes. */\n NUMBER_IN_DASH: \"numberInDash\",\n /** Hebrew numbering variant 1. */\n HEBREW1: \"hebrew1\",\n /** Hebrew numbering variant 2. */\n HEBREW2: \"hebrew2\",\n /** Arabic alpha numbering. */\n ARABIC_ALPHA: \"arabicAlpha\",\n /** Arabic abjad numbering. */\n ARABIC_ABJAD: \"arabicAbjad\",\n /** Hindi vowels. */\n HINDI_VOWELS: \"hindiVowels\",\n /** Hindi consonants. */\n HINDI_CONSONANTS: \"hindiConsonants\",\n /** Hindi numbers. */\n HINDI_NUMBERS: \"hindiNumbers\",\n /** Hindi counting system. */\n HINDI_COUNTING: \"hindiCounting\",\n /** Thai letters. */\n THAI_LETTERS: \"thaiLetters\",\n /** Thai numbers. */\n THAI_NUMBERS: \"thaiNumbers\",\n /** Thai counting system. */\n THAI_COUNTING: \"thaiCounting\",\n /** Thai Baht text. */\n BAHT_TEXT: \"bahtText\",\n /** Dollar text. */\n DOLLAR_TEXT: \"dollarText\",\n /** Custom numbering format. */\n CUSTOM: \"custom\",\n} as const;\n\n/**\n * Number format specification for a level.\n *\n * Specifies the numbering format to use (decimal, roman, letter, etc.).\n */\nclass NumberFormat extends XmlComponent {\n public constructor(value: string) {\n super(\"w:numFmt\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Level text template for displaying the numbering.\n *\n * The text can include placeholders like %1, %2, etc. to reference\n * numbering from different levels.\n */\nclass LevelText extends XmlComponent {\n public constructor(value: string) {\n super(\"w:lvlText\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Alignment specification for level numbering.\n */\nclass LevelJc extends XmlComponent {\n public constructor(value: (typeof AlignmentType)[keyof typeof AlignmentType]) {\n super(\"w:lvlJc\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Suffix types for list levels.\n *\n * Defines what follows the numbering text (tab, space, or nothing).\n *\n * @example\n * ```typescript\n * // Add a tab after the numbering\n * suffix: LevelSuffix.TAB\n *\n * // Add a space after the numbering\n * suffix: LevelSuffix.SPACE\n *\n * // No separator after the numbering\n * suffix: LevelSuffix.NOTHING\n * ```\n *\n * @publicApi\n */\nexport const LevelSuffix = {\n /** No separator after the numbering. */\n NOTHING: \"nothing\",\n /** Space character after the numbering. */\n SPACE: \"space\",\n /** Tab character after the numbering. */\n TAB: \"tab\",\n} as const;\n\n/**\n * Options for configuring a numbering level.\n *\n * @property level - Level index (0-8)\n * @property format - Number format type (decimal, roman, letter, etc.)\n * @property text - Level text template with placeholders like %1, %2\n * @property alignment - Text alignment for the numbering\n * @property start - Starting number for this level\n * @property suffix - Character(s) following the numbering (tab, space, nothing)\n * @property isLegalNumberingStyle - Use legal numbering style\n * @property style - Run and paragraph style properties\n */\nexport interface LevelsOptions {\n /** Level index (0-8). */\n readonly level: number;\n /** Number format type (decimal, roman, letter, bullet, etc.). */\n readonly format?: (typeof LevelFormat)[keyof typeof LevelFormat];\n /** Level text template with placeholders like %1, %2. */\n readonly text?: string;\n /** Text alignment for the numbering. */\n readonly alignment?: (typeof AlignmentType)[keyof typeof AlignmentType];\n /** Starting number for this level. */\n readonly start?: number;\n /** Character(s) following the numbering. */\n readonly suffix?: (typeof LevelSuffix)[keyof typeof LevelSuffix];\n /** Use legal numbering style (e.g., 1.1.1). */\n readonly isLegalNumberingStyle?: boolean;\n /** Run and paragraph style properties. */\n readonly style?: {\n /** Run style properties for the numbering text. */\n readonly run?: RunStylePropertiesOptions;\n /** Paragraph style properties for the level. */\n readonly paragraph?: LevelParagraphStylePropertiesOptions;\n };\n}\n\n/**\n * Suffix specification for a level.\n *\n * Defines what character(s) follow the numbering text.\n */\nclass Suffix extends XmlComponent {\n public constructor(value: (typeof LevelSuffix)[keyof typeof LevelSuffix]) {\n super(\"w:suff\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Legal numbering style flag.\n *\n * When enabled, creates multi-level legal numbering like 1.1.1.\n *\n * Reference: http://officeopenxml.com/WPnumbering-isLgl.php\n */\nclass IsLegalNumberingStyle extends XmlComponent {\n public constructor() {\n super(\"w:isLgl\");\n }\n}\n\n/**\n * Base class for numbering level definitions.\n *\n * Defines the formatting and behavior of a single level in a multi-level\n * numbering scheme. Each level can have its own numbering format, text template,\n * alignment, and styling.\n *\n * Reference: http://officeopenxml.com/WPnumbering-numFmt.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Lvl\">\n * <xsd:sequence>\n * <xsd:element name=\"start\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"numFmt\" type=\"CT_NumFmt\" minOccurs=\"0\"/>\n * <xsd:element name=\"lvlRestart\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"pStyle\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"isLgl\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"suff\" type=\"CT_LevelSuffix\" minOccurs=\"0\"/>\n * <xsd:element name=\"lvlText\" type=\"CT_LevelText\" minOccurs=\"0\"/>\n * <xsd:element name=\"lvlPicBulletId\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"legacy\" type=\"CT_LvlLegacy\" minOccurs=\"0\"/>\n * <xsd:element name=\"lvlJc\" type=\"CT_Jc\" minOccurs=\"0\"/>\n * <xsd:element name=\"pPr\" type=\"CT_PPrGeneral\" minOccurs=\"0\"/>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"ilvl\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * <xsd:attribute name=\"tplc\" type=\"ST_LongHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"tentative\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport class LevelBase extends XmlComponent {\n private readonly paragraphProperties: ParagraphProperties;\n private readonly runProperties: RunProperties;\n\n /**\n * Creates a new numbering level.\n *\n * @param options - Level configuration options\n * @throws Error if level is greater than 9 (Word limitation)\n */\n public constructor({\n level,\n format,\n text,\n alignment = AlignmentType.START,\n start = 1,\n style,\n suffix,\n isLegalNumberingStyle,\n }: LevelsOptions) {\n super(\"w:lvl\");\n\n this.root.push(numberValObj(\"w:start\", decimalNumber(start)));\n\n if (format) {\n this.root.push(new NumberFormat(format));\n }\n\n if (suffix) {\n this.root.push(new Suffix(suffix));\n }\n\n if (isLegalNumberingStyle) {\n this.root.push(new IsLegalNumberingStyle());\n }\n\n if (text) {\n this.root.push(new LevelText(text));\n }\n\n this.root.push(new LevelJc(alignment));\n\n this.paragraphProperties = new ParagraphProperties(style && style.paragraph);\n this.runProperties = new RunProperties(style && style.run);\n\n this.root.push(this.paragraphProperties);\n this.root.push(this.runProperties);\n\n this.root.push({\n _attr: {\n \"w:ilvl\": decimalNumber(Math.min(level, 9)),\n \"w15:tentative\": 1,\n },\n });\n }\n}\n\n/**\n * Represents a numbering level within an abstract numbering definition.\n *\n * This is the standard level definition used in abstract numbering definitions.\n * Each abstract numbering definition can contain up to 9 levels (0-8).\n *\n * Reference: http://officeopenxml.com/WPnumbering-numFmt.php\n *\n * @example\n * ```typescript\n * // Create a decimal numbered level\n * const level = new Level({\n * level: 0,\n * format: LevelFormat.DECIMAL,\n * text: \"%1.\",\n * alignment: AlignmentType.LEFT,\n * start: 1,\n * });\n *\n * // Create a bullet level with custom styling\n * const bulletLevel = new Level({\n * level: 0,\n * format: LevelFormat.BULLET,\n * text: \"\\u2022\",\n * alignment: AlignmentType.LEFT,\n * style: {\n * paragraph: {\n * indent: { left: 720, hanging: 360 },\n * },\n * },\n * });\n * ```\n */\nexport class Level extends LevelBase {\n // This is the level that sits under abstractNum\n}\n\n/**\n * Represents a numbering level used in level overrides.\n *\n * This level type is used when overriding specific levels within a\n * concrete numbering instance.\n */\nexport class LevelForOverride extends LevelBase {}\n","/**\n * Multi-level type definitions for WordprocessingML documents.\n *\n * Defines the type of numbering structure (single-level, multi-level, or hybrid).\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents the multi-level type of a numbering definition.\n *\n * The multi-level type specifies whether the numbering definition uses a single\n * level, multiple levels, or a hybrid approach.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_MultiLevelType\">\n * <xsd:attribute name=\"val\" type=\"ST_MultiLevelType\" use=\"required\"/>\n * </xsd:complexType>\n *\n * <xsd:simpleType name=\"ST_MultiLevelType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"singleLevel\"/>\n * <xsd:enumeration value=\"multilevel\"/>\n * <xsd:enumeration value=\"hybridMultilevel\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a hybrid multi-level numbering\n * const multiLevel = new MultiLevelType(\"hybridMultilevel\");\n *\n * // Create a single-level numbering\n * const singleLevel = new MultiLevelType(\"singleLevel\");\n * ```\n */\nexport class MultiLevelType extends XmlComponent {\n /**\n * Creates a new multi-level type specification.\n *\n * @param value - The multi-level type: \"singleLevel\", \"multilevel\", or \"hybridMultilevel\"\n */\n public constructor(value: string) {\n super(\"w:multiLevelType\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n","/**\n * Abstract numbering definitions module for WordprocessingML documents.\n *\n * Abstract numbering definitions contain the formatting and style information\n * that can be shared across multiple numbering instances.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\nimport { Level } from \"./level\";\nimport type { LevelsOptions } from \"./level\";\nimport { MultiLevelType } from \"./multi-level-type\";\n\n/**\n * Represents an abstract numbering definition in a WordprocessingML document.\n *\n * Abstract numbering definitions define the formatting and style of numbered or\n * bulleted lists that can be referenced by concrete numbering instances.\n * Each abstract definition can contain up to 9 levels.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_AbstractNum\">\n * <xsd:sequence>\n * <xsd:element name=\"nsid\" type=\"CT_LongHexNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"multiLevelType\" type=\"CT_MultiLevelType\" minOccurs=\"0\"/>\n * <xsd:element name=\"tmpl\" type=\"CT_LongHexNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"name\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"styleLink\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"numStyleLink\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"lvl\" type=\"CT_Lvl\" minOccurs=\"0\" maxOccurs=\"9\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"abstractNumId\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create an abstract numbering definition with multiple levels\n * const abstractNumbering = new AbstractNumbering(1, [\n * {\n * level: 0,\n * format: LevelFormat.DECIMAL,\n * text: \"%1.\",\n * alignment: AlignmentType.LEFT,\n * },\n * {\n * level: 1,\n * format: LevelFormat.LOWER_LETTER,\n * text: \"%2)\",\n * alignment: AlignmentType.LEFT,\n * },\n * ]);\n * ```\n */\nexport class AbstractNumbering extends XmlComponent {\n /** The unique identifier for this abstract numbering definition. */\n public readonly id: number;\n\n /**\n * Creates a new abstract numbering definition.\n *\n * @param id - Unique identifier for this abstract numbering definition\n * @param levelOptions - Array of level definitions (up to 9 levels)\n */\n public constructor(id: number, levelOptions: readonly LevelsOptions[]) {\n super(\"w:abstractNum\");\n this.root.push({\n _attr: {\n \"w:abstractNumId\": decimalNumber(id),\n \"w15:restartNumberingAfterBreak\": 0,\n },\n });\n this.root.push(new MultiLevelType(\"hybridMultilevel\"));\n this.id = id;\n\n for (const option of levelOptions) {\n this.root.push(new Level(option));\n }\n }\n}\n","/**\n * Concrete numbering instances module for WordprocessingML documents.\n *\n * Concrete numbering instances reference abstract numbering definitions and\n * can override specific level settings. Each paragraph references a concrete\n * numbering instance to apply list formatting.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Reference to an abstract numbering definition.\n */\nclass AbstractNumId extends XmlComponent {\n public constructor(value: number) {\n super(\"w:abstractNumId\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Options for overriding a specific level in a numbering instance.\n *\n * @property num - The level number to override (0-8)\n * @property start - The starting number for this level\n */\ninterface OverrideLevel {\n /** The level number to override (0-8). */\n readonly num: number;\n /** The starting number for this level. */\n readonly start?: number;\n}\n\n/**\n * Options for creating a concrete numbering instance.\n *\n * @property numId - Unique identifier for this numbering instance\n * @property abstractNumId - ID of the abstract numbering definition to reference\n * @property reference - Reference name for this numbering instance\n * @property instance - Instance number for tracking multiple uses\n * @property overrideLevels - Array of level overrides to customize specific levels\n */\nexport interface ConcreteNumberingOptions {\n /** Unique identifier for this numbering instance. */\n readonly numId: number;\n /** ID of the abstract numbering definition to reference. */\n readonly abstractNumId: number;\n /** Reference name for this numbering instance. */\n readonly reference: string;\n /** Instance number for tracking multiple uses. */\n readonly instance: number;\n /** Array of level overrides to customize specific levels. */\n readonly overrideLevels?: readonly OverrideLevel[];\n}\n\n/**\n * Represents a concrete numbering instance in a WordprocessingML document.\n *\n * A concrete numbering instance references an abstract numbering definition and\n * can override specific levels. Paragraphs reference concrete numbering instances\n * to apply list formatting.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Num\">\n * <xsd:sequence>\n * <xsd:element name=\"abstractNumId\" type=\"CT_DecimalNumber\" minOccurs=\"1\"/>\n * <xsd:element name=\"lvlOverride\" type=\"CT_NumLvl\" minOccurs=\"0\" maxOccurs=\"9\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"numId\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a concrete numbering instance\n * const concreteNumbering = new ConcreteNumbering({\n * numId: 1,\n * abstractNumId: 0,\n * reference: \"my-numbering\",\n * instance: 0,\n * overrideLevels: [\n * {\n * num: 0,\n * start: 5, // Start numbering at 5 instead of 1\n * },\n * ],\n * });\n * ```\n */\nexport class ConcreteNumbering extends XmlComponent {\n /** The unique identifier for this numbering instance. */\n public readonly numId: number;\n /** The reference name for this numbering instance. */\n public readonly reference: string;\n /** The instance number for tracking multiple uses. */\n public readonly instance: number;\n\n /**\n * Creates a new concrete numbering instance.\n *\n * @param options - Configuration options for the numbering instance\n */\n public constructor(options: ConcreteNumberingOptions) {\n super(\"w:num\");\n\n this.numId = options.numId;\n this.reference = options.reference;\n this.instance = options.instance;\n\n this.root.push({ _attr: { \"w:numId\": decimalNumber(options.numId) } });\n\n this.root.push(new AbstractNumId(decimalNumber(options.abstractNumId)));\n\n if (options.overrideLevels && options.overrideLevels.length) {\n for (const level of options.overrideLevels) {\n this.root.push(new LevelOverride(level.num, level.start));\n }\n }\n }\n}\n\n/**\n * Represents a level override in a concrete numbering instance.\n *\n * Level overrides allow customization of specific levels within a numbering\n * instance, such as changing the starting number.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_NumLvl\">\n * <xsd:sequence>\n * <xsd:element name=\"startOverride\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"lvl\" type=\"CT_Lvl\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"ilvl\" type=\"ST_DecimalNumber\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport class LevelOverride extends XmlComponent {\n /**\n * Creates a new level override.\n *\n * @param levelNum - The level number to override (0-8)\n * @param start - Optional starting number for the level\n */\n public constructor(levelNum: number, start?: number) {\n super(\"w:lvlOverride\");\n this.root.push({ _attr: { \"w:ilvl\": levelNum } });\n if (start !== undefined) {\n this.root.push(new StartOverride(start));\n }\n }\n}\n\nclass StartOverride extends XmlComponent {\n public constructor(start: number) {\n super(\"w:startOverride\");\n this.root.push({ _attr: { \"w:val\": start } });\n }\n}\n","/**\n * Numbering module for WordprocessingML documents.\n *\n * Numbering provides support for numbered and bulleted lists.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * @see https://stackoverflow.com/questions/58622437/purpose-of-abstractnum-and-numberinginstance\n *\n * @module\n */\nimport { AlignmentType } from \"@file/paragraph\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { Context, IXmlableObject } from \"@file/xml-components\";\nimport {\n abstractNumUniqueNumericIdGen,\n concreteNumUniqueNumericIdGen,\n convertInchesToTwip,\n} from \"@util/convenience-functions\";\n\nimport { buildDocumentAttributes } from \"../document/document-attributes\";\nimport { AbstractNumbering } from \"./abstract-numbering\";\nimport { LevelFormat } from \"./level\";\nimport type { LevelsOptions } from \"./level\";\nimport { ConcreteNumbering } from \"./num\";\n\n/**\n * Options for configuring numbering definitions.\n *\n * @property config - Array of numbering configurations\n *\n * @see {@link Numbering}\n */\nexport interface NumberingOptions {\n /** Array of numbering configurations, each with levels and a reference name. */\n readonly config: readonly {\n /** Array of level definitions for this numbering configuration. */\n readonly levels: readonly LevelsOptions[];\n /** Unique reference name for this numbering configuration. */\n readonly reference: string;\n }[];\n}\n\n/**\n * Represents the numbering definitions in a WordprocessingML document.\n *\n * The numbering element contains abstract numbering definitions and their\n * concrete instances, which are referenced by paragraphs to create lists.\n * Each numbering configuration includes a default bullet list and any\n * custom numbering schemes defined by the user.\n *\n * Reference: http://officeopenxml.com/WPnumbering.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"numbering\" type=\"CT_Numbering\"/>\n *\n * <xsd:complexType name=\"CT_Numbering\">\n * <xsd:sequence>\n * <xsd:element name=\"numPicBullet\" type=\"CT_NumPicBullet\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"abstractNum\" type=\"CT_AbstractNum\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"num\" type=\"CT_Num\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"numIdMacAtCleanup\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create numbering with custom decimal list\n * const numbering = new Numbering({\n * config: [\n * {\n * reference: \"my-decimal-list\",\n * levels: [\n * {\n * level: 0,\n * format: LevelFormat.DECIMAL,\n * text: \"%1.\",\n * alignment: AlignmentType.LEFT,\n * start: 1,\n * style: {\n * paragraph: {\n * indent: { left: 720, hanging: 360 },\n * },\n * },\n * },\n * {\n * level: 1,\n * format: LevelFormat.LOWER_LETTER,\n * text: \"%2)\",\n * alignment: AlignmentType.LEFT,\n * style: {\n * paragraph: {\n * indent: { left: 1440, hanging: 360 },\n * },\n * },\n * },\n * ],\n * },\n * ],\n * });\n * ```\n */\nexport class Numbering extends XmlComponent {\n private readonly abstractNumberingMap = new Map<string, AbstractNumbering>();\n private readonly concreteNumberingMap = new Map<string, ConcreteNumbering>();\n private readonly referenceConfigMap = new Map<string, Record<string, any>>();\n private readonly abstractNumUniqueNumericId = abstractNumUniqueNumericIdGen();\n private readonly concreteNumUniqueNumericId = concreteNumUniqueNumericIdGen();\n\n /**\n * Creates a new numbering definition collection.\n *\n * Initializes the numbering with a default bullet list configuration and\n * any custom numbering configurations provided in the options.\n *\n * @param options - Configuration options for numbering definitions\n */\n public constructor(options: NumberingOptions) {\n super(\"w:numbering\");\n this.root.push(\n buildDocumentAttributes(\n [\n \"wpc\",\n \"mc\",\n \"o\",\n \"r\",\n \"m\",\n \"v\",\n \"wp14\",\n \"wp\",\n \"w10\",\n \"w\",\n \"w14\",\n \"w15\",\n \"wpg\",\n \"wpi\",\n \"wne\",\n \"wps\",\n ],\n \"w14 w15 wp14\",\n ),\n );\n\n const abstractNumbering = new AbstractNumbering(this.abstractNumUniqueNumericId(), [\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 0,\n style: {\n paragraph: {\n indent: {\n hanging: convertInchesToTwip(0.25),\n left: convertInchesToTwip(0.5),\n },\n },\n },\n text: \"\\u25CF\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 1,\n style: {\n paragraph: {\n indent: {\n hanging: convertInchesToTwip(0.25),\n left: convertInchesToTwip(1),\n },\n },\n },\n text: \"\\u25CB\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 2,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 2160 },\n },\n },\n text: \"\\u25A0\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 3,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 2880 },\n },\n },\n text: \"\\u25CF\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 4,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 3600 },\n },\n },\n text: \"\\u25CB\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 5,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 4320 },\n },\n },\n text: \"\\u25A0\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 6,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 5040 },\n },\n },\n text: \"\\u25CF\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 7,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 5760 },\n },\n },\n text: \"\\u25CF\",\n },\n {\n alignment: AlignmentType.LEFT,\n format: LevelFormat.BULLET,\n level: 8,\n style: {\n paragraph: {\n indent: { hanging: convertInchesToTwip(0.25), left: 6480 },\n },\n },\n text: \"\\u25CF\",\n },\n ]);\n\n this.concreteNumberingMap.set(\n \"default-bullet-numbering\",\n new ConcreteNumbering({\n abstractNumId: abstractNumbering.id,\n instance: 0,\n numId: 1,\n overrideLevels: [\n {\n num: 0,\n start: 1,\n },\n ],\n reference: \"default-bullet-numbering\",\n }),\n );\n\n this.abstractNumberingMap.set(\"default-bullet-numbering\", abstractNumbering);\n\n for (const con of options.config) {\n this.abstractNumberingMap.set(\n con.reference,\n new AbstractNumbering(this.abstractNumUniqueNumericId(), con.levels),\n );\n this.referenceConfigMap.set(con.reference, con.levels);\n }\n }\n\n /**\n * Prepares the numbering definitions for XML serialization.\n *\n * Adds all abstract and concrete numbering definitions to the XML tree.\n *\n * @param context - The XML context\n * @returns The prepared XML object\n */\n public prepForXml(context: Context): IXmlableObject | undefined {\n for (const numbering of this.abstractNumberingMap.values()) {\n this.root.push(numbering);\n }\n\n for (const numbering of this.concreteNumberingMap.values()) {\n this.root.push(numbering);\n }\n return super.prepForXml(context);\n }\n\n /**\n * Creates a concrete numbering instance from an abstract numbering definition.\n *\n * This method creates a new concrete numbering instance that references an\n * abstract numbering definition. It's used internally when paragraphs reference\n * numbering configurations.\n *\n * @param reference - The reference name of the abstract numbering definition\n * @param instance - The instance number for this concrete numbering\n */\n public createConcreteNumberingInstance(reference: string, instance: number): void {\n const abstractNumbering = this.abstractNumberingMap.get(reference);\n\n if (!abstractNumbering) {\n return;\n }\n\n const fullReference = `${reference}-${instance}`;\n\n if (this.concreteNumberingMap.has(fullReference)) {\n return;\n }\n\n const referenceConfigLevels = this.referenceConfigMap.get(reference);\n const firstLevelStartNumber = referenceConfigLevels && referenceConfigLevels[0].start;\n\n const concreteNumberingSettings = {\n abstractNumId: abstractNumbering.id,\n instance,\n numId: this.concreteNumUniqueNumericId(),\n overrideLevels: [\n typeof firstLevelStartNumber === \"number\" && Number.isInteger(firstLevelStartNumber)\n ? {\n num: 0,\n start: firstLevelStartNumber,\n }\n : {\n num: 0,\n start: 1,\n },\n ],\n reference,\n };\n\n this.concreteNumberingMap.set(fullReference, new ConcreteNumbering(concreteNumberingSettings));\n }\n\n /**\n * Gets all concrete numbering instances.\n *\n * @returns An array of all concrete numbering instances\n */\n public get concreteNumbering(): readonly ConcreteNumbering[] {\n return [...this.concreteNumberingMap.values()];\n }\n\n /**\n * Gets all reference configurations.\n *\n * @returns An array of all numbering reference configurations\n */\n public get referenceConfig(): readonly Record<string, any>[] {\n return [...this.referenceConfigMap.values()];\n }\n}\n","/**\n * Compatibility setting module for WordprocessingML documents.\n *\n * This module provides the compatibility mode version setting that controls\n * which Word version's behavior the document should emulate.\n *\n * Reference: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/90138c4d-eb18-4edc-aa6c-dfb799cb1d0d\n *\n * @module\n */\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { XmlComponent } from \"@file/xml-components\";\n\n// Currently, this is hard-coded for Microsoft word compatSettings.\n// Theoretically, we could add compatSettings for other programs, but\n// Currently there isn't a need.\n\n// <xsd:complexType name=\"CT_CompatSetting\">\n// <xsd:attribute name=\"name\" type=\"s:ST_String\"/>\n// <xsd:attribute name=\"uri\" type=\"s:ST_String\"/>\n// <xsd:attribute name=\"val\" type=\"s:ST_String\"/>\n// </xsd:complexType>\n\ninterface CompatibilitySettingAttributes {\n readonly name: string;\n readonly uri: string;\n readonly val: string | number;\n}\n\n/**\n * Creates a compatibility setting for a WordprocessingML document.\n *\n * This controls which Word version's formatting and layout behavior the document emulates,\n * as well as other compatibility behaviors.\n *\n * Common version values:\n * - 11: Word 2003\n * - 12: Word 2007\n * - 14: Word 2010\n * - 15: Word 2013+\n *\n * Reference: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/90138c4d-eb18-4edc-aa6c-dfb799cb1d0d\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_CompatSetting\">\n * <xsd:attribute name=\"name\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"uri\" type=\"s:ST_String\"/>\n * <xsd:attribute name=\"val\" type=\"s:ST_String\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set compatibility mode to Word 2013+\n * createCompatibilitySetting(\"compatibilityMode\", 15);\n *\n * // Enable OpenType features\n * createCompatibilitySetting(\"enableOpenTypeFeatures\", 1);\n * ```\n */\nexport const createCompatibilitySetting = (\n name: string,\n val: string | number,\n uri = \"http://schemas.microsoft.com/office/word\",\n): XmlComponent =>\n new BuilderElement<CompatibilitySettingAttributes>({\n attributes: {\n name: { key: \"w:name\", value: name },\n uri: { key: \"w:uri\", value: uri },\n val: { key: \"w:val\", value: val },\n },\n name: \"w:compatSetting\",\n });\n","/**\n * Compatibility module for WordprocessingML documents.\n *\n * This module provides compatibility settings that control how Word\n * handles documents created in older versions or other word processors.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_compat-1.html\n *\n * @module\n */\nimport { onOffObj, XmlComponent } from \"@file/xml-components\";\n\nimport { createCompatibilitySetting } from \"./compatibility-setting/compatibility-setting\";\n\n// <xsd:complexType name=\"CT_Compat\">\n// <xsd:sequence>\n// <xsd:element name=\"useSingleBorderforContiguousCells\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"wpJustification\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noTabHangInd\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noLeading\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"spaceForUL\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noColumnBalance\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"balanceSingleByteDoubleByteWidth\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noExtraLineSpacing\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotLeaveBackslashAlone\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"ulTrailSpace\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotExpandShiftReturn\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"spacingInWholePoints\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"lineWrapLikeWord6\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"printBodyTextBeforeHeader\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"printColBlack\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"wpSpaceWidth\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"showBreaksInFrames\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"subFontBySize\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"suppressBottomSpacing\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"suppressTopSpacing\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"suppressSpacingAtTopOfPage\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"suppressTopSpacingWP\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"suppressSpBfAfterPgBrk\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"swapBordersFacingPages\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"convMailMergeEsc\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"truncateFontHeightsLikeWP6\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"mwSmallCaps\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"usePrinterMetrics\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotSuppressParagraphBorders\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"wrapTrailSpaces\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"footnoteLayoutLikeWW8\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"shapeLayoutLikeWW8\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"alignTablesRowByRow\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"forgetLastTabAlignment\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"adjustLineHeightInTable\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"autoSpaceLikeWord95\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noSpaceRaiseLower\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotUseHTMLParagraphAutoSpacing\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"layoutRawTableWidth\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"layoutTableRowsApart\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useWord97LineBreakRules\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotBreakWrappedTables\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotSnapToGridInCell\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"selectFldWithFirstOrLastChar\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"applyBreakingRules\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotWrapTextWithPunct\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotUseEastAsianBreakRules\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useWord2002TableStyleRules\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"growAutofit\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useFELayout\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useNormalStyleForList\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotUseIndentAsNumberingTabStop\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useAltKinsokuLineBreakRules\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"allowSpaceOfSameStyleInTable\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotSuppressIndentation\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotAutofitConstrainedTables\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"autofitToFirstFixedWidthCell\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"underlineTabInNumList\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"displayHangulFixedWidth\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"splitPgBreakAndParaMark\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotVertAlignCellWithSp\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotBreakConstrainedForcedTable\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotVertAlignInTxbx\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useAnsiKerningPairs\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"cachedColBalance\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"compatSetting\" type=\"CT_CompatSetting\" minOccurs=\"0\" maxOccurs=\"unbounded\"\n// />\n// </xsd:sequence>\n// </xsd:complexType>\n\n/**\n * Options for configuring document compatibility settings.\n *\n * These settings control how Word processes and displays documents to match\n * behavior from older Word versions or other word processors like WordPerfect.\n *\n * @see {@link Compatibility}\n */\nexport interface CompatibilityOptions {\n /** Word compatibility mode version (e.g., 15 for Word 2013+) */\n readonly version?: number;\n /** Use Simplified Rules For Table Border Conflicts */\n readonly useSingleBorderforContiguousCells?: boolean;\n /** Emulate WordPerfect 6.x Paragraph Justification */\n readonly wordPerfectJustification?: boolean;\n /** Do Not Create Custom Tab Stop for Hanging Indent */\n readonly noTabStopForHangingIndent?: boolean;\n /** Do Not Add Leading Between Lines of Text */\n readonly noLeading?: boolean;\n /** Add Additional Space Below Baseline For Underlined East Asian Text */\n readonly spaceForUnderline?: boolean;\n /** Do Not Balance Text Columns within a Section */\n readonly noColumnBalance?: boolean;\n /** Balance Single Byte and Double Byte Characters */\n readonly balanceSingleByteDoubleByteWidth?: boolean;\n /** Do Not Center Content on Lines With Exact Line Height */\n readonly noExtraLineSpacing?: boolean;\n /** Convert Backslash To Yen Sign When Entered */\n readonly doNotLeaveBackslashAlone?: boolean;\n /** Underline All Trailing Spaces */\n readonly underlineTrailingSpaces?: boolean;\n /** Don't Justify Lines Ending in Soft Line Break */\n readonly doNotExpandShiftReturn?: boolean;\n /** Only Expand/Condense Text By Whole Points */\n readonly spacingInWholePoints?: boolean;\n /** Emulate Word 6.0 Line Wrapping for East Asian Text */\n readonly lineWrapLikeWord6?: boolean;\n /** Print Body Text before Header/Footer Contents */\n readonly printBodyTextBeforeHeader?: boolean;\n /** Print Colors as Black And White without Dithering */\n readonly printColorsBlack?: boolean;\n /** Space width */\n readonly spaceWidth?: boolean;\n /** Display Page/Column Breaks Present in Frames */\n readonly showBreaksInFrames?: boolean;\n /** Increase Priority Of Font Size During Font Substitution */\n readonly subFontBySize?: boolean;\n /** Ignore Exact Line Height for Last Line on Page */\n readonly suppressBottomSpacing?: boolean;\n /** Ignore Minimum and Exact Line Height for First Line on Page */\n readonly suppressTopSpacing?: boolean;\n /** Ignore Minimum Line Height for First Line on Page */\n readonly suppressSpacingAtTopOfPage?: boolean;\n /** Emulate WordPerfect 5.x Line Spacing */\n readonly suppressTopSpacingWP?: boolean;\n /** Do Not Use Space Before On First Line After a Page Break */\n readonly suppressSpBfAfterPgBrk?: boolean;\n /** Swap Paragraph Borders on Odd Numbered Pages */\n readonly swapBordersFacingPages?: boolean;\n /** Treat Backslash Quotation Delimiter as Two Quotation Marks */\n readonly convertMailMergeEsc?: boolean;\n /** Emulate WordPerfect 6.x Font Height Calculation */\n readonly truncateFontHeightsLikeWP6?: boolean;\n /** Emulate Word 5.x for the Macintosh Small Caps Formatting */\n readonly macWordSmallCaps?: boolean;\n /** Use Printer Metrics To Display Documents */\n readonly usePrinterMetrics?: boolean;\n /** Do Not Suppress Paragraph Borders Next To Frames */\n readonly doNotSuppressParagraphBorders?: boolean;\n /** Line Wrap Trailing Spaces */\n readonly wrapTrailSpaces?: boolean;\n /** Emulate Word 6.x/95/97 Footnote Placement */\n readonly footnoteLayoutLikeWW8?: boolean;\n /** Emulate Word 97 Text Wrapping Around Floating Objects */\n readonly shapeLayoutLikeWW8?: boolean;\n /** Align Table Rows Independently */\n readonly alignTablesRowByRow?: boolean;\n /** Ignore Width of Last Tab Stop When Aligning Paragraph If It Is Not Left Aligned */\n readonly forgetLastTabAlignment?: boolean;\n /** Add Document Grid Line Pitch To Lines in Table Cells */\n readonly adjustLineHeightInTable?: boolean;\n /** Emulate Word 95 Full-Width Character Spacing */\n readonly autoSpaceLikeWord95?: boolean;\n /** Do Not Increase Line Height for Raised/Lowered Text */\n readonly noSpaceRaiseLower?: boolean;\n /** Use Fixed Paragraph Spacing for HTML Auto Setting */\n readonly doNotUseHTMLParagraphAutoSpacing?: boolean;\n /** Ignore Space Before Table When Deciding If Table Should Wrap Floating Object */\n readonly layoutRawTableWidth?: boolean;\n /** Allow Table Rows to Wrap Inline Objects Independently */\n readonly layoutTableRowsApart?: boolean;\n /** Emulate Word 97 East Asian Line Breaking */\n readonly useWord97LineBreakRules?: boolean;\n /** Do Not Allow Floating Tables To Break Across Pages */\n readonly doNotBreakWrappedTables?: boolean;\n /** Do Not Snap to Document Grid in Table Cells with Objects */\n readonly doNotSnapToGridInCell?: boolean;\n /** Select Field When First or Last Character Is Selected */\n readonly selectFieldWithFirstOrLastCharacter?: boolean;\n /** Use Legacy Ethiopic and Amharic Line Breaking Rules */\n readonly applyBreakingRules?: boolean;\n /** Do Not Allow Hanging Punctuation With Character Grid */\n readonly doNotWrapTextWithPunctuation?: boolean;\n /** Do Not Compress Compressible Characters When Using Document Grid */\n readonly doNotUseEastAsianBreakRules?: boolean;\n /** Emulate Word 2002 Table Style Rules */\n readonly useWord2002TableStyleRules?: boolean;\n /** Allow Tables to AutoFit Into Page Margins */\n readonly growAutofit?: boolean;\n /** Do Not Bypass East Asian/Complex Script Layout Code */\n readonly useFELayout?: boolean;\n /** Do Not Automatically Apply List Paragraph Style To Bulleted/Numbered Text */\n readonly useNormalStyleForList?: boolean;\n /** Ignore Hanging Indent When Creating Tab Stop After Numbering */\n readonly doNotUseIndentAsNumberingTabStop?: boolean;\n /** Use Alternate Set of East Asian Line Breaking Rules */\n readonly useAlternateEastAsianLineBreakRules?: boolean;\n /** Allow Contextual Spacing of Paragraphs in Tables */\n readonly allowSpaceOfSameStyleInTable?: boolean;\n /** Do Not Ignore Floating Objects When Calculating Paragraph Indentation */\n readonly doNotSuppressIndentation?: boolean;\n /** Do Not AutoFit Tables To Fit Next To Wrapped Objects */\n readonly doNotAutofitConstrainedTables?: boolean;\n /** Allow Table Columns To Exceed Preferred Widths of Constituent Cells */\n readonly autofitToFirstFixedWidthCell?: boolean;\n /** Underline Following Character Following Numbering */\n readonly underlineTabInNumberingList?: boolean;\n /** Always Use Fixed Width for Hangul Characters */\n readonly displayHangulFixedWidth?: boolean;\n /** Always Move Paragraph Mark to Page after a Page Break */\n readonly splitPgBreakAndParaMark?: boolean;\n /** Don't Vertically Align Cells Containing Floating Objects */\n readonly doNotVerticallyAlignCellWithSp?: boolean;\n /** Don't Break Table Rows Around Floating Tables */\n readonly doNotBreakConstrainedForcedTable?: boolean;\n /** Ignore Vertical Alignment in Textboxes */\n readonly ignoreVerticalAlignmentInTextboxes?: boolean;\n /** Use ANSI Kerning Pairs from Fonts */\n readonly useAnsiKerningPairs?: boolean;\n /** Use Cached Paragraph Information for Column Balancing */\n readonly cachedColumnBalance?: boolean;\n /** Override Table Style Font Size and Justification */\n readonly overrideTableStyleFontSizeAndJustification?: boolean;\n /** Enable OpenType Features */\n readonly enableOpenTypeFeatures?: boolean;\n /** Do Not Flip Mirror Indents */\n readonly doNotFlipMirrorIndents?: boolean;\n}\n\n/**\n * Represents compatibility settings in a WordprocessingML document.\n *\n * Compatibility settings control document rendering and layout behavior\n * to match older Word versions or other word processors. This ensures\n * documents maintain consistent appearance across different applications.\n *\n * Reference: http://www.datypic.com/sc/ooxml/e-w_compat-1.html\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Compat\">\n * <xsd:sequence>\n * <xsd:element name=\"useSingleBorderforContiguousCells\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"wpJustification\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"noTabHangInd\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"noLeading\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"usePrinterMetrics\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"compatSetting\" type=\"CT_CompatSetting\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <!-- Additional compatibility elements omitted for brevity -->\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set compatibility mode to Word 2013+\n * new Compatibility({\n * version: 15,\n * });\n *\n * // Enable specific compatibility options\n * new Compatibility({\n * version: 15,\n * usePrinterMetrics: true,\n * doNotSnapToGridInCell: true,\n * });\n * ```\n */\nexport class Compatibility extends XmlComponent {\n public constructor(options: CompatibilityOptions) {\n super(\"w:compat\");\n\n // All individual compat elements first (per XSD CT_Compat sequence)\n if (options.useSingleBorderforContiguousCells) {\n this.root.push(\n onOffObj(\"w:useSingleBorderforContiguousCells\", options.useSingleBorderforContiguousCells),\n );\n }\n\n if (options.wordPerfectJustification) {\n this.root.push(onOffObj(\"w:wpJustification\", options.wordPerfectJustification));\n }\n\n if (options.noTabStopForHangingIndent) {\n this.root.push(onOffObj(\"w:noTabHangInd\", options.noTabStopForHangingIndent));\n }\n\n if (options.noLeading) {\n this.root.push(onOffObj(\"w:noLeading\", options.noLeading));\n }\n\n if (options.spaceForUnderline) {\n this.root.push(onOffObj(\"w:spaceForUL\", options.spaceForUnderline));\n }\n\n if (options.noColumnBalance) {\n this.root.push(onOffObj(\"w:noColumnBalance\", options.noColumnBalance));\n }\n\n if (options.balanceSingleByteDoubleByteWidth) {\n this.root.push(\n onOffObj(\"w:balanceSingleByteDoubleByteWidth\", options.balanceSingleByteDoubleByteWidth),\n );\n }\n\n if (options.noExtraLineSpacing) {\n this.root.push(onOffObj(\"w:noExtraLineSpacing\", options.noExtraLineSpacing));\n }\n\n if (options.doNotLeaveBackslashAlone) {\n this.root.push(onOffObj(\"w:doNotLeaveBackslashAlone\", options.doNotLeaveBackslashAlone));\n }\n\n if (options.underlineTrailingSpaces) {\n this.root.push(onOffObj(\"w:ulTrailSpace\", options.underlineTrailingSpaces));\n }\n\n if (options.doNotExpandShiftReturn) {\n this.root.push(onOffObj(\"w:doNotExpandShiftReturn\", options.doNotExpandShiftReturn));\n }\n\n if (options.spacingInWholePoints) {\n this.root.push(onOffObj(\"w:spacingInWholePoints\", options.spacingInWholePoints));\n }\n\n if (options.lineWrapLikeWord6) {\n this.root.push(onOffObj(\"w:lineWrapLikeWord6\", options.lineWrapLikeWord6));\n }\n\n if (options.printBodyTextBeforeHeader) {\n this.root.push(onOffObj(\"w:printBodyTextBeforeHeader\", options.printBodyTextBeforeHeader));\n }\n\n if (options.printColorsBlack) {\n this.root.push(onOffObj(\"w:printColBlack\", options.printColorsBlack));\n }\n\n if (options.spaceWidth) {\n this.root.push(onOffObj(\"w:wpSpaceWidth\", options.spaceWidth));\n }\n\n if (options.showBreaksInFrames) {\n this.root.push(onOffObj(\"w:showBreaksInFrames\", options.showBreaksInFrames));\n }\n\n if (options.subFontBySize) {\n this.root.push(onOffObj(\"w:subFontBySize\", options.subFontBySize));\n }\n\n if (options.suppressBottomSpacing) {\n this.root.push(onOffObj(\"w:suppressBottomSpacing\", options.suppressBottomSpacing));\n }\n\n if (options.suppressTopSpacing) {\n this.root.push(onOffObj(\"w:suppressTopSpacing\", options.suppressTopSpacing));\n }\n\n if (options.suppressSpacingAtTopOfPage) {\n this.root.push(onOffObj(\"w:suppressSpacingAtTopOfPage\", options.suppressSpacingAtTopOfPage));\n }\n\n if (options.suppressTopSpacingWP) {\n this.root.push(onOffObj(\"w:suppressTopSpacingWP\", options.suppressTopSpacingWP));\n }\n\n if (options.suppressSpBfAfterPgBrk) {\n this.root.push(onOffObj(\"w:suppressSpBfAfterPgBrk\", options.suppressSpBfAfterPgBrk));\n }\n\n if (options.swapBordersFacingPages) {\n this.root.push(onOffObj(\"w:swapBordersFacingPages\", options.swapBordersFacingPages));\n }\n\n if (options.convertMailMergeEsc) {\n this.root.push(onOffObj(\"w:convMailMergeEsc\", options.convertMailMergeEsc));\n }\n\n if (options.truncateFontHeightsLikeWP6) {\n this.root.push(onOffObj(\"w:truncateFontHeightsLikeWP6\", options.truncateFontHeightsLikeWP6));\n }\n\n if (options.macWordSmallCaps) {\n this.root.push(onOffObj(\"w:mwSmallCaps\", options.macWordSmallCaps));\n }\n\n if (options.usePrinterMetrics) {\n this.root.push(onOffObj(\"w:usePrinterMetrics\", options.usePrinterMetrics));\n }\n\n if (options.doNotSuppressParagraphBorders) {\n this.root.push(\n onOffObj(\"w:doNotSuppressParagraphBorders\", options.doNotSuppressParagraphBorders),\n );\n }\n\n if (options.wrapTrailSpaces) {\n this.root.push(onOffObj(\"w:wrapTrailSpaces\", options.wrapTrailSpaces));\n }\n\n if (options.footnoteLayoutLikeWW8) {\n this.root.push(onOffObj(\"w:footnoteLayoutLikeWW8\", options.footnoteLayoutLikeWW8));\n }\n\n if (options.shapeLayoutLikeWW8) {\n this.root.push(onOffObj(\"w:shapeLayoutLikeWW8\", options.shapeLayoutLikeWW8));\n }\n\n if (options.alignTablesRowByRow) {\n this.root.push(onOffObj(\"w:alignTablesRowByRow\", options.alignTablesRowByRow));\n }\n\n if (options.forgetLastTabAlignment) {\n this.root.push(onOffObj(\"w:forgetLastTabAlignment\", options.forgetLastTabAlignment));\n }\n\n if (options.adjustLineHeightInTable) {\n this.root.push(onOffObj(\"w:adjustLineHeightInTable\", options.adjustLineHeightInTable));\n }\n\n if (options.autoSpaceLikeWord95) {\n this.root.push(onOffObj(\"w:autoSpaceLikeWord95\", options.autoSpaceLikeWord95));\n }\n\n if (options.noSpaceRaiseLower) {\n this.root.push(onOffObj(\"w:noSpaceRaiseLower\", options.noSpaceRaiseLower));\n }\n\n if (options.doNotUseHTMLParagraphAutoSpacing) {\n this.root.push(\n onOffObj(\"w:doNotUseHTMLParagraphAutoSpacing\", options.doNotUseHTMLParagraphAutoSpacing),\n );\n }\n\n if (options.layoutRawTableWidth) {\n this.root.push(onOffObj(\"w:layoutRawTableWidth\", options.layoutRawTableWidth));\n }\n\n if (options.layoutTableRowsApart) {\n this.root.push(onOffObj(\"w:layoutTableRowsApart\", options.layoutTableRowsApart));\n }\n\n if (options.useWord97LineBreakRules) {\n this.root.push(onOffObj(\"w:useWord97LineBreakRules\", options.useWord97LineBreakRules));\n }\n\n if (options.doNotBreakWrappedTables) {\n this.root.push(onOffObj(\"w:doNotBreakWrappedTables\", options.doNotBreakWrappedTables));\n }\n\n if (options.doNotSnapToGridInCell) {\n this.root.push(onOffObj(\"w:doNotSnapToGridInCell\", options.doNotSnapToGridInCell));\n }\n\n if (options.selectFieldWithFirstOrLastCharacter) {\n this.root.push(\n onOffObj(\"w:selectFldWithFirstOrLastChar\", options.selectFieldWithFirstOrLastCharacter),\n );\n }\n\n if (options.applyBreakingRules) {\n this.root.push(onOffObj(\"w:applyBreakingRules\", options.applyBreakingRules));\n }\n\n if (options.doNotWrapTextWithPunctuation) {\n this.root.push(onOffObj(\"w:doNotWrapTextWithPunct\", options.doNotWrapTextWithPunctuation));\n }\n\n if (options.doNotUseEastAsianBreakRules) {\n this.root.push(\n onOffObj(\"w:doNotUseEastAsianBreakRules\", options.doNotUseEastAsianBreakRules),\n );\n }\n\n if (options.useWord2002TableStyleRules) {\n this.root.push(onOffObj(\"w:useWord2002TableStyleRules\", options.useWord2002TableStyleRules));\n }\n\n if (options.growAutofit) {\n this.root.push(onOffObj(\"w:growAutofit\", options.growAutofit));\n }\n\n if (options.useFELayout) {\n this.root.push(onOffObj(\"w:useFELayout\", options.useFELayout));\n }\n\n if (options.useNormalStyleForList) {\n this.root.push(onOffObj(\"w:useNormalStyleForList\", options.useNormalStyleForList));\n }\n\n if (options.doNotUseIndentAsNumberingTabStop) {\n this.root.push(\n onOffObj(\"w:doNotUseIndentAsNumberingTabStop\", options.doNotUseIndentAsNumberingTabStop),\n );\n }\n\n if (options.useAlternateEastAsianLineBreakRules) {\n this.root.push(\n onOffObj(\"w:useAltKinsokuLineBreakRules\", options.useAlternateEastAsianLineBreakRules),\n );\n }\n\n if (options.allowSpaceOfSameStyleInTable) {\n this.root.push(\n onOffObj(\"w:allowSpaceOfSameStyleInTable\", options.allowSpaceOfSameStyleInTable),\n );\n }\n\n if (options.doNotSuppressIndentation) {\n this.root.push(onOffObj(\"w:doNotSuppressIndentation\", options.doNotSuppressIndentation));\n }\n\n if (options.doNotAutofitConstrainedTables) {\n this.root.push(\n onOffObj(\"w:doNotAutofitConstrainedTables\", options.doNotAutofitConstrainedTables),\n );\n }\n\n if (options.autofitToFirstFixedWidthCell) {\n this.root.push(\n onOffObj(\"w:autofitToFirstFixedWidthCell\", options.autofitToFirstFixedWidthCell),\n );\n }\n\n if (options.underlineTabInNumberingList) {\n this.root.push(onOffObj(\"w:underlineTabInNumList\", options.underlineTabInNumberingList));\n }\n\n if (options.displayHangulFixedWidth) {\n this.root.push(onOffObj(\"w:displayHangulFixedWidth\", options.displayHangulFixedWidth));\n }\n\n if (options.splitPgBreakAndParaMark) {\n this.root.push(onOffObj(\"w:splitPgBreakAndParaMark\", options.splitPgBreakAndParaMark));\n }\n\n if (options.doNotVerticallyAlignCellWithSp) {\n this.root.push(\n onOffObj(\"w:doNotVertAlignCellWithSp\", options.doNotVerticallyAlignCellWithSp),\n );\n }\n\n if (options.doNotBreakConstrainedForcedTable) {\n this.root.push(\n onOffObj(\"w:doNotBreakConstrainedForcedTable\", options.doNotBreakConstrainedForcedTable),\n );\n }\n\n if (options.ignoreVerticalAlignmentInTextboxes) {\n this.root.push(\n onOffObj(\"w:doNotVertAlignInTxbx\", options.ignoreVerticalAlignmentInTextboxes),\n );\n }\n\n if (options.useAnsiKerningPairs) {\n this.root.push(onOffObj(\"w:useAnsiKerningPairs\", options.useAnsiKerningPairs));\n }\n\n if (options.cachedColumnBalance) {\n this.root.push(onOffObj(\"w:cachedColBalance\", options.cachedColumnBalance));\n }\n\n // compatSetting must come last per XSD CT_Compat sequence\n if (options.version) {\n this.root.push(createCompatibilitySetting(\"compatibilityMode\", options.version));\n }\n\n if (options.overrideTableStyleFontSizeAndJustification) {\n this.root.push(createCompatibilitySetting(\"overrideTableStyleFontSizeAndJustification\", 1));\n }\n\n if (options.enableOpenTypeFeatures) {\n this.root.push(createCompatibilitySetting(\"enableOpenTypeFeatures\", 1));\n }\n\n if (options.doNotFlipMirrorIndents) {\n this.root.push(createCompatibilitySetting(\"doNotFlipMirrorIndents\", 1));\n }\n }\n}\n","/**\n * Settings module for WordprocessingML documents.\n *\n * This module provides document-level settings including compatibility,\n * track changes, headers/footers, and hyphenation options.\n *\n * Reference: http://officeopenxml.com/WPsettings.php\n *\n * @module\n */\nimport {\n BuilderElement,\n XmlComponent,\n numberValObj,\n onOffObj,\n stringValObj,\n} from \"@file/xml-components\";\n\nimport { Compatibility } from \"./compatibility\";\nimport type { CompatibilityOptions } from \"./compatibility\";\n\n// <xsd:complexType name=\"CT_Settings\">\n// <xsd:sequence>\n// <xsd:element name=\"writeProtection\" type=\"CT_WriteProtection\" minOccurs=\"0\"/>\n// <xsd:element name=\"view\" type=\"CT_View\" minOccurs=\"0\"/>\n// <xsd:element name=\"zoom\" type=\"CT_Zoom\" minOccurs=\"0\"/>\n// <xsd:element name=\"removePersonalInformation\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"removeDateAndTime\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotDisplayPageBoundaries\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"displayBackgroundShape\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"printPostScriptOverText\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"printFractionalCharacterWidth\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"printFormsData\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"embedTrueTypeFonts\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"embedSystemFonts\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"saveSubsetFonts\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"saveFormsData\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"mirrorMargins\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"alignBordersAndEdges\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"bordersDoNotSurroundHeader\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"bordersDoNotSurroundFooter\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"gutterAtTop\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"hideSpellingErrors\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"hideGrammaticalErrors\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"activeWritingStyle\" type=\"CT_WritingStyle\" minOccurs=\"0\"\n// MaxOccurs=\"unbounded\"/>\n// <xsd:element name=\"proofState\" type=\"CT_Proof\" minOccurs=\"0\"/>\n// <xsd:element name=\"formsDesign\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"attachedTemplate\" type=\"CT_Rel\" minOccurs=\"0\"/>\n// <xsd:element name=\"linkStyles\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"stylePaneFormatFilter\" type=\"CT_StylePaneFilter\" minOccurs=\"0\"/>\n// <xsd:element name=\"stylePaneSortMethod\" type=\"CT_StyleSort\" minOccurs=\"0\"/>\n// <xsd:element name=\"documentType\" type=\"CT_DocType\" minOccurs=\"0\"/>\n// <xsd:element name=\"mailMerge\" type=\"CT_MailMerge\" minOccurs=\"0\"/>\n// <xsd:element name=\"revisionView\" type=\"CT_TrackChangesView\" minOccurs=\"0\"/>\n// <xsd:element name=\"trackRevisions\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotTrackMoves\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotTrackFormatting\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"documentProtection\" type=\"CT_DocProtect\" minOccurs=\"0\"/>\n// <xsd:element name=\"autoFormatOverride\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"styleLockTheme\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"styleLockQFSet\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"defaultTabStop\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n// <xsd:element name=\"autoHyphenation\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"consecutiveHyphenLimit\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"hyphenationZone\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotHyphenateCaps\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"showEnvelope\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"summaryLength\" type=\"CT_DecimalNumberOrPrecent\" minOccurs=\"0\"/>\n// <xsd:element name=\"clickAndTypeStyle\" type=\"CT_String\" minOccurs=\"0\"/>\n// <xsd:element name=\"defaultTableStyle\" type=\"CT_String\" minOccurs=\"0\"/>\n// <xsd:element name=\"evenAndOddHeaders\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"bookFoldRevPrinting\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"bookFoldPrinting\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"bookFoldPrintingSheets\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"drawingGridHorizontalSpacing\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n// <xsd:element name=\"drawingGridVerticalSpacing\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n// <xsd:element name=\"displayHorizontalDrawingGridEvery\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"displayVerticalDrawingGridEvery\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotUseMarginsForDrawingGridOrigin\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"drawingGridHorizontalOrigin\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n// <xsd:element name=\"drawingGridVerticalOrigin\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotShadeFormData\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noPunctuationKerning\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"characterSpacingControl\" type=\"CT_CharacterSpacing\" minOccurs=\"0\"/>\n// <xsd:element name=\"printTwoOnOne\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"strictFirstAndLastChars\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"noLineBreaksAfter\" type=\"CT_Kinsoku\" minOccurs=\"0\"/>\n// <xsd:element name=\"noLineBreaksBefore\" type=\"CT_Kinsoku\" minOccurs=\"0\"/>\n// <xsd:element name=\"savePreviewPicture\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotValidateAgainstSchema\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"saveInvalidXml\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"ignoreMixedContent\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"alwaysShowPlaceholderText\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotDemarcateInvalidXml\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"saveXmlDataOnly\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"useXSLTWhenSaving\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"saveThroughXslt\" type=\"CT_SaveThroughXslt\" minOccurs=\"0\"/>\n// <xsd:element name=\"showXMLTags\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"alwaysMergeEmptyNamespace\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"updateFields\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"hdrShapeDefaults\" type=\"CT_ShapeDefaults\" minOccurs=\"0\"/>\n// <xsd:element name=\"footnotePr\" type=\"CT_FtnDocProps\" minOccurs=\"0\"/>\n// <xsd:element name=\"endnotePr\" type=\"CT_EdnDocProps\" minOccurs=\"0\"/>\n// <xsd:element name=\"compat\" type=\"CT_Compat\" minOccurs=\"0\"/>\n// <xsd:element name=\"docVars\" type=\"CT_DocVars\" minOccurs=\"0\"/>\n// <xsd:element name=\"rsids\" type=\"CT_DocRsids\" minOccurs=\"0\"/>\n// <xsd:element ref=\"m:mathPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"attachedSchema\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n// <xsd:element name=\"themeFontLang\" type=\"CT_Language\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"clrSchemeMapping\" type=\"CT_ColorSchemeMapping\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotIncludeSubdocsInStats\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotAutoCompressPictures\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"forceUpgrade\" type=\"CT_Empty\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"captions\" type=\"CT_Captions\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"readModeInkLockDown\" type=\"CT_ReadingModeInkLockDown\" minOccurs=\"0\"/>\n// <xsd:element name=\"smartTagType\" type=\"CT_SmartTagType\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n// <xsd:element ref=\"sl:schemaLibrary\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"shapeDefaults\" type=\"CT_ShapeDefaults\" minOccurs=\"0\"/>\n// <xsd:element name=\"doNotEmbedSmartTags\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"decimalSymbol\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"listSeparator\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// </xsd:sequence>\n// </xsd:complexType>\n\n/**\n * Options for configuring document settings.\n *\n * @see {@link Settings}\n */\nexport interface SettingsOptions {\n /** @deprecated Use compatibility.version instead */\n readonly compatibilityModeVersion?: number;\n /** Enable different headers/footers for even and odd pages */\n readonly evenAndOddHeaders?: boolean;\n /** Enable track changes (revision marking) */\n readonly trackRevisions?: boolean;\n /** Update fields when document is opened */\n readonly updateFields?: boolean;\n /** Compatibility settings for older Word versions */\n readonly compatibility?: CompatibilityOptions;\n /** Default distance between tab stops in twips */\n readonly defaultTabStop?: number;\n /** Hyphenation settings */\n readonly hyphenation?: HyphenationOptions;\n /** Controls whether punctuation is compressed at line ends */\n readonly characterSpacingControl?: \"compressPunctuation\" | \"doNotCompress\";\n /** Document protection settings */\n readonly documentProtection?: DocumentProtectionOptions;\n /** Default document view mode */\n readonly view?: \"none\" | \"print\" | \"outline\" | \"masterPages\" | \"normal\" | \"web\";\n /** Default zoom level (percentage) and type */\n readonly zoom?: {\n readonly percent?: number;\n readonly val?: \"none\" | \"fullPage\" | \"bestFit\" | \"textFit\";\n };\n /** Write protection recommendation (not enforcement) */\n readonly writeProtection?: WriteProtectionOptions;\n /** Whether to display the background shape in print layout */\n readonly displayBackgroundShape?: boolean;\n /** Whether to embed TrueType fonts in the document */\n readonly embedTrueTypeFonts?: boolean;\n /** Whether to embed system fonts in the document */\n readonly embedSystemFonts?: boolean;\n /** Whether to save only a subset of the embedded fonts */\n readonly saveSubsetFonts?: boolean;\n /** Document variables (key-value pairs stored in the document) */\n readonly docVars?: readonly { readonly name: string; readonly val: string }[];\n /** Theme color scheme remapping */\n readonly colorSchemeMapping?: {\n readonly bg1?: string;\n readonly t1?: string;\n readonly bg2?: string;\n readonly t2?: string;\n readonly accent1?: string;\n readonly accent2?: string;\n readonly accent3?: string;\n readonly accent4?: string;\n readonly accent5?: string;\n readonly accent6?: string;\n readonly hyperlink?: string;\n readonly followedHyperlink?: string;\n };\n}\n\n/**\n * Options for document protection (restrict editing).\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_DocProtect\n */\nexport interface DocumentProtectionOptions {\n /** Type of editing restriction */\n readonly edit?: \"none\" | \"readOnly\" | \"comments\" | \"trackedChanges\" | \"forms\";\n /** Whether formatting is restricted */\n readonly formatting?: boolean;\n /** Password hash (SHA-512 base64) */\n readonly hashValue?: string;\n /** Password salt (base64) */\n readonly saltValue?: string;\n /** Password spin count */\n readonly spinCount?: number;\n /** Password algorithm name */\n readonly algorithmName?: string;\n}\n\n/**\n * Options for write protection (read-only recommendation, not enforcement).\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_WriteProtection\n */\nexport interface WriteProtectionOptions {\n /** Cryptographic hash of the password */\n readonly hashValue?: string;\n /** Salt value for the hash (base64) */\n readonly saltValue?: string;\n /** Password spin count */\n readonly spinCount?: number;\n /** Password algorithm name */\n readonly algorithmName?: string;\n /** Whether write protection is recommended (default true when options provided) */\n readonly recommended?: boolean;\n}\n\n/**\n * Options for automatic hyphenation settings.\n *\n * @see {@link Settings}\n */\nexport interface HyphenationOptions {\n /** Specifies whether the application automatically hyphenates words as they are typed in the document. */\n readonly autoHyphenation?: boolean;\n /** Specifies the minimum number of characters at the beginning of a word before a hyphen can be inserted. */\n readonly hyphenationZone?: number;\n /** Specifies the maximum number of consecutive lines that can end with a hyphenated word. */\n readonly consecutiveHyphenLimit?: number;\n /** Specifies whether to hyphenate words in all capital letters. */\n readonly doNotHyphenateCaps?: boolean;\n}\n\n/**\n * Represents document settings in a WordprocessingML document.\n *\n * Settings contain document-wide configuration options such as\n * compatibility mode, track changes, hyphenation, and more.\n *\n * Reference: http://officeopenxml.com/WPsettings.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Settings\">\n * <xsd:sequence>\n * <xsd:element name=\"trackRevisions\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"evenAndOddHeaders\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"defaultTabStop\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"autoHyphenation\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"consecutiveHyphenLimit\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"hyphenationZone\" type=\"CT_TwipsMeasure\" minOccurs=\"0\"/>\n * <xsd:element name=\"doNotHyphenateCaps\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"updateFields\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"compat\" type=\"CT_Compat\" minOccurs=\"0\"/>\n * <!-- Additional elements omitted for brevity -->\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Basic settings with track changes enabled\n * new Settings({\n * trackRevisions: true,\n * evenAndOddHeaders: true,\n * });\n *\n * // Settings with compatibility mode and hyphenation\n * new Settings({\n * compatibility: {\n * version: 15, // Word 2013+\n * },\n * hyphenation: {\n * autoHyphenation: true,\n * consecutiveHyphenLimit: 2,\n * },\n * });\n * ```\n */\nexport class Settings extends XmlComponent {\n public constructor(options: SettingsOptions) {\n super(\"w:settings\");\n this.root.push({\n _attr: {\n \"mc:Ignorable\": \"w14 w15 wp14\",\n \"xmlns:m\": \"http://schemas.openxmlformats.org/officeDocument/2006/math\",\n \"xmlns:mc\": \"http://schemas.openxmlformats.org/markup-compatibility/2006\",\n \"xmlns:o\": \"urn:schemas-microsoft-com:office:office\",\n \"xmlns:r\": \"http://schemas.openxmlformats.org/officeDocument/2006/relationships\",\n \"xmlns:v\": \"urn:schemas-microsoft-com:vml\",\n \"xmlns:w\": \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\",\n \"xmlns:w10\": \"urn:schemas-microsoft-com:office:word\",\n \"xmlns:w14\": \"http://schemas.microsoft.com/office/word/2010/wordml\",\n \"xmlns:w15\": \"http://schemas.microsoft.com/office/word/2012/wordml\",\n \"xmlns:wne\": \"http://schemas.microsoft.com/office/word/2006/wordml\",\n \"xmlns:wp\": \"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\",\n \"xmlns:wp14\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\",\n \"xmlns:wpc\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\",\n \"xmlns:wpg\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\",\n \"xmlns:wpi\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\",\n \"xmlns:wps\": \"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\",\n },\n });\n\n // Elements ordered per XSD CT_Settings sequence.\n // Only elements actually used are included; all others are minOccurs=\"0\".\n\n if (options.writeProtection !== undefined) {\n this.root.push(new WriteProtection(options.writeProtection));\n }\n\n if (options.view !== undefined) {\n this.root.push(new View(options.view));\n }\n\n if (options.zoom !== undefined) {\n this.root.push(\n new Zoom({\n val: options.zoom.val,\n percent: options.zoom.percent ?? 100,\n }),\n );\n }\n\n if (options.displayBackgroundShape !== undefined) {\n this.root.push(onOffObj(\"w:displayBackgroundShape\", options.displayBackgroundShape));\n }\n\n if (options.embedTrueTypeFonts !== undefined) {\n this.root.push(onOffObj(\"w:embedTrueTypeFonts\", options.embedTrueTypeFonts));\n }\n\n if (options.embedSystemFonts !== undefined) {\n this.root.push(onOffObj(\"w:embedSystemFonts\", options.embedSystemFonts));\n }\n\n if (options.saveSubsetFonts !== undefined) {\n this.root.push(onOffObj(\"w:saveSubsetFonts\", options.saveSubsetFonts));\n }\n\n if (options.trackRevisions !== undefined) {\n this.root.push(onOffObj(\"w:trackRevisions\", options.trackRevisions));\n }\n\n if (options.documentProtection !== undefined) {\n this.root.push(new DocumentProtection(options.documentProtection));\n }\n\n // https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_defaultTabStop_topic_ID0EIXSX.html\n this.root.push(numberValObj(\"w:defaultTabStop\", options.defaultTabStop ?? 420));\n\n if (options.hyphenation?.autoHyphenation !== undefined) {\n this.root.push(onOffObj(\"w:autoHyphenation\", options.hyphenation.autoHyphenation));\n }\n\n if (options.hyphenation?.consecutiveHyphenLimit !== undefined) {\n this.root.push(\n numberValObj(\"w:consecutiveHyphenLimit\", options.hyphenation.consecutiveHyphenLimit),\n );\n }\n\n if (options.hyphenation?.hyphenationZone !== undefined) {\n this.root.push(numberValObj(\"w:hyphenationZone\", options.hyphenation.hyphenationZone));\n }\n\n if (options.hyphenation?.doNotHyphenateCaps !== undefined) {\n this.root.push(onOffObj(\"w:doNotHyphenateCaps\", options.hyphenation.doNotHyphenateCaps));\n }\n\n if (options.evenAndOddHeaders !== undefined) {\n this.root.push(onOffObj(\"w:evenAndOddHeaders\", options.evenAndOddHeaders));\n }\n\n this.root.push(\n stringValObj(\n \"w:characterSpacingControl\",\n options.characterSpacingControl ?? \"compressPunctuation\",\n ),\n );\n\n if (options.updateFields !== undefined) {\n this.root.push(onOffObj(\"w:updateFields\", options.updateFields));\n }\n\n this.root.push(\n new Compatibility({\n ...options.compatibility,\n version: options.compatibility?.version ?? options.compatibilityModeVersion ?? 15,\n spaceForUnderline: options.compatibility?.spaceForUnderline ?? true,\n balanceSingleByteDoubleByteWidth:\n options.compatibility?.balanceSingleByteDoubleByteWidth ?? true,\n doNotLeaveBackslashAlone: options.compatibility?.doNotLeaveBackslashAlone ?? true,\n underlineTrailingSpaces: options.compatibility?.underlineTrailingSpaces ?? true,\n doNotExpandShiftReturn: options.compatibility?.doNotExpandShiftReturn ?? true,\n adjustLineHeightInTable: options.compatibility?.adjustLineHeightInTable ?? true,\n useFELayout: options.compatibility?.useFELayout ?? true,\n overrideTableStyleFontSizeAndJustification:\n options.compatibility?.overrideTableStyleFontSizeAndJustification ?? true,\n enableOpenTypeFeatures: options.compatibility?.enableOpenTypeFeatures ?? true,\n doNotFlipMirrorIndents: options.compatibility?.doNotFlipMirrorIndents ?? true,\n }),\n );\n\n if (options.docVars !== undefined && options.docVars.length > 0) {\n this.root.push(\n new BuilderElement({\n name: \"w:docVars\",\n children: options.docVars.map(\n (v) =>\n new BuilderElement({\n name: \"w:docVar\",\n attributes: [\n { key: \"w:name\", value: v.name },\n { key: \"w:val\", value: v.val },\n ],\n }),\n ),\n }),\n );\n }\n\n if (options.colorSchemeMapping !== undefined) {\n this.root.push(new ColorSchemeMapping(options.colorSchemeMapping));\n }\n }\n}\n\n/**\n * Represents document protection settings (CT_DocProtect).\n *\n * Restricts the types of editing allowed in the document.\n * Requires `enforcement: true` to take effect.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_DocProtect\n */\nclass DocumentProtection extends XmlComponent {\n public constructor(options: DocumentProtectionOptions) {\n super(\"w:documentProtection\");\n const attr: Record<string, string | number> = { \"w:enforcement\": \"1\" };\n if (options.edit !== undefined) {\n attr[\"w:edit\"] = options.edit;\n }\n if (options.formatting !== undefined) {\n attr[\"w:formatting\"] = options.formatting ? \"1\" : \"0\";\n }\n if (options.algorithmName !== undefined) {\n attr[\"w:algorithmName\"] = options.algorithmName;\n }\n if (options.hashValue !== undefined) {\n attr[\"w:hashValue\"] = options.hashValue;\n }\n if (options.saltValue !== undefined) {\n attr[\"w:saltValue\"] = options.saltValue;\n }\n if (options.spinCount !== undefined) {\n attr[\"w:spinCount\"] = options.spinCount;\n }\n this.root.push({ _attr: attr });\n }\n}\n\nclass View extends XmlComponent {\n public constructor(val: string) {\n super(\"w:view\");\n this.root.push({ _attr: { \"w:val\": val } });\n }\n}\n\nclass Zoom extends XmlComponent {\n public constructor(options: { val?: string; percent: number }) {\n super(\"w:zoom\");\n const attr: Record<string, string | number> = { \"w:percent\": options.percent };\n if (options.val !== undefined) {\n attr[\"w:val\"] = options.val;\n }\n this.root.push({ _attr: attr });\n }\n}\n\nclass WriteProtection extends XmlComponent {\n public constructor(options: WriteProtectionOptions) {\n super(\"w:writeProtection\");\n const attr: Record<string, string | number> = {};\n if (options.recommended !== undefined) {\n attr[\"w:recommended\"] = options.recommended ? \"1\" : \"0\";\n }\n if (options.hashValue !== undefined) {\n attr[\"w:hashValue\"] = options.hashValue;\n }\n if (options.saltValue !== undefined) {\n attr[\"w:saltValue\"] = options.saltValue;\n }\n if (options.spinCount !== undefined) {\n attr[\"w:spinCount\"] = options.spinCount;\n }\n if (options.algorithmName !== undefined) {\n attr[\"w:algorithmName\"] = options.algorithmName;\n }\n this.root.push({ _attr: attr });\n }\n}\n\nclass ColorSchemeMapping extends XmlComponent {\n public constructor(options: {\n readonly bg1?: string;\n readonly t1?: string;\n readonly bg2?: string;\n readonly t2?: string;\n readonly accent1?: string;\n readonly accent2?: string;\n readonly accent3?: string;\n readonly accent4?: string;\n readonly accent5?: string;\n readonly accent6?: string;\n readonly hyperlink?: string;\n readonly followedHyperlink?: string;\n }) {\n super(\"w:clrSchemeMapping\");\n const attr: Record<string, string> = {};\n if (options.bg1 !== undefined) attr[\"w:bg1\"] = options.bg1;\n if (options.t1 !== undefined) attr[\"w:t1\"] = options.t1;\n if (options.bg2 !== undefined) attr[\"w:bg2\"] = options.bg2;\n if (options.t2 !== undefined) attr[\"w:t2\"] = options.t2;\n if (options.accent1 !== undefined) attr[\"w:accent1\"] = options.accent1;\n if (options.accent2 !== undefined) attr[\"w:accent2\"] = options.accent2;\n if (options.accent3 !== undefined) attr[\"w:accent3\"] = options.accent3;\n if (options.accent4 !== undefined) attr[\"w:accent4\"] = options.accent4;\n if (options.accent5 !== undefined) attr[\"w:accent5\"] = options.accent5;\n if (options.accent6 !== undefined) attr[\"w:accent6\"] = options.accent6;\n if (options.hyperlink !== undefined) attr[\"w:hyperlink\"] = options.hyperlink;\n if (options.followedHyperlink !== undefined)\n attr[\"w:followedHyperlink\"] = options.followedHyperlink;\n this.root.push({ _attr: attr });\n }\n}\n","/**\n * Style components module for WordprocessingML documents.\n *\n * Provides common elements used in style definitions.\n *\n * Reference: http://officeopenxml.com/WPstyleGenProps.php\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { decimalNumber } from \"@util/values\";\n\n/**\n * Represents the name element of a style.\n *\n * This element specifies the display name of a style as shown in the user interface.\n *\n * Reference: http://officeopenxml.com/WPstyleGenProps.php\n *\n * @example\n * ```typescript\n * // Typically used internally by Style class\n * new Name(\"Heading 1\");\n * ```\n */\nexport class Name extends XmlComponent {\n public constructor(value: string) {\n super(\"w:name\");\n this.root.push({ _attr: { \"w:val\": value } });\n }\n}\n\n/**\n * Represents the UI priority of a style.\n *\n * This element specifies the sort order priority for displaying the style in the user interface.\n * Lower numbers appear first in style lists.\n *\n * Reference: http://officeopenxml.com/WPstyleGenProps.php\n *\n * @example\n * ```typescript\n * // Typically used internally by Style class\n * new UiPriority(99);\n * ```\n */\nexport class UiPriority extends XmlComponent {\n public constructor(value: number) {\n super(\"w:uiPriority\");\n this.root.push({ _attr: { \"w:val\": decimalNumber(value) } });\n }\n}\n\n/**\n * Represents table properties for table styles.\n *\n * @internal\n */\nexport class TableProperties extends XmlComponent {}\n\n/**\n * Represents revision save ID for tracking document changes.\n *\n * @internal\n */\nexport class RsId extends XmlComponent {}\n","/**\n * Table style override module for WordprocessingML documents.\n *\n * Table style overrides (CT_TblStylePr) allow defining formatting\n * for specific table regions (first row, last column, banding, etc.)\n * within a table style definition.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_TblStylePr\n *\n * @module\n */\n\nimport { BuilderElement } from \"@file/xml-components\";\nimport type { BuilderChild, XmlComponent } from \"@file/xml-components\";\n\n/**\n * Table style override type (ST_TblStyleOverrideType).\n *\n * Specifies which region of the table the override applies to.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TblStyleOverrideType\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"wholeTable\"/>\n * <xsd:enumeration value=\"firstRow\"/>\n * <xsd:enumeration value=\"lastRow\"/>\n * <xsd:enumeration value=\"firstCol\"/>\n * <xsd:enumeration value=\"lastCol\"/>\n * <xsd:enumeration value=\"band1Vert\"/>\n * <xsd:enumeration value=\"band2Vert\"/>\n * <xsd:enumeration value=\"band1Horz\"/>\n * <xsd:enumeration value=\"band2Horz\"/>\n * <xsd:enumeration value=\"neCell\"/>\n * <xsd:enumeration value=\"nwCell\"/>\n * <xsd:enumeration value=\"seCell\"/>\n * <xsd:enumeration value=\"swCell\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const TableStyleOverrideType = {\n /** Override applies to the entire table */\n WHOLE_TABLE: \"wholeTable\",\n /** Override applies to the first row */\n FIRST_ROW: \"firstRow\",\n /** Override applies to the last row */\n LAST_ROW: \"lastRow\",\n /** Override applies to the first column */\n FIRST_COL: \"firstCol\",\n /** Override applies to the last column */\n LAST_COL: \"lastCol\",\n /** Override applies to odd-numbered vertical bands (columns) */\n BAND1_VERT: \"band1Vert\",\n /** Override applies to even-numbered vertical bands (columns) */\n BAND2_VERT: \"band2Vert\",\n /** Override applies to odd-numbered horizontal bands (rows) */\n BAND1_HORZ: \"band1Horz\",\n /** Override applies to even-numbered horizontal bands (rows) */\n BAND2_HORZ: \"band2Horz\",\n /** Override applies to the northeast (top-right) corner cell */\n NE_CELL: \"neCell\",\n /** Override applies to the northwest (top-left) corner cell */\n NW_CELL: \"nwCell\",\n /** Override applies to the southeast (bottom-right) corner cell */\n SE_CELL: \"seCell\",\n /** Override applies to the southwest (bottom-left) corner cell */\n SW_CELL: \"swCell\",\n} as const;\n\n/**\n * Options for a table style override.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblStylePr\">\n * <xsd:sequence>\n * <xsd:element name=\"pPr\" type=\"CT_PPrGeneral\" minOccurs=\"0\"/>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"tblPr\" type=\"CT_TblPrBase\" minOccurs=\"0\"/>\n * <xsd:element name=\"trPr\" type=\"CT_TrPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"tcPr\" type=\"CT_TcPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"type\" type=\"ST_TblStyleOverrideType\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface TableStyleOverrideOptions {\n /**\n * The table region this override applies to.\n */\n readonly type: (typeof TableStyleOverrideType)[keyof typeof TableStyleOverrideType];\n /**\n * Paragraph properties for this region.\n *\n * Accepts any XmlComponent (e.g., ParagraphProperties instance).\n */\n readonly paragraphProperties?: XmlComponent;\n /**\n * Run (character) properties for this region.\n *\n * Accepts any XmlComponent (e.g., RunProperties instance).\n */\n readonly runProperties?: XmlComponent;\n /**\n * Table properties for this region.\n *\n * Accepts any XmlComponent (e.g., TableProperties instance).\n */\n readonly tableProperties?: XmlComponent;\n /**\n * Table row properties for this region.\n *\n * Accepts any XmlComponent (e.g., TableRowProperties instance).\n */\n readonly rowProperties?: XmlComponent;\n /**\n * Table cell properties for this region.\n *\n * Accepts any XmlComponent (e.g., TableCellProperties instance).\n */\n readonly cellProperties?: XmlComponent;\n}\n\n/**\n * Creates a table style override element (w:tblStylePr).\n *\n * Table style overrides allow defining formatting for specific regions\n * of a table (first row, last column, banding, etc.) within a table\n * style definition.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TblStylePr\">\n * <xsd:sequence>\n * <xsd:element name=\"pPr\" type=\"CT_PPrGeneral\" minOccurs=\"0\"/>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"tblPr\" type=\"CT_TblPrBase\" minOccurs=\"0\"/>\n * <xsd:element name=\"trPr\" type=\"CT_TrPr\" minOccurs=\"0\"/>\n * <xsd:element name=\"tcPr\" type=\"CT_TcPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"type\" type=\"ST_TblStyleOverrideType\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Bold text in the first row\n * createTableStyleOverride({\n * type: \"firstRow\",\n * runProperties: new RunProperties({ bold: true }),\n * });\n *\n * // Banded rows with background color\n * createTableStyleOverride({\n * type: \"band1Horz\",\n * cellProperties: new TableCellProperties({\n * shading: { fill: \"E7E6E6\" },\n * }),\n * });\n * ```\n */\nexport const createTableStyleOverride = (options: TableStyleOverrideOptions): XmlComponent => {\n const children: BuilderChild[] = [];\n\n if (options.paragraphProperties) {\n children.push(options.paragraphProperties);\n }\n if (options.runProperties) {\n children.push(options.runProperties);\n }\n if (options.tableProperties) {\n children.push(options.tableProperties);\n }\n if (options.rowProperties) {\n children.push(options.rowProperties);\n }\n if (options.cellProperties) {\n children.push(options.cellProperties);\n }\n\n return new BuilderElement<{ readonly type: string }>({\n attributes: {\n type: { key: \"w:type\", value: options.type },\n },\n children,\n name: \"w:tblStylePr\",\n });\n};\n","/**\n * Style definition module for WordprocessingML documents.\n *\n * Provides base style functionality for paragraph and character styles.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { XmlComponent, onOffObj, stringValObj } from \"@file/xml-components\";\n\nimport { Name, UiPriority } from \"./components\";\nimport type { TableStyleOverrideOptions } from \"./table-style-override\";\nimport { createTableStyleOverride } from \"./table-style-override\";\n\n// <xsd:complexType name=\"CT_Style\">\n// <xsd:sequence>\n// <xsd:element name=\"name\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"aliases\" type=\"CT_String\" minOccurs=\"0\"/>\n// <xsd:element name=\"basedOn\" type=\"CT_String\" minOccurs=\"0\"/>\n// <xsd:element name=\"next\" type=\"CT_String\" minOccurs=\"0\"/>\n// <xsd:element name=\"link\" type=\"CT_String\" minOccurs=\"0\"/>\n// <xsd:element name=\"autoRedefine\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"hidden\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"uiPriority\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"semiHidden\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"unhideWhenUsed\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"qFormat\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"locked\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"personal\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"personalCompose\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"personalReply\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n// <xsd:element name=\"rsid\" type=\"CT_LongHexNumber\" minOccurs=\"0\"/>\n// <xsd:element name=\"pPr\" type=\"CT_PPrGeneral\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"tblPr\" type=\"CT_TblPrBase\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"trPr\" type=\"CT_TrPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"tcPr\" type=\"CT_TcPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n// <xsd:element name=\"tblStylePr\" type=\"CT_TblStylePr\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n// </xsd:sequence>\n// <xsd:attribute name=\"type\" type=\"ST_StyleType\" use=\"optional\"/>\n// <xsd:attribute name=\"styleId\" type=\"s:ST_String\" use=\"optional\"/>\n// <xsd:attribute name=\"default\" type=\"s:ST_OnOff\" use=\"optional\"/>\n// <xsd:attribute name=\"customStyle\" type=\"s:ST_OnOff\" use=\"optional\"/>\n// </xsd:complexType>\n\n/**\n * Attributes for style elements.\n *\n * @property type - Type of style (paragraph, character, table, numbering)\n * @property styleId - Unique identifier for the style\n * @property default - Whether this is the default style for its type\n * @property customStyle - Whether this is a custom user-defined style\n */\nexport interface StyleAttributes {\n /** Type of style (paragraph, character, table, numbering) */\n readonly type?: string;\n /** Unique identifier for the style */\n readonly styleId?: string;\n /** Whether this is the default style for its type */\n readonly default?: boolean;\n /** Whether this is a custom user-defined style */\n readonly customStyle?: string;\n}\n\n/**\n * Options for configuring a style.\n *\n * @property name - Display name of the style\n * @property basedOn - Style ID that this style inherits from (must be same type)\n * @property next - Style to automatically apply to the next paragraph\n * @property link - Linked style ID for paragraph/character style pairing\n * @property uiPriority - Priority for displaying in the UI (lower numbers appear first)\n * @property semiHidden - Whether the style is semi-hidden in the UI\n * @property unhideWhenUsed - Whether the style should unhide when used\n * @property quickFormat - Whether the style appears in the quick format gallery\n */\nexport interface StyleOptions {\n /** Display name of the style */\n readonly name?: string;\n /**\n * Specifies the style upon which the current style is based-that is, the style from which the current style inherits. It is the mechanism for implementing style inheritance.\n * Note that if the type of the current style must match the type of the style upon which it is based or the basedOn element will be ignored.\n * However, if the current style is a numbering style, then the `basedOn` element is ignored.\n *\n * **WARNING**: You cannot set `basedOn` to be the same as `name`. This is akin to inheriting from itself. This creates a cyclic dependency and cause undesirable behavior.\n */\n readonly basedOn?: string;\n /** Style to automatically apply to the next paragraph */\n readonly next?: string;\n /** Linked style ID for paragraph/character style pairing */\n readonly link?: string;\n /** Priority for displaying in the UI (lower numbers appear first) */\n readonly uiPriority?: number;\n /** Whether the style is semi-hidden in the UI */\n readonly semiHidden?: boolean;\n /** Whether the style should unhide when used */\n readonly unhideWhenUsed?: boolean;\n /** Whether the style appears in the quick format gallery */\n readonly quickFormat?: boolean;\n /**\n * Table style overrides for specific table regions.\n *\n * Each override applies formatting to a specific region (first row,\n * last column, banding, etc.) within a table style.\n */\n readonly tableStyleOverrides?: readonly TableStyleOverrideOptions[];\n}\n\n/**\n * Represents a base style definition in a WordprocessingML document.\n *\n * This is the base class for paragraph and character styles. It defines common\n * style properties such as name, inheritance (basedOn), UI priority, and visibility.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Style\">\n * <xsd:sequence>\n * <xsd:element name=\"name\" type=\"CT_String\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"aliases\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"basedOn\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"next\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"link\" type=\"CT_String\" minOccurs=\"0\"/>\n * <xsd:element name=\"autoRedefine\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"hidden\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"uiPriority\" type=\"CT_DecimalNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"semiHidden\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"unhideWhenUsed\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"qFormat\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"locked\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"personal\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"personalCompose\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"personalReply\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"rsid\" type=\"CT_LongHexNumber\" minOccurs=\"0\"/>\n * <xsd:element name=\"pPr\" type=\"CT_PPrGeneral\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblPr\" type=\"CT_TblPrBase\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"trPr\" type=\"CT_TrPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tcPr\" type=\"CT_TcPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"tblStylePr\" type=\"CT_TblStylePr\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"type\" type=\"ST_StyleType\" use=\"optional\"/>\n * <xsd:attribute name=\"styleId\" type=\"s:ST_String\" use=\"optional\"/>\n * <xsd:attribute name=\"default\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * <xsd:attribute name=\"customStyle\" type=\"s:ST_OnOff\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // This is typically extended by StyleForParagraph or StyleForCharacter\n * // See those classes for usage examples\n * ```\n */\nexport class Style extends XmlComponent {\n public constructor(attributes: StyleAttributes, options: StyleOptions) {\n super(\"w:style\");\n this.root.push({\n _attr: {\n ...(attributes.type !== undefined ? { \"w:type\": attributes.type } : {}),\n ...(attributes.styleId !== undefined ? { \"w:styleId\": attributes.styleId } : {}),\n ...(attributes.default !== undefined ? { \"w:default\": attributes.default } : {}),\n ...(attributes.customStyle !== undefined\n ? { \"w:customStyle\": attributes.customStyle }\n : {}),\n },\n });\n if (options.name) {\n this.root.push(new Name(options.name));\n }\n\n if (options.basedOn) {\n this.root.push(stringValObj(\"w:basedOn\", options.basedOn));\n }\n\n if (options.next) {\n this.root.push(stringValObj(\"w:next\", options.next));\n }\n\n if (options.link) {\n this.root.push(stringValObj(\"w:link\", options.link));\n }\n\n if (options.uiPriority !== undefined) {\n this.root.push(new UiPriority(options.uiPriority));\n }\n\n if (options.semiHidden !== undefined) {\n this.root.push(onOffObj(\"w:semiHidden\", options.semiHidden));\n }\n\n if (options.unhideWhenUsed !== undefined) {\n this.root.push(onOffObj(\"w:unhideWhenUsed\", options.unhideWhenUsed));\n }\n\n if (options.quickFormat !== undefined) {\n this.root.push(onOffObj(\"w:qFormat\", options.quickFormat));\n }\n\n if (options.tableStyleOverrides) {\n for (const override of options.tableStyleOverrides) {\n this.root.push(createTableStyleOverride(override));\n }\n }\n }\n}\n","/**\n * Paragraph style module for WordprocessingML documents.\n *\n * Paragraph styles define formatting that applies to entire paragraphs.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { ParagraphProperties } from \"@file/paragraph\";\nimport type { IParagraphStylePropertiesOptions, RunStylePropertiesOptions } from \"@file/paragraph\";\nimport { RunProperties } from \"@file/paragraph/run/properties\";\n\nimport { Style } from \"./style\";\nimport type { StyleOptions } from \"./style\";\n\n/**\n * Base options for paragraph style configuration.\n *\n * @property paragraph - Paragraph properties (alignment, spacing, indentation, etc.)\n * @property run - Run properties that apply to text within this paragraph style\n */\nexport type IBaseParagraphStyleOptions = {\n /** Paragraph properties (alignment, spacing, indentation, etc.) */\n readonly paragraph?: IParagraphStylePropertiesOptions;\n /** Run properties that apply to text within this paragraph style */\n readonly run?: RunStylePropertiesOptions;\n} & StyleOptions;\n\n/**\n * Options for creating a paragraph style.\n *\n * @property id - Unique identifier for the paragraph style\n */\nexport type IParagraphStyleOptions = {\n /** Unique identifier for the paragraph style */\n readonly id: string;\n} & IBaseParagraphStyleOptions;\n\n/**\n * Represents a paragraph style in a WordprocessingML document.\n *\n * Paragraph styles apply formatting to entire paragraphs, including both\n * paragraph-level properties (spacing, alignment, indentation) and\n * run-level properties (font, size, color) for text within the paragraph.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Style\">\n * <xsd:sequence>\n * <!-- Style elements including pPr for paragraph properties -->\n * <xsd:element name=\"pPr\" type=\"CT_PPrGeneral\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"type\" type=\"ST_StyleType\" use=\"optional\"/>\n * <xsd:attribute name=\"styleId\" type=\"s:ST_String\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a custom heading style\n * new StyleForParagraph({\n * id: \"CustomHeading\",\n * name: \"Custom Heading\",\n * basedOn: \"Normal\",\n * paragraph: {\n * spacing: { before: 240, after: 120 },\n * alignment: AlignmentType.LEFT\n * },\n * run: {\n * size: 28,\n * bold: true,\n * color: \"2E74B5\"\n * }\n * });\n * ```\n */\nexport class StyleForParagraph extends Style {\n private readonly paragraphProperties: ParagraphProperties;\n private readonly runProperties: RunProperties;\n\n public constructor(options: IParagraphStyleOptions) {\n super({ styleId: options.id, type: \"paragraph\" }, options);\n\n this.paragraphProperties = new ParagraphProperties(options.paragraph);\n this.runProperties = new RunProperties(options.run);\n\n this.root.push(this.paragraphProperties);\n this.root.push(this.runProperties);\n }\n}\n","/**\n * Character style module for WordprocessingML documents.\n *\n * Character styles define formatting that applies to individual text runs.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { RunProperties } from \"@file/paragraph/run/properties\";\nimport type { RunStylePropertiesOptions } from \"@file/paragraph/run/properties\";\n\nimport { Style } from \"./style\";\nimport type { StyleOptions } from \"./style\";\n\n/**\n * Base options for character style configuration.\n *\n * @property run - Run properties (font, size, color, etc.) for this character style\n */\nexport type IBaseCharacterStyleOptions = {\n /** Run properties (font, size, color, etc.) for this character style */\n readonly run?: RunStylePropertiesOptions;\n} & StyleOptions;\n\n/**\n * Options for creating a character style.\n *\n * @property id - Unique identifier for the character style\n */\nexport type ICharacterStyleOptions = {\n /** Unique identifier for the character style */\n readonly id: string;\n} & IBaseCharacterStyleOptions;\n\n/**\n * Represents a character style in a WordprocessingML document.\n *\n * Character styles apply formatting to individual runs of text within a paragraph,\n * such as font, size, color, bold, italic, and other text-level formatting.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Style\">\n * <xsd:sequence>\n * <!-- Style elements including rPr for run properties -->\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"type\" type=\"ST_StyleType\" use=\"optional\"/>\n * <xsd:attribute name=\"styleId\" type=\"s:ST_String\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create a custom character style for highlighting\n * new StyleForCharacter({\n * id: \"Highlight\",\n * name: \"Highlight Text\",\n * basedOn: \"DefaultParagraphFont\",\n * run: {\n * color: \"FF0000\",\n * bold: true\n * }\n * });\n * ```\n */\nexport class StyleForCharacter extends Style {\n private readonly runProperties: RunProperties;\n\n public constructor(options: ICharacterStyleOptions) {\n super(\n { styleId: options.id, type: \"character\" },\n {\n uiPriority: 99,\n unhideWhenUsed: true,\n ...options,\n },\n );\n\n this.runProperties = new RunProperties(options.run);\n this.root.push(this.runProperties);\n }\n}\n","/**\n * Default styles module for WordprocessingML documents.\n *\n * Provides pre-configured style classes for common document elements like headings,\n * hyperlinks, and footnotes.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { LineRuleType } from \"@file/paragraph\";\nimport { UnderlineType } from \"@file/paragraph/run/underline\";\n\nimport { StyleForCharacter } from \"./character-style\";\nimport type { IBaseCharacterStyleOptions } from \"./character-style\";\nimport { StyleForParagraph } from \"./paragraph-style\";\nimport type { IBaseParagraphStyleOptions, IParagraphStyleOptions } from \"./paragraph-style\";\n\n/**\n * Base class for heading styles.\n *\n * Provides common configuration for heading styles, including basedOn=\"Normal\"\n * and quickFormat enabled.\n *\n * @example\n * ```typescript\n * // Typically extended by specific heading classes\n * new HeadingStyle({\n * id: \"CustomHeading\",\n * name: \"Custom Heading\",\n * run: { bold: true, size: 28 }\n * });\n * ```\n */\nexport class HeadingStyle extends StyleForParagraph {\n public constructor(options: IParagraphStyleOptions) {\n super({\n basedOn: \"Normal\",\n next: \"Normal\",\n quickFormat: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Title paragraph style.\n *\n * Used for document titles with larger font size and emphasis.\n *\n * @example\n * ```typescript\n * new TitleStyle({\n * run: { size: 56, bold: true }\n * });\n * ```\n */\nexport class TitleStyle extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Title\",\n name: \"Title\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Heading 1 paragraph style.\n *\n * First-level heading style for major document sections.\n *\n * @example\n * ```typescript\n * new Heading1Style({\n * run: { size: 32, color: \"2E74B5\" }\n * });\n * ```\n */\nexport class Heading1Style extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Heading1\",\n name: \"Heading 1\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Heading 2 paragraph style.\n *\n * Second-level heading style for subsections.\n */\nexport class Heading2Style extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Heading2\",\n name: \"Heading 2\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Heading 3 paragraph style.\n *\n * Third-level heading style for sub-subsections.\n */\nexport class Heading3Style extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Heading3\",\n name: \"Heading 3\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Heading 4 paragraph style.\n *\n * Fourth-level heading style for nested sections.\n */\nexport class Heading4Style extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Heading4\",\n name: \"Heading 4\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Heading 5 paragraph style.\n *\n * Fifth-level heading style for deeply nested sections.\n */\nexport class Heading5Style extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Heading5\",\n name: \"Heading 5\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Heading 6 paragraph style.\n *\n * Sixth-level heading style for the deepest nested sections.\n */\nexport class Heading6Style extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Heading6\",\n name: \"Heading 6\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the Strong paragraph style.\n *\n * Used for emphasizing important paragraphs with bold formatting.\n */\nexport class StrongStyle extends HeadingStyle {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n id: \"Strong\",\n name: \"Strong\",\n ...options,\n });\n }\n}\n\n/**\n * Represents the List Paragraph style.\n *\n * Used for paragraphs within numbered or bulleted lists.\n */\nexport class ListParagraph extends StyleForParagraph {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n basedOn: \"Normal\",\n id: \"ListParagraph\",\n name: \"List Paragraph\",\n quickFormat: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Footnote Text paragraph style.\n *\n * Used for the text content of footnotes with smaller font size and tighter spacing.\n */\nexport class FootnoteText extends StyleForParagraph {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n basedOn: \"Normal\",\n id: \"FootnoteText\",\n link: \"FootnoteTextChar\",\n name: \"footnote text\",\n paragraph: {\n spacing: {\n after: 0,\n line: 240,\n lineRule: LineRuleType.AUTO,\n },\n },\n run: {\n size: 20,\n },\n semiHidden: true,\n uiPriority: 99,\n unhideWhenUsed: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Footnote Reference character style.\n *\n * Used for footnote reference numbers in the main text, displayed as superscript.\n */\nexport class FootnoteReferenceStyle extends StyleForCharacter {\n public constructor(options: IBaseCharacterStyleOptions) {\n super({\n basedOn: \"DefaultParagraphFont\",\n id: \"FootnoteReference\",\n name: \"footnote reference\",\n run: {\n superScript: true,\n },\n semiHidden: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Footnote Text Char character style.\n *\n * Character style linked to FootnoteText paragraph style for consistent formatting.\n */\nexport class FootnoteTextChar extends StyleForCharacter {\n public constructor(options: IBaseCharacterStyleOptions) {\n super({\n basedOn: \"DefaultParagraphFont\",\n id: \"FootnoteTextChar\",\n link: \"FootnoteText\",\n name: \"Footnote Text Char\",\n run: {\n size: 20,\n },\n semiHidden: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Endnote Text paragraph style.\n *\n * Used for the text content of endnotes with smaller font size and tighter spacing.\n */\nexport class EndnoteText extends StyleForParagraph {\n public constructor(options: IBaseParagraphStyleOptions) {\n super({\n basedOn: \"Normal\",\n id: \"EndnoteText\",\n link: \"EndnoteTextChar\",\n name: \"endnote text\",\n paragraph: {\n spacing: {\n after: 0,\n line: 240,\n lineRule: LineRuleType.AUTO,\n },\n },\n run: {\n size: 20,\n },\n semiHidden: true,\n uiPriority: 99,\n unhideWhenUsed: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Endnote Reference character style.\n *\n * Used for endnote reference numbers in the main text, displayed as superscript.\n */\nexport class EndnoteReferenceStyle extends StyleForCharacter {\n public constructor(options: IBaseCharacterStyleOptions) {\n super({\n basedOn: \"DefaultParagraphFont\",\n id: \"EndnoteReference\",\n name: \"endnote reference\",\n run: {\n superScript: true,\n },\n semiHidden: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Endnote Text Char character style.\n *\n * Character style linked to EndnoteText paragraph style for consistent formatting.\n */\nexport class EndnoteTextChar extends StyleForCharacter {\n public constructor(options: IBaseCharacterStyleOptions) {\n super({\n basedOn: \"DefaultParagraphFont\",\n id: \"EndnoteTextChar\",\n link: \"EndnoteText\",\n name: \"Endnote Text Char\",\n run: {\n size: 20,\n },\n semiHidden: true,\n ...options,\n });\n }\n}\n\n/**\n * Represents the Hyperlink character style.\n *\n * Used for hyperlinks with blue color and single underline formatting.\n */\nexport class HyperlinkStyle extends StyleForCharacter {\n public constructor(options: IBaseCharacterStyleOptions) {\n super({\n basedOn: \"DefaultParagraphFont\",\n id: \"Hyperlink\",\n name: \"Hyperlink\",\n run: {\n color: \"0563C1\",\n underline: {\n type: UnderlineType.SINGLE,\n },\n },\n ...options,\n });\n }\n}\n","/**\n * Styles module for WordprocessingML documents.\n *\n * This module provides style definitions for paragraphs and characters.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport type { DefaultStylesOptions } from \"@file/styles/factory\";\nimport { XmlComponent } from \"@file/xml-components\";\nimport type { BaseXmlComponent, IXmlableObject, ImportedXmlComponent } from \"@file/xml-components\";\n\nimport { StyleForCharacter, StyleForParagraph } from \"./style\";\nimport type { ICharacterStyleOptions } from \"./style/character-style\";\nimport type { IParagraphStyleOptions } from \"./style/paragraph-style\";\n\n/**\n * Options for configuring document styles.\n *\n * @property default - Default styles for document, headings, and common elements\n * @property initialStyles - Initial base XML component for styles root element\n * @property paragraphStyles - Array of custom paragraph style definitions\n * @property characterStyles - Array of custom character style definitions\n * @property importedStyles - Array of styles imported from external sources\n *\n * @see {@link Styles}\n */\nexport interface StylesOptions {\n /** Default styles for document, headings, and common elements */\n readonly default?: DefaultStylesOptions;\n /** Initial base XML component for styles root element */\n readonly initialStyles?: BaseXmlComponent | IXmlableObject;\n /** Array of custom paragraph style definitions */\n readonly paragraphStyles?: readonly IParagraphStyleOptions[];\n /** Array of custom character style definitions */\n readonly characterStyles?: readonly ICharacterStyleOptions[];\n /** Array of styles imported from external sources */\n readonly importedStyles?: readonly (\n | XmlComponent\n | StyleForParagraph\n | StyleForCharacter\n | ImportedXmlComponent\n )[];\n}\n\n/**\n * Represents the styles definitions in a WordprocessingML document.\n *\n * The styles element contains document defaults, latent styles, and\n * individual style definitions for paragraphs and characters. Styles provide\n * a way to define consistent formatting across a document.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Styles\">\n * <xsd:sequence>\n * <xsd:element name=\"docDefaults\" type=\"CT_DocDefaults\" minOccurs=\"0\"/>\n * <xsd:element name=\"latentStyles\" type=\"CT_LatentStyles\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"style\" type=\"CT_Style\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Create styles with custom paragraph and character styles\n * new Styles({\n * paragraphStyles: [{\n * id: \"CustomHeading\",\n * name: \"Custom Heading\",\n * basedOn: \"Normal\",\n * run: { bold: true, size: 28 }\n * }],\n * characterStyles: [{\n * id: \"Highlight\",\n * name: \"Highlight\",\n * run: { color: \"FF0000\" }\n * }]\n * });\n * ```\n */\nexport class Styles extends XmlComponent {\n public constructor(options: StylesOptions) {\n super(\"w:styles\");\n\n if (options.initialStyles) {\n this.root.push(options.initialStyles);\n }\n\n if (options.importedStyles) {\n for (const style of options.importedStyles) {\n this.root.push(style);\n }\n }\n\n if (options.paragraphStyles) {\n for (const style of options.paragraphStyles) {\n this.root.push(new StyleForParagraph(style));\n }\n }\n\n if (options.characterStyles) {\n for (const style of options.characterStyles) {\n this.root.push(new StyleForCharacter(style));\n }\n }\n }\n}\n","import { ParagraphProperties } from \"@file/paragraph/properties\";\nimport type { IParagraphStylePropertiesOptions } from \"@file/paragraph/properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents default paragraph properties in a WordprocessingML document.\n *\n * This element defines the default paragraph formatting properties that apply\n * to all paragraphs in the document unless overridden.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PPrDefault\">\n * <xsd:sequence>\n * <xsd:element name=\"pPr\" type=\"CT_PPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set default paragraph spacing\n * new ParagraphPropertiesDefaults({\n * spacing: { after: 200, line: 276 }\n * });\n * ```\n */\nexport class ParagraphPropertiesDefaults extends XmlComponent {\n public constructor(options?: IParagraphStylePropertiesOptions) {\n super(\"w:pPrDefault\");\n this.root.push(new ParagraphProperties(options));\n }\n}\n","import { RunProperties } from \"@file/paragraph/run/properties\";\nimport type { RunStylePropertiesOptions } from \"@file/paragraph/run/properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Represents default run properties in a WordprocessingML document.\n *\n * This element defines the default text run formatting properties that apply\n * to all text runs in the document unless overridden by styles or direct formatting.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RPrDefault\">\n * <xsd:sequence>\n * <xsd:element name=\"rPr\" type=\"CT_RPr\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set default font and size\n * new RunPropertiesDefaults({\n * font: \"Calibri\",\n * size: 22\n * });\n * ```\n */\nexport class RunPropertiesDefaults extends XmlComponent {\n public constructor(options?: RunStylePropertiesOptions) {\n super(\"w:rPrDefault\");\n\n this.root.push(new RunProperties(options));\n }\n}\n","/**\n * Document defaults module for WordprocessingML styles.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport type { IParagraphStylePropertiesOptions } from \"@file/paragraph/properties\";\nimport type { RunStylePropertiesOptions } from \"@file/paragraph/run/properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { ParagraphPropertiesDefaults } from \"./paragraph-properties\";\nimport { RunPropertiesDefaults } from \"./run-properties\";\n\n/**\n * Options for configuring document-wide default formatting.\n *\n * @property paragraph - Default paragraph properties applied to all paragraphs\n * @property run - Default run properties applied to all text runs\n */\nexport interface DocumentDefaultsOptions {\n /** Default paragraph properties applied to all paragraphs */\n readonly paragraph?: IParagraphStylePropertiesOptions;\n /** Default run properties applied to all text runs */\n readonly run?: RunStylePropertiesOptions;\n}\n\n/**\n * Represents document-wide default formatting in a WordprocessingML document.\n *\n * Document defaults define the base formatting properties that apply to all\n * paragraphs and runs in a document unless overridden by a style or direct formatting.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DocDefaults\">\n * <xsd:sequence>\n * <xsd:element name=\"rPrDefault\" type=\"CT_RPrDefault\" minOccurs=\"0\"/>\n * <xsd:element name=\"pPrDefault\" type=\"CT_PPrDefault\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Set default font and spacing for the document\n * new DocumentDefaults({\n * run: {\n * font: \"Calibri\",\n * size: 22\n * },\n * paragraph: {\n * spacing: { after: 200, line: 276 }\n * }\n * });\n * ```\n */\nexport class DocumentDefaults extends XmlComponent {\n private readonly runPropertiesDefaults: RunPropertiesDefaults;\n private readonly paragraphPropertiesDefaults: ParagraphPropertiesDefaults;\n\n public constructor(options: DocumentDefaultsOptions) {\n super(\"w:docDefaults\");\n\n this.runPropertiesDefaults = new RunPropertiesDefaults(options.run);\n this.paragraphPropertiesDefaults = new ParagraphPropertiesDefaults(options.paragraph);\n\n this.root.push(this.runPropertiesDefaults);\n this.root.push(this.paragraphPropertiesDefaults);\n }\n}\n","import { ImportedRootElementAttributes, convertToXmlComponent } from \"@file/xml-components\";\nimport type { ImportedXmlComponent } from \"@file/xml-components\";\n/**\n * External styles factory module for WordprocessingML documents.\n *\n * Provides functionality to import and parse styles from external XML sources.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { xml2js } from \"@office-open/xml\";\nimport type { Element as XMLElement } from \"@office-open/xml\";\n\nimport type { StylesOptions } from \"./styles\";\n\n/**\n * Factory for creating styles from external XML sources.\n *\n * This factory parses styles from XML (typically from a styles.xml file)\n * and converts them into Styles components that can be used in the document.\n *\n * @example\n * ```typescript\n * // Import styles from an external styles.xml file\n * const factory = new ExternalStylesFactory();\n * const xmlData = '<?xml version=\"1.0\"?><w:styles>...</w:styles>';\n * const styles = factory.newInstance(xmlData);\n * ```\n */\nexport class ExternalStylesFactory {\n /**\n * Creates new Styles based on the given XML data.\n *\n * Parses the styles XML and converts them to XmlComponent instances.\n *\n * Example content from styles.xml:\n * ```xml\n * <?xml version=\"1.0\"?>\n * <w:styles xmlns:mc=\"some schema\" ...>\n * <w:style w:type=\"paragraph\" w:styleId=\"Heading1\">\n * <w:name w:val=\"heading 1\"/>\n * ...\n * </w:style>\n * <w:style w:type=\"paragraph\" w:styleId=\"Heading2\">\n * <w:name w:val=\"heading 2\"/>\n * ...\n * </w:style>\n * <w:docDefaults>...</w:docDefaults>\n * </w:styles>\n * ```\n *\n * @param xmlData - XML string containing styles data from styles.xml\n * @returns Styles object containing all parsed styles\n * @throws Error if styles element cannot be found in the XML\n */\n public newInstance(xmlData: string): StylesOptions {\n const xmlObj = xml2js(xmlData, { compact: false }) as XMLElement;\n\n let stylesXmlElement: XMLElement | undefined;\n for (const xmlElm of xmlObj.elements || []) {\n if (xmlElm.name === \"w:styles\") {\n stylesXmlElement = xmlElm;\n }\n }\n if (stylesXmlElement === undefined) {\n return {\n importedStyles: [],\n initialStyles: new ImportedRootElementAttributes({}),\n };\n }\n\n const stylesElements = stylesXmlElement.elements || [];\n\n return {\n importedStyles: stylesElements.map(\n (childElm) => convertToXmlComponent(childElm) as ImportedXmlComponent,\n ),\n initialStyles: new ImportedRootElementAttributes(stylesXmlElement.attributes),\n };\n }\n}\n","import { buildDocumentAttributes } from \"../document/document-attributes\";\n/**\n * Factory module for creating default document styles.\n *\n * Provides a factory class that creates pre-configured styles for common document elements.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { DocumentDefaults } from \"./defaults\";\nimport type { DocumentDefaultsOptions } from \"./defaults\";\nimport {\n EndnoteReferenceStyle,\n EndnoteText,\n EndnoteTextChar,\n FootnoteReferenceStyle,\n FootnoteText,\n FootnoteTextChar,\n Heading1Style,\n Heading2Style,\n Heading3Style,\n Heading4Style,\n Heading5Style,\n Heading6Style,\n HyperlinkStyle,\n ListParagraph,\n StrongStyle,\n TitleStyle,\n} from \"./style\";\nimport type { IBaseCharacterStyleOptions, IBaseParagraphStyleOptions } from \"./style\";\nimport type { StylesOptions } from \"./styles\";\n\n/**\n * Options for configuring default document styles.\n *\n * Allows customization of built-in styles for common document elements.\n *\n * @property document - Document-wide default formatting\n * @property title - Title paragraph style options\n * @property heading1 - Heading 1 paragraph style options\n * @property heading2 - Heading 2 paragraph style options\n * @property heading3 - Heading 3 paragraph style options\n * @property heading4 - Heading 4 paragraph style options\n * @property heading5 - Heading 5 paragraph style options\n * @property heading6 - Heading 6 paragraph style options\n * @property strong - Strong paragraph style options\n * @property listParagraph - List paragraph style options\n * @property hyperlink - Hyperlink character style options\n * @property footnoteReference - Footnote reference character style options\n * @property footnoteText - Footnote text paragraph style options\n * @property footnoteTextChar - Footnote text character style options\n */\nexport interface DefaultStylesOptions {\n /** Document-wide default formatting */\n readonly document?: DocumentDefaultsOptions;\n /** Title paragraph style options */\n readonly title?: IBaseParagraphStyleOptions;\n /** Heading 1 paragraph style options */\n readonly heading1?: IBaseParagraphStyleOptions;\n /** Heading 2 paragraph style options */\n readonly heading2?: IBaseParagraphStyleOptions;\n /** Heading 3 paragraph style options */\n readonly heading3?: IBaseParagraphStyleOptions;\n /** Heading 4 paragraph style options */\n readonly heading4?: IBaseParagraphStyleOptions;\n /** Heading 5 paragraph style options */\n readonly heading5?: IBaseParagraphStyleOptions;\n /** Heading 6 paragraph style options */\n readonly heading6?: IBaseParagraphStyleOptions;\n /** Strong paragraph style options */\n readonly strong?: IBaseParagraphStyleOptions;\n /** List paragraph style options */\n readonly listParagraph?: IBaseParagraphStyleOptions;\n /** Hyperlink character style options */\n readonly hyperlink?: IBaseCharacterStyleOptions;\n /** Footnote reference character style options */\n readonly footnoteReference?: IBaseCharacterStyleOptions;\n /** Footnote text paragraph style options */\n readonly footnoteText?: IBaseParagraphStyleOptions;\n /** Footnote text character style options */\n readonly footnoteTextChar?: IBaseCharacterStyleOptions;\n readonly endnoteReference?: IBaseCharacterStyleOptions;\n readonly endnoteText?: IBaseParagraphStyleOptions;\n readonly endnoteTextChar?: IBaseCharacterStyleOptions;\n}\n\nlet cachedDefaultStyles: StylesOptions | null = null;\n\n/**\n * Factory for creating default document styles.\n *\n * This factory creates a complete set of default styles for common document elements\n * such as headings, hyperlinks, and footnotes. When no custom options are provided,\n * a cached instance is reused across documents.\n *\n * @example\n * ```typescript\n * // Create default styles with custom heading formatting\n * const factory = new DefaultStylesFactory();\n * const styles = factory.newInstance({\n * heading1: {\n * run: { color: \"FF0000\", size: 32 }\n * },\n * heading2: {\n * run: { color: \"00FF00\", size: 26 }\n * }\n * });\n * ```\n */\nexport class DefaultStylesFactory {\n public newInstance(options: DefaultStylesOptions = {}): StylesOptions {\n if (Object.keys(options).length === 0) {\n if (!cachedDefaultStyles) {\n cachedDefaultStyles = this.build({});\n }\n return cachedDefaultStyles;\n }\n return this.build(options);\n }\n\n private build(options: DefaultStylesOptions): StylesOptions {\n return {\n importedStyles: [\n new DocumentDefaults(options.document ?? {}),\n new TitleStyle({\n run: {\n size: 56,\n },\n ...options.title,\n }),\n new Heading1Style(options.heading1 || {}),\n new Heading2Style(options.heading2 || {}),\n new Heading3Style(options.heading3 || {}),\n new Heading4Style(options.heading4 || {}),\n new Heading5Style(options.heading5 || {}),\n new Heading6Style(options.heading6 || {}),\n new StrongStyle({\n run: {\n bold: true,\n },\n ...options.strong,\n }),\n new ListParagraph(options.listParagraph || {}),\n new HyperlinkStyle(options.hyperlink || {}),\n new FootnoteReferenceStyle(options.footnoteReference || {}),\n new FootnoteText(options.footnoteText || {}),\n new FootnoteTextChar(options.footnoteTextChar || {}),\n new EndnoteReferenceStyle(options.endnoteReference || {}),\n new EndnoteText(options.endnoteText || {}),\n new EndnoteTextChar(options.endnoteTextChar || {}),\n ],\n initialStyles: buildDocumentAttributes([\"mc\", \"r\", \"w\", \"w14\", \"w15\"], \"w14 w15\"),\n };\n }\n}\n","/**\n * Sub-document collection module for managing sub-document parts.\n *\n * @module\n */\n\n/**\n * Stores sub-document data for later serialization by the compiler.\n */\nexport interface SubDocData {\n /** Raw document data (.docx bytes) */\n readonly data: Uint8Array;\n /** Part sub-path within word/ (e.g., \"subdocs/subdoc1.docx\") */\n readonly path: string;\n}\n\n/**\n * Manages sub-document parts in a document.\n */\nexport class SubDocCollection {\n private readonly map: Map<string, SubDocData>;\n\n public constructor() {\n this.map = new Map<string, SubDocData>();\n }\n\n public addSubDoc(key: string, data: SubDocData): void {\n this.map.set(key, data);\n }\n\n public get array(): readonly SubDocData[] {\n return [...this.map.values()];\n }\n}\n","import { AltChunkCollection } from \"./alt-chunk/alt-chunk-collection\";\n/**\n * File module for WordprocessingML documents.\n *\n * The File class is the main entry point for creating DOCX documents.\n * It manages all document parts including content, styles, numbering, and media.\n *\n * @module\n */\nimport { AppProperties } from \"./app-properties/app-properties\";\nimport { Bibliography } from \"./bibliography\";\nimport { ChartCollection } from \"./chart/chart-collection\";\nimport { coerceSectionChild } from \"./coerce\";\nimport { ContentTypes } from \"./content-types/content-types\";\nimport { CoreProperties } from \"./core-properties\";\nimport type { PropertiesOptions } from \"./core-properties\";\nimport { CustomProperties } from \"./custom-properties\";\nimport { DocumentWrapper } from \"./document-wrapper\";\nimport { HeaderFooterReferenceType } from \"./document/body/section-properties\";\nimport type { ISectionPropertiesOptions } from \"./document/body/section-properties\";\nimport { EndnotesWrapper } from \"./endnotes-wrapper\";\nimport { FontWrapper } from \"./fonts/font-wrapper\";\nimport { FooterWrapper } from \"./footer-wrapper\";\nimport type { DocumentFooter } from \"./footer-wrapper\";\nimport { FootnotesWrapper } from \"./footnotes-wrapper\";\nimport { Footer, Header } from \"./header\";\nimport { HeaderWrapper } from \"./header-wrapper\";\nimport type { DocumentHeader } from \"./header-wrapper\";\nimport { Media } from \"./media\";\nimport { Numbering } from \"./numbering\";\nimport { Paragraph } from \"./paragraph/paragraph\";\nimport { Comments } from \"./paragraph/run/comment-run\";\nimport { Relationships } from \"./relationships\";\nimport type { SectionChild } from \"./section-child\";\nimport { Settings } from \"./settings\";\nimport { SmartArtCollection } from \"./smartart/smartart-collection\";\nimport { Styles } from \"./styles\";\nimport { ExternalStylesFactory } from \"./styles/external-styles-factory\";\nimport { DefaultStylesFactory } from \"./styles/factory\";\nimport { SubDocCollection } from \"./sub-doc/sub-doc-collection\";\n\n/**\n * Options for a document section.\n *\n * Each section can have its own headers, footers, and page properties.\n *\n * @property headers - Optional header definitions for the section\n * @property headers.default - Default header for all pages (when first/even not specified)\n * @property headers.first - Header for the first page of the section\n * @property headers.even - Header for even-numbered pages\n * @property footers - Optional footer definitions for the section\n * @property footers.default - Default footer for all pages (when first/even not specified)\n * @property footers.first - Footer for the first page of the section\n * @property footers.even - Footer for even-numbered pages\n * @property properties - Section properties such as page size, margins, and orientation\n * @property children - Array of content elements (paragraphs, tables, etc.) for this section\n */\nexport interface SectionOptions {\n /** Optional header definitions for the section. */\n readonly headers?: {\n /** Default header for all pages (when first/even not specified). */\n readonly default?: Header | readonly SectionChild[];\n /** Header for the first page of the section. */\n readonly first?: Header | readonly SectionChild[];\n /** Header for even-numbered pages. */\n readonly even?: Header | readonly SectionChild[];\n };\n /** Optional footer definitions for the section. */\n readonly footers?: {\n /** Default footer for all pages (when first/even not specified). */\n readonly default?: Footer | readonly SectionChild[];\n /** Footer for the first page of the section. */\n readonly first?: Footer | readonly SectionChild[];\n /** Footer for even-numbered pages. */\n readonly even?: Footer | readonly SectionChild[];\n };\n /** Section properties such as page size, margins, and orientation. */\n readonly properties?: ISectionPropertiesOptions;\n /** Array of content elements (paragraphs, tables, etc.) for this section. */\n readonly children: readonly SectionChild[];\n}\n\n/**\n * Represents a Word document file.\n *\n * The File class (exported as `Document`) is the main entry point for creating DOCX documents.\n * It manages all document components including content, styles, numbering, headers/footers,\n * and media. Documents are organized into sections, each of which can have its own page\n * settings, headers, and footers.\n *\n * This class handles the assembly of all OOXML parts required for a valid .docx file,\n * including relationships, content types, and document properties.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * // Simple document with one section\n * const doc = new Document({\n * sections: [{\n * children: [\n * new Paragraph(\"Hello World\"),\n * ],\n * }],\n * });\n *\n * // Document with multiple sections and headers/footers\n * const doc = new Document({\n * creator: \"John Doe\",\n * sections: [\n * {\n * headers: {\n * default: new Header({\n * children: [new Paragraph(\"Header Text\")],\n * }),\n * },\n * children: [\n * new Paragraph(\"Section 1 content\"),\n * ],\n * },\n * {\n * children: [\n * new Paragraph(\"Section 2 content\"),\n * ],\n * },\n * ],\n * });\n *\n * // Document with custom styles and numbering\n * const doc = new Document({\n * styles: {\n * paragraphStyles: [\n * {\n * id: \"MyHeading\",\n * name: \"My Heading\",\n * basedOn: \"Heading1\",\n * run: { bold: true, color: \"FF0000\" },\n * },\n * ],\n * },\n * numbering: {\n * config: [\n * {\n * reference: \"my-numbering\",\n * levels: [\n * { level: 0, format: \"decimal\", text: \"%1.\", alignment: \"left\" },\n * ],\n * },\n * ],\n * },\n * sections: [{\n * children: [new Paragraph(\"Content\")],\n * }],\n * });\n * ```\n */\nexport class File {\n private _currentRelationshipId: number = 1;\n\n public readonly document: DocumentWrapper;\n private readonly _headers: DocumentHeader[] = [];\n private readonly _footers: DocumentFooter[] = [];\n public readonly coreProperties: CoreProperties;\n public readonly numbering: Numbering;\n public readonly media: Media;\n public readonly charts: ChartCollection;\n public readonly smartArts: SmartArtCollection;\n public readonly altChunks: AltChunkCollection;\n public readonly subDocs: SubDocCollection;\n public readonly fileRelationships: Relationships;\n public readonly footNotes: FootnotesWrapper;\n public readonly endnotes: EndnotesWrapper;\n public readonly settings: Settings;\n public readonly contentTypes: ContentTypes;\n public readonly customProperties: CustomProperties;\n public readonly appProperties: AppProperties;\n public readonly styles: Styles;\n public readonly comments: Comments;\n public readonly bibliography: Bibliography | undefined;\n public readonly fontTable: FontWrapper;\n\n public constructor(options: PropertiesOptions) {\n this.coreProperties = new CoreProperties({\n ...options,\n creator: options.creator ?? \"Un-named\",\n lastModifiedBy: options.lastModifiedBy ?? \"Un-named\",\n revision: options.revision ?? 1,\n });\n\n this.numbering = new Numbering(options.numbering ? options.numbering : { config: [] });\n\n this.comments = new Comments(options.comments ?? { children: [] });\n this.bibliography = options.bibliography ? new Bibliography(options.bibliography) : undefined;\n this.fileRelationships = new Relationships();\n this.customProperties = new CustomProperties(options.customProperties ?? []);\n this.appProperties = new AppProperties();\n this.footNotes = new FootnotesWrapper();\n this.endnotes = new EndnotesWrapper();\n this.contentTypes = new ContentTypes();\n this.document = new DocumentWrapper({ background: options.background });\n this.settings = new Settings({\n compatibility: options.compatibility,\n compatibilityModeVersion: options.compatabilityModeVersion,\n defaultTabStop: options.defaultTabStop,\n evenAndOddHeaders: options.evenAndOddHeaderAndFooters ? true : false,\n characterSpacingControl: options.characterSpacingControl,\n hyphenation: {\n autoHyphenation: options.hyphenation?.autoHyphenation,\n consecutiveHyphenLimit: options.hyphenation?.consecutiveHyphenLimit,\n doNotHyphenateCaps: options.hyphenation?.doNotHyphenateCaps,\n hyphenationZone: options.hyphenation?.hyphenationZone,\n },\n trackRevisions: options.features?.trackRevisions,\n updateFields: options.features?.updateFields,\n documentProtection: options.features?.documentProtection,\n view: options.view,\n zoom: options.zoom,\n writeProtection: options.writeProtection,\n displayBackgroundShape:\n options.displayBackgroundShape ?? (options.background?.image ? true : undefined),\n embedTrueTypeFonts: options.embedTrueTypeFonts,\n embedSystemFonts: options.embedSystemFonts,\n saveSubsetFonts: options.saveSubsetFonts,\n docVars: options.docVars,\n colorSchemeMapping: options.colorSchemeMapping,\n });\n\n this.media = new Media();\n this.charts = new ChartCollection();\n this.smartArts = new SmartArtCollection();\n this.altChunks = new AltChunkCollection();\n this.subDocs = new SubDocCollection();\n\n if (options.externalStyles !== undefined) {\n const defaultFactory = new DefaultStylesFactory();\n const defaultStyles = defaultFactory.newInstance(options.styles?.default);\n const externalFactory = new ExternalStylesFactory();\n const externalStyles = externalFactory.newInstance(options.externalStyles);\n // External styles already have docDefaults + latentStyles + styles in XSD order.\n // Append only the style elements from default factory (skip its DocumentDefaults\n // to avoid a second docDefaults after style elements, which violates XSD sequence).\n const defaultStyleElements = defaultStyles.importedStyles!.slice(1);\n this.styles = new Styles({\n ...externalStyles,\n importedStyles: [...externalStyles.importedStyles!, ...defaultStyleElements],\n });\n } else if (options.styles) {\n const stylesFactory = new DefaultStylesFactory();\n const defaultStyles = stylesFactory.newInstance(options.styles.default);\n this.styles = new Styles({\n ...defaultStyles,\n ...options.styles,\n });\n } else {\n const stylesFactory = new DefaultStylesFactory();\n this.styles = new Styles(stylesFactory.newInstance());\n }\n\n this.addDefaultRelationships();\n\n if (this.bibliography) {\n this.contentTypes.addBibliography();\n }\n\n for (const section of options.sections) {\n this.addSection(section);\n }\n\n if (options.footnotes) {\n for (const key in options.footnotes) {\n const children = options.footnotes[key].children.map((p) =>\n p instanceof Paragraph ? p : new Paragraph(p),\n );\n this.footNotes.view.createFootNote(parseFloat(key), children);\n }\n }\n\n if (options.endnotes) {\n for (const key in options.endnotes) {\n const children = options.endnotes[key].children.map((p) =>\n p instanceof Paragraph ? p : new Paragraph(p),\n );\n this.endnotes.view.createEndnote(parseFloat(key), children);\n }\n }\n\n this.fontTable = new FontWrapper(options.fonts ?? []);\n }\n\n private addSection({ headers = {}, footers = {}, children, properties }: SectionOptions): void {\n this.document.view.body.addSection({\n ...properties,\n footerWrapperGroup: {\n default: footers.default ? this.createFooter(footers.default) : undefined,\n even: footers.even ? this.createFooter(footers.even) : undefined,\n first: footers.first ? this.createFooter(footers.first) : undefined,\n },\n headerWrapperGroup: {\n default: headers.default ? this.createHeader(headers.default) : undefined,\n even: headers.even ? this.createHeader(headers.even) : undefined,\n first: headers.first ? this.createHeader(headers.first) : undefined,\n },\n });\n\n for (const rawChild of children) {\n this.document.view.add(coerceSectionChild(rawChild));\n }\n }\n\n private createHeader(header: Header | readonly SectionChild[]): HeaderWrapper {\n const wrapper = new HeaderWrapper(this.media, this._currentRelationshipId++);\n\n const children = header instanceof Header ? header.options.children : header;\n for (const rawChild of children) {\n wrapper.add(coerceSectionChild(rawChild));\n }\n\n this.addHeaderToDocument(wrapper);\n return wrapper;\n }\n\n private createFooter(footer: Footer | readonly SectionChild[]): FooterWrapper {\n const wrapper = new FooterWrapper(this.media, this._currentRelationshipId++);\n\n const children = footer instanceof Footer ? footer.options.children : footer;\n for (const rawChild of children) {\n wrapper.add(coerceSectionChild(rawChild));\n }\n\n this.addFooterToDocument(wrapper);\n return wrapper;\n }\n\n private addHeaderToDocument(\n header: HeaderWrapper,\n type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType] = HeaderFooterReferenceType.DEFAULT,\n ): void {\n this._headers.push({ header, type });\n this.document.relationships.addRelationship(\n header.view.referenceId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header\",\n `header${this._headers.length}.xml`,\n );\n this.contentTypes.addHeader(this._headers.length);\n }\n\n private addFooterToDocument(\n footer: FooterWrapper,\n type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType] = HeaderFooterReferenceType.DEFAULT,\n ): void {\n this._footers.push({ footer, type });\n this.document.relationships.addRelationship(\n footer.view.referenceId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer\",\n `footer${this._footers.length}.xml`,\n );\n this.contentTypes.addFooter(this._footers.length);\n }\n\n private addDefaultRelationships(): void {\n this.fileRelationships.addRelationship(\n 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"word/document.xml\",\n );\n this.fileRelationships.addRelationship(\n 2,\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"docProps/core.xml\",\n );\n this.fileRelationships.addRelationship(\n 3,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"docProps/app.xml\",\n );\n this.fileRelationships.addRelationship(\n 4,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\",\n \"docProps/custom.xml\",\n );\n\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\",\n \"styles.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering\",\n \"numbering.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes\",\n \"footnotes.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes\",\n \"endnotes.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\",\n \"settings.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\",\n \"comments.xml\",\n );\n if (this.bibliography) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/bibliography\",\n \"bibliography.xml\",\n );\n }\n }\n\n public get headers(): readonly HeaderWrapper[] {\n return this._headers.map((item) => item.header);\n }\n\n public get footers(): readonly FooterWrapper[] {\n return this._footers.map((item) => item.footer);\n }\n}\n","/**\n * Footnote run components module for WordprocessingML documents.\n *\n * This module exports run-level components used in footnotes,\n * including footnote reference runs.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nexport * from \"./reference-run\";\n","export * from \"./reference-run\";\n","/**\n * CheckBox symbol module for WordprocessingML documents.\n *\n * Provides XML components for checkbox symbol states.\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\nimport { shortHexNumber } from \"@util/values\";\n\n/**\n * Represents a checkbox symbol element (checked or unchecked state).\n *\n * This element defines the appearance of a checkbox in a particular state,\n * specifying the Unicode character and font to render.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtCheckboxSymbol\">\n * <xsd:attribute name=\"font\" type=\"w:ST_String\"/>\n * <xsd:attribute name=\"val\" type=\"w:ST_ShortHexNumber\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Checked state symbol\n * new CheckBoxSymbolElement(\"w14:checkedState\", \"2612\", \"MS Gothic\");\n *\n * // Unchecked state symbol\n * new CheckBoxSymbolElement(\"w14:uncheckedState\", \"2610\", \"MS Gothic\");\n *\n * // Symbol without explicit font\n * new CheckBoxSymbolElement(\"w14:checked\", \"1\");\n * ```\n */\nexport class CheckBoxSymbolElement extends XmlComponent {\n public constructor(name: string, val: string, font?: string) {\n super(name);\n if (font) {\n this.root.push({ _attr: { \"w14:font\": font, \"w14:val\": shortHexNumber(val) } });\n } else {\n this.root.push({ _attr: { \"w14:val\": val } });\n }\n }\n}\n","/**\n * CheckBox utility module for WordprocessingML documents.\n *\n * Provides the internal XML structure for checkbox content controls.\n *\n * @module\n */\nimport { CheckBoxSymbolElement } from \"@file/checkbox/checkbox-symbol\";\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Configuration for a checkbox symbol state (checked or unchecked).\n *\n * @property value - Hexadecimal character code for the symbol (e.g., \"2612\" for ☒)\n * @property font - Font family to use for rendering the symbol\n */\nexport interface CheckboxSymbolProperties {\n /** Hexadecimal character code for the symbol (e.g., \"2612\" for ☒). */\n readonly value?: string;\n /** Font family to use for rendering the symbol. */\n readonly font?: string;\n}\n\n/**\n * Options for configuring a checkbox control.\n *\n * @property alias - Display name for the checkbox control\n * @property checked - Whether the checkbox is initially checked\n * @property checkedState - Symbol properties for the checked state\n * @property uncheckedState - Symbol properties for the unchecked state\n */\nexport interface CheckboxSymbolOptions {\n /** Display name for the checkbox control. */\n readonly alias?: string;\n /** Whether the checkbox is initially checked. */\n readonly checked?: boolean;\n /** Symbol properties for the checked state. */\n readonly checkedState?: CheckboxSymbolProperties;\n /** Symbol properties for the unchecked state. */\n readonly uncheckedState?: CheckboxSymbolProperties;\n}\n\n/**\n * Represents the checkbox element within a structured document tag.\n *\n * This class generates the w14:checkbox element that defines the checkbox behavior,\n * including its checked state and the symbols used for checked and unchecked states.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtCheckbox\">\n * <xsd:sequence>\n * <xsd:element name=\"checked\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"checkedState\" type=\"CT_SdtCheckboxSymbol\" minOccurs=\"0\"/>\n * <xsd:element name=\"uncheckedState\" type=\"CT_SdtCheckboxSymbol\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * <xsd:element name=\"checkbox\" type=\"CT_SdtCheckbox\"/>\n * ```\n *\n * @example\n * ```typescript\n * // Default checkbox (unchecked with default symbols)\n * new CheckBoxUtil();\n *\n * // Checked checkbox with defaults\n * new CheckBoxUtil({ checked: true });\n *\n * // Custom symbols\n * new CheckBoxUtil({\n * checked: false,\n * checkedState: { value: \"2611\", font: \"Wingdings\" },\n * uncheckedState: { value: \"2610\", font: \"Wingdings\" },\n * });\n * ```\n */\nexport class CheckBoxUtil extends XmlComponent {\n private readonly DEFAULT_UNCHECKED_SYMBOL: string = \"2610\";\n private readonly DEFAULT_CHECKED_SYMBOL: string = \"2612\";\n private readonly DEFAULT_FONT: string = \"MS Gothic\";\n public constructor(options?: CheckboxSymbolOptions) {\n super(\"w14:checkbox\");\n\n const value = options?.checked ? \"1\" : \"0\";\n let symbol: string;\n let font: string;\n this.root.push(new CheckBoxSymbolElement(\"w14:checked\", value));\n\n symbol = options?.checkedState?.value\n ? options?.checkedState?.value\n : this.DEFAULT_CHECKED_SYMBOL;\n font = options?.checkedState?.font ? options?.checkedState?.font : this.DEFAULT_FONT;\n this.root.push(new CheckBoxSymbolElement(\"w14:checkedState\", symbol, font));\n\n symbol = options?.uncheckedState?.value\n ? options?.uncheckedState?.value\n : this.DEFAULT_UNCHECKED_SYMBOL;\n font = options?.uncheckedState?.font ? options?.uncheckedState?.font : this.DEFAULT_FONT;\n this.root.push(new CheckBoxSymbolElement(\"w14:uncheckedState\", symbol, font));\n }\n}\n","/**\n * CheckBox module for WordprocessingML documents.\n *\n * This module provides interactive checkbox controls using\n * structured document tags (content controls).\n *\n * @module\n */\nimport { SymbolRun } from \"@file/paragraph/run/symbol-run\";\nimport { StructuredDocumentTagContent } from \"@file/table-of-contents/sdt-content\";\nimport { StructuredDocumentTagProperties } from \"@file/table-of-contents/sdt-properties\";\nimport { XmlComponent } from \"@file/xml-components\";\n\nimport { CheckBoxUtil } from \"./checkbox-util\";\nimport type { CheckboxSymbolOptions } from \"./checkbox-util\";\n\n/**\n * Represents an interactive checkbox in a WordprocessingML document.\n *\n * CheckBox creates a content control with checkbox functionality,\n * displaying a checked or unchecked symbol based on its state. The checkbox\n * is implemented using structured document tags (w:sdt) with checkbox-specific\n * properties.\n *\n * @publicApi\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SdtCheckbox\">\n * <xsd:sequence>\n * <xsd:element name=\"checked\" type=\"CT_OnOff\" minOccurs=\"0\"/>\n * <xsd:element name=\"checkedState\" type=\"CT_SdtCheckboxSymbol\" minOccurs=\"0\"/>\n * <xsd:element name=\"uncheckedState\" type=\"CT_SdtCheckboxSymbol\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * <xsd:element name=\"checkbox\" type=\"CT_SdtCheckbox\"/>\n * ```\n *\n * @example\n * ```typescript\n * // Simple checkbox\n * new CheckBox({ checked: true });\n *\n * // Checkbox with custom alias\n * new CheckBox({\n * checked: false,\n * alias: \"Accept Terms\",\n * });\n *\n * // Checkbox with custom symbols\n * new CheckBox({\n * checked: true,\n * checkedState: { value: \"2611\", font: \"Wingdings\" },\n * uncheckedState: { value: \"2610\", font: \"Wingdings\" },\n * });\n * ```\n */\nexport class CheckBox extends XmlComponent {\n // Default values per Microsoft\n private readonly DEFAULT_UNCHECKED_SYMBOL: string = \"2610\";\n private readonly DEFAULT_CHECKED_SYMBOL: string = \"2612\";\n private readonly DEFAULT_FONT: string = \"MS Gothic\";\n public constructor(options?: CheckboxSymbolOptions) {\n super(\"w:sdt\");\n\n const properties = new StructuredDocumentTagProperties(options?.alias);\n properties.addChildElement(new CheckBoxUtil(options));\n this.root.push(properties);\n\n const content = new StructuredDocumentTagContent();\n const checkedFont: string | undefined = options?.checkedState?.font;\n const checkedText: string | undefined = options?.checkedState?.value;\n const uncheckedFont: string | undefined = options?.uncheckedState?.font;\n const uncheckedText: string | undefined = options?.uncheckedState?.value;\n let symbolFont: string;\n let char: string;\n\n if (options?.checked) {\n symbolFont = checkedFont ? checkedFont : this.DEFAULT_FONT;\n char = checkedText ? checkedText : this.DEFAULT_CHECKED_SYMBOL;\n } else {\n symbolFont = uncheckedFont ? uncheckedFont : this.DEFAULT_FONT;\n char = uncheckedText ? uncheckedText : this.DEFAULT_UNCHECKED_SYMBOL;\n }\n\n const initialRenderedChar = new SymbolRun({\n char: char,\n symbolfont: symbolFont,\n });\n\n content.addChildElement(initialRenderedChar);\n this.root.push(content);\n }\n}\n","/**\n * Permission range markers for WordprocessingML document protection.\n *\n * These elements mark editable ranges within a protected document.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_PermStart, CT_PermEnd\n *\n * @module\n */\nimport { XmlComponent } from \"@file/xml-components\";\n\n/**\n * Editing group values for permission ranges.\n *\n * Defines who can edit within a permission range.\n *\n * Reference: ISO/IEC 29500-4, ST_EdGrp\n */\nexport const EditGroupType = {\n NONE: \"none\",\n EVERYONE: \"everyone\",\n ADMINISTRATORS: \"administrators\",\n CONTRIBUTORS: \"contributors\",\n EDITORS: \"editors\",\n OWNERS: \"owners\",\n CURRENT: \"current\",\n} as const;\n\nexport type EditGroup = (typeof EditGroupType)[keyof typeof EditGroupType];\n\n/**\n * Options for creating a permission start marker.\n */\nexport interface PermStartOptions {\n /** Unique identifier for this permission range (typically a number) */\n readonly id: string | number;\n /** Editing group that can edit this range */\n readonly edGroup?: EditGroup;\n /** Individual user who can edit this range */\n readonly ed?: string;\n /** First column this range covers (for table cells) */\n readonly colFirst?: number;\n /** Last column this range covers (for table cells) */\n readonly colLast?: number;\n}\n\n/**\n * Marks the start of a permission range.\n *\n * Permission ranges define editable regions within a protected document.\n * The range extends from this element to the matching `PermEnd`.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, permStart (CT_PermStart)\n *\n * @example\n * ```typescript\n * new PermStart({ id: \"editRange1\", edGroup: \"everyone\" });\n * ```\n */\nexport class PermStart extends XmlComponent {\n public constructor(options: PermStartOptions) {\n super(\"w:permStart\");\n const attrs: Record<string, string | number> = { \"w:id\": options.id };\n if (options.edGroup !== undefined) attrs[\"w:edGrp\"] = options.edGroup;\n if (options.ed !== undefined) attrs[\"w:ed\"] = options.ed;\n if (options.colFirst !== undefined) attrs[\"w:colFirst\"] = options.colFirst;\n if (options.colLast !== undefined) attrs[\"w:colLast\"] = options.colLast;\n this.root.push({ _attr: attrs });\n }\n}\n\n/**\n * Marks the end of a permission range.\n *\n * Must be paired with a preceding `PermStart` with the same id.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, permEnd (CT_Perm)\n *\n * @example\n * ```typescript\n * new PermEnd(\"editRange1\");\n * ```\n */\nexport class PermEnd extends XmlComponent {\n public constructor(id: string | number) {\n super(\"w:permEnd\");\n this.root.push({ _attr: { \"w:id\": id } });\n }\n}\n","/**\n * AltChunk module exports.\n *\n * @module\n */\nexport * from \"./alt-chunk\";\nexport * from \"./alt-chunk-collection\";\n","/**\n * Sub-document module exports.\n *\n * @module\n */\nexport * from \"./sub-doc\";\nexport * from \"./sub-doc-collection\";\n","/**\n * Fonts module exports.\n *\n * @module\n */\nexport { CharacterSet } from \"./font\";\n","/**\n * Textbox module exports.\n *\n * @module\n */\nexport * from \"./textbox\";\n","export * from \"./chart-collection\";\nexport * from \"./chart-space\";\n","export * from \"./built-in-definitions\";\nexport * from \"./data-model\";\nexport * from \"./smartart-collection\";\nexport * from \"./tree-to-model\";\n","/**\n * File components module for WordprocessingML documents.\n *\n * This module exports all the building blocks needed to create DOCX documents,\n * including paragraphs, tables, styles, numbering, headers/footers, and more.\n *\n * The main `File` class (exported as `Document` from the root) coordinates all\n * these components to produce a complete OOXML document.\n *\n * @module\n */\n\nexport * from \"./paragraph\";\nexport * from \"./coerce\";\nexport * from \"./section-child\";\nexport * from \"./table\";\nexport * from \"./file\";\nexport * from \"./file-child\";\nexport * from \"./numbering\";\nexport * from \"./media\";\nexport * from \"./drawing\";\nexport * from \"./document\";\nexport * from \"./shading\";\nexport * from \"./styles\";\nexport * from \"./table-of-contents\";\nexport * from \"./xml-components\";\nexport * from \"./header-wrapper\";\nexport * from \"./footer-wrapper\";\nexport * from \"./header\";\nexport * from \"./footnotes\";\nexport * from \"./endnotes\";\nexport * from \"./track-revision\";\nexport * from \"./shared\";\nexport * from \"./border\";\nexport * from \"./vertical-align\";\nexport * from \"./checkbox\";\nexport * from \"./sdt\";\nexport * from \"./permissions\";\nexport * from \"./alt-chunk\";\nexport * from \"./sub-doc\";\nexport * from \"./fonts\";\nexport * from \"./textbox\";\nexport * from \"./bibliography\";\nexport * from \"./chart\";\nexport * from \"./smartart\";\nexport { type PropertiesOptions } from \"./core-properties\";\n","/**\n * Font obfuscation module for embedding fonts in WordprocessingML documents.\n *\n * This module implements the OOXML font obfuscation algorithm used to embed\n * fonts in DOCX documents. Obfuscation is required by the OOXML specification\n * to prevent simple extraction of embedded font files.\n *\n * Reference: ECMA-376 Part 2, Section 11.1 (Font Embedding)\n *\n * @module\n */\n\n/** Start offset for obfuscation in the font file */\nconst obfuscatedStartOffset = 0;\n/** End offset for obfuscation (first 32 bytes are obfuscated) */\nconst obfuscatedEndOffset = 32;\n/** Expected GUID size (32 hex characters without dashes) */\nconst guidSize = 32;\n\n/**\n * Obfuscates a TrueType font file for embedding in OOXML documents.\n *\n * The obfuscation algorithm XORs the first 32 bytes of the font file\n * with a reversed byte sequence derived from the font's GUID key.\n * This prevents simple extraction while maintaining font functionality.\n *\n * @param buf - The original font file as a byte array\n * @param fontKey - The GUID key for the font (with or without dashes)\n * @returns The obfuscated font data\n * @throws Error if the fontKey is not a valid 32-character GUID\n *\n * @example\n * ```typescript\n * const fontData = readFileSync(\"font.ttf\");\n * const fontKey = \"00000000-0000-0000-0000-000000000000\";\n * const obfuscatedData = obfuscate(fontData, fontKey);\n * ```\n *\n * @internal\n */\nexport const obfuscate = (buf: Uint8Array, fontKey: string): Uint8Array => {\n const guid = fontKey.replace(/-/g, \"\");\n if (guid.length !== guidSize) {\n throw new Error(`Error: Cannot extract GUID from font filename: ${fontKey}`);\n }\n\n const hexStrings = guid.replace(/(..)/g, \"$1 \").trim().split(\" \");\n const hexNumbers = hexStrings.map((hexString) => parseInt(hexString, 16));\n hexNumbers.reverse();\n\n const bytesToObfuscate = buf.slice(obfuscatedStartOffset, obfuscatedEndOffset);\n const obfuscatedBytes = bytesToObfuscate.map(\n (byte, i) => byte ^ hexNumbers[i % hexNumbers.length],\n );\n\n const out = new Uint8Array(\n obfuscatedStartOffset + obfuscatedBytes.length + Math.max(0, buf.length - obfuscatedEndOffset),\n );\n out.set(buf.slice(0, obfuscatedStartOffset));\n out.set(obfuscatedBytes, obfuscatedStartOffset);\n out.set(buf.slice(obfuscatedEndOffset), obfuscatedStartOffset + obfuscatedBytes.length);\n return out;\n};\n","import type { ConcreteNumbering } from \"@file/numbering\";\n\nexport function replaceNumberingPlaceholders(\n xml: string,\n concreteNumberings: readonly ConcreteNumbering[],\n): string {\n let result = xml;\n\n for (const { reference, instance, numId } of concreteNumberings) {\n result = result.replace(new RegExp(`{${reference}-${instance}}`, \"g\"), numId.toString());\n }\n\n return result;\n}\n","import type { File } from \"@file/file\";\nimport { obfuscate } from \"@file/fonts/obfuscate-ttf-to-odttf\";\nimport {\n DEFAULT_DRAWING_XML,\n getColorXml,\n getLayoutXml,\n getStyleXml,\n} from \"@file/smartart/built-in-definitions\";\nimport {\n addSmartArtRelationships,\n getReferencedMedia,\n hasPlaceholders,\n replaceChartPlaceholders,\n replaceImagePlaceholders,\n replaceSmartArtPlaceholders,\n} from \"@office-open/core\";\nimport type { Context, XmlifyedFile, Zippable } from \"@office-open/core\";\nimport { ZIP_STORED_LEVEL } from \"@office-open/core\";\nimport { xml } from \"@office-open/xml\";\nimport { toUint8Array } from \"undio\";\n\nimport { Formatter } from \"../formatter\";\nimport { replaceNumberingPlaceholders } from \"./numbering-placeholders\";\n\n/** Reusable TextEncoder (stateless, safe to share). */\nconst encoder = new TextEncoder();\n\n/** Extended context with docx-specific properties passed through the XML tree. */\ntype DocxContext = Context & {\n file: File;\n viewWrapper?: any;\n headerFormattedViews?: Map<number, string>;\n footerFormattedViews?: Map<number, string>;\n};\n\n/**\n * Complete mapping of all XML files in an OOXML document package.\n *\n * This type represents the full structure of a .docx file, including the main\n * document, styles, relationships, headers, footers, and metadata files.\n */\ninterface XmlifyedFileMapping {\n /** Main document content (word/document.xml) */\n readonly Document: XmlifyedFile;\n /** Style definitions (word/styles.xml) */\n readonly Styles: XmlifyedFile;\n /** Core document properties (docProps/core.xml) */\n readonly Properties: XmlifyedFile;\n /** Numbering definitions (word/numbering.xml) */\n readonly Numbering: XmlifyedFile;\n /** Document relationships (word/_rels/document.xml.rels) */\n readonly Relationships: XmlifyedFile;\n /** Package-level relationships (_rels/.rels) */\n readonly FileRelationships: XmlifyedFile;\n /** Header content files */\n readonly Headers: readonly XmlifyedFile[];\n /** Footer content files */\n readonly Footers: readonly XmlifyedFile[];\n /** Header relationship files */\n readonly HeaderRelationships: readonly XmlifyedFile[];\n /** Footer relationship files */\n readonly FooterRelationships: readonly XmlifyedFile[];\n /** Content types mapping ([Content_Types].xml) */\n readonly ContentTypes: XmlifyedFile;\n /** Custom document properties (docProps/custom.xml) */\n readonly CustomProperties: XmlifyedFile;\n /** Application properties (docProps/app.xml) */\n readonly AppProperties: XmlifyedFile;\n /** Footnotes content (word/footnotes.xml) */\n readonly FootNotes: XmlifyedFile;\n /** Footnotes relationships (word/_rels/footnotes.xml.rels) */\n readonly FootNotesRelationships: XmlifyedFile;\n /** Endnotes content (word/endnotes.xml) */\n readonly Endnotes: XmlifyedFile;\n /** Endnotes relationships (word/_rels/endnotes.xml.rels) */\n readonly EndnotesRelationships: XmlifyedFile;\n /** Document settings (word/settings.xml) */\n readonly Settings: XmlifyedFile;\n /** Comments content (word/comments.xml) */\n readonly Comments?: XmlifyedFile;\n /** Comments relationships (word/_rels/comments.xml.rels) */\n readonly CommentsRelationships?: XmlifyedFile;\n /** Font table (word/fontTable.xml) */\n readonly FontTable?: XmlifyedFile;\n /** Font table relationships (word/_rels/fontTable.xml.rels) */\n readonly FontTableRelationships?: XmlifyedFile;\n /** Bibliography content (word/bibliography.xml) */\n readonly Bibliography?: XmlifyedFile;\n /** Chart XML parts (word/charts/chart{n}.xml) */\n readonly Charts?: readonly XmlifyedFile[];\n /** Diagram data XML parts (word/diagrams/data{n}.xml) */\n readonly DiagramData?: readonly XmlifyedFile[];\n /** Diagram layout XML parts (word/diagrams/layout{n}.xml) */\n readonly DiagramLayout?: readonly XmlifyedFile[];\n /** Diagram style XML parts (word/diagrams/quickStyle{n}.xml) */\n readonly DiagramStyle?: readonly XmlifyedFile[];\n /** Diagram colors XML parts (word/diagrams/colors{n}.xml) */\n readonly DiagramColors?: readonly XmlifyedFile[];\n /** Diagram drawing XML parts (word/diagrams/drawing{n}.xml) */\n readonly DiagramDrawing?: readonly XmlifyedFile[];\n /** AltChunk parts (word/afchunks/afchunk{n}.{ext}) */\n readonly AltChunks?: readonly XmlifyedFile[];\n /** SubDoc parts (word/subdocs/subdoc{n}.docx) */\n readonly SubDocs?: readonly XmlifyedFile[];\n}\n\n/**\n * Compiles File objects into OOXML-compliant ZIP file data.\n *\n * The Compiler is responsible for converting the internal document representation\n * into the complete set of XML files required for a .docx document, managing\n * relationships, images, fonts, and all other document components.\n *\n * @example\n * ```typescript\n * const compiler = new Compiler();\n * const files = compiler.compile(file);\n * ```\n */\n\nexport class Compiler {\n private readonly formatter: Formatter;\n\n public constructor() {\n this.formatter = new Formatter();\n }\n\n /**\n * Compiles a File object into a flat file map suitable for fflate zipSync.\n *\n * This method orchestrates the entire compilation process:\n * - Converts all document components to XML\n * - Manages image and numbering placeholder replacements\n * - Creates relationship files\n * - Packages fonts and media files\n *\n * Media files (images, SVGs) use level 0 (STORE) to avoid redundant\n * compression on already-compressed formats. XML files use the default\n * DEFLATE compression set by the caller via zipSync options.\n *\n * @param file - The document to compile\n * @param overrides - Optional custom XML file overrides\n * @returns A Zippable object mapping file paths to their content\n */\n public compile(file: File, overrides: readonly XmlifyedFile[] = []): Zippable {\n const files: Zippable = {};\n\n // Cache format() results to avoid duplicate formatting of Header/Footer views.\n // HeaderRelationships/FooterRelationships runs before Headers/Footers in the map,\n // So we cache the formatted View data there and reuse it later.\n const headerFormattedViews = new Map<number, string>();\n const footerFormattedViews = new Map<number, string>();\n\n const xmlifiedFileMapping = this.xmlifyFile(file, headerFormattedViews, footerFormattedViews);\n const map = new Map<string, XmlifyedFile | readonly XmlifyedFile[]>(\n Object.entries(xmlifiedFileMapping),\n );\n\n for (const [, obj] of map) {\n if (Array.isArray(obj)) {\n for (const subFile of obj as readonly XmlifyedFile[]) {\n files[subFile.path] =\n typeof subFile.data === \"string\" ? encoder.encode(subFile.data) : subFile.data;\n }\n } else {\n const fileObj = obj as XmlifyedFile;\n files[fileObj.path] =\n typeof fileObj.data === \"string\" ? encoder.encode(fileObj.data) : fileObj.data;\n }\n }\n\n for (const subFile of overrides) {\n files[subFile.path] =\n typeof subFile.data === \"string\" ? encoder.encode(subFile.data) : subFile.data;\n }\n\n // Media files: use STORE for already-compressed formats (JPEG, PNG, GIF, etc.)\n for (const mediaData of file.media.array) {\n files[`word/media/${mediaData.fileName}`] = [\n toUint8Array(mediaData.data),\n { level: ZIP_STORED_LEVEL },\n ];\n if (mediaData.type === \"svg\") {\n files[`word/media/${mediaData.fallback.fileName}`] = [\n toUint8Array(mediaData.fallback.data),\n { level: ZIP_STORED_LEVEL },\n ];\n }\n }\n\n // Font files: use higher compression for binary font data\n for (const { data: buffer, name, fontKey } of file.fontTable.fontOptionsWithKey) {\n const [nameWithoutExtension] = name.split(\".\");\n files[`word/fonts/${nameWithoutExtension}.odttf`] = obfuscate(buffer, fontKey);\n }\n\n return files;\n }\n\n private xmlifyFile(\n file: File,\n headerFormattedViews: Map<number, string>,\n footerFormattedViews: Map<number, string>,\n ): XmlifyedFileMapping {\n // Factory to build typed context objects with docx-specific extensions.\n const mkCtx = (viewWrapper?: DocxContext[\"viewWrapper\"]): DocxContext => ({\n fileData: file,\n file,\n stack: [],\n viewWrapper,\n });\n\n const documentRelationshipCount = file.document.relationships.relationshipCount + 1;\n\n const documentXmlData = this.formatter.formatToXml(file.document.view, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n });\n\n const commentRelationshipCount = file.comments.relationships.relationshipCount + 1;\n const commentXmlData = this.formatter.formatToXml(\n file.comments,\n mkCtx({ relationships: file.comments.relationships, view: file.comments }),\n { encoding: \"UTF-8\", standalone: \"yes\" },\n );\n\n const footnoteRelationshipCount = file.footNotes.relationships.relationshipCount + 1;\n const footnoteXmlData = this.formatter.formatToXml(file.footNotes.view, mkCtx(file.footNotes), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n });\n\n const documentMediaDatas = hasPlaceholders(documentXmlData)\n ? getReferencedMedia(documentXmlData, file.media.array)\n : [];\n const commentMediaDatas = hasPlaceholders(commentXmlData)\n ? getReferencedMedia(commentXmlData, file.media.array)\n : [];\n const footnoteMediaDatas = hasPlaceholders(footnoteXmlData)\n ? getReferencedMedia(footnoteXmlData, file.media.array)\n : [];\n\n return {\n AppProperties: {\n data: this.formatter.formatToXml(file.appProperties, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: \"docProps/app.xml\",\n },\n Comments: {\n data: (() => {\n const xmlData =\n commentMediaDatas.length > 0\n ? replaceImagePlaceholders(\n commentXmlData,\n commentMediaDatas,\n commentRelationshipCount,\n \"rId\",\n )\n : commentXmlData;\n return replaceNumberingPlaceholders(xmlData, file.numbering.concreteNumbering);\n })(),\n path: \"word/comments.xml\",\n },\n CommentsRelationships: {\n data: (() => {\n commentMediaDatas.forEach((mediaData, i) => {\n file.comments.relationships.addRelationship(\n commentRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${mediaData.fileName}`,\n );\n });\n return this.formatter.formatToXml(\n file.comments.relationships,\n mkCtx({\n relationships: file.comments.relationships,\n view: file.comments,\n }),\n { encoding: \"UTF-8\" },\n );\n })(),\n path: \"word/_rels/comments.xml.rels\",\n },\n ContentTypes: {\n data: (() => {\n // Register chart and diagram content types BEFORE serialization\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 return this.formatter.formatToXml(file.contentTypes, mkCtx(file.document), {\n encoding: \"UTF-8\",\n });\n })(),\n path: \"[Content_Types].xml\",\n },\n CustomProperties: {\n data: this.formatter.formatToXml(file.customProperties, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: \"docProps/custom.xml\",\n },\n Document: {\n data: (() => {\n let xmlData =\n documentMediaDatas.length > 0\n ? replaceImagePlaceholders(\n documentXmlData,\n documentMediaDatas,\n documentRelationshipCount,\n \"rId\",\n )\n : documentXmlData;\n if (hasPlaceholders(xmlData)) {\n xmlData = replaceChartPlaceholders(\n xmlData,\n file.charts.array.map((c) => c.key),\n documentRelationshipCount + documentMediaDatas.length,\n \"rId\",\n );\n const smartArtDataOffset =\n documentRelationshipCount + documentMediaDatas.length + file.charts.array.length;\n xmlData = replaceSmartArtPlaceholders(\n xmlData,\n file.smartArts.array.map((s) => s.key),\n smartArtDataOffset,\n \"rId\",\n );\n }\n const referencedXmlData = replaceNumberingPlaceholders(\n xmlData,\n file.numbering.concreteNumbering,\n );\n return referencedXmlData;\n })(),\n path: \"word/document.xml\",\n },\n Endnotes: {\n data: this.formatter.formatToXml(file.endnotes.view, mkCtx(file.endnotes), {\n encoding: \"UTF-8\",\n }),\n path: \"word/endnotes.xml\",\n },\n EndnotesRelationships: {\n data: this.formatter.formatToXml(file.endnotes.relationships, mkCtx(file.endnotes), {\n encoding: \"UTF-8\",\n }),\n path: \"word/_rels/endnotes.xml.rels\",\n },\n FileRelationships: {\n data: this.formatter.formatToXml(file.fileRelationships, mkCtx(file.document), {\n encoding: \"UTF-8\",\n }),\n path: \"_rels/.rels\",\n },\n FontTable: {\n data: this.formatter.formatToXml(file.fontTable.view, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: \"word/fontTable.xml\",\n },\n FontTableRelationships: {\n data: (() =>\n this.formatter.formatToXml(file.fontTable.relationships, mkCtx(file.document), {\n encoding: \"UTF-8\",\n }))(),\n path: \"word/_rels/fontTable.xml.rels\",\n },\n FootNotes: {\n data: (() => {\n const xmlData =\n footnoteMediaDatas.length > 0\n ? replaceImagePlaceholders(\n footnoteXmlData,\n footnoteMediaDatas,\n footnoteRelationshipCount,\n \"rId\",\n )\n : footnoteXmlData;\n return replaceNumberingPlaceholders(xmlData, file.numbering.concreteNumbering);\n })(),\n path: \"word/footnotes.xml\",\n },\n FootNotesRelationships: {\n data: (() => {\n footnoteMediaDatas.forEach((mediaData, i) => {\n file.footNotes.relationships.addRelationship(\n footnoteRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${mediaData.fileName}`,\n );\n });\n return this.formatter.formatToXml(file.footNotes.relationships, mkCtx(file.footNotes), {\n encoding: \"UTF-8\",\n });\n })(),\n path: \"word/_rels/footnotes.xml.rels\",\n },\n FooterRelationships: file.footers.map((footerWrapper, index) => {\n const xmlData = this.formatter.formatToXml(footerWrapper.view, mkCtx(footerWrapper), {\n encoding: \"UTF-8\",\n });\n // Cache for reuse in Footers section\n footerFormattedViews.set(index, xmlData);\n const mediaDatas = getReferencedMedia(xmlData, file.media.array);\n\n mediaDatas.forEach((mediaData, i) => {\n footerWrapper.relationships.addRelationship(\n i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${mediaData.fileName}`,\n );\n });\n\n return {\n data: this.formatter.formatToXml(footerWrapper.relationships, mkCtx(footerWrapper), {\n encoding: \"UTF-8\",\n }),\n path: `word/_rels/footer${index + 1}.xml.rels`,\n };\n }),\n Footers: file.footers.map((_footerWrapper, index) => {\n const tempXmlData = footerFormattedViews.get(index)!;\n const mediaDatas = hasPlaceholders(tempXmlData)\n ? getReferencedMedia(tempXmlData, file.media.array)\n : [];\n const xmlData =\n mediaDatas.length > 0\n ? replaceImagePlaceholders(tempXmlData, mediaDatas, 0, \"rId\")\n : tempXmlData;\n\n return {\n data: replaceNumberingPlaceholders(xmlData, file.numbering.concreteNumbering),\n path: `word/footer${index + 1}.xml`,\n };\n }),\n HeaderRelationships: file.headers.map((headerWrapper, index) => {\n const xmlData = this.formatter.formatToXml(headerWrapper.view, mkCtx(headerWrapper), {\n encoding: \"UTF-8\",\n });\n // Cache for reuse in Headers section\n headerFormattedViews.set(index, xmlData);\n const mediaDatas = getReferencedMedia(xmlData, file.media.array);\n\n mediaDatas.forEach((mediaData, i) => {\n headerWrapper.relationships.addRelationship(\n i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${mediaData.fileName}`,\n );\n });\n\n return {\n data: this.formatter.formatToXml(headerWrapper.relationships, mkCtx(headerWrapper), {\n encoding: \"UTF-8\",\n }),\n path: `word/_rels/header${index + 1}.xml.rels`,\n };\n }),\n Headers: file.headers.map((_headerWrapper, index) => {\n const tempXmlData = headerFormattedViews.get(index)!;\n const mediaDatas = hasPlaceholders(tempXmlData)\n ? getReferencedMedia(tempXmlData, file.media.array)\n : [];\n const xmlData =\n mediaDatas.length > 0\n ? replaceImagePlaceholders(tempXmlData, mediaDatas, 0, \"rId\")\n : tempXmlData;\n\n return {\n data: replaceNumberingPlaceholders(xmlData, file.numbering.concreteNumbering),\n path: `word/header${index + 1}.xml`,\n };\n }),\n Numbering: {\n data: this.formatter.formatToXml(file.numbering, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: \"word/numbering.xml\",\n },\n Properties: {\n data: this.formatter.formatToXml(file.coreProperties, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: \"docProps/core.xml\",\n },\n Relationships: {\n data: (() => {\n documentMediaDatas.forEach((mediaData, i) => {\n file.document.relationships.addRelationship(\n documentRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${mediaData.fileName}`,\n );\n });\n\n // Chart relationships\n const chartOffset = documentRelationshipCount + documentMediaDatas.length;\n file.charts.array.forEach((_chartData, i) => {\n file.document.relationships.addRelationship(\n chartOffset + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\",\n `charts/chart${i + 1}.xml`,\n );\n });\n\n // SmartArt relationships (data + layout/style/color internal)\n addSmartArtRelationships(\n file.smartArts.array.map((s) => s.key),\n (id, type, target) => {\n file.document.relationships.addRelationship(id, type, target);\n },\n documentRelationshipCount + documentMediaDatas.length + file.charts.array.length,\n 0,\n {\n pathPrefix: \"\",\n styleRelType: \"http://schemas.microsoft.com/office/2007/relationships/diagramStyle\",\n },\n );\n\n file.document.relationships.addRelationship(\n file.document.relationships.relationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable\",\n \"fontTable.xml\",\n );\n\n return this.formatter.formatToXml(file.document.relationships, mkCtx(file.document), {\n encoding: \"UTF-8\",\n });\n })(),\n path: \"word/_rels/document.xml.rels\",\n },\n Settings: {\n data: this.formatter.formatToXml(file.settings, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: \"word/settings.xml\",\n },\n Styles: {\n data: (() => {\n const xmlStyles = this.formatter.formatToXml(file.styles, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n });\n const referencedXmlStyles = replaceNumberingPlaceholders(\n xmlStyles,\n file.numbering.concreteNumbering,\n );\n return referencedXmlStyles;\n })(),\n path: \"word/styles.xml\",\n },\n ...(file.bibliography\n ? {\n Bibliography: {\n data: this.formatter.formatToXml(\n file.bibliography,\n mkCtx({\n relationships: file.bibliography.relationships,\n view: file.bibliography,\n }),\n { encoding: \"UTF-8\", standalone: \"yes\" },\n ),\n path: \"word/bibliography.xml\",\n },\n }\n : {}),\n ...(file.charts.array.length > 0\n ? {\n Charts: file.charts.array.flatMap((chartData, i) => [\n {\n data: this.formatter.formatToXml(chartData.chartSpace, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: `word/charts/chart${i + 1}.xml`,\n },\n {\n data: 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 path: `word/charts/_rels/chart${i + 1}.xml.rels`,\n },\n ]),\n }\n : {}),\n ...(file.smartArts.array.length > 0\n ? {\n DiagramData: file.smartArts.array.map((smartArtData, i) => ({\n data: this.formatter.formatToXml(smartArtData.dataModel, mkCtx(file.document), {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n }),\n path: `word/diagrams/data${i + 1}.xml`,\n })),\n DiagramLayout: file.smartArts.array.map((smartArtData, i) => ({\n data: getLayoutXml(smartArtData.layout),\n path: `word/diagrams/layout${i + 1}.xml`,\n })),\n DiagramStyle: file.smartArts.array.map((smartArtData, i) => ({\n data: getStyleXml(smartArtData.style),\n path: `word/diagrams/quickStyle${i + 1}.xml`,\n })),\n DiagramColors: file.smartArts.array.map((smartArtData, i) => ({\n data: getColorXml(smartArtData.color),\n path: `word/diagrams/colors${i + 1}.xml`,\n })),\n DiagramDrawing: file.smartArts.array.map((_, i) => ({\n data: DEFAULT_DRAWING_XML,\n path: `word/diagrams/drawing${i + 1}.xml`,\n })),\n }\n : {}),\n ...(file.altChunks.array.length > 0\n ? {\n AltChunks: file.altChunks.array.map((altChunkData) => ({\n data: altChunkData.data,\n path: `word/${altChunkData.path}`,\n })),\n }\n : {}),\n ...(file.subDocs.array.length > 0\n ? {\n SubDocs: file.subDocs.array.map((subDocData) => ({\n data: subDocData.data,\n path: `word/${subDocData.path}`,\n })),\n }\n : {}),\n };\n }\n}\n","import type { File } from \"@file/file\";\nimport { createPacker, OoxmlMimeType } from \"@office-open/core\";\n\nimport { Compiler } from \"./next-compiler\";\n\nconst compiler = new Compiler();\n\n/**\n * Exports documents to various output formats.\n *\n * @publicApi\n *\n * @example\n * ```typescript\n * const buffer = await Packer.toBuffer(doc);\n * const blob = await Packer.toBlob(doc);\n * ```\n */\nexport const Packer = createPacker<File>({\n compile: (file, overrides) => compiler.compile(file, overrides),\n mimeType: OoxmlMimeType.DOCX,\n});\n","/**\n * Utility functions and types for the docx library.\n *\n * This module re-exports all utility functions, type definitions, and validators\n * used throughout the library for unit conversion, ID generation, and value validation.\n *\n * @module\n */\nexport * from \"./convenience-functions\";\nexport * from \"./values\";\n","import { DocumentAttributeNamespaces } from \"@file/document\";\nimport type { ViewWrapper } from \"@file/document-wrapper\";\nimport type { File } from \"@file/file\";\nimport type { FileChild } from \"@file/file-child\";\nimport { Media } from \"@file/media\";\nimport { ConcreteHyperlink, ExternalHyperlink } from \"@file/paragraph\";\nimport type { ParagraphChild } from \"@file/paragraph\";\nimport { TargetModeType } from \"@file/relationships/relationship/relationship\";\nimport type { Context, XmlComponent } from \"@file/xml-components\";\nimport {\n DOCX_NS,\n Formatter,\n OoxmlMimeType,\n appendContentType,\n appendRelationship,\n createReplacer,\n getNextRelationshipIndex,\n getReferencedMedia,\n replaceImagePlaceholders,\n strFromU8,\n toJson,\n unzipSync,\n zipAndConvert,\n} from \"@office-open/core\";\nimport type { OutputByType, OutputType } from \"@office-open/core\";\nimport { js2xml, xml2js } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\nimport { uniqueId } from \"@util/convenience-functions\";\nimport { toUint8Array } from \"undio\";\n\n/** Reusable TextEncoder (stateless, safe to share). */\nconst encoder = new TextEncoder();\n\n/**\n * Document patching module for modifying existing .docx files.\n *\n * @module\n */\n\nconst formatter = new Formatter();\n\nconst docxReplacer = createReplacer({\n ns: DOCX_NS,\n formatChild: (child: unknown, context: unknown): Element[] => {\n const xmlStr = formatter.formatToXml(child as XmlComponent, context as Context);\n const jsonObj = xml2js(xmlStr, { captureSpacesBetweenElements: true });\n return [jsonObj.elements![0]];\n },\n});\n\n/**\n * Supported input data types for document patching.\n */\nexport type InputDataType = Buffer | string | number[] | Uint8Array | ArrayBuffer | Blob;\n\n/**\n * Patch type enumeration.\n *\n * @publicApi\n */\nexport const PatchType = {\n DOCUMENT: \"file\",\n PARAGRAPH: \"paragraph\",\n} as const;\n\ninterface ParagraphPatch {\n readonly type: typeof PatchType.PARAGRAPH;\n readonly children: readonly ParagraphChild[];\n}\n\ninterface FilePatch {\n readonly type: typeof PatchType.DOCUMENT;\n readonly children: readonly FileChild[];\n}\n\ninterface ImageRelationshipAddition {\n readonly key: string;\n readonly mediaDatas: readonly { readonly fileName: string }[];\n}\n\ninterface HyperlinkRelationshipAddition {\n readonly key: string;\n readonly hyperlink: { readonly id: string; readonly link: string };\n}\n\nexport type IPatch = ParagraphPatch | FilePatch;\n\nexport type PatchDocumentOutputType = OutputType;\n\nexport interface PatchDocumentOptions<T extends PatchDocumentOutputType = PatchDocumentOutputType> {\n readonly outputType: T;\n readonly data: InputDataType;\n readonly patches: Readonly<Record<string, IPatch>>;\n readonly keepOriginalStyles?: boolean;\n readonly placeholderDelimiters?: Readonly<{\n readonly start: string;\n readonly end: string;\n }>;\n readonly recursive?: boolean;\n}\n\nconst UTF16LE = new Uint8Array([0xff, 0xfe]);\nconst UTF16BE = new Uint8Array([0xfe, 0xff]);\n\nconst compareByteArrays = (a: Uint8Array, b: Uint8Array): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Patches an existing .docx document by replacing placeholders with new content.\n *\n * @publicApi\n */\nexport const patchDocument = async <T extends PatchDocumentOutputType = PatchDocumentOutputType>({\n outputType,\n data,\n patches,\n keepOriginalStyles = true,\n placeholderDelimiters = { end: \"}}\", start: \"{{\" } as const,\n recursive = true,\n}: PatchDocumentOptions<T>): Promise<OutputByType[T]> => {\n const zipContent = unzipSync(toUint8Array(data));\n const contexts = new Map<string, Context>();\n const file = {\n media: new Media(),\n } as unknown as File;\n\n const map = new Map<string, Element>();\n\n const imageRelationshipAdditions: ImageRelationshipAddition[] = [];\n const hyperlinkRelationshipAdditions: HyperlinkRelationshipAddition[] = [];\n let hasMedia = false;\n\n const binaryContentMap = new Map<string, Uint8Array>();\n\n for (const [key, value] of Object.entries(zipContent)) {\n const startBytes = value.slice(0, 2);\n if (compareByteArrays(startBytes, UTF16LE) || compareByteArrays(startBytes, UTF16BE)) {\n binaryContentMap.set(key, value);\n continue;\n }\n\n if (!key.endsWith(\".xml\") && !key.endsWith(\".rels\")) {\n binaryContentMap.set(key, value);\n continue;\n }\n\n const json = toJson(strFromU8(value));\n\n if (key === \"word/document.xml\") {\n const document = json.elements?.find((i) => i.name === \"w:document\");\n if (document && document.attributes) {\n for (const ns of [\"mc\", \"wp\", \"r\", \"w15\", \"m\"] as const) {\n document.attributes[`xmlns:${ns}`] = DocumentAttributeNamespaces[ns];\n }\n document.attributes[\"mc:Ignorable\"] =\n `${document.attributes[\"mc:Ignorable\"] || \"\"} w15`.trim();\n }\n }\n\n if (key.startsWith(\"word/\") && !key.endsWith(\".xml.rels\")) {\n const context: Context = {\n fileData: file,\n file,\n stack: [],\n viewWrapper: {\n relationships: {\n addRelationship: (\n linkId: string,\n _: string,\n target: string,\n __: (typeof TargetModeType)[keyof typeof TargetModeType],\n ) => {\n hyperlinkRelationshipAdditions.push({\n hyperlink: {\n id: linkId,\n link: target,\n },\n key,\n });\n },\n },\n } as unknown as ViewWrapper,\n };\n contexts.set(key, context);\n\n if (!placeholderDelimiters?.start.trim() || !placeholderDelimiters?.end.trim()) {\n throw new Error(\"Both start and end delimiters must be non-empty strings.\");\n }\n\n const { start, end } = placeholderDelimiters;\n\n for (const [patchKey, patchValue] of Object.entries(patches)) {\n const patchText = `${start}${patchKey}${end}`;\n while (true) {\n const { didFindOccurrence } = docxReplacer({\n context,\n json,\n keepOriginalStyles,\n patch: {\n ...patchValue,\n children: patchValue.children.map((element) => {\n if (element instanceof ExternalHyperlink) {\n const concreteHyperlink = new ConcreteHyperlink(\n element.options.children,\n uniqueId(),\n { tooltip: element.options.tooltip as string | undefined },\n );\n hyperlinkRelationshipAdditions.push({\n hyperlink: {\n id: concreteHyperlink.linkId,\n link: element.options.link,\n },\n key,\n });\n return concreteHyperlink;\n } else {\n return element;\n }\n }),\n } as any,\n patchText,\n });\n if (!recursive || !didFindOccurrence) {\n break;\n }\n }\n }\n\n const mediaDatas = getReferencedMedia(JSON.stringify(json), context.file.media.array);\n if (mediaDatas.length > 0) {\n hasMedia = true;\n imageRelationshipAdditions.push({\n key,\n mediaDatas,\n });\n }\n }\n\n map.set(key, json);\n }\n\n for (const { key, mediaDatas } of imageRelationshipAdditions) {\n const relationshipKey = `word/_rels/${key.split(\"/\").pop()}.rels`;\n const relationshipsJson = map.get(relationshipKey) ?? createRelationshipFile();\n map.set(relationshipKey, relationshipsJson);\n\n const index = getNextRelationshipIndex(relationshipsJson);\n const newJson = replaceImagePlaceholders(\n JSON.stringify(map.get(key)),\n mediaDatas,\n index,\n \"plain\",\n );\n map.set(key, JSON.parse(newJson) as Element);\n\n for (let i = 0; i < mediaDatas.length; i++) {\n const { fileName } = mediaDatas[i];\n appendRelationship(\n relationshipsJson,\n index + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${fileName}`,\n );\n }\n }\n\n for (const { key, hyperlink } of hyperlinkRelationshipAdditions) {\n const relationshipKey = `word/_rels/${key.split(\"/\").pop()}.rels`;\n\n const relationshipsJson = map.get(relationshipKey) ?? createRelationshipFile();\n map.set(relationshipKey, relationshipsJson);\n\n appendRelationship(\n relationshipsJson,\n hyperlink.id,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n hyperlink.link,\n TargetModeType.EXTERNAL,\n );\n }\n\n if (hasMedia) {\n const contentTypesJson = map.get(\"[Content_Types].xml\");\n\n if (!contentTypesJson) {\n throw new Error(\"Could not find content types file\");\n }\n\n appendContentType(contentTypesJson, \"image/png\", \"png\");\n appendContentType(contentTypesJson, \"image/jpeg\", \"jpeg\");\n appendContentType(contentTypesJson, \"image/jpeg\", \"jpg\");\n appendContentType(contentTypesJson, \"image/bmp\", \"bmp\");\n appendContentType(contentTypesJson, \"image/gif\", \"gif\");\n appendContentType(contentTypesJson, \"image/svg+xml\", \"svg\");\n }\n\n const files: Record<string, Uint8Array> = {};\n\n for (const [key, value] of map) {\n files[key] = encoder.encode(js2xml(value));\n }\n\n for (const [key, value] of binaryContentMap) {\n files[key] = value;\n }\n\n for (const { data: mediaData, fileName } of file.media.array) {\n files[`word/media/${fileName}`] =\n mediaData instanceof Uint8Array ? mediaData : new Uint8Array(mediaData);\n }\n\n return await zipAndConvert(files, outputType, OoxmlMimeType.DOCX);\n};\n\nconst createRelationshipFile = (): Element => ({\n declaration: {\n attributes: {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n version: \"1.0\",\n },\n },\n elements: [\n {\n attributes: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n elements: [],\n name: \"Relationships\",\n type: \"element\",\n },\n ],\n});\n","/**\n * Patch detector for discovering placeholders in document templates.\n *\n * @module\n */\nimport { DOCX_NS, createTraverser, strFromU8, toJson, unzipSync } from \"@office-open/core\";\nimport { toUint8Array } from \"undio\";\n\nimport type { InputDataType } from \"./from-docx\";\n\n/**\n * Options for patch detection.\n *\n * @property data - The document template to scan for placeholders\n */\ninterface PatchDetectorOptions {\n readonly data: InputDataType;\n}\n\n/**\n * Detects all placeholders present in a document template.\n *\n * Scans through all XML content in a .docx file to find placeholder text\n * enclosed in delimiters (default: {{placeholder}}). This is useful for\n * discovering what patches a template expects before performing replacement.\n *\n * @param options - Patch detector configuration\n * @returns Array of placeholder keys found in the document\n *\n * @example\n * ```typescript\n * const placeholders = await patchDetector({ data: templateBuffer });\n * // Returns: [\"name\", \"date\", \"address\"] if template contains {{name}}, {{date}}, {{address}}\n *\n * // Use detected placeholders to create patches\n * const patches = {};\n * placeholders.forEach(key => {\n * patches[key] = {\n * type: PatchType.PARAGRAPH,\n * children: [new TextRun(getUserData(key))],\n * };\n * });\n * ```\n */\nexport const patchDetector = async ({ data }: PatchDetectorOptions): Promise<readonly string[]> => {\n const zipContent = unzipSync(toUint8Array(data));\n const patches = new Set<string>();\n\n for (const [key, value] of Object.entries(zipContent)) {\n if (!key.endsWith(\".xml\") && !key.endsWith(\".rels\")) {\n continue;\n }\n if (key.startsWith(\"word/\") && !key.endsWith(\".xml.rels\")) {\n const json = toJson(strFromU8(value));\n const { traverse } = createTraverser(DOCX_NS);\n traverse(json).forEach((p) => findPatchKeys(p.text).forEach((patch) => patches.add(patch)));\n }\n }\n return [...patches];\n};\n\n/**\n * Extracts placeholder keys from text using regex pattern.\n *\n * @param text - Text to search for placeholders\n * @returns Array of placeholder keys (without delimiters)\n */\nconst findPatchKeys = (text: string): readonly string[] => {\n const pattern = /(?<=\\{\\{).+?(?=\\}\\})/gs;\n return text.match(pattern) ?? [];\n};\n","import type { ChartOptions } from \"@file/paragraph/run/chart-run\";\nimport type { IImageOptions } from \"@file/paragraph/run/image-run\";\nimport type { SmartArtOptions } from \"@file/paragraph/run/smartart-run\";\n/**\n * Drawing parser for DOCX documents.\n *\n * Parses w:drawing elements and extracts image, chart, or SmartArt data.\n *\n * @module\n */\nimport { convertEmuToPixels } from \"@office-open/core\";\nimport { attr, attrBool, attrNum, findChild, findDeep, textOf } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\n\n/** Union type for parsed drawing child wrappers. */\nexport type DrawingChild =\n | { readonly image: IImageOptions }\n | { readonly chart: ChartOptions }\n | { readonly smartArt: SmartArtOptions };\n\n/**\n * Parse a w:drawing element and dispatch to the correct parser\n * based on the graphicData URI.\n */\nexport function parseDrawingRun(el: Element, ctx: ParseContext): DrawingChild | undefined {\n const graphicData = findDeep(el, \"a:graphicData\")[0];\n if (!graphicData) return undefined;\n\n const uri = attr(graphicData, \"uri\") ?? \"\";\n\n if (uri.includes(\"/chart\")) {\n return parseChartDrawing(el, ctx);\n }\n if (uri.includes(\"/diagram\")) {\n return parseSmartArtDrawing(el, ctx);\n }\n return parseImageRun(el, ctx);\n}\n\n/**\n * Determine image type from file extension or MIME type.\n */\nfunction imageTypeFromPath(\n path: string,\n): \"jpg\" | \"png\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\" {\n const ext = path.split(\".\").pop()?.toLowerCase() ?? \"\";\n switch (ext) {\n case \"jpg\":\n case \"jpeg\":\n return \"jpg\";\n case \"png\":\n return \"png\";\n case \"gif\":\n return \"gif\";\n case \"bmp\":\n return \"bmp\";\n case \"tif\":\n case \"tiff\":\n return \"tif\";\n case \"ico\":\n return \"ico\";\n case \"emf\":\n return \"emf\";\n case \"wmf\":\n return \"wmf\";\n default:\n return \"png\"; // fallback\n }\n}\n\n/**\n * Parse a w:drawing element and return image data wrapped in { image: ... }.\n */\nexport function parseImageRun(\n el: Element,\n ctx: ParseContext,\n): { readonly image: IImageOptions } | undefined {\n // Try inline first, then anchor\n const inline = findDeep(el, \"wp:inline\")[0];\n const anchor = inline ? undefined : findDeep(el, \"wp:anchor\")[0];\n const parent = inline ?? anchor;\n if (!parent) return undefined;\n\n // Get extent (dimensions in EMU, convert to pixels for API)\n const extent = findChild(parent, \"wp:extent\");\n let width: number | undefined;\n let height: number | undefined;\n if (extent) {\n const cxEmu = attrNum(extent, \"cx\");\n const cyEmu = attrNum(extent, \"cy\");\n if (cxEmu !== undefined) width = convertEmuToPixels(cxEmu);\n if (cyEmu !== undefined) height = convertEmuToPixels(cyEmu);\n }\n\n // Get graphic → graphicData → blip\n const blip = findDeep(parent, \"a:blip\")[0];\n if (!blip) return undefined;\n\n const rEmbed = attr(blip, \"r:embed\");\n if (!rEmbed) return undefined;\n\n // Look up media path from relationships\n const mediaPath = ctx.docx.partRefs.media.get(rEmbed);\n if (!mediaPath) return undefined;\n\n // Read image data from ZIP\n const imageData = ctx.docx.doc.getRaw(mediaPath);\n if (!imageData) return undefined;\n\n const type = imageTypeFromPath(mediaPath);\n\n const imageOpts: Record<string, unknown> = {\n type,\n data: imageData,\n transformation: {\n ...(width !== undefined ? { width } : {}),\n ...(height !== undefined ? { height } : {}),\n },\n };\n\n // Get alt text from docPr\n const docPr = findChild(parent, \"wp:docPr\");\n if (docPr) {\n const name = attr(docPr, \"name\");\n const descr = attr(docPr, \"descr\");\n const title = attr(docPr, \"title\");\n if (name || descr || title) {\n imageOpts.altText = {\n ...(name ? { name } : {}),\n ...(descr ? { description: descr } : {}),\n ...(title ? { title } : {}),\n };\n }\n }\n\n // For anchor, extract floating properties\n if (anchor && !inline) {\n const floating: Record<string, unknown> = {};\n // Position\n const posH = findChild(anchor, \"wp:positionH\");\n if (posH) {\n const align = findChild(posH, \"wp:align\");\n const posOffset = findChild(posH, \"wp:posOffset\");\n if (align) floating.horizontalPosition = { align: textOf(align) };\n else if (posOffset) {\n const val = Number(textOf(posOffset));\n if (!isNaN(val)) floating.horizontalPosition = { offset: val };\n }\n }\n const posV = findChild(anchor, \"wp:positionV\");\n if (posV) {\n const align = findChild(posV, \"wp:align\");\n const posOffset = findChild(posV, \"wp:posOffset\");\n if (align) floating.verticalPosition = { align: textOf(align) };\n else if (posOffset) {\n const val = Number(textOf(posOffset));\n if (!isNaN(val)) floating.verticalPosition = { offset: val };\n }\n }\n // Wrap\n for (const wrapType of [\"wrapSquare\", \"wrapTight\", \"wrapTopAndBottom\", \"wrapNone\"]) {\n const wrapEl = findChild(anchor, `wp:${wrapType}`);\n if (wrapEl) {\n floating.wrap = wrapType;\n break;\n }\n }\n // Behind text\n const behindDoc = attrBool(anchor, \"behindDoc\");\n if (behindDoc) floating.behindDocument = true;\n\n if (Object.keys(floating).length > 0) {\n imageOpts.floating = floating;\n }\n }\n\n return { image: imageOpts as unknown as IImageOptions };\n}\n\n// ── Common helpers ──────────────────────────────────────────────────────────\n\nfunction getDrawingExtent(el: Element): { width?: number; height?: number } {\n const inline = findDeep(el, \"wp:inline\")[0];\n const anchor = inline ? undefined : findDeep(el, \"wp:anchor\")[0];\n const parent = inline ?? anchor;\n if (!parent) return {};\n\n const extent = findChild(parent, \"wp:extent\");\n if (!extent) return {};\n\n const cxEmu = attrNum(extent, \"cx\");\n const cyEmu = attrNum(extent, \"cy\");\n return {\n ...(cxEmu !== undefined ? { width: convertEmuToPixels(cxEmu) } : {}),\n ...(cyEmu !== undefined ? { height: convertEmuToPixels(cyEmu) } : {}),\n };\n}\n\n// ── Chart parsing ───────────────────────────────────────────────────────────\n\n/**\n * Look up a relationship ID in a map, with fallback for double \"rId\" prefix\n * that the library's generation code produces (e.g. \"rIdrId7\" → \"rId7\").\n */\nfunction lookupRId(map: Map<string, string>, rId: string | undefined): string | undefined {\n if (!rId) return undefined;\n const direct = map.get(rId);\n if (direct) return direct;\n // Fallback: strip one \"rId\" prefix when the value starts with \"rIdrId\"\n if (rId.startsWith(\"rIdrId\")) return map.get(rId.slice(3));\n return undefined;\n}\n\nfunction parseChartDrawing(\n el: Element,\n ctx: ParseContext,\n): { readonly chart: ChartOptions } | undefined {\n const chartRef = findDeep(el, \"c:chart\")[0];\n if (!chartRef) return undefined;\n\n const rId = attr(chartRef, \"r:id\");\n const chartPath = lookupRId(ctx.docx.partRefs.charts, rId);\n if (!chartPath) return undefined;\n\n const chartXml = ctx.docx.doc.get(chartPath);\n if (!chartXml) return undefined;\n\n const opts = parseChartXml(chartXml);\n if (!opts) return undefined;\n\n const ext = getDrawingExtent(el);\n if (ext.width !== undefined || ext.height !== undefined) {\n (opts as Record<string, unknown>).transformation = {\n ...ext,\n };\n }\n\n return { chart: opts as unknown as ChartOptions };\n}\n\n/**\n * Parse c:chartSpace element into ChartOptions.\n */\nfunction parseChartXml(el: Element): Record<string, unknown> | undefined {\n const chart = findChild(el, \"c:chart\");\n if (!chart) return undefined;\n\n const opts: Record<string, unknown> = {};\n\n // Title: c:chart → c:title → c:tx → c:rich → a:p → a:r → a:t\n const titleEl = findChild(chart, \"c:title\");\n if (titleEl) {\n const rich = findDeep(titleEl, \"c:rich\")[0];\n if (rich) {\n const t = findDeep(rich, \"a:t\")[0];\n if (t) {\n const title = textOf(t);\n if (title) opts.title = title;\n }\n }\n }\n\n // Plot area → chart type\n const plotArea = findChild(chart, \"c:plotArea\");\n if (!plotArea) return undefined;\n\n let chartType: string | undefined;\n let typeElement: Element | undefined;\n\n for (const child of plotArea.elements ?? []) {\n switch (child.name) {\n case \"c:barChart\": {\n const barDir = findChild(child, \"c:barDir\");\n chartType = barDir && attr(barDir, \"val\") === \"bar\" ? \"bar\" : \"column\";\n typeElement = child;\n break;\n }\n case \"c:lineChart\":\n chartType = \"line\";\n typeElement = child;\n break;\n case \"c:pieChart\":\n chartType = \"pie\";\n typeElement = child;\n break;\n case \"c:areaChart\":\n chartType = \"area\";\n typeElement = child;\n break;\n case \"c:scatterChart\":\n chartType = \"scatter\";\n typeElement = child;\n break;\n }\n if (chartType) break;\n }\n\n if (!chartType || !typeElement) return undefined;\n opts.type = chartType;\n\n // Parse series\n const series: { name: string; values: number[] }[] = [];\n let categories: string[] | undefined;\n\n for (const serEl of typeElement.elements ?? []) {\n if (serEl.name !== \"c:ser\") continue;\n\n // Series name: c:tx → c:strCache → c:pt → c:v\n const nameParts = extractStrCache(serEl, \"c:tx\");\n // Categories: c:cat → c:strCache → c:pt → c:v\n const cats = extractStrCache(serEl, \"c:cat\");\n if (cats.length > 0 && !categories) categories = cats;\n // Values: c:val → c:numCache → c:pt → c:v\n const vals = extractNumCache(serEl);\n\n series.push({ name: nameParts[0] ?? \"\", values: vals });\n }\n\n opts.data = { categories: categories ?? [], series };\n\n // Legend\n opts.showLegend = findChild(chart, \"c:legend\") !== undefined;\n\n // Style\n const styleEl = findChild(el, \"c:style\");\n if (styleEl) {\n const val = attrNum(styleEl, \"val\");\n if (val !== undefined) opts.style = val;\n }\n\n return opts;\n}\n\n/**\n * Extract string values from c:strCache within a container element.\n */\nfunction extractStrCache(parent: Element, containerName: string): string[] {\n const container = findChild(parent, containerName);\n if (!container) return [];\n const cache = findDeep(container, \"c:strCache\")[0];\n if (!cache) return [];\n\n const values: string[] = [];\n for (const pt of cache.elements ?? []) {\n if (pt.name !== \"c:pt\") continue;\n const v = findChild(pt, \"c:v\");\n if (v) values.push(textOf(v) ?? \"\");\n }\n return values;\n}\n\n/**\n * Extract numeric values from c:numCache within a c:val container.\n */\nfunction extractNumCache(parent: Element): number[] {\n const valEl = findChild(parent, \"c:val\");\n if (!valEl) return [];\n const cache = findDeep(valEl, \"c:numCache\")[0];\n if (!cache) return [];\n\n const values: number[] = [];\n for (const pt of cache.elements ?? []) {\n if (pt.name !== \"c:pt\") continue;\n const v = findChild(pt, \"c:v\");\n if (v) {\n const num = Number(textOf(v));\n if (!isNaN(num)) values.push(num);\n }\n }\n return values;\n}\n\n// ── SmartArt parsing ────────────────────────────────────────────────────────\n\nfunction parseSmartArtDrawing(\n el: Element,\n ctx: ParseContext,\n): { readonly smartArt: SmartArtOptions } | undefined {\n const relIds = findDeep(el, \"dgm:relIds\")[0];\n if (!relIds) return undefined;\n\n const rId = attr(relIds, \"r:dm\");\n const dataPath = lookupRId(ctx.docx.partRefs.diagramData, rId);\n if (!dataPath) return undefined;\n\n const dataEl = ctx.docx.doc.get(dataPath);\n if (!dataEl) return undefined;\n\n const opts = parseSmartArtDataXml(dataEl);\n if (!opts) return undefined;\n\n const ext = getDrawingExtent(el);\n if (ext.width !== undefined || ext.height !== undefined) {\n (opts as Record<string, unknown>).transformation = {\n ...ext,\n };\n }\n\n return { smartArt: opts as unknown as SmartArtOptions };\n}\n\n/**\n * Parse dgm:dataModel element into SmartArtOptions.\n */\nfunction parseSmartArtDataXml(el: Element): Record<string, unknown> | undefined {\n const ptLst = findChild(el, \"dgm:ptLst\");\n if (!ptLst) return undefined;\n\n const opts: Record<string, unknown> = {};\n const nodeMap = new Map<string, string>(); // modelId → text\n\n for (const pt of ptLst.elements ?? []) {\n if (pt.name !== \"dgm:pt\") continue;\n const type = attr(pt, \"type\");\n const modelId = attr(pt, \"modelId\");\n\n if (type === \"doc\") {\n // Extract layout/style/color from prSet URIs\n const prSet = findChild(pt, \"dgm:prSet\");\n if (prSet) {\n const loTypeId = attr(prSet, \"loTypeId\") ?? \"\";\n const qsTypeId = attr(prSet, \"qsTypeId\") ?? \"\";\n const csTypeId = attr(prSet, \"csTypeId\") ?? \"\";\n\n const layout = loTypeId.split(\"/\").pop();\n if (layout) opts.layout = layout;\n const style = qsTypeId.split(\"/\").pop();\n if (style) opts.style = style;\n const color = csTypeId.split(\"/\").pop();\n if (color) opts.color = color;\n }\n } else if (type === \"node\" && modelId) {\n // Extract text: dgm:t → a:p → a:r → a:t\n const t = findDeep(pt, \"a:t\")[0];\n nodeMap.set(modelId, t ? (textOf(t) ?? \"\") : \"\");\n }\n }\n\n // Build tree from connections\n const cxnLst = findChild(el, \"dgm:cxnLst\");\n if (!cxnLst) {\n opts.data = { nodes: [] };\n return opts;\n }\n\n // Map: parentId → childIds\n const childrenMap = new Map<string, string[]>();\n for (const cxn of cxnLst.elements ?? []) {\n if (cxn.name !== \"dgm:cxn\") continue;\n const srcId = attr(cxn, \"srcId\");\n const destId = attr(cxn, \"destId\");\n if (!srcId || !destId || !nodeMap.has(destId)) continue;\n\n let arr = childrenMap.get(srcId);\n if (!arr) {\n arr = [];\n childrenMap.set(srcId, arr);\n }\n arr.push(destId);\n }\n\n // Root children are connected from doc node (modelId=\"0\")\n const topIds = childrenMap.get(\"0\") ?? [];\n opts.data = { nodes: topIds.map((id) => buildSmartArtNode(id, nodeMap, childrenMap)) };\n\n return opts;\n}\n\nfunction buildSmartArtNode(\n id: string,\n nodeMap: Map<string, string>,\n childrenMap: Map<string, string[]>,\n): { text: string; children?: unknown[] } {\n const text = nodeMap.get(id) ?? \"\";\n const childIds = childrenMap.get(id) ?? [];\n\n if (childIds.length === 0) return { text };\n return { text, children: childIds.map((cid) => buildSmartArtNode(cid, nodeMap, childrenMap)) };\n}\n","import type { RunPropertiesOptions, RunOptions } from \"@file/paragraph/run\";\nimport { RawPassthrough } from \"@office-open/core\";\n/**\n * Run properties parser for DOCX documents.\n *\n * Parses w:rPr Element trees into RunPropertiesOptions objects.\n *\n * @module\n */\nimport { attr, attrBool, attrNum, colorAttr, findChild, textOf } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../../parse/context\";\n\n/**\n * Parse a w:rPr element into RunPropertiesOptions.\n */\nexport function parseRunProperties(el: Element): RunPropertiesOptions {\n const opts: Record<string, unknown> = {};\n\n const rStyle = findChild(el, \"w:rStyle\");\n if (rStyle) opts.style = attr(rStyle, \"w:val\");\n\n const font = findChild(el, \"w:rFonts\");\n if (font) {\n const ascii = attr(font, \"w:ascii\");\n const eastAsia = attr(font, \"w:eastAsia\");\n const hAnsi = attr(font, \"w:hAnsi\");\n const cs = attr(font, \"w:cs\");\n const hint = attr(font, \"w:hint\");\n\n if (ascii && !eastAsia && !hAnsi && !cs) {\n opts.font = hint ? { name: ascii, hint } : ascii;\n } else {\n const fontObj: Record<string, string | undefined> = {};\n if (ascii) fontObj.ascii = ascii;\n if (eastAsia) fontObj.eastAsia = eastAsia;\n if (hAnsi) fontObj.hAnsi = hAnsi;\n if (cs) fontObj.cs = cs;\n if (hint) fontObj.hint = hint;\n opts.font = fontObj;\n }\n }\n\n const bold = findChild(el, \"w:b\");\n if (bold) opts.bold = attrBool(bold, \"w:val\") ?? true;\n\n const boldCs = findChild(el, \"w:bCs\");\n if (boldCs) opts.boldComplexScript = attrBool(boldCs, \"w:val\") ?? true;\n\n const italics = findChild(el, \"w:i\");\n if (italics) opts.italics = attrBool(italics, \"w:val\") ?? true;\n\n const italicsCs = findChild(el, \"w:iCs\");\n if (italicsCs) opts.italicsComplexScript = attrBool(italicsCs, \"w:val\") ?? true;\n\n const underline = findChild(el, \"w:u\");\n if (underline) {\n const ul: Record<string, string | undefined> = {};\n const uType = attr(underline, \"w:val\");\n if (uType) ul.type = uType;\n const uColor = colorAttr(underline, \"w:color\");\n if (uColor) ul.color = uColor;\n opts.underline = ul;\n }\n\n // On/off properties\n for (const [name, optKey] of [\n [\"w:strike\", \"strike\"],\n [\"w:dstrike\", \"doubleStrike\"],\n [\"w:outline\", \"outline\"],\n [\"w:shadow\", \"shadow\"],\n [\"w:emboss\", \"emboss\"],\n [\"w:imprint\", \"imprint\"],\n [\"w:vanish\", \"vanish\"],\n [\"w:webHidden\", \"webHidden\"],\n [\"w:noProof\", \"noProof\"],\n [\"w:snapToGrid\", \"snapToGrid\"],\n [\"w:smallCaps\", \"smallCaps\"],\n [\"w:caps\", \"allCaps\"],\n [\"w:rtl\", \"rightToLeft\"],\n [\"w:cs\", \"complexScript\"],\n [\"w:specVanish\", \"specVanish\"],\n [\"w:math\", \"math\"],\n ] as const) {\n const child = findChild(el, name);\n if (child) opts[optKey] = attrBool(child, \"w:val\") ?? true;\n }\n\n const color = findChild(el, \"w:color\");\n if (color) {\n const c = colorAttr(color, \"w:val\");\n if (c) opts.color = c;\n }\n\n const sz = findChild(el, \"w:sz\");\n if (sz) {\n const halfPts = attrNum(sz, \"w:val\");\n if (halfPts !== undefined) opts.size = halfPts;\n }\n\n const szCs = findChild(el, \"w:szCs\");\n if (szCs) {\n const halfPts = attrNum(szCs, \"w:val\");\n if (halfPts !== undefined) opts.sizeComplexScript = halfPts;\n }\n\n const highlight = findChild(el, \"w:highlight\");\n if (highlight) {\n const val = attr(highlight, \"w:val\");\n if (val) opts.highlight = val;\n }\n\n const highlightCs = findChild(el, \"w:highlightCs\");\n if (highlightCs) {\n const val = attr(highlightCs, \"w:val\");\n if (val) opts.highlightComplexScript = val;\n }\n\n const vertAlign = findChild(el, \"w:vertAlign\");\n if (vertAlign) {\n const val = attr(vertAlign, \"w:val\");\n if (val === \"subscript\") opts.subScript = true;\n else if (val === \"superscript\") opts.superScript = true;\n }\n\n const effect = findChild(el, \"w:effect\");\n if (effect) {\n const val = attr(effect, \"w:val\");\n if (val) opts.effect = val;\n }\n\n const emphasisMark = findChild(el, \"w:em\");\n if (emphasisMark) {\n const val = attr(emphasisMark, \"w:val\");\n if (val) opts.emphasisMark = { type: val };\n }\n\n const spacing = findChild(el, \"w:spacing\");\n if (spacing) {\n const val = attrNum(spacing, \"w:val\");\n if (val !== undefined) opts.characterSpacing = val;\n }\n\n const scale = findChild(el, \"w:w\");\n if (scale) {\n const val = attrNum(scale, \"w:val\");\n if (val !== undefined) opts.scale = val;\n }\n\n const kern = findChild(el, \"w:kern\");\n if (kern) {\n const val = attrNum(kern, \"w:val\");\n if (val !== undefined) opts.kern = val;\n }\n\n const position = findChild(el, \"w:position\");\n if (position) {\n const val = attr(position, \"w:val\");\n if (val !== undefined) opts.position = val;\n }\n\n const fitText = findChild(el, \"w:fitText\");\n if (fitText) {\n const val = attrNum(fitText, \"w:val\");\n if (val !== undefined) opts.fitText = val;\n }\n\n const lang = findChild(el, \"w:lang\");\n if (lang) {\n const langObj: Record<string, string | undefined> = {};\n const val = attr(lang, \"w:val\");\n if (val) langObj.val = val;\n const eastAsia = attr(lang, \"w:eastAsia\");\n if (eastAsia) langObj.eastAsia = eastAsia;\n const bidi = attr(lang, \"w:bidi\");\n if (bidi) langObj.bidi = bidi;\n if (Object.keys(langObj).length > 0) opts.language = langObj;\n }\n\n // Border (w:bdr)\n const bdr = findChild(el, \"w:bdr\");\n if (bdr) {\n opts.border = parseBorder(bdr);\n }\n\n // Shading (w:shd)\n const shd = findChild(el, \"w:shd\");\n if (shd) {\n opts.shading = parseShading(shd);\n }\n\n return opts as RunPropertiesOptions;\n}\n\n/**\n * Parse a w:bdr element into BorderOptions.\n */\nexport function parseBorder(el: Element): Record<string, unknown> {\n const opts: Record<string, unknown> = {};\n const style = attr(el, \"w:val\");\n if (style) opts.style = style;\n const color = colorAttr(el, \"w:color\");\n if (color) opts.color = color;\n const size = attrNum(el, \"w:sz\");\n if (size !== undefined) opts.size = size;\n const space = attrNum(el, \"w:space\");\n if (space !== undefined) opts.space = space;\n const shadow = attrBool(el, \"w:shadow\");\n if (shadow !== undefined) opts.shadow = shadow;\n const frame = attrBool(el, \"w:frame\");\n if (frame !== undefined) opts.frame = frame;\n return opts;\n}\n\n/**\n * Parse a w:shd element into ShadingAttributesProperties.\n */\nexport function parseShading(el: Element): Record<string, unknown> {\n const opts: Record<string, unknown> = {};\n const fill = colorAttr(el, \"w:fill\");\n if (fill) opts.fill = fill;\n const color = colorAttr(el, \"w:color\");\n if (color) opts.color = color;\n const type = attr(el, \"w:val\");\n if (type) opts.type = type;\n return opts;\n}\n\n// ── Special run child constants ──────────────────────────────────────────────\n\n/** Matches w:br[@w:type=\"page\"] → PageBreak */\nexport const PARSED_PAGE_BREAK = Symbol(\"PageBreak\");\n/** Matches w:br (line break) */\nexport const PARSED_LINE_BREAK = Symbol(\"LineBreak\");\n/** Matches w:tab */\nexport const PARSED_TAB = Symbol(\"Tab\");\n/** Matches w:cr */\nexport const PARSED_CR = Symbol(\"CarriageReturn\");\n/** Matches w:noBreakHyphen */\nexport const PARSED_NO_BREAK_HYPHEN = Symbol(\"NoBreakHyphen\");\n/** Matches w:softHyphen */\nexport const PARSED_SOFT_HYPHEN = Symbol(\"SoftHyphen\");\n/** Matches w:footnoteRef — auto-generated by Footnote class */\nexport const PARSED_FOOTNOTE_REF = Symbol(\"FootnoteRef\");\n/** Matches w:br[@w:type=\"column\"] */\nexport const PARSED_COLUMN_BREAK = Symbol(\"ColumnBreak\");\n\nexport type ParsedRunChild =\n | string\n | typeof PARSED_PAGE_BREAK\n | typeof PARSED_LINE_BREAK\n | typeof PARSED_TAB\n | typeof PARSED_CR\n | typeof PARSED_NO_BREAK_HYPHEN\n | typeof PARSED_SOFT_HYPHEN\n | typeof PARSED_FOOTNOTE_REF\n | typeof PARSED_COLUMN_BREAK\n | { readonly commentReference: number }\n | RawPassthrough;\n\n/**\n * Parse a w:r element into run data.\n * Returns { properties, children } where children are parsed run content items.\n */\nexport function parseRun(\n el: Element,\n _ctx: ParseContext,\n): {\n properties: RunPropertiesOptions | undefined;\n children: ParsedRunChild[];\n} {\n const rPr = findChild(el, \"w:rPr\");\n const properties = rPr ? parseRunProperties(rPr) : undefined;\n const children: ParsedRunChild[] = [];\n\n for (const child of el.elements ?? []) {\n switch (child.name) {\n case \"w:rPr\":\n // already handled above\n break;\n case \"w:t\": {\n const preserveSpace = attrBool(child, \"xml:space\");\n let text = textOf(child);\n if (preserveSpace && text) {\n // keep leading/trailing whitespace\n // textOf already returns the raw text\n }\n children.push(text);\n break;\n }\n case \"w:delText\": {\n // Deleted text in track changes (same format as w:t)\n const text = textOf(child);\n if (text) children.push(text);\n break;\n }\n case \"w:br\": {\n const brType = attr(child, \"w:type\");\n if (brType === \"page\") {\n children.push(PARSED_PAGE_BREAK);\n } else if (brType === \"column\") {\n children.push(PARSED_COLUMN_BREAK);\n } else {\n children.push(PARSED_LINE_BREAK);\n }\n break;\n }\n case \"w:tab\":\n children.push(PARSED_TAB);\n break;\n case \"w:cr\":\n children.push(PARSED_CR);\n break;\n case \"w:noBreakHyphen\":\n children.push(PARSED_NO_BREAK_HYPHEN);\n break;\n case \"w:softHyphen\":\n children.push(PARSED_SOFT_HYPHEN);\n break;\n case \"w:commentReference\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) children.push({ commentReference: id });\n break;\n }\n // Drawing/pict are handled at the paragraph level (parseSectionChild in body.ts)\n // where the drawing is extracted and replaced as a paragraph child.\n case \"w:drawing\":\n case \"w:pict\":\n break;\n // Symbol run — extract char and font attributes\n case \"w:sym\": {\n const charVal = attr(child, \"w:char\");\n const fontVal = attr(child, \"w:font\");\n if (charVal) {\n children.push({\n symbolRun: { char: charVal, symbolfont: fontVal ?? \"Wingdings\" },\n } as unknown as ParsedRunChild);\n }\n break;\n }\n // Footnote/endnote reference — preserve as { footnoteReference: id } / { endnoteReference: id }\n case \"w:footnoteReference\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) children.push({ footnoteReference: id } as unknown as ParsedRunChild);\n break;\n }\n case \"w:endnoteReference\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) children.push({ endnoteReference: id } as unknown as ParsedRunChild);\n break;\n }\n // Footnote/endnote ref mark inside footnote/endnote content —\n // auto-generated by Footnote/Endnote class, skip to avoid duplication.\n case \"w:footnoteRef\":\n case \"w:endnoteRef\":\n children.push(PARSED_FOOTNOTE_REF);\n break;\n default:\n // Preserve unknown run-level elements for round-trip fidelity\n if (child.name && child.elements && child.elements.length > 0) {\n children.push(new RawPassthrough(child));\n }\n break;\n }\n }\n\n return { properties, children };\n}\n\n/**\n * Convert parsed run data into an RunOptions suitable for the Document constructor.\n * Simplifies the parsed children into text + break format.\n * If the run contains only a commentReference, returns { commentReference: id } instead.\n * If the run only contains footnoteRef/endnoteRef (auto-generated), returns empty options.\n */\nexport function parsedRunToOptions(\n parsed: ReturnType<typeof parseRun>,\n): RunOptions | { readonly commentReference: number } | null {\n // Filter out footnoteRef/endnoteRef symbols (auto-generated by Footnote/Endnote class)\n const contentChildren = parsed.children.filter((c) => c !== PARSED_FOOTNOTE_REF);\n const isOnlyFootnoteRef =\n contentChildren.length === 0 && parsed.children.some((c) => c === PARSED_FOOTNOTE_REF);\n\n // If the run only contained footnoteRef/endnoteRef (no text, no other content),\n // skip it entirely — the Footnote/Endnote class auto-adds FootnoteRefRun.\n if (isOnlyFootnoteRef) {\n return null;\n }\n\n const opts: Record<string, unknown> = { ...parsed.properties };\n\n // Check if this run is a pure reference run (commentReference, footnoteReference, endnoteReference)\n const isRefChild = (c: unknown): c is Record<string, number> =>\n typeof c === \"object\" &&\n c !== null &&\n (\"commentReference\" in c || \"footnoteReference\" in c || \"endnoteReference\" in c);\n\n const refChildren = contentChildren.filter(isRefChild);\n const nonRefChildren = contentChildren.filter((c) => !isRefChild(c));\n\n // If the run is a pure reference run (no text), return it directly.\n // Drop auto-generated rStyle (e.g., \"FootnoteReference\") since it's implicit.\n if (refChildren.length > 0 && nonRefChildren.length === 0) {\n return refChildren[0] as RunOptions | { readonly commentReference: number };\n }\n\n // If the run only contains a symbolRun, return it directly\n const symbolIdx = nonRefChildren.findIndex(\n (c) => typeof c === \"object\" && c !== null && \"symbolRun\" in c,\n );\n if (symbolIdx >= 0 && nonRefChildren.length === 1 && !parsed.properties) {\n return nonRefChildren[symbolIdx] as unknown as RunOptions;\n }\n\n // Collect text and breaks\n const textParts: string[] = [];\n let breakCount = 0;\n let hasPageBreak = false;\n let hasColumnBreak = false;\n\n for (const child of nonRefChildren) {\n if (typeof child === \"string\") {\n textParts.push(child);\n } else if (child === PARSED_LINE_BREAK) {\n breakCount++;\n } else if (child === PARSED_PAGE_BREAK) {\n hasPageBreak = true;\n } else if (child === PARSED_COLUMN_BREAK) {\n hasColumnBreak = true;\n }\n // Other symbols (tab, etc.) are dropped in simplified mode\n }\n\n if (textParts.length > 0) {\n opts.text = textParts.join(\"\");\n }\n if (breakCount > 0) {\n opts.break = breakCount;\n }\n if (hasPageBreak) {\n opts.pageBreak = true;\n }\n if (hasColumnBreak) {\n opts.columnBreak = true;\n }\n\n // If the run has no content and no properties (e.g., a pure drawing run),\n // return null so it can be skipped by the caller.\n if (\n Object.keys(opts).length === 0 &&\n textParts.length === 0 &&\n breakCount === 0 &&\n !hasPageBreak &&\n !hasColumnBreak\n ) {\n return null;\n }\n\n return opts as RunOptions;\n}\n","import { HeadingLevel } from \"@file/paragraph/formatting/style\";\nimport type { ParagraphOptions } from \"@file/paragraph/paragraph\";\nimport type { RunOptions } from \"@file/paragraph/run\";\n/**\n * Paragraph parser for DOCX documents.\n *\n * Parses w:p and w:pPr Element trees into ParagraphOptions objects.\n *\n * @module\n */\nimport { RawPassthrough } from \"@office-open/core\";\nimport { attr, attrBool, attrNum, children, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\nimport { parseDrawingRun } from \"../drawing/drawing-parse\";\nimport { parseMathChildren } from \"./math/math-parse\";\nimport { parseRun, parseRunProperties, parsedRunToOptions } from \"./run/run-parse\";\n\nconst HEADING_MAP: Record<string, string> = {\n Heading1: HeadingLevel.HEADING_1,\n Heading2: HeadingLevel.HEADING_2,\n Heading3: HeadingLevel.HEADING_3,\n Heading4: HeadingLevel.HEADING_4,\n Heading5: HeadingLevel.HEADING_5,\n Heading6: HeadingLevel.HEADING_6,\n Title: HeadingLevel.TITLE,\n};\n\n/**\n * Parse w:pPr element into paragraph properties (without children).\n */\nexport function parseParagraphProperties(el: Element, _ctx: ParseContext): Record<string, unknown> {\n const opts: Record<string, unknown> = {};\n\n // Style / heading\n const pStyle = findChild(el, \"w:pStyle\");\n if (pStyle) {\n const styleVal = attr(pStyle, \"w:val\");\n if (styleVal) {\n if (HEADING_MAP[styleVal]) {\n opts.heading = HEADING_MAP[styleVal];\n } else {\n opts.style = styleVal;\n }\n }\n }\n\n // Alignment\n const jc = findChild(el, \"w:jc\");\n if (jc) {\n const val = attr(jc, \"w:val\");\n if (val) opts.alignment = val;\n }\n\n // Spacing\n const spacing = findChild(el, \"w:spacing\");\n if (spacing) {\n const sp: Record<string, unknown> = {};\n const before = attrNum(spacing, \"w:before\");\n if (before !== undefined) sp.before = before;\n const after = attrNum(spacing, \"w:after\");\n if (after !== undefined) sp.after = after;\n const line = attrNum(spacing, \"w:line\");\n if (line !== undefined) sp.line = line;\n const lineRule = attr(spacing, \"w:lineRule\");\n if (lineRule) sp.lineRule = lineRule;\n const beforeAuto =\n attrBool(spacing, \"w:beforeAutospacing\") ?? attrBool(spacing, \"w:beforeLines\");\n if (beforeAuto !== undefined) sp.beforeAutoSpacing = beforeAuto;\n const afterAuto = attrBool(spacing, \"w:afterAutospacing\") ?? attrBool(spacing, \"w:afterLines\");\n if (afterAuto !== undefined) sp.afterAutoSpacing = afterAuto;\n if (Object.keys(sp).length > 0) opts.spacing = sp;\n }\n\n // Indent\n const ind = findChild(el, \"w:ind\");\n if (ind) {\n const indentObj: Record<string, unknown> = {};\n const left = attrNum(ind, \"w:left\");\n if (left !== undefined) indentObj.left = left;\n const right = attrNum(ind, \"w:right\");\n if (right !== undefined) indentObj.right = right;\n const start = attrNum(ind, \"w:start\");\n if (start !== undefined) indentObj.start = start;\n const end = attrNum(ind, \"w:end\");\n if (end !== undefined) indentObj.end = end;\n const hanging = attrNum(ind, \"w:hanging\");\n if (hanging !== undefined) indentObj.hanging = hanging;\n const firstLine = attrNum(ind, \"w:firstLine\");\n if (firstLine !== undefined) indentObj.firstLine = firstLine;\n if (Object.keys(indentObj).length > 0) opts.indent = indentObj;\n }\n\n // Numbering (w:numPr) → numbering reference or bullet fallback\n const numPr = findChild(el, \"w:numPr\");\n if (numPr) {\n const ilvl = findChild(numPr, \"w:ilvl\");\n const level = ilvl ? (attrNum(ilvl, \"w:val\") ?? 0) : 0;\n const numIdEl = findChild(numPr, \"w:numId\");\n const numId = numIdEl ? attr(numIdEl, \"w:val\") : undefined;\n if (numId !== undefined && _ctx.numberingCache.size > 0) {\n // Resolve numId → abstractNumId → find in numberingCache\n const numEl = _ctx.docx.numbering;\n if (numEl) {\n let abstractNumId: string | undefined;\n for (const child of numEl.elements ?? []) {\n if (child.name !== \"w:num\") continue;\n if (attr(child, \"w:numId\") === numId) {\n const absRef = findChild(child, \"w:abstractNumId\");\n abstractNumId = absRef ? attr(absRef, \"w:val\") : undefined;\n break;\n }\n }\n if (abstractNumId !== undefined) {\n opts.numbering = { reference: `list_${numId}`, level };\n } else {\n opts.bullet = { level };\n }\n } else {\n opts.bullet = { level };\n }\n } else {\n opts.bullet = { level };\n }\n }\n\n // Tab stops\n const tabs = findChild(el, \"w:tabs\");\n if (tabs) {\n const tabStops: Record<string, unknown>[] = [];\n for (const tab of children(tabs, \"w:tab\")) {\n const tabObj: Record<string, unknown> = {};\n const pos = attrNum(tab, \"w:pos\");\n if (pos !== undefined) tabObj.position = pos;\n const val = attr(tab, \"w:val\");\n if (val) tabObj.type = val;\n const leader = attr(tab, \"w:leader\");\n if (leader) tabObj.leader = leader;\n tabStops.push(tabObj);\n }\n if (tabStops.length > 0) opts.tabStops = tabStops;\n }\n\n // On/off properties\n for (const [name, optKey] of [\n [\"w:keepNext\", \"keepNext\"],\n [\"w:keepLines\", \"keepLines\"],\n [\"w:pageBreakBefore\", \"pageBreakBefore\"],\n [\"w:widowControl\", \"widowControl\"],\n [\"w:suppressLineNumbers\", \"suppressLineNumbers\"],\n [\"w:contextualSpacing\", \"contextualSpacing\"],\n [\"w:bidi\", \"bidirectional\"],\n [\"w:wordWrap\", \"wordWrap\"],\n [\"w:suppressAutoHyphens\", \"suppressAutoHyphens\"],\n [\"w:adjustRightInd\", \"adjustRightInd\"],\n [\"w:snapToGrid\", \"snapToGrid\"],\n [\"w:mirrorIndents\", \"mirrorIndents\"],\n [\"w:kinsoku\", \"kinsoku\"],\n [\"w:topLinePunct\", \"topLinePunct\"],\n [\"w:autoSpaceDE\", \"autoSpaceDE\"],\n [\"w:overflowPunct\", \"overflowPunctuation\"],\n [\"w:suppressOverlap\", \"suppressOverlap\"],\n ] as const) {\n const child = findChild(el, name);\n if (child) opts[optKey] = attrBool(child, \"w:val\") ?? true;\n }\n\n // Thematic break\n if (findChild(el, \"w:pBdr\")) {\n const pBdr = findChild(el, \"w:pBdr\")!;\n const border: Record<string, unknown> = {};\n for (const side of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n const sideEl = findChild(pBdr, `w:${side}`);\n if (sideEl) {\n const sideOpts: Record<string, unknown> = {};\n const style = attr(sideEl, \"w:val\");\n if (style) sideOpts.style = style;\n const color = attr(sideEl, \"w:color\");\n if (color) sideOpts.color = color;\n const size = attrNum(sideEl, \"w:sz\");\n if (size !== undefined) sideOpts.size = size;\n const space = attrNum(sideEl, \"w:space\");\n if (space !== undefined) sideOpts.space = space;\n border[side] = sideOpts;\n }\n }\n if (Object.keys(border).length > 0) opts.border = border;\n }\n\n // Shading\n const shd = findChild(el, \"w:shd\");\n if (shd) {\n const shdObj: Record<string, unknown> = {};\n const fill = attr(shd, \"w:fill\");\n if (fill) shdObj.fill = fill;\n const color = attr(shd, \"w:color\");\n if (color) shdObj.color = color;\n const val = attr(shd, \"w:val\");\n if (val) shdObj.type = val;\n if (Object.keys(shdObj).length > 0) opts.shading = shdObj;\n }\n\n // Text alignment\n const textAlignment = findChild(el, \"w:textAlignment\");\n if (textAlignment) {\n const val = attr(textAlignment, \"w:val\");\n if (val) opts.textAlignment = val;\n }\n\n // Outline level\n const outlineLvl = findChild(el, \"w:outlineLvl\");\n if (outlineLvl) {\n const val = attrNum(outlineLvl, \"w:val\");\n if (val !== undefined) opts.outlineLevel = val;\n }\n\n // Conditional format style\n const cnfStyle = findChild(el, \"w:cnfStyle\");\n if (cnfStyle) {\n const val = attr(cnfStyle, \"w:val\");\n if (val) opts.cnfStyle = { val };\n }\n\n // Run properties (paragraph-level defaults)\n const rPr = findChild(el, \"w:rPr\");\n if (rPr) {\n opts.run = parseRunProperties(rPr);\n }\n\n // Frame properties\n const framePr = findChild(el, \"w:framePr\");\n if (framePr) {\n const frame: Record<string, unknown> = {};\n for (const [attrName, optName] of [\n [\"w:dropCap\", \"dropCap\"],\n [\"w:lines\", \"lines\"],\n [\"w:wrap\", \"wrap\"],\n [\"w:vAnchor\", \"vAnchor\"],\n [\"w:hAnchor\", \"hAnchor\"],\n [\"w:x\", \"x\"],\n [\"w:y\", \"y\"],\n [\"w:hRule\", \"hRule\"],\n [\"w:hSpace\", \"hSpace\"],\n [\"w:vSpace\", \"vSpace\"],\n ] as const) {\n const val = attr(framePr, attrName);\n if (val !== undefined) frame[optName] = val;\n }\n const w = attrNum(framePr, \"w:w\");\n if (w !== undefined) frame.width = w;\n const h = attrNum(framePr, \"w:h\");\n if (h !== undefined) frame.height = h;\n if (Object.keys(frame).length > 0) opts.frame = frame;\n }\n\n return opts;\n}\n\n/**\n * Parse a w:p element into ParagraphOptions.\n */\nexport function parseParagraph(el: Element, ctx: ParseContext): ParagraphOptions {\n const opts: Record<string, unknown> = {};\n\n const pPr = findChild(el, \"w:pPr\");\n if (pPr) {\n Object.assign(opts, parseParagraphProperties(pPr, ctx));\n }\n\n // Parse children\n const childList: unknown[] = [];\n\n for (const child of el.elements ?? []) {\n switch (child.name) {\n case \"w:pPr\":\n break; // already handled\n case \"w:r\": {\n // Check for drawing inside run (image/chart/smartArt) — preserve original position\n const drawingEl = findChild(child, \"w:drawing\");\n if (drawingEl) {\n const drawingChild = parseDrawingRun(drawingEl, ctx);\n if (drawingChild) {\n childList.push(drawingChild);\n break;\n }\n }\n const parsed = parseRun(child, ctx);\n // Extract RawPassthrough children and push them directly to paragraph\n const rawChildren = parsed.children.filter(\n (c): c is RawPassthrough => c instanceof RawPassthrough,\n );\n const simplified = {\n ...parsed,\n children: parsed.children.filter((c) => !(c instanceof RawPassthrough)),\n };\n // Convert to RunOptions (or { commentReference }, or null if footnoteRef-only)\n const runOpts = parsedRunToOptions(simplified);\n if (runOpts !== null) childList.push(runOpts);\n // Preserve raw passthrough elements for round-trip fidelity\n childList.push(...rawChildren);\n break;\n }\n case \"w:hyperlink\": {\n const hl: Record<string, unknown> = {};\n // External link via r:id\n const rId = attr(child, \"r:id\");\n if (rId) {\n const target = ctx.docx.partRefs.hyperlinks.get(rId);\n if (target) hl.link = target;\n }\n // Internal bookmark anchor\n const anchor = attr(child, \"w:anchor\");\n if (anchor) hl.anchor = anchor;\n // Tooltip\n const tooltip = attr(child, \"w:tooltip\");\n if (tooltip) hl.tooltip = tooltip;\n\n const linkRuns: unknown[] = [];\n for (const sub of child.elements ?? []) {\n if (sub.name === \"w:r\") {\n const parsed = parseRun(sub, ctx);\n const runOpts = parsedRunToOptions(parsed);\n linkRuns.push(runOpts);\n }\n }\n\n if (linkRuns.length > 0) {\n hl.children = linkRuns;\n childList.push({ hyperlink: hl });\n }\n break;\n }\n case \"w:bookmarkStart\": {\n const id = attrNum(child, \"w:id\");\n const name = attr(child, \"w:name\");\n if (id !== undefined && name) {\n childList.push({ bookmarkStart: { id, name } });\n }\n break;\n }\n case \"w:bookmarkEnd\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) childList.push({ bookmarkEnd: id });\n break;\n }\n case \"w:commentRangeStart\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) childList.push({ commentRangeStart: id });\n break;\n }\n case \"w:commentRangeEnd\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) childList.push({ commentRangeEnd: id });\n break;\n }\n case \"w:commentReference\": {\n const id = attrNum(child, \"w:id\");\n if (id !== undefined) childList.push({ commentReference: id });\n break;\n }\n case \"m:oMath\": {\n const mathChildren = parseMathChildren(child);\n childList.push({ math: { children: mathChildren } });\n break;\n }\n case \"w:ins\": {\n // Track change insertion: w:ins containing w:r children\n const insRun = findChild(child, \"w:r\");\n if (insRun) {\n const parsed = parseRun(insRun, ctx);\n const runOpts = parsedRunToOptions(parsed);\n if (runOpts !== null && typeof runOpts === \"object\" && !(\"commentReference\" in runOpts)) {\n childList.push({\n insertion: {\n id: attrNum(child, \"w:id\") ?? 0,\n author: attr(child, \"w:author\") ?? \"\",\n date: attr(child, \"w:date\") ?? \"\",\n ...(runOpts as Record<string, unknown>),\n },\n });\n }\n }\n break;\n }\n case \"w:del\": {\n // Track change deletion: w:del containing w:r with w:delText\n const delRun = findChild(child, \"w:r\");\n if (delRun) {\n const parsed = parseRun(delRun, ctx);\n const runOpts = parsedRunToOptions(parsed);\n if (runOpts !== null && typeof runOpts === \"object\" && !(\"commentReference\" in runOpts)) {\n childList.push({\n deletion: {\n id: attrNum(child, \"w:id\") ?? 0,\n author: attr(child, \"w:author\") ?? \"\",\n date: attr(child, \"w:date\") ?? \"\",\n ...(runOpts as Record<string, unknown>),\n },\n });\n }\n }\n break;\n }\n default:\n // Wrap unknown elements as RawPassthrough\n if (child.name && child.elements && child.elements.length > 0) {\n childList.push(new RawPassthrough(child));\n }\n break;\n }\n }\n\n // Simple text optimization: if there's only pure text content (no formatting), use the text field\n if (childList.length > 0) {\n const allStrings = childList.every(\n (c) =>\n typeof c === \"object\" &&\n c !== null &&\n \"text\" in (c as Record<string, unknown>) &&\n Object.keys(c as Record<string, unknown>).length === 1,\n );\n if (allStrings) {\n const combined = childList.map((c) => (c as Record<string, unknown>).text as string).join(\"\");\n if (combined && Object.keys(opts).length === 0) {\n return combined as unknown as ParagraphOptions;\n }\n if (combined) {\n opts.text = combined;\n return opts as ParagraphOptions;\n }\n }\n\n opts.children = childList as (RunOptions | string)[];\n }\n\n return opts as ParagraphOptions;\n}\n","import type { AltChunkOptions } from \"@file/alt-chunk/alt-chunk\";\n/**\n * AltChunk parser for DOCX documents.\n *\n * Parses w:altChunk elements and extracts embedded content from the ZIP.\n *\n * @module\n */\nimport { attr } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\n\n/**\n * Parse a w:altChunk element into AltChunkOptions.\n * Reads the referenced data from the ZIP package.\n */\nexport function parseAltChunk(el: Element, ctx: ParseContext): AltChunkOptions {\n const rId = attr(el, \"r:id\");\n if (!rId) {\n throw new Error(\"w:altChunk missing r:id attribute\");\n }\n\n // Look up the path from relationships\n const path = ctx.docx.partRefs.afChunks.get(rId);\n if (!path) {\n throw new Error(`AltChunk relationship ${rId} not found`);\n }\n\n // Read raw data from ZIP\n const data = ctx.docx.doc.getRaw(path);\n if (!data) {\n throw new Error(`AltChunk data not found at ${path}`);\n }\n\n // Determine content type from extension\n const ext = path.split(\".\").pop() ?? \"txt\";\n let contentType: \"text/html\" | \"application/rtf\" | \"text/plain\";\n let extension: \"html\" | \"rtf\" | \"txt\";\n\n switch (ext) {\n case \"html\":\n contentType = \"text/html\";\n extension = \"html\";\n break;\n case \"rtf\":\n contentType = \"application/rtf\";\n extension = \"rtf\";\n break;\n default:\n contentType = \"text/plain\";\n extension = \"txt\";\n break;\n }\n\n return {\n data,\n contentType,\n extension,\n };\n}\n","import type {\n SdtPropertiesOptions,\n SdtListItem,\n SdtDateOptions,\n SdtTextOptions,\n SdtComboBoxOptions,\n SdtDropDownListOptions,\n} from \"@file/table-of-contents\";\n/**\n * Structured Document Tag parser for DOCX documents.\n *\n * Parses w:sdt elements into SdtPropertiesOptions + children.\n *\n * @module\n */\nimport { attr, attrBool, attrNum, children, findChild, textOf } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\n\n// Forward declaration for circular dependency\nlet _parseSectionChildren: ((elements: Element[], ctx: ParseContext) => unknown[]) | undefined;\n\nexport function setSectionChildrenParser(\n fn: (elements: Element[], ctx: ParseContext) => unknown[],\n): void {\n _parseSectionChildren = fn;\n}\n\n/**\n * Parse w:sdtPr element into SdtPropertiesOptions.\n */\nfunction parseSdtProperties(el: Element): SdtPropertiesOptions {\n const opts: Record<string, unknown> = {};\n\n const alias = findChild(el, \"w:alias\");\n if (alias) opts.alias = attr(alias, \"w:val\");\n\n const tag = findChild(el, \"w:tag\");\n if (tag) {\n const val = attr(tag, \"w:val\");\n if (val) opts.tag = val;\n }\n\n const id = findChild(el, \"w:id\");\n if (id) {\n const val = attrNum(id, \"w:val\");\n if (val !== undefined) opts.id = val;\n }\n\n const lock = findChild(el, \"w:lock\");\n if (lock) {\n const val = attr(lock, \"w:val\");\n if (val) opts.lock = val as SdtPropertiesOptions[\"lock\"];\n }\n\n const temporary = findChild(el, \"w:temporary\");\n if (temporary) opts.temporary = attrBool(temporary, \"w:val\") ?? true;\n\n const showingPlcHdr = findChild(el, \"w:showingPlcHdr\");\n if (showingPlcHdr) opts.showingPlaceholder = attrBool(showingPlcHdr, \"w:val\") ?? true;\n\n const label = findChild(el, \"w:label\");\n if (label) {\n const val = attrNum(label, \"w:val\");\n if (val !== undefined) opts.label = val;\n }\n\n const tabIndex = findChild(el, \"w:tabIndex\");\n if (tabIndex) {\n const val = attrNum(tabIndex, \"w:val\");\n if (val !== undefined) opts.tabIndex = val;\n }\n\n // Data binding\n const dataBinding = findChild(el, \"w:dataBinding\");\n if (dataBinding) {\n opts.dataBinding = {\n xpath: attr(dataBinding, \"w:xpath\") ?? \"\",\n storeItemID: attr(dataBinding, \"w:storeItemID\") ?? \"\",\n prefixMappings: attr(dataBinding, \"w:prefixMappings\"),\n };\n }\n\n // Type discriminators (xsd:choice)\n if (findChild(el, \"w:equation\")) {\n opts.equation = true;\n } else if (findChild(el, \"w:comboBox\")) {\n const comboBox = findChild(el, \"w:comboBox\")!;\n const items: SdtListItem[] = [];\n for (const li of children(comboBox, \"w:listItem\")) {\n items.push({\n displayText: attr(li, \"w:displayText\"),\n value: attr(li, \"w:value\"),\n });\n }\n opts.comboBox = {\n items: items.length > 0 ? items : undefined,\n lastValue: attr(comboBox, \"w:lastValue\"),\n } as SdtComboBoxOptions;\n } else if (findChild(el, \"w:date\")) {\n const date = findChild(el, \"w:date\")!;\n const dateOpts: Record<string, unknown> = {};\n const dateFormat = findChild(date, \"w:dateFormat\");\n if (dateFormat) dateOpts.dateFormat = textOf(dateFormat);\n const lid = findChild(date, \"w:lid\");\n if (lid) dateOpts.languageId = textOf(lid);\n const storeMapped = findChild(date, \"w:storeMappedDataAs\");\n if (storeMapped) dateOpts.storeMappedDataAs = attr(storeMapped, \"w:val\");\n const calendar = findChild(date, \"w:calendar\");\n if (calendar) dateOpts.calendar = attr(calendar, \"w:val\");\n const fullDate = attr(date, \"w:fullDate\");\n if (fullDate) dateOpts.fullDate = fullDate;\n opts.date = dateOpts as SdtDateOptions;\n } else if (findChild(el, \"w:dropDownList\")) {\n const ddl = findChild(el, \"w:dropDownList\")!;\n const items: SdtListItem[] = [];\n for (const li of children(ddl, \"w:listItem\")) {\n items.push({\n displayText: attr(li, \"w:displayText\"),\n value: attr(li, \"w:value\"),\n });\n }\n opts.dropDownList = {\n items: items.length > 0 ? items : undefined,\n lastValue: attr(ddl, \"w:lastValue\"),\n } as SdtDropDownListOptions;\n } else if (findChild(el, \"w:picture\")) {\n opts.picture = true;\n } else if (findChild(el, \"w:richText\")) {\n opts.richText = true;\n } else if (findChild(el, \"w:text\")) {\n const text = findChild(el, \"w:text\")!;\n opts.text = {\n multiLine: attrBool(text, \"w:multiLine\"),\n } as SdtTextOptions;\n } else if (findChild(el, \"w:citation\")) {\n opts.citation = true;\n } else if (findChild(el, \"w:group\")) {\n opts.group = true;\n } else if (findChild(el, \"w:bibliography\")) {\n opts.bibliography = true;\n } else if (findChild(el, \"w:docPartObj\")) {\n const dp = findChild(el, \"w:docPartObj\")!;\n opts.docPartObj = {};\n const gallery = findChild(dp, \"w:docPartGallery\");\n if (gallery) (opts.docPartObj as Record<string, unknown>).gallery = attr(gallery, \"w:val\");\n const category = findChild(dp, \"w:docPartCategory\");\n if (category) (opts.docPartObj as Record<string, unknown>).category = attr(category, \"w:val\");\n } else if (findChild(el, \"w:docPartList\")) {\n const dp = findChild(el, \"w:docPartList\")!;\n opts.docPartList = {};\n const gallery = findChild(dp, \"w:docPartGallery\");\n if (gallery) (opts.docPartList as Record<string, unknown>).gallery = attr(gallery, \"w:val\");\n const category = findChild(dp, \"w:docPartCategory\");\n if (category) (opts.docPartList as Record<string, unknown>).category = attr(category, \"w:val\");\n }\n\n return opts as SdtPropertiesOptions;\n}\n\n/**\n * Parse a block-level w:sdt element.\n * Returns an object suitable for the { sdt: ... } SectionChild variant.\n */\nexport function parseSdtBlock(\n el: Element,\n ctx: ParseContext,\n): {\n properties: SdtPropertiesOptions;\n children?: unknown[];\n} {\n const sdtPr = findChild(el, \"w:sdtPr\");\n const properties = sdtPr ? parseSdtProperties(sdtPr) : {};\n\n const sdtContent = findChild(el, \"w:sdtContent\");\n let childList: unknown[] | undefined;\n if (sdtContent && _parseSectionChildren) {\n childList = _parseSectionChildren(sdtContent.elements ?? [], ctx);\n if (childList.length === 0) childList = undefined;\n }\n\n return { properties, children: childList };\n}\n","import type { SubDocOptions } from \"@file/sub-doc/sub-doc\";\n/**\n * SubDoc parser for DOCX documents.\n *\n * Parses w:subDoc elements and extracts embedded document data.\n *\n * @module\n */\nimport { attr } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\n\n/**\n * Parse a w:subDoc element into SubDocOptions.\n * Reads the referenced document data from the ZIP package.\n */\nexport function parseSubDoc(el: Element, ctx: ParseContext): SubDocOptions {\n const rId = attr(el, \"r:id\");\n if (!rId) {\n throw new Error(\"w:subDoc missing r:id attribute\");\n }\n\n const path = ctx.docx.partRefs.subDocs.get(rId);\n if (!path) {\n throw new Error(`SubDoc relationship ${rId} not found`);\n }\n\n const data = ctx.docx.doc.getRaw(path);\n if (!data) {\n throw new Error(`SubDoc data not found at ${path}`);\n }\n\n return { data };\n}\n","import type { TableOfContentsOptions } from \"@file/table-of-contents/table-of-contents-properties\";\n/**\n * Table of Contents parser for DOCX documents.\n *\n * Parses TOC-type SDT elements into TOC options.\n *\n * @module\n */\nimport { attr, children, findChild, textOf } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\n\n/**\n * Try to parse a w:sdt element as a TOC.\n * Returns { alias, ...tocOptions } if it's a TOC, or undefined otherwise.\n *\n * Detects TOC in two ways:\n * 1. SDT with w:docPartObj > w:docPartGallery = \"Table of Contents\" (Word-generated)\n * 2. SDT whose content contains a TOC field instruction (library-generated)\n */\nexport function parseToc(\n el: Element,\n _ctx: ParseContext,\n):\n | ({\n alias?: string;\n } & TableOfContentsOptions)\n | undefined {\n const sdtPr = findChild(el, \"w:sdtPr\");\n if (!sdtPr) return undefined;\n\n // Detection method 1: docPartObj with gallery \"Table of Contents\"\n const docPartObj = findChild(sdtPr, \"w:docPartObj\");\n let isToc = false;\n\n if (docPartObj) {\n const gallery = findChild(docPartObj, \"w:docPartGallery\");\n if (gallery && textOf(gallery) === \"Table of Contents\") {\n isToc = true;\n }\n }\n\n // Detection method 2: scan content for TOC field instruction\n if (!isToc) {\n const sdtContent = findChild(el, \"w:sdtContent\");\n if (sdtContent) {\n isToc = hasTocFieldInstruction(sdtContent);\n }\n }\n\n if (!isToc) return undefined;\n\n // It's a TOC SDT\n const alias = (() => {\n const aliasEl = findChild(sdtPr, \"w:alias\");\n return aliasEl ? attr(aliasEl, \"w:val\") : undefined;\n })();\n\n // Parse field instruction from content to extract TOC options\n const tocOpts: Record<string, unknown> = {};\n const sdtContent = findChild(el, \"w:sdtContent\");\n\n if (sdtContent) {\n // Look for field instructions\n for (const p of children(sdtContent, \"w:p\")) {\n for (const r of children(p, \"w:r\")) {\n for (const instrText of children(r, \"w:instrText\")) {\n const instruction = textOf(instrText).trim();\n parseTocFieldInstruction(instruction, tocOpts);\n }\n }\n }\n }\n\n return { alias, ...tocOpts } as { alias?: string } & TableOfContentsOptions;\n}\n\n/**\n * Check whether an element tree contains a TOC field instruction\n * (w:instrText with text starting with \"TOC\").\n */\nfunction hasTocFieldInstruction(el: Element): boolean {\n for (const p of children(el, \"w:p\")) {\n for (const r of children(p, \"w:r\")) {\n for (const instrText of children(r, \"w:instrText\")) {\n const instruction = textOf(instrText)?.trim();\n if (instruction?.startsWith(\"TOC\")) return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Parse a TOC field instruction string (e.g., ' TOC \\o \"1-3\" \\h \\z ')\n * into TableOfContentsOptions properties.\n */\nfunction parseTocFieldInstruction(instruction: string, opts: Record<string, unknown>): void {\n if (!instruction.startsWith(\"TOC\")) return;\n\n const rest = instruction.slice(3).trim();\n const switches = parseFieldSwitches(rest);\n\n if (switches[\"a\"]) opts.captionLabel = switches[\"a\"];\n if (switches[\"b\"]) opts.entriesFromBookmark = switches[\"b\"];\n if (switches[\"c\"]) opts.captionLabelIncludingNumbers = switches[\"c\"];\n if (switches[\"d\"]) opts.sequenceAndPageNumbersSeparator = switches[\"d\"];\n if (switches[\"f\"]) opts.tcFieldIdentifier = switches[\"f\"];\n if (\"h\" in switches) opts.hyperlink = true;\n if (switches[\"l\"]) opts.tcFieldLevelRange = switches[\"l\"];\n if (switches[\"n\"]) opts.pageNumbersEntryLevelsRange = switches[\"n\"];\n if (switches[\"o\"]) opts.headingStyleRange = switches[\"o\"];\n if (switches[\"p\"]) opts.entryAndPageNumberSeparator = switches[\"p\"];\n if (switches[\"s\"]) opts.seqFieldIdentifierForPrefix = switches[\"s\"];\n if (\"u\" in switches) opts.useAppliedParagraphOutlineLevel = true;\n if (\"w\" in switches) opts.preserveTabInEntries = true;\n if (\"x\" in switches) opts.preserveNewLineInEntries = true;\n if (\"z\" in switches) opts.hideTabAndPageNumbersInWebView = true;\n}\n\n/**\n * Parse field switches like \\o \"1-3\" \\h \\z into a map.\n */\nfunction parseFieldSwitches(text: string): Record<string, string | undefined> {\n const result: Record<string, string | undefined> = {};\n let i = 0;\n\n while (i < text.length) {\n // Skip whitespace\n while (i < text.length && text[i] === \" \") i++;\n if (i >= text.length) break;\n\n // Expect backslash\n if (text[i] !== \"\\\\\") {\n i++;\n continue;\n }\n i++;\n\n // Read switch name\n const nameStart = i;\n while (i < text.length && /[a-zA-Z]/.test(text[i])) i++;\n const name = text.slice(nameStart, i);\n if (!name) continue;\n\n // Skip whitespace\n while (i < text.length && text[i] === \" \") i++;\n\n // Read argument (quoted or unquoted)\n if (i < text.length && text[i] === '\"') {\n i++;\n const argStart = i;\n while (i < text.length && text[i] !== '\"') i++;\n result[name] = text.slice(argStart, i);\n if (i < text.length) i++; // skip closing quote\n } else if (i < text.length && text[i] !== \"\\\\\") {\n const argStart = i;\n while (i < text.length && text[i] !== \" \" && text[i] !== \"\\\\\") i++;\n const arg = text.slice(argStart, i).trim();\n if (arg) result[name] = arg;\n else result[name] = undefined;\n } else {\n result[name] = undefined;\n }\n }\n\n return result;\n}\n","import type { SectionChild } from \"@file/section-child\";\nimport type { TableOptions } from \"@file/table/table\";\nimport type { TableCellOptions } from \"@file/table/table-cell\";\nimport type { TableRowOptions } from \"@file/table/table-row\";\n/**\n * Table parser for DOCX documents.\n *\n * Parses w:tbl, w:tr, w:tc Element trees into TableOptions.\n *\n * @module\n */\nimport { attr, attrBool, attrNum, children, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\nimport { parseParagraph } from \"../paragraph/paragraph-parse\";\n\n/**\n * Parse w:tblPr into table properties.\n */\nfunction parseTableProperties(el: Element): Record<string, unknown> {\n const opts: Record<string, unknown> = {};\n\n const style = findChild(el, \"w:tblStyle\");\n if (style) {\n const val = attr(style, \"w:val\");\n if (val) opts.style = val;\n }\n\n const tblW = findChild(el, \"w:tblW\");\n if (tblW) {\n const rawSize = attr(tblW, \"w:w\");\n const type = attr(tblW, \"w:type\");\n // For \"pct\" type, size may be a percentage string like \"100%\"\n const size = type === \"pct\" ? rawSize : attrNum(tblW, \"w:w\");\n if (size !== undefined || type) {\n opts.width = { size: size ?? 0, ...(type ? { type } : {}) };\n }\n }\n\n const jc = findChild(el, \"w:jc\");\n if (jc) {\n const val = attr(jc, \"w:val\");\n if (val) opts.alignment = val;\n }\n\n const layout = findChild(el, \"w:tblLayout\");\n if (layout) {\n const val = attr(layout, \"w:type\");\n if (val === \"autofit\" || val === \"fixed\") opts.layout = val;\n }\n\n // Borders\n const tblBorders = findChild(el, \"w:tblBorders\");\n if (tblBorders) {\n const borders: Record<string, unknown> = {};\n for (const side of [\"top\", \"bottom\", \"left\", \"right\", \"insideH\", \"insideV\"] as const) {\n const sideEl = findChild(tblBorders, `w:${side}`);\n if (sideEl) {\n const b: Record<string, unknown> = {};\n const val = attr(sideEl, \"w:val\");\n if (val) b.style = val;\n const color = attr(sideEl, \"w:color\");\n if (color) b.color = color;\n const sz = attrNum(sideEl, \"w:sz\");\n if (sz !== undefined) b.size = sz;\n const space = attrNum(sideEl, \"w:space\");\n if (space !== undefined) b.space = space;\n borders[side] = b;\n }\n }\n if (Object.keys(borders).length > 0) opts.borders = borders;\n }\n\n // Cell margin\n const tblCellMar = findChild(el, \"w:tblCellMar\");\n if (tblCellMar) {\n const margins: Record<string, unknown> = {};\n for (const side of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n const sideEl = findChild(tblCellMar, `w:${side}`);\n if (sideEl) {\n const size = attrNum(sideEl, \"w:w\");\n const type = attr(sideEl, \"w:type\");\n if (size !== undefined) {\n (margins as Record<string, unknown>)[side] = { size, type: type ?? \"dxa\" };\n }\n }\n }\n if (Object.keys(margins).length > 0) opts.margins = margins;\n }\n\n const shd = findChild(el, \"w:shd\");\n if (shd) {\n const shading: Record<string, unknown> = {};\n const fill = attr(shd, \"w:fill\");\n if (fill) shading.fill = fill;\n const color = attr(shd, \"w:color\");\n if (color) shading.color = color;\n const val = attr(shd, \"w:val\");\n if (val) shading.type = val;\n if (Object.keys(shading).length > 0) opts.shading = shading;\n }\n\n return opts;\n}\n\n/**\n * Parse w:gridCol elements from w:tblGrid to extract column widths.\n */\nfunction parseColumnWidths(el: Element): number[] {\n const cols: number[] = [];\n const tblGrid = findChild(el, \"w:tblGrid\");\n if (!tblGrid) return cols;\n\n for (const col of children(tblGrid, \"w:gridCol\")) {\n const w = attrNum(col, \"w:w\");\n cols.push(w ?? 100);\n }\n\n return cols;\n}\n\n/**\n * Parse w:trPr into table row properties.\n */\nfunction parseTableRowProperties(el: Element): Record<string, unknown> {\n const opts: Record<string, unknown> = {};\n\n const trHeight = findChild(el, \"w:trHeight\");\n if (trHeight) {\n const val = attrNum(trHeight, \"w:val\");\n const rule = attr(trHeight, \"w:hRule\");\n if (val !== undefined) {\n opts.height = { value: val, rule: rule ?? \"atLeast\" };\n }\n }\n\n const tblHeader = findChild(el, \"w:tblHeader\");\n if (tblHeader) {\n opts.tableHeader = attrBool(tblHeader, \"w:val\") ?? true;\n }\n\n const cantSplit = findChild(el, \"w:cantSplit\");\n if (cantSplit) {\n opts.cantSplit = attrBool(cantSplit, \"w:val\") ?? true;\n }\n\n return opts;\n}\n\n/**\n * Parse w:tcPr into table cell properties.\n */\nfunction parseTableCellProperties(el: Element): Record<string, unknown> {\n const opts: Record<string, unknown> = {};\n\n const tcW = findChild(el, \"w:tcW\");\n if (tcW) {\n const size = attrNum(tcW, \"w:w\");\n const type = attr(tcW, \"w:type\");\n if (size !== undefined) {\n opts.width = { size, type: type ?? \"dxa\" };\n }\n }\n\n const gridSpan = findChild(el, \"w:gridSpan\");\n if (gridSpan) {\n const val = attrNum(gridSpan, \"w:val\");\n if (val !== undefined) opts.columnSpan = val;\n }\n\n const vMerge = findChild(el, \"w:vMerge\");\n if (vMerge) {\n const val = attr(vMerge, \"w:val\");\n opts.verticalMerge = val === \"restart\" ? \"restart\" : \"continue\";\n }\n\n const vAlign = findChild(el, \"w:vAlign\");\n if (vAlign) {\n const val = attr(vAlign, \"w:val\");\n if (val) opts.verticalAlign = val;\n }\n\n const shd = findChild(el, \"w:shd\");\n if (shd) {\n const shading: Record<string, unknown> = {};\n const fill = attr(shd, \"w:fill\");\n if (fill) shading.fill = fill;\n const color = attr(shd, \"w:color\");\n if (color) shading.color = color;\n const val = attr(shd, \"w:val\");\n if (val) shading.type = val;\n if (Object.keys(shading).length > 0) opts.shading = shading;\n }\n\n // Cell borders\n const tcBorders = findChild(el, \"w:tcBorders\");\n if (tcBorders) {\n const borders: Record<string, unknown> = {};\n for (const side of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n const sideEl = findChild(tcBorders, `w:${side}`);\n if (sideEl) {\n const b: Record<string, unknown> = {};\n const val = attr(sideEl, \"w:val\");\n if (val) b.style = val;\n const color = attr(sideEl, \"w:color\");\n if (color) b.color = color;\n const sz = attrNum(sideEl, \"w:sz\");\n if (sz !== undefined) b.size = sz;\n borders[side] = b;\n }\n }\n if (Object.keys(borders).length > 0) opts.borders = borders;\n }\n\n const noWrap = findChild(el, \"w:noWrap\");\n if (noWrap) opts.noWrap = true;\n\n // Cell margins (w:tcMar → TableCellMarginOptions)\n const tcMar = findChild(el, \"w:tcMar\");\n if (tcMar) {\n const margins: Record<string, unknown> = {};\n let marginUnitType: string | undefined;\n for (const side of [\"top\", \"bottom\", \"left\", \"right\"] as const) {\n const sideEl = findChild(tcMar, `w:${side}`);\n if (sideEl) {\n const size = attrNum(sideEl, \"w:w\");\n const type = attr(sideEl, \"w:type\");\n if (size !== undefined) {\n margins[side] = size;\n if (type && !marginUnitType) marginUnitType = type;\n }\n }\n }\n if (marginUnitType) margins.marginUnitType = marginUnitType;\n if (Object.keys(margins).length > 0) opts.margins = margins;\n }\n\n const textDirection = findChild(el, \"w:textDirection\");\n if (textDirection) {\n const val = attr(textDirection, \"w:val\");\n if (val) opts.textDirection = val;\n }\n\n return opts;\n}\n\n// Forward declaration to handle circular reference\nlet _parseSectionChild: ((el: Element, ctx: ParseContext) => SectionChild) | undefined;\n\n/**\n * Set the section child parser function (called by parse-body to resolve circular dependency).\n */\nexport function setSectionChildParser(fn: (el: Element, ctx: ParseContext) => SectionChild): void {\n _parseSectionChild = fn;\n}\n\n/**\n * Parse w:tc element into TableCellOptions.\n */\nexport function parseTableCell(el: Element, ctx: ParseContext): TableCellOptions {\n const opts: Record<string, unknown> = {};\n\n const tcPr = findChild(el, \"w:tcPr\");\n if (tcPr) {\n Object.assign(opts, parseTableCellProperties(tcPr));\n }\n\n const childElements: SectionChild[] = [];\n for (const child of el.elements ?? []) {\n switch (child.name) {\n case \"w:tcPr\":\n break;\n case \"w:p\":\n if (_parseSectionChild) {\n childElements.push(_parseSectionChild(child, ctx));\n } else {\n childElements.push({ paragraph: parseParagraph(child, ctx) });\n }\n break;\n case \"w:tbl\":\n if (_parseSectionChild) {\n childElements.push(_parseSectionChild(child, ctx));\n } else {\n childElements.push({ table: parseTable(child, ctx) });\n }\n break;\n default:\n break;\n }\n }\n\n opts.children = childElements;\n return opts as unknown as TableCellOptions;\n}\n\n/**\n * Parse w:tr element into TableRowOptions.\n */\nexport function parseTableRow(el: Element, ctx: ParseContext): TableRowOptions {\n const opts: Record<string, unknown> = {};\n\n const trPr = findChild(el, \"w:trPr\");\n if (trPr) {\n Object.assign(opts, parseTableRowProperties(trPr));\n }\n\n const childCells: TableCellOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.name === \"w:tc\") {\n childCells.push(parseTableCell(child, ctx));\n }\n }\n\n opts.children = childCells;\n return opts as unknown as TableRowOptions;\n}\n\n/**\n * Parse w:tbl element into TableOptions.\n */\nexport function parseTable(el: Element, ctx: ParseContext): TableOptions {\n const opts: Record<string, unknown> = {};\n\n const tblPr = findChild(el, \"w:tblPr\");\n if (tblPr) {\n Object.assign(opts, parseTableProperties(tblPr));\n }\n\n // Column widths\n const colWidths = parseColumnWidths(el);\n if (colWidths.length > 0) {\n opts.columnWidths = colWidths;\n }\n\n // Rows\n const rows: TableRowOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.name === \"w:tr\") {\n rows.push(parseTableRow(child, ctx));\n }\n }\n\n opts.rows = rows;\n return opts as unknown as TableOptions;\n}\n","/**\n * Textbox parser for DOCX documents.\n *\n * Parses w:pict → v:shape → v:textbox → w:txbxContent elements.\n *\n * @module\n */\nimport { attr, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport type { ParseContext } from \"../../parse/context\";\n\n// Forward declaration\nlet _parseSectionChildren: ((elements: Element[], ctx: ParseContext) => unknown[]) | undefined;\n\nexport function setTextboxSectionChildrenParser(\n fn: (elements: Element[], ctx: ParseContext) => unknown[],\n): void {\n _parseSectionChildren = fn;\n}\n\n/**\n * Parse VML shape style string into VmlShapeStyle-like object.\n */\nfunction parseVmlStyle(styleStr: string): Record<string, string> {\n const style: Record<string, string> = {};\n for (const part of styleStr.split(\";\")) {\n const [key, val] = part.split(\":\").map((s) => s.trim());\n if (key && val) style[key] = val;\n }\n return style;\n}\n\n/**\n * Parse a w:pict element that contains a textbox.\n * Returns an object suitable for the { textbox: ... } SectionChild variant.\n */\nexport function parseTextbox(\n el: Element,\n ctx: ParseContext,\n): {\n style?: Record<string, string>;\n children?: unknown[];\n} {\n const shape = findDeep(el, \"v:shape\")[0];\n if (!shape) return {};\n\n const opts: Record<string, unknown> = {};\n\n // Parse VML style\n const styleAttr = attr(shape, \"style\");\n if (styleAttr) {\n opts.style = parseVmlStyle(styleAttr);\n }\n\n // Parse textbox content\n const textbox = findDeep(shape, \"v:textbox\")[0];\n if (textbox) {\n const txbxContent = findChild(textbox, \"w:txbxContent\");\n if (txbxContent && _parseSectionChildren) {\n const childList = _parseSectionChildren(txbxContent.elements ?? [], ctx);\n if (childList.length > 0) opts.children = childList;\n }\n }\n\n return opts as { style?: Record<string, string>; children?: unknown[] };\n}\n\n// Simple deep finder\nfunction findDeep(parent: Element, name: string): Element[] {\n const result: Element[] = [];\n for (const child of parent.elements ?? []) {\n if (child.name === name) result.push(child);\n result.push(...findDeep(child, name));\n }\n return result;\n}\n","/**\n * Parse context module.\n *\n * Provides the shared context object used throughout the DOCX parsing pipeline.\n * Holds references to the parsed DocxDocument and cached style/numbering data.\n *\n * @module\n */\nimport type { Element } from \"@office-open/xml\";\n\nimport type { DocxDocument } from \"../parse\";\n\nexport class ParseContext {\n constructor(\n readonly docx: DocxDocument,\n readonly styleCache: Map<string, Element>,\n readonly numberingCache: Map<string, Element>,\n ) {}\n}\n","import type { ISectionPropertiesOptions } from \"@file/document/body/section-properties/section-properties\";\nimport type { SectionOptions } from \"@file/file\";\nimport type { SectionChild } from \"@file/section-child\";\n/**\n * Body parser for DOCX documents.\n *\n * Parses w:body → SectionOptions[] by splitting at w:sectPr boundaries.\n *\n * @module\n */\nimport { RawPassthrough } from \"@office-open/core\";\nimport { attr, attrBool, attrNum, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport { parseAltChunk } from \"../file/alt-chunk/alt-chunk-parse\";\nimport { parseParagraph } from \"../file/paragraph/paragraph-parse\";\nimport { parseSdtBlock, setSectionChildrenParser } from \"../file/sdt/sdt-parse\";\nimport { parseSubDoc } from \"../file/sub-doc/sub-doc-parse\";\nimport { parseToc } from \"../file/table-of-contents/toc-parse\";\nimport { parseTable, setSectionChildParser } from \"../file/table/table-parse\";\nimport { setTextboxSectionChildrenParser, parseTextbox } from \"../file/textbox/textbox-parse\";\nimport { ParseContext } from \"./context\";\n\n// ── Section properties parser ────────────────────────────────────────────────\n\n/**\n * Parse w:sectPr element into ISectionPropertiesOptions.\n */\nfunction parseSectionProperties(el: Element, ctx: ParseContext): ISectionPropertiesOptions {\n const opts: Record<string, unknown> = {};\n\n // Page size\n const pgSz = findChild(el, \"w:pgSz\");\n if (pgSz) {\n const page: Record<string, unknown> = {};\n const size: Record<string, unknown> = {};\n const w = attrNum(pgSz, \"w:w\");\n const h = attrNum(pgSz, \"w:h\");\n const orient = attr(pgSz, \"w:orient\");\n // createPageSize swaps w/h for landscape, so reverse that here\n if (orient === \"landscape\" && w !== undefined && h !== undefined) {\n size.width = h;\n size.height = w;\n } else {\n if (w !== undefined) size.width = w;\n if (h !== undefined) size.height = h;\n }\n if (orient) size.orientation = orient;\n if (Object.keys(size).length > 0) page.size = size;\n\n // Page margins\n const pgMar = findChild(el, \"w:pgMar\");\n if (pgMar) {\n const margin: Record<string, unknown> = {};\n for (const [attrName, optName] of [\n [\"w:top\", \"top\"],\n [\"w:right\", \"right\"],\n [\"w:bottom\", \"bottom\"],\n [\"w:left\", \"left\"],\n [\"w:header\", \"header\"],\n [\"w:footer\", \"footer\"],\n [\"w:gutter\", \"gutter\"],\n ] as const) {\n const val = attrNum(pgMar, attrName);\n if (val !== undefined) margin[optName] = val;\n }\n if (Object.keys(margin).length > 0) page.margin = margin;\n }\n\n // Page number type\n const pgNumType = findChild(el, \"w:pgNumType\");\n if (pgNumType) {\n const pageNumbers: Record<string, unknown> = {};\n const start = attrNum(pgNumType, \"w:start\");\n if (start !== undefined) pageNumbers.start = start;\n const fmt = attr(pgNumType, \"w:fmt\");\n if (fmt) pageNumbers.formatType = fmt;\n if (Object.keys(pageNumbers).length > 0) page.pageNumbers = pageNumbers;\n }\n\n if (Object.keys(page).length > 0) opts.page = page;\n }\n\n // Columns\n const cols = findChild(el, \"w:cols\");\n if (cols) {\n const column: Record<string, unknown> = {};\n const count = attrNum(cols, \"w:num\");\n if (count !== undefined) column.count = count;\n const space = attrNum(cols, \"w:space\");\n if (space !== undefined) column.space = space;\n const sep = attrBool(cols, \"w:sep\");\n if (sep) column.separator = true;\n if (Object.keys(column).length > 0) opts.column = column;\n }\n\n // Section type\n const type = findChild(el, \"w:type\");\n if (type) {\n const val = attr(type, \"w:val\");\n if (val) opts.type = val;\n }\n\n // Title page\n const titlePg = findChild(el, \"w:titlePg\");\n if (titlePg) opts.titlePage = attrBool(titlePg, \"w:val\") ?? true;\n\n // On/off properties\n for (const [name, optKey] of [\n [\"w:noEndnote\", \"noEndnote\"],\n [\"w:formProt\", \"formProtection\"],\n [\"w:bidi\", \"bidi\"],\n [\"w:rtlGutter\", \"rtlGutter\"],\n ] as const) {\n const child = findChild(el, name);\n if (child) opts[optKey] = attrBool(child, \"w:val\") ?? true;\n }\n\n // Document grid\n const docGrid = findChild(el, \"w:docGrid\");\n if (docGrid) {\n const grid: Record<string, unknown> = {};\n const type = attr(docGrid, \"w:type\");\n if (type) grid.type = type;\n const linePitch = attrNum(docGrid, \"w:linePitch\");\n if (linePitch !== undefined) grid.linePitch = linePitch;\n const charSpace = attrNum(docGrid, \"w:charSpace\");\n if (charSpace !== undefined) grid.charSpace = charSpace;\n if (Object.keys(grid).length > 0) opts.grid = grid;\n }\n\n // Line numbers\n const lnNumType = findChild(el, \"w:lnNumType\");\n if (lnNumType) {\n const lineNumbers: Record<string, unknown> = {};\n const countBy = attrNum(lnNumType, \"w:countBy\");\n if (countBy !== undefined) lineNumbers.countBy = countBy;\n const start = attrNum(lnNumType, \"w:start\");\n if (start !== undefined) lineNumbers.start = start;\n const restart = attr(lnNumType, \"w:restart\");\n if (restart) lineNumbers.restart = restart;\n const distance = attrNum(lnNumType, \"w:distance\");\n if (distance !== undefined) lineNumbers.distance = distance;\n if (Object.keys(lineNumbers).length > 0) opts.lineNumbers = lineNumbers;\n }\n\n // Page borders\n const pgBorders = findChild(el, \"w:pgBorders\");\n if (pgBorders) {\n const borders: Record<string, unknown> = {};\n for (const side of [\"top\", \"left\", \"bottom\", \"right\"] as const) {\n const sideEl = findChild(pgBorders, `w:${side}`);\n if (sideEl) {\n const b: Record<string, unknown> = {};\n const val = attr(sideEl, \"w:val\");\n if (val) b.style = val;\n const color = attr(sideEl, \"w:color\");\n if (color) b.color = color;\n const sz = attrNum(sideEl, \"w:sz\");\n if (sz !== undefined) b.size = sz;\n const space = attrNum(sideEl, \"w:space\");\n if (space !== undefined) b.space = space;\n borders[side] = b;\n }\n }\n // Global page border attributes\n const display = attr(pgBorders, \"w:display\");\n if (display) borders.display = display;\n const offsetFrom = attr(pgBorders, \"w:offsetFrom\");\n if (offsetFrom) borders.offsetFrom = offsetFrom;\n const zOrder = attr(pgBorders, \"w:zOrder\");\n if (zOrder) borders.zOrder = zOrder;\n if (Object.keys(borders).length > 0) {\n const page = (opts.page ?? {}) as Record<string, unknown>;\n page.borders = borders;\n opts.page = page;\n }\n }\n\n // Vertical align\n const vAlign = findChild(el, \"w:vAlign\");\n if (vAlign) {\n const val = attr(vAlign, \"w:val\");\n if (val) opts.verticalAlign = val;\n }\n\n // Headers/footers - parse from references and store in a separate field\n const headerRefs: Record<string, unknown> = {};\n const footerRefs: Record<string, unknown> = {};\n\n for (const child of el.elements ?? []) {\n if (child.name === \"w:headerReference\") {\n const rId = attr(child, \"r:id\");\n const type = attr(child, \"w:type\");\n if (rId && type) {\n const headerChildren = parseHeaderFooterRef(rId, ctx);\n if (headerChildren) headerRefs[type] = headerChildren;\n }\n }\n if (child.name === \"w:footerReference\") {\n const rId = attr(child, \"r:id\");\n const type = attr(child, \"w:type\");\n if (rId && type) {\n const footerChildren = parseHeaderFooterRef(rId, ctx);\n if (footerChildren) footerRefs[type] = footerChildren;\n }\n }\n }\n\n if (Object.keys(headerRefs).length > 0) {\n (opts as Record<string, unknown>).parsedHeaders = headerRefs;\n }\n if (Object.keys(footerRefs).length > 0) {\n (opts as Record<string, unknown>).parsedFooters = footerRefs;\n }\n\n return opts as ISectionPropertiesOptions;\n}\n\n/**\n * Parse a header/footer reference by following the relationship to its XML part.\n */\nfunction parseHeaderFooterRef(rId: string, ctx: ParseContext): SectionChild[] | undefined {\n const path = ctx.docx.partRefs.headers.get(rId) ?? ctx.docx.partRefs.footers.get(rId);\n if (!path) return undefined;\n\n const partEl = ctx.docx.doc.get(path);\n if (!partEl) return undefined;\n\n // The header/footer XML root element contains w:p, w:tbl, etc.\n const children: SectionChild[] = [];\n for (const child of partEl.elements ?? []) {\n const sectionChild = parseSectionChild(child, ctx);\n if (sectionChild !== undefined) {\n children.push(sectionChild);\n }\n }\n\n return children.length > 0 ? children : undefined;\n}\n\n// ── Section child dispatch ───────────────────────────────────────────────────\n\n/**\n * Parse a single body child element into a SectionChild.\n */\nexport function parseSectionChild(el: Element, ctx: ParseContext): SectionChild {\n switch (el.name) {\n case \"w:p\": {\n // Check for textbox (w:pict containing v:textbox)\n const pict = findChild(el, \"w:pict\");\n if (pict) {\n const textbox = findDeepElement(pict, \"v:textbox\");\n if (textbox) {\n const textboxOpts = parseTextbox(pict, ctx);\n return { textbox: textboxOpts as SectionChild extends { textbox: infer T } ? T : never };\n }\n }\n\n return { paragraph: parseParagraph(el, ctx) };\n }\n case \"w:tbl\":\n return { table: parseTable(el, ctx) };\n case \"w:sdt\": {\n // Try TOC first\n const tocResult = parseToc(el, ctx);\n if (tocResult) {\n return { toc: tocResult };\n }\n // Otherwise parse as generic SDT block\n const sdtResult = parseSdtBlock(el, ctx);\n return {\n sdt: {\n properties: sdtResult.properties,\n children: sdtResult.children as SectionChild[] | undefined,\n },\n };\n }\n case \"w:altChunk\":\n return { altChunk: parseAltChunk(el, ctx) };\n case \"w:subDoc\":\n return { subDoc: parseSubDoc(el, ctx) };\n default:\n return new RawPassthrough(el);\n }\n}\n\n/**\n * Find a deep descendant element by name.\n */\nfunction findDeepElement(parent: Element, name: string): Element | undefined {\n for (const child of parent.elements ?? []) {\n if (child.name === name) return child;\n const found = findDeepElement(child, name);\n if (found) return found;\n }\n return undefined;\n}\n\n// ── Body parsing with section splitting ───────────────────────────────────────\n\n/**\n * Parse w:body element into SectionOptions[].\n *\n * Splits body content at w:sectPr boundaries to create sections.\n * The last w:sectPr (child of w:body directly) defines the last section.\n * Previous w:sectPr elements appear inside w:pPr elements.\n */\nexport function parseBody(body: Element, ctx: ParseContext): SectionOptions[] {\n // Wire up circular dependencies\n setSectionChildParser(parseSectionChild);\n setSectionChildrenParser(parseSectionChildrenElements);\n setTextboxSectionChildrenParser(parseSectionChildrenElements);\n\n // Collect body children and detect section breaks\n interface SectionBoundary {\n index: number;\n sectPr: Element;\n }\n\n const bodyChildren: Element[] = [];\n const boundaries: SectionBoundary[] = [];\n\n for (const child of body.elements ?? []) {\n if (child.name === \"w:sectPr\") {\n // Final section properties (last section)\n boundaries.push({ index: bodyChildren.length, sectPr: child });\n } else {\n bodyChildren.push(child);\n\n // Check for inline sectPr in paragraph properties\n if (child.name === \"w:p\") {\n const pPr = findChild(child, \"w:pPr\");\n if (pPr) {\n const sectPr = findChild(pPr, \"w:sectPr\");\n if (sectPr) {\n boundaries.push({ index: bodyChildren.length, sectPr });\n }\n }\n }\n }\n }\n\n // If no boundaries, the whole body is one section\n if (boundaries.length === 0) {\n return [\n {\n children: bodyChildren.map((el) => parseSectionChild(el, ctx)),\n },\n ];\n }\n\n // Split into sections\n const sections: SectionOptions[] = [];\n let start = 0;\n\n for (let i = 0; i < boundaries.length; i++) {\n const boundary = boundaries[i];\n // For inline sectPr (inside w:pPr), the containing paragraph was pushed to\n // bodyChildren. Exclude it — it's a section break marker, not content.\n // The last boundary uses a body-level sectPr, so no paragraph to exclude.\n const isInlineSectPr = i < boundaries.length - 1;\n const endIdx = isInlineSectPr ? Math.max(start, boundary.index - 1) : boundary.index;\n const sectionElements = bodyChildren.slice(start, endIdx);\n const parsedProps = parseSectionProperties(boundary.sectPr, ctx);\n const rawProps = parsedProps as Record<string, unknown>;\n\n // Extract headers/footers that were stored as parsedHeaders/parsedFooters\n const parsedHeaders = rawProps.parsedHeaders as Record<string, SectionChild[]> | undefined;\n const parsedFooters = rawProps.parsedFooters as Record<string, SectionChild[]> | undefined;\n\n // Build clean properties without internal fields\n const cleanProps = { ...parsedProps };\n delete (cleanProps as Record<string, unknown>).parsedHeaders;\n delete (cleanProps as Record<string, unknown>).parsedFooters;\n\n const section = {\n children: sectionElements.map((el) => parseSectionChild(el, ctx)),\n properties: cleanProps,\n ...(parsedHeaders ? { headers: parsedHeaders } : {}),\n ...(parsedFooters ? { footers: parsedFooters } : {}),\n } as SectionOptions;\n\n sections.push(section);\n start = boundary.index;\n }\n\n // If there are elements after the last boundary, they form the last section\n // with the body-level w:sectPr (already captured)\n // Actually the body-level sectPr IS the last boundary\n\n return sections;\n}\n\n/**\n * Parse a list of elements into SectionChild[].\n * Used by SDT and textbox parsers for their content.\n */\nfunction parseSectionChildrenElements(elements: Element[], ctx: ParseContext): SectionChild[] {\n return elements.map((el) => parseSectionChild(el, ctx));\n}\n","import { attr } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\nimport { textOf } from \"@office-open/xml\";\n\n/**\n * Parse docProps/custom.xml into custom property entries.\n *\n * XML format:\n * ```xml\n * <property name=\"...\" fmtid=\"...\" pid=\"2\">\n * <vt:lpwstr>value</vt:lpwstr>\n * </property>\n * ```\n */\nexport function parseCustomProperties(el: Element | undefined): { name: string; value: string }[] {\n if (!el) return [];\n\n const result: { name: string; value: string }[] = [];\n for (const child of el.elements ?? []) {\n if (child.name !== \"property\") continue;\n const name = attr(child, \"name\");\n if (!name) continue;\n\n // Find the value element (vt:lpwstr, vt:lpstr, etc.)\n const valueEl = child.elements?.find((e) => e.name?.startsWith(\"vt:\"));\n const value = valueEl ? (textOf(valueEl) ?? \"\") : \"\";\n result.push({ name, value });\n }\n\n return result;\n}\n","/**\n * Numbering definition parser for DOCX documents.\n *\n * Parses w:numbering elements into NumberingOptions objects for round-trip fidelity.\n *\n * @module\n */\nimport { attr, attrNum, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\n/**\n * Parse w:numbering element into NumberingOptions.\n */\nexport function parseNumberingDefinitions(el: Element): Record<string, unknown> | undefined {\n // Build a map of abstractNum elements\n const abstractNums = new Map<string, Element>();\n for (const child of el.elements ?? []) {\n if (child.name !== \"w:abstractNum\") continue;\n const id = attr(child, \"w:abstractNumId\");\n if (id !== undefined) abstractNums.set(id, child);\n }\n\n // Build num → abstractNumId mapping\n const numToAbstract = new Map<string, string>();\n for (const child of el.elements ?? []) {\n if (child.name !== \"w:num\") continue;\n const numId = attr(child, \"w:numId\");\n const abstractRef = findChild(child, \"w:abstractNumId\");\n const abstractId = abstractRef ? attr(abstractRef, \"w:val\") : undefined;\n if (numId !== undefined && abstractId !== undefined) {\n numToAbstract.set(numId, abstractId);\n }\n }\n\n // Parse each abstractNum → config entry\n const configs: { reference: string; levels: Record<string, unknown>[] }[] = [];\n\n for (const [numId, abstractId] of numToAbstract) {\n const abstractEl = abstractNums.get(abstractId);\n if (!abstractEl) continue;\n\n const levels: Record<string, unknown>[] = [];\n for (const child of abstractEl.elements ?? []) {\n if (child.name !== \"w:lvl\") continue;\n const levelOpts = parseLevel(child);\n if (levelOpts) levels.push(levelOpts);\n }\n\n // Skip default bullet list (all levels are bullet format) —\n // Numbering constructor already creates a default bullet list.\n if (levels.length > 0 && levels.every((l) => l.format === \"bullet\")) continue;\n\n if (levels.length > 0) {\n configs.push({ reference: `list_${numId}`, levels });\n }\n }\n\n if (configs.length === 0) return undefined;\n return { config: configs };\n}\n\nfunction parseLevel(el: Element): Record<string, unknown> | undefined {\n const opts: Record<string, unknown> = {};\n\n const level = attrNum(el, \"w:ilvl\");\n if (level !== undefined) opts.level = level;\n\n // start\n const start = findChild(el, \"w:start\");\n if (start) {\n const val = attrNum(start, \"w:val\");\n if (val !== undefined) opts.start = val;\n }\n\n // format\n const numFmt = findChild(el, \"w:numFmt\");\n if (numFmt) {\n const val = attr(numFmt, \"w:val\");\n if (val) opts.format = val;\n }\n\n // text\n const lvlText = findChild(el, \"w:lvlText\");\n if (lvlText) {\n const val = attr(lvlText, \"w:val\");\n if (val) opts.text = val;\n }\n\n // alignment\n const lvlJc = findChild(el, \"w:lvlJc\");\n if (lvlJc) {\n const val = attr(lvlJc, \"w:val\");\n if (val) opts.alignment = val;\n }\n\n // suffix\n const suff = findChild(el, \"w:suff\");\n if (suff) {\n const val = attr(suff, \"w:val\");\n if (val) opts.suffix = val;\n }\n\n // isLegalNumberingStyle\n if (findChild(el, \"w:isLgl\")) opts.isLegalNumberingStyle = true;\n\n // Run properties\n const rPr = findChild(el, \"w:rPr\");\n if (rPr) {\n const style: Record<string, unknown> = {};\n // Parse basic run properties for numbering level\n const sz = findChild(rPr, \"w:sz\");\n if (sz) {\n const val = attrNum(sz, \"w:val\");\n if (val !== undefined) {\n if (!style.run) style.run = {};\n (style.run as Record<string, unknown>).size = val;\n }\n }\n const rFonts = findChild(rPr, \"w:rFonts\");\n if (rFonts) {\n const ascii = attr(rFonts, \"w:ascii\");\n if (ascii) {\n if (!style.run) style.run = {};\n (style.run as Record<string, unknown>).font = ascii;\n }\n }\n if (Object.keys(style).length > 0) opts.style = style;\n }\n\n // Paragraph properties (indent)\n const pPr = findChild(el, \"w:pPr\");\n if (pPr) {\n const style = (opts.style as Record<string, unknown>) ?? {};\n const paraStyle: Record<string, unknown> = {};\n\n const ind = findChild(pPr, \"w:ind\");\n if (ind) {\n const indent: Record<string, unknown> = {};\n const left = attrNum(ind, \"w:left\");\n if (left !== undefined) indent.left = left;\n const hanging = attrNum(ind, \"w:hanging\");\n if (hanging !== undefined) indent.hanging = hanging;\n if (Object.keys(indent).length > 0) paraStyle.indent = indent;\n }\n\n const tabs = findChild(pPr, \"w:tabs\");\n if (tabs) {\n const tabStops: Record<string, unknown>[] = [];\n for (const tab of pPr.elements ?? []) {\n if (tab.name !== \"w:tab\") continue;\n const tabObj: Record<string, unknown> = {};\n const pos = attrNum(tab, \"w:pos\");\n if (pos !== undefined) tabObj.position = pos;\n const val = attr(tab, \"w:val\");\n if (val) tabObj.type = val;\n tabStops.push(tabObj);\n }\n if (tabStops.length > 0) paraStyle.tabStops = tabStops;\n }\n\n if (Object.keys(paraStyle).length > 0) {\n style.paragraph = paraStyle;\n opts.style = style;\n }\n }\n\n return Object.keys(opts).length > 0 ? opts : undefined;\n}\n","import type { PropertiesOptions } from \"@file/core-properties\";\nimport { attr, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\n/**\n * Parse word/settings.xml Element into PropertiesOptions fields.\n */\nexport function parseSettings(el: Element | undefined): Partial<PropertiesOptions> {\n if (!el) return {};\n\n const opts: Record<string, unknown> = {};\n\n // evenAndOddHeaderAndFooters → w:evenAndOddHeaders (check val attribute)\n const eohEl = findChild(el, \"w:evenAndOddHeaders\");\n if (eohEl) {\n const val = attr(eohEl, \"w:val\");\n opts.evenAndOddHeaderAndFooters = val !== \"false\" && val !== \"0\" && val !== \"off\";\n }\n\n // view → w:view/@w:val\n const viewEl = findChild(el, \"w:view\");\n if (viewEl) {\n const val = attr(viewEl, \"w:val\");\n if (val) opts.view = val as PropertiesOptions[\"view\"];\n }\n\n // zoom → w:zoom/@w:percent, @w:val\n const zoomEl = findChild(el, \"w:zoom\");\n if (zoomEl) {\n const zoom: Record<string, unknown> = {};\n const percent = attr(zoomEl, \"w:percent\");\n if (percent) zoom.percent = parseInt(percent, 10);\n const val = attr(zoomEl, \"w:val\");\n if (val) zoom.val = val;\n if (Object.keys(zoom).length > 0) opts.zoom = zoom;\n }\n\n // defaultTabStop → w:defaultTabStop/@w:val\n const tabStopEl = findChild(el, \"w:defaultTabStop\");\n if (tabStopEl) {\n const val = attr(tabStopEl, \"w:val\");\n if (val) opts.defaultTabStop = parseInt(val, 10);\n }\n\n // features.trackRevisions → w:trackRevisions (presence)\n if (findChild(el, \"w:trackRevisions\")) {\n const features = (opts.features as Record<string, unknown>) ?? {};\n (features as Record<string, unknown>).trackRevisions = true;\n opts.features = features;\n }\n\n // features.updateFields → w:updateFields (presence)\n if (findChild(el, \"w:updateFields\")) {\n const features = (opts.features as Record<string, unknown>) ?? {};\n (features as Record<string, unknown>).updateFields = true;\n opts.features = features;\n }\n\n // compatabilityModeVersion → w:compat/w:compatSetting\n const compatEl = findChild(el, \"w:compat\");\n if (compatEl) {\n for (const child of compatEl.elements ?? []) {\n if (child.name === \"w:compatSetting\") {\n const name = attr(child, \"w:name\");\n if (name === \"compatibilityMode\") {\n const val = attr(child, \"w:val\");\n if (val) opts.compatabilityModeVersion = parseInt(val, 10);\n }\n }\n }\n }\n\n // docVars → w:docVars/w:docVar\n const docVarsEl = findChild(el, \"w:docVars\");\n if (docVarsEl) {\n const vars: Array<{ name: string; val: string }> = [];\n for (const child of docVarsEl.elements ?? []) {\n if (child.name === \"w:docVar\") {\n const name = attr(child, \"w:name\");\n const val = attr(child, \"w:val\");\n if (name && val) vars.push({ name, val });\n }\n }\n if (vars.length > 0) opts.docVars = vars;\n }\n\n // characterSpacingControl → w:characterSpacingControl/@w:val\n const cscEl = findChild(el, \"w:characterSpacingControl\");\n if (cscEl) {\n const val = attr(cscEl, \"w:val\");\n if (val) opts.characterSpacingControl = val as PropertiesOptions[\"characterSpacingControl\"];\n }\n\n // displayBackgroundShape → w:displayBackgroundShape (presence)\n if (findChild(el, \"w:displayBackgroundShape\")) {\n opts.displayBackgroundShape = true;\n }\n\n // embedTrueTypeFonts → w:embedTrueTypeFonts (presence)\n if (findChild(el, \"w:embedTrueTypeFonts\")) {\n opts.embedTrueTypeFonts = true;\n }\n\n // embedSystemFonts → w:embedSystemFonts (presence)\n if (findChild(el, \"w:embedSystemFonts\")) {\n opts.embedSystemFonts = true;\n }\n\n // saveSubsetFonts → w:saveSubsetFonts (presence)\n if (findChild(el, \"w:saveSubsetFonts\")) {\n opts.saveSubsetFonts = true;\n }\n\n return opts;\n}\n","/**\n * Style cache builder and definition parser for DOCX documents.\n *\n * Builds lookup maps from parsed styles.xml and numbering.xml elements\n * for efficient style resolution during document parsing.\n * Also parses full style definitions into StylesOptions for round-trip fidelity.\n *\n * @module\n */\nimport { attr, attrBool, attrNum, findChild } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\nimport { parseParagraphProperties } from \"../file/paragraph/paragraph-parse\";\nimport { parseRunProperties } from \"../file/paragraph/run/run-parse\";\nimport type { DocxDocument } from \"../parse\";\nimport type { ParseContext } from \"./context\";\n\n/**\n * Build a cache of style elements keyed by styleId.\n * Iterates w:styles/w:style elements and indexes by w:styleId/@w:val.\n */\nexport function buildStyleCache(docx: DocxDocument): Map<string, Element> {\n const cache = new Map<string, Element>();\n if (!docx.styles) return cache;\n\n for (const child of docx.styles.elements ?? []) {\n if (child.name !== \"w:style\") continue;\n const styleId = attr(child, \"w:styleId\");\n if (styleId) {\n cache.set(styleId, child);\n }\n }\n\n return cache;\n}\n\n/**\n * Build a cache of abstract numbering elements keyed by abstractNumId.\n * Iterates w:numbering/w:abstractNum elements and indexes by @w:abstractNumId.\n */\nexport function buildNumberingCache(docx: DocxDocument): Map<string, Element> {\n const cache = new Map<string, Element>();\n if (!docx.numbering) return cache;\n\n for (const child of docx.numbering.elements ?? []) {\n if (child.name !== \"w:abstractNum\") continue;\n const abstractNumId = attr(child, \"w:abstractNumId\");\n if (abstractNumId !== undefined) {\n cache.set(abstractNumId, child);\n }\n }\n\n return cache;\n}\n\n// ── Style definition parsing ──────────────────────────────────────────────────\n\n/** Style IDs generated by DefaultStylesFactory — skip these during parsing. */\nconst BUILTIN_STYLE_IDS = new Set([\n \"Title\",\n \"Heading1\",\n \"Heading2\",\n \"Heading3\",\n \"Heading4\",\n \"Heading5\",\n \"Heading6\",\n \"Strong\",\n \"ListParagraph\",\n \"Hyperlink\",\n \"FootnoteText\",\n \"FootnoteTextChar\",\n \"EndnoteText\",\n \"EndnoteTextChar\",\n \"FootnoteReference\",\n \"EndnoteReference\",\n]);\n\n/**\n * Parse w:styles element into StylesOptions.\n *\n * Skips built-in styles that DefaultStylesFactory already generates,\n * keeping only user-defined custom styles for round-trip fidelity.\n */\nexport function parseStyleDefinitions(\n el: Element,\n ctx: ParseContext,\n): Record<string, unknown> | undefined {\n const opts: Record<string, unknown> = {};\n const paragraphStyles: Record<string, unknown>[] = [];\n const characterStyles: Record<string, unknown>[] = [];\n\n for (const child of el.elements ?? []) {\n if (child.name === \"w:docDefaults\") {\n const defOpts = parseDocDefaults(child);\n if (defOpts) opts.default = defOpts;\n } else if (child.name === \"w:style\") {\n const styleOpts = parseStyleElement(child, ctx);\n if (!styleOpts) continue;\n\n // Skip built-in styles handled by DefaultStylesFactory\n const styleId = styleOpts.id as string | undefined;\n if (styleId && BUILTIN_STYLE_IDS.has(styleId)) continue;\n\n const type = styleOpts._type as string | undefined;\n delete styleOpts._type;\n\n if (type === \"paragraph\") {\n paragraphStyles.push(styleOpts);\n } else if (type === \"character\") {\n characterStyles.push(styleOpts);\n }\n }\n }\n\n if (paragraphStyles.length > 0) opts.paragraphStyles = paragraphStyles;\n if (characterStyles.length > 0) opts.characterStyles = characterStyles;\n\n return Object.keys(opts).length > 0 ? opts : undefined;\n}\n\nfunction parseDocDefaults(el: Element): Record<string, unknown> | undefined {\n const result: Record<string, unknown> = {};\n const docDefaults: Record<string, unknown> = {};\n\n // rPrDefault → run defaults\n const rPrDefault = findChild(el, \"w:rPrDefault\");\n if (rPrDefault) {\n const rPr = findChild(rPrDefault, \"w:rPr\");\n if (rPr) {\n const runDefaults = parseRunProperties(rPr);\n if (Object.keys(runDefaults).length > 0) docDefaults.run = runDefaults;\n }\n }\n\n // pPrDefault → paragraph defaults\n const pPrDefault = findChild(el, \"w:pPrDefault\");\n if (pPrDefault) {\n const pPr = findChild(pPrDefault, \"w:pPr\");\n if (pPr) {\n const paraDefaults: Record<string, unknown> = {};\n const spacing = findChild(pPr, \"w:spacing\");\n if (spacing) {\n const sp: Record<string, unknown> = {};\n const before = attrNum(spacing, \"w:before\");\n if (before !== undefined) sp.before = before;\n const after = attrNum(spacing, \"w:after\");\n if (after !== undefined) sp.after = after;\n const line = attrNum(spacing, \"w:line\");\n if (line !== undefined) sp.line = line;\n if (Object.keys(sp).length > 0) paraDefaults.spacing = sp;\n }\n if (Object.keys(paraDefaults).length > 0) docDefaults.paragraph = paraDefaults;\n }\n }\n\n if (Object.keys(docDefaults).length > 0) result.document = docDefaults;\n return Object.keys(result).length > 0 ? result : undefined;\n}\n\nfunction parseStyleElement(\n el: Element,\n ctx: ParseContext,\n): (Record<string, unknown> & { _type?: string }) | undefined {\n const opts: Record<string, unknown> & { _type?: string } = {};\n\n // Type and ID — these are attributes on w:style element, not child elements\n const type = attr(el, \"w:type\");\n if (type) opts._type = type;\n\n const id = attr(el, \"w:styleId\");\n if (id) opts.id = id;\n\n // Default flag\n const isDefault = attrBool(el, \"w:default\");\n if (isDefault) opts.default = true;\n\n // Custom style flag\n const customStyle = attrBool(el, \"w:customStyle\");\n if (customStyle) opts.customStyle = \"1\";\n\n // Name\n const nameEl = findChild(el, \"w:name\");\n if (nameEl) {\n const name = attr(nameEl, \"w:val\");\n if (name) opts.name = name;\n }\n\n // basedOn\n const basedOn = findChild(el, \"w:basedOn\");\n if (basedOn) {\n const val = attr(basedOn, \"w:val\");\n if (val) opts.basedOn = val;\n }\n\n // next\n const next = findChild(el, \"w:next\");\n if (next) {\n const val = attr(next, \"w:val\");\n if (val) opts.next = val;\n }\n\n // link\n const link = findChild(el, \"w:link\");\n if (link) {\n const val = attr(link, \"w:val\");\n if (val) opts.link = val;\n }\n\n // uiPriority\n const uiPriority = findChild(el, \"w:uiPriority\");\n if (uiPriority) {\n const val = attrNum(uiPriority, \"w:val\");\n if (val !== undefined) opts.uiPriority = val;\n }\n\n // quickFormat\n if (findChild(el, \"w:qFormat\")) opts.quickFormat = true;\n\n // semiHidden\n if (findChild(el, \"w:semiHidden\")) opts.semiHidden = true;\n\n // unhideWhenUsed\n if (findChild(el, \"w:unhideWhenUsed\")) opts.unhideWhenUsed = true;\n\n // Paragraph properties\n const pPr = findChild(el, \"w:pPr\");\n if (pPr) {\n const paraOpts = parseParagraphProperties(pPr, ctx);\n if (Object.keys(paraOpts).length > 0) opts.paragraph = paraOpts;\n }\n\n // Run properties\n const rPr = findChild(el, \"w:rPr\");\n if (rPr) {\n const runOpts = parseRunProperties(rPr);\n if (Object.keys(runOpts).length > 0) opts.run = runOpts;\n }\n\n return opts;\n}\n","import type { PropertiesOptions } from \"@file/core-properties\";\nimport type { ParsedArchive } from \"@office-open/core\";\nimport { parseArchive, parseCorePropsElement } from \"@office-open/core\";\nimport { attr, attrNum } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\nimport type { DataType } from \"undio\";\nimport { toUint8Array } from \"undio\";\n\nimport { parseParagraph } from \"./file/paragraph/paragraph-parse\";\nimport { parseBody } from \"./parse/body\";\nimport { ParseContext } from \"./parse/context\";\nimport { parseCustomProperties } from \"./parse/custom-properties\";\nimport { parseNumberingDefinitions } from \"./parse/numbering\";\nimport { parseSettings } from \"./parse/settings\";\nimport { buildStyleCache, buildNumberingCache, parseStyleDefinitions } from \"./parse/styles\";\n\nexport { parseArchive };\n\n/**\n * All part paths extracted from the DOCX package.\n * Field names correspond directly to the OOXML directory structure.\n */\nexport interface DocxPartRefs {\n /** word/headerN.xml keyed by rId */\n headers: Map<string, string>;\n /** word/footerN.xml keyed by rId */\n footers: Map<string, string>;\n /** word/footnotes.xml */\n footnotes?: string;\n /** word/endnotes.xml */\n endnotes?: string;\n /** word/comments.xml */\n comments?: string;\n /** Hyperlink targets keyed by rId (external URLs) */\n hyperlinks: Map<string, string>;\n /** word/charts/chartN.xml keyed by rId */\n charts: Map<string, string>;\n /** word/diagrams/dataN.xml keyed by rId */\n diagramData: Map<string, string>;\n /** word/media/* keyed by rId */\n media: Map<string, string>;\n /** Alternative format chunks (word/afchunkN.*) keyed by rId */\n afChunks: Map<string, string>;\n /** Sub-documents (word/subdocs/subdocN.docx) keyed by rId */\n subDocs: Map<string, string>;\n}\n\nexport interface DocxDocument {\n doc: ParsedArchive;\n /** word/document.xml → w:body element */\n body: Element;\n /** word/document.xml → w:background element */\n background?: Element;\n /** word/styles.xml */\n styles?: Element;\n /** word/numbering.xml */\n numbering?: Element;\n /** word/settings.xml */\n settings?: Element;\n /** word/fontTable.xml */\n fontTable?: Element;\n /** word/webSettings.xml */\n webSettings?: Element;\n partRefs: DocxPartRefs;\n /** docProps/core.xml */\n coreProps?: string;\n /** docProps/app.xml */\n appProps?: string;\n /** docProps/custom.xml */\n customProps?: 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 `word/${target}`;\n}\n\nfunction parseDocPartRefs(doc: ParsedArchive): DocxPartRefs {\n const refs: DocxPartRefs = {\n headers: new Map(),\n footers: new Map(),\n hyperlinks: new Map(),\n charts: new Map(),\n diagramData: new Map(),\n media: new Map(),\n afChunks: new Map(),\n subDocs: new Map(),\n };\n\n const relsEl = doc.get(\"word/_rels/document.xml.rels\");\n if (!relsEl) return refs;\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 const id = attr(child, \"Id\") ?? \"\";\n if (!target) continue;\n\n const path = resolveRelsPath(target);\n\n if (type.includes(\"/header\")) {\n refs.headers.set(id, path);\n } else if (type.includes(\"/footer\")) {\n refs.footers.set(id, path);\n } else if (type.includes(\"/footnotes\")) {\n refs.footnotes = path;\n } else if (type.includes(\"/endnotes\")) {\n refs.endnotes = path;\n } else if (type.includes(\"/comments\")) {\n refs.comments = path;\n } else if (type.includes(\"/chart\")) {\n refs.charts.set(id, path);\n } else if (type.includes(\"/diagramData\")) {\n refs.diagramData.set(id, path);\n } else if (type.includes(\"/image\") || type.includes(\"/media\")) {\n refs.media.set(id, path);\n } else if (type.includes(\"/aFChunk\")) {\n refs.afChunks.set(id, path);\n } else if (type.includes(\"/subDocument\")) {\n refs.subDocs.set(id, path);\n } else if (type.includes(\"/hyperlink\")) {\n refs.hyperlinks.set(id, target);\n }\n }\n\n return refs;\n}\n\nfunction parseRootRels(doc: ParsedArchive): {\n coreProps?: string;\n appProps?: string;\n customProps?: string;\n} {\n const relsEl = doc.get(\"_rels/.rels\");\n if (!relsEl) return {};\n\n let coreProps: string | undefined;\n let appProps: string | undefined;\n let customProps: 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 } else if (type.includes(\"/custom-properties\")) {\n customProps = path;\n }\n }\n\n return { coreProps, appProps, customProps };\n}\n\n/**\n * Parse a .docx file and convert it into PropertiesOptions.\n *\n * This is the main public API for parsing DOCX files.\n * The returned options can be passed directly to `new Document(parsed)`\n * to recreate the document.\n *\n * @param data - Raw bytes of a .docx file\n * @returns Document options including sections and metadata\n */\nexport function parseDocument(data: DataType): PropertiesOptions {\n const docx = parseDocx(data);\n const ctx = new ParseContext(docx, buildStyleCache(docx), buildNumberingCache(docx));\n const sections = parseBody(docx.body, ctx);\n\n const opts: Record<string, unknown> = { sections };\n\n // Background (w:background in document.xml)\n if (docx.background) {\n const bg: Record<string, unknown> = {};\n const color = attr(docx.background, \"w:color\");\n if (color) bg.color = color;\n if (Object.keys(bg).length > 0) opts.background = bg;\n }\n\n // Core properties\n if (docx.coreProps) {\n const corePropsEl = docx.doc.get(docx.coreProps);\n if (corePropsEl) {\n const cp = parseCorePropsElement(corePropsEl);\n if (cp.title) opts.title = cp.title;\n if (cp.subject) opts.subject = cp.subject;\n if (cp.creator) opts.creator = cp.creator;\n if (cp.keywords) opts.keywords = cp.keywords;\n if (cp.description) opts.description = cp.description;\n if (cp.lastModifiedBy) opts.lastModifiedBy = cp.lastModifiedBy;\n if (cp.revision) opts.revision = parseInt(cp.revision, 10);\n }\n }\n\n // Settings\n if (docx.settings) {\n Object.assign(opts, parseSettings(docx.settings));\n }\n\n // Custom properties\n if (docx.customProps) {\n const customPropsEl = docx.doc.get(docx.customProps);\n if (customPropsEl) {\n const cpEntries = parseCustomProperties(customPropsEl);\n if (cpEntries.length > 0) {\n opts.customProperties = cpEntries;\n }\n }\n }\n\n // Comments content\n if (docx.partRefs.comments) {\n const commentsEl = docx.doc.get(docx.partRefs.comments);\n if (commentsEl) {\n const comments = parseComments(commentsEl, ctx);\n if (comments.length > 0) {\n opts.comments = { children: comments };\n }\n }\n }\n\n // Footnotes content\n if (docx.partRefs.footnotes) {\n const footnotesEl = docx.doc.get(docx.partRefs.footnotes);\n if (footnotesEl) {\n const footnotes = parseNotesContent(footnotesEl, \"w:footnote\", ctx);\n const footnotesMap: Record<string, { children: unknown[] }> = {};\n for (const fn of footnotes) {\n footnotesMap[String(fn.id)] = { children: fn.children };\n }\n if (Object.keys(footnotesMap).length > 0) opts.footnotes = footnotesMap;\n }\n }\n\n // Endnotes content\n if (docx.partRefs.endnotes) {\n const endnotesEl = docx.doc.get(docx.partRefs.endnotes);\n if (endnotesEl) {\n const endnotes = parseNotesContent(endnotesEl, \"w:endnote\", ctx);\n const endnotesMap: Record<string, { children: unknown[] }> = {};\n for (const en of endnotes) {\n endnotesMap[String(en.id)] = { children: en.children };\n }\n if (Object.keys(endnotesMap).length > 0) opts.endnotes = endnotesMap;\n }\n }\n\n // Styles definitions\n if (docx.styles) {\n const styleOpts = parseStyleDefinitions(docx.styles, ctx);\n if (styleOpts) opts.styles = styleOpts;\n }\n\n // Numbering definitions\n if (docx.numbering) {\n const numOpts = parseNumberingDefinitions(docx.numbering);\n if (numOpts) opts.numbering = numOpts;\n }\n\n return opts as unknown as PropertiesOptions;\n}\n\nexport function parseDocx(data: DataType): DocxDocument {\n const uint8 = toUint8Array(data);\n const doc = parseArchive(uint8);\n\n const documentEl = doc.get(\"word/document.xml\");\n if (!documentEl) throw new Error(\"word/document.xml not found\");\n const body = documentEl.elements?.find((e) => e.name === \"w:body\");\n if (!body) throw new Error(\"w:body not found in word/document.xml\");\n const background = documentEl.elements?.find((e) => e.name === \"w:background\");\n\n const styles = doc.get(\"word/styles.xml\");\n const numbering = doc.get(\"word/numbering.xml\");\n const settings = doc.get(\"word/settings.xml\");\n const fontTable = doc.get(\"word/fontTable.xml\");\n const webSettings = doc.get(\"word/webSettings.xml\");\n\n const partRefs = parseDocPartRefs(doc);\n const { coreProps, appProps, customProps } = parseRootRels(doc);\n\n return {\n doc,\n body,\n background,\n styles,\n numbering,\n settings,\n fontTable,\n webSettings,\n partRefs,\n coreProps,\n appProps,\n customProps,\n };\n}\n\n/**\n * Parse w:comments element into CommentOptions array.\n */\nfunction parseComments(\n el: Element,\n ctx: ParseContext,\n): { id: number; author?: string; initials?: string; date?: string; children: unknown[] }[] {\n const comments: {\n id: number;\n author?: string;\n initials?: string;\n date?: string;\n children: unknown[];\n }[] = [];\n\n for (const child of el.elements ?? []) {\n if (child.name !== \"w:comment\") continue;\n const id = attrNum(child, \"w:id\");\n if (id === undefined) continue;\n\n const author = attr(child, \"w:author\");\n const initials = attr(child, \"w:initials\");\n const date = attr(child, \"w:date\");\n\n const children: unknown[] = [];\n for (const sub of child.elements ?? []) {\n if (sub.name === \"w:p\") {\n children.push(parseParagraph(sub, ctx));\n }\n }\n\n comments.push({\n id,\n author: author || undefined,\n initials: initials || undefined,\n date: date || undefined,\n children,\n });\n }\n\n return comments;\n}\n\n/**\n * Parse footnotes or endnotes content into {id, children} array.\n * Skips system notes (id=-1 for separator, id=0 for continuation separator).\n */\nfunction parseNotesContent(\n el: Element,\n tagName: \"w:footnote\" | \"w:endnote\",\n ctx: ParseContext,\n): { id: number; type?: string; children: unknown[] }[] {\n const notes: { id: number; type?: string; children: unknown[] }[] = [];\n\n for (const child of el.elements ?? []) {\n if (child.name !== tagName) continue;\n const id = attrNum(child, \"w:id\");\n if (id === undefined) continue;\n\n // Skip system footnotes/endnotes (separator and continuation)\n if (id < 1) continue;\n\n const type = attr(child, \"w:type\");\n\n const children: unknown[] = [];\n for (const sub of child.elements ?? []) {\n if (sub.name === \"w:p\") {\n children.push(parseParagraph(sub, ctx));\n }\n }\n\n notes.push({ id, type: type || undefined, children });\n }\n\n return notes;\n}\n","/**\n * Main entry point for the docx library.\n *\n * This module provides a declarative API for creating .docx files that works\n * in both Node.js and browser environments. The library generates documents\n * compliant with the OOXML (Office Open XML) specification.\n *\n * The primary export is the `Document` class (internally named `File`), which\n * serves as the main entry point for creating Word documents.\n *\n * @module\n *\n * @example\n * ```typescript\n * import { Document, Paragraph, TextRun, Packer } from \"docx-plus\";\n *\n * // Create a document\n * const doc = new Document({\n * sections: [{\n * children: [\n * new Paragraph({\n * children: [\n * new TextRun({ text: \"Hello World\", bold: true }),\n * ],\n * }),\n * ],\n * }],\n * });\n *\n * // Export to buffer\n * const buffer = await Packer.toBuffer(doc);\n * ```\n */\n\n// Internally, the wrapper is a 'File', but export to the end user as a 'Document'\n// Use of 'File' also works\nexport { File as Document } from \"./file\";\nexport * from \"./file\";\nexport * from \"./export\";\nexport * from \"./util\";\nexport * from \"./patcher\";\nexport * from \"./parse\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;CC4Ba,aAAb,cAAgCA,wBA+C7B;EACD,UAA6B;GAC3B,QAAQ;GACR,OAAO;GACP,MAAM;GACN,QAAQ;GACR,QAAQ;GACR,GAAG;GACH,QAAQ;GACR,MAAM;GACN,WAAW;GACX,KAAK;GACL,OAAO;GACP,OAAO;GACP,SAAS;GACT,UAAU;GACV,OAAO;GACP,IAAI;GACJ,YAAY;GACZ,YAAY;GACZ,WAAW;GACX,KAAK;GACL,MAAM;GACN,KAAK;GACL,GAAG;GACJ;;;;;;;;;;;;CCtFU,uBAAuB,MAAc,UAChD,IAAIC,iBAAe;EACjB,YAAY,EACV,OAAO;GAAE,KAAK;GAAS;GAAO,EAC/B;EACD;EACD,CAAC;;;;;YCdsC;;uBA8Bc;;;;;;sBCxBF;CAgCzC,gBAAgB;;EAE3B,OAAO;;EAEP,QAAQ;;EAER,KAAK;;EAEL,MAAM;;EAEN,gBAAgB;;EAEhB,YAAY;;EAEZ,SAAS;;EAET,cAAc;;EAEd,aAAa;;EAEb,iBAAiB;;EAEjB,MAAM;;EAEN,OAAO;;EAEP,WAAW;EACZ;CAwBY,mBACX,SAEA,IAAI,eAAqF;EACvF,YAAY,EACV,KAAK;GAAE,KAAK;GAAS,OAAO;GAAM,EACnC;EACD,MAAM;EACP,CAAC;;;;;;;;;;;;sBEzEkD;cAOhC;CAoCT,kBACX,aACA,EAAE,OAAO,MAAM,OAAO,OAAO,YAAY,WAAW,YAAY,QAAQ,YACrD;EACnB,MAAM,QAAmD,EAAE;EAC3D,IAAI,UAAU,KAAA,GAAW,MAAM,WAAW;EAC1C,IAAI,UAAU,KAAA,GAAW,MAAM,cAAA,GAAA,eAAA,eAA2B,MAAM;EAChE,IAAI,SAAS,KAAA,GAAW,MAAM,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,OAAO,CAClF;EACD,KAAK,KAAK,KAAK,cAAc,mBAAmB,MAAM,CAAC;EACvD,KAAK,KAAK,KACR,cAAc,gEAAgE,QAAQ,CACvF;EAED,KAAK,KAAK,KACR,eACE,oFACA,qBACD,CACF;EAED,KAAK,KAAK,KACR,eACE,6EACA,mBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,8DACA,qBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,uEACA,uBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,yEACA,oBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,gFACA,sBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,gFACA,sBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,+EACA,qBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,+EACA,qBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,+EACA,qBACD,CACF;EACD,KAAK,KAAK,KACR,eACE,gFACA,sBACD,CACF;;;;;CAMH,kBAA+B;EAC7B,KAAK,KAAK,KACR,eACE,mFACA,yBACD,CACF;;;;;;;CAQH,UAAiB,OAAqB;EACpC,KAAK,KAAK,KACR,eACE,6EACA,eAAe,MAAM,MACtB,CACF;;;;;;;CAQH,UAAiB,OAAqB;EACpC,KAAK,KAAK,KACR,eACE,6EACA,eAAe,MAAM,MACtB,CACF;;;;;;;CAQH,SAAgB,OAAqB;EACnC,KAAK,KAAK,KACR,eACE,qEACA,qBAAqB,MAAM,MAC5B,CACF;;;;;;;CAQH,eAAsB,OAAqB;EACzC,KAAK,KAAK,KACR,eACE,2EACA,sBAAsB,MAAM,MAC7B,CACF;;;;;;;CAQH,iBAAwB,OAAqB;EAC3C,KAAK,KAAK,KACR,eACE,6EACA,wBAAwB,MAAM,MAC/B,CACF;;;;;;;CAQH,gBAAuB,OAAqB;EAC1C,KAAK,KAAK,KACR,eACE,4EACA,4BAA4B,MAAM,MACnC,CACF;;;;;;;CAQH,iBAAwB,OAAqB;EAC3C,KAAK,KAAK,KACR,e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