@office-kit/pptx 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -139,6 +139,7 @@ const NS = {
139
139
  chartDrawing: "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing",
140
140
  sml: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
141
141
  wml: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
142
+ math: "http://schemas.openxmlformats.org/officeDocument/2006/math",
142
143
  mc: "http://schemas.openxmlformats.org/markup-compatibility/2006",
143
144
  a14: "http://schemas.microsoft.com/office/drawing/2010/main",
144
145
  a15: "http://schemas.microsoft.com/office/drawing/2012/main",
@@ -150,7 +151,77 @@ const NS = {
150
151
  xml: "http://www.w3.org/XML/1998/namespace",
151
152
  xmlns: "http://www.w3.org/2000/xmlns/"
152
153
  };
153
- NS.contentTypes, NS.relationships, NS.officeDocRels, NS.pml, NS.dml, NS.diagram, NS.chart, NS.chartDrawing, NS.sml, NS.wml, NS.mc, NS.a14, NS.a15, NS.a16, NS.p14, NS.p15, NS.p16, NS.p159, NS.xml;
154
+ NS.contentTypes, NS.relationships, NS.officeDocRels, NS.pml, NS.dml, NS.diagram, NS.chart, NS.chartDrawing, NS.sml, NS.wml, NS.math, NS.mc, NS.a14, NS.a15, NS.a16, NS.p14, NS.p15, NS.p16, NS.p159, NS.xml;
155
+ //#endregion
156
+ //#region src/internal/xml/query.ts
157
+ const isElement = (n) => n.kind === "element";
158
+ const childElements = (e) => e.children.filter(isElement);
159
+ const firstChildElement = (e, name) => {
160
+ for (const c of e.children) if (isElement(c) && qnameEquals(c.name, name)) return c;
161
+ return null;
162
+ };
163
+ const allChildElements = (e, name) => {
164
+ const out = [];
165
+ for (const c of e.children) if (isElement(c) && qnameEquals(c.name, name)) out.push(c);
166
+ return out;
167
+ };
168
+ const getAttr = (e, name) => {
169
+ for (const a of e.attrs) if (qnameEquals(a.name, name)) return a;
170
+ return null;
171
+ };
172
+ const getAttrValue = (e, name) => getAttr(e, name)?.value ?? null;
173
+ /**
174
+ * Returns the concatenated text content of an element, walking into nested
175
+ * elements. OOXML uses this pattern for `<a:t>Hello</a:t>` (single text
176
+ * child) and for run sequences where multiple text nodes need merging.
177
+ */
178
+ const textContent = (e) => {
179
+ let out = "";
180
+ for (const c of e.children) if (c.kind === "text") out += c.data;
181
+ else if (c.kind === "cdata") out += c.data;
182
+ else if (c.kind === "element") out += textContent(c);
183
+ return out;
184
+ };
185
+ /**
186
+ * Walks the element tree depth-first, yielding every element including the
187
+ * root. The visitor returns `false` to skip descending into the current
188
+ * element's children. Returning nothing (or `true`) descends as usual.
189
+ */
190
+ const walkElements = (root, visit) => {
191
+ const stack = [root];
192
+ while (stack.length > 0) {
193
+ const node = stack.pop();
194
+ if (!node) continue;
195
+ if (visit(node) === false) continue;
196
+ for (let i = node.children.length - 1; i >= 0; i--) {
197
+ const c = node.children[i];
198
+ if (c && isElement(c)) stack.push(c);
199
+ }
200
+ }
201
+ };
202
+ //#endregion
203
+ //#region src/internal/xml/markup-compatibility.ts
204
+ const ATTR_REQUIRES$2 = qname("", "Requires", "");
205
+ const isAlternateContent = (el) => el.name.namespaceURI === NS.mc && el.name.localName === "AlternateContent";
206
+ /** The prefix bindings in effect inside `el`, given those in effect around it. */
207
+ const withPrefixDecls = (scope, el) => el.prefixDecls.size === 0 ? scope : new Map([...scope, ...el.prefixDecls]);
208
+ /**
209
+ * The branch of `alternateContent` a reader that understands `understood`
210
+ * (namespace URIs) takes, or `null` when no choice qualifies and there is no
211
+ * fallback. `scope` holds the prefix bindings in effect around the element;
212
+ * `Requires` names prefixes, so they resolve against it.
213
+ */
214
+ const selectAlternateContentBranch = (alternateContent, understood, scope) => {
215
+ const outer = withPrefixDecls(scope, alternateContent);
216
+ for (const branch of alternateContent.children) {
217
+ if (branch.kind !== "element" || branch.name.namespaceURI !== NS.mc) continue;
218
+ if (branch.name.localName === "Fallback") return branch;
219
+ if (branch.name.localName !== "Choice") continue;
220
+ const inner = withPrefixDecls(outer, branch);
221
+ if ((getAttrValue(branch, ATTR_REQUIRES$2) ?? "").split(/\s+/).filter(Boolean).every((prefix) => understood.has(inner.get(prefix) ?? ""))) return branch;
222
+ }
223
+ return null;
224
+ };
154
225
  //#endregion
155
226
  //#region src/internal/xml/parse.ts
156
227
  var XmlParseError = class extends Error {
@@ -469,53 +540,6 @@ const parseXml = (src) => {
469
540
  };
470
541
  const parseFragment = (src) => parseXml(src).root;
471
542
  //#endregion
472
- //#region src/internal/xml/query.ts
473
- const isElement = (n) => n.kind === "element";
474
- const childElements = (e) => e.children.filter(isElement);
475
- const firstChildElement = (e, name) => {
476
- for (const c of e.children) if (isElement(c) && qnameEquals(c.name, name)) return c;
477
- return null;
478
- };
479
- const allChildElements = (e, name) => {
480
- const out = [];
481
- for (const c of e.children) if (isElement(c) && qnameEquals(c.name, name)) out.push(c);
482
- return out;
483
- };
484
- const getAttr = (e, name) => {
485
- for (const a of e.attrs) if (qnameEquals(a.name, name)) return a;
486
- return null;
487
- };
488
- const getAttrValue = (e, name) => getAttr(e, name)?.value ?? null;
489
- /**
490
- * Returns the concatenated text content of an element, walking into nested
491
- * elements. OOXML uses this pattern for `<a:t>Hello</a:t>` (single text
492
- * child) and for run sequences where multiple text nodes need merging.
493
- */
494
- const textContent = (e) => {
495
- let out = "";
496
- for (const c of e.children) if (c.kind === "text") out += c.data;
497
- else if (c.kind === "cdata") out += c.data;
498
- else if (c.kind === "element") out += textContent(c);
499
- return out;
500
- };
501
- /**
502
- * Walks the element tree depth-first, yielding every element including the
503
- * root. The visitor returns `false` to skip descending into the current
504
- * element's children. Returning nothing (or `true`) descends as usual.
505
- */
506
- const walkElements = (root, visit) => {
507
- const stack = [root];
508
- while (stack.length > 0) {
509
- const node = stack.pop();
510
- if (!node) continue;
511
- if (visit(node) === false) continue;
512
- for (let i = node.children.length - 1; i >= 0; i--) {
513
- const c = node.children[i];
514
- if (c && isElement(c)) stack.push(c);
515
- }
516
- }
517
- };
518
- //#endregion
519
543
  //#region src/internal/xml/serialize.ts
520
544
  const rejectForbiddenChar = (c) => {
521
545
  const control = c < 32 && c !== 9 && c !== 10 && c !== 13;
@@ -787,84 +811,54 @@ const textBodyText = (txBody) => {
787
811
  /** Iterates over each paragraph (`a:p`) element inside `a:txBody`. */
788
812
  const paragraphsOf$1 = (txBody) => allChildElements(txBody, NAME_P$6);
789
813
  //#endregion
790
- //#region src/internal/bounds.ts
791
- const RANGES = {
792
- coordinate: [-27273042329600, 27273042316900],
793
- positiveCoordinate: [0, 27273042316900],
794
- coordinate32: [-2147483648, 2147483647],
795
- positiveCoordinate32: [0, 2147483647],
796
- slideSize: [914400, 51206400],
797
- lineWidth: [0, 20116800],
798
- angle: [-2147483648, 2147483647],
799
- fontSize: [100, 4e5],
800
- textNonNegativePoint: [0, 4e5],
801
- textMargin: [0, 51206400],
802
- textIndent: [-51206400, 51206400],
803
- textPoint: [-4e5, 4e5],
804
- textSpacingPoint: [0, 158400],
805
- unsignedInt: [0, 4294967295],
806
- columnCount: [1, 16],
807
- overlap: [-100, 100],
808
- gapAmount: [0, 500],
809
- holeSize: [1, 90],
810
- firstSliceAng: [0, 360],
811
- rotX: [-90, 90],
812
- rotY: [0, 360],
813
- perspective: [0, 240],
814
- depthPercent: [20, 2e3],
815
- heightPercent: [5, 500],
816
- secondPieSize: [5, 200],
817
- bubbleScale: [0, 300],
818
- percent100000: [0, 1e5]
819
- };
820
- const boundedInt = (value, key, field) => {
821
- if (!Number.isFinite(value)) throw new RangeError(`${field}: expected a finite number, got ${value}`);
822
- const n = Math.round(value);
823
- const [min, max] = RANGES[key];
824
- if (n < min || n > max) throw new RangeError(`${field}: ${value} is out of range for ${key} (${min}..${max})`);
825
- return n;
814
+ //#region src/internal/drawingml/math-runs.ts
815
+ const NAME_A_RPR$4 = qname("a", "rPr", NS.dml);
816
+ const isMath$1 = (el, localName) => el.name.namespaceURI === NS.math && el.name.localName === localName;
817
+ const runProperties = (run) => {
818
+ const existing = firstChildElement(run, NAME_A_RPR$4);
819
+ if (existing) return existing;
820
+ const rPr = elem(NAME_A_RPR$4);
821
+ const first = run.children[0];
822
+ const afterMathProps = first?.kind === "element" && isMath$1(first, "rPr") ? 1 : 0;
823
+ run.children.splice(afterMathProps, 0, rPr);
824
+ return rPr;
826
825
  };
827
- /** EMU position coordinate (`<a:off>` x/y) — ST_Coordinate. */
828
- const emuCoordinate = (v, field) => boundedInt(v, "coordinate", field);
829
- /** EMU extent (`<a:ext>` cx/cy, column/table widths, row heights) — ST_PositiveCoordinate. */
830
- const emuExtent = (v, field) => boundedInt(v, "positiveCoordinate", field);
831
- /** 32-bit EMU (text-body insets, cell margins) — ST_Coordinate32. */
832
- const emuCoordinate32 = (v, field) => boundedInt(v, "coordinate32", field);
833
- /** Non-negative 32-bit EMU (column gap) — ST_PositiveCoordinate32. */
834
- const emuPositiveCoordinate32 = (v, field) => boundedInt(v, "positiveCoordinate32", field);
835
- /** Line width in EMU — ST_LineWidth. */
836
- const lineWidthEmu = (v, field) => boundedInt(v, "lineWidth", field);
837
- /** Angle in 1/60000 degree — ST_Angle. */
838
- const angle60000 = (v, field) => boundedInt(v, "angle", field);
839
- /** Font size in 1/100 pt — ST_TextFontSize. */
840
- const fontSizeHundredthPt = (v, field) => boundedInt(v, "fontSize", field);
841
- /** Character spacing in 1/100 pt — ST_TextPoint. */
842
- const textPointSpacing = (v, field) => boundedInt(v, "textPoint", field);
843
- /** Auto-advance / timing duration in ms — xsd:unsignedInt. */
844
- const unsignedIntMs = (v, field) => boundedInt(v, "unsignedInt", field);
845
- /** Text column count — ST_TextColumnCount (1..16). */
846
- const textColumnCount = (v, field) => boundedInt(v, "columnCount", field);
847
- /** Bar/column series overlap percent — ST_OverlapByte (-100..100). */
848
- const overlapPercent = (v, field) => boundedInt(v, "overlap", field);
849
- /** Bar/column gap width percent — ST_GapAmount (0..500). */
850
- const gapAmountPercent = (v, field) => boundedInt(v, "gapAmount", field);
851
- /** Doughnut hole size percent — ST_HoleSizeUByte (1..90). */
852
- const holeSizePercent = (v, field) => boundedInt(v, "holeSize", field);
853
- /** Pie/doughnut first-slice angle in degrees — ST_FirstSliceAng (0..360). */
854
- const firstSliceAngle = (v, field) => boundedInt(v, "firstSliceAng", field);
855
- const GUID_RE = /^\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\}$/;
856
- const normalizeGuid = (value, field) => {
857
- if (!GUID_RE.test(value)) throw new RangeError(`${field}: ${JSON.stringify(value)} is not a GUID of the form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}`);
858
- return value.toUpperCase();
826
+ const collectMathRuns = (el, out) => {
827
+ for (const child of el.children) {
828
+ if (child.kind !== "element") continue;
829
+ if (isMath$1(child, "r")) out.push(runProperties(child));
830
+ else collectMathRuns(child, out);
831
+ }
859
832
  };
833
+ const isZone = (el) => el.name.namespaceURI === NS.a14 && el.name.localName === "m";
860
834
  /**
861
- * A fresh `ST_Guid`. `crypto.randomUUID` is a Web API, available in both
862
- * runtimes this library targets, and is the only randomness it uses.
835
+ * The `<a:rPr>` of every run in `paragraph`'s equations: the math runs of
836
+ * each `<a14:m>`, and the text runs of the `mc:Fallback` the library writes
837
+ * beside one. Missing properties are created.
863
838
  */
864
- const newGuid = () => `{${globalThis.crypto.randomUUID().toUpperCase()}}`;
865
- const oneOf = (value, allowed, field) => {
866
- if (!allowed.includes(value)) throw new RangeError(`${field}: ${JSON.stringify(value)} is not one of: ${allowed.join(", ")}`);
867
- return value;
839
+ const equationRunProperties = (paragraph) => {
840
+ const math = [];
841
+ const fallback = [];
842
+ for (const child of paragraph.children) {
843
+ if (child.kind !== "element") continue;
844
+ if (isZone(child)) {
845
+ collectMathRuns(child, math);
846
+ continue;
847
+ }
848
+ if (child.name.namespaceURI !== NS.mc || child.name.localName !== "AlternateContent") continue;
849
+ const branches = child.children.filter((branch) => branch.kind === "element" && branch.name.namespaceURI === NS.mc);
850
+ const choice = branches.find((branch) => branch.name.localName === "Choice" && branch.children.some((zone) => zone.kind === "element" && isZone(zone)));
851
+ if (!choice) continue;
852
+ collectMathRuns(choice, math);
853
+ for (const branch of branches) {
854
+ if (branch.name.localName !== "Fallback") continue;
855
+ for (const run of branch.children) if (run.kind === "element" && run.name.namespaceURI === NS.dml && run.name.localName === "r") fallback.push(runProperties(run));
856
+ }
857
+ }
858
+ return {
859
+ math,
860
+ fallback
861
+ };
868
862
  };
869
863
  //#endregion
870
864
  //#region src/internal/enum-values.ts
@@ -1305,6 +1299,86 @@ const PRESET_MATERIALS = [
1305
1299
  "softmetal"
1306
1300
  ];
1307
1301
  //#endregion
1302
+ //#region src/internal/bounds.ts
1303
+ const RANGES = {
1304
+ coordinate: [-27273042329600, 27273042316900],
1305
+ positiveCoordinate: [0, 27273042316900],
1306
+ coordinate32: [-2147483648, 2147483647],
1307
+ positiveCoordinate32: [0, 2147483647],
1308
+ slideSize: [914400, 51206400],
1309
+ lineWidth: [0, 20116800],
1310
+ angle: [-2147483648, 2147483647],
1311
+ fontSize: [100, 4e5],
1312
+ textNonNegativePoint: [0, 4e5],
1313
+ textMargin: [0, 51206400],
1314
+ textIndent: [-51206400, 51206400],
1315
+ textPoint: [-4e5, 4e5],
1316
+ textSpacingPoint: [0, 158400],
1317
+ unsignedInt: [0, 4294967295],
1318
+ columnCount: [1, 16],
1319
+ overlap: [-100, 100],
1320
+ gapAmount: [0, 500],
1321
+ holeSize: [1, 90],
1322
+ firstSliceAng: [0, 360],
1323
+ rotX: [-90, 90],
1324
+ rotY: [0, 360],
1325
+ perspective: [0, 240],
1326
+ depthPercent: [20, 2e3],
1327
+ heightPercent: [5, 500],
1328
+ secondPieSize: [5, 200],
1329
+ bubbleScale: [0, 300],
1330
+ percent100000: [0, 1e5]
1331
+ };
1332
+ const boundedInt = (value, key, field) => {
1333
+ if (!Number.isFinite(value)) throw new RangeError(`${field}: expected a finite number, got ${value}`);
1334
+ const n = Math.round(value);
1335
+ const [min, max] = RANGES[key];
1336
+ if (n < min || n > max) throw new RangeError(`${field}: ${value} is out of range for ${key} (${min}..${max})`);
1337
+ return n;
1338
+ };
1339
+ /** EMU position coordinate (`<a:off>` x/y) — ST_Coordinate. */
1340
+ const emuCoordinate = (v, field) => boundedInt(v, "coordinate", field);
1341
+ /** EMU extent (`<a:ext>` cx/cy, column/table widths, row heights) — ST_PositiveCoordinate. */
1342
+ const emuExtent = (v, field) => boundedInt(v, "positiveCoordinate", field);
1343
+ /** 32-bit EMU (text-body insets, cell margins) — ST_Coordinate32. */
1344
+ const emuCoordinate32 = (v, field) => boundedInt(v, "coordinate32", field);
1345
+ /** Non-negative 32-bit EMU (column gap) — ST_PositiveCoordinate32. */
1346
+ const emuPositiveCoordinate32 = (v, field) => boundedInt(v, "positiveCoordinate32", field);
1347
+ /** Line width in EMU — ST_LineWidth. */
1348
+ const lineWidthEmu = (v, field) => boundedInt(v, "lineWidth", field);
1349
+ /** Angle in 1/60000 degree — ST_Angle. */
1350
+ const angle60000 = (v, field) => boundedInt(v, "angle", field);
1351
+ /** Font size in 1/100 pt — ST_TextFontSize. */
1352
+ const fontSizeHundredthPt = (v, field) => boundedInt(v, "fontSize", field);
1353
+ /** Character spacing in 1/100 pt — ST_TextPoint. */
1354
+ const textPointSpacing = (v, field) => boundedInt(v, "textPoint", field);
1355
+ /** Auto-advance / timing duration in ms — xsd:unsignedInt. */
1356
+ const unsignedIntMs = (v, field) => boundedInt(v, "unsignedInt", field);
1357
+ /** Text column count — ST_TextColumnCount (1..16). */
1358
+ const textColumnCount = (v, field) => boundedInt(v, "columnCount", field);
1359
+ /** Bar/column series overlap percent — ST_OverlapByte (-100..100). */
1360
+ const overlapPercent = (v, field) => boundedInt(v, "overlap", field);
1361
+ /** Bar/column gap width percent — ST_GapAmount (0..500). */
1362
+ const gapAmountPercent = (v, field) => boundedInt(v, "gapAmount", field);
1363
+ /** Doughnut hole size percent — ST_HoleSizeUByte (1..90). */
1364
+ const holeSizePercent = (v, field) => boundedInt(v, "holeSize", field);
1365
+ /** Pie/doughnut first-slice angle in degrees — ST_FirstSliceAng (0..360). */
1366
+ const firstSliceAngle = (v, field) => boundedInt(v, "firstSliceAng", field);
1367
+ const GUID_RE = /^\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\}$/;
1368
+ const normalizeGuid = (value, field) => {
1369
+ if (!GUID_RE.test(value)) throw new RangeError(`${field}: ${JSON.stringify(value)} is not a GUID of the form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}`);
1370
+ return value.toUpperCase();
1371
+ };
1372
+ /**
1373
+ * A fresh `ST_Guid`. `crypto.randomUUID` is a Web API, available in both
1374
+ * runtimes this library targets, and is the only randomness it uses.
1375
+ */
1376
+ const newGuid = () => `{${globalThis.crypto.randomUUID().toUpperCase()}}`;
1377
+ const oneOf = (value, allowed, field) => {
1378
+ if (!allowed.includes(value)) throw new RangeError(`${field}: ${JSON.stringify(value)} is not one of: ${allowed.join(", ")}`);
1379
+ return value;
1380
+ };
1381
+ //#endregion
1308
1382
  //#region src/internal/drawingml/color.ts
1309
1383
  const NAME_SRGB_CLR$4 = qname("a", "srgbClr", NS.dml);
1310
1384
  const NAME_SCHEME_CLR$2 = qname("a", "schemeClr", NS.dml);
@@ -2779,9 +2853,226 @@ const applyValidatedFormatToAllRuns = (txBody, format, reset = false, images) =>
2779
2853
  }
2780
2854
  applyValidatedRunFormat(rPr, format, images);
2781
2855
  }
2856
+ const equation = equationRunProperties(p);
2857
+ if (equation.math.length > 0) {
2858
+ const { font: _font, fontEastAsian: _ea, fontComplexScript: _cs, ...mathFormat } = format;
2859
+ for (const rPr of equation.math) applyValidatedRunFormat(rPr, mathFormat, images);
2860
+ for (const rPr of equation.fallback) applyValidatedRunFormat(rPr, format, images);
2861
+ }
2782
2862
  }
2783
2863
  };
2784
2864
  //#endregion
2865
+ //#region src/internal/drawingml/math.ts
2866
+ const MATH_FONT = "Cambria Math";
2867
+ const DEFAULT_ACCENT$1 = "̂";
2868
+ const DEFAULT_NARY_OPERATOR$1 = "∫";
2869
+ const m$1 = (localName) => qname("m", localName, NS.math);
2870
+ const NAME_VAL$2 = m$1("val");
2871
+ const NAME_A_RPR$3 = qname("a", "rPr", NS.dml);
2872
+ const NAME_A_R$1 = qname("a", "r", NS.dml);
2873
+ const NAME_A_T$1 = qname("a", "t", NS.dml);
2874
+ const NAME_A14_M = qname("a14", "m", NS.a14);
2875
+ const NAME_ALTERNATE_CONTENT$1 = qname("mc", "AlternateContent", NS.mc);
2876
+ const NAME_CHOICE$1 = qname("mc", "Choice", NS.mc);
2877
+ const NAME_FALLBACK$1 = qname("mc", "Fallback", NS.mc);
2878
+ const ATTR_REQUIRES$1 = qname("", "Requires", "");
2879
+ const ATTR_XML_SPACE = qname("xml", "space", NS.xml);
2880
+ const STY_BY_STYLE = {
2881
+ plain: "p",
2882
+ bold: "b",
2883
+ italic: "i",
2884
+ boldItalic: "bi"
2885
+ };
2886
+ const FRACTION_TOKEN = {
2887
+ skewed: "skw",
2888
+ linear: "lin",
2889
+ noBar: "noBar"
2890
+ };
2891
+ const valElement = (localName, value) => elem(m$1(localName), { attrs: [attr(NAME_VAL$2, value)] });
2892
+ const textElement = (name, value) => elem(name, {
2893
+ attrs: /^\s|\s$/.test(value) ? [attr(ATTR_XML_SPACE, "preserve")] : [],
2894
+ children: [text(value)]
2895
+ });
2896
+ const runElement = (node, ctx) => {
2897
+ const rPr = elem(NAME_A_RPR$3);
2898
+ applyRunFormat(rPr, {
2899
+ font: MATH_FONT,
2900
+ ...ctx.format,
2901
+ ...node.format
2902
+ }, ctx.caller, ctx.images);
2903
+ return elem(m$1("r"), { children: [
2904
+ ...node.style === void 0 ? [] : [elem(m$1("rPr"), { children: [valElement("sty", STY_BY_STYLE[node.style])] })],
2905
+ rPr,
2906
+ textElement(m$1("t"), node.text)
2907
+ ] });
2908
+ };
2909
+ const arg = (localName, nodes, ctx) => elem(m$1(localName), { children: nodes.map((node) => nodeElement(node, ctx)) });
2910
+ const props = (localName, children) => children.length === 0 ? [] : [elem(m$1(localName), { children })];
2911
+ const nodeElement = (node, ctx) => {
2912
+ switch (node.kind) {
2913
+ case "text": return runElement(node, ctx);
2914
+ case "fraction": return elem(m$1("f"), { children: [
2915
+ ...props("fPr", node.type === void 0 || node.type === "bar" ? [] : [valElement("type", FRACTION_TOKEN[node.type])]),
2916
+ arg("num", node.numerator, ctx),
2917
+ arg("den", node.denominator, ctx)
2918
+ ] });
2919
+ case "subscript": return elem(m$1("sSub"), { children: [arg("e", node.base, ctx), arg("sub", node.sub, ctx)] });
2920
+ case "superscript": return elem(m$1("sSup"), { children: [arg("e", node.base, ctx), arg("sup", node.sup, ctx)] });
2921
+ case "subSuperscript": return elem(m$1("sSubSup"), { children: [
2922
+ arg("e", node.base, ctx),
2923
+ arg("sub", node.sub, ctx),
2924
+ arg("sup", node.sup, ctx)
2925
+ ] });
2926
+ case "radical": {
2927
+ const degree = node.degree ?? [];
2928
+ return elem(m$1("rad"), { children: [
2929
+ ...props("radPr", degree.length === 0 ? [valElement("degHide", "1")] : []),
2930
+ arg("deg", degree, ctx),
2931
+ arg("e", node.body, ctx)
2932
+ ] });
2933
+ }
2934
+ case "nary": {
2935
+ const hiddenSub = node.sub === void 0 || node.sub === null;
2936
+ const hiddenSup = node.sup === void 0 || node.sup === null;
2937
+ return elem(m$1("nary"), { children: [
2938
+ ...props("naryPr", [
2939
+ ...node.operator === void 0 || node.operator === DEFAULT_NARY_OPERATOR$1 ? [] : [valElement("chr", node.operator)],
2940
+ ...node.limitLocation === void 0 ? [] : [valElement("limLoc", node.limitLocation === "underOver" ? "undOvr" : "subSup")],
2941
+ ...hiddenSub ? [valElement("subHide", "1")] : [],
2942
+ ...hiddenSup ? [valElement("supHide", "1")] : []
2943
+ ]),
2944
+ arg("sub", node.sub ?? [], ctx),
2945
+ arg("sup", node.sup ?? [], ctx),
2946
+ arg("e", node.body, ctx)
2947
+ ] });
2948
+ }
2949
+ case "delimiter": return elem(m$1("d"), { children: [...props("dPr", [
2950
+ ...node.open === void 0 ? [] : [valElement("begChr", node.open)],
2951
+ ...node.separator === void 0 ? [] : [valElement("sepChr", node.separator)],
2952
+ ...node.close === void 0 ? [] : [valElement("endChr", node.close)]
2953
+ ]), ...node.items.map((item) => arg("e", item, ctx))] });
2954
+ case "matrix": {
2955
+ const columns = node.rows[0]?.length ?? 0;
2956
+ return elem(m$1("m"), { children: [elem(m$1("mPr"), { children: [elem(m$1("mcs"), { children: [elem(m$1("mc"), { children: [elem(m$1("mcPr"), { children: [valElement("count", String(columns)), valElement("mcJc", "center")] })] })] })] }), ...node.rows.map((row) => elem(m$1("mr"), { children: row.map((cell) => arg("e", cell, ctx)) }))] });
2957
+ }
2958
+ case "accent": return elem(m$1("acc"), { children: [...props("accPr", node.accent === void 0 || node.accent === DEFAULT_ACCENT$1 ? [] : [valElement("chr", node.accent)]), arg("e", node.body, ctx)] });
2959
+ case "function": return elem(m$1("func"), { children: [arg("fName", node.name, ctx), arg("e", node.body, ctx)] });
2960
+ case "lowerLimit":
2961
+ case "upperLimit": return elem(m$1(node.kind === "lowerLimit" ? "limLow" : "limUpp"), { children: [arg("e", node.base, ctx), arg("lim", node.limit, ctx)] });
2962
+ }
2963
+ };
2964
+ const ATOM = /^(?:[\p{L}\p{M}\p{N}.]+|.)$/u;
2965
+ const group = (s) => ATOM.test(s) ? s : `(${s})`;
2966
+ const linear = (nodes) => nodes.map(linearNode).join("");
2967
+ const linearNode = (node) => {
2968
+ switch (node.kind) {
2969
+ case "text": return node.text;
2970
+ case "fraction": return `${group(linear(node.numerator))}/${group(linear(node.denominator))}`;
2971
+ case "subscript": return `${group(linear(node.base))}_${group(linear(node.sub))}`;
2972
+ case "superscript": return `${group(linear(node.base))}^${group(linear(node.sup))}`;
2973
+ case "subSuperscript": return `${group(linear(node.base))}_${group(linear(node.sub))}^${group(linear(node.sup))}`;
2974
+ case "radical": {
2975
+ const degree = node.degree ? linear(node.degree) : "";
2976
+ return degree === "" ? `√${group(linear(node.body))}` : `√(${degree}&${linear(node.body)})`;
2977
+ }
2978
+ case "nary": {
2979
+ const sub = node.sub ? `_${group(linear(node.sub))}` : "";
2980
+ const sup = node.sup ? `^${group(linear(node.sup))}` : "";
2981
+ return `${node.operator ?? DEFAULT_NARY_OPERATOR$1}${sub}${sup} ${linear(node.body)}`;
2982
+ }
2983
+ case "delimiter": return `${node.open ?? "("}${node.items.map(linear).join(node.separator ?? "|")}${node.close ?? ")"}`;
2984
+ case "matrix": return `[${node.rows.map((row) => row.map(linear).join(", ")).join("; ")}]`;
2985
+ case "accent": return `${group(linear(node.body))}${node.accent ?? DEFAULT_ACCENT$1}`;
2986
+ case "function": return `${linear(node.name)} ${linear(node.body)}`;
2987
+ case "lowerLimit": return `${linear(node.base)}_${group(linear(node.limit))}`;
2988
+ case "upperLimit": return `${linear(node.base)}^${group(linear(node.limit))}`;
2989
+ }
2990
+ };
2991
+ const validate = (nodes, caller) => {
2992
+ for (const node of nodes) switch (node.kind) {
2993
+ case "text": break;
2994
+ case "fraction":
2995
+ validate(node.numerator, caller);
2996
+ validate(node.denominator, caller);
2997
+ break;
2998
+ case "subscript":
2999
+ validate(node.base, caller);
3000
+ validate(node.sub, caller);
3001
+ break;
3002
+ case "superscript":
3003
+ validate(node.base, caller);
3004
+ validate(node.sup, caller);
3005
+ break;
3006
+ case "subSuperscript":
3007
+ validate(node.base, caller);
3008
+ validate(node.sub, caller);
3009
+ validate(node.sup, caller);
3010
+ break;
3011
+ case "radical":
3012
+ validate(node.degree ?? [], caller);
3013
+ validate(node.body, caller);
3014
+ break;
3015
+ case "nary":
3016
+ validate(node.sub ?? [], caller);
3017
+ validate(node.sup ?? [], caller);
3018
+ validate(node.body, caller);
3019
+ break;
3020
+ case "delimiter":
3021
+ if (node.items.length === 0) throw new RangeError(`${caller}: a delimiter needs at least one item`);
3022
+ for (const item of node.items) validate(item, caller);
3023
+ break;
3024
+ case "matrix": {
3025
+ const columns = node.rows[0]?.length ?? 0;
3026
+ if (columns === 0) throw new RangeError(`${caller}: a matrix needs at least one cell`);
3027
+ for (const row of node.rows) {
3028
+ if (row.length !== columns) throw new RangeError(`${caller}: every matrix row needs ${columns} cells`);
3029
+ for (const cell of row) validate(cell, caller);
3030
+ }
3031
+ break;
3032
+ }
3033
+ case "accent":
3034
+ validate(node.body, caller);
3035
+ break;
3036
+ case "function":
3037
+ validate(node.name, caller);
3038
+ validate(node.body, caller);
3039
+ break;
3040
+ case "lowerLimit":
3041
+ case "upperLimit":
3042
+ validate(node.base, caller);
3043
+ validate(node.limit, caller);
3044
+ break;
3045
+ default: throw new TypeError(`${caller}: unknown math node kind ${JSON.stringify(node.kind)}`);
3046
+ }
3047
+ };
3048
+ /** Builds the paragraph child that holds `spec`: an equation with its text fallback. */
3049
+ const buildEquation = (spec, caller, images) => {
3050
+ validate(spec.equation, caller);
3051
+ const ctx = {
3052
+ format: spec.format,
3053
+ caller,
3054
+ images
3055
+ };
3056
+ const oMath = elem(m$1("oMath"), { children: spec.equation.map((node) => nodeElement(node, ctx)) });
3057
+ const zone = elem(NAME_A14_M, { children: [spec.display === true ? elem(m$1("oMathPara"), {
3058
+ prefixDecls: new Map([["m", NS.math]]),
3059
+ children: [oMath]
3060
+ }) : {
3061
+ ...oMath,
3062
+ prefixDecls: new Map([["m", NS.math]])
3063
+ }] });
3064
+ const fallbackPr = elem(NAME_A_RPR$3);
3065
+ if (spec.format !== void 0) applyRunFormat(fallbackPr, spec.format, caller, images);
3066
+ return elem(NAME_ALTERNATE_CONTENT$1, {
3067
+ prefixDecls: new Map([["mc", NS.mc]]),
3068
+ children: [elem(NAME_CHOICE$1, {
3069
+ attrs: [attr(ATTR_REQUIRES$1, "a14")],
3070
+ prefixDecls: new Map([["a14", NS.a14]]),
3071
+ children: [zone]
3072
+ }), elem(NAME_FALLBACK$1, { children: [elem(NAME_A_R$1, { children: [fallbackPr, textElement(NAME_A_T$1, linear(spec.equation))] })] })]
3073
+ });
3074
+ };
3075
+ //#endregion
2785
3076
  //#region src/internal/drawingml/text-body-mutation.ts
2786
3077
  const NAME_BU_CHAR = qname("a", "buChar", NS.dml);
2787
3078
  const NAME_BU_AUTO_NUM = qname("a", "buAutoNum", NS.dml);
@@ -3188,6 +3479,10 @@ const buildTextBodyParagraphs = (paragraphs, caller = "setShapeParagraphs", imag
3188
3479
  const children = [];
3189
3480
  if (para.align !== void 0) children.push(elem(NAME_PPR$1, { attrs: [attr(ATTR_ALGN, alignToken(para.align, caller))] }));
3190
3481
  for (const run of para.runs) {
3482
+ if ("equation" in run) {
3483
+ children.push(buildEquation(run, caller, embedder));
3484
+ continue;
3485
+ }
3191
3486
  const rPr = elem(NAME_RPR$6);
3192
3487
  if (run.format !== void 0) applyRunFormat(rPr, run.format, caller, embedder);
3193
3488
  const lines = run.text.split(RUN_LINE_BREAK);
@@ -25735,7 +26030,8 @@ const NV_BY_KIND = {
25735
26030
  graphicFrame: NAME_NV_GRAPHIC_FRAME_PR$2,
25736
26031
  connector: NAME_NV_CXN_SP_PR$1
25737
26032
  };
25738
- const classify = (element) => {
26033
+ /** The shape kind of a shape-tree child, or `null` for anything that is not a shape. */
26034
+ const classifyShapeElement = (element) => {
25739
26035
  if (element.name.namespaceURI !== NS.pml) return null;
25740
26036
  switch (element.name.localName) {
25741
26037
  case "sp": return "shape";
@@ -25785,16 +26081,28 @@ const extractShape = (element, kind) => {
25785
26081
  element
25786
26082
  };
25787
26083
  };
25788
- const collectShapes = (spTree, out, recurseIntoGroups) => {
25789
- for (const child of spTree.children) {
26084
+ const UNDERSTOOD_CHOICES = new Set([NS.a14]);
26085
+ const collectShapes = (container, out, recurseIntoGroups, scope) => {
26086
+ for (const child of container.children) {
25790
26087
  if (child.kind !== "element") continue;
25791
- const kind = classify(child);
26088
+ if (isAlternateContent(child)) {
26089
+ const branch = selectAlternateContentBranch(child, UNDERSTOOD_CHOICES, scope);
26090
+ if (branch !== null) collectShapes(branch, out, recurseIntoGroups, withPrefixDecls(withPrefixDecls(scope, child), branch));
26091
+ continue;
26092
+ }
26093
+ const kind = classifyShapeElement(child);
25792
26094
  if (kind === null) continue;
25793
26095
  out.push(extractShape(child, kind));
25794
- if (kind === "group" && recurseIntoGroups) collectShapes(child, out, recurseIntoGroups);
26096
+ if (kind === "group" && recurseIntoGroups) collectShapes(child, out, recurseIntoGroups, withPrefixDecls(scope, child));
25795
26097
  }
25796
26098
  };
25797
26099
  /**
26100
+ * The shape elements an `mc:AlternateContent` in a shape tree holds, across
26101
+ * all its branches. Edits that move or reposition the wrapped shape apply to
26102
+ * each, so every reader sees the same result.
26103
+ */
26104
+ const alternateContentShapes = (alternateContent) => alternateContent.children.flatMap((branch) => branch.kind === "element" && branch.name.namespaceURI === NS.mc ? branch.children.filter((child) => child.kind === "element" && classifyShapeElement(child) !== null) : []);
26105
+ /**
25798
26106
  * Reads the immediate child shapes of a `<p:grpSp>` (group shape)
25799
26107
  * without recursing further. Used by `getGroupChildren` on the public
25800
26108
  * surface to expose group contents to renderers.
@@ -25804,7 +26112,7 @@ const collectShapes = (spTree, out, recurseIntoGroups) => {
25804
26112
  const readGroupChildren = (element) => {
25805
26113
  if (element.name.namespaceURI !== NS.pml || element.name.localName !== "grpSp") throw new Error(`readGroupChildren: expected <p:grpSp>, got <${element.name.prefix}:${element.name.localName}>`);
25806
26114
  const out = [];
25807
- collectShapes(element, out, false);
26115
+ collectShapes(element, out, false, element.prefixDecls);
25808
26116
  return out;
25809
26117
  };
25810
26118
  /**
@@ -25819,7 +26127,8 @@ const readShapeTreeFromCsldRoot = (root, expectedLocalName, options = {}) => {
25819
26127
  const spTree = firstChildElement(cSld, NAME_SP_TREE$3);
25820
26128
  if (spTree === null) throw new Error("<p:cSld>: missing <p:spTree>");
25821
26129
  const shapes = [];
25822
- collectShapes(spTree, shapes, options.recurseIntoGroups ?? true);
26130
+ const scope = withPrefixDecls(withPrefixDecls(root.prefixDecls, cSld), spTree);
26131
+ collectShapes(spTree, shapes, options.recurseIntoGroups ?? true, scope);
25823
26132
  return {
25824
26133
  shapes,
25825
26134
  cSld
@@ -31914,14 +32223,43 @@ const setOpcDefault = (pkg, extension, contentType) => {
31914
32223
  });
31915
32224
  };
31916
32225
  /** Locate the owning slide/group container without descending into shape content. */
31917
- const findShapeParent = (shape) => {
32226
+ /**
32227
+ * Whether `node` is a shape in a shape tree's child list: a shape element, or
32228
+ * an `mc:AlternateContent` holding one in its branches (the shape the reader
32229
+ * enumerates is in one of them).
32230
+ */
32231
+ const isShapeSlot = (node) => node.kind === "element" && (classifyShapeElement(node) !== null || isAlternateContent(node) && alternateContentShapes(node).length > 0);
32232
+ /** The shape elements a slot holds: the slot itself, or every branch's shape. */
32233
+ const shapesInSlot = (slot) => isAlternateContent(slot) ? alternateContentShapes(slot) : [slot];
32234
+ /** Maps each shape element held by `container`'s slots to that slot. */
32235
+ const shapeSlotsIn = (container) => {
32236
+ const slots = /* @__PURE__ */ new Map();
32237
+ for (const child of container.children) {
32238
+ if (!isShapeSlot(child)) continue;
32239
+ for (const shape of shapesInSlot(child)) slots.set(shape, child);
32240
+ }
32241
+ return slots;
32242
+ };
32243
+ const isGroupElement = (node) => node.kind === "element" && node.name.namespaceURI === NS.pml && node.name.localName === "grpSp";
32244
+ /**
32245
+ * The container (`p:spTree` or `p:grpSp`) holding the shape and the slot it
32246
+ * occupies there: the shape element, or the `mc:AlternateContent` wrapping it.
32247
+ * Structural edits (remove, reorder, group, copy) move the slot, so the
32248
+ * wrapper and its other branches go along with the shape.
32249
+ */
32250
+ const findShapeSlot = (shape) => {
31918
32251
  const stack = [requireSpTree(shape[SHAPE_SLIDE])];
31919
32252
  const target = shape[SHAPE_ELEMENT];
31920
32253
  while (stack.length) {
31921
32254
  const parent = stack.pop();
31922
32255
  for (const child of parent.children) {
31923
- if (child === target) return parent;
31924
- if (child.kind === "element" && child.name.namespaceURI === NS.pml && child.name.localName === "grpSp") stack.push(child);
32256
+ if (!isShapeSlot(child)) continue;
32257
+ const held = shapesInSlot(child);
32258
+ if (held.includes(target)) return {
32259
+ parent,
32260
+ slot: child
32261
+ };
32262
+ stack.push(...held.filter(isGroupElement));
31925
32263
  }
31926
32264
  }
31927
32265
  return null;
@@ -32990,6 +33328,203 @@ const readBulletStyleLayer = (pPr, resolveColor) => {
32990
33328
  return out;
32991
33329
  };
32992
33330
  //#endregion
33331
+ //#region src/api/fn/_omml-read.ts
33332
+ const m = (localName) => qname("m", localName, NS.math);
33333
+ const NAME_VAL$1 = m("val");
33334
+ const NAME_A_RPR$2 = qname("a", "rPr", NS.dml);
33335
+ const STYLE_BY_STY = {
33336
+ p: "plain",
33337
+ b: "bold",
33338
+ i: "italic",
33339
+ bi: "boldItalic"
33340
+ };
33341
+ const FRACTION_TYPES = {
33342
+ bar: "bar",
33343
+ skw: "skewed",
33344
+ lin: "linear",
33345
+ noBar: "noBar"
33346
+ };
33347
+ const DEFAULT_DELIMITER_OPEN = "(";
33348
+ const DEFAULT_DELIMITER_CLOSE = ")";
33349
+ const DEFAULT_DELIMITER_SEPARATOR = "|";
33350
+ const DEFAULT_NARY_OPERATOR = "∫";
33351
+ const DEFAULT_ACCENT = "̂";
33352
+ const isMath = (node) => node.kind === "element" && node.name.namespaceURI === NS.math;
33353
+ const childOf = (parent, localName) => parent === null ? null : firstChildElement(parent, m(localName));
33354
+ const childrenOf = (parent, localName) => parent.children.filter((child) => isMath(child) && child.name.localName === localName);
33355
+ const valOf = (parent, localName) => {
33356
+ const el = childOf(parent, localName);
33357
+ return el === null ? null : getAttrValue(el, NAME_VAL$1);
33358
+ };
33359
+ const flagOf = (parent, localName) => {
33360
+ const el = childOf(parent, localName);
33361
+ if (el === null) return false;
33362
+ const value = getAttrValue(el, NAME_VAL$1);
33363
+ return value === null || value === "on" || value === "1" || value === "true";
33364
+ };
33365
+ const charOf = (props, localName, fallback) => {
33366
+ const el = childOf(props, localName);
33367
+ if (el === null) return fallback;
33368
+ return getAttrValue(el, NAME_VAL$1) ?? "";
33369
+ };
33370
+ const runText = (run) => {
33371
+ let out = "";
33372
+ for (const t of childrenOf(run, "t")) for (const c of t.children) if (c.kind === "text" || c.kind === "cdata") out += c.data;
33373
+ return out;
33374
+ };
33375
+ /** Plain text of every `<m:t>` under `el`, in document order. */
33376
+ const mathPlainText = (el) => {
33377
+ let out = "";
33378
+ for (const child of el.children) {
33379
+ if (child.kind !== "element") continue;
33380
+ if (child.name.namespaceURI === NS.math && child.name.localName === "t") {
33381
+ for (const c of child.children) if (c.kind === "text" || c.kind === "cdata") out += c.data;
33382
+ } else out += mathPlainText(child);
33383
+ }
33384
+ return out;
33385
+ };
33386
+ const readArg = (parent, localName) => {
33387
+ const el = childOf(parent, localName);
33388
+ return el === null ? [] : readMathNodes(el);
33389
+ };
33390
+ const readRun = (run) => {
33391
+ const sty = valOf(childOf(run, "rPr"), "sty");
33392
+ const aRPr = firstChildElement(run, NAME_A_RPR$2);
33393
+ const style = sty === null ? void 0 : STYLE_BY_STY[sty];
33394
+ return {
33395
+ kind: "text",
33396
+ text: runText(run),
33397
+ ...style !== void 0 ? { style } : {},
33398
+ format: aRPr === null ? null : parseRPrLikeElement(aRPr)
33399
+ };
33400
+ };
33401
+ const readNode = (el) => {
33402
+ switch (el.name.localName) {
33403
+ case "r": return readRun(el);
33404
+ case "f": return {
33405
+ kind: "fraction",
33406
+ type: FRACTION_TYPES[valOf(childOf(el, "fPr"), "type") ?? "bar"] ?? "bar",
33407
+ numerator: readArg(el, "num"),
33408
+ denominator: readArg(el, "den")
33409
+ };
33410
+ case "sSub": return {
33411
+ kind: "subscript",
33412
+ base: readArg(el, "e"),
33413
+ sub: readArg(el, "sub")
33414
+ };
33415
+ case "sSup": return {
33416
+ kind: "superscript",
33417
+ base: readArg(el, "e"),
33418
+ sup: readArg(el, "sup")
33419
+ };
33420
+ case "sSubSup": return {
33421
+ kind: "subSuperscript",
33422
+ base: readArg(el, "e"),
33423
+ sub: readArg(el, "sub"),
33424
+ sup: readArg(el, "sup")
33425
+ };
33426
+ case "rad": return {
33427
+ kind: "radical",
33428
+ degree: flagOf(childOf(el, "radPr"), "degHide") ? null : readArg(el, "deg"),
33429
+ body: readArg(el, "e")
33430
+ };
33431
+ case "nary": {
33432
+ const props = childOf(el, "naryPr");
33433
+ const limLoc = valOf(props, "limLoc");
33434
+ return {
33435
+ kind: "nary",
33436
+ operator: charOf(props, "chr", DEFAULT_NARY_OPERATOR),
33437
+ ...limLoc === "undOvr" ? { limitLocation: "underOver" } : limLoc === "subSup" ? { limitLocation: "subSup" } : {},
33438
+ sub: flagOf(props, "subHide") ? null : readArg(el, "sub"),
33439
+ sup: flagOf(props, "supHide") ? null : readArg(el, "sup"),
33440
+ body: readArg(el, "e")
33441
+ };
33442
+ }
33443
+ case "d": {
33444
+ const props = childOf(el, "dPr");
33445
+ return {
33446
+ kind: "delimiter",
33447
+ open: charOf(props, "begChr", DEFAULT_DELIMITER_OPEN),
33448
+ close: charOf(props, "endChr", DEFAULT_DELIMITER_CLOSE),
33449
+ separator: charOf(props, "sepChr", DEFAULT_DELIMITER_SEPARATOR),
33450
+ items: childrenOf(el, "e").map(readMathNodes)
33451
+ };
33452
+ }
33453
+ case "m": return {
33454
+ kind: "matrix",
33455
+ rows: childrenOf(el, "mr").map((row) => childrenOf(row, "e").map(readMathNodes))
33456
+ };
33457
+ case "acc": return {
33458
+ kind: "accent",
33459
+ accent: charOf(childOf(el, "accPr"), "chr", DEFAULT_ACCENT),
33460
+ body: readArg(el, "e")
33461
+ };
33462
+ case "func": return {
33463
+ kind: "function",
33464
+ name: readArg(el, "fName"),
33465
+ body: readArg(el, "e")
33466
+ };
33467
+ case "limLow":
33468
+ case "limUpp": return {
33469
+ kind: el.name.localName === "limLow" ? "lowerLimit" : "upperLimit",
33470
+ base: readArg(el, "e"),
33471
+ limit: readArg(el, "lim")
33472
+ };
33473
+ case "ctrlPr":
33474
+ case "argPr":
33475
+ case "oMathParaPr": return null;
33476
+ default: return {
33477
+ kind: "unsupported",
33478
+ element: el.name.localName,
33479
+ text: mathPlainText(el)
33480
+ };
33481
+ }
33482
+ };
33483
+ /** Reads the content children of an OMML argument or `<m:oMath>`. */
33484
+ const readMathNodes = (parent) => {
33485
+ const out = [];
33486
+ for (const child of parent.children) {
33487
+ if (!isMath(child)) continue;
33488
+ const node = readNode(child);
33489
+ if (node !== null) out.push(node);
33490
+ }
33491
+ return out;
33492
+ };
33493
+ /**
33494
+ * The equations of one `<a14:m>`: its inline `<m:oMath>`, or each
33495
+ * `<m:oMath>` of its `<m:oMathPara>`.
33496
+ */
33497
+ const mathZoneEquations = (zone) => {
33498
+ const out = [];
33499
+ for (const child of zone.children) {
33500
+ if (!isMath(child)) continue;
33501
+ if (child.name.localName === "oMath") out.push({
33502
+ display: false,
33503
+ oMath: child
33504
+ });
33505
+ else if (child.name.localName === "oMathPara") for (const oMath of childrenOf(child, "oMath")) out.push({
33506
+ display: true,
33507
+ oMath
33508
+ });
33509
+ }
33510
+ return out;
33511
+ };
33512
+ const isA14Zone = (el) => el.name.namespaceURI === NS.a14 && el.name.localName === "m";
33513
+ /**
33514
+ * The `<a14:m>` a paragraph child holds: the child itself, or the zone in an
33515
+ * `mc:AlternateContent` choice (the form the library writes), else `null`.
33516
+ */
33517
+ const equationZoneOf = (child) => {
33518
+ if (isA14Zone(child)) return child;
33519
+ if (child.name.namespaceURI !== NS.mc || child.name.localName !== "AlternateContent") return null;
33520
+ for (const choice of child.children) {
33521
+ if (choice.kind !== "element" || choice.name.namespaceURI !== NS.mc) continue;
33522
+ if (choice.name.localName !== "Choice") continue;
33523
+ for (const zone of choice.children) if (zone.kind === "element" && isA14Zone(zone)) return zone;
33524
+ }
33525
+ return null;
33526
+ };
33527
+ //#endregion
32993
33528
  //#region src/api/fn/theme.ts
32994
33529
  const THEME_CONTENT_TYPE$2 = "application/vnd.openxmlformats-officedocument.theme+xml";
32995
33530
  const NAME_THEME_ELEMENTS = qname("a", "themeElements", NS.dml);
@@ -42701,8 +43236,10 @@ const getTableCellParagraphs = (cell) => {
42701
43236
  "fld",
42702
43237
  "br"
42703
43238
  ].includes(child.name.localName));
42704
- const elements = readParagraphElements(p).map((element, index) => {
42705
- const properties = firstChildElement(inline[index], qname("a", "rPr", NS.dml));
43239
+ let inlineIndex = 0;
43240
+ const elements = readParagraphElements(p).map((element) => {
43241
+ if (element.kind === "math") return element;
43242
+ const properties = firstChildElement(inline[inlineIndex++], qname("a", "rPr", NS.dml));
42706
43243
  const link = properties ? firstChildElement(properties, qname("a", "hlinkClick", NS.dml)) : null;
42707
43244
  if (!link) return element;
42708
43245
  const clickAction = readClickAction(cell[CELL_TABLE][SHAPE_SLIDE], link);
@@ -47721,7 +48258,19 @@ const readParagraphElements = (paragraph) => {
47721
48258
  return parseRPrLikeElement(rPr);
47722
48259
  };
47723
48260
  for (const child of paragraph.children) {
47724
- if (child.kind !== "element" || child.name.namespaceURI !== NS.dml) continue;
48261
+ if (child.kind !== "element") continue;
48262
+ const zone = equationZoneOf(child);
48263
+ if (zone !== null) {
48264
+ for (const { display, oMath } of mathZoneEquations(zone)) out.push({
48265
+ kind: "math",
48266
+ text: mathPlainText(oMath),
48267
+ display,
48268
+ math: readMathNodes(oMath),
48269
+ format: null
48270
+ });
48271
+ continue;
48272
+ }
48273
+ if (child.name.namespaceURI !== NS.dml) continue;
47725
48274
  if (child.name.localName === "r") out.push({
47726
48275
  kind: "r",
47727
48276
  text: readT(child),
@@ -52308,7 +52857,7 @@ const animatedSpids = (timing) => {
52308
52857
  */
52309
52858
  const copyShape = (targetSlide, sourceShape, opts = {}) => {
52310
52859
  const sourceSlide = sourceShape[SHAPE_SLIDE];
52311
- const sourceEl = sourceShape[SHAPE_ELEMENT];
52860
+ const sourceEl = findShapeSlot(sourceShape)?.slot ?? sourceShape[SHAPE_ELEMENT];
52312
52861
  let cloned = cloneXmlElement(sourceEl);
52313
52862
  if (opts.preserveGroupTransform) {
52314
52863
  const root = requireSpTree(sourceSlide);
@@ -52317,9 +52866,9 @@ const copyShape = (targetSlide, sourceShape, opts = {}) => {
52317
52866
  while (stack.length) {
52318
52867
  const parent = stack.pop();
52319
52868
  for (const child of parent.children) {
52320
- if (child.kind !== "element" || !isShapeChild(child)) continue;
52869
+ if (!isShapeSlot(child)) continue;
52321
52870
  parents.set(child, parent);
52322
- if (child.name.localName === "grpSp") stack.push(child);
52871
+ if (child.name.namespaceURI === NS.pml && child.name.localName === "grpSp") stack.push(child);
52323
52872
  }
52324
52873
  }
52325
52874
  let branch = sourceEl;
@@ -52327,9 +52876,9 @@ const copyShape = (targetSlide, sourceShape, opts = {}) => {
52327
52876
  while (parent && parent !== root) {
52328
52877
  const wrapper = cloneXmlElement({
52329
52878
  ...parent,
52330
- children: parent.children.filter((child) => !isShapeChild(child))
52879
+ children: parent.children.filter((child) => !isShapeSlot(child))
52331
52880
  });
52332
- const insertion = parent.children.slice(0, parent.children.indexOf(branch)).filter((child) => !isShapeChild(child)).length;
52881
+ const insertion = parent.children.slice(0, parent.children.indexOf(branch)).filter((child) => !isShapeSlot(child)).length;
52333
52882
  wrapper.children.splice(insertion, 0, cloned);
52334
52883
  cloned = wrapper;
52335
52884
  branch = parent;
@@ -52376,7 +52925,7 @@ const rewriteShapeIds = (root, firstId) => {
52376
52925
  ...a,
52377
52926
  value: ids.get(a.value) ?? a.value
52378
52927
  };
52379
- const value = String(nextId++);
52928
+ const value = ids.get(a.value) ?? String(nextId++);
52380
52929
  ids.set(a.value, value);
52381
52930
  return {
52382
52931
  ...a,
@@ -52389,14 +52938,6 @@ const rewriteShapeIds = (root, firstId) => {
52389
52938
  walk(root, true);
52390
52939
  return ids;
52391
52940
  };
52392
- const SHAPE_CHILD_LOCALS = new Set([
52393
- "sp",
52394
- "pic",
52395
- "cxnSp",
52396
- "graphicFrame",
52397
- "grpSp"
52398
- ]);
52399
- const isShapeChild = (node) => node.kind === "element" && node.name?.namespaceURI === NS.pml && SHAPE_CHILD_LOCALS.has(node.name.localName);
52400
52941
  /** Move one shape or a selection in front of all siblings, preserving their stacking order. */
52401
52942
  const bringShapeToFront = (shape) => {
52402
52943
  reorderShapes(shape, "front");
@@ -52413,13 +52954,13 @@ function reorderShapes(input, direction) {
52413
52954
  const shapes = SHAPE_ELEMENT in input ? [input] : input;
52414
52955
  const first = shapes[0];
52415
52956
  if (!first) return;
52416
- const parent = findShapeParent(first);
52957
+ const parent = findShapeSlot(first)?.parent;
52417
52958
  if (!parent) return;
52418
52959
  const slide = first[SHAPE_SLIDE];
52419
- const selected = new Set(shapes.map((shape) => shape[SHAPE_ELEMENT]));
52420
- const siblings = parent.children.filter((child) => isShapeChild(child));
52421
- const siblingSet = new Set(siblings);
52422
- if (shapes.some((shape) => shape[SHAPE_SLIDE] !== slide || !siblingSet.has(shape[SHAPE_ELEMENT]))) throw new Error("Shapes must belong to the same parent container.");
52960
+ const slots = shapeSlotsIn(parent);
52961
+ const siblings = parent.children.filter(isShapeSlot);
52962
+ if (shapes.some((shape) => shape[SHAPE_SLIDE] !== slide || !slots.has(shape[SHAPE_ELEMENT]))) throw new Error("Shapes must belong to the same parent container.");
52963
+ const selected = new Set(shapes.map((shape) => slots.get(shape[SHAPE_ELEMENT])));
52423
52964
  let ordered = [...siblings];
52424
52965
  if (direction === "front" || direction === "back") {
52425
52966
  const chosen = siblings.filter((child) => selected.has(child));
@@ -52430,7 +52971,7 @@ function reorderShapes(input, direction) {
52430
52971
  } else for (let i = 1; i < ordered.length; i++) if (selected.has(ordered[i]) && !selected.has(ordered[i - 1])) [ordered[i - 1], ordered[i]] = [ordered[i], ordered[i - 1]];
52431
52972
  if (ordered.every((child, i) => child === siblings[i])) return;
52432
52973
  let index = 0;
52433
- parent.children = parent.children.map((child) => isShapeChild(child) ? ordered[index++] : child);
52974
+ parent.children = parent.children.map((child) => isShapeSlot(child) ? ordered[index++] : child);
52434
52975
  commitSlideData(slide);
52435
52976
  rebuildShapesFromDocument(slide);
52436
52977
  }
@@ -52441,15 +52982,9 @@ function reorderShapes(input, direction) {
52441
52982
  * Higher numbers render in front.
52442
52983
  */
52443
52984
  const getShapeZIndex = (shape) => {
52444
- const spTree = findShapeParent(shape);
52445
- if (!spTree) return -1;
52446
- let i = 0;
52447
- for (const c of spTree.children) {
52448
- if (!isShapeChild(c)) continue;
52449
- if (c === shape[SHAPE_ELEMENT]) return i;
52450
- i++;
52451
- }
52452
- return -1;
52985
+ const found = findShapeSlot(shape);
52986
+ if (!found) return -1;
52987
+ return found.parent.children.filter(isShapeSlot).indexOf(found.slot);
52453
52988
  };
52454
52989
  /**
52455
52990
  * Moves a shape or an ordered batch of siblings to a specific z-index.
@@ -52460,15 +52995,15 @@ const setShapeZIndex = (shape, toIndex) => {
52460
52995
  const shapes = SHAPE_ELEMENT in shape ? [shape] : shape;
52461
52996
  const first = shapes[0];
52462
52997
  if (!first) return;
52463
- const parent = findShapeParent(first);
52998
+ const parent = findShapeSlot(first)?.parent;
52464
52999
  if (!parent) return;
52465
53000
  const slide = first[SHAPE_SLIDE];
52466
- const siblings = parent.children.filter((child) => isShapeChild(child));
52467
- const siblingSet = new Set(siblings);
52468
- const chosen = shapes.map((member) => member[SHAPE_ELEMENT]);
53001
+ const slots = shapeSlotsIn(parent);
53002
+ const siblings = parent.children.filter(isShapeSlot);
53003
+ if (shapes.some((member) => member[SHAPE_SLIDE] !== slide || !slots.has(member[SHAPE_ELEMENT]))) throw new Error("Shapes must belong to the same parent container.");
53004
+ const chosen = shapes.map((member) => slots.get(member[SHAPE_ELEMENT]));
52469
53005
  const selected = new Set(chosen);
52470
53006
  if (selected.size !== chosen.length) throw new Error("Duplicate shapes are not allowed.");
52471
- if (shapes.some((member) => member[SHAPE_SLIDE] !== slide || !siblingSet.has(member[SHAPE_ELEMENT]))) throw new Error("Shapes must belong to the same parent container.");
52472
53007
  const remaining = siblings.filter((child) => !selected.has(child));
52473
53008
  const clamped = Math.max(0, Math.min(toIndex, remaining.length));
52474
53009
  const ordered = [
@@ -52478,7 +53013,7 @@ const setShapeZIndex = (shape, toIndex) => {
52478
53013
  ];
52479
53014
  if (ordered.every((child, index) => child === siblings[index])) return;
52480
53015
  let index = 0;
52481
- parent.children = parent.children.map((child) => isShapeChild(child) ? ordered[index++] : child);
53016
+ parent.children = parent.children.map((child) => isShapeSlot(child) ? ordered[index++] : child);
52482
53017
  commitSlideData(slide);
52483
53018
  rebuildShapesFromDocument(slide);
52484
53019
  };
@@ -52497,9 +53032,9 @@ const sendShapeBackward = (shape) => {
52497
53032
  const clearSlideShapes = (slide) => {
52498
53033
  const spTree = requireSpTree(slide);
52499
53034
  const removedIds = /* @__PURE__ */ new Set();
52500
- for (const child of spTree.children) if (child.kind === "element" && isShapeChild(child)) collectShapeIds(child, removedIds);
53035
+ for (const child of spTree.children) if (isShapeSlot(child)) collectShapeIds(child, removedIds);
52501
53036
  const dropAnimations = planShapeAnimationRemoval(slide, removedIds);
52502
- spTree.children = spTree.children.filter((c) => !isShapeChild(c));
53037
+ spTree.children = spTree.children.filter((c) => !isShapeSlot(c));
52503
53038
  dropAnimations();
52504
53039
  removeMediaTimingNodes(slide, removedIds);
52505
53040
  commitSlideData(slide);
@@ -52514,12 +53049,12 @@ const clearSlideShapes = (slide) => {
52514
53049
  */
52515
53050
  const removeShape = (shape) => {
52516
53051
  const slide = shape[SHAPE_SLIDE];
52517
- const spTree = findShapeParent(shape);
52518
- if (!spTree) return;
52519
- const idx = spTree.children.indexOf(shape[SHAPE_ELEMENT]);
52520
- if (idx < 0) return;
53052
+ const found = findShapeSlot(shape);
53053
+ if (!found) return;
53054
+ const spTree = found.parent;
53055
+ const idx = spTree.children.indexOf(found.slot);
52521
53056
  const removedIds = /* @__PURE__ */ new Set();
52522
- collectShapeIds(shape[SHAPE_ELEMENT], removedIds);
53057
+ collectShapeIds(found.slot, removedIds);
52523
53058
  const dropAnimations = planShapeAnimationRemoval(slide, removedIds);
52524
53059
  spTree.children.splice(idx, 1);
52525
53060
  dropAnimations();
@@ -55253,7 +55788,13 @@ const getShapeTextLanguage = (shape) => {
55253
55788
  const getParagraphElementLanguages = (target, paragraphIndex) => {
55254
55789
  const languages = [];
55255
55790
  for (const child of requireParagraph(target, paragraphIndex).children) {
55256
- if (child.kind !== "element" || child.name.namespaceURI !== NS.dml) continue;
55791
+ if (child.kind !== "element") continue;
55792
+ const zone = equationZoneOf(child);
55793
+ if (zone !== null) {
55794
+ for (const _ of mathZoneEquations(zone)) languages.push(null);
55795
+ continue;
55796
+ }
55797
+ if (child.name.namespaceURI !== NS.dml) continue;
55257
55798
  if (!RUN_CONTAINERS.has(child.name.localName)) continue;
55258
55799
  const properties = firstChildElement(child, NAME_RPR);
55259
55800
  languages.push(properties ? getAttrValue(properties, ATTR_LANG) : null);
@@ -55329,9 +55870,9 @@ const setShapeStyle = (shape, options) => {
55329
55870
  const groupShapes = (shapes, opts = {}) => {
55330
55871
  if (shapes.length < 2) throw new Error("groupShapes: at least 2 shapes are required");
55331
55872
  const slide = shapes[0][SHAPE_SLIDE];
55332
- const spTree = findShapeParent(shapes[0]);
55873
+ const spTree = findShapeSlot(shapes[0])?.parent;
55333
55874
  if (!spTree) throw new Error("groupShapes: shape is not attached to the slide");
55334
- const siblings = new Set(spTree.children);
55875
+ const slots = shapeSlotsIn(spTree);
55335
55876
  const seen = /* @__PURE__ */ new Set();
55336
55877
  let minX = Number.POSITIVE_INFINITY;
55337
55878
  let minY = Number.POSITIVE_INFINITY;
@@ -55340,9 +55881,10 @@ const groupShapes = (shapes, opts = {}) => {
55340
55881
  for (const shape of shapes) {
55341
55882
  if (shape[SHAPE_SLIDE] !== slide) throw new Error("groupShapes: all shapes must belong to the same slide");
55342
55883
  const el = shape[SHAPE_ELEMENT];
55343
- if (seen.has(el)) throw new Error(`groupShapes: shape "${shape[SHAPE_SNAPSHOT].name}" was passed twice`);
55344
- seen.add(el);
55345
- if (!siblings.has(el)) throw new Error(`groupShapes: shape "${shape[SHAPE_SNAPSHOT].name}" is not a direct child of the same parent as the other shapes`);
55884
+ const slot = slots.get(el);
55885
+ if (slot === void 0) throw new Error(`groupShapes: shape "${shape[SHAPE_SNAPSHOT].name}" is not a direct child of the same parent as the other shapes`);
55886
+ if (seen.has(slot)) throw new Error(`groupShapes: shape "${shape[SHAPE_SNAPSHOT].name}" was passed twice`);
55887
+ seen.add(slot);
55346
55888
  const kind = shape[SHAPE_SNAPSHOT].kind;
55347
55889
  const pos = readPosition$1(el, kind);
55348
55890
  const size = readSize(el, kind);
@@ -55400,12 +55942,17 @@ const ungroupShapes = (group) => {
55400
55942
  const centerX = outer.x + outer.w / 2;
55401
55943
  const centerY = outer.y + outer.h / 2;
55402
55944
  const slide = group[SHAPE_SLIDE];
55403
- const spTree = findShapeParent(group);
55404
- if (!spTree) throw new Error("ungroupShapes: group is not attached to the slide");
55405
- const groupEl = group[SHAPE_ELEMENT];
55406
- const idx = spTree.children.indexOf(groupEl);
55407
- if (idx < 0) throw new Error("ungroupShapes: group is not attached to the slide");
55408
- const childElements = readGroupChildren(groupEl).map((child) => {
55945
+ const found = findShapeSlot(group);
55946
+ if (!found) throw new Error("ungroupShapes: group is not attached to the slide");
55947
+ const spTree = found.parent;
55948
+ const idx = spTree.children.indexOf(found.slot);
55949
+ const slots = group[SHAPE_ELEMENT].children.filter(isShapeSlot);
55950
+ const moved = slots.flatMap(shapesInSlot);
55951
+ for (const element of moved) {
55952
+ const child = {
55953
+ element,
55954
+ kind: classifyShapeElement(element)
55955
+ };
55409
55956
  const pos = readPosition$1(child.element, child.kind);
55410
55957
  const size = readSize(child.element, child.kind);
55411
55958
  if (pos !== null && size !== null) {
@@ -55425,17 +55972,12 @@ const ungroupShapes = (group) => {
55425
55972
  });
55426
55973
  }
55427
55974
  }
55428
- return child.element;
55429
- });
55430
- spTree.children.splice(idx, 1, ...childElements);
55975
+ }
55976
+ spTree.children.splice(idx, 1, ...slots);
55431
55977
  commitSlideData(slide);
55432
55978
  rebuildShapesFromDocument(slide);
55433
- const byElement = new Map(slide[SLIDE_SHAPES].map((s) => [s[SHAPE_ELEMENT], s]));
55434
- return childElements.map((el) => {
55435
- const found = byElement.get(el);
55436
- if (!found) throw new Error("ungroupShapes: post-condition failed");
55437
- return found;
55438
- });
55979
+ const movedSet = new Set(moved);
55980
+ return slide[SLIDE_SHAPES].filter((s) => movedSet.has(s[SHAPE_ELEMENT]));
55439
55981
  };
55440
55982
  //#endregion
55441
55983
  //#region src/api/fn/shape-picture-style.ts
@@ -56245,8 +56787,8 @@ const getShapeImageIntrinsicSize = (shape) => {
56245
56787
  };
56246
56788
  //#endregion
56247
56789
  //#region src/api/index.ts
56248
- const VERSION = "0.28.0";
56790
+ const VERSION = "0.30.0";
56249
56791
  //#endregion
56250
56792
  export { swapSlides as $, findSlidesByLayoutName as $a, getPresentationChartKindCounts as $c, getShapeStroke as $i, getSlideLayoutUsageCounts as $l, clearShapeEffects as $n, getSlideNotesParagraphEndFormat as $o, getShapeName as $r, getTableCellText as $s, isSlideLayoutBackgroundGraphicsHidden as $t, isShapeAspectRatioLocked as A, setParagraphAlignment as Aa, splitTableCell as Ac, setShapeFlip as Ai, getSlideMasterBackgroundImageBytes as Al, getShapeTextAutoFit as An, appendSlideNotes as Ao, getSlideShapes as Ar, getPackageSize as As, findSlidesByNotes as At, getPresentationCommenters as Au, addContentSlide as B, getSlideBody as Ba, setExtendedProperties as Bc, setShapeSlideBackgroundFill as Bi, getShapeGradientFillEffective as Bl, setShapeParagraphs as Bn, getAllImages as Bo, getMaxShapeId as Br, getSlideTables as Bs, getSlideCount as Bt, createPresentation as Bu, groupShapes as C, getShapeParagraphElements as Ca, setTableCellText as Cc, clearShapeStroke as Ci, getSlideLayoutBackgroundGradientFill as Cl, moveSlideAnimation as Cn, setShapeImageRecolor as Co, findSlidePlaceholderByIdx as Cr, getShapeMedia as Cs, setSlideMasterPlaceholderIncluded as Ct, getCommentPosition as Cu, getShapeTextLanguage as D, getShapeRunHyperlinkTooltip as Da, setTableRowHeight as Dc, getShapeStrokeSketch as Di, getSlideLayoutShapes as Dl, getShapeBodyPrEffective as Dn, getPresentationFirstSlideNumber as Do, getShapeXmlString as Dr, compactPackage as Ds, findSlideByPartName as Dt, getCommentsSortedByDate as Du, getParagraphElementLanguages as E, getShapeRunHyperlink as Ea, setTableColumnWidth as Ec, getShapeStrokeDash as Ei, getSlideLayoutBackgroundShapes as El, appendShapeText as En, SLIDE_SIZE_4_3 as Eo, getShapeSlide as Er, _internalPackageOf as Es, setSlideSections as Et, getCommentText as Eu, addSlidePlaceholder as F, setParagraphSpacing as Fa, getExtendedProperties as Fc, setShapePatternFill as Fi, setSlideBackgroundImage as Fl, getShapeTextFlat as Fn, findSlidesWithChartKind as Fo, centerShapeOnSlide as Fr, setMediaPartBytes as Fs, getPresentationText as Ft, setCommentText as Fu, duplicateSlide as G, clearSlideAnimations as Ga, setShapeHyperlink as Gc, setShapeStrokeDash as Gi, findLayoutsWithPlaceholderType as Gl, setShapeTextBodyRotationDeg as Gn, getHiddenSlides as Go, getShapeBounds as Gr, getTableCellAppearanceEffective as Gs, getSlidePartName as Gt, BUILTIN_PICTURE_STYLES as Gu, addSlide as H, setSlideBody as Ha, getParagraphPropertiesEffective as Hc, setShapeStrokeArrow as Hi, setSlideLayoutBackground as Hl, setShapeText3D as Hn, getAllTables as Ho, getPresetGeometry as Hr, getTableCell as Hs, getSlideInfo as Ht, savePresentation as Hu, resetSlideLayout as I, setParagraphTabs as Ia, getPresentationCreated as Ic, setShapePosition as Ii, setSlideBackgroundImageFillLayout as Il, getShapeTextMargins as In, findSlidesWithChartTrendlines as Io, findShapesAtPoint as Ir, slidesUsingMediaPart as Is, getPresentationTextLength as It, getPresentationFonts as Iu, mergePresentations as J, getSlideAnimations as Ja, findChartByKind as Jc, getShapeFill as Ji, findSlideLayoutByType as Jl, setShapeTextField as Jn, getPresentationNotesLengthsBySlide as Jo, getShapeCustomGeometry as Jr, getTableCellMargins as Js, getSlideXmlString as Jt, cm as Ju, duplicateSlideAt as K, findShapesWithAnimation as Ka, setShapeRunFormat as Kc, setShapeStrokeJoin as Ki, findSlideLayout as Kl, setShapeTextColumns as Kn, getPresentationHyperlinkCountsBySlide as Ko, getShapeBoundsResolved as Kr, getTableCellBorders as Ks, getSlideText as Kt, toWritableTextFormat as Ku, resetSlidePlaceholderGeometry as L, setParagraphTypography as La, getPresentationModified as Lc, setShapePreset as Li, setSlideBackgroundImageOpacity as Ll, getShapeTextWrap as Ln, getAllCharts as Lo, findShapesInRect as Lr, validatePresentation as Ls, getPresentationTextLengthsBySlide as Lt, getPresentationTheme as Lu, setShapeAspectRatioLocked as M, setParagraphIndent as Ma, removeThumbnail as Mc, setShapeImageFill as Mi, getSlideMasterShapes as Ml, getShapeTextBodyRotationDeg as Mn, clearAllSlideNotes as Mo, replaceTokensInSlide as Mr, getSlideMediaPartNames as Ms, getAllShapes as Mt, getSlideComments as Mu, setShapeLocked as N, setParagraphLevel as Na, setThumbnail as Nc, setShapeNoFill as Ni, setSlideBackground as Nl, getShapeTextColumns as Nn, clearSlideHyperlinks as No, setSlideLayout as Nr, listPackageParts as Ns, getOutlineText as Nt, removeSlideComment as Nu, setShapeTextLanguage as O, getShapeRunText as Oa, setTableStyleFlags as Oc, setShapeAdjustValues as Oi, getSlideMasterBackground as Ol, getShapeText3D as On, getSlideSize as Oo, getShapesBounds as Or, getMediaParts as Os, findSlideByText as Ot, getPresentationCommentCountsByAuthor as Ou, addMissingSlidePlaceholders as P, setParagraphLineSpacing as Pa, getCoreProperties as Pc, setShapeNoStroke as Pi, setSlideBackgroundGradientFill as Pl, getShapeTextDirection as Pn, findSlidesByHyperlink as Po, translateShapes as Pr, readPackagePart as Ps, getPresentationShapeCountsBySlide as Pt, setCommentStatus as Pu, sortSlides as Q, findShapesOutsideCanvas as Qa, getPresentationChartCountsBySlide as Qc, getShapeFillOpacity as Qi, getSlideLayoutType as Ql, setShapeTextWrap as Qn, getSlideNotesLineBreaks as Qo, getShapeKind as Qr, getTableCellSpan as Qs, isSlideHidden as Qt, pt as Qu, resetSlidePlaceholderTextFormatting as R, setShapeRunHyperlink as Ra, incrementRevision as Rc, setShapeRotation as Ri, setSlideBackgroundPatternFill as Rl, setShapeAlignment as Rn, getAllComments as Ro, getGroupChildren as Rr, clearTableCellFill as Rs, getShapeAt as Rt, setPresentationFonts as Ru, setShapePictureStyle as S, getShapeParagraphCount as Sa, setTableCellParagraphs as Sc, clearShapeFill as Si, getSlideLayoutBackground as Sl, setShapeZIndex as Sn, setShapeImageOpacity as So, findSlidePlaceholder as Sr, findShapesWithMedia as Ss, setSlideMasterName as St, getCommentParent as Su, setShapeStyle as T, getShapeRunCount as Ta, setTableCellTextFormat as Tc, getShapeStrokeArrow as Ti, getSlideLayoutBackgroundPatternFill as Tl, updateSlideAnimation as Tn, SLIDE_SIZE_16_9 as To, getShapeIndex as Tr, setShapeMediaPlayback as Ts, getSlideSections as Tt, getCommentStatus as Tu, addSlideAt as U, setSlidePlaceholders as Ua, getShapeHyperlink as Uc, setShapeStrokeCap as Ui, setSlideLayoutName as Ul, setShapeTextAnchor as Un, getDistinctHyperlinkUrls as Uo, getShapeAdjustValues as Ur, getTableCellAlignment as Us, getSlideLayoutCount as Ut, COMMENT_STATUSES as Uu, addSectionHeaderSlide as V, getSlideTitle as Va, touchModified as Vc, setShapeStroke as Vi, clearSlideLayoutBackground as Vl, setShapeText as Vn, getAllNotes as Vo, getMaxShapeIdInPresentation as Vr, getTableBackgroundEffective as Vs, getSlideIndex as Vt, loadPresentation as Vu, addTitleSlide as W, setSlideTitle as Wa, getShapeRunFormatEffective as Wc, setShapeStrokeCompound as Wi, setSlideLayoutPlaceholderBounds as Wl, setShapeTextAutoFit as Wn, getEmptySlides as Wo, getShapeAltTitle as Wr, getTableCellAnchor as Ws, getSlideOutline as Wt, BUILTIN_TABLE_STYLES as Wu, removeSlide as X, findFlippedShapes as Xa, findChartsWithDataLabels as Xc, getShapeFillColorResolved as Xi, getSlideLayoutPartName$1 as Xl, setShapeTextFormat as Xn, getSlideNotes as Xo, getShapeFlip as Xr, getTableCellPosition as Xs, getSlidesByLayout as Xt, inches as Xu, moveSlide as Y, setShapeAnimation as Ya, findChartsBySeriesName as Yc, getShapeFillColor as Yi, getSlideLayoutName as Yl, setShapeTextFlat as Yn, getPresentationNotesText as Yo, getShapeDescription as Yr, getTableCellParagraphs as Ys, getSlides as Yt, emu as Yu, reverseSlides as Z, findOverlappingShapePairs as Za, findChartsWithTrendlines as Zc, getShapeFillEffective as Zi, getSlideLayoutPlaceholders as Zl, setShapeTextMargins as Zn, getSlideNotesLength as Zo, getShapeId as Zr, getTableCellRunFormatEffective as Zs, isSlideBackgroundGraphicsHidden as Zt, mm as Zu, setSlideMasterBackgroundStyle as _, getParagraphIndent as _a, setTableCellAnchor as _c, setShapeAltTitle as _i, getSlideBackgroundImageFillLayout as _l, copyShape as _n, isShapeImageGrayscale as _o, findShapesByKind as _r, getSlideTransition as _s, removeSlideLayout as _t, findSlidesWithCommentsByAuthor as _u, getPresentationTextReview as a, getShapeStrokeGradient as aa, getTableRowHeights as ac, getShapeSize as ai, getSlideCharts as al, searchSlides as an, getShapeImageBrightness as ao, setShape3D as ar, getSlidesWithNotes as as, setHandoutSlidesPerPage as at, setShapeClickAction as au, getShapePictureStyle as b, getParagraphSpacing as ba, setTableCellFill as bc, setShapeHidden as bi, getSlideBackgroundPatternFill as bl, sendShapeBackward as bn, setShapeImageContrast as bo, findShapesByText as br, setSlideTransitionSound as bs, setSlideLayoutFootersIncluded as bt, getCommentDate as bu, getDrawingGuidesVisible as c, getShapeStrokeWidth as ca, getTableStyleId as cc, getSlideMasterPartName as ci, getEffectiveColorMap as cl, slideHasAnimations as cn, getShapeImageCrop as co, setShapeReflection as cr, getVisibleSlides as cs, getSlideShowProperties as ct, setShapeImage as cu, setDrawingGuides as d, resolveDrawingColorOpacity as da, isChartShape as dc, getUnusedSlideMasters as di, clearSlideBackground as dl, addSlideShape as dn, getShapeImageFormat as do, findEmptyPlaceholders as dr, replaceHyperlink as ds, addSlideLayoutPlaceholder as dt, clearSlideComments as du, getShapeStrokeCap as ea, getTableCellText3D as ec, getShapePlaceholderIdx as ei, getShapeChartCategories as el, replaceTextInNotes as en, findSlidesByLayoutPartName as eo, findShapesByEffect as er, getSlideNotesTextFormats as es, getHandoutMasterPlaceholders as et, getSlideLayoutUsageCountsByType as eu, setDrawingGuidesVisible as f, getParagraphAlignment as fa, isTableShape as fc, isShapeHidden as fi, copySlideBackground as fl, addSlideTable as fn, getShapeImageLinkUrl as fo, findShapeById as fr, resolveSlideNotesTextColor as fs, addSlideMaster as ft, findCommentAuthorByName as fu, getSlideMasterBackgroundStyles as g, getParagraphEndFormat as ga, setTableCellAlignment as gc, renameShape as gi, getSlideBackgroundImageCrop as gl, clearSlideShapes as gn, hasShapeText as go, findShapesByHyperlink as gr, clearSlideTransition as gs, isSlideMasterPreserved as gt, findCommentsByText as gu, setSnapToGrid as h, getParagraphBulletStyle as ha, removeTableRow as hc, pointInShape as hi, getSlideBackgroundImageBytes as hl, bringShapeToFront as hn, hasShapeImage as ho, findShapeInPresentation as hr, transformSlideNotesCase as hs, getSlideMasterPlaceholders as ht, findCommentsByAuthor as hu, setShapeImageFillLayout as i, getShapeStrokeEffective as ia, getTableDimensions as ic, getShapeRotation as ii, getShapeChartSpec as il, replaceTokensInPresentation as in, getShapeImageBiLevelThreshold as io, getShapeEffectsEffective as ir, getSlidesWithImages as is, setHandoutMasterPlaceholderIncluded as it, getShapeClickAction as iu, isShapeLocked as j, setParagraphBullet as ja, getThumbnail as jc, setShapeGradientFill as ji, getSlideMasterBackgroundPatternFill as jl, getShapeTextAutoFitParams as jn, clearAllHyperlinks as jo, getSlidesWithEmptyPlaceholders as jr, getPresentationSummary as js, findSlidesByText as jt, getSlideCommentAuthors as ju, setShapeCustomGeometry as k, isParagraphBulletPicture as ka, setTableStyleId as kc, setShapeFill as ki, getSlideMasterBackgroundGradientFill as kl, getShapeTextAnchor as kn, setSlideSize as ko, getSlideLayout as kr, getOrphanMediaPartNames as ks, findSlideByTitle as kt, getPresentationCommentCountsBySlide as ku, getGridSpacing as l, getShapeRunFormat as la, insertTableColumn as lc, getSlideMasterPartNames as li, resolveDeckBodyTextColor as ll, addSlideImage as ln, getShapeImageDuotone as lo, setShapeShadow as lr, hasSlideNotes as ls, setSlideShowProperties as lt, addSlideComment as lu, setSlideOutlineCollapsed as m, getParagraphBulletImageBytes as ma, removeTableColumn as mc, isShapeTextBox as mi, getSlideBackgroundGradientFill as ml, bringShapeForward as mn, getShapeImagePartName as mo, findShapeByText as mr, setSlideNotesFormat as ms, getSlideMasterName as mt, findCommentsBefore as mu, getShapeImageFillLayout as n, getShapeStrokeColorResolved as na, getTableCells as nc, getShapePosition as ni, getShapeChartSeriesNames as nl, replaceTextInSlide as nn, getPresentationImageCountsBySlide as no, getShapeEffect as nr, getSlidesWithComments as ns, getNotesMasterPlaceholders as nt, getUnusedSlideLayouts as nu, getCollapsedOutlineSlides as o, getShapeStrokeJoin as oa, getTableSize as oc, getShapeText as oi, setChartData as ol, setSlideBackgroundGraphicsHidden as on, getShapeImageBytes as oo, setShapeGlow as or, getSlidesWithOverlap as os, setNotesMasterPlaceholderIncluded as ot, getCustomShows as ou, setGridSpacing as p, getParagraphBullet as pa, mergeTableCells as pc, isShapePlaceholder as pi, getSlideBackground as pl, addSlideTextBox as pn, getShapeImageOpacity as po, findShapeByName as pr, setSlideNotes as ps, getSlideMasterLayouts as pt, findCommentsAfter as pu, importSlide as q, getShapeAnimation as qa, addSlideChart as qc, setShapeStrokeSketch as qi, findSlideLayoutByPartName as ql, setShapeTextDirection as qn, getPresentationNotesLength as qo, getShapeCenter as qr, getTableCellFill as qs, getSlideTextLength as qt, asColor as qu, getShapeImageIntrinsicSize as r, getShapeStrokeCompound as ra, getTableColumnWidths as rc, getShapePreset as ri, getShapeChartSeriesValues as rl, replaceTextInSlideNotes as rn, getShapeImageArtisticEffect as ro, getShapeEffects as rr, getSlidesWithHyperlinks as rs, getNotesPageSize as rt, isChartSpec as ru, getDrawingGuides as s, getShapeStrokeOpacity as sa, getTableStyleFlags as sc, getSlideMasterCount as si, setChartSpec as sl, setSlideHidden as sn, getShapeImageContrast as so, setShapeInnerShadow as sr, getSlidesWithTables as ss, setNotesPageOrientation as st, setCustomShows as su, VERSION as t, getShapeStrokeColor as ta, getTableCellTextDirection as tc, getShapePlaceholderType as ti, getShapeChartKind as tl, replaceTextInPresentation as tn, findSlidesByLayoutType as to, getShape3D as tr, getSlidesWithCharts as ts, getHandoutSlidesPerPage as tt, getSlideLayouts as tu, getSnapToGrid as u, resolveDrawingColor as ua, insertTableRow as uc, getSlideMasterUsageCounts as ui, applySlideBackgroundToAll as ul, addSlideLine as un, getShapeImageFillBytes as uo, setShapeSoftEdge as ur, removeSlideNotes as us, addSlideLayout as ut, clearAllSlideComments as uu, resetShapeVideoFormatting as v, getParagraphLevel as va, setTableCellBorders as vc, setShapeBounds as vi, getSlideBackgroundImageIntrinsicSize as vl, getShapeZIndex as vn, resetShapeImageColorEffects as vo, findShapesByName as vr, getSlideTransitionSound as vs, removeSlideMaster as vt, getCommentAuthor as vu, ungroupShapes as w, getShapeRunClickAction as wa, setTableCellTextDirection as wc, getShapePatternFill as wi, getSlideLayoutBackgroundImageBytes as wl, removeSlideAnimation as wn, SLIDE_SIZE_16_10 as wo, findSlidePlaceholders as wr, getShapeMediaPlayback as ws, setSlideMasterPreserved as wt, getCommentSlide as wu, setShapeImageCompressionState as x, getShapeHyperlinkTooltip as xa, setTableCellMargins as xc, shapesOverlap as xi, getSlideColorMapOverride as xl, sendShapeToBack as xn, setShapeImageCrop as xo, findShapesWithHyperlinks as xr, addSlideMedia as xs, setSlideLayoutTitleIncluded as xt, getCommentFormat as xu, getShapeImageCompressionState as y, getParagraphLineSpacing as ya, setTableCellClickAction as yc, setShapeDescription as yi, getSlideBackgroundImageOpacity as yl, removeShape as yn, setShapeImageBrightness as yo, findShapesByPreset as yr, setSlideTransition as ys, setSlideLayoutBackgroundGraphicsHidden as yt, getCommentAuthors as yu, addBlankSlide as z, setShapeRunText as za, setCoreProperties as zc, setShapeSize as zi, getShapeGradientFill as zl, setShapeBulletStyle as zn, getAllHyperlinks as zo, getGroupTransform as zr, getPresentationTableCountsBySlide as zs, getSlideAt as zt, setPresentationTheme as zu };
56251
56793
 
56252
- //# sourceMappingURL=api-miOxITQn.js.map
56794
+ //# sourceMappingURL=api-B5-Bdn3_.js.map