ooxml-core 1.46.0 → 1.47.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 (45) hide show
  1. package/dist/PptxHandler-JX62VKU4.cjs +14 -0
  2. package/dist/{PptxHandler-HWEOIHEA.mjs → PptxHandler-NXHZ6ITL.mjs} +2 -2
  3. package/dist/PptxHandler-SUGLNSZI.mjs +5 -0
  4. package/dist/{PresentationBuilder-2BCCMZW7.cjs → PresentationBuilder-IK6NIK6T.cjs} +6 -6
  5. package/dist/{PresentationBuilder-AFD72LIG.mjs → PresentationBuilder-LHQ333UL.mjs} +3 -3
  6. package/dist/{PresentationBuilder-66RV4F45.mjs → PresentationBuilder-URSPID7L.mjs} +2 -2
  7. package/dist/{chunk-IBRV3AK3.cjs → chunk-4GPLQEEC.cjs} +1381 -1289
  8. package/dist/{chunk-E2TTMUKU.mjs → chunk-553WFEHD.mjs} +108 -16
  9. package/dist/{chunk-H43QQVJU.mjs → chunk-5HNRZOBX.mjs} +1 -1
  10. package/dist/{chunk-EI6555OK.mjs → chunk-6MU4WKHS.mjs} +1 -1
  11. package/dist/{chunk-X2DC7XRL.mjs → chunk-7L6ZAA5Y.mjs} +66 -2
  12. package/dist/{chunk-5TOVSCVT.cjs → chunk-APCA7N6Q.cjs} +3 -3
  13. package/dist/{chunk-LXVE2VKR.mjs → chunk-DEDK2J57.mjs} +65 -1
  14. package/dist/{chunk-G6LEU3Y5.mjs → chunk-QHR726W3.mjs} +1 -1
  15. package/dist/{chunk-QUAFASFC.cjs → chunk-WFN6ZU7N.cjs} +65 -0
  16. package/dist/{chunk-L6MJGE3Q.mjs → chunk-XVEJS7HN.mjs} +5 -5
  17. package/dist/{chunk-HH3AYM63.mjs → chunk-Z734BYYR.mjs} +109 -17
  18. package/dist/pptx/automation/index.cjs +1857 -1682
  19. package/dist/pptx/automation/index.d.ts +3 -3
  20. package/dist/pptx/automation/index.mjs +5 -5
  21. package/dist/pptx/chunks/{index-BPGaFlm5.d.ts → index--HBUyILF.d.ts} +4 -4
  22. package/dist/pptx/chunks/{index-BPGaFlm5.d.ts.map → index--HBUyILF.d.ts.map} +1 -1
  23. package/dist/pptx/chunks/{index-DtFoPmk7.d.ts → index-BDVzSboe.d.ts} +23 -2
  24. package/dist/pptx/chunks/index-BDVzSboe.d.ts.map +1 -0
  25. package/dist/pptx/chunks/{index-D4-WJQ1r.d.ts → index-Dr3iIPt9.d.ts} +2 -2
  26. package/dist/pptx/chunks/{index-D4-WJQ1r.d.ts.map → index-Dr3iIPt9.d.ts.map} +1 -1
  27. package/dist/pptx/cli/index.cjs +301 -126
  28. package/dist/pptx/cli/index.mjs +4 -4
  29. package/dist/pptx/converter/index.d.ts +1 -1
  30. package/dist/pptx/converter/index.mjs +2 -2
  31. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  32. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  33. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  34. package/dist/pptx/editor/render/find-replace.d.ts +1 -1
  35. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  36. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  37. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  38. package/dist/pptx/index.cjs +2254 -2079
  39. package/dist/pptx/index.d.ts +4 -4
  40. package/dist/pptx/index.mjs +5 -5
  41. package/dist/pptx/node/index.d.ts +1 -1
  42. package/package.json +1 -1
  43. package/dist/PptxHandler-FZ43IJFP.mjs +0 -5
  44. package/dist/PptxHandler-XAUKKK36.cjs +0 -14
  45. package/dist/pptx/chunks/index-DtFoPmk7.d.ts.map +0 -1
@@ -35869,6 +35869,70 @@ function applyPictureEffects(blip, effects2) {
35869
35869
  for (const node of elements(blip)) blip.removeChild(node);
35870
35870
  for (const node of nodes) blip.appendChild(node);
35871
35871
  }
