ooxml-core 1.27.1 → 1.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PptxHandler-NHOKKZ4S.cjs → PptxHandler-FRQKHTCM.cjs} +2 -2
- package/dist/{PptxHandler-TZJNIXPX.mjs → PptxHandler-RETSKQ5E.mjs} +1 -1
- package/dist/{PptxHandler-OIR3ZY4Q.mjs → PptxHandler-WRJXTPGV.mjs} +2 -2
- package/dist/{PresentationBuilder-X5WFSHLB.mjs → PresentationBuilder-LWR5X3JA.mjs} +2 -2
- package/dist/{PresentationBuilder-RFTSZUPR.mjs → PresentationBuilder-POXKHTV7.mjs} +1 -1
- package/dist/{PresentationBuilder-EX6DAE5X.cjs → PresentationBuilder-YO5YOTA3.cjs} +4 -4
- package/dist/{chunk-BXZF7H5G.mjs → chunk-3VIPI6IA.mjs} +4 -4
- package/dist/{chunk-5KJAQKZG.mjs → chunk-6LCBTFNL.mjs} +213 -110
- package/dist/{chunk-5NJPYCGO.mjs → chunk-G67MARDL.mjs} +1 -1
- package/dist/{chunk-DMJIDRJE.cjs → chunk-K6DNX3YC.cjs} +212 -109
- package/dist/{chunk-GZ4DIXZZ.mjs → chunk-RNUYMB73.mjs} +212 -109
- package/dist/{chunk-QIMNQDON.mjs → chunk-TIQWSSGI.mjs} +1 -1
- package/dist/{chunk-ZWTXVWMY.mjs → chunk-XW4XB6P4.mjs} +1 -1
- package/dist/pptx/automation/index.cjs +224 -109
- package/dist/pptx/automation/index.d.ts +3 -3
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-D4FnOx6x.d.ts → index-CdRlUz-v.d.ts} +2 -2
- package/dist/pptx/chunks/{index-D4FnOx6x.d.ts.map → index-CdRlUz-v.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-D8DNpc1X.d.ts → index-D_d4NTVP.d.ts} +36 -3
- package/dist/pptx/chunks/index-D_d4NTVP.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-GWpMAY-f.d.ts → index-lwMA6pP5.d.ts} +3 -3
- package/dist/pptx/chunks/{index-GWpMAY-f.d.ts.map → index-lwMA6pP5.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +224 -109
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +1 -1
- package/dist/pptx/index.cjs +224 -109
- package/dist/pptx/index.d.ts +3 -3
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/pptx/chunks/index-D8DNpc1X.d.ts.map +0 -1
|
@@ -70592,6 +70592,96 @@ var init_background_fill_shapes = __esm({
|
|
|
70592
70592
|
}
|
|
70593
70593
|
});
|
|
70594
70594
|
|
|
70595
|
+
// pptx/core/core/runtime/load-part-reader.ts
|
|
70596
|
+
function parseText2(parser, text2) {
|
|
70597
|
+
return text2 ? parser.parse(text2) : void 0;
|
|
70598
|
+
}
|
|
70599
|
+
function readPartText(zip, path4) {
|
|
70600
|
+
const reader2 = openReaders.get(zip);
|
|
70601
|
+
if (reader2) {
|
|
70602
|
+
return reader2.readText(path4);
|
|
70603
|
+
}
|
|
70604
|
+
return zip.file(path4)?.async("string") ?? Promise.resolve(void 0);
|
|
70605
|
+
}
|
|
70606
|
+
async function readPartXml(zip, parser, path4) {
|
|
70607
|
+
const reader2 = openReaders.get(zip);
|
|
70608
|
+
if (reader2) {
|
|
70609
|
+
return reader2.readXml(parser, path4);
|
|
70610
|
+
}
|
|
70611
|
+
const text2 = await zip.file(path4)?.async("string");
|
|
70612
|
+
return text2 ? parseText2(parser, text2) : void 0;
|
|
70613
|
+
}
|
|
70614
|
+
var openReaders, LoadPartReader;
|
|
70615
|
+
var init_load_part_reader = __esm({
|
|
70616
|
+
"pptx/core/core/runtime/load-part-reader.ts"() {
|
|
70617
|
+
openReaders = /* @__PURE__ */ new WeakMap();
|
|
70618
|
+
LoadPartReader = class {
|
|
70619
|
+
constructor(zip) {
|
|
70620
|
+
this.zip = zip;
|
|
70621
|
+
openReaders.set(zip, this);
|
|
70622
|
+
}
|
|
70623
|
+
zip;
|
|
70624
|
+
parts = /* @__PURE__ */ new Map();
|
|
70625
|
+
closed = false;
|
|
70626
|
+
entry(path4) {
|
|
70627
|
+
const file2 = this.zip.file(path4);
|
|
70628
|
+
if (!file2) {
|
|
70629
|
+
this.parts.delete(path4);
|
|
70630
|
+
return void 0;
|
|
70631
|
+
}
|
|
70632
|
+
const previous = this.parts.get(path4);
|
|
70633
|
+
if (previous?.file === file2) {
|
|
70634
|
+
return previous;
|
|
70635
|
+
}
|
|
70636
|
+
const entry2 = { file: file2, text: file2.async("string"), relationships: /* @__PURE__ */ new Map() };
|
|
70637
|
+
this.parts.set(path4, entry2);
|
|
70638
|
+
entry2.text.catch(() => {
|
|
70639
|
+
if (this.parts.get(path4) === entry2) {
|
|
70640
|
+
this.parts.delete(path4);
|
|
70641
|
+
}
|
|
70642
|
+
});
|
|
70643
|
+
return entry2;
|
|
70644
|
+
}
|
|
70645
|
+
readText(path4) {
|
|
70646
|
+
return this.entry(path4)?.text ?? Promise.resolve(void 0);
|
|
70647
|
+
}
|
|
70648
|
+
async readXml(parser, path4) {
|
|
70649
|
+
const entry2 = this.entry(path4);
|
|
70650
|
+
if (!entry2) {
|
|
70651
|
+
return void 0;
|
|
70652
|
+
}
|
|
70653
|
+
if (!path4.endsWith(".rels")) {
|
|
70654
|
+
return parseText2(parser, await entry2.text);
|
|
70655
|
+
}
|
|
70656
|
+
let parsed = entry2.relationships.get(parser);
|
|
70657
|
+
if (!parsed) {
|
|
70658
|
+
const pending = entry2.text.then((text2) => parseText2(parser, text2));
|
|
70659
|
+
entry2.relationships.set(parser, pending);
|
|
70660
|
+
pending.catch(() => {
|
|
70661
|
+
if (entry2.relationships.get(parser) === pending) {
|
|
70662
|
+
entry2.relationships.delete(parser);
|
|
70663
|
+
}
|
|
70664
|
+
});
|
|
70665
|
+
parsed = pending;
|
|
70666
|
+
}
|
|
70667
|
+
return structuredClone(await parsed);
|
|
70668
|
+
}
|
|
70669
|
+
/** Whether this reader still serves reads for its package. */
|
|
70670
|
+
get isOpen() {
|
|
70671
|
+
return !this.closed;
|
|
70672
|
+
}
|
|
70673
|
+
/** Drops every cached read; later reads of the package go to the archive. */
|
|
70674
|
+
close() {
|
|
70675
|
+
this.closed = true;
|
|
70676
|
+
if (openReaders.get(this.zip) === this) {
|
|
70677
|
+
openReaders.delete(this.zip);
|
|
70678
|
+
}
|
|
70679
|
+
this.parts.clear();
|
|
70680
|
+
}
|
|
70681
|
+
};
|
|
70682
|
+
}
|
|
70683
|
+
});
|
|
70684
|
+
|
|
70595
70685
|
// pptx/core/core/builders/element-hidden-flag.ts
|
|
70596
70686
|
function findCNvPr(shape) {
|
|
70597
70687
|
if (!shape) {
|
|
@@ -70665,11 +70755,10 @@ var init_flatten_elements = __esm({
|
|
|
70665
70755
|
|
|
70666
70756
|
// pptx/core/utils/slide-synchronization.ts
|
|
70667
70757
|
async function loadSlideSynchronization(input2) {
|
|
70668
|
-
const
|
|
70669
|
-
if (!
|
|
70758
|
+
const relsData = await readPartXml(input2.zip, input2.parser, input2.relsPath);
|
|
70759
|
+
if (!relsData) {
|
|
70670
70760
|
return void 0;
|
|
70671
70761
|
}
|
|
70672
|
-
const relsData = input2.parser.parse(relsXml);
|
|
70673
70762
|
const relationship2 = findSlideSyncRelationship(relsData);
|
|
70674
70763
|
if (!relationship2) {
|
|
70675
70764
|
return void 0;
|
|
@@ -70679,7 +70768,7 @@ async function loadSlideSynchronization(input2) {
|
|
|
70679
70768
|
return void 0;
|
|
70680
70769
|
}
|
|
70681
70770
|
const partPath = resolvePartPath2(input2.slidePath, target);
|
|
70682
|
-
const partXml = await input2.zip
|
|
70771
|
+
const partXml = await readPartText(input2.zip, partPath);
|
|
70683
70772
|
if (!partXml) {
|
|
70684
70773
|
return void 0;
|
|
70685
70774
|
}
|
|
@@ -70800,6 +70889,7 @@ function nextSlideSyncPath(files) {
|
|
|
70800
70889
|
var SLIDE_SYNC_CONTENT_TYPE;
|
|
70801
70890
|
var init_slide_synchronization = __esm({
|
|
70802
70891
|
"pptx/core/utils/slide-synchronization.ts"() {
|
|
70892
|
+
init_load_part_reader();
|
|
70803
70893
|
SLIDE_SYNC_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideSyncData+xml";
|
|
70804
70894
|
}
|
|
70805
70895
|
});
|
|
@@ -70813,11 +70903,10 @@ function ensureArray9(value) {
|
|
|
70813
70903
|
}
|
|
70814
70904
|
async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
70815
70905
|
try {
|
|
70816
|
-
const
|
|
70817
|
-
if (!
|
|
70906
|
+
const relsData = await readPartXml(zip, parser, relsPath2);
|
|
70907
|
+
if (!relsData) {
|
|
70818
70908
|
return [];
|
|
70819
70909
|
}
|
|
70820
|
-
const relsData = parser.parse(relsXml);
|
|
70821
70910
|
const relationships3 = ensureArray9(
|
|
70822
70911
|
relsData["Relationships"]?.["Relationship"]
|
|
70823
70912
|
);
|
|
@@ -70840,7 +70929,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
70840
70929
|
if (!resolved) {
|
|
70841
70930
|
continue;
|
|
70842
70931
|
}
|
|
70843
|
-
const vmlXml = await zip
|
|
70932
|
+
const vmlXml = await readPartText(zip, resolved);
|
|
70844
70933
|
if (!vmlXml) {
|
|
70845
70934
|
continue;
|
|
70846
70935
|
}
|
|
@@ -70859,6 +70948,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
70859
70948
|
var VML_DRAWING_REL_SUFFIX;
|
|
70860
70949
|
var init_vml_drawing_loader = __esm({
|
|
70861
70950
|
"pptx/core/utils/vml-drawing-loader.ts"() {
|
|
70951
|
+
init_load_part_reader();
|
|
70862
70952
|
init_safe_path();
|
|
70863
70953
|
init_vml_parser();
|
|
70864
70954
|
VML_DRAWING_REL_SUFFIX = "/relationships/vmlDrawing";
|
|
@@ -73366,6 +73456,7 @@ var PptxSlideLoaderService;
|
|
|
73366
73456
|
var init_PptxSlideLoaderService = __esm({
|
|
73367
73457
|
"pptx/core/services/PptxSlideLoaderService.ts"() {
|
|
73368
73458
|
init_background_fill_shapes();
|
|
73459
|
+
init_load_part_reader();
|
|
73369
73460
|
init_element_hidden_flag();
|
|
73370
73461
|
init_background_style_ref();
|
|
73371
73462
|
init_flatten_elements();
|
|
@@ -73426,11 +73517,14 @@ var init_PptxSlideLoaderService = __esm({
|
|
|
73426
73517
|
* @returns Map of relationship ID to target path string.
|
|
73427
73518
|
*/
|
|
73428
73519
|
async loadPresentationSlideRels(params) {
|
|
73429
|
-
const
|
|
73430
|
-
|
|
73520
|
+
const relsData = await readPartXml(
|
|
73521
|
+
params.zip,
|
|
73522
|
+
params.parser,
|
|
73523
|
+
"ppt/_rels/presentation.xml.rels"
|
|
73524
|
+
);
|
|
73525
|
+
if (!relsData) {
|
|
73431
73526
|
return /* @__PURE__ */ new Map();
|
|
73432
73527
|
}
|
|
73433
|
-
const relsData = params.parser.parse(relsXml);
|
|
73434
73528
|
const relationships3 = relsData["Relationships"]?.["Relationship"];
|
|
73435
73529
|
const relNodes = this.toXmlObjectArray(relationships3);
|
|
73436
73530
|
const relsMap = /* @__PURE__ */ new Map();
|
|
@@ -73470,7 +73564,7 @@ var init_PptxSlideLoaderService = __esm({
|
|
|
73470
73564
|
if (!params.zip.file(path4)) {
|
|
73471
73565
|
path4 = `ppt/${target}`;
|
|
73472
73566
|
}
|
|
73473
|
-
const slideXmlStr = await params.zip
|
|
73567
|
+
const slideXmlStr = await readPartText(params.zip, path4);
|
|
73474
73568
|
if (!slideXmlStr) {
|
|
73475
73569
|
return void 0;
|
|
73476
73570
|
}
|
|
@@ -97659,12 +97753,11 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
97659
97753
|
if (!external.targetPath || !external.embeddedWorkbookData) return false;
|
|
97660
97754
|
const target = resolve(chartPartPath, external.targetPath);
|
|
97661
97755
|
let references = 0;
|
|
97662
|
-
const parser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
97663
97756
|
try {
|
|
97664
97757
|
for (const path4 of Object.keys(zip.files)) {
|
|
97665
97758
|
if (!path4.endsWith(".rels") || !path4.includes("/_rels/")) continue;
|
|
97666
97759
|
const source = path4.replace("/_rels/", "/").slice(0, -5);
|
|
97667
|
-
const tree =
|
|
97760
|
+
const tree = await readPartXml(zip, relationshipParser, path4);
|
|
97668
97761
|
for (const rel of xmlChildren(xmlChild(tree, "Relationships"), "Relationship")) {
|
|
97669
97762
|
const relationshipTarget2 = xmlAttr(rel, "Target");
|
|
97670
97763
|
if (relationshipTarget2 && xmlAttr(rel, "TargetMode") !== "External" && resolve(source, relationshipTarget2) === target)
|
|
@@ -97681,11 +97774,14 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
97681
97774
|
return false;
|
|
97682
97775
|
}
|
|
97683
97776
|
}
|
|
97777
|
+
var relationshipParser;
|
|
97684
97778
|
var init_chart_label_source = __esm({
|
|
97685
97779
|
"pptx/core/utils/chart-label-source.ts"() {
|
|
97780
|
+
init_load_part_reader();
|
|
97686
97781
|
init_chart_xlsx_writer();
|
|
97687
97782
|
init_xml_access();
|
|
97688
97783
|
init_chart_xlsx_cellref();
|
|
97784
|
+
relationshipParser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
97689
97785
|
}
|
|
97690
97786
|
});
|
|
97691
97787
|
|
|
@@ -100191,7 +100287,7 @@ function parseChartData(context, element) {
|
|
|
100191
100287
|
}
|
|
100192
100288
|
return out;
|
|
100193
100289
|
}
|
|
100194
|
-
function
|
|
100290
|
+
function parseText3(context, element) {
|
|
100195
100291
|
if (!element) return void 0;
|
|
100196
100292
|
reportUnmodelled2(context, element, /* @__PURE__ */ new Set(["txData", "rich"]));
|
|
100197
100293
|
const data = cxChild(element, "txData");
|
|
@@ -100211,7 +100307,7 @@ function parseTitle2(context, element) {
|
|
|
100211
100307
|
return assignDefined(
|
|
100212
100308
|
{},
|
|
100213
100309
|
{
|
|
100214
|
-
tx:
|
|
100310
|
+
tx: parseText3(context, cxChild(element, "tx")),
|
|
100215
100311
|
spPr: shapeProperties2(element),
|
|
100216
100312
|
txPr: textProperties2(element),
|
|
100217
100313
|
position: attribute6(element, "pos"),
|
|
@@ -100456,7 +100552,7 @@ function parseSeries2(context, element) {
|
|
|
100456
100552
|
ownerIndex: numberAttribute(context, element, "ownerIdx"),
|
|
100457
100553
|
uniqueId: attribute6(element, "uniqueId"),
|
|
100458
100554
|
formatIndex: numberAttribute(context, element, "formatIdx"),
|
|
100459
|
-
tx:
|
|
100555
|
+
tx: parseText3(context, cxChild(element, "tx")),
|
|
100460
100556
|
spPr: shapeProperties2(element),
|
|
100461
100557
|
txPr: textProperties2(element),
|
|
100462
100558
|
valueColorsXml: rawChild2(element, "valueColors"),
|
|
@@ -114076,8 +114172,8 @@ async function discoverTagCollections(zip, codec2) {
|
|
|
114076
114172
|
if (!sourcePartPath) {
|
|
114077
114173
|
continue;
|
|
114078
114174
|
}
|
|
114079
|
-
const data =
|
|
114080
|
-
const root = data["Relationships"];
|
|
114175
|
+
const data = await readPartXml(zip, codec2, relFile.name);
|
|
114176
|
+
const root = data?.["Relationships"];
|
|
114081
114177
|
for (const relationship2 of ensureArray17(root?.["Relationship"])) {
|
|
114082
114178
|
if (String(relationship2["@_Type"] ?? "") !== TAG_RELATIONSHIP_TYPE) {
|
|
114083
114179
|
continue;
|
|
@@ -114182,7 +114278,7 @@ async function removeTagContentTypeOverride(zip, codec2, path4) {
|
|
|
114182
114278
|
zip.file("[Content_Types].xml", codec2.build(data));
|
|
114183
114279
|
}
|
|
114184
114280
|
async function readTagCollection(zip, codec2, path4) {
|
|
114185
|
-
const xml = await zip
|
|
114281
|
+
const xml = await readPartText(zip, path4);
|
|
114186
114282
|
if (!xml) {
|
|
114187
114283
|
return void 0;
|
|
114188
114284
|
}
|
|
@@ -114291,6 +114387,7 @@ function ensureArray17(value) {
|
|
|
114291
114387
|
var TAG_RELATIONSHIP_TYPE, TAG_CONTENT_TYPE;
|
|
114292
114388
|
var init_tag_package = __esm({
|
|
114293
114389
|
"pptx/core/utils/tag-package.ts"() {
|
|
114390
|
+
init_load_part_reader();
|
|
114294
114391
|
init_safe_path();
|
|
114295
114392
|
init_tag_package_owning_element();
|
|
114296
114393
|
TAG_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags";
|
|
@@ -119624,10 +119721,35 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
119624
119721
|
"pptx/core/core/runtime/PptxHandlerRuntimeState.ts"() {
|
|
119625
119722
|
init_utils();
|
|
119626
119723
|
init_part_rels_path();
|
|
119724
|
+
init_load_part_reader();
|
|
119627
119725
|
init_template_element_baselines();
|
|
119628
119726
|
PptxHandlerRuntime = class {
|
|
119629
119727
|
/** The in-memory ZIP archive representing the OPC (.pptx) package. */
|
|
119630
119728
|
zip;
|
|
119729
|
+
/** Shares part reads within the load in progress; see {@link LoadPartReader}. */
|
|
119730
|
+
loadPartReader;
|
|
119731
|
+
/** Opens a part reader for the current package, closing any earlier one. */
|
|
119732
|
+
beginPartReads() {
|
|
119733
|
+
this.endPartReads();
|
|
119734
|
+
const reader2 = new LoadPartReader(this.zip);
|
|
119735
|
+
this.loadPartReader = reader2;
|
|
119736
|
+
return reader2;
|
|
119737
|
+
}
|
|
119738
|
+
/** Closes `reader` (by default the open one) and releases its cached reads. */
|
|
119739
|
+
endPartReads(reader2 = this.loadPartReader) {
|
|
119740
|
+
reader2?.close();
|
|
119741
|
+
if (reader2 && this.loadPartReader === reader2) {
|
|
119742
|
+
this.loadPartReader = void 0;
|
|
119743
|
+
}
|
|
119744
|
+
}
|
|
119745
|
+
/** The text of a package part, shared within a load. */
|
|
119746
|
+
readPartText(path4) {
|
|
119747
|
+
return readPartText(this.zip, path4);
|
|
119748
|
+
}
|
|
119749
|
+
/** A parsed package part; relationship parts are parsed once per load. */
|
|
119750
|
+
readPartXml(path4) {
|
|
119751
|
+
return readPartXml(this.zip, this.parser, path4);
|
|
119752
|
+
}
|
|
119631
119753
|
/** fast-xml-parser instance used to parse XML strings into JS objects. */
|
|
119632
119754
|
parser;
|
|
119633
119755
|
/** fast-xml-parser builder used to serialize JS objects back to XML strings. */
|
|
@@ -120046,11 +120168,11 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
120046
120168
|
* @param relsPath - Path of the `.rels` part; derived from `partPath` when omitted.
|
|
120047
120169
|
*/
|
|
120048
120170
|
async loadPartRelationships(partPath, relsPath2) {
|
|
120049
|
-
const
|
|
120050
|
-
|
|
120171
|
+
const path4 = relsPath2 ?? partRelsPath(partPath);
|
|
120172
|
+
const relsData = await this.readPartXml(path4);
|
|
120173
|
+
if (!relsData) {
|
|
120051
120174
|
return;
|
|
120052
120175
|
}
|
|
120053
|
-
const relsData = this.parser.parse(relsXml);
|
|
120054
120176
|
const relationships3 = relsData?.["Relationships"];
|
|
120055
120177
|
const raw2 = relationships3?.["Relationship"];
|
|
120056
120178
|
const entries = Array.isArray(raw2) ? raw2 : raw2 ? [raw2] : [];
|
|
@@ -121579,10 +121701,6 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
121579
121701
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
121580
121702
|
return true;
|
|
121581
121703
|
}
|
|
121582
|
-
/** The text of a package part, or `undefined` when the package has no such part. */
|
|
121583
|
-
async readPartText(path4) {
|
|
121584
|
-
return this.zip.file(path4)?.async("string");
|
|
121585
|
-
}
|
|
121586
121704
|
/**
|
|
121587
121705
|
* Parse extended (application) properties from `docProps/app.xml`.
|
|
121588
121706
|
*/
|
|
@@ -121643,8 +121761,10 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
121643
121761
|
if (!relsFile) {
|
|
121644
121762
|
return [];
|
|
121645
121763
|
}
|
|
121646
|
-
const
|
|
121647
|
-
|
|
121764
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
121765
|
+
if (!relsData) {
|
|
121766
|
+
return [];
|
|
121767
|
+
}
|
|
121648
121768
|
const relRoot = relsData["Relationships"] || {};
|
|
121649
121769
|
const relationships3 = this.ensureArray(relRoot["Relationship"]);
|
|
121650
121770
|
const relMap = /* @__PURE__ */ new Map();
|
|
@@ -121675,7 +121795,7 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
121675
121795
|
try {
|
|
121676
121796
|
const file2 = this.zip.file(resolvedPath);
|
|
121677
121797
|
if (file2) {
|
|
121678
|
-
data = await
|
|
121798
|
+
data = await this.readPartText(resolvedPath);
|
|
121679
121799
|
}
|
|
121680
121800
|
} catch {
|
|
121681
121801
|
}
|
|
@@ -121755,9 +121875,7 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
121755
121875
|
*/
|
|
121756
121876
|
async parseTags() {
|
|
121757
121877
|
try {
|
|
121758
|
-
return await discoverTagCollections(this.zip,
|
|
121759
|
-
parse: (xml) => this.parser.parse(xml)
|
|
121760
|
-
});
|
|
121878
|
+
return await discoverTagCollections(this.zip, this.parser);
|
|
121761
121879
|
} catch (e) {
|
|
121762
121880
|
console.warn("Failed to parse tags:", e);
|
|
121763
121881
|
return [];
|
|
@@ -121897,7 +122015,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
121897
122015
|
}
|
|
121898
122016
|
for (const file2 of masterFiles) {
|
|
121899
122017
|
const path4 = file2.name;
|
|
121900
|
-
const xml = await
|
|
122018
|
+
const xml = await this.readPartText(path4) ?? "";
|
|
121901
122019
|
const data = this.parser.parse(xml);
|
|
121902
122020
|
const sldMaster = data?.["p:sldMaster"];
|
|
121903
122021
|
if (!sldMaster) {
|
|
@@ -121922,8 +122040,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
121922
122040
|
);
|
|
121923
122041
|
const relsFile = this.zip.file(relsPath2);
|
|
121924
122042
|
if (relsFile) {
|
|
121925
|
-
const
|
|
121926
|
-
const relsData = this.parser.parse(relsXml);
|
|
122043
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
121927
122044
|
const rels = this.ensureArray(
|
|
121928
122045
|
xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
121929
122046
|
);
|
|
@@ -121937,8 +122054,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
121937
122054
|
}
|
|
121938
122055
|
const layoutPaths = [];
|
|
121939
122056
|
if (relsFile) {
|
|
121940
|
-
const
|
|
121941
|
-
const relsData = this.parser.parse(relsXml);
|
|
122057
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
121942
122058
|
const rels = this.ensureArray(
|
|
121943
122059
|
xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
121944
122060
|
);
|
|
@@ -121982,7 +122098,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
121982
122098
|
return void 0;
|
|
121983
122099
|
}
|
|
121984
122100
|
const path4 = files[0].name;
|
|
121985
|
-
const xml = await
|
|
122101
|
+
const xml = await this.readPartText(path4) ?? "";
|
|
121986
122102
|
const data = this.parser.parse(xml);
|
|
121987
122103
|
const master = data?.["p:handoutMaster"];
|
|
121988
122104
|
if (!master) {
|
|
@@ -122014,7 +122130,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
122014
122130
|
return void 0;
|
|
122015
122131
|
}
|
|
122016
122132
|
const path4 = files[0].name;
|
|
122017
|
-
const xml = await
|
|
122133
|
+
const xml = await this.readPartText(path4) ?? "";
|
|
122018
122134
|
const data = this.parser.parse(xml);
|
|
122019
122135
|
const master = data?.["p:notesMaster"];
|
|
122020
122136
|
if (!master) {
|
|
@@ -122045,7 +122161,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
122045
122161
|
if (!layoutFile) {
|
|
122046
122162
|
return void 0;
|
|
122047
122163
|
}
|
|
122048
|
-
const xml = await
|
|
122164
|
+
const xml = await this.readPartText(layoutPath) ?? "";
|
|
122049
122165
|
const data = this.parser.parse(xml);
|
|
122050
122166
|
const sldLayout = data?.["p:sldLayout"];
|
|
122051
122167
|
if (!sldLayout) {
|
|
@@ -122153,18 +122269,19 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
122153
122269
|
*/
|
|
122154
122270
|
async parsePresentationProperties() {
|
|
122155
122271
|
try {
|
|
122156
|
-
const
|
|
122157
|
-
if (!
|
|
122272
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
122273
|
+
if (!relsData) {
|
|
122158
122274
|
return void 0;
|
|
122159
122275
|
}
|
|
122160
|
-
const
|
|
122161
|
-
|
|
122276
|
+
const rels = this.ensureArray(
|
|
122277
|
+
relsData.Relationships?.Relationship
|
|
122278
|
+
);
|
|
122162
122279
|
const prRel = rels.find(
|
|
122163
122280
|
(r) => String(r?.["@_Type"] || "").includes("presProps") || String(r?.["@_Target"] || "").includes("presProps")
|
|
122164
122281
|
);
|
|
122165
122282
|
const prTarget = prRel ? String(prRel["@_Target"] || "") : "presProps.xml";
|
|
122166
122283
|
const prPath = prTarget.startsWith("/") ? prTarget.substring(1) : `ppt/${prTarget}`;
|
|
122167
|
-
const prXmlStr = await this.
|
|
122284
|
+
const prXmlStr = await this.readPartText(prPath);
|
|
122168
122285
|
if (!prXmlStr) {
|
|
122169
122286
|
return void 0;
|
|
122170
122287
|
}
|
|
@@ -122210,7 +122327,7 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
122210
122327
|
*/
|
|
122211
122328
|
async parseViewProperties() {
|
|
122212
122329
|
try {
|
|
122213
|
-
const viewPropsXml2 = await this.
|
|
122330
|
+
const viewPropsXml2 = await this.readPartText("ppt/viewProps.xml");
|
|
122214
122331
|
if (!viewPropsXml2) {
|
|
122215
122332
|
return void 0;
|
|
122216
122333
|
}
|
|
@@ -126685,7 +126802,7 @@ var init_PptxHandlerRuntimeChartUserShapes = __esm({
|
|
|
126685
126802
|
if (existingRel?.target) {
|
|
126686
126803
|
drawingPath = this.resolveImagePath(chartPartPath, existingRel.target);
|
|
126687
126804
|
try {
|
|
126688
|
-
const xml = await this.
|
|
126805
|
+
const xml = await this.readPartText(drawingPath);
|
|
126689
126806
|
if (xml) {
|
|
126690
126807
|
const root = this.parser.parse(xml);
|
|
126691
126808
|
onDisk = parseChartUserShapesDrawing(root, this.xmlLookupService, {
|
|
@@ -126736,11 +126853,10 @@ var init_PptxHandlerRuntimeChartUserShapes = __esm({
|
|
|
126736
126853
|
const slash = chartPartPath.lastIndexOf("/");
|
|
126737
126854
|
const relsPath2 = `${chartPartPath.slice(0, slash + 1)}_rels/${chartPartPath.slice(slash + 1)}.rels`;
|
|
126738
126855
|
try {
|
|
126739
|
-
const
|
|
126740
|
-
if (!
|
|
126856
|
+
const tree = await this.readPartXml(relsPath2);
|
|
126857
|
+
if (!tree) {
|
|
126741
126858
|
return void 0;
|
|
126742
126859
|
}
|
|
126743
|
-
const tree = this.parser.parse(xml);
|
|
126744
126860
|
const root = tree["Relationships"];
|
|
126745
126861
|
const rels = root?.["Relationship"];
|
|
126746
126862
|
const list3 = rels === void 0 ? [] : Array.isArray(rels) ? rels : [rels];
|
|
@@ -142279,7 +142395,7 @@ var init_PptxHandlerRuntimeSlideParsing = __esm({
|
|
|
142279
142395
|
this.unwrapAlternateContent(spTree);
|
|
142280
142396
|
let rawXmlStr;
|
|
142281
142397
|
try {
|
|
142282
|
-
rawXmlStr = await this.
|
|
142398
|
+
rawXmlStr = await this.readPartText(slidePath);
|
|
142283
142399
|
} catch {
|
|
142284
142400
|
}
|
|
142285
142401
|
const slidePrefix = slidePath ? `${slidePath}-` : "";
|
|
@@ -142848,7 +142964,7 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
142848
142964
|
if (cached2) {
|
|
142849
142965
|
return cached2;
|
|
142850
142966
|
}
|
|
142851
|
-
const xml = await this.
|
|
142967
|
+
const xml = await this.readPartText(layoutPath);
|
|
142852
142968
|
if (!xml) {
|
|
142853
142969
|
return void 0;
|
|
142854
142970
|
}
|
|
@@ -142862,7 +142978,7 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
142862
142978
|
if (cached2) {
|
|
142863
142979
|
return cached2;
|
|
142864
142980
|
}
|
|
142865
|
-
const xml = await this.
|
|
142981
|
+
const xml = await this.readPartText(masterPath);
|
|
142866
142982
|
if (!xml) {
|
|
142867
142983
|
return void 0;
|
|
142868
142984
|
}
|
|
@@ -143322,7 +143438,7 @@ var init_PptxHandlerRuntimeSlideUtils = __esm({
|
|
|
143322
143438
|
if (!notesPath) {
|
|
143323
143439
|
return {};
|
|
143324
143440
|
}
|
|
143325
|
-
const notesXml = await this.
|
|
143441
|
+
const notesXml = await this.readPartText(notesPath);
|
|
143326
143442
|
if (!notesXml) {
|
|
143327
143443
|
return {};
|
|
143328
143444
|
}
|
|
@@ -143821,7 +143937,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
143821
143937
|
try {
|
|
143822
143938
|
let masterXmlObj = this.masterXmlMap.get(master.path);
|
|
143823
143939
|
if (!masterXmlObj) {
|
|
143824
|
-
const xmlStr = await this.
|
|
143940
|
+
const xmlStr = await this.readPartText(master.path);
|
|
143825
143941
|
if (!xmlStr) {
|
|
143826
143942
|
continue;
|
|
143827
143943
|
}
|
|
@@ -143894,7 +144010,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
143894
144010
|
}
|
|
143895
144011
|
const masterToken = masterPath.split("/").pop()?.replace(/\.xml$/u, "") ?? masterPath;
|
|
143896
144012
|
try {
|
|
143897
|
-
const masterXmlStr = await this.
|
|
144013
|
+
const masterXmlStr = await this.readPartText(masterPath);
|
|
143898
144014
|
if (!masterXmlStr) {
|
|
143899
144015
|
return [];
|
|
143900
144016
|
}
|
|
@@ -144056,7 +144172,7 @@ var init_PptxHandlerRuntimeAuxiliaryMasterElements = __esm({
|
|
|
144056
144172
|
}
|
|
144057
144173
|
const partPath = part.path;
|
|
144058
144174
|
rememberMasterPartBackground(this, partPath, part.backgroundColor);
|
|
144059
|
-
const xml = await this.
|
|
144175
|
+
const xml = await this.readPartText(partPath);
|
|
144060
144176
|
if (!xml) {
|
|
144061
144177
|
return;
|
|
144062
144178
|
}
|
|
@@ -144216,7 +144332,7 @@ var init_PptxHandlerRuntimeLayoutElements = __esm({
|
|
|
144216
144332
|
}
|
|
144217
144333
|
const layoutToken = layoutPath.split("/").pop()?.replace(/\.xml$/u, "") ?? layoutPath;
|
|
144218
144334
|
try {
|
|
144219
|
-
const layoutXmlStr = await this.
|
|
144335
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
144220
144336
|
if (!layoutXmlStr) {
|
|
144221
144337
|
return [];
|
|
144222
144338
|
}
|
|
@@ -144950,7 +145066,7 @@ var init_PptxHandlerRuntimeThemeOverrides = __esm({
|
|
|
144950
145066
|
return cached2;
|
|
144951
145067
|
}
|
|
144952
145068
|
try {
|
|
144953
|
-
const overrideXml = await this.
|
|
145069
|
+
const overrideXml = await this.readPartText(overridePath);
|
|
144954
145070
|
if (!overrideXml) {
|
|
144955
145071
|
return null;
|
|
144956
145072
|
}
|
|
@@ -145579,10 +145695,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
145579
145695
|
if (!relsXml) {
|
|
145580
145696
|
return void 0;
|
|
145581
145697
|
}
|
|
145582
|
-
const relsData = this.
|
|
145583
|
-
// eslint-disable-next-line no-await-in-loop
|
|
145584
|
-
await relsXml.async("string")
|
|
145585
|
-
);
|
|
145698
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
145586
145699
|
const relNodes = this.ensureArray(
|
|
145587
145700
|
relsData?.Relationships?.Relationship
|
|
145588
145701
|
);
|
|
@@ -145608,7 +145721,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
145608
145721
|
const options = [];
|
|
145609
145722
|
for (const file2 of themeFiles) {
|
|
145610
145723
|
try {
|
|
145611
|
-
const xml = await file2.
|
|
145724
|
+
const xml = await this.readPartText(file2.name) ?? "";
|
|
145612
145725
|
const data = this.parser.parse(xml);
|
|
145613
145726
|
const root = data["a:theme"];
|
|
145614
145727
|
const name = String(root?.["@_name"] || "").trim();
|
|
@@ -145688,7 +145801,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
145688
145801
|
];
|
|
145689
145802
|
for (const file2 of masterFiles) {
|
|
145690
145803
|
try {
|
|
145691
|
-
const masterXml = await file2.
|
|
145804
|
+
const masterXml = await this.readPartText(file2.name) ?? "";
|
|
145692
145805
|
const masterData = this.parser.parse(masterXml);
|
|
145693
145806
|
const clrMap = masterData?.["p:sldMaster"]?.["p:clrMap"];
|
|
145694
145807
|
if (!clrMap) {
|
|
@@ -145721,7 +145834,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
145721
145834
|
if (!themeFile) {
|
|
145722
145835
|
return null;
|
|
145723
145836
|
}
|
|
145724
|
-
const themeXml3 = await
|
|
145837
|
+
const themeXml3 = await this.readPartText(themePath) ?? "";
|
|
145725
145838
|
const model = this.parseThemePartXml(themeXml3);
|
|
145726
145839
|
this.cacheThemePartModel(themePath, themeXml3, model);
|
|
145727
145840
|
return { colorMap: model.colorMap, fontMap: model.fontMap, formatScheme: model.formatScheme };
|
|
@@ -145756,7 +145869,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
145756
145869
|
if (!relsXml) {
|
|
145757
145870
|
return void 0;
|
|
145758
145871
|
}
|
|
145759
|
-
const relsData =
|
|
145872
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
145760
145873
|
const relNodes = this.ensureArray(
|
|
145761
145874
|
relsData?.Relationships?.Relationship
|
|
145762
145875
|
);
|
|
@@ -146085,11 +146198,10 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146085
146198
|
async extractModernSlideComments(slidePath) {
|
|
146086
146199
|
try {
|
|
146087
146200
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
146088
|
-
const
|
|
146089
|
-
if (!
|
|
146201
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
146202
|
+
if (!relsData) {
|
|
146090
146203
|
return [];
|
|
146091
146204
|
}
|
|
146092
|
-
const relsData = this.parser.parse(relsXml);
|
|
146093
146205
|
const rels = this.ensureArray(
|
|
146094
146206
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
146095
146207
|
);
|
|
@@ -146106,7 +146218,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146106
146218
|
continue;
|
|
146107
146219
|
}
|
|
146108
146220
|
const filePath = this.resolvePath(slidePath, target);
|
|
146109
|
-
const xml = await this.
|
|
146221
|
+
const xml = await this.readPartText(filePath);
|
|
146110
146222
|
if (!xml) {
|
|
146111
146223
|
continue;
|
|
146112
146224
|
}
|
|
@@ -146129,11 +146241,10 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146129
146241
|
return [];
|
|
146130
146242
|
}
|
|
146131
146243
|
async loadModernCommentAuthors() {
|
|
146132
|
-
const
|
|
146133
|
-
if (!
|
|
146244
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
146245
|
+
if (!relsData) {
|
|
146134
146246
|
return;
|
|
146135
146247
|
}
|
|
146136
|
-
const relsData = this.parser.parse(relsXml);
|
|
146137
146248
|
const relationships3 = this.ensureArray(
|
|
146138
146249
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
146139
146250
|
);
|
|
@@ -146145,7 +146256,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146145
146256
|
return;
|
|
146146
146257
|
}
|
|
146147
146258
|
const partPath = this.resolvePath("ppt/presentation.xml", target);
|
|
146148
|
-
const xml = await this.
|
|
146259
|
+
const xml = await this.readPartText(partPath);
|
|
146149
146260
|
if (!xml) {
|
|
146150
146261
|
return;
|
|
146151
146262
|
}
|
|
@@ -146171,12 +146282,12 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146171
146282
|
}
|
|
146172
146283
|
}
|
|
146173
146284
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
146174
|
-
const relsXml = await this.
|
|
146285
|
+
const relsXml = await this.readPartText(relsPath2);
|
|
146175
146286
|
if (!relsXml) {
|
|
146176
146287
|
return void 0;
|
|
146177
146288
|
}
|
|
146178
146289
|
try {
|
|
146179
|
-
const relsData = this.
|
|
146290
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
146180
146291
|
const rels = this.ensureArray(
|
|
146181
146292
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
146182
146293
|
);
|
|
@@ -146215,7 +146326,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146215
146326
|
return [];
|
|
146216
146327
|
}
|
|
146217
146328
|
const commentsPath = this.resolveImagePath(slidePath, commentTarget);
|
|
146218
|
-
const commentsXml = await this.
|
|
146329
|
+
const commentsXml = await this.readPartText(commentsPath);
|
|
146219
146330
|
if (!commentsXml) {
|
|
146220
146331
|
return [];
|
|
146221
146332
|
}
|
|
@@ -146250,7 +146361,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
146250
146361
|
}
|
|
146251
146362
|
}
|
|
146252
146363
|
async loadCommentAuthors() {
|
|
146253
|
-
const commentAuthorsXml = await this.
|
|
146364
|
+
const commentAuthorsXml = await this.readPartText("ppt/commentAuthors.xml");
|
|
146254
146365
|
if (!commentAuthorsXml) {
|
|
146255
146366
|
return;
|
|
146256
146367
|
}
|
|
@@ -146322,7 +146433,7 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
146322
146433
|
return void 0;
|
|
146323
146434
|
}
|
|
146324
146435
|
const partPath = this.resolveImagePath(slidePath, target);
|
|
146325
|
-
const xmlString = await this.
|
|
146436
|
+
const xmlString = await this.readPartText(partPath);
|
|
146326
146437
|
if (!xmlString) {
|
|
146327
146438
|
return void 0;
|
|
146328
146439
|
}
|
|
@@ -148037,9 +148148,8 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
148037
148148
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
148038
148149
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
148039
148150
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
148040
|
-
const
|
|
148041
|
-
if (
|
|
148042
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
148151
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
148152
|
+
if (chartRelsData) {
|
|
148043
148153
|
const relsContainer = chartRelsData?.Relationships;
|
|
148044
148154
|
if (relsContainer?.Relationship) {
|
|
148045
148155
|
const rels = Array.isArray(relsContainer.Relationship) ? relsContainer.Relationship : [relsContainer.Relationship];
|
|
@@ -148121,7 +148231,7 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
148121
148231
|
if (drawingPath.length === 0) {
|
|
148122
148232
|
return void 0;
|
|
148123
148233
|
}
|
|
148124
|
-
const drawingXml = await this.
|
|
148234
|
+
const drawingXml = await this.readPartText(drawingPath);
|
|
148125
148235
|
if (!drawingXml) {
|
|
148126
148236
|
return void 0;
|
|
148127
148237
|
}
|
|
@@ -148142,11 +148252,10 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
148142
148252
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
148143
148253
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
148144
148254
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
148145
|
-
const
|
|
148146
|
-
if (!
|
|
148255
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
148256
|
+
if (!chartRelsData) {
|
|
148147
148257
|
return [];
|
|
148148
148258
|
}
|
|
148149
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
148150
148259
|
const relsContainer = chartRelsData?.Relationships;
|
|
148151
148260
|
if (!relsContainer?.Relationship) {
|
|
148152
148261
|
return [];
|
|
@@ -149038,11 +149147,10 @@ var init_PptxHandlerRuntimeEmbeddedFonts = __esm({
|
|
|
149038
149147
|
async loadPresentationFontRels() {
|
|
149039
149148
|
const map2 = /* @__PURE__ */ new Map();
|
|
149040
149149
|
try {
|
|
149041
|
-
const
|
|
149042
|
-
if (!
|
|
149150
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
149151
|
+
if (!relsData) {
|
|
149043
149152
|
return map2;
|
|
149044
149153
|
}
|
|
149045
|
-
const relsData = this.parser.parse(relsXml);
|
|
149046
149154
|
const rels = this.ensureArray(
|
|
149047
149155
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
149048
149156
|
);
|
|
@@ -149363,13 +149471,13 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
149363
149471
|
if (!file2) {
|
|
149364
149472
|
continue;
|
|
149365
149473
|
}
|
|
149366
|
-
const data = await
|
|
149474
|
+
const data = await this.readPartText(entry2) ?? "";
|
|
149367
149475
|
const propsPath = `customXml/itemProps${itemId}.xml`;
|
|
149368
149476
|
const propsFile = this.zip.file(propsPath);
|
|
149369
149477
|
let properties;
|
|
149370
149478
|
let schemaUri;
|
|
149371
149479
|
if (propsFile) {
|
|
149372
|
-
properties = await
|
|
149480
|
+
properties = await this.readPartText(propsPath) ?? "";
|
|
149373
149481
|
try {
|
|
149374
149482
|
const propsData = this.parser.parse(properties);
|
|
149375
149483
|
const schemaRefs = propsData?.["ds:datastoreItem"]?.["ds:schemaRefs"]?.["ds:schemaRef"];
|
|
@@ -149389,14 +149497,14 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
149389
149497
|
const relsFile = this.zip.file(relsPath2);
|
|
149390
149498
|
let rels;
|
|
149391
149499
|
if (relsFile) {
|
|
149392
|
-
rels = await
|
|
149500
|
+
rels = await this.readPartText(relsPath2);
|
|
149393
149501
|
}
|
|
149394
149502
|
parts.push({ id: itemId, data, schemaUri, properties, rels });
|
|
149395
149503
|
}
|
|
149396
149504
|
this.customXmlParts = parts;
|
|
149397
149505
|
}
|
|
149398
149506
|
async loadPresentationState() {
|
|
149399
|
-
const presentationXml3 = await this.
|
|
149507
|
+
const presentationXml3 = await this.readPartText("ppt/presentation.xml");
|
|
149400
149508
|
if (!presentationXml3) {
|
|
149401
149509
|
throw new Error("Invalid PPTX: presentation.xml not found");
|
|
149402
149510
|
}
|
|
@@ -149748,6 +149856,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
149748
149856
|
* or resolve images. Create a new `PptxHandler` instance instead.
|
|
149749
149857
|
*/
|
|
149750
149858
|
dispose() {
|
|
149859
|
+
this.endPartReads();
|
|
149751
149860
|
this.revokeBlobUrls();
|
|
149752
149861
|
this.imageDataCache.clear();
|
|
149753
149862
|
this.slideMap.clear();
|
|
@@ -149781,18 +149890,24 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
149781
149890
|
this.zip = null;
|
|
149782
149891
|
}
|
|
149783
149892
|
async load(data, options = {}) {
|
|
149784
|
-
|
|
149785
|
-
|
|
149786
|
-
|
|
149787
|
-
|
|
149788
|
-
|
|
149789
|
-
|
|
149790
|
-
|
|
149791
|
-
|
|
149792
|
-
|
|
149793
|
-
|
|
149794
|
-
|
|
149795
|
-
|
|
149893
|
+
let reader2;
|
|
149894
|
+
try {
|
|
149895
|
+
await this.initializeLoadSession(data, options);
|
|
149896
|
+
reader2 = this.beginPartReads();
|
|
149897
|
+
await this.detectAndPreserveVbaProject();
|
|
149898
|
+
this.detectDigitalSignatureParts();
|
|
149899
|
+
await this.parseCustomXmlParts();
|
|
149900
|
+
const presentationState = await this.loadPresentationState();
|
|
149901
|
+
const slideMasters = await this.parseSlideMasters();
|
|
149902
|
+
await this.enrichSlideMastersWithTxStyles(slideMasters);
|
|
149903
|
+
const slides = await this.loadSlidesForPresentation(presentationState.sectionBySlideId);
|
|
149904
|
+
const slidesWithWarnings = this.attachSlideWarnings(slides);
|
|
149905
|
+
this.resetElementIdCounter(slides);
|
|
149906
|
+
recordSlideFingerprints(this.savedSlideFingerprints, slidesWithWarnings);
|
|
149907
|
+
return await this.buildLoadData(presentationState, slidesWithWarnings, slideMasters);
|
|
149908
|
+
} finally {
|
|
149909
|
+
this.endPartReads(reader2);
|
|
149910
|
+
}
|
|
149796
149911
|
}
|
|
149797
149912
|
/**
|
|
149798
149913
|
* Retrieve the current background colour for a layout or master.
|
|
@@ -149931,7 +150046,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
149931
150046
|
options.push(this.buildLayoutOption(lp, xmlObj));
|
|
149932
150047
|
} else {
|
|
149933
150048
|
try {
|
|
149934
|
-
const layoutXmlStr = await this.
|
|
150049
|
+
const layoutXmlStr = await this.readPartText(lp);
|
|
149935
150050
|
if (layoutXmlStr) {
|
|
149936
150051
|
const layoutXmlObj = this.parser.parse(layoutXmlStr);
|
|
149937
150052
|
this.layoutXmlMap.set(lp, layoutXmlObj);
|
|
@@ -149974,7 +150089,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
149974
150089
|
}
|
|
149975
150090
|
let layoutXml3 = this.layoutXmlMap.get(layoutPath);
|
|
149976
150091
|
if (!layoutXml3) {
|
|
149977
|
-
const layoutXmlStr = await this.
|
|
150092
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
149978
150093
|
if (!layoutXmlStr) {
|
|
149979
150094
|
throw new Error(`Layout not found: ${layoutPath}`);
|
|
149980
150095
|
}
|