@office-kit/pptx 0.24.1 → 0.26.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.
@@ -1,4 +1,4 @@
1
- import { unzipSync, zipSync } from "fflate";
1
+ import { Inflate, inflateSync, strFromU8, zipSync } from "fflate";
2
2
  //#region src/api/units.ts
3
3
  const EMU_PER_INCH = 914400;
4
4
  const EMU_PER_CM = 36e4;
@@ -1308,7 +1308,7 @@ const PRESET_MATERIALS = [
1308
1308
  //#region src/internal/drawingml/color.ts
1309
1309
  const NAME_SRGB_CLR$4 = qname("a", "srgbClr", NS.dml);
1310
1310
  const NAME_SCHEME_CLR$2 = qname("a", "schemeClr", NS.dml);
1311
- const ATTR_VAL$12 = qname("", "val", "");
1311
+ const ATTR_VAL$13 = qname("", "val", "");
1312
1312
  const SCHEME_TOKENS = new Set([
1313
1313
  "bg1",
1314
1314
  "tx1",
@@ -1378,7 +1378,7 @@ const parseSrgbHex = (value) => normalizeSrgbHex(value);
1378
1378
  const buildColorElement = (value) => {
1379
1379
  const parsed = parseColor(value);
1380
1380
  if (parsed === null) throw new Error(`unrecognized color: ${value}`);
1381
- return parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$4, { attrs: [attr(ATTR_VAL$12, parsed.hex)] }) : elem(NAME_SCHEME_CLR$2, { attrs: [attr(ATTR_VAL$12, parsed.token)] });
1381
+ return parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$4, { attrs: [attr(ATTR_VAL$13, parsed.hex)] }) : elem(NAME_SCHEME_CLR$2, { attrs: [attr(ATTR_VAL$13, parsed.token)] });
1382
1382
  };
1383
1383
  /**
1384
1384
  * Narrows a color read back from a deck to one that can be written again,
@@ -1406,7 +1406,7 @@ const editSolidColor = (previous, options) => {
1406
1406
  if (options.color !== void 0 && previous) color.children = previous.children.filter((child) => child.kind === "element" && isAlpha(child));
1407
1407
  if (options.opacity !== void 0) {
1408
1408
  color.children = color.children.filter((child) => child.kind !== "element" || !isAlpha(child));
1409
- color.children.push(elem(qname("a", "alpha", NS.dml), { attrs: [attr(ATTR_VAL$12, String(Math.round(options.opacity * 1e5)))] }));
1409
+ color.children.push(elem(qname("a", "alpha", NS.dml), { attrs: [attr(ATTR_VAL$13, String(Math.round(options.opacity * 1e5)))] }));
1410
1410
  }
1411
1411
  return color;
1412
1412
  };
@@ -1529,7 +1529,7 @@ const ATTR_SX = qname("", "sx", "");
1529
1529
  const ATTR_SY = qname("", "sy", "");
1530
1530
  const ATTR_KX = qname("", "kx", "");
1531
1531
  const ATTR_KY = qname("", "ky", "");
1532
- const ATTR_VAL$11 = qname("", "val", "");
1532
+ const ATTR_VAL$12 = qname("", "val", "");
1533
1533
  const PERCENTAGE_UNITS = 1e5;
1534
1534
  const ALPHA_TRANSFORMS = new Set([
1535
1535
  "alpha",
@@ -1626,7 +1626,7 @@ const effectColor = (options, caller) => {
1626
1626
  base.children = buildColorTransforms(transforms);
1627
1627
  if (opacity !== void 0 && (colorTransforms === void 0 || opacity !== colorTransformOpacity(transforms))) {
1628
1628
  base.children = base.children.filter((c) => !(c.kind === "element" && ALPHA_TRANSFORMS.has(c.name.localName)));
1629
- if (opacity >= 0 && opacity < 1) base.children.push(elem(NAME_ALPHA, { attrs: [attr(ATTR_VAL$11, String(Math.round(opacity * PERCENTAGE_UNITS)))] }));
1629
+ if (opacity >= 0 && opacity < 1) base.children.push(elem(NAME_ALPHA, { attrs: [attr(ATTR_VAL$12, String(Math.round(opacity * PERCENTAGE_UNITS)))] }));
1630
1630
  }
1631
1631
  return base;
1632
1632
  };
@@ -2097,7 +2097,7 @@ const clearStroke = (spPr) => {
2097
2097
  spPr.children = spPr.children.filter((c) => !(c.kind === "element" && c.name.namespaceURI === NS.dml && c.name.localName === "ln"));
2098
2098
  };
2099
2099
  const NAME_PRST_DASH = qname("a", "prstDash", NS.dml);
2100
- const ATTR_VAL$10 = qname("", "val", "");
2100
+ const ATTR_VAL$11 = qname("", "val", "");
2101
2101
  /**
2102
2102
  * Sets `<a:prstDash val="..."/>` inside the shape's `<a:ln>`. Creates
2103
2103
  * `<a:ln>` if absent. Replacing the dash choice on subsequent calls.
@@ -2106,7 +2106,7 @@ const setStrokeDash = (spPr, dash) => {
2106
2106
  oneOf(dash, LINE_DASHES, "setShapeStrokeDash: dash");
2107
2107
  const ln = ensureLn(spPr);
2108
2108
  ln.children = ln.children.filter((c) => !(c.kind === "element" && c.name.namespaceURI === NS.dml && c.name.localName === "prstDash"));
2109
- insertLnChild(ln, elem(NAME_PRST_DASH, { attrs: [attr(ATTR_VAL$10, dash)] }));
2109
+ insertLnChild(ln, elem(NAME_PRST_DASH, { attrs: [attr(ATTR_VAL$11, dash)] }));
2110
2110
  };
2111
2111
  const ATTR_TYPE$7 = qname("", "type", "");
2112
2112
  const ATTR_LEN = qname("", "len", "");
@@ -2304,7 +2304,7 @@ const ATTR_NORMALIZE_H = qname("", "normalizeH", "");
2304
2304
  const ATTR_BASELINE = qname("", "baseline", "");
2305
2305
  const ATTR_CAP = qname("", "cap", "");
2306
2306
  const ATTR_TYPEFACE$3 = qname("", "typeface", "");
2307
- const ATTR_VAL$9 = qname("", "val", "");
2307
+ const ATTR_VAL$10 = qname("", "val", "");
2308
2308
  const NAME_HIGHLIGHT = qname("a", "highlight", NS.dml);
2309
2309
  const NAME_NO_FILL$1 = qname("a", "noFill", NS.dml);
2310
2310
  const NAME_BLIP_FILL$2 = qname("a", "blipFill", NS.dml);
@@ -2451,7 +2451,7 @@ const setSolidFill = (rPr, value, transforms) => {
2451
2451
  const parsed = parseColor(value);
2452
2452
  if (parsed === null) throw new Error(`unrecognized color: ${value}`);
2453
2453
  removeAnyFill(rPr);
2454
- const inner = parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$3, { attrs: [attr(ATTR_VAL$9, parsed.hex)] }) : elem(NAME_SCHEME_CLR$1, { attrs: [attr(ATTR_VAL$9, parsed.token)] });
2454
+ const inner = parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$3, { attrs: [attr(ATTR_VAL$10, parsed.hex)] }) : elem(NAME_SCHEME_CLR$1, { attrs: [attr(ATTR_VAL$10, parsed.token)] });
2455
2455
  if (transforms !== void 0) inner.children = buildColorTransforms(transforms);
2456
2456
  insertChildByRank(rPr, elem(NAME_SOLID_FILL$4, { children: [inner] }), rprChildRank);
2457
2457
  };
@@ -2487,7 +2487,7 @@ const setUnderlineFill = (rPr, value) => {
2487
2487
  insertChildByRank(rPr, value === null ? elem(NAME_U_FILL_TX) : (() => {
2488
2488
  const parsed = parseColor(value);
2489
2489
  if (parsed === null) throw new Error(`unrecognized underline color: ${value}`);
2490
- return elem(NAME_U_FILL, { children: [elem(NAME_SOLID_FILL$4, { children: [parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$3, { attrs: [attr(ATTR_VAL$9, parsed.hex)] }) : elem(NAME_SCHEME_CLR$1, { attrs: [attr(ATTR_VAL$9, parsed.token)] })] })] });
2490
+ return elem(NAME_U_FILL, { children: [elem(NAME_SOLID_FILL$4, { children: [parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$3, { attrs: [attr(ATTR_VAL$10, parsed.hex)] }) : elem(NAME_SCHEME_CLR$1, { attrs: [attr(ATTR_VAL$10, parsed.token)] })] })] });
2491
2491
  })(), rprChildRank);
2492
2492
  };
2493
2493
  const setLatin = (rPr, font) => {
@@ -2510,7 +2510,7 @@ const setHighlight = (rPr, value) => {
2510
2510
  if (value === null) return;
2511
2511
  const parsed = parseColor(value);
2512
2512
  if (parsed === null) throw new Error(`unrecognized highlight color: ${value}`);
2513
- insertChildByRank(rPr, elem(NAME_HIGHLIGHT, { children: [parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$3, { attrs: [attr(ATTR_VAL$9, parsed.hex)] }) : elem(NAME_SCHEME_CLR$1, { attrs: [attr(ATTR_VAL$9, parsed.token)] })] }), rprChildRank);
2513
+ insertChildByRank(rPr, elem(NAME_HIGHLIGHT, { children: [parsed.kind === "srgb" ? elem(NAME_SRGB_CLR$3, { attrs: [attr(ATTR_VAL$10, parsed.hex)] }) : elem(NAME_SCHEME_CLR$1, { attrs: [attr(ATTR_VAL$10, parsed.token)] })] }), rprChildRank);
2514
2514
  };
2515
2515
  const validateFormatEnums = (format, caller, images) => {
2516
2516
  if (format.underline != null && typeof format.underline !== "boolean") oneOf(format.underline, UNDERLINES, `${caller}: underline`);
@@ -25702,7 +25702,7 @@ const NAME_TX_BODY$11 = qname("p", "txBody", NS.pml);
25702
25702
  const ATTR_ID$19 = qname("", "id", "");
25703
25703
  const ATTR_NAME$16 = qname("", "name", "");
25704
25704
  const ATTR_TYPE$6 = qname("", "type", "");
25705
- const ATTR_IDX$6 = qname("", "idx", "");
25705
+ const ATTR_IDX$7 = qname("", "idx", "");
25706
25706
  const NV_BY_KIND = {
25707
25707
  shape: NAME_NV_SP_PR$5,
25708
25708
  picture: NAME_NV_PIC_PR$3,
@@ -25740,7 +25740,7 @@ const extractShape = (element, kind) => {
25740
25740
  const ph = firstChildElement(nvPr, NAME_PH$3);
25741
25741
  if (ph !== null) {
25742
25742
  placeholderType = getAttrValue(ph, ATTR_TYPE$6);
25743
- const idxRaw = getAttrValue(ph, ATTR_IDX$6);
25743
+ const idxRaw = getAttrValue(ph, ATTR_IDX$7);
25744
25744
  if (idxRaw !== null) placeholderIdx = Number.parseInt(idxRaw, 10);
25745
25745
  }
25746
25746
  }
@@ -26122,8 +26122,8 @@ const NAME_FILL_REF$1 = qname("a", "fillRef", NS.dml);
26122
26122
  const NAME_EFFECT_REF$1 = qname("a", "effectRef", NS.dml);
26123
26123
  const NAME_FONT_REF$1 = qname("a", "fontRef", NS.dml);
26124
26124
  const NAME_SCHEME_CLR = qname("a", "schemeClr", NS.dml);
26125
- const ATTR_IDX$5 = qname("", "idx", "");
26126
- const ATTR_VAL$8 = qname("", "val", "");
26125
+ const ATTR_IDX$6 = qname("", "idx", "");
26126
+ const ATTR_VAL$9 = qname("", "val", "");
26127
26127
  const ATTR_ID$15 = qname("", "id", "");
26128
26128
  const ATTR_NAME$11 = qname("", "name", "");
26129
26129
  const ATTR_X$6 = qname("", "x", "");
@@ -26171,8 +26171,8 @@ const buildConnector = (opts) => {
26171
26171
  const children = [nvCxnSpPr, elem(NAME_SP_PR$3, { children: spPrChildren })];
26172
26172
  if (!hasExplicitLine) {
26173
26173
  const styleRef = (name, idx, clr) => elem(name, {
26174
- attrs: [attr(ATTR_IDX$5, idx)],
26175
- children: [elem(NAME_SCHEME_CLR, { attrs: [attr(ATTR_VAL$8, clr)] })]
26174
+ attrs: [attr(ATTR_IDX$6, idx)],
26175
+ children: [elem(NAME_SCHEME_CLR, { attrs: [attr(ATTR_VAL$9, clr)] })]
26176
26176
  });
26177
26177
  children.push(elem(NAME_STYLE$2, { children: [
26178
26178
  styleRef(NAME_LN_REF$1, "1", "accent1"),
@@ -26441,7 +26441,7 @@ const NAME_SRGB_CLR$2 = qname("a", "srgbClr", NS.dml);
26441
26441
  const NAME_T$2 = qname("a", "t", NS.dml);
26442
26442
  const NAME_PPR = qname("a", "pPr", NS.dml);
26443
26443
  const NAME_BU_NONE = qname("a", "buNone", NS.dml);
26444
- const ATTR_VAL$7 = qname("", "val", "");
26444
+ const ATTR_VAL$8 = qname("", "val", "");
26445
26445
  const ATTR_MAR_L = qname("", "marL", "");
26446
26446
  const ATTR_MAR_R = qname("", "marR", "");
26447
26447
  const ATTR_MAR_T = qname("", "marT", "");
@@ -26463,7 +26463,7 @@ const ATTR_LANG$2 = qname("", "lang", "");
26463
26463
  const buildCellRunProps = (textColorHex) => {
26464
26464
  const langAttr = attr(ATTR_LANG$2, "en-US");
26465
26465
  if (textColorHex === void 0) return elem(NAME_RPR$2, { attrs: [langAttr] });
26466
- const solidFill = elem(NAME_SOLID_FILL$2, { children: [elem(NAME_SRGB_CLR$2, { attrs: [attr(ATTR_VAL$7, (textColorHex.startsWith("#") ? textColorHex.slice(1) : textColorHex).toUpperCase())] })] });
26466
+ const solidFill = elem(NAME_SOLID_FILL$2, { children: [elem(NAME_SRGB_CLR$2, { attrs: [attr(ATTR_VAL$8, (textColorHex.startsWith("#") ? textColorHex.slice(1) : textColorHex).toUpperCase())] })] });
26467
26467
  return elem(NAME_RPR$2, {
26468
26468
  attrs: [langAttr],
26469
26469
  children: [solidFill]
@@ -27378,7 +27378,7 @@ const ATTR_NO_GRP = qname("", "noGrp", "");
27378
27378
  const ATTR_NO_ROT = qname("", "noRot", "");
27379
27379
  const ATTR_NO_CHANGE_ASPECT = qname("", "noChangeAspect", "");
27380
27380
  const ATTR_TYPE$3 = qname("", "type", "");
27381
- const ATTR_IDX$4 = qname("", "idx", "");
27381
+ const ATTR_IDX$5 = qname("", "idx", "");
27382
27382
  const ATTR_LANG$1 = qname("", "lang", "");
27383
27383
  const buildRootGroup = () => {
27384
27384
  return elem(NAME_NV_GRP_SP_PR, { children: [
@@ -27408,7 +27408,7 @@ const buildNotesBodyPlaceholder = (id, notes) => {
27408
27408
  const nvSpPr = elem(NAME_NV_SP_PR$1, { children: [
27409
27409
  elem(NAME_C_NV_PR, { attrs: [attr(ATTR_ID$10, String(id)), attr(ATTR_NAME$7, `Notes Placeholder ${id - 1}`)] }),
27410
27410
  elem(NAME_C_NV_SP_PR, { children: [elem(NAME_SP_LOCKS, { attrs: [attr(ATTR_NO_GRP, "1")] })] }),
27411
- elem(NAME_NV_PR$3, { children: [elem(NAME_PH$1, { attrs: [attr(ATTR_TYPE$3, "body"), attr(ATTR_IDX$4, "1")] })] })
27411
+ elem(NAME_NV_PR$3, { children: [elem(NAME_PH$1, { attrs: [attr(ATTR_TYPE$3, "body"), attr(ATTR_IDX$5, "1")] })] })
27412
27412
  ] });
27413
27413
  const txBody = elem(NAME_TX_BODY$6, { children: [
27414
27414
  elem(NAME_BODY_PR$2),
@@ -28569,7 +28569,7 @@ const ATTR_FROM = qname("", "from", "");
28569
28569
  const ATTR_TO = qname("", "to", "");
28570
28570
  const ATTR_X$2 = qname("", "x", "");
28571
28571
  const ATTR_Y$2 = qname("", "y", "");
28572
- const ATTR_VAL$6 = qname("", "val", "");
28572
+ const ATTR_VAL$7 = qname("", "val", "");
28573
28573
  const ATTR_PR_LST = qname("", "prLst", "");
28574
28574
  const behavioursOf$1 = (effectCTn) => {
28575
28575
  const list = firstChildElement(effectCTn, NAME_CHILD_TN_LST$6);
@@ -28647,7 +28647,7 @@ const readColor = (host) => {
28647
28647
  const elements = host.children.filter((c) => c.kind === "element");
28648
28648
  const el = elements[0];
28649
28649
  if (elements.length !== 1 || el === void 0 || el.name.namespaceURI !== NS.dml) return null;
28650
- const val = getAttrValue(el, ATTR_VAL$6);
28650
+ const val = getAttrValue(el, ATTR_VAL$7);
28651
28651
  if (val === null) return null;
28652
28652
  const base = el.name.localName === "srgbClr" ? asColor(`#${val.toUpperCase()}`) : el.name.localName === "schemeClr" ? asColor(`scheme:${val}`) : null;
28653
28653
  if (base === null) return null;
@@ -28703,7 +28703,7 @@ const readAnimationEmphasisOptions = (effect, effectCTn) => {
28703
28703
  const set = behaviours.find((b) => isPml$5(b, "set") && attrNameOf$1(b) === "style.opacity");
28704
28704
  const to = set === void 0 ? null : firstChildElement(set, NAME_TO$1);
28705
28705
  const strVal = to === null ? null : firstChildElement(to, NAME_STR_VAL$1);
28706
- const raw = strVal === null ? null : getAttrValue(strVal, ATTR_VAL$6);
28706
+ const raw = strVal === null ? null : getAttrValue(strVal, ATTR_VAL$7);
28707
28707
  const opacity = raw === null || !/^\d*\.?\d+$/.test(raw.trim()) ? NaN : Number(raw);
28708
28708
  if (!(opacity >= 0 && opacity <= 1)) return null;
28709
28709
  return withOptions({ transparencyPercent: Number(((1 - opacity) * PERCENT).toFixed(OPACITY_DIGITS - 2)) });
@@ -29534,7 +29534,7 @@ const ATTR_CONCURRENT = qname("", "concurrent", "");
29534
29534
  const ATTR_NEXT_AC = qname("", "nextAc", "");
29535
29535
  const ATTR_SPID$3 = qname("", "spid", "");
29536
29536
  const ATTR_EVT$2 = qname("", "evt", "");
29537
- const ATTR_VAL$5 = qname("", "val", "");
29537
+ const ATTR_VAL$6 = qname("", "val", "");
29538
29538
  const ATTR_GRP_ID$3 = qname("", "grpId", "");
29539
29539
  const ATTR_BUILD$1 = qname("", "build", "");
29540
29540
  const ATTR_ANIM_BG = qname("", "animBg", "");
@@ -29915,7 +29915,7 @@ const setAttrValue = (el, name, value) => {
29915
29915
  const hidesTarget = (behaviour) => {
29916
29916
  const to = firstChildElement(behaviour.element, NAME_TO);
29917
29917
  const strVal = to === null ? null : firstChildElement(to, NAME_STR_VAL);
29918
- return strVal !== null && getAttrValue(strVal, ATTR_VAL$5) === "hidden";
29918
+ return strVal !== null && getAttrValue(strVal, ATTR_VAL$6) === "hidden";
29919
29919
  };
29920
29920
  /**
29921
29921
  * Retimes an effect to run for `durationMs`, in place: every behaviour's length
@@ -30109,7 +30109,7 @@ const ATTR_LAST_IDX = qname("", "lastIdx", "");
30109
30109
  const ATTR_CLR_IDX = qname("", "clrIdx", "");
30110
30110
  const ATTR_AUTHOR_ID$1 = qname("", "authorId", "");
30111
30111
  const ATTR_DT = qname("", "dt", "");
30112
- const ATTR_IDX$3 = qname("", "idx", "");
30112
+ const ATTR_IDX$4 = qname("", "idx", "");
30113
30113
  const ATTR_X$1 = qname("", "x", "");
30114
30114
  const ATTR_Y$1 = qname("", "y", "");
30115
30115
  const readCommentAuthorList = (root) => {
@@ -30139,7 +30139,7 @@ const readCommentList = (root) => {
30139
30139
  const comments = [];
30140
30140
  for (const el of allChildElements(root, NAME_CM$1)) {
30141
30141
  const authorIdRaw = getAttrValue(el, ATTR_AUTHOR_ID$1);
30142
- const idxRaw = getAttrValue(el, ATTR_IDX$3);
30142
+ const idxRaw = getAttrValue(el, ATTR_IDX$4);
30143
30143
  const dtVal = getAttrValue(el, ATTR_DT);
30144
30144
  if (authorIdRaw === null || idxRaw === null) continue;
30145
30145
  const authorId = Number.parseInt(authorIdRaw, 10);
@@ -30172,7 +30172,7 @@ const readCommentList = (root) => {
30172
30172
  const identifier = threading && firstChildElement(threading, NAME_PARENT);
30173
30173
  if (!identifier) continue;
30174
30174
  const author = getAttrValue(identifier, ATTR_AUTHOR_ID$1);
30175
- const index = getAttrValue(identifier, ATTR_IDX$3);
30175
+ const index = getAttrValue(identifier, ATTR_IDX$4);
30176
30176
  if (author !== null && index !== null && /^\d+$/.test(author) && /^\d+$/.test(index) && Number(author) <= 4294967295 && Number(index) <= 4294967295) parent = {
30177
30177
  authorId: Number(author),
30178
30178
  idx: Number(index)
@@ -30220,7 +30220,7 @@ const DEFAULT_COMMENT_POSITION = {
30220
30220
  y: 0
30221
30221
  };
30222
30222
  const commentElement = (c) => {
30223
- const attrs = [attr(ATTR_AUTHOR_ID$1, String(c.authorId)), attr(ATTR_IDX$3, String(c.idx))];
30223
+ const attrs = [attr(ATTR_AUTHOR_ID$1, String(c.authorId)), attr(ATTR_IDX$4, String(c.idx))];
30224
30224
  if (c.dt !== null) attrs.push(attr(ATTR_DT, c.dt));
30225
30225
  const position = c.position ?? DEFAULT_COMMENT_POSITION;
30226
30226
  const children = [elem(NAME_POS$1, { attrs: [attr(ATTR_X$1, String(position.x)), attr(ATTR_Y$1, String(position.y))] })];
@@ -30229,7 +30229,7 @@ const commentElement = (c) => {
30229
30229
  attrs: [attr(ATTR_URI$2, THREADING_URI)],
30230
30230
  children: [elem(NAME_THREADING, {
30231
30231
  prefixDecls: new Map([["p15", P15]]),
30232
- children: [elem(NAME_PARENT, { attrs: [attr(ATTR_AUTHOR_ID$1, String(c.parent.authorId)), attr(ATTR_IDX$3, String(c.parent.idx))] })]
30232
+ children: [elem(NAME_PARENT, { attrs: [attr(ATTR_AUTHOR_ID$1, String(c.parent.authorId)), attr(ATTR_IDX$4, String(c.parent.idx))] })]
30233
30233
  })]
30234
30234
  })] }));
30235
30235
  return elem(NAME_CM$1, {
@@ -30552,20 +30552,173 @@ const extensionOf = (name) => {
30552
30552
  * negligible savings.
30553
30553
  */
30554
30554
  const shouldStore = (name) => STORE_BY_EXTENSION.has(extensionOf(name));
30555
+ const SIG_LOCAL_HEADER = 67324752;
30556
+ const SIG_CENTRAL_HEADER = 33639248;
30557
+ const SIG_EOCD = 101010256;
30558
+ const SIG_ZIP64_EOCD = 101075792;
30559
+ const SIG_ZIP64_LOCATOR = 117853008;
30560
+ const EOCD_SIZE = 22;
30561
+ const MAX_COMMENT_LENGTH = 65535;
30562
+ const ZIP64_LOCATOR_SIZE = 20;
30563
+ const ZIP64_EOCD_MIN_SIZE = 56;
30564
+ const CENTRAL_HEADER_SIZE = 46;
30565
+ const LOCAL_HEADER_SIZE = 30;
30566
+ const ZIP64_EXTRA_ID = 1;
30567
+ const ZIP64_SENTINEL_32 = 4294967295;
30568
+ const FLAG_UTF8 = 2048;
30569
+ const METHOD_STORE = 0;
30570
+ const METHOD_DEFLATE = 8;
30571
+ const INFLATE_CHUNK_SIZE = 16 * 1024;
30572
+ const MAX_DEFLATE_RATIO = 1032;
30573
+ const DEFLATE_RATIO_SLACK = 1024;
30574
+ const invalid = (reason) => /* @__PURE__ */ new Error(`invalid ZIP: ${reason}`);
30575
+ const u16 = (d, at) => d[at] | d[at + 1] << 8;
30576
+ const u32 = (d, at) => (d[at] | d[at + 1] << 8 | d[at + 2] << 16 | d[at + 3] << 24) >>> 0;
30577
+ const u64 = (d, at) => {
30578
+ const value = u32(d, at) + u32(d, at + 4) * 2 ** 32;
30579
+ if (!Number.isSafeInteger(value)) throw invalid("ZIP64 value out of range");
30580
+ return value;
30581
+ };
30582
+ const requireRange = (d, at, length, what) => {
30583
+ if (at < 0 || length < 0 || at + length > d.length) throw invalid(`${what} is out of bounds`);
30584
+ };
30585
+ const findEocd = (d) => {
30586
+ const lowest = Math.max(0, d.length - EOCD_SIZE - MAX_COMMENT_LENGTH);
30587
+ for (let at = d.length - EOCD_SIZE; at >= lowest; at--) if (u32(d, at) === SIG_EOCD) return at;
30588
+ throw invalid("end of central directory not found");
30589
+ };
30590
+ const readCentralDirectoryLocation = (d) => {
30591
+ const eocd = findEocd(d);
30592
+ const locator = eocd - ZIP64_LOCATOR_SIZE;
30593
+ if (locator >= 0 && u32(d, locator) === SIG_ZIP64_LOCATOR) {
30594
+ const zip64Eocd = u32(d, locator + 8) + u32(d, locator + 12) * 2 ** 32;
30595
+ if (zip64Eocd + ZIP64_EOCD_MIN_SIZE <= d.length && u32(d, zip64Eocd) === SIG_ZIP64_EOCD) return {
30596
+ count: u64(d, zip64Eocd + 32),
30597
+ offset: u64(d, zip64Eocd + 48)
30598
+ };
30599
+ }
30600
+ return {
30601
+ count: u16(d, eocd + 10),
30602
+ offset: u32(d, eocd + 16)
30603
+ };
30604
+ };
30605
+ const resolveZip64Sizes = (d, extraStart, extraEnd, sizes) => {
30606
+ const needUncompressed = sizes.uncompressedSize === ZIP64_SENTINEL_32;
30607
+ const needCompressed = sizes.compressedSize === ZIP64_SENTINEL_32;
30608
+ const needOffset = sizes.localHeaderOffset === ZIP64_SENTINEL_32;
30609
+ if (!needUncompressed && !needCompressed && !needOffset) return sizes;
30610
+ for (let at = extraStart; at + 4 <= extraEnd; at += 4 + u16(d, at + 2)) {
30611
+ if (u16(d, at) !== ZIP64_EXTRA_ID) continue;
30612
+ const fieldEnd = at + 4 + u16(d, at + 2);
30613
+ if (fieldEnd > extraEnd) break;
30614
+ let cursor = at + 4;
30615
+ const next = () => {
30616
+ if (cursor + 8 > fieldEnd) throw invalid("ZIP64 extra field is truncated");
30617
+ const value = u64(d, cursor);
30618
+ cursor += 8;
30619
+ return value;
30620
+ };
30621
+ return {
30622
+ uncompressedSize: needUncompressed ? next() : sizes.uncompressedSize,
30623
+ compressedSize: needCompressed ? next() : sizes.compressedSize,
30624
+ localHeaderOffset: needOffset ? next() : sizes.localHeaderOffset
30625
+ };
30626
+ }
30627
+ throw invalid("ZIP64 sizes without a ZIP64 extra field");
30628
+ };
30629
+ const overflowError = (name, declaredSize) => invalid(`entry "${name}" inflates beyond its declared size of ${declaredSize} bytes`);
30630
+ const corruptError = (name, error) => {
30631
+ return invalid(`entry "${name}" is not valid DEFLATE data: ${error instanceof Error ? error.message : String(error)}`);
30632
+ };
30633
+ const inflateSmallEntry = (compressed, declaredSize, name) => {
30634
+ if (compressed.length === 0) return new Uint8Array(0);
30635
+ let out;
30636
+ try {
30637
+ out = inflateSync(compressed, { out: new Uint8Array(declaredSize + 1) });
30638
+ } catch (error) {
30639
+ if (error instanceof RangeError) throw overflowError(name, declaredSize);
30640
+ throw corruptError(name, error);
30641
+ }
30642
+ if (out.length > declaredSize) throw overflowError(name, declaredSize);
30643
+ return out;
30644
+ };
30645
+ const inflateLargeEntry = (compressed, declaredSize, name) => {
30646
+ const out = new Uint8Array(declaredSize);
30647
+ let overflowed = false;
30648
+ let produced = 0;
30649
+ const inflater = new Inflate((chunk) => {
30650
+ if (produced + chunk.length > declaredSize) {
30651
+ overflowed = true;
30652
+ throw overflowError(name, declaredSize);
30653
+ }
30654
+ out.set(chunk, produced);
30655
+ produced += chunk.length;
30656
+ });
30657
+ for (let at = 0; at < compressed.length; at += INFLATE_CHUNK_SIZE) {
30658
+ const end = Math.min(at + INFLATE_CHUNK_SIZE, compressed.length);
30659
+ try {
30660
+ inflater.push(compressed.subarray(at, end), end === compressed.length);
30661
+ } catch (error) {
30662
+ if (overflowed) throw error;
30663
+ throw corruptError(name, error);
30664
+ }
30665
+ }
30666
+ return out.subarray(0, produced);
30667
+ };
30668
+ const inflateEntry = (compressed, declaredSize, name) => {
30669
+ if (declaredSize > compressed.length * MAX_DEFLATE_RATIO + DEFLATE_RATIO_SLACK) throw invalid(`entry "${name}" declares ${declaredSize} bytes, more than ${compressed.length} compressed bytes can hold`);
30670
+ const out = compressed.length <= INFLATE_CHUNK_SIZE ? inflateSmallEntry(compressed, declaredSize, name) : inflateLargeEntry(compressed, declaredSize, name);
30671
+ if (out.length !== declaredSize) throw invalid(`entry "${name}" inflates to ${out.length} bytes, not its declared ${declaredSize}`);
30672
+ return out;
30673
+ };
30555
30674
  /**
30556
30675
  * Reads a ZIP archive (a `.pptx` file is a ZIP) and returns entries in
30557
- * central-directory order. Throws if `input` is not a valid ZIP.
30676
+ * central-directory order. Throws if `input` is not a valid ZIP, if two
30677
+ * entries share a name, or if an entry's data does not match the size its
30678
+ * central-directory record declares.
30558
30679
  */
30559
30680
  const readZip = (input) => {
30560
- const obj = unzipSync(input);
30681
+ const { offset, count } = readCentralDirectoryLocation(input);
30561
30682
  const entries = [];
30562
- for (const name of Object.keys(obj)) {
30563
- const data = obj[name];
30564
- if (data === void 0) continue;
30565
- entries.push({
30683
+ const seen = /* @__PURE__ */ new Set();
30684
+ let cursor = offset;
30685
+ for (let i = 0; i < count; i++) {
30686
+ requireRange(input, cursor, CENTRAL_HEADER_SIZE, "central directory");
30687
+ if (u32(input, cursor) !== SIG_CENTRAL_HEADER) throw invalid("bad central directory signature");
30688
+ const flags = u16(input, cursor + 8);
30689
+ const method = u16(input, cursor + 10);
30690
+ const nameLength = u16(input, cursor + 28);
30691
+ const extraLength = u16(input, cursor + 30);
30692
+ const commentLength = u16(input, cursor + 32);
30693
+ const nameStart = cursor + CENTRAL_HEADER_SIZE;
30694
+ const extraStart = nameStart + nameLength;
30695
+ const recordEnd = extraStart + extraLength + commentLength;
30696
+ requireRange(input, cursor, recordEnd - cursor, "central directory");
30697
+ const name = strFromU8(input.subarray(nameStart, extraStart), (flags & FLAG_UTF8) === 0);
30698
+ const { compressedSize, uncompressedSize, localHeaderOffset } = resolveZip64Sizes(input, extraStart, extraStart + extraLength, {
30699
+ compressedSize: u32(input, cursor + 20),
30700
+ uncompressedSize: u32(input, cursor + 24),
30701
+ localHeaderOffset: u32(input, cursor + 42)
30702
+ });
30703
+ cursor = recordEnd;
30704
+ if (seen.has(name)) throw invalid(`duplicate entry "${name}"`);
30705
+ seen.add(name);
30706
+ requireRange(input, localHeaderOffset, LOCAL_HEADER_SIZE, `local header of "${name}"`);
30707
+ if (u32(input, localHeaderOffset) !== SIG_LOCAL_HEADER) throw invalid(`bad local header signature for "${name}"`);
30708
+ const dataStart = localHeaderOffset + LOCAL_HEADER_SIZE + u16(input, localHeaderOffset + 26) + u16(input, localHeaderOffset + 28);
30709
+ requireRange(input, dataStart, compressedSize, `data of "${name}"`);
30710
+ const compressed = input.subarray(dataStart, dataStart + compressedSize);
30711
+ if (method === METHOD_STORE) {
30712
+ if (compressedSize !== uncompressedSize) throw invalid(`stored entry "${name}" has mismatched sizes`);
30713
+ entries.push({
30714
+ name,
30715
+ data: compressed.slice()
30716
+ });
30717
+ } else if (method === METHOD_DEFLATE) entries.push({
30566
30718
  name,
30567
- data
30719
+ data: inflateEntry(compressed, uncompressedSize, name)
30568
30720
  });
30721
+ else throw invalid(`entry "${name}" uses unsupported compression method ${method}`);
30569
30722
  }
30570
30723
  return { entries };
30571
30724
  };
@@ -30729,8 +30882,13 @@ const serializeContentTypes = (ct) => {
30729
30882
  epilog: []
30730
30883
  });
30731
30884
  };
30885
+ const defaultKeyOf = (name) => {
30886
+ const file = basename(name);
30887
+ const dot = file.lastIndexOf(".");
30888
+ return dot < 0 ? null : file.slice(dot + 1).toLowerCase();
30889
+ };
30732
30890
  /**
30733
- * Resolves the content type for a given part name.
30891
+ * Builds a resolver for many part names against one `ContentTypes`.
30734
30892
  *
30735
30893
  * 1. The first Override whose PartName matches case-insensitively wins.
30736
30894
  * 2. Otherwise, the first Default whose Extension matches the part's
@@ -30738,13 +30896,35 @@ const serializeContentTypes = (ct) => {
30738
30896
  * 3. Returns `null` if neither rule matches — `[Content_Types].xml` is
30739
30897
  * required to cover every part, so a null here indicates a malformed
30740
30898
  * package.
30899
+ *
30900
+ * The resolver snapshots `ct`; later edits to it are not reflected.
30901
+ */
30902
+ const contentTypeResolver = (ct) => {
30903
+ const overrides = /* @__PURE__ */ new Map();
30904
+ for (const o of ct.overrides) {
30905
+ const key = o.partName.toLowerCase();
30906
+ if (!overrides.has(key)) overrides.set(key, o.contentType);
30907
+ }
30908
+ const defaults = /* @__PURE__ */ new Map();
30909
+ for (const d of ct.defaults) {
30910
+ const key = d.extension.toLowerCase();
30911
+ if (!defaults.has(key)) defaults.set(key, d.contentType);
30912
+ }
30913
+ return (name) => {
30914
+ const override = overrides.get(name.toLowerCase());
30915
+ if (override !== void 0) return override;
30916
+ const ext = defaultKeyOf(name);
30917
+ return ext === null ? null : defaults.get(ext) ?? null;
30918
+ };
30919
+ };
30920
+ /**
30921
+ * Resolves the content type of one part name by the rules of
30922
+ * `contentTypeResolver`, scanning without building maps.
30741
30923
  */
30742
30924
  const lookupContentType = (ct, name) => {
30743
30925
  for (const o of ct.overrides) if (partNamesEqual(o.partName, name)) return o.contentType;
30744
- const file = basename(name);
30745
- const dot = file.lastIndexOf(".");
30746
- if (dot < 0) return null;
30747
- const ext = file.slice(dot + 1).toLowerCase();
30926
+ const ext = defaultKeyOf(name);
30927
+ if (ext === null) return null;
30748
30928
  for (const d of ct.defaults) if (d.extension.toLowerCase() === ext) return d.contentType;
30749
30929
  return null;
30750
30930
  };
@@ -31117,9 +31297,9 @@ const detectAudioFormat = (bytes) => {
31117
31297
  };
31118
31298
  //#endregion
31119
31299
  //#region src/internal/parts/package.ts
31120
- const TEXT_DECODER$1 = new TextDecoder();
31300
+ const TEXT_DECODER$2 = new TextDecoder();
31121
31301
  const TEXT_ENCODER$3 = new TextEncoder();
31122
- const decode$2 = (b) => TEXT_DECODER$1.decode(b);
31302
+ const decode$2 = (b) => TEXT_DECODER$2.decode(b);
31123
31303
  const encode$3 = (s) => TEXT_ENCODER$3.encode(s);
31124
31304
  const parsedRels = /* @__PURE__ */ new WeakMap();
31125
31305
  const readRels = (bytes) => {
@@ -31139,16 +31319,29 @@ const CONTENT_TYPES_PART = "[Content_Types].xml";
31139
31319
  var OpcPackage = class OpcPackage {
31140
31320
  /**
31141
31321
  * Ordered list of parts. The order is the order parts will be written to
31142
- * the ZIP central directory on `save()`. Direct mutation is allowed for
31143
- * callers that need to reorder, but `addPart` / `removePart` are the
31144
- * supported entry points.
31322
+ * the ZIP central directory on `save()`. Read-only so every change goes
31323
+ * through `addPart` / `removePart` / `retainParts`, which keep the name
31324
+ * index in sync.
31145
31325
  */
31146
- parts;
31326
+ get parts() {
31327
+ return this.partList;
31328
+ }
31329
+ partList;
31147
31330
  /** Mutable Content_Types map. Direct mutation is allowed. */
31148
31331
  contentTypes;
31332
+ /** Lowercased part name → first part with that name, for `getPart`. */
31333
+ partsByName = /* @__PURE__ */ new Map();
31149
31334
  constructor(parts, contentTypes) {
31150
- this.parts = parts;
31335
+ this.partList = parts;
31151
31336
  this.contentTypes = contentTypes;
31337
+ this.indexParts();
31338
+ }
31339
+ indexParts() {
31340
+ this.partsByName.clear();
31341
+ for (const part of this.parts) {
31342
+ const key = part.name.toLowerCase();
31343
+ if (!this.partsByName.has(key)) this.partsByName.set(key, part);
31344
+ }
31152
31345
  }
31153
31346
  /**
31154
31347
  * Builds an empty package containing only the two default content-type
@@ -31184,8 +31377,9 @@ var OpcPackage = class OpcPackage {
31184
31377
  });
31185
31378
  }
31186
31379
  if (contentTypes === null) throw new Error("package is missing [Content_Types].xml");
31380
+ const resolveContentType = contentTypeResolver(contentTypes);
31187
31381
  for (const part of parts) {
31188
- const ct = lookupContentType(contentTypes, part.name);
31382
+ const ct = resolveContentType(part.name);
31189
31383
  if (ct === null) throw new Error(`part "${part.name}" has no content type registered in [Content_Types].xml`);
31190
31384
  part.contentType = ct;
31191
31385
  }
@@ -31208,8 +31402,7 @@ var OpcPackage = class OpcPackage {
31208
31402
  * Looks up a part by name (case-insensitive per OPC §9.1.1.7).
31209
31403
  */
31210
31404
  getPart(name) {
31211
- for (const p of this.parts) if (partNamesEqual(p.name, name)) return p;
31212
- return null;
31405
+ return this.partsByName.get(name.toLowerCase()) ?? null;
31213
31406
  }
31214
31407
  /**
31215
31408
  * Adds a new part. Throws if a part with the same name (case-insensitive)
@@ -31223,7 +31416,8 @@ var OpcPackage = class OpcPackage {
31223
31416
  contentType,
31224
31417
  data
31225
31418
  };
31226
- this.parts.push(part);
31419
+ this.partList.push(part);
31420
+ this.partsByName.set(name.toLowerCase(), part);
31227
31421
  if (lookupContentType(this.contentTypes, name) !== contentType) this.contentTypes.overrides.push({
31228
31422
  partName: name,
31229
31423
  contentType
@@ -31237,14 +31431,35 @@ var OpcPackage = class OpcPackage {
31237
31431
  */
31238
31432
  removePart(name) {
31239
31433
  let removed = false;
31240
- for (let i = this.parts.length - 1; i >= 0; i--) {
31241
- const p = this.parts[i];
31434
+ for (let i = this.partList.length - 1; i >= 0; i--) {
31435
+ const p = this.partList[i];
31242
31436
  if (p && partNamesEqual(p.name, name)) {
31243
- this.parts.splice(i, 1);
31437
+ this.partList.splice(i, 1);
31244
31438
  removed = true;
31245
31439
  }
31246
31440
  }
31247
- if (removed) this.contentTypes.overrides = this.contentTypes.overrides.filter((o) => !partNamesEqual(o.partName, name));
31441
+ if (removed) {
31442
+ this.partsByName.delete(name.toLowerCase());
31443
+ this.contentTypes.overrides = this.contentTypes.overrides.filter((o) => !partNamesEqual(o.partName, name));
31444
+ }
31445
+ return removed;
31446
+ }
31447
+ /**
31448
+ * Keeps only the parts `keep` accepts and drops the `Override` entries of
31449
+ * the removed ones, in one pass (`removePart` per part would be O(n²)).
31450
+ * Returns the removed part names in package order.
31451
+ */
31452
+ retainParts(keep) {
31453
+ const removed = [];
31454
+ let kept = 0;
31455
+ for (const part of this.partList) if (keep(part)) this.partList[kept++] = part;
31456
+ else removed.push(part.name);
31457
+ this.partList.length = kept;
31458
+ if (removed.length > 0) {
31459
+ this.indexParts();
31460
+ const gone = new Set(removed.map((name) => name.toLowerCase()));
31461
+ this.contentTypes.overrides = this.contentTypes.overrides.filter((o) => !gone.has(o.partName.toLowerCase()));
31462
+ }
31248
31463
  return removed;
31249
31464
  }
31250
31465
  /**
@@ -31448,9 +31663,9 @@ const savePresentation = (pres) => {
31448
31663
  };
31449
31664
  //#endregion
31450
31665
  //#region src/api/fn/_helpers.ts
31451
- const TEXT_DECODER = new TextDecoder();
31666
+ const TEXT_DECODER$1 = new TextDecoder();
31452
31667
  const TEXT_ENCODER$1 = new TextEncoder();
31453
- const decode$1 = (b) => TEXT_DECODER.decode(b);
31668
+ const decode$1 = (b) => TEXT_DECODER$1.decode(b);
31454
31669
  const encode$1 = (s) => TEXT_ENCODER$1.encode(s);
31455
31670
  const SLIDE_LAYOUT_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
31456
31671
  const SLIDE_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
@@ -32711,7 +32926,7 @@ const NAME_THEME_ELEMENTS = qname("a", "themeElements", NS.dml);
32711
32926
  const NAME_CLR_SCHEME = qname("a", "clrScheme", NS.dml);
32712
32927
  const NAME_SRGB_CLR$1 = qname("a", "srgbClr", NS.dml);
32713
32928
  const NAME_SYS_CLR = qname("a", "sysClr", NS.dml);
32714
- const ATTR_VAL$4 = qname("", "val", "");
32929
+ const ATTR_VAL$5 = qname("", "val", "");
32715
32930
  const ATTR_NAME$4 = qname("", "name", "");
32716
32931
  const ATTR_TYPEFACE$1 = qname("", "typeface", "");
32717
32932
  const CLR_SCHEME_SLOTS = [
@@ -32899,7 +33114,7 @@ const setPresentationTheme = (pres, theme) => {
32899
33114
  const slotName = qname("a", local, NS.dml);
32900
33115
  const idx = clrScheme.children.findIndex((c) => c.kind === "element" && c.name.namespaceURI === NS.dml && c.name.localName === local);
32901
33116
  if (idx < 0) throw new Error(`setPresentationTheme: clrScheme is missing <a:${local}>`);
32902
- clrScheme.children[idx] = elem(slotName, { children: [elem(NAME_SRGB_CLR$1, { attrs: [attr(ATTR_VAL$4, hex)] })] });
33117
+ clrScheme.children[idx] = elem(slotName, { children: [elem(NAME_SRGB_CLR$1, { attrs: [attr(ATTR_VAL$5, hex)] })] });
32903
33118
  }
32904
33119
  themePart.data = encode$1(serializeXml(doc));
32905
33120
  };
@@ -34146,6 +34361,30 @@ const buildClickAction = (slide, action) => {
34146
34361
  return elem(NAME_HLINK_CLICK_FN, { attrs });
34147
34362
  };
34148
34363
  //#endregion
34364
+ //#region src/internal/chartml/secondary-axis.ts
34365
+ /** The `ChartAxisScaling` fields written flat on a secondary value axis. */
34366
+ const flatSecondaryScaling = (axis) => ({
34367
+ ...axis.min !== void 0 ? { min: axis.min } : {},
34368
+ ...axis.max !== void 0 ? { max: axis.max } : {},
34369
+ ...axis.majorUnit !== void 0 ? { majorUnit: axis.majorUnit } : {},
34370
+ ...axis.minorUnit !== void 0 ? { minorUnit: axis.minorUnit } : {},
34371
+ ...axis.numberFormat !== void 0 ? { numberFormat: axis.numberFormat } : {},
34372
+ ...axis.logBase !== void 0 ? { logBase: axis.logBase } : {},
34373
+ ...axis.displayUnits !== void 0 ? { displayUnits: axis.displayUnits } : {},
34374
+ ...axis.displayUnitsLabel !== void 0 ? { displayUnitsLabel: axis.displayUnitsLabel } : {}
34375
+ });
34376
+ /**
34377
+ * The secondary axis's scaling from whichever form it was written in: the
34378
+ * flat fields, or the deprecated `scaling` object. Validation rejects a spec
34379
+ * that sets both, so at most one of them is non-empty here.
34380
+ */
34381
+ const secondaryAxisScaling = (axis) => {
34382
+ if (axis === void 0) return void 0;
34383
+ if (axis.scaling !== void 0) return axis.scaling;
34384
+ const flat = flatSecondaryScaling(axis);
34385
+ return Object.keys(flat).length > 0 ? flat : void 0;
34386
+ };
34387
+ //#endregion
34149
34388
  //#region src/internal/chartml/enum-validation.ts
34150
34389
  const LABEL_POSITIONS = [
34151
34390
  "ctr",
@@ -34335,7 +34574,12 @@ const validateChartSpecEnums = (spec, caller) => {
34335
34574
  validateLabels(spec.dataLabels, `${caller}: dataLabels`);
34336
34575
  validateScaling(spec.valueAxis, `${caller}: valueAxis`);
34337
34576
  validateScaling(spec.categoryAxisScaling, `${caller}: categoryAxisScaling`);
34338
- validateScaling(spec.secondaryValueAxis?.scaling, `${caller}: secondaryValueAxis.scaling`);
34577
+ const secondary = spec.secondaryValueAxis;
34578
+ if (secondary?.scaling !== void 0) {
34579
+ const flat = Object.keys(flatSecondaryScaling(secondary));
34580
+ if (flat.length > 0) throw new Error(`${caller}: secondaryValueAxis.scaling cannot be combined with secondaryValueAxis.${flat[0]}; write the scaling fields directly on secondaryValueAxis (scaling is deprecated)`);
34581
+ }
34582
+ validateScaling(secondaryAxisScaling(secondary), `${caller}: secondaryValueAxis${secondary?.scaling !== void 0 ? ".scaling" : ""}`);
34339
34583
  for (const [index, series] of spec.series.entries()) {
34340
34584
  const field = `${caller}: series[${index}]`;
34341
34585
  if (series.chartKind !== void 0) oneOf(series.chartKind, [
@@ -34733,11 +34977,11 @@ const NS_R = NS.officeDocRels;
34733
34977
  const c = (local) => qname("c", local, NS_C$1);
34734
34978
  const a$2 = (local) => qname("a", local, NS_A$1);
34735
34979
  const r = (local) => qname("r", local, NS_R);
34736
- const ATTR_VAL$3 = qname("", "val", "");
34737
- const ATTR_IDX$2 = qname("", "idx", "");
34738
- const valNode = (name, val) => elem(name, { attrs: [attr(ATTR_VAL$3, String(val))] });
34980
+ const ATTR_VAL$4 = qname("", "val", "");
34981
+ const ATTR_IDX$3 = qname("", "idx", "");
34982
+ const valNode = (name, val) => elem(name, { attrs: [attr(ATTR_VAL$4, String(val))] });
34739
34983
  const ptNode = (idx, value) => elem(c("pt"), {
34740
- attrs: [attr(ATTR_IDX$2, String(idx))],
34984
+ attrs: [attr(ATTR_IDX$3, String(idx))],
34741
34985
  children: [elem(c("v"), { children: [text(value)] })]
34742
34986
  });
34743
34987
  const strRef = (formula, points) => {
@@ -34753,7 +34997,7 @@ const numRef = (formula, points, formatCode = "General") => elem(c("numRef"), {
34753
34997
  const multiLvlStrRef = (formula, levels, pointCount) => elem(c("multiLvlStrRef"), { children: [elem(c("f"), { children: [text(formula)] }), elem(c("multiLvlStrCache"), { children: [valNode(c("ptCount"), pointCount), ...levels.map((level, depth) => elem(c("lvl"), { children: level.map((label, i) => depth > 0 && label === "" ? null : ptNode(i, label)).filter((n) => n !== null) }))] })] });
34754
34998
  const hexOf = (color) => color.replace(/^#/, "").toUpperCase();
34755
34999
  const solidFill = (color, opacity) => elem(a$2("solidFill"), { children: [elem(a$2("srgbClr"), {
34756
- attrs: [attr(ATTR_VAL$3, hexOf(color))],
35000
+ attrs: [attr(ATTR_VAL$4, hexOf(color))],
34757
35001
  children: opacity !== void 0 ? [valNode(a$2("alpha"), boundedInt(opacity * 1e5, "percent100000", "chart series: fillOpacity"))] : []
34758
35002
  })] });
34759
35003
  const solidFillSpPr = (color, opacity) => elem(c("spPr"), { children: [solidFill(color, opacity)] });
@@ -34935,8 +35179,7 @@ const seriesElement = (spec, seriesIdx, layout) => {
34935
35179
  children.push(markerElement(series.markerSymbol ?? (markersOff ? "none" : void 0), series.markerSizePt, markerColor, markerLineColor));
34936
35180
  }
34937
35181
  for (const dPt of dPtElements(series.pointColors, series.pointExplosions, series.fillOpacity, spec.bubble3D === true)) children.push(dPt);
34938
- if (series.pointDataLabels !== void 0 && series.dataLabels === void 0) throw new Error(`chart: series '${series.name}' sets pointDataLabels without dataLabels; add the series-level dataLabels the overrides fall back to`);
34939
- const serDLbls = buildDLblsFromLabels(series.dataLabels, series.pointDataLabels);
35182
+ const serDLbls = buildDLblsFromLabels(series.dataLabels ?? (series.pointDataLabels !== void 0 ? spec.dataLabels ?? HIDDEN_DATA_LABELS : void 0), series.pointDataLabels);
34940
35183
  if (serDLbls !== null) children.push(serDLbls);
34941
35184
  if (series.trendline && SHAPES_WITH_TRENDLINE.has(shape) && spec.kind !== "stock") children.push(trendlineElement(series.trendline));
34942
35185
  if (series.errorBars !== void 0 || series.xErrorBars !== void 0) {
@@ -35030,8 +35273,7 @@ const catAxis = (spec) => {
35030
35273
  if (spec.categoryAxisMinorGridlines) children.push(gridlinesElement("minorGridlines", spec.categoryAxisMinorGridlineColor, spec.categoryAxisMinorGridlineWidthEmu, "chart: categoryAxisMinorGridlineWidthEmu"));
35031
35274
  if (spec.categoryAxisTitle !== void 0) children.push(titleElement(spec.categoryAxisTitle, spec.categoryAxisTitleStyle, spec.categoryAxisTitleRotationDeg));
35032
35275
  if (spec.categoryAxisNumberFormat !== void 0) children.push(elem(c("numFmt"), { attrs: [attr(qname("", "formatCode", ""), spec.categoryAxisNumberFormat), attr(qname("", "sourceLinked", ""), "0")] }));
35033
- if (spec.categoryAxisMajorTickMark !== void 0) children.push(valNode(c("majorTickMark"), spec.categoryAxisMajorTickMark));
35034
- if (spec.categoryAxisMinorTickMark !== void 0) children.push(valNode(c("minorTickMark"), spec.categoryAxisMinorTickMark));
35276
+ children.push(valNode(c("majorTickMark"), spec.categoryAxisMajorTickMark ?? (spec.kind === "bar" || spec.kind === "column" ? "none" : "out")), valNode(c("minorTickMark"), spec.categoryAxisMinorTickMark ?? "none"));
35035
35277
  if (spec.categoryAxisTickLabelPos !== void 0) children.push(valNode(c("tickLblPos"), spec.categoryAxisTickLabelPos));
35036
35278
  const catLine = lineSpPr(spec.categoryAxisLineColor, spec.categoryAxisLineWidthEmu, "chart: categoryAxisLineWidthEmu", spec.categoryAxisLineHidden === true);
35037
35279
  if (catLine !== null) children.push(catLine);
@@ -35071,8 +35313,7 @@ const valueAxisElement = (f, ids) => {
35071
35313
  if (f.minorGridlines) children.push(gridlinesElement("minorGridlines", f.minorGridlineColor, f.minorGridlineWidthEmu, `chart: ${f.widthFields.minorGridline}`));
35072
35314
  if (f.title !== void 0) children.push(titleElement(f.title, f.titleStyle, f.titleRotationDeg));
35073
35315
  if (f.scaling?.numberFormat !== void 0) children.push(elem(c("numFmt"), { attrs: [attr(qname("", "formatCode", ""), f.scaling.numberFormat), attr(qname("", "sourceLinked", ""), "0")] }));
35074
- if (f.majorTickMark !== void 0) children.push(valNode(c("majorTickMark"), f.majorTickMark));
35075
- if (f.minorTickMark !== void 0) children.push(valNode(c("minorTickMark"), f.minorTickMark));
35316
+ children.push(valNode(c("majorTickMark"), f.majorTickMark ?? "out"), valNode(c("minorTickMark"), f.minorTickMark ?? "none"));
35076
35317
  if (f.tickLabelPos !== void 0) children.push(valNode(c("tickLblPos"), f.tickLabelPos));
35077
35318
  const axisLine = lineSpPr(f.lineColor, f.lineWidthEmu, `chart: ${f.widthFields.line}`, f.lineHidden === true);
35078
35319
  if (axisLine !== null) children.push(axisLine);
@@ -35176,6 +35417,7 @@ const serAxis = (spec) => {
35176
35417
  ];
35177
35418
  if (s.majorGridlines) children.push(elem(c("majorGridlines")));
35178
35419
  if (s.title !== void 0) children.push(titleElement(s.title, s.titleStyle));
35420
+ children.push(valNode(c("majorTickMark"), "out"), valNode(c("minorTickMark"), "none"));
35179
35421
  if (s.tickLabelPos !== void 0) children.push(valNode(c("tickLblPos"), s.tickLabelPos));
35180
35422
  const line = lineSpPr(s.lineColor, void 0, "chart: seriesAxis");
35181
35423
  if (line !== null) children.push(line);
@@ -35185,13 +35427,19 @@ const serAxis = (spec) => {
35185
35427
  if (s.tickLabelSkip !== void 0) children.push(valNode(c("tickLblSkip"), s.tickLabelSkip));
35186
35428
  return elem(c("serAx"), { children });
35187
35429
  };
35430
+ const HIDDEN_DATA_LABELS = {
35431
+ showValue: false,
35432
+ showCategory: false,
35433
+ showSeriesName: false,
35434
+ showPercent: false
35435
+ };
35188
35436
  const buildDLblsFromLabels = (dl, pointLabels = void 0) => {
35189
35437
  const children = [];
35190
35438
  pointLabels?.forEach((pl, i) => {
35191
35439
  if (pl === null) return;
35192
35440
  children.push(elem(c("dLbl"), { children: [
35193
35441
  valNode(c("idx"), i),
35194
- ...pl.text !== void 0 ? [elem(c("tx"), { children: [richText(pl.text)] })] : [],
35442
+ ...pl.text !== void 0 ? [elem(c("tx"), { children: [richText(pl.text, pl.textStyle)] })] : [],
35195
35443
  ...dLblGroupChildren(pl)
35196
35444
  ] }));
35197
35445
  });
@@ -35427,7 +35675,7 @@ const buildPlotGroup = (g, kind) => {
35427
35675
  const secondaryValAxis = (spec) => {
35428
35676
  const s = spec.secondaryValueAxis ?? {};
35429
35677
  return valueAxisElement({
35430
- scaling: s.scaling,
35678
+ scaling: secondaryAxisScaling(spec.secondaryValueAxis),
35431
35679
  orientation: void 0,
35432
35680
  hidden: void 0,
35433
35681
  majorGridlines: s.majorGridlines,
@@ -35503,11 +35751,15 @@ const manualLayoutElement = (position, size, target) => elem(c("layout"), { chil
35503
35751
  valNode(c("y"), position.y),
35504
35752
  ...size !== void 0 ? [valNode(c("w"), size.w), valNode(c("h"), size.h)] : []
35505
35753
  ] })] });
35506
- const richText = (value) => elem(c("rich"), { children: [
35507
- elem(a$2("bodyPr")),
35508
- elem(a$2("lstStyle")),
35509
- elem(a$2("p"), { children: [elem(a$2("r"), { children: [elem(a$2("t"), { children: [text(value)] })] })] })
35510
- ] });
35754
+ const richText = (value, style) => {
35755
+ const run = elem(a$2("r"), { children: [...style !== void 0 ? [elem(a$2("rPr"), rPrAttrsFromStyle(style))] : [], elem(a$2("t"), { children: [text(value)] })] });
35756
+ const pPr = style !== void 0 ? [elem(a$2("pPr"), { children: [elem(a$2("defRPr"), rPrAttrsFromStyle(style))] })] : [];
35757
+ return elem(c("rich"), { children: [
35758
+ elem(a$2("bodyPr")),
35759
+ elem(a$2("lstStyle")),
35760
+ elem(a$2("p"), { children: [...pPr, run] })
35761
+ ] });
35762
+ };
35511
35763
  const titleElement = (title, style, rotationDeg, placement) => {
35512
35764
  const pPr = elem(a$2("pPr"), { children: [elem(a$2("defRPr"))] });
35513
35765
  const { attrs: runAttrs, children: runChildren } = rPrAttrsFromStyle(style);
@@ -35742,8 +35994,8 @@ const NAME_R_DML = qname("a", "r", NS_A);
35742
35994
  const NAME_SP_PR_C = qname("c", "spPr", NS_C);
35743
35995
  const NAME_SOLID_FILL$1 = qname("a", "solidFill", NS_A);
35744
35996
  const NAME_SRGB_CLR = qname("a", "srgbClr", NS_A);
35745
- const ATTR_VAL$2 = qname("", "val", "");
35746
- const ATTR_IDX$1 = qname("", "idx", "");
35997
+ const ATTR_VAL$3 = qname("", "val", "");
35998
+ const ATTR_IDX$2 = qname("", "idx", "");
35747
35999
  /** Kinds a combo plot group can carry (mirrors `ChartSeries.chartKind`). */
35748
36000
  const isComboSeriesKind = (kind) => kind === "bar" || kind === "column" || kind === "line" || kind === "area";
35749
36001
  const KIND_MAP = [
@@ -35821,11 +36073,11 @@ const findFirst = (parent, names) => {
35821
36073
  };
35822
36074
  const readPtCount = (host) => {
35823
36075
  const ptCountEl = firstChildElement(host, NAME_PT_COUNT);
35824
- const raw = ptCountEl !== null ? getAttrValue(ptCountEl, ATTR_VAL$2) : null;
36076
+ const raw = ptCountEl !== null ? getAttrValue(ptCountEl, ATTR_VAL$3) : null;
35825
36077
  return raw !== null ? Number.parseInt(raw, 10) : NaN;
35826
36078
  };
35827
36079
  const readXmlBool = (el) => {
35828
- const v = getAttrValue(el, ATTR_VAL$2);
36080
+ const v = getAttrValue(el, ATTR_VAL$3);
35829
36081
  return v === null || v === "1" || v === "true";
35830
36082
  };
35831
36083
  const parsePointIndex = (raw, limit) => {
@@ -35835,14 +36087,14 @@ const parsePointIndex = (raw, limit) => {
35835
36087
  };
35836
36088
  const readPointIndex = (host, pointCount) => {
35837
36089
  const idxEl = firstChildElement(host, qname("c", "idx", NS_C));
35838
- return parsePointIndex(idxEl !== null ? getAttrValue(idxEl, ATTR_VAL$2) : null, pointCount);
36090
+ return parsePointIndex(idxEl !== null ? getAttrValue(idxEl, ATTR_VAL$3) : null, pointCount);
35839
36091
  };
35840
36092
  const readPtArray = (cache, countHost = cache) => {
35841
36093
  const out = [];
35842
36094
  const ptCount = readPtCount(countHost);
35843
36095
  const idxLimit = Number.isFinite(ptCount) ? Math.min(ptCount, MAX_PT_COUNT) : MAX_PT_COUNT;
35844
36096
  for (const pt of allChildElements(cache, NAME_PT)) {
35845
- const idx = parsePointIndex(getAttrValue(pt, ATTR_IDX$1), idxLimit);
36097
+ const idx = parsePointIndex(getAttrValue(pt, ATTR_IDX$2), idxLimit);
35846
36098
  if (idx === null) continue;
35847
36099
  const v = firstChildElement(pt, NAME_V);
35848
36100
  if (v === null) continue;
@@ -35911,7 +36163,7 @@ const readDataPointOverrides = (ser, pointCount) => {
35911
36163
  if (solidFill) {
35912
36164
  const srgb = firstChildElement(solidFill, NAME_SRGB_CLR);
35913
36165
  if (srgb) {
35914
- const val = getAttrValue(srgb, ATTR_VAL$2);
36166
+ const val = getAttrValue(srgb, ATTR_VAL$3);
35915
36167
  if (val !== null) {
35916
36168
  colors[idx] = `#${val.toUpperCase()}`;
35917
36169
  anyColor = true;
@@ -35921,7 +36173,7 @@ const readDataPointOverrides = (ser, pointCount) => {
35921
36173
  }
35922
36174
  const explEl = firstChildElement(c, qname("c", "explosion", NS_C));
35923
36175
  if (explEl) {
35924
- const v = getAttrValue(explEl, ATTR_VAL$2);
36176
+ const v = getAttrValue(explEl, ATTR_VAL$3);
35925
36177
  if (v !== null) {
35926
36178
  const n = Number.parseInt(v, 10);
35927
36179
  if (Number.isFinite(n) && n > 0) {
@@ -35947,7 +36199,7 @@ const readTrendline = (ser) => {
35947
36199
  if (acc.length > 0) name = acc;
35948
36200
  }
35949
36201
  const typeEl = firstChildElement(tl, qname("c", "trendlineType", NS_C));
35950
- const tToken = typeEl ? getAttrValue(typeEl, ATTR_VAL$2) : null;
36202
+ const tToken = typeEl ? getAttrValue(typeEl, ATTR_VAL$3) : null;
35951
36203
  let type;
35952
36204
  switch (tToken) {
35953
36205
  case "exp":
@@ -35964,7 +36216,7 @@ const readTrendline = (ser) => {
35964
36216
  if (type === "movingAvg") {
35965
36217
  const pEl = firstChildElement(tl, qname("c", "period", NS_C));
35966
36218
  if (pEl) {
35967
- const v = getAttrValue(pEl, ATTR_VAL$2);
36219
+ const v = getAttrValue(pEl, ATTR_VAL$3);
35968
36220
  if (v !== null) {
35969
36221
  const n = Number.parseInt(v, 10);
35970
36222
  if (Number.isFinite(n) && n > 0) period = n;
@@ -35975,7 +36227,7 @@ const readTrendline = (ser) => {
35975
36227
  if (type === "poly") {
35976
36228
  const oEl = firstChildElement(tl, qname("c", "order", NS_C));
35977
36229
  if (oEl) {
35978
- const v = getAttrValue(oEl, ATTR_VAL$2);
36230
+ const v = getAttrValue(oEl, ATTR_VAL$3);
35979
36231
  if (v !== null) {
35980
36232
  const n = Number.parseInt(v, 10);
35981
36233
  if (Number.isFinite(n) && n >= 2) order = n;
@@ -35991,7 +36243,7 @@ const readTrendline = (ser) => {
35991
36243
  if (solid) {
35992
36244
  const srgb = firstChildElement(solid, NAME_SRGB_CLR);
35993
36245
  if (srgb) {
35994
- const v = getAttrValue(srgb, ATTR_VAL$2);
36246
+ const v = getAttrValue(srgb, ATTR_VAL$3);
35995
36247
  if (v !== null) color = `#${v.toUpperCase()}`;
35996
36248
  }
35997
36249
  }
@@ -36000,7 +36252,7 @@ const readTrendline = (ser) => {
36000
36252
  const readExtension = (local) => {
36001
36253
  const el = firstChildElement(tl, qname("c", local, NS_C));
36002
36254
  if (!el) return void 0;
36003
- const raw = getAttrValue(el, ATTR_VAL$2);
36255
+ const raw = getAttrValue(el, ATTR_VAL$3);
36004
36256
  if (raw === null) return void 0;
36005
36257
  const n = Number.parseFloat(raw);
36006
36258
  return Number.isFinite(n) && n > 0 ? n : void 0;
@@ -36010,7 +36262,7 @@ const readTrendline = (ser) => {
36010
36262
  const readDispBool = (local) => {
36011
36263
  const el = firstChildElement(tl, qname("c", local, NS_C));
36012
36264
  if (!el) return void 0;
36013
- const v = getAttrValue(el, ATTR_VAL$2);
36265
+ const v = getAttrValue(el, ATTR_VAL$3);
36014
36266
  return v === null || v === "1" || v === "true" ? true : void 0;
36015
36267
  };
36016
36268
  const displayEquation = readDispBool("dispEq");
@@ -36034,13 +36286,13 @@ const readSeriesColor = (ser) => {
36034
36286
  if (!solidFill) return void 0;
36035
36287
  const srgb = firstChildElement(solidFill, NAME_SRGB_CLR);
36036
36288
  if (!srgb) return void 0;
36037
- const v = getAttrValue(srgb, ATTR_VAL$2);
36289
+ const v = getAttrValue(srgb, ATTR_VAL$3);
36038
36290
  return v !== null ? `#${v.toUpperCase()}` : void 0;
36039
36291
  };
36040
36292
  const readSolidSrgb = (host) => {
36041
36293
  const fill = host !== null ? firstChildElement(host, NAME_SOLID_FILL$1) : null;
36042
36294
  const srgb = fill !== null ? firstChildElement(fill, NAME_SRGB_CLR) : null;
36043
- const color = srgb !== null ? getAttrValue(srgb, ATTR_VAL$2) : null;
36295
+ const color = srgb !== null ? getAttrValue(srgb, ATTR_VAL$3) : null;
36044
36296
  return color !== null ? `#${color.toUpperCase()}` : void 0;
36045
36297
  };
36046
36298
  const readSeriesMarker = (ser) => {
@@ -36054,12 +36306,12 @@ const readSeriesMarker = (ser) => {
36054
36306
  if (lineColor !== void 0) out.markerLineColor = lineColor;
36055
36307
  const symEl = firstChildElement(m, qname("c", "symbol", NS_C));
36056
36308
  if (symEl) {
36057
- const v = getAttrValue(symEl, ATTR_VAL$2);
36309
+ const v = getAttrValue(symEl, ATTR_VAL$3);
36058
36310
  if (v === "none" || v === "auto" || v === "circle" || v === "square" || v === "diamond" || v === "triangle" || v === "star" || v === "x" || v === "plus" || v === "dash" || v === "dot" || v === "picture") out.markerSymbol = v;
36059
36311
  }
36060
36312
  const sizeEl = firstChildElement(m, qname("c", "size", NS_C));
36061
36313
  if (sizeEl) {
36062
- const v = getAttrValue(sizeEl, ATTR_VAL$2);
36314
+ const v = getAttrValue(sizeEl, ATTR_VAL$3);
36063
36315
  if (v !== null) {
36064
36316
  const n = Number.parseInt(v, 10);
36065
36317
  if (Number.isFinite(n) && n > 0) out.markerSizePt = n;
@@ -36075,7 +36327,7 @@ const readSeriesLineProps = (ser) => {
36075
36327
  const out = {};
36076
36328
  const lnFill = firstChildElement(ln, NAME_SOLID_FILL$1);
36077
36329
  const lnSrgb = lnFill !== null ? firstChildElement(lnFill, NAME_SRGB_CLR) : null;
36078
- const lnColor = lnSrgb !== null ? getAttrValue(lnSrgb, ATTR_VAL$2) : null;
36330
+ const lnColor = lnSrgb !== null ? getAttrValue(lnSrgb, ATTR_VAL$3) : null;
36079
36331
  if (lnColor !== null) out.lineColor = `#${lnColor.toUpperCase()}`;
36080
36332
  const w = getAttrValue(ln, qname("", "w", ""));
36081
36333
  if (w !== null) {
@@ -36084,7 +36336,7 @@ const readSeriesLineProps = (ser) => {
36084
36336
  }
36085
36337
  const prstDash = firstChildElement(ln, qname("a", "prstDash", NS_A));
36086
36338
  if (prstDash) {
36087
- const v = getAttrValue(prstDash, ATTR_VAL$2);
36339
+ const v = getAttrValue(prstDash, ATTR_VAL$3);
36088
36340
  if (v !== null) out.lineDash = v;
36089
36341
  }
36090
36342
  return out;
@@ -36137,7 +36389,7 @@ const readRunStyle = (rPr) => {
36137
36389
  if (solidFill) {
36138
36390
  const srgb = firstChildElement(solidFill, NAME_A_SRGB);
36139
36391
  if (srgb) {
36140
- const v = getAttrValue(srgb, ATTR_VAL$2);
36392
+ const v = getAttrValue(srgb, ATTR_VAL$3);
36141
36393
  if (v !== null) color = `#${v.toUpperCase()}`;
36142
36394
  }
36143
36395
  }
@@ -36206,7 +36458,7 @@ const readTitleRotationDeg = (titleEl) => {
36206
36458
  const readDataLabelPosition = (dLbls) => {
36207
36459
  const el = firstChildElement(dLbls, qname("c", "dLblPos", NS_C));
36208
36460
  if (!el) return void 0;
36209
- const v = getAttrValue(el, ATTR_VAL$2);
36461
+ const v = getAttrValue(el, ATTR_VAL$3);
36210
36462
  switch (v) {
36211
36463
  case "ctr":
36212
36464
  case "inEnd":
@@ -36325,7 +36577,7 @@ const readValueAxisScaling = (valAx) => {
36325
36577
  const readNumOn = (parent, local) => {
36326
36578
  const el = firstChildElement(parent, qname("c", local, NS_C));
36327
36579
  if (!el) return void 0;
36328
- const v = getAttrValue(el, ATTR_VAL$2);
36580
+ const v = getAttrValue(el, ATTR_VAL$3);
36329
36581
  if (v === null) return void 0;
36330
36582
  const n = Number.parseFloat(v);
36331
36583
  return Number.isFinite(n) ? n : void 0;
@@ -36342,7 +36594,7 @@ const readValueAxisScaling = (valAx) => {
36342
36594
  if (dispUnits) {
36343
36595
  const builtIn = firstChildElement(dispUnits, qname("c", "builtInUnit", NS_C));
36344
36596
  if (builtIn) {
36345
- const v = getAttrValue(builtIn, ATTR_VAL$2);
36597
+ const v = getAttrValue(builtIn, ATTR_VAL$3);
36346
36598
  switch (v) {
36347
36599
  case "hundreds":
36348
36600
  case "thousands":
@@ -36378,7 +36630,7 @@ const readValueAxisScaling = (valAx) => {
36378
36630
  };
36379
36631
  const childVal = (parent, local) => {
36380
36632
  const el = firstChildElement(parent, qname("c", local, NS_C));
36381
- return el !== null ? getAttrValue(el, ATTR_VAL$2) : null;
36633
+ return el !== null ? getAttrValue(el, ATTR_VAL$3) : null;
36382
36634
  };
36383
36635
  const childNumber = (parent, local) => {
36384
36636
  const raw = childVal(parent, local);
@@ -36400,7 +36652,7 @@ const readSeriesFillOpacity = (ser) => {
36400
36652
  const fill = spPr !== null ? firstChildElement(spPr, NAME_SOLID_FILL$1) : null;
36401
36653
  const srgb = fill !== null ? firstChildElement(fill, NAME_SRGB_CLR) : null;
36402
36654
  const alpha = srgb !== null ? firstChildElement(srgb, qname("a", "alpha", NS_A)) : null;
36403
- const raw = alpha !== null ? getAttrValue(alpha, ATTR_VAL$2) : null;
36655
+ const raw = alpha !== null ? getAttrValue(alpha, ATTR_VAL$3) : null;
36404
36656
  if (raw === null || !/^\d+$/.test(raw)) return void 0;
36405
36657
  const n = Number.parseInt(raw, 10);
36406
36658
  return n <= ALPHA_OPAQUE ? n / ALPHA_OPAQUE : void 0;
@@ -36495,7 +36747,7 @@ const readOfPie = (group) => {
36495
36747
  const custSplit = firstChildElement(group, qname("c", "custSplit", NS_C));
36496
36748
  const customSplit = [];
36497
36749
  if (custSplit !== null) for (const pt of allChildElements(custSplit, qname("c", "secondPiePt", NS_C))) {
36498
- const idx = parsePointIndex(getAttrValue(pt, ATTR_VAL$2), MAX_PT_COUNT);
36750
+ const idx = parsePointIndex(getAttrValue(pt, ATTR_VAL$3), MAX_PT_COUNT);
36499
36751
  if (idx !== null) customSplit.push(idx);
36500
36752
  }
36501
36753
  const seriesLines = firstChildElement(group, qname("c", "serLines", NS_C)) !== null;
@@ -36672,7 +36924,7 @@ const readChartSpec = (root) => {
36672
36924
  let groupKind = mapped.kind;
36673
36925
  if (mapped.localName === "barChart" || mapped.localName === "bar3DChart") {
36674
36926
  const barDir = firstChildElement(child, qname("c", "barDir", NS_C));
36675
- groupKind = (barDir !== null ? getAttrValue(barDir, ATTR_VAL$2) : null) === "bar" ? "bar" : "column";
36927
+ groupKind = (barDir !== null ? getAttrValue(barDir, ATTR_VAL$3) : null) === "bar" ? "bar" : "column";
36676
36928
  }
36677
36929
  plotGroups.push({
36678
36930
  element: child,
@@ -36686,7 +36938,7 @@ const readChartSpec = (root) => {
36686
36938
  const groupAxisIds = (group) => {
36687
36939
  const ids = [];
36688
36940
  for (const axIdEl of allChildElements(group, qname("c", "axId", NS_C))) {
36689
- const id = getAttrValue(axIdEl, ATTR_VAL$2);
36941
+ const id = getAttrValue(axIdEl, ATTR_VAL$3);
36690
36942
  if (id !== null) ids.push(id);
36691
36943
  }
36692
36944
  return ids;
@@ -36694,7 +36946,7 @@ const readChartSpec = (root) => {
36694
36946
  const valAxisIds = /* @__PURE__ */ new Set();
36695
36947
  for (const el of allChildElements(plotArea, NAME_VAL_AX)) {
36696
36948
  const axIdEl = firstChildElement(el, qname("c", "axId", NS_C));
36697
- const id = axIdEl !== null ? getAttrValue(axIdEl, ATTR_VAL$2) : null;
36949
+ const id = axIdEl !== null ? getAttrValue(axIdEl, ATTR_VAL$3) : null;
36698
36950
  if (id !== null) valAxisIds.add(id);
36699
36951
  }
36700
36952
  const primaryAxisIds = new Set(groupAxisIds(plotted));
@@ -36782,7 +37034,7 @@ const readChartSpec = (root) => {
36782
37034
  let secValAx = null;
36783
37035
  for (const el of allChildElements(plotArea, NAME_VAL_AX)) {
36784
37036
  const axIdEl = firstChildElement(el, qname("c", "axId", NS_C));
36785
- const id = axIdEl !== null ? getAttrValue(axIdEl, ATTR_VAL$2) : null;
37037
+ const id = axIdEl !== null ? getAttrValue(axIdEl, ATTR_VAL$3) : null;
36786
37038
  if (id !== null && secondaryValAxisIds.has(id)) secValAx ??= el;
36787
37039
  else valAx ??= el;
36788
37040
  }
@@ -36811,7 +37063,7 @@ const readChartSpec = (root) => {
36811
37063
  if (kind === "column" || kind === "bar" || kind === "area" || kind === "line") {
36812
37064
  const groupingEl = firstChildElement(plotted, qname("c", "grouping", NS_C));
36813
37065
  if (groupingEl) {
36814
- const g = getAttrValue(groupingEl, ATTR_VAL$2);
37066
+ const g = getAttrValue(groupingEl, ATTR_VAL$3);
36815
37067
  if (g === "clustered" || g === "stacked" || g === "percentStacked" || g === "standard") grouping = g;
36816
37068
  }
36817
37069
  }
@@ -36824,7 +37076,7 @@ const readChartSpec = (root) => {
36824
37076
  const markerEl = firstChildElement(plotted, qname("c", "marker", NS_C));
36825
37077
  if (markerEl === null) lineMarkers = false;
36826
37078
  else {
36827
- const v = getAttrValue(markerEl, ATTR_VAL$2);
37079
+ const v = getAttrValue(markerEl, ATTR_VAL$3);
36828
37080
  lineMarkers = v === null ? true : v === "1" || v === "true";
36829
37081
  }
36830
37082
  }
@@ -36833,7 +37085,7 @@ const readChartSpec = (root) => {
36833
37085
  if (kind === "column" || kind === "bar") {
36834
37086
  const gwEl = firstChildElement(plotted, qname("c", "gapWidth", NS_C));
36835
37087
  if (gwEl) {
36836
- const v = getAttrValue(gwEl, ATTR_VAL$2);
37088
+ const v = getAttrValue(gwEl, ATTR_VAL$3);
36837
37089
  if (v !== null) {
36838
37090
  const n = Number.parseInt(v, 10);
36839
37091
  if (Number.isFinite(n)) gapWidthPct = n;
@@ -36841,7 +37093,7 @@ const readChartSpec = (root) => {
36841
37093
  }
36842
37094
  const ovEl = firstChildElement(plotted, qname("c", "overlap", NS_C));
36843
37095
  if (ovEl) {
36844
- const v = getAttrValue(ovEl, ATTR_VAL$2);
37096
+ const v = getAttrValue(ovEl, ATTR_VAL$3);
36845
37097
  if (v !== null) {
36846
37098
  const n = Number.parseInt(v, 10);
36847
37099
  if (Number.isFinite(n)) overlapPct = n;
@@ -36861,7 +37113,7 @@ const readChartSpec = (root) => {
36861
37113
  const readTickMarkLocal = (axis, local) => {
36862
37114
  const el = firstChildElement(axis, qname("c", local, NS_C));
36863
37115
  if (!el) return void 0;
36864
- const v = getAttrValue(el, ATTR_VAL$2);
37116
+ const v = getAttrValue(el, ATTR_VAL$3);
36865
37117
  if (v === "in" || v === "out" || v === "cross" || v === "none") return v;
36866
37118
  };
36867
37119
  const readTickMark = (axis) => readTickMarkLocal(axis, "majorTickMark");
@@ -36900,7 +37152,7 @@ const readChartSpec = (root) => {
36900
37152
  if (!solid) return void 0;
36901
37153
  const srgb = firstChildElement(solid, NAME_SRGB_CLR);
36902
37154
  if (!srgb) return void 0;
36903
- const v = getAttrValue(srgb, ATTR_VAL$2);
37155
+ const v = getAttrValue(srgb, ATTR_VAL$3);
36904
37156
  return v !== null ? `#${v.toUpperCase()}` : void 0;
36905
37157
  };
36906
37158
  const readLineWidthEmu = (host) => {
@@ -36919,14 +37171,14 @@ const readChartSpec = (root) => {
36919
37171
  if (!solid) return void 0;
36920
37172
  const srgb = firstChildElement(solid, NAME_SRGB_CLR);
36921
37173
  if (!srgb) return void 0;
36922
- const v = getAttrValue(srgb, ATTR_VAL$2);
37174
+ const v = getAttrValue(srgb, ATTR_VAL$3);
36923
37175
  return v !== null ? `#${v.toUpperCase()}` : void 0;
36924
37176
  };
36925
37177
  const catAx = xValAx ?? findFirst(plotArea, ["catAx", "dateAx"]);
36926
37178
  const isHidden = (axis) => {
36927
37179
  const d = firstChildElement(axis, qname("c", "delete", NS_C));
36928
37180
  if (!d) return void 0;
36929
- const v = getAttrValue(d, ATTR_VAL$2);
37181
+ const v = getAttrValue(d, ATTR_VAL$3);
36930
37182
  return v === null || v === "1" || v === "true";
36931
37183
  };
36932
37184
  let categoryAxisOrientation;
@@ -36939,7 +37191,7 @@ const readChartSpec = (root) => {
36939
37191
  if (!scaling) return void 0;
36940
37192
  const orientationEl = firstChildElement(scaling, qname("c", "orientation", NS_C));
36941
37193
  if (!orientationEl) return void 0;
36942
- const v = getAttrValue(orientationEl, ATTR_VAL$2);
37194
+ const v = getAttrValue(orientationEl, ATTR_VAL$3);
36943
37195
  if (v === "minMax" || v === "maxMin") return v;
36944
37196
  };
36945
37197
  if (catAx) {
@@ -36982,7 +37234,7 @@ const readChartSpec = (root) => {
36982
37234
  categoryAxisMinorTickMark = readTickMarkLocal(catAx, "minorTickMark");
36983
37235
  const skipEl = firstChildElement(catAx, qname("c", "tickLblSkip", NS_C));
36984
37236
  if (skipEl) {
36985
- const v = getAttrValue(skipEl, ATTR_VAL$2);
37237
+ const v = getAttrValue(skipEl, ATTR_VAL$3);
36986
37238
  if (v !== null) {
36987
37239
  const n = Number.parseInt(v, 10);
36988
37240
  if (Number.isFinite(n) && n > 1) categoryAxisTickLabelSkip = n;
@@ -36990,7 +37242,7 @@ const readChartSpec = (root) => {
36990
37242
  }
36991
37243
  const markSkipEl = firstChildElement(catAx, qname("c", "tickMarkSkip", NS_C));
36992
37244
  if (markSkipEl) {
36993
- const v = getAttrValue(markSkipEl, ATTR_VAL$2);
37245
+ const v = getAttrValue(markSkipEl, ATTR_VAL$3);
36994
37246
  if (v !== null) {
36995
37247
  const n = Number.parseInt(v, 10);
36996
37248
  if (Number.isFinite(n) && n > 1) categoryAxisTickMarkSkip = n;
@@ -36998,12 +37250,12 @@ const readChartSpec = (root) => {
36998
37250
  }
36999
37251
  const posEl = firstChildElement(catAx, qname("c", "tickLblPos", NS_C));
37000
37252
  if (posEl) {
37001
- const v = getAttrValue(posEl, ATTR_VAL$2);
37253
+ const v = getAttrValue(posEl, ATTR_VAL$3);
37002
37254
  if (v === "none" || v === "low" || v === "high" || v === "nextTo") categoryAxisTickLabelPos = v;
37003
37255
  }
37004
37256
  const lblOffsetEl = firstChildElement(catAx, qname("c", "lblOffset", NS_C));
37005
37257
  if (lblOffsetEl) {
37006
- const v = getAttrValue(lblOffsetEl, ATTR_VAL$2);
37258
+ const v = getAttrValue(lblOffsetEl, ATTR_VAL$3);
37007
37259
  if (v !== null) {
37008
37260
  const n = Number.parseInt(v, 10);
37009
37261
  if (Number.isFinite(n) && n !== 100) categoryAxisLabelOffset = n;
@@ -37011,7 +37263,7 @@ const readChartSpec = (root) => {
37011
37263
  }
37012
37264
  const lblAlgnEl = firstChildElement(catAx, qname("c", "lblAlgn", NS_C));
37013
37265
  if (lblAlgnEl) {
37014
- const v = getAttrValue(lblAlgnEl, ATTR_VAL$2);
37266
+ const v = getAttrValue(lblAlgnEl, ATTR_VAL$3);
37015
37267
  if (v === "ctr" || v === "l" || v === "r") categoryAxisLabelAlign = v;
37016
37268
  }
37017
37269
  const catNumFmtEl = firstChildElement(catAx, qname("c", "numFmt", NS_C));
@@ -37021,7 +37273,7 @@ const readChartSpec = (root) => {
37021
37273
  }
37022
37274
  const noMultiLvlEl = firstChildElement(catAx, qname("c", "noMultiLvlLbl", NS_C));
37023
37275
  if (noMultiLvlEl) {
37024
- const v = getAttrValue(noMultiLvlEl, ATTR_VAL$2);
37276
+ const v = getAttrValue(noMultiLvlEl, ATTR_VAL$3);
37025
37277
  if (v === "1" || v === "true") categoryAxisNoMultiLevelLabel = true;
37026
37278
  }
37027
37279
  }
@@ -37056,12 +37308,12 @@ const readChartSpec = (root) => {
37056
37308
  valueAxisMinorTickMark = readTickMarkLocal(valAx, "minorTickMark");
37057
37309
  const valPosEl = firstChildElement(valAx, qname("c", "tickLblPos", NS_C));
37058
37310
  if (valPosEl) {
37059
- const v = getAttrValue(valPosEl, ATTR_VAL$2);
37311
+ const v = getAttrValue(valPosEl, ATTR_VAL$3);
37060
37312
  if (v === "none" || v === "low" || v === "high" || v === "nextTo") valueAxisTickLabelPos = v;
37061
37313
  }
37062
37314
  const crossesAtEl = firstChildElement(valAx, qname("c", "crossesAt", NS_C));
37063
37315
  if (crossesAtEl) {
37064
- const v = getAttrValue(crossesAtEl, ATTR_VAL$2);
37316
+ const v = getAttrValue(crossesAtEl, ATTR_VAL$3);
37065
37317
  if (v !== null) {
37066
37318
  const n = Number.parseFloat(v);
37067
37319
  if (Number.isFinite(n)) valueAxisCrosses = { at: n };
@@ -37069,13 +37321,13 @@ const readChartSpec = (root) => {
37069
37321
  } else {
37070
37322
  const crossesEl = firstChildElement(valAx, qname("c", "crosses", NS_C));
37071
37323
  if (crossesEl) {
37072
- const v = getAttrValue(crossesEl, ATTR_VAL$2);
37324
+ const v = getAttrValue(crossesEl, ATTR_VAL$3);
37073
37325
  if (v === "autoZero" || v === "min" || v === "max") valueAxisCrosses = v;
37074
37326
  }
37075
37327
  }
37076
37328
  const crossBetweenEl = firstChildElement(valAx, qname("c", "crossBetween", NS_C));
37077
37329
  if (crossBetweenEl) {
37078
- const v = getAttrValue(crossBetweenEl, ATTR_VAL$2);
37330
+ const v = getAttrValue(crossBetweenEl, ATTR_VAL$3);
37079
37331
  if (v === "between" || v === "midCat") valueAxisCrossBetween = v;
37080
37332
  }
37081
37333
  const majorGl = firstChildElement(valAx, qname("c", "majorGridlines", NS_C));
@@ -37107,13 +37359,13 @@ const readChartSpec = (root) => {
37107
37359
  const majorTickMark = readTickMark(secValAx);
37108
37360
  const minorTickMark = readTickMarkLocal(secValAx, "minorTickMark");
37109
37361
  const secPosEl = firstChildElement(secValAx, qname("c", "tickLblPos", NS_C));
37110
- const secPos = secPosEl !== null ? getAttrValue(secPosEl, ATTR_VAL$2) : null;
37362
+ const secPos = secPosEl !== null ? getAttrValue(secPosEl, ATTR_VAL$3) : null;
37111
37363
  const tickLabelPos = secPos === "none" || secPos === "low" || secPos === "high" || secPos === "nextTo" ? secPos : void 0;
37112
37364
  const crossBetweenEl = firstChildElement(secValAx, qname("c", "crossBetween", NS_C));
37113
- const cb = crossBetweenEl !== null ? getAttrValue(crossBetweenEl, ATTR_VAL$2) : null;
37365
+ const cb = crossBetweenEl !== null ? getAttrValue(crossBetweenEl, ATTR_VAL$3) : null;
37114
37366
  const crossBetween = cb === "between" || cb === "midCat" ? cb : void 0;
37115
37367
  const fields = {
37116
- ...scaling !== void 0 ? { scaling } : {},
37368
+ ...scaling,
37117
37369
  ...title !== void 0 ? { title } : {},
37118
37370
  ...titleStyle !== void 0 ? { titleStyle } : {},
37119
37371
  ...labelStyle !== void 0 ? { labelStyle } : {},
@@ -37136,7 +37388,7 @@ const readChartSpec = (root) => {
37136
37388
  if (!solid) return void 0;
37137
37389
  const srgb = firstChildElement(solid, NAME_SRGB_CLR);
37138
37390
  if (!srgb) return void 0;
37139
- const v = getAttrValue(srgb, ATTR_VAL$2);
37391
+ const v = getAttrValue(srgb, ATTR_VAL$3);
37140
37392
  return v !== null ? `#${v.toUpperCase()}` : void 0;
37141
37393
  };
37142
37394
  const readSpPrStrokeColor = (parent) => {
@@ -37148,7 +37400,7 @@ const readChartSpec = (root) => {
37148
37400
  if (!solid) return void 0;
37149
37401
  const srgb = firstChildElement(solid, NAME_SRGB_CLR);
37150
37402
  if (!srgb) return void 0;
37151
- const v = getAttrValue(srgb, ATTR_VAL$2);
37403
+ const v = getAttrValue(srgb, ATTR_VAL$3);
37152
37404
  return v !== null ? `#${v.toUpperCase()}` : void 0;
37153
37405
  };
37154
37406
  const plotAreaFill = readSpPrFill(plotArea);
@@ -37158,25 +37410,25 @@ const readChartSpec = (root) => {
37158
37410
  let dispBlanksAs;
37159
37411
  const dbaEl = firstChildElement(chart, qname("c", "dispBlanksAs", NS_C));
37160
37412
  if (dbaEl) {
37161
- const v = getAttrValue(dbaEl, ATTR_VAL$2);
37413
+ const v = getAttrValue(dbaEl, ATTR_VAL$3);
37162
37414
  if (v === "gap" || v === "zero" || v === "span") dispBlanksAs = v;
37163
37415
  }
37164
37416
  let plotVisibleCellsOnly;
37165
37417
  const pvoEl = firstChildElement(chart, qname("c", "plotVisOnly", NS_C));
37166
37418
  if (pvoEl) {
37167
- const v = getAttrValue(pvoEl, ATTR_VAL$2);
37419
+ const v = getAttrValue(pvoEl, ATTR_VAL$3);
37168
37420
  if (v === "0" || v === "false") plotVisibleCellsOnly = false;
37169
37421
  }
37170
37422
  let roundedCorners;
37171
37423
  const rcEl = firstChildElement(root, qname("c", "roundedCorners", NS_C));
37172
37424
  if (rcEl) {
37173
- const v = getAttrValue(rcEl, ATTR_VAL$2);
37425
+ const v = getAttrValue(rcEl, ATTR_VAL$3);
37174
37426
  if (v === "1" || v === "true") roundedCorners = true;
37175
37427
  }
37176
37428
  let chartStyle;
37177
37429
  const styleEl = firstChildElement(root, qname("c", "style", NS_C));
37178
37430
  if (styleEl) {
37179
- const v = getAttrValue(styleEl, ATTR_VAL$2);
37431
+ const v = getAttrValue(styleEl, ATTR_VAL$3);
37180
37432
  if (v !== null) {
37181
37433
  const n = Number.parseInt(v, 10);
37182
37434
  if (Number.isFinite(n) && n >= 1 && n <= 48) chartStyle = n;
@@ -37185,22 +37437,22 @@ const readChartSpec = (root) => {
37185
37437
  let language;
37186
37438
  const langEl = firstChildElement(root, qname("c", "lang", NS_C));
37187
37439
  if (langEl) {
37188
- const v = getAttrValue(langEl, ATTR_VAL$2);
37440
+ const v = getAttrValue(langEl, ATTR_VAL$3);
37189
37441
  if (v !== null && v.length > 0) language = v;
37190
37442
  }
37191
37443
  let date1904;
37192
37444
  const dateEl = firstChildElement(root, qname("c", "date1904", NS_C));
37193
37445
  if (dateEl) {
37194
- const v = getAttrValue(dateEl, ATTR_VAL$2);
37446
+ const v = getAttrValue(dateEl, ATTR_VAL$3);
37195
37447
  if (v === "1" || v === "true") date1904 = true;
37196
37448
  }
37197
37449
  let legend;
37198
37450
  const legendEl = firstChildElement(chart, qname("c", "legend", NS_C));
37199
37451
  if (legendEl) {
37200
37452
  const posEl = firstChildElement(legendEl, qname("c", "legendPos", NS_C));
37201
- const tok = posEl ? getAttrValue(posEl, ATTR_VAL$2) : null;
37453
+ const tok = posEl ? getAttrValue(posEl, ATTR_VAL$3) : null;
37202
37454
  const ovEl = firstChildElement(legendEl, qname("c", "overlay", NS_C));
37203
- const overlay = ovEl ? getAttrValue(ovEl, ATTR_VAL$2) !== "0" : false;
37455
+ const overlay = ovEl ? getAttrValue(ovEl, ATTR_VAL$3) !== "0" : false;
37204
37456
  const txPr = firstChildElement(legendEl, qname("c", "txPr", NS_C));
37205
37457
  const textStyle = txPr ? readLabelStyle(txPr) : void 0;
37206
37458
  const hiddenIndices = [];
@@ -37209,9 +37461,9 @@ const readChartSpec = (root) => {
37209
37461
  const idxEl = firstChildElement(c, qname("c", "idx", NS_C));
37210
37462
  const delEl = firstChildElement(c, qname("c", "delete", NS_C));
37211
37463
  if (!idxEl || !delEl) continue;
37212
- const delV = getAttrValue(delEl, ATTR_VAL$2);
37464
+ const delV = getAttrValue(delEl, ATTR_VAL$3);
37213
37465
  if (!(delV === null || delV === "1" || delV === "true")) continue;
37214
- const idxV = getAttrValue(idxEl, ATTR_VAL$2);
37466
+ const idxV = getAttrValue(idxEl, ATTR_VAL$3);
37215
37467
  if (idxV === null) continue;
37216
37468
  const n = Number.parseInt(idxV, 10);
37217
37469
  if (Number.isFinite(n) && n >= 0) hiddenIndices.push(n);
@@ -37229,21 +37481,21 @@ const readChartSpec = (root) => {
37229
37481
  let varyColors;
37230
37482
  const vcEl = firstChildElement(plotted, qname("c", "varyColors", NS_C));
37231
37483
  if (vcEl) {
37232
- const v = getAttrValue(vcEl, ATTR_VAL$2);
37484
+ const v = getAttrValue(vcEl, ATTR_VAL$3);
37233
37485
  varyColors = v === null || v === "1" || v === "true";
37234
37486
  }
37235
37487
  let titleOverlay;
37236
37488
  const titleEl = firstChildElement(chart, NAME_TITLE);
37237
37489
  if (titleEl) {
37238
37490
  const ovEl = firstChildElement(titleEl, qname("c", "overlay", NS_C));
37239
- if (ovEl) titleOverlay = getAttrValue(ovEl, ATTR_VAL$2) !== "0";
37491
+ if (ovEl) titleOverlay = getAttrValue(ovEl, ATTR_VAL$3) !== "0";
37240
37492
  }
37241
37493
  let firstSliceAngleDeg;
37242
37494
  let holeSizePct;
37243
37495
  if (kind === "pie" || kind === "doughnut") {
37244
37496
  const fsAng = firstChildElement(plotted, qname("c", "firstSliceAng", NS_C));
37245
37497
  if (fsAng) {
37246
- const v = getAttrValue(fsAng, ATTR_VAL$2);
37498
+ const v = getAttrValue(fsAng, ATTR_VAL$3);
37247
37499
  if (v !== null) {
37248
37500
  const n = Number.parseInt(v, 10);
37249
37501
  if (Number.isFinite(n)) firstSliceAngleDeg = (n % 360 + 360) % 360;
@@ -37252,7 +37504,7 @@ const readChartSpec = (root) => {
37252
37504
  if (kind === "doughnut") {
37253
37505
  const hs = firstChildElement(plotted, qname("c", "holeSize", NS_C));
37254
37506
  if (hs) {
37255
- const v = getAttrValue(hs, ATTR_VAL$2);
37507
+ const v = getAttrValue(hs, ATTR_VAL$3);
37256
37508
  if (v !== null) {
37257
37509
  const n = Number.parseInt(v, 10);
37258
37510
  if (Number.isFinite(n)) holeSizePct = Math.max(10, Math.min(90, n));
@@ -37267,19 +37519,19 @@ const readChartSpec = (root) => {
37267
37519
  if (kind === "scatter") {
37268
37520
  const el = firstChildElement(plotted, qname("c", "scatterStyle", NS_C));
37269
37521
  if (el) {
37270
- const v = getAttrValue(el, ATTR_VAL$2);
37522
+ const v = getAttrValue(el, ATTR_VAL$3);
37271
37523
  if (v === "none" || v === "line" || v === "lineMarker" || v === "marker" || v === "smooth" || v === "smoothMarker") scatterStyle = v;
37272
37524
  }
37273
37525
  } else if (kind === "radar") {
37274
37526
  const el = firstChildElement(plotted, qname("c", "radarStyle", NS_C));
37275
37527
  if (el) {
37276
- const v = getAttrValue(el, ATTR_VAL$2);
37528
+ const v = getAttrValue(el, ATTR_VAL$3);
37277
37529
  if (v === "standard" || v === "marker" || v === "filled") radarStyle = v;
37278
37530
  }
37279
37531
  } else if (kind === "bubble") {
37280
37532
  const bsEl = firstChildElement(plotted, qname("c", "bubbleScale", NS_C));
37281
37533
  if (bsEl) {
37282
- const v = getAttrValue(bsEl, ATTR_VAL$2);
37534
+ const v = getAttrValue(bsEl, ATTR_VAL$3);
37283
37535
  if (v !== null) {
37284
37536
  const n = Number.parseInt(v, 10);
37285
37537
  if (Number.isFinite(n) && n >= 0) bubbleScale = Math.min(300, n);
@@ -37287,7 +37539,7 @@ const readChartSpec = (root) => {
37287
37539
  }
37288
37540
  const srEl = firstChildElement(plotted, qname("c", "sizeRepresents", NS_C));
37289
37541
  if (srEl) {
37290
- const v = getAttrValue(srEl, ATTR_VAL$2);
37542
+ const v = getAttrValue(srEl, ATTR_VAL$3);
37291
37543
  if (v === "area") bubbleSizeRepresents = "area";
37292
37544
  else if (v === "w") bubbleSizeRepresents = "width";
37293
37545
  }
@@ -37767,7 +38019,7 @@ const NAME_NV_SP_PR = qname("p", "nvSpPr", NS.pml);
37767
38019
  const NAME_NV_PR$2 = qname("p", "nvPr", NS.pml);
37768
38020
  const NAME_PH = qname("p", "ph", NS.pml);
37769
38021
  const ATTR_TYPE$1 = qname("", "type", "");
37770
- const ATTR_IDX = qname("", "idx", "");
38022
+ const ATTR_IDX$1 = qname("", "idx", "");
37771
38023
  /** The `<p:ph>` of a top-level `<p:sp>`, or `null` for anything else. */
37772
38024
  const phOf = (node) => {
37773
38025
  if (node.name.namespaceURI !== NS.pml || node.name.localName !== "sp") return null;
@@ -37786,7 +38038,7 @@ const placeholderIndices = (spTree) => {
37786
38038
  for (const child of spTree.children) {
37787
38039
  if (child.kind !== "element") continue;
37788
38040
  const ph = phOf(child);
37789
- const idx = ph && getAttrValue(ph, ATTR_IDX);
38041
+ const idx = ph && getAttrValue(ph, ATTR_IDX$1);
37790
38042
  if (idx) out.push(Number(idx));
37791
38043
  }
37792
38044
  return out;
@@ -39911,15 +40163,227 @@ const setChartSpec = (chart, spec) => {
39911
40163
  const chartPart = pkg.getPart(resolved.partName);
39912
40164
  if (!chartPart) throw new Error(`setChartSpec: chart part ${resolved.partName} not found`);
39913
40165
  chartPart.data = chartBytes;
39914
- const chartRels = pkg.getRels(resolved.partName);
39915
- if (chartRels) {
39916
- const xlsxRel = chartRels.items.find((r) => r.type === REL_TYPES.package);
39917
- if (xlsxRel) {
39918
- const xlsxName = xlsxRel.target.startsWith("/") ? partName(xlsxRel.target) : resolveTarget(resolved.partName, xlsxRel.target);
39919
- const xlsxPart = pkg.getPart(xlsxName);
39920
- if (xlsxPart) xlsxPart.data = buildEmbeddedXlsx(layoutChartSheet(spec).grid);
40166
+ const workbook = embeddedWorkbookPart(pkg, resolved.partName);
40167
+ if (workbook) workbook.data = buildEmbeddedXlsx(layoutChartSheet(spec).grid);
40168
+ };
40169
+ const embeddedWorkbookPart = (pkg, chartPartName) => {
40170
+ const xlsxRel = pkg.getRels(chartPartName)?.items.find((r) => r.type === REL_TYPES.package);
40171
+ if (!xlsxRel || xlsxRel.targetMode === "External") return null;
40172
+ const xlsxName = xlsxRel.target.startsWith("/") ? partName(xlsxRel.target) : resolveTarget(chartPartName, xlsxRel.target);
40173
+ return pkg.getPart(xlsxName) ?? null;
40174
+ };
40175
+ const CHART_DATA_KINDS = new Set([
40176
+ "bar",
40177
+ "column",
40178
+ "line",
40179
+ "area",
40180
+ "pie",
40181
+ "doughnut"
40182
+ ]);
40183
+ const isChartDataKind = (kind) => CHART_DATA_KINDS.has(kind);
40184
+ const NAME_C_PLOT_AREA = qname("c", "plotArea", NS.chart);
40185
+ const NAME_C_SER = qname("c", "ser", NS.chart);
40186
+ const NAME_C_TX = qname("c", "tx", NS.chart);
40187
+ const NAME_C_CAT = qname("c", "cat", NS.chart);
40188
+ const NAME_C_VAL = qname("c", "val", NS.chart);
40189
+ const NAME_C_F = qname("c", "f", NS.chart);
40190
+ const NAME_C_STR_REF = qname("c", "strRef", NS.chart);
40191
+ const NAME_C_STR_LIT = qname("c", "strLit", NS.chart);
40192
+ const NAME_C_STR_CACHE = qname("c", "strCache", NS.chart);
40193
+ const NAME_C_NUM_REF = qname("c", "numRef", NS.chart);
40194
+ const NAME_C_NUM_LIT = qname("c", "numLit", NS.chart);
40195
+ const NAME_C_NUM_CACHE = qname("c", "numCache", NS.chart);
40196
+ const NAME_C_MULTI_LVL_STR_REF = qname("c", "multiLvlStrRef", NS.chart);
40197
+ const NAME_C_MULTI_LVL_STR_CACHE = qname("c", "multiLvlStrCache", NS.chart);
40198
+ const NAME_C_LVL = qname("c", "lvl", NS.chart);
40199
+ const NAME_C_FORMAT_CODE = qname("c", "formatCode", NS.chart);
40200
+ const NAME_C_PT_COUNT = qname("c", "ptCount", NS.chart);
40201
+ const NAME_C_EXT_LST = qname("c", "extLst", NS.chart);
40202
+ const ATTR_VAL$2 = qname("", "val", "");
40203
+ const ATTR_IDX = qname("", "idx", "");
40204
+ /** A `c:` element named like `sibling`, so it uses the prefix the part already declares. */
40205
+ const chartElem = (sibling, localName, init = {}) => elem(qname(sibling.name.prefix, localName, NS.chart), init);
40206
+ const setFormula = (ref, formula) => {
40207
+ const f = firstChildElement(ref, NAME_C_F);
40208
+ if (f) f.children = [text(formula)];
40209
+ };
40210
+ const setCachePoints = (cache, points) => {
40211
+ const formatCode = allChildElements(cache, NAME_C_FORMAT_CODE);
40212
+ const extLst = allChildElements(cache, NAME_C_EXT_LST);
40213
+ const ptCount = firstChildElement(cache, NAME_C_PT_COUNT) ?? chartElem(cache, "ptCount");
40214
+ ptCount.attrs = [attr(ATTR_VAL$2, String(points.length))];
40215
+ cache.children = [
40216
+ ...formatCode,
40217
+ ptCount,
40218
+ ...pointElems(cache, points),
40219
+ ...extLst
40220
+ ];
40221
+ };
40222
+ const pointElems = (sibling, points) => points.flatMap((point, i) => point === null ? [] : [chartElem(sibling, "pt", {
40223
+ attrs: [attr(ATTR_IDX, String(i))],
40224
+ children: [chartElem(sibling, "v", { children: [text(point)] })]
40225
+ })]);
40226
+ /**
40227
+ * Rewrites a `c:cat` / `c:val` / `c:tx` channel: its formula when `formula`
40228
+ * is given, its cached points when `points` is.
40229
+ */
40230
+ const setChannel = (channel, formula, points) => {
40231
+ for (const [refName, cacheName] of [[NAME_C_STR_REF, NAME_C_STR_CACHE], [NAME_C_NUM_REF, NAME_C_NUM_CACHE]]) {
40232
+ const ref = firstChildElement(channel, refName);
40233
+ if (!ref) continue;
40234
+ if (formula !== null) setFormula(ref, formula);
40235
+ if (points !== null) {
40236
+ let cache = firstChildElement(ref, cacheName);
40237
+ if (!cache) {
40238
+ cache = chartElem(ref, cacheName.localName);
40239
+ ref.children.push(cache);
40240
+ }
40241
+ setCachePoints(cache, points);
39921
40242
  }
40243
+ return;
40244
+ }
40245
+ const literal = firstChildElement(channel, NAME_C_STR_LIT) ?? firstChildElement(channel, NAME_C_NUM_LIT);
40246
+ if (literal && points !== null) setCachePoints(literal, points);
40247
+ const multiLevel = firstChildElement(channel, NAME_C_MULTI_LVL_STR_REF);
40248
+ if (!multiLevel) return;
40249
+ if (formula !== null) setFormula(multiLevel, formula);
40250
+ if (points !== null) setSingleLevelCache(multiLevel, points);
40251
+ };
40252
+ const setSingleLevelCache = (ref, points) => {
40253
+ const cache = firstChildElement(ref, NAME_C_MULTI_LVL_STR_CACHE) ?? chartElem(ref, "multiLvlStrCache");
40254
+ if (!ref.children.includes(cache)) ref.children.push(cache);
40255
+ const lvl = firstChildElement(cache, NAME_C_LVL) ?? chartElem(cache, "lvl");
40256
+ const ptCount = firstChildElement(cache, NAME_C_PT_COUNT) ?? chartElem(cache, "ptCount");
40257
+ ptCount.attrs = [attr(ATTR_VAL$2, String(points.length))];
40258
+ lvl.children = [...pointElems(cache, points), ...allChildElements(lvl, NAME_C_EXT_LST)];
40259
+ cache.children = [
40260
+ ptCount,
40261
+ lvl,
40262
+ ...allChildElements(cache, NAME_C_EXT_LST)
40263
+ ];
40264
+ };
40265
+ const isNumericChannel = (channel) => firstChildElement(channel, NAME_C_NUM_REF) !== null || firstChildElement(channel, NAME_C_NUM_LIT) !== null;
40266
+ /**
40267
+ * Replaces the data of a bar, column, line, area, pie or doughnut chart.
40268
+ *
40269
+ * When `kind` is the chart's own and `series` names the same series (in any
40270
+ * order), only the values change: everything else in the chart, its
40271
+ * formatting included, is kept. Changing `kind`, or adding, removing or
40272
+ * renaming a series, builds the chart again from its title, axis titles,
40273
+ * legend, series names and colors, and the rest of its formatting returns
40274
+ * to the defaults; to keep it, copy the series names exactly as they are
40275
+ * read. Each series needs one value per category: when changing
40276
+ * `categories`, pass every series with values of the same length. A pie or
40277
+ * doughnut chart takes exactly one series. On a date axis the categories
40278
+ * are read as date serial numbers (days since 1899-12-30, e.g. `"45292"`
40279
+ * for 2024-01-01) and must be passed the same way. The embedded workbook
40280
+ * is rewritten with the new data.
40281
+ *
40282
+ * Throws when the chart is of another kind (scatter, bubble, stock,
40283
+ * surface, radar, or one this library cannot read), when `categories` or
40284
+ * `series` is empty, when a series has more or fewer values than there are
40285
+ * categories, when a date-axis category is not a number, and when
40286
+ * categories change on a chart whose categories have several levels.
40287
+ */
40288
+ const setChartData = (chart, data) => {
40289
+ const slide = chart.shape[SHAPE_SLIDE];
40290
+ const pkg = slide[INTERNAL_PACKAGE];
40291
+ const resolved = resolveChartPartName(slide, chart.shape);
40292
+ if (!resolved) throw new Error("setChartData: shape is not a chart graphic frame");
40293
+ const part = pkg.getPart(resolved.partName);
40294
+ if (!part) throw new Error(`setChartData: chart part ${resolved.partName} not found`);
40295
+ const doc = parseXml(decode$1(part.data));
40296
+ const current = readChartSpec(doc.root);
40297
+ if (current === null || !isChartDataKind(current.kind)) throw new Error(`setChartData: the data of ${current === null ? "this chart" : `a ${current.kind} chart`} cannot be replaced; build the chart again instead`);
40298
+ if (data.categories?.length === 0 || data.series?.length === 0) throw new Error("setChartData: categories and series must not be empty");
40299
+ const kind = data.kind ?? current.kind;
40300
+ const categories = data.categories ?? current.categories;
40301
+ const series = data.series ?? current.series;
40302
+ for (const s of series) {
40303
+ if (s.values.length !== categories.length) throw new Error(`setChartData: series "${s.name}" has ${s.values.length} values for ${categories.length} categories`);
40304
+ if (s.values.some((v) => v !== null && !Number.isFinite(v))) throw new Error(`setChartData: series "${s.name}" has a value that is not a finite number`);
40305
+ }
40306
+ const byName = new Map(series.map((s) => [s.name, s]));
40307
+ if (data.series !== void 0 && byName.size !== series.length) throw new Error("setChartData: series names must be distinct");
40308
+ const sameSeries = data.series === void 0 || new Set(current.series.map((s) => s.name)).size === series.length && current.series.every((s) => byName.has(s.name));
40309
+ if (kind !== current.kind || !sameSeries) {
40310
+ setChartSpec(chart, rebuiltChartSpec(current, kind, categories, series));
40311
+ return;
39922
40312
  }
40313
+ if (data.categories !== void 0 && current.categoryGroupLevels !== void 0) throw new Error("setChartData: the categories of a chart with several category levels cannot be replaced");
40314
+ const sers = childElements(firstChildElement(firstChildElement(doc.root, NAME_C_CHART), NAME_C_PLOT_AREA)).flatMap((group) => allChildElements(group, NAME_C_SER));
40315
+ const values = current.series.map((s) => data.series === void 0 ? s.values : byName.get(s.name).values);
40316
+ const numericCategories = sers.some((ser) => {
40317
+ const cat = firstChildElement(ser, NAME_C_CAT);
40318
+ return cat !== null && isNumericChannel(cat);
40319
+ });
40320
+ if (data.categories !== void 0 && numericCategories && categories.some((c) => !Number.isFinite(Number(c)) || c.trim() === "")) throw new Error("setChartData: this chart has numeric (date) categories; pass numbers");
40321
+ const workbook = embeddedWorkbookPart(pkg, resolved.partName);
40322
+ const layout = workbook ? layoutChartSheet({
40323
+ ...current,
40324
+ categories,
40325
+ series: current.series.map((s, i) => ({
40326
+ ...s,
40327
+ values: values[i]
40328
+ }))
40329
+ }) : null;
40330
+ sers.forEach((ser, i) => {
40331
+ const refs = layout?.series[i];
40332
+ const tx = firstChildElement(ser, NAME_C_TX);
40333
+ if (tx && refs) setChannel(tx, refs.name, null);
40334
+ let cat = firstChildElement(ser, NAME_C_CAT);
40335
+ const val = firstChildElement(ser, NAME_C_VAL);
40336
+ if (!val) throw new Error("setChartData: a series of this chart has no values");
40337
+ if (!cat && data.categories !== void 0) {
40338
+ cat = chartElem(ser, "cat", { children: [layout ? chartElem(ser, "strRef", { children: [chartElem(ser, "f"), chartElem(ser, "strCache")] }) : chartElem(ser, "strLit")] });
40339
+ ser.children.splice(ser.children.indexOf(val), 0, cat);
40340
+ }
40341
+ if (cat) setChannel(cat, layout?.categories ?? null, data.categories === void 0 ? null : isNumericChannel(cat) ? categories.map((c) => String(Number(c))) : categories);
40342
+ setChannel(val, refs?.values ?? null, data.series === void 0 ? null : values[i].map((v) => v === null ? null : String(v)));
40343
+ });
40344
+ part.data = encode$1(serializeXml(doc));
40345
+ if (workbook && layout) workbook.data = buildEmbeddedXlsx(layout.grid);
40346
+ };
40347
+ const rebuiltChartSpec = (current, kind, categories, series) => {
40348
+ const colors = new Map(current.series.map((s) => [s.name, s.color]));
40349
+ const plain = series.map(({ name, values }) => {
40350
+ const color = colors.get(name);
40351
+ return {
40352
+ name,
40353
+ values,
40354
+ ...color !== void 0 ? { color } : {}
40355
+ };
40356
+ });
40357
+ const legend = current.legend && {
40358
+ position: current.legend.position,
40359
+ ...current.legend.overlay !== void 0 ? { overlay: current.legend.overlay } : {},
40360
+ ...current.legend.textStyle !== void 0 ? { textStyle: current.legend.textStyle } : {}
40361
+ };
40362
+ const common = {
40363
+ categories,
40364
+ ...current.title !== void 0 ? { title: current.title } : {},
40365
+ ...legend !== void 0 ? { legend } : {}
40366
+ };
40367
+ if (kind === "pie" || kind === "doughnut") {
40368
+ const [only, ...rest] = plain;
40369
+ if (only === void 0 || rest.length > 0) throw new Error(`setChartData: a ${kind} chart takes exactly one series`);
40370
+ return kind === "pie" ? {
40371
+ kind,
40372
+ ...common,
40373
+ series: [only]
40374
+ } : {
40375
+ kind,
40376
+ ...common,
40377
+ series: [only]
40378
+ };
40379
+ }
40380
+ return {
40381
+ kind,
40382
+ ...common,
40383
+ series: plain,
40384
+ ...current.categoryAxisTitle !== void 0 ? { categoryAxisTitle: current.categoryAxisTitle } : {},
40385
+ ...current.valueAxisTitle !== void 0 ? { valueAxisTitle: current.valueAxisTitle } : {}
40386
+ };
39923
40387
  };
39924
40388
  /**
39925
40389
  * Returns every chart on the slide, with its `ChartSpec` parsed from
@@ -42948,6 +43412,7 @@ const validatePresentationPackage = (pkg) => {
42948
43412
  const validatePresentation = (pres) => validatePresentationPackage(pres[INTERNAL_PACKAGE]);
42949
43413
  //#endregion
42950
43414
  //#region src/api/fn/package-introspection.ts
43415
+ const TEXT_DECODER = new TextDecoder();
42951
43416
  /**
42952
43417
  * Power-user escape hatch. Returns the underlying `OpcPackage`
42953
43418
  * backing `pres`. Use this when you need to manipulate parts /
@@ -43003,45 +43468,69 @@ const getMediaParts = (pres) => {
43003
43468
  });
43004
43469
  return out;
43005
43470
  };
43471
+ const ROOT_RELS = "/_rels/.rels";
43472
+ const RELS_PART = /^(.*)\/_rels\/([^/]+)\.rels$/;
43473
+ const resolveClamped = (source, target) => {
43474
+ if (target.startsWith("/")) return target;
43475
+ const segments = source.split("/").slice(1, -1);
43476
+ for (const seg of target.split("/")) if (seg === "..") segments.pop();
43477
+ else if (seg !== "." && seg.length > 0) segments.push(seg);
43478
+ return `/${segments.join("/")}`;
43479
+ };
43480
+ /** `/ppt/slides/_rels/slide1.xml.rels` → `/ppt/slides/slide1.xml`; `null` for other parts. */
43481
+ const relsSourceOf = (name) => {
43482
+ const m = RELS_PART.exec(name);
43483
+ return m ? `${m[1]}/${m[2]}` : null;
43484
+ };
43485
+ const existingPartName = (byName, target) => {
43486
+ const lower = target.toLowerCase();
43487
+ if (byName.has(lower)) return lower;
43488
+ try {
43489
+ const decoded = decodeURIComponent(target).toLowerCase();
43490
+ return byName.has(decoded) ? decoded : null;
43491
+ } catch {
43492
+ return null;
43493
+ }
43494
+ };
43495
+ /**
43496
+ * Lowercased names of the parts reachable from `/_rels/.rels` through
43497
+ * internal relationships (OPC part names compare case-insensitively), or
43498
+ * `null` when that does not reach `/ppt/presentation.xml`, since the
43499
+ * library opens the presentation part by name and the graph is then unusable.
43500
+ */
43501
+ const reachablePartNames = (pkg) => {
43502
+ const byName = new Map(pkg.parts.map((p) => [p.name.toLowerCase(), p]));
43503
+ const reachable = /* @__PURE__ */ new Set();
43504
+ const queue = ["/"];
43505
+ while (queue.length > 0) {
43506
+ const source = queue.pop();
43507
+ const relsName = source === "/" ? ROOT_RELS : relsPartNameFor(source).toLowerCase();
43508
+ const relsPart = byName.get(relsName);
43509
+ if (!relsPart) continue;
43510
+ for (const rel of parseRels(TEXT_DECODER.decode(relsPart.data)).items) {
43511
+ if (rel.targetMode === "External" || rel.target === "") continue;
43512
+ const target = existingPartName(byName, resolveClamped(source, rel.target));
43513
+ if (target === null || reachable.has(target)) continue;
43514
+ reachable.add(target);
43515
+ queue.push(partName(target));
43516
+ }
43517
+ }
43518
+ return reachable.has(PRES_PART_NAME) ? reachable : null;
43519
+ };
43006
43520
  /**
43007
- * Returns every media part NOT referenced by any rels in the
43008
- * package — the set `compactPackage` would remove. Non-destructive;
43009
- * the caller decides whether to delete.
43521
+ * Returns every media part that cannot be reached from the package root
43522
+ * through internal relationships — the media subset of what
43523
+ * `compactPackage` would remove. Non-destructive; the caller decides
43524
+ * whether to delete.
43010
43525
  *
43011
43526
  * Useful for audit UIs that want to surface bloat before cleaning,
43012
43527
  * and for "is this asset still used?" checks.
43013
43528
  */
43014
43529
  const getOrphanMediaPartNames = (pres) => {
43015
43530
  const pkg = pres[INTERNAL_PACKAGE];
43016
- const referenced = /* @__PURE__ */ new Set();
43017
- const resolve = (sourcePart, target) => {
43018
- if (target.startsWith("/")) return target;
43019
- const dir = sourcePart.split("/").slice(0, -1);
43020
- const segments = [];
43021
- for (const seg of [...dir, ...target.split("/")]) if (seg === "..") segments.pop();
43022
- else if (seg !== "." && seg.length > 0) segments.push(seg);
43023
- return `/${segments.join("/")}`;
43024
- };
43025
- for (const part of pkg.parts) {
43026
- if (!part.name.endsWith(".rels")) continue;
43027
- const m = part.name.match(/^(.*)\/_rels\/(.+)\.rels$/);
43028
- let sourceName;
43029
- if (part.name === "/_rels/.rels") sourceName = "/";
43030
- else if (m) sourceName = `${m[1]}/${m[2]}`;
43031
- else continue;
43032
- const sourceRels = sourceName === "/" ? pkg.rootRels() : pkg.getRels(sourceName);
43033
- if (!sourceRels) continue;
43034
- for (const rel of sourceRels.items) {
43035
- if (rel.targetMode === "External") continue;
43036
- referenced.add(resolve(sourceName, rel.target).toLowerCase());
43037
- }
43038
- }
43039
- const out = [];
43040
- for (const part of pkg.parts) {
43041
- if (!part.name.startsWith("/ppt/media/")) continue;
43042
- if (!referenced.has(part.name.toLowerCase())) out.push(part.name);
43043
- }
43044
- return out;
43531
+ const reachable = reachablePartNames(pkg);
43532
+ if (reachable === null) return [];
43533
+ return pkg.parts.filter((p) => p.name.startsWith("/ppt/media/") && !reachable.has(p.name.toLowerCase())).map((p) => p.name);
43045
43534
  };
43046
43535
  /**
43047
43536
  * Returns every media part name the slide's rels reference
@@ -43052,19 +43541,11 @@ const getOrphanMediaPartNames = (pres) => {
43052
43541
  const getSlideMediaPartNames = (slide) => {
43053
43542
  const rels = slide[INTERNAL_PACKAGE].getRels(slide[SLIDE_PART_NAME]);
43054
43543
  if (!rels) return [];
43055
- const resolve = (sourcePart, target) => {
43056
- if (target.startsWith("/")) return target;
43057
- const dir = sourcePart.split("/").slice(0, -1);
43058
- const segments = [];
43059
- for (const seg of [...dir, ...target.split("/")]) if (seg === "..") segments.pop();
43060
- else if (seg !== "." && seg.length > 0) segments.push(seg);
43061
- return `/${segments.join("/")}`;
43062
- };
43063
43544
  const out = [];
43064
43545
  const seen = /* @__PURE__ */ new Set();
43065
43546
  for (const rel of rels.items) {
43066
43547
  if (rel.targetMode === "External") continue;
43067
- const resolved = resolve(slide[SLIDE_PART_NAME], rel.target);
43548
+ const resolved = resolveClamped(slide[SLIDE_PART_NAME], rel.target);
43068
43549
  if (!resolved.startsWith("/ppt/media/")) continue;
43069
43550
  if (seen.has(resolved)) continue;
43070
43551
  seen.add(resolved);
@@ -43082,64 +43563,37 @@ const getSlideMediaPartNames = (slide) => {
43082
43563
  */
43083
43564
  const slidesUsingMediaPart = (pres, mediaPartName) => {
43084
43565
  const pkg = pres[INTERNAL_PACKAGE];
43085
- const resolve = (sourcePart, target) => {
43086
- if (target.startsWith("/")) return target;
43087
- const dir = sourcePart.split("/").slice(0, -1);
43088
- const segments = [];
43089
- for (const seg of [...dir, ...target.split("/")]) if (seg === "..") segments.pop();
43090
- else if (seg !== "." && seg.length > 0) segments.push(seg);
43091
- return `/${segments.join("/")}`;
43092
- };
43093
43566
  const out = [];
43094
43567
  for (const slide of getSlides(pres)) {
43095
43568
  const rels = pkg.getRels(slide[SLIDE_PART_NAME]);
43096
43569
  if (!rels) continue;
43097
- if (rels.items.some((r) => r.targetMode !== "External" && resolve(slide[SLIDE_PART_NAME], r.target) === mediaPartName)) out.push(slide);
43570
+ if (rels.items.some((r) => r.targetMode !== "External" && resolveClamped(slide[SLIDE_PART_NAME], r.target) === mediaPartName)) out.push(slide);
43098
43571
  }
43099
43572
  return out;
43100
43573
  };
43101
43574
  /**
43102
- * Removes media parts that no rels graph references. Returns the
43103
- * list of removed part names. Useful after a sequence of slide
43104
- * removals leaves orphan images behind.
43575
+ * Removes every part that cannot be reached from the package root
43576
+ * (`/_rels/.rels`) through internal relationships, together with its
43577
+ * `.rels` part and its `[Content_Types].xml` override. Returns the
43578
+ * removed part names.
43105
43579
  *
43106
- * Only `/ppt/media/...` parts are considered. The check walks every
43107
- * `.rels` part in the package and resolves each internal rel target
43108
- * against its source part name to build the live media set.
43580
+ * `removeSlide` removes only the slide and its `.rels`, so the slide's
43581
+ * charts, embedded workbooks, notes slide, tags and media stay in the
43582
+ * package until this runs. Parts still in use — including layouts no
43583
+ * slide uses, which their master references — are kept. Any other part
43584
+ * nothing points at, such as custom data added without a relationship, is
43585
+ * removed too. When `/_rels/.rels` does not reach `/ppt/presentation.xml`,
43586
+ * nothing is removed.
43109
43587
  */
43110
43588
  const compactPackage = (pres) => {
43111
43589
  const pkg = pres[INTERNAL_PACKAGE];
43112
- const referenced = /* @__PURE__ */ new Set();
43113
- const resolve = (sourcePart, target) => {
43114
- if (target.startsWith("/")) return target;
43115
- const dir = sourcePart.split("/").slice(0, -1);
43116
- const segments = [];
43117
- for (const seg of [...dir, ...target.split("/")]) if (seg === "..") segments.pop();
43118
- else if (seg !== "." && seg.length > 0) segments.push(seg);
43119
- return `/${segments.join("/")}`;
43120
- };
43121
- for (const part of pkg.parts) {
43122
- if (!part.name.endsWith(".rels")) continue;
43123
- let sourceName = part.name.replace("/_rels/", "/").replace(/\.rels$/, "");
43124
- if (sourceName === "/" || sourceName === "") sourceName = "/";
43125
- const rels = sourceName === "/" ? null : pkg.getRels(partName(sourceName));
43126
- if (!rels) continue;
43127
- for (const rel of rels.items) {
43128
- if (rel.targetMode === "External") continue;
43129
- referenced.add(resolve(sourceName, rel.target).toLowerCase());
43130
- }
43131
- }
43132
- const removed = [];
43133
- const orphans = [];
43134
- for (const part of pkg.parts) {
43135
- if (!part.name.startsWith("/ppt/media/")) continue;
43136
- if (!referenced.has(part.name.toLowerCase())) orphans.push(part.name);
43137
- }
43138
- for (const name of orphans) {
43139
- pkg.removePart(partName(name));
43140
- removed.push(name);
43141
- }
43142
- return { removed };
43590
+ const reachable = reachablePartNames(pkg);
43591
+ if (reachable === null) return { removed: [] };
43592
+ return { removed: pkg.retainParts((part) => {
43593
+ const lower = part.name.toLowerCase();
43594
+ if (lower === ROOT_RELS) return true;
43595
+ return reachable.has(relsSourceOf(lower) ?? lower);
43596
+ }) };
43143
43597
  };
43144
43598
  /**
43145
43599
  * Replaces the bytes of a media part in place. Returns `true` if the
@@ -53894,9 +54348,11 @@ const stripSlideReferences = (element, relIds) => {
53894
54348
  * Links to this slide from other slides are cleared to prevent accidental
53895
54349
  * retargeting when a slide part name is reused.
53896
54350
  *
53897
- * Media parts are intentionally NOT cleaned up — they may be shared
53898
- * with other slides. The freed `sldId` is NOT reused on subsequent
53899
- * `addSlide` calls (the reference desktop app's quirk, see plan §Risks).
54351
+ * Parts the slide referenced (media, charts and their workbooks, the notes
54352
+ * slide, tags) are left in place because other slides may share them; call
54353
+ * `compactPackage` afterwards to drop the ones nothing references any more.
54354
+ * The freed `sldId` is NOT reused on subsequent `addSlide` calls (the
54355
+ * reference desktop app's quirk, see plan §Risks).
53900
54356
  */
53901
54357
  const removeSlide = (pres, slide) => {
53902
54358
  const pkg = pres[INTERNAL_PACKAGE];
@@ -55460,8 +55916,8 @@ const getShapeImageIntrinsicSize = (shape) => {
55460
55916
  };
55461
55917
  //#endregion
55462
55918
  //#region src/api/index.ts
55463
- const VERSION = "0.24.1";
55919
+ const VERSION = "0.26.0";
55464
55920
  //#endregion
55465
- export { getHandoutMasterPlaceholders as $, findSlidesByLayoutPartName as $a, getShapeChartCategories as $c, getShapeStrokeCap as $i, getSlideLayouts as $l, findShapesByEffect as $n, getSlideNotesTextFormats as $o, getShapePlaceholderIdx as $r, getTableCellText3D as $s, replaceTextInNotes as $t, isShapeLocked as A, setParagraphBullet as Aa, getThumbnail as Ac, setShapeGradientFill as Ai, getSlideMasterShapes as Al, getShapeTextAutoFitParams as An, clearAllHyperlinks as Ao, getSlidesWithEmptyPlaceholders as Ar, getPresentationSummary as As, findSlidesByText as At, getSlideComments as Au, addSectionHeaderSlide as B, getSlideTitle as Ba, touchModified as Bc, setShapeStroke as Bi, setSlideLayoutBackground as Bl, setShapeText as Bn, getAllNotes as Bo, getMaxShapeIdInPresentation as Br, getTableBackgroundEffective as Bs, getSlideIndex as Bt, savePresentation as Bu, ungroupShapes as C, getShapeRunClickAction as Ca, setTableCellTextDirection as Cc, getShapePatternFill as Ci, getSlideLayoutBackgroundPatternFill as Cl, removeSlideAnimation as Cn, SLIDE_SIZE_16_10 as Co, findSlidePlaceholders as Cr, getShapeMediaPlayback as Cs, setSlideMasterPreserved as Ct, getCommentStatus as Cu, setShapeTextLanguage as D, getShapeRunText as Da, setTableStyleFlags as Dc, setShapeAdjustValues as Di, getSlideMasterBackgroundGradientFill as Dl, getShapeText3D as Dn, getSlideSize as Do, getShapesBounds as Dr, getMediaParts as Ds, findSlideByText as Dt, getPresentationCommentCountsBySlide as Du, getShapeTextLanguage as E, getShapeRunHyperlinkTooltip as Ea, setTableRowHeight as Ec, getShapeStrokeSketch as Ei, getSlideMasterBackground as El, getShapeBodyPrEffective as En, getPresentationFirstSlideNumber as Eo, getShapeXmlString as Er, compactPackage as Es, findSlideByPartName as Et, getPresentationCommentCountsByAuthor as Eu, resetSlideLayout as F, setParagraphTabs as Fa, getPresentationCreated as Fc, setShapePosition as Fi, setSlideBackgroundImageOpacity as Fl, getShapeTextMargins as Fn, findSlidesWithChartTrendlines as Fo, findShapesAtPoint as Fr, slidesUsingMediaPart as Fs, getPresentationTextLength as Ft, getPresentationTheme as Fu, duplicateSlideAt as G, findShapesWithAnimation as Ga, setShapeRunFormat as Gc, setShapeStrokeJoin as Gi, findSlideLayoutByPartName as Gl, setShapeTextColumns as Gn, getPresentationHyperlinkCountsBySlide as Go, getShapeBoundsResolved as Gr, getTableCellBorders as Gs, getSlideText as Gt, asColor as Gu, addSlideAt as H, setSlidePlaceholders as Ha, getShapeHyperlink as Hc, setShapeStrokeCap as Hi, setSlideLayoutPlaceholderBounds as Hl, setShapeTextAnchor as Hn, getDistinctHyperlinkUrls as Ho, getShapeAdjustValues as Hr, getTableCellAlignment as Hs, getSlideLayoutCount as Ht, BUILTIN_TABLE_STYLES as Hu, resetSlidePlaceholderGeometry as I, setParagraphTypography as Ia, getPresentationModified as Ic, setShapePreset as Ii, setSlideBackgroundPatternFill as Il, getShapeTextWrap as In, getAllCharts as Io, findShapesInRect as Ir, validatePresentation as Is, getPresentationTextLengthsBySlide as It, setPresentationFonts as Iu, moveSlide as J, setShapeAnimation as Ja, findChartsBySeriesName as Jc, getShapeFillColor as Ji, getSlideLayoutPartName$1 as Jl, setShapeTextFlat as Jn, getPresentationNotesText as Jo, getShapeDescription as Jr, getTableCellParagraphs as Js, getSlides as Jt, inches as Ju, importSlide as K, getShapeAnimation as Ka, addSlideChart as Kc, setShapeStrokeSketch as Ki, findSlideLayoutByType as Kl, setShapeTextDirection as Kn, getPresentationNotesLength as Ko, getShapeCenter as Kr, getTableCellFill as Ks, getSlideTextLength as Kt, cm as Ku, resetSlidePlaceholderTextFormatting as L, setShapeRunHyperlink as La, incrementRevision as Lc, setShapeRotation as Li, getShapeGradientFill as Ll, setShapeAlignment as Ln, getAllComments as Lo, getGroupChildren as Lr, clearTableCellFill as Ls, getShapeAt as Lt, setPresentationTheme as Lu, setShapeLocked as M, setParagraphLevel as Ma, setThumbnail as Mc, setShapeNoFill as Mi, setSlideBackgroundGradientFill as Ml, getShapeTextColumns as Mn, clearSlideHyperlinks as Mo, setSlideLayout as Mr, listPackageParts as Ms, getOutlineText as Mt, setCommentStatus as Mu, addMissingSlidePlaceholders as N, setParagraphLineSpacing as Na, getCoreProperties as Nc, setShapeNoStroke as Ni, setSlideBackgroundImage as Nl, getShapeTextDirection as Nn, findSlidesByHyperlink as No, translateShapes as Nr, readPackagePart as Ns, getPresentationShapeCountsBySlide as Nt, setCommentText as Nu, setShapeCustomGeometry as O, isParagraphBulletPicture as Oa, setTableStyleId as Oc, setShapeFill as Oi, getSlideMasterBackgroundImageBytes as Ol, getShapeTextAnchor as On, setSlideSize as Oo, getSlideLayout as Or, getOrphanMediaPartNames as Os, findSlideByTitle as Ot, getPresentationCommenters as Ou, addSlidePlaceholder as P, setParagraphSpacing as Pa, getExtendedProperties as Pc, setShapePatternFill as Pi, setSlideBackgroundImageFillLayout as Pl, getShapeTextFlat as Pn, findSlidesWithChartKind as Po, centerShapeOnSlide as Pr, setMediaPartBytes as Ps, getPresentationText as Pt, getPresentationFonts as Pu, swapSlides as Q, findSlidesByLayoutName as Qa, getPresentationChartKindCounts as Qc, getShapeStroke as Qi, getSlideLayoutUsageCountsByType as Ql, clearShapeEffects as Qn, getSlideNotesParagraphEndFormat as Qo, getShapeName as Qr, getTableCellText as Qs, isSlideLayoutBackgroundGraphicsHidden as Qt, addBlankSlide as R, setShapeRunText as Ra, setCoreProperties as Rc, setShapeSize as Ri, getShapeGradientFillEffective as Rl, setShapeBulletStyle as Rn, getAllHyperlinks as Ro, getGroupTransform as Rr, getPresentationTableCountsBySlide as Rs, getSlideAt as Rt, createPresentation as Ru, groupShapes as S, getShapeParagraphElements as Sa, setTableCellText as Sc, clearShapeStroke as Si, getSlideLayoutBackgroundImageBytes as Sl, moveSlideAnimation as Sn, setShapeImageRecolor as So, findSlidePlaceholderByIdx as Sr, getShapeMedia as Ss, setSlideMasterPlaceholderIncluded as St, getCommentSlide as Su, getParagraphElementLanguages as T, getShapeRunHyperlink as Ta, setTableColumnWidth as Tc, getShapeStrokeDash as Ti, getSlideLayoutShapes as Tl, appendShapeText as Tn, SLIDE_SIZE_4_3 as To, getShapeSlide as Tr, _internalPackageOf as Ts, setSlideSections as Tt, getCommentsSortedByDate as Tu, addTitleSlide as U, setSlideTitle as Ua, getShapeRunFormatEffective as Uc, setShapeStrokeCompound as Ui, findLayoutsWithPlaceholderType as Ul, setShapeTextAutoFit as Un, getEmptySlides as Uo, getShapeAltTitle as Ur, getTableCellAnchor as Us, getSlideOutline as Ut, BUILTIN_PICTURE_STYLES as Uu, addSlide as V, setSlideBody as Va, getParagraphPropertiesEffective as Vc, setShapeStrokeArrow as Vi, setSlideLayoutName as Vl, setShapeText3D as Vn, getAllTables as Vo, getPresetGeometry as Vr, getTableCell as Vs, getSlideInfo as Vt, COMMENT_STATUSES as Vu, duplicateSlide as W, clearSlideAnimations as Wa, setShapeHyperlink as Wc, setShapeStrokeDash as Wi, findSlideLayout as Wl, setShapeTextBodyRotationDeg as Wn, getHiddenSlides as Wo, getShapeBounds as Wr, getTableCellAppearanceEffective as Ws, getSlidePartName as Wt, toWritableTextFormat as Wu, reverseSlides as X, findOverlappingShapePairs as Xa, findChartsWithTrendlines as Xc, getShapeFillEffective as Xi, getSlideLayoutType as Xl, setShapeTextMargins as Xn, getSlideNotesLength as Xo, getShapeId as Xr, getTableCellRunFormatEffective as Xs, isSlideBackgroundGraphicsHidden as Xt, pt as Xu, removeSlide as Y, findFlippedShapes as Ya, findChartsWithDataLabels as Yc, getShapeFillColorResolved as Yi, getSlideLayoutPlaceholders as Yl, setShapeTextFormat as Yn, getSlideNotes as Yo, getShapeFlip as Yr, getTableCellPosition as Ys, getSlidesByLayout as Yt, mm as Yu, sortSlides as Z, findShapesOutsideCanvas as Za, getPresentationChartCountsBySlide as Zc, getShapeFillOpacity as Zi, getSlideLayoutUsageCounts as Zl, setShapeTextWrap as Zn, getSlideNotesLineBreaks as Zo, getShapeKind as Zr, getTableCellSpan as Zs, isSlideHidden as Zt, resetShapeVideoFormatting as _, getParagraphLevel as _a, setTableCellBorders as _c, setShapeBounds as _i, getSlideBackgroundImageOpacity as _l, getShapeZIndex as _n, resetShapeImageColorEffects as _o, findShapesByName as _r, getSlideTransitionSound as _s, removeSlideMaster as _t, getCommentAuthors as _u, getCollapsedOutlineSlides as a, getShapeStrokeJoin as aa, getTableSize as ac, getShapeText as ai, setChartSpec as al, setSlideBackgroundGraphicsHidden as an, getShapeImageBytes as ao, setShapeGlow as ar, getSlidesWithOverlap as as, setNotesMasterPlaceholderIncluded as at, setCustomShows as au, setShapeImageCompressionState as b, getShapeHyperlinkTooltip as ba, setTableCellMargins as bc, shapesOverlap as bi, getSlideLayoutBackground as bl, sendShapeToBack as bn, setShapeImageCrop as bo, findShapesWithHyperlinks as br, addSlideMedia as bs, setSlideLayoutTitleIncluded as bt, getCommentParent as bu, getGridSpacing as c, getShapeRunFormat as ca, insertTableColumn as cc, getSlideMasterPartNames as ci, applySlideBackgroundToAll as cl, addSlideImage as cn, getShapeImageDuotone as co, setShapeShadow as cr, hasSlideNotes as cs, setSlideShowProperties as ct, clearAllSlideComments as cu, setDrawingGuidesVisible as d, getParagraphAlignment as da, isTableShape as dc, isShapeHidden as di, getSlideBackground as dl, addSlideTable as dn, getShapeImageLinkUrl as do, findShapeById as dr, resolveSlideNotesTextColor as ds, addSlideMaster as dt, findCommentsAfter as du, getShapeStrokeColor as ea, getTableCellTextDirection as ec, getShapePlaceholderType as ei, getShapeChartKind as el, replaceTextInPresentation as en, findSlidesByLayoutType as eo, getShape3D as er, getSlidesWithCharts as es, getHandoutSlidesPerPage as et, getUnusedSlideLayouts as eu, setGridSpacing as f, getParagraphBullet as fa, mergeTableCells as fc, isShapePlaceholder as fi, getSlideBackgroundGradientFill as fl, addSlideTextBox as fn, getShapeImageOpacity as fo, findShapeByName as fr, setSlideNotes as fs, getSlideMasterLayouts as ft, findCommentsBefore as fu, setSlideMasterBackgroundStyle as g, getParagraphIndent as ga, setTableCellAnchor as gc, setShapeAltTitle as gi, getSlideBackgroundImageIntrinsicSize as gl, copyShape as gn, isShapeImageGrayscale as go, findShapesByKind as gr, getSlideTransition as gs, removeSlideLayout as gt, getCommentAuthor as gu, getSlideMasterBackgroundStyles as h, getParagraphEndFormat as ha, setTableCellAlignment as hc, renameShape as hi, getSlideBackgroundImageFillLayout as hl, clearSlideShapes as hn, hasShapeText as ho, findShapesByHyperlink as hr, clearSlideTransition as hs, isSlideMasterPreserved as ht, findSlidesWithCommentsByAuthor as hu, setShapeImageFillLayout as i, getShapeStrokeGradient as ia, getTableRowHeights as ic, getShapeSize as ii, getSlideCharts as il, searchSlides as in, getShapeImageBrightness as io, setShape3D as ir, getSlidesWithNotes as is, setHandoutSlidesPerPage as it, getCustomShows as iu, setShapeAspectRatioLocked as j, setParagraphIndent as ja, removeThumbnail as jc, setShapeImageFill as ji, setSlideBackground as jl, getShapeTextBodyRotationDeg as jn, clearAllSlideNotes as jo, replaceTokensInSlide as jr, getSlideMediaPartNames as js, getAllShapes as jt, removeSlideComment as ju, isShapeAspectRatioLocked as k, setParagraphAlignment as ka, splitTableCell as kc, setShapeFlip as ki, getSlideMasterBackgroundPatternFill as kl, getShapeTextAutoFit as kn, appendSlideNotes as ko, getSlideShapes as kr, getPackageSize as ks, findSlidesByNotes as kt, getSlideCommentAuthors as ku, getSnapToGrid as l, resolveDrawingColor as la, insertTableRow as lc, getSlideMasterUsageCounts as li, clearSlideBackground as ll, addSlideLine as ln, getShapeImageFillBytes as lo, setShapeSoftEdge as lr, removeSlideNotes as ls, addSlideLayout as lt, clearSlideComments as lu, setSnapToGrid as m, getParagraphBulletStyle as ma, removeTableRow as mc, pointInShape as mi, getSlideBackgroundImageCrop as ml, bringShapeToFront as mn, hasShapeImage as mo, findShapeInPresentation as mr, transformSlideNotesCase as ms, getSlideMasterPlaceholders as mt, findCommentsByText as mu, getShapeImageFillLayout as n, getShapeStrokeCompound as na, getTableColumnWidths as nc, getShapePreset as ni, getShapeChartSeriesValues as nl, replaceTextInSlideNotes as nn, getShapeImageArtisticEffect as no, getShapeEffects as nr, getSlidesWithHyperlinks as ns, getNotesPageSize as nt, getShapeClickAction as nu, getDrawingGuides as o, getShapeStrokeOpacity as oa, getTableStyleFlags as oc, getSlideMasterCount as oi, getEffectiveColorMap as ol, setSlideHidden as on, getShapeImageContrast as oo, setShapeInnerShadow as or, getSlidesWithTables as os, setNotesPageOrientation as ot, setShapeImage as ou, setSlideOutlineCollapsed as p, getParagraphBulletImageBytes as pa, removeTableColumn as pc, isShapeTextBox as pi, getSlideBackgroundImageBytes as pl, bringShapeForward as pn, getShapeImagePartName as po, findShapeByText as pr, setSlideNotesFormat as ps, getSlideMasterName as pt, findCommentsByAuthor as pu, mergePresentations as q, getSlideAnimations as qa, findChartByKind as qc, getShapeFill as qi, getSlideLayoutName as ql, setShapeTextField as qn, getPresentationNotesLengthsBySlide as qo, getShapeCustomGeometry as qr, getTableCellMargins as qs, getSlideXmlString as qt, emu as qu, getShapeImageIntrinsicSize as r, getShapeStrokeEffective as ra, getTableDimensions as rc, getShapeRotation as ri, getShapeChartSpec as rl, replaceTokensInPresentation as rn, getShapeImageBiLevelThreshold as ro, getShapeEffectsEffective as rr, getSlidesWithImages as rs, setHandoutMasterPlaceholderIncluded as rt, setShapeClickAction as ru, getDrawingGuidesVisible as s, getShapeStrokeWidth as sa, getTableStyleId as sc, getSlideMasterPartName as si, resolveDeckBodyTextColor as sl, slideHasAnimations as sn, getShapeImageCrop as so, setShapeReflection as sr, getVisibleSlides as ss, getSlideShowProperties as st, addSlideComment as su, VERSION as t, getShapeStrokeColorResolved as ta, getTableCells as tc, getShapePosition as ti, getShapeChartSeriesNames as tl, replaceTextInSlide as tn, getPresentationImageCountsBySlide as to, getShapeEffect as tr, getSlidesWithComments as ts, getNotesMasterPlaceholders as tt, isChartSpec as tu, setDrawingGuides as u, resolveDrawingColorOpacity as ua, isChartShape as uc, getUnusedSlideMasters as ui, copySlideBackground as ul, addSlideShape as un, getShapeImageFormat as uo, findEmptyPlaceholders as ur, replaceHyperlink as us, addSlideLayoutPlaceholder as ut, findCommentAuthorByName as uu, getShapeImageCompressionState as v, getParagraphLineSpacing as va, setTableCellClickAction as vc, setShapeDescription as vi, getSlideBackgroundPatternFill as vl, removeShape as vn, setShapeImageBrightness as vo, findShapesByPreset as vr, setSlideTransition as vs, setSlideLayoutBackgroundGraphicsHidden as vt, getCommentDate as vu, setShapeStyle as w, getShapeRunCount as wa, setTableCellTextFormat as wc, getShapeStrokeArrow as wi, getSlideLayoutBackgroundShapes as wl, updateSlideAnimation as wn, SLIDE_SIZE_16_9 as wo, getShapeIndex as wr, setShapeMediaPlayback as ws, getSlideSections as wt, getCommentText as wu, setShapePictureStyle as x, getShapeParagraphCount as xa, setTableCellParagraphs as xc, clearShapeFill as xi, getSlideLayoutBackgroundGradientFill as xl, setShapeZIndex as xn, setShapeImageOpacity as xo, findSlidePlaceholder as xr, findShapesWithMedia as xs, setSlideMasterName as xt, getCommentPosition as xu, getShapePictureStyle as y, getParagraphSpacing as ya, setTableCellFill as yc, setShapeHidden as yi, getSlideColorMapOverride as yl, sendShapeBackward as yn, setShapeImageContrast as yo, findShapesByText as yr, setSlideTransitionSound as ys, setSlideLayoutFootersIncluded as yt, getCommentFormat as yu, addContentSlide as z, getSlideBody as za, setExtendedProperties as zc, setShapeSlideBackgroundFill as zi, clearSlideLayoutBackground as zl, setShapeParagraphs as zn, getAllImages as zo, getMaxShapeId as zr, getSlideTables as zs, getSlideCount as zt, loadPresentation as zu };
55921
+ export { getHandoutMasterPlaceholders as $, findSlidesByLayoutPartName as $a, getShapeChartCategories as $c, getShapeStrokeCap as $i, getSlideLayoutUsageCountsByType as $l, findShapesByEffect as $n, getSlideNotesTextFormats as $o, getShapePlaceholderIdx as $r, getTableCellText3D as $s, replaceTextInNotes as $t, isShapeLocked as A, setParagraphBullet as Aa, getThumbnail as Ac, setShapeGradientFill as Ai, getSlideMasterBackgroundPatternFill as Al, getShapeTextAutoFitParams as An, clearAllHyperlinks as Ao, getSlidesWithEmptyPlaceholders as Ar, getPresentationSummary as As, findSlidesByText as At, getSlideCommentAuthors as Au, addSectionHeaderSlide as B, getSlideTitle as Ba, touchModified as Bc, setShapeStroke as Bi, clearSlideLayoutBackground as Bl, setShapeText as Bn, getAllNotes as Bo, getMaxShapeIdInPresentation as Br, getTableBackgroundEffective as Bs, getSlideIndex as Bt, loadPresentation as Bu, ungroupShapes as C, getShapeRunClickAction as Ca, setTableCellTextDirection as Cc, getShapePatternFill as Ci, getSlideLayoutBackgroundImageBytes as Cl, removeSlideAnimation as Cn, SLIDE_SIZE_16_10 as Co, findSlidePlaceholders as Cr, getShapeMediaPlayback as Cs, setSlideMasterPreserved as Ct, getCommentSlide as Cu, setShapeTextLanguage as D, getShapeRunText as Da, setTableStyleFlags as Dc, setShapeAdjustValues as Di, getSlideMasterBackground as Dl, getShapeText3D as Dn, getSlideSize as Do, getShapesBounds as Dr, getMediaParts as Ds, findSlideByText as Dt, getPresentationCommentCountsByAuthor as Du, getShapeTextLanguage as E, getShapeRunHyperlinkTooltip as Ea, setTableRowHeight as Ec, getShapeStrokeSketch as Ei, getSlideLayoutShapes as El, getShapeBodyPrEffective as En, getPresentationFirstSlideNumber as Eo, getShapeXmlString as Er, compactPackage as Es, findSlideByPartName as Et, getCommentsSortedByDate as Eu, resetSlideLayout as F, setParagraphTabs as Fa, getPresentationCreated as Fc, setShapePosition as Fi, setSlideBackgroundImageFillLayout as Fl, getShapeTextMargins as Fn, findSlidesWithChartTrendlines as Fo, findShapesAtPoint as Fr, slidesUsingMediaPart as Fs, getPresentationTextLength as Ft, getPresentationFonts as Fu, duplicateSlideAt as G, findShapesWithAnimation as Ga, setShapeRunFormat as Gc, setShapeStrokeJoin as Gi, findSlideLayout as Gl, setShapeTextColumns as Gn, getPresentationHyperlinkCountsBySlide as Go, getShapeBoundsResolved as Gr, getTableCellBorders as Gs, getSlideText as Gt, toWritableTextFormat as Gu, addSlideAt as H, setSlidePlaceholders as Ha, getShapeHyperlink as Hc, setShapeStrokeCap as Hi, setSlideLayoutName as Hl, setShapeTextAnchor as Hn, getDistinctHyperlinkUrls as Ho, getShapeAdjustValues as Hr, getTableCellAlignment as Hs, getSlideLayoutCount as Ht, COMMENT_STATUSES as Hu, resetSlidePlaceholderGeometry as I, setParagraphTypography as Ia, getPresentationModified as Ic, setShapePreset as Ii, setSlideBackgroundImageOpacity as Il, getShapeTextWrap as In, getAllCharts as Io, findShapesInRect as Ir, validatePresentation as Is, getPresentationTextLengthsBySlide as It, getPresentationTheme as Iu, moveSlide as J, setShapeAnimation as Ja, findChartsBySeriesName as Jc, getShapeFillColor as Ji, getSlideLayoutName as Jl, setShapeTextFlat as Jn, getPresentationNotesText as Jo, getShapeDescription as Jr, getTableCellParagraphs as Js, getSlides as Jt, emu as Ju, importSlide as K, getShapeAnimation as Ka, addSlideChart as Kc, setShapeStrokeSketch as Ki, findSlideLayoutByPartName as Kl, setShapeTextDirection as Kn, getPresentationNotesLength as Ko, getShapeCenter as Kr, getTableCellFill as Ks, getSlideTextLength as Kt, asColor as Ku, resetSlidePlaceholderTextFormatting as L, setShapeRunHyperlink as La, incrementRevision as Lc, setShapeRotation as Li, setSlideBackgroundPatternFill as Ll, setShapeAlignment as Ln, getAllComments as Lo, getGroupChildren as Lr, clearTableCellFill as Ls, getShapeAt as Lt, setPresentationFonts as Lu, setShapeLocked as M, setParagraphLevel as Ma, setThumbnail as Mc, setShapeNoFill as Mi, setSlideBackground as Ml, getShapeTextColumns as Mn, clearSlideHyperlinks as Mo, setSlideLayout as Mr, listPackageParts as Ms, getOutlineText as Mt, removeSlideComment as Mu, addMissingSlidePlaceholders as N, setParagraphLineSpacing as Na, getCoreProperties as Nc, setShapeNoStroke as Ni, setSlideBackgroundGradientFill as Nl, getShapeTextDirection as Nn, findSlidesByHyperlink as No, translateShapes as Nr, readPackagePart as Ns, getPresentationShapeCountsBySlide as Nt, setCommentStatus as Nu, setShapeCustomGeometry as O, isParagraphBulletPicture as Oa, setTableStyleId as Oc, setShapeFill as Oi, getSlideMasterBackgroundGradientFill as Ol, getShapeTextAnchor as On, setSlideSize as Oo, getSlideLayout as Or, getOrphanMediaPartNames as Os, findSlideByTitle as Ot, getPresentationCommentCountsBySlide as Ou, addSlidePlaceholder as P, setParagraphSpacing as Pa, getExtendedProperties as Pc, setShapePatternFill as Pi, setSlideBackgroundImage as Pl, getShapeTextFlat as Pn, findSlidesWithChartKind as Po, centerShapeOnSlide as Pr, setMediaPartBytes as Ps, getPresentationText as Pt, setCommentText as Pu, swapSlides as Q, findSlidesByLayoutName as Qa, getPresentationChartKindCounts as Qc, getShapeStroke as Qi, getSlideLayoutUsageCounts as Ql, clearShapeEffects as Qn, getSlideNotesParagraphEndFormat as Qo, getShapeName as Qr, getTableCellText as Qs, isSlideLayoutBackgroundGraphicsHidden as Qt, addBlankSlide as R, setShapeRunText as Ra, setCoreProperties as Rc, setShapeSize as Ri, getShapeGradientFill as Rl, setShapeBulletStyle as Rn, getAllHyperlinks as Ro, getGroupTransform as Rr, getPresentationTableCountsBySlide as Rs, getSlideAt as Rt, setPresentationTheme as Ru, groupShapes as S, getShapeParagraphElements as Sa, setTableCellText as Sc, clearShapeStroke as Si, getSlideLayoutBackgroundGradientFill as Sl, moveSlideAnimation as Sn, setShapeImageRecolor as So, findSlidePlaceholderByIdx as Sr, getShapeMedia as Ss, setSlideMasterPlaceholderIncluded as St, getCommentPosition as Su, getParagraphElementLanguages as T, getShapeRunHyperlink as Ta, setTableColumnWidth as Tc, getShapeStrokeDash as Ti, getSlideLayoutBackgroundShapes as Tl, appendShapeText as Tn, SLIDE_SIZE_4_3 as To, getShapeSlide as Tr, _internalPackageOf as Ts, setSlideSections as Tt, getCommentText as Tu, addTitleSlide as U, setSlideTitle as Ua, getShapeRunFormatEffective as Uc, setShapeStrokeCompound as Ui, setSlideLayoutPlaceholderBounds as Ul, setShapeTextAutoFit as Un, getEmptySlides as Uo, getShapeAltTitle as Ur, getTableCellAnchor as Us, getSlideOutline as Ut, BUILTIN_TABLE_STYLES as Uu, addSlide as V, setSlideBody as Va, getParagraphPropertiesEffective as Vc, setShapeStrokeArrow as Vi, setSlideLayoutBackground as Vl, setShapeText3D as Vn, getAllTables as Vo, getPresetGeometry as Vr, getTableCell as Vs, getSlideInfo as Vt, savePresentation as Vu, duplicateSlide as W, clearSlideAnimations as Wa, setShapeHyperlink as Wc, setShapeStrokeDash as Wi, findLayoutsWithPlaceholderType as Wl, setShapeTextBodyRotationDeg as Wn, getHiddenSlides as Wo, getShapeBounds as Wr, getTableCellAppearanceEffective as Ws, getSlidePartName as Wt, BUILTIN_PICTURE_STYLES as Wu, reverseSlides as X, findOverlappingShapePairs as Xa, findChartsWithTrendlines as Xc, getShapeFillEffective as Xi, getSlideLayoutPlaceholders as Xl, setShapeTextMargins as Xn, getSlideNotesLength as Xo, getShapeId as Xr, getTableCellRunFormatEffective as Xs, isSlideBackgroundGraphicsHidden as Xt, mm as Xu, removeSlide as Y, findFlippedShapes as Ya, findChartsWithDataLabels as Yc, getShapeFillColorResolved as Yi, getSlideLayoutPartName$1 as Yl, setShapeTextFormat as Yn, getSlideNotes as Yo, getShapeFlip as Yr, getTableCellPosition as Ys, getSlidesByLayout as Yt, inches as Yu, sortSlides as Z, findShapesOutsideCanvas as Za, getPresentationChartCountsBySlide as Zc, getShapeFillOpacity as Zi, getSlideLayoutType as Zl, setShapeTextWrap as Zn, getSlideNotesLineBreaks as Zo, getShapeKind as Zr, getTableCellSpan as Zs, isSlideHidden as Zt, pt as Zu, resetShapeVideoFormatting as _, getParagraphLevel as _a, setTableCellBorders as _c, setShapeBounds as _i, getSlideBackgroundImageIntrinsicSize as _l, getShapeZIndex as _n, resetShapeImageColorEffects as _o, findShapesByName as _r, getSlideTransitionSound as _s, removeSlideMaster as _t, getCommentAuthor as _u, getCollapsedOutlineSlides as a, getShapeStrokeJoin as aa, getTableSize as ac, getShapeText as ai, setChartData as al, setSlideBackgroundGraphicsHidden as an, getShapeImageBytes as ao, setShapeGlow as ar, getSlidesWithOverlap as as, setNotesMasterPlaceholderIncluded as at, getCustomShows as au, setShapeImageCompressionState as b, getShapeHyperlinkTooltip as ba, setTableCellMargins as bc, shapesOverlap as bi, getSlideColorMapOverride as bl, sendShapeToBack as bn, setShapeImageCrop as bo, findShapesWithHyperlinks as br, addSlideMedia as bs, setSlideLayoutTitleIncluded as bt, getCommentFormat as bu, getGridSpacing as c, getShapeRunFormat as ca, insertTableColumn as cc, getSlideMasterPartNames as ci, resolveDeckBodyTextColor as cl, addSlideImage as cn, getShapeImageDuotone as co, setShapeShadow as cr, hasSlideNotes as cs, setSlideShowProperties as ct, addSlideComment as cu, setDrawingGuidesVisible as d, getParagraphAlignment as da, isTableShape as dc, isShapeHidden as di, copySlideBackground as dl, addSlideTable as dn, getShapeImageLinkUrl as do, findShapeById as dr, resolveSlideNotesTextColor as ds, addSlideMaster as dt, findCommentAuthorByName as du, getShapeStrokeColor as ea, getTableCellTextDirection as ec, getShapePlaceholderType as ei, getShapeChartKind as el, replaceTextInPresentation as en, findSlidesByLayoutType as eo, getShape3D as er, getSlidesWithCharts as es, getHandoutSlidesPerPage as et, getSlideLayouts as eu, setGridSpacing as f, getParagraphBullet as fa, mergeTableCells as fc, isShapePlaceholder as fi, getSlideBackground as fl, addSlideTextBox as fn, getShapeImageOpacity as fo, findShapeByName as fr, setSlideNotes as fs, getSlideMasterLayouts as ft, findCommentsAfter as fu, setSlideMasterBackgroundStyle as g, getParagraphIndent as ga, setTableCellAnchor as gc, setShapeAltTitle as gi, getSlideBackgroundImageFillLayout as gl, copyShape as gn, isShapeImageGrayscale as go, findShapesByKind as gr, getSlideTransition as gs, removeSlideLayout as gt, findSlidesWithCommentsByAuthor as gu, getSlideMasterBackgroundStyles as h, getParagraphEndFormat as ha, setTableCellAlignment as hc, renameShape as hi, getSlideBackgroundImageCrop as hl, clearSlideShapes as hn, hasShapeText as ho, findShapesByHyperlink as hr, clearSlideTransition as hs, isSlideMasterPreserved as ht, findCommentsByText as hu, setShapeImageFillLayout as i, getShapeStrokeGradient as ia, getTableRowHeights as ic, getShapeSize as ii, getSlideCharts as il, searchSlides as in, getShapeImageBrightness as io, setShape3D as ir, getSlidesWithNotes as is, setHandoutSlidesPerPage as it, setShapeClickAction as iu, setShapeAspectRatioLocked as j, setParagraphIndent as ja, removeThumbnail as jc, setShapeImageFill as ji, getSlideMasterShapes as jl, getShapeTextBodyRotationDeg as jn, clearAllSlideNotes as jo, replaceTokensInSlide as jr, getSlideMediaPartNames as js, getAllShapes as jt, getSlideComments as ju, isShapeAspectRatioLocked as k, setParagraphAlignment as ka, splitTableCell as kc, setShapeFlip as ki, getSlideMasterBackgroundImageBytes as kl, getShapeTextAutoFit as kn, appendSlideNotes as ko, getSlideShapes as kr, getPackageSize as ks, findSlidesByNotes as kt, getPresentationCommenters as ku, getSnapToGrid as l, resolveDrawingColor as la, insertTableRow as lc, getSlideMasterUsageCounts as li, applySlideBackgroundToAll as ll, addSlideLine as ln, getShapeImageFillBytes as lo, setShapeSoftEdge as lr, removeSlideNotes as ls, addSlideLayout as lt, clearAllSlideComments as lu, setSnapToGrid as m, getParagraphBulletStyle as ma, removeTableRow as mc, pointInShape as mi, getSlideBackgroundImageBytes as ml, bringShapeToFront as mn, hasShapeImage as mo, findShapeInPresentation as mr, transformSlideNotesCase as ms, getSlideMasterPlaceholders as mt, findCommentsByAuthor as mu, getShapeImageFillLayout as n, getShapeStrokeCompound as na, getTableColumnWidths as nc, getShapePreset as ni, getShapeChartSeriesValues as nl, replaceTextInSlideNotes as nn, getShapeImageArtisticEffect as no, getShapeEffects as nr, getSlidesWithHyperlinks as ns, getNotesPageSize as nt, isChartSpec as nu, getDrawingGuides as o, getShapeStrokeOpacity as oa, getTableStyleFlags as oc, getSlideMasterCount as oi, setChartSpec as ol, setSlideHidden as on, getShapeImageContrast as oo, setShapeInnerShadow as or, getSlidesWithTables as os, setNotesPageOrientation as ot, setCustomShows as ou, setSlideOutlineCollapsed as p, getParagraphBulletImageBytes as pa, removeTableColumn as pc, isShapeTextBox as pi, getSlideBackgroundGradientFill as pl, bringShapeForward as pn, getShapeImagePartName as po, findShapeByText as pr, setSlideNotesFormat as ps, getSlideMasterName as pt, findCommentsBefore as pu, mergePresentations as q, getSlideAnimations as qa, findChartByKind as qc, getShapeFill as qi, findSlideLayoutByType as ql, setShapeTextField as qn, getPresentationNotesLengthsBySlide as qo, getShapeCustomGeometry as qr, getTableCellMargins as qs, getSlideXmlString as qt, cm as qu, getShapeImageIntrinsicSize as r, getShapeStrokeEffective as ra, getTableDimensions as rc, getShapeRotation as ri, getShapeChartSpec as rl, replaceTokensInPresentation as rn, getShapeImageBiLevelThreshold as ro, getShapeEffectsEffective as rr, getSlidesWithImages as rs, setHandoutMasterPlaceholderIncluded as rt, getShapeClickAction as ru, getDrawingGuidesVisible as s, getShapeStrokeWidth as sa, getTableStyleId as sc, getSlideMasterPartName as si, getEffectiveColorMap as sl, slideHasAnimations as sn, getShapeImageCrop as so, setShapeReflection as sr, getVisibleSlides as ss, getSlideShowProperties as st, setShapeImage as su, VERSION as t, getShapeStrokeColorResolved as ta, getTableCells as tc, getShapePosition as ti, getShapeChartSeriesNames as tl, replaceTextInSlide as tn, getPresentationImageCountsBySlide as to, getShapeEffect as tr, getSlidesWithComments as ts, getNotesMasterPlaceholders as tt, getUnusedSlideLayouts as tu, setDrawingGuides as u, resolveDrawingColorOpacity as ua, isChartShape as uc, getUnusedSlideMasters as ui, clearSlideBackground as ul, addSlideShape as un, getShapeImageFormat as uo, findEmptyPlaceholders as ur, replaceHyperlink as us, addSlideLayoutPlaceholder as ut, clearSlideComments as uu, getShapeImageCompressionState as v, getParagraphLineSpacing as va, setTableCellClickAction as vc, setShapeDescription as vi, getSlideBackgroundImageOpacity as vl, removeShape as vn, setShapeImageBrightness as vo, findShapesByPreset as vr, setSlideTransition as vs, setSlideLayoutBackgroundGraphicsHidden as vt, getCommentAuthors as vu, setShapeStyle as w, getShapeRunCount as wa, setTableCellTextFormat as wc, getShapeStrokeArrow as wi, getSlideLayoutBackgroundPatternFill as wl, updateSlideAnimation as wn, SLIDE_SIZE_16_9 as wo, getShapeIndex as wr, setShapeMediaPlayback as ws, getSlideSections as wt, getCommentStatus as wu, setShapePictureStyle as x, getShapeParagraphCount as xa, setTableCellParagraphs as xc, clearShapeFill as xi, getSlideLayoutBackground as xl, setShapeZIndex as xn, setShapeImageOpacity as xo, findSlidePlaceholder as xr, findShapesWithMedia as xs, setSlideMasterName as xt, getCommentParent as xu, getShapePictureStyle as y, getParagraphSpacing as ya, setTableCellFill as yc, setShapeHidden as yi, getSlideBackgroundPatternFill as yl, sendShapeBackward as yn, setShapeImageContrast as yo, findShapesByText as yr, setSlideTransitionSound as ys, setSlideLayoutFootersIncluded as yt, getCommentDate as yu, addContentSlide as z, getSlideBody as za, setExtendedProperties as zc, setShapeSlideBackgroundFill as zi, getShapeGradientFillEffective as zl, setShapeParagraphs as zn, getAllImages as zo, getMaxShapeId as zr, getSlideTables as zs, getSlideCount as zt, createPresentation as zu };
55466
55922
 
55467
- //# sourceMappingURL=api-BSdL1LrI.js.map
55923
+ //# sourceMappingURL=api-CSDea_92.js.map