35872
+ function patchPictureEffects(source2, patch) {
35873
+ const result = structuredClone(source2);
35874
+ const upsert2 = (kind, update) => {
35875
+ const matches = result.flatMap((effect, index2) => effect.kind === kind ? [index2] : []);
35876
+ if (matches.length > 1) throw new Error(`Ambiguous duplicate picture effect: ${kind}`);
35877
+ const index = matches[0];
35878
+ const value = update(index === void 0 ? void 0 : result[index]);
35879
+ if (index !== void 0) {
35880
+ if (value) result[index] = value;
35881
+ else result.splice(index, 1);
35882
+ } else if (value) {
35883
+ const ext = result.findIndex(
35884
+ (effect) => effect.kind === "unsupported" && effect.name === "extLst"
35885
+ );
35886
+ result.splice(ext < 0 ? result.length : ext, 0, value);
35887
+ }
35888
+ };
35889
+ for (const key2 of ["brightness", "contrast", "alpha"])
35890
+ if (patch[key2] !== void 0 && !Number.isFinite(patch[key2]))
35891
+ throw new RangeError("Picture effect must be finite");
35892
+ if ([patch.brightness, patch.contrast].some((value) => value !== void 0 && Math.abs(value) > 1))
35893
+ throw new RangeError("Picture luminance must be between -1 and 1");
35894
+ if (patch.alpha !== void 0 && patch.alpha < 0)
35895
+ throw new RangeError("Picture alpha must be nonnegative");
35896
+ if (patch.grayscale !== void 0)
35897
+ upsert2(
35898
+ "grayscale",
35899
+ (effect) => patch.grayscale ? effect ?? { kind: "grayscale" } : void 0
35900
+ );
35901
+ if (patch.brightness !== void 0 || patch.contrast !== void 0)
35902
+ upsert2("luminance", (effect) => ({
35903
+ ...effect?.kind === "luminance" ? effect : { kind: "luminance" },
35904
+ ...patch.brightness !== void 0 ? { brightness: patch.brightness } : {},
35905
+ ...patch.contrast !== void 0 ? { contrast: patch.contrast } : {}
35906
+ }));
35907
+ if (patch.alpha !== void 0)
35908
+ upsert2("alphaModFix", (effect) => ({
35909
+ ...effect?.kind === "alphaModFix" ? effect : { kind: "alphaModFix" },
35910
+ amount: patch.alpha
35911
+ }));
35912
+ if (patch.standard) {
35913
+ const target = patch.standard;
35914
+ const matches = result.flatMap(
35915
+ (effect, index2) => effect.kind === "standard" && effect.name === target.name || effect.kind === "unsupported" && effect.name === target.name ? [index2] : []
35916
+ );
35917
+ if (matches.length > 1 || matches.some((index2) => result[index2]?.kind === "unsupported"))
35918
+ throw new Error(`Ambiguous or unreadable picture effect: ${target.name}`);
35919
+ const index = matches[0], before = index === void 0 ? void 0 : result[index];
35920
+ const next = {
35921
+ ...before?.kind === "standard" ? before : {},
35922
+ ...target,
35923
+ kind: "standard"
35924
+ };
35925
+ const doc = parseXml(next.sourceXml ?? `<a:${next.name} xmlns:a="${NS.a}"/>`);
35926
+ applyStandardPictureEffect(doc.documentElement, next);
35927
+ if (index === void 0) {
35928
+ const ext = result.findIndex(
35929
+ (effect) => effect.kind === "artistic" || effect.kind === "unsupported" && effect.name === "extLst"
35930
+ );
35931
+ result.splice(ext < 0 ? result.length : ext, 0, next);
35932
+ } else result[index] = next;
35933
+ }
35934
+ return result;
35935
+ }
35872
35936
  var init_picture_effects = __esm({
35873
35937
  "drawingml/picture-effects.ts"() {
35874
35938
  init_picture_artistic();
@@ -61268,6 +61332,53 @@ var init_chart_layout_operations = __esm({
61268
61332
  }
61269
61333
  });
61270
61334
 
61335
+ // pptx/core/builders/sdk/picture-effects-input.ts
61336
+ function pictureEffectsFromInput(options2) {
61337
+ const { opacity: opacity2, brightness, contrast } = options2 ?? {};
61338
+ if (opacity2 !== void 0 && !(opacity2 >= 0 && opacity2 <= 1)) {
61339
+ throw new RangeError(`ImageOptions.opacity must be between 0 and 1, got ${opacity2}`);
61340
+ }
61341
+ const patch = {};
61342
+ if (opacity2 !== void 0 && opacity2 < 1) {
61343
+ patch.alpha = opacity2;
61344
+ }
61345
+ if (brightness !== void 0) {
61346
+ patch.brightness = brightness / 100;
61347
+ }
61348
+ if (contrast !== void 0) {
61349
+ patch.contrast = contrast / 100;
61350
+ }
61351
+ if (Object.keys(patch).length === 0) {
61352
+ return void 0;
61353
+ }
61354
+ let patched;
61355
+ try {
61356
+ patched = patchPictureEffects([], patch);
61357
+ } catch (error) {
61358
+ throw new RangeError(
61359
+ `ImageOptions.brightness and contrast must be finite percentages from -100 to 100 (${String(error)})`
61360
+ );
61361
+ }
61362
+ let effects2;
61363
+ for (const effect of patched) {
61364
+ effects2 ??= {};
61365
+ if (effect.kind === "alphaModFix") {
61366
+ effects2.alphaModFix = effect.amount * 100;
61367
+ } else if (effect.kind === "luminance") {
61368
+ effects2.lum = {
61369
+ ...effect.brightness !== void 0 ? { bright: effect.brightness * 100 } : {},
61370
+ ...effect.contrast !== void 0 ? { contrast: effect.contrast * 100 } : {}
61371
+ };
61372
+ }
61373
+ }
61374
+ return effects2;
61375
+ }
61376
+ var init_picture_effects_input = __esm({
61377
+ "pptx/core/builders/sdk/picture-effects-input.ts"() {
61378
+ init_picture_effects();
61379
+ }
61380
+ });
61381
+
61271
61382
  // pptx/core/builders/sdk/shape-style-input.ts
61272
61383
  function mapFillToShapeStyle(fill3) {
61273
61384
  if (!fill3) {
@@ -61908,12 +62019,13 @@ function createConnectorElement(options2) {
61908
62019
  function createImageElement(source2, options2) {
61909
62020
  const p2 = pos("image", options2);
61910
62021
  const isDataUrl = source2.startsWith("data:");
62022
+ const imageEffects = pictureEffectsFromInput(options2);
61911
62023
  return {
61912
62024
  type: "image",
61913
62025
  id: generateId("img"),
61914
62026
  ...p2,
61915
62027
  rotation: options2?.rotation,
61916
- opacity: options2?.opacity,
62028
+ ...imageEffects ? { imageEffects } : {},
61917
62029
  imagePath: isDataUrl ? void 0 : source2,
61918
62030
  imageData: isDataUrl ? source2 : void 0,
61919
62031
  altText: options2?.altText,
@@ -62081,6 +62193,7 @@ var init_ElementFactory = __esm({
62081
62193
  init_custom_geometry();
62082
62194
  init_chart_gradient_input();
62083
62195
  init_chart_layout_operations();
62196
+ init_picture_effects_input();
62084
62197
  init_table_cell_input();
62085
62198
  init_table_merge_input();
62086
62199
  init_text_segment_style();
@@ -62482,6 +62595,174 @@ var init_layout_operations = __esm({
62482
62595
  }
62483
62596
  });
62484
62597
 
62598
+ // pptx/core/utils/document-properties-model.ts
62599
+ function toPptxCoreProperties(core) {
62600
+ const result = {};
62601
+ for (const field of CORE_FIELDS) result[field] = trimmed(core[field]);
62602
+ return anyDefined(result) ? result : void 0;
62603
+ }
62604
+ function toPptxAppProperties(app) {
62605
+ const result = {
62606
+ application: trimmed(app.application),
62607
+ appVersion: trimmed(app.appVersion),
62608
+ presentationFormat: trimmed(app.presentationFormat),
62609
+ slides: app.slides,
62610
+ hiddenSlides: app.hiddenSlides,
62611
+ notes: app.notes,
62612
+ totalTime: app.totalTime,
62613
+ words: app.words,
62614
+ paragraphs: app.paragraphs,
62615
+ company: trimmed(app.company),
62616
+ manager: trimmed(app.manager),
62617
+ template: trimmed(app.template),
62618
+ hyperlinkBase: trimmed(app.hyperlinkBase),
62619
+ docSecurity: app.docSecurity,
62620
+ mmClips: app.mmClips,
62621
+ scaleCrop: app.scaleCrop,
62622
+ linksUpToDate: app.linksUpToDate,
62623
+ sharedDoc: app.sharedDoc,
62624
+ hyperlinksChanged: app.hyperlinksChanged
62625
+ };
62626
+ return anyDefined(result) ? result : void 0;
62627
+ }
62628
+ function toPptxCustomProperties(texts) {
62629
+ return texts.flatMap((entry2) => {
62630
+ const name = entry2.name.trim();
62631
+ if (!name) return [];
62632
+ const known = CUSTOM_TYPES.has(entry2.type);
62633
+ return [{ name, value: known ? entry2.text : "", type: known ? entry2.type : "unknown" }];
62634
+ });
62635
+ }
62636
+ function applyCoreOverrides(core, overrides) {
62637
+ const next = { ...core };
62638
+ for (const field of CORE_FIELDS) {
62639
+ const value = overrides?.[field];
62640
+ if (value === void 0) continue;
62641
+ const text2 = String(value).trim();
62642
+ if (text2) next[field] = text2;
62643
+ else delete next[field];
62644
+ }
62645
+ return next;
62646
+ }
62647
+ function applyAppOverrides(app, overrides) {
62648
+ const next = { ...app };
62649
+ for (const field of APP_TEXT_OVERRIDES) {
62650
+ const value = overrides?.[field];
62651
+ if (value === void 0) continue;
62652
+ const text2 = String(value).trim();
62653
+ if (text2) next[field] = text2;
62654
+ else delete next[field];
62655
+ }
62656
+ for (const field of APP_NUMBER_OVERRIDES) {
62657
+ const value = Number(overrides?.[field]);
62658
+ if (overrides?.[field] !== void 0 && Number.isFinite(value)) next[field] = Math.trunc(value);
62659
+ }
62660
+ return next;
62661
+ }
62662
+ function toCustomProperty(entry2) {
62663
+ const type = String(entry2.type || "lpwstr").trim().toLowerCase();
62664
+ return customPropertyFromText(
62665
+ entry2.name,
62666
+ CUSTOM_TYPES.has(type) ? type : "lpwstr",
62667
+ String(entry2.value ?? "")
62668
+ );
62669
+ }
62670
+ var CORE_FIELDS, APP_TEXT_OVERRIDES, APP_NUMBER_OVERRIDES, trimmed, anyDefined, CUSTOM_TYPES;
62671
+ var init_document_properties_model = __esm({
62672
+ "pptx/core/utils/document-properties-model.ts"() {
62673
+ init_properties();
62674
+ CORE_FIELDS = [
62675
+ "title",
62676
+ "subject",
62677
+ "creator",
62678
+ "keywords",
62679
+ "description",
62680
+ "lastModifiedBy",
62681
+ "revision",
62682
+ "created",
62683
+ "modified",
62684
+ "category",
62685
+ "contentStatus"
62686
+ ];
62687
+ APP_TEXT_OVERRIDES = [
62688
+ "application",
62689
+ "appVersion",
62690
+ "presentationFormat",
62691
+ "company",
62692
+ "manager",
62693
+ "template"
62694
+ ];
62695
+ APP_NUMBER_OVERRIDES = [
62696
+ "slides",
62697
+ "hiddenSlides",
62698
+ "notes",
62699
+ "totalTime",
62700
+ "words",
62701
+ "paragraphs"
62702
+ ];
62703
+ trimmed = (value) => value?.trim() || void 0;
62704
+ anyDefined = (record2) => Object.values(record2).some((value) => value !== void 0);
62705
+ CUSTOM_TYPES = /* @__PURE__ */ new Set(["lpwstr", "i4", "bool", "filetime", "r8", "i2", "ui4", "lpstr"]);
62706
+ }
62707
+ });
62708
+
62709
+ // pptx/core/builders/sdk/presentation-app-properties.ts
62710
+ function blankAppXml(slideCount) {
62711
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
62712
+ <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
62713
+ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
62714
+ <Application>pptx-viewer-sdk</Application>
62715
+ <Slides>${slideCount}</Slides>
62716
+ <ScaleCrop>false</ScaleCrop>
62717
+ <LinksUpToDate>false</LinksUpToDate>
62718
+ <SharedDoc>false</SharedDoc>
62719
+ <HyperlinksChanged>false</HyperlinksChanged>
62720
+ <AppVersion>1.0000</AppVersion>
62721
+ </Properties>`;
62722
+ }
62723
+ function validate(input) {
62724
+ for (const [field, value] of Object.entries(input)) {
62725
+ if (!INPUT_FIELDS.has(field)) {
62726
+ throw new RangeError(
62727
+ `appProperties.${field} cannot be set when a presentation is created; it takes ${[...INPUT_FIELDS].join(", ")} (counts are computed on save)`
62728
+ );
62729
+ }
62730
+ if (value !== void 0 && typeof value !== "string") {
62731
+ throw new RangeError(`appProperties.${field} must be a string`);
62732
+ }
62733
+ }
62734
+ const version = input.appVersion?.trim();
62735
+ if (version && !APP_VERSION.test(version)) {
62736
+ throw new RangeError(
62737
+ `appProperties.appVersion must be digits, a dot and four digits (e.g. "16.0000"), got "${input.appVersion}"`
62738
+ );
62739
+ }
62740
+ }
62741
+ function newPresentationAppXml(slideCount, input) {
62742
+ const xml = blankAppXml(slideCount);
62743
+ if (input === void 0) {
62744
+ return xml;
62745
+ }
62746
+ validate(input);
62747
+ return writeAppProperties(applyAppOverrides(parseAppProperties(xml), input), xml);
62748
+ }
62749
+ var INPUT_FIELDS, APP_VERSION;
62750
+ var init_presentation_app_properties = __esm({
62751
+ "pptx/core/builders/sdk/presentation-app-properties.ts"() {
62752
+ init_properties();
62753
+ init_document_properties_model();
62754
+ INPUT_FIELDS = /* @__PURE__ */ new Set([
62755
+ "application",
62756
+ "appVersion",
62757
+ "presentationFormat",
62758
+ "company",
62759
+ "manager",
62760
+ "template"
62761
+ ]);
62762
+ APP_VERSION = /^\d+\.\d{4}$/u;
62763
+ }
62764
+ });
62765
+
62485
62766
  // pptx/core/builders/sdk/standard-layout-placeholders.ts
62486
62767
  function standardLayoutPlaceholders(type, width, height) {
62487
62768
  if (type === "blank") return [];
@@ -62806,19 +63087,6 @@ function corePropsXml(title, creator) {
62806
63087
  <dcterms:modified xsi:type="dcterms:W3CDTF">${now}</dcterms:modified>
62807
63088
  </cp:coreProperties>`;
62808
63089
  }
62809
- function appPropsXml(slideCount) {
62810
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
62811
- <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
62812
- xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
62813
- <Application>pptx-viewer-sdk</Application>
62814
- <Slides>${slideCount}</Slides>
62815
- <ScaleCrop>false</ScaleCrop>
62816
- <LinksUpToDate>false</LinksUpToDate>
62817
- <SharedDoc>false</SharedDoc>
62818
- <HyperlinksChanged>false</HyperlinksChanged>
62819
- <AppVersion>1.0000</AppVersion>
62820
- </Properties>`;
62821
- }
62822
63090
  async function buildBlankPresentationArchive(options2) {
62823
63091
  const width = options2?.width ?? DEFAULT_WIDTH;
62824
63092
  const height = options2?.height ?? DEFAULT_HEIGHT;
@@ -62860,7 +63128,7 @@ async function buildBlankPresentationArchive(options2) {
62860
63128
  zip.file("ppt/viewProps.xml", viewPropsXml());
62861
63129
  zip.file("ppt/tableStyles.xml", tableStylesXml());
62862
63130
  zip.file("docProps/core.xml", corePropsXml(options2?.title, options2?.creator));
62863
- zip.file("docProps/app.xml", appPropsXml(initialSlideCount));
63131
+ zip.file("docProps/app.xml", newPresentationAppXml(initialSlideCount, options2?.appProperties));
62864
63132
  return zip.generateAsync({ type: "arraybuffer" });
62865
63133
  }
62866
63134
  var DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_COLORS2, DEFAULT_MAJOR_FONT, DEFAULT_MINOR_FONT, STANDARD_LAYOUTS, PresentationBuilder;
@@ -62870,6 +63138,7 @@ var init_PresentationBuilder = __esm({
62870
63138
  init_PptxHandler();
62871
63139
  init_SlideBuilder();
62872
63140
  init_layout_operations();
63141
+ init_presentation_app_properties();
62873
63142
  init_standard_layout_placeholders();
62874
63143
  DEFAULT_WIDTH = 12192e3;
62875
63144
  DEFAULT_HEIGHT = 6858e3;
@@ -73033,117 +73302,6 @@ var init_app_properties_text_stats = __esm({
73033
73302
  }
73034
73303
  });
73035
73304
 
73036
- // pptx/core/utils/document-properties-model.ts
73037
- function toPptxCoreProperties(core) {
73038
- const result = {};
73039
- for (const field of CORE_FIELDS) result[field] = trimmed(core[field]);
73040
- return anyDefined(result) ? result : void 0;
73041
- }
73042
- function toPptxAppProperties(app) {
73043
- const result = {
73044
- application: trimmed(app.application),
73045
- appVersion: trimmed(app.appVersion),
73046
- presentationFormat: trimmed(app.presentationFormat),
73047
- slides: app.slides,
73048
- hiddenSlides: app.hiddenSlides,
73049
- notes: app.notes,
73050
- totalTime: app.totalTime,
73051
- words: app.words,
73052
- paragraphs: app.paragraphs,
73053
- company: trimmed(app.company),
73054
- manager: trimmed(app.manager),
73055
- template: trimmed(app.template),
73056
- hyperlinkBase: trimmed(app.hyperlinkBase),
73057
- docSecurity: app.docSecurity,
73058
- mmClips: app.mmClips,
73059
- scaleCrop: app.scaleCrop,
73060
- linksUpToDate: app.linksUpToDate,
73061
- sharedDoc: app.sharedDoc,
73062
- hyperlinksChanged: app.hyperlinksChanged
73063
- };
73064
- return anyDefined(result) ? result : void 0;
73065
- }
73066
- function toPptxCustomProperties(texts) {
73067
- return texts.flatMap((entry2) => {
73068
- const name = entry2.name.trim();
73069
- if (!name) return [];
73070
- const known = CUSTOM_TYPES.has(entry2.type);
73071
- return [{ name, value: known ? entry2.text : "", type: known ? entry2.type : "unknown" }];
73072
- });
73073
- }
73074
- function applyCoreOverrides(core, overrides) {
73075
- const next = { ...core };
73076
- for (const field of CORE_FIELDS) {
73077
- const value = overrides?.[field];
73078
- if (value === void 0) continue;
73079
- const text2 = String(value).trim();
73080
- if (text2) next[field] = text2;
73081
- else delete next[field];
73082
- }
73083
- return next;
73084
- }
73085
- function applyAppOverrides(app, overrides) {
73086
- const next = { ...app };
73087
- for (const field of APP_TEXT_OVERRIDES) {
73088
- const value = overrides?.[field];
73089
- if (value === void 0) continue;
73090
- const text2 = String(value).trim();
73091
- if (text2) next[field] = text2;
73092
- else delete next[field];
73093
- }
73094
- for (const field of APP_NUMBER_OVERRIDES) {
73095
- const value = Number(overrides?.[field]);
73096
- if (overrides?.[field] !== void 0 && Number.isFinite(value)) next[field] = Math.trunc(value);
73097
- }
73098
- return next;
73099
- }
73100
- function toCustomProperty(entry2) {
73101
- const type = String(entry2.type || "lpwstr").trim().toLowerCase();
73102
- return customPropertyFromText(
73103
- entry2.name,
73104
- CUSTOM_TYPES.has(type) ? type : "lpwstr",
73105
- String(entry2.value ?? "")
73106
- );
73107
- }
73108
- var CORE_FIELDS, APP_TEXT_OVERRIDES, APP_NUMBER_OVERRIDES, trimmed, anyDefined, CUSTOM_TYPES;
73109
- var init_document_properties_model = __esm({
73110
- "pptx/core/utils/document-properties-model.ts"() {
73111
- init_properties();
73112
- CORE_FIELDS = [
73113
- "title",
73114
- "subject",
73115
- "creator",
73116
- "keywords",
73117
- "description",
73118
- "lastModifiedBy",
73119
- "revision",
73120
- "created",
73121
- "modified",
73122
- "category",
73123
- "contentStatus"
73124
- ];
73125
- APP_TEXT_OVERRIDES = [
73126
- "application",
73127
- "appVersion",
73128
- "presentationFormat",
73129
- "company",
73130
- "manager",
73131
- "template"
73132
- ];
73133
- APP_NUMBER_OVERRIDES = [
73134
- "slides",
73135
- "hiddenSlides",
73136
- "notes",
73137
- "totalTime",
73138
- "words",
73139
- "paragraphs"
73140
- ];
73141
- trimmed = (value) => value?.trim() || void 0;
73142
- anyDefined = (record2) => Object.values(record2).some((value) => value !== void 0);
73143
- CUSTOM_TYPES = /* @__PURE__ */ new Set(["lpwstr", "i4", "bool", "filetime", "r8", "i2", "ui4", "lpstr"]);
73144
- }
73145
- });
73146
-
73147
73305
  // pptx/core/services/custom-properties-package.ts
73148
73306
  async function ensureCustomPropertiesPackagingArtifacts(context) {
73149
73307
  const ctFile = context.zip.file("[Content_Types].xml");
@@ -127109,6 +127267,21 @@ var init_image_alpha_effects = __esm({
127109
127267
  }
127110
127268
  });
127111
127269
 
127270
+ // pptx/core/core/runtime/blip-extension-order.ts
127271
+ function keepExtensionListLast(blip) {
127272
+ const key2 = Object.keys(blip).find((candidate) => candidate.split(":").at(-1) === "extLst");
127273
+ if (key2 === void 0) {
127274
+ return;
127275
+ }
127276
+ const value = blip[key2];
127277
+ delete blip[key2];
127278
+ blip[key2] = value;
127279
+ }
127280
+ var init_blip_extension_order = __esm({
127281
+ "pptx/core/core/runtime/blip-extension-order.ts"() {
127282
+ }
127283
+ });
127284
+
127112
127285
  // pptx/core/core/runtime/image-color-effects.ts
127113
127286
  function child32(parent, name) {
127114
127287
  if (!parent) {
@@ -133148,6 +133321,7 @@ var init_PptxHandlerRuntimeSaveImageEffects = __esm({
133148
133321
  init_crop_shape_geometry();
133149
133322
  init_image_a14_effects_writer();
133150
133323
  init_image_alpha_effects();
133324
+ init_blip_extension_order();
133151
133325
  init_image_color_effects();
133152
133326
  init_image_crop_save();
133153
133327
  init_PptxHandlerRuntimeSaveShapeXml();
@@ -133265,6 +133439,7 @@ var init_PptxHandlerRuntimeSaveImageEffects = __esm({
133265
133439
  delete blip["a:blur"];
133266
133440
  }
133267
133441
  applyA14ImageExtension(blip, nextEffects);
133442
+ keepExtensionListLast(blip);
133268
133443
  }
133269
133444
  normalizePresetGeometry(shapeType) {
133270
133445
  return this.elementXmlBuilder.normalizePresetGeometry(shapeType);
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { replaceText, findText, mergePresentation } from '../../chunk-G6LEU3Y5.mjs';
3
- import { PptxMarkdownConverter } from '../../chunk-H43QQVJU.mjs';
4
- import { PptxHandler } from '../../chunk-E2TTMUKU.mjs';
5
- import { SvgExporter, isImageLikeElement, blobUrlToDataUrl } from '../../chunk-X2DC7XRL.mjs';
2
+ import { replaceText, findText, mergePresentation } from '../../chunk-QHR726W3.mjs';
3
+ import { PptxMarkdownConverter } from '../../chunk-5HNRZOBX.mjs';
4
+ import { PptxHandler } from '../../chunk-553WFEHD.mjs';
5
+ import { SvgExporter, isImageLikeElement, blobUrlToDataUrl } from '../../chunk-7L6ZAA5Y.mjs';
6
6
  import '../../chunk-EYCM7RVL.mjs';
7
7
  import '../../chunk-2N7RZQLC.mjs';
8
8
  import '../../chunk-VDUNZTJC.mjs';
@@ -1,2 +1,2 @@
1
- import { A as SlideProcessor, B as generateMediaFilename, C as PptxJsonAssetStats, D as SvgExportOptions, E as isPptxJsonText, F as deriveOutputPath, H as ConversionResult, I as getDirectory, L as normalizePath, M as PptxConverterOptions, N as PptxMarkdownConverter, O as SvgExporter, P as DocumentConverter, R as MediaContext, S as PPTX_JSON_VERSION, T as decodePptxJsonText, U as FileSystemAdapter, V as ConversionOptions, _ as decodeJsonValue, a as deserializePptxFromJson, b as PPTX_JSON_FORMAT, c as pptxDataFromJsonDocument, d as serializePptxToJson, f as PRESENTATION_FIELD_KEYS, g as bytesToBase64, h as base64ToBytes, i as PptxJsonFormatError, j as SlideProcessorOptions, k as SlideMetadataRenderer, l as PptxJsonSerializeOptions, m as JsonAssetAccumulator, n as PptxJsonConverterOptions, o as parsePptxJson, p as PRESENTATION_FIELD_NAMES, r as applyImportedPptxData, s as parsePptxJsonDocument, t as PptxJsonConverter, u as buildPptxJsonDocument, v as encodeJsonValue, w as PptxJsonDocument, x as PPTX_JSON_MIME_TYPE, y as PPTX_JSON_FILE_EXTENSION, z as dataUrlToMediaBytes } from "../chunks/index-D4-WJQ1r.js";
1
+ import { A as SlideProcessor, B as generateMediaFilename, C as PptxJsonAssetStats, D as SvgExportOptions, E as isPptxJsonText, F as deriveOutputPath, H as ConversionResult, I as getDirectory, L as normalizePath, M as PptxConverterOptions, N as PptxMarkdownConverter, O as SvgExporter, P as DocumentConverter, R as MediaContext, S as PPTX_JSON_VERSION, T as decodePptxJsonText, U as FileSystemAdapter, V as ConversionOptions, _ as decodeJsonValue, a as deserializePptxFromJson, b as PPTX_JSON_FORMAT, c as pptxDataFromJsonDocument, d as serializePptxToJson, f as PRESENTATION_FIELD_KEYS, g as bytesToBase64, h as base64ToBytes, i as PptxJsonFormatError, j as SlideProcessorOptions, k as SlideMetadataRenderer, l as PptxJsonSerializeOptions, m as JsonAssetAccumulator, n as PptxJsonConverterOptions, o as parsePptxJson, p as PRESENTATION_FIELD_NAMES, r as applyImportedPptxData, s as parsePptxJsonDocument, t as PptxJsonConverter, u as buildPptxJsonDocument, v as encodeJsonValue, w as PptxJsonDocument, x as PPTX_JSON_MIME_TYPE, y as PPTX_JSON_FILE_EXTENSION, z as dataUrlToMediaBytes } from "../chunks/index-Dr3iIPt9.js";
2
2
  export { type ConversionOptions, type ConversionResult, DocumentConverter, type FileSystemAdapter, type JsonAssetAccumulator, MediaContext, PPTX_JSON_FILE_EXTENSION, PPTX_JSON_FORMAT, PPTX_JSON_MIME_TYPE, PPTX_JSON_VERSION, PRESENTATION_FIELD_KEYS, PRESENTATION_FIELD_NAMES, type PptxConverterOptions, type PptxJsonAssetStats, PptxJsonConverter, type PptxJsonConverterOptions, type PptxJsonDocument, PptxJsonFormatError, type PptxJsonSerializeOptions, PptxMarkdownConverter, SlideMetadataRenderer, SlideProcessor, type SlideProcessorOptions, type SvgExportOptions, SvgExporter, applyImportedPptxData, base64ToBytes, buildPptxJsonDocument, bytesToBase64, dataUrlToMediaBytes, decodeJsonValue, decodePptxJsonText, deriveOutputPath, deserializePptxFromJson, encodeJsonValue, generateMediaFilename, getDirectory, isPptxJsonText, normalizePath, parsePptxJson, parsePptxJsonDocument, pptxDataFromJsonDocument, serializePptxToJson };
@@ -1,6 +1,6 @@
1
1
  import '../../chunk-6Q7TP72Y.mjs';
2
- export { DocumentConverter, MediaContext, PptxMarkdownConverter, SlideMetadataRenderer, SlideProcessor, dataUrlToMediaBytes, deriveOutputPath, generateMediaFilename, getDirectory, normalizePath } from '../../chunk-H43QQVJU.mjs';
3
- export { PPTX_JSON_FILE_EXTENSION, PPTX_JSON_FORMAT, PPTX_JSON_MIME_TYPE, PPTX_JSON_VERSION, PRESENTATION_FIELD_KEYS, PRESENTATION_FIELD_NAMES, PptxJsonConverter, PptxJsonFormatError, SvgExporter, applyImportedPptxData, base64ToBytes, buildPptxJsonDocument, bytesToBase64, decodeJsonValue, decodePptxJsonText, deserializePptxFromJson, encodeJsonValue, isPptxJsonText, parsePptxJson, parsePptxJsonDocument, pptxDataFromJsonDocument, serializePptxToJson } from '../../chunk-X2DC7XRL.mjs';
2
+ export { DocumentConverter, MediaContext, PptxMarkdownConverter, SlideMetadataRenderer, SlideProcessor, dataUrlToMediaBytes, deriveOutputPath, generateMediaFilename, getDirectory, normalizePath } from '../../chunk-5HNRZOBX.mjs';
3
+ export { PPTX_JSON_FILE_EXTENSION, PPTX_JSON_FORMAT, PPTX_JSON_MIME_TYPE, PPTX_JSON_VERSION, PRESENTATION_FIELD_KEYS, PRESENTATION_FIELD_NAMES, PptxJsonConverter, PptxJsonFormatError, SvgExporter, applyImportedPptxData, base64ToBytes, buildPptxJsonDocument, bytesToBase64, decodeJsonValue, decodePptxJsonText, deserializePptxFromJson, encodeJsonValue, isPptxJsonText, parsePptxJson, parsePptxJsonDocument, pptxDataFromJsonDocument, serializePptxToJson } from '../../chunk-7L6ZAA5Y.mjs';
4
4
  import '../../chunk-EYCM7RVL.mjs';
5
5
  import '../../chunk-VDUNZTJC.mjs';
6
6
  import '../../chunk-7DJEJTN7.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQUAFASFC_cjs = require('../../../chunk-QUAFASFC.cjs');
3
+ var chunkWFN6ZU7N_cjs = require('../../../chunk-WFN6ZU7N.cjs');
4
4
  require('../../../chunk-XZPZHXV4.cjs');
5
5
  require('../../../chunk-5W2QL4SB.cjs');
6
6
 
@@ -114,7 +114,7 @@ function customShowSlides(show, slides) {
114
114
  });
115
115
  }
116
116
  function clearCustomShowActions(slides, id) {
117
- const result = chunkQUAFASFC_cjs.mapCustomShowActions(slides, (target) => target === id ? null : target);
117
+ const result = chunkWFN6ZU7N_cjs.mapCustomShowActions(slides, (target) => target === id ? null : target);
118
118
  return { slides: result.slides, cleared: result.changed };
119
119
  }
120
120
 
@@ -1,4 +1,4 @@
1
- import { mapCustomShowActions } from '../../../chunk-LXVE2VKR.mjs';
1
+ import { mapCustomShowActions } from '../../../chunk-DEDK2J57.mjs';
2
2
  import '../../../chunk-GXHKNSZX.mjs';
3
3
  import '../../../chunk-CA7KCNL3.mjs';
4
4
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk5TOVSCVT_cjs = require('../../../chunk-5TOVSCVT.cjs');
4
- var chunkQUAFASFC_cjs = require('../../../chunk-QUAFASFC.cjs');
3
+ var chunkAPCA7N6Q_cjs = require('../../../chunk-APCA7N6Q.cjs');
4
+ var chunkWFN6ZU7N_cjs = require('../../../chunk-WFN6ZU7N.cjs');
5
5
  var chunkXZPZHXV4_cjs = require('../../../chunk-XZPZHXV4.cjs');
6
6
  require('../../../chunk-5W2QL4SB.cjs');
7
7
  var chunkAWIDASUW_cjs = require('../../../chunk-AWIDASUW.cjs');
@@ -146,10 +146,10 @@ function* findSlideTextTargets(slide, includeNotes = false, includeChartTitles =
146
146
  function patchTableXml(element, rowIndex, colIndex, original, runs) {
147
147
  if (!element.rawXml) return void 0;
148
148
  const rawXml = structuredClone(element.rawXml);
149
- const table = chunk5TOVSCVT_cjs.getTblFromRawXml(rawXml);
150
- const row = chunk5TOVSCVT_cjs.ensureArray(table?.["a:tr"])[rowIndex];
151
- const cell = chunk5TOVSCVT_cjs.ensureArray(row?.["a:tc"])[colIndex];
152
- const paragraphs = chunk5TOVSCVT_cjs.ensureArray(
149
+ const table = chunkAPCA7N6Q_cjs.getTblFromRawXml(rawXml);
150
+ const row = chunkAPCA7N6Q_cjs.ensureArray(table?.["a:tr"])[rowIndex];
151
+ const cell = chunkAPCA7N6Q_cjs.ensureArray(row?.["a:tc"])[colIndex];
152
+ const paragraphs = chunkAPCA7N6Q_cjs.ensureArray(
153
153
  cell?.["a:txBody"]?.["a:p"]
154
154
  );
155
155
  let paragraphIndex = 0, runIndex = 0, fieldIndex = 0;
@@ -164,7 +164,7 @@ function patchTableXml(element, rowIndex, colIndex, original, runs) {
164
164
  if (previous.isLineBreak) continue;
165
165
  const paragraph = paragraphs[paragraphIndex];
166
166
  const key = previous.isField ? "a:fld" : "a:r";
167
- const xmlRun = chunk5TOVSCVT_cjs.ensureArray(paragraph?.[key])[previous.isField ? fieldIndex++ : runIndex++];
167
+ const xmlRun = chunkAPCA7N6Q_cjs.ensureArray(paragraph?.[key])[previous.isField ? fieldIndex++ : runIndex++];
168
168
  if (!xmlRun) return void 0;
169
169
  if (previous.text !== runs[index].text) xmlRun["a:t"] = runs[index].text;
170
170
  }
@@ -174,7 +174,7 @@ function updateNode(nodes, nodeId, text) {
174
174
  return nodes.map((node) => {
175
175
  if (node.id === nodeId) {
176
176
  const originalParagraphs = node.paragraphs ?? (node.runs?.length ? [{ items: node.runs.map((run) => ({ kind: "run", run })) }] : void 0);
177
- const paragraphs = originalParagraphs ? chunkQUAFASFC_cjs.reconcileSmartArtTextParagraphs(originalParagraphs, text) : void 0;
177
+ const paragraphs = originalParagraphs ? chunkWFN6ZU7N_cjs.reconcileSmartArtTextParagraphs(originalParagraphs, text) : void 0;
178
178
  return { ...node, text, ...paragraphs ? { paragraphs } : {} };
179
179
  }
180
180
  if (!node.children) return node;
@@ -253,14 +253,14 @@ function replaceLeaf(element, match, replacement) {
253
253
  );
254
254
  if (!runs) return element;
255
255
  let text = runs.map((run) => run.isParagraphBreak ? "\n" : run.isLineBreak ? "" : run.text).join("");
256
- let rawXml = cell.textRuns?.length ? patchTableXml(element, rowIndex, colIndex, original2, runs) : chunk5TOVSCVT_cjs.updateCellTextInRawXml(element, rowIndex, colIndex, text);
256
+ let rawXml = cell.textRuns?.length ? patchTableXml(element, rowIndex, colIndex, original2, runs) : chunkAPCA7N6Q_cjs.updateCellTextInRawXml(element, rowIndex, colIndex, text);
257
257
  if (rawXml) {
258
- const table = chunk5TOVSCVT_cjs.getTblFromRawXml(rawXml);
259
- const xmlRow = chunk5TOVSCVT_cjs.ensureArray(table?.["a:tr"])[rowIndex];
260
- const xmlCell = chunk5TOVSCVT_cjs.ensureArray(xmlRow?.["a:tc"])[colIndex];
261
- text = chunk5TOVSCVT_cjs.flattenCellTxBodyText(
258
+ const table = chunkAPCA7N6Q_cjs.getTblFromRawXml(rawXml);
259
+ const xmlRow = chunkAPCA7N6Q_cjs.ensureArray(table?.["a:tr"])[rowIndex];
260
+ const xmlCell = chunkAPCA7N6Q_cjs.ensureArray(xmlRow?.["a:tc"])[colIndex];
261
+ text = chunkAPCA7N6Q_cjs.flattenCellTxBodyText(
262
262
  xmlCell?.["a:txBody"],
263
- (value) => chunk5TOVSCVT_cjs.ensureArray(value)
263
+ (value) => chunkAPCA7N6Q_cjs.ensureArray(value)
264
264
  );
265
265
  }
266
266
  const rows = [...element.tableData.rows], cells = [...row.cells];
@@ -274,7 +274,7 @@ function replaceLeaf(element, match, replacement) {
274
274
  if (!node || match.startOffset < 0 || match.startOffset + match.length > node.text.length)
275
275
  return element;
276
276
  const text = node.text.slice(0, match.startOffset) + replacement + node.text.slice(match.startOffset + match.length);
277
- const next = chunkQUAFASFC_cjs.updateSmartArtNodeText({ ...data, nodes }, node.id, text);
277
+ const next = chunkWFN6ZU7N_cjs.updateSmartArtNodeText({ ...data, nodes }, node.id, text);
278
278
  const drawingShapes = next.drawingShapes?.map((shape, index) => {
279
279
  if (shape === data.drawingShapes?.[index] || !shape.textSegments) return shape;
280
280
  return {
@@ -1,4 +1,4 @@
1
- import "../../chunks/index-BPGaFlm5.js";
1
+ import "../../chunks/index--HBUyILF.js";
2
2
  import { C as PptxSlide } from "../../chunks/text-operations-CVHXOSit.js";
3
3
  /** Identifies a single match of the find query at segment-level precision. */
4
4
  export interface FindResult {
@@ -1,5 +1,5 @@
1
- import { updateCellTextInRawXml, getTblFromRawXml, ensureArray, flattenCellTxBodyText } from '../../../chunk-EI6555OK.mjs';
2
- import { updateSmartArtNodeText, reconcileSmartArtTextParagraphs } from '../../../chunk-LXVE2VKR.mjs';
1
+ import { updateCellTextInRawXml, getTblFromRawXml, ensureArray, flattenCellTxBodyText } from '../../../chunk-6MU4WKHS.mjs';
2
+ import { updateSmartArtNodeText, reconcileSmartArtTextParagraphs } from '../../../chunk-DEDK2J57.mjs';
3
3
  import { hasTextProperties } from '../../../chunk-GXHKNSZX.mjs';
4
4
  import '../../../chunk-CA7KCNL3.mjs';
5
5
  import { remapTextToSegments } from '../../../chunk-CBNKBVX5.mjs';