ooxml-core 1.45.0 → 1.46.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.
Files changed (82) hide show
  1. package/dist/PptxHandler-FZ43IJFP.mjs +5 -0
  2. package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-HWEOIHEA.mjs} +2 -2
  3. package/dist/PptxHandler-XAUKKK36.cjs +14 -0
  4. package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-2BCCMZW7.cjs} +6 -6
  5. package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-66RV4F45.mjs} +2 -2
  6. package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-AFD72LIG.mjs} +3 -3
  7. package/dist/automation/index.cjs +12 -7
  8. package/dist/automation/index.mjs +12 -7
  9. package/dist/chart/edit/group-options.d.ts +4 -0
  10. package/dist/chart/edit/group-options.d.ts.map +1 -1
  11. package/dist/chart/edit/new-chart-minimal.d.ts +13 -0
  12. package/dist/chart/edit/new-chart-minimal.d.ts.map +1 -0
  13. package/dist/chart/edit/new-chart.d.ts +34 -1
  14. package/dist/chart/edit/new-chart.d.ts.map +1 -1
  15. package/dist/chart/edit/secondary-axis.d.ts +8 -1
  16. package/dist/chart/edit/secondary-axis.d.ts.map +1 -1
  17. package/dist/chart/edit/type.d.ts +2 -0
  18. package/dist/chart/edit/type.d.ts.map +1 -1
  19. package/dist/chart/index.cjs +414 -263
  20. package/dist/chart/index.mjs +412 -264
  21. package/dist/{chunk-3J6VIKLP.cjs → chunk-5TOVSCVT.cjs} +3 -3
  22. package/dist/{chunk-U5BXJQZG.mjs → chunk-E2TTMUKU.mjs} +225 -38
  23. package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
  24. package/dist/{chunk-VKFKEVHK.mjs → chunk-EI6555OK.mjs} +1 -1
  25. package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
  26. package/dist/{chunk-GGJUWJXB.mjs → chunk-G6LEU3Y5.mjs} +1 -1
  27. package/dist/{chunk-RVYGAYCP.mjs → chunk-H43QQVJU.mjs} +1 -1
  28. package/dist/{chunk-CVJX6NNO.mjs → chunk-HH3AYM63.mjs} +227 -39
  29. package/dist/{chunk-YBSNMVSN.cjs → chunk-IBRV3AK3.cjs} +1497 -1309
  30. package/dist/{chunk-LCXBTJXE.mjs → chunk-L6MJGE3Q.mjs} +4 -4
  31. package/dist/{chunk-IPV3J3I5.mjs → chunk-LXVE2VKR.mjs} +4 -1
  32. package/dist/{chunk-QZPOPUI5.cjs → chunk-QUAFASFC.cjs} +4 -0
  33. package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
  34. package/dist/{chunk-GXYK3H4O.mjs → chunk-X2DC7XRL.mjs} +17 -16
  35. package/dist/{chunk-OORQCSVA.mjs → chunk-ZLUHU2SU.mjs} +1 -0
  36. package/dist/docx/index.cjs +300 -144
  37. package/dist/docx/index.mjs +300 -144
  38. package/dist/index.cjs +484 -333
  39. package/dist/index.mjs +484 -333
  40. package/dist/pptx/automation/index.cjs +350 -143
  41. package/dist/pptx/automation/index.d.ts +4 -4
  42. package/dist/pptx/automation/index.mjs +5 -5
  43. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts → index-BPGaFlm5.d.ts} +4 -4
  44. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index-BPGaFlm5.d.ts.map} +1 -1
  45. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-D4-WJQ1r.d.ts} +3 -3
  46. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-D4-WJQ1r.d.ts.map} +1 -1
  47. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-DtFoPmk7.d.ts} +49 -6
  48. package/dist/pptx/chunks/index-DtFoPmk7.d.ts.map +1 -0
  49. package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts → text-operations-CVHXOSit.d.ts} +18 -3
  50. package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
  51. package/dist/pptx/cli/index.cjs +307 -100
  52. package/dist/pptx/cli/index.d.ts +1 -1
  53. package/dist/pptx/cli/index.mjs +4 -4
  54. package/dist/pptx/converter/index.cjs +1 -0
  55. package/dist/pptx/converter/index.d.ts +1 -1
  56. package/dist/pptx/converter/index.mjs +2 -2
  57. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
  58. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
  59. package/dist/pptx/editor/render/collaboration-reconcile.cjs +8 -8
  60. package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
  61. package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
  62. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  63. package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
  64. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  65. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  66. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  67. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  68. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  69. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  70. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  71. package/dist/pptx/index.cjs +351 -147
  72. package/dist/pptx/index.d.ts +5 -5
  73. package/dist/pptx/index.mjs +5 -5
  74. package/dist/pptx/node/index.d.ts +1 -1
  75. package/dist/xlsx/index.cjs +12 -7
  76. package/dist/xlsx/index.mjs +12 -7
  77. package/dist/xlsx/ui/index.cjs +12 -7
  78. package/dist/xlsx/ui/index.mjs +12 -7
  79. package/package.json +1 -1
  80. package/dist/PptxHandler-3RDVJFQV.cjs +0 -14
  81. package/dist/PptxHandler-EI6DMHPM.mjs +0 -5
  82. package/dist/pptx/chunks/index-DGKI80Hj.d.ts.map +0 -1
