allyhub 0.11.0 → 0.13.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 +16 -0
- package/bin/allyhub.js +2 -2
- package/dist/commands/frames/report.js +1 -1
- package/dist/commands/frames.js +11 -11
- package/dist/main.js +6 -6
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/dist/render.js +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +3 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.js +2 -1
- package/dist/node_modules/@allyhub/chart/dist/color.js +2 -0
- package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/call.js +4 -4
- package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +2 -0
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +6 -0
- package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +2 -0
- package/dist/node_modules/@allyhub/cloud/dist/device.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/records.d.ts +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/signin.d.ts +11 -3
- package/dist/node_modules/@allyhub/cloud/dist/signin.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/uploads.d.ts +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/uploads.js +2 -2
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +130 -0
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/gen.d.ts +3 -1
- package/dist/node_modules/@allyhub/formats/dist/data/gen.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +512 -166
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +2523 -136
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +931 -87
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/dist/run.d.ts +6 -1
- package/dist/node_modules/@allyhub/media/dist/run.js +2 -2
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/color.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/transform.js +2 -0
- package/dist/node_modules/@allyhub/ooxml/package.json +5 -1
- package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +4 -4
- package/dist/node_modules/@allyhub/piece/dist/media.d.ts +2 -2
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +49 -5
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +56 -0
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +72 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +35 -20
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/errors.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +328 -0
- package/dist/node_modules/@allyhub/protocol/dist/events.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +28 -2
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +2 -2
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +69 -6
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +9 -9
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +1 -1
- package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +3 -3
- package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +29 -1
- package/dist/node_modules/@allyhub/report-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +11 -4
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +6 -2
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +3 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/annotations.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/rules.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/data-tools.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/edit.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/fill.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/outline.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/rich.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/rules.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +3 -3
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/numbering.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/patterns.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/table-style.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/workspace.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/audio-icon.js +2 -0
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +3 -3
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +2 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/index.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/table.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/timing.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/table-styles.js +2 -0
- package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/ink.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +101 -49
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/LICENSE +241 -0
- package/dist/node_modules/@allyhub/telemetry/dist/doc.js +47 -0
- package/dist/node_modules/@allyhub/telemetry/dist/errors.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/dist/level.js +3 -0
- package/dist/node_modules/@allyhub/telemetry/dist/scrub.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/dist/telemetry.js +5 -0
- package/dist/node_modules/@allyhub/telemetry/package.json +21 -0
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/timeline-text.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +3 -3
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +12 -12
- package/dist/telemetry.js +4 -0
- package/dist/turn.js +2 -0
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-BKmMA6gn.js → abnfDiagram-WEYOIA3C-D70jg8mE.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-BEFBgb4k.js → architecture-WOLXFQ4H-CrXS3E8e.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-_u5YfCjY.js → architectureDiagram-ZHVYKT53-JrBljCOx.js} +1 -1
- package/editor-web/assets/arrow-down-DzZjFrBL.js +1 -0
- package/editor-web/assets/arrow-up-hdmh9LVD.js +1 -0
- package/editor-web/assets/{article-BUmD3xtR.js → article-BWrfVMRA.js} +6 -6
- package/editor-web/assets/article-hxHjqzV1.js +7 -0
- package/editor-web/assets/{audio-lines-CzuzsGjI.js → audio-lines-1s1eRs4Q.js} +1 -1
- package/editor-web/assets/{blockDiagram-RJAE7QA3-DybfaO3Z.js → blockDiagram-RJAE7QA3-BzfC1xTS.js} +1 -1
- package/editor-web/assets/{bookmark-Dsd3kHJJ.js → bookmark-Dfji3syX.js} +1 -1
- package/editor-web/assets/{button-eGxLxbv9.js → button-EftXSfev.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-BfqLHB5i.js → c4Diagram-XDPPPE54-s2TpXKgH.js} +1 -1
- package/editor-web/assets/calc-worker-jImBXoeb.js +45 -0
- package/editor-web/assets/channel-BFbXY6R0.js +1 -0
- package/editor-web/assets/chart-BC3kUUDD.js +2 -0
- package/editor-web/assets/{chart-no-axes-column-BVkeF_Mr.js → chart-no-axes-column-CJmeYOSo.js} +1 -1
- package/editor-web/assets/{chunk-2E7WHVMD-BVp1I_d0.js → chunk-2E7WHVMD-DyE9v6UX.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-CTdgWEMr.js → chunk-4EMNKR2T-CCunMMcT.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-7pnsxeaP.js → chunk-55XCU76K-CZgJYrN4.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-Dc0Dvkq7.js → chunk-7S6XSTFO-B01FlTFf.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-VAILIsfx.js → chunk-AQDTSKZB-latWUvVu.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-CUDx1Rv5.js → chunk-DSNLSHJZ-BHFiQInN.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-DAoEe-dJ.js → chunk-HAGFOTED-C4hR36ab.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-g0akya12.js → chunk-HNE4Q36P-CNrxiD2Q.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-hTGjzXdJ.js → chunk-NQOKRVIF-DpyEHKEY.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-BgLV8BIJ.js → chunk-UHW7PFBP-SIEJdixh.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-Bw19OOSD.js → chunk-VQ5W62QI-CxWnQRxx.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-CMST9dyE.js → chunk-WQQL4CDK-CbRuCBm6.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-Bbpu36XF.js → chunk-YZO67HFG-Cgu-EQvs.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-C48Ri0Gs.js → chunk-ZAUX2LTX-pAl5CV3o.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-DN1g01Oe.js → chunk-ZCHMQSOR-Du5hY-FP.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-U6jbPr2d.js → classDiagram-v2-4MYWR3UA-CevU94T6.js} +1 -1
- package/editor-web/assets/{collaborator-B1u2td9m.js → collaborator-C6IJkcGR.js} +1 -1
- package/editor-web/assets/copy-DvOiv9Ra.js +1 -0
- package/editor-web/assets/{createLucideIcon-GFZ_fxLc.js → createLucideIcon-REX213UO.js} +1 -1
- package/editor-web/assets/{cynefin-EF2NZ3EQ-gzkai_7-.js → cynefin-EF2NZ3EQ-DBHwpMRJ.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-DtSekSr6.js → cynefinDiagram-WF24UDRP-CxUzpjvG.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-CiUwYVT6.js → dagre-NK4GIZVX-BAJNBDYO.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-r9XHCV-k.js → diagram-CBK3MWTC-BQW9Fbw-.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-DxVsDZ34.js → diagram-I5XIIV2D-DQBROUfn.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-B0eNQoHV.js → diagram-ODIL2UCW-DEoK31qy.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-C7f2MfJT.js → diagram-PFBEJUXE-BTCa2We1.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-CSXcnvct.js → diagram-RJA3I4VV-DNM8qWC3.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-DXzOD_ii.js → diagram-TYUNFSNR-BcKpED4d.js} +1 -1
- package/editor-web/assets/dist-90dg0B0d.js +2 -0
- package/editor-web/assets/dist-BSPs7tZR.js +1 -0
- package/editor-web/assets/dist-CP9XwbBS.js +45 -0
- package/editor-web/assets/dist-CRxtC7DG.js +24 -0
- package/editor-web/assets/{dist-CC7OeU1e.js → dist-Cmnq14RO.js} +3 -3
- package/editor-web/assets/dist-CrZwqOm2.js +1 -0
- package/editor-web/assets/dist-CzUWTcvC.js +38 -0
- package/editor-web/assets/dist-D2a_y4AE.js +1 -0
- package/editor-web/assets/{dist-DDv_SbKw.js → dist-DMZ1VHPK.js} +1 -1
- package/editor-web/assets/dist-DYnXIW8F.js +16 -0
- package/editor-web/assets/{dist-BuWaZ3Y4.js → dist-Dpet39Yp.js} +30 -30
- package/editor-web/assets/dist-Dre4Cwpz.js +1 -0
- package/editor-web/assets/dist-RkxskWGK.js +5 -0
- package/editor-web/assets/dist-aANR6S2I.js +3 -0
- package/editor-web/assets/{dist-Gz6NDS0J.js → dist-qSuFWuVB.js} +3 -3
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-Cs4YRvDD.js → ebnfDiagram-V4P3TTPT-D-1x27Eh.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Bh3LZ9WI.js → elk-QONTBCTQ-BJSCxiTH.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-C4vYTYXp.js → erDiagram-KYQIGQAA-C7Q357iD.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-BN1kkHWS.js → eventmodeling-K75KTNOO-kXrQLSF5.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-GSC4btef.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CA1LkkC5.js → ganttDiagram-R7GPNTJY-Bt3SRgK7.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-Dy5tA7dG.js → gitGraph-VSP46ZUC-DS4CkhfK.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-hJIB8EkH.js → gitGraphDiagram-PDYL7XHY-BgfmSVdI.js} +1 -1
- package/editor-web/assets/group-pebHQTdP.js +1 -0
- package/editor-web/assets/{hint-B8JpEypy.js → hint-BmRKl2nL.js} +1 -1
- package/editor-web/assets/index-D8qc_ipi.js +28 -0
- package/editor-web/assets/index-DDtZpLDF.css +2 -0
- package/editor-web/assets/{info-OHQRW6UA-DvzSf7rQ.js → info-OHQRW6UA-BZjctF3x.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-BjIMm4Af.js → infoDiagram-MVDRKAX5-BAp5oUXk.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Bpz71S40.js → ishikawaDiagram-HPEHV2GE-DGL7ZfUu.js} +1 -1
- package/editor-web/assets/{italic-D10w8n6C.js → italic-CtlNOXN9.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-DAB-pZjD.js → journeyDiagram-BOSHW7O7-DOOoBGx-.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-cYeyh3P6.js → kanban-definition-FNSA4HC5-lbLuUiMW.js} +1 -1
- package/editor-web/assets/katex-UWCZofcd.js +257 -0
- package/editor-web/assets/{link-BC5xK1-1.js → link-CW2KxKT_.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-req5LE0X.js → mermaid-parser.core-RkCFmJcg.js} +3 -3
- package/editor-web/assets/{mermaid.core-zFwZug4C.js → mermaid.core-BVUl-afX.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-TStWb7DG.js → mindmap-definition-6OY57UG3-C3DC4T1J.js} +1 -1
- package/editor-web/assets/minus-D1tgAHbU.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-smFhVKcB.js → packet-JDAUHWVQ-Bkd6YpX8.js} +1 -1
- package/editor-web/assets/{palette-BIOudGkm.js → palette-INFK0Zsr.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-DvSNRv0-.js → pegDiagram-ECIUJNBX-B5Seh4Oe.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-qjaGsBZG.js → pie-XZMESJXO-BNbb4Q8k.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-Dd9P-Pdc.js → pieDiagram-GNMPY74T-_hnbUloZ.js} +1 -1
- package/editor-web/assets/play-DvMyq5xW.js +1 -0
- package/editor-web/assets/{progress-DE4C5_3x.js → progress-D6wSFdpY.js} +1 -1
- package/editor-web/assets/props-form-BfwEi6jW.js +1 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-h2IIKUUA.js → quadrantDiagram-D57K4MC3-1rbqW-KO.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-DlVrSA1d.js → radar-ABXABTNO-BWSnhBSp.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-nFbuLAtc.js → railroad-I3PHUGI6-BNB-OKs1.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-Daj8h2iV.js → railroad-abnf-LNEFI6M7-BKgidf_B.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-eYJyl5PH.js → railroad-ebnf-DWYD2UWJ-CNCnxtHp.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-BTRhKZQq.js → railroad-peg-JR7BVNR7-CyBW6_0o.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-CeLGUjdp.js → railroadDiagram-Y72NRBL7-Cud3SJ7O.js} +1 -1
- package/editor-web/assets/{react-WA6wlt8S.js → react-Bk7NnOLX.js} +1 -1
- package/editor-web/assets/{repeat-2-VQP1EVOZ.js → repeat-2-DfPmKp4w.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dmk9XRM5.js → requirementDiagram-EQYSW5RA-BrSCcpqV.js} +1 -1
- package/editor-web/assets/{row-BRlEWRrK.js → row-VwyPfa1b.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-Yn4zlrAM.js → sankeyDiagram-SY24JHO5-rJV4dJFn.js} +1 -1
- package/editor-web/assets/scissors-D9WmgvNP.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-BTRnp_PW.js → sequenceDiagram-BLEHNHQU-CEUuD2n6.js} +1 -1
- package/editor-web/assets/{session-Do9AqS38.js → session-DE0fvAcs.js} +1 -1
- package/editor-web/assets/sigma-CY2Chbro.js +1 -0
- package/editor-web/assets/slides-BgacyjJW.js +1 -0
- package/editor-web/assets/{snapshots-BUGlKQIB.js → snapshots-D8TtZp1x.js} +1 -1
- package/editor-web/assets/{sound-Bj3o9_Fa.js → sound-DUCxe9eC.js} +1 -1
- package/editor-web/assets/split-Cx2MMnC_.js +3 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-kstrRKv2.js → stateDiagram-v2-A6IESKWZ-BRE_C2he.js} +1 -1
- package/editor-web/assets/sticky-note-C5qUDHhC.js +1 -0
- package/editor-web/assets/{strikethrough-CfXx6IYH.js → strikethrough-DP-7tMz0.js} +1 -1
- package/editor-web/assets/svg-nJtFNJ-7.js +1 -0
- package/editor-web/assets/{swatch-WeJD41aW.js → swatch-lxK4C8fD.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-DaZsZkeP.js → swimlanes-B3ENRKFQ-BEPqWgVe.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DAcNszZ6.js +8 -0
- package/editor-web/assets/{switch-N0G_sbqt.js → switch-DaG6OuAi.js} +1 -1
- package/editor-web/assets/{syntax-oWsKBWFw.js → syntax-9LD8MzGy.js} +1 -1
- package/editor-web/assets/{syntax-BVsgRJ4I.js → syntax-CLaCSmoi.js} +1 -1
- package/editor-web/assets/{table-B6hVZAMi.js → table-CTjNpE4W.js} +1 -1
- package/editor-web/assets/tabs-DjhzblAG.js +1 -0
- package/editor-web/assets/{textarea-tEWvBY9p.js → textarea-DBwRbOyF.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-CLCvY-Yf.js → timeline-definition-JXYKGLGB-p8Qeg4pS.js} +1 -1
- package/editor-web/assets/{trash-2-BP6nqpg2.js → trash-2-DrnRa91l.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-BmN0gwdC.js → treeView-D4JQ5SDB-C9FTdXKq.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-DN29G_E_.js → treemap-SAJKECNS-XAeLVOtI.js} +1 -1
- package/editor-web/assets/{undo-2-CHR0nvWL.js → undo-2-DUGGyBdX.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-DTRS54cB.js → usecaseDiagram-WPOLBNNX-BV3AMRuH.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DAAc11Hx.js → vennDiagram-Q3Y3IDCW-CJdKcYyA.js} +1 -1
- package/editor-web/assets/{video-BlvmR8BK.js → video-He8p6dr6.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-B-UYkmdB.js → wardley-7MLQ67FV-DZh6Mf22.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BmbwCaky.js → wardleyDiagram-IVAIDKWA-XtvKSX-m.js} +1 -1
- package/editor-web/assets/{words-D_4T9Adq.js → words-CPHp_0tt.js} +1 -1
- package/editor-web/assets/{words-WgdEQdYP.js → words-CjW-1tZI.js} +1 -1
- package/editor-web/assets/{xychartDiagram-4URNHDU4-ChAfAq1U.js → xychartDiagram-4URNHDU4-CGkL42sz.js} +1 -1
- package/editor-web/assets/zoom-in-C4lxmIDE.js +1 -0
- package/editor-web/index.html +6 -6
- package/package.json +2 -2
- package/editor-web/assets/arrow-up-B5rJbBv0.js +0 -1
- package/editor-web/assets/article-DNioBb3p.js +0 -7
- package/editor-web/assets/calc-worker-D2pGis6e.js +0 -45
- package/editor-web/assets/channel-TNPgFDrw.js +0 -1
- package/editor-web/assets/chart-C37xvZT2.js +0 -1
- package/editor-web/assets/dist-BGRwhCQO.js +0 -1
- package/editor-web/assets/dist-BW4X7BrF.js +0 -1
- package/editor-web/assets/dist-BgDRE85b.js +0 -2
- package/editor-web/assets/dist-Blq5nJnU.js +0 -24
- package/editor-web/assets/dist-C1emZ9wX.js +0 -37
- package/editor-web/assets/dist-CX-fiPSn.js +0 -38
- package/editor-web/assets/dist-C_VvG-_9.js +0 -5
- package/editor-web/assets/dist-Ce7HrBxv.js +0 -3
- package/editor-web/assets/dist-D2k6w-_a.js +0 -1
- package/editor-web/assets/dist-DEoEO4zs.js +0 -1
- package/editor-web/assets/dist-DlDxxPIP.js +0 -16
- package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +0 -1
- package/editor-web/assets/index-CgB5osVc.js +0 -28
- package/editor-web/assets/index-Daytem9N.css +0 -2
- package/editor-web/assets/katex-5Z2zF-9g.js +0 -257
- package/editor-web/assets/minus-DaWs5i8B.js +0 -1
- package/editor-web/assets/play-CrMmPghG.js +0 -1
- package/editor-web/assets/props-form-CsmDBqzy.js +0 -1
- package/editor-web/assets/schemas-VikZYZIK.js +0 -1
- package/editor-web/assets/slides-diTEQ3C5.js +0 -1
- package/editor-web/assets/split-CNU1RHcX.js +0 -3
- package/editor-web/assets/svg-Cx50MpxK.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +0 -8
- package/editor-web/assets/tabs-DIFDqj-l.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{colorAt as
|
|
2
|
+
import{tableStyleOf as z}from"@allyhub/slides-core";import{colorAt as j,fillOf as v,lineOf as F,say as C,withAlpha as D}from"./common.js";import{bodyOf as G}from"./text.js";function q(l,t,o){const n={borders:{},font:{}};if(!l)return n;const s=l.one("a:tcTxStyle");if(s){const u=s.attr("b");u==="on"?n.font.bold=!0:u==="off"&&(n.font.bold=!1);const a=s.attr("i");a==="on"?n.font.italic=!0:a==="off"&&(n.font.italic=!1);const b=s.one("a:fontRef"),p=j(b??s,t,"a:tcTxStyle");b?.attr("idx"),p&&(n.font.color=p.color),s.one("a:font")?.skip("a table style's own fonts")}const i=l.one("a:tcStyle");if(i){const u=i.one("a:fill"),a=v(u,t);a?.fill!==void 0&&(n.fill=a.fill);const b=i.one("a:fillRef");if(b){const f=b.attr("idx")??0,e=j(b,t,"a:fillRef");n.fill=f===0?null:e?.color??null}i.one("a:cell3D")?.skip("a table style's 3-D cells");const p=i.one("a:tcBdr"),d=f=>{const e=p?.one(f),m=e?.one("a:ln");if(m){const c=F(m,t);return c.line===null?null:c.line===void 0?void 0:{color:c.line,width:c.line_width??12700}}const w=e?.one("a:lnRef");if(w){const c=j(w,t,"a:lnRef"),g=w.attr("idx")??0,O=t.read.matrix.line[g-1]?.el.attrs.find(k=>k.key==="w")?.value;return g===0||!c?null:{color:c.color,width:Number(O??12700)}}},r=(f,e)=>{e!==void 0&&(n.borders[f]=e)};r("left",o.left?d("a:insideV"):d("a:left")),r("right",o.right?d("a:insideV"):d("a:right")),r("top",o.top?d("a:insideH"):d("a:top")),r("bottom",o.bottom?d("a:insideH"):d("a:bottom"));for(const f of["a:tl2br","a:tr2bl"]){const e=p?.one(f);e&&(C(t,"cannot-hold",f,"a cell's diagonal line"),e.consume())}}return n}function E(l,t,o,n,s,i,u){const a={borders:{},font:{}};if(!l)return a;const b={top:o>0,bottom:o<s-1,left:n>0,right:n<i-1},p=t.firstRow?1:0,d=t.firstCol?1:0,r=[l.one("a:wholeTbl")];t.bandRow&&o>=p&&!(t.lastRow&&o===s-1)&&r.push(l.one((o-p)%2===0?"a:band1H":"a:band2H")),t.bandCol&&n>=d&&!(t.lastCol&&n===i-1)&&r.push(l.one((n-d)%2===0?"a:band1V":"a:band2V")),t.lastCol&&n===i-1&&r.push(l.one("a:lastCol")),t.firstCol&&n===0&&r.push(l.one("a:firstCol")),t.lastRow&&o===s-1&&r.push(l.one("a:lastRow")),t.firstRow&&o===0&&r.push(l.one("a:firstRow"));const f=(e,m)=>{e&&r.push(l.one(m))};f(t.firstRow&&t.firstCol&&o===0&&n===0,"a:nwCell"),f(t.firstRow&&t.lastCol&&o===0&&n===i-1,"a:neCell"),f(t.lastRow&&t.firstCol&&o===s-1&&n===0,"a:swCell"),f(t.lastRow&&t.lastCol&&o===s-1&&n===i-1,"a:seCell");for(const e of r){const m=q(e,u,b);m.fill!==void 0&&(a.fill=m.fill),Object.assign(a.borders,m.borders),Object.assign(a.font,m.font)}return a}function J(l,t){const o=t.read.pkg,n=o.relOfType("ppt/presentation.xml","tableStyles");return(n?o.open(n.target):void 0)?.all("a:tblStyle").find(i=>i.attr("styleId")===l)}function L(l,t,o){if(l?.fill!==void 0)return l.fill===null||l.fill_transparency===void 0?l.fill:D(l.fill,1-l.fill_transparency);const n=l?.gradient?.stops[0];if(n)return C(o,"approximated",`${t}/a:gradFill`,"a cell's gradient is drawn in its first colour"),n.transparency===void 0?n.color:D(n.color,1-n.transparency)}export function tableOf(l,t){const o=l.one("a:tblPr"),n={firstRow:o?.attrOr("firstRow")??!1,firstCol:o?.attrOr("firstCol")??!1,lastRow:o?.attrOr("lastRow")??!1,lastCol:o?.attrOr("lastCol")??!1,bandRow:o?.attrOr("bandRow")??!1,bandCol:o?.attrOr("bandCol")??!1},s=L(v(o,t),"a:tblPr",t);s&&C(t,"approximated","a:tblPr/a:solidFill","a table's own fill is each cell's");const i=o?.one("a:tableStyleId")?.text().trim(),u=z(i),a=i&&!u?J(i,t):void 0;i&&!a&&!u&&C(t,"missing","a:tableStyleId",`table style ${i} is not defined in the file: its look is not known here`),a&&(C(t,"approximated","a:tableStyleId",`table style ${a.attr("styleName")??i??""} is each cell's own look`),a.one("a:tblBg")?.skip("a table style's background behind its cells"),a.attr("styleName"));const b=(l.one("a:tblGrid")?.all("a:gridCol")??[]).map(r=>r.attr("w")??0),p=l.all("a:tr"),d=p.map((r,f)=>({height:r.attr("h")??0,cells:r.all("a:tc").map((e,m)=>{const w=e.one("a:tcPr"),c=E(a,n,f,m,p.length,b.length,t),g=G(e.one("a:txBody"),{},t);if(Object.keys(c.font).length>0)for(const R of g.paragraphs)for(const h of R.runs){const _=h.font??{};h.font={...c.font,..._}}const O=L(v(w,t),"a:tcPr",t),k=O!==void 0?O:c.fill??s,S={};for(const[R,h]of[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]]){const _=w?.one(h),y=_?F(_,t):void 0;(y?.line_compound!==void 0||y?.line_dash!==void 0||y?.line_cap!==void 0)&&C(t,"approximated",`${h}@cmpd`,"a cell's edge is one solid line");const A=y?.line===null?null:y?.line!==void 0?{color:y.line,width:y.line_width??12700}:c.borders[R];A&&(S[R]=A)}for(const R of["a:lnTlToBr","a:lnBlToTr"]){const h=w?.one(R);h&&F(h,t).line&&C(t,"cannot-hold",R,"a cell's diagonal line")}const x=w?.attr("anchor"),M=R=>w?.attr(R),[H,N,V,$]=["marL","marR","marT","marB"].map(M),T=e.attr("gridSpan"),B=e.attr("rowSpan"),I=e.attrOr("hMerge"),P=e.attrOr("vMerge");return{text:{...g,...H===void 0?{}:{margin_left:H},...N===void 0?{}:{margin_right:N},...V===void 0?{}:{margin_top:V},...$===void 0?{}:{margin_bottom:$},...x==="t"||x==="ctr"||x==="b"?{vertical_anchor:x}:{}},...k===void 0?{}:{fill:k},...Object.keys(S).length>0?{borders:S}:{},...T===void 0||T<2||I||P?{}:{span_width:T},...B===void 0||B<2||I||P?{}:{span_height:B},...I||P?{spanned:!0}:{}}})}));return{columns:b,rows:d,...u?{style:u.id}:{},...n.firstRow?{first_row:!0}:{},...n.firstCol?{first_col:!0}:{},...n.lastRow?{last_row:!0}:{},...n.lastCol?{last_col:!0}:{},...n.bandRow?{horz_banding:!0}:{},...n.bandCol?{vert_banding:!0}:{}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{NUMBERINGS as
|
|
2
|
+
import{NUMBERINGS as A}from"@allyhub/formats";import{colorIn as S,parseValue as z}from"@allyhub/ooxml";import{NUMBERINGS_DRAWN_AS_ARABIC as F,TEXT_INSETS as x}from"@allyhub/slides-core";import{colorAt as y,linkOf as L,say as p,withAlpha as v}from"./common.js";export function fontOf(t,e){if(!t)return;const n={},f=t.attr("sz");f!==void 0&&(n.size=f*127);const i=t.attr("b");i!==void 0&&(n.bold=i);const a=t.attr("i");a!==void 0&&(n.italic=a);const c=t.attr("u");c!==void 0&&(n.underline=c==="none"?!1:c==="sng"?!0:c);const s=t.attr("strike");s!==void 0&&(n.strike=s==="noStrike"?!1:s==="sngStrike"?!0:s);const r=t.attr("baseline");r!==void 0&&r!==0&&(n.baseline=r/1e5);const u=t.attr("spc");u!==void 0&&(n.spacing=u*127);const h=t.attr("cap");h!==void 0&&(n.caps=h),t.ignore(["lang","altLang"],"a run's language: a deck's is its script's"),t.ignore(["noProof","dirty","err","smtClean","smtId","bmk"],"spell-check and editing state"),t.ignore(["kern"],"kerning from a size: the stage kerns as the browser does (PowerPoint's own is not measured here)");const d=t.choice("a:solidFill","a:noFill","a:gradFill");if(d?.key==="a:solidFill"){const l=y(d,e,"a:rPr/a:solidFill");l&&(n.color=v(l.color,l.alpha))}else d&&(p(e,"cannot-hold",`a:rPr/${d.key}`,d.key==="a:noFill"?"text with no fill":"text filled with a gradient"),d.consume());const g=S(t.one("a:highlight"),e.colors);g&&(n.highlight=g.rgb);const b=t.one("a:latin");if(b){b.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const l=b.attr("typeface");l&&(n.name=l)}for(const l of["a:ea","a:cs","a:sym"]){const _=t.one(l);if(!_)continue;_.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const P=_.attr("typeface");P&&!P.startsWith("+")&&!e.read.faces.has(P)&&p(e,"cannot-hold",l,`a run's own ${l==="a:ea"?"East Asian":l==="a:cs"?"complex script":"symbol"} face (${P})`)}const k=t.one("a:hlinkClick");if(k){const l=L(k,e,"a:hlinkClick");l!==void 0&&(n.link=l)}const o=t.one("a:hlinkMouseOver");o&&(p(e,"cannot-hold","a:hlinkMouseOver","a link followed when the pointer is over words"),o.consume()),t.one("a:uLnTx"),t.one("a:uFillTx");const m=t.one("a:effectLst");return m&&m.el.children.length>0&&(p(e,"cannot-hold","a:rPr/a:effectLst","text effects (shadow, glow)"),m.consume()),Object.keys(n).length>0?n:void 0}function w(t){const e=t?.one("a:spcPct")?.attr("val");if(e!==void 0)return{lines:e/1e5};const n=t?.one("a:spcPts")?.attr("val");if(n!==void 0)return{fixed:n*127}}export function formatOf(t,e){if(!t)return{};const n={},f=t.attr("algn");f==="l"||f==="ctr"||f==="r"||f==="just"?n.alignment=f:f!==void 0&&(n.alignment="just",p(e,"approximated","a:pPr@algn",`${f} is justified`));const i=t.attr("marL");i!==void 0&&(n.margin_left=i);const a=t.attr("indent");a!==void 0&&(n.indent=a);const c=t.attr("marR");c!==void 0&&c!==0&&p(e,"cannot-hold","a:pPr@marR","a paragraph's right margin");const s=w(t.one("a:lnSpc"));s&&(n.line_spacing=s);for(const[o,m]of[["a:spcBef","space_before"],["a:spcAft","space_after"]]){const l=w(t.one(o));l&&(n[m]="fixed"in l?l.fixed:l.lines===0?0:{lines:l.lines})}t.has("a:buNone")&&(n.bullet=null);const r=t.one("a:buChar")?.attr("char");r!==void 0&&(n.bullet=r);const u=t.one("a:buFont");if(u){u.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const o=u.attr("typeface");o!==void 0&&(n.bullet_font=o)}const h=t.one("a:buAutoNum");if(h){const o=h.attr("type")??"arabicPeriod";A.includes(o)?(n.numbered=o,F.has(n.numbered)&&p(e,"approximated","a:buAutoNum@type",`${o} is drawn as 1., 2., 3. (and written as it is)`)):(n.numbered="arabicPeriod",p(e,"approximated","a:buAutoNum@type",`${o} is counted as arabicPeriod`));const m=h.attr("startAt");m!==void 0&&(n.start_at=m)}t.has("a:buClrTx")&&(t.one("a:buClrTx"),n.bullet_color=null);const d=t.one("a:buClr");if(d){const o=y(d,e,"a:buClr");o&&(n.bullet_color=v(o.color,o.alpha))}t.has("a:buSzTx")&&(t.one("a:buSzTx"),n.bullet_size=null);const g=t.one("a:buSzPct")?.attr("val");if(g!==void 0){const o=Number(z("pct",g));Number.isFinite(o)&&o>0&&(n.bullet_size=o/1e5)}t.one("a:buFontTx");for(const o of["a:buSzPts","a:buBlip"]){const m=t.one(o);m&&(p(e,"cannot-hold",o,o==="a:buBlip"?"a picture as a bullet":"a bullet's size in points"),m.consume())}t.ignore(["eaLnBrk","latinLnBrk","hangingPunct","fontAlgn"],"line-breaking and alignment rules for East Asian text: the stage breaks lines as the browser does"),t.ignore(["defTabSz"],"a default tab stop");const b=t.one("a:tabLst");b&&b.el.children.length>0&&(p(e,"cannot-hold","a:tabLst","tab stops"),b.consume()),t.attr("rtl")===!0&&p(e,"cannot-hold","a:pPr@rtl","a right-to-left paragraph");const k=fontOf(t.one("a:defRPr"),e);return k&&(n.font=k),n}const C=["a:lvl1pPr","a:lvl2pPr","a:lvl3pPr","a:lvl4pPr","a:lvl5pPr","a:lvl6pPr","a:lvl7pPr","a:lvl8pPr","a:lvl9pPr"];export function levelsOf(t,e){const n=formatOf(t?.one("a:defPPr"),e);return C.map(f=>{const i=t?.one(f);i?.attr("lvl");const a=formatOf(i,e);return Object.keys(n).length===0?a:{...n,...a,...n.font||a.font?{font:{...n.font,...a.font}}:{}}})}export function paragraphsOf(t,e){return(t?.all("a:p")??[]).map(n=>{const f=n.one("a:pPr"),i=[];let a;for(const s of n.kids())if(s.key==="a:r"){const r=s.use(),u=fontOf(r.one("a:rPr"),e);i.push({text:r.one("a:t")?.text()??"",...u?{font:u}:{}})}else if(s.key==="a:br")s.use(),s.one("a:rPr")?.skip("a line break's font"),i.push({text:"\v"});else if(s.key==="a:fld"){const r=s.use();r.attr("id");const u=r.attr("type")??"",h=fontOf(r.one("a:rPr"),e),d=r.one("a:pPr");d&&(d.el.attrs.length>0||d.el.children.length>0)&&p(e,"cannot-hold","a:fld/a:pPr","a field's own paragraph properties");const g=r.one("a:t")?.text()??"";u!=="slidenum"&&p(e,"cannot-hold","a:fld@type",`${u||"a field"}: kept as the text it showed`),i.push({text:g,...h?{font:h}:{},...u==="slidenum"?{field:"slidenum"}:{}})}else s.key==="a:endParaRPr"&&(i.length===0?a=fontOf(s.use(),e):s.skip("the font of a paragraph's end"));const c=formatOf(f,e);return{...c,...a?{font:{...c.font,...a}}:{},runs:i,level:f?.attr("lvl")??0}})}export const BODY_DEFAULTS={vertical_anchor:"t",word_wrap:!0,auto_size:"none",margin_left:x.left,margin_top:x.top,margin_right:x.right,margin_bottom:x.bottom};export function bodyOf(t,e,n,f=!1){const i=t?.one("a:bodyPr");if(f)for(const h of t?.all("a:p")??[])h.skip("a master's or a layout's placeholder's prompt text");const a={...e,levels:levelsOf(t?.one("a:lstStyle"),n),paragraphs:f?[]:paragraphsOf(t,n)},c=i?.attr("anchor");c==="t"||c==="ctr"||c==="b"?a.vertical_anchor=c:c!==void 0&&(a.vertical_anchor="t",p(n,"approximated","a:bodyPr@anchor",`${c} is at the top`));const s=i?.attr("wrap");s!==void 0&&(a.word_wrap=s!=="none");const r=i?.choice("a:normAutofit","a:spAutoFit","a:noAutofit");r?.key==="a:normAutofit"?(a.auto_size="text",r.ignore(["fontScale","lnSpcReduction"],"the share PowerPoint last shrank text to: the stage fits it again")):r?.key==="a:spAutoFit"?a.auto_size="shape":r&&(a.auto_size="none");for(const[h,d]of[["lIns","margin_left"],["tIns","margin_top"],["rIns","margin_right"],["bIns","margin_bottom"]]){const g=i?.attr(h);g!==void 0&&(a[d]=g)}i?.ignore(["forceAA","compatLnSpc"],"rendering hints of a text body");const u=i?.attr("vert");return u!==void 0&&(a.orientation=u),i?.attr("rtlCol")===!0&&p(n,"cannot-hold","a:bodyPr@rtlCol","columns right to left"),a}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{as as T}from"@allyhub/ooxml";import{EMU_PER_PT as D,pathText as R}from"@allyhub/slides-core";import{PRESETS as A,SUBTYPES as P,TRANSITION_SIDES as j}from"../timing.js";import{say as m}from"./common.js";const q=Object.fromEntries(Object.entries(A).map(([o,s])=>[`${s.kind}:${String(s.id)}`,o])),F=new Map(Object.entries(P).map(([o,s])=>[s,o])),L=new Map(Object.entries(j).map(([o,s])=>[s,o])),U={fast:.5,med:.75,slow:1};export function transitionOf(o,s){if(!o)return{};const h=o.attr("advTm"),c=h===void 0?{}:{advance:h/1e3},p=o.attr("p14:dur"),u=U[o.attrOr("spd")],y=p===void 0?u:p/1e3;o.attrOr("advClick")||m(s,"cannot-hold","p:transition@advClick","a slide that a click does not advance");const n=o.one("p:sndAc");n&&(m(s,"cannot-hold","p:sndAc","a transition's sound"),n.consume());const t=o.kids().find(r=>r.key!=="p:sndAc"&&r.key!=="p:extLst");if(!t)return c;t.use();const a=t.key==="p:push"||t.key==="p:wipe"?L.get(T(t).attrOr("dir")):void 0,d=t.key==="p:fade"?"fade":t.key==="p:push"?"push":t.key==="p:wipe"?"wipe":t.key==="p159:morph"?"morph":void 0;return t.key==="p159:morph"&&T(t).attrOr("option"),t.key==="p:fade"&&T(t).attr("thruBlk"),d?{transition:{type:d,...a&&d!=="fade"&&d!=="morph"?{direction:a}:{},duration:y},...c}:(m(s,"cannot-hold",t.key,"a transition a deck has none of"),t.consume(),c)}function _(o,s){const h=o.match(/[A-Za-z]|-?[\d.]+(?:[eE]-?\d+)?/gu)??[],c=(n,t)=>Math.round(n*(t===0?s.width:s.height)/D*100)/100,p=[];let u=[0,0],y=[0,0];for(let n=0;n<h.length;){const t=h[n++]??"",a=t.toUpperCase();if(a==="E")continue;if(a==="Z"){p.push({op:"close"}),u=y;continue}const d=a==="C"?6:a==="M"||a==="L"?2:-1,r=h.slice(n,n+d).map(Number);if(d<0||r.length<d||r.some(i=>!Number.isFinite(i)))return;n+=d;const f=r.map((i,l)=>t===a?i:i+(u[l%2]??0)),k=i=>({x:c(f[i]??0,0),y:c(f[i+1]??0,1)});if(a==="C"){const i=k(0),l=k(2);p.push({op:"curve",x1:i.x,y1:i.y,x2:l.x,y2:l.y,...k(4)})}else p.push({op:a==="M"?"move":"line",...k(0)});u=f.slice(-2),a==="M"&&(y=u)}return p[0]?.op==="move"?R(p):void 0}const B=new Set(["wipe","wipe-out","fly-in","fly-out"]);function w(o){return o.kids().flatMap(s=>[s,...w(s)])}export function animationsOf(o,s,h,c){if(!o)return[];const p=w(o),u=[];for(const y of p.filter(n=>n.key==="p:seq"))T(y).one("p:cTn")?.attr("nodeType")==="interactiveSeq"&&m(c,"cannot-hold","p:seq","animations a click on a shape starts (a trigger)");for(const y of p.filter(n=>n.key==="p:cTn")){const n=T(y),t=n.attr("nodeType");if(t!=="clickEffect"&&t!=="withEffect"&&t!=="afterEffect"||n.attr("presetClass")==="mediacall")continue;const a=w(n),d=a.find(e=>e.key==="p:spTgt")?.el.attrs.find(e=>e.key==="spid")?.value??"",r=s.get(d);if(r===void 0){m(c,"cannot-hold","p:spTgt",`an animation of shape ${d}, which is not read`);continue}const f=n.attr("presetClass")??"",k=n.attr("presetID")??0,i=q[`${f}:${String(k)}`],l=i??(f==="path"?"path":f==="exit"?"fade-out":f==="emph"?"pulse":"fade");if(i===void 0&&f!=="path"&&m(c,"approximated","p:cTn@presetID",`${r}: effect ${f} ${String(k)} is read as ${l}`),i===void 0)for(const[e,E]of[["repeatCount","repeated"],["accel","accelerated"],["decel","decelerated"]])a.concat([n]).some(b=>b.key==="p:cTn"&&b.el.attrs.some(v=>v.key===e&&Number(v.value)>0&&!(e==="repeatCount"&&v.value==="1000")))&&m(c,"cannot-hold",`p:cTn@${e}`,`${r}: an effect ${E}`);a.some(e=>e.key==="p:iterate")&&m(c,"cannot-hold","p:iterate",`${r}: an effect by word or letter`);const x=n.attr("presetSubtype")??0,M=F.get(x),O=a.find(e=>e.key==="p:pRg"),g=O?Number(O.el.attrs.find(e=>e.key==="st")?.value):void 0,C=a.find(e=>e.key==="p:cond"),N=Number(C?.el.attrs.find(e=>e.key==="delay")?.value??0)||0,I=(n.one("p:childTnLst")?.kids()??[]).filter(e=>e.key!=="p:set").flatMap(e=>w(e).filter(E=>E.key==="p:cTn").map(E=>(Number(E.el.attrs.find(v=>v.key==="dur")?.value??0)||0)*(E.el.attrs.find(v=>v.key==="autoRev")?.value==="1"?2:1))),S=a.find(e=>e.key==="p:animMotion")?.el.attrs.find(e=>e.key==="path")?.value,$=S===void 0?void 0:_(S,h);S!==void 0&&$===void 0&&(m(c,"cannot-hold","p:animMotion@path",`${r}: a motion path of ${S}`),l==="path")||u.push({shape:r,effect:l,...g===void 0||Number.isNaN(g)?{}:{paragraph:g},...M&&x>0&&B.has(l)?{direction:M}:{},start:t==="clickEffect"?"on-click":t==="withEffect"?"with-previous":"after-previous",duration:Math.max(0,...I)/1e3,...N>0?{delay:N/1e3}:{},...$===void 0?{}:{path:$}})}return o.consume(),u}
|
|
2
|
+
import{as as v}from"@allyhub/ooxml";import{EMU_PER_PT as Y,PLAYBACK_DEFAULTS as G,pathText as Z,effectTakes as H,TEXT_DELAY as P}from"@allyhub/slides-core";import{FLOAT_DOWN as D,PRESETS as K,SUBTYPED as B,SUBTYPES as V,TRANSITION_SIDES as X}from"../timing.js";import{say as l}from"./common.js";const J={...Object.fromEntries(Object.entries(K).map(([n,c])=>[`${c.kind}:${String(c.id)}`,n])),[`entr:${String(D)}`]:"float-in",[`exit:${String(D)}`]:"float-out"},Q=new Map(Object.entries(V).map(([n,c])=>[c,n])),tt=new Map(Object.entries(X).map(([n,c])=>[c,n])),et={fast:.5,med:.75,slow:1};export function transitionOf(n,c){if(!n)return{};const u=n.attr("advTm"),i=u===void 0?{}:{advance:u/1e3},e=n.attr("p14:dur"),a=et[n.attrOr("spd")],o=e===void 0?a:e/1e3;n.attrOr("advClick")||l(c,"cannot-hold","p:transition@advClick","a slide that a click does not advance");const t=n.one("p:sndAc");t&&(l(c,"cannot-hold","p:sndAc","a transition's sound"),t.consume());const d=n.kids().find(f=>f.key!=="p:sndAc"&&f.key!=="p:extLst");if(!d)return i;d.use();const r=nt(d,c);return r?{transition:{type:r.type,...r.direction===void 0?{}:{direction:r.direction},...r.black?{through_black:!0}:{},duration:r.type==="cut"&&e===void 0?0:o},...i}:(l(c,"cannot-hold",d.key,"a transition a deck has none of"),d.consume(),i)}function nt(n,c){const u=e=>tt.get(e)??"from-right",i=()=>v(n).attr("thruBlk")===!0;switch(n.key){case"p:fade":return{type:"fade",black:i()};case"p:cut":return{type:"cut",black:i()};case"p:push":case"p:wipe":{const e=v(n).attrOr("dir");return{type:n.key==="p:push"?"push":"wipe",direction:u(e),black:!1}}case"p:cover":case"p:pull":{const e=v(n).attrOr("dir");return{type:n.key==="p:cover"?"cover":"uncover",direction:u(e),black:!1}}case"p:split":{const e=v(n),a=e.attrOr("orient"),o=e.attrOr("dir");return{type:"split",direction:`${a==="vert"?"vertical":"horizontal"}-${o==="in"?"in":"out"}`,black:!1}}case"p14:reveal":{const e=v(n);return{type:"reveal",direction:e.attrOr("dir")==="l"?"from-left":"from-right",black:e.attrOr("thruBlk")}}case"p14:warp":return{type:"zoom",direction:v(n).attrOr("dir")==="in"?"in":"out",black:!1};case"p:newsflash":return{type:"zoom",direction:"rotate",black:!1};case"p159:morph":{const e=v(n).attrOr("option");return e!=="byObject"&&l(c,"approximated","p159:morph@option",`a morph ${e==="byWord"?"by word":"by character"} moves its shapes as objects`),{type:"morph",black:!1}}default:return}}function ot(n,c){const u=n.match(/[A-Za-z]|-?[\d.]+(?:[eE]-?\d+)?/gu)??[],i=(t,d)=>Math.round(t*(d===0?c.width:c.height)/Y*100)/100,e=[];let a=[0,0],o=[0,0];for(let t=0;t<u.length;){const d=u[t++]??"",r=d.toUpperCase();if(r==="E")continue;if(r==="Z"){e.push({op:"close"}),a=o;continue}const f=r==="C"?6:r==="M"||r==="L"?2:-1,m=u.slice(t,t+f).map(Number);if(f<0||m.length<f||m.some(y=>!Number.isFinite(y)))return;t+=f;const p=m.map((y,h)=>d===r?y:y+(a[h%2]??0)),b=y=>({x:i(p[y]??0,0),y:i(p[y+1]??0,1)});if(r==="C"){const y=b(0),h=b(2);e.push({op:"curve",x1:y.x,y1:y.y,x2:h.x,y2:h.y,...b(4)})}else e.push({op:r==="M"?"move":"line",...b(0)});a=p.slice(-2),r==="M"&&(o=a)}return e[0]?.op==="move"?Z(e):void 0}function at(n,c,u){const i=n.kids().find(p=>p.key==="p:iterate");if(!i)return{};const e=(p,b)=>p?.el.attrs.find(y=>y.key===b)?.value,a=e(i,"type")??"el";if((e(i,"backwards")==="1"||e(i,"backwards")==="true")&&l(u,"cannot-hold","p:iterate@backwards",`${c}: its text built from its end`),a!=="wd"&&a!=="lt")return l(u,"cannot-hold","p:iterate",`${c}: an effect a part of its text at a time`),{};const o=i.kids(),t=e(o.find(p=>p.key==="p:tmPct"),"val"),d=e(o.find(p=>p.key==="p:tmAbs"),"val"),r=Number(w(n).find(p=>p.key==="p:cTn"&&p.el.attrs.some(b=>b.key==="dur"&&b.value!=="1"))?.el.attrs.find(p=>p.key==="dur")?.value),f=t!==void 0?t.endsWith("%")?Number.parseFloat(t)/100:Number(t)/1e5:d!==void 0&&r>0?Number(d)/r:P,m=Number.isFinite(f)&&f>=0?Math.round(f*1e3)/1e3:P;return{animate_text:a==="wd"?"word":"letter",...m===P?{}:{text_delay:m}}}function rt(n,c){const u=(e,a)=>e?.el.attrs.find(o=>o.key===a)?.value,i=e=>Math.round(e*1e3)/1e3;if(n==="grow-shrink"){const e=c.find(t=>t.key==="p:by"),a=Number(u(e,"x")??15e4)/1e5,o=Number(u(e,"y")??15e4)/1e5;return!Number.isFinite(a)||!Number.isFinite(o)||a<=0||o<=0?{}:a===o?{direction:"both",amount:i(a)}:a===1?{direction:"vertical",amount:i(o)}:{direction:"horizontal",amount:i(a)}}if(n==="spin"){const e=Number(u(c.find(a=>a.key==="p:animRot"),"by"))/6e4;return!Number.isFinite(e)||e===0?{}:{direction:e<0?"counterclockwise":"clockwise",amount:i(Math.abs(e))}}if(n==="transparency"){const e=c.find(d=>d.key==="p:set"&&w(d).some(r=>r.key==="p:attrName"&&r.el.text==="style.opacity")),a=e?u(w(e).find(d=>d.key==="p:strVal"),"val"):/opacity:\s*([\d.]+)/u.exec(u(c.find(d=>d.key==="p:animEffect"),"prLst")??"")?.[1],o=Number(a);if(a===void 0||!Number.isFinite(o))return{};const t=i(1-o);return t>0&&t<=1?{amount:t}:{}}return{}}function w(n){return n.kids().flatMap(c=>[c,...w(c)])}export function animationsOf(n,c,u,i){if(!n)return[];const e=w(n),a=[];for(const o of e.filter(t=>t.key==="p:seq"))v(o).one("p:cTn")?.attr("nodeType")==="interactiveSeq"&&l(i,"cannot-hold","p:seq","animations a click on a shape starts (a trigger)");for(const o of e.filter(t=>t.key==="p:cTn")){const t=v(o),d=t.attr("nodeType");if(d!=="clickEffect"&&d!=="withEffect"&&d!=="afterEffect"||t.attr("presetClass")==="mediacall")continue;const r=w(t),f=r.find(s=>s.key==="p:spTgt")?.el.attrs.find(s=>s.key==="spid")?.value??"",m=c.get(f);if(m===void 0){l(i,"cannot-hold","p:spTgt",`an animation of shape ${f}, which is not read`);continue}const p=t.attr("presetClass")??"",b=t.attr("presetID")??0,y=J[`${p}:${String(b)}`],h=y??(p==="path"?"path":p==="exit"?"fade-out":p==="emph"?"pulse":"fade");y===void 0&&p!=="path"&&l(i,"approximated","p:cTn@presetID",`${m}: effect ${p} ${String(b)} is read as ${h}`);for(const[s,k]of it){const S=st[h]?.[s];(s==="repeatCount"?r:r.concat([t])).some(T=>T.key==="p:cTn"&&T.el.attrs.some($=>{const g=$.value==="true"?"1":$.value==="false"?"0":$.value;return $.key===s&&g!==S&&!(s==="repeatCount"&&g==="1000")&&!(s==="spd"&&(g==="100000"||g==="100%"))&&(s==="repeatCount"||s==="repeatDur"||Number(g)!==0)}))&&l(i,"cannot-hold",`p:cTn@${s}`,`${m}: an effect ${k}`)}for(const[s,k]of ct)r.some(S=>S.key===s)&&l(i,"cannot-hold",s,`${m}: ${k}`);const j=at(t,m,i),L=s=>t.el.attrs.find(k=>k.key===s)?.value,N=L("repeatCount"),z=(t.one("p:endCondLst")?.kids()??[]).some(s=>s.el.attrs.find(k=>k.key==="evt")?.value==="onNext"),R=N==="indefinite"?z?"until-next-click":"until-end-of-slide":N!==void 0&&Number(N)>1e3?Number(N)/1e3:void 0,U=L("fill")==="remove",x=t.attr("presetSubtype")??0,C=Q.get(x),A=h==="float-in"||h==="float-out"?b===D?"down":"up":C!==void 0&&H(h,C)?C:void 0,E=rt(h,r);B.has(h)&&x>0&&A===void 0&&l(i,"approximated","p:cTn@presetSubtype",`${m}: ${dt[x]??`side ${String(x)}`} is from the bottom`);const F=r.find(s=>s.key==="p:pRg"),M=F?Number(F.el.attrs.find(s=>s.key==="st")?.value):void 0,q=r.find(s=>s.key==="p:cond"),I=Number(q?.el.attrs.find(s=>s.key==="delay")?.value??0)||0,W=(t.one("p:childTnLst")?.kids()??[]).filter(s=>s.key!=="p:set").flatMap(s=>w(s).filter(k=>k.key==="p:cTn").map(k=>(Number(k.el.attrs.find(T=>T.key==="dur")?.value??0)||0)*(k.el.attrs.find(T=>T.key==="autoRev")?.value==="1"?2:1))),O=r.find(s=>s.key==="p:animMotion")?.el.attrs.find(s=>s.key==="path")?.value,_=O===void 0?void 0:ot(O,u);O!==void 0&&_===void 0&&(l(i,"cannot-hold","p:animMotion@path",`${m}: a motion path of ${O}`),h==="path")||a.push({shape:m,effect:h,...M===void 0||Number.isNaN(M)?{}:{paragraph:M},...A!==void 0&&(x>0||!B.has(h))?{direction:A}:E.direction===void 0?{}:{direction:E.direction},...E.amount===void 0?{}:{amount:E.amount},...j,...R===void 0?{}:{repeat:R},...U?{rewind:!0}:{},start:d==="clickEffect"?"on-click":d==="withEffect"?"with-previous":"after-previous",duration:Math.max(0,...W)/1e3,...I>0?{delay:I/1e3}:{},..._===void 0?{}:{path:_}})}for(const o of n.one("p:bldLst")?.kids()??[])if(o.key==="p:bldP"){const t=v(o);t.attrOr("rev")&&l(i,"cannot-hold","p:bldP@rev","a text built in reverse order"),t.attrOr("animBg")&&l(i,"cannot-hold","p:bldP@animBg","a shape's text built with its shape as one");const d=t.el.attrs.find(r=>r.key==="advAuto")?.value;d!==void 0&&d!=="indefinite"&&l(i,"cannot-hold","p:bldP@advAuto","a text's paragraphs coming on by themselves, a time apart"),(t.attr("bldLvl")??1)>1&&l(i,"cannot-hold","p:bldP@bldLvl","a text built by its deeper levels too")}else l(i,"cannot-hold",o.key,o.key==="p:bldGraphic"||o.key==="p:bldOleChart"?"a chart built by its series or categories":o.key==="p:bldDgm"?"a SmartArt built a part at a time":"a build a deck has none of");return n.consume(),a}const it=[["repeatCount","repeated"],["repeatDur","repeated for a time"],["accel","accelerated"],["decel","decelerated"],["autoRev","played back again"],["spd","at a speed of its own"]],st={"fly-in":{decel:"100000"},"fly-out":{accel:"100000"},pulse:{autoRev:"1"}},ct=[["p:sndTgt","a sound played with an effect"],["p:audio","a sound played with an effect"],["p:graphicEl","an effect on a part of a chart or a SmartArt"],["p:oleChartEl","an effect on a part of a chart"],["p:inkTgt","an effect on ink"]],dt={3:"from the top right",6:"from the bottom right",9:"from the top left",12:"from the bottom left"};export function playbacksOf(n){const c=new Map;if(!n)return c;const u=w(n),i=a=>w(a).find(o=>o.key==="p:spTgt")?.el.attrs.find(o=>o.key==="spid")?.value,e=a=>{const o=c.get(a)??{};return c.set(a,o),o};for(const a of u)if(a.key==="p:video"||a.key==="p:audio"){const o=v(a),t=o.one("p:cMediaNode"),d=t?i(t):void 0;if(d===void 0||!t)continue;const r=e(d);a.key==="p:video"&&o.attr("fullScrn")===!0&&(r.fullscreen=!0);const f=t.attr("vol");t.attr("mute")===!0?r.volume=0:f!==void 0&&f!==Math.round(G.volume*1e5)&&(r.volume=Math.round(f/1e5*1e3)/1e3),t.attr("showWhenStopped")===!1&&(r.hide=!0),t.one("p:cTn")?.attr("repeatCount")==="indefinite"&&(r.loop=!0)}else if(a.key==="p:cTn"){const o=v(a);if(o.attr("presetClass")!=="mediacall")continue;const t=i(a);t!==void 0&&o.attr("nodeType")==="clickEffect"&&(e(t).start="on-click")}return c}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{presetAdjustments as
|
|
2
|
+
import{groupLevels as F,inGroup as L}from"@allyhub/formats";import{presetAdjustments as w}from"@allyhub/ooxml/geometry";import{NS as P,effects as o,el as n,fill as k,gradientFill as N,patternFill as G,pictureFill as D}from"./xml.js";import{linkXml as E}from"./text.js";export const LOCKED={noMove:1,noResize:1,noRot:1};const g=e=>e.locked?LOCKED:{},v=(e,r={})=>n("a:xfrm",{rot:r.rotation===void 0?void 0:Math.round(r.rotation*6e4),flipH:r.flip?.h?1:void 0,flipV:r.flip?.v?1:void 0},n("a:off",{x:e.left,y:e.top}),n("a:ext",{cx:e.width,cy:e.height})),y=(e,r)=>{const i=w(e);return n("a:prstGeom",{prst:e},n("a:avLst",{},...(r??[]).flatMap((d,p)=>{const c=i[p]?.name;return c===void 0?[]:[n("a:gd",{name:c,fmla:`val ${String(Math.round(d*1e5))}`})]})))};function B(e,r){const i=e.steps.every(t=>t.op==="close"?!0:t.op==="curve"?[t.x1,t.y1,t.x2,t.y2,t.x,t.y].every(Number.isInteger):Number.isInteger(t.x)&&Number.isInteger(t.y)),[d,p]=i||!r?[1,1]:[e.w===0?1:r.width/e.w,e.h===0?1:r.height/e.h],c=(t,a)=>n("a:pt",{x:Math.round(t*d),y:Math.round(a*p)}),l=e.steps.map(t=>t.op==="close"?n("a:close"):t.op==="move"?n("a:moveTo",{},c(t.x,t.y)):t.op==="line"?n("a:lnTo",{},c(t.x,t.y)):n("a:cubicBezTo",{},c(t.x1,t.y1),c(t.x2,t.y2),c(t.x,t.y)));return n("a:custGeom",{},n("a:avLst"),n("a:gdLst"),n("a:ahLst"),n("a:cxnLst"),n("a:rect",{l:"l",t:"t",r:"r",b:"b"}),n("a:pathLst",{},n("a:path",{w:Math.round(e.w*d),h:Math.round(e.h*p)},...l)))}const b=e=>e.line===void 0&&e.lineWidth===void 0&&e.lineDash===void 0&&e.lineCap===void 0&&e.lineJoin===void 0&&e.lineCompound===void 0&&e.lineBegin===void 0&&e.lineEnd===void 0?"":n("a:ln",{w:e.lineWidth,cap:e.lineCap,cmpd:e.lineCompound},e.line===void 0?"":k(e.line),e.lineDash===void 0?"":n("a:prstDash",{val:e.lineDash}),e.lineJoin===void 0?"":e.lineJoin==="miter"?n("a:miter",{lim:8e5}):n(`a:${e.lineJoin}`),e.lineBegin===void 0?"":n("a:headEnd",{type:e.lineBegin,...e.lineBeginSize}),e.lineEnd===void 0?"":n("a:tailEnd",{type:e.lineEnd,...e.lineEndSize})),f=(e,r,i)=>n(e,{idx:r},n("a:schemeClr",{val:i})),S={shape:n("p:style",{},f("a:lnRef",1,"accent1"),f("a:fillRef",3,"accent1"),f("a:effectRef",2,"accent1"),f("a:fontRef","minor","lt1")),connector:n("p:style",{},f("a:lnRef",2,"accent1"),f("a:fillRef",0,"accent1"),f("a:effectRef",1,"accent1"),f("a:fontRef","minor","tx1"))},z=e=>n("p:ph",{type:e.type==="obj"?void 0:e.type,orient:e.orient,sz:e.sz,idx:e.idx===0?void 0:e.idx}),s=(e,r)=>n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr},r??(e.link===void 0?"":E(e.link))),M=(e,r="")=>n("p:nvPr",{},e.placeholder?z(e.placeholder):"",r);export function shapeXml(e){if(e.kind==="table"||e.kind==="chart")return n("p:graphicFrame",{},n("p:nvGraphicFramePr",{},s(e),n("p:cNvGraphicFramePr",{},n("a:graphicFrameLocks",{noGrp:1,...e.locked?{noMove:1,noResize:1}:{}})),n("p:nvPr")),n("p:xfrm",{},n("a:off",{x:e.frame?.left??0,y:e.frame?.top??0}),n("a:ext",{cx:e.frame?.width??0,cy:e.frame?.height??0})),n("a:graphic",{},n("a:graphicData",{uri:`http://schemas.openxmlformats.org/drawingml/2006/${e.kind}`},e.kind==="table"?e.table??"":n("c:chart",{"xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","xmlns:r":P.r,"r:id":e.chart??""}))));if(e.kind==="cxn")return n("p:cxnSp",{},n("p:nvCxnSpPr",{},s(e),n("p:cNvCxnSpPr",{},e.locked?n("a:cxnSpLocks",g(e)):"",e.connect?.begin?n("a:stCxn",e.connect.begin):"",e.connect?.end?n("a:endCxn",e.connect.end):""),n("p:nvPr")),n("p:spPr",{},e.frame?v(e.frame,e):"",y(e.geometry??"line",e.adjustments),b(e),o(e)),e.style?S[e.style]:"");if(e.kind==="pic"){const i=e.video;return n("p:pic",{},n("p:nvPicPr",{},s(e,i?n("a:hlinkClick",{"r:id":"",action:"ppaction://media"}):void 0),n("p:cNvPicPr",{},n("a:picLocks",{noChangeAspect:1,...g(e)})),M(e,i?n(i.sound===!0?"a:audioFile":"a:videoFile",{"r:link":i.link})+n("p:extLst",{},n("p:ext",{uri:"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}"},n("p14:media",{"xmlns:p14":P.p14,"r:embed":i.media},i.trim?n("p14:trim",{st:i.trim.start===void 0?void 0:String(Math.round(i.trim.start*1e6)/1e3),end:i.trim.end===void 0?void 0:String(Math.round(i.trim.end*1e6)/1e3)}):""))):"")),n("p:blipFill",{},n("a:blip",{"r:embed":e.picture?.image}),e.picture?.crop?n("a:srcRect",{l:h(e.picture.crop.left),t:h(e.picture.crop.top),r:h(e.picture.crop.right),b:h(e.picture.crop.bottom)}):"",n("a:stretch",{},n("a:fillRect"))),n("p:spPr",{},e.frame?v(e.frame,e):"",y("rect"),o(e)))}const r=e.placeholder||e.locked?n("a:spLocks",{...e.placeholder?{noGrp:1}:{},...g(e)}):"";return n("p:sp",{},n("p:nvSpPr",{},s(e),n("p:cNvSpPr",{txBox:e.textbox?1:void 0},r),M(e)),n("p:spPr",{},e.frame?v(e.frame,e):"",e.path?B(e.path,e.frame):e.geometry?y(e.geometry,e.adjustments):"",e.pictureFill?D(e.pictureFill):e.pattern?G(e.pattern):e.gradient?N(e.gradient):e.fill===void 0?"":k(e.fill,e.fillTransparency),b(e),o(e)),e.style?S[e.style]:"",e.text??"")}function A(e,r,i,d){const p=Math.min(...i.map(a=>a.left)),c=Math.min(...i.map(a=>a.top)),l=Math.max(...i.map(a=>a.left+a.width))-p,t=Math.max(...i.map(a=>a.top+a.height))-c;return n("p:grpSp",{},n("p:nvGrpSpPr",{},n("p:cNvPr",{id:e,name:r}),n("p:cNvGrpSpPr"),n("p:nvPr")),n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:p,y:c}),n("a:ext",{cx:l,cy:t}),n("a:chOff",{x:p,y:c}),n("a:chExt",{cx:l,cy:t}))),...d)}export function treeXml(e){let r=Math.max(0,...e.map(d=>d.id));const i=(d,p)=>{const c=[],l=[];let t=d;for(;t<e.length;){const a=e[t];if(!a)break;const m=a.group;if(p!==void 0&&!L(m,p))break;if(m===p||m===void 0){c.push(shapeXml(a)),a.frame&&l.push(a.frame),t++;continue}const x=F(m).find(C=>p===void 0||C.length>p.length)??m,u=i(t,x),R=x.split("/").pop()??x;c.push(A(++r,R,u.frames,u.xml)),l.push(...u.frames),t=u.next}return{xml:c,frames:l,next:t}};return i(0,void 0).xml}const h=e=>e===0?void 0:Math.round(e*1e5);export const NO_PARAGRAPHS=[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{color as r,el as t,fill as d}from"./xml.js";const f=["wholeTbl","band1H","band2H","band1V","band2V","lastCol","firstCol","lastRow","firstRow"],u=["left","right","top","bottom","insideH","insideV"],c=n=>t("a:ln",n===null?{}:{w:n.width,cmpd:"sng"},n===null?t("a:noFill"):d(n.color));function s(n,l){const e=l.bold!==void 0||l.text!==void 0?t("a:tcTxStyle",{b:l.bold===void 0?void 0:l.bold?"on":"off"},t("a:fontRef",{idx:"minor"},t("a:prstClr",{val:"black"})),l.text===void 0?"":r(l.text)):"",i=u.flatMap(o=>{const a=l.borders?.[o];return a===void 0?[]:[t(`a:${o}`,{},c(a))]});return t(`a:${n}`,{},e,t("a:tcStyle",{},t("a:tcBdr",{},...i),l.fill===void 0?"":t("a:fill",{},d(l.fill))))}export function tableStyleXml(n){return t("a:tblStyle",{styleId:n.id,styleName:n.name},n.background===void 0?"":t("a:tblBg",{},t("a:fill",{},d(n.background))),...f.flatMap(l=>{const e=n.parts[l];return e?[s(l,e)]:[]}))}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{runLang as
|
|
2
|
+
import{runLang as y}from"@allyhub/slides-core";import{face as P}from"./theme.js";import{centipoints as c,color as f,el as t,esc as _,fill as k}from"./xml.js";const x={t:"t",ctr:"ctr",b:"b"},z={"+mj-lt":"+mj-ea","+mn-lt":"+mn-ea"};export const LINK="link:",SLIDE_LINK="slidelink:";export function linkXml(e){return e.startsWith("#")?t("a:hlinkClick",{"r:id":`${SLIDE_LINK}${e.slice(1)}`,action:"ppaction://hlinksldjump"}):e.startsWith("ppaction://")?t("a:hlinkClick",{"r:id":"",action:e}):t("a:hlinkClick",{"r:id":`${LINK}${e}`})}export function runProps(e,n,i){const a=n?.color===void 0?"":k(n.color),r=n?.name===void 0?void 0:z[n.name];return t(e,{lang:i,sz:n?.size===void 0?void 0:c(n.size),b:n?.bold,i:n?.italic,u:n?.underline===void 0?void 0:typeof n.underline=="string"?n.underline:n.underline?"sng":"none",strike:n?.strike===void 0?void 0:typeof n.strike=="string"?n.strike:n.strike?"sngStrike":"noStrike",cap:n?.caps,baseline:n?.baseline===void 0?void 0:Math.round(n.baseline*1e5),spc:n?.spacing===void 0?void 0:c(n.spacing)},a,n?.highlight===void 0?"":t("a:highlight",{},f({rgb:n.highlight})),n?.name===void 0?"":t("a:latin",{typeface:P(n.name)}),r===void 0?"":t("a:ea",{typeface:r}),n?.link===void 0?"":linkXml(n.link))}const m=(e,n)=>n===void 0?"":t(e,{},typeof n=="number"?t("a:spcPts",{val:c(n)}):t("a:spcPct",{val:Math.round(n.lines*1e5)}));function g(e,n){const i=e.line_spacing;return{attrs:{marL:e.margin_left,indent:e.indent,algn:e.alignment},children:[i===void 0?"":t("a:lnSpc",{},"lines"in i?t("a:spcPct",{val:Math.round(i.lines*1e5)}):t("a:spcPts",{val:c(i.fixed)})),m("a:spcBef",e.space_before),m("a:spcAft",e.space_after),e.bullet_color===void 0?"":e.bullet_color===null?t("a:buClrTx"):t("a:buClr",{},f(e.bullet_color)),e.bullet_size===void 0?"":e.bullet_size===null?t("a:buSzTx"):t("a:buSzPct",{val:Math.round(e.bullet_size*1e5)}),e.bullet_font===void 0?"":t("a:buFont",{typeface:e.bullet_font}),e.numbered!==void 0?t("a:buAutoNum",{type:e.numbered,startAt:e.start_at}):e.bullet===void 0?"":e.bullet===null?t("a:buNone"):t("a:buChar",{char:e.bullet}),n&&e.font&&Object.keys(e.font).length>0?runProps("a:defRPr",e.font):""]}}export function listStyle(e,n="a:lstStyle"){const i=e.slice(0,9).flatMap((a,r)=>{const{attrs:u,children:o}=g(a,!0),l=o.join("");return l===""&&Object.values(u).every(d=>d===void 0)?[]:[t(`a:lvl${String(r+1)}pPr`,u,l)]});return t(n,{},...i)}export function levelOf(e){return{alignment:e.alignment,line_spacing:e.line_spacing,space_before:e.space_before,space_after:e.space_after,...e.numbered===void 0?{bullet:e.bullet?e.bullet.char:null}:{numbered:e.numbered},...e.bullet?.font===void 0?{}:{bullet_font:e.bullet.font},...e.bullet_color===void 0?{}:{bullet_color:e.bullet_color},...e.bullet_size===void 0?{}:{bullet_size:e.bullet_size},...e.start_at===void 0?{}:{start_at:e.start_at},margin_left:e.margin_left,indent:e.indent,font:e.font}}export function bodyProps(e,n,i={}){const a=n!==void 0?t("a:normAutofit",{fontScale:Math.round(n*1e5)}):e.auto_size==="text"?t("a:normAutofit"):e.auto_size==="shape"?t("a:spAutoFit"):e.auto_size==="none"?t("a:noAutofit"):"";return t("a:bodyPr",{wrap:e.word_wrap===void 0?void 0:e.word_wrap?"square":"none",lIns:e.margin_left,tIns:e.margin_top,rIns:e.margin_right,bIns:e.margin_bottom,anchor:e.vertical_anchor===void 0?void 0:x[e.vertical_anchor],vert:e.orientation,...i},a)}export const bodyOfStyle=e=>({vertical_anchor:e.vertical_anchor,auto_size:e.auto_size,word_wrap:e.word_wrap,margin_left:e.margins.left,margin_top:e.margins.top,margin_right:e.margins.right,margin_bottom:e.margins.bottom,...e.orientation==="horz"?{}:{orientation:e.orientation}}),bodyUnder=(e,n)=>({...e,...n?.anchor===void 0?{}:{vertical_anchor:n.anchor},...n?.orientation===void 0?{}:{orientation:n.orientation}});const v="{B6F15528-21DE-4FAA-801E-634DDDAF4B2B}";export const SLIDE_NUMBER=[{level:0,runs:[{text:"‹#›",field:"slidenum"}]}];export function paragraph(e,n,i){const a={...e,...i?.paragraph,...i?.levels?.[e.level]};i?.paragraph.bullet!==void 0&&delete a.numbered,(i?.paragraph.bullet!==void 0||i?.paragraph.numbered!==void 0)&&delete a.bullet_font;const{attrs:r,children:u}=g(a,!1),o=t("a:pPr",{...r,lvl:e.level>0?e.level:void 0},...u),l=e.runs.flatMap(s=>s.text.split("\v").flatMap((d,h)=>{const p={...e.font,...i?.font,...s.font},b=runProps("a:rPr",Object.keys(p).length>0?p:void 0,y(d,n));return[...h>0?[t("a:br",{},runProps("a:rPr",void 0,n))]:[],...d===""?[]:[s.field?t("a:fld",{id:v,type:s.field},b,t("a:t",{},_(d))):t("a:r",{},b,t("a:t",{},_(d)))]]}));return t("a:p",{},o==="<a:pPr/>"?"":o,...l,l.length===0?runProps("a:endParaRPr",{...e.font,...i?.font},n):"")}export function txBody(e,n,i,a,r,u){const o=a.map(l=>paragraph(l,r,u));return t(e,{},n,i,...o.length>0?o:[t("a:p")])}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{fontFace as l}from"@allyhub/slides-core";export{l as face};import{HEAD as
|
|
2
|
+
import{fontFace as l}from"@allyhub/slides-core";export{l as face};import{HEAD as m,NS as r,el as a}from"./xml.js";const f=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],i=t=>a("a:srgbClr",{val:t.replace("#","").toUpperCase().slice(0,6)}),e=a("a:solidFill",{},a("a:schemeClr",{val:"phClr"}));export function themeXml(t){const c=(n,o)=>a("a:latin",{typeface:l(n)})+a("a:ea",{typeface:l(o)})+a("a:cs",{typeface:""})+["Jpan","Hang","Hans","Hant"].map(s=>a("a:font",{script:s,typeface:l(o)})).join("");return m+a("a:theme",{"xmlns:a":r.a,name:t.name},a("a:themeElements",{},a("a:clrScheme",{name:t.name},...f.map(n=>a(`a:${n}`,{},i(t.colors[n])))),a("a:fontScheme",{name:t.name},a("a:majorFont",{},c(t.fonts.major,t.fonts.major_east_asian)),a("a:minorFont",{},c(t.fonts.minor,t.fonts.minor_east_asian))),a("a:fmtScheme",{name:t.name},a("a:fillStyleLst",{},e,e,e),a("a:lnStyleLst",{},...[6350,12700,19050].map(n=>a("a:ln",{w:n,cap:"flat",cmpd:"sng",algn:"ctr"},e,a("a:prstDash",{val:"solid"}),a("a:miter",{lim:8e5})))),a("a:effectStyleLst",{},...[0,1,2].map(()=>a("a:effectStyle",{},a("a:effectLst")))),a("a:bgFillStyleLst",{},e,e,e))),a("a:objectDefaults"),a("a:extraClrSchemeLst"))}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{isEntrance as q,isExit as I}from"@allyhub/slides-core";import{el as t}from"./xml.js";const k=e=>Math.round(e*1e3),W="http://schemas.microsoft.com/office/powerpoint/2010/main",Y="http://schemas.microsoft.com/office/powerpoint/2015/09/main",Z="http://schemas.openxmlformats.org/markup-compatibility/2006";export const TRANSITION_SIDES={"from-right":"l","from-left":"r","from-bottom":"u","from-top":"d"};const G=e=>e<.625?"fast":e<.875?"med":"slow";export function transitionXml(e,o){const p=o===void 0?void 0:k(o);if(!e)return p===void 0?"":t("p:transition",{advTm:p});const c=G(e.duration),i=e.type==="morph"?t("p159:morph",{option:"byObject"}):e.type==="fade"?t("p:fade"):t(`p:${e.type}`,{dir:TRANSITION_SIDES[e.direction]});return t("mc:AlternateContent",{"xmlns:mc":Z},t("mc:Choice",{"xmlns:p14":W,...e.type==="morph"?{"xmlns:p159":Y}:{},Requires:e.type==="morph"?"p159":"p14"},t("p:transition",{spd:c,"p14:dur":k(e.duration),advTm:p},i)),t("mc:Fallback",{},t("p:transition",{spd:c,advTm:p},e.type==="morph"?t("p:fade"):i)))}export const PRESETS={appear:{kind:"entr",id:1},fade:{kind:"entr",id:10},wipe:{kind:"entr",id:22},"fly-in":{kind:"entr",id:2},zoom:{kind:"entr",id:53},disappear:{kind:"exit",id:1},"fade-out":{kind:"exit",id:10},"wipe-out":{kind:"exit",id:22},"fly-out":{kind:"exit",id:2},"zoom-out":{kind:"exit",id:53},pulse:{kind:"emph",id:26},path:{kind:"path",id:0}},SUBTYPES={"from-top":1,"from-right":2,"from-bottom":4,"from-left":8};const H={"from-top":"up","from-right":"right","from-bottom":"down","from-left":"left"},F={"from-top":["ppt_y","0-#ppt_h/2"],"from-right":["ppt_x","1+#ppt_w/2"],"from-bottom":["ppt_y","1+#ppt_h/2"],"from-left":["ppt_x","0-#ppt_w/2"]};export function motionPath(e,o){const p=r=>String(r/o.width),c=r=>String(r/o.height);return`${e.map(r=>r.op==="close"?"Z":r.op==="curve"?`C ${p(r.x1)} ${c(r.y1)} ${p(r.x2)} ${c(r.y2)} ${p(r.x)} ${c(r.y)}`:`${r.op==="move"?"M":"L"} ${p(r.x)} ${c(r.y)}`).join(" ")} E`}class J{next=1;take(){return this.next++}}const _=e=>t("p:stCondLst",{},t("p:cond",{delay:e})),B=(...e)=>t("p:attrNameLst",{},...e.map(o=>t("p:attrName",{},o))),T=e=>t("p:tgtEl",{},t("p:spTgt",{spid:e.spid},e.paragraph===void 0?"":t("p:txEl",{},t("p:pRg",{st:e.paragraph,end:e.paragraph})))),z=(e,o,p,c)=>t("p:set",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:1,fill:"hold"},_(c)),T(o),B("style.visibility")),t("p:to",{},t("p:strVal",{val:p}))),E=(e,o,p,c,i)=>t("p:animEffect",{transition:p,filter:c},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i}),T(o))),x=(e,o,p,c,i,r,f={})=>t("p:anim",{calcmode:"lin",valueType:"num"},t("p:cBhvr",{additive:"base"},t("p:cTn",{id:e.take(),dur:r,fill:"hold",...f}),T(o),B(p)),t("p:tavLst",{},...[[0,c],[1e5,i]].map(([a,s])=>t("p:tav",{tm:a},t("p:val",{},t("p:strVal",{val:s}))))));function K(e,o,p,c){const i=Math.max(1,k(o.duration)),r=I(o.effect)?z(e,p,"hidden",Math.max(0,i-1)):o.effect==="pulse"||o.effect==="path"?"":z(e,p,"visible",0),f=I(o.effect)?"out":"in",a=[];switch(o.effect){case"fade":case"fade-out":a.push(E(e,p,f,"fade",i));break;case"wipe":case"wipe-out":a.push(E(e,p,f,`wipe(${H[o.direction]})`,i));break;case"fly-in":{const[s,b]=F[o.direction];a.push(x(e,p,s,b,`#${s}`,i,{decel:1e5}));break}case"fly-out":{const[s,b]=F[o.direction];a.push(x(e,p,s,`#${s}`,b,i,{accel:1e5}));break}case"zoom":a.push(x(e,p,"ppt_w","0","#ppt_w",i),x(e,p,"ppt_h","0","#ppt_h",i),E(e,p,"in","fade",i));break;case"zoom-out":a.push(x(e,p,"ppt_w","#ppt_w","0",i),x(e,p,"ppt_h","#ppt_h","0",i),E(e,p,"out","fade",i));break;case"pulse":a.push(t("p:animScale",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:Math.round(i/2),autoRev:1,fill:"hold"}),T(p)),t("p:by",{x:105e3,y:105e3})));break;case"path":a.push(t("p:animMotion",{origin:"layout",path:motionPath(o.path??[],c),pathEditMode:"relative",ptsTypes:""},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),T(p),B("ppt_x","ppt_y"))));break;default:break}return I(o.effect)?[...a,r]:[r,...a]}const v=["clickEffect","withEffect","afterEffect"],A=(e,o,p,c)=>t("p:par",{},t("p:cTn",{id:e.take(),presetID:1,presetClass:"mediacall",presetSubtype:0,fill:"hold",nodeType:p},_(0),t("p:childTnLst",{},t("p:cmd",{type:"call",cmd:"playFrom(0.0)"},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:k(c),fill:"hold"}),T({spid:o}))))));export function timingXml(e,o,p,c,i,r=new Map){const f=e.filter(n=>p(n.shape)!==void 0),a=[...r].filter(([n])=>p(n)!==void 0&&!f.some(d=>d.shape===n&&q(d.effect)));if(f.length===0&&o.length===0)return"";const s=new J,b=s.take(),N=f.length>0||a.length>0,S=N?s.take():0,C=[];for(const n of f){const d=C.at(-1);if(n.start==="on-click"||!d){C.push({auto:n.start!=="on-click",groups:[{at:0,of:[n]}]});continue}const l=d.groups.at(-1);if(n.start==="with-previous"&&l)l.of.push(n);else{const u=d.groups.reduce((g,m)=>Math.max(g,...m.of.map(h=>m.at+h.delay+h.duration)),0);d.groups.push({at:u,of:[n]})}}const P=new Map,$=[],D=(n,d)=>{const l=p(n.shape)??0,u={spid:l,paragraph:n.paragraph},g=PRESETS[n.effect],m=n.paragraph!==void 0||c(n.shape),h=P.get(l)??0;m&&(P.set(l,h+1),$.push(t("p:bldP",{spid:l,grpId:h,...n.paragraph===void 0?{}:{build:"p"}})));const M=s.take();return t("p:par",{},t("p:cTn",{id:M,presetID:g.id,presetClass:g.kind,presetSubtype:n.effect==="wipe"||n.effect==="wipe-out"||n.effect==="fly-in"||n.effect==="fly-out"?SUBTYPES[n.direction]:0,fill:"hold",...m?{grpId:h}:{},nodeType:d},_(k(n.delay)),t("p:childTnLst",{},...K(s,n,u,i))))},X=C.map(n=>{const d=s.take(),l=n.groups.map((u,g)=>{const m=s.take(),h=u.of.map((y,w)=>{const L=g===0&&w===0&&!n.auto?v[0]:w>0||y.start==="with-previous"?v[1]:v[2];return D(y,L)}),M=u.of.flatMap(y=>{const w=r.get(y.shape),L=p(y.shape);return w!==void 0&&L!==void 0&&q(y.effect)?[A(s,L,v[1],w)]:[]});return t("p:par",{},t("p:cTn",{id:m,fill:"hold"},_(k(u.at)),t("p:childTnLst",{},...h,...M)))});return t("p:par",{},t("p:cTn",{id:d,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),n.auto?t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:S})):""),t("p:childTnLst",{},...l)))}),j=n=>{const d=s.take(),l=s.take();return t("p:par",{},t("p:cTn",{id:d,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:S}))),t("p:childTnLst",{},t("p:par",{},t("p:cTn",{id:l,fill:"hold"},_(0),t("p:childTnLst",{},...n))))))},V=a.length>0?[j(a.map(([n,d],l)=>A(s,p(n)??0,l===0?v[2]:v[1],d)))]:[],R=n=>t("p:cond",{evt:n,delay:0},t("p:tgtEl",{},t("p:sldTgt"))),O=N?t("p:seq",{concurrent:1,nextAc:"seek"},t("p:cTn",{id:S,dur:"indefinite",nodeType:"mainSeq"},t("p:childTnLst",{},...V,...X)),t("p:prevCondLst",{},R("onPrev")),t("p:nextCondLst",{},R("onNext"))):"",U=o.map(n=>t("p:video",{},t("p:cMediaNode",{vol:8e4},t("p:cTn",{id:s.take(),fill:"hold",display:0},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}))),t("p:tgtEl",{},t("p:spTgt",{spid:n})))));return t("p:timing",{},t("p:tnLst",{},t("p:par",{},t("p:cTn",{id:b,dur:"indefinite",restart:"never",nodeType:"tmRoot"},t("p:childTnLst",{},O,...U)))),$.length>0?t("p:bldLst",{},...$):"")}
|
|
2
|
+
import{isEntrance as P,isExit as I,PLAYBACK_DEFAULTS as K,spanOf as Z}from"@allyhub/slides-core";import{el as t}from"./xml.js";const _=e=>Math.round(e*1e3),G="http://schemas.microsoft.com/office/powerpoint/2010/main",J="http://schemas.microsoft.com/office/powerpoint/2015/09/main",Q="http://schemas.openxmlformats.org/markup-compatibility/2006";export const TRANSITION_SIDES={"from-right":"l","from-left":"r","from-bottom":"u","from-top":"d","from-top-right":"ld","from-bottom-right":"lu","from-top-left":"rd","from-bottom-left":"ru"},SPLITS={"vertical-out":{orient:"vert",dir:"out"},"vertical-in":{orient:"vert",dir:"in"},"horizontal-out":{orient:"horz",dir:"out"},"horizontal-in":{orient:"horz",dir:"in"}};const tt=e=>e<.625?"fast":e<.875?"med":"slow";function et(e){const p=e.throughBlack?{thruBlk:1}:{};switch(e.type){case"fade":return{of:t("p:fade",p)};case"cut":return{of:t("p:cut",p)};case"push":case"wipe":case"cover":return{of:t(`p:${e.type}`,{dir:TRANSITION_SIDES[e.direction]})};case"uncover":return{of:t("p:pull",{dir:TRANSITION_SIDES[e.direction]})};case"split":return{of:t("p:split",SPLITS[e.direction]??{})};case"reveal":return{of:t("p14:reveal",{...p,dir:e.direction==="from-left"?"l":"r"}),ns:"p14"};case"zoom":return e.direction==="rotate"?{of:t("p:newsflash")}:{of:t("p14:warp",{dir:e.direction==="out"?"out":"in"}),ns:"p14"};case"morph":return{of:t("p159:morph",{option:"byObject"}),ns:"p159"}}}export function transitionXml(e,p){const n=p===void 0?void 0:_(p);if(!e)return n===void 0?"":t("p:transition",{advTm:n});const s=tt(e.duration),{of:i,ns:r}=et(e),u=r===void 0?i:t("p:fade");return t("mc:AlternateContent",{"xmlns:mc":Q},t("mc:Choice",{"xmlns:p14":G,...r==="p159"?{"xmlns:p159":J}:{},Requires:r??"p14"},t("p:transition",{spd:s,"p14:dur":_(e.duration),advTm:n},i)),t("mc:Fallback",{},t("p:transition",{spd:s,advTm:n},u)))}export const PRESETS={appear:{kind:"entr",id:1},fade:{kind:"entr",id:10},"fly-in":{kind:"entr",id:2},"float-in":{kind:"entr",id:42},split:{kind:"entr",id:16},wipe:{kind:"entr",id:22},zoom:{kind:"entr",id:53},disappear:{kind:"exit",id:1},"fade-out":{kind:"exit",id:10},"fly-out":{kind:"exit",id:2},"float-out":{kind:"exit",id:42},"split-out":{kind:"exit",id:16},"wipe-out":{kind:"exit",id:22},"zoom-out":{kind:"exit",id:53},pulse:{kind:"emph",id:26},"grow-shrink":{kind:"emph",id:6},spin:{kind:"emph",id:8},transparency:{kind:"emph",id:9},path:{kind:"path",id:0}},FLOAT_DOWN=47,SUBTYPES={"from-top":1,"from-right":2,"from-bottom":4,"from-left":8,"vertical-in":21,"horizontal-in":26,"vertical-out":37,"horizontal-out":42},SUBTYPED=new Set(["wipe","wipe-out","fly-in","fly-out","split","split-out"]);export function presetOf(e){const p=PRESETS[e.effect],n=(e.effect==="float-in"||e.effect==="float-out")&&e.direction==="down";return{kind:p.kind,id:n?FLOAT_DOWN:p.id,subtype:SUBTYPED.has(e.effect)?SUBTYPES[e.direction]??0:0}}const nt={"vertical-in":"barn(inVertical)","horizontal-in":"barn(inHorizontal)","vertical-out":"barn(outVertical)","horizontal-out":"barn(outHorizontal)"},ot={"from-top":"up","from-right":"right","from-bottom":"down","from-left":"left"},D={"from-top":["ppt_y","0-#ppt_h/2"],"from-right":["ppt_x","1+#ppt_w/2"],"from-bottom":["ppt_y","1+#ppt_h/2"],"from-left":["ppt_x","0-#ppt_w/2"]};export function motionPath(e,p){const n=r=>String(r/p.width),s=r=>String(r/p.height);return`${e.map(r=>r.op==="close"?"Z":r.op==="curve"?`C ${n(r.x1)} ${s(r.y1)} ${n(r.x2)} ${s(r.y2)} ${n(r.x)} ${s(r.y)}`:`${r.op==="move"?"M":"L"} ${n(r.x)} ${s(r.y)}`).join(" ")} E`}class pt{next=1;take(){return this.next++}}const w=e=>t("p:stCondLst",{},t("p:cond",{delay:e})),E=(...e)=>t("p:attrNameLst",{},...e.map(p=>t("p:attrName",{},p))),h=e=>t("p:tgtEl",{},t("p:spTgt",{spid:e.spid},e.paragraph===void 0?"":t("p:txEl",{},t("p:pRg",{st:e.paragraph,end:e.paragraph})))),V=(e,p,n,s)=>t("p:set",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:1,fill:"hold"},w(s)),h(p),E("style.visibility")),t("p:to",{},t("p:strVal",{val:n}))),L=(e,p,n,s,i)=>t("p:animEffect",{transition:n,filter:s},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i}),h(p))),k=(e,p,n,s,i,r,u={})=>t("p:anim",{calcmode:"lin",valueType:"num"},t("p:cBhvr",{additive:"base"},t("p:cTn",{id:e.take(),dur:r,fill:"hold",...u}),h(p),E(n)),t("p:tavLst",{},...[[0,s],[1e5,i]].map(([d,a])=>t("p:tav",{tm:d},t("p:val",{},t("p:strVal",{val:a}))))));function it(e,p,n,s){const i=Math.max(1,_(p.duration)),r=I(p.effect)?V(e,n,"hidden",Math.max(0,i-1)):P(p.effect)?V(e,n,"visible",0):"",u=I(p.effect)?"out":"in",d=[];switch(p.effect){case"fade":case"fade-out":d.push(L(e,n,u,"fade",i));break;case"wipe":case"wipe-out":d.push(L(e,n,u,`wipe(${ot[p.direction]??"up"})`,i));break;case"split":case"split-out":d.push(L(e,n,u,nt[p.direction]??"barn(outVertical)",i));break;case"float-in":case"float-out":{const a=p.direction==="down"?"#ppt_y-.1":"#ppt_y+.1",y=p.direction==="down"?"#ppt_y+.1":"#ppt_y-.1";d.push(L(e,n,u,"fade",i),k(e,n,"ppt_x","#ppt_x","#ppt_x",i),p.effect==="float-in"?k(e,n,"ppt_y",a,"#ppt_y",i):k(e,n,"ppt_y","#ppt_y",y,i));break}case"grow-shrink":{const a=Math.round((p.amount??1.5)*1e5);d.push(t("p:animScale",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),h(n)),t("p:by",{x:p.direction==="vertical"?1e5:a,y:p.direction==="horizontal"?1e5:a})));break}case"spin":{const a=(p.amount??360)*(p.direction==="counterclockwise"?-1:1);d.push(t("p:animRot",{by:Math.round(a*6e4)},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),h(n),E("r"))));break}case"transparency":{const a=String(Math.round((1-(p.amount??.5))*1e3)/1e3);d.push(t("p:set",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),h(n),E("style.opacity")),t("p:to",{},t("p:strVal",{val:a}))),t("p:animEffect",{filter:"image",prLst:`opacity: ${a}`},t("p:cBhvr",{rctx:"IE"},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),h(n))));break}case"fly-in":{const[a,y]=D[p.direction]??["ppt_y","1+#ppt_h/2"];d.push(k(e,n,a,y,`#${a}`,i,{decel:1e5}));break}case"fly-out":{const[a,y]=D[p.direction]??["ppt_y","1+#ppt_h/2"];d.push(k(e,n,a,`#${a}`,y,i,{accel:1e5}));break}case"zoom":d.push(k(e,n,"ppt_w","0","#ppt_w",i),k(e,n,"ppt_h","0","#ppt_h",i),L(e,n,"in","fade",i));break;case"zoom-out":d.push(k(e,n,"ppt_w","#ppt_w","0",i),k(e,n,"ppt_h","#ppt_h","0",i),L(e,n,"out","fade",i));break;case"pulse":d.push(t("p:animScale",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:Math.round(i/2),autoRev:1,fill:"hold"}),h(n)),t("p:by",{x:105e3,y:105e3})));break;case"path":d.push(t("p:animMotion",{origin:"layout",path:motionPath(p.path??[],s),pathEditMode:"relative",ptsTypes:""},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),h(n),E("ppt_x","ppt_y"))));break;default:break}return I(p.effect)?[...d,r]:[r,...d]}const x=["clickEffect","withEffect","afterEffect"],N=(e,p,n,s)=>t("p:par",{},t("p:cTn",{id:e.take(),presetID:1,presetClass:"mediacall",presetSubtype:0,fill:"hold",nodeType:n},w(0),t("p:childTnLst",{},t("p:cmd",{type:"call",cmd:"playFrom(0.0)"},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:s===void 0?"indefinite":_(s),fill:"hold"}),h({spid:p}))))));export function timingXml(e,p,n,s,i,r=new Map){const u=e.filter(o=>n(o.shape)!==void 0),d=o=>p.some(c=>c.name===o&&c.playback?.start==="on-click"),a=[...r].filter(([o])=>n(o)!==void 0&&!d(o)&&!u.some(c=>c.shape===o&&P(c.effect))),y=p.flatMap(o=>o.name!==void 0&&o.playback?.start==="on-click"&&n(o.name)!==void 0?[[o.name,r.get(o.name)]]:[]);if(u.length===0&&p.length===0)return"";const f=new pt,q=f.take(),A=u.length>0||a.length>0||y.length>0,M=A?f.take():0,B=[];for(const o of u){const c=B.at(-1);if(o.start==="on-click"||!c){B.push({auto:o.start!=="on-click",groups:[{at:0,of:[o]}]});continue}const l=c.groups.at(-1);if(o.start==="with-previous"&&l)l.of.push(o);else{const m=c.groups.reduce((T,v)=>Math.max(T,...v.of.map(g=>v.at+g.delay+Z(g))),0);c.groups.push({at:m,of:[o]})}}const R=new Map,z=[],O=(o,c)=>{const l=n(o.shape)??0,m={spid:l,paragraph:o.paragraph},T=presetOf(o),v=o.paragraph!==void 0||s(o.shape),g=R.get(l)??0;v&&(R.set(l,g+1),z.push(t("p:bldP",{spid:l,grpId:g,...o.paragraph===void 0?{}:{build:"p"}})));const $=f.take();return t("p:par",{},t("p:cTn",{id:$,presetID:T.id,presetClass:T.kind,presetSubtype:T.subtype,...o.repeat===void 0?{}:{repeatCount:typeof o.repeat=="number"?Math.round(o.repeat*1e3):"indefinite"},fill:o.rewind?"remove":"hold",...v?{grpId:g}:{},nodeType:c},w(_(o.delay)),o.repeat==="until-next-click"?t("p:endCondLst",{},t("p:cond",{evt:"onNext",delay:0},t("p:tgtEl",{},t("p:sldTgt")))):"",o.iterate?t("p:iterate",{type:o.iterate.by==="word"?"wd":"lt"},t("p:tmPct",{val:Math.round(o.iterate.delay*1e5)})):"",t("p:childTnLst",{},...it(f,o,m,i))))},U=B.map(o=>{const c=f.take(),l=o.groups.map((m,T)=>{const v=f.take(),g=m.of.map((b,S)=>{const C=T===0&&S===0&&!o.auto?x[0]:S>0||b.start==="with-previous"?x[1]:x[2];return O(b,C)}),$=m.of.flatMap(b=>{const S=r.get(b.shape),C=n(b.shape);return S!==void 0&&C!==void 0&&P(b.effect)&&!d(b.shape)?[N(f,C,x[1],S)]:[]});return t("p:par",{},t("p:cTn",{id:v,fill:"hold"},w(_(m.at)),t("p:childTnLst",{},...g,...$)))});return t("p:par",{},t("p:cTn",{id:c,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),o.auto?t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:M})):""),t("p:childTnLst",{},...l)))}),W=y.map(([o,c])=>{const l=f.take(),m=f.take();return t("p:par",{},t("p:cTn",{id:l,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"})),t("p:childTnLst",{},t("p:par",{},t("p:cTn",{id:m,fill:"hold"},w(0),t("p:childTnLst",{},N(f,n(o)??0,x[0],c)))))))}),X=o=>{const c=f.take(),l=f.take();return t("p:par",{},t("p:cTn",{id:c,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:M}))),t("p:childTnLst",{},t("p:par",{},t("p:cTn",{id:l,fill:"hold"},w(0),t("p:childTnLst",{},...o))))))},Y=a.length>0?[X(a.map(([o,c],l)=>N(f,n(o)??0,l===0?x[2]:x[1],c)))]:[],F=o=>t("p:cond",{evt:o,delay:0},t("p:tgtEl",{},t("p:sldTgt"))),j=A?t("p:seq",{concurrent:1,nextAc:"seek"},t("p:cTn",{id:M,dur:"indefinite",nodeType:"mainSeq"},t("p:childTnLst",{},...Y,...U,...W)),t("p:prevCondLst",{},F("onPrev")),t("p:nextCondLst",{},F("onNext"))):"",H=p.map(({spid:o,playback:c,sound:l})=>t(l?"p:audio":"p:video",l?{}:{fullScrn:c?.fullscreen===!0?1:void 0},t("p:cMediaNode",{vol:Math.round((c?.volume??K.volume)*1e5),...c?.volume===0?{mute:1}:{},...c?.hide===!0?{showWhenStopped:0}:{}},t("p:cTn",{id:f.take(),...c?.loop===!0?{repeatCount:"indefinite"}:{},fill:"hold",display:0},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}))),t("p:tgtEl",{},t("p:spTgt",{spid:o})))));return t("p:timing",{},t("p:tnLst",{},t("p:par",{},t("p:cTn",{id:q,dur:"indefinite",restart:"never",nodeType:"tmRoot"},t("p:childTnLst",{},j,...H)))),z.length>0?t("p:bldLst",{},...z):"")}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{createHash as Te}from"node:crypto";import{zipSync as Ee}from"fflate";import{AUTOSHAPE_STYLE as Oe,colorOfFile as Ie,CONNECTOR_STYLE as Ce,isConnectorGeometry as ie,joinPath as fe,placeholderFrame as Re,plainLevels as Be,Pt as ae}from"@allyhub/slides-core";import{chartBook as je,chartXml as Ne}from"./charts.js";import{asFace as Ae,fontInfo as ze,eotOf as Fe}from"./fonts.js";import{NO_PARAGRAPHS as He,shapeXml as he,treeXml as oe}from"./shapes.js";import{bodyOfStyle as Ge,bodyProps as V,bodyUnder as re,LINK as Xe,SLIDE_NUMBER as Ue,levelOf as ue,listStyle as A,txBody as X}from"./text.js";import{themeXml as ge}from"./theme.js";import{timingXml as We,transitionXml as Je}from"./timing.js";import{HEAD as M,PML as E,color as Ye,el as n,esc as Ze,fill as xe,gradientFill as qe,unesc as Ke}from"./xml.js";const Q={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf"},ye={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},D=e=>(e.split(".").pop()??"").toLowerCase(),Ve=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],c={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},S={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class O{list=[];linked(t){return t.replaceAll(new RegExp(`r:id="${Xe}([^"]*)"`,"gu"),(o,i)=>`r:id="${this.add(c.hyperlink,Ke(i),!0)}"`)}add(t,o,i=!1){const r=this.list.find(s=>s.type===t&&s.target===o);if(r)return r.id;const p=`rId${String(this.list.length+1)}`;return this.list.push({id:p,type:t,target:o,...i?{external:i}:{}}),p}xml(){return M+n("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>n("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class Qe{list=[];add(t,o){return this.list.push({chart:t,frame:o}),`../charts/chart${String(this.list.length)}.xml`}}class et{parts=new Map;byHash=new Map;add(t,o,i,r){const p=Te("sha256").update(t).digest("hex"),s=this.byHash.get(`${i}:${p}`);if(s)return s;const l=r?.split("/").pop()?.replace(/\.[^.]*$/u,"").replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,""),f=l===void 0||l===""?void 0:l;let u=`${f??`${i}${String(this.parts.size+1)}`}.${o}`;for(let P=2;this.parts.has(`ppt/media/${u}`);P++)u=`${f??i}-${String(P)}.${o}`;return this.parts.set(`ppt/media/${u}`,t),this.byHash.set(`${i}:${p}`,`../media/${u}`),`../media/${u}`}}function be(e){return e.kind==="component"||e.kind==="movie"?!1:e.kind==="picture"?Q[D(e.media?.path??"")]!==void 0:!0}function se(e){return e.kind==="component"||e.kind==="movie"?!0:e.kind==="picture"?Q[D(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(o=>se(o)).map(o=>({key:`${t.id}/${o.name}`,slide:t.id,shape:o.name,frame:o.frame})))}export function filesOf(e){const t=new Set;for(const o of e.masters)for(const i of[...o.shapes,...o.layouts.flatMap(r=>r.shapes)])i.media&&be(i)&&t.add(fe(i.media.base,i.media.path));for(const o of e.slides){o.background_picture!==void 0&&t.add(o.background_picture);for(const i of o.shapes)i.media&&(i.kind==="picture"||i.kind==="movie")&&t.add(i.media.path)}return[...t].sort()}const tt=n("p:nvGrpSpPr",{},n("p:cNvPr",{id:1,name:""}),n("p:cNvGrpSpPr"),n("p:nvPr")),nt=n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:0,y:0}),n("a:ext",{cx:0,cy:0}),n("a:chOff",{x:0,y:0}),n("a:chExt",{cx:0,cy:0}))),Z=e=>n("p:spTree",{},tt,nt,...e),_e={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},ee=e=>n("p:bg",{},n("p:bgPr",{},n("a:solidFill",{},Ye(e)),n("a:effectLst")));function it(e,t,o){if(e.background_picture!==void 0){const i=o(e.background_picture);if(i!==void 0)return n("p:bg",{},n("p:bgPr",{},n("a:blipFill",{dpi:0,rotWithShape:1},n("a:blip",{"r:embed":i}),n("a:srcRect"),n("a:stretch",{},n("a:fillRect"))),n("a:effectLst")))}return e.background_gradient?n("p:bg",{},n("p:bgPr",{},qe(e.background_gradient),n("a:effectLst"))):de(e.background,t)?"":ee(e.background)}const de=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Se(e){return{...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow===void 0?{}:{shadow:e.shadow}}}function te(e){const t=o=>({...e.fill===void 0||"fill"in o&&de(e.fill,o.fill)?{}:{fill:e.fill},...e.line===void 0||de(e.line,o.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===o.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?ie(e.geometry)?{style:"connector",...t(Ce)}:{style:"shape",...t(Oe)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const at=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(o,i)=>{const r=e[i]??{},p=t[i]??{},s={...r.font,...p.font};return{...r,...p,...Object.keys(s).length>0?{font:s}:{}}});function ke(e,t,o,i,r,p,s,l){const f=i!==void 0&&r!==void 0&&JSON.stringify(i.text_styles.other)!==JSON.stringify(r.text_styles.other);return X("p:txBody",V(re(t,l),s,e==="autoshape"?{rtlCol:0}:{}),A(f?at(i.text_styles.other,t.levels):t.levels),o,p,l)}const ot="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",rt=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function we(e,t){return n("a:tbl",{},n("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},n("a:tableStyleId",{},ot)),n("a:tblGrid",{},...e.columns.map(o=>n("a:gridCol",{w:o}))),...e.rows.map((o,i)=>n("a:tr",{h:o.height},...o.cells.map((r,p)=>{const s=r.text.own??r.text,l=$e(r.fileText,r.text.style),f=o.cells[p-1],u=e.rows[i-1]?.cells[p];return n("a:tc",{gridSpan:r.span_width,rowSpan:r.span_height,hMerge:r.spanned&&f&&(f.spanned||f.span_width)?1:void 0,vMerge:r.spanned&&u&&(u.spanned||u.span_height)?1:void 0},X("a:txBody",n("a:bodyPr"),n("a:lstStyle"),r.text.paragraphs,t,l),n("a:tcPr",{marL:s.margin_left,marR:s.margin_right,marT:s.margin_top,marB:s.margin_bottom,anchor:re(s,l).vertical_anchor},...rt.map(([P,U])=>{const I=r.borders?.[P];return I?n(U,{w:I.width},xe(I.color)):""}),r.fill===void 0?"":xe(r.fill)))}))))}const le=e=>e.group===void 0?{}:{group:e.group},ne=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end},...e.line_begin_size===void 0?{}:{lineBeginSize:e.line_begin_size},...e.line_end_size===void 0?{}:{lineEndSize:e.line_end_size}});function pe(e,t,o){return e.map(i=>{const r=i.kind==="cxn"?t.get(i.id)?.connect:void 0;if(!r)return i;const p=f=>{const u=f&&o(f.shape);return f&&u!==void 0?{id:u,idx:f.site}:void 0},s=p(r.begin),l=p(r.end);return s||l?{...i,connect:{...s?{begin:s}:{},...l?{end:l}:{}}}:i})}const Me=e=>new Map(e.map((t,o)=>[o+2,t])),ve=e=>t=>e.find(o=>o.name===t)?.id;function Pe(e,t,o,i,r,p,s){const l={...Se(e),id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?{flip:e.flip}:{}};if(e.kind==="placeholder"&&e.placeholder){const f=s.on==="master"?{...Re(e.placeholder.type),...e.text}:e.text;return{...l,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:X("p:txBody",f?V(f):n("a:bodyPr"),A(f?.levels??[]),e.placeholder.type==="sldNum"?Ue:He,p)}}if(be(e)){if(e.table)return{...l,kind:"table",table:we(e.table,p)};if(e.kind==="picture"&&e.media){const f=r(fe(e.media.base,e.media.path));return f?{...l,kind:"pic",picture:{image:o.add(c.image,i.add(f,D(e.media.path),"image",e.media.path))},descr:e.media.path.split("/").pop()??""}:void 0}return!e.path&&ie(e.geometry)?{...l,kind:"cxn",geometry:e.geometry??"line",...e.adjustments?{adjustments:e.adjustments}:{},...te(e),...ne(e)}:{...l,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...te(e),...ne(e),...e.text?{text:ke(e.kind,e.text,e.text.paragraphs,s.master,s.first,p)}:{}}}}function $e(e,t){if(!e)return;const o=e.numbered!==void 0||e.bullet!==void 0&&e.bullet!==!1;return{font:{...e.size===void 0?{}:{size:ae(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline},...e.strike===void 0?{}:{strike:e.strike},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:{color:Ie(e.color)}},paragraph:{...e.align===void 0?{}:{alignment:e.align},...e.line_spacing===void 0?{}:{line_spacing:{lines:e.line_spacing}},...e.space_before===void 0?{}:{space_before:ae(e.space_before)},...e.space_after===void 0?{}:{space_after:ae(e.space_after)},...e.numbered!==void 0?{numbered:e.numbered}:e.bullet===void 0?{}:{bullet:e.bullet===!1?null:e.bullet}},...o&&t?{levels:t.levels.map(i=>({margin_left:i.margin_left,indent:i.indent}))}:{},...e.anchor===void 0?{}:{anchor:e.anchor}}}function st(e,t,o,i,r,p,s,l,f){const u=`${e.id}/${t.name}`,P=p.deck.fitted[u];if(t.level!=="slide"&&!se(t))return;const U=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},W=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},v={...Se(t),id:o,name:t.name,...U,...W,...t.rotation===void 0?{}:{rotation:t.rotation},...t.flip?{flip:t.flip}:{},...t.alt===void 0?{}:{descr:t.alt},...t.locked?{locked:!0}:{}},q=()=>{const y=p.pictures.get(u);return y?{image:i.add(c.image,r.add(y,"png","image"))}:void 0};if(t.table)return{...v,kind:"table",table:we(t.table,s)};if(t.chart)return{...v,frame:t.frame,kind:"chart",chart:i.add(c.chart,f.add(t.chart,t.frame))};if(t.kind==="movie"&&t.media){const y=q(),R=ye[D(t.media.path)]?p.file(t.media.path):void 0;if(!y)return;if(!R)return{...v,frame:t.frame,kind:"pic",picture:y};const L=r.add(R,D(t.media.path),"media",t.media.path);return l.push(o),{...v,frame:t.frame,kind:"pic",picture:{image:y.image},video:{link:i.add(c.video,L),media:i.add(c.media,L)}}}if(se(t)){const y=q(),R=p.movies?.get(u);if(y&&R){const L=r.add(R.bytes,"mp4","media");return l.push(o),{...v,frame:t.frame,kind:"pic",picture:{image:y.image},video:{link:i.add(c.video,L),media:i.add(c.media,L)}}}return y?{...v,frame:t.frame,kind:"pic",picture:y}:void 0}if(t.kind==="picture"&&t.media){const y=p.file(t.media.path);return y?{...v,kind:"pic",picture:{image:i.add(c.image,r.add(y,D(t.media.path),"image",t.media.path)),...t.media.crop?{crop:t.media.crop}:{}},descr:t.alt??t.media.path.split("/").pop()??""}:void 0}if(!t.path&&ie(t.geometry))return{...v,kind:"cxn",geometry:t.geometry??"line",...t.adjustments?{adjustments:t.adjustments}:{},...te(t),...ne(t)};const $=t.text,K=p.deck.masters.find(y=>y.name===e.master),z=$e(t.fileText,$?.style),J=$?t.placeholder?X("p:txBody",V(re({},z),P),n("a:lstStyle"),$.paragraphs,s,z):$.own?ke(t.kind,$.own,$.paragraphs,K,p.deck.masters[0],s,P,z):X("p:txBody",V(Ge($.style),P),A($.style.levels.map(ue)),$.paragraphs,s):void 0,Y=t.sources.frame.from==="code",C=t.fill!==void 0&&(Y||t.sources.fill?.from==="slide"),F=t.line!==void 0&&(Y||t.sources.line?.from==="slide");return{...v,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||C||F?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...ne(t),...t.placeholder?{...C?{fill:t.fill}:{},...F?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:te(t),...J?{text:J}:{}}}const dt={cx:6858e3,cy:9144e3};function Le(e,t){const o=he({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),i=he({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:X("p:txBody",n("a:bodyPr"),n("a:lstStyle"),(e??"").split(`
|
|
3
|
-
`).map(
|
|
2
|
+
import{createHash as ge}from"node:crypto";import{zipSync as Ae}from"fflate";import{AUTOSHAPE_STYLE as Ne,colorOfFile as xe,spaceOfFile as ye,CONNECTOR_STYLE as Fe,isConnectorGeometry as re,joinPath as ne,placeholderFrame as ze,plainLevels as He,Pt as Ue,DEFAULT_TABLE_STYLE as Ge,TABLE_STYLES as Xe}from"@allyhub/slides-core";import{AUDIO_ICON as Ye}from"./audio-icon.js";import{chartBook as Je,chartXml as We}from"./charts.js";import{asFace as Ze,fontInfo as qe,eotOf as Ke}from"./fonts.js";import{NO_PARAGRAPHS as Ve,shapeXml as _e,treeXml as de}from"./shapes.js";import{bodyOfStyle as Qe,bodyProps as ie,bodyUnder as se,LINK as et,SLIDE_LINK as tt,SLIDE_NUMBER as nt,levelOf as be,listStyle as F,txBody as Y}from"./text.js";import{tableStyleXml as it}from"./table-styles.js";import{themeXml as Se}from"./theme.js";import{timingXml as at,transitionXml as ot}from"./timing.js";import{HEAD as v,NS as rt,PML as j,color as dt,el as i,esc as st,fill as ke,gradientFill as lt,unesc as we}from"./xml.js";const q={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf"},$e={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},ve={mp3:"audio/mpeg",m4a:"audio/mp4",wav:"audio/wav",aac:"audio/aac"},M=e=>(e.split(".").pop()??"").toLowerCase(),pt=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],c={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",audio:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},k={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class R{list=[];linked(t,o){return t.replaceAll(new RegExp(`r:id="${et}([^"]*)"`,"gu"),(n,d)=>`r:id="${this.add(c.hyperlink,we(d),!0)}"`).replaceAll(new RegExp(`r:id="${tt}([^"]*)"`,"gu"),(n,d)=>{const r=o?.(we(d));return`r:id="${r===void 0?"":this.add(c.slide,r)}"`})}add(t,o,n=!1){const d=this.list.find(s=>s.type===t&&s.target===o);if(d)return d.id;const r=`rId${String(this.list.length+1)}`;return this.list.push({id:r,type:t,target:o,...n?{external:n}:{}}),r}xml(){return v+i("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>i("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class ct{list=[];add(t,o){return this.list.push({chart:t,frame:o}),`../charts/chart${String(this.list.length)}.xml`}}class mt{parts=new Map;byHash=new Map;add(t,o,n,d){const r=ge("sha256").update(t).digest("hex"),s=this.byHash.get(`${n}:${r}`);if(s)return s;const l=d?.split("/").pop()?.replace(/\.[^.]*$/u,"").replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,""),f=l===void 0||l===""?void 0:l;let g=`${f??`${n}${String(this.parts.size+1)}`}.${o}`;for(let P=2;this.parts.has(`ppt/media/${g}`);P++)g=`${f??n}-${String(P)}.${o}`;return this.parts.set(`ppt/media/${g}`,t),this.byHash.set(`${n}:${r}`,`../media/${g}`),`../media/${g}`}}function Me(e){return e.kind==="component"||e.kind==="movie"||e.kind==="audio"?!1:e.kind==="picture"?q[M(e.media?.path??"")]!==void 0:!0}function le(e){return e.kind==="component"||e.kind==="movie"?!0:e.kind==="picture"?q[M(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(o=>le(o)).map(o=>({key:`${t.id}/${o.name}`,slide:t.id,shape:o.name,frame:o.frame})))}export function filesOf(e){const t=new Set;for(const o of e.masters)for(const n of[...o.shapes,...o.layouts.flatMap(d=>d.shapes)])n.media&&Me(n)&&t.add(ne(n.media.base,n.media.path)),n.picture_fill&&t.add(ne(n.picture_fill.base,n.picture_fill.path));for(const o of e.slides){o.background_picture!==void 0&&t.add(o.background_picture);for(const n of o.shapes)n.media&&(n.kind==="picture"||n.kind==="movie"||n.kind==="audio")&&t.add(n.media.path),n.picture_fill&&t.add(n.picture_fill.path)}return[...t].sort()}const ft=i("p:nvGrpSpPr",{},i("p:cNvPr",{id:1,name:""}),i("p:cNvGrpSpPr"),i("p:nvPr")),ut=i("p:grpSpPr",{},i("a:xfrm",{},i("a:off",{x:0,y:0}),i("a:ext",{cx:0,cy:0}),i("a:chOff",{x:0,y:0}),i("a:chExt",{cx:0,cy:0}))),K=e=>i("p:spTree",{},ft,ut,...e),pe={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},ae=e=>i("p:bg",{},i("p:bgPr",{},i("a:solidFill",{},dt(e)),i("a:effectLst")));function ht(e,t,o){if(e.background_picture!==void 0){const n=o(e.background_picture);if(n!==void 0)return i("p:bg",{},i("p:bgPr",{},i("a:blipFill",{dpi:0,rotWithShape:1},i("a:blip",{"r:embed":n}),i("a:srcRect"),i("a:stretch",{},i("a:fillRect"))),i("a:effectLst")))}return e.background_gradient?i("p:bg",{},i("p:bgPr",{},lt(e.background_gradient),i("a:effectLst"))):ce(e.background,t)?"":ae(e.background)}const ce=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Pe(e){return{...e.inner_shadow?{innerShadow:e.inner_shadow}:{},...e.glow?{glow:e.glow}:{},...e.reflection?{reflection:e.reflection}:{},...e.soft_edges===void 0?{}:{softEdges:e.soft_edges},...e.pattern?{pattern:e.pattern}:{},...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow===void 0?{}:{shadow:e.shadow}}}function Le(e,t,o,n,d){if(!e)return{};const r=n(e.path);return!r||q[M(e.path)]===void 0?(d(`${e.path} ${r?"is of a kind PowerPoint does not read":"is not in the project"}, so the file leaves the shape's picture fill out`),{}):{pictureFill:{image:t.add(c.image,o.add(r,M(e.path),"image",e.path)),...e.tile?{tile:e.tile}:{},...e.transparency===void 0?{}:{transparency:e.transparency}}}}function oe(e){const t=o=>({...e.fill===void 0||"fill"in o&&ce(e.fill,o.fill)?{}:{fill:e.fill},...e.line===void 0||ce(e.line,o.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===o.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?re(e.geometry)?{style:"connector",...t(Fe)}:{style:"shape",...t(Ne)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const gt=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(o,n)=>{const d=e[n]??{},r=t[n]??{},s={...d.font,...r.font};return{...d,...r,...Object.keys(s).length>0?{font:s}:{}}});function Ee(e,t,o,n,d,r,s,l){const f=n!==void 0&&d!==void 0&&JSON.stringify(n.text_styles.other)!==JSON.stringify(d.text_styles.other);return Y("p:txBody",ie(se(t,l),s,e==="autoshape"?{rtlCol:0}:{}),F(f?gt(n.text_styles.other,t.levels):t.levels),o,r,l)}const xt="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",yt=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function Ie(e,t){const o=new Map;return e.rows.forEach((n,d)=>{n.cells.forEach((r,s)=>{if(!r.spanned)for(let l=0;l<(r.span_height??1);l++)for(let f=0;f<(r.span_width??1);f++)(l>0||f>0)&&o.set(`${String(d+l)},${String(s+f)}`,{row:d,col:s})})}),i("a:tbl",{},i("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},i("a:tableStyleId",{},e.style??xt)),i("a:tblGrid",{},...e.columns.map(n=>i("a:gridCol",{w:n}))),...e.rows.map((n,d)=>i("a:tr",{h:n.height},...n.cells.map((r,s)=>{const l=r.text.own??r.text,f=Ce(r.fileText,r.text.style),g=r.spanned?o.get(`${String(d)},${String(s)}`):void 0;return i("a:tc",{gridSpan:r.span_width,rowSpan:r.span_height,hMerge:g&&s>g.col?1:void 0,vMerge:g&&d>g.row?1:void 0},Y("a:txBody",i("a:bodyPr"),i("a:lstStyle"),r.text.paragraphs,t,f),i("a:tcPr",{marL:l.margin_left,marR:l.margin_right,marT:l.margin_top,marB:l.margin_bottom,anchor:se(l,f).vertical_anchor},...yt.map(([P,z])=>{const H=r.borders?.[P];return H?i(z,{w:H.width},ke(H.color)):""}),r.fill===void 0?"":ke(r.fill)))}))))}const me=e=>e.group===void 0?{}:{group:e.group},V=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_cap===void 0?{}:{lineCap:e.line_cap},...e.line_join===void 0?{}:{lineJoin:e.line_join},...e.line_compound===void 0?{}:{lineCompound:e.line_compound},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end},...e.line_begin_size===void 0?{}:{lineBeginSize:e.line_begin_size},...e.line_end_size===void 0?{}:{lineEndSize:e.line_end_size}});function fe(e,t,o){return e.map(n=>{const d=n.kind==="cxn"?t.get(n.id)?.connect:void 0;if(!d)return n;const r=f=>{const g=f&&o(f.shape);return f&&g!==void 0?{id:g,idx:f.site}:void 0},s=r(d.begin),l=r(d.end);return s||l?{...n,connect:{...s?{begin:s}:{},...l?{end:l}:{}}}:n})}const Te=e=>new Map(e.map((t,o)=>[o+2,t])),De=e=>t=>e.find(o=>o.name===t)?.id;function Oe(e,t,o,n,d,r,s){const l={...Pe(e),...Le(e.picture_fill&&{...e.picture_fill,path:ne(e.picture_fill.base,e.picture_fill.path)},o,n,d,f=>{s.left(`${s.where} › ${e.name}: ${f}`)}),id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?{flip:e.flip}:{}};if(e.kind==="placeholder"&&e.placeholder){const f=s.on==="master"?{...ze(e.placeholder.type),...e.text}:e.text;return{...l,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...V(e),...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:Y("p:txBody",f?ie(f):i("a:bodyPr"),F(f?.levels??[]),e.placeholder.type==="sldNum"?nt:Ve,r)}}if(Me(e)){if(e.table)return{...l,kind:"table",table:Ie(e.table,r)};if(e.kind==="picture"&&e.media){const f=ne(e.media.base,e.media.path),g=d(f);if(!g){s.left(`${s.where} › ${e.name}: ${f} is not in the project, so the file leaves the picture out`);return}return{...l,kind:"pic",picture:{image:o.add(c.image,n.add(g,M(e.media.path),"image",e.media.path))},descr:e.media.path.split("/").pop()??""}}return!e.path&&re(e.geometry)?{...l,kind:"cxn",geometry:e.geometry??"line",...e.adjustments?{adjustments:e.adjustments}:{},...oe(e),...V(e)}:{...l,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...oe(e),...V(e),...e.text?{text:Ee(e.kind,e.text,e.text.paragraphs,s.master,s.first,r)}:{}}}}function Ce(e,t){if(!e)return;const o=e.numbered!==void 0||e.bullet!==void 0&&e.bullet!==!1;return{font:{...e.size===void 0?{}:{size:Ue(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline},...e.strike===void 0?{}:{strike:e.strike},...e.caps===void 0?{}:{caps:e.caps},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:{color:xe(e.color)}},paragraph:{...e.align===void 0?{}:{alignment:e.align},...e.line_spacing===void 0?{}:{line_spacing:{lines:e.line_spacing}},...e.space_before===void 0?{}:{space_before:ye(e.space_before)},...e.space_after===void 0?{}:{space_after:ye(e.space_after)},...e.bullet_color===void 0?{}:{bullet_color:xe(e.bullet_color)},...e.bullet_size===void 0?{}:{bullet_size:e.bullet_size},...e.start_at===void 0?{}:{start_at:e.start_at},...e.numbered!==void 0?{numbered:e.numbered}:e.bullet===void 0?{}:{bullet:e.bullet===!1?null:e.bullet}},...o&&t?{levels:t.levels.map(n=>({margin_left:n.margin_left,indent:n.indent}))}:{},...e.anchor===void 0?{}:{anchor:e.anchor},...e.orientation===void 0?{}:{orientation:e.orientation}}}function _t(e,t,o,n,d,r,s,l,f){const g=`${e.id}/${t.name}`,P=r.deck.fitted[g];if(t.level!=="slide"&&!le(t))return;const z=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},Q=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},w={...Pe(t),...Le(t.picture_fill,n,d,r.file,u=>{r.left?.(`slide ${e.id} › ${t.name}: ${u}`)}),id:o,name:t.name,...z,...Q,...t.rotation===void 0?{}:{rotation:t.rotation},...t.flip?{flip:t.flip}:{},...t.alt===void 0?{}:{descr:t.alt},...t.locked?{locked:!0}:{},...t.link===void 0?{}:{link:t.link}},J=()=>{const u=r.pictures.get(g);return u?{image:n.add(c.image,d.add(u,"png","image"))}:void 0};if(t.table)return{...w,kind:"table",table:Ie(t.table,s)};if(t.chart)return{...w,frame:t.frame,kind:"chart",chart:n.add(c.chart,f.add(t.chart,t.frame))};const B=u=>r.left?.(`${g}: ${u}`);if(t.kind==="audio"&&t.media){const u=ve[M(t.media.path)]!==void 0,I=u?r.file(t.media.path):void 0;if(!I){B(u?`${t.media.path} is not in the project, so the file leaves the sound out`:`${t.media.path} is a sound PowerPoint does not play, so the file leaves it out`);return}const T=d.add(I,M(t.media.path),"media",t.media.path),D=t.media.playback;return l.push({spid:o,name:t.name,playback:D,sound:!0}),{...w,frame:t.frame,kind:"pic",picture:{image:n.add(c.image,d.add(Ye,"png","image"))},video:{link:n.add(c.audio,T),media:n.add(c.media,T),sound:!0,...D?.trim?{trim:D.trim}:{}}}}if(t.kind==="movie"&&t.media){const u=J(),I=$e[M(t.media.path)]!==void 0,T=I?r.file(t.media.path):void 0;if(!u){B("no picture of the video was drawn, so the file leaves it out");return}if(!T)return B(I?`${t.media.path} is not in the project, so the file holds the video's picture alone`:`${t.media.path} is a video PowerPoint does not play, so the file holds its picture alone`),{...w,frame:t.frame,kind:"pic",picture:u};const D=d.add(T,M(t.media.path),"media",t.media.path),E=t.media.playback;return l.push({spid:o,name:t.name,playback:E}),{...w,frame:t.frame,kind:"pic",picture:{image:u.image},video:{link:n.add(c.video,D),media:n.add(c.media,D),...E?.trim?{trim:E.trim}:{}}}}if(le(t)){const u=J(),I=r.movies?.get(g);if(u&&I){const T=d.add(I.bytes,"mp4","media");return l.push({spid:o,name:t.name}),{...w,frame:t.frame,kind:"pic",picture:{image:u.image},video:{link:n.add(c.video,T),media:n.add(c.media,T)}}}return u||B("no picture of it was drawn, so the file leaves it out"),u?{...w,frame:t.frame,kind:"pic",picture:u}:void 0}if(t.kind==="picture"&&t.media){const u=r.file(t.media.path);if(!u){B(`${t.media.path} is not in the project, so the file leaves the picture out`);return}return{...w,kind:"pic",picture:{image:n.add(c.image,d.add(u,M(t.media.path),"image",t.media.path)),...t.media.crop?{crop:t.media.crop}:{}},descr:t.alt??t.media.path.split("/").pop()??""}}if(!t.path&&re(t.geometry))return{...w,kind:"cxn",geometry:t.geometry??"line",...t.adjustments?{adjustments:t.adjustments}:{},...oe(t),...V(t)};const L=t.text,ee=r.deck.masters.find(u=>u.name===e.master),U=Ce(t.fileText,L?.style),W=L?t.placeholder?Y("p:txBody",ie(se({},U),P),i("a:lstStyle"),L.paragraphs,s,U):L.own?Ee(t.kind,L.own,L.paragraphs,ee,r.deck.masters[0],s,P,U):Y("p:txBody",ie(Qe(L.style),P),F(L.style.levels.map(be)),L.paragraphs,s):void 0,Z=t.sources.frame.from==="code",te=t.fill!==void 0&&(Z||t.sources.fill?.from==="slide"),A=t.line!==void 0&&(Z||t.sources.line?.from==="slide");return{...w,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||te||A?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...V(t),...t.placeholder?{...te?{fill:t.fill}:{},...A?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:oe(t),...W?{text:W}:{}}}const bt={cx:6858e3,cy:9144e3};function je(e,t){const o=_e({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),n=_e({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:Y("p:txBody",i("a:bodyPr"),i("a:lstStyle"),(e??"").split(`
|
|
3
|
+
`).map(d=>({runs:[{text:d}],level:0})),t)});return[o,n]}export function pptxParts(e){const{deck:t}=e,o=t.lang?.split("-").map((a,m)=>m===0?a.toLowerCase():a.toUpperCase()).join("-"),n=new Map,d=new mt,r=new ct,s=[],l=new R,f=[],g=new Map;let P=2147483648;const z=a=>{const m=t.slides.findIndex(x=>x.id===a);return m<0?void 0:`../slides/slide${String(m+1)}.xml`};t.masters.forEach((a,m)=>{const x=m+1,$=P++,y=`ppt/slideMasters/slideMaster${String(x)}.xml`,_=`ppt/theme/theme${String(x)}.xml`;n.set(_,Se(t.theme)),s.push([_,k.theme]);const S=new R,C=[];a.layouts.forEach(b=>{const N=g.size+1,p=`ppt/slideLayouts/slideLayout${String(N)}.xml`;g.set(b,p);const h=new R;h.add(c.slideMaster,`../slideMasters/slideMaster${String(x)}.xml`);const O=b.shapes.flatMap((ue,Re)=>{const he=Oe(ue,Re+2,h,d,e.file,o,{master:a,first:e.deck.masters[0],on:"layout",where:`layout "${b.name}"`,left:Be=>e.left?.(Be)});return he?[{...he,...me(ue)}]:[]});n.set(p,v+i("p:sldLayout",{...j,...b.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},i("p:cSld",{name:b.name},b.background===void 0?"":ae(b.background),h.linked(K(de(fe(O,Te(b.shapes),De(O)))),z)),i("p:clrMapOvr",{},b.color_map&&Object.keys(b.color_map).length>0?i("a:overrideClrMapping",{...pe,...a.color_map,...b.color_map}):i("a:masterClrMapping")))),n.set(`ppt/slideLayouts/_rels/slideLayout${String(N)}.xml.rels`,h.xml()),s.push([p,k.slideLayout]),C.push(i("p:sldLayoutId",{id:P++,"r:id":S.add(c.slideLayout,`../slideLayouts/slideLayout${String(N)}.xml`)}))}),S.add(c.theme,`../theme/theme${String(x)}.xml`);const G=a.shapes.flatMap((b,N)=>{const p=Oe(b,N+2,S,d,e.file,o,{master:a,first:e.deck.masters[0],on:"master",where:`master "${a.name}"`,left:h=>e.left?.(h)});return p?[{...p,...me(b)}]:[]}),X=a.text_styles;n.set(y,v+i("p:sldMaster",j,i("p:cSld",{name:a.name},ae(a.background),S.linked(K(de(fe(G,Te(a.shapes),De(G)))),z)),i("p:clrMap",{...pe,...a.color_map}),i("p:sldLayoutIdLst",{},...C),i("p:txStyles",{},F(X.title,"p:titleStyle"),F(X.body,"p:bodyStyle"),F(X.other,"p:otherStyle")))),n.set(`ppt/slideMasters/_rels/slideMaster${String(x)}.xml.rels`,S.xml()),s.push([y,k.slideMaster]),f.push(i("p:sldMasterId",{id:$,"r:id":l.add(c.slideMaster,`slideMasters/slideMaster${String(x)}.xml`)}))});const H=t.slides.some(a=>a.notes!==void 0),Q=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let w="";if(H){n.set(Q,Se(t.theme)),s.push([Q,k.theme]);const a=new R;a.add(c.theme,`../theme/theme${String(t.masters.length+1)}.xml`),n.set("ppt/notesMasters/notesMaster1.xml",v+i("p:notesMaster",j,i("p:cSld",{},ae("lt1"),K(je(void 0,o))),i("p:clrMap",pe))),n.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",a.xml()),s.push(["ppt/notesMasters/notesMaster1.xml",k.notesMaster]),w=l.add(c.notesMaster,"notesMasters/notesMaster1.xml")}const J=[],B=new Map(t.masters.flatMap(a=>a.layouts.map(m=>[m.name,m]))),L=a=>{const m=new Set,x=t.slides[a];for(const[$,y]of[[t.slides[a-1],x],[x,t.slides[a+1]]])if($&&y&&y.transition?.type==="morph")for(const _ of $.shapes)_.level==="slide"&&y.shapes.some(S=>S.name===_.name)&&m.add(_.name);return m};t.slides.forEach((a,m)=>{const x=m+1,$=`ppt/slides/slide${String(x)}.xml`,y=new R,_=B.get(a.layout),S=_?g.get(_):void 0;S&&y.add(c.slideLayout,`../${S.slice(4)}`);const C=[],G=new Map,X=new Map;let b=1;const N=a.shapes.flatMap(p=>{const h=_t(a,p,++b,y,d,e,o,C,r);if(!h)return b--,[];G.set(p.name,h.id),X.set(h.id,p);const O=L(m).has(p.name)?{name:`!!${h.name}`}:{};return[{...h,...me(p),...O}]});if(a.notes!==void 0){const p=`ppt/notesSlides/notesSlide${String(x)}.xml`,h=new R;h.add(c.notesMaster,"../notesMasters/notesMaster1.xml"),h.add(c.slide,`../slides/slide${String(x)}.xml`),n.set(p,v+i("p:notes",j,i("p:cSld",{},K(je(a.notes,o))),i("p:clrMapOvr",{},i("a:masterClrMapping")))),n.set(`ppt/notesSlides/_rels/notesSlide${String(x)}.xml.rels`,h.xml()),s.push([p,k.notesSlide]),y.add(c.notesSlide,`../notesSlides/notesSlide${String(x)}.xml`)}n.set($,v+i("p:sld",{...j,show:a.hidden?0:void 0},i("p:cSld",{name:a.id},ht(a,_?.background??t.masters.find(p=>p.name===a.master)?.background,p=>{const h=e.file(p);if(h&&q[M(p)]!==void 0)return y.add(c.image,d.add(h,M(p),"image",p));e.left?.(`${a.id}: its background picture ${p} ${h?"is of a kind PowerPoint does not read":"is not in the project"}, so the slide has its layout's background`)}),y.linked(K(de(fe(N,X,p=>G.get(p)))),p=>{const h=t.slides.findIndex(O=>O.id===p);return h<0?void 0:`slide${String(h+1)}.xml`})),i("p:clrMapOvr",{},i("a:masterClrMapping")),ot(a.transition,a.advance),at(a.animations,C,p=>G.get(p),p=>a.shapes.find(h=>h.name===p)?.text!==void 0,t,new Map(a.shapes.flatMap(p=>{const h=e.movies?.get(`${a.id}/${p.name}`),O=(p.kind==="movie"||p.kind==="audio")&&p.media?e.lengths?.get(p.media.path):h?.seconds;return O===void 0?[]:[[p.name,O]]}))))),n.set(`ppt/slides/_rels/slide${String(x)}.xml.rels`,y.xml()),s.push([$,k.slide]),J.push(i("p:sldId",{id:256+m,"r:id":l.add(c.slide,`slides/slide${String(x)}.xml`)}))}),l.add(c.theme,"theme/theme1.xml"),l.add(c.presProps,"presProps.xml"),l.add(c.viewProps,"viewProps.xml"),l.add(c.tableStyles,"tableStyles.xml");const ee=new Map;let U=0;const W=(e.fonts??[]).flatMap(a=>{const m=pt.flatMap(([x,$,y])=>{const _=a[x]&&Ze(a[x],a.typeface,y),S=_&&qe(_);if(!_||!S)return[];const C=`fonts/font${String(++U)}.fntdata`;return ee.set(`ppt/${C}`,Ke(_,S,a.typeface,y)),[i($,{"r:id":l.add(c.font,C)})]});return m.length===0?[]:[i("p:embeddedFont",{},i("p:font",{typeface:a.typeface}),...m)]}),Z=W.length===0?"":i("p:embeddedFontLst",{},...W);n.set("ppt/presentation.xml",v+i("p:presentation",{...j,...Z===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},i("p:sldMasterIdLst",{},...f),w===""?"":i("p:notesMasterIdLst",{},i("p:notesMasterId",{"r:id":w})),i("p:sldIdLst",{},...J),i("p:sldSz",{cx:t.width,cy:t.height}),i("p:notesSz",bt),Z,e.deck.masters[0]?F(He(e.deck.masters[0]).map(be),"p:defaultTextStyle"):"",sectionsXml(t.slides))),n.set("ppt/_rels/presentation.xml.rels",l.xml()),s.push(["ppt/presentation.xml",k.presentation]),n.set("ppt/presProps.xml",v+i("p:presentationPr",j)),n.set("ppt/viewProps.xml",v+i("p:viewPr",j));const te=new Set([...t.slides.flatMap(a=>a.shapes),...e.deck.masters.flatMap(a=>[...a.shapes,...a.layouts.flatMap(m=>m.shapes)])].flatMap(a=>a.table?.style===void 0?[]:[a.table.style]));n.set("ppt/tableStyles.xml",v+i("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:Ge},...Xe.filter(a=>te.has(a.id)).map(it))),s.push(["ppt/presProps.xml",k.presProps]),s.push(["ppt/viewProps.xml",k.viewProps]),s.push(["ppt/tableStyles.xml",k.tableStyles]),n.set("docProps/core.xml",v+i("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${st(e.title)}</dc:title>`)),n.set("docProps/app.xml",v+i("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},i("Application",{},"AllyHub"),i("Slides",{},String(t.slides.length)),i("Notes",{},String(t.slides.filter(a=>a.notes!==void 0).length)),i("HiddenSlides",{},String(t.slides.filter(a=>a.hidden).length)))),s.push(["docProps/core.xml",k.core]),s.push(["docProps/app.xml",k.app]);const A=new R;A.add(c.officeDocument,"ppt/presentation.xml"),A.add(c.core,"docProps/core.xml"),A.add(c.app,"docProps/app.xml");const u=new Map;r.list.forEach(({chart:a,frame:m},x)=>{const $=String(x+1),y=`ppt/charts/chart${$}.xml`,_=new R,S=`Microsoft_Excel_Sheet${$}.xlsx`;u.set(`ppt/embeddings/${S}`,Je(a)),n.set(y,We(a,m,_.add(c.package,`../embeddings/${S}`))),n.set(`ppt/charts/_rels/chart${$}.xml.rels`,_.xml()),s.push([y,k.chart])});const I=new Set([...d.parts.keys(),...u.keys()].map(M)),T=v+i("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},i("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),i("Default",{Extension:"xml",ContentType:"application/xml"}),U>0?i("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...I].sort().map(a=>i("Default",{Extension:a,ContentType:a==="xlsx"?k.workbook:q[a]??$e[a]??ve[a]??"application/octet-stream"})),...s.map(([a,m])=>i("Override",{PartName:`/${a}`,ContentType:m}))),D=new TextEncoder,E=new Map;E.set("[Content_Types].xml",D.encode(T)),E.set("_rels/.rels",D.encode(A.xml()));for(const[a,m]of n)E.set(a,D.encode(m));for(const[a,m]of d.parts)E.set(a,m);for(const[a,m]of u)E.set(a,m);for(const[a,m]of ee)E.set(a,m);return E}const St=new Date(1980,0,1);export function writePptx(e){const t={};for(const[o,n]of pptxParts(e))t[o]=[n,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(o)?0:6,mtime:St}];return Ae(t)}const kt="{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";function wt(e,t){const o=ge("sha256").update(`${String(e)}:${t}`).digest("hex").toUpperCase();return`{${o.slice(0,8)}-${o.slice(8,12)}-4${o.slice(13,16)}-8${o.slice(17,20)}-${o.slice(20,32)}}`}export function sectionsXml(e){if(!e.some(o=>o.section!==void 0))return"";const t=[];return e.forEach((o,n)=>{(o.section!==void 0||t.length===0)&&t.push({name:o.section??"Default Section",ids:[]}),t.at(-1)?.ids.push(256+n)}),i("p:extLst",{},i("p:ext",{uri:kt},i("p14:sectionLst",{"xmlns:p14":rt.p14},...t.map((o,n)=>i("p14:section",{name:o.name,id:wt(n,o.name)},i("p14:sldIdLst",{},...o.ids.map(d=>i("p14:sldId",{id:d}))))))))}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{
|
|
3
|
-
`,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){
|
|
2
|
+
import{colorXml as i}from"@allyhub/slides-core";const c={"&":"&","<":"<",">":">",'"':"""},d=t=>{const o=t.charCodeAt(0);return o<32&&o!==9&&o!==10&&o!==13||o===65534||o===65535};export const esc=t=>Array.from(t,o=>d(o)?"":c[o]??o).join(""),unesc=t=>t.replaceAll(""",'"').replaceAll(">",">").replaceAll("<","<").replaceAll("&","&");export function el(t,o={},...n){const e=Object.entries(o).filter(([,a])=>a!==void 0).map(([a,r])=>` ${a}="${esc(typeof r=="boolean"?r?"1":"0":String(r))}"`).join(""),l=n.join("");return l===""?`<${t}${e}/>`:`<${t}${e}>${l}</${t}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
`,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){return i(t,o>0?el("a:alpha",{val:Math.round((1-o)*1e5)}):"")}export const fill=(t,o=0)=>t===null?el("a:noFill"):el("a:solidFill",{},color(t,o)),gradientFill=t=>el("a:gradFill",{rotWithShape:1},el("a:gsLst",{},...[...t.stops].sort((o,n)=>o.at-n.at).map(o=>el("a:gs",{pos:Math.round(o.at*1e5)},color(o.color,o.transparency)))),t.path===void 0?el("a:lin",{ang:Math.round(t.angle*6e4),scaled:0}):el("a:path",{path:t.path},el("a:fillToRect",{l:Math.round((t.focus?.left??.5)*1e5),t:Math.round((t.focus?.top??.5)*1e5),r:Math.round((t.focus?.right??.5)*1e5),b:Math.round((t.focus?.bottom??.5)*1e5)}))),patternFill=t=>el("a:pattFill",{prst:t.preset},el("a:fgClr",{},color(t.fg)),el("a:bgClr",{},color(t.bg))),pictureFill=t=>el("a:blipFill",{dpi:0,rotWithShape:1},el("a:blip",{"r:embed":t.image},t.transparency===void 0?"":el("a:alphaModFix",{amt:Math.round((1-t.transparency)*1e5)})),el("a:srcRect"),t.tile?el("a:tile",{tx:Math.round(t.tile.offset_x),ty:Math.round(t.tile.offset_y),sx:Math.round(t.tile.scale_x*1e5),sy:Math.round(t.tile.scale_y*1e5),flip:"none",algn:t.tile.align}):el("a:stretch",{},el("a:fillRect")));const s=t=>({blurRad:t.blur,dist:t.distance,dir:Math.round(t.angle*6e4)});export function effects(t){const o=[t.glow?el("a:glow",{rad:t.glow.size},color(t.glow.color,t.glow.transparency)):"",t.innerShadow?el("a:innerShdw",s(t.innerShadow),color(t.innerShadow.color,t.innerShadow.transparency)):"",t.shadow?el("a:outerShdw",{...s(t.shadow),algn:"ctr",rotWithShape:0},color(t.shadow.color,t.shadow.transparency)):"",t.reflection?el("a:reflection",{blurRad:t.reflection.blur,stA:Math.round((1-t.reflection.transparency)*1e5),endA:300,endPos:Math.round(t.reflection.size*1e5),dist:t.reflection.distance,dir:54e5,sy:-1e5,algn:"bl",rotWithShape:0}):"",t.softEdges===void 0?"":el("a:softEdge",{rad:t.softEdges})].filter(n=>n!=="");return o.length===0&&t.shadow===void 0?"":el("a:effectLst",{},...o)}export const centipoints=t=>Math.round(t/127);
|