pptx-react-viewer 3.17.1 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +33 -31
- package/dist/{AiChatPanel-SINEEZBW.mjs → AiChatPanel-DDZC6IRK.mjs} +4 -4
- package/dist/AiChatPanel-DDZC6IRK.mjs.br +0 -0
- package/dist/AiChatPanel-DDZC6IRK.mjs.gz +0 -0
- package/dist/{AiChatPanel-GYH43XWW.js → AiChatPanel-T2QSCUQR.js} +25 -25
- package/dist/AiChatPanel-T2QSCUQR.js.br +0 -0
- package/dist/AiChatPanel-T2QSCUQR.js.gz +0 -0
- package/dist/{Area3DChartScene-D7GSJGPQ.js → Area3DChartScene-WEU2MP3B.js} +2 -2
- package/dist/Area3DChartScene-WEU2MP3B.js.br +0 -0
- package/dist/Area3DChartScene-WEU2MP3B.js.gz +0 -0
- package/dist/{Area3DChartScene-X5SM67PZ.mjs → Area3DChartScene-WTKQDHC7.mjs} +1 -1
- package/dist/Area3DChartScene-WTKQDHC7.mjs.br +0 -0
- package/dist/Area3DChartScene-WTKQDHC7.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-M72WQW5Y.js → Bar3DChartScene-25G6TG53.js} +2 -2
- package/dist/Bar3DChartScene-25G6TG53.js.br +0 -0
- package/dist/Bar3DChartScene-25G6TG53.js.gz +0 -0
- package/dist/{Bar3DChartScene-HWIFFGI3.mjs → Bar3DChartScene-A5ICLHXS.mjs} +1 -1
- package/dist/{Bar3DChartScene-HWIFFGI3.mjs.br → Bar3DChartScene-A5ICLHXS.mjs.br} +0 -0
- package/dist/Bar3DChartScene-A5ICLHXS.mjs.gz +0 -0
- package/dist/{GLTFLoader-374ZNTXW.mjs → GLTFLoader-IWJFC4XI.mjs} +54 -16
- package/dist/GLTFLoader-IWJFC4XI.mjs.br +0 -0
- package/dist/GLTFLoader-IWJFC4XI.mjs.gz +0 -0
- package/dist/{GLTFLoader-Q7BHCGAW.js → GLTFLoader-KY7AYPMX.js} +178 -140
- package/dist/GLTFLoader-KY7AYPMX.js.br +0 -0
- package/dist/GLTFLoader-KY7AYPMX.js.gz +0 -0
- package/dist/{Line3DChartScene-7MPZWVF3.mjs → Line3DChartScene-ARCDLHXQ.mjs} +1 -1
- package/dist/Line3DChartScene-ARCDLHXQ.mjs.br +0 -0
- package/dist/Line3DChartScene-ARCDLHXQ.mjs.gz +0 -0
- package/dist/{Line3DChartScene-YOZEEQZ3.js → Line3DChartScene-WRZ52Z2Z.js} +2 -2
- package/dist/Line3DChartScene-WRZ52Z2Z.js.br +0 -0
- package/dist/Line3DChartScene-WRZ52Z2Z.js.gz +0 -0
- package/dist/{Model3DScene-5IJSNGDZ.js → Model3DScene-JGUG5NPX.js} +2 -2
- package/dist/Model3DScene-JGUG5NPX.js.br +0 -0
- package/dist/Model3DScene-JGUG5NPX.js.gz +0 -0
- package/dist/{Model3DScene-57LVY5QW.mjs → Model3DScene-PBKBL2YU.mjs} +1 -1
- package/dist/Model3DScene-PBKBL2YU.mjs.br +0 -0
- package/dist/Model3DScene-PBKBL2YU.mjs.gz +0 -0
- package/dist/OrbitControls-2XOMWUVE.mjs +3 -0
- package/dist/OrbitControls-2XOMWUVE.mjs.br +0 -0
- package/dist/OrbitControls-2XOMWUVE.mjs.gz +0 -0
- package/dist/OrbitControls-CGYUF3BY.js +12 -0
- package/dist/OrbitControls-CGYUF3BY.js.br +0 -0
- package/dist/OrbitControls-CGYUF3BY.js.gz +0 -0
- package/dist/{PieChart3DScene-UBI6X66Q.js → PieChart3DScene-S25DNSRS.js} +2 -2
- package/dist/PieChart3DScene-S25DNSRS.js.br +0 -0
- package/dist/PieChart3DScene-S25DNSRS.js.gz +0 -0
- package/dist/{PieChart3DScene-WD5B6NP3.mjs → PieChart3DScene-ZNKXS62H.mjs} +1 -1
- package/dist/{PieChart3DScene-WD5B6NP3.mjs.br → PieChart3DScene-ZNKXS62H.mjs.br} +0 -0
- package/dist/PieChart3DScene-ZNKXS62H.mjs.gz +0 -0
- package/dist/{SmartArt3DScene-ODKCGJBO.mjs → SmartArt3DScene-QZGIABOK.mjs} +2 -2
- package/dist/SmartArt3DScene-QZGIABOK.mjs.br +0 -0
- package/dist/SmartArt3DScene-QZGIABOK.mjs.gz +0 -0
- package/dist/{SmartArt3DScene-BK7QN3WT.js → SmartArt3DScene-T236GYUT.js} +33 -33
- package/dist/SmartArt3DScene-T236GYUT.js.br +0 -0
- package/dist/SmartArt3DScene-T236GYUT.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-JZGU6BBD.mjs → SurfaceChart3DScene-EBT7RPCX.mjs} +1 -1
- package/dist/SurfaceChart3DScene-EBT7RPCX.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-EBT7RPCX.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-JGNPYQ32.js → SurfaceChart3DScene-LXBC3HMV.js} +2 -2
- package/dist/SurfaceChart3DScene-LXBC3HMV.js.br +0 -0
- package/dist/SurfaceChart3DScene-LXBC3HMV.js.gz +0 -0
- package/dist/{chunk-KVXB22D3.js → chunk-2LTTSFLD.js} +5 -5
- package/dist/chunk-2LTTSFLD.js.br +0 -0
- package/dist/chunk-2LTTSFLD.js.gz +0 -0
- package/dist/{chunk-VYSMTC5C.mjs → chunk-2OCTGK4L.mjs} +6 -110
- package/dist/chunk-2OCTGK4L.mjs.br +0 -0
- package/dist/chunk-2OCTGK4L.mjs.gz +0 -0
- package/dist/{chunk-IXKAIIA2.mjs → chunk-3KKPRPVE.mjs} +114 -126
- package/dist/chunk-3KKPRPVE.mjs.br +0 -0
- package/dist/chunk-3KKPRPVE.mjs.gz +0 -0
- package/dist/{chunk-B4QYQLZU.js → chunk-3N6AC4HA.js} +1122 -693
- package/dist/chunk-3N6AC4HA.js.br +0 -0
- package/dist/chunk-3N6AC4HA.js.gz +0 -0
- package/dist/{chunk-OAKDJYYT.mjs → chunk-5S3A6HL3.mjs} +121 -42
- package/dist/chunk-5S3A6HL3.mjs.br +0 -0
- package/dist/chunk-5S3A6HL3.mjs.gz +0 -0
- package/dist/{chunk-IRG7SIUX.js → chunk-6R2EUDJQ.js} +1399 -1411
- package/dist/chunk-6R2EUDJQ.js.br +0 -0
- package/dist/chunk-6R2EUDJQ.js.gz +0 -0
- package/dist/{chunk-XBMKFZVP.mjs → chunk-7TAWW5QQ.mjs} +1120 -694
- package/dist/chunk-7TAWW5QQ.mjs.br +0 -0
- package/dist/chunk-7TAWW5QQ.mjs.gz +0 -0
- package/dist/{chunk-64FUV37N.js → chunk-BRJN3ZMG.js} +2 -1
- package/dist/chunk-BRJN3ZMG.js.br +0 -0
- package/dist/{chunk-64FUV37N.js.gz → chunk-BRJN3ZMG.js.gz} +0 -0
- package/dist/{chunk-QTGCOL5H.mjs → chunk-GNRVDNCV.mjs} +1707 -435
- package/dist/chunk-GNRVDNCV.mjs.br +0 -0
- package/dist/chunk-GNRVDNCV.mjs.gz +0 -0
- package/dist/{chunk-6C2WYLZY.js → chunk-IXS7DALE.js} +45 -39
- package/dist/chunk-IXS7DALE.js.br +0 -0
- package/dist/chunk-IXS7DALE.js.gz +0 -0
- package/dist/{chunk-7FBKS7OS.js → chunk-LJ46KXUV.js} +179 -283
- package/dist/chunk-LJ46KXUV.js.br +0 -0
- package/dist/chunk-LJ46KXUV.js.gz +0 -0
- package/dist/{chunk-LAU34UMB.mjs → chunk-MQUTXOET.mjs} +2 -1
- package/dist/chunk-MQUTXOET.mjs.br +0 -0
- package/dist/{chunk-LAU34UMB.mjs.gz → chunk-MQUTXOET.mjs.gz} +0 -0
- package/dist/{chunk-3CBDTD46.mjs → chunk-MV2GCDBR.mjs} +8 -2
- package/dist/chunk-MV2GCDBR.mjs.br +0 -0
- package/dist/chunk-MV2GCDBR.mjs.gz +0 -0
- package/dist/{chunk-4SPZ5IZN.js → chunk-V32F4I45.js} +1713 -439
- package/dist/chunk-V32F4I45.js.br +0 -0
- package/dist/chunk-V32F4I45.js.gz +0 -0
- package/dist/{chunk-E55VEC37.js → chunk-WGBXO4LM.js} +576 -497
- package/dist/chunk-WGBXO4LM.js.br +0 -0
- package/dist/chunk-WGBXO4LM.js.gz +0 -0
- package/dist/{chunk-7YJBRPCT.mjs → chunk-WRO37U2O.mjs} +1 -1
- package/dist/chunk-WRO37U2O.mjs.br +0 -0
- package/dist/chunk-WRO37U2O.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +18 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/three.module-LGUV2LI6.mjs +2 -0
- package/dist/three.module-LGUV2LI6.mjs.br +0 -0
- package/dist/three.module-LGUV2LI6.mjs.gz +0 -0
- package/dist/{three.module-GNNNRIMK.js → three.module-YZ4M24WM.js} +454 -442
- package/dist/three.module-YZ4M24WM.js.br +0 -0
- package/dist/three.module-YZ4M24WM.js.gz +0 -0
- package/dist/{useViewerBuildingBlocks-DkUGmlkP.d.ts → useViewerBuildingBlocks-4Tj6P8Fm.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-4Tj6P8Fm.d.ts.map +1 -0
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-GYH43XWW.js.br +0 -0
- package/dist/AiChatPanel-GYH43XWW.js.gz +0 -0
- package/dist/AiChatPanel-SINEEZBW.mjs.br +0 -0
- package/dist/AiChatPanel-SINEEZBW.mjs.gz +0 -0
- package/dist/Area3DChartScene-D7GSJGPQ.js.br +0 -0
- package/dist/Area3DChartScene-D7GSJGPQ.js.gz +0 -0
- package/dist/Area3DChartScene-X5SM67PZ.mjs.br +0 -0
- package/dist/Area3DChartScene-X5SM67PZ.mjs.gz +0 -0
- package/dist/Bar3DChartScene-HWIFFGI3.mjs.gz +0 -0
- package/dist/Bar3DChartScene-M72WQW5Y.js.br +0 -0
- package/dist/Bar3DChartScene-M72WQW5Y.js.gz +0 -0
- package/dist/GLTFLoader-374ZNTXW.mjs.br +0 -0
- package/dist/GLTFLoader-374ZNTXW.mjs.gz +0 -0
- package/dist/GLTFLoader-Q7BHCGAW.js.br +0 -0
- package/dist/GLTFLoader-Q7BHCGAW.js.gz +0 -0
- package/dist/Line3DChartScene-7MPZWVF3.mjs.br +0 -0
- package/dist/Line3DChartScene-7MPZWVF3.mjs.gz +0 -0
- package/dist/Line3DChartScene-YOZEEQZ3.js.br +0 -0
- package/dist/Line3DChartScene-YOZEEQZ3.js.gz +0 -0
- package/dist/Model3DScene-57LVY5QW.mjs.br +0 -0
- package/dist/Model3DScene-57LVY5QW.mjs.gz +0 -0
- package/dist/Model3DScene-5IJSNGDZ.js.br +0 -0
- package/dist/Model3DScene-5IJSNGDZ.js.gz +0 -0
- package/dist/OrbitControls-SMYCPLXO.js +0 -12
- package/dist/OrbitControls-SMYCPLXO.js.br +0 -3
- package/dist/OrbitControls-SMYCPLXO.js.gz +0 -0
- package/dist/OrbitControls-ZTGHPI5G.mjs +0 -3
- package/dist/OrbitControls-ZTGHPI5G.mjs.br +0 -0
- package/dist/OrbitControls-ZTGHPI5G.mjs.gz +0 -0
- package/dist/PieChart3DScene-UBI6X66Q.js.br +0 -0
- package/dist/PieChart3DScene-UBI6X66Q.js.gz +0 -0
- package/dist/PieChart3DScene-WD5B6NP3.mjs.gz +0 -0
- package/dist/SmartArt3DScene-BK7QN3WT.js.br +0 -0
- package/dist/SmartArt3DScene-BK7QN3WT.js.gz +0 -0
- package/dist/SmartArt3DScene-ODKCGJBO.mjs.br +0 -0
- package/dist/SmartArt3DScene-ODKCGJBO.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-JGNPYQ32.js.br +0 -0
- package/dist/SurfaceChart3DScene-JGNPYQ32.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JZGU6BBD.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JZGU6BBD.mjs.gz +0 -0
- package/dist/chunk-3CBDTD46.mjs.br +0 -0
- package/dist/chunk-3CBDTD46.mjs.gz +0 -0
- package/dist/chunk-4SPZ5IZN.js.br +0 -0
- package/dist/chunk-4SPZ5IZN.js.gz +0 -0
- package/dist/chunk-64FUV37N.js.br +0 -0
- package/dist/chunk-6C2WYLZY.js.br +0 -0
- package/dist/chunk-6C2WYLZY.js.gz +0 -0
- package/dist/chunk-7FBKS7OS.js.br +0 -0
- package/dist/chunk-7FBKS7OS.js.gz +0 -0
- package/dist/chunk-7YJBRPCT.mjs.br +0 -0
- package/dist/chunk-7YJBRPCT.mjs.gz +0 -0
- package/dist/chunk-B4QYQLZU.js.br +0 -0
- package/dist/chunk-B4QYQLZU.js.gz +0 -0
- package/dist/chunk-E55VEC37.js.br +0 -0
- package/dist/chunk-E55VEC37.js.gz +0 -0
- package/dist/chunk-IRG7SIUX.js.br +0 -0
- package/dist/chunk-IRG7SIUX.js.gz +0 -0
- package/dist/chunk-IXKAIIA2.mjs.br +0 -0
- package/dist/chunk-IXKAIIA2.mjs.gz +0 -0
- package/dist/chunk-KVXB22D3.js.br +0 -0
- package/dist/chunk-KVXB22D3.js.gz +0 -0
- package/dist/chunk-LAU34UMB.mjs.br +0 -0
- package/dist/chunk-OAKDJYYT.mjs.br +0 -0
- package/dist/chunk-OAKDJYYT.mjs.gz +0 -0
- package/dist/chunk-QTGCOL5H.mjs.br +0 -0
- package/dist/chunk-QTGCOL5H.mjs.gz +0 -0
- package/dist/chunk-VYSMTC5C.mjs.br +0 -0
- package/dist/chunk-VYSMTC5C.mjs.gz +0 -0
- package/dist/chunk-XBMKFZVP.mjs.br +0 -0
- package/dist/chunk-XBMKFZVP.mjs.gz +0 -0
- package/dist/three.module-AC7ESV4W.mjs +0 -2
- package/dist/three.module-AC7ESV4W.mjs.br +0 -0
- package/dist/three.module-AC7ESV4W.mjs.gz +0 -0
- package/dist/three.module-GNNNRIMK.js.br +0 -0
- package/dist/three.module-GNNNRIMK.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-DkUGmlkP.d.ts.map +0 -1
|
@@ -8122,11 +8122,11 @@ function createBuiltinVariables(ctx) {
|
|
|
8122
8122
|
vars.set("b", h2);
|
|
8123
8123
|
vars.set("hc", w / 2);
|
|
8124
8124
|
vars.set("vc", h2 / 2);
|
|
8125
|
-
const widthDivisors = [2, 3, 4, 5, 6, 8, 10, 12];
|
|
8125
|
+
const widthDivisors = [2, 3, 4, 5, 6, 8, 10, 12, 16, 32];
|
|
8126
8126
|
for (const d of widthDivisors) {
|
|
8127
8127
|
vars.set(`wd${d}`, w / d);
|
|
8128
8128
|
}
|
|
8129
|
-
const heightDivisors = [2, 3, 4, 5, 6, 8, 10, 12];
|
|
8129
|
+
const heightDivisors = [2, 3, 4, 5, 6, 8, 10, 12, 16, 32];
|
|
8130
8130
|
for (const d of heightDivisors) {
|
|
8131
8131
|
vars.set(`hd${d}`, h2 / d);
|
|
8132
8132
|
}
|
|
@@ -37112,9 +37112,9 @@ function compoundChildIds(role, node, childrenOf) {
|
|
|
37112
37112
|
const children13 = childrenOf.get(node.id) ?? [];
|
|
37113
37113
|
const start = role.presentationOf?.start?.[chIndex] ?? 1;
|
|
37114
37114
|
const count = role.presentationOf?.count?.[chIndex];
|
|
37115
|
-
const
|
|
37115
|
+
const positions = positionRange(start, count, 1, children13.length);
|
|
37116
37116
|
const ids = [];
|
|
37117
|
-
for (const position2 of
|
|
37117
|
+
for (const position2 of positions) {
|
|
37118
37118
|
const child262 = children13[position2 - 1];
|
|
37119
37119
|
if (!child262 || child262.text.trim().length === 0) {
|
|
37120
37120
|
continue;
|
|
@@ -48835,7 +48835,7 @@ function parseValueColors(node, colorParser) {
|
|
|
48835
48835
|
return colors.length > 0 ? colors : void 0;
|
|
48836
48836
|
}
|
|
48837
48837
|
function parseValueColorPositions(node, xmlLookup) {
|
|
48838
|
-
const
|
|
48838
|
+
const positions = [];
|
|
48839
48839
|
for (const posNode of xmlLookup.getChildrenArrayByLocalName(node, "pos")) {
|
|
48840
48840
|
const kind = POSITION_KIND_MAP[String(posNode["@_type"] ?? "").trim()];
|
|
48841
48841
|
if (!kind) {
|
|
@@ -48849,9 +48849,9 @@ function parseValueColorPositions(node, xmlLookup) {
|
|
|
48849
48849
|
entry2.value = num;
|
|
48850
48850
|
}
|
|
48851
48851
|
}
|
|
48852
|
-
|
|
48852
|
+
positions.push(entry2);
|
|
48853
48853
|
}
|
|
48854
|
-
return
|
|
48854
|
+
return positions.length > 0 ? positions : void 0;
|
|
48855
48855
|
}
|
|
48856
48856
|
function parseCxValueColors(series, xmlLookup, colorParser) {
|
|
48857
48857
|
const valueColorsNode = xmlLookup.getChildByLocalName(series, "valueColors");
|
|
@@ -48867,9 +48867,9 @@ function parseCxValueColors(series, xmlLookup, colorParser) {
|
|
|
48867
48867
|
}
|
|
48868
48868
|
}
|
|
48869
48869
|
if (valueColorPositionsNode) {
|
|
48870
|
-
const
|
|
48871
|
-
if (
|
|
48872
|
-
result.valueColorPositions =
|
|
48870
|
+
const positions = parseValueColorPositions(valueColorPositionsNode, xmlLookup);
|
|
48871
|
+
if (positions) {
|
|
48872
|
+
result.valueColorPositions = positions;
|
|
48873
48873
|
}
|
|
48874
48874
|
}
|
|
48875
48875
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
@@ -51605,6 +51605,55 @@ function toStrictNamespaceUri(uri) {
|
|
|
51605
51605
|
function isTransitionalNamespaceUri(uri) {
|
|
51606
51606
|
return TRANSITIONAL_TO_STRICT_NS.has(uri) || deriveStrictUri(uri) !== void 0;
|
|
51607
51607
|
}
|
|
51608
|
+
function isXmlWhitespace(char) {
|
|
51609
|
+
return char.trim().length === 0;
|
|
51610
|
+
}
|
|
51611
|
+
function isConvertibleAttributeName(name) {
|
|
51612
|
+
return name === "Type" || name === "uri" || name === "xmlns" || name.startsWith("xmlns:") && /^[A-Za-z_][\w.-]*$/u.test(name.slice("xmlns:".length));
|
|
51613
|
+
}
|
|
51614
|
+
function containsConvertibleStrictNamespaceAttribute(xml) {
|
|
51615
|
+
let index = 0;
|
|
51616
|
+
while (index < xml.length) {
|
|
51617
|
+
while (index < xml.length && !isXmlWhitespace(xml[index])) {
|
|
51618
|
+
index++;
|
|
51619
|
+
}
|
|
51620
|
+
while (index < xml.length && isXmlWhitespace(xml[index])) {
|
|
51621
|
+
index++;
|
|
51622
|
+
}
|
|
51623
|
+
const nameStart = index;
|
|
51624
|
+
while (index < xml.length && !isXmlWhitespace(xml[index]) && xml[index] !== "=") {
|
|
51625
|
+
index++;
|
|
51626
|
+
}
|
|
51627
|
+
const name = xml.slice(nameStart, index);
|
|
51628
|
+
if (!isConvertibleAttributeName(name)) {
|
|
51629
|
+
continue;
|
|
51630
|
+
}
|
|
51631
|
+
while (index < xml.length && isXmlWhitespace(xml[index])) {
|
|
51632
|
+
index++;
|
|
51633
|
+
}
|
|
51634
|
+
if (xml[index] !== "=") {
|
|
51635
|
+
continue;
|
|
51636
|
+
}
|
|
51637
|
+
index++;
|
|
51638
|
+
while (index < xml.length && isXmlWhitespace(xml[index])) {
|
|
51639
|
+
index++;
|
|
51640
|
+
}
|
|
51641
|
+
const quote = xml[index];
|
|
51642
|
+
if (quote !== '"' && quote !== "'") {
|
|
51643
|
+
continue;
|
|
51644
|
+
}
|
|
51645
|
+
const valueStart = ++index;
|
|
51646
|
+
const valueEnd = xml.indexOf(quote, valueStart);
|
|
51647
|
+
if (valueEnd === -1) {
|
|
51648
|
+
return false;
|
|
51649
|
+
}
|
|
51650
|
+
if (isTransitionalNamespaceUri(xml.slice(valueStart, valueEnd))) {
|
|
51651
|
+
return true;
|
|
51652
|
+
}
|
|
51653
|
+
index = valueEnd + 1;
|
|
51654
|
+
}
|
|
51655
|
+
return false;
|
|
51656
|
+
}
|
|
51608
51657
|
function convertXmlToStrict(node, setConformance = false) {
|
|
51609
51658
|
if (typeof node !== "object" || node === null || Array.isArray(node)) {
|
|
51610
51659
|
return node;
|
|
@@ -52067,6 +52116,178 @@ var init_activex_serializer = __esm({
|
|
|
52067
52116
|
"src/core/utils/activex-serializer.ts"() {
|
|
52068
52117
|
}
|
|
52069
52118
|
});
|
|
52119
|
+
function parseShapeId(value, allowZero = false) {
|
|
52120
|
+
const text22 = String(value ?? "").trim();
|
|
52121
|
+
if (!/^\d+$/.test(text22)) {
|
|
52122
|
+
return void 0;
|
|
52123
|
+
}
|
|
52124
|
+
const id = Number(text22);
|
|
52125
|
+
return Number.isSafeInteger(id) && id >= (allowZero ? 0 : 1) && id <= MAX_SHAPE_ID ? id : void 0;
|
|
52126
|
+
}
|
|
52127
|
+
function visitXmlObjects(value, visit, tag = "") {
|
|
52128
|
+
if (Array.isArray(value)) {
|
|
52129
|
+
for (const item of value) {
|
|
52130
|
+
visitXmlObjects(item, visit, tag);
|
|
52131
|
+
}
|
|
52132
|
+
} else if (value && typeof value === "object") {
|
|
52133
|
+
const node = value;
|
|
52134
|
+
visit(node, tag);
|
|
52135
|
+
for (const [key2, child262] of Object.entries(node)) {
|
|
52136
|
+
if (!key2.startsWith("@_")) {
|
|
52137
|
+
visitXmlObjects(child262, visit, key2);
|
|
52138
|
+
}
|
|
52139
|
+
}
|
|
52140
|
+
}
|
|
52141
|
+
}
|
|
52142
|
+
function remapAttribute(node, attribute6, ids) {
|
|
52143
|
+
const current = node[attribute6];
|
|
52144
|
+
if (current === void 0) {
|
|
52145
|
+
return;
|
|
52146
|
+
}
|
|
52147
|
+
const replacement = ids.get(String(current).trim());
|
|
52148
|
+
if (replacement !== void 0) {
|
|
52149
|
+
node[attribute6] = replacement;
|
|
52150
|
+
}
|
|
52151
|
+
}
|
|
52152
|
+
function remapShapeIdReferences(root, ids) {
|
|
52153
|
+
if (ids.size === 0) {
|
|
52154
|
+
return;
|
|
52155
|
+
}
|
|
52156
|
+
visitXmlObjects(root, (node, tag) => {
|
|
52157
|
+
if (ID_REFERENCE_TAGS.has(tag)) {
|
|
52158
|
+
remapAttribute(node, "@_id", ids);
|
|
52159
|
+
} else if (SPID_REFERENCE_TAGS.has(tag)) {
|
|
52160
|
+
remapAttribute(node, "@_spid", ids);
|
|
52161
|
+
} else if (tag === "pptx:animation") {
|
|
52162
|
+
for (const attribute6 of EDITOR_ANIMATION_ID_ATTRIBUTES) {
|
|
52163
|
+
remapAttribute(node, attribute6, ids);
|
|
52164
|
+
}
|
|
52165
|
+
}
|
|
52166
|
+
});
|
|
52167
|
+
}
|
|
52168
|
+
function findCnvPrNode(rawXml) {
|
|
52169
|
+
if (!rawXml) {
|
|
52170
|
+
return void 0;
|
|
52171
|
+
}
|
|
52172
|
+
for (const nvTag of NV_CONTAINER_TAGS) {
|
|
52173
|
+
const nv = rawXml[nvTag];
|
|
52174
|
+
const cNvPr = nv?.["p:cNvPr"] ?? nv?.["p14:cNvPr"];
|
|
52175
|
+
if (cNvPr) {
|
|
52176
|
+
return cNvPr;
|
|
52177
|
+
}
|
|
52178
|
+
}
|
|
52179
|
+
return void 0;
|
|
52180
|
+
}
|
|
52181
|
+
function flattenElements(elements2, out) {
|
|
52182
|
+
for (const element of elements2) {
|
|
52183
|
+
out.push(element);
|
|
52184
|
+
if (element.type === "group" && Array.isArray(element.children)) {
|
|
52185
|
+
flattenElements(element.children, out);
|
|
52186
|
+
}
|
|
52187
|
+
}
|
|
52188
|
+
}
|
|
52189
|
+
function remapElementShapeIds(elements2, ids) {
|
|
52190
|
+
if (ids.size === 0) {
|
|
52191
|
+
return 0;
|
|
52192
|
+
}
|
|
52193
|
+
const flat = [];
|
|
52194
|
+
flattenElements(elements2, flat);
|
|
52195
|
+
const declaredId = (element) => {
|
|
52196
|
+
const cNvPr = findCnvPrNode(element.rawXml);
|
|
52197
|
+
if (cNvPr?.["@_id"] !== void 0) {
|
|
52198
|
+
return String(cNvPr["@_id"]).trim();
|
|
52199
|
+
}
|
|
52200
|
+
return element.shapeId;
|
|
52201
|
+
};
|
|
52202
|
+
const holders = /* @__PURE__ */ new Map();
|
|
52203
|
+
for (const element of flat) {
|
|
52204
|
+
const declared = declaredId(element);
|
|
52205
|
+
if (declared !== void 0 && ids.has(declared)) {
|
|
52206
|
+
holders.set(declared, (holders.get(declared) ?? 0) + 1);
|
|
52207
|
+
}
|
|
52208
|
+
}
|
|
52209
|
+
const keptKeys = /* @__PURE__ */ new Set();
|
|
52210
|
+
const inPlaceRepairedIds = /* @__PURE__ */ new Set();
|
|
52211
|
+
for (const element of flat) {
|
|
52212
|
+
const rawId = findCnvPrNode(element.rawXml)?.["@_id"];
|
|
52213
|
+
if (rawId !== void 0) {
|
|
52214
|
+
inPlaceRepairedIds.add(String(rawId).trim());
|
|
52215
|
+
}
|
|
52216
|
+
}
|
|
52217
|
+
let changed = 0;
|
|
52218
|
+
for (const element of flat) {
|
|
52219
|
+
const rawXml = element.rawXml;
|
|
52220
|
+
const cNvPr = findCnvPrNode(rawXml);
|
|
52221
|
+
const rawId = cNvPr?.["@_id"] === void 0 ? void 0 : String(cNvPr["@_id"]).trim();
|
|
52222
|
+
const declared = rawId ?? element.shapeId;
|
|
52223
|
+
let touched = false;
|
|
52224
|
+
if (declared !== void 0 && ids.has(declared)) {
|
|
52225
|
+
const fresh = ids.get(declared);
|
|
52226
|
+
const retainsOldId = inPlaceRepairedIds.has(fresh);
|
|
52227
|
+
if (!retainsOldId && ((holders.get(declared) ?? 0) === 1 || keptKeys.has(declared))) {
|
|
52228
|
+
if (cNvPr && rawId !== void 0) {
|
|
52229
|
+
cNvPr["@_id"] = fresh;
|
|
52230
|
+
}
|
|
52231
|
+
if (element.shapeId !== void 0) {
|
|
52232
|
+
element.shapeId = fresh;
|
|
52233
|
+
}
|
|
52234
|
+
touched = true;
|
|
52235
|
+
} else if (!retainsOldId) {
|
|
52236
|
+
keptKeys.add(declared);
|
|
52237
|
+
}
|
|
52238
|
+
} else if (rawId !== void 0 && element.shapeId !== void 0 && element.shapeId !== rawId) {
|
|
52239
|
+
if (ids.get(element.shapeId) === rawId) {
|
|
52240
|
+
element.shapeId = rawId;
|
|
52241
|
+
touched = true;
|
|
52242
|
+
}
|
|
52243
|
+
}
|
|
52244
|
+
if (rawXml) {
|
|
52245
|
+
remapShapeIdReferences(rawXml, ids);
|
|
52246
|
+
}
|
|
52247
|
+
const style = "shapeStyle" in element ? element.shapeStyle : void 0;
|
|
52248
|
+
for (const connection of [style?.connectorStartConnection, style?.connectorEndConnection]) {
|
|
52249
|
+
const replacement = connection?.shapeId === void 0 ? void 0 : ids.get(connection.shapeId.trim());
|
|
52250
|
+
if (connection && replacement !== void 0) {
|
|
52251
|
+
connection.shapeId = replacement;
|
|
52252
|
+
touched = true;
|
|
52253
|
+
}
|
|
52254
|
+
}
|
|
52255
|
+
if (touched) {
|
|
52256
|
+
changed += 1;
|
|
52257
|
+
}
|
|
52258
|
+
}
|
|
52259
|
+
return changed;
|
|
52260
|
+
}
|
|
52261
|
+
var MAX_SHAPE_ID;
|
|
52262
|
+
var ID_REFERENCE_TAGS;
|
|
52263
|
+
var SPID_REFERENCE_TAGS;
|
|
52264
|
+
var EDITOR_ANIMATION_ID_ATTRIBUTES;
|
|
52265
|
+
var NV_CONTAINER_TAGS;
|
|
52266
|
+
var init_shape_ids = __esm({
|
|
52267
|
+
"src/core/utils/shape-ids.ts"() {
|
|
52268
|
+
MAX_SHAPE_ID = 4294967295;
|
|
52269
|
+
ID_REFERENCE_TAGS = /* @__PURE__ */ new Set(["a:stCxn", "a:endCxn"]);
|
|
52270
|
+
SPID_REFERENCE_TAGS = /* @__PURE__ */ new Set([
|
|
52271
|
+
"p:spTgt",
|
|
52272
|
+
"p:bldP",
|
|
52273
|
+
"p:bldOleChart",
|
|
52274
|
+
"p:bldDgm",
|
|
52275
|
+
"p:bldGraphic",
|
|
52276
|
+
"p:inkTgt",
|
|
52277
|
+
"p:control"
|
|
52278
|
+
]);
|
|
52279
|
+
EDITOR_ANIMATION_ID_ATTRIBUTES = ["@_elementId", "@_triggerShapeId"];
|
|
52280
|
+
NV_CONTAINER_TAGS = [
|
|
52281
|
+
"p:nvSpPr",
|
|
52282
|
+
"p:nvPicPr",
|
|
52283
|
+
"p:nvCxnSpPr",
|
|
52284
|
+
"p:nvGrpSpPr",
|
|
52285
|
+
"p:nvGraphicFramePr",
|
|
52286
|
+
"p:nvContentPartPr",
|
|
52287
|
+
"p14:nvContentPartPr"
|
|
52288
|
+
];
|
|
52289
|
+
}
|
|
52290
|
+
});
|
|
52070
52291
|
function parseKinsoku(presentationXml3) {
|
|
52071
52292
|
if (!presentationXml3) {
|
|
52072
52293
|
return void 0;
|
|
@@ -52779,6 +53000,19 @@ var init_font_substitution = __esm({
|
|
|
52779
53000
|
// fallbacks must stay condensed, or short numeric labels sized to the
|
|
52780
53001
|
// narrow face overflow their text boxes and wrap (issue #132, "77%").
|
|
52781
53002
|
"Bebas Neue": ["Oswald", "Arial Narrow", "Impact", "sans-serif"],
|
|
53003
|
+
// Office stores named Source Sans weights as separate family names (e.g. a
|
|
53004
|
+
// theme authored with "Source Sans Pro ExtraLight" as its own face), while
|
|
53005
|
+
// Google Fonts and most local installs expose the base family with a
|
|
53006
|
+
// weight axis instead. Keep the authored face first for a browser that
|
|
53007
|
+
// does have it installed under that exact name, then fall back to the
|
|
53008
|
+
// metrically compatible base family before generic sans-serif.
|
|
53009
|
+
"Source Sans Pro ExtraLight": [
|
|
53010
|
+
"Source Sans Pro",
|
|
53011
|
+
"Calibri Light",
|
|
53012
|
+
"Segoe UI Light",
|
|
53013
|
+
"Arial",
|
|
53014
|
+
"sans-serif"
|
|
53015
|
+
],
|
|
52782
53016
|
"Century Gothic": ["URW Gothic", "Futura", "sans-serif"],
|
|
52783
53017
|
Oswald: ["Agency FB", "Arial Narrow", "sans-serif"],
|
|
52784
53018
|
"Franklin Gothic": ["Liberation Sans", "Helvetica Neue", "sans-serif"],
|
|
@@ -52878,6 +53112,11 @@ var init_pptx_validator_conformance_xml = __esm({
|
|
|
52878
53112
|
};
|
|
52879
53113
|
}
|
|
52880
53114
|
});
|
|
53115
|
+
var init_pptx_validator_content_order = __esm({
|
|
53116
|
+
"src/core/utils/pptx-validator-content-order.ts"() {
|
|
53117
|
+
init_pptx_validator_conformance_xml();
|
|
53118
|
+
}
|
|
53119
|
+
});
|
|
52881
53120
|
var init_pptx_validator_facet_constants = __esm({
|
|
52882
53121
|
"src/core/utils/pptx-validator-facet-constants.ts"() {
|
|
52883
53122
|
}
|
|
@@ -52898,6 +53137,12 @@ var init_pptx_validator_mce = __esm({
|
|
|
52898
53137
|
init_pptx_validator_conformance_xml();
|
|
52899
53138
|
}
|
|
52900
53139
|
});
|
|
53140
|
+
var init_pptx_validator_slide_parts = __esm({
|
|
53141
|
+
"src/core/utils/pptx-validator-slide-parts.ts"() {
|
|
53142
|
+
init_pptx_validator_conformance_xml();
|
|
53143
|
+
init_pptx_validator_content_order();
|
|
53144
|
+
}
|
|
53145
|
+
});
|
|
52901
53146
|
var init_pptx_validator_transitions = __esm({
|
|
52902
53147
|
"src/core/utils/pptx-validator-transitions.ts"() {
|
|
52903
53148
|
init_pptx_validator_conformance_xml();
|
|
@@ -52914,9 +53159,11 @@ var init_pptx_validator_transitions = __esm({
|
|
|
52914
53159
|
var init_pptx_validator_conformance = __esm({
|
|
52915
53160
|
"src/core/utils/pptx-validator-conformance.ts"() {
|
|
52916
53161
|
init_pptx_validator_conformance_xml();
|
|
53162
|
+
init_pptx_validator_content_order();
|
|
52917
53163
|
init_pptx_validator_facets();
|
|
52918
53164
|
init_pptx_validator_helpers();
|
|
52919
53165
|
init_pptx_validator_mce();
|
|
53166
|
+
init_pptx_validator_slide_parts();
|
|
52920
53167
|
init_pptx_validator_transitions();
|
|
52921
53168
|
}
|
|
52922
53169
|
});
|
|
@@ -52989,6 +53236,192 @@ var init_pptx_validator = __esm({
|
|
|
52989
53236
|
init_pptx_validator_repair();
|
|
52990
53237
|
}
|
|
52991
53238
|
});
|
|
53239
|
+
function normalizeFace(face) {
|
|
53240
|
+
return face?.trim().toLowerCase() ?? "";
|
|
53241
|
+
}
|
|
53242
|
+
function themeFace(scheme, role, script) {
|
|
53243
|
+
const group2 = role === "major" ? scheme?.majorFont : scheme?.minorFont;
|
|
53244
|
+
return group2?.[script] || group2?.latin;
|
|
53245
|
+
}
|
|
53246
|
+
function parseThemeFontToken(token2) {
|
|
53247
|
+
const match = token2?.trim().toLowerCase().match(TOKEN_PATTERN);
|
|
53248
|
+
if (!match) {
|
|
53249
|
+
return void 0;
|
|
53250
|
+
}
|
|
53251
|
+
const role = match[1] === "mj" ? "major" : "minor";
|
|
53252
|
+
const script = match[2] === "ea" ? "eastAsia" : match[2] === "cs" ? "complexScript" : "latin";
|
|
53253
|
+
return { role, script };
|
|
53254
|
+
}
|
|
53255
|
+
function placeholderFontRole(element) {
|
|
53256
|
+
const placeholderType2 = element.placeholderType?.trim().toLowerCase();
|
|
53257
|
+
if (!placeholderType2) {
|
|
53258
|
+
return void 0;
|
|
53259
|
+
}
|
|
53260
|
+
return placeholderType2 === "title" || placeholderType2 === "ctrtitle" ? "major" : "minor";
|
|
53261
|
+
}
|
|
53262
|
+
function resolveFace(current, token2, script, oldScheme, newScheme, fallbackRole) {
|
|
53263
|
+
const parsed = parseThemeFontToken(token2);
|
|
53264
|
+
if (parsed) {
|
|
53265
|
+
const linked = themeFace(newScheme, parsed.role, parsed.script);
|
|
53266
|
+
return linked && linked !== current ? linked : void 0;
|
|
53267
|
+
}
|
|
53268
|
+
if (!fallbackRole || !current) {
|
|
53269
|
+
return void 0;
|
|
53270
|
+
}
|
|
53271
|
+
const oldFace = themeFace(oldScheme, fallbackRole, script);
|
|
53272
|
+
const newFace = themeFace(newScheme, fallbackRole, script);
|
|
53273
|
+
if (!oldFace || !newFace || normalizeFace(current) !== normalizeFace(oldFace)) {
|
|
53274
|
+
return void 0;
|
|
53275
|
+
}
|
|
53276
|
+
return newFace !== current ? newFace : void 0;
|
|
53277
|
+
}
|
|
53278
|
+
function remapTextStyleFonts(style, oldScheme, newScheme, fallbackRole) {
|
|
53279
|
+
const latin = resolveFace(
|
|
53280
|
+
style.fontFamily,
|
|
53281
|
+
style.latinFontThemeToken,
|
|
53282
|
+
"latin",
|
|
53283
|
+
oldScheme,
|
|
53284
|
+
newScheme,
|
|
53285
|
+
fallbackRole
|
|
53286
|
+
);
|
|
53287
|
+
const eastAsia = resolveFace(
|
|
53288
|
+
style.eastAsiaFont,
|
|
53289
|
+
style.eastAsiaFontThemeToken,
|
|
53290
|
+
"eastAsia",
|
|
53291
|
+
oldScheme,
|
|
53292
|
+
newScheme,
|
|
53293
|
+
fallbackRole
|
|
53294
|
+
);
|
|
53295
|
+
const complexScript = resolveFace(
|
|
53296
|
+
style.complexScriptFont,
|
|
53297
|
+
style.complexScriptFontThemeToken,
|
|
53298
|
+
"complexScript",
|
|
53299
|
+
oldScheme,
|
|
53300
|
+
newScheme,
|
|
53301
|
+
fallbackRole
|
|
53302
|
+
);
|
|
53303
|
+
if (latin === void 0 && eastAsia === void 0 && complexScript === void 0) {
|
|
53304
|
+
return style;
|
|
53305
|
+
}
|
|
53306
|
+
return {
|
|
53307
|
+
...style,
|
|
53308
|
+
...latin !== void 0 && { fontFamily: latin },
|
|
53309
|
+
...eastAsia !== void 0 && { eastAsiaFont: eastAsia },
|
|
53310
|
+
...complexScript !== void 0 && { complexScriptFont: complexScript }
|
|
53311
|
+
};
|
|
53312
|
+
}
|
|
53313
|
+
function remapSegmentFonts(segments, oldScheme, newScheme, fallbackRole) {
|
|
53314
|
+
let changed = false;
|
|
53315
|
+
const next = segments.map((segment) => {
|
|
53316
|
+
if (!segment.style) {
|
|
53317
|
+
return segment;
|
|
53318
|
+
}
|
|
53319
|
+
const style = remapTextStyleFonts(segment.style, oldScheme, newScheme, fallbackRole);
|
|
53320
|
+
if (style === segment.style) {
|
|
53321
|
+
return segment;
|
|
53322
|
+
}
|
|
53323
|
+
changed = true;
|
|
53324
|
+
return { ...segment, style };
|
|
53325
|
+
});
|
|
53326
|
+
return changed ? next : segments;
|
|
53327
|
+
}
|
|
53328
|
+
function remapTableFonts(tableData, oldScheme, newScheme) {
|
|
53329
|
+
let changed = false;
|
|
53330
|
+
const rows = tableData.rows.map((row) => {
|
|
53331
|
+
let rowChanged = false;
|
|
53332
|
+
const cells2 = row.cells.map((cell) => {
|
|
53333
|
+
const face = resolveFace(
|
|
53334
|
+
cell.style?.fontFamily,
|
|
53335
|
+
void 0,
|
|
53336
|
+
"latin",
|
|
53337
|
+
oldScheme,
|
|
53338
|
+
newScheme,
|
|
53339
|
+
"minor"
|
|
53340
|
+
);
|
|
53341
|
+
if (face === void 0) {
|
|
53342
|
+
return cell;
|
|
53343
|
+
}
|
|
53344
|
+
rowChanged = true;
|
|
53345
|
+
return { ...cell, style: { ...cell.style, fontFamily: face } };
|
|
53346
|
+
});
|
|
53347
|
+
if (!rowChanged) {
|
|
53348
|
+
return row;
|
|
53349
|
+
}
|
|
53350
|
+
changed = true;
|
|
53351
|
+
return { ...row, cells: cells2 };
|
|
53352
|
+
});
|
|
53353
|
+
return changed ? { ...tableData, rows } : tableData;
|
|
53354
|
+
}
|
|
53355
|
+
function remapElementFonts(element, oldScheme, newScheme) {
|
|
53356
|
+
const patched = { ...element };
|
|
53357
|
+
let changed = false;
|
|
53358
|
+
const fallbackRole = placeholderFontRole(element);
|
|
53359
|
+
if ("textStyle" in element && element.textStyle) {
|
|
53360
|
+
const textStyle = remapTextStyleFonts(element.textStyle, oldScheme, newScheme, fallbackRole);
|
|
53361
|
+
if (textStyle !== element.textStyle) {
|
|
53362
|
+
patched.textStyle = textStyle;
|
|
53363
|
+
changed = true;
|
|
53364
|
+
}
|
|
53365
|
+
}
|
|
53366
|
+
if ("textSegments" in element && element.textSegments) {
|
|
53367
|
+
const textSegments = remapSegmentFonts(
|
|
53368
|
+
element.textSegments,
|
|
53369
|
+
oldScheme,
|
|
53370
|
+
newScheme,
|
|
53371
|
+
fallbackRole
|
|
53372
|
+
);
|
|
53373
|
+
if (textSegments !== element.textSegments) {
|
|
53374
|
+
patched.textSegments = textSegments;
|
|
53375
|
+
changed = true;
|
|
53376
|
+
}
|
|
53377
|
+
}
|
|
53378
|
+
if (element.type === "group" && element.children) {
|
|
53379
|
+
const children13 = reResolveElementFonts(element.children, oldScheme, newScheme);
|
|
53380
|
+
if (children13 !== element.children) {
|
|
53381
|
+
patched.children = children13;
|
|
53382
|
+
changed = true;
|
|
53383
|
+
}
|
|
53384
|
+
}
|
|
53385
|
+
if (element.type === "table" && element.tableData) {
|
|
53386
|
+
const tableData = remapTableFonts(element.tableData, oldScheme, newScheme);
|
|
53387
|
+
if (tableData !== element.tableData) {
|
|
53388
|
+
patched.tableData = tableData;
|
|
53389
|
+
changed = true;
|
|
53390
|
+
}
|
|
53391
|
+
}
|
|
53392
|
+
return changed ? patched : element;
|
|
53393
|
+
}
|
|
53394
|
+
function reResolveElementFonts(elements2, oldFontScheme, newFontScheme) {
|
|
53395
|
+
let changed = false;
|
|
53396
|
+
const next = elements2.map((element) => {
|
|
53397
|
+
const remapped = remapElementFonts(element, oldFontScheme, newFontScheme);
|
|
53398
|
+
if (remapped !== element) {
|
|
53399
|
+
changed = true;
|
|
53400
|
+
}
|
|
53401
|
+
return remapped;
|
|
53402
|
+
});
|
|
53403
|
+
return changed ? next : elements2;
|
|
53404
|
+
}
|
|
53405
|
+
function reResolveSlideFonts(slides, oldFontScheme, newFontScheme) {
|
|
53406
|
+
let changed = false;
|
|
53407
|
+
const next = slides.map((slide) => {
|
|
53408
|
+
const elements2 = reResolveElementFonts(slide.elements, oldFontScheme, newFontScheme);
|
|
53409
|
+
const notesSegments = slide.notesSegments ? remapSegmentFonts(slide.notesSegments, oldFontScheme, newFontScheme, "minor") : slide.notesSegments;
|
|
53410
|
+
const notesShapes = slide.notesShapes ? reResolveElementFonts(slide.notesShapes, oldFontScheme, newFontScheme) : slide.notesShapes;
|
|
53411
|
+
if (elements2 === slide.elements && notesSegments === slide.notesSegments && notesShapes === slide.notesShapes) {
|
|
53412
|
+
return slide;
|
|
53413
|
+
}
|
|
53414
|
+
changed = true;
|
|
53415
|
+
return { ...slide, elements: elements2, notesSegments, notesShapes };
|
|
53416
|
+
});
|
|
53417
|
+
return changed ? next : slides;
|
|
53418
|
+
}
|
|
53419
|
+
var TOKEN_PATTERN;
|
|
53420
|
+
var init_theme_font_switching = __esm({
|
|
53421
|
+
"src/core/utils/theme-font-switching.ts"() {
|
|
53422
|
+
TOKEN_PATTERN = /^\+(mj|mn)-(lt|ea|cs)$/u;
|
|
53423
|
+
}
|
|
53424
|
+
});
|
|
52992
53425
|
function normalizeHex2(hex4) {
|
|
52993
53426
|
if (!hex4) {
|
|
52994
53427
|
return "";
|
|
@@ -53001,7 +53434,7 @@ function buildColorRemapTable(oldColorMap, newColorMap) {
|
|
|
53001
53434
|
for (const key2 of allKeys) {
|
|
53002
53435
|
const oldVal = normalizeHex2(oldColorMap[key2]);
|
|
53003
53436
|
const newVal = normalizeHex2(newColorMap[key2]);
|
|
53004
|
-
if (oldVal && newVal && oldVal !== newVal) {
|
|
53437
|
+
if (oldVal && newVal && oldVal !== newVal && !remap.has(oldVal)) {
|
|
53005
53438
|
remap.set(oldVal, `#${newVal}`);
|
|
53006
53439
|
remap.set(`#${oldVal}`, `#${newVal}`);
|
|
53007
53440
|
}
|
|
@@ -53219,7 +53652,8 @@ function reResolveElementColors(elements2, oldColorMap, newColorScheme) {
|
|
|
53219
53652
|
function applyThemeToData(data, newColorScheme, newFontScheme, themeName) {
|
|
53220
53653
|
const oldColorMap = data.themeColorMap ?? {};
|
|
53221
53654
|
const newColorMap = buildThemeColorMap(newColorScheme);
|
|
53222
|
-
const
|
|
53655
|
+
const recolouredSlides = reResolveSlideColors(data.slides, oldColorMap, newColorScheme);
|
|
53656
|
+
const newSlides = newFontScheme ? reResolveSlideFonts(recolouredSlides, data.theme?.fontScheme, newFontScheme) : recolouredSlides;
|
|
53223
53657
|
const newTheme = {
|
|
53224
53658
|
...data.theme,
|
|
53225
53659
|
colorScheme: newColorScheme,
|
|
@@ -53238,6 +53672,7 @@ var init_theme_switching = __esm({
|
|
|
53238
53672
|
init_theme_color_ref();
|
|
53239
53673
|
init_theme();
|
|
53240
53674
|
init_gradient_angle();
|
|
53675
|
+
init_theme_font_switching();
|
|
53241
53676
|
}
|
|
53242
53677
|
});
|
|
53243
53678
|
function applyThemeOverrideToSlide(slide, baseColorScheme, nextOverride) {
|
|
@@ -60223,6 +60658,7 @@ var init_utils = __esm({
|
|
|
60223
60658
|
init_vml_parser();
|
|
60224
60659
|
init_activex_parser();
|
|
60225
60660
|
init_activex_serializer();
|
|
60661
|
+
init_shape_ids();
|
|
60226
60662
|
init_kinsoku_parser();
|
|
60227
60663
|
init_smart_tags_parser();
|
|
60228
60664
|
init_header_footer_placeholder();
|
|
@@ -60232,6 +60668,7 @@ var init_utils = __esm({
|
|
|
60232
60668
|
init_font_substitution();
|
|
60233
60669
|
init_pptx_validator();
|
|
60234
60670
|
init_theme_switching();
|
|
60671
|
+
init_theme_font_switching();
|
|
60235
60672
|
init_slide_theme_override();
|
|
60236
60673
|
init_smartart_layout_definition();
|
|
60237
60674
|
init_smartart_definition_metadata();
|
|
@@ -60474,14 +60911,109 @@ var init_custom_geometry_live_eval = __esm({
|
|
|
60474
60911
|
ensureArray7 = (value) => ensureArrayValue(value);
|
|
60475
60912
|
}
|
|
60476
60913
|
});
|
|
60477
|
-
|
|
60478
|
-
|
|
60914
|
+
function formatCoordinate(value) {
|
|
60915
|
+
return String(Number(value.toFixed(12)));
|
|
60916
|
+
}
|
|
60917
|
+
function flipPresetPath(pathData, width, height, flipH, flipV) {
|
|
60918
|
+
const tokens = pathData.match(PATH_TOKEN);
|
|
60919
|
+
if (!tokens) {
|
|
60920
|
+
return void 0;
|
|
60479
60921
|
}
|
|
60480
|
-
|
|
60922
|
+
const output = [];
|
|
60923
|
+
let command = "";
|
|
60924
|
+
let coordinateIndex = 0;
|
|
60925
|
+
for (const token2 of tokens) {
|
|
60926
|
+
if (/^[A-Z]$/u.test(token2)) {
|
|
60927
|
+
command = token2;
|
|
60928
|
+
coordinateIndex = 0;
|
|
60929
|
+
if (!(command in COMMAND_ARITY)) {
|
|
60930
|
+
return void 0;
|
|
60931
|
+
}
|
|
60932
|
+
output.push(command);
|
|
60933
|
+
continue;
|
|
60934
|
+
}
|
|
60935
|
+
const arity = COMMAND_ARITY[command];
|
|
60936
|
+
if (!arity || coordinateIndex >= arity) {
|
|
60937
|
+
return void 0;
|
|
60938
|
+
}
|
|
60939
|
+
const value = Number(token2);
|
|
60940
|
+
const isX = coordinateIndex % 2 === 0;
|
|
60941
|
+
const flipped = isX ? flipH ? width - value : value : flipV ? height - value : value;
|
|
60942
|
+
output.push(formatCoordinate(flipped));
|
|
60943
|
+
coordinateIndex += 1;
|
|
60944
|
+
}
|
|
60945
|
+
return output.join(" ");
|
|
60946
|
+
}
|
|
60947
|
+
function evaluateConnectorPresetPath(shapeType, width, height, adjustments, flipH, flipV) {
|
|
60948
|
+
if (!CONNECTOR_PRESET.test(shapeType)) {
|
|
60949
|
+
return void 0;
|
|
60950
|
+
}
|
|
60951
|
+
const pathData = evaluatePresetShape(shapeType, width, height, adjustments)?.svgPath;
|
|
60952
|
+
if (!pathData || !flipH && !flipV) {
|
|
60953
|
+
return pathData;
|
|
60954
|
+
}
|
|
60955
|
+
return flipPresetPath(pathData, width, height, flipH, flipV);
|
|
60956
|
+
}
|
|
60957
|
+
var CONNECTOR_PRESET;
|
|
60958
|
+
var PATH_TOKEN;
|
|
60959
|
+
var COMMAND_ARITY;
|
|
60960
|
+
var init_connector_preset_geometry = __esm({
|
|
60961
|
+
"src/core/geometry/connector-preset-geometry.ts"() {
|
|
60962
|
+
init_preset_shape_evaluator();
|
|
60963
|
+
CONNECTOR_PRESET = /^(?:bent|curved)connector[2-5]$/iu;
|
|
60964
|
+
PATH_TOKEN = /[MLQCZ]|[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/giu;
|
|
60965
|
+
COMMAND_ARITY = {
|
|
60966
|
+
M: 2,
|
|
60967
|
+
L: 2,
|
|
60968
|
+
Q: 4,
|
|
60969
|
+
C: 6,
|
|
60970
|
+
Z: 0
|
|
60971
|
+
};
|
|
60972
|
+
}
|
|
60973
|
+
});
|
|
60974
|
+
function getConnectorPathGeometry(element) {
|
|
60975
|
+
const width = Math.max(element.width, 0);
|
|
60976
|
+
const height = Math.max(element.height, 0);
|
|
60977
|
+
const shapeType = element.shapeType || "";
|
|
60978
|
+
const point = (x, y) => `${x} ${y}`;
|
|
60979
|
+
const rawSpPr = element.rawXml?.["p:spPr"];
|
|
60980
|
+
const rawXfrm = rawSpPr?.["a:xfrm"];
|
|
60981
|
+
const xmlBoolean = (value) => value === true || value === 1 || value === "1" || value === "true";
|
|
60982
|
+
const flipH = element.flipHorizontal ?? xmlBoolean(rawXfrm?.["@_flipH"]);
|
|
60983
|
+
const flipV = element.flipVertical ?? xmlBoolean(rawXfrm?.["@_flipV"]);
|
|
60984
|
+
const startX2 = flipH ? width : 0;
|
|
60985
|
+
const startY = flipV ? height : 0;
|
|
60986
|
+
const endX = flipH ? 0 : width;
|
|
60987
|
+
const endY = flipV ? 0 : height;
|
|
60988
|
+
const presetPath = evaluateConnectorPresetPath(
|
|
60989
|
+
shapeType,
|
|
60990
|
+
width,
|
|
60991
|
+
height,
|
|
60992
|
+
element.shapeAdjustments,
|
|
60993
|
+
flipH,
|
|
60994
|
+
flipV
|
|
60995
|
+
);
|
|
60996
|
+
if (presetPath) {
|
|
60997
|
+
return {
|
|
60998
|
+
startX: startX2,
|
|
60999
|
+
startY,
|
|
61000
|
+
endX,
|
|
61001
|
+
endY,
|
|
61002
|
+
pathData: presetPath
|
|
61003
|
+
};
|
|
61004
|
+
}
|
|
61005
|
+
return {
|
|
61006
|
+
startX: startX2,
|
|
61007
|
+
startY,
|
|
61008
|
+
endX,
|
|
61009
|
+
endY,
|
|
61010
|
+
pathData: `M ${point(startX2, startY)} L ${point(endX, endY)}`
|
|
61011
|
+
};
|
|
61012
|
+
}
|
|
60481
61013
|
var init_connector_geometry = __esm({
|
|
60482
61014
|
"src/core/geometry/connector-geometry.ts"() {
|
|
60483
61015
|
init_color_primitives();
|
|
60484
|
-
|
|
61016
|
+
init_connector_preset_geometry();
|
|
60485
61017
|
}
|
|
60486
61018
|
});
|
|
60487
61019
|
function isTextOrientationMatrix(value) {
|
|
@@ -70088,39 +70620,76 @@ function collectCnvPrNodes(node, results, ensureArray20) {
|
|
|
70088
70620
|
}
|
|
70089
70621
|
}
|
|
70090
70622
|
}
|
|
70623
|
+
var ShapeIdAllocator;
|
|
70091
70624
|
var PptxShapeIdValidator;
|
|
70092
70625
|
var init_PptxShapeIdValidator = __esm({
|
|
70093
70626
|
"src/core/core/builders/PptxShapeIdValidator.ts"() {
|
|
70627
|
+
init_shape_ids();
|
|
70628
|
+
ShapeIdAllocator = class {
|
|
70629
|
+
constructor(used, maxId) {
|
|
70630
|
+
this.used = used;
|
|
70631
|
+
this.maxId = maxId;
|
|
70632
|
+
}
|
|
70633
|
+
used;
|
|
70634
|
+
maxId;
|
|
70635
|
+
gapCursor = 1;
|
|
70636
|
+
next() {
|
|
70637
|
+
if (this.maxId < MAX_SHAPE_ID) {
|
|
70638
|
+
this.maxId += 1;
|
|
70639
|
+
this.used.add(this.maxId);
|
|
70640
|
+
return this.maxId;
|
|
70641
|
+
}
|
|
70642
|
+
while (this.gapCursor <= MAX_SHAPE_ID && this.used.has(this.gapCursor)) {
|
|
70643
|
+
this.gapCursor += 1;
|
|
70644
|
+
}
|
|
70645
|
+
if (this.gapCursor > MAX_SHAPE_ID) {
|
|
70646
|
+
throw new Error("No free DrawingML shape id left in this shape tree.");
|
|
70647
|
+
}
|
|
70648
|
+
this.used.add(this.gapCursor);
|
|
70649
|
+
return this.gapCursor;
|
|
70650
|
+
}
|
|
70651
|
+
};
|
|
70094
70652
|
PptxShapeIdValidator = class {
|
|
70095
|
-
validateAndDeduplicateIds(spTree, ensureArray20) {
|
|
70653
|
+
validateAndDeduplicateIds(spTree, ensureArray20, referenceRoot = spTree) {
|
|
70654
|
+
return this.repairShapeIds(spTree, ensureArray20, referenceRoot).reassigned;
|
|
70655
|
+
}
|
|
70656
|
+
/**
|
|
70657
|
+
* Same repair, but also returns the old-id -> new-id map so a caller can
|
|
70658
|
+
* replay it onto state that lives outside `referenceRoot` (the live element
|
|
70659
|
+
* model, a cached `rawTiming`, typed ActiveX controls).
|
|
70660
|
+
*/
|
|
70661
|
+
repairShapeIds(spTree, ensureArray20, referenceRoot = spTree) {
|
|
70662
|
+
const ids = /* @__PURE__ */ new Map();
|
|
70096
70663
|
const cNvPrNodes = [];
|
|
70097
70664
|
collectCnvPrNodes(spTree, cNvPrNodes, ensureArray20);
|
|
70098
70665
|
if (cNvPrNodes.length === 0) {
|
|
70099
|
-
return 0;
|
|
70666
|
+
return { reassigned: 0, ids };
|
|
70100
70667
|
}
|
|
70101
70668
|
const usedIds = /* @__PURE__ */ new Set();
|
|
70102
|
-
const
|
|
70669
|
+
const invalid = [];
|
|
70103
70670
|
let maxId = 0;
|
|
70104
70671
|
for (const cNvPr of cNvPrNodes) {
|
|
70105
|
-
const
|
|
70106
|
-
|
|
70672
|
+
const id = parseShapeId(cNvPr["@_id"], true);
|
|
70673
|
+
if (id === void 0 || id === 0 || usedIds.has(id)) {
|
|
70674
|
+
invalid.push(cNvPr);
|
|
70675
|
+
continue;
|
|
70676
|
+
}
|
|
70677
|
+
usedIds.add(id);
|
|
70107
70678
|
if (id > maxId) {
|
|
70108
70679
|
maxId = id;
|
|
70109
70680
|
}
|
|
70110
|
-
if (id === 0 || usedIds.has(id)) {
|
|
70111
|
-
duplicates.push(cNvPr);
|
|
70112
|
-
} else {
|
|
70113
|
-
usedIds.add(id);
|
|
70114
|
-
}
|
|
70115
70681
|
}
|
|
70116
|
-
|
|
70117
|
-
for (const cNvPr of
|
|
70118
|
-
|
|
70119
|
-
|
|
70120
|
-
|
|
70121
|
-
|
|
70682
|
+
const allocator = new ShapeIdAllocator(usedIds, maxId);
|
|
70683
|
+
for (const cNvPr of invalid) {
|
|
70684
|
+
const oldId = String(cNvPr["@_id"] ?? "").trim();
|
|
70685
|
+
const fresh = String(allocator.next());
|
|
70686
|
+
cNvPr["@_id"] = fresh;
|
|
70687
|
+
if (oldId.length > 0) {
|
|
70688
|
+
ids.set(oldId, fresh);
|
|
70689
|
+
}
|
|
70122
70690
|
}
|
|
70123
|
-
|
|
70691
|
+
remapShapeIdReferences(referenceRoot, ids);
|
|
70692
|
+
return { reassigned: invalid.length, ids };
|
|
70124
70693
|
}
|
|
70125
70694
|
};
|
|
70126
70695
|
}
|
|
@@ -78503,6 +79072,62 @@ var init_embedded_font_list = __esm({
|
|
|
78503
79072
|
};
|
|
78504
79073
|
}
|
|
78505
79074
|
});
|
|
79075
|
+
function partRelsPath(partPath) {
|
|
79076
|
+
const lastSlash = partPath.lastIndexOf("/");
|
|
79077
|
+
if (lastSlash < 0) {
|
|
79078
|
+
return `_rels/${partPath}.rels`;
|
|
79079
|
+
}
|
|
79080
|
+
const directory = partPath.slice(0, lastSlash);
|
|
79081
|
+
const fileName = partPath.slice(lastSlash + 1);
|
|
79082
|
+
return `${directory}/_rels/${fileName}.rels`;
|
|
79083
|
+
}
|
|
79084
|
+
var init_part_rels_path = __esm({
|
|
79085
|
+
"src/core/utils/part-rels-path.ts"() {
|
|
79086
|
+
}
|
|
79087
|
+
});
|
|
79088
|
+
function isEmptyTextElement(element) {
|
|
79089
|
+
if (element.type !== "text" || !hasTextProperties(element)) {
|
|
79090
|
+
return false;
|
|
79091
|
+
}
|
|
79092
|
+
if (element.text && element.text.trim().length > 0) {
|
|
79093
|
+
return false;
|
|
79094
|
+
}
|
|
79095
|
+
return !element.textSegments?.some((segment) => segment.text.trim().length > 0);
|
|
79096
|
+
}
|
|
79097
|
+
function enrichEmptyPlaceholderPrompts(elements2, resolver) {
|
|
79098
|
+
return elements2.map((element) => {
|
|
79099
|
+
if (!isEmptyTextElement(element) || element.promptText) {
|
|
79100
|
+
return element;
|
|
79101
|
+
}
|
|
79102
|
+
const defaults = resolver.resolveDefaults(element);
|
|
79103
|
+
const placeholderType2 = resolver.placeholderType(element);
|
|
79104
|
+
if (!defaults && placeholderType2 === void 0) {
|
|
79105
|
+
return element;
|
|
79106
|
+
}
|
|
79107
|
+
const textStyle = { ...element.textStyle ?? {} };
|
|
79108
|
+
if (defaults) {
|
|
79109
|
+
resolver.applyBodyDefaults(textStyle, defaults);
|
|
79110
|
+
const firstLevel = defaults.levelStyles?.[0];
|
|
79111
|
+
if (firstLevel) {
|
|
79112
|
+
resolver.applyLevelDefaults(textStyle, firstLevel);
|
|
79113
|
+
}
|
|
79114
|
+
}
|
|
79115
|
+
const enriched = {
|
|
79116
|
+
...element,
|
|
79117
|
+
...defaults?.promptText ? { promptText: defaults.promptText } : {},
|
|
79118
|
+
...Object.keys(textStyle).length > 0 ? { textStyle } : {}
|
|
79119
|
+
};
|
|
79120
|
+
if (placeholderType2 !== void 0) {
|
|
79121
|
+
enriched.placeholderType = placeholderType2;
|
|
79122
|
+
}
|
|
79123
|
+
return enriched;
|
|
79124
|
+
});
|
|
79125
|
+
}
|
|
79126
|
+
var init_layout_switch_placeholder_prompts = __esm({
|
|
79127
|
+
"src/core/core/runtime/layout-switch-placeholder-prompts.ts"() {
|
|
79128
|
+
init_types();
|
|
79129
|
+
}
|
|
79130
|
+
});
|
|
78506
79131
|
var DEFAULT_MAX_UNCOMPRESSED_BYTES;
|
|
78507
79132
|
var MAX_ZIP_ENTRY_COUNT;
|
|
78508
79133
|
var ZipBombError;
|
|
@@ -81492,19 +82117,6 @@ var init_color_scheme_index = __esm({
|
|
|
81492
82117
|
};
|
|
81493
82118
|
}
|
|
81494
82119
|
});
|
|
81495
|
-
function partRelsPath(partPath) {
|
|
81496
|
-
const lastSlash = partPath.lastIndexOf("/");
|
|
81497
|
-
if (lastSlash < 0) {
|
|
81498
|
-
return `_rels/${partPath}.rels`;
|
|
81499
|
-
}
|
|
81500
|
-
const directory = partPath.slice(0, lastSlash);
|
|
81501
|
-
const fileName = partPath.slice(lastSlash + 1);
|
|
81502
|
-
return `${directory}/_rels/${fileName}.rels`;
|
|
81503
|
-
}
|
|
81504
|
-
var init_part_rels_path = __esm({
|
|
81505
|
-
"src/core/utils/part-rels-path.ts"() {
|
|
81506
|
-
}
|
|
81507
|
-
});
|
|
81508
82120
|
function rememberAuxiliaryMasterUnparsedNodes(runtime, partPath, nodesByTag) {
|
|
81509
82121
|
let byPart = unparsedNodesByRuntime.get(runtime);
|
|
81510
82122
|
if (!byPart) {
|
|
@@ -81562,6 +82174,16 @@ function masterPartElementSignature(elements2) {
|
|
|
81562
82174
|
return "";
|
|
81563
82175
|
}
|
|
81564
82176
|
}
|
|
82177
|
+
function templateElementSignature(element) {
|
|
82178
|
+
try {
|
|
82179
|
+
return JSON.stringify(
|
|
82180
|
+
element,
|
|
82181
|
+
(key2, value) => TEMPLATE_ELEMENT_SKIP_KEYS.has(key2) ? void 0 : value
|
|
82182
|
+
);
|
|
82183
|
+
} catch {
|
|
82184
|
+
return "";
|
|
82185
|
+
}
|
|
82186
|
+
}
|
|
81565
82187
|
function rememberMasterPartElementSignature(runtime, partPath, elements2) {
|
|
81566
82188
|
let byPart = signaturesByRuntime.get(runtime);
|
|
81567
82189
|
if (!byPart) {
|
|
@@ -81582,6 +82204,7 @@ function masterPartElementsChanged(runtime, partPath, elements2) {
|
|
|
81582
82204
|
}
|
|
81583
82205
|
var signaturesByRuntime;
|
|
81584
82206
|
var SIGNATURE_SKIP_KEYS;
|
|
82207
|
+
var TEMPLATE_ELEMENT_SKIP_KEYS;
|
|
81585
82208
|
var init_master_part_element_signature = __esm({
|
|
81586
82209
|
"src/core/core/runtime/master-part-element-signature.ts"() {
|
|
81587
82210
|
signaturesByRuntime = /* @__PURE__ */ new WeakMap();
|
|
@@ -81593,6 +82216,10 @@ var init_master_part_element_signature = __esm({
|
|
|
81593
82216
|
"posterSrc",
|
|
81594
82217
|
"thumbnailSrc"
|
|
81595
82218
|
]);
|
|
82219
|
+
TEMPLATE_ELEMENT_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
82220
|
+
...SIGNATURE_SKIP_KEYS,
|
|
82221
|
+
"shapeId"
|
|
82222
|
+
]);
|
|
81596
82223
|
}
|
|
81597
82224
|
});
|
|
81598
82225
|
function masterPartIdPrefix(rootTag2, partPath) {
|
|
@@ -82870,6 +83497,86 @@ var init_pptx_print_properties = __esm({
|
|
|
82870
83497
|
findKey13 = (node, name) => Object.keys(node).find((key2) => localName20(key2) === name);
|
|
82871
83498
|
}
|
|
82872
83499
|
});
|
|
83500
|
+
function canonicalPlaceholderType(value) {
|
|
83501
|
+
const text22 = String(value ?? "").trim();
|
|
83502
|
+
if (text22.length === 0) {
|
|
83503
|
+
return void 0;
|
|
83504
|
+
}
|
|
83505
|
+
return CANONICAL_BY_LOWER2.get(text22.toLowerCase());
|
|
83506
|
+
}
|
|
83507
|
+
function canonicalizePlaceholderTypes(root) {
|
|
83508
|
+
let changed = 0;
|
|
83509
|
+
const visit = (value, tag) => {
|
|
83510
|
+
if (Array.isArray(value)) {
|
|
83511
|
+
for (const item of value) {
|
|
83512
|
+
visit(item, tag);
|
|
83513
|
+
}
|
|
83514
|
+
return;
|
|
83515
|
+
}
|
|
83516
|
+
if (!value || typeof value !== "object") {
|
|
83517
|
+
return;
|
|
83518
|
+
}
|
|
83519
|
+
const node = value;
|
|
83520
|
+
if (tag === "p:ph" && node["@_type"] !== void 0) {
|
|
83521
|
+
const canonical = canonicalPlaceholderType(node["@_type"]);
|
|
83522
|
+
if (canonical !== void 0 && canonical !== String(node["@_type"])) {
|
|
83523
|
+
node["@_type"] = canonical;
|
|
83524
|
+
changed += 1;
|
|
83525
|
+
}
|
|
83526
|
+
}
|
|
83527
|
+
for (const [key2, child262] of Object.entries(node)) {
|
|
83528
|
+
if (!key2.startsWith("@_")) {
|
|
83529
|
+
visit(child262, key2);
|
|
83530
|
+
}
|
|
83531
|
+
}
|
|
83532
|
+
};
|
|
83533
|
+
visit(root, "");
|
|
83534
|
+
return changed;
|
|
83535
|
+
}
|
|
83536
|
+
var VALID_PLACEHOLDER_TYPES;
|
|
83537
|
+
var CANONICAL_BY_LOWER2;
|
|
83538
|
+
var init_placeholder_validation = __esm({
|
|
83539
|
+
"src/core/utils/placeholder-validation.ts"() {
|
|
83540
|
+
VALID_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set([
|
|
83541
|
+
"body",
|
|
83542
|
+
"chart",
|
|
83543
|
+
"clipArt",
|
|
83544
|
+
"ctrTitle",
|
|
83545
|
+
"dgm",
|
|
83546
|
+
"dt",
|
|
83547
|
+
"ftr",
|
|
83548
|
+
"hdr",
|
|
83549
|
+
"media",
|
|
83550
|
+
"obj",
|
|
83551
|
+
"pic",
|
|
83552
|
+
"sldImg",
|
|
83553
|
+
"sldNum",
|
|
83554
|
+
"subTitle",
|
|
83555
|
+
"tbl",
|
|
83556
|
+
"title",
|
|
83557
|
+
// Additional types from extended specs
|
|
83558
|
+
"half",
|
|
83559
|
+
"qtr",
|
|
83560
|
+
"txAndClipArt",
|
|
83561
|
+
"txAndChart",
|
|
83562
|
+
"txAndMedia",
|
|
83563
|
+
"txAndObj",
|
|
83564
|
+
"txAndTwoObj",
|
|
83565
|
+
"txOverObj",
|
|
83566
|
+
"objAndTx",
|
|
83567
|
+
"twoObj",
|
|
83568
|
+
"twoObjAndObj",
|
|
83569
|
+
"twoObjAndTx",
|
|
83570
|
+
"twoObjOverTx",
|
|
83571
|
+
"objOverTx",
|
|
83572
|
+
"twoColTx",
|
|
83573
|
+
"fourObj"
|
|
83574
|
+
]);
|
|
83575
|
+
CANONICAL_BY_LOWER2 = new Map(
|
|
83576
|
+
Array.from(VALID_PLACEHOLDER_TYPES, (type) => [type.toLowerCase(), type])
|
|
83577
|
+
);
|
|
83578
|
+
}
|
|
83579
|
+
});
|
|
82873
83580
|
function elementRectEmu(el) {
|
|
82874
83581
|
return {
|
|
82875
83582
|
x: el.xEmu ?? Math.round(el.x * EMU_PER_PX),
|
|
@@ -84975,10 +85682,10 @@ var init_group_writer = __esm({
|
|
|
84975
85682
|
ZERO_RECT = { x: 0, y: 0, w: 0, h: 0 };
|
|
84976
85683
|
}
|
|
84977
85684
|
});
|
|
84978
|
-
var
|
|
85685
|
+
var ShapeIdAllocator2;
|
|
84979
85686
|
var init_shape_id_allocator = __esm({
|
|
84980
85687
|
"src/core/ppt/writer/shape-id-allocator.ts"() {
|
|
84981
|
-
|
|
85688
|
+
ShapeIdAllocator2 = class {
|
|
84982
85689
|
current;
|
|
84983
85690
|
constructor(drawingId, clusterSize) {
|
|
84984
85691
|
this.current = drawingId * clusterSize - 1;
|
|
@@ -85014,7 +85721,7 @@ function buildBackgroundShape(rgb2, allocator) {
|
|
|
85014
85721
|
return record(OA.SpContainer, data, 0, true);
|
|
85015
85722
|
}
|
|
85016
85723
|
function buildDrawing(canvasRect, shapes, backgroundRgb, fonts, drawingId, hyperlinks, oleEmbeds, mediaEmbeds) {
|
|
85017
|
-
const allocator = new
|
|
85724
|
+
const allocator = new ShapeIdAllocator2(drawingId, SHAPE_ID_CLUSTER_SIZE2);
|
|
85018
85725
|
const spgrData = new ByteWriter().bytes(buildCanvasPatriarch(allocator));
|
|
85019
85726
|
if (backgroundRgb) {
|
|
85020
85727
|
spgrData.bytes(buildBackgroundShape(backgroundRgb, allocator));
|
|
@@ -91113,7 +91820,7 @@ function scorePlaceholderMatch(element, source, target) {
|
|
|
91113
91820
|
}
|
|
91114
91821
|
const sourceType = normalizeType(source.type);
|
|
91115
91822
|
const targetType = normalizeType(target.type);
|
|
91116
|
-
let score =
|
|
91823
|
+
let score = 1;
|
|
91117
91824
|
if (source.idx !== void 0 && source.idx === target.idx) {
|
|
91118
91825
|
score += 100;
|
|
91119
91826
|
}
|
|
@@ -93645,11 +94352,97 @@ var init_SvgExporter = __esm({
|
|
|
93645
94352
|
};
|
|
93646
94353
|
}
|
|
93647
94354
|
});
|
|
94355
|
+
var TemplateElementBaselineTracker;
|
|
94356
|
+
var init_template_element_baselines = __esm({
|
|
94357
|
+
"src/core/core/runtime/template-element-baselines.ts"() {
|
|
94358
|
+
init_master_part_element_signature();
|
|
94359
|
+
TemplateElementBaselineTracker = class {
|
|
94360
|
+
/** Element id -> signature of the copy the owning part currently holds. */
|
|
94361
|
+
baselines = /* @__PURE__ */ new Map();
|
|
94362
|
+
/** Copies superseded by a written edit; skipped on every later save. */
|
|
94363
|
+
stale = /* @__PURE__ */ new WeakSet();
|
|
94364
|
+
/** Element id -> signature written back during the save in progress. */
|
|
94365
|
+
pending = /* @__PURE__ */ new Map();
|
|
94366
|
+
/** Every copy the save in progress looked at, keyed by element id. */
|
|
94367
|
+
seen = /* @__PURE__ */ new Map();
|
|
94368
|
+
/** Forget everything; called wherever the other per-load caches are cleared. */
|
|
94369
|
+
reset() {
|
|
94370
|
+
this.baselines.clear();
|
|
94371
|
+
this.pending.clear();
|
|
94372
|
+
this.seen.clear();
|
|
94373
|
+
this.stale = /* @__PURE__ */ new WeakSet();
|
|
94374
|
+
}
|
|
94375
|
+
/**
|
|
94376
|
+
* Record the as-parsed signature of freshly produced inherited copies. A
|
|
94377
|
+
* baseline is written once per id: a later re-parse of the same part (layout
|
|
94378
|
+
* switch, preview decoding) must not move it, because the part's XML may by
|
|
94379
|
+
* then already carry an edit the tracker has committed.
|
|
94380
|
+
*/
|
|
94381
|
+
recordBaselines(elements2) {
|
|
94382
|
+
for (const element of elements2) {
|
|
94383
|
+
if (!this.baselines.has(element.id)) {
|
|
94384
|
+
this.baselines.set(element.id, templateElementSignature(element));
|
|
94385
|
+
}
|
|
94386
|
+
}
|
|
94387
|
+
}
|
|
94388
|
+
/** Drop any bookkeeping left over from a save that did not complete. */
|
|
94389
|
+
beginSave() {
|
|
94390
|
+
this.pending.clear();
|
|
94391
|
+
this.seen.clear();
|
|
94392
|
+
}
|
|
94393
|
+
/**
|
|
94394
|
+
* Decide whether the save writer has to write this copy back into its
|
|
94395
|
+
* part. `false` means the part already holds it (or a newer edit of it),
|
|
94396
|
+
* so the shared `rawXml` must be left untouched.
|
|
94397
|
+
*/
|
|
94398
|
+
shouldWriteBack(element) {
|
|
94399
|
+
if (this.stale.has(element)) {
|
|
94400
|
+
return false;
|
|
94401
|
+
}
|
|
94402
|
+
const signature = templateElementSignature(element);
|
|
94403
|
+
this.remember(element, signature);
|
|
94404
|
+
const baseline = this.baselines.get(element.id);
|
|
94405
|
+
if (baseline !== void 0 && baseline === signature) {
|
|
94406
|
+
return false;
|
|
94407
|
+
}
|
|
94408
|
+
this.pending.set(element.id, signature);
|
|
94409
|
+
return true;
|
|
94410
|
+
}
|
|
94411
|
+
/**
|
|
94412
|
+
* Promote the signatures written during this save to baselines, and mark
|
|
94413
|
+
* every other copy of the same id that still matched the previous baseline
|
|
94414
|
+
* as stale.
|
|
94415
|
+
*/
|
|
94416
|
+
commitSave() {
|
|
94417
|
+
for (const [id, signature] of this.pending) {
|
|
94418
|
+
const previous = this.baselines.get(id);
|
|
94419
|
+
for (const copy2 of this.seen.get(id) ?? []) {
|
|
94420
|
+
if (copy2.signature !== signature && copy2.signature === previous) {
|
|
94421
|
+
this.stale.add(copy2.element);
|
|
94422
|
+
}
|
|
94423
|
+
}
|
|
94424
|
+
this.baselines.set(id, signature);
|
|
94425
|
+
}
|
|
94426
|
+
this.pending.clear();
|
|
94427
|
+
this.seen.clear();
|
|
94428
|
+
}
|
|
94429
|
+
remember(element, signature) {
|
|
94430
|
+
const copies = this.seen.get(element.id);
|
|
94431
|
+
if (copies) {
|
|
94432
|
+
copies.push({ element, signature });
|
|
94433
|
+
} else {
|
|
94434
|
+
this.seen.set(element.id, [{ element, signature }]);
|
|
94435
|
+
}
|
|
94436
|
+
}
|
|
94437
|
+
};
|
|
94438
|
+
}
|
|
94439
|
+
});
|
|
93648
94440
|
var PptxHandlerRuntime;
|
|
93649
94441
|
var init_PptxHandlerRuntimeState = __esm({
|
|
93650
94442
|
"src/core/core/runtime/PptxHandlerRuntimeState.ts"() {
|
|
93651
94443
|
init_utils();
|
|
93652
94444
|
init_part_rels_path();
|
|
94445
|
+
init_template_element_baselines();
|
|
93653
94446
|
PptxHandlerRuntime = class {
|
|
93654
94447
|
/** The in-memory ZIP archive representing the OPC (.pptx) package. */
|
|
93655
94448
|
zip;
|
|
@@ -93679,6 +94472,13 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
93679
94472
|
layoutCache = /* @__PURE__ */ new Map();
|
|
93680
94473
|
/** Cached parsed master elements keyed by master archive path. */
|
|
93681
94474
|
masterCache = /* @__PURE__ */ new Map();
|
|
94475
|
+
/**
|
|
94476
|
+
* As-parsed signatures of the `layout-` / `master-` element copies merged
|
|
94477
|
+
* into slides, plus the copies a later edit has superseded. Lets the save
|
|
94478
|
+
* writer patch a shared template `rawXml` node only from the copy that was
|
|
94479
|
+
* actually edited; see `template-element-baselines.ts`.
|
|
94480
|
+
*/
|
|
94481
|
+
templateElementBaselines = new TemplateElementBaselineTracker();
|
|
93682
94482
|
/** Raw parsed layout XML objects keyed by layout archive path. */
|
|
93683
94483
|
layoutXmlMap = /* @__PURE__ */ new Map();
|
|
93684
94484
|
/** Raw parsed master XML objects keyed by master archive path. */
|
|
@@ -99527,6 +100327,7 @@ var init_PptxHandlerRuntimeTextEditing = __esm({
|
|
|
99527
100327
|
}
|
|
99528
100328
|
});
|
|
99529
100329
|
var PptxHandlerRuntime21;
|
|
100330
|
+
var NON_MATERIALIZED_PLACEHOLDER_TYPES;
|
|
99530
100331
|
var init_PptxHandlerRuntimeLayoutSwitching = __esm({
|
|
99531
100332
|
"src/core/core/runtime/PptxHandlerRuntimeLayoutSwitching.ts"() {
|
|
99532
100333
|
init_constants();
|
|
@@ -99746,11 +100547,15 @@ var init_PptxHandlerRuntimeLayoutSwitching = __esm({
|
|
|
99746
100547
|
...slot,
|
|
99747
100548
|
matched: false
|
|
99748
100549
|
}));
|
|
99749
|
-
const
|
|
99750
|
-
|
|
100550
|
+
const claimOrder = [
|
|
100551
|
+
...elements2.filter((element) => !this.isUntouchedPlaceholderPrompt(element)),
|
|
100552
|
+
...elements2.filter((element) => this.isUntouchedPlaceholderPrompt(element))
|
|
100553
|
+
];
|
|
100554
|
+
const remappedByElement = /* @__PURE__ */ new Map();
|
|
100555
|
+
for (const element of claimOrder) {
|
|
99751
100556
|
const phInfo = this.getElementPlaceholderInfo(element);
|
|
99752
100557
|
if (!phInfo) {
|
|
99753
|
-
|
|
100558
|
+
remappedByElement.set(element, element);
|
|
99754
100559
|
continue;
|
|
99755
100560
|
}
|
|
99756
100561
|
let resolvedLayoutPh;
|
|
@@ -99789,18 +100594,31 @@ var init_PptxHandlerRuntimeLayoutSwitching = __esm({
|
|
|
99789
100594
|
if (updatedElement.rawXml) {
|
|
99790
100595
|
retargetPlaceholder(updatedElement.rawXml, resolvedLayoutPh.phInfo);
|
|
99791
100596
|
}
|
|
99792
|
-
|
|
99793
|
-
|
|
99794
|
-
|
|
100597
|
+
const retyped = updatedElement;
|
|
100598
|
+
if (resolvedLayoutPh.phInfo.type) {
|
|
100599
|
+
retyped.placeholderType = resolvedLayoutPh.phInfo.type;
|
|
100600
|
+
} else {
|
|
100601
|
+
delete retyped.placeholderType;
|
|
100602
|
+
}
|
|
100603
|
+
remappedByElement.set(element, updatedElement);
|
|
100604
|
+
} else {
|
|
100605
|
+
remappedByElement.set(element, this.isUntouchedPlaceholderPrompt(element) ? null : element);
|
|
100606
|
+
}
|
|
100607
|
+
}
|
|
100608
|
+
const resultElements = [];
|
|
100609
|
+
for (const element of elements2) {
|
|
100610
|
+
const remapped = remappedByElement.get(element);
|
|
100611
|
+
if (remapped) {
|
|
100612
|
+
resultElements.push(remapped);
|
|
99795
100613
|
}
|
|
99796
100614
|
}
|
|
99797
100615
|
let slotIndex = 0;
|
|
100616
|
+
const generatedElements = [];
|
|
99798
100617
|
for (const lp of targets) {
|
|
99799
100618
|
if (lp.matched) {
|
|
99800
100619
|
continue;
|
|
99801
100620
|
}
|
|
99802
|
-
|
|
99803
|
-
if (lp.phInfo.type && skipTypes.has(lp.phInfo.type)) {
|
|
100621
|
+
if (lp.phInfo.type && NON_MATERIALIZED_PLACEHOLDER_TYPES.has(lp.phInfo.type)) {
|
|
99804
100622
|
continue;
|
|
99805
100623
|
}
|
|
99806
100624
|
const emptyElement = createEmptyPlaceholderElement(
|
|
@@ -99812,12 +100630,25 @@ var init_PptxHandlerRuntimeLayoutSwitching = __esm({
|
|
|
99812
100630
|
`${newLayoutPath}-${slotIndex++}-${Date.now()}`
|
|
99813
100631
|
);
|
|
99814
100632
|
if (emptyElement) {
|
|
99815
|
-
|
|
100633
|
+
generatedElements.push(emptyElement);
|
|
99816
100634
|
}
|
|
99817
100635
|
}
|
|
99818
|
-
return resultElements;
|
|
100636
|
+
return [...generatedElements, ...resultElements];
|
|
99819
100637
|
}
|
|
99820
100638
|
};
|
|
100639
|
+
NON_MATERIALIZED_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set([
|
|
100640
|
+
"dt",
|
|
100641
|
+
"ftr",
|
|
100642
|
+
"sldnum",
|
|
100643
|
+
"hdr",
|
|
100644
|
+
"pic",
|
|
100645
|
+
"clipart",
|
|
100646
|
+
"chart",
|
|
100647
|
+
"tbl",
|
|
100648
|
+
"dgm",
|
|
100649
|
+
"media",
|
|
100650
|
+
"sldimg"
|
|
100651
|
+
]);
|
|
99821
100652
|
}
|
|
99822
100653
|
});
|
|
99823
100654
|
function writeCellFill(tcPr, style, resolveColorXml) {
|
|
@@ -103930,12 +104761,8 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
|
|
|
103930
104761
|
continue;
|
|
103931
104762
|
}
|
|
103932
104763
|
const isPresentationXml = path === "ppt/presentation.xml";
|
|
103933
|
-
if (!isPresentationXml) {
|
|
103934
|
-
|
|
103935
|
-
const hasConvertibleUri = candidateUris?.some((uri) => isTransitionalNamespaceUri(uri));
|
|
103936
|
-
if (!hasConvertibleUri) {
|
|
103937
|
-
continue;
|
|
103938
|
-
}
|
|
104764
|
+
if (!isPresentationXml && !containsConvertibleStrictNamespaceAttribute(xmlText2)) {
|
|
104765
|
+
continue;
|
|
103939
104766
|
}
|
|
103940
104767
|
try {
|
|
103941
104768
|
const parsed = parse2(xmlText2);
|
|
@@ -105442,6 +106269,16 @@ var init_PptxHandlerRuntimeSaveTextWriter = __esm({
|
|
|
105442
106269
|
};
|
|
105443
106270
|
}
|
|
105444
106271
|
});
|
|
106272
|
+
function shouldWritePictureGeometry(el, spPr) {
|
|
106273
|
+
if (el.type !== "picture" && el.type !== "image") {
|
|
106274
|
+
return true;
|
|
106275
|
+
}
|
|
106276
|
+
return Boolean(spPr["a:prstGeom"] || spPr["a:custGeom"]);
|
|
106277
|
+
}
|
|
106278
|
+
var init_save_picture_geometry_gate = __esm({
|
|
106279
|
+
"src/core/core/runtime/save-picture-geometry-gate.ts"() {
|
|
106280
|
+
}
|
|
106281
|
+
});
|
|
105445
106282
|
function getMediaReferenceContainer(shape) {
|
|
105446
106283
|
if (!shape) {
|
|
105447
106284
|
return void 0;
|
|
@@ -105463,6 +106300,7 @@ var init_PptxHandlerRuntimeSaveElementEmbedding = __esm({
|
|
|
105463
106300
|
init_drawing_media_reference();
|
|
105464
106301
|
init_xml_access();
|
|
105465
106302
|
init_PptxHandlerRuntimeSaveTextWriter();
|
|
106303
|
+
init_save_picture_geometry_gate();
|
|
105466
106304
|
PptxHandlerRuntime32 = class extends PptxHandlerRuntime31 {
|
|
105467
106305
|
/** Serialize table, chart, and SmartArt data when applicable. */
|
|
105468
106306
|
applyDataSerialization(shape, el, slideId) {
|
|
@@ -105504,7 +106342,7 @@ var init_PptxHandlerRuntimeSaveElementEmbedding = __esm({
|
|
|
105504
106342
|
return;
|
|
105505
106343
|
}
|
|
105506
106344
|
const spPr = ensureXmlChild(shape, "p:spPr");
|
|
105507
|
-
if (!spPr) {
|
|
106345
|
+
if (!spPr || !shouldWritePictureGeometry(el, spPr)) {
|
|
105508
106346
|
return;
|
|
105509
106347
|
}
|
|
105510
106348
|
const elWithPaths = el;
|
|
@@ -107360,6 +108198,9 @@ var init_PptxHandlerRuntimeSaveElementWriter = __esm({
|
|
|
107360
108198
|
* transforms, geometry, styles, text, and sorts into collectors.
|
|
107361
108199
|
*/
|
|
107362
108200
|
processSlideElement(el, collectors, ctx) {
|
|
108201
|
+
if (this.isOwnTemplateElement(el, ctx) && !this.templateElementBaselines.shouldWriteBack(el)) {
|
|
108202
|
+
return;
|
|
108203
|
+
}
|
|
107363
108204
|
let shape = el.rawXml;
|
|
107364
108205
|
if ((el.type === "picture" || el.type === "image") && typeof el.imageData === "string") {
|
|
107365
108206
|
shape = this.processImageEmbedding(el, shape, ctx) ?? shape;
|
|
@@ -107542,6 +108383,135 @@ var init_PptxHandlerRuntimeSaveElementWriter = __esm({
|
|
|
107542
108383
|
};
|
|
107543
108384
|
}
|
|
107544
108385
|
});
|
|
108386
|
+
function structuralPartRootTag(path) {
|
|
108387
|
+
return PART_ROOT_BY_PATH.find(([pattern]) => pattern.test(path))?.[1];
|
|
108388
|
+
}
|
|
108389
|
+
function spTreeOfPartRoot(root) {
|
|
108390
|
+
const cSld = root?.["p:cSld"];
|
|
108391
|
+
return cSld?.["p:spTree"];
|
|
108392
|
+
}
|
|
108393
|
+
function prescanStructuralPart(xml) {
|
|
108394
|
+
let suspectIds = false;
|
|
108395
|
+
const seen = /* @__PURE__ */ new Set();
|
|
108396
|
+
for (const match of xml.matchAll(CNVPR_ID_RE)) {
|
|
108397
|
+
const id = parseShapeId(match[1] ?? match[2], true);
|
|
108398
|
+
if (id === void 0 || seen.has(id)) {
|
|
108399
|
+
suspectIds = true;
|
|
108400
|
+
break;
|
|
108401
|
+
}
|
|
108402
|
+
seen.add(id);
|
|
108403
|
+
}
|
|
108404
|
+
let placeholderCasing = false;
|
|
108405
|
+
for (const match of xml.matchAll(PH_TYPE_RE)) {
|
|
108406
|
+
const raw = match[1] ?? match[2] ?? "";
|
|
108407
|
+
const canonical = canonicalPlaceholderType(raw);
|
|
108408
|
+
if (canonical !== void 0 && canonical !== raw) {
|
|
108409
|
+
placeholderCasing = true;
|
|
108410
|
+
break;
|
|
108411
|
+
}
|
|
108412
|
+
}
|
|
108413
|
+
return { suspectIds, placeholderCasing };
|
|
108414
|
+
}
|
|
108415
|
+
function countDeclaredIds(node, counts, ensureArray20) {
|
|
108416
|
+
for (const [nvTag, cNvPrTag] of NV_CONTAINERS3) {
|
|
108417
|
+
const cNvPr = node[nvTag]?.[cNvPrTag];
|
|
108418
|
+
if (!cNvPr) {
|
|
108419
|
+
continue;
|
|
108420
|
+
}
|
|
108421
|
+
const id = parseShapeId(cNvPr["@_id"], true);
|
|
108422
|
+
if (id === void 0) {
|
|
108423
|
+
return false;
|
|
108424
|
+
}
|
|
108425
|
+
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
108426
|
+
}
|
|
108427
|
+
for (const listKey of SHAPE_LISTS) {
|
|
108428
|
+
for (const child262 of ensureArray20(node[listKey])) {
|
|
108429
|
+
if (!countDeclaredIds(child262, counts, ensureArray20)) {
|
|
108430
|
+
return false;
|
|
108431
|
+
}
|
|
108432
|
+
}
|
|
108433
|
+
}
|
|
108434
|
+
for (const envelope of ensureArray20(node["mc:AlternateContent"])) {
|
|
108435
|
+
const merged = /* @__PURE__ */ new Map();
|
|
108436
|
+
for (const branchKey of ["mc:Choice", "mc:Fallback"]) {
|
|
108437
|
+
for (const branch of ensureArray20(envelope[branchKey])) {
|
|
108438
|
+
const branchCounts = /* @__PURE__ */ new Map();
|
|
108439
|
+
if (!countDeclaredIds(branch, branchCounts, ensureArray20)) {
|
|
108440
|
+
return false;
|
|
108441
|
+
}
|
|
108442
|
+
for (const [id, count] of branchCounts) {
|
|
108443
|
+
merged.set(id, Math.max(merged.get(id) ?? 0, count));
|
|
108444
|
+
}
|
|
108445
|
+
}
|
|
108446
|
+
}
|
|
108447
|
+
for (const [id, count] of merged) {
|
|
108448
|
+
counts.set(id, (counts.get(id) ?? 0) + count);
|
|
108449
|
+
}
|
|
108450
|
+
}
|
|
108451
|
+
return true;
|
|
108452
|
+
}
|
|
108453
|
+
function hasStructuralIdDefects(spTree, ensureArray20) {
|
|
108454
|
+
const counts = /* @__PURE__ */ new Map();
|
|
108455
|
+
if (!countDeclaredIds(spTree, counts, ensureArray20)) {
|
|
108456
|
+
return true;
|
|
108457
|
+
}
|
|
108458
|
+
for (const count of counts.values()) {
|
|
108459
|
+
if (count > 1) {
|
|
108460
|
+
return true;
|
|
108461
|
+
}
|
|
108462
|
+
}
|
|
108463
|
+
return false;
|
|
108464
|
+
}
|
|
108465
|
+
function applyShapeIdMapToSlide(slide, ids) {
|
|
108466
|
+
if (ids.size === 0) {
|
|
108467
|
+
return;
|
|
108468
|
+
}
|
|
108469
|
+
remapElementShapeIds(
|
|
108470
|
+
slide.elements.filter((element) => !isTemplateElementId(element.id)),
|
|
108471
|
+
ids
|
|
108472
|
+
);
|
|
108473
|
+
if (slide.rawTiming) {
|
|
108474
|
+
remapShapeIdReferences(slide.rawTiming, ids);
|
|
108475
|
+
}
|
|
108476
|
+
for (const control of slide.activeXControls ?? []) {
|
|
108477
|
+
const replacement = control.shapeId === void 0 ? void 0 : ids.get(control.shapeId.trim());
|
|
108478
|
+
if (replacement !== void 0) {
|
|
108479
|
+
control.shapeId = replacement;
|
|
108480
|
+
}
|
|
108481
|
+
}
|
|
108482
|
+
}
|
|
108483
|
+
var PART_ROOT_BY_PATH;
|
|
108484
|
+
var CNVPR_ID_RE;
|
|
108485
|
+
var PH_TYPE_RE;
|
|
108486
|
+
var NV_CONTAINERS3;
|
|
108487
|
+
var SHAPE_LISTS;
|
|
108488
|
+
var init_save_structural_id_gate = __esm({
|
|
108489
|
+
"src/core/core/runtime/save-structural-id-gate.ts"() {
|
|
108490
|
+
init_group_ops();
|
|
108491
|
+
init_placeholder_validation();
|
|
108492
|
+
init_shape_ids();
|
|
108493
|
+
PART_ROOT_BY_PATH = [
|
|
108494
|
+
[/^ppt\/slides\/[^/]+\.xml$/u, "p:sld"],
|
|
108495
|
+
[/^ppt\/slideLayouts\/[^/]+\.xml$/u, "p:sldLayout"],
|
|
108496
|
+
[/^ppt\/slideMasters\/[^/]+\.xml$/u, "p:sldMaster"],
|
|
108497
|
+
[/^ppt\/notesSlides\/[^/]+\.xml$/u, "p:notes"],
|
|
108498
|
+
[/^ppt\/notesMasters\/[^/]+\.xml$/u, "p:notesMaster"],
|
|
108499
|
+
[/^ppt\/handoutMasters\/[^/]+\.xml$/u, "p:handoutMaster"]
|
|
108500
|
+
];
|
|
108501
|
+
CNVPR_ID_RE = /<(?:p|p14):cNvPr\b[^>]*?\sid\s*=\s*(?:"([^"]*)"|'([^']*)')/gu;
|
|
108502
|
+
PH_TYPE_RE = /<p:ph\b[^>]*?\stype\s*=\s*(?:"([^"]*)"|'([^']*)')/gu;
|
|
108503
|
+
NV_CONTAINERS3 = [
|
|
108504
|
+
["p:nvSpPr", "p:cNvPr"],
|
|
108505
|
+
["p:nvPicPr", "p:cNvPr"],
|
|
108506
|
+
["p:nvCxnSpPr", "p:cNvPr"],
|
|
108507
|
+
["p:nvGrpSpPr", "p:cNvPr"],
|
|
108508
|
+
["p:nvGraphicFramePr", "p:cNvPr"],
|
|
108509
|
+
["p:nvContentPartPr", "p:cNvPr"],
|
|
108510
|
+
["p14:nvContentPartPr", "p14:cNvPr"]
|
|
108511
|
+
];
|
|
108512
|
+
SHAPE_LISTS = ["p:sp", "p:pic", "p:cxnSp", "p:graphicFrame", "p:grpSp", "p:contentPart"];
|
|
108513
|
+
}
|
|
108514
|
+
});
|
|
107545
108515
|
function hashString(hasher, text22) {
|
|
107546
108516
|
hasher.update(`s${text22.length}:`);
|
|
107547
108517
|
if (text22.length <= FULL_HASH_LIMIT) {
|
|
@@ -108155,6 +109125,7 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
|
|
|
108155
109125
|
init_builders();
|
|
108156
109126
|
init_authored_slide_background();
|
|
108157
109127
|
init_PptxHandlerRuntimeSaveElementWriter();
|
|
109128
|
+
init_save_structural_id_gate();
|
|
108158
109129
|
init_slide_fingerprint();
|
|
108159
109130
|
init_slide_save_xml_order();
|
|
108160
109131
|
init_slide_transition_reconcile();
|
|
@@ -108504,11 +109475,13 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
|
|
|
108504
109475
|
this.wrapNewContentPartEnvelopes(spTree, collectors.contentParts);
|
|
108505
109476
|
this.wrapNewModel3DEnvelopes(spTree, collectors.model3ds);
|
|
108506
109477
|
this.wrapNewZoomEnvelopes(spTree, collectors.zooms);
|
|
108507
|
-
const reassigned = shapeIdValidator.
|
|
109478
|
+
const { reassigned, ids: reassignedIds } = shapeIdValidator.repairShapeIds(
|
|
108508
109479
|
spTree,
|
|
108509
|
-
(v) => this.ensureArray(v)
|
|
109480
|
+
(v) => this.ensureArray(v),
|
|
109481
|
+
xmlObj
|
|
108510
109482
|
);
|
|
108511
109483
|
if (reassigned > 0) {
|
|
109484
|
+
applyShapeIdMapToSlide(slide, reassignedIds);
|
|
108512
109485
|
this.compatibilityService.reportWarning({
|
|
108513
109486
|
code: "SHAPE_ID_DEDUPLICATED",
|
|
108514
109487
|
message: `Reassigned ${reassigned} duplicate shape ID(s) on slide '${slide.id}'.`,
|
|
@@ -109252,7 +110225,7 @@ function asObjects3(value) {
|
|
|
109252
110225
|
return isXmlObject9(value) ? [value] : [];
|
|
109253
110226
|
}
|
|
109254
110227
|
function rememberTemplateSpTreePositions(runtime, partPath, spTree, positionOf) {
|
|
109255
|
-
const
|
|
110228
|
+
const positions = /* @__PURE__ */ new Map();
|
|
109256
110229
|
for (const [key2, value] of Object.entries(spTree)) {
|
|
109257
110230
|
if (!SHAPE_TREE_ELEMENT_TAGS.has(key2) && key2 !== ALTERNATE_CONTENT_TAG3) {
|
|
109258
110231
|
continue;
|
|
@@ -109260,7 +110233,7 @@ function rememberTemplateSpTreePositions(runtime, partPath, spTree, positionOf)
|
|
|
109260
110233
|
for (const node of asObjects3(value)) {
|
|
109261
110234
|
const position2 = positionOf(node);
|
|
109262
110235
|
if (position2 !== void 0) {
|
|
109263
|
-
|
|
110236
|
+
positions.set(node, position2);
|
|
109264
110237
|
}
|
|
109265
110238
|
}
|
|
109266
110239
|
}
|
|
@@ -109269,7 +110242,7 @@ function rememberTemplateSpTreePositions(runtime, partPath, spTree, positionOf)
|
|
|
109269
110242
|
byPart = /* @__PURE__ */ new Map();
|
|
109270
110243
|
positionsByRuntime.set(runtime, byPart);
|
|
109271
110244
|
}
|
|
109272
|
-
byPart.set(partPath,
|
|
110245
|
+
byPart.set(partPath, positions);
|
|
109273
110246
|
}
|
|
109274
110247
|
function withReplacedChild(container, tag, indexInType, replacement) {
|
|
109275
110248
|
const existing = container[tag];
|
|
@@ -109298,17 +110271,17 @@ function orderContainer(container, plan, getLocalName2) {
|
|
|
109298
110271
|
working = withReplacedChild(working, entry2.tag, entry2.indexInType, ordered4);
|
|
109299
110272
|
}
|
|
109300
110273
|
}
|
|
109301
|
-
const
|
|
110274
|
+
const positions = /* @__PURE__ */ new Map();
|
|
109302
110275
|
plan.forEach((entry2, position2) => {
|
|
109303
110276
|
const node = asObjects3(working[entry2.tag])[entry2.indexInType];
|
|
109304
|
-
if (node && !
|
|
109305
|
-
|
|
110277
|
+
if (node && !positions.has(node)) {
|
|
110278
|
+
positions.set(node, position2);
|
|
109306
110279
|
}
|
|
109307
110280
|
});
|
|
109308
|
-
if (
|
|
110281
|
+
if (positions.size === 0) {
|
|
109309
110282
|
return working;
|
|
109310
110283
|
}
|
|
109311
|
-
return orderShapeTreeChildren(working, (node) =>
|
|
110284
|
+
return orderShapeTreeChildren(working, (node) => positions.get(node), getLocalName2);
|
|
109312
110285
|
}
|
|
109313
110286
|
function orderedTemplatePartXml(options) {
|
|
109314
110287
|
const {
|
|
@@ -109361,6 +110334,7 @@ var PptxHandlerRuntime46;
|
|
|
109361
110334
|
var init_PptxHandlerRuntimeSaveMasterElements = __esm({
|
|
109362
110335
|
"src/core/core/runtime/PptxHandlerRuntimeSaveMasterElements.ts"() {
|
|
109363
110336
|
init_services();
|
|
110337
|
+
init_shape_ids();
|
|
109364
110338
|
init_builders();
|
|
109365
110339
|
init_auxiliary_master_node_cache();
|
|
109366
110340
|
init_master_part_element_signature();
|
|
@@ -109470,7 +110444,12 @@ var init_PptxHandlerRuntimeSaveMasterElements = __esm({
|
|
|
109470
110444
|
}
|
|
109471
110445
|
this.publishMasterCollectors(partPath, spTree, collectors);
|
|
109472
110446
|
this.reapplyAlternateContentEnvelopes(spTree, collectors);
|
|
109473
|
-
|
|
110447
|
+
const idRepair = shapeIdValidator2.repairShapeIds(
|
|
110448
|
+
spTree,
|
|
110449
|
+
(value) => this.ensureArray(value),
|
|
110450
|
+
root
|
|
110451
|
+
);
|
|
110452
|
+
remapElementShapeIds(elements2, idRepair.ids);
|
|
109474
110453
|
rememberTemplateSpTreePositions(this, partPath, spTree, (node) => childOrder3.positionOf(node));
|
|
109475
110454
|
relsRoot["Relationship"] = relationships;
|
|
109476
110455
|
relsData["Relationships"] = relsRoot;
|
|
@@ -110520,7 +111499,104 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
|
|
|
110520
111499
|
};
|
|
110521
111500
|
}
|
|
110522
111501
|
});
|
|
111502
|
+
var shapeIdValidator3;
|
|
110523
111503
|
var PptxHandlerRuntime53;
|
|
111504
|
+
var init_PptxHandlerRuntimeSaveStructuralIds = __esm({
|
|
111505
|
+
"src/core/core/runtime/PptxHandlerRuntimeSaveStructuralIds.ts"() {
|
|
111506
|
+
init_placeholder_validation();
|
|
111507
|
+
init_shape_ids();
|
|
111508
|
+
init_builders();
|
|
111509
|
+
init_PptxHandlerRuntimeSaveLegacyPpt();
|
|
111510
|
+
init_save_structural_id_gate();
|
|
111511
|
+
init_slide_fingerprint();
|
|
111512
|
+
init_template_sp_tree_order();
|
|
111513
|
+
shapeIdValidator3 = new PptxShapeIdValidator();
|
|
111514
|
+
PptxHandlerRuntime53 = class extends PptxHandlerRuntime52 {
|
|
111515
|
+
async repairStructuralIdsBeforeExport(slides) {
|
|
111516
|
+
for (const path of Object.keys(this.zip.files)) {
|
|
111517
|
+
const rootTag2 = structuralPartRootTag(path);
|
|
111518
|
+
if (rootTag2 === void 0) {
|
|
111519
|
+
continue;
|
|
111520
|
+
}
|
|
111521
|
+
const xml = await this.zip.file(path)?.async("string");
|
|
111522
|
+
if (xml === void 0) {
|
|
111523
|
+
continue;
|
|
111524
|
+
}
|
|
111525
|
+
const scan = prescanStructuralPart(xml);
|
|
111526
|
+
if (!scan.suspectIds && !scan.placeholderCasing) {
|
|
111527
|
+
continue;
|
|
111528
|
+
}
|
|
111529
|
+
await this.repairStructuralPart(path, rootTag2, xml, scan.suspectIds, slides);
|
|
111530
|
+
}
|
|
111531
|
+
}
|
|
111532
|
+
/** The loader's cached parse of a part, which the live model's `rawXml` nodes belong to. */
|
|
111533
|
+
cachedStructuralPart(path) {
|
|
111534
|
+
return this.slideMap.get(path) ?? this.layoutXmlMap.get(path) ?? this.masterXmlMap.get(path);
|
|
111535
|
+
}
|
|
111536
|
+
async repairStructuralPart(path, rootTag2, xml, suspectIds, slides) {
|
|
111537
|
+
const fresh = this.parser.parse(xml);
|
|
111538
|
+
const ensureArray20 = (value) => this.ensureArray(value);
|
|
111539
|
+
const freshTree = spTreeOfPartRoot(fresh[rootTag2]);
|
|
111540
|
+
const needsIds = suspectIds && freshTree !== void 0 && hasStructuralIdDefects(freshTree, ensureArray20);
|
|
111541
|
+
const cached = this.cachedStructuralPart(path);
|
|
111542
|
+
let target = cached ?? fresh;
|
|
111543
|
+
let repair = this.repairPartObject(target, rootTag2, needsIds, ensureArray20);
|
|
111544
|
+
if (repair.reassigned === 0 && repair.casing === 0 && cached !== void 0) {
|
|
111545
|
+
target = fresh;
|
|
111546
|
+
repair = this.repairPartObject(target, rootTag2, needsIds, ensureArray20);
|
|
111547
|
+
}
|
|
111548
|
+
if (repair.reassigned === 0 && repair.casing === 0) {
|
|
111549
|
+
return;
|
|
111550
|
+
}
|
|
111551
|
+
if (repair.ids.size > 0) {
|
|
111552
|
+
const slide = slides.find((candidate) => candidate.id === path);
|
|
111553
|
+
if (slide) {
|
|
111554
|
+
applyShapeIdMapToSlide(slide, repair.ids);
|
|
111555
|
+
this.savedSlideFingerprints.set(slide.id, fingerprintSlide(slide));
|
|
111556
|
+
}
|
|
111557
|
+
const templateElements = this.layoutCache.get(path) ?? this.masterCache.get(path);
|
|
111558
|
+
if (templateElements) {
|
|
111559
|
+
remapElementShapeIds(templateElements, repair.ids);
|
|
111560
|
+
}
|
|
111561
|
+
}
|
|
111562
|
+
const ordered4 = orderedTemplatePartXml({
|
|
111563
|
+
runtime: this,
|
|
111564
|
+
partPath: path,
|
|
111565
|
+
xmlObj: target,
|
|
111566
|
+
rootTag: rootTag2,
|
|
111567
|
+
sourceXml: xml,
|
|
111568
|
+
getLocalName: (key2) => this.compatibilityService.getXmlLocalName(key2),
|
|
111569
|
+
alternateContentBlockByRawXml: this.alternateContentBlockByRawXml
|
|
111570
|
+
});
|
|
111571
|
+
this.zip.file(path, this.builder.build(ordered4));
|
|
111572
|
+
if (repair.reassigned > 0) {
|
|
111573
|
+
this.compatibilityService.reportWarning({
|
|
111574
|
+
code: "SHAPE_ID_DEDUPLICATED",
|
|
111575
|
+
message: `Reassigned ${repair.reassigned} invalid or duplicate shape ID(s) in '${path}'.`,
|
|
111576
|
+
scope: "save",
|
|
111577
|
+
slideId: path
|
|
111578
|
+
});
|
|
111579
|
+
}
|
|
111580
|
+
if (repair.casing > 0) {
|
|
111581
|
+
this.compatibilityService.reportWarning({
|
|
111582
|
+
code: "PLACEHOLDER_TYPE_CANONICALIZED",
|
|
111583
|
+
message: `Corrected the casing of ${repair.casing} placeholder type(s) in '${path}'.`,
|
|
111584
|
+
scope: "save",
|
|
111585
|
+
slideId: path
|
|
111586
|
+
});
|
|
111587
|
+
}
|
|
111588
|
+
}
|
|
111589
|
+
repairPartObject(xmlObj, rootTag2, needsIds, ensureArray20) {
|
|
111590
|
+
const root = xmlObj[rootTag2];
|
|
111591
|
+
const spTree = spTreeOfPartRoot(root);
|
|
111592
|
+
const idRepair = needsIds && root !== void 0 && spTree !== void 0 ? shapeIdValidator3.repairShapeIds(spTree, ensureArray20, root) : { reassigned: 0, ids: /* @__PURE__ */ new Map() };
|
|
111593
|
+
const casing = root === void 0 ? 0 : canonicalizePlaceholderTypes(root);
|
|
111594
|
+
return { ...idRepair, casing };
|
|
111595
|
+
}
|
|
111596
|
+
};
|
|
111597
|
+
}
|
|
111598
|
+
});
|
|
111599
|
+
var PptxHandlerRuntime54;
|
|
110524
111600
|
var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
110525
111601
|
"src/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts"() {
|
|
110526
111602
|
init_modern_comment_package();
|
|
@@ -110528,8 +111604,8 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
110528
111604
|
init_factories();
|
|
110529
111605
|
init_header_footer_parts();
|
|
110530
111606
|
init_pptx_print_properties();
|
|
110531
|
-
|
|
110532
|
-
|
|
111607
|
+
init_PptxHandlerRuntimeSaveStructuralIds();
|
|
111608
|
+
PptxHandlerRuntime54 = class _PptxHandlerRuntime extends PptxHandlerRuntime53 {
|
|
110533
111609
|
/**
|
|
110534
111610
|
* Resolve the effective conformance class for this save operation.
|
|
110535
111611
|
*
|
|
@@ -110568,9 +111644,11 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
110568
111644
|
});
|
|
110569
111645
|
await this.ensureNotesMasterForAuthoredNotes(slides, saveConstants);
|
|
110570
111646
|
await this.ensureHandoutMasterInfrastructure(options?.handoutMaster, saveConstants);
|
|
111647
|
+
this.templateElementBaselines.beginSave();
|
|
110571
111648
|
for (const slide of slides) {
|
|
110572
111649
|
await this.processSlideForSave(slide, saveSession, saveConstants);
|
|
110573
111650
|
}
|
|
111651
|
+
this.templateElementBaselines.commitSave();
|
|
110574
111652
|
const contentTypesXml3 = await this.zip.file("[Content_Types].xml")?.async("string");
|
|
110575
111653
|
if (contentTypesXml3) {
|
|
110576
111654
|
const contentTypesData = this.parser.parse(contentTypesXml3);
|
|
@@ -110734,6 +111812,7 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
110734
111812
|
await this.stripDigitalSignatures();
|
|
110735
111813
|
const outputFormat = options?.outputFormat ?? "pptx";
|
|
110736
111814
|
await this.applyOutputFormatOverrides(outputFormat);
|
|
111815
|
+
await this.repairStructuralIdsBeforeExport(slides);
|
|
110737
111816
|
if (effectiveConformance === "strict") {
|
|
110738
111817
|
await this.convertZipToStrictConformance();
|
|
110739
111818
|
}
|
|
@@ -110817,14 +111896,14 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
110817
111896
|
}
|
|
110818
111897
|
});
|
|
110819
111898
|
var SPECIAL_PLACEHOLDER_TYPES;
|
|
110820
|
-
var
|
|
111899
|
+
var PptxHandlerRuntime55;
|
|
110821
111900
|
var init_PptxHandlerRuntimeElementParsing = __esm({
|
|
110822
111901
|
"src/core/core/runtime/PptxHandlerRuntimeElementParsing.ts"() {
|
|
110823
111902
|
init_utils();
|
|
110824
111903
|
init_placeholder_index();
|
|
110825
111904
|
init_PptxHandlerRuntimeSavePipeline();
|
|
110826
111905
|
SPECIAL_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set(["dt", "ftr", "hdr", "sldnum"]);
|
|
110827
|
-
|
|
111906
|
+
PptxHandlerRuntime55 = class _PptxHandlerRuntime extends PptxHandlerRuntime54 {
|
|
110828
111907
|
/**
|
|
110829
111908
|
* Parse media data (video/audio path and MIME type) from graphic frame data.
|
|
110830
111909
|
*/
|
|
@@ -111119,11 +112198,11 @@ function readBoolean(value) {
|
|
|
111119
112198
|
}
|
|
111120
112199
|
return String(value) !== "0" && String(value).toLowerCase() !== "false";
|
|
111121
112200
|
}
|
|
111122
|
-
var
|
|
112201
|
+
var PptxHandlerRuntime56;
|
|
111123
112202
|
var init_PptxHandlerRuntimeZoomParsing = __esm({
|
|
111124
112203
|
"src/core/core/runtime/PptxHandlerRuntimeZoomParsing.ts"() {
|
|
111125
112204
|
init_PptxHandlerRuntimeElementParsing();
|
|
111126
|
-
|
|
112205
|
+
PptxHandlerRuntime56 = class _PptxHandlerRuntime extends PptxHandlerRuntime55 {
|
|
111127
112206
|
/** Parse an Office 2016 `pslz:sldZm` slide Zoom object. */
|
|
111128
112207
|
async parseSlideZoomElement(zoom, id, slidePath) {
|
|
111129
112208
|
try {
|
|
@@ -111190,12 +112269,12 @@ function readBoolean2(value) {
|
|
|
111190
112269
|
}
|
|
111191
112270
|
return String(value) !== "0" && String(value).toLowerCase() !== "false";
|
|
111192
112271
|
}
|
|
111193
|
-
var
|
|
112272
|
+
var PptxHandlerRuntime57;
|
|
111194
112273
|
var init_PptxHandlerRuntimeSectionZoomParsing = __esm({
|
|
111195
112274
|
"src/core/core/runtime/PptxHandlerRuntimeSectionZoomParsing.ts"() {
|
|
111196
112275
|
init_presentation_section_parser();
|
|
111197
112276
|
init_PptxHandlerRuntimeZoomParsing();
|
|
111198
|
-
|
|
112277
|
+
PptxHandlerRuntime57 = class _PptxHandlerRuntime extends PptxHandlerRuntime56 {
|
|
111199
112278
|
/** Parse an Office 2016 `psezm:sectionZm` section Zoom object. */
|
|
111200
112279
|
async parseSectionZoomElement(zoom, id, slidePath) {
|
|
111201
112280
|
try {
|
|
@@ -111255,12 +112334,12 @@ var init_PptxHandlerRuntimeSectionZoomParsing = __esm({
|
|
|
111255
112334
|
};
|
|
111256
112335
|
}
|
|
111257
112336
|
});
|
|
111258
|
-
var
|
|
112337
|
+
var PptxHandlerRuntime58;
|
|
111259
112338
|
var init_PptxHandlerRuntimeSummaryZoomParsing = __esm({
|
|
111260
112339
|
"src/core/core/runtime/PptxHandlerRuntimeSummaryZoomParsing.ts"() {
|
|
111261
112340
|
init_presentation_section_parser();
|
|
111262
112341
|
init_PptxHandlerRuntimeSectionZoomParsing();
|
|
111263
|
-
|
|
112342
|
+
PptxHandlerRuntime58 = class _PptxHandlerRuntime extends PptxHandlerRuntime57 {
|
|
111264
112343
|
/** Parse an Office 2016 Summary Zoom container and all section tiles. */
|
|
111265
112344
|
async parseSummaryZoomElement(zoom, id, slidePath) {
|
|
111266
112345
|
try {
|
|
@@ -111351,7 +112430,7 @@ var init_PptxHandlerRuntimeSummaryZoomParsing = __esm({
|
|
|
111351
112430
|
}
|
|
111352
112431
|
});
|
|
111353
112432
|
var PLACEHOLDER_BUCKETS;
|
|
111354
|
-
var
|
|
112433
|
+
var PptxHandlerRuntime59;
|
|
111355
112434
|
var init_PptxHandlerRuntimePlaceholderLookup = __esm({
|
|
111356
112435
|
"src/core/core/runtime/PptxHandlerRuntimePlaceholderLookup.ts"() {
|
|
111357
112436
|
init_header_footer_placeholder();
|
|
@@ -111364,7 +112443,7 @@ var init_PptxHandlerRuntimePlaceholderLookup = __esm({
|
|
|
111364
112443
|
{ bucket: "p:pic", nvKey: "p:nvPicPr", contextKey: "picture" },
|
|
111365
112444
|
{ bucket: "p:graphicFrame", nvKey: "p:nvGraphicFramePr", contextKey: "graphicFrame" }
|
|
111366
112445
|
];
|
|
111367
|
-
|
|
112446
|
+
PptxHandlerRuntime59 = class extends PptxHandlerRuntime58 {
|
|
111368
112447
|
findPlaceholderInShapeTree(spTree, expected) {
|
|
111369
112448
|
return this.scanPlaceholderBuckets(spTree, (info) => this.placeholderMatches(expected, info));
|
|
111370
112449
|
}
|
|
@@ -111597,14 +112676,22 @@ var init_preset_avlst_fmla = __esm({
|
|
|
111597
112676
|
]);
|
|
111598
112677
|
}
|
|
111599
112678
|
});
|
|
111600
|
-
|
|
112679
|
+
function parseBoundedRectFraction(value) {
|
|
112680
|
+
const fraction = parseOoxmlPercent(value);
|
|
112681
|
+
if (fraction === void 0) {
|
|
112682
|
+
return void 0;
|
|
112683
|
+
}
|
|
112684
|
+
return Math.max(-10, Math.min(10, fraction));
|
|
112685
|
+
}
|
|
112686
|
+
var PptxHandlerRuntime60;
|
|
111601
112687
|
var init_PptxHandlerRuntimeGeometryParsing = __esm({
|
|
111602
112688
|
"src/core/core/runtime/PptxHandlerRuntimeGeometryParsing.ts"() {
|
|
112689
|
+
init_color_primitives();
|
|
111603
112690
|
init_custom_geometry_parser();
|
|
111604
112691
|
init_guide_formula();
|
|
111605
112692
|
init_PptxHandlerRuntimePlaceholderLookup();
|
|
111606
112693
|
init_preset_avlst_fmla();
|
|
111607
|
-
|
|
112694
|
+
PptxHandlerRuntime60 = class _PptxHandlerRuntime extends PptxHandlerRuntime59 {
|
|
111608
112695
|
parseGeometryAdjustments(prstGeom) {
|
|
111609
112696
|
if (!prstGeom) {
|
|
111610
112697
|
return void 0;
|
|
@@ -111975,11 +113062,7 @@ var init_PptxHandlerRuntimeGeometryParsing = __esm({
|
|
|
111975
113062
|
* hostile input.
|
|
111976
113063
|
*/
|
|
111977
113064
|
parseCropFraction(value) {
|
|
111978
|
-
|
|
111979
|
-
if (!Number.isFinite(raw)) {
|
|
111980
|
-
return void 0;
|
|
111981
|
-
}
|
|
111982
|
-
return Math.max(-1e6, Math.min(1e6, raw)) / 1e5;
|
|
113065
|
+
return parseBoundedRectFraction(value);
|
|
111983
113066
|
}
|
|
111984
113067
|
readImageCropFromBlipFill(blipFill) {
|
|
111985
113068
|
const result = {};
|
|
@@ -112006,11 +113089,7 @@ var init_PptxHandlerRuntimeGeometryParsing = __esm({
|
|
|
112006
113089
|
* magnitude is capped at 10x the frame to bound hostile input.
|
|
112007
113090
|
*/
|
|
112008
113091
|
parseSignedRectFraction(value) {
|
|
112009
|
-
|
|
112010
|
-
if (!Number.isFinite(raw)) {
|
|
112011
|
-
return void 0;
|
|
112012
|
-
}
|
|
112013
|
-
return Math.max(-1e6, Math.min(1e6, raw)) / 1e5;
|
|
113092
|
+
return parseBoundedRectFraction(value);
|
|
112014
113093
|
}
|
|
112015
113094
|
extractShapeStyle(spPr, styleNode) {
|
|
112016
113095
|
return this.shapeStyleExtractor.extractShapeStyle(spPr, styleNode);
|
|
@@ -112018,12 +113097,12 @@ var init_PptxHandlerRuntimeGeometryParsing = __esm({
|
|
|
112018
113097
|
};
|
|
112019
113098
|
}
|
|
112020
113099
|
});
|
|
112021
|
-
var
|
|
113100
|
+
var PptxHandlerRuntime61;
|
|
112022
113101
|
var init_PptxHandlerRuntimeShapeImageFill = __esm({
|
|
112023
113102
|
"src/core/core/runtime/PptxHandlerRuntimeShapeImageFill.ts"() {
|
|
112024
113103
|
init_xml_access();
|
|
112025
113104
|
init_PptxHandlerRuntimeGeometryParsing();
|
|
112026
|
-
|
|
113105
|
+
PptxHandlerRuntime61 = class _PptxHandlerRuntime extends PptxHandlerRuntime60 {
|
|
112027
113106
|
/**
|
|
112028
113107
|
* Parse a shape that has an image fill (a:blipFill inside spPr)
|
|
112029
113108
|
* This handles shapes like rectangles filled with images (e.g., wood texture backgrounds)
|
|
@@ -112235,12 +113314,12 @@ var init_PptxHandlerRuntimeShapeImageFill = __esm({
|
|
|
112235
113314
|
};
|
|
112236
113315
|
}
|
|
112237
113316
|
});
|
|
112238
|
-
var
|
|
113317
|
+
var PptxHandlerRuntime62;
|
|
112239
113318
|
var init_PptxHandlerRuntimeTextDefaults = __esm({
|
|
112240
113319
|
"src/core/core/runtime/PptxHandlerRuntimeTextDefaults.ts"() {
|
|
112241
113320
|
init_color();
|
|
112242
113321
|
init_PptxHandlerRuntimeShapeImageFill();
|
|
112243
|
-
|
|
113322
|
+
PptxHandlerRuntime62 = class extends PptxHandlerRuntime61 {
|
|
112244
113323
|
/**
|
|
112245
113324
|
* Apply {@link PlaceholderDefaults} body-level properties to a
|
|
112246
113325
|
* {@link TextStyle} as fallback values (only sets fields that are
|
|
@@ -112417,7 +113496,7 @@ var init_PptxHandlerRuntimeTextDefaults = __esm({
|
|
|
112417
113496
|
};
|
|
112418
113497
|
}
|
|
112419
113498
|
});
|
|
112420
|
-
var
|
|
113499
|
+
var PptxHandlerRuntime63;
|
|
112421
113500
|
var init_PptxHandlerRuntimeBulletParsing = __esm({
|
|
112422
113501
|
"src/core/core/runtime/PptxHandlerRuntimeBulletParsing.ts"() {
|
|
112423
113502
|
init_theme_color_ref();
|
|
@@ -112426,7 +113505,7 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
|
|
|
112426
113505
|
init_paragraph_properties_parser();
|
|
112427
113506
|
init_xml_access();
|
|
112428
113507
|
init_PptxHandlerRuntimeTextDefaults();
|
|
112429
|
-
|
|
113508
|
+
PptxHandlerRuntime63 = class extends PptxHandlerRuntime62 {
|
|
112430
113509
|
resolveParagraphBulletInfo(paragraph, paragraphIndex, txBody, inheritedTxBody, isBodyPlaceholder = false, slidePath, effectiveLevelStyles) {
|
|
112431
113510
|
if (!paragraph) {
|
|
112432
113511
|
return null;
|
|
@@ -112625,7 +113704,7 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
|
|
|
112625
113704
|
};
|
|
112626
113705
|
}
|
|
112627
113706
|
});
|
|
112628
|
-
var
|
|
113707
|
+
var PptxHandlerRuntime64;
|
|
112629
113708
|
var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
|
|
112630
113709
|
"src/core/core/runtime/PptxHandlerRuntimeShapeBodyParsing.ts"() {
|
|
112631
113710
|
init_alternate_content();
|
|
@@ -112633,7 +113712,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
|
|
|
112633
113712
|
init_text_body_scene3d();
|
|
112634
113713
|
init_text_body_sp3d();
|
|
112635
113714
|
init_PptxHandlerRuntimeBulletParsing();
|
|
112636
|
-
|
|
113715
|
+
PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime63 {
|
|
112637
113716
|
/**
|
|
112638
113717
|
* Parse `a:spLocks` attributes into a structured {@link PptxShapeLocks} object.
|
|
112639
113718
|
* Returns `undefined` when the node is absent or contains no lock attributes.
|
|
@@ -112854,12 +113933,12 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
|
|
|
112854
113933
|
};
|
|
112855
113934
|
}
|
|
112856
113935
|
});
|
|
112857
|
-
var
|
|
113936
|
+
var PptxHandlerRuntime65;
|
|
112858
113937
|
var init_PptxHandlerRuntimeShapeTextParsing = __esm({
|
|
112859
113938
|
"src/core/core/runtime/PptxHandlerRuntimeShapeTextParsing.ts"() {
|
|
112860
113939
|
init_paragraph_properties_parser();
|
|
112861
113940
|
init_PptxHandlerRuntimeShapeBodyParsing();
|
|
112862
|
-
|
|
113941
|
+
PptxHandlerRuntime65 = class _PptxHandlerRuntime extends PptxHandlerRuntime64 {
|
|
112863
113942
|
/**
|
|
112864
113943
|
* A copy of an `a:lstStyle` level entry without its `a:defRPr`: run
|
|
112865
113944
|
* defaults follow their own precedence chain, so only the paragraph-level
|
|
@@ -113150,7 +114229,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
|
|
|
113150
114229
|
}
|
|
113151
114230
|
});
|
|
113152
114231
|
var PARAGRAPH_CONTENT_TAGS;
|
|
113153
|
-
var
|
|
114232
|
+
var PptxHandlerRuntime66;
|
|
113154
114233
|
var init_PptxHandlerRuntimeShapeParagraphContentParsing = __esm({
|
|
113155
114234
|
"src/core/core/runtime/PptxHandlerRuntimeShapeParagraphContentParsing.ts"() {
|
|
113156
114235
|
init_utils();
|
|
@@ -113169,7 +114248,7 @@ var init_PptxHandlerRuntimeShapeParagraphContentParsing = __esm({
|
|
|
113169
114248
|
"mc:AlternateContent",
|
|
113170
114249
|
"a:br"
|
|
113171
114250
|
]);
|
|
113172
|
-
|
|
114251
|
+
PptxHandlerRuntime66 = class extends PptxHandlerRuntime65 {
|
|
113173
114252
|
/**
|
|
113174
114253
|
* Collect text content (runs, fields, equations, bullets) for a single
|
|
113175
114254
|
* paragraph and return text parts + segments. The returned `seedStyle`
|
|
@@ -113598,7 +114677,7 @@ var init_PptxHandlerRuntimeShapeParagraphContentParsing = __esm({
|
|
|
113598
114677
|
};
|
|
113599
114678
|
}
|
|
113600
114679
|
});
|
|
113601
|
-
var
|
|
114680
|
+
var PptxHandlerRuntime67;
|
|
113602
114681
|
var init_PptxHandlerRuntimeShapeParsing = __esm({
|
|
113603
114682
|
"src/core/core/runtime/PptxHandlerRuntimeShapeParsing.ts"() {
|
|
113604
114683
|
init_decorative_extension();
|
|
@@ -113608,7 +114687,7 @@ var init_PptxHandlerRuntimeShapeParsing = __esm({
|
|
|
113608
114687
|
init_auto_number_sequence();
|
|
113609
114688
|
init_element_paragraph_geometry();
|
|
113610
114689
|
init_PptxHandlerRuntimeShapeParagraphContentParsing();
|
|
113611
|
-
|
|
114690
|
+
PptxHandlerRuntime67 = class _PptxHandlerRuntime extends PptxHandlerRuntime66 {
|
|
113612
114691
|
parseShape(shape, id, slidePath) {
|
|
113613
114692
|
try {
|
|
113614
114693
|
const spPr = shape["p:spPr"];
|
|
@@ -113915,7 +114994,7 @@ function parseEmuInt2(value) {
|
|
|
113915
114994
|
}
|
|
113916
114995
|
var INT32_MIN2;
|
|
113917
114996
|
var INT32_MAX2;
|
|
113918
|
-
var
|
|
114997
|
+
var PptxHandlerRuntime68;
|
|
113919
114998
|
var init_PptxHandlerRuntimePictureParsing = __esm({
|
|
113920
114999
|
"src/core/core/runtime/PptxHandlerRuntimePictureParsing.ts"() {
|
|
113921
115000
|
init_crop_shape_geometry();
|
|
@@ -113928,7 +115007,7 @@ var init_PptxHandlerRuntimePictureParsing = __esm({
|
|
|
113928
115007
|
init_shape_lock_containers();
|
|
113929
115008
|
INT32_MIN2 = -2147483648;
|
|
113930
115009
|
INT32_MAX2 = 2147483647;
|
|
113931
|
-
|
|
115010
|
+
PptxHandlerRuntime68 = class _PptxHandlerRuntime extends PptxHandlerRuntime67 {
|
|
113932
115011
|
async parsePicture(pic, id, slidePath) {
|
|
113933
115012
|
try {
|
|
113934
115013
|
const spPr = pic["p:spPr"];
|
|
@@ -114282,13 +115361,13 @@ var init_PptxHandlerRuntimePictureParsing = __esm({
|
|
|
114282
115361
|
};
|
|
114283
115362
|
}
|
|
114284
115363
|
});
|
|
114285
|
-
var
|
|
115364
|
+
var PptxHandlerRuntime69;
|
|
114286
115365
|
var init_PptxHandlerRuntimeSpTreeParsing = __esm({
|
|
114287
115366
|
"src/core/core/runtime/PptxHandlerRuntimeSpTreeParsing.ts"() {
|
|
114288
115367
|
init_alternate_content();
|
|
114289
115368
|
init_vml_parser();
|
|
114290
115369
|
init_PptxHandlerRuntimePictureParsing();
|
|
114291
|
-
|
|
115370
|
+
PptxHandlerRuntime69 = class _PptxHandlerRuntime extends PptxHandlerRuntime68 {
|
|
114292
115371
|
/**
|
|
114293
115372
|
* Known element tag names that appear as direct children of `p:spTree`
|
|
114294
115373
|
* (or `p:grpSp`) and represent renderable shapes/objects.
|
|
@@ -114670,7 +115749,7 @@ var init_PptxHandlerRuntimeSpTreeParsing = __esm({
|
|
|
114670
115749
|
};
|
|
114671
115750
|
}
|
|
114672
115751
|
});
|
|
114673
|
-
var
|
|
115752
|
+
var PptxHandlerRuntime70;
|
|
114674
115753
|
var init_PptxHandlerRuntimeGroupParsing = __esm({
|
|
114675
115754
|
"src/core/core/runtime/PptxHandlerRuntimeGroupParsing.ts"() {
|
|
114676
115755
|
init_transform_utils();
|
|
@@ -114679,7 +115758,7 @@ var init_PptxHandlerRuntimeGroupParsing = __esm({
|
|
|
114679
115758
|
init_group_shape_geometry();
|
|
114680
115759
|
init_PptxHandlerRuntimeSpTreeParsing();
|
|
114681
115760
|
init_shape_lock_containers();
|
|
114682
|
-
|
|
115761
|
+
PptxHandlerRuntime70 = class _PptxHandlerRuntime extends PptxHandlerRuntime69 {
|
|
114683
115762
|
/**
|
|
114684
115763
|
* Parse the children of a `<p:grpSp>` into the group's own pixel space.
|
|
114685
115764
|
*
|
|
@@ -114881,11 +115960,11 @@ var init_PptxHandlerRuntimeGroupParsing = __esm({
|
|
|
114881
115960
|
};
|
|
114882
115961
|
}
|
|
114883
115962
|
});
|
|
114884
|
-
var
|
|
115963
|
+
var PptxHandlerRuntime71;
|
|
114885
115964
|
var init_PptxHandlerRuntimeSlideParsing = __esm({
|
|
114886
115965
|
"src/core/core/runtime/PptxHandlerRuntimeSlideParsing.ts"() {
|
|
114887
115966
|
init_PptxHandlerRuntimeGroupParsing();
|
|
114888
|
-
|
|
115967
|
+
PptxHandlerRuntime71 = class extends PptxHandlerRuntime70 {
|
|
114889
115968
|
/**
|
|
114890
115969
|
* Parse text body from a connector shape (p:cxnSp > p:txBody).
|
|
114891
115970
|
* Uses the same text run extraction logic as regular shapes but
|
|
@@ -114996,7 +116075,7 @@ var init_PptxHandlerRuntimeSlideParsing = __esm({
|
|
|
114996
116075
|
}
|
|
114997
116076
|
});
|
|
114998
116077
|
var DEFAULT_CLR_MAP_ALIAS;
|
|
114999
|
-
var
|
|
116078
|
+
var PptxHandlerRuntime72;
|
|
115000
116079
|
var init_PptxHandlerRuntimeColorAndEffects = __esm({
|
|
115001
116080
|
"src/core/core/runtime/PptxHandlerRuntimeColorAndEffects.ts"() {
|
|
115002
116081
|
init_PptxHandlerRuntimeSlideParsing();
|
|
@@ -115006,7 +116085,7 @@ var init_PptxHandlerRuntimeColorAndEffects = __esm({
|
|
|
115006
116085
|
bg2: "lt2",
|
|
115007
116086
|
tx2: "dk2"
|
|
115008
116087
|
};
|
|
115009
|
-
|
|
116088
|
+
PptxHandlerRuntime72 = class extends PptxHandlerRuntime71 {
|
|
115010
116089
|
/**
|
|
115011
116090
|
* Forward declaration – implemented in PptxHandlerRuntimeThemeProcessing.
|
|
115012
116091
|
* Re-resolves gradient stops by substituting `phClr` with the given colour.
|
|
@@ -115148,14 +116227,14 @@ var init_PptxHandlerRuntimeColorAndEffects = __esm({
|
|
|
115148
116227
|
};
|
|
115149
116228
|
}
|
|
115150
116229
|
});
|
|
115151
|
-
var
|
|
116230
|
+
var PptxHandlerRuntime73;
|
|
115152
116231
|
var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
115153
116232
|
"src/core/core/runtime/PptxHandlerRuntimeBackgroundParsing.ts"() {
|
|
115154
116233
|
init_part_rels_path();
|
|
115155
116234
|
init_strip_parent_dir_segments();
|
|
115156
116235
|
init_xml_access();
|
|
115157
116236
|
init_PptxHandlerRuntimeColorAndEffects();
|
|
115158
|
-
|
|
116237
|
+
PptxHandlerRuntime73 = class extends PptxHandlerRuntime72 {
|
|
115159
116238
|
/**
|
|
115160
116239
|
* Preserve the visual properties authored on a background `a:blipFill`.
|
|
115161
116240
|
*
|
|
@@ -115599,14 +116678,14 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
115599
116678
|
};
|
|
115600
116679
|
}
|
|
115601
116680
|
});
|
|
115602
|
-
var
|
|
116681
|
+
var PptxHandlerRuntime74;
|
|
115603
116682
|
var init_PptxHandlerRuntimeSlideUtils = __esm({
|
|
115604
116683
|
"src/core/core/runtime/PptxHandlerRuntimeSlideUtils.ts"() {
|
|
115605
116684
|
init_part_rels_path();
|
|
115606
116685
|
init_strip_parent_dir_segments();
|
|
115607
116686
|
init_notes_body_shapes();
|
|
115608
116687
|
init_PptxHandlerRuntimeBackgroundParsing();
|
|
115609
|
-
|
|
116688
|
+
PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
|
|
115610
116689
|
/**
|
|
115611
116690
|
* Retrieve the background gradient from a layout, falling back to master.
|
|
115612
116691
|
*/
|
|
@@ -115949,14 +117028,14 @@ var init_PptxHandlerRuntimeSlideUtils = __esm({
|
|
|
115949
117028
|
};
|
|
115950
117029
|
}
|
|
115951
117030
|
});
|
|
115952
|
-
var
|
|
117031
|
+
var PptxHandlerRuntime75;
|
|
115953
117032
|
var init_PptxHandlerRuntimePlaceholderStyles = __esm({
|
|
115954
117033
|
"src/core/core/runtime/PptxHandlerRuntimePlaceholderStyles.ts"() {
|
|
115955
117034
|
init_color_xml_preservation();
|
|
115956
117035
|
init_paragraph_properties_parser();
|
|
115957
117036
|
init_xml_access();
|
|
115958
117037
|
init_PptxHandlerRuntimeSlideUtils();
|
|
115959
|
-
|
|
117038
|
+
PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
|
|
115960
117039
|
/**
|
|
115961
117040
|
* Parse a single `a:lvlXpPr` node into a structured
|
|
115962
117041
|
* {@link PlaceholderTextLevelStyle}.
|
|
@@ -116106,11 +117185,11 @@ var init_PptxHandlerRuntimePlaceholderStyles = __esm({
|
|
|
116106
117185
|
};
|
|
116107
117186
|
}
|
|
116108
117187
|
});
|
|
116109
|
-
var
|
|
117188
|
+
var PptxHandlerRuntime76;
|
|
116110
117189
|
var init_PptxHandlerRuntimePlaceholderDefaults = __esm({
|
|
116111
117190
|
"src/core/core/runtime/PptxHandlerRuntimePlaceholderDefaults.ts"() {
|
|
116112
117191
|
init_PptxHandlerRuntimePlaceholderStyles();
|
|
116113
|
-
|
|
117192
|
+
PptxHandlerRuntime76 = class _PptxHandlerRuntime extends PptxHandlerRuntime75 {
|
|
116114
117193
|
/**
|
|
116115
117194
|
* Extract structured {@link PlaceholderDefaults} from a layout or master
|
|
116116
117195
|
* shape that carries a `p:ph` element.
|
|
@@ -116272,14 +117351,14 @@ function parseHeaderFooterFlags(hf) {
|
|
|
116272
117351
|
}
|
|
116273
117352
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
116274
117353
|
}
|
|
116275
|
-
var
|
|
117354
|
+
var PptxHandlerRuntime77;
|
|
116276
117355
|
var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
116277
117356
|
"src/core/core/runtime/PptxHandlerRuntimeMasterElements.ts"() {
|
|
116278
117357
|
init_part_rels_path();
|
|
116279
117358
|
init_strip_parent_dir_segments();
|
|
116280
117359
|
init_xml_access();
|
|
116281
117360
|
init_PptxHandlerRuntimePlaceholderDefaults();
|
|
116282
|
-
|
|
117361
|
+
PptxHandlerRuntime77 = class extends PptxHandlerRuntime76 {
|
|
116283
117362
|
/**
|
|
116284
117363
|
* Parse a `CT_TextListStyle` node (`a:defPPr` + `a:lvl1pPr` … `a:lvl9pPr`)
|
|
116285
117364
|
* into a level-keyed style map. Used for `<p:txStyles>` children
|
|
@@ -116563,7 +117642,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
116563
117642
|
};
|
|
116564
117643
|
}
|
|
116565
117644
|
});
|
|
116566
|
-
var
|
|
117645
|
+
var PptxHandlerRuntime78;
|
|
116567
117646
|
var init_PptxHandlerRuntimeAuxiliaryMasterElements = __esm({
|
|
116568
117647
|
"src/core/core/runtime/PptxHandlerRuntimeAuxiliaryMasterElements.ts"() {
|
|
116569
117648
|
init_services();
|
|
@@ -116572,7 +117651,7 @@ var init_PptxHandlerRuntimeAuxiliaryMasterElements = __esm({
|
|
|
116572
117651
|
init_master_part_element_signature();
|
|
116573
117652
|
init_master_part_tags();
|
|
116574
117653
|
init_PptxHandlerRuntimeMasterElements();
|
|
116575
|
-
|
|
117654
|
+
PptxHandlerRuntime78 = class extends PptxHandlerRuntime77 {
|
|
116576
117655
|
/** Parse every editable element in a master or layout shape tree. */
|
|
116577
117656
|
async enrichMasterPartElements(part, rootTag2) {
|
|
116578
117657
|
if (!part) {
|
|
@@ -116677,14 +117756,14 @@ var init_PptxHandlerRuntimeAuxiliaryMasterElements = __esm({
|
|
|
116677
117756
|
};
|
|
116678
117757
|
}
|
|
116679
117758
|
});
|
|
116680
|
-
var
|
|
117759
|
+
var PptxHandlerRuntime79;
|
|
116681
117760
|
var init_PptxHandlerRuntimeLayoutElements = __esm({
|
|
116682
117761
|
"src/core/core/runtime/PptxHandlerRuntimeLayoutElements.ts"() {
|
|
116683
117762
|
init_part_rels_path();
|
|
116684
117763
|
init_strip_parent_dir_segments();
|
|
116685
117764
|
init_xml_access();
|
|
116686
117765
|
init_PptxHandlerRuntimeAuxiliaryMasterElements();
|
|
116687
|
-
|
|
117766
|
+
PptxHandlerRuntime79 = class extends PptxHandlerRuntime78 {
|
|
116688
117767
|
/**
|
|
116689
117768
|
* Parse the layout artwork inherited by a slide.
|
|
116690
117769
|
*
|
|
@@ -116868,6 +117947,7 @@ var init_PptxHandlerRuntimeLayoutElements = __esm({
|
|
|
116868
117947
|
const masterElements = showMasterSp ? await this.getMasterElements(layoutPath) : [];
|
|
116869
117948
|
this.currentSlideClrMapOverride = prevClrMapOverride;
|
|
116870
117949
|
const allElements = [...masterElements, ...elements2];
|
|
117950
|
+
this.templateElementBaselines.recordBaselines(allElements);
|
|
116871
117951
|
this.layoutCache.set(layoutPath, allElements);
|
|
116872
117952
|
return allElements;
|
|
116873
117953
|
} catch (e) {
|
|
@@ -116878,13 +117958,13 @@ var init_PptxHandlerRuntimeLayoutElements = __esm({
|
|
|
116878
117958
|
};
|
|
116879
117959
|
}
|
|
116880
117960
|
});
|
|
116881
|
-
var
|
|
117961
|
+
var PptxHandlerRuntime80;
|
|
116882
117962
|
var init_PptxHandlerRuntimeLayoutPreviews = __esm({
|
|
116883
117963
|
"src/core/core/runtime/PptxHandlerRuntimeLayoutPreviews.ts"() {
|
|
116884
117964
|
init_constants();
|
|
116885
117965
|
init_xml_access();
|
|
116886
117966
|
init_PptxHandlerRuntimeLayoutElements();
|
|
116887
|
-
|
|
117967
|
+
PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
|
|
116888
117968
|
layoutPreviewCache = /* @__PURE__ */ new Map();
|
|
116889
117969
|
/**
|
|
116890
117970
|
* Build (or return the memoised) preview for one layout.
|
|
@@ -116997,7 +118077,7 @@ function extractFillStyleListChildOrder(rawXml, listTag) {
|
|
|
116997
118077
|
return order;
|
|
116998
118078
|
}
|
|
116999
118079
|
var FILL_LIST_CHILD_TAGS;
|
|
117000
|
-
var
|
|
118080
|
+
var PptxHandlerRuntime81;
|
|
117001
118081
|
var init_PptxHandlerRuntimeThemeFormatScheme = __esm({
|
|
117002
118082
|
"src/core/core/runtime/PptxHandlerRuntimeThemeFormatScheme.ts"() {
|
|
117003
118083
|
init_PptxHandlerRuntimeLayoutPreviews();
|
|
@@ -117008,7 +118088,7 @@ var init_PptxHandlerRuntimeThemeFormatScheme = __esm({
|
|
|
117008
118088
|
"a:noFill",
|
|
117009
118089
|
"a:grpFill"
|
|
117010
118090
|
];
|
|
117011
|
-
|
|
118091
|
+
PptxHandlerRuntime81 = class _PptxHandlerRuntime extends PptxHandlerRuntime80 {
|
|
117012
118092
|
/**
|
|
117013
118093
|
* Build a fill-style entry for one child node based on its tag.
|
|
117014
118094
|
*/
|
|
@@ -117291,12 +118371,12 @@ var init_PptxHandlerRuntimeThemeFormatScheme = __esm({
|
|
|
117291
118371
|
};
|
|
117292
118372
|
}
|
|
117293
118373
|
});
|
|
117294
|
-
var
|
|
118374
|
+
var PptxHandlerRuntime82;
|
|
117295
118375
|
var init_PptxHandlerRuntimeThemeOverrides = __esm({
|
|
117296
118376
|
"src/core/core/runtime/PptxHandlerRuntimeThemeOverrides.ts"() {
|
|
117297
118377
|
init_color_scheme_index();
|
|
117298
118378
|
init_PptxHandlerRuntimeThemeFormatScheme();
|
|
117299
|
-
|
|
118379
|
+
PptxHandlerRuntime82 = class extends PptxHandlerRuntime81 {
|
|
117300
118380
|
/**
|
|
117301
118381
|
* Parse the `a:fmtScheme` element from the theme into a structured
|
|
117302
118382
|
* {@link PptxThemeFormatScheme}. Each sub-list (fillStyleLst, lnStyleLst,
|
|
@@ -117519,12 +118599,12 @@ var init_PptxHandlerRuntimeThemeOverrides = __esm({
|
|
|
117519
118599
|
};
|
|
117520
118600
|
}
|
|
117521
118601
|
});
|
|
117522
|
-
var
|
|
118602
|
+
var PptxHandlerRuntime83;
|
|
117523
118603
|
var init_PptxHandlerRuntimeThemeRefResolution = __esm({
|
|
117524
118604
|
"src/core/core/runtime/PptxHandlerRuntimeThemeRefResolution.ts"() {
|
|
117525
118605
|
init_utils();
|
|
117526
118606
|
init_PptxHandlerRuntimeThemeOverrides();
|
|
117527
|
-
|
|
118607
|
+
PptxHandlerRuntime83 = class extends PptxHandlerRuntime82 {
|
|
117528
118608
|
/**
|
|
117529
118609
|
* Resolve a `a:effectRef` element into concrete effect properties
|
|
117530
118610
|
* by looking up `@_idx` in the theme format scheme's effect style list.
|
|
@@ -117767,11 +118847,11 @@ var init_PptxHandlerRuntimeThemeRefResolution = __esm({
|
|
|
117767
118847
|
function isPresentationThemePartPath(path) {
|
|
117768
118848
|
return /^ppt\/theme\/(?!themeOverride)[^/]+\.xml$/iu.test(path);
|
|
117769
118849
|
}
|
|
117770
|
-
var
|
|
118850
|
+
var PptxHandlerRuntime84;
|
|
117771
118851
|
var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
117772
118852
|
"src/core/core/runtime/PptxHandlerRuntimeThemeLoading.ts"() {
|
|
117773
118853
|
init_PptxHandlerRuntimeThemeRefResolution();
|
|
117774
|
-
|
|
118854
|
+
PptxHandlerRuntime84 = class extends PptxHandlerRuntime83 {
|
|
117775
118855
|
async resolvePrimaryThemePath() {
|
|
117776
118856
|
const masterFiles = this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);
|
|
117777
118857
|
if (!masterFiles || masterFiles.length === 0) {
|
|
@@ -118308,13 +119388,13 @@ var init_theme_scheme_edit = __esm({
|
|
|
118308
119388
|
}
|
|
118309
119389
|
});
|
|
118310
119390
|
var THEME_PART_PATTERN;
|
|
118311
|
-
var
|
|
119391
|
+
var PptxHandlerRuntime85;
|
|
118312
119392
|
var init_PptxHandlerRuntimeThemeProcessing = __esm({
|
|
118313
119393
|
"src/core/core/runtime/PptxHandlerRuntimeThemeProcessing.ts"() {
|
|
118314
119394
|
init_PptxHandlerRuntimeThemeLoading();
|
|
118315
119395
|
init_theme_scheme_edit();
|
|
118316
119396
|
THEME_PART_PATTERN = /^ppt\/theme\/theme\d+\.xml$/;
|
|
118317
|
-
|
|
119397
|
+
PptxHandlerRuntime85 = class extends PptxHandlerRuntime84 {
|
|
118318
119398
|
/**
|
|
118319
119399
|
* The theme parts an edit should touch, primary theme first.
|
|
118320
119400
|
*
|
|
@@ -118467,14 +119547,14 @@ var init_PptxHandlerRuntimeThemeProcessing = __esm({
|
|
|
118467
119547
|
};
|
|
118468
119548
|
}
|
|
118469
119549
|
});
|
|
118470
|
-
var
|
|
119550
|
+
var PptxHandlerRuntime86;
|
|
118471
119551
|
var init_PptxHandlerRuntimeComments = __esm({
|
|
118472
119552
|
"src/core/core/runtime/PptxHandlerRuntimeComments.ts"() {
|
|
118473
119553
|
init_legacy_comment_threading();
|
|
118474
119554
|
init_modern_comment_xml();
|
|
118475
119555
|
init_xml_access();
|
|
118476
119556
|
init_PptxHandlerRuntimeThemeProcessing();
|
|
118477
|
-
|
|
119557
|
+
PptxHandlerRuntime86 = class _PptxHandlerRuntime extends PptxHandlerRuntime85 {
|
|
118478
119558
|
/**
|
|
118479
119559
|
* Parse modern threaded comments (PowerPoint 2019+ / Office 365).
|
|
118480
119560
|
* Modern comments use `p188:cmLst`/`p15:cmLst` roots within
|
|
@@ -118701,7 +119781,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
118701
119781
|
};
|
|
118702
119782
|
}
|
|
118703
119783
|
});
|
|
118704
|
-
var
|
|
119784
|
+
var PptxHandlerRuntime87;
|
|
118705
119785
|
var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
118706
119786
|
"src/core/core/runtime/PptxHandlerRuntimeSmartArtXmlUtils.ts"() {
|
|
118707
119787
|
init_smartart_color_lists();
|
|
@@ -118709,7 +119789,7 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
118709
119789
|
init_smart_art_text_helpers();
|
|
118710
119790
|
init_PptxHandlerRuntimeComments();
|
|
118711
119791
|
init_smartart_text_paragraphs();
|
|
118712
|
-
|
|
119792
|
+
PptxHandlerRuntime87 = class extends PptxHandlerRuntime86 {
|
|
118713
119793
|
async readXmlPartByRelationshipId(slidePath, relationshipId2) {
|
|
118714
119794
|
const normalizedRelationshipId = String(relationshipId2 || "").trim();
|
|
118715
119795
|
if (normalizedRelationshipId.length === 0) {
|
|
@@ -119199,7 +120279,7 @@ var init_smartart_text_style_resolution = __esm({
|
|
|
119199
120279
|
"src/core/core/runtime/smartart-text-style-resolution.ts"() {
|
|
119200
120280
|
}
|
|
119201
120281
|
});
|
|
119202
|
-
var
|
|
120282
|
+
var PptxHandlerRuntime88;
|
|
119203
120283
|
var init_PptxHandlerRuntimeSmartArtParsing = __esm({
|
|
119204
120284
|
"src/core/core/runtime/PptxHandlerRuntimeSmartArtParsing.ts"() {
|
|
119205
120285
|
init_smartart_connector_labels();
|
|
@@ -119210,7 +120290,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
|
|
|
119210
120290
|
init_smartart_style_label_refs();
|
|
119211
120291
|
init_smartart_text_paragraphs();
|
|
119212
120292
|
init_smartart_text_style_resolution();
|
|
119213
|
-
|
|
120293
|
+
PptxHandlerRuntime88 = class _PptxHandlerRuntime extends PptxHandlerRuntime87 {
|
|
119214
120294
|
reportIncompleteSmartArtRelationships(graphicFrame, relationshipIds, slidePath) {
|
|
119215
120295
|
const missing = [
|
|
119216
120296
|
["dm", relationshipIds?.dataRelId],
|
|
@@ -119600,7 +120680,7 @@ var init_smartart_layout_category = __esm({
|
|
|
119600
120680
|
];
|
|
119601
120681
|
}
|
|
119602
120682
|
});
|
|
119603
|
-
var
|
|
120683
|
+
var PptxHandlerRuntime89;
|
|
119604
120684
|
var init_PptxHandlerRuntimeSmartArt = __esm({
|
|
119605
120685
|
"src/core/core/runtime/PptxHandlerRuntimeSmartArt.ts"() {
|
|
119606
120686
|
init_utils();
|
|
@@ -119613,7 +120693,7 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
|
|
|
119613
120693
|
init_smartart_text_paragraphs();
|
|
119614
120694
|
init_smartart_text_style_resolution();
|
|
119615
120695
|
init_smartart_xml_builders();
|
|
119616
|
-
|
|
120696
|
+
PptxHandlerRuntime89 = class _PptxHandlerRuntime extends PptxHandlerRuntime88 {
|
|
119617
120697
|
async getSmartArtDataForGraphicFrame(slidePath, graphicFrame) {
|
|
119618
120698
|
const graphicData = this.xmlLookupService.getChildByLocalName(
|
|
119619
120699
|
this.xmlLookupService.getChildByLocalName(graphicFrame, "graphic"),
|
|
@@ -119832,12 +120912,12 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
|
|
|
119832
120912
|
};
|
|
119833
120913
|
}
|
|
119834
120914
|
});
|
|
119835
|
-
var
|
|
120915
|
+
var PptxHandlerRuntime90;
|
|
119836
120916
|
var init_PptxHandlerRuntimeChartDetection = __esm({
|
|
119837
120917
|
"src/core/core/runtime/PptxHandlerRuntimeChartDetection.ts"() {
|
|
119838
120918
|
init_chart_multi_level_category_parser();
|
|
119839
120919
|
init_PptxHandlerRuntimeSmartArt();
|
|
119840
|
-
|
|
120920
|
+
PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
|
|
119841
120921
|
detectChartType(plotArea) {
|
|
119842
120922
|
if (!plotArea) {
|
|
119843
120923
|
return "unknown";
|
|
@@ -120047,14 +121127,14 @@ function parseNumberVal(node) {
|
|
|
120047
121127
|
return Number.isFinite(num) ? num : void 0;
|
|
120048
121128
|
}
|
|
120049
121129
|
var CHART_DATA_DISPLAY_OPTIONS_EXT_URI2;
|
|
120050
|
-
var
|
|
121130
|
+
var PptxHandlerRuntime91;
|
|
120051
121131
|
var init_PptxHandlerRuntimeChartParsingHelpers = __esm({
|
|
120052
121132
|
"src/core/core/runtime/PptxHandlerRuntimeChartParsingHelpers.ts"() {
|
|
120053
121133
|
init_chart_ext_lookup();
|
|
120054
121134
|
init_chart_pivot_source2();
|
|
120055
121135
|
init_PptxHandlerRuntimeChartDetection();
|
|
120056
121136
|
CHART_DATA_DISPLAY_OPTIONS_EXT_URI2 = "{56B9EC1D-385E-4148-901F-78D8002777C0}";
|
|
120057
|
-
|
|
121137
|
+
PptxHandlerRuntime91 = class extends PptxHandlerRuntime90 {
|
|
120058
121138
|
/**
|
|
120059
121139
|
* Parse `c:plotVisOnly` from the chart root element.
|
|
120060
121140
|
*
|
|
@@ -120313,14 +121393,14 @@ var init_PptxHandlerRuntimeChartParsingHelpers = __esm({
|
|
|
120313
121393
|
}
|
|
120314
121394
|
});
|
|
120315
121395
|
var CHART_USER_SHAPES_REL_TYPE2;
|
|
120316
|
-
var
|
|
121396
|
+
var PptxHandlerRuntime92;
|
|
120317
121397
|
var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
120318
121398
|
"src/core/core/runtime/PptxHandlerRuntimeChartExternalData.ts"() {
|
|
120319
121399
|
init_chart_user_shapes_parser();
|
|
120320
121400
|
init_chart_xlsx_parser();
|
|
120321
121401
|
init_PptxHandlerRuntimeChartParsingHelpers();
|
|
120322
121402
|
CHART_USER_SHAPES_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes";
|
|
120323
|
-
|
|
121403
|
+
PptxHandlerRuntime92 = class extends PptxHandlerRuntime91 {
|
|
120324
121404
|
/**
|
|
120325
121405
|
* Parse `c:externalData` from the chart's `c:chartSpace` and resolve
|
|
120326
121406
|
* the external relationship target from the chart part's .rels file.
|
|
@@ -120477,12 +121557,12 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
120477
121557
|
};
|
|
120478
121558
|
}
|
|
120479
121559
|
});
|
|
120480
|
-
var
|
|
121560
|
+
var PptxHandlerRuntime93;
|
|
120481
121561
|
var init_PptxHandlerRuntimeChartColorStyle = __esm({
|
|
120482
121562
|
"src/core/core/runtime/PptxHandlerRuntimeChartColorStyle.ts"() {
|
|
120483
121563
|
init_chart_style_definition_parser();
|
|
120484
121564
|
init_PptxHandlerRuntimeChartExternalData();
|
|
120485
|
-
|
|
121565
|
+
PptxHandlerRuntime93 = class extends PptxHandlerRuntime92 {
|
|
120486
121566
|
/**
|
|
120487
121567
|
* Parse the Office 2013+ chart-style part (`ppt/charts/style#.xml`)
|
|
120488
121568
|
* referenced from the chart's relationships, sibling to
|
|
@@ -120622,7 +121702,7 @@ var init_PptxHandlerRuntimeChartColorStyle = __esm({
|
|
|
120622
121702
|
}
|
|
120623
121703
|
});
|
|
120624
121704
|
var SCATTER_STYLES;
|
|
120625
|
-
var
|
|
121705
|
+
var PptxHandlerRuntime94;
|
|
120626
121706
|
var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
120627
121707
|
"src/core/core/runtime/PptxHandlerRuntimeChartParsing.ts"() {
|
|
120628
121708
|
init_chart_advanced_parser();
|
|
@@ -120659,7 +121739,7 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
120659
121739
|
"smooth",
|
|
120660
121740
|
"smoothMarker"
|
|
120661
121741
|
]);
|
|
120662
|
-
|
|
121742
|
+
PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
|
|
120663
121743
|
/**
|
|
120664
121744
|
* Parse chart data from a graphic frame element on a slide.
|
|
120665
121745
|
*
|
|
@@ -121311,14 +122391,14 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
121311
122391
|
};
|
|
121312
122392
|
}
|
|
121313
122393
|
});
|
|
121314
|
-
var
|
|
122394
|
+
var PptxHandlerRuntime95;
|
|
121315
122395
|
var init_PptxHandlerRuntimePresentationStructure = __esm({
|
|
121316
122396
|
"src/core/core/runtime/PptxHandlerRuntimePresentationStructure.ts"() {
|
|
121317
122397
|
init_kinsoku_parser();
|
|
121318
122398
|
init_presentation_section_parser();
|
|
121319
122399
|
init_header_footer_parts();
|
|
121320
122400
|
init_PptxHandlerRuntimeChartParsing();
|
|
121321
|
-
|
|
122401
|
+
PptxHandlerRuntime95 = class extends PptxHandlerRuntime94 {
|
|
121322
122402
|
parseEditorAnimations(slideXml3) {
|
|
121323
122403
|
return this.editorAnimationService.parseEditorAnimations(slideXml3);
|
|
121324
122404
|
}
|
|
@@ -121503,7 +122583,7 @@ var init_PptxHandlerRuntimePresentationStructure = __esm({
|
|
|
121503
122583
|
};
|
|
121504
122584
|
}
|
|
121505
122585
|
});
|
|
121506
|
-
var
|
|
122586
|
+
var PptxHandlerRuntime96;
|
|
121507
122587
|
var init_PptxHandlerRuntimeEmbeddedFonts = __esm({
|
|
121508
122588
|
"src/core/core/runtime/PptxHandlerRuntimeEmbeddedFonts.ts"() {
|
|
121509
122589
|
init_eot_parser();
|
|
@@ -121512,7 +122592,7 @@ var init_PptxHandlerRuntimeEmbeddedFonts = __esm({
|
|
|
121512
122592
|
init_strip_parent_dir_segments();
|
|
121513
122593
|
init_xml_access();
|
|
121514
122594
|
init_PptxHandlerRuntimePresentationStructure();
|
|
121515
|
-
|
|
122595
|
+
PptxHandlerRuntime96 = class extends PptxHandlerRuntime95 {
|
|
121516
122596
|
async getEmbeddedFonts(fontList) {
|
|
121517
122597
|
if (!fontList || fontList.fonts.length === 0) {
|
|
121518
122598
|
return [];
|
|
@@ -121715,7 +122795,7 @@ var init_PptxHandlerRuntimeEmbeddedFonts = __esm({
|
|
|
121715
122795
|
}
|
|
121716
122796
|
});
|
|
121717
122797
|
var MAX_OLE_EMBEDDING_BYTES;
|
|
121718
|
-
var
|
|
122798
|
+
var PptxHandlerRuntime97;
|
|
121719
122799
|
var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
121720
122800
|
"src/core/core/runtime/PptxHandlerRuntimeLoadSession.ts"() {
|
|
121721
122801
|
init_ole_embedded_extract();
|
|
@@ -121725,7 +122805,7 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
121725
122805
|
init_authored_slide_background();
|
|
121726
122806
|
init_PptxHandlerRuntimeEmbeddedFonts();
|
|
121727
122807
|
MAX_OLE_EMBEDDING_BYTES = 25 * 1024 * 1024;
|
|
121728
|
-
|
|
122808
|
+
PptxHandlerRuntime97 = class _PptxHandlerRuntime extends PptxHandlerRuntime96 {
|
|
121729
122809
|
isZipContainer(data) {
|
|
121730
122810
|
const bytes = new Uint8Array(data);
|
|
121731
122811
|
if (bytes.byteLength < 4) {
|
|
@@ -121784,6 +122864,7 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
121784
122864
|
this.savedSlideFingerprints.clear();
|
|
121785
122865
|
this.layoutCache.clear();
|
|
121786
122866
|
this.masterCache.clear();
|
|
122867
|
+
this.templateElementBaselines.reset();
|
|
121787
122868
|
this.layoutXmlMap.clear();
|
|
121788
122869
|
this.masterXmlMap.clear();
|
|
121789
122870
|
this.masterTxStylesCache.clear();
|
|
@@ -122082,19 +123163,22 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
122082
123163
|
};
|
|
122083
123164
|
}
|
|
122084
123165
|
});
|
|
122085
|
-
var
|
|
123166
|
+
var PptxHandlerRuntime98;
|
|
122086
123167
|
var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
122087
123168
|
"src/core/core/runtime/PptxHandlerRuntimeLoadPipeline.ts"() {
|
|
122088
123169
|
init_fluent();
|
|
122089
123170
|
init_embedded_font_list();
|
|
122090
123171
|
init_guide_utils();
|
|
122091
123172
|
init_layout_display_name();
|
|
123173
|
+
init_part_rels_path();
|
|
122092
123174
|
init_smart_tags_parser();
|
|
122093
123175
|
init_strip_parent_dir_segments();
|
|
122094
123176
|
init_builders();
|
|
123177
|
+
init_authored_slide_background();
|
|
123178
|
+
init_layout_switch_placeholder_prompts();
|
|
122095
123179
|
init_PptxHandlerRuntimeLoadSession();
|
|
122096
123180
|
init_slide_fingerprint();
|
|
122097
|
-
|
|
123181
|
+
PptxHandlerRuntime98 = class extends PptxHandlerRuntime97 {
|
|
122098
123182
|
async buildLoadData(presentationState, slidesWithWarnings, slideMasters) {
|
|
122099
123183
|
const headerFooter = this.extractHeaderFooter();
|
|
122100
123184
|
const presentationProperties = await this.parsePresentationProperties();
|
|
@@ -122256,6 +123340,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
122256
123340
|
this.externalRelsMap.clear();
|
|
122257
123341
|
this.layoutCache.clear();
|
|
122258
123342
|
this.masterCache.clear();
|
|
123343
|
+
this.templateElementBaselines.reset();
|
|
122259
123344
|
this.layoutXmlMap.clear();
|
|
122260
123345
|
this.masterXmlMap.clear();
|
|
122261
123346
|
this.masterTxStylesCache.clear();
|
|
@@ -122517,15 +123602,28 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
122517
123602
|
}
|
|
122518
123603
|
}
|
|
122519
123604
|
}
|
|
123605
|
+
if (!this.slideRelsMap.has(slidePath)) {
|
|
123606
|
+
this.slideRelsMap.set(
|
|
123607
|
+
slidePath,
|
|
123608
|
+
/* @__PURE__ */ new Map([["rId1", `../slideLayouts/${layoutPath.split("/").pop()}`]])
|
|
123609
|
+
);
|
|
123610
|
+
}
|
|
122520
123611
|
this.layoutCache.delete(layoutPath);
|
|
122521
|
-
|
|
122522
|
-
|
|
122523
|
-
layoutXml,
|
|
122524
|
-
|
|
123612
|
+
await this.getLayoutElements(slidePath);
|
|
123613
|
+
const remappedElements = enrichEmptyPlaceholderPrompts(
|
|
123614
|
+
this.remapElementsToNewLayout(slide.elements, layoutXml, layoutPath),
|
|
123615
|
+
{
|
|
123616
|
+
resolveDefaults: (element) => {
|
|
123617
|
+
const phInfo = this.getElementPlaceholderInfo(element);
|
|
123618
|
+
return phInfo ? this.lookupPlaceholderDefaults(slidePath, phInfo) : void 0;
|
|
123619
|
+
},
|
|
123620
|
+
placeholderType: (element) => this.getElementPlaceholderInfo(element)?.type,
|
|
123621
|
+
applyBodyDefaults: (textStyle, defaults) => this.applyPlaceholderBodyDefaults(textStyle, defaults),
|
|
123622
|
+
applyLevelDefaults: (textStyle, level) => this.applyPlaceholderLevelDefaults(textStyle, level)
|
|
123623
|
+
}
|
|
122525
123624
|
);
|
|
122526
123625
|
const sldLayout = layoutXml["p:sldLayout"];
|
|
122527
123626
|
const layoutName = String(sldLayout?.["p:cSld"]?.["@_name"] || "").trim() || layoutPath;
|
|
122528
|
-
const layoutBgColor = this.extractBackgroundColor(layoutXml, "p:sldLayout");
|
|
122529
123627
|
const updated = {
|
|
122530
123628
|
...slide,
|
|
122531
123629
|
elements: remappedElements,
|
|
@@ -122533,10 +123631,24 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
122533
123631
|
layoutName,
|
|
122534
123632
|
isDirty: true
|
|
122535
123633
|
};
|
|
122536
|
-
|
|
122537
|
-
|
|
122538
|
-
|
|
122539
|
-
|
|
123634
|
+
const origin = slideBackgroundOrigin(this, slidePath);
|
|
123635
|
+
const inheritsBackground = origin ? slideBackgroundIsPurelyInherited(origin, slide) : !slide.rawXml || !this.extractBackgroundColor(slide.rawXml);
|
|
123636
|
+
if (inheritsBackground) {
|
|
123637
|
+
await this.loadSlideRelationships(layoutPath, partRelsPath(layoutPath));
|
|
123638
|
+
const [color2, gradient, image] = await Promise.all([
|
|
123639
|
+
this.getLayoutBackgroundColor(slidePath),
|
|
123640
|
+
this.getLayoutBackgroundGradient(slidePath),
|
|
123641
|
+
this.getLayoutBackgroundImage(slidePath)
|
|
123642
|
+
]);
|
|
123643
|
+
updated.backgroundColor = color2 ?? slide.backgroundColor;
|
|
123644
|
+
updated.backgroundGradient = gradient;
|
|
123645
|
+
updated.backgroundImage = image;
|
|
123646
|
+
rememberSlideBackgroundOrigin(this, slidePath, {
|
|
123647
|
+
authored: false,
|
|
123648
|
+
color: updated.backgroundColor,
|
|
123649
|
+
gradient,
|
|
123650
|
+
image
|
|
123651
|
+
});
|
|
122540
123652
|
}
|
|
122541
123653
|
slides[slideIndex] = updated;
|
|
122542
123654
|
return updated;
|
|
@@ -122544,14 +123656,14 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
122544
123656
|
};
|
|
122545
123657
|
}
|
|
122546
123658
|
});
|
|
122547
|
-
var
|
|
123659
|
+
var PptxHandlerRuntime99;
|
|
122548
123660
|
var init_PptxHandlerRuntimeImplementation = __esm({
|
|
122549
123661
|
"src/core/core/runtime/PptxHandlerRuntimeImplementation.ts"() {
|
|
122550
123662
|
init_PptxElementXmlBuilder();
|
|
122551
123663
|
init_builders();
|
|
122552
123664
|
init_factories();
|
|
122553
123665
|
init_PptxHandlerRuntimeLoadPipeline();
|
|
122554
|
-
|
|
123666
|
+
PptxHandlerRuntime99 = class _PptxHandlerRuntime extends PptxHandlerRuntime98 {
|
|
122555
123667
|
constructor(dependencyFactory = new PptxRuntimeDependencyFactory()) {
|
|
122556
123668
|
super();
|
|
122557
123669
|
this.dependencyFactory = dependencyFactory;
|
|
@@ -122688,11 +123800,11 @@ var init_PptxHandlerRuntimeImplementation = __esm({
|
|
|
122688
123800
|
};
|
|
122689
123801
|
}
|
|
122690
123802
|
});
|
|
122691
|
-
var
|
|
123803
|
+
var PptxHandlerRuntime100;
|
|
122692
123804
|
var init_PptxHandlerRuntime = __esm({
|
|
122693
123805
|
"src/core/core/PptxHandlerRuntime.ts"() {
|
|
122694
123806
|
init_PptxHandlerRuntimeImplementation();
|
|
122695
|
-
|
|
123807
|
+
PptxHandlerRuntime100 = class extends PptxHandlerRuntime99 {
|
|
122696
123808
|
};
|
|
122697
123809
|
}
|
|
122698
123810
|
});
|
|
@@ -122700,7 +123812,7 @@ var createDefaultPptxHandlerRuntime;
|
|
|
122700
123812
|
var init_PptxHandlerRuntimeFactory = __esm({
|
|
122701
123813
|
"src/core/core/PptxHandlerRuntimeFactory.ts"() {
|
|
122702
123814
|
init_PptxHandlerRuntime();
|
|
122703
|
-
createDefaultPptxHandlerRuntime = () => new
|
|
123815
|
+
createDefaultPptxHandlerRuntime = () => new PptxHandlerRuntime100();
|
|
122704
123816
|
}
|
|
122705
123817
|
});
|
|
122706
123818
|
function deepClone(value) {
|
|
@@ -175197,7 +176309,7 @@ function markerText(info) {
|
|
|
175197
176309
|
}
|
|
175198
176310
|
function infoForParagraph(previous, kind, ordinal) {
|
|
175199
176311
|
if (kind === "none") {
|
|
175200
|
-
return {
|
|
176312
|
+
return { none: true };
|
|
175201
176313
|
}
|
|
175202
176314
|
const sameKind = previous && (kind === "numbered" ? Boolean(previous.autoNumType) : Boolean(
|
|
175203
176315
|
previous.char || previous.imageRelId || previous.imageDataUrl || previous.imageBlipFillXml
|
|
@@ -175268,75 +176380,218 @@ function elementSegments(element) {
|
|
|
175268
176380
|
{ text: text22, style: { ...element.textStyle } }
|
|
175269
176381
|
]);
|
|
175270
176382
|
}
|
|
175271
|
-
function
|
|
175272
|
-
const paragraphs = [
|
|
175273
|
-
|
|
175274
|
-
];
|
|
175275
|
-
for (const segment of segments) {
|
|
176383
|
+
function splitBulletParagraphs(segments) {
|
|
176384
|
+
const paragraphs = [{ segments: [], indices: [] }];
|
|
176385
|
+
for (const [index, segment] of segments.entries()) {
|
|
175276
176386
|
if (isParagraphSeparatorSegment(segment)) {
|
|
175277
176387
|
paragraphs[paragraphs.length - 1].terminator = segment;
|
|
175278
|
-
paragraphs.push({ segments: [] });
|
|
176388
|
+
paragraphs.push({ segments: [], indices: [] });
|
|
175279
176389
|
} else {
|
|
175280
176390
|
paragraphs[paragraphs.length - 1].segments.push(segment);
|
|
176391
|
+
paragraphs[paragraphs.length - 1].indices.push(index);
|
|
175281
176392
|
}
|
|
175282
176393
|
}
|
|
175283
176394
|
return paragraphs;
|
|
175284
176395
|
}
|
|
175285
|
-
function
|
|
175286
|
-
|
|
175287
|
-
|
|
175288
|
-
return paragraphBulletKind(paragraph.segments);
|
|
175289
|
-
}
|
|
176396
|
+
function resolveBulletSegments(element, override) {
|
|
176397
|
+
if (override?.length) {
|
|
176398
|
+
return [...override];
|
|
175290
176399
|
}
|
|
175291
|
-
return
|
|
176400
|
+
return elementSegments(element);
|
|
175292
176401
|
}
|
|
175293
|
-
function
|
|
175294
|
-
|
|
175295
|
-
|
|
176402
|
+
function paragraphsBulletKind(paragraphs) {
|
|
176403
|
+
let kind;
|
|
176404
|
+
for (const paragraph of paragraphs) {
|
|
176405
|
+
if (paragraph.segments.length === 0) {
|
|
176406
|
+
continue;
|
|
176407
|
+
}
|
|
176408
|
+
const current = paragraphBulletKind(paragraph.segments);
|
|
176409
|
+
if (kind !== void 0 && kind !== current) {
|
|
176410
|
+
return "mixed";
|
|
176411
|
+
}
|
|
176412
|
+
kind = current;
|
|
175296
176413
|
}
|
|
175297
|
-
|
|
175298
|
-
|
|
176414
|
+
return kind ?? "none";
|
|
176415
|
+
}
|
|
176416
|
+
function elementBulletKind(element) {
|
|
176417
|
+
return paragraphsBulletKind(splitBulletParagraphs(resolveBulletSegments(element)));
|
|
176418
|
+
}
|
|
176419
|
+
function inScope(paragraph, selection) {
|
|
176420
|
+
if (!selection) {
|
|
176421
|
+
return true;
|
|
175299
176422
|
}
|
|
175300
|
-
|
|
175301
|
-
|
|
175302
|
-
|
|
176423
|
+
return paragraph.indices.some(
|
|
176424
|
+
(index) => index >= selection.startSegIdx && index <= selection.endSegIdx
|
|
176425
|
+
);
|
|
176426
|
+
}
|
|
176427
|
+
function selectionBulletKind(element, selection, segments) {
|
|
176428
|
+
const paragraphs = splitBulletParagraphs(resolveBulletSegments(element, segments));
|
|
176429
|
+
return paragraphsBulletKind(paragraphs.filter((paragraph) => inScope(paragraph, selection)));
|
|
176430
|
+
}
|
|
176431
|
+
function setSelectionBullets(element, kind, selection, segments) {
|
|
176432
|
+
if (!hasTextProperties(element)) {
|
|
176433
|
+
return { patch: {}, newSelection: selection };
|
|
175303
176434
|
}
|
|
176435
|
+
const source = resolveBulletSegments(element, segments);
|
|
175304
176436
|
const next = [];
|
|
175305
|
-
const
|
|
175306
|
-
|
|
175307
|
-
|
|
175308
|
-
|
|
175309
|
-
|
|
175310
|
-
|
|
175311
|
-
|
|
175312
|
-
|
|
175313
|
-
|
|
175314
|
-
|
|
175315
|
-
|
|
175316
|
-
|
|
175317
|
-
|
|
175318
|
-
|
|
175319
|
-
const first = segments[0] ?? paragraph.terminator;
|
|
175320
|
-
const info = first?.bulletInfo;
|
|
175321
|
-
const level = first?.paragraphLevel ?? 0;
|
|
175322
|
-
if (info?.autoNumType && paragraphBulletKind(segments) === "numbered") {
|
|
175323
|
-
const startAt = info.autoNumStartAt ?? 1;
|
|
175324
|
-
const ordinal = nextAutoNumber(sequence, level, info.autoNumType, startAt) - startAt;
|
|
175325
|
-
if (info.paragraphIndex !== ordinal) {
|
|
175326
|
-
segments = toggleParagraphBullet(segments, "numbered", ordinal);
|
|
175327
|
-
}
|
|
176437
|
+
const indexMap = /* @__PURE__ */ new Map();
|
|
176438
|
+
let ordinal = 0;
|
|
176439
|
+
for (const paragraph of splitBulletParagraphs(source)) {
|
|
176440
|
+
const content = paragraph.indices.filter(
|
|
176441
|
+
(_index, position2) => !isBulletMarkerSegment(paragraph.segments[position2])
|
|
176442
|
+
);
|
|
176443
|
+
if (paragraph.segments.length > 0 && content.length > 0 && inScope(paragraph, selection)) {
|
|
176444
|
+
const rewritten = toggleParagraphBullet(paragraph.segments, kind, ordinal);
|
|
176445
|
+
ordinal += 1;
|
|
176446
|
+
const contentStart = next.length + (kind === "none" ? 0 : 1);
|
|
176447
|
+
for (const [position2, index] of content.entries()) {
|
|
176448
|
+
indexMap.set(index, contentStart + position2);
|
|
176449
|
+
}
|
|
176450
|
+
next.push(...rewritten);
|
|
175328
176451
|
} else {
|
|
175329
|
-
|
|
176452
|
+
for (const [position2, index] of paragraph.indices.entries()) {
|
|
176453
|
+
indexMap.set(index, next.length + position2);
|
|
176454
|
+
}
|
|
176455
|
+
next.push(...paragraph.segments);
|
|
175330
176456
|
}
|
|
175331
|
-
next.push(...segments);
|
|
175332
176457
|
if (paragraph.terminator) {
|
|
175333
176458
|
next.push(paragraph.terminator);
|
|
175334
176459
|
}
|
|
175335
176460
|
}
|
|
175336
|
-
|
|
175337
|
-
|
|
175338
|
-
|
|
175339
|
-
|
|
176461
|
+
const textStyle = withoutListType(element.textStyle);
|
|
176462
|
+
const newSelection = selection ? {
|
|
176463
|
+
startSegIdx: indexMap.get(selection.startSegIdx) ?? selection.startSegIdx,
|
|
176464
|
+
startOffset: selection.startOffset,
|
|
176465
|
+
endSegIdx: indexMap.get(selection.endSegIdx) ?? selection.endSegIdx,
|
|
176466
|
+
endOffset: selection.endOffset
|
|
176467
|
+
} : null;
|
|
176468
|
+
return { patch: { textSegments: next, textStyle }, newSelection };
|
|
176469
|
+
}
|
|
176470
|
+
function toggleSelectionBullets(element, kind, selection, segments) {
|
|
176471
|
+
const current = selectionBulletKind(element, selection, segments);
|
|
176472
|
+
return setSelectionBullets(element, current === kind ? "none" : kind, selection, segments);
|
|
176473
|
+
}
|
|
176474
|
+
var TEXT_DECORATION_FLAGS = [
|
|
176475
|
+
"bold",
|
|
176476
|
+
"italic",
|
|
176477
|
+
"underline",
|
|
176478
|
+
"strikethrough"
|
|
176479
|
+
];
|
|
176480
|
+
function isContentSegment(segment) {
|
|
176481
|
+
return !segment.isParagraphBreak && segment.text !== "\n" && segment.text.length > 0 && !isBulletMarkerSegment(segment);
|
|
176482
|
+
}
|
|
176483
|
+
function contentSegmentsInSelection(segments, selection) {
|
|
176484
|
+
if (!segments) {
|
|
176485
|
+
return [];
|
|
176486
|
+
}
|
|
176487
|
+
return segments.filter(
|
|
176488
|
+
(segment, index) => isContentSegment(segment) && (!selection || index >= selection.startSegIdx && index <= selection.endSegIdx)
|
|
176489
|
+
);
|
|
176490
|
+
}
|
|
176491
|
+
function flagState(values) {
|
|
176492
|
+
if (values.every((value) => value)) {
|
|
176493
|
+
return "on";
|
|
176494
|
+
}
|
|
176495
|
+
return values.some((value) => value) ? "mixed" : "off";
|
|
176496
|
+
}
|
|
176497
|
+
function getSelectionTextStyleFlags(segments, selection, elementTextStyle) {
|
|
176498
|
+
const runs = contentSegmentsInSelection(segments, selection);
|
|
176499
|
+
const flags = {};
|
|
176500
|
+
for (const flag of TEXT_DECORATION_FLAGS) {
|
|
176501
|
+
const body = elementTextStyle?.[flag] ?? false;
|
|
176502
|
+
flags[flag] = runs.length === 0 ? flagState([body]) : flagState(runs.map((run) => run.style?.[flag] ?? body));
|
|
176503
|
+
}
|
|
176504
|
+
return flags;
|
|
176505
|
+
}
|
|
176506
|
+
function nextToggleValue(state) {
|
|
176507
|
+
return state !== "on";
|
|
176508
|
+
}
|
|
176509
|
+
var BODY_TEXT_STYLE_KEYS = /* @__PURE__ */ new Set([
|
|
176510
|
+
// autofit (`a:normAutofit` / `a:spAutoFit`)
|
|
176511
|
+
"autoFit",
|
|
176512
|
+
"autoFitMode",
|
|
176513
|
+
"autoFitFontScale",
|
|
176514
|
+
"autoFitLineSpacingReduction",
|
|
176515
|
+
// `a:bodyPr` anchoring, direction, rotation
|
|
176516
|
+
"vAlign",
|
|
176517
|
+
"anchorCenter",
|
|
176518
|
+
"textDirection",
|
|
176519
|
+
"textBodyRotation",
|
|
176520
|
+
"upright",
|
|
176521
|
+
// `a:bodyPr` columns, overflow, wrap
|
|
176522
|
+
"columnCount",
|
|
176523
|
+
"columnSpacing",
|
|
176524
|
+
"rtlColumns",
|
|
176525
|
+
"hOverflow",
|
|
176526
|
+
"vertOverflow",
|
|
176527
|
+
"textWrap",
|
|
176528
|
+
// `a:bodyPr` insets
|
|
176529
|
+
"bodyInsetLeft",
|
|
176530
|
+
"bodyInsetTop",
|
|
176531
|
+
"bodyInsetRight",
|
|
176532
|
+
"bodyInsetBottom",
|
|
176533
|
+
// paragraph geometry the block applies body-wide
|
|
176534
|
+
"paragraphMarginLeft",
|
|
176535
|
+
"paragraphMarginRight",
|
|
176536
|
+
"paragraphIndent",
|
|
176537
|
+
"paragraphSpacingBefore",
|
|
176538
|
+
"paragraphSpacingAfter",
|
|
176539
|
+
"lineSpacing",
|
|
176540
|
+
"lineSpacingExactPt",
|
|
176541
|
+
"tabStops",
|
|
176542
|
+
"defaultTabSize",
|
|
176543
|
+
"eaLineBreak",
|
|
176544
|
+
"latinLineBreak",
|
|
176545
|
+
"fontAlignment",
|
|
176546
|
+
"hangingPunctuation",
|
|
176547
|
+
// `a:bodyPr` flags
|
|
176548
|
+
"spaceFirstLastParagraph",
|
|
176549
|
+
"fromWordArt",
|
|
176550
|
+
"forceAntiAlias",
|
|
176551
|
+
"compatibleLineSpacing",
|
|
176552
|
+
// warp and 3D scene on the body
|
|
176553
|
+
"textWarpPreset",
|
|
176554
|
+
"textWarpAdj",
|
|
176555
|
+
"textWarpAdj2",
|
|
176556
|
+
"text3d",
|
|
176557
|
+
"textBodyScene3d",
|
|
176558
|
+
"textBodyScene3dXml",
|
|
176559
|
+
"flatText",
|
|
176560
|
+
"bodyPropertiesExtLstXml"
|
|
176561
|
+
]);
|
|
176562
|
+
function isBodyTextStyleKey(key2) {
|
|
176563
|
+
return BODY_TEXT_STYLE_KEYS.has(key2);
|
|
176564
|
+
}
|
|
176565
|
+
function splitTextStyleUpdate(updates) {
|
|
176566
|
+
const body = {};
|
|
176567
|
+
const run = {};
|
|
176568
|
+
for (const [key2, value] of Object.entries(updates)) {
|
|
176569
|
+
(isBodyTextStyleKey(key2) ? body : run)[key2] = value;
|
|
176570
|
+
}
|
|
176571
|
+
return { body, run };
|
|
176572
|
+
}
|
|
176573
|
+
function reconcileDecorationFlags(segments, textStyle, flags) {
|
|
176574
|
+
const nextStyle = { ...textStyle ?? {} };
|
|
176575
|
+
let nextSegments = [...segments];
|
|
176576
|
+
for (const flag of flags) {
|
|
176577
|
+
const body = nextStyle[flag] ?? false;
|
|
176578
|
+
const content = nextSegments.filter(isContentSegment);
|
|
176579
|
+
if (content.length === 0) {
|
|
176580
|
+
continue;
|
|
176581
|
+
}
|
|
176582
|
+
if (content.every((segment) => segment.style?.[flag] ?? body)) {
|
|
176583
|
+
nextStyle[flag] = true;
|
|
176584
|
+
continue;
|
|
176585
|
+
}
|
|
176586
|
+
if (!body) {
|
|
176587
|
+
continue;
|
|
176588
|
+
}
|
|
176589
|
+
delete nextStyle[flag];
|
|
176590
|
+
nextSegments = nextSegments.map(
|
|
176591
|
+
(segment) => isContentSegment(segment) && segment.style?.[flag] === void 0 ? { ...segment, style: { ...segment.style, [flag]: true } } : segment
|
|
176592
|
+
);
|
|
176593
|
+
}
|
|
176594
|
+
return { textStyle: nextStyle, textSegments: nextSegments };
|
|
175340
176595
|
}
|
|
175341
176596
|
function updateTextSegmentStyle(segment, updates, options = {}) {
|
|
175342
176597
|
return {
|
|
@@ -175597,128 +176852,37 @@ function findTextPositionInSegment(editor, segIdx, charOffset) {
|
|
|
175597
176852
|
}
|
|
175598
176853
|
return null;
|
|
175599
176854
|
}
|
|
175600
|
-
function
|
|
175601
|
-
|
|
175602
|
-
|
|
175603
|
-
|
|
175604
|
-
|
|
175605
|
-
|
|
175606
|
-
const
|
|
175607
|
-
|
|
175608
|
-
|
|
175609
|
-
|
|
175610
|
-
|
|
175611
|
-
|
|
175612
|
-
|
|
175613
|
-
|
|
175614
|
-
|
|
175615
|
-
|
|
175616
|
-
|
|
175617
|
-
|
|
175618
|
-
|
|
175619
|
-
|
|
175620
|
-
|
|
175621
|
-
|
|
175622
|
-
}
|
|
175623
|
-
|
|
175624
|
-
const
|
|
175625
|
-
|
|
175626
|
-
|
|
175627
|
-
|
|
175628
|
-
continue;
|
|
175629
|
-
}
|
|
175630
|
-
fallback = { index, offset: segments[index].text.length };
|
|
175631
|
-
if (end ? offset <= entry2.end : offset < entry2.end) {
|
|
175632
|
-
return { index, offset: Math.max(0, offset - entry2.start) };
|
|
175633
|
-
}
|
|
175634
|
-
}
|
|
175635
|
-
return fallback;
|
|
175636
|
-
}
|
|
175637
|
-
function restoreParagraphMetadata(original, updated) {
|
|
175638
|
-
const firstRuns = original.filter(
|
|
175639
|
-
(_, index) => index === 0 || isParagraphSeparatorSegment(original[index - 1])
|
|
175640
|
-
);
|
|
175641
|
-
let paragraph = 0;
|
|
175642
|
-
return updated.map((segment, index) => {
|
|
175643
|
-
const first = index === 0 || isParagraphSeparatorSegment(updated[index - 1]);
|
|
175644
|
-
if (!first) {
|
|
175645
|
-
return segment;
|
|
175646
|
-
}
|
|
175647
|
-
const source = firstRuns[paragraph++];
|
|
175648
|
-
if (!source) {
|
|
175649
|
-
return segment;
|
|
175650
|
-
}
|
|
175651
|
-
return {
|
|
175652
|
-
...segment,
|
|
175653
|
-
bulletInfo: source.bulletInfo,
|
|
175654
|
-
paragraphLevel: source.paragraphLevel,
|
|
175655
|
-
paragraphProperties: source.paragraphProperties,
|
|
175656
|
-
endParaRunProperties: source.endParaRunProperties
|
|
175657
|
-
};
|
|
175658
|
-
});
|
|
175659
|
-
}
|
|
175660
|
-
function selectedParagraphBulletKind(element, selection) {
|
|
175661
|
-
if (!selection || !hasTextProperties(element) || !element.textSegments) {
|
|
175662
|
-
return elementBulletKind(element);
|
|
175663
|
-
}
|
|
175664
|
-
let first = selection.startSegIdx;
|
|
175665
|
-
while (first > 0 && !isParagraphSeparatorSegment(element.textSegments[first - 1])) {
|
|
175666
|
-
first -= 1;
|
|
175667
|
-
}
|
|
175668
|
-
return paragraphBulletKind(element.textSegments.slice(first));
|
|
175669
|
-
}
|
|
175670
|
-
function applyListStyleUpdate(element, updates, selection) {
|
|
175671
|
-
if (!hasTextProperties(element) || !updates.listType) {
|
|
175672
|
-
return { patch: {}, selection };
|
|
175673
|
-
}
|
|
175674
|
-
const { listType, ...characterStyle } = updates;
|
|
175675
|
-
let segments = element.textSegments;
|
|
175676
|
-
let workingSelection = selection;
|
|
175677
|
-
if (segments && Object.keys(characterStyle).length > 0) {
|
|
175678
|
-
if (selection) {
|
|
175679
|
-
const styled = applyStyleToSelectedSegments(segments, selection, characterStyle);
|
|
175680
|
-
segments = restoreParagraphMetadata(segments, styled.newSegments);
|
|
175681
|
-
workingSelection = styled.newSelection;
|
|
175682
|
-
} else {
|
|
175683
|
-
segments = segments.map((segment) => updateTextSegmentStyle(segment, characterStyle));
|
|
175684
|
-
}
|
|
175685
|
-
}
|
|
175686
|
-
const working = {
|
|
175687
|
-
...element,
|
|
175688
|
-
textSegments: segments,
|
|
175689
|
-
textStyle: selection ? element.textStyle : { ...element.textStyle, ...characterStyle }
|
|
175690
|
-
};
|
|
175691
|
-
if (!workingSelection || !segments) {
|
|
175692
|
-
return { patch: setElementBullets(working, listType), selection: null };
|
|
175693
|
-
}
|
|
175694
|
-
const entries = positions(segments);
|
|
175695
|
-
const startEntry = entries[workingSelection.startSegIdx];
|
|
175696
|
-
const endEntry = entries[workingSelection.endSegIdx];
|
|
175697
|
-
if (!startEntry || !endEntry) {
|
|
175698
|
-
return { patch: {}, selection: null };
|
|
175699
|
-
}
|
|
175700
|
-
const startOffset = startEntry.start + workingSelection.startOffset;
|
|
175701
|
-
const endOffset = endEntry.start + workingSelection.endOffset;
|
|
175702
|
-
const lastSelected = [...entries].reverse().find((entry2) => entry2.start < endOffset);
|
|
175703
|
-
const patch = setElementBullets(working, listType, {
|
|
175704
|
-
startParagraph: startEntry.paragraph,
|
|
175705
|
-
endParagraph: lastSelected?.paragraph ?? endEntry.paragraph
|
|
175706
|
-
});
|
|
175707
|
-
const next = { ...working, ...patch };
|
|
175708
|
-
const nextSegments = hasTextProperties(next) ? next.textSegments : void 0;
|
|
175709
|
-
if (!nextSegments) {
|
|
175710
|
-
return { patch, selection: null };
|
|
175711
|
-
}
|
|
175712
|
-
const start = restorePoint(nextSegments, startOffset, false);
|
|
175713
|
-
const end = restorePoint(nextSegments, endOffset, true);
|
|
176855
|
+
function applyTextStyleUpdate(element, updates, selection, segments) {
|
|
176856
|
+
if (!hasTextProperties(element)) {
|
|
176857
|
+
return { patch: {}, newSelection: null };
|
|
176858
|
+
}
|
|
176859
|
+
const current = segments ?? element.textSegments;
|
|
176860
|
+
if (selection && current && current.length > 0) {
|
|
176861
|
+
const { body, run } = splitTextStyleUpdate(updates);
|
|
176862
|
+
let textStyle2 = { ...element.textStyle, ...body };
|
|
176863
|
+
let textSegments2 = [...current];
|
|
176864
|
+
let newSelection = selection;
|
|
176865
|
+
if (Object.keys(run).length > 0) {
|
|
176866
|
+
const scoped = applyStyleToSelectedSegments(textSegments2, selection, run);
|
|
176867
|
+
textSegments2 = scoped.newSegments;
|
|
176868
|
+
newSelection = scoped.newSelection;
|
|
176869
|
+
}
|
|
176870
|
+
const touched = TEXT_DECORATION_FLAGS.filter((flag) => flag in run);
|
|
176871
|
+
if (touched.length > 0) {
|
|
176872
|
+
const reconciled = reconcileDecorationFlags(textSegments2, textStyle2, touched);
|
|
176873
|
+
textStyle2 = reconciled.textStyle;
|
|
176874
|
+
textSegments2 = reconciled.textSegments;
|
|
176875
|
+
}
|
|
176876
|
+
return { patch: { textStyle: textStyle2, textSegments: textSegments2 }, newSelection };
|
|
176877
|
+
}
|
|
176878
|
+
const textStyle = { ...element.textStyle, ...updates };
|
|
176879
|
+
const textSegments = current?.map((segment) => ({
|
|
176880
|
+
...segment,
|
|
176881
|
+
style: { ...segment.style, ...updates }
|
|
176882
|
+
}));
|
|
175714
176883
|
return {
|
|
175715
|
-
patch,
|
|
175716
|
-
|
|
175717
|
-
startSegIdx: start.index,
|
|
175718
|
-
startOffset: start.offset,
|
|
175719
|
-
endSegIdx: end.index,
|
|
175720
|
-
endOffset: end.offset
|
|
175721
|
-
}
|
|
176884
|
+
patch: textSegments ? { textStyle, textSegments } : { textStyle },
|
|
176885
|
+
newSelection: null
|
|
175722
176886
|
};
|
|
175723
176887
|
}
|
|
175724
176888
|
var DEBOUNCE_MS = 600;
|
|
@@ -176867,12 +178031,15 @@ function buildTextBlockStyle(element, options = {}) {
|
|
|
176867
178031
|
const bodyIndent = hasParagraphIndents ? 0 : ts?.paragraphIndent || 0;
|
|
176868
178032
|
const bodyMarginLeft = hasParagraphIndents ? 0 : ts?.paragraphMarginLeft || 0;
|
|
176869
178033
|
const bodyMarginRight = hasParagraphIndents ? 0 : ts?.paragraphMarginRight || 0;
|
|
178034
|
+
const hasTextSegments = (element.textSegments?.length ?? 0) > 0;
|
|
176870
178035
|
const decorations = [];
|
|
176871
|
-
if (
|
|
176872
|
-
|
|
176873
|
-
|
|
176874
|
-
|
|
176875
|
-
|
|
178036
|
+
if (!hasTextSegments) {
|
|
178037
|
+
if (ts?.underline || ts?.hyperlink) {
|
|
178038
|
+
decorations.push("underline");
|
|
178039
|
+
}
|
|
178040
|
+
if (ts?.strikethrough) {
|
|
178041
|
+
decorations.push("line-through");
|
|
178042
|
+
}
|
|
176876
178043
|
}
|
|
176877
178044
|
const style = {};
|
|
176878
178045
|
if (options.bodyLayout) {
|
|
@@ -176888,7 +178055,7 @@ function buildTextBlockStyle(element, options = {}) {
|
|
|
176888
178055
|
}
|
|
176889
178056
|
}
|
|
176890
178057
|
style.color = ts?.hyperlink ? normalizeHexColor2(ts?.color, HYPERLINK_COLOR) : normalizeHexColor2(ts?.color, fallbackColor);
|
|
176891
|
-
if (
|
|
178058
|
+
if (!hasTextSegments && ts?.highlightColor) {
|
|
176892
178059
|
style.backgroundColor = normalizeHexColor2(ts.highlightColor, void 0);
|
|
176893
178060
|
}
|
|
176894
178061
|
style.textAlign = resolveCssTextAlign(ts?.align, isRtl) ?? "left";
|
|
@@ -176901,7 +178068,7 @@ function buildTextBlockStyle(element, options = {}) {
|
|
|
176901
178068
|
style.fontWeight = ts?.bold ? 700 : 400;
|
|
176902
178069
|
style.fontStyle = ts?.italic ? "italic" : "normal";
|
|
176903
178070
|
style.textDecorationLine = decorations.length > 0 ? decorations.join(" ") : "none";
|
|
176904
|
-
if (ts?.strikethrough && ts?.strikeType === "dblStrike") {
|
|
178071
|
+
if (!hasTextSegments && ts?.strikethrough && ts?.strikeType === "dblStrike") {
|
|
176905
178072
|
style.textDecorationStyle = "double";
|
|
176906
178073
|
}
|
|
176907
178074
|
style.lineHeight = resolveLineHeight(ts);
|
|
@@ -181238,6 +182405,9 @@ function remapEmptyParagraph(text22, segments, terminator) {
|
|
|
181238
182405
|
delete first.isParagraphBreak;
|
|
181239
182406
|
return [{ ...first, text: text22, style: { ...insertionStyle } }];
|
|
181240
182407
|
}
|
|
182408
|
+
function trailingWhitespace(text22) {
|
|
182409
|
+
return text22.slice(text22.trimEnd().length);
|
|
182410
|
+
}
|
|
181241
182411
|
function renumberRemappedParagraphs(segments) {
|
|
181242
182412
|
const sequence = createAutoNumberSequence();
|
|
181243
182413
|
let first = true;
|
|
@@ -181261,7 +182431,7 @@ function renumberRemappedParagraphs(segments) {
|
|
|
181261
182431
|
if (isBulletMarkerSegment(segment)) {
|
|
181262
182432
|
const resolved = resolveParagraphBullet(updated);
|
|
181263
182433
|
if (resolved) {
|
|
181264
|
-
updated.text = resolved.marker + (segment.text
|
|
182434
|
+
updated.text = resolved.marker + trailingWhitespace(segment.text);
|
|
181265
182435
|
}
|
|
181266
182436
|
}
|
|
181267
182437
|
return updated;
|
|
@@ -181311,8 +182481,7 @@ function continueListParagraph(segments, donorSegments) {
|
|
|
181311
182481
|
if (bullet.isNumbered && typeof paragraphIndex === "number" && Number.isFinite(paragraphIndex) && isBulletMarkerSegment(donor)) {
|
|
181312
182482
|
const resolved = resolveParagraphBullet(continued);
|
|
181313
182483
|
if (resolved) {
|
|
181314
|
-
|
|
181315
|
-
continued.text = `${resolved.marker}${trailingWhitespace}`;
|
|
182484
|
+
continued.text = `${resolved.marker}${trailingWhitespace(donor.text)}`;
|
|
181316
182485
|
}
|
|
181317
182486
|
}
|
|
181318
182487
|
return [continued, ...rest];
|
|
@@ -181545,6 +182714,22 @@ function remapTextToSegments(newText, originalSegments, elementTextStyle) {
|
|
|
181545
182714
|
);
|
|
181546
182715
|
if (!originalParagraph && precedingParagraph) {
|
|
181547
182716
|
paraSegments = continueListParagraph(paraSegments, precedingParagraph);
|
|
182717
|
+
const donor = precedingParagraph[0];
|
|
182718
|
+
if (donor?.paragraphProperties?.alignment !== void 0 && paraSegments[0]) {
|
|
182719
|
+
paraSegments = [
|
|
182720
|
+
{
|
|
182721
|
+
...paraSegments[0],
|
|
182722
|
+
paragraphLevel: donor.paragraphLevel,
|
|
182723
|
+
paragraphProperties: donor.paragraphProperties
|
|
182724
|
+
},
|
|
182725
|
+
...paraSegments.slice(1)
|
|
182726
|
+
];
|
|
182727
|
+
}
|
|
182728
|
+
} else if (!originalParagraph && pi === 0 && paraSegments[0]) {
|
|
182729
|
+
const firstOriginal = originalParagraphs[0]?.segments[0];
|
|
182730
|
+
if (firstOriginal?.paragraphLevel !== void 0) {
|
|
182731
|
+
paraSegments = [{ ...paraSegments[0], paragraphLevel: firstOriginal.paragraphLevel }];
|
|
182732
|
+
}
|
|
181548
182733
|
}
|
|
181549
182734
|
output.push(...paraSegments);
|
|
181550
182735
|
precedingParagraph = paraSegments;
|
|
@@ -181655,7 +182840,7 @@ function adjustmentRange(def, key2, vars, isAngular) {
|
|
|
181655
182840
|
}
|
|
181656
182841
|
return isAngular ? { min: 0, max: ANGLE_UNITS_PER_TURN } : { min: -UNBOUNDED_CARTESIAN, max: UNBOUNDED_CARTESIAN };
|
|
181657
182842
|
}
|
|
181658
|
-
var
|
|
182843
|
+
var COMMAND_ARITY2 = {
|
|
181659
182844
|
M: { take: 2, points: [0] },
|
|
181660
182845
|
L: { take: 2, points: [0] },
|
|
181661
182846
|
Q: { take: 4, points: [0, 2] },
|
|
@@ -181675,7 +182860,7 @@ function pathCoordinates(paths) {
|
|
|
181675
182860
|
i2 += 1;
|
|
181676
182861
|
continue;
|
|
181677
182862
|
}
|
|
181678
|
-
const arity =
|
|
182863
|
+
const arity = COMMAND_ARITY2[command];
|
|
181679
182864
|
if (!arity) {
|
|
181680
182865
|
i2 += 1;
|
|
181681
182866
|
continue;
|
|
@@ -187567,14 +188752,14 @@ var THREE_UNAVAILABLE = {
|
|
|
187567
188752
|
var FOV = 50;
|
|
187568
188753
|
async function loadThree() {
|
|
187569
188754
|
try {
|
|
187570
|
-
return await import('./three.module-
|
|
188755
|
+
return await import('./three.module-YZ4M24WM.js');
|
|
187571
188756
|
} catch {
|
|
187572
188757
|
return null;
|
|
187573
188758
|
}
|
|
187574
188759
|
}
|
|
187575
188760
|
async function loadGltfLoaderCtor() {
|
|
187576
188761
|
try {
|
|
187577
|
-
const mod = await import('./GLTFLoader-
|
|
188762
|
+
const mod = await import('./GLTFLoader-KY7AYPMX.js');
|
|
187578
188763
|
return mod.GLTFLoader;
|
|
187579
188764
|
} catch {
|
|
187580
188765
|
return null;
|
|
@@ -187582,7 +188767,7 @@ async function loadGltfLoaderCtor() {
|
|
|
187582
188767
|
}
|
|
187583
188768
|
async function loadOrbitControlsCtor() {
|
|
187584
188769
|
try {
|
|
187585
|
-
const mod = await import('./OrbitControls-
|
|
188770
|
+
const mod = await import('./OrbitControls-CGYUF3BY.js');
|
|
187586
188771
|
return mod.OrbitControls;
|
|
187587
188772
|
} catch {
|
|
187588
188773
|
return null;
|
|
@@ -187929,14 +189114,14 @@ function createChart3DLabelProjector(three, doc, labels) {
|
|
|
187929
189114
|
}
|
|
187930
189115
|
async function loadChart3DThree() {
|
|
187931
189116
|
try {
|
|
187932
|
-
return await import('./three.module-
|
|
189117
|
+
return await import('./three.module-YZ4M24WM.js');
|
|
187933
189118
|
} catch {
|
|
187934
189119
|
return null;
|
|
187935
189120
|
}
|
|
187936
189121
|
}
|
|
187937
189122
|
async function loadChart3DOrbitControls() {
|
|
187938
189123
|
try {
|
|
187939
|
-
const mod = await import('./OrbitControls-
|
|
189124
|
+
const mod = await import('./OrbitControls-CGYUF3BY.js');
|
|
187940
189125
|
return mod.OrbitControls;
|
|
187941
189126
|
} catch {
|
|
187942
189127
|
return null;
|
|
@@ -190771,27 +191956,41 @@ function projectDrawingShapes(elementId, shapes, viewBox, palette, style) {
|
|
|
190771
191956
|
function styleShadowFilter(style) {
|
|
190772
191957
|
return styleShadow(style);
|
|
190773
191958
|
}
|
|
191959
|
+
function collectFontsFromElement(element, fonts) {
|
|
191960
|
+
if (hasTextProperties(element)) {
|
|
191961
|
+
if (element.textStyle?.fontFamily) {
|
|
191962
|
+
fonts.add(element.textStyle.fontFamily);
|
|
191963
|
+
}
|
|
191964
|
+
for (const segment of element.textSegments ?? []) {
|
|
191965
|
+
if (segment.style?.fontFamily) {
|
|
191966
|
+
fonts.add(segment.style.fontFamily);
|
|
191967
|
+
}
|
|
191968
|
+
}
|
|
191969
|
+
}
|
|
191970
|
+
if (element.type === "group") {
|
|
191971
|
+
for (const child27 of element.children ?? []) {
|
|
191972
|
+
collectFontsFromElement(child27, fonts);
|
|
191973
|
+
}
|
|
191974
|
+
}
|
|
191975
|
+
}
|
|
191976
|
+
function collectUsedFonts(slides) {
|
|
191977
|
+
const fonts = /* @__PURE__ */ new Set();
|
|
191978
|
+
for (const slide of slides) {
|
|
191979
|
+
for (const element of slide.elements ?? []) {
|
|
191980
|
+
collectFontsFromElement(element, fonts);
|
|
191981
|
+
}
|
|
191982
|
+
}
|
|
191983
|
+
return [...fonts].sort();
|
|
191984
|
+
}
|
|
190774
191985
|
var GOOGLE_FONTS_CSS2_BASE = "https://fonts.googleapis.com/css2";
|
|
190775
191986
|
var GOOGLE_WEBFONT_AXIS = "ital,wght@0,400;0,700;1,400;1,700";
|
|
190776
191987
|
var DISPLAY_PARAM = "display=swap";
|
|
190777
191988
|
function collectReferencedFontFamilies(slides) {
|
|
190778
191989
|
const families = /* @__PURE__ */ new Set();
|
|
190779
|
-
const visit = (elements) => {
|
|
190780
|
-
for (const el of elements) {
|
|
190781
|
-
if (el.type === "group") {
|
|
190782
|
-
visit(el.children);
|
|
190783
|
-
}
|
|
190784
|
-
if (hasTextProperties(el) && el.textSegments) {
|
|
190785
|
-
for (const seg of el.textSegments) {
|
|
190786
|
-
if (seg.style.fontFamily) {
|
|
190787
|
-
families.add(seg.style.fontFamily);
|
|
190788
|
-
}
|
|
190789
|
-
}
|
|
190790
|
-
}
|
|
190791
|
-
}
|
|
190792
|
-
};
|
|
190793
191990
|
for (const slide of slides) {
|
|
190794
|
-
|
|
191991
|
+
for (const el of slide.elements) {
|
|
191992
|
+
collectFontsFromElement(el, families);
|
|
191993
|
+
}
|
|
190795
191994
|
}
|
|
190796
191995
|
return families;
|
|
190797
191996
|
}
|
|
@@ -198369,32 +199568,6 @@ function computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight,
|
|
|
198369
199568
|
visibleRange: { start: visibleStart, end: visibleEnd }
|
|
198370
199569
|
};
|
|
198371
199570
|
}
|
|
198372
|
-
function collectFontsFromElement(element, fonts) {
|
|
198373
|
-
if (hasTextProperties(element)) {
|
|
198374
|
-
if (element.textStyle?.fontFamily) {
|
|
198375
|
-
fonts.add(element.textStyle.fontFamily);
|
|
198376
|
-
}
|
|
198377
|
-
for (const segment of element.textSegments ?? []) {
|
|
198378
|
-
if (segment.style?.fontFamily) {
|
|
198379
|
-
fonts.add(segment.style.fontFamily);
|
|
198380
|
-
}
|
|
198381
|
-
}
|
|
198382
|
-
}
|
|
198383
|
-
if (element.type === "group") {
|
|
198384
|
-
for (const child27 of element.children ?? []) {
|
|
198385
|
-
collectFontsFromElement(child27, fonts);
|
|
198386
|
-
}
|
|
198387
|
-
}
|
|
198388
|
-
}
|
|
198389
|
-
function collectUsedFonts(slides) {
|
|
198390
|
-
const fonts = /* @__PURE__ */ new Set();
|
|
198391
|
-
for (const slide of slides) {
|
|
198392
|
-
for (const element of slide.elements ?? []) {
|
|
198393
|
-
collectFontsFromElement(element, fonts);
|
|
198394
|
-
}
|
|
198395
|
-
}
|
|
198396
|
-
return [...fonts].sort();
|
|
198397
|
-
}
|
|
198398
199571
|
function browserFontSource() {
|
|
198399
199572
|
return typeof document === "undefined" ? void 0 : document.fonts;
|
|
198400
199573
|
}
|
|
@@ -201185,13 +202358,26 @@ async function fetchAsDataUrl(url) {
|
|
|
201185
202358
|
return null;
|
|
201186
202359
|
}
|
|
201187
202360
|
}
|
|
201188
|
-
var CSS_URL_PATTERN = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^"')\s]+))\s*\)/u;
|
|
201189
202361
|
function extractCssUrl(value) {
|
|
201190
|
-
const
|
|
201191
|
-
if (
|
|
202362
|
+
const start = value.indexOf("url(");
|
|
202363
|
+
if (start === -1) {
|
|
202364
|
+
return null;
|
|
202365
|
+
}
|
|
202366
|
+
const contents = value.slice(start + "url(".length).trimStart();
|
|
202367
|
+
const quote = contents[0];
|
|
202368
|
+
if (quote === '"' || quote === "'") {
|
|
202369
|
+
const end2 = contents.indexOf(quote, 1);
|
|
202370
|
+
if (end2 === -1 || !contents.slice(end2 + 1).trimStart().startsWith(")")) {
|
|
202371
|
+
return null;
|
|
202372
|
+
}
|
|
202373
|
+
return contents.slice(1, end2);
|
|
202374
|
+
}
|
|
202375
|
+
const end = contents.indexOf(")");
|
|
202376
|
+
if (end === -1) {
|
|
201192
202377
|
return null;
|
|
201193
202378
|
}
|
|
201194
|
-
|
|
202379
|
+
const url = contents.slice(0, end).trimEnd();
|
|
202380
|
+
return url && !url.includes('"') && !url.includes("'") && !url.includes(" ") && !url.includes(" ") ? url : null;
|
|
201195
202381
|
}
|
|
201196
202382
|
function needsEmbedding(url) {
|
|
201197
202383
|
return url.startsWith("blob:") || url.startsWith("http:") || url.startsWith("https:");
|
|
@@ -201329,6 +202515,89 @@ function calculateViewportFit(input, defaults = DEFAULTS2) {
|
|
|
201329
202515
|
availableHeight
|
|
201330
202516
|
};
|
|
201331
202517
|
}
|
|
202518
|
+
var FREEFORM_COORD_SCALE = 100;
|
|
202519
|
+
var FREEFORM_MIN_POINTS = 2;
|
|
202520
|
+
var FREEFORM_CLOSE_TOLERANCE_FACTOR = 3;
|
|
202521
|
+
var FREEFORM_CLOSE_TOLERANCE_MIN_PX = 4;
|
|
202522
|
+
function freeformCloseTolerance(strokeWidth) {
|
|
202523
|
+
return Math.max(FREEFORM_CLOSE_TOLERANCE_MIN_PX, strokeWidth * FREEFORM_CLOSE_TOLERANCE_FACTOR);
|
|
202524
|
+
}
|
|
202525
|
+
function isFreeformStrokeClosed(points4, tolerance) {
|
|
202526
|
+
if (points4.length < 3) {
|
|
202527
|
+
return false;
|
|
202528
|
+
}
|
|
202529
|
+
const first = points4[0];
|
|
202530
|
+
const last = points4[points4.length - 1];
|
|
202531
|
+
return Math.hypot(last.x - first.x, last.y - first.y) <= tolerance;
|
|
202532
|
+
}
|
|
202533
|
+
function buildFreeformStrokeGeometry(points4, strokeWidth, options = {}) {
|
|
202534
|
+
if (points4.length < FREEFORM_MIN_POINTS) {
|
|
202535
|
+
return null;
|
|
202536
|
+
}
|
|
202537
|
+
let minX = Infinity;
|
|
202538
|
+
let minY = Infinity;
|
|
202539
|
+
let maxX = -Infinity;
|
|
202540
|
+
let maxY = -Infinity;
|
|
202541
|
+
for (const point of points4) {
|
|
202542
|
+
minX = Math.min(minX, point.x);
|
|
202543
|
+
minY = Math.min(minY, point.y);
|
|
202544
|
+
maxX = Math.max(maxX, point.x);
|
|
202545
|
+
maxY = Math.max(maxY, point.y);
|
|
202546
|
+
}
|
|
202547
|
+
minX -= strokeWidth;
|
|
202548
|
+
minY -= strokeWidth;
|
|
202549
|
+
maxX += strokeWidth;
|
|
202550
|
+
maxY += strokeWidth;
|
|
202551
|
+
const width = Math.max(maxX - minX, 1);
|
|
202552
|
+
const height = Math.max(maxY - minY, 1);
|
|
202553
|
+
const segments = points4.map((point, index) => {
|
|
202554
|
+
const pt = {
|
|
202555
|
+
x: Math.round((point.x - minX) * FREEFORM_COORD_SCALE),
|
|
202556
|
+
y: Math.round((point.y - minY) * FREEFORM_COORD_SCALE)
|
|
202557
|
+
};
|
|
202558
|
+
return index === 0 ? { type: "moveTo", pt } : { type: "lineTo", pt };
|
|
202559
|
+
});
|
|
202560
|
+
const closed = isFreeformStrokeClosed(
|
|
202561
|
+
points4,
|
|
202562
|
+
options.closeTolerance ?? freeformCloseTolerance(strokeWidth)
|
|
202563
|
+
);
|
|
202564
|
+
if (closed) {
|
|
202565
|
+
segments.push({ type: "close" });
|
|
202566
|
+
}
|
|
202567
|
+
return {
|
|
202568
|
+
x: minX,
|
|
202569
|
+
y: minY,
|
|
202570
|
+
width,
|
|
202571
|
+
height,
|
|
202572
|
+
path: {
|
|
202573
|
+
width: Math.round(width * FREEFORM_COORD_SCALE),
|
|
202574
|
+
height: Math.round(height * FREEFORM_COORD_SCALE),
|
|
202575
|
+
segments
|
|
202576
|
+
},
|
|
202577
|
+
closed
|
|
202578
|
+
};
|
|
202579
|
+
}
|
|
202580
|
+
function buildFreeformShapeElement(points4, options) {
|
|
202581
|
+
const geometry = buildFreeformStrokeGeometry(points4, options.width, options);
|
|
202582
|
+
if (!geometry) {
|
|
202583
|
+
return null;
|
|
202584
|
+
}
|
|
202585
|
+
return {
|
|
202586
|
+
id: options.id ?? createEditorId("shape"),
|
|
202587
|
+
type: "shape",
|
|
202588
|
+
x: geometry.x,
|
|
202589
|
+
y: geometry.y,
|
|
202590
|
+
width: geometry.width,
|
|
202591
|
+
height: geometry.height,
|
|
202592
|
+
shapeType: "custom",
|
|
202593
|
+
shapeStyle: {
|
|
202594
|
+
fillColor: "transparent",
|
|
202595
|
+
strokeColor: options.color,
|
|
202596
|
+
strokeWidth: options.width
|
|
202597
|
+
},
|
|
202598
|
+
customGeometryPaths: [geometry.path]
|
|
202599
|
+
};
|
|
202600
|
+
}
|
|
201332
202601
|
var FALLBACK_DOWNLOAD_NAME = "presentation.pptx";
|
|
201333
202602
|
var REVOKE_DELAY_MS = 200;
|
|
201334
202603
|
var OPEN_REVOKE_DELAY_MS = 6e4;
|
|
@@ -203493,15 +204762,18 @@ async function rasterizeElementTiles(element, naturalWidth, naturalHeight, doc,
|
|
|
203493
204762
|
return { fullWidth: plan.fullWidth, fullHeight: plan.fullHeight, tiled: plan.tiled, tiles };
|
|
203494
204763
|
}
|
|
203495
204764
|
function groupTilesByRow(tiles) {
|
|
203496
|
-
const
|
|
203497
|
-
|
|
203498
|
-
|
|
203499
|
-
|
|
203500
|
-
|
|
203501
|
-
|
|
203502
|
-
|
|
203503
|
-
|
|
203504
|
-
|
|
204765
|
+
const validTiles = tiles.filter(
|
|
204766
|
+
(tile) => Number.isInteger(tile.row) && Number.isInteger(tile.col) && tile.row >= 0 && tile.col >= 0
|
|
204767
|
+
);
|
|
204768
|
+
const rowCount = validTiles.reduce((max, tile) => Math.max(max, tile.row), 0) + 1;
|
|
204769
|
+
return Array.from({ length: rowCount }, (_rowIndex, row) => {
|
|
204770
|
+
const tilesInRow = validTiles.filter((tile) => tile.row === row);
|
|
204771
|
+
const colCount = tilesInRow.reduce((max, tile) => Math.max(max, tile.col), -1) + 1;
|
|
204772
|
+
return Array.from(
|
|
204773
|
+
{ length: colCount },
|
|
204774
|
+
(_columnIndex, col) => tilesInRow.find((tile) => tile.col === col)
|
|
204775
|
+
);
|
|
204776
|
+
});
|
|
203505
204777
|
}
|
|
203506
204778
|
function combineTileRowPixels(tiles, fullWidth) {
|
|
203507
204779
|
if (tiles.length === 0) {
|
|
@@ -203871,6 +205143,7 @@ exports.TABLE_STYLE_EDITOR_PARTS = TABLE_STYLE_EDITOR_PARTS;
|
|
|
203871
205143
|
exports.TABLE_STYLE_PRESETS = TABLE_STYLE_PRESETS;
|
|
203872
205144
|
exports.TAB_ROW_ACTION_CLASSES = TAB_ROW_ACTION_CLASSES;
|
|
203873
205145
|
exports.TEXT_BUILD_ID_SEP = TEXT_BUILD_ID_SEP;
|
|
205146
|
+
exports.TEXT_DECORATION_FLAGS = TEXT_DECORATION_FLAGS;
|
|
203874
205147
|
exports.TEXT_WARP_PRESETS = TEXT_WARP_PRESETS;
|
|
203875
205148
|
exports.THEME_CATALOG = THEME_CATALOG;
|
|
203876
205149
|
exports.THEME_COLOR_SLOT_LABEL_KEYS = THEME_COLOR_SLOT_LABEL_KEYS;
|
|
@@ -203923,7 +205196,6 @@ exports.applyFindReplacements = applyFindReplacements;
|
|
|
203923
205196
|
exports.applyFormatToElement = applyFormatToElement;
|
|
203924
205197
|
exports.applyHighlightClickStyle = applyHighlightClickStyle;
|
|
203925
205198
|
exports.applyImagePathPatches = applyImagePathPatches;
|
|
203926
|
-
exports.applyListStyleUpdate = applyListStyleUpdate;
|
|
203927
205199
|
exports.applyMasterViewCrudAction = applyMasterViewCrudAction;
|
|
203928
205200
|
exports.applyMotionPathPreset = applyMotionPathPreset;
|
|
203929
205201
|
exports.applyOleDocumentParagraphEdit = applyOleDocumentParagraphEdit;
|
|
@@ -203935,11 +205207,11 @@ exports.applyReadingViewCommand = applyReadingViewCommand;
|
|
|
203935
205207
|
exports.applyRehearsalTimings = applyRehearsalTimings;
|
|
203936
205208
|
exports.applyReroutedConnectors = applyReroutedConnectors;
|
|
203937
205209
|
exports.applyResize = applyResize;
|
|
203938
|
-
exports.applyStyleToSelectedSegments = applyStyleToSelectedSegments;
|
|
203939
205210
|
exports.applyTableStyleDelete = applyTableStyleDelete;
|
|
203940
205211
|
exports.applyTableStyleFieldEdit = applyTableStyleFieldEdit;
|
|
203941
205212
|
exports.applyTableStyleMapChange = applyTableStyleMapChange;
|
|
203942
205213
|
exports.applyTableStylePreset = applyTableStylePreset;
|
|
205214
|
+
exports.applyTextStyleUpdate = applyTextStyleUpdate;
|
|
203943
205215
|
exports.applyThemeOverrideToSlide = applyThemeOverrideToSlide;
|
|
203944
205216
|
exports.applyThemeToData = applyThemeToData;
|
|
203945
205217
|
exports.applyTransitionSoundFile = applyTransitionSoundFile;
|
|
@@ -203980,6 +205252,7 @@ exports.buildDuotoneCacheKey = buildDuotoneCacheKey;
|
|
|
203980
205252
|
exports.buildElementClipboardPayload = buildElementClipboardPayload;
|
|
203981
205253
|
exports.buildFieldSubstitutionContext = buildFieldSubstitutionContext;
|
|
203982
205254
|
exports.buildFontCatalog = buildFontCatalog;
|
|
205255
|
+
exports.buildFreeformShapeElement = buildFreeformShapeElement;
|
|
203983
205256
|
exports.buildGlyphEnvelope = buildGlyphEnvelope;
|
|
203984
205257
|
exports.buildHandoutsHtml = buildHandoutsHtml;
|
|
203985
205258
|
exports.buildHollowHitOutline = buildHollowHitOutline;
|
|
@@ -204067,7 +205340,6 @@ exports.clampOptionNumber = clampOptionNumber;
|
|
|
204067
205340
|
exports.clampPercent2 = clampPercent2;
|
|
204068
205341
|
exports.clampSorterZoom = clampSorterZoom;
|
|
204069
205342
|
exports.clampTransitionNumber = clampTransitionNumber;
|
|
204070
|
-
exports.clampUnitInterval = clampUnitInterval2;
|
|
204071
205343
|
exports.clampZoomScale = clampZoomScale;
|
|
204072
205344
|
exports.classifyExtraConnections = classifyExtraConnections;
|
|
204073
205345
|
exports.classifyMediaType = classifyMediaType;
|
|
@@ -204236,6 +205508,7 @@ exports.getComputedEffectStyle = getComputedEffectStyle;
|
|
|
204236
205508
|
exports.getComputedFillStyle = getComputedFillStyle;
|
|
204237
205509
|
exports.getComputedStrokeStyle = getComputedStrokeStyle;
|
|
204238
205510
|
exports.getConnectorEndpointHandles = getConnectorEndpointHandles;
|
|
205511
|
+
exports.getConnectorPathGeometry = getConnectorPathGeometry;
|
|
204239
205512
|
exports.getContentPartReplayStyles = getContentPartReplayStyles;
|
|
204240
205513
|
exports.getCropShapeClipPath = getCropShapeClipPath;
|
|
204241
205514
|
exports.getCurrentParagraphIndex = getCurrentParagraphIndex;
|
|
@@ -204277,6 +205550,7 @@ exports.getPendingSelectionRestore = getPendingSelectionRestore;
|
|
|
204277
205550
|
exports.getPresetShapeClipPath = getPresetShapeClipPath;
|
|
204278
205551
|
exports.getPresetShapeVectorGeometry = getPresetShapeVectorGeometry;
|
|
204279
205552
|
exports.getPrintableArea = getPrintableArea;
|
|
205553
|
+
exports.getSelectionTextStyleFlags = getSelectionTextStyleFlags;
|
|
204280
205554
|
exports.getSessionTabId = getSessionTabId;
|
|
204281
205555
|
exports.getShapeAdjustmentHandleDescriptors = getShapeAdjustmentHandleDescriptors;
|
|
204282
205556
|
exports.getShapeConnectionSites = getShapeConnectionSites;
|
|
@@ -204409,6 +205683,7 @@ exports.nestedTextDecorationStyle = nestedTextDecorationStyle;
|
|
|
204409
205683
|
exports.newTableElement = newTableElement;
|
|
204410
205684
|
exports.nextPresentedSlide = nextPresentedSlide;
|
|
204411
205685
|
exports.nextShowSlideIndex = nextShowSlideIndex;
|
|
205686
|
+
exports.nextToggleValue = nextToggleValue;
|
|
204412
205687
|
exports.normalizeColorsForCapture = normalizeColorsForCapture;
|
|
204413
205688
|
exports.normalizeHexColor = normalizeHexColor2;
|
|
204414
205689
|
exports.normalizeStrokeDashType = normalizeStrokeDashType;
|
|
@@ -204593,7 +205868,6 @@ exports.segmentsToEditorHtml = segmentsToEditorHtml;
|
|
|
204593
205868
|
exports.segmentsToParagraphs = segmentsToParagraphs;
|
|
204594
205869
|
exports.segmentsToPlainText = segmentsToPlainText;
|
|
204595
205870
|
exports.selectGoogleWebfontFamilies = selectGoogleWebfontFamilies;
|
|
204596
|
-
exports.selectedParagraphBulletKind = selectedParagraphBulletKind;
|
|
204597
205871
|
exports.sendBackward = sendBackward;
|
|
204598
205872
|
exports.sendToBack = sendToBack;
|
|
204599
205873
|
exports.seriesSecondaryAxisPatch = seriesSecondaryAxisPatch;
|
|
@@ -204686,6 +205960,7 @@ exports.toSlideIndex = toSlideIndex;
|
|
|
204686
205960
|
exports.toggleBlackboard = toggleBlackboard;
|
|
204687
205961
|
exports.toggleCommentResolvedInList = toggleCommentResolvedInList;
|
|
204688
205962
|
exports.togglePresenterTimer = togglePresenterTimer;
|
|
205963
|
+
exports.toggleSelectionBullets = toggleSelectionBullets;
|
|
204689
205964
|
exports.toggleSheet = toggleSheet;
|
|
204690
205965
|
exports.toggleStageElementMedia = toggleStageElementMedia;
|
|
204691
205966
|
exports.toggleText3dExtrusion = toggleText3dExtrusion;
|
|
@@ -204702,7 +205977,6 @@ exports.updateMasterViewElement = updateMasterViewElement;
|
|
|
204702
205977
|
exports.updateMergeAttrsInRawXml = updateMergeAttrsInRawXml;
|
|
204703
205978
|
exports.updateSmartArtNodeText = updateSmartArtNodeText;
|
|
204704
205979
|
exports.updateTagInCollections = updateTagInCollections;
|
|
204705
|
-
exports.updateTextSegmentStyle = updateTextSegmentStyle;
|
|
204706
205980
|
exports.validateMediaTrimRange = validateMediaTrimRange;
|
|
204707
205981
|
exports.validateRoomId = validateRoomId;
|
|
204708
205982
|
exports.vermilionDarkColors = vermilionDarkColors;
|