@@ -624,6 +624,7 @@ var init_collaboration_field_schema = __esm({
624
624
  backgroundImage: "scalar",
625
625
  backgroundImageProperties: "complex",
626
626
  backgroundGradient: "scalar",
627
+ backgroundGradientFill: "complex",
627
628
  backgroundStyleRef: "complex",
628
629
  backgroundPattern: "complex",
629
630
  backgroundShadeToTitle: "scalar",
@@ -1218,6 +1219,150 @@ var init_xml_utils = __esm({
1218
1219
  }
1219
1220
  });
1220
1221
 
1222
+ // pptx/core/utils/gradient-angle.ts
1223
+ function normalizeDegrees(deg) {
1224
+ if (!Number.isFinite(deg)) {
1225
+ return 0;
1226
+ }
1227
+ return (deg % 360 + 360) % 360;
1228
+ }
1229
+ function ooxmlGradientAngleToCssDegrees(angleDegrees) {
1230
+ return normalizeDegrees(angleDegrees + OOXML_TO_CSS_OFFSET_DEG);
1231
+ }
1232
+ function cssDegreesToOoxmlGradientAngle(cssDegrees) {
1233
+ return normalizeDegrees(cssDegrees - OOXML_TO_CSS_OFFSET_DEG);
1234
+ }
1235
+ var OOXML_TO_CSS_OFFSET_DEG;
1236
+ var init_gradient_angle = __esm({
1237
+ "pptx/core/utils/gradient-angle.ts"() {
1238
+ OOXML_TO_CSS_OFFSET_DEG = 90;
1239
+ }
1240
+ });
1241
+
1242
+ // pptx/core/utils/slide-background-gradient.ts
1243
+ function cssColor(color3, opacity2) {
1244
+ if (opacity2 === void 0 || opacity2 >= 1) {
1245
+ return color3;
1246
+ }
1247
+ const hex5 = color3.replace("#", "");
1248
+ const channel = (index2) => Number.parseInt(hex5.slice(index2, index2 + 2), 16);
1249
+ return `rgba(${channel(0)}, ${channel(2)}, ${channel(4)}, ${num(opacity2)})`;
1250
+ }
1251
+ function slideBackgroundGradientCss(gradient) {
1252
+ const stops = (gradient.fillGradientStops ?? []).map((stop) => `${cssColor(stop.color, stop.opacity)} ${num(stop.position)}%`).join(", ");
1253
+ if (gradient.fillGradientType !== "radial") {
1254
+ const angle = ooxmlGradientAngleToCssDegrees(gradient.fillGradientAngle ?? 0);
1255
+ return `linear-gradient(${num(angle)}deg, ${stops})`;
1256
+ }
1257
+ const focus = gradient.fillGradientFillToRect;
1258
+ const cx = focus ? (focus.l + (1 - focus.r)) / 2 * 100 : 50;
1259
+ const cy = focus ? (focus.t + (1 - focus.b)) / 2 * 100 : 50;
1260
+ const at2 = `at ${num(cx)}% ${num(cy)}%`;
1261
+ switch (gradient.fillGradientPathType) {
1262
+ case "rect":
1263
+ return `radial-gradient(${num(Math.max(cx, 100 - cx))}% ${num(Math.max(cy, 100 - cy))}% ${at2}, ${stops})`;
1264
+ case "shape":
1265
+ return `radial-gradient(farthest-side ${at2}, ${stops})`;
1266
+ default:
1267
+ return `radial-gradient(circle ${at2}, ${stops})`;
1268
+ }
1269
+ }
1270
+ function slideBackgroundGradientToWrite(slide) {
1271
+ const gradient = slide.backgroundGradientFill;
1272
+ if (!gradient || !slide.backgroundGradient) {
1273
+ return void 0;
1274
+ }
1275
+ return slide.backgroundGradient === slideBackgroundGradientCss(gradient) ? gradient : void 0;
1276
+ }
1277
+ var num;
1278
+ var init_slide_background_gradient = __esm({
1279
+ "pptx/core/utils/slide-background-gradient.ts"() {
1280
+ init_gradient_angle();
1281
+ num = (value) => String(Number(value.toFixed(3)));
1282
+ }
1283
+ });
1284
+
1285
+ // pptx/core/builders/sdk/background-gradient-input.ts
1286
+ function finite(name, value, min, max) {
1287
+ if (typeof value !== "number" || !Number.isFinite(value)) {
1288
+ throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
1289
+ }
1290
+ if (min !== void 0 && value < min || max !== void 0 && value > max) {
1291
+ throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
1292
+ }
1293
+ return value;
1294
+ }
1295
+ function stopsOf(input2) {
1296
+ if (!Array.isArray(input2.stops) || input2.stops.length < 2) {
1297
+ throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
1298
+ }
1299
+ return input2.stops.map((stop, index2) => {
1300
+ if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
1301
+ throw new RangeError(
1302
+ `${WHERE}.stops[${index2}].color must be #RRGGBB, got ${String(stop.color)}`
1303
+ );
1304
+ }
1305
+ const position4 = finite(`stops[${index2}].position`, stop.position, 0, 1);
1306
+ const opacity2 = stop.opacity === void 0 ? void 0 : finite(`stops[${index2}].opacity`, stop.opacity, 0, 1);
1307
+ return {
1308
+ color: `#${stop.color.replace("#", "").toUpperCase()}`,
1309
+ // The shape gradient model keeps positions in percent.
1310
+ position: position4 * 100,
1311
+ ...opacity2 !== void 0 ? { opacity: opacity2 } : {}
1312
+ };
1313
+ });
1314
+ }
1315
+ function mapBackgroundGradientInput(input2) {
1316
+ const fillGradientStops = stopsOf(input2);
1317
+ let gradient;
1318
+ if (input2.path !== void 0) {
1319
+ if (!PATHS.has(input2.path)) {
1320
+ throw new RangeError(
1321
+ `${WHERE}.path must be circle, rect or shape, got ${String(input2.path)}`
1322
+ );
1323
+ }
1324
+ if (input2.angle !== void 0) {
1325
+ throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
1326
+ }
1327
+ const focus = input2.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
1328
+ gradient = {
1329
+ fillGradientType: "radial",
1330
+ fillGradientPathType: input2.path,
1331
+ fillGradientStops,
1332
+ fillGradientFillToRect: {
1333
+ l: finite("focus.l", focus.l),
1334
+ t: finite("focus.t", focus.t),
1335
+ r: finite("focus.r", focus.r),
1336
+ b: finite("focus.b", focus.b)
1337
+ }
1338
+ };
1339
+ } else {
1340
+ if (input2.focus !== void 0) {
1341
+ throw new RangeError(`${WHERE}.focus needs a path gradient`);
1342
+ }
1343
+ const cssAngle = finite("angle", input2.angle ?? 180);
1344
+ gradient = {
1345
+ fillGradientType: "linear",
1346
+ fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
1347
+ fillGradientStops
1348
+ };
1349
+ }
1350
+ return {
1351
+ backgroundGradient: slideBackgroundGradientCss(gradient),
1352
+ backgroundGradientFill: gradient
1353
+ };
1354
+ }
1355
+ var HEX, PATHS, WHERE;
1356
+ var init_background_gradient_input = __esm({
1357
+ "pptx/core/builders/sdk/background-gradient-input.ts"() {
1358
+ init_gradient_angle();
1359
+ init_slide_background_gradient();
1360
+ HEX = /^#?[0-9a-f]{6}$/iu;
1361
+ PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
1362
+ WHERE = "BackgroundInput";
1363
+ }
1364
+ });
1365
+
1221
1366
  // pptx/core/core/runtime/table-style-defaults.ts
1222
1367
  var DEFAULT_POWERPOINT_TABLE_STYLE_ID;
