allyhub 0.19.0 → 0.20.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/dist/commands/align.js +1 -1
- package/dist/commands/check.js +1 -1
- package/dist/commands/cloud-tools.js +1 -1
- package/dist/commands/cloud.js +1 -1
- package/dist/commands/dev.js +5 -5
- package/dist/commands/export.js +3 -0
- package/dist/commands/frames/doc.js +1 -1
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/sheet.js +1 -1
- package/dist/commands/frames.js +9 -9
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/combos.js +1 -1
- package/dist/commands/inspect/common.js +2 -2
- package/dist/commands/inspect/facts.js +2 -2
- package/dist/commands/migrate.js +3 -0
- package/dist/commands/skills.js +3 -3
- package/dist/commands/upgrade.js +5 -0
- package/dist/commands.json +1 -1
- package/dist/help.js +3 -3
- package/dist/main.js +8 -7
- package/dist/node_modules/@allyhub/3d-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/blocks/LICENSE +241 -0
- package/dist/node_modules/@allyhub/blocks/dist/alt.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/elements.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/flow-resolve.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/flow-table.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/format.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/gantt.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/grids.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/html.js +75 -0
- package/dist/node_modules/@allyhub/blocks/dist/icons.generated.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/icons.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/layout.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/look.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/measure.js +3 -0
- package/dist/node_modules/@allyhub/blocks/dist/model.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/page.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/palette.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/path.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/resolve.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/samples.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/sankey.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/svg.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/tidy.js +2 -0
- package/dist/node_modules/@allyhub/blocks/dist/trees.js +2 -0
- package/dist/node_modules/@allyhub/blocks/package.json +19 -0
- package/dist/node_modules/@allyhub/browser/dist/html.js +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/fonts.js +9 -3
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/migrate.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
- package/dist/node_modules/@allyhub/build/package.json +5 -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 +2 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +4 -3
- package/dist/node_modules/@allyhub/chart/dist/chart.js +4 -2
- package/dist/node_modules/@allyhub/chart/dist/chartex-xml.js +4 -0
- package/dist/node_modules/@allyhub/chart/dist/classic.js +2 -0
- package/dist/node_modules/@allyhub/chart/dist/embedded.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/extended.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/dist/tree.js +2 -0
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/call.js +4 -4
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/storage.js +2 -0
- 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/background.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/item-process.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/item-worker.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/pages.js +20 -1
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -3
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/blocks.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/color.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx-read.js +12 -0
- package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +83 -48
- package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/merges.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/numbering.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/omml.js +3 -0
- package/dist/node_modules/@allyhub/doc/dist/page.js +2 -1
- package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/parse.js +5 -4
- package/dist/node_modules/@allyhub/doc/dist/redline.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/revisions.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/shapes.js +4 -0
- package/dist/node_modules/@allyhub/doc/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +65 -39
- package/dist/node_modules/@allyhub/doc/package.json +5 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +3 -0
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/index.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/styles.js +4 -0
- package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/project-tools.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +22 -2
- package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc-print/dist/layout.js +8 -7
- package/dist/node_modules/@allyhub/doc-print/dist/print.js +22 -16
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/dist/export.js +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/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/blocks-flow.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/blocks.d.ts +146 -0
- package/dist/node_modules/@allyhub/formats/dist/data/blocks.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.d.ts +9 -0
- package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +47 -40
- package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.d.ts +6 -0
- package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/diagrams.d.ts +29 -0
- package/dist/node_modules/@allyhub/formats/dist/data/diagrams.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +18 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +59 -0
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +698 -258
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +14104 -2167
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/themes.d.ts +82 -0
- package/dist/node_modules/@allyhub/formats/dist/data/themes.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/tokens.d.ts +67 -0
- package/dist/node_modules/@allyhub/formats/dist/data/tokens.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/index.d.ts +7 -0
- package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +12 -3
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +3260 -290
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +45 -0
- package/dist/node_modules/@allyhub/formats/dist/tolerant.js +2 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -9
- package/dist/node_modules/@allyhub/html-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/html-extension/markup/markup.json +14 -4
- package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +22 -1
- package/dist/node_modules/@allyhub/html-extension/package.json +9 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +2 -2
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/build-plugins.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
- package/dist/node_modules/@allyhub/image-measure/dist/layout.js +2 -2
- 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/dist/block.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/blocks.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.js +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 -3
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +3 -3
- 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/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/analyses/faces.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/asr/transcribe.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/ocr/text.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/index-media.js +3 -2
- 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/office-extension/markup/csv/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/mce.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/node.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/ns.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/opc.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/export.d.ts +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +2 -0
- package/dist/node_modules/@allyhub/piece/dist/look.d.ts +10 -2
- package/dist/node_modules/@allyhub/piece/dist/look.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/media.d.ts +8 -2
- package/dist/node_modules/@allyhub/piece/dist/script.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +3 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/media-index.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/page-frame.js +2 -0
- 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/runtime/dist/footage.js +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +2 -2
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/dist/index.js +12 -8
- 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/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/index.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/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/server.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/cell-styles.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/heatmap.js +2 -0
- 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/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/paginate.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/sparklines.js +2 -0
- 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/theme.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/tiles.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/units.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +14 -14
- 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/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/theme.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/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +7 -7
- package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/evaluate.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/dist/inspect.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/dist/migrations.js +4 -0
- package/dist/node_modules/@allyhub/sheet-extension/dist/project-tools.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +7 -3
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/blocks.js +2 -0
- 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/code.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/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/office-layouts.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
- 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/styles/brief.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/editorial.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/index.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/kit.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/layouts.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/pitch.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/stage.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/styles/tiles.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/check.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-fonts.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/project-tools.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +24 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/charts.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/image-size.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 +7 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/names.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/mtx.js +2 -0
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +3 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chartex.js +3 -0
- 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/text.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 +3 -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/load.js +1 -1
- 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/dist/fonts/archivo/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700-italic.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700.css +1 -0
- package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +42 -0
- package/dist/node_modules/@allyhub/stage-page/dist/style-faces.js +2 -0
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +96 -92
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/limit.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
- package/dist/node_modules/@allyhub/text-extension/markup/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/seams.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/index.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/joins.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/loop.js +3 -0
- package/dist/node_modules/@allyhub/video-extension/package.json +2 -25
- package/dist/node_modules/@allyhub/video-measure/dist/check.js +2 -2
- package/dist/node_modules/@allyhub/video-measure/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/dist/seams.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/free.js +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/website/dist/website.js +2 -2
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +3 -3
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -3
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +3 -3
- 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 +14 -14
- package/dist/self-upgrade.js +2 -0
- package/dist/text/batch-text.js +1 -1
- package/dist/text/facts-text.js +5 -5
- package/dist/text/format.js +2 -2
- package/dist/update-notice.js +3 -0
- package/dist/version.js +1 -1
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-DYaMS_BB.js → abnfDiagram-WEYOIA3C-BkVJMd53.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-g_Tjfl_y.js → architecture-WOLXFQ4H-C6rnaynZ.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-CqdhofOL.js → architectureDiagram-ZHVYKT53-D3vrh8LK.js} +1 -1
- package/editor-web/assets/arrow-down-D-QZrqcz.js +1 -0
- package/editor-web/assets/arrow-up-B1zjKUHX.js +1 -0
- package/editor-web/assets/article-DHf6mOY_.js +7 -0
- package/editor-web/assets/article-Dns1-Xh-.js +3 -0
- package/editor-web/assets/{audio-lines-PZj77e7t.js → audio-lines-BFoW_IeO.js} +1 -1
- package/editor-web/assets/bar-button-CKPfx2AB.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-Bc-28Bci.js → blockDiagram-RJAE7QA3-BKngt8H7.js} +1 -1
- package/editor-web/assets/{browser-C9NP0ZYz.js → browser-DEGNhKTV.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-CTGJb8FB.js → c4Diagram-XDPPPE54-j7sUELqF.js} +1 -1
- package/editor-web/assets/calc-worker-Cr4a0xmt.js +168 -0
- package/editor-web/assets/channel-CVWSV3su.js +1 -0
- package/editor-web/assets/{chart-no-axes-column-Be0lFcGF.js → chart-no-axes-column-Dyy25XZ_.js} +1 -1
- package/editor-web/assets/chip-Bn_9JRRG.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-B2MPOVTU.js → chunk-2E7WHVMD-BXa-uRSi.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BUV1ZHP0.js → chunk-4EMNKR2T-B3ntcsZN.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BZlpspL5.js → chunk-55XCU76K-AMvnFwUg.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-CpKeisWE.js → chunk-7S6XSTFO-BA6esfFu.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BJqwAPyo.js → chunk-AQDTSKZB-BT_vANXs.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-D6oPWl_W.js → chunk-DSNLSHJZ-DoUgmzGB.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-B5pk4MZF.js → chunk-HAGFOTED-DtnIrCZb.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-DHbSPvxQ.js → chunk-HNE4Q36P-BlPwQx3_.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CcL_GcRA.js → chunk-NQOKRVIF-D2r7jp2r.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-YgiOL6XE.js → chunk-UHW7PFBP-Cmc0_F5o.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-p14b4UYc.js → chunk-VQ5W62QI-nJSMqAr0.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-BWW0x-XH.js → chunk-WQQL4CDK-Btq2nbF6.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-oG3qd68C.js → chunk-YZO67HFG-DTbcCoGt.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-CpcheH0u.js → chunk-ZAUX2LTX-DVwkg-2N.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-cWQvLl1w.js → chunk-ZCHMQSOR-BV39jOOE.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-7PG7YcdU.js → classDiagram-v2-4MYWR3UA-Cj74-fhM.js} +1 -1
- package/editor-web/assets/code-Ch6AB5bZ.js +1 -0
- package/editor-web/assets/collaborator-XiHOxwGM.js +1 -0
- package/editor-web/assets/{copy-CuJSs0nI.js → copy-SoaMYqsN.js} +1 -1
- package/editor-web/assets/{createLucideIcon-lm_6n8YT.js → createLucideIcon-euu7Wcd9.js} +1 -1
- package/editor-web/assets/{cynefin-EF2NZ3EQ-CtcknEQ_.js → cynefin-EF2NZ3EQ-C0CkiipV.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-Ca7VIsjN.js → cynefinDiagram-WF24UDRP-hdsnJ4cI.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-BzcSLtsr.js → dagre-NK4GIZVX-CC7WSgaK.js} +1 -1
- package/editor-web/assets/deck-DQpNIS2p.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-DpRmTGlG.js → diagram-CBK3MWTC-DmaVm13J.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-BTrs_AX8.js → diagram-I5XIIV2D-De8jqp7b.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-CkIVjPqH.js → diagram-ODIL2UCW-B5pBTulX.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BlFMbAG1.js → diagram-PFBEJUXE-BYsXg5_w.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-D3f8VJ-D.js → diagram-RJA3I4VV-DZ8f6bYe.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Bbpngj6F.js → diagram-TYUNFSNR-qXHUsauD.js} +1 -1
- package/editor-web/assets/dist--z0ZHp4T.js +16 -0
- package/editor-web/assets/dist-9kuRjUTN.js +41 -0
- package/editor-web/assets/dist-B3rd02Cg.js +6 -0
- package/editor-web/assets/dist-B5GOGGEe.js +1 -0
- package/editor-web/assets/dist-Bx6q9kCu.js +1 -0
- package/editor-web/assets/dist-C4hHtrJr.js +1 -0
- package/editor-web/assets/dist-CCXJewsi.js +19 -0
- package/editor-web/assets/dist-CfK2BLl8.js +4 -0
- package/editor-web/assets/dist-Cmux3oJ_.js +1 -0
- package/editor-web/assets/dist-Cspf85KV.js +6 -0
- package/editor-web/assets/dist-DA72-4WB.js +82 -0
- package/editor-web/assets/{dist-DruvDNQe.js → dist-DAhe-kFC.js} +5 -5
- package/editor-web/assets/dist-DIJnhQFK.js +9 -0
- package/editor-web/assets/dist-DOrGo1GD.js +19 -0
- package/editor-web/assets/{dist-Bd8IxQPP.js → dist-DQ6RpEJD.js} +2 -2
- package/editor-web/assets/dist-DjiCHlSu.js +35 -0
- package/editor-web/assets/dist-Do4a40Wn.js +19 -0
- package/editor-web/assets/dist-FKEWS3Co.js +547 -0
- package/editor-web/assets/dist-QKd2i6kG.js +5 -0
- package/editor-web/assets/dist-SGnOfLhx.js +24 -0
- package/editor-web/assets/dist-VmVB7tl4.js +3 -0
- package/editor-web/assets/{docx-draw-CoK1oqQD.js → docx-draw-L54blreB.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BaKj-yL6.js → ebnfDiagram-V4P3TTPT-B7-IfVI-.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Cn2qv1_U.js → elk-QONTBCTQ-Gj_WaeBn.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-Bd7AEIDo.js → erDiagram-KYQIGQAA-BDF6Qoqx.js} +1 -1
- package/editor-web/assets/esm-PQD5Pn8a.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-Sfp7_461.js → eventmodeling-K75KTNOO-elxVXXEe.js} +1 -1
- package/editor-web/assets/{file-question-mark-DlIjUK37.js → file-question-mark-PeZgyqkK.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CBqcGdHI.js → ganttDiagram-R7GPNTJY-CEogW3jW.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-WTokXKTW.js → gitGraph-VSP46ZUC-Bh9cRWFa.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BIWZHD9q.js → gitGraphDiagram-PDYL7XHY-BQAvdM_V.js} +1 -1
- package/editor-web/assets/{group-BdrTp7gi.js → group-DwM2yqU8.js} +1 -1
- package/editor-web/assets/hint-CbwoSBMw.js +1 -0
- package/editor-web/assets/index-CXisi0Cj.css +2 -0
- package/editor-web/assets/index-wMlfx8aT.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-COC6G-_J.js → info-OHQRW6UA-CdPrqere.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-DpaqdKBD.js → infoDiagram-MVDRKAX5-uwIMeP44.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js → ishikawaDiagram-HPEHV2GE-rtfvqK7E.js} +1 -1
- package/editor-web/assets/iso-UwGLGD3F.js +1 -0
- package/editor-web/assets/{italic-zw4_eUNF.js → italic-BV7iHxoP.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-DeSVfmm7.js → journeyDiagram-BOSHW7O7-mmhfIyVG.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-Bfg0lj7B.js → kanban-definition-FNSA4HC5-Fe7jBsi-.js} +1 -1
- package/editor-web/assets/{link-DopSU3aa.js → link-CFOv3nz-.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-CyhovuYE.js → mermaid-parser.core-BxOSjBH9.js} +3 -3
- package/editor-web/assets/{mermaid.core-Dx1fBVUG.js → mermaid.core-BOln9YdH.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-QEU2HF_m.js → mindmap-definition-6OY57UG3-M3Q1LOtO.js} +1 -1
- package/editor-web/assets/minus-ngE8owxs.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-ReJTa_hw.js → packet-JDAUHWVQ-Dbb0TUG6.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-Bo1jFrvb.js → pegDiagram-ECIUJNBX-BZMRpSFC.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-BrtYafNA.js → pie-XZMESJXO-Ctm9XdKp.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-Cj0zQqs_.js → pieDiagram-GNMPY74T-cGbs5ZTl.js} +1 -1
- package/editor-web/assets/progress-DZQTiRLv.js +6 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-D5npDAVn.js → quadrantDiagram-D57K4MC3-BUe_zsxT.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-C8RDrRqi.js → radar-ABXABTNO-CCmKtqLs.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-ebDrmYTK.js → railroad-I3PHUGI6-k-yhjhjA.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-BxKuqg6V.js → railroad-abnf-LNEFI6M7-B-PvntB3.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DOclnfpr.js → railroad-ebnf-DWYD2UWJ-Ds2rua1h.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-DN0A1fpq.js → railroad-peg-JR7BVNR7-jNZ2wEp2.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-B3PjoVWw.js → railroadDiagram-Y72NRBL7-CTqSQ15w.js} +1 -1
- package/editor-web/assets/react-Byupo4pA.js +1 -0
- package/editor-web/assets/replace-CLLMtF4e.js +1 -0
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-DLdzkQk5.js → requirementDiagram-EQYSW5RA-CUblhR5M.js} +1 -1
- package/editor-web/assets/ribbon-DajdQ_Ya.js +1 -0
- package/editor-web/assets/row-Bei9HNEe.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-Dip4Piv_.js → sankeyDiagram-SY24JHO5-nSz6zDX3.js} +1 -1
- package/editor-web/assets/schemas-C21MyseF.js +1 -0
- package/editor-web/assets/{iso-DoC-ZoBr.js → schemas-DlRAoVtq.js} +1 -1
- package/editor-web/assets/{scissors-B_xOiUhd.js → scissors-m6QcoEf2.js} +1 -1
- package/editor-web/assets/search-D75Bi2GU.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-QnPcoybL.js → sequenceDiagram-BLEHNHQU-DxTpOYuo.js} +1 -1
- package/editor-web/assets/{session-DMlLCFWg.js → session-BhClkDyr.js} +1 -1
- package/editor-web/assets/{sigma-DSUsJhMn.js → sigma-B4AWtnVA.js} +1 -1
- package/editor-web/assets/snapshots-DwGHDN3t.js +1 -0
- package/editor-web/assets/sound-DkR3qxSt.js +1 -0
- package/editor-web/assets/split-DBAbwPZ5.js +3 -0
- package/editor-web/assets/{square-arrow-out-up-right-DF5dvsSp.js → square-arrow-out-up-right-1NqFsNDe.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-D103CiMX.js → stateDiagram-v2-A6IESKWZ-C3e14iHY.js} +1 -1
- package/editor-web/assets/{sticky-note-BdkIu5_D.js → sticky-note-s4QfzaBB.js} +1 -1
- package/editor-web/assets/surface-CIF0Ae0z.js +1 -0
- package/editor-web/assets/swatch-BUzr_XmH.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-y4gCqEoa.js → swimlanes-B3ENRKFQ-DPPdzNzu.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +8 -0
- package/editor-web/assets/switch-DrZxoPQS.js +1 -0
- package/editor-web/assets/{syntax-CU_WPKxt.js → syntax-emXV4DnN.js} +1 -1
- package/editor-web/assets/table-BW43XXVd.js +1 -0
- package/editor-web/assets/tabs-BwU2E7bU.js +1 -0
- package/editor-web/assets/text-wrap-Baus6l-V.js +1 -0
- package/editor-web/assets/textarea-BX_ax3X8.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-BMp76v4V.js → timeline-definition-JXYKGLGB-DRTJ1_Er.js} +1 -1
- package/editor-web/assets/tolerant-DM9s0Mt1.js +1 -0
- package/editor-web/assets/{treeView-D4JQ5SDB-Q_GYyk0b.js → treeView-D4JQ5SDB-BYJ_m-i5.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-B5lRWdQB.js → treemap-SAJKECNS-BcU6I6Rg.js} +1 -1
- package/editor-web/assets/type-CvZ0HZsV.js +41 -0
- package/editor-web/assets/{undo-2-C47jrRp5.js → undo-2-DCbMWoug.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX--QRllA-U.js → usecaseDiagram-WPOLBNNX-YV92pS4o.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CzkATPA3.js → vennDiagram-Q3Y3IDCW-oAvfHZtf.js} +1 -1
- package/editor-web/assets/video-SJvDRCJK.js +1 -0
- package/editor-web/assets/{wardley-7MLQ67FV-BXzwcdJa.js → wardley-7MLQ67FV-BLNiqxtt.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BQvC8Agx.js → wardleyDiagram-IVAIDKWA-SppgC6xW.js} +1 -1
- package/editor-web/assets/{whole-word-D3ZAtnkw.js → whole-word-C9TkGBCY.js} +1 -1
- package/editor-web/assets/{words-CaUHhQHf.js → words-BUlNNuH2.js} +3 -3
- package/editor-web/assets/words-zMedmPWc.js +3 -0
- package/editor-web/assets/workbook-BZKYx4WB.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-aY-lsD5o.js → xychartDiagram-4URNHDU4-BHMn_jwJ.js} +1 -1
- package/editor-web/assets/{zoom-in-PgsC94hP.js → zoom-in-yAGKspfC.js} +1 -1
- package/editor-web/index.html +9 -8
- package/package.json +3 -3
- package/CHANGELOG.md +0 -251
- package/dist/commands/render.js +0 -3
- package/dist/node_modules/@allyhub/video-extension/dist/inspect/motion.js +0 -4
- package/dist/node_modules/@allyhub/video-measure/dist/still.js +0 -2
- package/editor-web/assets/arrow-down-B8VUPCGi.js +0 -1
- package/editor-web/assets/arrow-up-Ds4juY8X.js +0 -1
- package/editor-web/assets/article-8evPh712.js +0 -3
- package/editor-web/assets/article-BhRtWYMd.js +0 -7
- package/editor-web/assets/bar-button-J9vbfzTx.js +0 -1
- package/editor-web/assets/calc-worker-oEIqrrTM.js +0 -45
- package/editor-web/assets/channel-wIj_OqDm.js +0 -1
- package/editor-web/assets/chart-amT4lgX3.js +0 -2
- package/editor-web/assets/chart-file-dGiRgFcH.js +0 -1
- package/editor-web/assets/code-CD-CbJG9.js +0 -1
- package/editor-web/assets/collaborator-BU4qU7O3.js +0 -1
- package/editor-web/assets/deck-C7fN0Qtn.js +0 -1
- package/editor-web/assets/dist-3iovns9K.js +0 -16
- package/editor-web/assets/dist-BkHnbOEj.js +0 -4
- package/editor-web/assets/dist-BvOrNcK-.js +0 -19
- package/editor-web/assets/dist-CEIszq39.js +0 -1
- package/editor-web/assets/dist-CU5RbLNH.js +0 -1
- package/editor-web/assets/dist-CWZj8IAm.js +0 -1
- package/editor-web/assets/dist-C_Mtrnif.js +0 -17
- package/editor-web/assets/dist-CdqpwdCV.js +0 -24
- package/editor-web/assets/dist-CjT76RAw.js +0 -43
- package/editor-web/assets/dist-CpzEn9T8.js +0 -6
- package/editor-web/assets/dist-CrFYWl5-.js +0 -3
- package/editor-web/assets/dist-D3C6FyrO.js +0 -82
- package/editor-web/assets/dist-D4eBFGVL.js +0 -1
- package/editor-web/assets/dist-DTcjb3cP.js +0 -18
- package/editor-web/assets/dist-D_WSM29I.js +0 -17
- package/editor-web/assets/dist-Dp_9ISjP.js +0 -531
- package/editor-web/assets/dist-J-tPYKGS.js +0 -5
- package/editor-web/assets/dist-YW8hS4IM.js +0 -9
- package/editor-web/assets/esm-Cjv8ogpP.js +0 -21
- package/editor-web/assets/file-exclamation-point-_L3ElCJ5.js +0 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +0 -1
- package/editor-web/assets/hint-rlht0uxG.js +0 -1
- package/editor-web/assets/index-BQWZnyAQ.js +0 -28
- package/editor-web/assets/index-Dvh1t1om.css +0 -2
- package/editor-web/assets/minus-CbPnUIOy.js +0 -1
- package/editor-web/assets/progress-CwKcXARv.js +0 -6
- package/editor-web/assets/props-form-BpSXbrSF.js +0 -1
- package/editor-web/assets/react-Edyoga_4.js +0 -1
- package/editor-web/assets/row-C_svyL8o.js +0 -1
- package/editor-web/assets/schemas-CQ_UU8-Z.js +0 -1
- package/editor-web/assets/search-Ba2BbT6T.js +0 -1
- package/editor-web/assets/slides-7xWhREpt.js +0 -1
- package/editor-web/assets/snapshots-BLX4NTQC.js +0 -1
- package/editor-web/assets/sound-bTlco_K3.js +0 -1
- package/editor-web/assets/split-tFGKk-x8.js +0 -3
- package/editor-web/assets/strikethrough-BwXWi4zg.js +0 -1
- package/editor-web/assets/surface-DtCjIlrq.js +0 -1
- package/editor-web/assets/svg-CWIBMIQ9.js +0 -1
- package/editor-web/assets/swatch-DhztHwPU.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +0 -8
- package/editor-web/assets/switch-8MU4Nfxe.js +0 -1
- package/editor-web/assets/table-DRbddzx0.js +0 -1
- package/editor-web/assets/tabs-CuEawka3.js +0 -1
- package/editor-web/assets/tag-CIfWT8B_.js +0 -1
- package/editor-web/assets/text-align-start-Cic2-TLh.js +0 -1
- package/editor-web/assets/textarea-D7TnPwv1.js +0 -1
- package/editor-web/assets/video-D0uTbHWx.js +0 -1
- package/editor-web/assets/words-XlXG79Ur.js +0 -3
- package/editor-web/assets/workbook-CiCXkjmN.js +0 -45
- package/editor-web/assets/x-DlhyIKuu.js +0 -41
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{ZipLimitError as Re}from"@allyhub/formats";import{SHEET_FILTER_OPERATORS as Me,SHEET_ICONS as _e,SHEET_MARGINS as fe,SHEET_OPERATORS as Pe,SHEET_PAPERS as De,SHEET_VALIDATIONS as je}from"@allyhub/formats";import{MAX_COLUMNS as J,MAX_ROWS as Y,cellName as te,columnLetter as ne,readAddress as he,readArea as U,readAreas as oe}from"../address.js";import{ITERATION_DEFAULTS as pe}from"../calc/engine.js";import{SHEET_CHART_DEFAULTS as me}from"../chart.js";import{moveFormula as ze,relativeKey as ge}from"../formula/move.js";import{parseFormula as He}from"../formula/parse.js";import{printFormula as be}from"../formula/print.js";import{ERR as Be,errorOf as Ve,serialOfDate as Ue}from"../values.js";import{OFFICE_THEME as We,colorOf as P,paletteOf as we,themeColors as qe}from"./colors.js";import{chartAnchors as Xe,readChart as Ge}from"./charts.js";import{isRangeText as Ze,readFileFormula as re}from"./formula.js";import{BUILTIN_FORMATS as xe}from"./numfmt.js";import{XmlStream as ye}from"./sax.js";import{attr as c,flag as x,numberAttr as y,readXml as $e,readXstring as A,tag as d,tags as v,textOf as N}from"./xml.js";import{RunsCollector as ve,readRuns as ke}from"./runs.js";import{ZipIn as Je}from"./zip.js";function Ke(n){if(x(n,"iterate")!==!0)return;const t=y(n,"iterateCount"),e=y(n,"iterateDelta"),o=t===void 0?void 0:Math.min(32767,Math.max(1,Math.round(t))),r=e===void 0?void 0:Math.max(0,e),s={...o===void 0||o===pe.max_iterations?{}:{max_iterations:o},...r===void 0||r===pe.max_change?{}:{max_change:r}};return Object.keys(s).length>0?s:!0}const Se=7,Qe=n=>Math.floor((256*n+Math.floor(128/Se))/256*Se),Ye=n=>Math.round(n*4/3),se=5;export function placesLine(n){const t=n.slice(0,se).join(", ");return n.length>se?`${t} and ${String(n.length-se)} more`:t}const W=(n,t,e=`${t}s`)=>`${String(n)} ${n===1?t:e}`;export const GRID_END=`Excel's grid ends at ${ne(J-1)}${String(Y)} (${Y.toLocaleString("en-US")} rows, ${J.toLocaleString("en-US")} columns)`;function et(n,t){let e=0,o=0;const r=n.length;for(;e<r;e++){const i=n.charCodeAt(e),u=i>=65&&i<=90,a=i>=97&&i<=122;if(!u&&!a)break;o=o*26+(u?i-64:i-96)}if(e===0||e===r)return;let s=0;for(let i=e;i<r;i++){const u=n.charCodeAt(i);if(u<48||u>57)return;s=s*10+u-48}if(s!==0){if(e>3||o>J||s>Y)throw new Error(`${t} has a cell at ${n}, and ${GRID_END}.`);return{row:s-1,col:o-1}}}class tt{zip;constructor(t,e){this.zip=new Je(t,e)}get names(){return this.zip.names}has(t){return this.zip.has(t)}text(t){return this.zip.text(t)}bytes(t){return this.zip.bytesOf(t)}xml(t){const e=this.text(t);return e===void 0?void 0:$e(e)}stream(t,e){const o=this.zip.streamText(t,r=>{e.push(r)});return o&&e.end(),o}rels(t){const e=t.lastIndexOf("/"),o=`${t.slice(0,e+1)}_rels/${t.slice(e+1)}.rels`,r=this.xml(o);return v(d(r?.Relationships)?.Relationship).map(s=>{const i=c(s,"Type")??"",u=c(s,"Target")??"",a=c(s,"TargetMode")==="External";return{id:c(s,"Id")??"",type:i.slice(i.lastIndexOf("/")+1),target:a?u:nt(t,u),external:a}})}count(t){return this.names.filter(e=>t.test(e)).length}}function nt(n,t){if(t.startsWith("/"))return t.slice(1);const e=n.split("/").slice(0,-1);for(const o of t.split("/"))o===".."?e.pop():o!=="."&&e.push(o);return e.join("/")}function ot(n,t,e){const o=[];if(t===void 0)return o;let r,s=0,i=!1;const u={open(a,l){if(a==="si"){r={text:"",runs:new ve};return}if(r){if(s>0||a==="rPh"||a==="phoneticPr"||a==="extLst"){s+=1;return}r.runs.open(a,l)||a==="t"&&(i=!0)}},close(a){if(s>0){s-=1;return}if(a==="si"){if(r){const{runs:l}=r.runs;o.push({text:A(r.text),...l.length>0?{runs:ke(l,e)}:{}})}r=void 0;return}r?.runs.close(a),a==="t"&&(i=!1)},text(a){r&&i&&s===0&&(r.text+=a,r.runs.text(a))}};return n.stream(t,new ye(u)),o}function q(n,t){const e=n[t];if(e===void 0)return!1;const o=c(d(e),"val");return o===void 0||o!=="0"&&o!=="false"}const rt=new Set(["double","singleAccounting","doubleAccounting"]);function st(n,t,e){const o={},r=(a,l)=>c(d(a?.[l]),"val");if(q(n,"b")&&(o.bold=!0),q(n,"i")&&(o.italic=!0),q(n,"strike")&&(o.strike=!0),q(n,"u")){const a=r(n,"u");o.underline=a!==void 0&&rt.has(a)?a:!0}const s=r(n,"name");s!==void 0&&s!==r(t,"name")&&(o.font=s);const i=r(n,"sz");i!==void 0&&i!==r(t,"sz")&&(o.size=Number(i));const u=P(d(n.color),e);return u!==void 0&&u!==P(d(t?.color),e)&&(o.color=u),o}function it(n,t){const e=d(n.patternFill),o=c(e,"patternType");if(o===void 0||o==="none")return;const r=P(d(e?.fgColor),t),s=P(d(e?.bgColor),t);return o==="solid"&&r!==void 0?r:{pattern:o,...r===void 0?{}:{color:r},...s===void 0?{}:{background:s}}}function Ce(n,t){const e={};for(const o of["left","right","top","bottom"]){const r=d(n[o]),s=c(r,"style");if(s===void 0||s==="none")continue;const i=P(d(r?.color),t);e[o]={style:s,...i===void 0?{}:{color:i}}}return Object.keys(e).length===0?void 0:e}function at(n){const t={},e=c(n,"horizontal");e!==void 0&&e!=="general"&&(t.align=e);const o=c(n,"vertical");o!==void 0&&o!=="bottom"&&(t.valign=o),x(n,"wrapText")===!0&&(t.wrap=!0),x(n,"shrinkToFit")===!0&&(t.shrink=!0);const r=y(n,"indent");r!==void 0&&r>0&&(t.indent=r);const s=y(n,"textRotation");return s!==void 0&&s>0&&s<=180&&(t.rotation=s),t}function Te(n,t){const e={},o=d(n.font);if(o){const f=(m,w)=>{o[m]!==void 0&&(e[w]=q(o,m))};f("b","bold"),f("i","italic"),f("strike","strike"),o.u!==void 0&&(e.underline=q(o,"u"));const g=P(d(o.color),t);g!==void 0&&(e.color=g)}const r=d(d(n.fill)?.patternFill),s=P(d(r?.bgColor),t)??P(d(r?.fgColor),t);s!==void 0&&(e.fill=s);const i=d(n.border),u=i&&Ce(i,t);u!==void 0&&(e.border=u);const a=d(n.numFmt),l=c(a,"formatCode")??xe[y(a,"numFmtId")??-1];return a&&l!==void 0&&l!==""&&l!=="General"&&(e.format=l),e}function dt(n,t){const e=d(n?.styleSheet),o=we(t,e),r=new Map(v(d(e?.numFmts)?.numFmt).map(h=>[y(h,"numFmtId")??-1,c(h,"formatCode")?.replace(/^$/u,"General")??"General"])),s=v(d(e?.fonts)?.font),i=v(d(e?.fills)?.fill),u=v(d(e?.borders)?.border),a=v(d(e?.cellXfs)?.xf),l=s[y(a[0],"fontId")??0],f=new Set;i.some(h=>h.gradientFill!==void 0)&&f.add("gradient fills");const g=v(d(e?.cellStyles)?.cellStyle),m=new Set(a.map(h=>y(h,"xfId")??0)),w=g.filter(h=>y(h,"builtinId")!==0&&m.has(y(h,"xfId")??-1)).map(h=>A(c(h,"name")??"")).filter(h=>h!=="");w.length>0&&f.add(`the names of cell styles (${w.slice(0,5).join(", ")}${w.length>5?", …":""}): their looks are kept`);const p=a.map(h=>{const C={},E=s[y(h,"fontId")??0];E&&(Object.assign(C,st(E,l,o)),E.vertAlign!==void 0&&f.add("superscript and subscript"));const M=i[y(h,"fillId")??0],F=M&&it(M,o);F!==void 0&&(C.fill=F);const L=u[y(h,"borderId")??0],D=L&&Ce(L,o);D!==void 0&&(C.border=D),L&&c(d(L.diagonal),"style")!==void 0&&f.add("diagonal borders");const R=d(h.alignment);R&&(Object.assign(C,at(R)),y(R,"textRotation")===255&&f.add("vertical text"));const H=d(h.protection);x(H,"locked")===!1&&(C.locked=!1),x(H,"hidden")===!0&&(C.hide_formula=!0);const B=y(h,"numFmtId")??0,j=r.get(B)??xe[B];return j!==void 0&&j!=="General"&&(C.format=j),C}),$=c(d(l?.name),"val"),k=c(d(l?.sz),"val");return{looks:p,dxfs:v(d(e?.dxfs)?.dxf).map(h=>Te(h,o)),font:{...$===void 0?{}:{name:$},...k===void 0?{}:{size:Number(k)}},lost:[...f]}}const lt=n=>{const t=Number(n);return n.trim()!==""&&Number.isFinite(t)?t:n};function ut(n,t){const e=d(n.customFilters);if(e){const i=v(e.customFilter).map(u=>({operator:c(u,"operator")??"equal",value:lt(A(c(u,"val")??""))}));return i.length===0||i.length>2||i.some(u=>!Me.includes(u.operator))?void 0:{conditions:i,...i.length===2&&x(e,"and")!==!0?{or:!0}:{}}}const o=d(n.top10);if(o){const i=y(o,"val");return i===void 0||i<=0?void 0:{top:{count:i,...x(o,"percent")===!0?{percent:!0}:{},...x(o,"top")===!1?{bottom:!0}:{}}}}const r=c(d(n.dynamicFilter),"type");if(r==="aboveAverage")return{average:"above"};if(r==="belowAverage")return{average:"below"};const s=d(n.colorFilter);if(s){const i=t[y(s,"dxfId")??-1];return x(s,"cellColor")===!1?i?.color?{color:{font:i.color}}:void 0:typeof i?.fill=="string"?{color:{fill:i.fill}}:void 0}}function Ee(n,t=[]){const e=new Map;let o=0;for(const r of v(n.filterColumn)){const s=y(r,"colId")??0,i=d(r.filters);if(!i){const a=ut(r,t);a?e.set(s,a):Object.keys(r).some(l=>l!=="colId"&&l!=="hiddenButton")&&(o+=1);continue}if(i.dateGroupItem!==void 0){o+=1;continue}const u=v(i.filter).map(a=>A(c(a,"val")??""));e.set(s,{...u.length===0?{}:{values:u},...x(i,"blank")===!0?{blanks:!0}:{}})}return{columns:e,unread:o}}function ct(n,t=[]){const e=d(n?.table),o=U(c(e,"ref")??""),r=c(e,"displayName")??c(e,"name");if(!o||r===void 0)return;const s=d(e?.tableStyleInfo),i=d(e?.autoFilter);return{name:r,ref:o,headers:y(e,"headerRowCount")??1,totals:y(e,"totalsRowCount")??0,columns:v(d(e?.tableColumns)?.tableColumn).map(u=>({name:A(c(u,"name")??"").trim(),calculated:u.calculatedColumnFormula!==void 0})),style:c(s,"name")??"none",options:{...x(s,"showRowStripes")===!1?{banded_rows:!1}:{},...x(s,"showColumnStripes")===!0?{banded_columns:!0}:{},...x(s,"showFirstColumn")===!0?{first_column:!0}:{},...x(s,"showLastColumn")===!0?{last_column:!0}:{}},...i?{filter:Ee(i,t)}:{}}}function ie(n){const t=n.trim();if(t==="")return;const e=/^"((?:[^"]|"")*)"$/u.exec(t);if(e)return(e[1]??"").replaceAll('""','"');const o=Number(t);if(!Number.isNaN(o))return o;const r=re(t,!0);return r.ok?be(r.node):void 0}const Oe=n=>n!==void 0&&Pe.includes(n);function ae(n){const t=c(n,"type")??"num",e=c(n,"val")??(n.f===void 0?void 0:N(n.f)),o=e===void 0?void 0:ie(e);return{at:t,...o===void 0?{}:{value:o}}}const ft=_e,ht=n=>{const t=n.formula??n.f;return(Array.isArray(t)?t:t===void 0?[]:[t]).map(N)};function pt(n,t,e,o){const r=c(n,"type")??"",s={range:t,...x(n,"stopIfTrue")===!0?{stop:!0}:{}},i={...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline!==!1},...e.strike===void 0?{}:{strike:e.strike},...e.color===void 0?{}:{color:e.color},...typeof e.fill=="string"?{fill:e.fill}:{},...e.border===void 0?{}:{border:e.border},...e.format===void 0?{}:{format:e.format}},u=ht(n);switch(r){case"cellIs":{const a=c(n,"operator"),l=u.flatMap(f=>{const g=ie(f);return g===void 0?[]:[g]});return!Oe(a)||l.length===0?`a cellIs rule of ${a??"no operator"}`:{...s,...i,type:"cellIs",operator:a,formula:l}}case"containsText":case"notContainsText":case"beginsWith":case"endsWith":{const a=c(n,"text");return a===void 0?`a ${r} rule with no text`:{...s,...i,type:"containsText",...r==="containsText"?{}:{operator:r==="notContainsText"?"notContains":r},text:A(a)}}case"duplicateValues":case"uniqueValues":return{...s,...i,type:r};case"top10":return{...s,...i,type:"top10",rank:y(n,"rank")??10,...x(n,"percent")===!0?{percent:!0}:{},...x(n,"bottom")===!0?{bottom:!0}:{}};case"aboveAverage":return y(n,"stdDev")!==void 0?"an above or below average rule by standard deviations":{...s,...i,type:"aboveAverage",...x(n,"aboveAverage")===!1?{below:!0}:{},...x(n,"equalAverage")===!0?{equal:!0}:{}};case"expression":{const a=u[0]===void 0?void 0:re(u[0],!0);return a?.ok?{...s,...i,type:"expression",formula:be(a.node)}:"an expression rule that cannot be read"}case"dataBar":{const a=d(n.dataBar),l=P(d(a?.color??a?.fillColor),o),[f,g]=v(a?.cfvo).map(ae);return l===void 0?"a data bar with no colour":{...s,type:"dataBar",color:l,...f&&f.at!=="min"?{min:f}:{},...g&&g.at!=="max"?{max:g}:{},...x(a,"showValue")===!1?{show:!1}:{}}}case"colorScale":{const a=d(n.colorScale),l=v(a?.cfvo).map(ae),f=v(a?.color).map(m=>P(m,o)),g=l.flatMap((m,w)=>{const p=f[w];return p===void 0?[]:[{...m,color:p}]});return g.length<2?"a colour scale with too few stops":{...s,type:"colorScale",stops:g.slice(0,3)}}case"iconSet":{const a=d(n.iconSet),l=c(a,"iconSet")??"3TrafficLights1";if(!ft.includes(l))return`the icon set ${l}`;if(a?.cfIcon!==void 0)return"an icon set of icons chosen one by one";const f=v(a?.cfvo).map(ae);return{...s,type:"iconSet",icons:l,...f.length>=3?{stops:f.slice(0,5)}:{},...x(a,"reverse")===!0?{reverse:!0}:{},...x(a,"showValue")===!1?{show:!1}:{}}}default:return`a ${r} rule`}}const Ae={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}"},Ne=(n,t)=>v(d(n.extLst)?.ext).find(e=>c(e,"uri")?.toUpperCase()===t.toUpperCase());function mt(n,t,e){const o=[],r=[],s=new Set,i=(a,l,f)=>{const g=pt(a,l,f,e);typeof g=="string"?r.push(`${g} on ${l}`):o.push({priority:y(a,"priority")??0,rule:g})};for(const a of v(n.conditionalFormatting)){const l=c(a,"sqref")??"";if(!oe(l)){r.push(`a rule on ${l}`);continue}for(const f of v(a.cfRule)){const g=N(d(d(f.extLst)?.ext)?.id);g!==""&&s.add(g.toUpperCase());const m=y(f,"dxfId");i(f,l,m===void 0?{}:t[m]??{})}}const u=d(Ne(n,Ae.conditional)?.conditionalFormattings);for(const a of v(u?.conditionalFormatting)){const l=N(a.sqref).trim();for(const f of v(a.cfRule)){if(s.has((c(f,"id")??"").toUpperCase())){const m=gt(d(f.dataBar));m!==void 0&&r.push(`a data bar's ${m} on ${l}`);continue}if(!oe(l)){r.push(`a rule on ${l}`);continue}const g=d(f.dxf);i(f,l,g?Te(g,e):{})}}return{rules:o.sort((a,l)=>a.priority-l.priority).map(a=>a.rule),unread:r}}function gt(n){if(!n)return;const t=[];x(n,"gradient")===!1&&t.push("solid fill"),x(n,"border")===!0&&t.push("border");const e=c(n,"axisPosition");e!==void 0&&e!=="automatic"&&t.push(`axis ${e}`),x(n,"negativeBarColorSameAsPositive")===!0&&t.push("negative bars in its colour");const o=c(d(n.negativeFillColor),"rgb");return o!==void 0&&o.toUpperCase()!=="FFFF0000"&&t.push("negative bars' colour"),c(n,"direction")==="rightToLeft"&&t.push("right to left"),t.length===0?void 0:t.join(", ")}const bt=je;function Ie(n,t,e,o){const r=c(n,"type")??"none";if(r==="none"&&c(n,"prompt")===void 0)return;if(!bt.includes(r)||!oe(t))return`a ${r} rule on ${t}`;const s=/^"((?:[^"]|"")*)"$/u.exec(e.trim()),i=r==="list"&&s?(s[1]??"").replaceAll('""','"').split(","):void 0,u=[e,o].flatMap(p=>{const $=ie(p);return $===void 0?[]:[$]}),a=c(n,"operator"),l=p=>Object.fromEntries(Object.entries(p).filter(([,$])=>$!==void 0)),f=l({title:c(n,"promptTitle"),message:c(n,"prompt")}),g=l({style:c(n,"errorStyle"),title:c(n,"errorTitle"),message:c(n,"error")}),m=x(n,"showInputMessage")!==!0,w=x(n,"showErrorMessage")!==!0;return{range:t,type:r,...Oe(a)&&a!=="between"?{operator:a}:{},...i?{values:i}:{formula:u},...x(n,"allowBlank")===!0?{}:{blank:!1},...x(n,"showDropDown")===!0?{dropdown:!1}:{},...m||Object.keys(f).length>0?{prompt:{...f,...m?{show:!1}:{}}}:{},...w||Object.keys(g).length>0?{error:{...g,...w?{show:!1}:{}}}:{}}}function wt(n){const t=[],e=[],o=s=>{typeof s=="string"?e.push(s):s&&t.push(s)};for(const s of v(d(n.dataValidations)?.dataValidation))o(Ie(s,c(s,"sqref")??"",N(s.formula1),N(s.formula2)));const r=d(Ne(n,Ae.validations)?.dataValidations);for(const s of v(r?.dataValidation))o(Ie(s,N(s.sqref).trim(),N(d(s.formula1)?.f),N(d(s.formula2)?.f)));return{rules:t,unread:e}}function xt(n){const t=/^(-?\d{4,})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u.exec(n)??/^()()()(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u.exec(n);if(!t)return;const e=t[1]==="",o=e?1899:Number(t[1]),r=e?12:Number(t[2]),s=e?30:Number(t[3]),i=Number(t[4]??0)*3600+Number(t[5]??0)*60+Number(t[6]??0)+Number(t[7]??0),u=new Date(Date.UTC(o,r-1,s)+i*1e3);if(Number.isNaN(u.getTime()))return;const a=Ue(u);return e?a-Math.floor(a):a}let de;function Fe(n,t){const e=n.row-t.row,o=n.col-t.col;Object.defineProperty(n,"node",{get:()=>(de?.cell!==n&&(de={cell:n,node:ze(t.node,e,o)}),de.node),set:r=>{Object.defineProperty(n,"node",{value:r,writable:!0,enumerable:!0,configurable:!0})},enumerable:!0,configurable:!0}),n.key=t.key}function le(n,t,e){const o=re(n,t,e);return o.ok?{node:o.node}:{unread:n}}function yt(n){const t=U(n.ref??""),e=l=>{if(l===void 0||l==="")return"";const f=he(l.replaceAll("$",""));return f?`$${ne(f.col)}$${String(f.row+1)}`:void 0},o=e(n.r1),r=e(n.r2);if(!t||o===void 0||o===""||r===void 0)return;const s=n.dt2D==="1"||n.dt2D==="true",i=n.dtr==="1"||n.dtr==="true",u=s?`${o},${r}`:i?`${o},`:`,${o}`,a=He(`=TABLE(${u})`);return a.ok?{ref:t,node:a.node}:void 0}function $t(n){for(const{ref:t,node:e}of n.dataTables){const o=new Set;for(const r of n.cells)r.row<t.top||r.row>t.bottom||r.col<t.left||r.col>t.right||(r.node=e,Reflect.deleteProperty(r,"unread"),o.add(`${String(r.row)}:${String(r.col)}`));for(let r=t.top;r<=t.bottom;r++)for(let s=t.left;s<=t.right;s++)o.has(`${String(r)}:${String(s)}`)||n.cells.push({row:r,col:s,value:void 0,node:e,style:0})}}class vt{cells=[];rows=[];dataTables=[];outlined=!1;rest=[];xml;masters=new Map;above=new Map;left;strings;palette;name;isRangeName;inData=!1;row=-1;nextRow=0;nextCol=0;cell;target;buffer="";skip=0;constructor(t,e,o,r){this.strings=t,this.palette=e,this.name=o,this.isRangeName=r,this.xml=new ye(this),this.xml.capture=this.rest}open(t,e){if(!this.inData){t==="sheetData"&&(this.inData=!0,this.xml.capture=void 0);return}const o=this.cell;if(o){if(this.skip>0){this.skip+=1;return}switch(t){case"v":this.target="v",this.buffer="";return;case"f":o.f={...e,text:""},this.target="f",this.buffer="";return;case"is":o.inline={text:"",runs:new ve};return;case"t":o.inline&&(this.target="t",this.buffer="");return;case"rPh":case"phoneticPr":case"extLst":this.skip=1;return;default:o.inline?.runs.open(t,e);return}}t==="row"?this.openRow(e):t==="c"&&(this.cell={r:e.r,s:e.s,t:e.t,cm:e.cm,v:void 0,f:void 0,inline:void 0})}close(t){if(!this.inData)return;const e=this.cell;if(!e){t==="sheetData"&&(this.inData=!1,this.xml.capture=this.rest);return}if(this.skip>0){this.skip-=1;return}if(t===this.target){t==="v"?e.v=this.buffer:t==="f"&&e.f?e.f.text=this.buffer:e.inline&&(e.inline.text+=this.buffer,e.inline.runs.text(this.buffer)),this.target=void 0;return}e.inline?.runs.close(t),t==="c"&&(this.cell=void 0,this.readCell(e))}text(t){this.target!==void 0&&this.skip===0&&(this.buffer+=t)}openRow(t){const e=t.r,o=e===void 0?void 0:Number(e);if(o!==void 0&&Number.isInteger(o)&&o>Y)throw new Error(`${this.name} has a row ${e??""}, and ${GRID_END}.`);const r=o!==void 0&&Number.isInteger(o)&&o>0?o-1:this.nextRow;this.row=r,this.nextRow=r+1,this.nextCol=0;const s={row:r},i=t.ht===void 0?void 0:Number(t.ht),u=f=>f==="1"||f==="true";i!==void 0&&Number.isFinite(i)&&u(t.customHeight)&&(s.height=Ye(i)),u(t.hidden)&&(s.hidden=!0);const a=t.s===void 0?void 0:Number(t.s);a!==void 0&&a!==0&&u(t.customFormat)&&(s.style=a);const l=Number(t.outlineLevel??0);l>0&&(s.level=Math.min(7,l),this.outlined=!0),Object.keys(s).length>1&&this.rows.push(s)}value(t,e){const o=t.t??"n";if(o==="inlineStr"){const s=t.inline;if(!s)return{value:t.v===void 0?"":A(t.v)};const{runs:i}=s.runs;return{value:A(s.text),...i.length>0?{runs:ke(i,this.palette)}:{}}}const r=t.v;if(r===void 0)return{value:void 0};switch(o){case"s":{const s=this.strings[Number(r)];return s?{value:s.text,...s.runs?{runs:s.runs}:{}}:{value:""}}case"str":return{value:A(r)};case"b":return{value:r.trim()==="1"||r.trim()==="true"};case"e":return{value:Ve(r.trim())??Be.VALUE};case"d":return{value:xt(r.trim())??r};default:{if(r.trim()==="")return{value:void 0};const s=Number(r);if(Number.isNaN(s))throw new Error(`${e} says it holds a number and holds ${r}.`);return{value:s}}}}formula(t,e,o,r){const s=t.f;if(s===void 0)return;const i=s.t??"normal",u=s.text;if(i==="dataTable"){const w=yt(s);w?this.dataTables.push(w):r.unread=`a data table's {=TABLE(${s.r1??""})}`;return}if(i==="array"){Object.assign(r,le(u,!0,this.isRangeName));const w=U(s.ref??"");w&&(r.array=w),t.cm!==void 0&&(r.dynamic=!0);return}if(i==="shared"){const w=s.si??"";if(u!==""){const $=le(u,!1,this.isRangeName),k=$.node?ge($.node,e,o):"";this.masters.set(w,{node:$.node,unread:$.unread,row:e,col:o,key:k}),Object.assign(r,$),$.node&&(r.key=k);return}const p=this.masters.get(w);if(!p){r.unread=`a shared formula of a group that has no first cell (${w})`;return}p.node?Fe(r,{node:p.node,row:p.row,col:p.col,key:p.key}):p.unread!==void 0&&(r.unread=p.unread);return}if(u==="")return;const a=le(u,!1,this.isRangeName);if(!a.node){Object.assign(r,a);return}const l=ge(a.node,e,o),f=this.left?.row===e?this.left:void 0,g=[this.above.get(o),f].find(w=>w?.key===l);g?Fe(r,g):(r.node=a.node,r.key=l);const m=g??{node:a.node,row:e,col:o,key:l};this.above.set(o,m),this.left=m}readCell(t){const e=t.r===void 0?void 0:et(t.r,this.name),o=e?.row??this.row,r=e?.col??this.nextCol;if(r>=J)throw new Error(`${this.name} has a cell past its last column, and ${GRID_END}.`);this.nextCol=r+1;const s=t.r??te({row:o,col:r}),{value:i,runs:u}=this.value(t,s),a={row:o,col:r,value:i,style:t.s===void 0?0:Number(t.s)||0};u&&(a.runs=u),this.formula(t,o,r,a),this.cells.push(a)}}function kt(n,t){const e=[],o=f=>e.push(`${n}: ${f}`),r=v(d(t.hyperlinks)?.hyperlink).filter(f=>c(f,"tooltip")!==void 0);r.length>0&&o(`the tooltips of ${W(r.length,"link")} (${placesLine(r.map(f=>c(f,"ref")??""))})`),t.sortState!==void 0&&o("a sort");const s=d(t.sheetProtection);x(s,"sheet")===!0&&(c(s,"password")!==void 0||c(s,"hashValue")!==void 0)&&o("its protection's password: it is protected with none"),t.protectedRanges!==void 0&&o("protected ranges");const i=d(t.headerFooter);(i?.evenHeader!==void 0||i?.evenFooter!==void 0||i?.firstHeader!==void 0||i?.firstFooter!==void 0)&&o("its print header and footer of the first or even pages");const u=d(t.printOptions);u&&["gridLines","headings","horizontalCentered","verticalCentered"].some(f=>x(u,f)===!0)&&o("its print options (gridlines, headings, centring)"),t.oleObjects!==void 0&&o("embedded objects"),t.controls!==void 0&&o("form controls"),t.dataConsolidate!==void 0&&o("a consolidation"),t.customSheetViews!==void 0&&o("custom views"),v(d(t.sheetViews)?.sheetView).some(f=>c(d(f.pane),"state")==="split")&&o("a split, not frozen, window");const l=JSON.stringify(t.extLst??"");return l.includes("sparklineGroups")&&o("sparklines"),l.includes("slicerList")&&o("slicers"),e}function St(n,t){const e=[],o=(s,i,u)=>{const a=n.count(s);a>0&&e.push(W(a,i,u))};n.has("xl/vbaProject.bin")&&e.push("VBA macros"),o(/^xl\/pivotTables\/pivotTable\d*\.xml$/u,"pivot table"),o(/^xl\/chartsheets\/[^/]+\.xml$/u,"chart sheet"),o(/^xl\/dialogsheets\/[^/]+\.xml$/u,"dialog sheet"),o(/^xl\/macrosheets\/[^/]+\.xml$/u,"macro sheet");const r=n.names.filter(s=>s.startsWith("xl/media/")&&!t.has(s)).length;return r>0&&e.push(W(r,"image")),o(/^xl\/embeddings\//u,"embedded object"),o(/^xl\/slicers\/[^/]+\.xml$/u,"slicer part"),o(/^xl\/timelines\/[^/]+\.xml$/u,"timeline part"),o(/^xl\/ctrlProps\/[^/]+\.xml$/u,"form control"),o(/^xl\/activeX\/[^/]+\.xml$/u,"ActiveX control"),o(/^xl\/queryTables\/[^/]+\.xml$/u,"query table"),n.has("xl/connections.xml")&&e.push("data connections"),n.names.some(s=>s.startsWith("xl/richData/"))&&e.push("rich values (data types, pictures in cells)"),n.names.some(s=>/^customXml\/item\d+\.xml$/u.test(s)&&(n.text(s)??"").includes("DataMashup"))&&e.push("Power Query queries"),e}export function readHeaderFooter(n){const t={left:"",center:"",right:""};let e="center",o=new Set;for(let r=0;r<n.length;r++){const s=n[r],i=n[r+1];if(s==="&"&&(i==="L"||i==="C"||i==="R")){e=i==="L"?"left":i==="C"?"center":"right",o=new Set([...o,e]),r+=1;continue}if(s==="&"&&i==="&"){t[e]+="&&",r+=1;continue}t[e]+=s??""}return Object.fromEntries(Object.entries(t).filter(([r,s])=>s!==""||o.has(r)))}const Ct=new Map(Object.entries(De).map(([n,t])=>[t,n]));function Tt(n,t,e){const o={},r=d(n.pageSetup),s=c(r,"orientation");(s==="portrait"||s==="landscape")&&(o.orientation=s);const i=y(r,"paperSize");if(i!==void 0){const k=Ct.get(i);k?o.paper=k:e.push(`${t}: its paper size, Excel's number ${String(i)}`)}x(d(d(n.sheetPr)?.pageSetUpPr),"fitToPage")===!0&&(o.fit={width:y(r,"fitToWidth")??1,height:y(r,"fitToHeight")??1});const u=y(r,"scale");u!==void 0&&u!==100&&u>=10&&u<=400&&(o.scale=Math.round(u));const a=k=>v(d(n[k])?.brk).filter(h=>x(h,"man")===!0).map(h=>y(h,"id")).filter(h=>h!==void 0&&h>0).sort((h,C)=>h-C),l=a("rowBreaks").map(k=>k+1),f=a("colBreaks").map(k=>ne(k));(l.length>0||f.length>0)&&(o.breaks={...l.length>0?{rows:l}:{},...f.length>0?{cols:f}:{}});const g=d(n.pageMargins),m={};for(const k of Object.keys(fe)){const h=y(g,k);h!==void 0&&h!==fe[k]&&(m[k]=h)}Object.keys(m).length>0&&(o.margins=m);const w=d(n.headerFooter),p=N(w?.oddHeader),$=N(w?.oddFooter);return p!==""&&(o.header=readHeaderFooter(A(p))),$!==""&&(o.footer=readHeaderFooter(A($))),o}function Et(n,t,e,o,r){const s=n.rels(t),i=new Map;for(const a of s.filter(l=>l.type==="comments")){const l=d(n.xml(a.target)?.comments),f=d(l?.authors)?.author,g=(Array.isArray(f)?f:f===void 0?[]:[f]).map(m=>A(N(m)));for(const m of v(d(l?.commentList)?.comment)){const w=c(m,"ref")??"",p=d(m.text),$=v(p?.r),k=A($.length>0?$.map(C=>N(C.t)).join(""):N(p?.t)),h=g[y(m,"authorId")??-1];w!==""&&k!==""&&i.set(w,{ref:w,text:k,...h===void 0||h===""?{}:{author:h}})}}let u=0;for(const a of s.filter(l=>l.type==="threadedComment")){const l=d(n.xml(a.target)?.ThreadedComments),f=new Map;for(const g of v(l?.threadedComment)){const m=c(g,"ref")??"",w=A(N(g.text)),p=f.get(m)??{texts:[]};if(p.texts.length===0){const $=o.get(c(g,"personId")??"");$!==void 0&&(p.author=$)}p.texts.push(w),f.set(m,p)}for(const[g,m]of f)u+=1,i.set(g,{ref:g,text:m.texts.join(`
|
|
3
|
-
`),...m.author===void 0?{}:{author:m.author}})}return
|
|
2
|
+
import{heightToPixels as _e,widthToPixels as Pe}from"../units.js";import{OFFICE_COLORS as me,THEME_NAMES as De,THEMES as je,ZipLimitError as ze}from"@allyhub/formats";import{SHEET_FILTER_OPERATORS as He,SHEET_ICONS as Be,SHEET_MARGINS as ge,SHEET_OPERATORS as Ue,SHEET_PAPERS as Ve,SHEET_VALIDATIONS as We}from"@allyhub/formats";import{MAX_COLUMNS as K,MAX_ROWS as ee,cellName as te,columnLetter as ne,readAddress as be,readArea as W,readAreas as oe}from"../address.js";import{ITERATION_DEFAULTS as we}from"../calc/engine.js";import{SHEET_CHART_DEFAULTS as xe}from"../chart.js";import{moveFormula as qe,relativeKey as ye}from"../formula/move.js";import{parseFormula as Xe}from"../formula/parse.js";import{printFormula as ke}from"../formula/print.js";import{ERR as Ge,errorOf as Ze,serialOfDate as Je}from"../values.js";import{OFFICE_THEME as Ke,colorOf as D,paletteOf as $e,themeColors as Qe}from"./colors.js";import{chartAnchors as Ye,readChart as et}from"./charts.js";import{isRangeText as tt,readFileFormula as re}from"./formula.js";import{BUILTIN_FORMATS as ve}from"./numfmt.js";import{XmlStream as Se}from"./sax.js";import{attr as u,flag as w,numberAttr as k,readXml as Ce,readXstring as F,tag as d,tags as y,textOf as T}from"./xml.js";import{RunsCollector as Ee,readRuns as Te}from"./runs.js";import{ZipIn as nt}from"./zip.js";function ot(n){const t=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],e=Object.fromEntries(t.map((s,i)=>[s,`#${(n[i]??"000000").toUpperCase()}`])),o=s=>t.every(i=>s[i]?.toUpperCase()===e[i]);if(o(me))return;for(const s of De)if(o(je[s].colors))return s;const r={};for(const s of t)me[s]!==e[s]&&(r[s]=e[s]);return{colors:r}}function rt(n){if(w(n,"iterate")!==!0)return;const t=k(n,"iterateCount"),e=k(n,"iterateDelta"),o=t===void 0?void 0:Math.min(32767,Math.max(1,Math.round(t))),r=e===void 0?void 0:Math.max(0,e),s={...o===void 0||o===we.max_iterations?{}:{max_iterations:o},...r===void 0||r===we.max_change?{}:{max_change:r}};return Object.keys(s).length>0?s:!0}const Oe=7,st=n=>Math.floor((256*n+Math.floor(128/Oe))/256*Oe),se=5;export function placesLine(n){const t=n.slice(0,se).join(", ");return n.length>se?`${t} and ${String(n.length-se)} more`:t}const q=(n,t,e=`${t}s`)=>`${String(n)} ${n===1?t:e}`;export const GRID_END=`Excel's grid ends at ${ne(K-1)}${String(ee)} (${ee.toLocaleString("en-US")} rows, ${K.toLocaleString("en-US")} columns)`;function it(n,t){let e=0,o=0;const r=n.length;for(;e<r;e++){const i=n.charCodeAt(e),c=i>=65&&i<=90,a=i>=97&&i<=122;if(!c&&!a)break;o=o*26+(c?i-64:i-96)}if(e===0||e===r)return;let s=0;for(let i=e;i<r;i++){const c=n.charCodeAt(i);if(c<48||c>57)return;s=s*10+c-48}if(s!==0){if(e>3||o>K||s>ee)throw new Error(`${t} has a cell at ${n}, and ${GRID_END}.`);return{row:s-1,col:o-1}}}class at{zip;constructor(t,e){this.zip=new nt(t,e)}get names(){return this.zip.names}has(t){return this.zip.has(t)}text(t){return this.zip.text(t)}bytes(t){return this.zip.bytesOf(t)}xml(t){const e=this.text(t);return e===void 0?void 0:Ce(e)}stream(t,e){const o=this.zip.streamText(t,r=>{e.push(r)});return o&&e.end(),o}rels(t){const e=t.lastIndexOf("/"),o=`${t.slice(0,e+1)}_rels/${t.slice(e+1)}.rels`,r=this.xml(o);return y(d(r?.Relationships)?.Relationship).map(s=>{const i=u(s,"Type")??"",c=u(s,"Target")??"",a=u(s,"TargetMode")==="External";return{id:u(s,"Id")??"",type:i.slice(i.lastIndexOf("/")+1),target:a?c:dt(t,c),external:a}})}count(t){return this.names.filter(e=>t.test(e)).length}}function dt(n,t){if(t.startsWith("/"))return t.slice(1);const e=n.split("/").slice(0,-1);for(const o of t.split("/"))o===".."?e.pop():o!=="."&&e.push(o);return e.join("/")}function ct(n,t,e){const o=[];if(t===void 0)return o;let r,s=0,i=!1;const c={open(a,l){if(a==="si"){r={text:"",runs:new Ee};return}if(r){if(s>0||a==="rPh"||a==="phoneticPr"||a==="extLst"){s+=1;return}r.runs.open(a,l)||a==="t"&&(i=!0)}},close(a){if(s>0){s-=1;return}if(a==="si"){if(r){const{runs:l}=r.runs;o.push({text:F(r.text),...l.length>0?{runs:Te(l,e)}:{}})}r=void 0;return}r?.runs.close(a),a==="t"&&(i=!1)},text(a){r&&i&&s===0&&(r.text+=a,r.runs.text(a))}};return n.stream(t,new Se(c)),o}function X(n,t){const e=n[t];if(e===void 0)return!1;const o=u(d(e),"val");return o===void 0||o!=="0"&&o!=="false"}const lt=new Set(["double","singleAccounting","doubleAccounting"]);function ut(n,t,e){const o={},r=(a,l)=>u(d(a?.[l]),"val");if(X(n,"b")&&(o.bold=!0),X(n,"i")&&(o.italic=!0),X(n,"strike")&&(o.strike=!0),X(n,"u")){const a=r(n,"u");o.underline=a!==void 0&<.has(a)?a:!0}const s=r(n,"name");s!==void 0&&s!==r(t,"name")&&(o.font=s);const i=r(n,"sz");i!==void 0&&i!==r(t,"sz")&&(o.size=Number(i));const c=D(d(n.color),e);return c!==void 0&&c!==D(d(t?.color),e)&&(o.color=c),o}function ft(n,t){const e=d(n.patternFill),o=u(e,"patternType");if(o===void 0||o==="none")return;const r=D(d(e?.fgColor),t),s=D(d(e?.bgColor),t);return o==="solid"&&r!==void 0?r:{pattern:o,...r===void 0?{}:{color:r},...s===void 0?{}:{background:s}}}function Ae(n,t){const e={};for(const o of["left","right","top","bottom"]){const r=d(n[o]),s=u(r,"style");if(s===void 0||s==="none")continue;const i=D(d(r?.color),t);e[o]={style:s,...i===void 0?{}:{color:i}}}return Object.keys(e).length===0?void 0:e}function ht(n){const t={},e=u(n,"horizontal");e!==void 0&&e!=="general"&&(t.align=e);const o=u(n,"vertical");o!==void 0&&o!=="bottom"&&(t.valign=o),w(n,"wrapText")===!0&&(t.wrap=!0),w(n,"shrinkToFit")===!0&&(t.shrink=!0);const r=k(n,"indent");r!==void 0&&r>0&&(t.indent=r);const s=k(n,"textRotation");return s!==void 0&&s>0&&s<=180&&(t.rotation=s),t}function Fe(n,t){const e={},o=d(n.font);if(o){const f=(m,x)=>{o[m]!==void 0&&(e[x]=X(o,m))};f("b","bold"),f("i","italic"),f("strike","strike"),o.u!==void 0&&(e.underline=X(o,"u"));const g=D(d(o.color),t);g!==void 0&&(e.color=g)}const r=d(d(n.fill)?.patternFill),s=D(d(r?.bgColor),t)??D(d(r?.fgColor),t);s!==void 0&&(e.fill=s);const i=d(n.border),c=i&&Ae(i,t);c!==void 0&&(e.border=c);const a=d(n.numFmt),l=u(a,"formatCode")??ve[k(a,"numFmtId")??-1];return a&&l!==void 0&&l!==""&&l!=="General"&&(e.format=l),e}function pt(n,t){const e=d(n?.styleSheet),o=$e(t,e),r=new Map(y(d(e?.numFmts)?.numFmt).map(h=>[k(h,"numFmtId")??-1,u(h,"formatCode")?.replace(/^$/u,"General")??"General"])),s=y(d(e?.fonts)?.font),i=y(d(e?.fills)?.fill),c=y(d(e?.borders)?.border),a=y(d(e?.cellXfs)?.xf),l=s[k(a[0],"fontId")??0],f=new Set;i.some(h=>h.gradientFill!==void 0)&&f.add("gradient fills");const g=y(d(e?.cellStyles)?.cellStyle),m=new Set(a.map(h=>k(h,"xfId")??0)),x=g.filter(h=>k(h,"builtinId")!==0&&m.has(k(h,"xfId")??-1)).map(h=>F(u(h,"name")??"")).filter(h=>h!=="");x.length>0&&f.add(`the names of cell styles (${x.slice(0,5).join(", ")}${x.length>5?", …":""}): their looks are kept`);const p=a.map(h=>{const C={},O=s[k(h,"fontId")??0];O&&(Object.assign(C,ut(O,l,o)),O.vertAlign!==void 0&&f.add("superscript and subscript"));const R=i[k(h,"fillId")??0],L=R&&ft(R,o);L!==void 0&&(C.fill=L);const M=c[k(h,"borderId")??0],j=M&&Ae(M,o);j!==void 0&&(C.border=j),M&&u(d(M.diagonal),"style")!==void 0&&f.add("diagonal borders");const N=d(h.alignment);N&&(Object.assign(C,ht(N)),k(N,"textRotation")===255&&f.add("vertical text"));const z=d(h.protection);w(z,"locked")===!1&&(C.locked=!1),w(z,"hidden")===!0&&(C.hide_formula=!0);const H=k(h,"numFmtId")??0,_=r.get(H)??ve[H];return _!==void 0&&_!=="General"&&(C.format=_),C}),$=u(d(l?.name),"val"),v=u(d(l?.sz),"val");return{looks:p,dxfs:y(d(e?.dxfs)?.dxf).map(h=>Fe(h,o)),font:{...$===void 0?{}:{name:$},...v===void 0?{}:{size:Number(v)}},lost:[...f]}}const mt=n=>{const t=Number(n);return n.trim()!==""&&Number.isFinite(t)?t:n};function gt(n,t){const e=d(n.customFilters);if(e){const i=y(e.customFilter).map(c=>({operator:u(c,"operator")??"equal",value:mt(F(u(c,"val")??""))}));return i.length===0||i.length>2||i.some(c=>!He.includes(c.operator))?void 0:{conditions:i,...i.length===2&&w(e,"and")!==!0?{or:!0}:{}}}const o=d(n.top10);if(o){const i=k(o,"val");return i===void 0||i<=0?void 0:{top:{count:i,...w(o,"percent")===!0?{percent:!0}:{},...w(o,"top")===!1?{bottom:!0}:{}}}}const r=u(d(n.dynamicFilter),"type");if(r==="aboveAverage")return{average:"above"};if(r==="belowAverage")return{average:"below"};const s=d(n.colorFilter);if(s){const i=t[k(s,"dxfId")??-1];return w(s,"cellColor")===!1?i?.color?{color:{font:i.color}}:void 0:typeof i?.fill=="string"?{color:{fill:i.fill}}:void 0}}function Ne(n,t=[]){const e=new Map;let o=0;for(const r of y(n.filterColumn)){const s=k(r,"colId")??0,i=d(r.filters);if(!i){const a=gt(r,t);a?e.set(s,a):Object.keys(r).some(l=>l!=="colId"&&l!=="hiddenButton")&&(o+=1);continue}if(i.dateGroupItem!==void 0){o+=1;continue}const c=y(i.filter).map(a=>F(u(a,"val")??""));e.set(s,{...c.length===0?{}:{values:c},...w(i,"blank")===!0?{blanks:!0}:{}})}return{columns:e,unread:o}}function bt(n,t=[]){const e=d(n?.table),o=W(u(e,"ref")??""),r=u(e,"displayName")??u(e,"name");if(!o||r===void 0)return;const s=d(e?.tableStyleInfo),i=d(e?.autoFilter);return{name:r,ref:o,headers:k(e,"headerRowCount")??1,totals:k(e,"totalsRowCount")??0,columns:y(d(e?.tableColumns)?.tableColumn).map(c=>({name:F(u(c,"name")??"").trim(),calculated:c.calculatedColumnFormula!==void 0})),style:u(s,"name")??"none",options:{...w(s,"showRowStripes")===!1?{banded_rows:!1}:{},...w(s,"showColumnStripes")===!0?{banded_columns:!0}:{},...w(s,"showFirstColumn")===!0?{first_column:!0}:{},...w(s,"showLastColumn")===!0?{last_column:!0}:{}},...i?{filter:Ne(i,t)}:{}}}function ie(n){const t=n.trim();if(t==="")return;const e=/^"((?:[^"]|"")*)"$/u.exec(t);if(e)return(e[1]??"").replaceAll('""','"');const o=Number(t);if(!Number.isNaN(o))return o;const r=re(t,!0);return r.ok?ke(r.node):void 0}const Ie=n=>n!==void 0&&Ue.includes(n);function ae(n){const t=u(n,"type")??"num",e=u(n,"val")??(n.f===void 0?void 0:T(n.f)),o=e===void 0?void 0:ie(e);return{at:t,...o===void 0?{}:{value:o}}}const wt=Be,xt=n=>{const t=n.formula??n.f;return(Array.isArray(t)?t:t===void 0?[]:[t]).map(T)};function yt(n,t,e,o){const r=u(n,"type")??"",s={range:t,...w(n,"stopIfTrue")===!0?{stop:!0}:{}},i={...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline!==!1},...e.strike===void 0?{}:{strike:e.strike},...e.color===void 0?{}:{color:e.color},...typeof e.fill=="string"?{fill:e.fill}:{},...e.border===void 0?{}:{border:e.border},...e.format===void 0?{}:{format:e.format}},c=xt(n);switch(r){case"cellIs":{const a=u(n,"operator"),l=c.flatMap(f=>{const g=ie(f);return g===void 0?[]:[g]});return!Ie(a)||l.length===0?`a cellIs rule of ${a??"no operator"}`:{...s,...i,type:"cellIs",operator:a,formula:l}}case"containsText":case"notContainsText":case"beginsWith":case"endsWith":{const a=u(n,"text");return a===void 0?`a ${r} rule with no text`:{...s,...i,type:"containsText",...r==="containsText"?{}:{operator:r==="notContainsText"?"notContains":r},text:F(a)}}case"duplicateValues":case"uniqueValues":return{...s,...i,type:r};case"top10":return{...s,...i,type:"top10",rank:k(n,"rank")??10,...w(n,"percent")===!0?{percent:!0}:{},...w(n,"bottom")===!0?{bottom:!0}:{}};case"aboveAverage":return k(n,"stdDev")!==void 0?"an above or below average rule by standard deviations":{...s,...i,type:"aboveAverage",...w(n,"aboveAverage")===!1?{below:!0}:{},...w(n,"equalAverage")===!0?{equal:!0}:{}};case"expression":{const a=c[0]===void 0?void 0:re(c[0],!0);return a?.ok?{...s,...i,type:"expression",formula:ke(a.node)}:"an expression rule that cannot be read"}case"dataBar":{const a=d(n.dataBar),l=D(d(a?.color??a?.fillColor),o),[f,g]=y(a?.cfvo).map(ae);return l===void 0?"a data bar with no colour":{...s,type:"dataBar",color:l,...f&&f.at!=="min"?{min:f}:{},...g&&g.at!=="max"?{max:g}:{},...w(a,"showValue")===!1?{show:!1}:{}}}case"colorScale":{const a=d(n.colorScale),l=y(a?.cfvo).map(ae),f=y(a?.color).map(m=>D(m,o)),g=l.flatMap((m,x)=>{const p=f[x];return p===void 0?[]:[{...m,color:p}]});return g.length<2?"a colour scale with too few stops":{...s,type:"colorScale",stops:g.slice(0,3)}}case"iconSet":{const a=d(n.iconSet),l=u(a,"iconSet")??"3TrafficLights1";if(!wt.includes(l))return`the icon set ${l}`;if(a?.cfIcon!==void 0)return"an icon set of icons chosen one by one";const f=y(a?.cfvo).map(ae);return{...s,type:"iconSet",icons:l,...f.length>=3?{stops:f.slice(0,5)}:{},...w(a,"reverse")===!0?{reverse:!0}:{},...w(a,"showValue")===!1?{show:!1}:{}}}default:return`a ${r} rule`}}const de={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}",sparklines:"{05C60535-1F16-4fd2-B633-F4F36F0B64E0}"};function kt(n){const t=[],e=d(ce(n,de.sparklines)?.sparklineGroups);for(const o of y(e?.sparklineGroup)){const r=u(o,"type"),s=c=>{const a=u(d(o[c]),"rgb");return a!==void 0&&/^[0-9A-Fa-f]{8}$/u.test(a)?`#${a.slice(2).toUpperCase()}`:void 0},i={...r==="column"?{type:"column"}:r==="stacked"?{type:"win_loss"}:{},...s("colorSeries")===void 0?{}:{color:s("colorSeries")},...s("colorMarkers")===void 0?{}:{marks:s("colorMarkers")}};for(const c of["markers","high","low","first","last","negative"])w(o,c)===!0&&(i[c]=!0);for(const c of y(d(o.sparklines)?.sparkline)){const a=T(c.f).trim(),l=T(c.sqref).trim();a!==""&&l!==""&&t.push({at:l,data:a,...i})}}return t}const ce=(n,t)=>y(d(n.extLst)?.ext).find(e=>u(e,"uri")?.toUpperCase()===t.toUpperCase());function $t(n,t,e){const o=[],r=[],s=new Set,i=(a,l,f)=>{const g=yt(a,l,f,e);typeof g=="string"?r.push(`${g} on ${l}`):o.push({priority:k(a,"priority")??0,rule:g})};for(const a of y(n.conditionalFormatting)){const l=u(a,"sqref")??"";if(!oe(l)){r.push(`a rule on ${l}`);continue}for(const f of y(a.cfRule)){const g=T(d(d(f.extLst)?.ext)?.id);g!==""&&s.add(g.toUpperCase());const m=k(f,"dxfId");i(f,l,m===void 0?{}:t[m]??{})}}const c=d(ce(n,de.conditional)?.conditionalFormattings);for(const a of y(c?.conditionalFormatting)){const l=T(a.sqref).trim();for(const f of y(a.cfRule)){if(s.has((u(f,"id")??"").toUpperCase())){const m=vt(d(f.dataBar));m!==void 0&&r.push(`a data bar's ${m} on ${l}`);continue}if(!oe(l)){r.push(`a rule on ${l}`);continue}const g=d(f.dxf);i(f,l,g?Fe(g,e):{})}}return{rules:o.sort((a,l)=>a.priority-l.priority).map(a=>a.rule),unread:r}}function vt(n){if(!n)return;const t=[];w(n,"gradient")===!1&&t.push("solid fill"),w(n,"border")===!0&&t.push("border");const e=u(n,"axisPosition");e!==void 0&&e!=="automatic"&&t.push(`axis ${e}`),w(n,"negativeBarColorSameAsPositive")===!0&&t.push("negative bars in its colour");const o=u(d(n.negativeFillColor),"rgb");return o!==void 0&&o.toUpperCase()!=="FFFF0000"&&t.push("negative bars' colour"),u(n,"direction")==="rightToLeft"&&t.push("right to left"),t.length===0?void 0:t.join(", ")}const St=We;function Le(n,t,e,o){const r=u(n,"type")??"none";if(r==="none"&&u(n,"prompt")===void 0)return;if(!St.includes(r)||!oe(t))return`a ${r} rule on ${t}`;const s=/^"((?:[^"]|"")*)"$/u.exec(e.trim()),i=r==="list"&&s?(s[1]??"").replaceAll('""','"').split(","):void 0,c=[e,o].flatMap(p=>{const $=ie(p);return $===void 0?[]:[$]}),a=u(n,"operator"),l=p=>Object.fromEntries(Object.entries(p).filter(([,$])=>$!==void 0)),f=l({title:u(n,"promptTitle"),message:u(n,"prompt")}),g=l({style:u(n,"errorStyle"),title:u(n,"errorTitle"),message:u(n,"error")}),m=w(n,"showInputMessage")!==!0,x=w(n,"showErrorMessage")!==!0;return{range:t,type:r,...Ie(a)&&a!=="between"?{operator:a}:{},...i?{values:i}:{formula:c},...w(n,"allowBlank")===!0?{}:{blank:!1},...w(n,"showDropDown")===!0?{dropdown:!1}:{},...m||Object.keys(f).length>0?{prompt:{...f,...m?{show:!1}:{}}}:{},...x||Object.keys(g).length>0?{error:{...g,...x?{show:!1}:{}}}:{}}}function Ct(n){const t=[],e=[],o=s=>{typeof s=="string"?e.push(s):s&&t.push(s)};for(const s of y(d(n.dataValidations)?.dataValidation))o(Le(s,u(s,"sqref")??"",T(s.formula1),T(s.formula2)));const r=d(ce(n,de.validations)?.dataValidations);for(const s of y(r?.dataValidation))o(Le(s,T(s.sqref).trim(),T(d(s.formula1)?.f),T(d(s.formula2)?.f)));return{rules:t,unread:e}}function Et(n){const t=/^(-?\d{4,})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u.exec(n)??/^()()()(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u.exec(n);if(!t)return;const e=t[1]==="",o=e?1899:Number(t[1]),r=e?12:Number(t[2]),s=e?30:Number(t[3]),i=Number(t[4]??0)*3600+Number(t[5]??0)*60+Number(t[6]??0)+Number(t[7]??0),c=new Date(Date.UTC(o,r-1,s)+i*1e3);if(Number.isNaN(c.getTime()))return;const a=Je(c);return e?a-Math.floor(a):a}let le;function Re(n,t){const e=n.row-t.row,o=n.col-t.col;Object.defineProperty(n,"node",{get:()=>(le?.cell!==n&&(le={cell:n,node:qe(t.node,e,o)}),le.node),set:r=>{Object.defineProperty(n,"node",{value:r,writable:!0,enumerable:!0,configurable:!0})},enumerable:!0,configurable:!0}),n.key=t.key}function ue(n,t,e){const o=re(n,t,e);return o.ok?{node:o.node}:{unread:n}}function Tt(n){const t=W(n.ref??""),e=l=>{if(l===void 0||l==="")return"";const f=be(l.replaceAll("$",""));return f?`$${ne(f.col)}$${String(f.row+1)}`:void 0},o=e(n.r1),r=e(n.r2);if(!t||o===void 0||o===""||r===void 0)return;const s=n.dt2D==="1"||n.dt2D==="true",i=n.dtr==="1"||n.dtr==="true",c=s?`${o},${r}`:i?`${o},`:`,${o}`,a=Xe(`=TABLE(${c})`);return a.ok?{ref:t,node:a.node}:void 0}function Ot(n){for(const{ref:t,node:e}of n.dataTables){const o=new Set;for(const r of n.cells)r.row<t.top||r.row>t.bottom||r.col<t.left||r.col>t.right||(r.node=e,Reflect.deleteProperty(r,"unread"),o.add(`${String(r.row)}:${String(r.col)}`));for(let r=t.top;r<=t.bottom;r++)for(let s=t.left;s<=t.right;s++)o.has(`${String(r)}:${String(s)}`)||n.cells.push({row:r,col:s,value:void 0,node:e,style:0})}}class At{cells=[];rows=[];dataTables=[];outlined=!1;rest=[];xml;masters=new Map;above=new Map;left;strings;palette;name;isRangeName;inData=!1;row=-1;nextRow=0;nextCol=0;cell;target;buffer="";skip=0;constructor(t,e,o,r){this.strings=t,this.palette=e,this.name=o,this.isRangeName=r,this.xml=new Se(this),this.xml.capture=this.rest}open(t,e){if(!this.inData){t==="sheetData"&&(this.inData=!0,this.xml.capture=void 0);return}const o=this.cell;if(o){if(this.skip>0){this.skip+=1;return}switch(t){case"v":this.target="v",this.buffer="";return;case"f":o.f={...e,text:""},this.target="f",this.buffer="";return;case"is":o.inline={text:"",runs:new Ee};return;case"t":o.inline&&(this.target="t",this.buffer="");return;case"rPh":case"phoneticPr":case"extLst":this.skip=1;return;default:o.inline?.runs.open(t,e);return}}t==="row"?this.openRow(e):t==="c"&&(this.cell={r:e.r,s:e.s,t:e.t,cm:e.cm,v:void 0,f:void 0,inline:void 0})}close(t){if(!this.inData)return;const e=this.cell;if(!e){t==="sheetData"&&(this.inData=!1,this.xml.capture=this.rest);return}if(this.skip>0){this.skip-=1;return}if(t===this.target){t==="v"?e.v=this.buffer:t==="f"&&e.f?e.f.text=this.buffer:e.inline&&(e.inline.text+=this.buffer,e.inline.runs.text(this.buffer)),this.target=void 0;return}e.inline?.runs.close(t),t==="c"&&(this.cell=void 0,this.readCell(e))}text(t){this.target!==void 0&&this.skip===0&&(this.buffer+=t)}openRow(t){const e=t.r,o=e===void 0?void 0:Number(e);if(o!==void 0&&Number.isInteger(o)&&o>ee)throw new Error(`${this.name} has a row ${e??""}, and ${GRID_END}.`);const r=o!==void 0&&Number.isInteger(o)&&o>0?o-1:this.nextRow;this.row=r,this.nextRow=r+1,this.nextCol=0;const s={row:r},i=t.ht===void 0?void 0:Number(t.ht),c=f=>f==="1"||f==="true";i!==void 0&&Number.isFinite(i)&&c(t.customHeight)&&(s.height=_e(i)),c(t.hidden)&&(s.hidden=!0);const a=t.s===void 0?void 0:Number(t.s);a!==void 0&&a!==0&&c(t.customFormat)&&(s.style=a);const l=Number(t.outlineLevel??0);l>0&&(s.level=Math.min(7,l),this.outlined=!0),Object.keys(s).length>1&&this.rows.push(s)}value(t,e){const o=t.t??"n";if(o==="inlineStr"){const s=t.inline;if(!s)return{value:t.v===void 0?"":F(t.v)};const{runs:i}=s.runs;return{value:F(s.text),...i.length>0?{runs:Te(i,this.palette)}:{}}}const r=t.v;if(r===void 0)return{value:void 0};switch(o){case"s":{const s=this.strings[Number(r)];return s?{value:s.text,...s.runs?{runs:s.runs}:{}}:{value:""}}case"str":return{value:F(r)};case"b":return{value:r.trim()==="1"||r.trim()==="true"};case"e":return{value:Ze(r.trim())??Ge.VALUE};case"d":return{value:Et(r.trim())??r};default:{if(r.trim()==="")return{value:void 0};const s=Number(r);if(Number.isNaN(s))throw new Error(`${e} says it holds a number and holds ${r}.`);return{value:s}}}}formula(t,e,o,r){const s=t.f;if(s===void 0)return;const i=s.t??"normal",c=s.text;if(i==="dataTable"){const x=Tt(s);x?this.dataTables.push(x):r.unread=`a data table's {=TABLE(${s.r1??""})}`;return}if(i==="array"){Object.assign(r,ue(c,!0,this.isRangeName));const x=W(s.ref??"");x&&(r.array=x),t.cm!==void 0&&(r.dynamic=!0);return}if(i==="shared"){const x=s.si??"";if(c!==""){const $=ue(c,!1,this.isRangeName),v=$.node?ye($.node,e,o):"";this.masters.set(x,{node:$.node,unread:$.unread,row:e,col:o,key:v}),Object.assign(r,$),$.node&&(r.key=v);return}const p=this.masters.get(x);if(!p){r.unread=`a shared formula of a group that has no first cell (${x})`;return}p.node?Re(r,{node:p.node,row:p.row,col:p.col,key:p.key}):p.unread!==void 0&&(r.unread=p.unread);return}if(c==="")return;const a=ue(c,!1,this.isRangeName);if(!a.node){Object.assign(r,a);return}const l=ye(a.node,e,o),f=this.left?.row===e?this.left:void 0,g=[this.above.get(o),f].find(x=>x?.key===l);g?Re(r,g):(r.node=a.node,r.key=l);const m=g??{node:a.node,row:e,col:o,key:l};this.above.set(o,m),this.left=m}readCell(t){const e=t.r===void 0?void 0:it(t.r,this.name),o=e?.row??this.row,r=e?.col??this.nextCol;if(r>=K)throw new Error(`${this.name} has a cell past its last column, and ${GRID_END}.`);this.nextCol=r+1;const s=t.r??te({row:o,col:r}),{value:i,runs:c}=this.value(t,s),a={row:o,col:r,value:i,style:t.s===void 0?0:Number(t.s)||0};c&&(a.runs=c),this.formula(t,o,r,a),this.cells.push(a)}}function Ft(n,t){const e=[],o=f=>e.push(`${n}: ${f}`),r=y(d(t.hyperlinks)?.hyperlink).filter(f=>u(f,"tooltip")!==void 0);r.length>0&&o(`the tooltips of ${q(r.length,"link")} (${placesLine(r.map(f=>u(f,"ref")??""))})`),t.sortState!==void 0&&o("a sort");const s=d(t.sheetProtection);w(s,"sheet")===!0&&(u(s,"password")!==void 0||u(s,"hashValue")!==void 0)&&o("its protection's password: it is protected with none"),t.protectedRanges!==void 0&&o("protected ranges");const i=d(t.headerFooter);(i?.evenHeader!==void 0||i?.evenFooter!==void 0||i?.firstHeader!==void 0||i?.firstFooter!==void 0)&&o("its print header and footer of the first or even pages");const c=d(t.printOptions);return c&&["gridLines","headings","horizontalCentered","verticalCentered"].some(f=>w(c,f)===!0)&&o("its print options (gridlines, headings, centring)"),t.oleObjects!==void 0&&o("embedded objects"),t.controls!==void 0&&o("form controls"),t.dataConsolidate!==void 0&&o("a consolidation"),t.customSheetViews!==void 0&&o("custom views"),y(d(t.sheetViews)?.sheetView).some(f=>u(d(f.pane),"state")==="split")&&o("a split, not frozen, window"),JSON.stringify(t.extLst??"").includes("slicerList")&&o("slicers"),e}function Nt(n,t){const e=[],o=(s,i,c)=>{const a=n.count(s);a>0&&e.push(q(a,i,c))};n.has("xl/vbaProject.bin")&&e.push("VBA macros"),o(/^xl\/pivotTables\/pivotTable\d*\.xml$/u,"pivot table"),o(/^xl\/chartsheets\/[^/]+\.xml$/u,"chart sheet"),o(/^xl\/dialogsheets\/[^/]+\.xml$/u,"dialog sheet"),o(/^xl\/macrosheets\/[^/]+\.xml$/u,"macro sheet");const r=n.names.filter(s=>s.startsWith("xl/media/")&&!t.has(s)).length;return r>0&&e.push(q(r,"image")),o(/^xl\/embeddings\//u,"embedded object"),o(/^xl\/slicers\/[^/]+\.xml$/u,"slicer part"),o(/^xl\/timelines\/[^/]+\.xml$/u,"timeline part"),o(/^xl\/ctrlProps\/[^/]+\.xml$/u,"form control"),o(/^xl\/activeX\/[^/]+\.xml$/u,"ActiveX control"),o(/^xl\/queryTables\/[^/]+\.xml$/u,"query table"),n.has("xl/connections.xml")&&e.push("data connections"),n.names.some(s=>s.startsWith("xl/richData/"))&&e.push("rich values (data types, pictures in cells)"),n.names.some(s=>/^customXml\/item\d+\.xml$/u.test(s)&&(n.text(s)??"").includes("DataMashup"))&&e.push("Power Query queries"),e}export function readHeaderFooter(n){const t={left:"",center:"",right:""};let e="center",o=new Set;for(let r=0;r<n.length;r++){const s=n[r],i=n[r+1];if(s==="&"&&(i==="L"||i==="C"||i==="R")){e=i==="L"?"left":i==="C"?"center":"right",o=new Set([...o,e]),r+=1;continue}if(s==="&"&&i==="&"){t[e]+="&&",r+=1;continue}t[e]+=s??""}return Object.fromEntries(Object.entries(t).filter(([r,s])=>s!==""||o.has(r)))}const It=new Map(Object.entries(Ve).map(([n,t])=>[t,n]));function Lt(n,t,e){const o={},r=d(n.pageSetup),s=u(r,"orientation");(s==="portrait"||s==="landscape")&&(o.orientation=s);const i=k(r,"paperSize");if(i!==void 0){const v=It.get(i);v?o.paper=v:e.push(`${t}: its paper size, Excel's number ${String(i)}`)}w(d(d(n.sheetPr)?.pageSetUpPr),"fitToPage")===!0&&(o.fit={width:k(r,"fitToWidth")??1,height:k(r,"fitToHeight")??1});const c=k(r,"scale");c!==void 0&&c!==100&&c>=10&&c<=400&&(o.scale=Math.round(c));const a=v=>y(d(n[v])?.brk).filter(h=>w(h,"man")===!0).map(h=>k(h,"id")).filter(h=>h!==void 0&&h>0).sort((h,C)=>h-C),l=a("rowBreaks").map(v=>v+1),f=a("colBreaks").map(v=>ne(v));(l.length>0||f.length>0)&&(o.breaks={...l.length>0?{rows:l}:{},...f.length>0?{cols:f}:{}});const g=d(n.pageMargins),m={};for(const v of Object.keys(ge)){const h=k(g,v);h!==void 0&&h!==ge[v]&&(m[v]=h)}Object.keys(m).length>0&&(o.margins=m);const x=d(n.headerFooter),p=T(x?.oddHeader),$=T(x?.oddFooter);return p!==""&&(o.header=readHeaderFooter(F(p))),$!==""&&(o.footer=readHeaderFooter(F($))),o}function Rt(n,t,e,o,r){const s=n.rels(t),i=new Map;for(const a of s.filter(l=>l.type==="comments")){const l=d(n.xml(a.target)?.comments),f=d(l?.authors)?.author,g=(Array.isArray(f)?f:f===void 0?[]:[f]).map(m=>F(T(m)));for(const m of y(d(l?.commentList)?.comment)){const x=u(m,"ref")??"",p=d(m.text),$=y(p?.r),v=F($.length>0?$.map(C=>T(C.t)).join(""):T(p?.t)),h=g[k(m,"authorId")??-1];x!==""&&v!==""&&i.set(x,{ref:x,text:v,...h===void 0||h===""?{}:{author:h}})}}let c=0;for(const a of s.filter(l=>l.type==="threadedComment")){const l=d(n.xml(a.target)?.ThreadedComments),f=new Map;for(const g of y(l?.threadedComment)){const m=u(g,"ref")??"",x=F(T(g.text)),p=f.get(m)??{texts:[]};if(p.texts.length===0){const $=o.get(u(g,"personId")??"");$!==void 0&&(p.author=$)}p.texts.push(x),f.set(m,p)}for(const[g,m]of f)c+=1,i.set(g,{ref:g,text:m.texts.join(`
|
|
3
|
+
`),...m.author===void 0?{}:{author:m.author}})}return c>0&&r.push(`${e}: ${q(c,"threaded comment")}, kept as notes, replies after the first line`),[...i.values()]}function Mt(n,t,e,o,r,s,i,c,a,l,f,g){const m=new At(r,s,e,a);if(!n.stream(t,m.xml))throw new Error(`${t} is not in the file.`);Ot(m);const x=Ce(m.rest.join("")),p=d(x.worksheet);if(!p)throw new Error(`${t} is not a worksheet.`);const $=y(d(p.cols)?.col).map(S=>{const E=k(S,"width"),P=k(S,"style"),A=k(S,"outlineLevel")??0,J=(k(S,"min")??1)-1,fe=(k(S,"max")??1)-1;if(fe>=K)throw new Error(`${e} sets a column past its last, and ${GRID_END}.`);const he=w(S,"customWidth"),pe=E===void 0?void 0:st(E);return{min:J,max:fe,...pe!==void 0&&(he===!0||he===void 0&&pe!==Me)&&E!==void 0?{width:Pe(E)}:{},...w(S,"hidden")===!0?{hidden:!0}:{},...P===void 0||P===0?{}:{style:P},...A>0?{level:Math.min(7,A)}:{}}}),v=y(d(p.mergeCells)?.mergeCell).flatMap(S=>{const E=W(u(S,"ref")??"");return E?[E]:[]}),h=y(d(p.sheetViews)?.sheetView)[0],C=d(h?.pane);let O;const R=u(C,"state");if(R==="frozen"||R==="frozenSplit"){const S=be(u(h,"topLeftCell")??"A1")??{row:0,col:0};O={row:S.row+(k(C,"ySplit")??0),col:S.col+(k(C,"xSplit")??0)}}const L=n.rels(t),M=L.filter(S=>S.type==="table").flatMap(S=>{const E=bt(n.xml(S.target),i);return E?[E]:[]}),j=D(d(d(p.sheetPr)?.tabColor),s),N=Ft(e,p),z=$t(p,i,s),H=Ct(p);for(const S of z.unread)N.push(`${e}: a conditional format, ${S}`);for(const S of H.unread)N.push(`${e}: a data validation, ${S}`);const _=d(p.autoFilter),Q=W(u(_,"ref")??""),B=_&&Q?{ref:Q,...Ne(_,i)}:void 0;B&&B.unread>0&&N.push(`${e}: ${q(B.unread,"filter")} by condition on ${u(_,"ref")??""}, its rows left as they were hidden`);const{charts:G,pictures:Y}=Dt(n,t,e,$,m.rows,N,l,f,g),V={},b=new Map(L.map(S=>[S.id,S]));for(const S of y(d(p.hyperlinks)?.hyperlink)){const E=u(S,"ref");if(E===void 0)continue;const P=u(S,"location"),A=u(S,"id"),J=A===void 0?void 0:b.get(A)?.target;J!==void 0?V[E]=P===void 0?J:`${J}#${P}`:P!==void 0&&(V[E]=`#${P}`)}const I=d(p.sheetProtection),U=Lt(p,e,N),Z=kt(p);return{sheet:{name:e,state:o,cells:m.cells,merges:v,...O?{freeze:O}:{},...u(h,"showGridLines")==="0"?{gridlines:!1}:{},...j===void 0?{}:{tab:j},columns:$,rows:m.rows,tables:M,conditional:z.rules,validations:H.rules,...Z.length>0?{sparklines:Z}:{},scenarios:y(d(p.scenarios)?.scenario).map(S=>({name:u(S,"name")??"",cells:y(S.inputCells).map(E=>({at:u(E,"r")??"",value:u(E,"val")??""}))})),...B?{filter:B}:{},charts:G,links:V,notes:Rt(n,t,e,c,N),pictures:Y,...w(I,"sheet")===!0?{protect:!0}:{},...Object.keys(U).length>0?{print:U}:{},..._t(d(d(p.sheetPr)?.outlinePr))},lost:N}}function _t(n){const t=w(n,"summaryBelow")===!1,e=w(n,"summaryRight")===!1;return t||e?{outline:{...t?{summary_below:!1}:{},...e?{summary_right:!1}:{}}}:{}}const Me=64,Pt=20;function Dt(n,t,e,o,r,s,i,c,a){const l=p=>o.find($=>p>=$.min&&p<=$.max)?.width??Me,f=new Map(r.map(p=>[p.row,p.height])),g=p=>f.get(p)??Pt,m=[],x=[];for(const p of n.rels(t).filter($=>$.type==="drawing")){const $=Ye(n.xml(p.target),l,g),v=n.rels(p.target);for(const h of $.anchors){const C=v.find(M=>M.id===h.id),O=te(h.at);if(h.width<=0||h.height<=0){s.push(`${e}: the chart at ${O}, of no size`);continue}const R=[],L=et(C?n.xml(C.target):void 0,R,c,a);if(typeof L=="string"){s.push(`${e}: the chart at ${O}, as ${L}`);continue}for(const M of R)s.push(`${e}: the chart at ${O} without its ${M}`);m.push({...L,at:O,...h.x===void 0?{}:{x:h.x},...h.y===void 0?{}:{y:h.y},...h.width===xe.width?{}:{width:h.width},...h.height===xe.height?{}:{height:h.height}})}for(const h of $.pictures){const C=v.find(L=>L.id===h.id),O=C&&!C.external?n.bytes(C.target):void 0;if(!C||!O){s.push(`${e}: the picture at ${te(h.at)}, whose image is not in the file`);continue}i.add(C.target);const R=C.target.slice(C.target.lastIndexOf(".")+1).toLowerCase();x.push({row:h.at.row,col:h.at.col,...h.x===void 0?{}:{x:h.x},...h.y===void 0?{}:{y:h.y},width:h.width,height:h.height,...h.name===void 0?{}:{name:h.name},...h.descr===void 0?{}:{descr:h.descr},bytes:O,type:R})}$.others>0&&s.push(`${e}: ${q($.others,"shape")} of its drawing`)}return{charts:m,pictures:x}}function jt(n,t,e){for(const o of n){if(o.sheet===void 0)continue;const r=t[o.sheet];if(!r)continue;const s=o.text.split(",").map(i=>i.slice(i.lastIndexOf("!")+1).replaceAll("$",""));if(o.name==="_xlnm.Print_Area"){const[i]=s;s.length>1&&e.push(`${r.name}: its print area's ranges after the first`),i!==void 0&&W(i)&&(r.print={...r.print,area:i})}else if(o.name==="_xlnm.Print_Titles")for(const i of s)/^\d+:\d+$/u.test(i)?r.print={...r.print,title_rows:i}:/^[A-Za-z]+:[A-Za-z]+$/u.test(i)&&(r.print={...r.print,title_cols:i})}}export function readXlsx(n,t){let e;try{e=new at(n,t)}catch(b){throw b instanceof ze?b:new Error("It is not a zip file, as an .xlsx file is.")}const o=e.rels(""),r=o.find(b=>b.type==="officeDocument")?.target??"xl/workbook.xml";if(r.endsWith(".bin"))throw new Error("It is a binary workbook (.xlsb): save it as .xlsx.");const s=e.xml(r),i=d(s?.workbook);if(!i)throw new Error("It has no workbook part.");const c=e.rels(r),a=b=>c.find(I=>I.type===b)?.target,l=(()=>{const b=a("theme");return b===void 0?void 0:e.text(b)})(),f=l===void 0?Ke:Qe(l),g=a("styles"),m=g===void 0?void 0:e.xml(g),x=pt(m,f),p=$e(f,d(m?.styleSheet)),$=ct(e,a("sharedStrings"),p),v=[];for(const b of x.lost)v.push(b);const h=d(i.workbookPr),C=rt(d(i.calcPr)),O=ot(f);u(d(i.calcPr),"calcMode")==="manual"&&v.push("manual calculation: it computes as its cells change");const R=d(i.workbookProtection);(w(R,"lockStructure")===!0||w(R,"lockWindows")===!0)&&v.push("the workbook's protection"),i.fileSharing!==void 0&&v.push("its write protection");const L=new Map,M=a("person");if(M!==void 0)for(const b of y(d(e.xml(M)?.personList)?.person))L.set(u(b,"id")??"",F(u(b,"displayName")??""));const j=y(d(i.definedNames)?.definedName).map(b=>{const I=k(b,"localSheetId");return{name:u(b,"name")??"",text:F(T(b)),...I===void 0?{}:{sheet:I},...w(b,"hidden")===!0?{hidden:!0}:{}}}),N=[],z=new Set,H=new Map(c.map(b=>[b.id,b])),_=y(d(i.sheets)?.sheet),Q=new Set(_.filter(b=>H.get(u(b,"id")??"")?.type==="worksheet").map(b=>F(u(b,"name")??"").toLowerCase()));for(const[b,I]of _.entries()){const U=H.get(u(I,"id")??""),Z=F(u(I,"name")??"");if(U?.type!=="worksheet"){U?.type!=="chartsheet"&&U?.type!=="dialogsheet"&&v.push(`${Z}: a sheet of a kind this cannot read`);continue}const S=new Map;for(const A of j)(A.sheet===void 0||A.sheet===b)&&(A.sheet!==void 0||!S.has(A.name.toLowerCase()))&&S.set(A.name.toLowerCase(),tt(A.text));const E=u(I,"state"),P=Mt(e,U.target,Z,E==="hidden"||E==="veryHidden"?E:"visible",$,p,x.dxfs,L,A=>S.get(A.toLowerCase())===!0,z,A=>Q.has(A.toLowerCase()),A=>S.has(A.toLowerCase()));N[b]=P.sheet,v.push(...P.lost)}jt(j,N,v);const B=o.find(b=>b.type==="core-properties")?.target,G=B===void 0?void 0:T(d(e.xml(B)?.coreProperties)?.title).trim(),Y=N.filter(b=>b!==void 0),V=new Map;return N.forEach((b,I)=>{b!==void 0&&V.set(I,Y.indexOf(b))}),{sheets:Y,names:j.flatMap(b=>{if(b.sheet===void 0)return[b];const I=V.get(b.sheet);return I===void 0?[]:[{...b,sheet:I}]}),looks:x.looks,dxfs:x.dxfs,date1904:w(h,"date1904")===!0,font:x.font,...G===void 0||G===""?{}:{title:G},...C===void 0?{}:{iteration:C},...O===void 0?{}:{theme:O},lost:[...Nt(e,z),...v]}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{RUN_FIELDS as
|
|
2
|
+
import{RUN_FIELDS as v,runLook as F}from"../rich.js";import{FIRST_CUSTOM as S,builtinId as X}from"./numfmt.js";import{NS as w,el as n,xstring as N}from"./xml.js";export const DEFAULT_FONT={name:"Calibri",size:11};export function fontName(e){if(e.length<=31)return e;const t=e.split(/[;,]/u)[0]?.trim()??"";return(t===""?e:t).slice(0,31)}const f=e=>`FF${e.slice(1).toUpperCase()}`;class c{items=[];index=new Map;add(t){const i=this.index.get(t);if(i!==void 0)return i;const r=this.items.length;return this.items.push(t),this.index.set(t,r),r}}function p(e){const{underline:t}=e;return n("font",{},e.bold===!0?"<b/>":"",e.italic===!0?"<i/>":"",e.strike===!0?"<strike/>":"",t===!0||t==="single"?"<u/>":t?n("u",{val:t}):"",n("sz",{val:e.size??DEFAULT_FONT.size}),e.color===void 0?n("color",{theme:1}):n("color",{rgb:f(e.color)}),n("name",{val:fontName(e.font??DEFAULT_FONT.name)}),n("family",{val:2}),e.font===void 0?n("scheme",{val:"minor"}):"")}export function runXml(e,t){const i=`<t${/^\s|\s$|\n/u.test(e.text)?' xml:space="preserve"':""}>${N(e.text)}</t>`;if(v.every(d=>e[d]===void 0))return n("r",{},i);const r={...t,...F(e)},{underline:s}=r;return n("r",{},n("rPr",{},r.bold===!0?"<b/>":"",r.italic===!0?"<i/>":"",r.strike===!0?"<strike/>":"",s===!0||s==="single"?"<u/>":s?n("u",{val:s}):"",e.script===void 0?"":n("vertAlign",{val:e.script}),n("sz",{val:r.size??DEFAULT_FONT.size}),r.color===void 0?n("color",{theme:1}):n("color",{rgb:f(r.color)}),n("rFont",{val:fontName(r.font??DEFAULT_FONT.name)}),n("family",{val:2}),r.font===void 0?n("scheme",{val:"minor"}):""),i)}function g(e){const{pattern:t,color:i,background:r}=typeof e=="string"?{pattern:"solid",color:e,background:void 0}:e;return n("fill",{},n("patternFill",{patternType:t},i===void 0?"":n("fgColor",{rgb:f(i)}),r===void 0?t==="solid"?n("bgColor",{indexed:64}):"":n("bgColor",{rgb:f(r)})))}function h(e,t){return t?n(e,{style:t.style},t.color===void 0?n("color",{auto:1}):n("color",{rgb:f(t.color)})):n(e)}function b(e){return n("border",{},h("left",e.left),h("right",e.right),h("top",e.top),h("bottom",e.bottom),n("diagonal"))}function x(e,t="dxf",i){const{underline:r}=e,s=[e.bold===void 0?"":n("b",{val:e.bold}),e.italic===void 0?"":n("i",{val:e.italic}),e.strike===void 0?"":n("strike",{val:e.strike}),r===!0?"<u/>":"",e.color===void 0?"":n("color",{rgb:f(e.color)})].join(""),{fill:d,border:l}=e;return n(t,{},s===""?"":n("font",{},s),e.format===void 0||i===void 0?"":n("numFmt",{numFmtId:i,formatCode:e.format}),typeof d=="string"?n("fill",{},n("patternFill",{},n("bgColor",{rgb:f(d)}))):"",l?b(l):"")}const T=e=>e<0?90-e:e;function I(e){const t={horizontal:e.align,vertical:e.valign,textRotation:e.rotation===void 0?void 0:T(e.rotation),wrapText:e.wrap===!0?!0:void 0,indent:e.indent,shrinkToFit:e.shrink===!0?!0:void 0};return Object.values(t).every(i=>i===void 0)?"":n("alignment",t)}function z(e){const t={locked:e.locked===!1?!1:void 0,hidden:e.hide_formula===!0?!0:void 0};return t.locked===void 0&&t.hidden===void 0?"":n("protection",t)}export class Styles{fonts=new c;styleXfs=[n("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0})];styleNames=[n("cellStyle",{name:"Normal",xfId:0,builtinId:0})];byStyle=new Map;fills=new c;borders=new c;formats=new Map;xfs=new c;byLook=new Map;dxfs=new c;named;constructor(t){this.named=t,this.fonts.add(p({})),this.fills.add(n("fill",{},n("patternFill",{patternType:"none"}))),this.fills.add(n("fill",{},n("patternFill",{patternType:"gray125"}))),this.borders.add(n("border",{},n("left"),n("right"),n("top"),n("bottom"),n("diagonal"))),this.xfs.add(n("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}))}format(t){if(t===void 0)return 0;const i=X(t);if(i!==void 0)return i;let r=this.formats.get(t);return r===void 0&&(r=S+this.formats.size,this.formats.set(t,r)),r}styleXf(t){if(t===void 0||!this.named)return 0;const i=this.named(t);if(!i||i.name==="Normal")return 0;const r=this.byStyle.get(i.name);if(r!==void 0)return r;const{look:s}=i,d=this.format(s.format),l=this.fonts.add(p(s)),a=s.fill===void 0?0:this.fills.add(g(s.fill)),u=s.border===void 0?0:this.borders.add(b(s.border)),m=I(s),o=this.styleXfs.length;return this.styleXfs.push(n("xf",{numFmtId:d,fontId:l,fillId:a,borderId:u,applyNumberFormat:d===0?!1:void 0,applyFill:a===0?!1:void 0,applyBorder:u===0?!1:void 0,applyAlignment:m===""?!1:void 0},m)),this.styleNames.push(n("cellStyle",{name:i.name,xfId:o,builtinId:i.builtinId})),this.byStyle.set(i.name,o),o}xf(t){const i=JSON.stringify(t),r=this.byLook.get(i);if(r!==void 0)return r;const s=this.styleXf(t.style),d=this.format(t.format),l=this.fonts.add(p(t)),a=t.fill===void 0?0:this.fills.add(g(t.fill)),u=t.border===void 0?0:this.borders.add(b(t.border)),m=I(t),o=z(t),y=this.xfs.add(n("xf",{numFmtId:d,fontId:l,fillId:a,borderId:u,xfId:s,applyNumberFormat:d===0?void 0:!0,applyFont:l===0?void 0:!0,applyFill:a===0?void 0:!0,applyBorder:u===0?void 0:!0,applyAlignment:m===""?void 0:!0,applyProtection:o===""?void 0:!0},m,o));return this.byLook.set(i,y),y}dxf(t){return this.dxfs.add(x(t,"dxf",this.format(t.format)))}dxfXml(t,i){return x(t,i,this.format(t.format))}xml(){const t=(r,s)=>n(r,{count:s.length},s.join("")),i=[...this.formats].map(([r,s])=>n("numFmt",{numFmtId:s,formatCode:r}));return n("styleSheet",{xmlns:w.main},i.length>0?t("numFmts",i):"",t("fonts",this.fonts.items),t("fills",this.fills.items),t("borders",this.borders.items),t("cellStyleXfs",this.styleXfs),t("cellXfs",this.xfs.items),t("cellStyles",this.styleNames),this.dxfs.items.length===0?n("dxfs",{count:0}):t("dxfs",this.dxfs.items),n("tableStyles",{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}))}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{NS as
|
|
2
|
+
import{OFFICE_COLORS as i}from"@allyhub/formats";import{NS as r,el as e}from"./xml.js";const c=(t,a)=>`<a:${t}>${a}</a:${t}>`,s=t=>e("a:srgbClr",{val:t}),F=t=>[c("dk1",t.dk1==="#000000"?e("a:sysClr",{val:"windowText",lastClr:"000000"}):s(t.dk1.slice(1))),c("lt1",t.lt1==="#FFFFFF"?e("a:sysClr",{val:"window",lastClr:"FFFFFF"}):s(t.lt1.slice(1))),...["dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"].map(a=>c(a,s(t[a].slice(1).toUpperCase())))].join(""),f=(t,a)=>`<a:${t}>${e("a:latin",{typeface:a})}${e("a:ea",{typeface:""})}${e("a:cs",{typeface:""})}</a:${t}>`,l=e("a:solidFill",{},e("a:schemeClr",{val:"phClr"})),n=e("a:ln",{w:6350,cap:"flat",cmpd:"sng",algn:"ctr"},l,e("a:prstDash",{val:"solid"})),o=e("a:effectStyle",{},e("a:effectLst"));export const themeXml=(t=i,a="Office")=>e("a:theme",{"xmlns:a":r.drawing,name:a==="Office"?"Office Theme":a},e("a:themeElements",{},e("a:clrScheme",{name:a},F(t)),`<a:fontScheme name="Office">${f("majorFont","Calibri Light")}${f("minorFont","Calibri")}</a:fontScheme>`,e("a:fmtScheme",{name:"Office"},e("a:fillStyleLst",{},l,l,l),e("a:lnStyleLst",{},n,n,n),e("a:effectStyleLst",{},o,o,o),e("a:bgFillStyleLst",{},l,l,l))));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{SHEET_MARGINS as xe,SHEET_NOTE_AUTHOR as ee,SHEET_PAPERS as $e}from"@allyhub/formats";import{MAX_COLUMNS as X,MAX_ROWS as W,cellName as j,columnIndex as te,columnLetter as F,rangeName as M,readAddress as ne,readArea as ye}from"../address.js";import{analyse as be}from"../calc/analyse.js";import{ITERATION_DEFAULTS as se}from"../calc/engine.js";import{parseFormula as ve}from"../formula/parse.js";import{sheetPrefix as q}from"../formula/print.js";import{walk as oe}from"../formula/walk.js";import{fileCells as Se,isPicture as ke,pictureHeight as Ae,pictureSize as re}from"../files.js";import{scenariosByCell as Ee}from"../scenario.js";import{CellError as P,readTyped as Te}from"../values.js";import{FormulaCell as Ce,runsText as _e}from"../workbook.js";import{chartPart as Re,drawingPart as Me}from"./charts.js";import{fileFormula as V,needsArray as G}from"./formula.js";import{GRID_END as Y}from"./read.js";import{Styles as Le,runXml as je}from"./styles.js";import{THEME_XML as Ie}from"./theme.js";import{HEAD as E,NS as T,el as r,xstring as y}from"./xml.js";import{ZipOut as Fe}from"./zip.js";const C={comments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",sheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",styles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",strings:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",table:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",metadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",drawing:"application/vnd.openxmlformats-officedocument.drawing+xml",chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"},k=`${T.rel}/`,ie="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",ae="http://schemas.microsoft.com/office/excel/2006/main",Oe=/\.(tiff?|bmp|emf|wmf)$/iu,De={jpg:"jpeg",emf:"x-emf",wmf:"x-wmf"},le={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}"},Ne=191029;export const DEFAULT_TABLE_STYLE="TableStyleMedium2",LISTS_SHEET="AllyHub lists";const Pe=64,Ve=7,ze=l=>Math.min(255,Math.floor(l/Ve*256)/256),Ue=l=>Math.min(409.5,l*3/4),z=32767,He=255,Be=2e5,Xe=r("metadata",{xmlns:T.main,"xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},r("metadataTypes",{count:1},r("metadataType",{name:"XLDAPR",minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1})),r("futureMetadata",{name:"XLDAPR",count:1},r("bk",{},r("extLst",{},r("ext",{uri:"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"},r("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0}))))),r("cellMetadata",{count:1},r("bk",{},r("rc",{t:1,v:0}))));class We{index=new Map;count=0;place(t){this.count+=1;let n=this.index.get(t);return n===void 0&&(n=this.index.size,this.index.set(t,n)),n}of(t){return this.place(`t${t}`)}rich(t){return this.place(`r${t}`)}write(t){t.write(`${E}<sst xmlns="${T.main}" count="${String(this.count)}" uniqueCount="${String(this.index.size)}">`);for(const n of this.index.keys()){if(n.startsWith("r")){t.write(`<si>${n.slice(1)}</si>`);continue}const e=n.slice(1),s=/^\s|\s$|\n/u.test(e);t.write(`<si><t${s?' xml:space="preserve"':""}>${y(e)}</t></si>`)}t.write("</sst>"),t.end()}}function qe(l){let t=!1;return l&&oe(l,n=>{(n.kind==="structured"||n.kind==="ref"&&n.sheet!==void 0)&&(t=!0)}),t}function Ge(l){for(const t in l)if(Object.hasOwn(l,t))return!1;return!0}const Ye=l=>r("x",l).slice(2,-2),Ze="Base case";function Je(l){const t=new Map;for(const s of l.scenarios)for(const o of s.cells)t.set(j(o),o);const n=(s,o)=>r("inputCells",{r:j(s),val:o===null||o instanceof P?"":typeof o=="boolean"?o?"1":"0":String(o)}),e=(s,o)=>r("scenario",{name:s,locked:!0,count:o.length,user:"AllyHub"},o.join(""));return r("scenarios",{current:0,show:0,sqref:[...t.keys()].join(" ")},e(Ze,[...t.values()].map(s=>n(s,s.base))),...l.scenarios.map(s=>e(s.name,s.cells.map(o=>n(o,o.value)))))}function Ke(l,t,n,e){const s=[];let o=0;for(const{row:a,col:c,paths:d,column:f}of Se(l,t)){let h=0;const u=Ae(f);for(const m of d){const g=ke(m)?n?.(m):void 0,w=g&&re(g);if(!g||!w){o+=1;continue}const x=Math.round(w.width/w.height*u);s.push({row:a,col:c,x:h,width:x,height:u,name:m.split("/").pop()??m,path:m,file:`.${w.type==="jpeg"?"jpg":w.type}`,bytes:g}),h+=x+4}}let i=0;for(const a of l.spec.pictures??[]){const c=ne(a.at),d=n?.(a.file);if(!c||!d)continue;const f=re(d),h=f?.type??Oe.exec(a.file)?.[1]?.toLowerCase(),u=a.width!==void 0&&a.height!==void 0?{width:a.width,height:a.height}:void 0,m=f??u;if(h===void 0||m===void 0){i+=1;continue}const g=m.width/m.height,w=a.width??(a.height===void 0?m.width:a.height*g);s.push({row:c.row,col:c.col,x:a.x??0,y:a.y??0,width:Math.round(w),height:Math.round(a.height??w/g),name:a.file.split("/").pop()??a.file,path:a.file,file:`.${h==="jpeg"?"jpg":h==="tif"?"tiff":h}`,bytes:d})}return i>0&&e.push(`${l.name}: ${String(i)} picture${i===1?"":"s"} of a kind a file cannot hold, or with no size given`),o>0&&e.push(`${l.name}: ${String(o)} file${o===1?"":"s"} in a cell, which stay${o===1?"s":""} a name`),s}class Qe{name;columns=[];known=new Map;constructor(t){let n=LISTS_SHEET;for(let e=2;t.sheet(n);e++)n=`${LISTS_SHEET} (${String(e)})`;this.name=n}place(t){const n=JSON.stringify(t);let e=this.known.get(n);e===void 0&&(e=this.columns.length,this.columns.push(t),this.known.set(n,e));const s=F(e);return`${q(this.name)}$${s}$1:$${s}$${String(Math.max(1,t.length))}`}xml(t){const n=[],e=Math.max(0,...this.columns.map(s=>s.length));for(let s=0;s<e;s++){let o=`<row r="${String(s+1)}">`;this.columns.forEach((i,a)=>{const c=i[s];c!==void 0&&(o+=`<c r="${j({row:s,col:a})}" t="s"><v>${String(t.of(c))}</v></c>`)}),n.push(`${o}</row>`)}return`${E}<worksheet xmlns="${T.main}" xmlns:r="${T.rel}"><dimension ref="${M({top:0,left:0,bottom:Math.max(0,e-1),right:Math.max(0,this.columns.length-1)})}"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData>${n.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`}}class et{rows=new Int32Array(1024);cols=new Int32Array(1024);size=0;add(t,n){if(this.size===this.rows.length){const e=new Int32Array(this.size*2);e.set(this.rows),this.rows=e;const s=new Int32Array(this.size*2);s.set(this.cols),this.cols=s}this.rows[this.size]=t,this.cols[this.size]=n,this.size+=1}byRow(){const{size:t}=this;if(t===0)return{start:new Uint32Array(1),cols:new Int32Array(0),top:0,used:void 0};let n=1/0,e=-1,s=1/0,o=-1;for(let d=0;d<t;d++){const f=this.rows[d]??0,h=this.cols[d]??0;f<n&&(n=f),f>e&&(e=f),h<s&&(s=h),h>o&&(o=h)}const i=new Uint32Array(e-n+2);for(let d=0;d<t;d++){const f=(this.rows[d]??0)-n+1;i[f]=(i[f]??0)+1}for(let d=1;d<i.length;d++)i[d]=(i[d]??0)+(i[d-1]??0);const a=i.slice(0,-1),c=new Int32Array(t);for(let d=0;d<t;d++){const f=(this.rows[d]??0)-n,h=a[f]??0;c[h]=this.cols[d]??0,a[f]=h+1}return{start:i,cols:c,top:n,used:{top:n,bottom:e,left:s,right:o}}}}function tt(l,t){if(!l)return!1;let n=!1;const e=t.toLowerCase();return oe(l,s=>{(s.kind==="ref"||s.kind==="name")&&s.sheet!==void 0&&s.sheet.toLowerCase()!==e&&(n=!0)}),n}const nt=(l,t)=>`{00000000-0000-4000-8000-${(l*65536+t).toString(16).toUpperCase().padStart(12,"0")}}`;class st{arrays=!1;sheet;calc;styles;strings;wb;cached;left;lists;index;isTable;isRangeName;hiddenRows;tall;scenarios;drawn;newerRules=[];newerValidations=[];misgiven=new Set;shapes=new Map;groups=new Map;constructor(t,n,e,s,o,i,a,c,d=[],f){this.sheet=t,this.calc=n,this.wb=n.wb,this.styles=e,this.strings=s,this.cached=o,this.left=i,this.lists=a,this.index=c,this.isTable=u=>this.wb.table(u)!==void 0,this.isRangeName=u=>{const m=this.wb.name(u,t)?.formula?.node;return this.isTable(u)||m!==void 0&&G({kind:"unary",op:"-",arg:m})},this.hiddenRows=n.filtered(t),this.scenarios=f,this.drawn=t.charts.length>0||d.length>0;const h=new Map;for(const u of d)u.y===void 0&&h.set(u.row,Math.max(h.get(u.row)??0,u.height));this.tall=h}grid(){const{sheet:t}=this;if(t.lastRow>=W)throw new Error(`${t.name} reaches row ${(t.lastRow+1).toLocaleString("en-US")}, and ${Y}: an Excel file cannot hold it.`);if(t.columnsUsed>X)throw new Error(`${t.name} reaches past column ${F(X-1)}, and ${Y}: an Excel file cannot hold it.`);for(const n of Object.keys(t.spec.rows??{}))if(Number(n)>W)throw new Error(`${t.name} sets row ${n}, and ${Y}: an Excel file cannot hold it.`)}gather(){const{sheet:t}=this,n=new et;for(let e=0;e<t.columnsUsed;e++){const[s,o]=t.span(e,0,Number.MAX_SAFE_INTEGER);for(let i=s;i<=o;i++)(t.at(i,e)!==void 0||t.spillAt(i,e))&&n.add(i,e)}for(const{area:e}of t.styledAreas()){const s=(e.bottom-e.top+1)*(e.right-e.left+1);if(s>Be){this.left.push(`${t.name}!${M(e)}: its look on the cells that hold something, ${String(s)} cells being too many to write empty`);continue}for(let o=e.top;o<=e.bottom;o++)for(let i=e.left;i<=e.right;i++)n.add(o,i)}for(const e of t.keys.keys())n.add(Math.floor(e/16384),e%16384);return n.byRow()}styleOf(t,n){const e=this.sheet.lookAt(t,n);return Ge(e)?void 0:this.styles.xf(e)}held(t,n){return n.length<=z?n:(this.left.push(`${this.sheet.name}!${t} past Excel's ${String(z)} characters, of its ${String(n.length)}`),n.slice(0,z))}value(t,n,e){return e===null?`<c r="${t}"${v(n)}/>`:typeof e=="number"?`<c r="${t}"${v(n)}><v>${String(e)}</v></c>`:typeof e=="boolean"?`<c r="${t}"${v(n)} t="b"><v>${e?"1":"0"}</v></c>`:e instanceof P?he(e)?`<c r="${t}"${v(n)} t="e"><v>${e.code}</v></c>`:`<c r="${t}"${v(n)} t="s"><v>${String(this.strings.of(e.code))}</v></c>`:`<c r="${t}"${v(n)} t="s"><v>${String(this.strings.of(this.held(t,e)))}</v></c>`}dataTable(t,n,e,s){const o=this.value(t,n,s),{shared:i}=e;if(e.row!==i.row||e.col!==i.col)return o;const a=i.node,c=x=>{if(x===void 0||x.kind==="missing")return null;if(!(x.kind!=="ref"||x.sheet!==void 0||!x.row||!x.col))return j({row:x.row.index,col:x.col.index})},d=a?.kind==="call"?a.args:[],f=c(d[0]),h=c(d[1]);if(f===void 0||h===void 0||f===null&&h===null)return this.left.push(`${this.sheet.name}!${t}: a data table whose inputs a file cannot hold, as its values`),o;const m=this.sheet.fills.find(x=>x.shared===i)?.area??{top:e.row,left:e.col,bottom:e.row,right:e.col},g=f!==null&&h!==null?{dt2D:!0,dtr:!0,r1:f,r2:h}:f!==null?{dtr:!0,r1:f}:{dtr:!1,r1:h??""},w=r("f",{t:"dataTable",ref:M(m),...g});return typeof s=="string"?`<c r="${t}"${v(n)} t="str">${w}<v>${y(s)}</v></c>`:o.includes("<v>")?o.replace("<v>",`${w}<v>`):o.replace("/>",`>${w}</c>`)}table(t){return this.sheet.tableAt(t.row,t.col)?.name}formula(t,n,e){const s=this.calc.value(e.sheet,e.row,e.col),{shared:o}=e,{node:i}=o;if(!i)return`<c r="${t}"${v(n)} t="e"><v>#NAME?</v></c>`;if(i.kind==="call"&&i.name==="TABLE"&&i.args.length<=2)return this.dataTable(t,n,e,s);const a=(o.analysis??=be(this.wb,o)).arguments[0];if(a!==void 0)return this.misgiven.has(o)||(this.misgiven.add(o),this.left.push(`${this.sheet.name}!${t}: a formula's value, not the formula, as ${a.name} is given ${String(a.given)} arguments`)),this.value(t,n,s);let c=this.shapes.get(o);c===void 0&&(c=G(i,this.isRangeName),this.shapes.set(o,c));const d=e.array!==void 0||e.blocked!==void 0||c;let f=d?void 0:this.groups.get(o);f?.written===!1&&(e.row!==f.ref.top||e.col!==f.ref.left)&&(f=void 0);let h,u="";if(f?.written===!0)h=`<f t="shared" si="${String(f.si)}"/>`;else{const m=V(e.moved,{table:this.table(e),isTable:this.isTable,array:d});h=f?`<f t="shared" ref="${M(f.ref)}" si="${String(f.si)}">${y(m)}</f>`:`<f>${y(m)}</f>`,f&&(f.written=!0),d&&(h=this.arrayFormula(e,m))}return d&&(this.arrays=!0,u=' cm="1"'),this.cached?s===null||typeof s=="number"?`<c r="${t}"${v(n)}${u}>${h}<v>${String(s??0)}</v></c>`:typeof s=="boolean"?`<c r="${t}"${v(n)} t="b"${u}>${h}<v>${s?"1":"0"}</v></c>`:s instanceof P?he(s)?`<c r="${t}"${v(n)} t="e"${u}>${h}<v>${s.code}</v></c>`:s.code==="#CYCLE!"?`<c r="${t}"${v(n)}${u}>${h}<v>0</v></c>`:`<c r="${t}"${v(n)} t="e"${u}>${h}<v>#VALUE!</v></c>`:`<c r="${t}"${v(n)} t="str"${u}>${h}<v>${y(this.held(t,s))}</v></c>`:`<c r="${t}"${v(n)}${u}>${h}</c>`}arrayFormula(t,n){const e=t.spill??{top:t.row,left:t.col,bottom:t.row,right:t.col};return`<f t="array" ref="${M(e)}">${y(n)}</f>`}shareFormulas(){const t=new Map;for(const e of this.sheet.formulas){const s=t.get(e.shared);if(!s)t.set(e.shared,{area:{top:e.row,bottom:e.row,left:e.col,right:e.col},first:e,n:1});else{const{area:o}=s;e.row<o.top&&(o.top=e.row),e.row>o.bottom&&(o.bottom=e.row),e.col<o.left&&(o.left=e.col),e.col>o.right&&(o.right=e.col),(e.row<s.first.row||e.row===s.first.row&&e.col<s.first.col)&&(s.first=e),s.n+=1}}let n=0;for(const[e,{area:s,first:o,n:i}]of t)i>1&&o.row===s.top&&o.col===s.left&&!qe(e.node)&&(this.groups.set(e,{si:n,ref:s,written:!1}),n+=1)}cell(t,n){const e=j({row:t,col:n}),s=this.styleOf(t,n),o=this.sheet.at(t,n);if(o instanceof Ce)return this.formula(e,s,o);const i=typeof o=="string"?this.sheet.runsAt(t,n):void 0;if(i&&_e(i).length<=z){const a=this.sheet.lookAt(t,n);return`<c r="${e}"${v(s)} t="s"><v>${String(this.strings.rich(i.map(c=>je(c,a)).join("")))}</v></c>`}return o===void 0&&this.cached&&this.sheet.spillAt(t,n)?this.value(e,s,this.calc.value(this.sheet,t,n)):this.value(e,s,o??null)}columns(){const{sheet:t}=this,{spec:n}=t,e=new Map,s=new Map;for(const c of t.tables)for(const d of c.columns)d.spec?.width!==void 0&&s.set(c.at.col+d.index,d.spec.width);const o=new Set(s.keys()),i=new Map;for(const[c,d]of Object.entries(n.columns??{})){const f=te(c);f!==void 0&&(i.set(f,d),o.add(f))}for(const c of[...i.keys()])for(const d of[-1,1])c+d>=0&&this.collapsedColumn(c+d)&&o.add(c+d);for(const c of o){const d=i.get(c),f=d?.width??s.get(c),h=ue(d);e.set(c,r("col",{min:c+1,max:c+1,width:ze(f??Pe),style:h===void 0?void 0:this.styles.xf(h),hidden:d?.hidden===!0?!0:void 0,customWidth:f===void 0?void 0:!0,outlineLevel:d?.level,collapsed:this.collapsedColumn(c)?!0:void 0}))}const a=[...e.keys()].sort((c,d)=>c-d).map(c=>e.get(c)??"");return a.length===0?"":`<cols>${a.join("")}</cols>`}rowAttrs(t){const n=this.sheet.spec.rows?.[String(t+1)],e=ue(n),s=n?.height??this.tall.get(t);return Ye({r:t+1,s:e===void 0?void 0:this.styles.xf(e),customFormat:e===void 0?void 0:!0,ht:s===void 0?void 0:Ue(s),customHeight:s===void 0?void 0:!0,hidden:n?.hidden===!0||this.hiddenRows.has(t)?!0:void 0,outlineLevel:n?.level,collapsed:this.collapsedRow(t)?!0:void 0})}collapsedRow(t){const n=this.sheet.spec.rows??{},e=a=>n[String(a+1)]?.level??0,s=a=>n[String(a+1)]?.hidden===!0||this.hiddenRows.has(a),o=this.sheet.spec.outline?.summary_below===!1?1:-1,i=t+o;return i>=0&&e(i)>e(t)&&s(i)}collapsedColumn(t){const n=this.sheet.spec.columns??{},e=i=>n[F(i)],s=this.sheet.spec.outline?.summary_right===!1?1:-1,o=t+s;return o>=0&&(e(o)?.level??0)>(e(t)?.level??0)&&e(o)?.hidden===!0}rows(t,n){const{sheet:e}=this,s=new Set(this.hiddenRows);for(const f of Object.keys(e.spec.rows??{})){const h=Number(f)-1;s.add(h);for(const u of[-1,1])h+u>=0&&this.collapsedRow(h+u)&&s.add(h+u)}const{start:o,cols:i,top:a}=n;let c=n.used?a:1/0,d=n.used?n.used.bottom:-1;for(const f of s)f<c&&(c=f),f>d&&(d=f);for(let f=Math.max(0,c);f<=d;f++){const h=f-a,u=h>=0&&h<o.length-1?o[h]??0:0,m=h>=0&&h<o.length-1?o[h+1]??0:0;if(u===m&&!s.has(f))continue;if(u===m){t.write(`<row${this.rowAttrs(f)}/>`);continue}const g=i.subarray(u,m).sort();let w=`<row${this.rowAttrs(f)}>`,x=-1;for(const R of g)R!==x&&(x=R,w+=this.cell(f,R));t.write(`${w}</row>`)}}view(t){const{freeze:n}=this.sheet;let e="";if(n&&(n.row>0||n.col>0)){const s=n.row>0&&n.col>0?"bottomRight":n.row>0?"bottomLeft":"topRight";e=r("pane",{xSplit:n.col>0?n.col:void 0,ySplit:n.row>0?n.row:void 0,topLeftCell:j(n),activePane:s,state:"frozen"})}return r("sheetViews",{},r("sheetView",{showGridLines:this.sheet.spec.gridlines===!1?!1:void 0,tabSelected:t?!0:void 0,workbookViewId:0},e))}write(t,n,e){const{sheet:s}=this;this.grid();const o=this.gather();this.shareFormulas();const i=s.tables.map((A,S)=>r("tablePart",{"r:id":`rId${String(S+1)}`})),{print:a}=s.spec,c=a?.fit,d=Object.keys(s.spec.notes??{}).length>0,f=s.spec.outline,h=f?.summary_below===!1||f?.summary_right===!1?r("outlinePr",{summaryBelow:f.summary_below===!1?!1:void 0,summaryRight:f.summary_right===!1?!1:void 0}):"";t.write(`${E}<worksheet xmlns="${T.main}" xmlns:r="${T.rel}">`+(s.spec.tab===void 0&&c===void 0&&h===""?"":r("sheetPr",{},s.spec.tab===void 0?"":r("tabColor",{rgb:`FF${s.spec.tab.slice(1).toUpperCase()}`}),h,c===void 0?"":r("pageSetUpPr",{fitToPage:!0})))+r("dimension",{ref:o.used?M(o.used):"A1"})+this.view(n)+r("sheetFormatPr",{defaultRowHeight:15,outlineLevelRow:ce(s.spec.rows),outlineLevelCol:ce(s.spec.columns)})+this.columns()+"<sheetData>"),this.rows(t,o);const u=i.length+1+(this.drawn?1:0)+(d?2:0);let m=0;const g=Object.entries(s.spec.links??{}).map(([A,S])=>S.startsWith("#")?r("hyperlink",{ref:A,location:S.slice(1)}):r("hyperlink",{ref:A,"r:id":`rId${String(u+m++)}`})),w=s.merges.map(A=>r("mergeCell",{ref:M(A)})),x=s.conditions.map((A,S)=>this.condition(A,S+1)).join(""),R=this.validations();return t.write("</sheetData>"+(s.spec.protect===!0?r("sheetProtection",{sheet:!0,objects:!0,scenarios:!0}):"")+(this.scenarios?Je(this.scenarios):"")+this.sheetFilter()+(w.length>0?r("mergeCells",{count:w.length},w.join("")):"")+x+R+(g.length>0?r("hyperlinks",{},g.join("")):"")+r("pageMargins",{...xe,...a?.margins})+(a?.orientation!==void 0||a?.paper!==void 0||a?.scale!==void 0||c!==void 0?r("pageSetup",{paperSize:a?.paper===void 0?void 0:$e[a.paper],scale:a?.scale,fitToWidth:c?.width,fitToHeight:c?.height,orientation:a?.orientation}):"")+(a?.header||a?.footer?r("headerFooter",{},a.header?r("oddHeader",{},y(de(a.header))):"",a.footer?r("oddFooter",{},y(de(a.footer))):""):"")+pt(a?.breaks)+(this.drawn?r("drawing",{"r:id":`rId${String(i.length+1)}`}):"")+(d?r("legacyDrawing",{"r:id":`rId${String(i.length+(this.drawn?2:1))}`}):"")+(i.length>0?r("tableParts",{count:i.length},i.join("")):"")+this.extensions()+"</worksheet>"),t.end(),s.tables.map((A,S)=>this.tableXml(A,e+S))}extensions(){const t=[];return this.newerRules.length>0&&t.push(r("ext",{uri:le.conditional,"xmlns:x14":ie},r("x14:conditionalFormattings",{},this.newerRules.join("")))),this.newerValidations.length>0&&t.push(r("ext",{uri:le.validations,"xmlns:x14":ie},r("x14:dataValidations",{count:this.newerValidations.length,"xmlns:xm":ae},this.newerValidations.join("")))),t.length===0?"":r("extLst",{},t.join(""))}bound(t){if(t===void 0)return"";if(typeof t=="number")return String(t);if(!t.startsWith("=")){const e=Te(t);return typeof e.value=="number"&&e.formula===void 0?String(e.value):`"${t.replaceAll('"','""')}"`}const n=ve(t);return n.ok?V(n.node,{isTable:this.isTable,array:!0}):t.slice(1)}cfvo(t,n){const e=t.value===void 0?void 0:typeof t.value=="number"?String(t.value):this.bound(t.value);return n?r("x14:cfvo",{type:t.at},e===void 0?"":r("xm:f",{},y(e))):r("cfvo",{type:t.at,val:e})}crosses(t){return t.some(n=>tt(n?.node,this.sheet.name))}condition(t,n){const{spec:e}=t,s=e.range,o=e.type!=="dataBar"&&this.crosses(t.formulas),i=(h,u,...m)=>{if(!o){const g=Object.keys(u).length===0?void 0:this.styles.dxf(u);return r("conditionalFormatting",{sqref:s},r("cfRule",{...h,dxfId:g,priority:n,stopIfTrue:e.stop===!0?!0:void 0},...m))}return this.newerRules.push(r("x14:conditionalFormatting",{"xmlns:xm":ae},r("x14:cfRule",{...h,priority:n,stopIfTrue:e.stop===!0?!0:void 0,id:nt(this.index,n)},...m.map(g=>g.replace(/^<formula>(.*)<\/formula>$/su,"<xm:f>$1</xm:f>")),Object.keys(u).length===0?"":this.styles.dxfXml(u,"x14:dxf")),r("xm:sqref",{},s))),""},a=at(e),c=t.areas[0],d=c?j({row:c.top,col:c.left}):"A1",f=h=>r("formula",{},y(h));switch(e.type){case"cellIs":return i({type:"cellIs",operator:e.operator},a,...e.formula.map(h=>f(this.bound(h))));case"containsText":{const h=e.operator??"contains",u=`"${e.text.replaceAll('"','""')}"`,m=h==="contains"?`NOT(ISERROR(SEARCH(${u},${d})))`:h==="notContains"?`ISERROR(SEARCH(${u},${d}))`:h==="beginsWith"?`LEFT(${d},LEN(${u}))=${u}`:`RIGHT(${d},LEN(${u}))=${u}`;return i({type:h==="contains"?"containsText":h==="notContains"?"notContainsText":h,operator:h==="contains"?"containsText":h,text:e.text},a,f(m))}case"duplicateValues":case"uniqueValues":return i({type:e.type},a);case"top10":return i({type:"top10",percent:e.percent===!0?!0:void 0,bottom:e.bottom===!0?!0:void 0,rank:e.rank},a);case"aboveAverage":return i({type:"aboveAverage",aboveAverage:e.below===!0?!1:void 0,equalAverage:e.equal===!0?!0:void 0},a);case"expression":return i({type:"expression"},a,f(this.bound(e.formula.startsWith("=")?e.formula:`=${e.formula}`)));case"dataBar":return i({type:"dataBar"},{},r("dataBar",{showValue:e.show===!1?!1:void 0},this.cfvo(e.min??{at:"min"},!1),this.cfvo(e.max??{at:"max"},!1),r("color",{rgb:fe(e.color)})));case"colorScale":{const h=o?"x14:":"";return i({type:"colorScale"},{},r(`${h}colorScale`,{},...e.stops.map(u=>this.cfvo(u,o)),...e.stops.map(u=>r(`${h}color`,{rgb:fe(u.color)}))))}case"iconSet":{const h=Number.parseInt(e.icons,10),u=e.stops??Array.from({length:h},(m,g)=>({at:"percent",value:Math.round(g*100/h)}));return i({type:"iconSet"},{},r(o?"x14:iconSet":"iconSet",{iconSet:e.icons,showValue:e.show===!1?!1:void 0,reverse:e.reverse===!0?!0:void 0},...u.map(m=>this.cfvo(m,o))))}}}validation(t){const{spec:n}=t;let e="",s=this.crosses(t.formulas);if(n.values){const d=n.values.join(",");d.length>He||n.values.some(f=>f.includes(",")||f.includes('"'))?(e=this.lists.place(n.values),s=!0):e=`"${d}"`}else e=this.bound(n.formula?.[0]);const o=this.bound(n.formula?.[1]),{error:i,prompt:a}=n;n.multiple===!0&&this.left.push(`${this.sheet.name}!${n.range}: several choices in a cell: its text stays, and Excel's list offers one at a time`);const c={type:n.type,errorStyle:i?.style===void 0||i.style==="stop"?void 0:i.style,operator:n.operator===void 0||n.operator==="between"?void 0:n.operator,allowBlank:n.blank===!1?void 0:!0,showDropDown:n.dropdown===!1?!0:void 0,showInputMessage:a?.show===!1?void 0:!0,showErrorMessage:i?.show===!1||n.multiple===!0?void 0:!0,errorTitle:i?.title,error:i?.message,promptTitle:a?.title,prompt:a?.message};return s?(this.newerValidations.push(r("x14:dataValidation",c,e===""?"":r("x14:formula1",{},r("xm:f",{},y(e))),o===""?"":r("x14:formula2",{},r("xm:f",{},y(o))),r("xm:sqref",{},n.range))),""):r("dataValidation",{...c,sqref:n.range},e===""?"":r("formula1",{},y(e)),o===""?"":r("formula2",{},y(o)))}validations(){const t=this.sheet.validations.map(n=>this.validation(n)).filter(n=>n!=="");return t.length===0?"":r("dataValidations",{count:t.length},t.join(""))}filterColumns(t){return[...t.columns.entries()].sort(([n],[e])=>n-e).map(([n,e])=>lt(n-t.area.left,e,s=>this.styles.dxf(s)))}sheetFilter(){const t=this.sheet.filters.find(n=>!n.table);return t?r("autoFilter",{ref:M(t.area)},...this.filterColumns(t)):""}columnFormula(t,n){if(!n?.node)return"";const e=G(n.node,this.isRangeName),s=V(n.node,{table:t.name,isTable:this.isTable,array:e});return r("calculatedColumnFormula",{array:e?!0:void 0},y(s))}tableXml(t,n){const e=t.area,s=M({...e,bottom:Math.max(e.bottom,e.top+1)}),o=t.spec.style??DEFAULT_TABLE_STYLE,i=this.sheet.filters.find(a=>a.table===t);return E+r("table",{xmlns:T.main,id:n,name:t.name,displayName:t.name,ref:s,totalsRowShown:0},i?r("autoFilter",{ref:s},...this.filterColumns(i)):"",r("tableColumns",{count:t.columns.length},t.columns.map((a,c)=>r("tableColumn",{id:c+1,name:a.name},this.columnFormula(t,a.formula))).join("")),r("tableStyleInfo",{name:o==="none"?void 0:o,showFirstColumn:t.spec.first_column===!0,showLastColumn:t.spec.last_column===!0,showRowStripes:t.spec.banded_rows!==!1,showColumnStripes:t.spec.banded_columns===!0}))}}const ce=l=>{let t;for(const n of Object.values(l??{}))n.level!==void 0&&(t=Math.max(t??0,n.level));return t},de=l=>[l.left===void 0?"":`&L${l.left}`,l.center===void 0?"":`&C${l.center}`,l.right===void 0?"":`&R${l.right}`].join(""),ot=l=>typeof l=="string"?{text:l,author:ee}:{text:l.text,author:l.author??ee};function rt(l){const t=l.map(([e,s])=>({ref:e,...ot(s)})),n=[...new Set(t.map(e=>e.author))];return E+r("comments",{xmlns:T.main},r("authors",{},n.map(e=>r("author",{},y(e))).join("")),r("commentList",{},t.map(e=>r("comment",{ref:e.ref,authorId:n.indexOf(e.author)},r("text",{},r("r",{},r("t",/^\s|\s$|\n/u.test(e.text)?{"xml:space":"preserve"}:{},y(e.text)))))).join("")))}function it(l){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>${l.flatMap(([n],e)=>{const s=ne(n);return s?[`<v:shape id="_x0000_s${String(1025+e)}" type="#_x0000_t202" style="position:absolute;margin-left:80pt;margin-top:5pt;width:120pt;height:60pt;z-index:${String(e+1)};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${String(s.col+1)}, 15, ${String(s.row)}, 2, ${String(s.col+3)}, 15, ${String(s.row+4)}, 4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${String(s.row)}</x:Row><x:Column>${String(s.col)}</x:Column></x:ClientData></v:shape>`]:[]}).join("")}</xml>`}const fe=l=>`FF${l.slice(1).toUpperCase()}`;function at(l){if(l.type==="dataBar"||l.type==="colorScale"||l.type==="iconSet")return{};const t={};for(const n of["bold","italic","underline","strike","color","fill","border","format"])l[n]!==void 0&&(t[n]=l[n]);return t}function lt(l,t,n){const e=t.values!==void 0||t.blanks!==void 0,{conditions:s,top:o,average:i,color:a}=t,c=e?r("filters",{blank:t.blanks===!0?!0:void 0},(t.values??[]).map(d=>r("filter",{val:d})).join("")):s?r("customFilters",{and:s.length===2&&t.or!==!0?!0:void 0},s.map(d=>r("customFilter",{operator:d.operator==="equal"?void 0:d.operator,val:String(d.value)})).join("")):o?r("top10",{top:o.bottom===!0?!1:void 0,percent:o.percent===!0?!0:void 0,val:o.count}):i?r("dynamicFilter",{type:i==="above"?"aboveAverage":"belowAverage"}):a?.fill!==void 0?r("colorFilter",{dxfId:n({fill:a.fill})}):a?.font!==void 0?r("colorFilter",{dxfId:n({color:a.font}),cellColor:!1}):"";return r("filterColumn",{colId:l},c)}const v=l=>l===void 0?"":` s="${String(l)}"`,ct=new Set(["#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A","#GETTING_DATA"]),he=l=>ct.has(l.code),dt=new Set(["width","height","hidden"]);function ue(l){if(!l)return;const t=Object.fromEntries(Object.entries(l).filter(([n])=>!dt.has(n)));return Object.keys(t).length===0?void 0:t}const U=l=>E+r("Relationships",{xmlns:T.pkg},l.map(([t,n,e],s)=>r("Relationship",{Id:`rId${String(s+1)}`,Type:t,Target:n,TargetMode:e})).join(""));function ft(l,t){const n=t.formula?.node;if(n)return V(n,{isTable:s=>l.table(s)!==void 0,array:!0});const{value:e}=t;return e==null?'""':typeof e=="string"?`"${e.replaceAll('"','""')}"`:typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof P?e.code:String(e)}const ht=(l,t)=>l.length===t.length&&l.every((n,e)=>n===t[e]),me=l=>`$${F(l.left)}$${String(l.top+1)}:$${F(l.right)}$${String(l.bottom+1)}`;function ut(l){const t=[],n=(e,s)=>r("definedName",{name:e.name,localSheetId:s,hidden:e.hidden===!0?!0:void 0},y(ft(l,e)));for(const e of l.names.values())t.push(n(e));return l.sheets.forEach((e,s)=>{for(const f of e.names.values())t.push(n(f,s));const o=e.filters.find(f=>!f.table);o&&t.push(r("definedName",{name:"_xlnm._FilterDatabase",localSheetId:s,hidden:!0},y(`${q(e.name)}${me(o.area)}`)));const i=q(e.name),a=e.spec.print,c=a?.area===void 0?void 0:ye(a.area);c&&t.push(r("definedName",{name:"_xlnm.Print_Area",localSheetId:s},y(`${i}${me(c)}`)));const d=[a?.title_cols?.toUpperCase().replace(/([A-Z]+):([A-Z]+)/u,"$$$1:$$$2"),a?.title_rows?.replace(/(\d+):(\d+)/u,"$$$1:$$$2")].flatMap(f=>f===void 0?[]:[`${i}${f}`]);d.length>0&&t.push(r("definedName",{name:"_xlnm.Print_Titles",localSheetId:s},y(d.join(","))))}),t}function mt(l){if(l===void 0)return{};const t=l===!0?{}:l;return{iterate:!0,iterateCount:t.max_iterations??se.max_iterations,iterateDelta:t.max_change??se.max_change}}export function writeXlsx(l,t={}){const n=l.wb,e=[];n.checks.length>0&&e.push(`${String(n.checks.length)} check${n.checks.length===1?"":"s"}: a file has no such thing`);const s=Ee(l);e.push(...s.left);const o=new Le,i=new We,a=new Qe(n),c=new Fe,d=[["/xl/workbook.xml",C.sheet]],f=Math.max(0,n.sheets.findIndex(p=>p.spec.hidden!==!0));let h=1,u=!1;const m=new Map;let g=0,w=0,x=0;for(const[p,$]of n.sheets.entries()){const H=String(p+1),O=Ke($,l,t.file,e),D=$.charts.filter(({spec:b})=>[b.categories,...b.series.flatMap(_=>[_.values,_.x])].some(_=>_?.endsWith("#"))).length;D>0&&e.push(`${$.name}: ${String(D)} chart${D===1?"":"s"} on a spill: ${D===1?"it reads":"they read"} the cells the spill covers now, and will not grow with it`);const K=new st($,l,o,i,t.cached!==!1,e,a,p,O,s.sheets.find(b=>b.sheet===$)),ge=K.write(c.part(`xl/worksheets/sheet${H}.xml`),p===f,h);u||=K.arrays,d.push([`/xl/worksheets/sheet${H}.xml`,C.worksheet]);const L=[];for(const b of ge){const _=`table${String(h)}.xml`;h+=1,c.add(`xl/tables/${_}`,b),d.push([`/xl/tables/${_}`,C.table]),L.push([`${k}table`,`../tables/${_}`])}if($.charts.length>0||O.length>0){g+=1;const b=`drawing${String(g)}.xml`;c.add(`xl/drawings/${b}`,Me($.charts,O)),d.push([`/xl/drawings/${b}`,C.drawing]),L.push([`${k}drawing`,`../drawings/${b}`]);const _=$.charts.map(I=>{w+=1;const N=`chart${String(w)}.xml`;return c.add(`xl/charts/${N}`,Re(l,$,I)),d.push([`/xl/charts/${N}`,C.chart]),[`${k}chart`,`../charts/${N}`]});for(const I of O){const Q=[...m].find(([,we])=>ht(we,I.bytes))?.[0]??`image${String(m.size+1)}${I.file}`;m.set(Q,I.bytes),_.push([`${k}image`,`../media/${Q}`])}c.add(`xl/drawings/_rels/${b}.rels`,U(_))}const B=Object.entries($.spec.notes??{});if(B.length>0){x+=1;const b=String(x);c.add(`xl/comments${b}.xml`,rt(B)),d.push([`/xl/comments${b}.xml`,C.comments]),c.add(`xl/drawings/vmlDrawing${b}.vml`,it(B)),L.push([`${k}vmlDrawing`,`../drawings/vmlDrawing${b}.vml`]),L.push([`${k}comments`,`../comments${b}.xml`])}for(const b of Object.values($.spec.links??{}))b.startsWith("#")||L.push([`${k}hyperlink`,b,"External"]);L.length>0&&c.add(`xl/worksheets/_rels/sheet${H}.xml.rels`,U(L))}const R=n.sheets.length,A=a.columns.length>0;if(A){const p=`xl/worksheets/sheet${String(R+1)}.xml`;c.add(p,a.xml(i)),d.push([`/${p}`,C.worksheet])}const S=[...n.sheets,...A?[void 0]:[]].map((p,$)=>[`${k}worksheet`,`worksheets/sheet${String($+1)}.xml`]);S.push([`${k}theme`,"theme/theme1.xml"]),S.push([`${k}styles`,"styles.xml"]),S.push([`${k}sharedStrings`,"sharedStrings.xml"]),u&&(S.push([`${k}sheetMetadata`,"metadata.xml"]),d.push(["/xl/metadata.xml",C.metadata]));const Z=ut(n),J=n.sheets.map((p,$)=>r("sheet",{name:p.name,sheetId:$+1,state:p.spec.hidden===!0?"hidden":void 0,"r:id":`rId${String($+1)}`}));A&&J.push(r("sheet",{name:a.name,sheetId:R+1,state:"veryHidden","r:id":`rId${String(R+1)}`})),c.add("xl/workbook.xml",E+r("workbook",{xmlns:T.main,"xmlns:r":T.rel},r("workbookPr",{}),r("bookViews",{},r("workbookView",{activeTab:f===0?void 0:f})),r("sheets",{},J.join("")),Z.length>0?r("definedNames",{},Z.join("")):"",r("calcPr",{calcId:Ne,fullCalcOnLoad:!0,...mt(n.file.iteration)}))),c.add("xl/_rels/workbook.xml.rels",U(S)),c.add("xl/styles.xml",E+o.xml()),i.write(c.part("xl/sharedStrings.xml")),c.add("xl/theme/theme1.xml",E+Ie),u&&c.add("xl/metadata.xml",E+Xe),c.add("docProps/core.xml",E+r("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},n.title===void 0?"":r("dc:title",{},y(n.title)))),c.add("docProps/app.xml",E+r("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},r("Application",{},"AllyHub"))),c.add("_rels/.rels",U([[`${k}officeDocument`,"xl/workbook.xml"],["http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"],[`${k}extended-properties`,"docProps/app.xml"]])),d.push(["/xl/styles.xml",C.styles],["/xl/sharedStrings.xml",C.strings],["/xl/theme/theme1.xml",C.theme],["/docProps/core.xml",C.core],["/docProps/app.xml",C.app]);const pe=[...m].sort(([p],[$])=>p.localeCompare($));for(const[p,$]of pe)c.add(`xl/media/${p}`,$);return c.add("[Content_Types].xml",E+r("Types",{xmlns:T.types},r("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),r("Default",{Extension:"xml",ContentType:"application/xml"}),x>0?r("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}):"",[...new Set([...m.keys()].map(p=>p.split(".").pop()??""))].sort().map(p=>r("Default",{Extension:p,ContentType:`image/${De[p]??p}`})).join(""),d.map(([p,$])=>r("Override",{PartName:p,ContentType:$})).join(""))),{bytes:c.finish(),left:e}}function pt(l){const t=(s,o,i)=>o.length===0?"":r(s,{count:o.length,manualBreakCount:o.length},o.map(a=>r("brk",{id:a,max:i,man:!0})).join("")),n=[...new Set(l?.rows??[])].sort((s,o)=>s-o).map(s=>s-1),e=[...new Set((l?.cols??[]).map(s=>te(s.toUpperCase())).filter(s=>s!==void 0&&s>0))].sort((s,o)=>s-o);return t("rowBreaks",n,X-1)+t("colBreaks",e,W-1)}
|
|
2
|
+
import{CHARTEX_COLORS_REL as Se,CHARTEX_COLORS_TYPE as ke,CHARTEX_REL as Ee,CHARTEX_STYLE_REL as Ae,CHARTEX_STYLE_TYPE as Ce,CHARTEX_TYPE as Te,chartExColorsXml as _e,chartExStyleXml as Re,isExtended as Le}from"@allyhub/chart";import{EXCEL_CELL_STYLE_IDS as Me,themeTitle as Fe,SHEET_MARGINS as Ie,SHEET_NOTE_AUTHOR as ie,SHEET_PAPERS as Oe}from"@allyhub/formats";import{MAX_COLUMNS as G,MAX_ROWS as Z,cellName as D,columnIndex as ae,columnLetter as V,rangeName as L,readAddress as le,readArea as je}from"../address.js";import{analyse as De}from"../calc/analyse.js";import{sparklineGroupXml as Pe}from"../sparklines.js";import{lookColorIn as ce}from"../theme.js";import{ITERATION_DEFAULTS as de}from"../calc/engine.js";import{parseFormula as Ne}from"../formula/parse.js";import{sheetPrefix as J}from"../formula/print.js";import{walk as fe}from"../formula/walk.js";import{fileCells as Ve,isPicture as Xe,pictureHeight as ze,pictureSize as he}from"../files.js";import{scenariosByCell as He}from"../scenario.js";import{CellError as U,readTyped as Ue}from"../values.js";import{FormulaCell as Be,runsText as We}from"../workbook.js";import{chartPart as qe,drawingPart as Ye}from"./charts.js";import{tileChart as ue,tileSize as Ge}from"../tiles.js";import{fileFormula as B,needsArray as K}from"./formula.js";import{GRID_END as Q}from"./read.js";import{Styles as Ze,runXml as Je}from"./styles.js";import{themeXml as Ke}from"./theme.js";import{HEAD as A,NS as C,el as o,xstring as $}from"./xml.js";import{ZipOut as Qe}from"./zip.js";const T={comments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",sheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",styles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",strings:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",table:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",metadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",drawing:"application/vnd.openxmlformats-officedocument.drawing+xml",chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"},E=`${C.rel}/`,ee="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",te="http://schemas.microsoft.com/office/excel/2006/main",et=/\.(tiff?|bmp|emf|wmf)$/iu,tt={jpg:"jpeg",emf:"x-emf",wmf:"x-wmf"},ne={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}",sparklines:"{05C60535-1F16-4fd2-B633-F4F36F0B64E0}"},nt=191029;export const DEFAULT_TABLE_STYLE="TableStyleMedium2",LISTS_SHEET="AllyHub lists";const st=64,ot=7,rt=a=>Math.min(255,Math.floor(a/ot*256)/256),it=a=>Math.min(409.5,a*3/4),W=32767,at=255,lt=2e5,ct=o("metadata",{xmlns:C.main,"xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},o("metadataTypes",{count:1},o("metadataType",{name:"XLDAPR",minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1})),o("futureMetadata",{name:"XLDAPR",count:1},o("bk",{},o("extLst",{},o("ext",{uri:"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"},o("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0}))))),o("cellMetadata",{count:1},o("bk",{},o("rc",{t:1,v:0}))));class dt{index=new Map;count=0;place(t){this.count+=1;let n=this.index.get(t);return n===void 0&&(n=this.index.size,this.index.set(t,n)),n}of(t){return this.place(`t${t}`)}rich(t){return this.place(`r${t}`)}write(t){t.write(`${A}<sst xmlns="${C.main}" count="${String(this.count)}" uniqueCount="${String(this.index.size)}">`);for(const n of this.index.keys()){if(n.startsWith("r")){t.write(`<si>${n.slice(1)}</si>`);continue}const e=n.slice(1),s=/^\s|\s$|\n/u.test(e);t.write(`<si><t${s?' xml:space="preserve"':""}>${$(e)}</t></si>`)}t.write("</sst>"),t.end()}}function ft(a){let t=!1;return a&&fe(a,n=>{(n.kind==="structured"||n.kind==="ref"&&n.sheet!==void 0)&&(t=!0)}),t}function ht(a){for(const t in a)if(Object.hasOwn(a,t))return!1;return!0}const ut=a=>o("x",a).slice(2,-2),mt="Base case";function pt(a){const t=new Map;for(const s of a.scenarios)for(const r of s.cells)t.set(D(r),r);const n=(s,r)=>o("inputCells",{r:D(s),val:r===null||r instanceof U?"":typeof r=="boolean"?r?"1":"0":String(r)}),e=(s,r)=>o("scenario",{name:s,locked:!0,count:r.length,user:"AllyHub"},r.join(""));return o("scenarios",{current:0,show:0,sqref:[...t.keys()].join(" ")},e(mt,[...t.values()].map(s=>n(s,s.base))),...a.scenarios.map(s=>e(s.name,s.cells.map(r=>n(r,r.value)))))}function me(a){return[...a.charts,...a.tiles.flatMap(t=>ue(a,t).chart??[])]}function gt(a,t,n,e,s){const r=[];let l=0;for(const{row:i,col:d,paths:h,column:u}of Ve(a,t)){let m=0;const y=ze(u);for(const w of h){const p=Xe(w)?n?.(w):void 0,v=p&&he(p);if(!p||!v){l+=1;continue}const S=Math.round(v.width/v.height*y);r.push({row:i,col:d,x:m,width:S,height:y,name:w.split("/").pop()??w,path:w,file:`.${v.type==="jpeg"?"jpg":v.type}`,bytes:p}),m+=S+4}}let f=0;for(const i of a.spec.pictures??[]){const d=le(i.at),h=n?.(i.file);if(!d||!h)continue;const u=he(h),m=u?.type??et.exec(i.file)?.[1]?.toLowerCase(),y=i.width!==void 0&&i.height!==void 0?{width:i.width,height:i.height}:void 0,w=u??y;if(m===void 0||w===void 0){f+=1;continue}const p=w.width/w.height,v=i.width??(i.height===void 0?w.width:i.height*p);r.push({row:d.row,col:d.col,x:i.x??0,y:i.y??0,width:Math.round(v),height:Math.round(i.height??v/p),name:i.file.split("/").pop()??i.file,path:i.file,file:`.${m==="jpeg"?"jpg":m==="tif"?"tiff":m}`,bytes:h})}let c=0;for(const i of a.tiles){if(ue(a,i).chart)continue;const d=s?.(a,i);if(!d){c+=1;continue}const h=Ge(i);r.push({row:i.at.row,col:i.at.col,x:i.spec.x??0,y:i.spec.y??0,width:h.width,height:h.height,name:`${i.kind} ${String(i.index+1)}`,path:d.alt,file:".png",bytes:d.png})}return c>0&&e.push(`${a.name}: ${String(c)} block${c===1?"":"s"} over the cells, not drawn`),f>0&&e.push(`${a.name}: ${String(f)} picture${f===1?"":"s"} of a kind a file cannot hold, or with no size given`),l>0&&e.push(`${a.name}: ${String(l)} file${l===1?"":"s"} in a cell, which stay${l===1?"s":""} a name`),r}class xt{name;columns=[];known=new Map;constructor(t){let n=LISTS_SHEET;for(let e=2;t.sheet(n);e++)n=`${LISTS_SHEET} (${String(e)})`;this.name=n}place(t){const n=JSON.stringify(t);let e=this.known.get(n);e===void 0&&(e=this.columns.length,this.columns.push(t),this.known.set(n,e));const s=V(e);return`${J(this.name)}$${s}$1:$${s}$${String(Math.max(1,t.length))}`}xml(t){const n=[],e=Math.max(0,...this.columns.map(s=>s.length));for(let s=0;s<e;s++){let r=`<row r="${String(s+1)}">`;this.columns.forEach((l,f)=>{const c=l[s];c!==void 0&&(r+=`<c r="${D({row:s,col:f})}" t="s"><v>${String(t.of(c))}</v></c>`)}),n.push(`${r}</row>`)}return`${A}<worksheet xmlns="${C.main}" xmlns:r="${C.rel}"><dimension ref="${L({top:0,left:0,bottom:Math.max(0,e-1),right:Math.max(0,this.columns.length-1)})}"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData>${n.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`}}class wt{rows=new Int32Array(1024);cols=new Int32Array(1024);size=0;add(t,n){if(this.size===this.rows.length){const e=new Int32Array(this.size*2);e.set(this.rows),this.rows=e;const s=new Int32Array(this.size*2);s.set(this.cols),this.cols=s}this.rows[this.size]=t,this.cols[this.size]=n,this.size+=1}byRow(){const{size:t}=this;if(t===0)return{start:new Uint32Array(1),cols:new Int32Array(0),top:0,used:void 0};let n=1/0,e=-1,s=1/0,r=-1;for(let i=0;i<t;i++){const d=this.rows[i]??0,h=this.cols[i]??0;d<n&&(n=d),d>e&&(e=d),h<s&&(s=h),h>r&&(r=h)}const l=new Uint32Array(e-n+2);for(let i=0;i<t;i++){const d=(this.rows[i]??0)-n+1;l[d]=(l[d]??0)+1}for(let i=1;i<l.length;i++)l[i]=(l[i]??0)+(l[i-1]??0);const f=l.slice(0,-1),c=new Int32Array(t);for(let i=0;i<t;i++){const d=(this.rows[i]??0)-n,h=f[d]??0;c[h]=this.cols[i]??0,f[d]=h+1}return{start:l,cols:c,top:n,used:{top:n,bottom:e,left:s,right:r}}}}function $t(a,t){if(!a)return!1;let n=!1;const e=t.toLowerCase();return fe(a,s=>{(s.kind==="ref"||s.kind==="name")&&s.sheet!==void 0&&s.sheet.toLowerCase()!==e&&(n=!0)}),n}const yt=(a,t)=>`{00000000-0000-4000-8000-${(a*65536+t).toString(16).toUpperCase().padStart(12,"0")}}`;class bt{arrays=!1;sheet;calc;styles;strings;wb;cached;left;lists;index;isTable;isRangeName;hiddenRows;tall;scenarios;drawn;newerRules=[];newerValidations=[];misgiven=new Set;shapes=new Map;groups=new Map;constructor(t,n,e,s,r,l,f,c,i=[],d){this.sheet=t,this.calc=n,this.wb=n.wb,this.styles=e,this.strings=s,this.cached=r,this.left=l,this.lists=f,this.index=c,this.isTable=u=>this.wb.table(u)!==void 0,this.isRangeName=u=>{const m=this.wb.name(u,t)?.formula?.node;return this.isTable(u)||m!==void 0&&K({kind:"unary",op:"-",arg:m})},this.hiddenRows=n.filtered(t),this.scenarios=d,this.drawn=me(t).length>0||i.length>0;const h=new Map;for(const u of i)u.y===void 0&&h.set(u.row,Math.max(h.get(u.row)??0,u.height));this.tall=h}grid(){const{sheet:t}=this;if(t.lastRow>=Z)throw new Error(`${t.name} reaches row ${(t.lastRow+1).toLocaleString("en-US")}, and ${Q}: an Excel file cannot hold it.`);if(t.columnsUsed>G)throw new Error(`${t.name} reaches past column ${V(G-1)}, and ${Q}: an Excel file cannot hold it.`);for(const n of Object.keys(t.spec.rows??{}))if(Number(n)>Z)throw new Error(`${t.name} sets row ${n}, and ${Q}: an Excel file cannot hold it.`)}gather(){const{sheet:t}=this,n=new wt;for(let e=0;e<t.columnsUsed;e++){const[s,r]=t.span(e,0,Number.MAX_SAFE_INTEGER);for(let l=s;l<=r;l++)(t.at(l,e)!==void 0||t.spillAt(l,e))&&n.add(l,e)}for(const{area:e}of t.styledAreas()){const s=(e.bottom-e.top+1)*(e.right-e.left+1);if(s>lt){this.left.push(`${t.name}!${L(e)}: its look on the cells that hold something, ${String(s)} cells being too many to write empty`);continue}for(let r=e.top;r<=e.bottom;r++)for(let l=e.left;l<=e.right;l++)n.add(r,l)}for(const e of t.keys.keys())n.add(Math.floor(e/16384),e%16384);return n.byRow()}styleOf(t,n){const e=this.sheet.lookAt(t,n);return ht(e)?void 0:this.styles.xf(e)}held(t,n){return n.length<=W?n:(this.left.push(`${this.sheet.name}!${t} past Excel's ${String(W)} characters, of its ${String(n.length)}`),n.slice(0,W))}value(t,n,e){return e===null?`<c r="${t}"${k(n)}/>`:typeof e=="number"?`<c r="${t}"${k(n)}><v>${String(e)}</v></c>`:typeof e=="boolean"?`<c r="${t}"${k(n)} t="b"><v>${e?"1":"0"}</v></c>`:e instanceof U?we(e)?`<c r="${t}"${k(n)} t="e"><v>${e.code}</v></c>`:`<c r="${t}"${k(n)} t="s"><v>${String(this.strings.of(e.code))}</v></c>`:`<c r="${t}"${k(n)} t="s"><v>${String(this.strings.of(this.held(t,e)))}</v></c>`}dataTable(t,n,e,s){const r=this.value(t,n,s),{shared:l}=e;if(e.row!==l.atRow||e.col!==l.atCol)return r;const f=l.node,c=p=>{if(p===void 0||p.kind==="missing")return null;if(!(p.kind!=="ref"||p.sheet!==void 0||!p.row||!p.col))return D({row:p.row.index,col:p.col.index})},i=f?.kind==="call"?f.args:[],d=c(i[0]),h=c(i[1]);if(d===void 0||h===void 0||d===null&&h===null)return this.left.push(`${this.sheet.name}!${t}: a data table whose inputs a file cannot hold, as its values`),r;const m=this.sheet.fills.find(p=>p.shared===l)?.area??{top:e.row,left:e.col,bottom:e.row,right:e.col},y=d!==null&&h!==null?{dt2D:!0,dtr:!0,r1:d,r2:h}:d!==null?{dtr:!0,r1:d}:{dtr:!1,r1:h??""},w=o("f",{t:"dataTable",ref:L(m),...y});return typeof s=="string"?`<c r="${t}"${k(n)} t="str">${w}<v>${$(s)}</v></c>`:r.includes("<v>")?r.replace("<v>",`${w}<v>`):r.replace("/>",`>${w}</c>`)}table(t){return this.sheet.tableAt(t.row,t.col)?.name}formula(t,n,e){const s=this.calc.value(e.sheet,e.row,e.col),{shared:r}=e,{node:l}=r;if(!l)return`<c r="${t}"${k(n)} t="e"><v>#NAME?</v></c>`;if(l.kind==="call"&&l.name==="TABLE"&&l.args.length<=2)return this.dataTable(t,n,e,s);const f=(r.analysis??=De(this.wb,r)).arguments[0];if(f!==void 0)return this.misgiven.has(r)||(this.misgiven.add(r),this.left.push(`${this.sheet.name}!${t}: a formula's value, not the formula, as ${f.name} is given ${String(f.given)} arguments`)),this.value(t,n,s);let c=this.shapes.get(r);c===void 0&&(c=K(l,this.isRangeName),this.shapes.set(r,c));const i=e.array!==void 0||e.blocked!==void 0||c;let d=i?void 0:this.groups.get(r);d?.written===!1&&(e.row!==d.ref.top||e.col!==d.ref.left)&&(d=void 0);let h,u="";if(d?.written===!0)h=`<f t="shared" si="${String(d.si)}"/>`;else{const m=B(e.moved,{table:this.table(e),isTable:this.isTable,array:i});h=d?`<f t="shared" ref="${L(d.ref)}" si="${String(d.si)}">${$(m)}</f>`:`<f>${$(m)}</f>`,d&&(d.written=!0),i&&(h=this.arrayFormula(e,m))}return i&&(this.arrays=!0,u=' cm="1"'),this.cached?s===null||typeof s=="number"?`<c r="${t}"${k(n)}${u}>${h}<v>${String(s??0)}</v></c>`:typeof s=="boolean"?`<c r="${t}"${k(n)} t="b"${u}>${h}<v>${s?"1":"0"}</v></c>`:s instanceof U?we(s)?`<c r="${t}"${k(n)} t="e"${u}>${h}<v>${s.code}</v></c>`:s.code==="#CYCLE!"?`<c r="${t}"${k(n)}${u}>${h}<v>0</v></c>`:`<c r="${t}"${k(n)} t="e"${u}>${h}<v>#VALUE!</v></c>`:`<c r="${t}"${k(n)} t="str"${u}>${h}<v>${$(this.held(t,s))}</v></c>`:`<c r="${t}"${k(n)}${u}>${h}</c>`}arrayFormula(t,n){const e=t.spill??{top:t.row,left:t.col,bottom:t.row,right:t.col};return`<f t="array" ref="${L(e)}">${$(n)}</f>`}shareFormulas(){const t=new Map;for(const e of this.sheet.formulas){const s=t.get(e.shared);if(!s)t.set(e.shared,{area:{top:e.row,bottom:e.row,left:e.col,right:e.col},first:e,n:1});else{const{area:r}=s;e.row<r.top&&(r.top=e.row),e.row>r.bottom&&(r.bottom=e.row),e.col<r.left&&(r.left=e.col),e.col>r.right&&(r.right=e.col),(e.row<s.first.row||e.row===s.first.row&&e.col<s.first.col)&&(s.first=e),s.n+=1}}let n=0;for(const[e,{area:s,first:r,n:l}]of t)l>1&&r.row===s.top&&r.col===s.left&&!ft(e.node)&&(this.groups.set(e,{si:n,ref:s,written:!1}),n+=1)}cell(t,n){const e=D({row:t,col:n}),s=this.styleOf(t,n),r=this.sheet.at(t,n);if(r instanceof Be)return this.formula(e,s,r);const l=typeof r=="string"?this.sheet.runsAt(t,n):void 0;if(l&&We(l).length<=W){const f=this.sheet.lookAt(t,n);return`<c r="${e}"${k(s)} t="s"><v>${String(this.strings.rich(l.map(c=>Je(c,f)).join("")))}</v></c>`}return r===void 0&&this.cached&&this.sheet.spillAt(t,n)?this.value(e,s,this.calc.value(this.sheet,t,n)):this.value(e,s,r??null)}columns(){const{sheet:t}=this,{spec:n}=t,e=new Map,s=new Map;for(const c of t.tables)for(const i of c.columns)i.spec?.width!==void 0&&s.set(c.at.col+i.index,i.spec.width);const r=new Set(s.keys()),l=new Map;for(const[c,i]of Object.entries(n.columns??{})){const d=ae(c);d!==void 0&&(l.set(d,i),r.add(d))}for(const c of[...l.keys()])for(const i of[-1,1])c+i>=0&&this.collapsedColumn(c+i)&&r.add(c+i);for(const c of r){const i=l.get(c),d=i?.width??s.get(c),h=$e(i);e.set(c,o("col",{min:c+1,max:c+1,width:rt(d??st),style:h===void 0?void 0:this.styles.xf(h),hidden:i?.hidden===!0?!0:void 0,customWidth:d===void 0?void 0:!0,outlineLevel:i?.level,collapsed:this.collapsedColumn(c)?!0:void 0}))}const f=[...e.keys()].sort((c,i)=>c-i).map(c=>e.get(c)??"");return f.length===0?"":`<cols>${f.join("")}</cols>`}rowAttrs(t){const n=this.sheet.spec.rows?.[String(t+1)],e=$e(n),s=n?.height??this.tall.get(t);return ut({r:t+1,s:e===void 0?void 0:this.styles.xf(e),customFormat:e===void 0?void 0:!0,ht:s===void 0?void 0:it(s),customHeight:s===void 0?void 0:!0,hidden:n?.hidden===!0||this.hiddenRows.has(t)?!0:void 0,outlineLevel:n?.level,collapsed:this.collapsedRow(t)?!0:void 0})}collapsedRow(t){const n=this.sheet.spec.rows??{},e=f=>n[String(f+1)]?.level??0,s=f=>n[String(f+1)]?.hidden===!0||this.hiddenRows.has(f),r=this.sheet.spec.outline?.summary_below===!1?1:-1,l=t+r;return l>=0&&e(l)>e(t)&&s(l)}collapsedColumn(t){const n=this.sheet.spec.columns??{},e=l=>n[V(l)],s=this.sheet.spec.outline?.summary_right===!1?1:-1,r=t+s;return r>=0&&(e(r)?.level??0)>(e(t)?.level??0)&&e(r)?.hidden===!0}rows(t,n){const{sheet:e}=this,s=new Set(this.hiddenRows);for(const d of Object.keys(e.spec.rows??{})){const h=Number(d)-1;s.add(h);for(const u of[-1,1])h+u>=0&&this.collapsedRow(h+u)&&s.add(h+u)}const{start:r,cols:l,top:f}=n;let c=n.used?f:1/0,i=n.used?n.used.bottom:-1;for(const d of s)d<c&&(c=d),d>i&&(i=d);for(let d=Math.max(0,c);d<=i;d++){const h=d-f,u=h>=0&&h<r.length-1?r[h]??0:0,m=h>=0&&h<r.length-1?r[h+1]??0:0;if(u===m&&!s.has(d))continue;if(u===m){t.write(`<row${this.rowAttrs(d)}/>`);continue}const y=l.subarray(u,m).sort();let w=`<row${this.rowAttrs(d)}>`,p=-1;for(const v of y)v!==p&&(p=v,w+=this.cell(d,v));t.write(`${w}</row>`)}}view(t){const{freeze:n}=this.sheet;let e="";if(n&&(n.row>0||n.col>0)){const s=n.row>0&&n.col>0?"bottomRight":n.row>0?"bottomLeft":"topRight";e=o("pane",{xSplit:n.col>0?n.col:void 0,ySplit:n.row>0?n.row:void 0,topLeftCell:D(n),activePane:s,state:"frozen"})}return o("sheetViews",{},o("sheetView",{showGridLines:this.sheet.spec.gridlines===!1?!1:void 0,tabSelected:t?!0:void 0,workbookViewId:0},e))}write(t,n,e){const{sheet:s}=this;this.grid();const r=this.gather();this.shareFormulas();const l=s.tables.map((S,_)=>o("tablePart",{"r:id":`rId${String(_+1)}`})),{print:f}=s.spec,c=f?.fit,i=Object.keys(s.spec.notes??{}).length>0,d=s.spec.outline,h=d?.summary_below===!1||d?.summary_right===!1?o("outlinePr",{summaryBelow:d.summary_below===!1?!1:void 0,summaryRight:d.summary_right===!1?!1:void 0}):"";t.write(`${A}<worksheet xmlns="${C.main}" xmlns:r="${C.rel}">`+(s.spec.tab===void 0&&c===void 0&&h===""?"":o("sheetPr",{},s.spec.tab===void 0?"":o("tabColor",{rgb:`FF${s.spec.tab.slice(1).toUpperCase()}`}),h,c===void 0?"":o("pageSetUpPr",{fitToPage:!0})))+o("dimension",{ref:r.used?L(r.used):"A1"})+this.view(n)+o("sheetFormatPr",{defaultRowHeight:15,outlineLevelRow:pe(s.spec.rows),outlineLevelCol:pe(s.spec.columns)})+this.columns()+"<sheetData>"),this.rows(t,r);const u=l.length+1+(this.drawn?1:0)+(i?2:0);let m=0;const y=Object.entries(s.spec.links??{}).map(([S,_])=>_.startsWith("#")?o("hyperlink",{ref:S,location:_.slice(1)}):o("hyperlink",{ref:S,"r:id":`rId${String(u+m++)}`})),w=s.merges.map(S=>o("mergeCell",{ref:L(S)})),p=s.conditions.map((S,_)=>this.condition(S,_+1)).join(""),v=this.validations();return t.write("</sheetData>"+(s.spec.protect===!0?o("sheetProtection",{sheet:!0,objects:!0,scenarios:!0}):"")+(this.scenarios?pt(this.scenarios):"")+this.sheetFilter()+(w.length>0?o("mergeCells",{count:w.length},w.join("")):"")+p+v+(y.length>0?o("hyperlinks",{},y.join("")):"")+o("pageMargins",{...Ie,...f?.margins})+(f?.orientation!==void 0||f?.paper!==void 0||f?.scale!==void 0||c!==void 0?o("pageSetup",{paperSize:f?.paper===void 0?void 0:Oe[f.paper],scale:f?.scale,fitToWidth:c?.width,fitToHeight:c?.height,orientation:f?.orientation}):"")+(f?.header||f?.footer?o("headerFooter",{},f.header?o("oddHeader",{},$(ge(f.header))):"",f.footer?o("oddFooter",{},$(ge(f.footer))):""):"")+Ft(f?.breaks)+(this.drawn?o("drawing",{"r:id":`rId${String(l.length+1)}`}):"")+(i?o("legacyDrawing",{"r:id":`rId${String(l.length+(this.drawn?2:1))}`}):"")+(l.length>0?o("tableParts",{count:l.length},l.join("")):"")+this.extensions()+"</worksheet>"),t.end(),s.tables.map((S,_)=>this.tableXml(S,e+_))}extensions(){const t=[];if(this.newerRules.length>0&&t.push(o("ext",{uri:ne.conditional,"xmlns:x14":ee},o("x14:conditionalFormattings",{},this.newerRules.join("")))),this.newerValidations.length>0&&t.push(o("ext",{uri:ne.validations,"xmlns:x14":ee},o("x14:dataValidations",{count:this.newerValidations.length,"xmlns:xm":te},this.newerValidations.join("")))),this.sheet.sparklines.length>0){const n=this.wb.colors;t.push(o("ext",{uri:ne.sparklines,"xmlns:x14":ee},o("x14:sparklineGroups",{"xmlns:xm":te},this.sheet.sparklines.map(e=>Pe(e,{series:ce(e.spec.color??"accent1",n),marks:ce(e.spec.marks??"#D00000",n)})).join(""))))}return t.length===0?"":o("extLst",{},t.join(""))}bound(t){if(t===void 0)return"";if(typeof t=="number")return String(t);if(!t.startsWith("=")){const e=Ue(t);return typeof e.value=="number"&&e.formula===void 0?String(e.value):`"${t.replaceAll('"','""')}"`}const n=Ne(t);return n.ok?B(n.node,{isTable:this.isTable,array:!0}):t.slice(1)}cfvo(t,n){const e=t.value===void 0?void 0:typeof t.value=="number"?String(t.value):this.bound(t.value);return n?o("x14:cfvo",{type:t.at},e===void 0?"":o("xm:f",{},$(e))):o("cfvo",{type:t.at,val:e})}crosses(t){return t.some(n=>$t(n?.node,this.sheet.name))}condition(t,n){const{spec:e}=t,s=e.range,r=e.type!=="dataBar"&&this.crosses(t.formulas),l=(h,u,...m)=>{if(!r){const y=Object.keys(u).length===0?void 0:this.styles.dxf(u);return o("conditionalFormatting",{sqref:s},o("cfRule",{...h,dxfId:y,priority:n,stopIfTrue:e.stop===!0?!0:void 0},...m))}return this.newerRules.push(o("x14:conditionalFormatting",{"xmlns:xm":te},o("x14:cfRule",{...h,priority:n,stopIfTrue:e.stop===!0?!0:void 0,id:yt(this.index,n)},...m.map(y=>y.replace(/^<formula>(.*)<\/formula>$/su,"<xm:f>$1</xm:f>")),Object.keys(u).length===0?"":this.styles.dxfXml(u,"x14:dxf")),o("xm:sqref",{},s))),""},f=Et(e),c=t.areas[0],i=c?D({row:c.top,col:c.left}):"A1",d=h=>o("formula",{},$(h));switch(e.type){case"cellIs":return l({type:"cellIs",operator:e.operator},f,...e.formula.map(h=>d(this.bound(h))));case"containsText":{const h=e.operator??"contains",u=`"${e.text.replaceAll('"','""')}"`,m=h==="contains"?`NOT(ISERROR(SEARCH(${u},${i})))`:h==="notContains"?`ISERROR(SEARCH(${u},${i}))`:h==="beginsWith"?`LEFT(${i},LEN(${u}))=${u}`:`RIGHT(${i},LEN(${u}))=${u}`;return l({type:h==="contains"?"containsText":h==="notContains"?"notContainsText":h,operator:h==="contains"?"containsText":h,text:e.text},f,d(m))}case"duplicateValues":case"uniqueValues":return l({type:e.type},f);case"top10":return l({type:"top10",percent:e.percent===!0?!0:void 0,bottom:e.bottom===!0?!0:void 0,rank:e.rank},f);case"aboveAverage":return l({type:"aboveAverage",aboveAverage:e.below===!0?!1:void 0,equalAverage:e.equal===!0?!0:void 0},f);case"expression":return l({type:"expression"},f,d(this.bound(e.formula.startsWith("=")?e.formula:`=${e.formula}`)));case"dataBar":return l({type:"dataBar"},{},o("dataBar",{showValue:e.show===!1?!1:void 0},this.cfvo(e.min??{at:"min"},!1),this.cfvo(e.max??{at:"max"},!1),o("color",{rgb:xe(e.color)})));case"colorScale":{const h=r?"x14:":"";return l({type:"colorScale"},{},o(`${h}colorScale`,{},...e.stops.map(u=>this.cfvo(u,r)),...e.stops.map(u=>o(`${h}color`,{rgb:xe(u.color)}))))}case"iconSet":{const h=Number.parseInt(e.icons,10),u=e.stops??Array.from({length:h},(m,y)=>({at:"percent",value:Math.round(y*100/h)}));return l({type:"iconSet"},{},o(r?"x14:iconSet":"iconSet",{iconSet:e.icons,showValue:e.show===!1?!1:void 0,reverse:e.reverse===!0?!0:void 0},...u.map(m=>this.cfvo(m,r))))}}}validation(t){const{spec:n}=t;let e="",s=this.crosses(t.formulas);if(n.values){const i=n.values.join(",");i.length>at||n.values.some(d=>d.includes(",")||d.includes('"'))?(e=this.lists.place(n.values),s=!0):e=`"${i}"`}else e=this.bound(n.formula?.[0]);const r=this.bound(n.formula?.[1]),{error:l,prompt:f}=n;n.multiple===!0&&this.left.push(`${this.sheet.name}!${n.range}: several choices in a cell: its text stays, and Excel's list offers one at a time`);const c={type:n.type,errorStyle:l?.style===void 0||l.style==="stop"?void 0:l.style,operator:n.operator===void 0||n.operator==="between"?void 0:n.operator,allowBlank:n.blank===!1?void 0:!0,showDropDown:n.dropdown===!1?!0:void 0,showInputMessage:f?.show===!1?void 0:!0,showErrorMessage:l?.show===!1||n.multiple===!0?void 0:!0,errorTitle:l?.title,error:l?.message,promptTitle:f?.title,prompt:f?.message};return s?(this.newerValidations.push(o("x14:dataValidation",c,e===""?"":o("x14:formula1",{},o("xm:f",{},$(e))),r===""?"":o("x14:formula2",{},o("xm:f",{},$(r))),o("xm:sqref",{},n.range))),""):o("dataValidation",{...c,sqref:n.range},e===""?"":o("formula1",{},$(e)),r===""?"":o("formula2",{},$(r)))}validations(){const t=this.sheet.validations.map(n=>this.validation(n)).filter(n=>n!=="");return t.length===0?"":o("dataValidations",{count:t.length},t.join(""))}filterColumns(t){return[...t.columns.entries()].sort(([n],[e])=>n-e).map(([n,e])=>At(n-t.area.left,e,s=>this.styles.dxf(s)))}sheetFilter(){const t=this.sheet.filters.find(n=>!n.table);return t?o("autoFilter",{ref:L(t.area)},...this.filterColumns(t)):""}columnFormula(t,n){if(!n?.node)return"";const e=K(n.node,this.isRangeName),s=B(n.node,{table:t.name,isTable:this.isTable,array:e});return o("calculatedColumnFormula",{array:e?!0:void 0},$(s))}tableXml(t,n){const e=t.area,s=L({...e,bottom:Math.max(e.bottom,e.top+1)}),r=t.spec.style??DEFAULT_TABLE_STYLE,l=this.sheet.filters.find(f=>f.table===t);return A+o("table",{xmlns:C.main,id:n,name:t.name,displayName:t.name,ref:s,totalsRowShown:0},l?o("autoFilter",{ref:s},...this.filterColumns(l)):"",o("tableColumns",{count:t.columns.length},t.columns.map((f,c)=>o("tableColumn",{id:c+1,name:f.name},this.columnFormula(t,f.formula))).join("")),o("tableStyleInfo",{name:r==="none"?void 0:r,showFirstColumn:t.spec.first_column===!0,showLastColumn:t.spec.last_column===!0,showRowStripes:t.spec.banded_rows!==!1,showColumnStripes:t.spec.banded_columns===!0}))}}const pe=a=>{let t;for(const n of Object.values(a??{}))n.level!==void 0&&(t=Math.max(t??0,n.level));return t},ge=a=>[a.left===void 0?"":`&L${a.left}`,a.center===void 0?"":`&C${a.center}`,a.right===void 0?"":`&R${a.right}`].join(""),vt=a=>typeof a=="string"?{text:a,author:ie}:{text:a.text,author:a.author??ie};function St(a){const t=a.map(([e,s])=>({ref:e,...vt(s)})),n=[...new Set(t.map(e=>e.author))];return A+o("comments",{xmlns:C.main},o("authors",{},n.map(e=>o("author",{},$(e))).join("")),o("commentList",{},t.map(e=>o("comment",{ref:e.ref,authorId:n.indexOf(e.author)},o("text",{},o("r",{},o("t",/^\s|\s$|\n/u.test(e.text)?{"xml:space":"preserve"}:{},$(e.text)))))).join("")))}function kt(a){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>${a.flatMap(([n],e)=>{const s=le(n);return s?[`<v:shape id="_x0000_s${String(1025+e)}" type="#_x0000_t202" style="position:absolute;margin-left:80pt;margin-top:5pt;width:120pt;height:60pt;z-index:${String(e+1)};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${String(s.col+1)}, 15, ${String(s.row)}, 2, ${String(s.col+3)}, 15, ${String(s.row+4)}, 4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${String(s.row)}</x:Row><x:Column>${String(s.col)}</x:Column></x:ClientData></v:shape>`]:[]}).join("")}</xml>`}const xe=a=>`FF${a.slice(1).toUpperCase()}`;function Et(a){if(a.type==="dataBar"||a.type==="colorScale"||a.type==="iconSet")return{};const t={};for(const n of["bold","italic","underline","strike","color","fill","border","format"])a[n]!==void 0&&(t[n]=a[n]);return t}function At(a,t,n){const e=t.values!==void 0||t.blanks!==void 0,{conditions:s,top:r,average:l,color:f}=t,c=e?o("filters",{blank:t.blanks===!0?!0:void 0},(t.values??[]).map(i=>o("filter",{val:i})).join("")):s?o("customFilters",{and:s.length===2&&t.or!==!0?!0:void 0},s.map(i=>o("customFilter",{operator:i.operator==="equal"?void 0:i.operator,val:String(i.value)})).join("")):r?o("top10",{top:r.bottom===!0?!1:void 0,percent:r.percent===!0?!0:void 0,val:r.count}):l?o("dynamicFilter",{type:l==="above"?"aboveAverage":"belowAverage"}):f?.fill!==void 0?o("colorFilter",{dxfId:n({fill:f.fill})}):f?.font!==void 0?o("colorFilter",{dxfId:n({color:f.font}),cellColor:!1}):"";return o("filterColumn",{colId:a},c)}const k=a=>a===void 0?"":` s="${String(a)}"`,Ct=new Set(["#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A","#GETTING_DATA"]),we=a=>Ct.has(a.code),Tt=new Set(["width","height","hidden"]);function $e(a){if(!a)return;const t=Object.fromEntries(Object.entries(a).filter(([n])=>!Tt.has(n)));return Object.keys(t).length===0?void 0:t}const X=a=>A+o("Relationships",{xmlns:C.pkg},a.map(([t,n,e],s)=>o("Relationship",{Id:`rId${String(s+1)}`,Type:t,Target:n,TargetMode:e})).join(""));function _t(a,t){const n=t.formula?.node;if(n)return B(n,{isTable:s=>a.table(s)!==void 0,array:!0});const{value:e}=t;return e==null?'""':typeof e=="string"?`"${e.replaceAll('"','""')}"`:typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof U?e.code:String(e)}const Rt=(a,t)=>a.length===t.length&&a.every((n,e)=>n===t[e]),ye=a=>`$${V(a.left)}$${String(a.top+1)}:$${V(a.right)}$${String(a.bottom+1)}`;function Lt(a){const t=[],n=(e,s)=>o("definedName",{name:e.name,localSheetId:s,hidden:e.hidden===!0?!0:void 0},$(_t(a,e)));for(const e of a.names.values())t.push(n(e));return a.sheets.forEach((e,s)=>{for(const d of e.names.values())t.push(n(d,s));const r=e.filters.find(d=>!d.table);r&&t.push(o("definedName",{name:"_xlnm._FilterDatabase",localSheetId:s,hidden:!0},$(`${J(e.name)}${ye(r.area)}`)));const l=J(e.name),f=e.spec.print,c=f?.area===void 0?void 0:je(f.area);c&&t.push(o("definedName",{name:"_xlnm.Print_Area",localSheetId:s},$(`${l}${ye(c)}`)));const i=[f?.title_cols?.toUpperCase().replace(/([A-Z]+):([A-Z]+)/u,"$$$1:$$$2"),f?.title_rows?.replace(/(\d+):(\d+)/u,"$$$1:$$$2")].flatMap(d=>d===void 0?[]:[`${l}${d}`]);i.length>0&&t.push(o("definedName",{name:"_xlnm.Print_Titles",localSheetId:s},$(i.join(","))))}),t}function Mt(a){if(a===void 0)return{};const t=a===!0?{}:a;return{iterate:!0,iterateCount:t.max_iterations??de.max_iterations,iterateDelta:t.max_change??de.max_change}}export function writeXlsx(a,t={}){const n=a.wb,e=[];n.checks.length>0&&e.push(`${String(n.checks.length)} check${n.checks.length===1?"":"s"}: a file has no such thing`);const s=He(a);e.push(...s.left);const r=new Ze(g=>{const x=n.styleNamed(g),F=n.styleLook(g);if(!(!x||!F))return"own"in x?{name:x.own,look:F}:{name:x.builtin,builtinId:Me[x.builtin],look:F}}),l=new dt,f=new xt(n),c=new Qe,i=[["/xl/workbook.xml",T.sheet]],d=Math.max(0,n.sheets.findIndex(g=>g.spec.hidden!==!0));let h=1,u=!1;const m=new Map;let y=0,w=0,p=0,v=0;for(const[g,x]of n.sheets.entries()){const F=String(g+1),z=gt(x,a,t.file,e,t.tile),H=x.charts.filter(({spec:b})=>[b.categories,...b.series.flatMap(R=>[R.values,R.x])].some(R=>R?.endsWith("#"))).length;H>0&&e.push(`${x.name}: ${String(H)} chart${H===1?"":"s"} on a spill: ${H===1?"it reads":"they read"} the cells the spill covers now, and will not grow with it`);const re=new bt(x,a,r,l,t.cached!==!1,e,f,g,z,s.sheets.find(b=>b.sheet===x)),ve=re.write(c.part(`xl/worksheets/sheet${F}.xml`),g===d,h);u||=re.arrays,i.push([`/xl/worksheets/sheet${F}.xml`,T.worksheet]);const I=[];for(const b of ve){const R=`table${String(h)}.xml`;h+=1,c.add(`xl/tables/${R}`,b),i.push([`/xl/tables/${R}`,T.table]),I.push([`${E}table`,`../tables/${R}`])}const q=me(x);if(q.length>0||z.length>0){y+=1;const b=`drawing${String(y)}.xml`;c.add(`xl/drawings/${b}`,Ye(q,z)),i.push([`/xl/drawings/${b}`,T.drawing]),I.push([`${E}drawing`,`../drawings/${b}`]);const R=q.map(O=>{const P=Le(O.spec.type);P?p+=1:w+=1;const j=P?`chartEx${String(p)}.xml`:`chart${String(w)}.xml`;if(c.add(`xl/charts/${j}`,qe(a,x,O)),i.push([`/xl/charts/${j}`,P?Te:T.chart]),P){const M=String(p);c.add(`xl/charts/style${M}.xml`,Re(O.spec.type)),c.add(`xl/charts/colors${M}.xml`,_e()),i.push([`/xl/charts/style${M}.xml`,Ce]),i.push([`/xl/charts/colors${M}.xml`,ke]),c.add(`xl/charts/_rels/${j}.rels`,X([[Ae,`style${M}.xml`],[Se,`colors${M}.xml`]]))}return[P?Ee:`${E}chart`,`../charts/${j}`]});for(const O of z){const j=[...m].find(([,M])=>Rt(M,O.bytes))?.[0]??`image${String(m.size+1)}${O.file}`;m.set(j,O.bytes),R.push([`${E}image`,`../media/${j}`])}c.add(`xl/drawings/_rels/${b}.rels`,X(R))}const Y=Object.entries(x.spec.notes??{});if(Y.length>0){v+=1;const b=String(v);c.add(`xl/comments${b}.xml`,St(Y)),i.push([`/xl/comments${b}.xml`,T.comments]),c.add(`xl/drawings/vmlDrawing${b}.vml`,kt(Y)),I.push([`${E}vmlDrawing`,`../drawings/vmlDrawing${b}.vml`]),I.push([`${E}comments`,`../comments${b}.xml`])}for(const b of Object.values(x.spec.links??{}))b.startsWith("#")||I.push([`${E}hyperlink`,b,"External"]);I.length>0&&c.add(`xl/worksheets/_rels/sheet${F}.xml.rels`,X(I))}const S=n.sheets.length,_=f.columns.length>0;if(_){const g=`xl/worksheets/sheet${String(S+1)}.xml`;c.add(g,f.xml(l)),i.push([`/${g}`,T.worksheet])}const N=[...n.sheets,..._?[void 0]:[]].map((g,x)=>[`${E}worksheet`,`worksheets/sheet${String(x+1)}.xml`]);N.push([`${E}theme`,"theme/theme1.xml"]),N.push([`${E}styles`,"styles.xml"]),N.push([`${E}sharedStrings`,"sharedStrings.xml"]),u&&(N.push([`${E}sheetMetadata`,"metadata.xml"]),i.push(["/xl/metadata.xml",T.metadata]));const se=Lt(n),oe=n.sheets.map((g,x)=>o("sheet",{name:g.name,sheetId:x+1,state:g.spec.hidden===!0?"hidden":void 0,"r:id":`rId${String(x+1)}`}));_&&oe.push(o("sheet",{name:f.name,sheetId:S+1,state:"veryHidden","r:id":`rId${String(S+1)}`})),c.add("xl/workbook.xml",A+o("workbook",{xmlns:C.main,"xmlns:r":C.rel},o("workbookPr",{}),o("bookViews",{},o("workbookView",{activeTab:d===0?void 0:d})),o("sheets",{},oe.join("")),se.length>0?o("definedNames",{},se.join("")):"",o("calcPr",{calcId:nt,fullCalcOnLoad:!0,...Mt(n.file.iteration)}))),c.add("xl/_rels/workbook.xml.rels",X(N)),c.add("xl/styles.xml",A+r.xml()),l.write(c.part("xl/sharedStrings.xml")),c.add("xl/theme/theme1.xml",A+Ke(n.colors,Fe(n.theme))),u&&c.add("xl/metadata.xml",A+ct),c.add("docProps/core.xml",A+o("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},n.title===void 0?"":o("dc:title",{},$(n.title)))),c.add("docProps/app.xml",A+o("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},o("Application",{},"AllyHub"))),c.add("_rels/.rels",X([[`${E}officeDocument`,"xl/workbook.xml"],["http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"],[`${E}extended-properties`,"docProps/app.xml"]])),i.push(["/xl/styles.xml",T.styles],["/xl/sharedStrings.xml",T.strings],["/xl/theme/theme1.xml",T.theme],["/docProps/core.xml",T.core],["/docProps/app.xml",T.app]);const be=[...m].sort(([g],[x])=>g.localeCompare(x));for(const[g,x]of be)c.add(`xl/media/${g}`,x);return c.add("[Content_Types].xml",A+o("Types",{xmlns:C.types},o("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),o("Default",{Extension:"xml",ContentType:"application/xml"}),v>0?o("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}):"",[...new Set([...m.keys()].map(g=>g.split(".").pop()??""))].sort().map(g=>o("Default",{Extension:g,ContentType:`image/${tt[g]??g}`})).join(""),i.map(([g,x])=>o("Override",{PartName:g,ContentType:x})).join(""))),{bytes:c.finish(),left:e}}function Ft(a){const t=(s,r,l)=>r.length===0?"":o(s,{count:r.length,manualBreakCount:r.length},r.map(f=>o("brk",{id:f,max:l,man:!0})).join("")),n=[...new Set(a?.rows??[])].sort((s,r)=>s-r).map(s=>s-1),e=[...new Set((a?.cols??[]).map(s=>ae(s.toUpperCase())).filter(s=>s!==void 0&&s>0))].sort((s,r)=>s-r);return t("rowBreaks",n,G-1)+t("colBreaks",e,Z-1)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{createHash as b}from"node:crypto";import{readFile as
|
|
2
|
+
import{createHash as b}from"node:crypto";import{readFile as F}from"node:fs/promises";import{join as N,posix as S}from"node:path";import{problem as J}from"@allyhub/diagnostics";import{sdkEntriesOf as j}from"@allyhub/build";import{cellName as k,chartFormula as C,checkWorkbook as E,readCells as A,readSheetFile as D,seededRandom as L,SharedFormula as M,tableRows as $,textOf as O,CellError as R}from"@allyhub/sheet";import W from"./build-plugins.js";import{readSheetSource as x,sheetCodeOf as H,sheetFilePath as K,workbookFiles as P}from"./code.js";export const LEND={sdk:j(W)};function T(o,t,l,i,h){const n={};for(const e of l.tables){const a=$(i,e),d=$(i,e,{values:"shown"}),c=b("sha256").update(h).update(JSON.stringify(a)).update(JSON.stringify(d)).digest("hex");n[`${o}#${e.name}`]={sha256:c,value:a,shown:d},n[`${t}#${e.name}`]={sha256:c,value:a,shown:d}}const m=(e,a,d)=>{const c=b("sha256").update(h).update(e).update(JSON.stringify(a)).update(JSON.stringify(d)).digest("hex");n[`${o}#${e}`]={sha256:c,value:a,shown:d},n[`${t}#${e}`]={sha256:c,value:a,shown:d}};for(const e of l.names.values()){if(e.hidden===!0||e.sheet!==void 0)continue;const a=new M(C(e.name),0,0,e.source),d=l.sheets[0];if(!a.node||!d)continue;const c=A(i,d,a),g=c.map(r=>v(r.value)),u=c.map(O);c.length===1?m(e.name,g[0],u[0]):c.length>1&&m(e.name,g,u)}for(const e of l.sheets){const a=e.used;if(!a)continue;const d=l.tables.filter(r=>r.sheet===e).map(r=>r.area),c=(r,f)=>d.some(p=>r>=p.top&&r<=p.bottom&&f>=p.left&&f<=p.right),g={},u={};for(let r=a.top;r<=a.bottom;r++)for(let f=a.left;f<=a.right;f++){if(c(r,f))continue;const p=i.value(e,r,f);if(p===null)continue;const s=k({row:r,col:f});g[s]=v(p),u[s]=O({value:p,sheet:e,row:r,col:f})}Object.keys(g).length>0&&m(`${e.name}!`,g,u)}return n}const v=o=>o instanceof R?o.code:o;async function w(o,t,l){const i=[],h=t.entry,n=await x(o,h,l?{meta:l}:{lend:LEND}).catch(()=>{});if(!n)return{};i.push(...n.problems);const{csv:m,generated:e}=n,a=b("sha256").update(n.text);for(const s of m.values())a.update(s);e&&a.update(JSON.stringify(e));const d=a.digest("hex"),c=E(P(o,n),{random:L(d)}),g=K(n);for(const s of c.problems){const y=g(s.file);i.push(J("AK-M009",`${y}${s.line===void 0?"":`:${String(s.line)}`}: ${s.message}.`,{where:{file:y,...s.line===void 0?{}:{line:s.line}}}))}const{workbook:u,calc:r}=c,f=u?.title?.trim();return{sheet:{dir:t.dir,place:t.id,file:h,...f?{title:f}:{},sheets:u?.sheets.map(s=>s.name)??[],tables:u?.tables.map(s=>({name:s.name,rows:s.rows}))??[],files:[h,...[...m.keys()].map(s=>n.at.get(s)??S.join(t.dir,s)),...n.code===void 0?[]:[n.code]],...e?{generated:e}:{},...n.failed?{codeFailed:!0}:{}},problems:i,files:[...[...m.keys()].map(s=>({path:n.at.get(s)??S.join(t.dir,s),role:"table"})),...n.code===void 0?[]:[{path:n.code,role:"code"}]],...u&&r?{data:T(t.id,h,u,r,d)}:{}}}export async function readSheets(o,t,l){const i=[],h=[];let n={};for(const m of t){const e=await w(o,m,l);e.sheet&&i.push(e.sheet),h.push(...e.problems??[]),n={...n,...e.data}}return{sheets:i,problems:h,data:n}}const V={lend:(o,t)=>w(t.root,o,t.meta),code:async(o,t)=>{const l=await F(N(t.root,o.entry),"utf8").catch(()=>"");if(H(o.entry,l)===void 0)return{failed:!1};const i=await x(t.root,o.entry,{lend:t.lend}).catch(()=>{});return{failed:i?.failed??!0,...i?.generated?{value:i.generated}:{}}},unreadable:o=>D(o).problems.filter(t=>t.message.startsWith("not YAML")).map(t=>t.message),render:async(o,t)=>(await import("./export.js")).renderSheet(o,t)};export default V;
|