ooxml-core 1.26.1 → 1.27.1
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-AILFLRH7.cjs → PptxHandler-NHOKKZ4S.cjs} +3 -3
- package/dist/{PptxHandler-64BZOBWX.mjs → PptxHandler-OIR3ZY4Q.mjs} +2 -2
- package/dist/PptxHandler-TZJNIXPX.mjs +4 -0
- package/dist/{PresentationBuilder-RBQP6A37.cjs → PresentationBuilder-EX6DAE5X.cjs} +5 -5
- package/dist/{PresentationBuilder-EJY2TYWL.mjs → PresentationBuilder-RFTSZUPR.mjs} +2 -2
- package/dist/{PresentationBuilder-HBCCO2CF.mjs → PresentationBuilder-X5WFSHLB.mjs} +2 -2
- package/dist/{chunk-MU3XSASV.cjs → chunk-36TR3PER.cjs} +270 -13
- package/dist/{chunk-FZBAMWCJ.mjs → chunk-5KJAQKZG.mjs} +62 -275
- package/dist/{chunk-R7RL7W43.mjs → chunk-5NJPYCGO.mjs} +271 -17
- package/dist/{chunk-OQPT5IC3.mjs → chunk-BXZF7H5G.mjs} +4 -4
- package/dist/{chunk-NXTHB2M3.cjs → chunk-DMJIDRJE.cjs} +1139 -1352
- package/dist/{chunk-OTXJVFMY.mjs → chunk-GZ4DIXZZ.mjs} +62 -275
- package/dist/{chunk-2XMK5SXU.mjs → chunk-I57SMSU6.mjs} +268 -14
- package/dist/{chunk-WRFMS5CL.mjs → chunk-QIMNQDON.mjs} +1 -1
- package/dist/{chunk-DHAZSMC7.mjs → chunk-ZWTXVWMY.mjs} +1 -1
- package/dist/pptx/automation/index.cjs +352 -311
- package/dist/pptx/automation/index.d.ts +1 -1
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/index-D8DNpc1X.d.ts.map +1 -1
- package/dist/pptx/chunks/{index-CbFowkp4.d.ts → index-GWpMAY-f.d.ts} +16 -3
- package/dist/pptx/chunks/index-GWpMAY-f.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +352 -311
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/index.cjs +354 -311
- package/dist/pptx/index.d.ts +2 -2
- package/dist/pptx/index.mjs +5 -5
- package/package.json +1 -1
- package/dist/PptxHandler-PMLQGMFQ.mjs +0 -4
- package/dist/pptx/chunks/index-CbFowkp4.d.ts.map +0 -1
package/dist/pptx/index.cjs
CHANGED
|
@@ -71221,6 +71221,272 @@ var init_chart_data_sheet = __esm({
|
|
|
71221
71221
|
}
|
|
71222
71222
|
});
|
|
71223
71223
|
|
|
71224
|
+
// pptx/core/utils/modern-comment-mention-read.ts
|
|
71225
|
+
function readCommentMentions(node, authorName) {
|
|
71226
|
+
if (!node) {
|
|
71227
|
+
return void 0;
|
|
71228
|
+
}
|
|
71229
|
+
const found = [];
|
|
71230
|
+
for (const list3 of mentionChildrenNamed(node, "mentionLst")) {
|
|
71231
|
+
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
71232
|
+
const mention = readMention(entry2, authorName);
|
|
71233
|
+
if (mention) {
|
|
71234
|
+
found.push(mention);
|
|
71235
|
+
}
|
|
71236
|
+
}
|
|
71237
|
+
}
|
|
71238
|
+
for (const extension of mentionChildrenNamed(mentionChildrenNamed(node, "extLst")[0], "ext")) {
|
|
71239
|
+
const uri = String(extension["@_uri"] || "");
|
|
71240
|
+
for (const list3 of mentionChildrenNamed(extension, "mentionLst")) {
|
|
71241
|
+
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
71242
|
+
const mention = readMention(entry2, authorName, uri);
|
|
71243
|
+
if (mention) {
|
|
71244
|
+
found.push(mention);
|
|
71245
|
+
}
|
|
71246
|
+
}
|
|
71247
|
+
}
|
|
71248
|
+
}
|
|
71249
|
+
found.sort((a, b) => a.startIndex - b.startIndex);
|
|
71250
|
+
return found.length > 0 ? found : void 0;
|
|
71251
|
+
}
|
|
71252
|
+
var mentionLocalName, mentionNodesOf, mentionChildrenNamed, MENTION_PERSON_KEYS, MENTION_LENGTH_KEYS, attribute5, integer2, readMention;
|
|
71253
|
+
var init_modern_comment_mention_read = __esm({
|
|
71254
|
+
"pptx/core/utils/modern-comment-mention-read.ts"() {
|
|
71255
|
+
mentionLocalName = (key2) => key2.split(":").pop() || key2;
|
|
71256
|
+
mentionNodesOf = (value) => {
|
|
71257
|
+
if (Array.isArray(value)) {
|
|
71258
|
+
return value.filter((entry2) => Boolean(entry2) && typeof entry2 === "object");
|
|
71259
|
+
}
|
|
71260
|
+
return value && typeof value === "object" ? [value] : [];
|
|
71261
|
+
};
|
|
71262
|
+
mentionChildrenNamed = (node, name) => {
|
|
71263
|
+
if (!node) {
|
|
71264
|
+
return [];
|
|
71265
|
+
}
|
|
71266
|
+
const result = [];
|
|
71267
|
+
for (const [key2, value] of Object.entries(node)) {
|
|
71268
|
+
if (!key2.startsWith("@_") && mentionLocalName(key2) === name) {
|
|
71269
|
+
result.push(...mentionNodesOf(value));
|
|
71270
|
+
}
|
|
71271
|
+
}
|
|
71272
|
+
return result;
|
|
71273
|
+
};
|
|
71274
|
+
MENTION_PERSON_KEYS = [
|
|
71275
|
+
"@_mentionpersonId",
|
|
71276
|
+
"@_mentionPersonId",
|
|
71277
|
+
"@_personId",
|
|
71278
|
+
"@_authorId"
|
|
71279
|
+
];
|
|
71280
|
+
MENTION_LENGTH_KEYS = ["@_length", "@_mentionCharCount", "@_len"];
|
|
71281
|
+
attribute5 = (node, keys) => {
|
|
71282
|
+
for (const key2 of keys) {
|
|
71283
|
+
const value = node[key2];
|
|
71284
|
+
if (value !== void 0 && value !== null && String(value).length > 0) {
|
|
71285
|
+
return String(value);
|
|
71286
|
+
}
|
|
71287
|
+
}
|
|
71288
|
+
return void 0;
|
|
71289
|
+
};
|
|
71290
|
+
integer2 = (value) => {
|
|
71291
|
+
if (value === void 0) {
|
|
71292
|
+
return void 0;
|
|
71293
|
+
}
|
|
71294
|
+
const parsed = Number.parseInt(value, 10);
|
|
71295
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : void 0;
|
|
71296
|
+
};
|
|
71297
|
+
readMention = (node, authorName, containerUri) => {
|
|
71298
|
+
const personId = attribute5(node, MENTION_PERSON_KEYS);
|
|
71299
|
+
const startIndex = integer2(attribute5(node, ["@_startIndex"]));
|
|
71300
|
+
const length = integer2(attribute5(node, MENTION_LENGTH_KEYS));
|
|
71301
|
+
if (!personId || startIndex === void 0 || length === void 0 || length === 0) {
|
|
71302
|
+
return void 0;
|
|
71303
|
+
}
|
|
71304
|
+
return {
|
|
71305
|
+
personId,
|
|
71306
|
+
startIndex,
|
|
71307
|
+
length,
|
|
71308
|
+
id: attribute5(node, ["@_mentionId", "@_id"]),
|
|
71309
|
+
authorName: authorName(personId),
|
|
71310
|
+
containerUri,
|
|
71311
|
+
rawXml: node
|
|
71312
|
+
};
|
|
71313
|
+
};
|
|
71314
|
+
}
|
|
71315
|
+
});
|
|
71316
|
+
|
|
71317
|
+
// pptx/core/utils/modern-comment-mentions.ts
|
|
71318
|
+
function rebaseCommentMentions(mentions, oldText, newText, loaded) {
|
|
71319
|
+
if (!mentions || mentions.length === 0) {
|
|
71320
|
+
return void 0;
|
|
71321
|
+
}
|
|
71322
|
+
if (oldText === newText) {
|
|
71323
|
+
return mentions;
|
|
71324
|
+
}
|
|
71325
|
+
const prefix = commonPrefixLength(oldText, newText);
|
|
71326
|
+
const suffix = commonSuffixLength(
|
|
71327
|
+
oldText,
|
|
71328
|
+
newText,
|
|
71329
|
+
Math.min(oldText.length, newText.length) - prefix
|
|
71330
|
+
);
|
|
71331
|
+
const changeEnd = oldText.length - suffix;
|
|
71332
|
+
const delta2 = newText.length - oldText.length;
|
|
71333
|
+
const result = [];
|
|
71334
|
+
for (const mention of mentions) {
|
|
71335
|
+
const start = mention.startIndex;
|
|
71336
|
+
const end = start + mention.length;
|
|
71337
|
+
const coverage = loaded ? loadedCoverage(mention, loaded, oldText) : [];
|
|
71338
|
+
if (coverage === void 0 || coverage.includes(newText.slice(start, end))) {
|
|
71339
|
+
if (start >= 0 && mention.length > 0 && end <= newText.length) {
|
|
71340
|
+
result.push(mention);
|
|
71341
|
+
}
|
|
71342
|
+
continue;
|
|
71343
|
+
}
|
|
71344
|
+
const span = oldText.slice(start, end);
|
|
71345
|
+
if (span.length !== mention.length) {
|
|
71346
|
+
continue;
|
|
71347
|
+
}
|
|
71348
|
+
let next = -1;
|
|
71349
|
+
if (end <= prefix) {
|
|
71350
|
+
next = start;
|
|
71351
|
+
} else if (start >= changeEnd) {
|
|
71352
|
+
next = start + delta2;
|
|
71353
|
+
}
|
|
71354
|
+
if (next >= 0 && newText.slice(next, next + mention.length) === span) {
|
|
71355
|
+
result.push(next === start ? mention : { ...mention, startIndex: next });
|
|
71356
|
+
continue;
|
|
71357
|
+
}
|
|
71358
|
+
const relocated = nearestOccurrence(newText, span, next >= 0 ? next : start);
|
|
71359
|
+
if (relocated >= 0) {
|
|
71360
|
+
result.push({ ...mention, startIndex: relocated });
|
|
71361
|
+
}
|
|
71362
|
+
}
|
|
71363
|
+
return result.length > 0 ? result : void 0;
|
|
71364
|
+
}
|
|
71365
|
+
function buildMentionListNode(mentions) {
|
|
71366
|
+
if (!mentions || mentions.length === 0) {
|
|
71367
|
+
return void 0;
|
|
71368
|
+
}
|
|
71369
|
+
return { "p188:mention": mentions.map(buildMention) };
|
|
71370
|
+
}
|
|
71371
|
+
function applyCommentMentions(node, mentions, extension, replace) {
|
|
71372
|
+
if (!replace) {
|
|
71373
|
+
return extension;
|
|
71374
|
+
}
|
|
71375
|
+
const { direct, byUri } = groupByContainer(mentions);
|
|
71376
|
+
const directList = buildMentionListNode(direct);
|
|
71377
|
+
if (directList) {
|
|
71378
|
+
node["p188:mentionLst"] = directList;
|
|
71379
|
+
}
|
|
71380
|
+
if (!extension) {
|
|
71381
|
+
return void 0;
|
|
71382
|
+
}
|
|
71383
|
+
const rebuilt = stripMentionLists(extension);
|
|
71384
|
+
const extensionKey = Object.keys(rebuilt).find((key2) => mentionLocalName(key2) === "ext") || "p188:ext";
|
|
71385
|
+
const entries = mentionNodesOf(rebuilt[extensionKey]).map((entry2) => {
|
|
71386
|
+
const list3 = buildMentionListNode(byUri.get(String(entry2["@_uri"] || "")));
|
|
71387
|
+
const next = stripMentionLists(entry2);
|
|
71388
|
+
if (list3) {
|
|
71389
|
+
next["p188:mentionLst"] = list3;
|
|
71390
|
+
}
|
|
71391
|
+
return next;
|
|
71392
|
+
});
|
|
71393
|
+
if (entries.length > 0) {
|
|
71394
|
+
rebuilt[extensionKey] = entries.length === 1 ? entries[0] : entries;
|
|
71395
|
+
}
|
|
71396
|
+
return rebuilt;
|
|
71397
|
+
}
|
|
71398
|
+
var commonPrefixLength, commonSuffixLength, nearestOccurrence, loadedCoverage, buildMention, stripMentionLists, groupByContainer;
|
|
71399
|
+
var init_modern_comment_mentions = __esm({
|
|
71400
|
+
"pptx/core/utils/modern-comment-mentions.ts"() {
|
|
71401
|
+
init_modern_comment_mention_read();
|
|
71402
|
+
init_modern_comment_mention_read();
|
|
71403
|
+
commonPrefixLength = (a, b) => {
|
|
71404
|
+
const max = Math.min(a.length, b.length);
|
|
71405
|
+
let index = 0;
|
|
71406
|
+
while (index < max && a[index] === b[index]) {
|
|
71407
|
+
index += 1;
|
|
71408
|
+
}
|
|
71409
|
+
return index;
|
|
71410
|
+
};
|
|
71411
|
+
commonSuffixLength = (a, b, limit) => {
|
|
71412
|
+
let index = 0;
|
|
71413
|
+
while (index < limit && a[a.length - 1 - index] === b[b.length - 1 - index]) {
|
|
71414
|
+
index += 1;
|
|
71415
|
+
}
|
|
71416
|
+
return index;
|
|
71417
|
+
};
|
|
71418
|
+
nearestOccurrence = (text2, span, hint) => {
|
|
71419
|
+
let best = -1;
|
|
71420
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
71421
|
+
let at2 = text2.indexOf(span);
|
|
71422
|
+
while (at2 !== -1) {
|
|
71423
|
+
const distance = Math.abs(at2 - hint);
|
|
71424
|
+
if (distance < bestDistance) {
|
|
71425
|
+
best = at2;
|
|
71426
|
+
bestDistance = distance;
|
|
71427
|
+
}
|
|
71428
|
+
at2 = text2.indexOf(span, at2 + 1);
|
|
71429
|
+
}
|
|
71430
|
+
return best;
|
|
71431
|
+
};
|
|
71432
|
+
loadedCoverage = (mention, loaded, oldText) => {
|
|
71433
|
+
const records = loaded.filter(
|
|
71434
|
+
(record2) => mention.id ? record2.id === mention.id : !record2.id && record2.personId === mention.personId && record2.length === mention.length
|
|
71435
|
+
);
|
|
71436
|
+
if (records.length === 0) {
|
|
71437
|
+
return void 0;
|
|
71438
|
+
}
|
|
71439
|
+
return records.map(
|
|
71440
|
+
(record2) => oldText.slice(record2.startIndex, record2.startIndex + record2.length)
|
|
71441
|
+
);
|
|
71442
|
+
};
|
|
71443
|
+
buildMention = (mention) => {
|
|
71444
|
+
const node = {};
|
|
71445
|
+
for (const [key2, value] of Object.entries(mention.rawXml || {})) {
|
|
71446
|
+
if (key2.startsWith("@_")) {
|
|
71447
|
+
node[key2] = value;
|
|
71448
|
+
}
|
|
71449
|
+
}
|
|
71450
|
+
const personKey = MENTION_PERSON_KEYS.find((key2) => node[key2] !== void 0) || "@_mentionpersonId";
|
|
71451
|
+
const lengthKey = MENTION_LENGTH_KEYS.find((key2) => node[key2] !== void 0) || "@_length";
|
|
71452
|
+
node[personKey] = mention.personId;
|
|
71453
|
+
node[lengthKey] = String(mention.length);
|
|
71454
|
+
node["@_startIndex"] = String(mention.startIndex);
|
|
71455
|
+
if (mention.id) {
|
|
71456
|
+
const idKey = node["@_id"] !== void 0 && node["@_mentionId"] === void 0 ? "@_id" : "@_mentionId";
|
|
71457
|
+
node[idKey] = mention.id;
|
|
71458
|
+
}
|
|
71459
|
+
return node;
|
|
71460
|
+
};
|
|
71461
|
+
stripMentionLists = (node) => {
|
|
71462
|
+
const result = {};
|
|
71463
|
+
for (const [key2, value] of Object.entries(node)) {
|
|
71464
|
+
if (key2.startsWith("@_") || mentionLocalName(key2) !== "mentionLst") {
|
|
71465
|
+
result[key2] = value;
|
|
71466
|
+
}
|
|
71467
|
+
}
|
|
71468
|
+
return result;
|
|
71469
|
+
};
|
|
71470
|
+
groupByContainer = (mentions) => {
|
|
71471
|
+
const direct = [];
|
|
71472
|
+
const byUri = /* @__PURE__ */ new Map();
|
|
71473
|
+
for (const mention of mentions || []) {
|
|
71474
|
+
if (!mention.containerUri) {
|
|
71475
|
+
direct.push(mention);
|
|
71476
|
+
continue;
|
|
71477
|
+
}
|
|
71478
|
+
const bucket = byUri.get(mention.containerUri);
|
|
71479
|
+
if (bucket) {
|
|
71480
|
+
bucket.push(mention);
|
|
71481
|
+
} else {
|
|
71482
|
+
byUri.set(mention.containerUri, [mention]);
|
|
71483
|
+
}
|
|
71484
|
+
}
|
|
71485
|
+
return { direct, byUri };
|
|
71486
|
+
};
|
|
71487
|
+
}
|
|
71488
|
+
});
|
|
71489
|
+
|
|
71224
71490
|
// pptx/core/utils/index.ts
|
|
71225
71491
|
var init_utils = __esm({
|
|
71226
71492
|
"pptx/core/utils/index.ts"() {
|
|
@@ -71357,6 +71623,7 @@ var init_utils = __esm({
|
|
|
71357
71623
|
init_auto_number_scripts();
|
|
71358
71624
|
init_chart_grid_operations();
|
|
71359
71625
|
init_chart_data_sheet();
|
|
71626
|
+
init_modern_comment_mentions();
|
|
71360
71627
|
}
|
|
71361
71628
|
});
|
|
71362
71629
|
|
|
@@ -77195,7 +77462,7 @@ var init_effect_style_extractor_fill_overlay = __esm({
|
|
|
77195
77462
|
});
|
|
77196
77463
|
|
|
77197
77464
|
// pptx/core/core/builders/effect-style-extractor-reflection.ts
|
|
77198
|
-
function
|
|
77465
|
+
function integer3(value) {
|
|
77199
77466
|
if (value === void 0 || value === null || value === "") {
|
|
77200
77467
|
return void 0;
|
|
77201
77468
|
}
|
|
@@ -77212,19 +77479,19 @@ function boolean2(value) {
|
|
|
77212
77479
|
return void 0;
|
|
77213
77480
|
}
|
|
77214
77481
|
function fixedFraction(value) {
|
|
77215
|
-
const parsed =
|
|
77482
|
+
const parsed = integer3(value);
|
|
77216
77483
|
return parsed !== void 0 && parsed >= 0 && parsed <= 1e5 ? parsed / 1e5 : void 0;
|
|
77217
77484
|
}
|
|
77218
77485
|
function extractReflectionAttributes(node, emuPerPx) {
|
|
77219
|
-
const blur =
|
|
77220
|
-
const distance =
|
|
77221
|
-
const startOpacity =
|
|
77222
|
-
const endOpacity =
|
|
77223
|
-
const startPosition =
|
|
77224
|
-
const endPosition =
|
|
77225
|
-
const direction =
|
|
77226
|
-
const rotation =
|
|
77227
|
-
const fadeDirection =
|
|
77486
|
+
const blur = integer3(node["@_blurRad"]);
|
|
77487
|
+
const distance = integer3(node["@_dist"]);
|
|
77488
|
+
const startOpacity = integer3(node["@_stA"]);
|
|
77489
|
+
const endOpacity = integer3(node["@_endA"]);
|
|
77490
|
+
const startPosition = integer3(node["@_stPos"]);
|
|
77491
|
+
const endPosition = integer3(node["@_endPos"]);
|
|
77492
|
+
const direction = integer3(node["@_dir"]);
|
|
77493
|
+
const rotation = integer3(node["@_rot"]);
|
|
77494
|
+
const fadeDirection = integer3(node["@_fadeDir"]);
|
|
77228
77495
|
const alignment = String(node["@_algn"] ?? "").trim();
|
|
77229
77496
|
return {
|
|
77230
77497
|
reflectionBlurRadius: blur !== void 0 && blur >= 0 ? blur / emuPerPx : void 0,
|
|
@@ -77236,10 +77503,10 @@ function extractReflectionAttributes(node, emuPerPx) {
|
|
|
77236
77503
|
reflectionRotation: rotation !== void 0 ? rotation / 6e4 : void 0,
|
|
77237
77504
|
reflectionDistance: distance !== void 0 && distance >= 0 ? distance / emuPerPx : void 0,
|
|
77238
77505
|
reflectionFadeDirection: fadeDirection !== void 0 ? fadeDirection / 6e4 : void 0,
|
|
77239
|
-
reflectionScaleX:
|
|
77240
|
-
reflectionScaleY:
|
|
77241
|
-
reflectionSkewX:
|
|
77242
|
-
reflectionSkewY:
|
|
77506
|
+
reflectionScaleX: integer3(node["@_sx"]),
|
|
77507
|
+
reflectionScaleY: integer3(node["@_sy"]),
|
|
77508
|
+
reflectionSkewX: integer3(node["@_kx"]),
|
|
77509
|
+
reflectionSkewY: integer3(node["@_ky"]),
|
|
77243
77510
|
reflectionAlignment: VALID_ALIGNMENTS.has(alignment) ? alignment : void 0,
|
|
77244
77511
|
reflectionRotateWithShape: boolean2(node["@_rotWithShape"])
|
|
77245
77512
|
};
|
|
@@ -109081,7 +109348,10 @@ async function resolveBulletImage(imageRelId, slidePath, resolver) {
|
|
|
109081
109348
|
if (!target) {
|
|
109082
109349
|
return void 0;
|
|
109083
109350
|
}
|
|
109084
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
109351
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
109352
|
+
return resolver.allowExternalImages ? target : void 0;
|
|
109353
|
+
}
|
|
109354
|
+
if (target.startsWith("data:")) {
|
|
109085
109355
|
return target;
|
|
109086
109356
|
}
|
|
109087
109357
|
const imagePath = resolver.resolveImagePath(slidePath, target);
|
|
@@ -111836,7 +112106,7 @@ function malformed(context, element, value) {
|
|
|
111836
112106
|
function cBool(context, parent, local) {
|
|
111837
112107
|
const element = cChild(parent, local);
|
|
111838
112108
|
if (!element) return void 0;
|
|
111839
|
-
const raw2 =
|
|
112109
|
+
const raw2 = attribute6(element, "val");
|
|
111840
112110
|
if (raw2 === void 0) return true;
|
|
111841
112111
|
const value = raw2.trim().toLowerCase();
|
|
111842
112112
|
if (value === "1" || value === "true") return true;
|
|
@@ -111846,7 +112116,7 @@ function cBool(context, parent, local) {
|
|
|
111846
112116
|
}
|
|
111847
112117
|
function cNumber(context, parent, local) {
|
|
111848
112118
|
const element = cChild(parent, local);
|
|
111849
|
-
const raw2 =
|
|
112119
|
+
const raw2 = attribute6(element, "val");
|
|
111850
112120
|
if (!element || raw2 === void 0) return void 0;
|
|
111851
112121
|
const value = raw2.trim() ? Number(raw2) : Number.NaN;
|
|
111852
112122
|
if (Number.isFinite(value)) return value;
|
|
@@ -111855,7 +112125,7 @@ function cNumber(context, parent, local) {
|
|
|
111855
112125
|
}
|
|
111856
112126
|
function cEnum(context, parent, local, allowed) {
|
|
111857
112127
|
const element = cChild(parent, local);
|
|
111858
|
-
const raw2 =
|
|
112128
|
+
const raw2 = attribute6(element, "val");
|
|
111859
112129
|
if (!element || raw2 === void 0) return void 0;
|
|
111860
112130
|
if (allowed.includes(raw2)) return raw2;
|
|
111861
112131
|
malformed(context, element, raw2);
|
|
@@ -111912,9 +112182,9 @@ function chartLines(parent, local) {
|
|
|
111912
112182
|
}
|
|
111913
112183
|
function numberFormat(parent) {
|
|
111914
112184
|
const element = cChild(parent, "numFmt");
|
|
111915
|
-
const formatCode2 =
|
|
112185
|
+
const formatCode2 = attribute6(element, "formatCode");
|
|
111916
112186
|
if (formatCode2 === void 0) return void 0;
|
|
111917
|
-
const linked =
|
|
112187
|
+
const linked = attribute6(element, "sourceLinked");
|
|
111918
112188
|
return {
|
|
111919
112189
|
formatCode: formatCode2,
|
|
111920
112190
|
...linked === "1" || linked === "true" ? { sourceLinked: true } : {},
|
|
@@ -111938,7 +112208,7 @@ function assignDefined(target, values) {
|
|
|
111938
112208
|
if (value !== void 0) target[key2] = value;
|
|
111939
112209
|
return target;
|
|
111940
112210
|
}
|
|
111941
|
-
var cChild,
|
|
112211
|
+
var cChild, attribute6, cVal, path, textProperties;
|
|
111942
112212
|
var init_parse_util = __esm({
|
|
111943
112213
|
"chart/parse-util.ts"() {
|
|
111944
112214
|
init_xml2();
|
|
@@ -111947,8 +112217,8 @@ var init_parse_util = __esm({
|
|
|
111947
112217
|
init_manual_layout();
|
|
111948
112218
|
init_xml_fragment();
|
|
111949
112219
|
cChild = (parent, local) => first(parent, local, NS.c);
|
|
111950
|
-
|
|
111951
|
-
cVal = (parent, local) =>
|
|
112220
|
+
attribute6 = (element, name) => element?.hasAttribute(name) ? element.getAttribute(name) ?? void 0 : void 0;
|
|
112221
|
+
cVal = (parent, local) => attribute6(cChild(parent, local), "val");
|
|
111952
112222
|
path = (element) => `c:${element.parentNode?.localName ?? ""}/c:${element.localName}`;
|
|
111953
112223
|
textProperties = (parent) => chartTextBody(cChild(parent, "txPr"));
|
|
111954
112224
|
}
|
|
@@ -111960,9 +112230,9 @@ function parseCache(node) {
|
|
|
111960
112230
|
type: node.localName === "numCache" || node.localName === "numLit" ? "number" : "string",
|
|
111961
112231
|
points: children2(node, "pt", NS.c).map((pt3) => {
|
|
111962
112232
|
const point2 = { value: cChild(pt3, "v")?.textContent ?? "" };
|
|
111963
|
-
const index = Number(
|
|
112233
|
+
const index = Number(attribute6(pt3, "idx") ?? Number.NaN);
|
|
111964
112234
|
if (Number.isInteger(index) && index >= 0) point2.index = index;
|
|
111965
|
-
const formatCode3 =
|
|
112235
|
+
const formatCode3 = attribute6(pt3, "formatCode");
|
|
111966
112236
|
if (formatCode3 !== void 0) point2.formatCode = formatCode3;
|
|
111967
112237
|
return point2;
|
|
111968
112238
|
})
|
|
@@ -112165,10 +112435,10 @@ function readDisplayNaAsBlank(chartExtLst) {
|
|
|
112165
112435
|
return void 0;
|
|
112166
112436
|
}
|
|
112167
112437
|
for (const ext of elements(root)) {
|
|
112168
|
-
if (ext.localName !== "ext" ||
|
|
112438
|
+
if (ext.localName !== "ext" || attribute6(ext, "uri") !== DATA_DISPLAY_OPTIONS_URI) continue;
|
|
112169
112439
|
const flag2 = first(first(ext, "dataDisplayOptions16", C16R3), "dispNaAsBlank", C16R3);
|
|
112170
112440
|
if (!flag2) continue;
|
|
112171
|
-
const raw2 =
|
|
112441
|
+
const raw2 = attribute6(flag2, "val")?.trim().toLowerCase();
|
|
112172
112442
|
return raw2 === void 0 || raw2 === "1" || raw2 === "true";
|
|
112173
112443
|
}
|
|
112174
112444
|
return void 0;
|
|
@@ -112413,7 +112683,7 @@ function customSplit(context, element) {
|
|
|
112413
112683
|
if (!element) return void 0;
|
|
112414
112684
|
reportUnmodelled(context, element, /* @__PURE__ */ new Set(["secondPiePt"]));
|
|
112415
112685
|
return children2(element, "secondPiePt", NS.c).flatMap((point2) => {
|
|
112416
|
-
const raw2 =
|
|
112686
|
+
const raw2 = attribute6(point2, "val")?.trim();
|
|
112417
112687
|
const index = raw2 ? Number(raw2) : Number.NaN;
|
|
112418
112688
|
return Number.isInteger(index) && index >= 0 ? [index] : [];
|
|
112419
112689
|
});
|
|
@@ -112434,7 +112704,7 @@ function parseGroup(context, element) {
|
|
|
112434
112704
|
is3D,
|
|
112435
112705
|
series: children2(element, "ser", NS.c).map((ser) => parseSeries(context, ser)),
|
|
112436
112706
|
axisIds: children2(element, "axId", NS.c).flatMap((axis) => {
|
|
112437
|
-
const raw2 =
|
|
112707
|
+
const raw2 = attribute6(axis, "val")?.trim();
|
|
112438
112708
|
const id = raw2 ? Number(raw2) : Number.NaN;
|
|
112439
112709
|
return Number.isFinite(id) ? [id] : [];
|
|
112440
112710
|
})
|
|
@@ -112716,7 +112986,7 @@ function chartStyle(context, space) {
|
|
|
112716
112986
|
}
|
|
112717
112987
|
function c14Style(space) {
|
|
112718
112988
|
for (const alternate of children2(space, "AlternateContent", NS.mc)) {
|
|
112719
|
-
const raw2 =
|
|
112989
|
+
const raw2 = attribute6(first(first(alternate, "Choice", NS.mc), "style", NS.c14, false), "val");
|
|
112720
112990
|
const value = raw2?.trim() ? Number(raw2) : Number.NaN;
|
|
112721
112991
|
if (Number.isFinite(value)) return value;
|
|
112722
112992
|
}
|
|
@@ -113405,7 +113675,7 @@ function malformed2(context, where, value) {
|
|
|
113405
113675
|
});
|
|
113406
113676
|
}
|
|
113407
113677
|
function boolAttribute(context, element, name) {
|
|
113408
|
-
const raw2 =
|
|
113678
|
+
const raw2 = attribute6(element, name);
|
|
113409
113679
|
if (!element || raw2 === void 0) return void 0;
|
|
113410
113680
|
const value = raw2.trim().toLowerCase();
|
|
113411
113681
|
if (value === "1" || value === "true") return true;
|
|
@@ -113414,7 +113684,7 @@ function boolAttribute(context, element, name) {
|
|
|
113414
113684
|
return void 0;
|
|
113415
113685
|
}
|
|
113416
113686
|
function numberAttribute(context, element, name) {
|
|
113417
|
-
const raw2 =
|
|
113687
|
+
const raw2 = attribute6(element, name);
|
|
113418
113688
|
if (!element || raw2 === void 0) return void 0;
|
|
113419
113689
|
const value = raw2.trim() ? Number(raw2) : Number.NaN;
|
|
113420
113690
|
if (Number.isFinite(value)) return value;
|
|
@@ -113424,11 +113694,11 @@ function numberAttribute(context, element, name) {
|
|
|
113424
113694
|
function indexAttribute(context, element, name) {
|
|
113425
113695
|
const value = numberAttribute(context, element, name);
|
|
113426
113696
|
if (value === void 0 || Number.isInteger(value) && value >= 0) return value;
|
|
113427
|
-
malformed2(context, path2(element, name),
|
|
113697
|
+
malformed2(context, path2(element, name), attribute6(element, name) ?? "");
|
|
113428
113698
|
return void 0;
|
|
113429
113699
|
}
|
|
113430
113700
|
function autoNumberAttribute(context, element, name) {
|
|
113431
|
-
return
|
|
113701
|
+
return attribute6(element, name)?.trim() === "auto" ? "auto" : numberAttribute(context, element, name);
|
|
113432
113702
|
}
|
|
113433
113703
|
function reportUnmodelled2(context, element, handled) {
|
|
113434
113704
|
for (const child32 of elements(element)) {
|
|
@@ -113459,9 +113729,9 @@ function lines(parent, local) {
|
|
|
113459
113729
|
}
|
|
113460
113730
|
function numberFormat2(parent) {
|
|
113461
113731
|
const element = cxChild(parent, "numFmt");
|
|
113462
|
-
const formatCode2 =
|
|
113732
|
+
const formatCode2 = attribute6(element, "formatCode");
|
|
113463
113733
|
if (formatCode2 === void 0) return void 0;
|
|
113464
|
-
const linked =
|
|
113734
|
+
const linked = attribute6(element, "sourceLinked");
|
|
113465
113735
|
return {
|
|
113466
113736
|
formatCode: formatCode2,
|
|
113467
113737
|
...linked === "1" || linked === "true" ? { sourceLinked: true } : {},
|
|
@@ -113472,7 +113742,7 @@ function formula(parent, local) {
|
|
|
113472
113742
|
const element = cxChild(parent, local);
|
|
113473
113743
|
if (!element) return void 0;
|
|
113474
113744
|
const out = { formula: element.textContent ?? "" };
|
|
113475
|
-
const direction =
|
|
113745
|
+
const direction = attribute6(element, "dir");
|
|
113476
113746
|
if (direction !== void 0) out.direction = direction;
|
|
113477
113747
|
return out;
|
|
113478
113748
|
}
|
|
@@ -113506,8 +113776,8 @@ function parseLevel(context, element) {
|
|
|
113506
113776
|
{ points: points7 },
|
|
113507
113777
|
{
|
|
113508
113778
|
pointCount: indexAttribute(context, element, "ptCount"),
|
|
113509
|
-
formatCode:
|
|
113510
|
-
name:
|
|
113779
|
+
formatCode: attribute6(element, "formatCode"),
|
|
113780
|
+
name: attribute6(element, "name"),
|
|
113511
113781
|
extLst: extensionList2(element)
|
|
113512
113782
|
}
|
|
113513
113783
|
);
|
|
@@ -113520,7 +113790,7 @@ function parseDimension(context, element) {
|
|
|
113520
113790
|
levels: cxChildren(element, "lvl").map((level2) => parseLevel(context, level2))
|
|
113521
113791
|
},
|
|
113522
113792
|
{
|
|
113523
|
-
type:
|
|
113793
|
+
type: attribute6(element, "type"),
|
|
113524
113794
|
formula: formula(element, "f"),
|
|
113525
113795
|
nameFormula: formula(element, "nf"),
|
|
113526
113796
|
extLst: extensionList2(element)
|
|
@@ -113577,8 +113847,8 @@ function parseTitle2(context, element) {
|
|
|
113577
113847
|
tx: parseText3(context, cxChild(element, "tx")),
|
|
113578
113848
|
spPr: shapeProperties2(element),
|
|
113579
113849
|
txPr: textProperties2(element),
|
|
113580
|
-
position:
|
|
113581
|
-
align:
|
|
113850
|
+
position: attribute6(element, "pos"),
|
|
113851
|
+
align: attribute6(element, "align"),
|
|
113582
113852
|
overlay: boolAttribute(context, element, "overlay"),
|
|
113583
113853
|
extLst: extensionList2(element)
|
|
113584
113854
|
}
|
|
@@ -113589,8 +113859,8 @@ function parseLegend2(context, element) {
|
|
|
113589
113859
|
return assignDefined(
|
|
113590
113860
|
{},
|
|
113591
113861
|
{
|
|
113592
|
-
position:
|
|
113593
|
-
align:
|
|
113862
|
+
position: attribute6(element, "pos"),
|
|
113863
|
+
align: attribute6(element, "align"),
|
|
113594
113864
|
overlay: boolAttribute(context, element, "overlay"),
|
|
113595
113865
|
spPr: shapeProperties2(element),
|
|
113596
113866
|
txPr: textProperties2(element),
|
|
@@ -113639,7 +113909,7 @@ function parseUnits(context, element) {
|
|
|
113639
113909
|
return assignDefined(
|
|
113640
113910
|
{},
|
|
113641
113911
|
{
|
|
113642
|
-
unit:
|
|
113912
|
+
unit: attribute6(element, "unit"),
|
|
113643
113913
|
label: label ? parseTitle2(context, label) : void 0,
|
|
113644
113914
|
extLst: extensionList2(element)
|
|
113645
113915
|
}
|
|
@@ -113690,7 +113960,7 @@ var init_parse_axis = __esm({
|
|
|
113690
113960
|
"txPr",
|
|
113691
113961
|
"extLst"
|
|
113692
113962
|
]);
|
|
113693
|
-
tickMarks = (element) => element ? assignDefined({}, { type:
|
|
113963
|
+
tickMarks = (element) => element ? assignDefined({}, { type: attribute6(element, "type") }) : void 0;
|
|
113694
113964
|
}
|
|
113695
113965
|
});
|
|
113696
113966
|
|
|
@@ -113709,7 +113979,7 @@ function labelVisibility(context, element) {
|
|
|
113709
113979
|
function labelOptions2(context, element) {
|
|
113710
113980
|
const separator = cxChild(element, "separator");
|
|
113711
113981
|
return {
|
|
113712
|
-
position:
|
|
113982
|
+
position: attribute6(element, "pos"),
|
|
113713
113983
|
numberFormat: numberFormat2(element),
|
|
113714
113984
|
spPr: shapeProperties2(element),
|
|
113715
113985
|
txPr: textProperties2(element),
|
|
@@ -113742,7 +114012,7 @@ function parseBinning(context, element) {
|
|
|
113742
114012
|
return assignDefined(
|
|
113743
114013
|
{},
|
|
113744
114014
|
{
|
|
113745
|
-
intervalClosed:
|
|
114015
|
+
intervalClosed: attribute6(element, "intervalClosed"),
|
|
113746
114016
|
underflow: autoNumberAttribute(context, element, "underflow"),
|
|
113747
114017
|
overflow: autoNumberAttribute(context, element, "overflow"),
|
|
113748
114018
|
binSize: scalar4("binSize"),
|
|
@@ -113755,11 +114025,11 @@ function parseGeography(context, element) {
|
|
|
113755
114025
|
return assignDefined(
|
|
113756
114026
|
{},
|
|
113757
114027
|
{
|
|
113758
|
-
projectionType:
|
|
113759
|
-
viewedRegionType:
|
|
113760
|
-
cultureLanguage:
|
|
113761
|
-
cultureRegion:
|
|
113762
|
-
attribution:
|
|
114028
|
+
projectionType: attribute6(element, "projectionType"),
|
|
114029
|
+
viewedRegionType: attribute6(element, "viewedRegionType"),
|
|
114030
|
+
cultureLanguage: attribute6(element, "cultureLanguage"),
|
|
114031
|
+
cultureRegion: attribute6(element, "cultureRegion"),
|
|
114032
|
+
attribution: attribute6(element, "attribution"),
|
|
113763
114033
|
geoCacheXml: rawChild2(element, "geoCache"),
|
|
113764
114034
|
extLst: extensionList2(element)
|
|
113765
114035
|
}
|
|
@@ -113775,8 +114045,8 @@ function parseLayout(context, element) {
|
|
|
113775
114045
|
return assignDefined(
|
|
113776
114046
|
{},
|
|
113777
114047
|
{
|
|
113778
|
-
parentLabelLayout:
|
|
113779
|
-
regionLabelLayout:
|
|
114048
|
+
parentLabelLayout: attribute6(cxChild(element, "parentLabelLayout"), "val"),
|
|
114049
|
+
regionLabelLayout: attribute6(cxChild(element, "regionLabelLayout"), "val"),
|
|
113780
114050
|
visibility: visibility ? assignDefined(
|
|
113781
114051
|
{},
|
|
113782
114052
|
Object.fromEntries(
|
|
@@ -113788,7 +114058,7 @@ function parseLayout(context, element) {
|
|
|
113788
114058
|
geography: geography ? parseGeography(context, geography) : void 0,
|
|
113789
114059
|
statistics: statistics ? assignDefined(
|
|
113790
114060
|
{},
|
|
113791
|
-
{ quartileMethod:
|
|
114061
|
+
{ quartileMethod: attribute6(statistics, "quartileMethod") }
|
|
113792
114062
|
) : void 0,
|
|
113793
114063
|
subtotals: subtotals ? cxChildren(subtotals, "idx").map((idx) => indexAttribute(context, idx, "val")).filter((index) => index !== void 0) : void 0,
|
|
113794
114064
|
extLst: extensionList2(element)
|
|
@@ -113813,11 +114083,11 @@ function parseSeries2(context, element) {
|
|
|
113813
114083
|
const layout = cxChild(element, "layoutPr");
|
|
113814
114084
|
const axisIds = cxChildren(element, "axisId").map((axis) => indexAttribute(context, axis, "val")).filter((id) => id !== void 0);
|
|
113815
114085
|
return assignDefined(
|
|
113816
|
-
{ layoutId:
|
|
114086
|
+
{ layoutId: attribute6(element, "layoutId") ?? "", dataPoints, axisIds },
|
|
113817
114087
|
{
|
|
113818
114088
|
hidden: boolAttribute(context, element, "hidden"),
|
|
113819
114089
|
ownerIndex: numberAttribute(context, element, "ownerIdx"),
|
|
113820
|
-
uniqueId:
|
|
114090
|
+
uniqueId: attribute6(element, "uniqueId"),
|
|
113821
114091
|
formatIndex: numberAttribute(context, element, "formatIdx"),
|
|
113822
114092
|
tx: parseText3(context, cxChild(element, "tx")),
|
|
113823
114093
|
spPr: shapeProperties2(element),
|
|
@@ -117547,254 +117817,6 @@ var init_modern_comment_fields = __esm({
|
|
|
117547
117817
|
}
|
|
117548
117818
|
});
|
|
117549
117819
|
|
|
117550
|
-
// pptx/core/utils/modern-comment-mention-read.ts
|
|
117551
|
-
function readCommentMentions(node, authorName) {
|
|
117552
|
-
if (!node) {
|
|
117553
|
-
return void 0;
|
|
117554
|
-
}
|
|
117555
|
-
const found = [];
|
|
117556
|
-
for (const list3 of mentionChildrenNamed(node, "mentionLst")) {
|
|
117557
|
-
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
117558
|
-
const mention = readMention(entry2, authorName);
|
|
117559
|
-
if (mention) {
|
|
117560
|
-
found.push(mention);
|
|
117561
|
-
}
|
|
117562
|
-
}
|
|
117563
|
-
}
|
|
117564
|
-
for (const extension of mentionChildrenNamed(mentionChildrenNamed(node, "extLst")[0], "ext")) {
|
|
117565
|
-
const uri = String(extension["@_uri"] || "");
|
|
117566
|
-
for (const list3 of mentionChildrenNamed(extension, "mentionLst")) {
|
|
117567
|
-
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
117568
|
-
const mention = readMention(entry2, authorName, uri);
|
|
117569
|
-
if (mention) {
|
|
117570
|
-
found.push(mention);
|
|
117571
|
-
}
|
|
117572
|
-
}
|
|
117573
|
-
}
|
|
117574
|
-
}
|
|
117575
|
-
found.sort((a, b) => a.startIndex - b.startIndex);
|
|
117576
|
-
return found.length > 0 ? found : void 0;
|
|
117577
|
-
}
|
|
117578
|
-
var mentionLocalName, mentionNodesOf, mentionChildrenNamed, MENTION_PERSON_KEYS, MENTION_LENGTH_KEYS, attribute6, integer3, readMention;
|
|
117579
|
-
var init_modern_comment_mention_read = __esm({
|
|
117580
|
-
"pptx/core/utils/modern-comment-mention-read.ts"() {
|
|
117581
|
-
mentionLocalName = (key2) => key2.split(":").pop() || key2;
|
|
117582
|
-
mentionNodesOf = (value) => {
|
|
117583
|
-
if (Array.isArray(value)) {
|
|
117584
|
-
return value.filter((entry2) => Boolean(entry2) && typeof entry2 === "object");
|
|
117585
|
-
}
|
|
117586
|
-
return value && typeof value === "object" ? [value] : [];
|
|
117587
|
-
};
|
|
117588
|
-
mentionChildrenNamed = (node, name) => {
|
|
117589
|
-
if (!node) {
|
|
117590
|
-
return [];
|
|
117591
|
-
}
|
|
117592
|
-
const result = [];
|
|
117593
|
-
for (const [key2, value] of Object.entries(node)) {
|
|
117594
|
-
if (!key2.startsWith("@_") && mentionLocalName(key2) === name) {
|
|
117595
|
-
result.push(...mentionNodesOf(value));
|
|
117596
|
-
}
|
|
117597
|
-
}
|
|
117598
|
-
return result;
|
|
117599
|
-
};
|
|
117600
|
-
MENTION_PERSON_KEYS = [
|
|
117601
|
-
"@_mentionpersonId",
|
|
117602
|
-
"@_mentionPersonId",
|
|
117603
|
-
"@_personId",
|
|
117604
|
-
"@_authorId"
|
|
117605
|
-
];
|
|
117606
|
-
MENTION_LENGTH_KEYS = ["@_length", "@_mentionCharCount", "@_len"];
|
|
117607
|
-
attribute6 = (node, keys) => {
|
|
117608
|
-
for (const key2 of keys) {
|
|
117609
|
-
const value = node[key2];
|
|
117610
|
-
if (value !== void 0 && value !== null && String(value).length > 0) {
|
|
117611
|
-
return String(value);
|
|
117612
|
-
}
|
|
117613
|
-
}
|
|
117614
|
-
return void 0;
|
|
117615
|
-
};
|
|
117616
|
-
integer3 = (value) => {
|
|
117617
|
-
if (value === void 0) {
|
|
117618
|
-
return void 0;
|
|
117619
|
-
}
|
|
117620
|
-
const parsed = Number.parseInt(value, 10);
|
|
117621
|
-
return Number.isFinite(parsed) && parsed >= 0 ? parsed : void 0;
|
|
117622
|
-
};
|
|
117623
|
-
readMention = (node, authorName, containerUri) => {
|
|
117624
|
-
const personId = attribute6(node, MENTION_PERSON_KEYS);
|
|
117625
|
-
const startIndex = integer3(attribute6(node, ["@_startIndex"]));
|
|
117626
|
-
const length = integer3(attribute6(node, MENTION_LENGTH_KEYS));
|
|
117627
|
-
if (!personId || startIndex === void 0 || length === void 0 || length === 0) {
|
|
117628
|
-
return void 0;
|
|
117629
|
-
}
|
|
117630
|
-
return {
|
|
117631
|
-
personId,
|
|
117632
|
-
startIndex,
|
|
117633
|
-
length,
|
|
117634
|
-
id: attribute6(node, ["@_mentionId", "@_id"]),
|
|
117635
|
-
authorName: authorName(personId),
|
|
117636
|
-
containerUri,
|
|
117637
|
-
rawXml: node
|
|
117638
|
-
};
|
|
117639
|
-
};
|
|
117640
|
-
}
|
|
117641
|
-
});
|
|
117642
|
-
|
|
117643
|
-
// pptx/core/utils/modern-comment-mentions.ts
|
|
117644
|
-
function rebaseCommentMentions(mentions, oldText, newText) {
|
|
117645
|
-
if (!mentions || mentions.length === 0) {
|
|
117646
|
-
return void 0;
|
|
117647
|
-
}
|
|
117648
|
-
if (oldText === newText) {
|
|
117649
|
-
return mentions;
|
|
117650
|
-
}
|
|
117651
|
-
const prefix = commonPrefixLength(oldText, newText);
|
|
117652
|
-
const suffix = commonSuffixLength(
|
|
117653
|
-
oldText,
|
|
117654
|
-
newText,
|
|
117655
|
-
Math.min(oldText.length, newText.length) - prefix
|
|
117656
|
-
);
|
|
117657
|
-
const changeEnd = oldText.length - suffix;
|
|
117658
|
-
const delta2 = newText.length - oldText.length;
|
|
117659
|
-
const result = [];
|
|
117660
|
-
for (const mention of mentions) {
|
|
117661
|
-
const start = mention.startIndex;
|
|
117662
|
-
const end = start + mention.length;
|
|
117663
|
-
const span = oldText.slice(start, end);
|
|
117664
|
-
if (span.length !== mention.length) {
|
|
117665
|
-
continue;
|
|
117666
|
-
}
|
|
117667
|
-
let next = -1;
|
|
117668
|
-
if (end <= prefix) {
|
|
117669
|
-
next = start;
|
|
117670
|
-
} else if (start >= changeEnd) {
|
|
117671
|
-
next = start + delta2;
|
|
117672
|
-
}
|
|
117673
|
-
if (next >= 0 && newText.slice(next, next + mention.length) === span) {
|
|
117674
|
-
result.push(next === start ? mention : { ...mention, startIndex: next });
|
|
117675
|
-
continue;
|
|
117676
|
-
}
|
|
117677
|
-
const relocated = nearestOccurrence(newText, span, next >= 0 ? next : start);
|
|
117678
|
-
if (relocated >= 0) {
|
|
117679
|
-
result.push({ ...mention, startIndex: relocated });
|
|
117680
|
-
}
|
|
117681
|
-
}
|
|
117682
|
-
return result.length > 0 ? result : void 0;
|
|
117683
|
-
}
|
|
117684
|
-
function buildMentionListNode(mentions) {
|
|
117685
|
-
if (!mentions || mentions.length === 0) {
|
|
117686
|
-
return void 0;
|
|
117687
|
-
}
|
|
117688
|
-
return { "p188:mention": mentions.map(buildMention) };
|
|
117689
|
-
}
|
|
117690
|
-
function applyCommentMentions(node, mentions, extension, replace) {
|
|
117691
|
-
if (!replace) {
|
|
117692
|
-
return extension;
|
|
117693
|
-
}
|
|
117694
|
-
const { direct, byUri } = groupByContainer(mentions);
|
|
117695
|
-
const directList = buildMentionListNode(direct);
|
|
117696
|
-
if (directList) {
|
|
117697
|
-
node["p188:mentionLst"] = directList;
|
|
117698
|
-
}
|
|
117699
|
-
if (!extension) {
|
|
117700
|
-
return void 0;
|
|
117701
|
-
}
|
|
117702
|
-
const rebuilt = stripMentionLists(extension);
|
|
117703
|
-
const extensionKey = Object.keys(rebuilt).find((key2) => mentionLocalName(key2) === "ext") || "p188:ext";
|
|
117704
|
-
const entries = mentionNodesOf(rebuilt[extensionKey]).map((entry2) => {
|
|
117705
|
-
const list3 = buildMentionListNode(byUri.get(String(entry2["@_uri"] || "")));
|
|
117706
|
-
const next = stripMentionLists(entry2);
|
|
117707
|
-
if (list3) {
|
|
117708
|
-
next["p188:mentionLst"] = list3;
|
|
117709
|
-
}
|
|
117710
|
-
return next;
|
|
117711
|
-
});
|
|
117712
|
-
if (entries.length > 0) {
|
|
117713
|
-
rebuilt[extensionKey] = entries.length === 1 ? entries[0] : entries;
|
|
117714
|
-
}
|
|
117715
|
-
return rebuilt;
|
|
117716
|
-
}
|
|
117717
|
-
var commonPrefixLength, commonSuffixLength, nearestOccurrence, buildMention, stripMentionLists, groupByContainer;
|
|
117718
|
-
var init_modern_comment_mentions = __esm({
|
|
117719
|
-
"pptx/core/utils/modern-comment-mentions.ts"() {
|
|
117720
|
-
init_modern_comment_mention_read();
|
|
117721
|
-
init_modern_comment_mention_read();
|
|
117722
|
-
commonPrefixLength = (a, b) => {
|
|
117723
|
-
const max = Math.min(a.length, b.length);
|
|
117724
|
-
let index = 0;
|
|
117725
|
-
while (index < max && a[index] === b[index]) {
|
|
117726
|
-
index += 1;
|
|
117727
|
-
}
|
|
117728
|
-
return index;
|
|
117729
|
-
};
|
|
117730
|
-
commonSuffixLength = (a, b, limit) => {
|
|
117731
|
-
let index = 0;
|
|
117732
|
-
while (index < limit && a[a.length - 1 - index] === b[b.length - 1 - index]) {
|
|
117733
|
-
index += 1;
|
|
117734
|
-
}
|
|
117735
|
-
return index;
|
|
117736
|
-
};
|
|
117737
|
-
nearestOccurrence = (text2, span, hint) => {
|
|
117738
|
-
let best = -1;
|
|
117739
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
117740
|
-
let at2 = text2.indexOf(span);
|
|
117741
|
-
while (at2 !== -1) {
|
|
117742
|
-
const distance = Math.abs(at2 - hint);
|
|
117743
|
-
if (distance < bestDistance) {
|
|
117744
|
-
best = at2;
|
|
117745
|
-
bestDistance = distance;
|
|
117746
|
-
}
|
|
117747
|
-
at2 = text2.indexOf(span, at2 + 1);
|
|
117748
|
-
}
|
|
117749
|
-
return best;
|
|
117750
|
-
};
|
|
117751
|
-
buildMention = (mention) => {
|
|
117752
|
-
const node = {};
|
|
117753
|
-
for (const [key2, value] of Object.entries(mention.rawXml || {})) {
|
|
117754
|
-
if (key2.startsWith("@_")) {
|
|
117755
|
-
node[key2] = value;
|
|
117756
|
-
}
|
|
117757
|
-
}
|
|
117758
|
-
const personKey = MENTION_PERSON_KEYS.find((key2) => node[key2] !== void 0) || "@_mentionpersonId";
|
|
117759
|
-
const lengthKey = MENTION_LENGTH_KEYS.find((key2) => node[key2] !== void 0) || "@_length";
|
|
117760
|
-
node[personKey] = mention.personId;
|
|
117761
|
-
node[lengthKey] = String(mention.length);
|
|
117762
|
-
node["@_startIndex"] = String(mention.startIndex);
|
|
117763
|
-
if (mention.id) {
|
|
117764
|
-
const idKey = node["@_id"] !== void 0 && node["@_mentionId"] === void 0 ? "@_id" : "@_mentionId";
|
|
117765
|
-
node[idKey] = mention.id;
|
|
117766
|
-
}
|
|
117767
|
-
return node;
|
|
117768
|
-
};
|
|
117769
|
-
stripMentionLists = (node) => {
|
|
117770
|
-
const result = {};
|
|
117771
|
-
for (const [key2, value] of Object.entries(node)) {
|
|
117772
|
-
if (key2.startsWith("@_") || mentionLocalName(key2) !== "mentionLst") {
|
|
117773
|
-
result[key2] = value;
|
|
117774
|
-
}
|
|
117775
|
-
}
|
|
117776
|
-
return result;
|
|
117777
|
-
};
|
|
117778
|
-
groupByContainer = (mentions) => {
|
|
117779
|
-
const direct = [];
|
|
117780
|
-
const byUri = /* @__PURE__ */ new Map();
|
|
117781
|
-
for (const mention of mentions || []) {
|
|
117782
|
-
if (!mention.containerUri) {
|
|
117783
|
-
direct.push(mention);
|
|
117784
|
-
continue;
|
|
117785
|
-
}
|
|
117786
|
-
const bucket = byUri.get(mention.containerUri);
|
|
117787
|
-
if (bucket) {
|
|
117788
|
-
bucket.push(mention);
|
|
117789
|
-
} else {
|
|
117790
|
-
byUri.set(mention.containerUri, [mention]);
|
|
117791
|
-
}
|
|
117792
|
-
}
|
|
117793
|
-
return { direct, byUri };
|
|
117794
|
-
};
|
|
117795
|
-
}
|
|
117796
|
-
});
|
|
117797
|
-
|
|
117798
117820
|
// pptx/core/utils/modern-comment-text-body.ts
|
|
117799
117821
|
function flattenBodyText(node) {
|
|
117800
117822
|
if (!node) {
|
|
@@ -118188,7 +118210,13 @@ var init_modern_comment_xml = __esm({
|
|
|
118188
118210
|
const originalBody = child24(raw2, "txBody");
|
|
118189
118211
|
node["p188:txBody"] = applyModernCommentText(originalBody, comment.text);
|
|
118190
118212
|
const originalText = originalBody ? flattenBodyText(originalBody).join("\n") : comment.text;
|
|
118191
|
-
const
|
|
118213
|
+
const loadedMentions = raw2 ? readCommentMentions(raw2, () => void 0) : void 0;
|
|
118214
|
+
const mentions = rebaseCommentMentions(
|
|
118215
|
+
comment.mentions,
|
|
118216
|
+
originalText,
|
|
118217
|
+
comment.text,
|
|
118218
|
+
loadedMentions ?? []
|
|
118219
|
+
);
|
|
118192
118220
|
const extension = applyCommentMentions(node, mentions, child24(raw2, "extLst"), ownsMentions);
|
|
118193
118221
|
if (extension) {
|
|
118194
118222
|
node["p188:extLst"] = extension;
|
|
@@ -152044,7 +152072,13 @@ var init_PptxHandlerRuntimeElementParsing = __esm({
|
|
|
152044
152072
|
if (posterRId && relsMap) {
|
|
152045
152073
|
const posterTarget = relsMap.get(posterRId);
|
|
152046
152074
|
if (posterTarget) {
|
|
152047
|
-
if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")
|
|
152075
|
+
if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")) {
|
|
152076
|
+
if (this.allowExternalImages === true) {
|
|
152077
|
+
posterImage = posterTarget;
|
|
152078
|
+
imagePath = posterTarget;
|
|
152079
|
+
imageData = posterTarget;
|
|
152080
|
+
}
|
|
152081
|
+
} else if (posterTarget.startsWith("data:")) {
|
|
152048
152082
|
posterImage = posterTarget;
|
|
152049
152083
|
imagePath = posterTarget;
|
|
152050
152084
|
imageData = posterTarget;
|
|
@@ -153230,7 +153264,12 @@ var init_PptxHandlerRuntimeShapeImageFill = __esm({
|
|
|
153230
153264
|
const slideRels = this.slideRelsMap.get(slidePath);
|
|
153231
153265
|
const target = slideRels?.get(relId);
|
|
153232
153266
|
if (target) {
|
|
153233
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
153267
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
153268
|
+
if (this.allowExternalImages === true) {
|
|
153269
|
+
imagePath = target;
|
|
153270
|
+
imageData = target;
|
|
153271
|
+
}
|
|
153272
|
+
} else if (target.startsWith("data:")) {
|
|
153234
153273
|
imagePath = target;
|
|
153235
153274
|
imageData = target;
|
|
153236
153275
|
} else {
|
|
@@ -153703,7 +153742,9 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
|
|
|
153703
153742
|
const target = slideRels?.get(imageRelId);
|
|
153704
153743
|
let imageDataUrl;
|
|
153705
153744
|
if (target) {
|
|
153706
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
153745
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
153746
|
+
imageDataUrl = this.allowExternalImages === true ? target : void 0;
|
|
153747
|
+
} else if (target.startsWith("data:")) {
|
|
153707
153748
|
imageDataUrl = target;
|
|
153708
153749
|
} else {
|
|
153709
153750
|
const imagePath = this.resolveImagePath(slidePath, target);
|
|
@@ -163433,6 +163474,7 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
163433
163474
|
async enrichBulletPictureElementsWithEmbeddedData(elements3, slidePath) {
|
|
163434
163475
|
await enrichBulletPictureImages(elements3, slidePath, {
|
|
163435
163476
|
slideRelsMap: this.slideRelsMap,
|
|
163477
|
+
allowExternalImages: this.allowExternalImages === true,
|
|
163436
163478
|
resolveImagePath: (path3, target) => this.resolveImagePath(path3, target),
|
|
163437
163479
|
getImageData: (imagePath) => this.getImageData(imagePath)
|
|
163438
163480
|
});
|
|
@@ -187747,6 +187789,7 @@ exports.readOleSheetGrid = readOleSheetGrid;
|
|
|
187747
187789
|
exports.readOleXlsGrid = readOleXlsGrid;
|
|
187748
187790
|
exports.reapplyAlternateContentToTree = reapplyAlternateContentToTree;
|
|
187749
187791
|
exports.reassignDescendantIds = reassignDescendantIds;
|
|
187792
|
+
exports.rebaseCommentMentions = rebaseCommentMentions;
|
|
187750
187793
|
exports.rebuildTableStructureInRawXml = rebuildTableStructureInRawXml;
|
|
187751
187794
|
exports.reconcileAnimationTargets = reconcileAnimationTargets;
|
|
187752
187795
|
exports.rectNode = rectNode;
|