1223
1368
  var init_table_style_defaults = __esm({
@@ -1427,9 +1572,9 @@ function parseFormula(fmla) {
1427
1572
  return { op: op2, args };
1428
1573
  }
1429
1574
  function resolveOperand(token3, variables) {
1430
- const num4 = Number(token3);
1431
- if (Number.isFinite(num4)) {
1432
- return num4;
1575
+ const num5 = Number(token3);
1576
+ if (Number.isFinite(num5)) {
1577
+ return num5;
1433
1578
  }
1434
1579
  const value = variables.get(token3);
1435
1580
  if (value !== void 0) {
@@ -3257,8 +3402,8 @@ function authoredValue(node2) {
3257
3402
  return void 0;
3258
3403
  }
3259
3404
  const raw2 = node2["@_val"];
3260
- const num4 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
3261
- return Number.isFinite(num4) ? num4 : void 0;
3405
+ const num5 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
3406
+ return Number.isFinite(num5) ? num5 : void 0;
3262
3407
  }
3263
3408
  function applyChartGroupOptionsToXml(container2, containerLocal, chartData, getLocalName2) {
3264
3409
  let changed = false;
@@ -4652,6 +4797,7 @@ var init_ElementFactory = __esm({
4652
4797
  var SlideBuilder;
4653
4798
  var init_SlideBuilder = __esm({
4654
4799
  "pptx/core/builders/sdk/SlideBuilder.ts"() {
4800
+ init_background_gradient_input();
4655
4801
  init_ElementFactory();
4656
4802
  SlideBuilder = class {
4657
4803
  /**
@@ -4762,12 +4908,12 @@ var init_SlideBuilder = __esm({
4762
4908
  switch (bg.type) {
4763
4909
  case "solid":
4764
4910
  this.slide.backgroundColor = bg.color;
4911
+ delete this.slide.backgroundGradient;
4912
+ delete this.slide.backgroundGradientFill;
4765
4913
  break;
4766
- case "gradient": {
4767
- const stops = bg.stops.map((s) => `${s.color} ${Math.round(s.position * 100)}%`).join(", ");
4768
- this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
4914
+ case "gradient":
4915
+ Object.assign(this.slide, mapBackgroundGradientInput(bg));
4769
4916
  break;
4770
- }
4771
4917
  case "image":
4772
4918
  this.slide.backgroundImage = bg.source;
4773
4919
  break;
@@ -6225,9 +6371,9 @@ function resolveCoordinate(value, variables) {
6225
6371
  return value;
6226
6372
  }
6227
6373
  const trimmed2 = String(value).trim();
6228
- const num4 = Number(trimmed2);
6229
- if (Number.isFinite(num4)) {
6230
- return num4;
6374
+ const num5 = Number(trimmed2);
6375
+ if (Number.isFinite(num5)) {
6376
+ return num5;
6231
6377
  }
6232
6378
  return resolveOperand(trimmed2, variables);
6233
6379
  }
@@ -17443,9 +17589,9 @@ function resolveToken(token3, vars) {
17443
17589
  if (trimmed2 === "") {
17444
17590
  return 0;
17445
17591
  }
17446
- const num4 = Number(trimmed2);
17447
- if (Number.isFinite(num4)) {
17448
- return num4;
17592
+ const num5 = Number(trimmed2);
17593
+ if (Number.isFinite(num5)) {
17594
+ return num5;
17449
17595
  }
17450
17596
  return resolveOperand(trimmed2, vars);
17451
17597
  }
@@ -18360,23 +18506,6 @@ var init_element_actions = __esm({
18360
18506
  }
18361
18507
  });
18362
18508
 
18363
- // pptx/core/utils/gradient-angle.ts
18364
- function normalizeDegrees(deg) {
18365
- if (!Number.isFinite(deg)) {
18366
- return 0;
18367
- }
18368
- return (deg % 360 + 360) % 360;
18369
- }
18370
- function ooxmlGradientAngleToCssDegrees(angleDegrees) {
18371
- return normalizeDegrees(angleDegrees + OOXML_TO_CSS_OFFSET_DEG);
18372
- }
18373
- var OOXML_TO_CSS_OFFSET_DEG;
18374
- var init_gradient_angle = __esm({
18375
- "pptx/core/utils/gradient-angle.ts"() {
18376
- OOXML_TO_CSS_OFFSET_DEG = 90;
18377
- }
18378
- });
18379
-
18380
18509
  // pptx/core/utils/positive-fixed-angle.ts
18381
18510
  function normalizePositiveFixedAngleDegrees(degrees) {
18382
18511
  if (!Number.isFinite(degrees)) {
@@ -29091,7 +29220,7 @@ function boolean(value, fallback) {
29091
29220
  }
29092
29221
  return value === "1" || value === "true";
29093
29222
  }
29094
- function num(value, fallback) {
29223
+ function num2(value, fallback) {
29095
29224
  if (value === void 0 || value === "") {
29096
29225
  return fallback;
29097
29226
  }
@@ -29143,8 +29272,8 @@ function parseShape(element2) {
29143
29272
  const type = element2.attrs.type;
29144
29273
  return {
29145
29274
  type: type && type !== "none" ? type : void 0,
29146
- rot: num(element2.attrs.rot, 0),
29147
- zOrderOff: num(element2.attrs.zOrderOff, 0),
29275
+ rot: num2(element2.attrs.rot, 0),
29276
+ zOrderOff: num2(element2.attrs.zOrderOff, 0),
29148
29277
  hideGeom: boolean(element2.attrs.hideGeom, false),
29149
29278
  lkTxEntry: boolean(element2.attrs.lkTxEntry, false),
29150
29279
  blipPhldr: boolean(element2.attrs.blipPhldr, false),
@@ -29163,9 +29292,9 @@ function parseConstraint(attrs4) {
29163
29292
  refForName: attrs4.refForName || void 0,
29164
29293
  refPtType: attrs4.refPtType ?? "all",
29165
29294
  op: op2 === "equ" || op2 === "gte" || op2 === "lte" ? op2 : "none",
29166
- val: num(attrs4.val, 0),
29295
+ val: num2(attrs4.val, 0),
29167
29296
  hasVal: attrs4.val !== void 0,
29168
- fact: num(attrs4.fact, 1)
29297
+ fact: num2(attrs4.fact, 1)
29169
29298
  };
29170
29299
  }
29171
29300
  function parseRule(attrs4) {
@@ -32792,22 +32921,22 @@ var init_smartart_constraint_branch_index = __esm({
32792
32921
  });
32793
32922
 
32794
32923
  // diagram/layout/smartart-constraint-resolve.ts
32795
- function finite(value) {
32924
+ function finite2(value) {
32796
32925
  return typeof value === "number" && Number.isFinite(value);
32797
32926
  }
32798
32927
  function literalValue(constraint) {
32799
- if (finite(constraint.factor)) {
32928
+ if (finite2(constraint.factor)) {
32800
32929
  return constraint.factor;
32801
32930
  }
32802
- if (finite(constraint.value)) {
32931
+ if (finite2(constraint.value)) {
32803
32932
  return constraint.value;
32804
32933
  }
32805
32934
  return void 0;
32806
32935
  }
32807
32936
  function combine(constraint, referenced) {
32808
- const factor = finite(constraint.factor) ? constraint.factor : 1;
32937
+ const factor = finite2(constraint.factor) ? constraint.factor : 1;
32809
32938
  let result = referenced * factor;
32810
- if (finite(constraint.value)) {
32939
+ if (finite2(constraint.value)) {
32811
32940
  if (constraint.operator === "gte") {
32812
32941
  result = Math.max(result, constraint.value);
32813
32942
  } else if (constraint.operator === "lte") {
@@ -32845,7 +32974,7 @@ function resolveEntry(index2, entry2, visiting) {
32845
32974
  );
32846
32975
  const referenced = resolveInternal(index2, refRole, refType, visiting);
32847
32976
  if (referenced === void 0) {
32848
- return finite(constraint.value) ? constraint.value : void 0;
32977
+ return finite2(constraint.value) ? constraint.value : void 0;
32849
32978
  }
32850
32979
  return combine(constraint, referenced);
32851
32980
  }
@@ -40695,18 +40824,18 @@ function collectNamedRules(definition) {
40695
40824
  walk3(definition.rootNode);
40696
40825
  return out;
40697
40826
  }
40698
- function finite2(value) {
40827
+ function finite3(value) {
40699
40828
  return typeof value === "number" && Number.isFinite(value);
40700
40829
  }
40701
40830
  function ruleValue(rule) {
40702
- let value = finite2(rule.value) ? rule.value : rule.max;
40703
- if (!finite2(value)) {
40831
+ let value = finite3(rule.value) ? rule.value : rule.max;
40832
+ if (!finite3(value)) {
40704
40833
  return void 0;
40705
40834
  }
40706
- if (finite2(rule.factor)) {
40835
+ if (finite3(rule.factor)) {
40707
40836
  value *= rule.factor;
40708
40837
  }
40709
- if (finite2(rule.max)) {
40838
+ if (finite3(rule.max)) {
40710
40839
  value = Math.min(value, rule.max);
40711
40840
  }
40712
40841
  return Number.isFinite(value) ? value : void 0;
@@ -49502,18 +49631,18 @@ function groupTransform(group, parent) {
49502
49631
  const ext = first(xfrm, "ext", NS.a);
49503
49632
  const chOff = first(xfrm, "chOff", NS.a);
49504
49633
  const chExt = first(xfrm, "chExt", NS.a);
49505
- const num4 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
49506
- const cx = num4(ext, "cx");
49507
- const cy = num4(ext, "cy");
49508
- const chCx = num4(chExt, "cx");
49509
- const chCy = num4(chExt, "cy");
49634
+ const num5 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
49635
+ const cx = num5(ext, "cx");
49636
+ const cy = num5(ext, "cy");
49637
+ const chCx = num5(chExt, "cx");
49638
+ const chCy = num5(chExt, "cy");
49510
49639
  if (!off || ![cx, cy, chCx, chCy].every(Number.isFinite) || chCx === 0 || chCy === 0)
49511
49640
  return parent;
49512
49641
  const scaleX = cx / chCx;
49513
49642
  const scaleY = cy / chCy;
49514
49643
  const local = {
49515
- offsetX: num4(off, "x") - (num4(chOff, "x") || 0) * scaleX,
49516
- offsetY: num4(off, "y") - (num4(chOff, "y") || 0) * scaleY,
49644
+ offsetX: num5(off, "x") - (num5(chOff, "x") || 0) * scaleX,
49645
+ offsetY: num5(off, "y") - (num5(chOff, "y") || 0) * scaleY,
49517
49646
  scaleX,
49518
49647
  scaleY
49519
49648
  };
@@ -56319,9 +56448,9 @@ function parseValueColorPositions(node2, xmlLookup) {
56319
56448
  const entry2 = { kind };
56320
56449
  const rawVal = posNode["@_val"];
56321
56450
  if (rawVal !== void 0) {
56322
- const num4 = Number.parseFloat(String(rawVal));
56323
- if (Number.isFinite(num4)) {
56324
- entry2.value = num4;
56451
+ const num5 = Number.parseFloat(String(rawVal));
56452
+ if (Number.isFinite(num5)) {
56453
+ entry2.value = num5;
56325
56454
  }
56326
56455
  }
56327
56456
  positions2.push(entry2);
@@ -56683,8 +56812,8 @@ var init_chart_cx_parser = __esm({
56683
56812
  // pptx/core/utils/chart-user-shapes-parser.ts
56684
56813
  function markerFraction(marker2, axis, xml) {
56685
56814
  const raw2 = xml.getScalarChildByLocalName(marker2, axis);
56686
- const num4 = Number.parseFloat(String(raw2 ?? ""));
56687
- return Number.isFinite(num4) ? num4 : 0;
56815
+ const num5 = Number.parseFloat(String(raw2 ?? ""));
56816
+ return Number.isFinite(num5) ? num5 : 0;
56688
56817
  }
56689
56818
  function parseShapeParagraphs(shape2, xml, colors) {
56690
56819
  const txBody = xml.getChildByLocalName(shape2, "txBody");
@@ -56807,13 +56936,13 @@ function buildUserShape(shape2, kind, base2, xml, colors) {
56807
56936
  };
56808
56937
  }
56809
56938
  function parseOffExt(offNode, extNode) {
56810
- const num4 = (node2, attr6) => {
56939
+ const num5 = (node2, attr6) => {
56811
56940
  const raw2 = Number.parseFloat(String(node2?.[attr6] ?? ""));
56812
56941
  return Number.isFinite(raw2) ? raw2 : 0;
56813
56942
  };
56814
56943
  return {
56815
- off: { x: num4(offNode, "@_x"), y: num4(offNode, "@_y") },
56816
- ext: { cx: num4(extNode, "@_cx"), cy: num4(extNode, "@_cy") }
56944
+ off: { x: num5(offNode, "@_x"), y: num5(offNode, "@_y") },
56945
+ ext: { cx: num5(extNode, "@_cx"), cy: num5(extNode, "@_cy") }
56817
56946
  };
56818
56947
  }
56819
56948
  function parseGroupTransform(group, xml) {
@@ -57109,8 +57238,8 @@ function resolveCellValue(cell2, sharedStrings) {
57109
57238
  case "inlineStr":
57110
57239
  return cell2.value;
57111
57240
  default: {
57112
- const num4 = Number.parseFloat(cell2.value);
57113
- return Number.isFinite(num4) ? num4 : cell2.value;
57241
+ const num5 = Number.parseFloat(cell2.value);
57242
+ return Number.isFinite(num5) ? num5 : cell2.value;
57114
57243
  }
57115
57244
  }
57116
57245
  }
@@ -57195,8 +57324,8 @@ async function parseEmbeddedXlsx(xlsxData) {
57195
57324
  } else if (typeof cellVal === "number") {
57196
57325
  values.push(cellVal);
57197
57326
  } else {
57198
- const num4 = Number.parseFloat(String(cellVal));
57199
- values.push(Number.isFinite(num4) ? num4 : 0);
57327
+ const num5 = Number.parseFloat(String(cellVal));
57328
+ values.push(Number.isFinite(num5) ? num5 : 0);
57200
57329
  }
57201
57330
  }
57202
57331
  series.push({ name, values });
@@ -57722,8 +57851,8 @@ function parseVmlOpacity(value) {
57722
57851
  const pct = parseFloat(trimmed2.slice(0, -1));
57723
57852
  return Number.isFinite(pct) ? pct / 100 : void 0;
57724
57853
  }
57725
- const num4 = parseFloat(trimmed2);
57726
- return Number.isFinite(num4) ? Math.min(1, Math.max(0, num4)) : void 0;
57854
+ const num5 = parseFloat(trimmed2);
57855
+ return Number.isFinite(num5) ? Math.min(1, Math.max(0, num5)) : void 0;
57727
57856
  }
57728
57857
  var NAMED_COLORS;
57729
57858
  var init_vml_color_parser = __esm({
@@ -57766,29 +57895,29 @@ function parseCssDimension(value, containerPx) {
57766
57895
  if (trimmed2.length === 0) {
57767
57896
  return 0;
57768
57897
  }
57769
- const num4 = parseFloat(trimmed2);
57770
- if (!Number.isFinite(num4)) {
57898
+ const num5 = parseFloat(trimmed2);
57899
+ if (!Number.isFinite(num5)) {
57771
57900
  return 0;
57772
57901
  }
57773
57902
  if (trimmed2.endsWith("pt")) {
57774
- return num4 / PT_PER_PX2;
57903
+ return num5 / PT_PER_PX2;
57775
57904
  }
57776
57905
  if (trimmed2.endsWith("in")) {
57777
- return num4 * 96;
57906
+ return num5 * 96;
57778
57907
  }
57779
57908
  if (trimmed2.endsWith("cm")) {
57780
- return num4 * (96 / 2.54);
57909
+ return num5 * (96 / 2.54);
57781
57910
  }
57782
57911
  if (trimmed2.endsWith("mm")) {
57783
- return num4 * (96 / 25.4);
57912
+ return num5 * (96 / 25.4);
57784
57913
  }
57785
57914
  if (trimmed2.endsWith("emu")) {
57786
- return num4 / EMU_PER_PX6;
57915
+ return num5 / EMU_PER_PX6;
57787
57916
  }
57788
57917
  if (trimmed2.endsWith("%")) {
57789
- return containerPx ? num4 / 100 * containerPx : 0;
57918
+ return containerPx ? num5 / 100 * containerPx : 0;
57790
57919
  }
57791
- return num4;
57920
+ return num5;
57792
57921
  }
57793
57922
  function parseVmlStyle(styleAttr) {
57794
57923
  const result = {};
@@ -58707,7 +58836,7 @@ function children3(node2, name) {
58707
58836
  (v) => typeof v === "object" && v !== null ? v : {}
58708
58837
  );
58709
58838
  }
58710
- function num2(node2, attr6) {
58839
+ function num3(node2, attr6) {
58711
58840
  const raw2 = node2?.[`@_${attr6}`];
58712
58841
  if (raw2 === void 0 || raw2 === "") {
58713
58842
  return void 0;
@@ -58722,15 +58851,15 @@ function vec(node2, keys) {
58722
58851
  if (!node2) {
58723
58852
  return void 0;
58724
58853
  }
58725
- const [x, y, z2] = keys.map((k) => num2(node2, k));
58854
+ const [x, y, z2] = keys.map((k) => num3(node2, k));
58726
58855
  if (x === void 0 && y === void 0 && z2 === void 0) {
58727
58856
  return void 0;
58728
58857
  }
58729
58858
  return { x: x ?? 0, y: y ?? 0, z: z2 ?? 0 };
58730
58859
  }
58731
58860
  function ratio(node2) {
58732
- const n = num2(node2, "n");
58733
- const d = num2(node2, "d");
58861
+ const n = num3(node2, "n");
58862
+ const d = num3(node2, "d");
58734
58863
  if (n === void 0 || d === void 0 || d === 0) {
58735
58864
  return void 0;
58736
58865
  }
@@ -58746,7 +58875,7 @@ function colour2(node2) {
58746
58875
  const scrgb = child9(clr, "a:scrgbClr");
58747
58876
  if (scrgb) {
58748
58877
  const chan = (a) => {
58749
- const pct = Math.min(1e5, Math.max(0, num2(scrgb, a) ?? 0)) / 1e5;
58878
+ const pct = Math.min(1e5, Math.max(0, num3(scrgb, a) ?? 0)) / 1e5;
58750
58879
  return Math.round(pct * 255).toString(16).padStart(2, "0");
58751
58880
  };
58752
58881
  return `#${chan("r")}${chan("g")}${chan("b")}`;
@@ -58759,14 +58888,14 @@ function parseCamera(node2) {
58759
58888
  }
58760
58889
  const ortho = am(node2, "orthographic");
58761
58890
  const persp = am(node2, "perspective");
58762
- const fov = num2(persp, "fov");
58891
+ const fov = num3(persp, "fov");
58763
58892
  return {
58764
58893
  position: point(am(node2, "pos")),
58765
58894
  up: delta(am(node2, "up")),
58766
58895
  lookAt: point(am(node2, "lookAt")),
58767
58896
  projection: ortho && !persp ? "orthographic" : "perspective",
58768
58897
  ...fov !== void 0 ? { fovDeg: fov / ANGLE_UNIT } : {},
58769
- ...ortho ? { orthoScale: num2(ortho, "sx") ?? num2(ortho, "scale") } : {}
58898
+ ...ortho ? { orthoScale: num3(ortho, "sx") ?? num3(ortho, "scale") } : {}
58770
58899
  };
58771
58900
  }
58772
58901
  function parseTransform2(node2) {
@@ -58778,7 +58907,7 @@ function parseTransform2(node2) {
58778
58907
  const sx = ratio(am(scaleNode, "sx"));
58779
58908
  const sy = ratio(am(scaleNode, "sy"));
58780
58909
  const sz = ratio(am(scaleNode, "sz"));
58781
- const angle = (a) => (num2(rot, a) ?? 0) / ANGLE_UNIT;
58910
+ const angle = (a) => (num3(rot, a) ?? 0) / ANGLE_UNIT;
58782
58911
  return {
58783
58912
  meterPerModelUnit: ratio(am(node2, "meterPerModelUnit")),
58784
58913
  preTranslate: delta(am(node2, "preTrans")),
@@ -58791,7 +58920,7 @@ function parseLights(model3d) {
58791
58920
  const lights = [];
58792
58921
  for (const [tag, kind] of LIGHT_TAGS) {
58793
58922
  for (const node2 of [...children3(model3d, `am3d:${tag}`), ...children3(model3d, tag)]) {
58794
- const spot = num2(am(node2, "spotAngle"), "angle") ?? num2(node2, "angle") ?? num2(node2, "spotAngle");
58923
+ const spot = num3(am(node2, "spotAngle"), "angle") ?? num3(node2, "angle") ?? num3(node2, "spotAngle");
58795
58924
  lights.push({
58796
58925
  kind,
58797
58926
  color: colour2(node2),
@@ -58808,7 +58937,7 @@ function parseModel3DScene(model3d) {
58808
58937
  const camera = parseCamera(am(model3d, "camera"));
58809
58938
  const transform8 = parseTransform2(am(model3d, "trans"));
58810
58939
  const lights = parseLights(model3d);
58811
- const viewportSizeEmu = num2(am(model3d, "objViewport"), "viewportSz");
58940
+ const viewportSizeEmu = num3(am(model3d, "objViewport"), "viewportSz");
58812
58941
  if (!camera && !transform8 && lights.length === 0) {
58813
58942
  return void 0;
58814
58943
  }
@@ -72062,7 +72191,15 @@ var init_PptxSlideBackgroundBuilder = __esm({
72062
72191
  init.reportUnsupportedBackground?.(rawBackgroundImage);
72063
72192
  }
72064
72193
  }
72065
- if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
72194
+ if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundGradient) {
72195
+ const gradFill2 = init.buildBackgroundGradientFill?.();
72196
+ if (gradFill2) {
72197
+ backgroundProperties["a:gradFill"] = gradFill2;
72198
+ } else if (!hasBackgroundColor && !hasBackgroundImage) {
72199
+ init.reportUnsupportedGradient?.();
72200
+ }
72201
+ }
72202
+ if (backgroundProperties["a:blipFill"] === void 0 && backgroundProperties["a:gradFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
72066
72203
  backgroundProperties["a:solidFill"] = {
72067
72204
  "a:srgbClr": {
72068
72205
  "@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
@@ -76955,8 +77092,8 @@ function decodeAinkInk(inkRoot) {
76955
77092
  if (raw2.length === 0) {
76956
77093
  return 2;
76957
77094
  }
76958
- const num4 = Number(raw2);
76959
- return Number.isFinite(num4) && num4 > 0 ? num4 : 2;
77095
+ const num5 = Number(raw2);
77096
+ return Number.isFinite(num5) && num5 > 0 ? num5 : 2;
76960
77097
  })();
76961
77098
  const traces = ensureArrayLike3(inkRoot["aink:trace"]);
76962
77099
  for (const trace of traces) {
@@ -79117,9 +79254,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
79117
79254
  let maxId = 0;
79118
79255
  for (const rel of rels) {
79119
79256
  const id = String(rel?.["@_Id"] || "");
79120
- const num4 = Number.parseInt(id.replace(/^rId/, ""), 10);
79121
- if (Number.isFinite(num4) && num4 > maxId) {
79122
- maxId = num4;
79257
+ const num5 = Number.parseInt(id.replace(/^rId/, ""), 10);
79258
+ if (Number.isFinite(num5) && num5 > maxId) {
79259
+ maxId = num5;
79123
79260
  }
79124
79261
  }
79125
79262
  rels.push({
@@ -79204,11 +79341,11 @@ var init_PptxDocumentPropertiesUpdater = __esm({
79204
79341
  this.context = context;
79205
79342
  }
79206
79343
  async updateOnSave(slides, options2) {
79207
- await this.updateCoreProperties(options2?.coreProperties);
79344
+ await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
79208
79345
  await this.updateAppProperties(slides, options2?.appProperties);
79209
79346
  await this.updateCustomProperties(options2?.customProperties);
79210
79347
  }
79211
- async updateCoreProperties(overrides) {
79348
+ async updateCoreProperties(overrides, fixedDate) {
79212
79349
  const coreFile = this.context.zip.file("docProps/core.xml");
79213
79350
  if (!coreFile) {
79214
79351
  return;
@@ -79217,7 +79354,12 @@ var init_PptxDocumentPropertiesUpdater = __esm({
79217
79354
  const coreXml = await coreFile.async("string");
79218
79355
  const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides);
79219
79356
  const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
79220
- const next = {
79357
+ const next = fixedDate ? {
79358
+ ...core,
79359
+ revision: overrides?.revision ?? "1",
79360
+ created: overrides?.created ?? formatW3cdtf(fixedDate),
79361
+ modified: overrides?.modified ?? formatW3cdtf(fixedDate)
79362
+ } : {
79221
79363
  ...core,
79222
79364
  revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
79223
79365
  modified: formatW3cdtf(/* @__PURE__ */ new Date())
@@ -111535,7 +111677,7 @@ var init_type_axes = __esm({
111535
111677
  });
111536
111678
 
111537
111679
  // chart/edit/type.ts
111538
- function elementFor(kind, is3D) {
111680
+ function chartGroupElement(kind, is3D) {
111539
111681
  const match = Object.entries(CHART_GROUP_ELEMENTS).find(
111540
111682
  ([, value]) => value.kind === kind && value.is3D === is3D
111541
111683
  );
@@ -111550,7 +111692,7 @@ function groupingFor(element2, grouping) {
111550
111692
  }
111551
111693
  function newGroup(base2, target, series) {
111552
111694
  const is3D = target.is3D ?? (base2.is3D && SWITCHABLE[target.kind] === true);
111553
- const element2 = elementFor(target.kind, is3D);
111695
+ const element2 = chartGroupElement(target.kind, is3D);
111554
111696
  const group = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
111555
111697
  const allowed = GROUP_FIELDS[element2] ?? [];
111556
111698
  for (const key2 of allowed)
@@ -111759,6 +111901,11 @@ var init_target = __esm({
111759
111901
  });
111760
111902
 
111761
111903
  // chart/edit/group-options.ts
111904
+ function assertChartGroupOption(key2, value) {
111905
+ const [min, max] = RANGES[key2];
111906
+ if (!Number.isInteger(value) || value < min || value > max)
111907
+ throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
111908
+ }
111762
111909
  function setChartGroupOptions2(space, seriesIndex, edit) {
111763
111910
  return editChartSpace(space, (draft) => {
111764
111911
  const { group } = chartSeriesEntryAt(draft, seriesIndex);
@@ -111771,9 +111918,7 @@ function setChartGroupOptions2(space, seriesIndex, edit) {
111771
111918
  delete group[key2];
111772
111919
  continue;
111773
111920
  }
111774
- const [min, max] = RANGES[key2];
111775
- if (!Number.isInteger(value) || value < min || value > max)
111776
- throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
111921
+ assertChartGroupOption(key2, value);
111777
111922
  group[key2] = value;
111778
111923
  }
111779
111924
  });
@@ -113482,8 +113627,8 @@ function titleText(title) {
113482
113627
  }
113483
113628
  function scalingFromNeutral(axis, out) {
113484
113629
  const { scaling } = axis;
113485
- setOrRemove(out, "min", finite3(scaling.min));
113486
- setOrRemove(out, "max", finite3(scaling.max));
113630
+ setOrRemove(out, "min", finite4(scaling.min));
113631
+ setOrRemove(out, "max", finite4(scaling.max));
113487
113632
  const logBase = scaling.logBase !== void 0 && scaling.logBase > 0 ? scaling.logBase : void 0;
113488
113633
  setOrRemove(out, "logBase", logBase);
113489
113634
  setOrRemove(out, "logScale", logBase !== void 0 ? true : void 0);
@@ -113495,7 +113640,7 @@ function labelsFromNeutral(axis, out) {
113495
113640
  setOrRemove(out, "minorTickMark", oneOf(TICK_MARKS2, axis.minorTickMark));
113496
113641
  setOrRemove(out, "tickLblPos", oneOf(["high", "low", "nextTo", "none"], axis.tickLabelPosition));
113497
113642
  setOrRemove(out, "crosses", oneOf(["autoZero", "min", "max"], axis.crosses));
113498
- setOrRemove(out, "crossesAt", finite3(axis.crossesAt));
113643
+ setOrRemove(out, "crossesAt", finite4(axis.crossesAt));
113499
113644
  const valueAxis = type === "valAx";
113500
113645
  const categoryOrDate = type === "catAx" || type === "dateAx";
113501
113646
  const skips = type === "catAx" || type === "serAx";
@@ -113549,8 +113694,8 @@ function axisFromNeutral(axis, out) {
113549
113694
  setOrRemove(out, "displayUnits", custom2 ? "custom" : builtIn);
113550
113695
  setOrRemove(out, "displayUnitsValue", custom2 || void 0);
113551
113696
  }
113552
- setOrRemove(out, "majorUnit", finite3(axis.majorUnit));
113553
- setOrRemove(out, "minorUnit", finite3(axis.minorUnit));
113697
+ setOrRemove(out, "majorUnit", finite4(axis.majorUnit));
113698
+ setOrRemove(out, "minorUnit", finite4(axis.minorUnit));
113554
113699
  setOrRemove(
113555
113700
  out,
113556
113701
  "baseTimeUnit",
@@ -113571,12 +113716,12 @@ function axesFromNeutral(axes, styled) {
113571
113716
  );
113572
113717
  });
113573
113718
  }
113574
- var oneOf, finite3, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
113719
+ var oneOf, finite4, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
113575
113720
  var init_chart_from_neutral_axes = __esm({
113576
113721
  "pptx/core/utils/chart-from-neutral-axes.ts"() {
113577
113722
  init_chart_from_neutral_labels();
113578
113723
  oneOf = (values, value) => value !== void 0 && values.includes(value) ? value : void 0;
113579
- finite3 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
113724
+ finite4 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
113580
113725
  positiveInteger = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : void 0;
113581
113726
  TICK_MARKS2 = ["cross", "in", "none", "out"];
113582
113727
  TIME_UNITS2 = ["days", "months", "years"];
@@ -124311,7 +124456,7 @@ async function readSlideMasterPaths(zip) {
124311
124456
  }
124312
124457
  return paths;
124313
124458
  }
124314
- function num3(xml, pattern) {
124459
+ function num4(xml, pattern) {
124315
124460
  const value = pattern.exec(xml)?.[1];
124316
124461
  return value === void 0 ? void 0 : Number(value);
124317
124462
  }
@@ -124323,14 +124468,14 @@ function readPlaceholders(masterXml) {
124323
124468
  continue;
124324
124469
  }
124325
124470
  const kind = PLACEHOLDER_KINDS[/\btype="([^"]+)"/u.exec(phType)?.[1] ?? "body"];
124326
- const x = num3(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
124327
- const y = num3(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
124328
- const w = num3(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
124329
- const h2 = num3(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
124471
+ const x = num4(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
124472
+ const y = num4(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
124473
+ const w = num4(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
124474
+ const h2 = num4(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
124330
124475
  if (!kind || x === void 0 || y === void 0 || !w || !h2 || out.some((p2) => p2.kind === kind)) {
124331
124476
  continue;
124332
124477
  }
124333
- const size = num3(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
124478
+ const size = num4(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
124334
124479
  out.push({ kind, rect: { x, y, w, h: h2 }, ...size ? { sizePt: size / 100 } : {} });
124335
124480
  }
124336
124481
  return out;
@@ -132820,26 +132965,26 @@ function buildImgEffects(effects2) {
132820
132965
  if (effects2.backgroundRemoval) {
132821
132966
  out.push({ "a14:backgroundRemoval": buildBackgroundRemovalNode(effects2.backgroundRemoval) });
132822
132967
  }
132823
- if (finite4(effects2.sharpenSoften?.amount)) {
132968
+ if (finite5(effects2.sharpenSoften?.amount)) {
132824
132969
  out.push({ "a14:sharpenSoften": { "@_amount": round4(effects2.sharpenSoften.amount) } });
132825
132970
  }
132826
132971
  const bc = effects2.brightnessContrast;
132827
- if (bc && (finite4(bc.bright) || finite4(bc.contrast))) {
132972
+ if (bc && (finite5(bc.bright) || finite5(bc.contrast))) {
132828
132973
  const node2 = {};
132829
- if (finite4(bc.bright)) {
132974
+ if (finite5(bc.bright)) {
132830
132975
  node2["@_bright"] = round4(bc.bright);
132831
132976
  }
132832
- if (finite4(bc.contrast)) {
132977
+ if (finite5(bc.contrast)) {
132833
132978
  node2["@_contrast"] = round4(bc.contrast);
132834
132979
  }
132835
132980
  out.push({ "a14:brightnessContrast": node2 });
132836
132981
  }
132837
- if (finite4(effects2.colorTemperature?.colorTemp)) {
132982
+ if (finite5(effects2.colorTemperature?.colorTemp)) {
132838
132983
  out.push({
132839
132984
  "a14:colorTemperature": { "@_colorTemp": round4(effects2.colorTemperature.colorTemp) }
132840
132985
  });
132841
132986
  }
132842
- if (finite4(effects2.colorSaturation?.sat)) {
132987
+ if (finite5(effects2.colorSaturation?.sat)) {
132843
132988
  out.push({ "a14:saturation": { "@_sat": round4(effects2.colorSaturation.sat) } });
132844
132989
  }
132845
132990
  const artistic = a14ArtisticElementName(effects2.artisticEffect);
@@ -132889,7 +133034,7 @@ function applyA14ImageExtension(blip, effects2) {
132889
133034
  extLst[extKey] = entries.length === 1 ? entries[0] : entries;
132890
133035
  blip[extLstKey] = extLst;
132891
133036
  }
132892
- var GALLERY_TO_A14, round4, finite4;
133037
+ var GALLERY_TO_A14, round4, finite5;
132893
133038
  var init_image_a14_effects_writer = __esm({
132894
133039
  "pptx/core/core/runtime/image-a14-effects-writer.ts"() {
132895
133040
  init_image_a14_effects();
@@ -132922,7 +133067,7 @@ var init_image_a14_effects_writer = __esm({
132922
133067
  watercolorSponge: "artisticWatercolorSponge"
132923
133068
  };
132924
133069
  round4 = (value) => String(Math.round(value));
132925
- finite4 = (value) => typeof value === "number" && Number.isFinite(value);
133070
+ finite5 = (value) => typeof value === "number" && Number.isFinite(value);
132926
133071
  }
132927
133072
  });
132928
133073
 
@@ -139966,11 +140111,31 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
139966
140111
  * default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
139967
140112
  * module doc for why a nested group must not re-derive this itself.
139968
140113
  */
140114
+ /**
140115
+ * `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
140116
+ * mints reproducible ids and names (new table columns' `a16:colId`, the
140117
+ * fallback name of a new group) instead of random or time-based ones.
140118
+ */
140119
+ saveFixedDate;
140120
+ /**
140121
+ * The `p:cNvPr/@name` of a group with neither a name nor one from its
140122
+ * file: its element id, or for a reproducible save (`fixedDate`), which
140123
+ * must not depend on the time-based ids of elements made in code,
140124
+ * `Group <shape id>` as PowerPoint names groups.
140125
+ */
140126
+ groupFallbackName(group) {
140127
+ return this.saveFixedDate ? `Group ${group.shapeId ?? ""}`.trim() : group.id;
140128
+ }
139969
140129
  buildGroupShapeXml(group, ctx, ownEmuOverride) {
139970
140130
  if (group.rawXml && group.children.length === 0) {
139971
140131
  return {
139972
140132
  ...group.rawXml,
139973
- "p:nvGrpSpPr": buildGroupNonVisualXml(group.rawXml, group.name, group.id, group.shapeId)
140133
+ "p:nvGrpSpPr": buildGroupNonVisualXml(
140134
+ group.rawXml,
140135
+ group.name,
140136
+ this.groupFallbackName(group),
140137
+ group.shapeId
140138
+ )
139974
140139
  };
139975
140140
  }
139976
140141
  const EMU = _PptxHandlerRuntime.EMU_PER_PX;
@@ -139979,7 +140144,12 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
139979
140144
  const xfrm = buildGroupTransformXml(group, EMU, ownEmuOverride, rewrap);
139980
140145
  const childSpace = group;
139981
140146
  const grpXml2 = {
139982
- "p:nvGrpSpPr": buildGroupNonVisualXml(rawGroupXml, group.name, group.id, group.shapeId),
140147
+ "p:nvGrpSpPr": buildGroupNonVisualXml(
140148
+ rawGroupXml,
140149
+ group.name,
140150
+ this.groupFallbackName(group),
140151
+ group.shapeId
140152
+ ),
139983
140153
  "p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
139984
140154
  };
139985
140155
  const rawExtLst = rawGroupXml?.["p:extLst"];
@@ -142972,7 +143142,15 @@ function slideContainsA16Element(node2) {
142972
143142
  function randomColumnId() {
142973
143143
  return String(Math.floor(Math.random() * 4294967295));
142974
143144
  }
142975
- function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
143145
+ function deterministicColumnId(index2) {
143146
+ let hash3 = 2166136261;
143147
+ for (const ch of `a16:colId:${index2}`) {
143148
+ hash3 ^= ch.charCodeAt(0);
143149
+ hash3 = Math.imul(hash3, 16777619) >>> 0;
143150
+ }
143151
+ return String(hash3);
143152
+ }
143153
+ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
142976
143154
  const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
142977
143155
  const existingGridCols = ensureArrayFn(
142978
143156
  tbl["a:tblGrid"]?.["a:gridCol"]
@@ -143003,7 +143181,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
143003
143181
  // `ensureA16NamespaceOnSlideRoot`; emitting it here too is
143004
143182
  // schema-redundant and PowerPoint flags it.
143005
143183
  "a16:colId": {
143006
- "@_val": existingColIds[i2] || randomColumnId()
143184
+ "@_val": existingColIds[i2] || newColumnId(i2)
143007
143185
  }
143008
143186
  }
143009
143187
  }
@@ -143479,6 +143657,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
143479
143657
  init_table_style_change_cell_clear();
143480
143658
  init_table_paragraph_save_order();
143481
143659
  init_table_structural_ops();
143660
+ init_table_xml_rebuild();
143482
143661
  init_table_tblpr_save();
143483
143662
  CHART_DATA_DISPLAY_OPTIONS_EXT_URI = "{56B9EC1D-385E-4148-901F-78D8002777C0}";
143484
143663
  PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime23 {
@@ -143515,7 +143694,8 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
143515
143694
  tbl,
143516
143695
  tableData,
143517
143696
  _PptxHandlerRuntime.EMU_PER_PX,
143518
- this.ensureArray.bind(this)
143697
+ this.ensureArray.bind(this),
143698
+ this.saveFixedDate ? deterministicColumnId : void 0
143519
143699
  );
143520
143700
  const rebuiltRows = this.ensureArray(tbl["a:tr"]);
143521
143701
  for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
@@ -146124,9 +146304,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
146124
146304
  let maxId = 0;
146125
146305
  for (const rel of relationships3) {
146126
146306
  const id = String(rel?.["@_Id"] || "");
146127
- const num4 = parseInt(id.replace(/^rId/u, ""), 10);
146128
- if (Number.isFinite(num4) && num4 > maxId) {
146129
- maxId = num4;
146307
+ const num5 = parseInt(id.replace(/^rId/u, ""), 10);
146308
+ if (Number.isFinite(num5) && num5 > maxId) {
146309
+ maxId = num5;
146130
146310
  }
146131
146311
  }
146132
146312
  const existingFontTargets = /* @__PURE__ */ new Set();
@@ -146269,9 +146449,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
146269
146449
  let maxId = 0;
146270
146450
  for (const rel of relationships3) {
146271
146451
  const id = String(rel?.["@_Id"] || "");
146272
- const num4 = parseInt(id.replace(/^rId/u, ""), 10);
146273
- if (Number.isFinite(num4) && num4 > maxId) {
146274
- maxId = num4;
146452
+ const num5 = parseInt(id.replace(/^rId/u, ""), 10);
146453
+ if (Number.isFinite(num5) && num5 > maxId) {
146454
+ maxId = num5;
146275
146455
  }
146276
146456
  }
146277
146457
  relationships3.push({
@@ -150626,6 +150806,7 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
150626
150806
  init_slide_name();
150627
150807
  init_utils();
150628
150808
  init_modern_comment_package();
150809
+ init_slide_background_gradient();
150629
150810
  init_slide_synchronization();
150630
150811
  init_theme_override_utils();
150631
150812
  init_builders();
@@ -150883,6 +151064,16 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
150883
151064
  message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
150884
151065
  scope: "save",
150885
151066
  slideId: slide.id
151067
+ }),
151068
+ buildBackgroundGradientFill: () => {
151069
+ const gradient = slideBackgroundGradientToWrite(slide);
151070
+ return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
151071
+ },
151072
+ reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
151073
+ code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
151074
+ message: "Slide background gradient has no structured form (backgroundGradientFill) matching its CSS gradient and could not be written; the slide was saved without a background of its own.",
151075
+ scope: "save",
151076
+ slideId: slide.id
150886
151077
  })
150887
151078
  });
150888
151079
  this.slideCommentPartWriter.writeComments({
@@ -153234,6 +153425,15 @@ var init_PptxHandlerRuntimeSaveStructuralIds = __esm({
153234
153425
  });
153235
153426
 
153236
153427
  // pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts
153428
+ function validFixedDate(date5) {
153429
+ if (date5 === void 0) {
153430
+ return void 0;
153431
+ }
153432
+ if (!(date5 instanceof Date) || Number.isNaN(date5.getTime())) {
153433
+ throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
153434
+ }
153435
+ return date5;
153436
+ }
153237
153437
  var PptxHandlerRuntime54;
153238
153438
  var init_PptxHandlerRuntimeSavePipeline = __esm({
153239
153439
  "pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts"() {
@@ -153279,6 +153479,7 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
153279
153479
  /** One save, with the package to itself; callers go through {@link save}. */
153280
153480
  async saveNow(slides, options2) {
153281
153481
  validateSlideGeometry(slides);
153482
+ this.saveFixedDate = validFixedDate(options2?.fixedDate);
153282
153483
  const templates = [
153283
153484
  ...options2?.slideMasters ?? [],
153284
153485
  ...options2?.slideLayouts ?? [],
@@ -153469,7 +153670,8 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
153469
153670
  await this.documentPropertiesUpdater.updateOnSave(slides, {
153470
153671
  coreProperties: options2?.coreProperties,
153471
153672
  appProperties: options2?.appProperties,
153472
- customProperties: options2?.customProperties
153673
+ customProperties: options2?.customProperties,
153674
+ fixedDate: this.saveFixedDate
153473
153675
  });
153474
153676
  await this.applyTagCollectionChanges(options2?.tags);
153475
153677
  await this.applyNotesMasterChanges(options2?.notesMaster);
@@ -153513,6 +153715,11 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
153513
153715
  delete this.zip.files[name];
153514
153716
  }
153515
153717
  }
153718
+ if (this.saveFixedDate) {
153719
+ for (const file2 of Object.values(this.zip.files)) {
153720
+ file2.date = this.saveFixedDate;
153721
+ }
153722
+ }
153516
153723
  return await this.zip.generateAsync({
153517
153724
  type: "uint8array",
153518
153725
  compression: "DEFLATE",
@@ -163477,8 +163684,8 @@ function parseNumberVal(node2) {
163477
163684
  if (raw2 === void 0 || raw2 === null || raw2 === "") {
163478
163685
  return void 0;
163479
163686
  }
163480
- const num4 = Number.parseFloat(String(raw2));
163481
- return Number.isFinite(num4) ? num4 : void 0;
163687
+ const num5 = Number.parseFloat(String(raw2));
163688
+ return Number.isFinite(num5) ? num5 : void 0;
163482
163689
  }
163483
163690
  var CHART_DATA_DISPLAY_OPTIONS_EXT_URI2, PptxHandlerRuntime93;
163484
163691
  var init_PptxHandlerRuntimeChartParsingHelpers = __esm({
@@ -166071,12 +166278,12 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
166071
166278
  * in-memory format schemes of the masters on those parts and, when the deck's part is among
166072
166279
  * them, the deck's.
166073
166280
  */
166074
- async writeFormatScheme(elementFor2, themePaths) {
166281
+ async writeFormatScheme(elementFor, themePaths) {
166075
166282
  const deckBefore = this.getThemeFormatScheme();
166076
166283
  const replaced = /* @__PURE__ */ new Map();
166077
166284
  const schemes = /* @__PURE__ */ new Map();
166078
166285
  const written = await this.rewriteThemeParts(themePaths, (data, path4) => {
166079
- const element2 = elementFor2(path4);
166286
+ const element2 = elementFor(path4);
166080
166287
  const elements3 = data["a:theme"]?.["a:themeElements"];
166081
166288
  if (!element2 || !elements3) {
166082
166289
  return false;
@@ -166114,7 +166321,7 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
166114
166321
  this.themeFormatScheme = deck;
166115
166322
  this.heldFormatSchemes.holdParts(
166116
166323
  deck,
166117
- new Map(written.map((path4) => [path4, elementFor2(path4)]))
166324
+ new Map(written.map((path4) => [path4, elementFor(path4)]))
166118
166325
  );
166119
166326
  }
166120
166327
  return this.getThemeFormatScheme();
@@ -174640,12 +174847,12 @@ var OmmlLatexConverter = class {
174640
174847
  if (!f6) {
174641
174848
  return null;
174642
174849
  }
174643
- const num4 = this.renderNode(f6["m:num"]).trim();
174850
+ const num5 = this.renderNode(f6["m:num"]).trim();
174644
174851
  const den = this.renderNode(f6["m:den"]).trim();
174645
- if (!num4 && !den) {
174852
+ if (!num5 && !den) {
174646
174853
  return null;
174647
174854
  }
174648
- return `\\frac{${num4 || " "}}{${den || " "}}`;
174855
+ return `\\frac{${num5 || " "}}{${den || " "}}`;
174649
174856
  }
174650
174857
  trySuperscript(node2) {
174651
174858
  const value = node2["m:sSup"];