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
package/dist/pptx/cli/index.cjs
CHANGED
|
@@ -65253,6 +65253,96 @@ var init_background_fill_shapes = __esm({
|
|
|
65253
65253
|
}
|
|
65254
65254
|
});
|
|
65255
65255
|
|
|
65256
|
+
// pptx/core/core/runtime/load-part-reader.ts
|
|
65257
|
+
function parseText2(parser, text2) {
|
|
65258
|
+
return text2 ? parser.parse(text2) : void 0;
|
|
65259
|
+
}
|
|
65260
|
+
function readPartText(zip, path4) {
|
|
65261
|
+
const reader2 = openReaders.get(zip);
|
|
65262
|
+
if (reader2) {
|
|
65263
|
+
return reader2.readText(path4);
|
|
65264
|
+
}
|
|
65265
|
+
return zip.file(path4)?.async("string") ?? Promise.resolve(void 0);
|
|
65266
|
+
}
|
|
65267
|
+
async function readPartXml(zip, parser, path4) {
|
|
65268
|
+
const reader2 = openReaders.get(zip);
|
|
65269
|
+
if (reader2) {
|
|
65270
|
+
return reader2.readXml(parser, path4);
|
|
65271
|
+
}
|
|
65272
|
+
const text2 = await zip.file(path4)?.async("string");
|
|
65273
|
+
return text2 ? parseText2(parser, text2) : void 0;
|
|
65274
|
+
}
|
|
65275
|
+
var openReaders, LoadPartReader;
|
|
65276
|
+
var init_load_part_reader = __esm({
|
|
65277
|
+
"pptx/core/core/runtime/load-part-reader.ts"() {
|
|
65278
|
+
openReaders = /* @__PURE__ */ new WeakMap();
|
|
65279
|
+
LoadPartReader = class {
|
|
65280
|
+
constructor(zip) {
|
|
65281
|
+
this.zip = zip;
|
|
65282
|
+
openReaders.set(zip, this);
|
|
65283
|
+
}
|
|
65284
|
+
zip;
|
|
65285
|
+
parts = /* @__PURE__ */ new Map();
|
|
65286
|
+
closed = false;
|
|
65287
|
+
entry(path4) {
|
|
65288
|
+
const file = this.zip.file(path4);
|
|
65289
|
+
if (!file) {
|
|
65290
|
+
this.parts.delete(path4);
|
|
65291
|
+
return void 0;
|
|
65292
|
+
}
|
|
65293
|
+
const previous = this.parts.get(path4);
|
|
65294
|
+
if (previous?.file === file) {
|
|
65295
|
+
return previous;
|
|
65296
|
+
}
|
|
65297
|
+
const entry2 = { file, text: file.async("string"), relationships: /* @__PURE__ */ new Map() };
|
|
65298
|
+
this.parts.set(path4, entry2);
|
|
65299
|
+
entry2.text.catch(() => {
|
|
65300
|
+
if (this.parts.get(path4) === entry2) {
|
|
65301
|
+
this.parts.delete(path4);
|
|
65302
|
+
}
|
|
65303
|
+
});
|
|
65304
|
+
return entry2;
|
|
65305
|
+
}
|
|
65306
|
+
readText(path4) {
|
|
65307
|
+
return this.entry(path4)?.text ?? Promise.resolve(void 0);
|
|
65308
|
+
}
|
|
65309
|
+
async readXml(parser, path4) {
|
|
65310
|
+
const entry2 = this.entry(path4);
|
|
65311
|
+
if (!entry2) {
|
|
65312
|
+
return void 0;
|
|
65313
|
+
}
|
|
65314
|
+
if (!path4.endsWith(".rels")) {
|
|
65315
|
+
return parseText2(parser, await entry2.text);
|
|
65316
|
+
}
|
|
65317
|
+
let parsed = entry2.relationships.get(parser);
|
|
65318
|
+
if (!parsed) {
|
|
65319
|
+
const pending = entry2.text.then((text2) => parseText2(parser, text2));
|
|
65320
|
+
entry2.relationships.set(parser, pending);
|
|
65321
|
+
pending.catch(() => {
|
|
65322
|
+
if (entry2.relationships.get(parser) === pending) {
|
|
65323
|
+
entry2.relationships.delete(parser);
|
|
65324
|
+
}
|
|
65325
|
+
});
|
|
65326
|
+
parsed = pending;
|
|
65327
|
+
}
|
|
65328
|
+
return structuredClone(await parsed);
|
|
65329
|
+
}
|
|
65330
|
+
/** Whether this reader still serves reads for its package. */
|
|
65331
|
+
get isOpen() {
|
|
65332
|
+
return !this.closed;
|
|
65333
|
+
}
|
|
65334
|
+
/** Drops every cached read; later reads of the package go to the archive. */
|
|
65335
|
+
close() {
|
|
65336
|
+
this.closed = true;
|
|
65337
|
+
if (openReaders.get(this.zip) === this) {
|
|
65338
|
+
openReaders.delete(this.zip);
|
|
65339
|
+
}
|
|
65340
|
+
this.parts.clear();
|
|
65341
|
+
}
|
|
65342
|
+
};
|
|
65343
|
+
}
|
|
65344
|
+
});
|
|
65345
|
+
|
|
65256
65346
|
// pptx/core/core/builders/element-hidden-flag.ts
|
|
65257
65347
|
function findCNvPr(shape) {
|
|
65258
65348
|
if (!shape) {
|
|
@@ -65326,11 +65416,10 @@ var init_flatten_elements = __esm({
|
|
|
65326
65416
|
|
|
65327
65417
|
// pptx/core/utils/slide-synchronization.ts
|
|
65328
65418
|
async function loadSlideSynchronization(input) {
|
|
65329
|
-
const
|
|
65330
|
-
if (!
|
|
65419
|
+
const relsData = await readPartXml(input.zip, input.parser, input.relsPath);
|
|
65420
|
+
if (!relsData) {
|
|
65331
65421
|
return void 0;
|
|
65332
65422
|
}
|
|
65333
|
-
const relsData = input.parser.parse(relsXml);
|
|
65334
65423
|
const relationship2 = findSlideSyncRelationship(relsData);
|
|
65335
65424
|
if (!relationship2) {
|
|
65336
65425
|
return void 0;
|
|
@@ -65340,7 +65429,7 @@ async function loadSlideSynchronization(input) {
|
|
|
65340
65429
|
return void 0;
|
|
65341
65430
|
}
|
|
65342
65431
|
const partPath = resolvePartPath2(input.slidePath, target);
|
|
65343
|
-
const partXml = await input.zip
|
|
65432
|
+
const partXml = await readPartText(input.zip, partPath);
|
|
65344
65433
|
if (!partXml) {
|
|
65345
65434
|
return void 0;
|
|
65346
65435
|
}
|
|
@@ -65461,6 +65550,7 @@ function nextSlideSyncPath(files) {
|
|
|
65461
65550
|
var SLIDE_SYNC_CONTENT_TYPE;
|
|
65462
65551
|
var init_slide_synchronization = __esm({
|
|
65463
65552
|
"pptx/core/utils/slide-synchronization.ts"() {
|
|
65553
|
+
init_load_part_reader();
|
|
65464
65554
|
SLIDE_SYNC_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideSyncData+xml";
|
|
65465
65555
|
}
|
|
65466
65556
|
});
|
|
@@ -65474,11 +65564,10 @@ function ensureArray8(value) {
|
|
|
65474
65564
|
}
|
|
65475
65565
|
async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
65476
65566
|
try {
|
|
65477
|
-
const
|
|
65478
|
-
if (!
|
|
65567
|
+
const relsData = await readPartXml(zip, parser, relsPath2);
|
|
65568
|
+
if (!relsData) {
|
|
65479
65569
|
return [];
|
|
65480
65570
|
}
|
|
65481
|
-
const relsData = parser.parse(relsXml);
|
|
65482
65571
|
const relationships3 = ensureArray8(
|
|
65483
65572
|
relsData["Relationships"]?.["Relationship"]
|
|
65484
65573
|
);
|
|
@@ -65501,7 +65590,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
65501
65590
|
if (!resolved) {
|
|
65502
65591
|
continue;
|
|
65503
65592
|
}
|
|
65504
|
-
const vmlXml = await zip
|
|
65593
|
+
const vmlXml = await readPartText(zip, resolved);
|
|
65505
65594
|
if (!vmlXml) {
|
|
65506
65595
|
continue;
|
|
65507
65596
|
}
|
|
@@ -65520,6 +65609,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
65520
65609
|
var VML_DRAWING_REL_SUFFIX;
|
|
65521
65610
|
var init_vml_drawing_loader = __esm({
|
|
65522
65611
|
"pptx/core/utils/vml-drawing-loader.ts"() {
|
|
65612
|
+
init_load_part_reader();
|
|
65523
65613
|
init_safe_path();
|
|
65524
65614
|
init_vml_parser();
|
|
65525
65615
|
VML_DRAWING_REL_SUFFIX = "/relationships/vmlDrawing";
|
|
@@ -68027,6 +68117,7 @@ var PptxSlideLoaderService;
|
|
|
68027
68117
|
var init_PptxSlideLoaderService = __esm({
|
|
68028
68118
|
"pptx/core/services/PptxSlideLoaderService.ts"() {
|
|
68029
68119
|
init_background_fill_shapes();
|
|
68120
|
+
init_load_part_reader();
|
|
68030
68121
|
init_element_hidden_flag();
|
|
68031
68122
|
init_background_style_ref();
|
|
68032
68123
|
init_flatten_elements();
|
|
@@ -68087,11 +68178,14 @@ var init_PptxSlideLoaderService = __esm({
|
|
|
68087
68178
|
* @returns Map of relationship ID to target path string.
|
|
68088
68179
|
*/
|
|
68089
68180
|
async loadPresentationSlideRels(params) {
|
|
68090
|
-
const
|
|
68091
|
-
|
|
68181
|
+
const relsData = await readPartXml(
|
|
68182
|
+
params.zip,
|
|
68183
|
+
params.parser,
|
|
68184
|
+
"ppt/_rels/presentation.xml.rels"
|
|
68185
|
+
);
|
|
68186
|
+
if (!relsData) {
|
|
68092
68187
|
return /* @__PURE__ */ new Map();
|
|
68093
68188
|
}
|
|
68094
|
-
const relsData = params.parser.parse(relsXml);
|
|
68095
68189
|
const relationships3 = relsData["Relationships"]?.["Relationship"];
|
|
68096
68190
|
const relNodes = this.toXmlObjectArray(relationships3);
|
|
68097
68191
|
const relsMap = /* @__PURE__ */ new Map();
|
|
@@ -68131,7 +68225,7 @@ var init_PptxSlideLoaderService = __esm({
|
|
|
68131
68225
|
if (!params.zip.file(path4)) {
|
|
68132
68226
|
path4 = `ppt/${target}`;
|
|
68133
68227
|
}
|
|
68134
|
-
const slideXmlStr = await params.zip
|
|
68228
|
+
const slideXmlStr = await readPartText(params.zip, path4);
|
|
68135
68229
|
if (!slideXmlStr) {
|
|
68136
68230
|
return void 0;
|
|
68137
68231
|
}
|
|
@@ -92320,12 +92414,11 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
92320
92414
|
if (!external.targetPath || !external.embeddedWorkbookData) return false;
|
|
92321
92415
|
const target = resolve2(chartPartPath, external.targetPath);
|
|
92322
92416
|
let references = 0;
|
|
92323
|
-
const parser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
92324
92417
|
try {
|
|
92325
92418
|
for (const path4 of Object.keys(zip.files)) {
|
|
92326
92419
|
if (!path4.endsWith(".rels") || !path4.includes("/_rels/")) continue;
|
|
92327
92420
|
const source = path4.replace("/_rels/", "/").slice(0, -5);
|
|
92328
|
-
const tree =
|
|
92421
|
+
const tree = await readPartXml(zip, relationshipParser, path4);
|
|
92329
92422
|
for (const rel of xmlChildren(xmlChild(tree, "Relationships"), "Relationship")) {
|
|
92330
92423
|
const relationshipTarget2 = xmlAttr(rel, "Target");
|
|
92331
92424
|
if (relationshipTarget2 && xmlAttr(rel, "TargetMode") !== "External" && resolve2(source, relationshipTarget2) === target)
|
|
@@ -92342,11 +92435,14 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
92342
92435
|
return false;
|
|
92343
92436
|
}
|
|
92344
92437
|
}
|
|
92438
|
+
var relationshipParser;
|
|
92345
92439
|
var init_chart_label_source = __esm({
|
|
92346
92440
|
"pptx/core/utils/chart-label-source.ts"() {
|
|
92441
|
+
init_load_part_reader();
|
|
92347
92442
|
init_chart_xlsx_writer();
|
|
92348
92443
|
init_xml_access();
|
|
92349
92444
|
init_chart_xlsx_cellref();
|
|
92445
|
+
relationshipParser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
92350
92446
|
}
|
|
92351
92447
|
});
|
|
92352
92448
|
|
|
@@ -94852,7 +94948,7 @@ function parseChartData(context, element) {
|
|
|
94852
94948
|
}
|
|
94853
94949
|
return out;
|
|
94854
94950
|
}
|
|
94855
|
-
function
|
|
94951
|
+
function parseText3(context, element) {
|
|
94856
94952
|
if (!element) return void 0;
|
|
94857
94953
|
reportUnmodelled2(context, element, /* @__PURE__ */ new Set(["txData", "rich"]));
|
|
94858
94954
|
const data = cxChild(element, "txData");
|
|
@@ -94872,7 +94968,7 @@ function parseTitle2(context, element) {
|
|
|
94872
94968
|
return assignDefined(
|
|
94873
94969
|
{},
|
|
94874
94970
|
{
|
|
94875
|
-
tx:
|
|
94971
|
+
tx: parseText3(context, cxChild(element, "tx")),
|
|
94876
94972
|
spPr: shapeProperties2(element),
|
|
94877
94973
|
txPr: textProperties2(element),
|
|
94878
94974
|
position: attribute4(element, "pos"),
|
|
@@ -95117,7 +95213,7 @@ function parseSeries2(context, element) {
|
|
|
95117
95213
|
ownerIndex: numberAttribute(context, element, "ownerIdx"),
|
|
95118
95214
|
uniqueId: attribute4(element, "uniqueId"),
|
|
95119
95215
|
formatIndex: numberAttribute(context, element, "formatIdx"),
|
|
95120
|
-
tx:
|
|
95216
|
+
tx: parseText3(context, cxChild(element, "tx")),
|
|
95121
95217
|
spPr: shapeProperties2(element),
|
|
95122
95218
|
txPr: textProperties2(element),
|
|
95123
95219
|
valueColorsXml: rawChild2(element, "valueColors"),
|
|
@@ -108668,8 +108764,8 @@ async function discoverTagCollections(zip, codec) {
|
|
|
108668
108764
|
if (!sourcePartPath) {
|
|
108669
108765
|
continue;
|
|
108670
108766
|
}
|
|
108671
|
-
const data =
|
|
108672
|
-
const root = data["Relationships"];
|
|
108767
|
+
const data = await readPartXml(zip, codec, relFile.name);
|
|
108768
|
+
const root = data?.["Relationships"];
|
|
108673
108769
|
for (const relationship2 of ensureArray16(root?.["Relationship"])) {
|
|
108674
108770
|
if (String(relationship2["@_Type"] ?? "") !== TAG_RELATIONSHIP_TYPE) {
|
|
108675
108771
|
continue;
|
|
@@ -108774,7 +108870,7 @@ async function removeTagContentTypeOverride(zip, codec, path4) {
|
|
|
108774
108870
|
zip.file("[Content_Types].xml", codec.build(data));
|
|
108775
108871
|
}
|
|
108776
108872
|
async function readTagCollection(zip, codec, path4) {
|
|
108777
|
-
const xml = await zip
|
|
108873
|
+
const xml = await readPartText(zip, path4);
|
|
108778
108874
|
if (!xml) {
|
|
108779
108875
|
return void 0;
|
|
108780
108876
|
}
|
|
@@ -108883,6 +108979,7 @@ function ensureArray16(value) {
|
|
|
108883
108979
|
var TAG_RELATIONSHIP_TYPE, TAG_CONTENT_TYPE;
|
|
108884
108980
|
var init_tag_package = __esm({
|
|
108885
108981
|
"pptx/core/utils/tag-package.ts"() {
|
|
108982
|
+
init_load_part_reader();
|
|
108886
108983
|
init_safe_path();
|
|
108887
108984
|
init_tag_package_owning_element();
|
|
108888
108985
|
TAG_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags";
|
|
@@ -113249,10 +113346,35 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
113249
113346
|
"pptx/core/core/runtime/PptxHandlerRuntimeState.ts"() {
|
|
113250
113347
|
init_utils();
|
|
113251
113348
|
init_part_rels_path();
|
|
113349
|
+
init_load_part_reader();
|
|
113252
113350
|
init_template_element_baselines();
|
|
113253
113351
|
PptxHandlerRuntime = class {
|
|
113254
113352
|
/** The in-memory ZIP archive representing the OPC (.pptx) package. */
|
|
113255
113353
|
zip;
|
|
113354
|
+
/** Shares part reads within the load in progress; see {@link LoadPartReader}. */
|
|
113355
|
+
loadPartReader;
|
|
113356
|
+
/** Opens a part reader for the current package, closing any earlier one. */
|
|
113357
|
+
beginPartReads() {
|
|
113358
|
+
this.endPartReads();
|
|
113359
|
+
const reader2 = new LoadPartReader(this.zip);
|
|
113360
|
+
this.loadPartReader = reader2;
|
|
113361
|
+
return reader2;
|
|
113362
|
+
}
|
|
113363
|
+
/** Closes `reader` (by default the open one) and releases its cached reads. */
|
|
113364
|
+
endPartReads(reader2 = this.loadPartReader) {
|
|
113365
|
+
reader2?.close();
|
|
113366
|
+
if (reader2 && this.loadPartReader === reader2) {
|
|
113367
|
+
this.loadPartReader = void 0;
|
|
113368
|
+
}
|
|
113369
|
+
}
|
|
113370
|
+
/** The text of a package part, shared within a load. */
|
|
113371
|
+
readPartText(path4) {
|
|
113372
|
+
return readPartText(this.zip, path4);
|
|
113373
|
+
}
|
|
113374
|
+
/** A parsed package part; relationship parts are parsed once per load. */
|
|
113375
|
+
readPartXml(path4) {
|
|
113376
|
+
return readPartXml(this.zip, this.parser, path4);
|
|
113377
|
+
}
|
|
113256
113378
|
/** fast-xml-parser instance used to parse XML strings into JS objects. */
|
|
113257
113379
|
parser;
|
|
113258
113380
|
/** fast-xml-parser builder used to serialize JS objects back to XML strings. */
|
|
@@ -113671,11 +113793,11 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
113671
113793
|
* @param relsPath - Path of the `.rels` part; derived from `partPath` when omitted.
|
|
113672
113794
|
*/
|
|
113673
113795
|
async loadPartRelationships(partPath, relsPath2) {
|
|
113674
|
-
const
|
|
113675
|
-
|
|
113796
|
+
const path4 = relsPath2 ?? partRelsPath(partPath);
|
|
113797
|
+
const relsData = await this.readPartXml(path4);
|
|
113798
|
+
if (!relsData) {
|
|
113676
113799
|
return;
|
|
113677
113800
|
}
|
|
113678
|
-
const relsData = this.parser.parse(relsXml);
|
|
113679
113801
|
const relationships3 = relsData?.["Relationships"];
|
|
113680
113802
|
const raw2 = relationships3?.["Relationship"];
|
|
113681
113803
|
const entries = Array.isArray(raw2) ? raw2 : raw2 ? [raw2] : [];
|
|
@@ -115204,10 +115326,6 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
115204
115326
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
115205
115327
|
return true;
|
|
115206
115328
|
}
|
|
115207
|
-
/** The text of a package part, or `undefined` when the package has no such part. */
|
|
115208
|
-
async readPartText(path4) {
|
|
115209
|
-
return this.zip.file(path4)?.async("string");
|
|
115210
|
-
}
|
|
115211
115329
|
/**
|
|
115212
115330
|
* Parse extended (application) properties from `docProps/app.xml`.
|
|
115213
115331
|
*/
|
|
@@ -115268,8 +115386,10 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
115268
115386
|
if (!relsFile) {
|
|
115269
115387
|
return [];
|
|
115270
115388
|
}
|
|
115271
|
-
const
|
|
115272
|
-
|
|
115389
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
115390
|
+
if (!relsData) {
|
|
115391
|
+
return [];
|
|
115392
|
+
}
|
|
115273
115393
|
const relRoot = relsData["Relationships"] || {};
|
|
115274
115394
|
const relationships3 = this.ensureArray(relRoot["Relationship"]);
|
|
115275
115395
|
const relMap = /* @__PURE__ */ new Map();
|
|
@@ -115300,7 +115420,7 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
115300
115420
|
try {
|
|
115301
115421
|
const file = this.zip.file(resolvedPath);
|
|
115302
115422
|
if (file) {
|
|
115303
|
-
data = await
|
|
115423
|
+
data = await this.readPartText(resolvedPath);
|
|
115304
115424
|
}
|
|
115305
115425
|
} catch {
|
|
115306
115426
|
}
|
|
@@ -115380,9 +115500,7 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
115380
115500
|
*/
|
|
115381
115501
|
async parseTags() {
|
|
115382
115502
|
try {
|
|
115383
|
-
return await discoverTagCollections(this.zip,
|
|
115384
|
-
parse: (xml) => this.parser.parse(xml)
|
|
115385
|
-
});
|
|
115503
|
+
return await discoverTagCollections(this.zip, this.parser);
|
|
115386
115504
|
} catch (e) {
|
|
115387
115505
|
console.warn("Failed to parse tags:", e);
|
|
115388
115506
|
return [];
|
|
@@ -115522,7 +115640,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
115522
115640
|
}
|
|
115523
115641
|
for (const file of masterFiles) {
|
|
115524
115642
|
const path4 = file.name;
|
|
115525
|
-
const xml = await
|
|
115643
|
+
const xml = await this.readPartText(path4) ?? "";
|
|
115526
115644
|
const data = this.parser.parse(xml);
|
|
115527
115645
|
const sldMaster = data?.["p:sldMaster"];
|
|
115528
115646
|
if (!sldMaster) {
|
|
@@ -115547,8 +115665,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
115547
115665
|
);
|
|
115548
115666
|
const relsFile = this.zip.file(relsPath2);
|
|
115549
115667
|
if (relsFile) {
|
|
115550
|
-
const
|
|
115551
|
-
const relsData = this.parser.parse(relsXml);
|
|
115668
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
115552
115669
|
const rels = this.ensureArray(
|
|
115553
115670
|
xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
115554
115671
|
);
|
|
@@ -115562,8 +115679,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
115562
115679
|
}
|
|
115563
115680
|
const layoutPaths = [];
|
|
115564
115681
|
if (relsFile) {
|
|
115565
|
-
const
|
|
115566
|
-
const relsData = this.parser.parse(relsXml);
|
|
115682
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
115567
115683
|
const rels = this.ensureArray(
|
|
115568
115684
|
xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
115569
115685
|
);
|
|
@@ -115607,7 +115723,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
115607
115723
|
return void 0;
|
|
115608
115724
|
}
|
|
115609
115725
|
const path4 = files[0].name;
|
|
115610
|
-
const xml = await
|
|
115726
|
+
const xml = await this.readPartText(path4) ?? "";
|
|
115611
115727
|
const data = this.parser.parse(xml);
|
|
115612
115728
|
const master = data?.["p:handoutMaster"];
|
|
115613
115729
|
if (!master) {
|
|
@@ -115639,7 +115755,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
115639
115755
|
return void 0;
|
|
115640
115756
|
}
|
|
115641
115757
|
const path4 = files[0].name;
|
|
115642
|
-
const xml = await
|
|
115758
|
+
const xml = await this.readPartText(path4) ?? "";
|
|
115643
115759
|
const data = this.parser.parse(xml);
|
|
115644
115760
|
const master = data?.["p:notesMaster"];
|
|
115645
115761
|
if (!master) {
|
|
@@ -115670,7 +115786,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
115670
115786
|
if (!layoutFile) {
|
|
115671
115787
|
return void 0;
|
|
115672
115788
|
}
|
|
115673
|
-
const xml = await
|
|
115789
|
+
const xml = await this.readPartText(layoutPath) ?? "";
|
|
115674
115790
|
const data = this.parser.parse(xml);
|
|
115675
115791
|
const sldLayout = data?.["p:sldLayout"];
|
|
115676
115792
|
if (!sldLayout) {
|
|
@@ -115778,18 +115894,19 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
115778
115894
|
*/
|
|
115779
115895
|
async parsePresentationProperties() {
|
|
115780
115896
|
try {
|
|
115781
|
-
const
|
|
115782
|
-
if (!
|
|
115897
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
115898
|
+
if (!relsData) {
|
|
115783
115899
|
return void 0;
|
|
115784
115900
|
}
|
|
115785
|
-
const
|
|
115786
|
-
|
|
115901
|
+
const rels = this.ensureArray(
|
|
115902
|
+
relsData.Relationships?.Relationship
|
|
115903
|
+
);
|
|
115787
115904
|
const prRel = rels.find(
|
|
115788
115905
|
(r) => String(r?.["@_Type"] || "").includes("presProps") || String(r?.["@_Target"] || "").includes("presProps")
|
|
115789
115906
|
);
|
|
115790
115907
|
const prTarget = prRel ? String(prRel["@_Target"] || "") : "presProps.xml";
|
|
115791
115908
|
const prPath = prTarget.startsWith("/") ? prTarget.substring(1) : `ppt/${prTarget}`;
|
|
115792
|
-
const prXmlStr = await this.
|
|
115909
|
+
const prXmlStr = await this.readPartText(prPath);
|
|
115793
115910
|
if (!prXmlStr) {
|
|
115794
115911
|
return void 0;
|
|
115795
115912
|
}
|
|
@@ -115835,7 +115952,7 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
115835
115952
|
*/
|
|
115836
115953
|
async parseViewProperties() {
|
|
115837
115954
|
try {
|
|
115838
|
-
const viewPropsXml2 = await this.
|
|
115955
|
+
const viewPropsXml2 = await this.readPartText("ppt/viewProps.xml");
|
|
115839
115956
|
if (!viewPropsXml2) {
|
|
115840
115957
|
return void 0;
|
|
115841
115958
|
}
|
|
@@ -120299,7 +120416,7 @@ var init_PptxHandlerRuntimeChartUserShapes = __esm({
|
|
|
120299
120416
|
if (existingRel?.target) {
|
|
120300
120417
|
drawingPath = this.resolveImagePath(chartPartPath, existingRel.target);
|
|
120301
120418
|
try {
|
|
120302
|
-
const xml = await this.
|
|
120419
|
+
const xml = await this.readPartText(drawingPath);
|
|
120303
120420
|
if (xml) {
|
|
120304
120421
|
const root = this.parser.parse(xml);
|
|
120305
120422
|
onDisk = parseChartUserShapesDrawing(root, this.xmlLookupService, {
|
|
@@ -120350,11 +120467,10 @@ var init_PptxHandlerRuntimeChartUserShapes = __esm({
|
|
|
120350
120467
|
const slash = chartPartPath.lastIndexOf("/");
|
|
120351
120468
|
const relsPath2 = `${chartPartPath.slice(0, slash + 1)}_rels/${chartPartPath.slice(slash + 1)}.rels`;
|
|
120352
120469
|
try {
|
|
120353
|
-
const
|
|
120354
|
-
if (!
|
|
120470
|
+
const tree = await this.readPartXml(relsPath2);
|
|
120471
|
+
if (!tree) {
|
|
120355
120472
|
return void 0;
|
|
120356
120473
|
}
|
|
120357
|
-
const tree = this.parser.parse(xml);
|
|
120358
120474
|
const root = tree["Relationships"];
|
|
120359
120475
|
const rels = root?.["Relationship"];
|
|
120360
120476
|
const list3 = rels === void 0 ? [] : Array.isArray(rels) ? rels : [rels];
|
|
@@ -135730,7 +135846,7 @@ var init_PptxHandlerRuntimeSlideParsing = __esm({
|
|
|
135730
135846
|
this.unwrapAlternateContent(spTree);
|
|
135731
135847
|
let rawXmlStr;
|
|
135732
135848
|
try {
|
|
135733
|
-
rawXmlStr = await this.
|
|
135849
|
+
rawXmlStr = await this.readPartText(slidePath);
|
|
135734
135850
|
} catch {
|
|
135735
135851
|
}
|
|
135736
135852
|
const slidePrefix = slidePath ? `${slidePath}-` : "";
|
|
@@ -136299,7 +136415,7 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
136299
136415
|
if (cached) {
|
|
136300
136416
|
return cached;
|
|
136301
136417
|
}
|
|
136302
|
-
const xml = await this.
|
|
136418
|
+
const xml = await this.readPartText(layoutPath);
|
|
136303
136419
|
if (!xml) {
|
|
136304
136420
|
return void 0;
|
|
136305
136421
|
}
|
|
@@ -136313,7 +136429,7 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
136313
136429
|
if (cached) {
|
|
136314
136430
|
return cached;
|
|
136315
136431
|
}
|
|
136316
|
-
const xml = await this.
|
|
136432
|
+
const xml = await this.readPartText(masterPath);
|
|
136317
136433
|
if (!xml) {
|
|
136318
136434
|
return void 0;
|
|
136319
136435
|
}
|
|
@@ -136773,7 +136889,7 @@ var init_PptxHandlerRuntimeSlideUtils = __esm({
|
|
|
136773
136889
|
if (!notesPath) {
|
|
136774
136890
|
return {};
|
|
136775
136891
|
}
|
|
136776
|
-
const notesXml = await this.
|
|
136892
|
+
const notesXml = await this.readPartText(notesPath);
|
|
136777
136893
|
if (!notesXml) {
|
|
136778
136894
|
return {};
|
|
136779
136895
|
}
|
|
@@ -137272,7 +137388,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
137272
137388
|
try {
|
|
137273
137389
|
let masterXmlObj = this.masterXmlMap.get(master.path);
|
|
137274
137390
|
if (!masterXmlObj) {
|
|
137275
|
-
const xmlStr = await this.
|
|
137391
|
+
const xmlStr = await this.readPartText(master.path);
|
|
137276
137392
|
if (!xmlStr) {
|
|
137277
137393
|
continue;
|
|
137278
137394
|
}
|
|
@@ -137345,7 +137461,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
137345
137461
|
}
|
|
137346
137462
|
const masterToken = masterPath.split("/").pop()?.replace(/\.xml$/u, "") ?? masterPath;
|
|
137347
137463
|
try {
|
|
137348
|
-
const masterXmlStr = await this.
|
|
137464
|
+
const masterXmlStr = await this.readPartText(masterPath);
|
|
137349
137465
|
if (!masterXmlStr) {
|
|
137350
137466
|
return [];
|
|
137351
137467
|
}
|
|
@@ -137507,7 +137623,7 @@ var init_PptxHandlerRuntimeAuxiliaryMasterElements = __esm({
|
|
|
137507
137623
|
}
|
|
137508
137624
|
const partPath = part.path;
|
|
137509
137625
|
rememberMasterPartBackground(this, partPath, part.backgroundColor);
|
|
137510
|
-
const xml = await this.
|
|
137626
|
+
const xml = await this.readPartText(partPath);
|
|
137511
137627
|
if (!xml) {
|
|
137512
137628
|
return;
|
|
137513
137629
|
}
|
|
@@ -137667,7 +137783,7 @@ var init_PptxHandlerRuntimeLayoutElements = __esm({
|
|
|
137667
137783
|
}
|
|
137668
137784
|
const layoutToken = layoutPath.split("/").pop()?.replace(/\.xml$/u, "") ?? layoutPath;
|
|
137669
137785
|
try {
|
|
137670
|
-
const layoutXmlStr = await this.
|
|
137786
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
137671
137787
|
if (!layoutXmlStr) {
|
|
137672
137788
|
return [];
|
|
137673
137789
|
}
|
|
@@ -138401,7 +138517,7 @@ var init_PptxHandlerRuntimeThemeOverrides = __esm({
|
|
|
138401
138517
|
return cached;
|
|
138402
138518
|
}
|
|
138403
138519
|
try {
|
|
138404
|
-
const overrideXml = await this.
|
|
138520
|
+
const overrideXml = await this.readPartText(overridePath);
|
|
138405
138521
|
if (!overrideXml) {
|
|
138406
138522
|
return null;
|
|
138407
138523
|
}
|
|
@@ -139030,10 +139146,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
139030
139146
|
if (!relsXml) {
|
|
139031
139147
|
return void 0;
|
|
139032
139148
|
}
|
|
139033
|
-
const relsData = this.
|
|
139034
|
-
// eslint-disable-next-line no-await-in-loop
|
|
139035
|
-
await relsXml.async("string")
|
|
139036
|
-
);
|
|
139149
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
139037
139150
|
const relNodes = this.ensureArray(
|
|
139038
139151
|
relsData?.Relationships?.Relationship
|
|
139039
139152
|
);
|
|
@@ -139059,7 +139172,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
139059
139172
|
const options = [];
|
|
139060
139173
|
for (const file of themeFiles) {
|
|
139061
139174
|
try {
|
|
139062
|
-
const xml = await file.
|
|
139175
|
+
const xml = await this.readPartText(file.name) ?? "";
|
|
139063
139176
|
const data = this.parser.parse(xml);
|
|
139064
139177
|
const root = data["a:theme"];
|
|
139065
139178
|
const name = String(root?.["@_name"] || "").trim();
|
|
@@ -139139,7 +139252,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
139139
139252
|
];
|
|
139140
139253
|
for (const file of masterFiles) {
|
|
139141
139254
|
try {
|
|
139142
|
-
const masterXml = await file.
|
|
139255
|
+
const masterXml = await this.readPartText(file.name) ?? "";
|
|
139143
139256
|
const masterData = this.parser.parse(masterXml);
|
|
139144
139257
|
const clrMap = masterData?.["p:sldMaster"]?.["p:clrMap"];
|
|
139145
139258
|
if (!clrMap) {
|
|
@@ -139172,7 +139285,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
139172
139285
|
if (!themeFile) {
|
|
139173
139286
|
return null;
|
|
139174
139287
|
}
|
|
139175
|
-
const themeXml3 = await
|
|
139288
|
+
const themeXml3 = await this.readPartText(themePath) ?? "";
|
|
139176
139289
|
const model = this.parseThemePartXml(themeXml3);
|
|
139177
139290
|
this.cacheThemePartModel(themePath, themeXml3, model);
|
|
139178
139291
|
return { colorMap: model.colorMap, fontMap: model.fontMap, formatScheme: model.formatScheme };
|
|
@@ -139207,7 +139320,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
139207
139320
|
if (!relsXml) {
|
|
139208
139321
|
return void 0;
|
|
139209
139322
|
}
|
|
139210
|
-
const relsData =
|
|
139323
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
139211
139324
|
const relNodes = this.ensureArray(
|
|
139212
139325
|
relsData?.Relationships?.Relationship
|
|
139213
139326
|
);
|
|
@@ -139536,11 +139649,10 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139536
139649
|
async extractModernSlideComments(slidePath) {
|
|
139537
139650
|
try {
|
|
139538
139651
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
139539
|
-
const
|
|
139540
|
-
if (!
|
|
139652
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
139653
|
+
if (!relsData) {
|
|
139541
139654
|
return [];
|
|
139542
139655
|
}
|
|
139543
|
-
const relsData = this.parser.parse(relsXml);
|
|
139544
139656
|
const rels = this.ensureArray(
|
|
139545
139657
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
139546
139658
|
);
|
|
@@ -139557,7 +139669,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139557
139669
|
continue;
|
|
139558
139670
|
}
|
|
139559
139671
|
const filePath = this.resolvePath(slidePath, target);
|
|
139560
|
-
const xml = await this.
|
|
139672
|
+
const xml = await this.readPartText(filePath);
|
|
139561
139673
|
if (!xml) {
|
|
139562
139674
|
continue;
|
|
139563
139675
|
}
|
|
@@ -139580,11 +139692,10 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139580
139692
|
return [];
|
|
139581
139693
|
}
|
|
139582
139694
|
async loadModernCommentAuthors() {
|
|
139583
|
-
const
|
|
139584
|
-
if (!
|
|
139695
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
139696
|
+
if (!relsData) {
|
|
139585
139697
|
return;
|
|
139586
139698
|
}
|
|
139587
|
-
const relsData = this.parser.parse(relsXml);
|
|
139588
139699
|
const relationships3 = this.ensureArray(
|
|
139589
139700
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
139590
139701
|
);
|
|
@@ -139596,7 +139707,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139596
139707
|
return;
|
|
139597
139708
|
}
|
|
139598
139709
|
const partPath = this.resolvePath("ppt/presentation.xml", target);
|
|
139599
|
-
const xml = await this.
|
|
139710
|
+
const xml = await this.readPartText(partPath);
|
|
139600
139711
|
if (!xml) {
|
|
139601
139712
|
return;
|
|
139602
139713
|
}
|
|
@@ -139622,12 +139733,12 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139622
139733
|
}
|
|
139623
139734
|
}
|
|
139624
139735
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
139625
|
-
const relsXml = await this.
|
|
139736
|
+
const relsXml = await this.readPartText(relsPath2);
|
|
139626
139737
|
if (!relsXml) {
|
|
139627
139738
|
return void 0;
|
|
139628
139739
|
}
|
|
139629
139740
|
try {
|
|
139630
|
-
const relsData = this.
|
|
139741
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
139631
139742
|
const rels = this.ensureArray(
|
|
139632
139743
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
139633
139744
|
);
|
|
@@ -139666,7 +139777,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139666
139777
|
return [];
|
|
139667
139778
|
}
|
|
139668
139779
|
const commentsPath = this.resolveImagePath(slidePath, commentTarget);
|
|
139669
|
-
const commentsXml = await this.
|
|
139780
|
+
const commentsXml = await this.readPartText(commentsPath);
|
|
139670
139781
|
if (!commentsXml) {
|
|
139671
139782
|
return [];
|
|
139672
139783
|
}
|
|
@@ -139701,7 +139812,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
139701
139812
|
}
|
|
139702
139813
|
}
|
|
139703
139814
|
async loadCommentAuthors() {
|
|
139704
|
-
const commentAuthorsXml = await this.
|
|
139815
|
+
const commentAuthorsXml = await this.readPartText("ppt/commentAuthors.xml");
|
|
139705
139816
|
if (!commentAuthorsXml) {
|
|
139706
139817
|
return;
|
|
139707
139818
|
}
|
|
@@ -139773,7 +139884,7 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
139773
139884
|
return void 0;
|
|
139774
139885
|
}
|
|
139775
139886
|
const partPath = this.resolveImagePath(slidePath, target);
|
|
139776
|
-
const xmlString = await this.
|
|
139887
|
+
const xmlString = await this.readPartText(partPath);
|
|
139777
139888
|
if (!xmlString) {
|
|
139778
139889
|
return void 0;
|
|
139779
139890
|
}
|
|
@@ -141488,9 +141599,8 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
141488
141599
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
141489
141600
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
141490
141601
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
141491
|
-
const
|
|
141492
|
-
if (
|
|
141493
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
141602
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
141603
|
+
if (chartRelsData) {
|
|
141494
141604
|
const relsContainer = chartRelsData?.Relationships;
|
|
141495
141605
|
if (relsContainer?.Relationship) {
|
|
141496
141606
|
const rels = Array.isArray(relsContainer.Relationship) ? relsContainer.Relationship : [relsContainer.Relationship];
|
|
@@ -141572,7 +141682,7 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
141572
141682
|
if (drawingPath.length === 0) {
|
|
141573
141683
|
return void 0;
|
|
141574
141684
|
}
|
|
141575
|
-
const drawingXml = await this.
|
|
141685
|
+
const drawingXml = await this.readPartText(drawingPath);
|
|
141576
141686
|
if (!drawingXml) {
|
|
141577
141687
|
return void 0;
|
|
141578
141688
|
}
|
|
@@ -141593,11 +141703,10 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
141593
141703
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
141594
141704
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
141595
141705
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
141596
|
-
const
|
|
141597
|
-
if (!
|
|
141706
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
141707
|
+
if (!chartRelsData) {
|
|
141598
141708
|
return [];
|
|
141599
141709
|
}
|
|
141600
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
141601
141710
|
const relsContainer = chartRelsData?.Relationships;
|
|
141602
141711
|
if (!relsContainer?.Relationship) {
|
|
141603
141712
|
return [];
|
|
@@ -142489,11 +142598,10 @@ var init_PptxHandlerRuntimeEmbeddedFonts = __esm({
|
|
|
142489
142598
|
async loadPresentationFontRels() {
|
|
142490
142599
|
const map = /* @__PURE__ */ new Map();
|
|
142491
142600
|
try {
|
|
142492
|
-
const
|
|
142493
|
-
if (!
|
|
142601
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
142602
|
+
if (!relsData) {
|
|
142494
142603
|
return map;
|
|
142495
142604
|
}
|
|
142496
|
-
const relsData = this.parser.parse(relsXml);
|
|
142497
142605
|
const rels = this.ensureArray(
|
|
142498
142606
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
142499
142607
|
);
|
|
@@ -142814,13 +142922,13 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
142814
142922
|
if (!file) {
|
|
142815
142923
|
continue;
|
|
142816
142924
|
}
|
|
142817
|
-
const data = await
|
|
142925
|
+
const data = await this.readPartText(entry2) ?? "";
|
|
142818
142926
|
const propsPath = `customXml/itemProps${itemId}.xml`;
|
|
142819
142927
|
const propsFile = this.zip.file(propsPath);
|
|
142820
142928
|
let properties;
|
|
142821
142929
|
let schemaUri;
|
|
142822
142930
|
if (propsFile) {
|
|
142823
|
-
properties = await
|
|
142931
|
+
properties = await this.readPartText(propsPath) ?? "";
|
|
142824
142932
|
try {
|
|
142825
142933
|
const propsData = this.parser.parse(properties);
|
|
142826
142934
|
const schemaRefs = propsData?.["ds:datastoreItem"]?.["ds:schemaRefs"]?.["ds:schemaRef"];
|
|
@@ -142840,14 +142948,14 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
142840
142948
|
const relsFile = this.zip.file(relsPath2);
|
|
142841
142949
|
let rels;
|
|
142842
142950
|
if (relsFile) {
|
|
142843
|
-
rels = await
|
|
142951
|
+
rels = await this.readPartText(relsPath2);
|
|
142844
142952
|
}
|
|
142845
142953
|
parts.push({ id: itemId, data, schemaUri, properties, rels });
|
|
142846
142954
|
}
|
|
142847
142955
|
this.customXmlParts = parts;
|
|
142848
142956
|
}
|
|
142849
142957
|
async loadPresentationState() {
|
|
142850
|
-
const presentationXml3 = await this.
|
|
142958
|
+
const presentationXml3 = await this.readPartText("ppt/presentation.xml");
|
|
142851
142959
|
if (!presentationXml3) {
|
|
142852
142960
|
throw new Error("Invalid PPTX: presentation.xml not found");
|
|
142853
142961
|
}
|
|
@@ -143199,6 +143307,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
143199
143307
|
* or resolve images. Create a new `PptxHandler` instance instead.
|
|
143200
143308
|
*/
|
|
143201
143309
|
dispose() {
|
|
143310
|
+
this.endPartReads();
|
|
143202
143311
|
this.revokeBlobUrls();
|
|
143203
143312
|
this.imageDataCache.clear();
|
|
143204
143313
|
this.slideMap.clear();
|
|
@@ -143232,18 +143341,24 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
143232
143341
|
this.zip = null;
|
|
143233
143342
|
}
|
|
143234
143343
|
async load(data, options = {}) {
|
|
143235
|
-
|
|
143236
|
-
|
|
143237
|
-
|
|
143238
|
-
|
|
143239
|
-
|
|
143240
|
-
|
|
143241
|
-
|
|
143242
|
-
|
|
143243
|
-
|
|
143244
|
-
|
|
143245
|
-
|
|
143246
|
-
|
|
143344
|
+
let reader2;
|
|
143345
|
+
try {
|
|
143346
|
+
await this.initializeLoadSession(data, options);
|
|
143347
|
+
reader2 = this.beginPartReads();
|
|
143348
|
+
await this.detectAndPreserveVbaProject();
|
|
143349
|
+
this.detectDigitalSignatureParts();
|
|
143350
|
+
await this.parseCustomXmlParts();
|
|
143351
|
+
const presentationState = await this.loadPresentationState();
|
|
143352
|
+
const slideMasters = await this.parseSlideMasters();
|
|
143353
|
+
await this.enrichSlideMastersWithTxStyles(slideMasters);
|
|
143354
|
+
const slides = await this.loadSlidesForPresentation(presentationState.sectionBySlideId);
|
|
143355
|
+
const slidesWithWarnings = this.attachSlideWarnings(slides);
|
|
143356
|
+
this.resetElementIdCounter(slides);
|
|
143357
|
+
recordSlideFingerprints(this.savedSlideFingerprints, slidesWithWarnings);
|
|
143358
|
+
return await this.buildLoadData(presentationState, slidesWithWarnings, slideMasters);
|
|
143359
|
+
} finally {
|
|
143360
|
+
this.endPartReads(reader2);
|
|
143361
|
+
}
|
|
143247
143362
|
}
|
|
143248
143363
|
/**
|
|
143249
143364
|
* Retrieve the current background colour for a layout or master.
|
|
@@ -143382,7 +143497,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
143382
143497
|
options.push(this.buildLayoutOption(lp, xmlObj));
|
|
143383
143498
|
} else {
|
|
143384
143499
|
try {
|
|
143385
|
-
const layoutXmlStr = await this.
|
|
143500
|
+
const layoutXmlStr = await this.readPartText(lp);
|
|
143386
143501
|
if (layoutXmlStr) {
|
|
143387
143502
|
const layoutXmlObj = this.parser.parse(layoutXmlStr);
|
|
143388
143503
|
this.layoutXmlMap.set(lp, layoutXmlObj);
|
|
@@ -143425,7 +143540,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
143425
143540
|
}
|
|
143426
143541
|
let layoutXml3 = this.layoutXmlMap.get(layoutPath);
|
|
143427
143542
|
if (!layoutXml3) {
|
|
143428
|
-
const layoutXmlStr = await this.
|
|
143543
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
143429
143544
|
if (!layoutXmlStr) {
|
|
143430
143545
|
throw new Error(`Layout not found: ${layoutPath}`);
|
|
143431
143546
|
}
|