@allyhub/sdk 0.4.0 → 0.5.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/{node_modules → dist/node_modules}/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +3 -0
- package/{node_modules/@allyhub-next/slides-core → dist/node_modules/@allyhub-next/chart}/dist/chart.d.ts +26 -15
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/chart/dist/index.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/chart/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/chart/package.json +14 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/reference.d.ts +0 -86
- package/dist/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +4908 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/slides.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +2146 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/formats/package.json +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/editor.d.ts +10 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/editor.js +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/notes.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/tools.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/protocol/package.json +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/lock.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/runtimes.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.js +4 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/package.json +1 -1
- package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/moire.d.ts +7 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/phone.d.ts +3 -1
- package/dist/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/address.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/address.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/charts.d.ts +204 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/charts.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/code.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/code.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/hint.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/hint.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rectangles.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rectangles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rules.d.ts +170 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/styles.d.ts +117 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +323 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/arrange.d.ts +68 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/arrange.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +21 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +152 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +69 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/distributions.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/distributions.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/special.d.ts +29 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/special.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +50 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/check.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/csv.d.ts +62 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/csv.js +12 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +64 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/edit.d.ts +154 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/edit.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +11 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/file.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/files.d.ts +24 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/files.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/fill.d.ts +30 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/fill.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/filter.d.ts +29 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/filter.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +9 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/ast.d.ts +113 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/ast.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/move.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/move.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/parse.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/parse.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/print.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/print.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/rewrite.d.ts +65 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/rewrite.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/walk.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/formula/walk.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/generated.d.ts +46 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/generated.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +34 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +20 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/import.d.ts +11 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/import.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.d.ts +25 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/patch.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/patch.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/profile.d.ts +30 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/profile.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/rules.d.ts +56 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/scenario.d.ts +42 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/scenario.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/series.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/series.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/sort.d.ts +24 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/sort.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/validate.d.ts +26 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/validate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.d.ts +67 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +315 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/write.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/write.js +21 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +42 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/colors.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/colors.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +21 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +17 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +44 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/index.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/index.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/numfmt.d.ts +8 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/numfmt.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +117 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/theme.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/theme.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/xml.js +3 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +21 -0
- package/dist/node_modules/@allyhub-next/slides-core/LICENSE +241 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/chart-api.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/chart-file.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/model.d.ts +2 -5
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/resolve.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/video-core/LICENSE +241 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/fact.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/formats.d.ts +0 -28
- package/dist/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/measure.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/problem.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
- package/{node_modules → dist/node_modules}/@allyhub-next/video-core/package.json +1 -1
- package/dist/phone.js +1 -1
- package/dist/sheets.d.ts +2 -0
- package/dist/sheets.js +2 -0
- package/docs/README.md +2 -2
- package/docs/defaults.md +1 -0
- package/docs/project.md +1 -1
- package/docs/scenery.md +1 -1
- package/docs/sheets.md +377 -84
- package/docs/slides.md +1 -1
- package/docs/speech.md +1 -1
- package/package.json +11 -19
- package/node_modules/@allyhub-next/formats/dist/data/reference.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +0 -214
- package/node_modules/@allyhub-next/formats/dist/data/sheet.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/data/slides.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/index.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/items.js +0 -2
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +0 -719
- package/node_modules/@allyhub-next/formats/dist/schemas.js +0 -2
- package/node_modules/@allyhub-next/protocol/dist/notes.js +0 -2
- package/node_modules/@allyhub-next/protocol/dist/tools.js +0 -2
- package/node_modules/@allyhub-next/runtimes/dist/lock.js +0 -2
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +0 -3
- package/node_modules/@allyhub-next/runtimes/pins/exceljs/package-lock.json +0 -2533
- package/node_modules/@allyhub-next/runtimes/pins/exceljs/package.json +0 -8
- package/node_modules/@allyhub-next/scenery/dist/phone.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/chart-api.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/chart-file.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/chart.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/index.js +0 -2
- package/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +0 -23
- package/node_modules/@allyhub-next/slides-core/dist/strict.js +0 -2
- package/node_modules/@allyhub-next/video-core/dist/fact.js +0 -2
- package/node_modules/@allyhub-next/video-core/dist/formats.js +0 -2
- package/node_modules/@allyhub-next/video-core/dist/measure.js +0 -5
- package/node_modules/@allyhub-next/video-core/dist/problem.js +0 -2
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/at-cut.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/at-cut.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/decode.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/decode.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/envelope.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/envelope.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/levels.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/levels.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/master.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/master.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/music.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/music.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/decode.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/decode.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ebur128.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ffmpeg.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/loudness.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/loudness.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/master.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/master.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/measure.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/measure.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/mix.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/mix.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/plan.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/plan.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recorded.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recorded.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/bandwidth.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/chain.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/chain.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/dynamics.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fft.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fft.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/filters.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/filters.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/loudness.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/measure.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/measure.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/mic.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/mic.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/noise.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/noise.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/presets.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/presets.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/room.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/room.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/setup.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/setup.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/vec.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/vec.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/render.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/render.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/sfx.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/sfx.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/shape.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/shape.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/voice.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/voice.js +0 -0
- /package/{node_modules/@allyhub-next/formats → dist/node_modules/@allyhub-next/chart}/LICENSE +0 -0
- /package/{node_modules/@allyhub-next/protocol → dist/node_modules/@allyhub-next/formats}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/comments.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/comments.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/config.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/config.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/edits.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/edits.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/elements.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/elements.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/faces.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/faces.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/file.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/file.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/gen.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/gen.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/messages.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/messages.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/script.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/script.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/words.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/words.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/layout.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/layout.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/note-shape.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/note-shape.js +0 -0
- /package/{node_modules/@allyhub-next/runtimes → dist/node_modules/@allyhub-next/protocol}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/app.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/app.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/auth.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/auth.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cli.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cli.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cloud.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cloud.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/files.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/files.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/jsonrpc.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/jsonrpc.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/registry.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/registry.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/routes.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/routes.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/runtimes.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/runtimes.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/teams.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/teams.js +0 -0
- /package/{node_modules/@allyhub-next/scenery → dist/node_modules/@allyhub-next/runtimes}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/bundled.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/bundled.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/download.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/download.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/errors.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/errors.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/home.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/home.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/manifest.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/manifest.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/node-program.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/node-program.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/packages.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/packages.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/unpack.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/unpack.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/manifest.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/docx/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/docx/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/gltf-tools/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/gltf-tools/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/manifold-3d/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/manifold-3d/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/onnxruntime-node/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/onnxruntime-node/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/sherpa-onnx-node/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/tesseract.js/package-lock.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/tesseract.js/package.json +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/schemas/runtimes.schema.json +0 -0
- /package/{node_modules/@allyhub-next/slides-core → dist/node_modules/@allyhub-next/scenery}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/NOTICE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/aim.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/aim.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/bake.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/bake.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/camera.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/camera.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/curve.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/curve.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/define.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/define.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/fit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/fit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/glass.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/glass.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/handheld.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/handheld.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/hull.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/hull.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/lens.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/lens.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/moire.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/motion.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/motion.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/move.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/move.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/noise.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/noise.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/report.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/report.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen-focus.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen-focus.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/solve.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/solve.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/timing.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/timing.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/vec.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/vec.js +0 -0
- /package/{node_modules/@allyhub-next/video-core → dist/node_modules/@allyhub-next/sheet}/LICENSE +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/animation.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/animation.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/api.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/api.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/capabilities.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/capabilities.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/check.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/check.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/enums.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/enums.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/file.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/file.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/measure.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/measure.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/model.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/office.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/office.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/path.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/path.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/placeholders.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/placeholders.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/resolve.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/script.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/script.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/stage.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/stage.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/theme.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/theme.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/units.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/units.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/anchors.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/anchors.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/audio-types.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/audio-types.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/backdrop.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/backdrop.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/captions.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/captions.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/console.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/console.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/contrast.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/contrast.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/cut-report.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/cut-report.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edits.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edits.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/export.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/export.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/footage-motion.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/footage-motion.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/gen.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/gen.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/index.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/index.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/look.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/look.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/marks.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/marks.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/matrix.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/matrix.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/media.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/media.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/messages.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/messages.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/motion.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/motion.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/music.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/music.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/piece.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/piece.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/placement.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/placement.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/render-types.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/render-types.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/schema.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/schema.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script-edit.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script-edit.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/seams.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/seams.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/sound-under.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/sound-under.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/speech.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/speech.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timeline.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timeline.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timing.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timing.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transcript.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transcript.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transition.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transition.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/voice.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/voice.js +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/words.d.ts +0 -0
- /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/words.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CellError as O,ERR as e}from"../../values.js";import{toBool as L,toNumber as C}from"../coerce.js";import{alias as R,scalar as g}from"./define.js";import{betaI as s,erf as G,erfc as v,gamma as q,gammaP as E,gammaQ as F,logGamma as i,normalCdf as U,normalInv as m,normalPdf as l,solve as h}from"./special.js";function c(t,r,n,M){g(t,r,n,(...N)=>{const u=[];for(const o of N){const I=o===void 0?Number.NaN:C(o);if(I instanceof O)return I;u.push(I)}return M(...u)})}function a(t,r,n,M=0){g(t,r+1,r+1+M,(...N)=>{const u=L(N[r]);if(u instanceof O)return u;const o=[];for(const[I,f]of N.entries()){if(I===r)continue;const S=f===void 0?Number.NaN:C(f);if(S instanceof O)return S;o.push(S)}return n(u,...o)})}const z=t=>Number.isFinite(t)?t:e.NUM;a("NORM.DIST",3,(t,r=0,n=0,M=0)=>{if(M<=0)return e.NUM;const N=(r-n)/M;return t?U(N):l(N)/M}),c("NORM.INV",3,3,(t=0,r=0,n=0)=>t<=0||t>=1||n<=0?e.NUM:r+n*m(t)),g("NORM.S.DIST",1,2,(t,r)=>{const n=C(t);if(n instanceof O)return n;const M=r===void 0?!0:L(r);return M instanceof O?M:M?U(n):l(n)}),c("NORMSDIST",1,1,(t=0)=>U(t)),c("NORM.S.INV",1,1,(t=0)=>t<=0||t>=1?e.NUM:m(t)),a("LOGNORM.DIST",3,(t,r=0,n=0,M=0)=>{if(r<=0||M<=0)return e.NUM;const N=(Math.log(r)-n)/M;return t?U(N):l(N)/(r*M)}),c("LOGNORMDIST",3,3,(t=0,r=0,n=0)=>t<=0||n<=0?e.NUM:U((Math.log(t)-r)/n)),c("LOGNORM.INV",3,3,(t=0,r=0,n=0)=>t<=0||t>=1||n<=0?e.NUM:Math.exp(r+n*m(t))),c("STANDARDIZE",3,3,(t=0,r=0,n=0)=>n<=0?e.NUM:(t-r)/n),c("GAUSS",1,1,(t=0)=>U(t)-.5),c("PHI",1,1,(t=0)=>l(t)),c("FISHER",1,1,(t=0)=>t<=-1||t>=1?e.NUM:.5*Math.log((1+t)/(1-t))),c("FISHERINV",1,1,(t=0)=>{const r=Math.exp(2*t);return(r-1)/(r+1)}),c("CONFIDENCE.NORM",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(n);return t<=0||t>=1||r<=0||M<1?e.NUM:m(1-t/2)*r/Math.sqrt(M)});const T=(t,r)=>s(r/2,.5,r/(r+t*t)),W=(t,r)=>t<0?T(t,r)/2:1-T(t,r)/2;a("T.DIST",2,(t,r=0,n=0)=>{const M=Math.trunc(n);return M<1?e.NUM:t?W(r,M):Math.exp(i((M+1)/2)-i(M/2))/Math.sqrt(M*Math.PI)*(1+r*r/M)**(-(M+1)/2)}),c("T.DIST.2T",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return t<0||n<1?e.NUM:T(t,n)}),c("T.DIST.RT",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return n<1?e.NUM:t<0?1-T(t,n)/2:T(t,n)/2}),c("TDIST",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(r),N=Math.trunc(n);return t<0||M<1||N!==1&&N!==2?e.NUM:T(t,M)*N/2}),c("T.INV",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return t<=0||t>=1||n<1?e.NUM:t===.5?0:t<.5?-V(2*t,n):V(2*(1-t),n)});const V=(t,r)=>h(n=>-T(n,r),-t,0,1);c("T.INV.2T",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return t<=0||t>1||n<1?e.NUM:V(t,n)}),c("CONFIDENCE.T",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(n);return t<=0||t>=1||r<=0||M<1?e.NUM:M===1?e.DIV0:V(t,M-1)*r/Math.sqrt(M)}),a("CHISQ.DIST",2,(t,r=0,n=0)=>{const M=Math.trunc(n);return r<0||M<1?e.NUM:t?E(M/2,r/2):r===0?M===2?.5:M<2?e.NUM:0:Math.exp((M/2-1)*Math.log(r)-r/2-M/2*Math.LN2-i(M/2))}),c("CHISQ.DIST.RT",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return t<0||n<1?e.NUM:F(n/2,t/2)}),c("CHISQ.INV",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return t<0||t>=1||n<1?e.NUM:t===0?0:h(M=>E(n/2,M/2),t,0,n)}),c("CHISQ.INV.RT",2,2,(t=0,r=0)=>{const n=Math.trunc(r);return t<=0||t>1||n<1?e.NUM:t===1?0:h(M=>-F(n/2,M/2),-t,0,n)});const P=(t,r,n)=>s(r/2,n/2,r*t/(r*t+n)),H=(t,r,n)=>s(n/2,r/2,n/(r*t+n));a("F.DIST",3,(t,r=0,n=0,M=0)=>{const N=Math.trunc(n),u=Math.trunc(M);if(r<0||N<1||u<1)return e.NUM;if(t)return P(r,N,u);if(r===0)return N===2?1:N<2?e.NUM:0;const o=i((N+u)/2)-i(N/2)-i(u/2)+N/2*Math.log(N/u)+(N/2-1)*Math.log(r)-(N+u)/2*Math.log(1+N*r/u);return Math.exp(o)}),c("F.DIST.RT",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(r),N=Math.trunc(n);return t<0||M<1||N<1?e.NUM:H(t,M,N)}),c("F.INV",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(r),N=Math.trunc(n);return t<0||t>1||M<1||N<1?e.NUM:t===0?0:t===1?e.NUM:h(u=>P(u,M,N),t,0,1)}),c("F.INV.RT",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(r),N=Math.trunc(n);return t<=0||t>1||M<1||N<1?e.NUM:t===1?0:h(u=>-H(u,M,N),-t,0,1)}),a("GAMMA.DIST",3,(t,r=0,n=0,M=0)=>r<0||n<=0||M<=0?e.NUM:t?E(n,r/M):r===0?n===1?1/M:n<1?e.NUM:0:Math.exp((n-1)*Math.log(r)-r/M-n*Math.log(M)-i(n))),c("GAMMA.INV",3,3,(t=0,r=0,n=0)=>t<0||t>=1||r<=0||n<=0?e.NUM:t===0?0:n*h(M=>E(r,M),t,0,r));const X=(t,r,n)=>Math.exp(i(r+n)-i(r)-i(n)+(r-1)*Math.log(t)+(n-1)*Math.log1p(-t));a("BETA.DIST",3,(t,r=0,n=0,M=0,N=0,u=1)=>{const o=Number.isNaN(N)?0:N,I=Number.isNaN(u)?1:u;if(n<=0||M<=0||r<o||r>I||o===I)return e.NUM;const f=(r-o)/(I-o);return t?s(n,M,f):X(f,n,M)/(I-o)},2),c("BETADIST",3,5,(t=0,r=0,n=0,M=0,N=1)=>{const u=Number.isNaN(M)?0:M,o=Number.isNaN(N)?1:N;return r<=0||n<=0||t<u||t>o||u===o?e.NUM:s(r,n,(t-u)/(o-u))}),c("BETA.INV",3,5,(t=0,r=0,n=0,M=0,N=1)=>{const u=Number.isNaN(M)?0:M,o=Number.isNaN(N)?1:N;return t<=0||t>1||r<=0||n<=0||u>=o?e.NUM:u+(o-u)*h(I=>s(r,n,I),t,0,.5,1)}),R("BETAINV","BETA.INV");const D=(t,r)=>i(t+1)-i(r+1)-i(t-r+1),d=(t,r,n)=>n===0?t===0?1:0:n===1?t===r?1:0:Math.exp(D(r,t)+t*Math.log(n)+(r-t)*Math.log1p(-n)),Q=(t,r,n)=>t>=r||n===0?1:n===1?0:1-s(t+1,r-t,n);a("BINOM.DIST",3,(t,r=0,n=0,M=0)=>{const N=Math.trunc(r),u=Math.trunc(n);return N<0||N>u||M<0||M>1?e.NUM:t?Q(N,u,M):d(N,u,M)}),c("BINOM.INV",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(t);if(M<0||r<=0||r>=1||n<=0||n>=1)return e.NUM;for(let N=0;N<M;N++)if(Q(N,M,r)>=n)return N;return M}),c("BINOM.DIST.RANGE",3,4,(t=0,r=0,n=0,M=Number.NaN)=>{const N=Math.trunc(t),u=Math.trunc(n),o=Number.isNaN(M)?u:Math.trunc(M);if(N<0||r<0||r>1||u<0||u>N||o<u||o>N)return e.NUM;let I=0;for(let f=u;f<=o;f++)I+=d(f,N,r);return I}),a("NEGBINOM.DIST",3,(t,r=0,n=0,M=0)=>{const N=Math.trunc(r),u=Math.trunc(n);return N<0||u<1||M<0||M>1?e.NUM:t?s(u,N+1,M):M===0||M===1?M===1&&N===0?1:0:Math.exp(D(N+u-1,u-1)+u*Math.log(M)+N*Math.log1p(-M))}),c("NEGBINOMDIST",3,3,(t=0,r=0,n=0)=>{const M=Math.trunc(t),N=Math.trunc(r);return M<0||N<1||n<0||n>1?e.NUM:n===0||n===1?n===1&&M===0?1:0:Math.exp(D(M+N-1,N-1)+N*Math.log(n)+M*Math.log1p(-n))}),a("POISSON.DIST",2,(t,r=0,n=0)=>{const M=Math.trunc(r);return M<0||n<0?e.NUM:n===0?t||M===0?1:0:t?F(M+1,n):Math.exp(M*Math.log(n)-n-i(M+1))}),a("EXPON.DIST",2,(t,r=0,n=0)=>r<0||n<=0?e.NUM:t?-Math.expm1(-n*r):n*Math.exp(-n*r)),a("WEIBULL.DIST",3,(t,r=0,n=0,M=0)=>{if(r<0||n<=0||M<=0)return e.NUM;const N=(r/M)**n;return t?-Math.expm1(-N):n/M**n*r**(n-1)*Math.exp(-N)});const B=(t,r,n,M)=>Math.exp(D(n,t)+D(M-n,r-t)-D(M,r));a("HYPGEOM.DIST",4,(t,r=0,n=0,M=0,N=0)=>{const u=Math.trunc(r),o=Math.trunc(n),I=Math.trunc(M),f=Math.trunc(N);if(u<0||u>o||u>I||o>f||I>f||o<=0||I<=0||f<=0||u<o-f+I)return e.NUM;if(!t)return B(u,o,I,f);let S=0;for(let A=Math.max(0,o-f+I);A<=u;A++)S+=B(A,o,I,f);return Math.min(1,S)}),c("HYPGEOMDIST",4,4,(t=0,r=0,n=0,M=0)=>{const N=Math.trunc(t),u=Math.trunc(r),o=Math.trunc(n),I=Math.trunc(M);return N<0||N>u||N>o||u>I||o>I||N<u-I+o?e.NUM:B(N,u,o,I)}),c("GAMMA",1,1,(t=0)=>z(q(t))),c("GAMMALN",1,1,(t=0)=>t<=0?e.NUM:i(t)),R("GAMMALN.PRECISE","GAMMALN"),c("ERF",1,2,(t=0,r=Number.NaN)=>Number.isNaN(r)?G(t):G(r)-G(t)),c("ERFC",1,1,(t=0)=>v(t)),R("ERF.PRECISE","ERF"),R("ERFC.PRECISE","ERFC");for(const[t,r]of[["NORMDIST","NORM.DIST"],["NORMINV","NORM.INV"],["NORMSINV","NORM.S.INV"],["LOGINV","LOGNORM.INV"],["CHIINV","CHISQ.INV.RT"],["CHIDIST","CHISQ.DIST.RT"],["FDIST","F.DIST.RT"],["FINV","F.INV.RT"],["BINOMDIST","BINOM.DIST"],["CRITBINOM","BINOM.INV"],["POISSON","POISSON.DIST"],["EXPONDIST","EXPON.DIST"],["GAMMADIST","GAMMA.DIST"],["GAMMAINV","GAMMA.INV"],["TINV","T.INV.2T"],["WEIBULL","WEIBULL.DIST"],["CONFIDENCE","CONFIDENCE.NORM"]])R(t,r);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{MAX_COLUMNS as Q,MAX_ROWS as j}from"../../address.js";import{compareForSort as q}from"../../sort.js";import{CellError as u,ERR as a,Matrix as E}from"../../values.js";import{toBool as G,toNumber as k,toText as z}from"../coerce.js";import{Lambda as x,Missing as N}from"../types.js";import{cellsOf as m,many as M,raw as w}from"./define.js";const J=5e6,C=n=>Array.from({length:n.rows},(o,e)=>Array.from({length:n.cols},(t,r)=>n.at(e,r))),U=n=>{const o=n[0]?.length??0;return new E(n.length,o,n.flat())},L=n=>{const o=n[0]?.length??0;return Array.from({length:o},(e,t)=>n.map(r=>r[t]??null))};function O(n,o){if(!(n===void 0||n instanceof N))return o.calc.scalar(n,o.frame)}function A(n,o,e){const t=O(n,o);return t==null?e:k(t)}function S(n,o,e){const t=O(n,o);return t==null?e:G(t)}function g(n,o,e){if(n===void 0||n instanceof N)return[e];const t=m(n,o);if(t instanceof u)return t;const r=[];for(let s=0;s<t.rows;s++)for(let f=0;f<t.cols;f++){const i=k(t.at(s,f));if(i instanceof u)return i;r.push(Math.trunc(i))}return r}const T=n=>n===null||n==="";function W(n,o,e){if(T(n)||T(o))return T(n)&&T(o)?0:T(n)?1:-1;const t=q(n,o);return e?-t:t}function Z(n){return n instanceof u?n:n===null?!1:typeof n=="boolean"?n:typeof n=="number"?n!==0:a.VALUE}w("FILTER",2,3,(n,o)=>{const e=m(n[0],o),t=m(n[1],o);if(e instanceof u)return e;if(t instanceof u)return t;if(t.rows>1&&t.cols>1)return a.VALUE;const r=t.cols===1&&t.rows===e.rows?!0:t.rows===1&&t.cols===e.cols?!1:void 0;if(r===void 0)return a.VALUE;const s=C(e),f=r?s:L(s),i=[];for(let c=0;c<f.length;c++){const l=Z(r?t.at(c,0):t.at(0,c));if(l instanceof u)return l;l&&i.push(f[c]??[])}return i.length===0?n[2]===void 0||n[2]instanceof N?a.CALC:n[2]:U(r?i:L(i))}),w("SORT",1,4,(n,o)=>{const e=m(n[0],o);if(e instanceof u)return e;const t=g(n[1],o,1);if(t instanceof u)return t;const r=g(n[2],o,1);if(r instanceof u)return r;const s=S(n[3],o,!1);if(s instanceof u)return s;const f=C(e),i=s?L(f):f,c=i[0]?.length??0;if(r.length!==1&&r.length!==t.length)return a.VALUE;if(t.some(h=>h<1||h>c))return a.VALUE;if(r.some(h=>h!==1&&h!==-1))return a.VALUE;const l=i.map((h,d)=>({line:h,index:d})).sort((h,d)=>{for(const[y,p]of t.entries()){const R=r[r.length===1?0:y]??1,V=W(h.line[p-1]??null,d.line[p-1]??null,R<0);if(V!==0)return V}return h.index-d.index}).map(h=>h.line);return U(s?L(l):l)}),w("SORTBY",2,M,(n,o)=>{const e=m(n[0],o);if(e instanceof u)return e;const t=[];let r;for(let c=1;c<n.length;c+=2){const l=m(n[c],o);if(l instanceof u)return l;if(l.rows>1&&l.cols>1)return a.VALUE;const h=l.cols===1&&l.rows===e.rows,d=l.rows===1&&l.cols===e.cols;if(!h&&!d)return a.VALUE;const y=r??h;if(y?!h:!d)return a.VALUE;r=y;const p=A(n[c+1],o,1);if(p instanceof u)return p;if(p!==1&&p!==-1)return a.VALUE;t.push({values:C(l).flat(),descending:p<0})}const s=C(e),i=(r===!1?L(s):s).map((c,l)=>({line:c,index:l})).sort((c,l)=>{for(const{values:h,descending:d}of t){const y=W(h[c.index]??null,h[l.index]??null,d);if(y!==0)return y}return c.index-l.index}).map(c=>c.line);return U(r===!1?L(i):i)});const v=n=>n instanceof u?`e${n.code}`:typeof n=="string"?`s${n.toLowerCase()}`:`${typeof n}${String(n)}`;w("UNIQUE",1,3,(n,o)=>{const e=m(n[0],o);if(e instanceof u)return e;const t=S(n[1],o,!1);if(t instanceof u)return t;const r=S(n[2],o,!1);if(r instanceof u)return r;const s=C(e),f=t?L(s):s,i=new Map;for(const l of f){const h=l.map(v).join("\0"),d=i.get(h);d?d.count+=1:i.set(h,{line:l,count:1})}const c=[...i.values()].filter(l=>!r||l.count===1).map(l=>l.line);return c.length===0?a.CALC:U(t?L(c):c)});function _(n,o){if(n instanceof u)return n;if(o instanceof u)return o;const e=Math.trunc(n),t=Math.trunc(o);return e<0||t<0?a.VALUE:e===0||t===0?a.CALC:e>j||t>Q||e*t>J?a.VALUE:{rows:e,cols:t}}w("SEQUENCE",1,4,(n,o)=>{const e=_(A(n[0],o,1),A(n[1],o,1));if(e instanceof u)return e;const t=A(n[2],o,1);if(t instanceof u)return t;const r=A(n[3],o,1);if(r instanceof u)return r;const s=new Array(e.rows*e.cols);for(let f=0;f<s.length;f++)s[f]=t+f*r;return new E(e.rows,e.cols,s)}),w("RANDARRAY",0,5,(n,o)=>{const e=_(A(n[0],o,1),A(n[1],o,1));if(e instanceof u)return e;const t=A(n[2],o,0);if(t instanceof u)return t;const r=A(n[3],o,1);if(r instanceof u)return r;const s=S(n[4],o,!1);if(s instanceof u)return s;if(t>r)return a.VALUE;if(s&&(!Number.isInteger(t)||!Number.isInteger(r)))return a.VALUE;const f=new Array(e.rows*e.cols);for(let i=0;i<f.length;i++){const c=o.calc.random();f[i]=s?t+Math.floor(c*(r-t+1)):t+c*(r-t)}return new E(e.rows,e.cols,f)},{volatile:!0});function P(n,o){if(n===void 0||n instanceof N)return[];const e=m(n,o);if(e instanceof u)return e;const t=[];for(const r of C(e).flat()){if(r===null)continue;const s=z(r);if(s instanceof u)return s;t.push(s)}return t}function B(n,o,e){const t=e?n.toLowerCase():n,r=(e?o.map(c=>c.toLowerCase()):[...o]).sort((c,l)=>l.length-c.length),s=[];let f=0,i=0;for(;i<n.length;){const c=r.find(l=>l!==""&&t.startsWith(l,i));c===void 0?i+=1:(s.push(n.slice(f,i)),i+=c.length,f=i)}return s.push(n.slice(f)),s}w("TEXTSPLIT",2,6,(n,o)=>{const e=O(n[0],o);if(e instanceof u)return e;const t=z(e??"");if(t instanceof u)return t;const r=P(n[1],o);if(r instanceof u)return r;const s=P(n[2],o);if(s instanceof u)return s;if(r.length===0&&s.length===0)return a.VALUE;if(r.includes("")||s.includes(""))return a.VALUE;const f=S(n[3],o,!1);if(f instanceof u)return f;const i=A(n[4],o,0);if(i instanceof u)return i;const c=O(n[5],o)??a.NA,l=i===1,d=(s.length===0?[t]:B(t,s,l)).filter(p=>!(f&&p==="")).map(p=>{const R=r.length===0?[p]:B(p,r,l);return f?R.filter(V=>V!==""):R}),y=Math.max(0,...d.map(p=>p.length));return d.length===0||y===0?a.CALC:U(d.map(p=>Array.from({length:y},(R,V)=>p[V]??c)))});const b=(n,o)=>{const e=o.calc.flat(n);return e instanceof E?e.at(0,0):e};w("MAP",2,M,(n,o)=>{const e=n[n.length-1];if(!(e instanceof x))return a.VALUE;const t=[];for(const c of n.slice(0,-1)){const l=m(c,o);if(l instanceof u)return l;t.push(l)}const r=t[0];if(!r)return a.VALUE;const{rows:s,cols:f}=r;if(t.some(c=>c.rows!==s||c.cols!==f))return a.VALUE;const i=new Array(s*f);for(let c=0;c<s;c++)for(let l=0;l<f;l++)i[c*f+l]=b(o.calc.apply(e,t.map(h=>h.at(c,l))),o);return new E(s,f,i)});function I(n,o){const e=n.length===3,t=n[n.length-1];if(!(t instanceof x))return a.VALUE;const r=m(n[e?1:0],o);return r instanceof u?r:{start:e?O(n[0],o)??null:r.at(0,0),cells:r,fn:t}}w("REDUCE",2,3,(n,o)=>{const e=I(n,o);if(e instanceof u)return e;const{cells:t,fn:r}=e,s=n.length===3?0:1;let f=e.start;for(let i=s;i<t.rows*t.cols;i++)f=b(o.calc.apply(r,[f,t.at(Math.floor(i/t.cols),i%t.cols)]),o);return f}),w("SCAN",2,3,(n,o)=>{const e=I(n,o);if(e instanceof u)return e;const{cells:t,fn:r}=e,s=t.rows*t.cols,f=n.length===3?0:1,i=new Array(s);let c=e.start;f===1&&(i[0]=c);for(let l=f;l<s;l++)c=b(o.calc.apply(r,[c,t.at(Math.floor(l/t.cols),l%t.cols)]),o),i[l]=c;return new E(t.rows,t.cols,i)});const Y=n=>(o,e)=>{const t=m(o[0],e);if(t instanceof u)return t;const r=o[1];if(!(r instanceof x))return a.VALUE;const s=C(t),i=(n?s:L(s)).map(c=>b(e.calc.apply(r,[n?new E(1,c.length,c):new E(c.length,1,c)]),e));return n?new E(i.length,1,i):new E(1,i.length,i)};w("BYROW",2,2,Y(!0)),w("BYCOL",2,2,Y(!1)),w("MAKEARRAY",3,3,(n,o)=>{const e=_(A(n[0],o,1),A(n[1],o,1));if(e instanceof u)return e;const t=n[2];if(!(t instanceof x))return a.VALUE;const r=new Array(e.rows*e.cols);for(let s=0;s<e.rows;s++)for(let f=0;f<e.cols;f++)r[s*e.cols+f]=b(o.calc.apply(t,[s+1,f+1]),o);return new E(e.rows,e.cols,r)});function D(n){return(o,e)=>{const t=[];for(const f of o){const i=m(f,e);if(i instanceof u)return i;const c=C(i);t.push(n?c:L(c))}const r=Math.max(0,...t.map(f=>f[0]?.length??0)),s=t.flatMap(f=>f.map(i=>Array.from({length:r},(c,l)=>l<i.length?i[l]??null:a.NA)));return s.length===0?a.CALC:U(n?s:L(s))}}w("VSTACK",1,M,D(!0)),w("HSTACK",1,M,D(!1));function K(n,o,e){const t=Math.min(n,Math.abs(o));return e?o>=0?[0,t]:[n-t,n]:o>=0?[t,n]:[0,n-t]}function X(n){return(o,e)=>{const t=m(o[0],e);if(t instanceof u)return t;const r=d=>d===void 0||d instanceof N,s=A(o[1],e,n?t.rows:0);if(s instanceof u)return s;const f=A(o[2],e,n?t.cols:0);if(f instanceof u)return f;if(n&&!r(o[1])&&Math.trunc(s)===0)return a.CALC;if(n&&!r(o[2])&&Math.trunc(f)===0)return a.CALC;const[i,c]=K(t.rows,Math.trunc(s),n),[l,h]=K(t.cols,Math.trunc(f),n);return c<=i||h<=l?a.CALC:U(C(t).slice(i,c).map(d=>d.slice(l,h)))}}w("TAKE",2,3,X(!0)),w("DROP",2,3,X(!1));function $(n){return(o,e)=>{const t=m(o[0],e);if(t instanceof u)return t;const r=A(o[1],e,0);if(r instanceof u)return r;const s=S(o[2],e,!1);if(s instanceof u)return s;if(![0,1,2,3].includes(r))return a.VALUE;const f=C(t),c=(s?L(f):f).flat().filter(l=>!((r===1||r===3)&&l===null||(r===2||r===3)&&l instanceof u));return c.length===0?a.CALC:n?new E(c.length,1,c):new E(1,c.length,c)}}w("TOCOL",1,3,$(!0)),w("TOROW",1,3,$(!1));function H(n){return(o,e)=>{const t=m(o[0],e);if(t instanceof u)return t;const r=C(t),s=n?r:L(r),f=[];for(const i of o.slice(1)){const c=g(i,e,1);if(c instanceof u)return c;for(const l of c){const h=s[l>0?l-1:s.length+l];if(l===0||!h)return a.VALUE;f.push(h)}}return U(n?f:L(f))}}w("CHOOSEROWS",2,M,H(!0)),w("CHOOSECOLS",2,M,H(!1)),w("EXPAND",2,4,(n,o)=>{const e=m(n[0],o);if(e instanceof u)return e;const t=_(A(n[1],o,e.rows),A(n[2],o,e.cols));if(t instanceof u)return t;if(t.rows<e.rows||t.cols<e.cols)return a.VALUE;const r=O(n[3],o)??a.NA,s=new Array(t.rows*t.cols);for(let f=0;f<t.rows;f++)for(let i=0;i<t.cols;i++)s[f*t.cols+i]=f<e.rows&&i<e.cols?e.at(f,i):r;return new E(t.rows,t.cols,s)});function F(n){return(o,e)=>{const t=m(o[0],e);if(t instanceof u)return t;if(t.rows>1&&t.cols>1)return a.VALUE;const r=A(o[1],e,1);if(r instanceof u)return r;const s=Math.trunc(r);if(s<1)return a.NUM;const f=O(o[2],e)??a.NA,i=C(t).flat(),c=[];for(let l=0;l<i.length;l+=s)c.push(Array.from({length:s},(h,d)=>l+d<i.length?i[l+d]??null:f));return U(n?c:L(c))}}w("WRAPROWS",2,3,F(!0)),w("WRAPCOLS",2,3,F(!1));
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CellError as I,ERR as N,dateOf as g,serialOf as x}from"../../values.js";import{toBool as B,toNumber as H}from"../coerce.js";import{yearFrac as C}from"./date.js";import{number as J,scalar as O}from"./define.js";const F=(o,e)=>g(x(o,e+1,0)).day,T=(o,e,n)=>n===0||n===4?Math.round(C(o,e,n)*360):e-o;function A(o,e,n){const t=g(o),c=t.year*12+t.month-1+e,s=Math.floor(c/12),i=c-s*12+1,u=F(s,i);return x(s,i,n?u:Math.min(t.day,u))}const S=o=>{const e=g(o);return e.day===F(e.year,e.month)};function w(o,e,n,t){const c=12/n,s=S(e);let i=0,u=e;for(;u>o;)i+=1,u=A(e,-c*i,s);const a=A(e,-c*(i-1),s),l=t===1?a-u:t===3?365/n:360/n,f=T(u,o,t);return{previous:u,next:a,count:i,period:l,since:f,until:t===0||t===4?l-f:a-o}}function R(o,e){const n=[];for(const[t,c]of e.entries()){const s=o[t],i=s==null?c??0:H(s);if(i instanceof I)return i;n.push(i)}return n}const P=o=>Number.isInteger(o)&&o>=0&&o<=4,L=o=>o===1||o===2||o===4;function D(o,e,n,t){O(o,e,n.length,(...c)=>{const s=R(c,n);if(s instanceof I)return s;const[i=0,u=0,...a]=s,l=Math.trunc(i),f=Math.trunc(u),h=Math.trunc(a[a.length-1]??0);return l>=f||!P(h)?N.NUM:t(l,f,...a.slice(0,-1),h)})}const r=void 0;for(const[o,e]of[["COUPDAYBS",n=>n.since],["COUPDAYS",n=>n.period],["COUPDAYSNC",n=>n.until],["COUPNCD",n=>n.next],["COUPNUM",n=>n.count],["COUPPCD",n=>n.previous]])D(o,3,[r,r,r,0],(n,t,c=0,s=0)=>L(c)?e(w(n,t,c,s)):N.NUM);function Y(o,e,n,t,c,s,i){const u=w(o,e,s,i),a=100*n/s,l=u.until/u.period;if(u.count===1)return(c+a)/(1+l*t/s)-a*u.since/u.period;let f=c/(1+t/s)**(u.count-1+l);for(let h=1;h<=u.count;h++)f+=a/(1+t/s)**(h-1+l);return f-a*u.since/u.period}D("PRICE",6,[r,r,r,r,r,r,0],(o,e,n=0,t=0,c=0,s=0,i=0)=>n<0||t<0||c<=0||!L(s)?N.NUM:Y(o,e,n,t,c,s,i)),D("YIELD",6,[r,r,r,r,r,r,0],(o,e,n=0,t=0,c=0,s=0,i=0)=>{if(n<0||t<=0||c<=0||!L(s))return N.NUM;let u=-.99,a=1;for(;Y(o,e,n,a,c,s,i)>t&&a<1e6;)a*=2;for(let l=0;l<200;l++){const f=(u+a)/2;Y(o,e,n,f,c,s,i)>t?u=f:a=f}return(u+a)/2});function b(o,e,n,t,c,s){const i=w(o,e,c,s),u=i.until/i.period;let a=0,l=0;for(let f=1;f<=i.count;f++){const h=f-1+u,M=(100*n/c+(f===i.count?100:0))/(1+t/c)**h;a+=h*M,l+=M}return a/l/c}D("DURATION",5,[r,r,r,r,r,0],(o,e,n=0,t=0,c=0,s=0)=>n<0||t<0||!L(c)?N.NUM:b(o,e,n,t,c,s)),D("MDURATION",5,[r,r,r,r,r,0],(o,e,n=0,t=0,c=0,s=0)=>n<0||t<0||!L(c)?N.NUM:b(o,e,n,t,c,s)/(1+t/c)),D("DISC",4,[r,r,r,r,0],(o,e,n=0,t=0,c=0)=>n<=0||t<=0?N.NUM:(t-n)/t/C(o,e,c)),D("INTRATE",4,[r,r,r,r,0],(o,e,n=0,t=0,c=0)=>n<=0||t<=0?N.NUM:(t-n)/n/C(o,e,c)),D("RECEIVED",4,[r,r,r,r,0],(o,e,n=0,t=0,c=0)=>{const s=1-t*C(o,e,c);return n<=0||t<=0||s<=0?N.NUM:n/s}),D("PRICEDISC",4,[r,r,r,r,0],(o,e,n=0,t=0,c=0)=>n<=0||t<=0?N.NUM:t*(1-n*C(o,e,c))),D("YIELDDISC",4,[r,r,r,r,0],(o,e,n=0,t=0,c=0)=>n<=0||t<=0?N.NUM:(t-n)/n/C(o,e,c));function v(o,e){O(o,3,3,J((n=0,t=0,c=0)=>{const s=Math.trunc(n),i=Math.trunc(t);return s>=i||c<=0||i>A(s,12,!1)?N.NUM:e(i-s,c)}))}v("TBILLPRICE",(o,e)=>{const n=100*(1-e*o/360);return n<=0?N.NUM:n}),v("TBILLYIELD",(o,e)=>(100-e)/e*360/o),v("TBILLEQ",(o,e)=>{if(o<=182)return 365*e/(360-e*o);const n=100*(1-e*o/360),t=o/365,c=t*t-(2*t-1)*(1-100/n);return(-t+Math.sqrt(c))/(t-.5)}),O("ACCRINTM",3,5,(...o)=>{const e=R(o,[r,r,r,1e3,0]);if(e instanceof I)return e;const[n=0,t=0,c=0,s=0,i=0]=e,u=Math.trunc(n),a=Math.trunc(t);return u>=a||c<=0||s<=0||!P(i)?N.NUM:s*c*C(u,a,i)}),O("ACCRINT",6,8,(...o)=>{const e=R(o.slice(0,7),[r,r,r,r,1e3,r,0]);if(e instanceof I)return e;const[n=0,t=0,c=0,s=0,i=0,u=0,a=0]=e,l=o[7]===void 0?!0:B(o[7]);if(l instanceof I)return l;const f=Math.trunc(n),h=Math.trunc(c),M=Math.trunc(t);if(f>=h||s<=0||i<=0||!L(u)||!P(a))return N.NUM;const m=12/u;let d=M,U=M;for(let E=1;d>f;E++)d=A(M,-m*E,!1);let p=0;for(;d<h;){U=A(d,m,!1);const E=l?Math.max(f,d):Math.max(d,M<=h?M:f),k=Math.min(h,U),z=a===1?U-d:a===3?365/u:360/u;k>E&&(p+=T(E,k,a)/z),d=U}return i*s*p/u}),O("VDB",5,7,(...o)=>{const e=R(o.slice(0,6),[r,r,r,r,r,2]);if(e instanceof I)return e;const[n=0,t=0,c=0,s=0,i=0,u=0]=e,a=o[6]===void 0?!1:B(o[6]);if(a instanceof I)return a;if(n<0||t<0||c<=0||s<0||i>c||s>i||u<=0)return N.NUM;let l=n,f=0;const h=Math.ceil(i);for(let M=1;M<=h;M++){const m=Math.min(l*u/c,Math.max(0,l-t)),d=c-M+1,U=(l-t)/d,p=a?m:Math.max(m,U),E=Math.min(i,M)-Math.max(s,M-1);E>0&&(f+=p*E),l-=p}return f});const V=(o,e,n,t,c)=>({whole:C(n,e,c),accrued:C(n,o,c),left:C(o,e,c),rate:t});D("PRICEMAT",5,[r,r,r,r,r,0],(o,e,n=0,t=0,c=0,s=0)=>{const i=Math.trunc(n);if(i>=o||t<0||c<0)return N.NUM;const{whole:u,accrued:a,left:l}=V(o,e,i,t,s);return(100+u*t*100)/(1+l*c)-a*t*100}),D("YIELDMAT",5,[r,r,r,r,r,0],(o,e,n=0,t=0,c=0,s=0)=>{const i=Math.trunc(n);if(i>=o||t<0||c<=0)return N.NUM;const{whole:u,accrued:a,left:l}=V(o,e,i,t,s);return((1+u*t)/(c/100+a*t)-1)/l});function G(o,e,n,t,c){const s=12/t,i=S(e),u={held:0,accrued:0,left:0,count:0};let a=0,l=e;for(;l>o;){a+=1;const f=A(e,-s*a,i),h=c===1?l-f:c===3?365/t:360/t,M=Math.max(f,o),m=l,d=(U,p)=>p>U?T(U,p,c)/h:0;u.held+=d(M,m),u.accrued+=d(M,Math.min(n,m)),u.left+=d(Math.max(n,M),m),u.count+=1,l=f}return u}function K(o,e,n,t,c,s,i,u,a){const l=100*c/u,f=w(t,e,u,a).count+1,h=G(n,t,o,u,a),M=1+s/u,m=h.left;let d=i/M**(f-1+m);d+=l*h.held/M**m;for(let U=2;U<=f;U++)d+=l/M**(U-1+m);return d-l*h.accrued}function W(o,e,n){let t=n;for(let c=0;c<100;c++){const s=o(t),i=s-e;if(Math.abs(i)<1e-10)return t;const u=(o(t+1e-6)-s)/1e-6;if(u===0||!Number.isFinite(u))return;t-=i/u,t<=-1&&(t=-.99)}}function Q(o,e){O(o,8,9,(...n)=>{const t=R(n,[r,r,r,r,r,r,r,r,0]);if(t instanceof I)return t;const[c=0,s=0,i=0,u=0,a=0,l=0,f=0,h=0]=t,M=Math.trunc(t[8]??0),m=Math.trunc(c),d=Math.trunc(s),U=Math.trunc(i),p=Math.trunc(u);return!P(M)||!L(h)||!(d>p&&p>m&&m>U)||a<0||l<0||f<=0?N.NUM:e(E=>K(m,d,U,p,a,E,f,h,M),l)})}Q("ODDFPRICE",(o,e)=>o(e)),Q("ODDFYIELD",(o,e)=>W(o,e,.1)??N.NUM);function j(o,e){O(o,7,8,(...n)=>{const t=R(n,[r,r,r,r,r,r,r,0]);if(t instanceof I)return t;const[c=0,s=0,i=0,u=0,a=0,l=0,f=0]=t,h=Math.trunc(t[7]??0),M=Math.trunc(c),m=Math.trunc(s),d=Math.trunc(i);return!P(h)||!L(f)||!(m>M&&M>d)||u<0||a<0||l<=0?N.NUM:e({odd:G(d,m,M,f,h),coupon:100*u/f,last:a,red:l,f})})}j("ODDLPRICE",({odd:o,coupon:e,last:n,red:t,f:c})=>(t+o.held*e)/(1+o.left*n/c)-o.accrued*e),j("ODDLYIELD",({odd:o,coupon:e,last:n,red:t,f:c})=>{const s=n+o.accrued*e;return(t+o.held*e-s)/s*c/o.left}),O("AMORLINC",6,7,(...o)=>{const e=R(o,[r,r,r,r,r,r,0]);if(e instanceof I)return e;const[n=0,t=0,c=0,s=0,i=0,u=0]=e,a=Math.trunc(e[6]??0),l=Math.trunc(i);if(!P(a)||a===2||n<0||s<0||s>n||l<0||u<=0||t>c)return N.NUM;const f=n*u,h=C(Math.trunc(t),Math.trunc(c),a)*f,M=Math.trunc((n-s-h)/f);return l===0?h:l<=M?f:l===M+1?n-s-f*M-h:0}),O("AMORDEGRC",6,7,(...o)=>{const e=R(o,[r,r,r,r,r,r,0]);if(e instanceof I)return e;const[n=0,t=0,c=0,s=0,i=0,u=0]=e,a=Math.trunc(e[6]??0),l=Math.trunc(i);if(!P(a)||a===2||n<0||s<0||s>n||l<0||u<=0||t>c)return N.NUM;const f=1/u,h=f<3?1:f<5?1.5:f<=6?2:2.5,M=u*h;let m=Math.round(C(Math.trunc(t),Math.trunc(c),a)*M*n);if(l===0)return m;let d=n-m,U=d-s;for(let p=0;p<l;p++){if(m=Math.round(M*d),U-=m,U<0)return l-p<=1?Math.round(d*.5):0;d-=m}return m});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./logical.js";
|
|
2
|
+
import "./aggregate.js";
|
|
3
|
+
import "./criteria.js";
|
|
4
|
+
import "./lookup.js";
|
|
5
|
+
import "./text.js";
|
|
6
|
+
import "./date.js";
|
|
7
|
+
import "./info.js";
|
|
8
|
+
import "./kernels.js";
|
|
9
|
+
import "./distributions.js";
|
|
10
|
+
import "./maths.js";
|
|
11
|
+
import "./finance.js";
|
|
12
|
+
import "./database.js";
|
|
13
|
+
import "./dynamic.js";
|
|
14
|
+
export { FUNCTIONS, type Call, type FunctionDef } from "./define.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import"./logical.js";import"./aggregate.js";import"./criteria.js";import"./lookup.js";import"./text.js";import"./date.js";import"./info.js";import"./kernels.js";import"./distributions.js";import"./maths.js";import"./finance.js";import"./database.js";import"./dynamic.js";export{FUNCTIONS}from"./define.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{cellName as N}from"../../address.js";import{CellError as s,ERR as n,Matrix as R}from"../../values.js";import{FormulaCell as p}from"../../workbook.js";import{toNumber as L,toText as d}from"../coerce.js";import{Lambda as I,Reference as l,Union as y}from"../types.js";import{lazy as u,raw as m,scalar as c}from"./define.js";const f=(e,t)=>{c(e,1,1,r=>t(r),{errors:!0})};f("ISBLANK",e=>e==null),f("ISNUMBER",e=>typeof e=="number"),f("ISTEXT",e=>typeof e=="string"),f("ISNONTEXT",e=>typeof e!="string"),f("ISLOGICAL",e=>typeof e=="boolean"),f("ISERROR",e=>e instanceof s),f("ISERR",e=>e instanceof s&&e!==n.NA),f("ISNA",e=>e===n.NA);const E=(e,t)=>{const r=L(e);return r instanceof s?r:Math.abs(Math.trunc(r))%2===t};c("ISEVEN",1,1,e=>E(e,0)),c("ISODD",1,1,e=>E(e,1)),c("N",1,1,e=>typeof e=="number"?e:typeof e=="boolean"?e?1:0:e instanceof s?e:0,{errors:!0}),m("NA",0,0,()=>n.NA),m("TYPE",1,1,(e,t)=>{const r=t.calc.flat(e[0]);return r instanceof R?64:typeof r=="number"||r===null?1:typeof r=="string"?2:typeof r=="boolean"?4:16});const S=[n.NULL,n.DIV0,n.VALUE,n.REF,n.NAME,n.NUM,n.NA];c("ERROR.TYPE",1,1,e=>{const t=e instanceof s?S.indexOf(e):-1;return t<0?n.NA:t+1},{errors:!0}),u("ISREF",1,1,(e,t)=>{const r=e[0];if(!r)return!1;const o=t.calc.eval(r,t.frame);return o instanceof l||o instanceof y});const A=e=>e instanceof l?e.sheet.at(e.top,e.left):void 0;u("ISFORMULA",1,1,(e,t)=>{const r=e[0];if(!r)return n.VALUE;const o=t.calc.eval(r,t.frame);return o instanceof I?n.VALUE:A(o)instanceof p}),u("FORMULATEXT",1,1,(e,t)=>{const r=e[0];if(!r)return n.VALUE;const o=A(t.calc.eval(r,t.frame));return o instanceof p?o.text:n.NA}),m("CELL",1,2,(e,t)=>{const r=d(t.calc.scalar(e[0],t.frame));if(r instanceof s)return r;const o=e[1],a=o instanceof l?o:new l(t.frame.sheet,t.frame.row,t.frame.col,t.frame.row,t.frame.col),i=t.calc.read(a.sheet,a.top,a.left);switch(r.toLowerCase()){case"row":return a.top+1;case"col":return a.left+1;case"address":return N({row:a.top,col:a.left}).replace(/^([A-Z]+)(\d+)$/u,"$$$1$$$2");case"contents":return i;case"type":return i===null?"b":typeof i=="string"?"l":"v";default:return n.VALUE}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import*as k from"@formulajs/formulajs";import{CellError as A,ERR as R,errorOf as y,numberText as b}from"../../values.js";import{Missing as w}from"../types.js";import{toBool as X,toNumber as P,toText as d}from"../coerce.js";import{alias as D,cellsOf as F,many as B,numbersOf as G,numbersOfA as x,raw as V,scalar as U}from"./define.js";const j=k;function L(n){const t=n.split(".").reduce((E,f)=>E?.[f],j);if(typeof t!="function")throw new Error(`@formulajs/formulajs has no ${n}.`);return t}function K(n){return typeof n=="number"?Number.isFinite(n)?n:R.NUM:n instanceof Error?y(n.message)??R.VALUE:typeof n=="boolean"||typeof n=="string"?n:R.VALUE}const m=(n,t)=>{try{return K(n(...t))}catch{return R.VALUE}};function Q(n,t){return G([n],t)}function W(n,t){const E=F(n,t);if(E instanceof A)return E;const f=[];for(let s=0;s<E.rows;s++){const e=[];for(let c=0;c<E.cols;c++){const o=E.at(s,c);if(o instanceof A)return o;e.push(typeof o=="number"?o:0)}f.push(e)}return f}function r(n,t,E){const f=t.split("?")[0]?.length??0,s=t.replace("?",""),e=L(E);U(n,f,s.length,(...c)=>{const o=[];for(const[i,I]of c.entries()){if(I===void 0){o.push(void 0);continue}const N=s.charAt(i),u=N==="n"?P(I):N==="b"?X(I):d(I);if(u instanceof A)return u;o.push(u)}return m(e,o)},{from:"formulajs"})}function a(n,t,E){const f=t.split("?")[0]?.length??0,s=t.replace("?",""),e=s.endsWith("r"),c=L(E);V(n,f,e?B:s.length,(o,i)=>{const I=[];for(const[N,u]of o.entries()){const O=e&&N>=s.length-1?"r":s.charAt(N);if(O==="r"){const C=G(o.slice(N),i);if(C instanceof A)return C;I.push(C);break}if(u instanceof w){I.push(void 0);continue}let T;if(O==="l")T=Q(u,i);else if(O==="m")T=W(u,i);else{const C=i.calc.scalar(u,i.frame);T=O==="n"?P(C):O==="b"?X(C):d(C)}if(T instanceof A)return T;I.push(T)}return m(c,I)},{from:"formulajs"})}function M(n,t,E="",f=1){const s=L(t),e=E.length;V(n,e+2,e+2,(c,o)=>{const i=[];for(const C of c.slice(0,e)){const S=P(o.calc.scalar(C,o.frame));if(S instanceof A)return S;i.push(S)}const I=F(c[e],o),N=F(c[e+1],o);if(I instanceof A)return I;if(N instanceof A)return N;if(I.rows*I.cols!==N.rows*N.cols)return R.NA;const u=[],O=[];for(let C=0;C<I.rows;C++)for(let S=0;S<I.cols;S++){const p=I.at(C,S),h=N.rows===I.rows?N.at(C,S):N.at(S,C);if(p instanceof A)return p;if(h instanceof A)return h;typeof p=="number"&&typeof h=="number"&&(u.push(p),O.push(h))}if(u.length<f)return R.DIV0;const T=m(s,[...i,u,O]);return T===R.NUM?R.DIV0:T},{from:"formulajs"})}function l(n,t,E=!1,f=1,s=R.DIV0){const e=L(t);V(n,1,B,(c,o)=>{const i=E?x(c,o):G(c,o);if(i instanceof A)return i;if(i.length<f)return s;const I=m(e,[i]);return I===R.NUM&&s===R.DIV0?R.DIV0:I},{from:"formulajs"})}function g(n){const t=/^([+-]?[\d.]+(?:e[+-]?\d+)?)?(?:([+-]?)([\d.]+(?:e[+-]?\d+)?)?([ij]))?$/iu.exec(n);if(!t)return n;const[,E,f,s,e]=t,c=E===void 0?"":b(Number(E));if(e===void 0)return c;const o=s===void 0?"":b(Number(s));return`${c}${f??""}${o==="1"?"":o}${e}`}function H(n,t){const E=L(n);U(n,t.length,t.length,(...f)=>{const s=[];for(const[c,o]of f.entries()){const i=t.charAt(c)==="n"?P(o):d(o);if(i instanceof A)return i;s.push(i)}const e=m(E,s);return typeof e=="string"?g(e):e},{from:"formulajs"})}for(const n of["ABS","ACOS","ACOSH","ACOT","ACOTH","ASIN","ASINH","ATAN","ATANH","COS","COSH","COT","COTH","CSC","CSCH","DEGREES","EVEN","EXP","FACT","FACTDOUBLE","INT","LN","LOG10","ODD","RADIANS","SEC","SECH","SIGN","SIN","SINH","SQRT","SQRTPI","TAN","TANH"])r(n,"n",n);for(const n of["ATAN2","COMBIN","COMBINA","MROUND","PERMUT","PERMUTATIONA","POWER"])r(n,"nn",n);r("TRUNC","n?n","TRUNC"),r("CEILING","nn","CEILING"),r("FLOOR","nn","FLOOR"),r("CEILING.MATH","n?nn","CEILINGMATH"),r("FLOOR.MATH","n?nn","FLOORMATH"),r("CEILING.PRECISE","n?n","CEILINGPRECISE"),r("FLOOR.PRECISE","n?n","FLOORPRECISE"),D("ISO.CEILING","CEILING.PRECISE"),U("PI",0,0,()=>Math.PI),V("RAND",0,0,(n,t)=>t.calc.random(),{volatile:!0}),V("RANDBETWEEN",2,2,(n,t)=>{const E=P(t.calc.scalar(n[0],t.frame)),f=P(t.calc.scalar(n[1],t.frame));if(E instanceof A)return E;if(f instanceof A)return f;const s=Math.ceil(E),e=Math.floor(f);return s>e?R.NUM:s+Math.floor(t.calc.random()*(e-s+1))},{volatile:!0}),l("MULTINOMIAL","MULTINOMIAL"),l("AVEDEV","AVEDEV",!1,1,R.NUM),l("DEVSQ","DEVSQ",!1,1,R.NUM),l("MEDIAN","MEDIAN",!1,1,R.NUM),l("SKEW","SKEW",!1,3),l("SKEW.P","SKEW.P",!1,3),l("STDEV.S","STDEV.S",!1,2),l("STDEV.P","STDEV.P",!1,1),l("VAR.S","VAR.S",!1,2),l("VAR.P","VAR.P",!1,1),l("STDEVA","STDEVA",!0,2),l("STDEVPA","STDEVPA",!0,1),l("VARA","VARA",!0,2),l("VARPA","VARPA",!0,1);for(const[n,t]of[["STDEV","STDEV.S"],["STDEVP","STDEV.P"],["VAR","VAR.S"],["VARP","VAR.P"]])D(n,t);a("LARGE","ln","LARGE"),a("SMALL","ln","SMALL"),a("PERCENTILE.INC","ln","PERCENTILE.INC"),a("PERCENTILE.EXC","ln","PERCENTILE.EXC"),a("PERCENTRANK.INC","ln?n","PERCENTRANK.INC"),a("PERCENTRANK.EXC","ln?n","PERCENTRANK.EXC"),a("QUARTILE.EXC","ln","QUARTILE.EXC"),a("TRIMMEAN","ln","TRIMMEAN"),D("PERCENTILE","PERCENTILE.INC"),D("PERCENTRANK","PERCENTRANK.INC"),M("CORREL","CORREL"),M("PEARSON","PEARSON"),M("RSQ","RSQ"),M("SLOPE","SLOPE"),M("INTERCEPT","INTERCEPT"),M("STEYX","STEYX","",3),M("COVARIANCE.P","COVARIANCE.P"),M("COVARIANCE.S","COVARIANCE.S","",2),M("FORECAST","FORECAST","n"),D("FORECAST.LINEAR","FORECAST"),D("COVAR","COVARIANCE.P"),r("PMT","nnn?nn","PMT"),r("PPMT","nnnn?nn","PPMT"),r("IPMT","nnnn?nn","IPMT"),r("FV","nnn?nn","FV"),r("PV","nnn?nn","PV"),r("NPER","nnn?nn","NPER"),r("RATE","nnn?nnn","RATE"),r("SYD","nnnn","SYD"),r("DB","nnnn?n","DB"),r("DDB","nnnn?n","DDB"),r("ISPMT","nnnn","ISPMT"),r("EFFECT","nn","EFFECT"),r("NOMINAL","nn","NOMINAL"),r("CUMIPMT","nnnnnn","CUMIPMT"),r("CUMPRINC","nnnnnn","CUMPRINC"),r("DOLLARDE","nn","DOLLARDE"),r("DOLLARFR","nn","DOLLARFR"),r("PDURATION","nnn","PDURATION"),r("RRI","nnn","RRI"),a("IRR","l?n","IRR"),a("MIRR","lnn","MIRR"),a("NPV","nr","NPV"),a("FVSCHEDULE","nl","FVSCHEDULE");for(const n of["BIN2DEC","HEX2DEC","OCT2DEC","IMABS","IMAGINARY","IMARGUMENT","IMREAL"])r(n,"t",n);for(const n of["IMCONJUGATE","IMCOS","IMCOSH","IMCOT","IMCSC","IMCSCH","IMEXP","IMLN","IMLOG10","IMLOG2","IMSEC","IMSECH","IMSIN","IMSINH","IMSQRT","IMTAN"])H(n,"t");for(const n of["BIN2OCT","HEX2BIN","HEX2OCT","OCT2BIN"])r(n,"t?n",n);for(const n of["DEC2BIN","DEC2OCT"])r(n,"n?n",n);for(const[n,t]of[["BIN2HEX","t"],["OCT2HEX","t"],["DEC2HEX","n"]]){const E=L(n);U(n,1,2,(f,s)=>{const e=t==="n"?P(f):d(f);if(e instanceof A)return e;const c=s===void 0?void 0:P(s);if(c instanceof A)return c;const o=m(E,[e,c]);return typeof o=="string"?o.toUpperCase():o},{from:"formulajs"})}H("IMDIV","tt"),H("IMSUB","tt"),H("IMPOWER","tn"),r("COMPLEX","nn?t","COMPLEX"),r("DECIMAL","tn","DECIMAL"),r("ARABIC","t","ARABIC");for(const n of["IMSUM","IMPRODUCT"]){const t=L(n);V(n,1,B,(E,f)=>{const s=[];for(const c of E){const o=d(f.calc.scalar(c,f.frame));if(o instanceof A)return o;s.push(o)}const e=m(t,s);return typeof e=="string"?g(e):e},{from:"formulajs"})}r("CONVERT","ntt","CONVERT"),r("DELTA","n?n","DELTA"),r("GESTEP","n?n","GESTEP");
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CellError as s,ERR as i,Matrix as A}from"../../values.js";import{compare as N,toBool as E,toNumber as U}from"../coerce.js";import{Lambda as R,Missing as b}from"../types.js";import{eachArg as O,lazy as m,many as p,raw as d,scalar as k}from"./define.js";const l=(t,n)=>t?n.calc.eval(t,n.frame):!1;function V(t,n,e){if(!(t instanceof A))return t;const r=t.rows===1?0:n,o=t.cols===1?0:e;return r<t.rows&&o<t.cols?t.at(r,o):i.NA}function L(t,n,e){const r=[t,...n].filter(c=>c instanceof A),o=Math.max(...r.map(c=>c.rows)),f=Math.max(...r.map(c=>c.cols)),a=new Array(o*f);for(let c=0;c<o;c++)for(let u=0;u<f;u++){const h=e(V(t,c,u));a[c*f+u]=h instanceof s?h:V(n[h]??i.VALUE,c,u)}return new A(o,f,a)}m("IF",1,3,(t,n)=>{const e=n.calc.flat(l(t[0],n)),r=f=>{const a=t[f];if(a===void 0)return f===1;const c=n.calc.eval(a,n.frame);return c instanceof b?0:c};if(e instanceof A){const f=a=>a<t.length?n.calc.flat(r(a)):!1;return L(e,[f(1),f(2)],a=>{const c=E(a);return c instanceof s?c:c?0:1})}const o=E(e);return o instanceof s?o:r(o?1:2)}),m("IFS",2,p,(t,n)=>{for(let e=0;e+1<t.length;e+=2){const r=E(n.calc.scalar(l(t[e],n),n.frame));if(r instanceof s)return r;if(r)return l(t[e+1],n)}return i.NA});const M=t=>(n,e)=>{const r=e.calc.flat(l(n[0],e)),o=a=>a instanceof s&&(t===void 0||a===t),f=()=>n[1]?e.calc.flat(e.calc.eval(n[1],e.frame)):"";return r instanceof A?L(r,[r,f()],a=>o(a)?1:0):o(r)?f():r};m("IFERROR",2,2,M()),m("IFNA",2,2,M(i.NA)),m("CHOOSE",2,255,(t,n)=>{const e=n.calc.flat(l(t[0],n));if(e instanceof A){const a=t.slice(1).map(c=>n.calc.flat(n.calc.eval(c,n.frame)));return L(e,a,c=>{const u=U(c);if(u instanceof s)return u;const h=Math.trunc(u)-1;return h<0||h>=a.length?i.VALUE:h})}const r=U(e);if(r instanceof s)return r;const o=Math.trunc(r),f=t[o];return o<1||f===void 0?i.VALUE:n.calc.eval(f,n.frame)}),m("SWITCH",3,p,(t,n)=>{const e=n.calc.scalar(l(t[0],n),n.frame);if(e instanceof s)return e;let r=1;for(;r+1<t.length;r+=2){const o=n.calc.scalar(l(t[r],n),n.frame);if(o instanceof s)return o;if(N(e,o)===0)return l(t[r+1],n)}return r<t.length?l(t[r],n):i.NA});function w(t,n){const e=[];let r;return O(t,n,(o,f)=>{if(r)return;if(o instanceof s){r=o;return}if(typeof o=="string"&&!f||o===null)return;const a=E(o);a instanceof s?r=a:e.push(a)}),r||(e.length===0?i.VALUE:e)}d("AND",1,p,(t,n)=>{const e=w(t,n);return e instanceof s?e:e.every(Boolean)}),d("OR",1,p,(t,n)=>{const e=w(t,n);return e instanceof s?e:e.some(Boolean)}),d("XOR",1,p,(t,n)=>{const e=w(t,n);return e instanceof s?e:e.filter(Boolean).length%2===1}),k("NOT",1,1,t=>{const n=E(t);return n instanceof s?n:!n}),d("TRUE",0,0,()=>!0),d("FALSE",0,0,()=>!1);const y=(t,n)=>n?{names:t,parent:n}:{names:t};m("LET",3,p,(t,n)=>{if(t.length%2===0)return i.VALUE;const e=new Map,r={...n.frame,scope:y(e,n.frame.scope)};for(let o=0;o+1<t.length;o+=2){const f=t[o];if(f?.kind!=="name")return i.VALUE;e.set(f.name.toLowerCase(),l(t[o+1],{...n,frame:r}))}return l(t[t.length-1],{...n,frame:r})}),m("LAMBDA",1,254,(t,n)=>{const e=[];for(const o of t.slice(0,-1)){if(o.kind!=="name")return i.VALUE;e.push(o.name.toLowerCase())}const r=t[t.length-1];return r?new R(e,r,n.frame):i.VALUE});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CellError as a,ERR as w,Matrix as O}from"../../values.js";import{cellName as V,columnLetter as g,MAX_COLUMNS as H,MAX_ROWS as K}from"../../address.js";import{sheetPrefix as q}from"../../formula/print.js";import{parseFormula as G}from"../../formula/parse.js";import{compare as $,toBool as U,toNumber as b,toText as W}from"../coerce.js";import{Missing as k,Reference as R,Union as F}from"../types.js";import{cellsOf as x,lazy as J,raw as E,scalar as Q}from"./define.js";import{hasWildcard as Y,indexKey as C,wildcard as Z}from"./criteria.js";const X=(n,t)=>typeof n==typeof t&&!(n instanceof a)&&n!==null;function T(n){if(n.rows===1)return{length:n.cols,at:t=>n.at(0,t)};if(n.cols===1)return{length:n.rows,at:t=>n.at(t,0)}}function P(n,t,e,o,r,s=0,c=1){const i=typeof n=="string"?n:void 0;if(r&&i!==void 0&&Y(i)){const u=Z(i);for(let d=s;d>=0&&d<t.length;d+=c){const m=t.at(d);if(typeof m=="string"&&u(m))return d}return-1}const f=C(n);if(f===void 0)return-1;const l=e.reference;if(l&&t.length>=64&&s===0&&c===1){const u=`find:${l.key}`;let d=o.calc.indexes.get(u);if(!d){d=new Map;for(let m=t.length-1;m>=0;m--){const h=C(t.at(m));h!==void 0&&d.set(h,[m])}o.calc.indexes.set(u,d)}return d.get(f)?.[0]??-1}for(let u=s;u>=0&&u<t.length;u+=c)if(C(t.at(u))===f)return u;return-1}function S(n,t,e=!1){let o=0,r=t.length-1,s=-1;for(;o<=r;){const c=o+r>>1;let i=c;for(;i>=o&&!X(t.at(i),n);)i-=1;if(i<o){o=c+1;continue}const f=$(t.at(i),n);(e?f>=0:f<=0)?(s=i,o=c+1):r=i-1}return s}const N=(n,t)=>t.calc.scalar(n??null,t.frame),v=(n,t,e)=>n===void 0||n instanceof k?e:U(t.calc.scalar(n,t.frame));function D(n){return(t,e)=>{const o=N(t[0],e);if(o instanceof a)return o;const r=x(t[1],e);if(r instanceof a)return r;const s=b(e.calc.scalar(t[2],e.frame));if(s instanceof a)return s;const c=Math.trunc(s);if(c<1)return w.VALUE;if(c>(n?r.cols:r.rows))return w.REF;const i=v(t[3],e,!0);if(i instanceof a)return i;const f={length:n?r.rows:r.cols,at:d=>n?r.at(d,0):r.at(0,d)},l={rows:n?r.rows:1,cols:n?1:r.cols,at:(d,m)=>r.at(d,m),...r.reference?{reference:new R(r.reference.sheet,r.reference.top,r.reference.left,n?r.reference.bottom:r.reference.top,n?r.reference.left:r.reference.right)}:{}},u=i?S(o,f):P(o,f,l,e,!0);return u<0?w.NA:n?r.at(u,c-1):r.at(c-1,u)}}E("VLOOKUP",3,4,D(!0)),E("HLOOKUP",3,4,D(!1)),E("MATCH",2,3,(n,t)=>{const e=N(n[0],t);if(e instanceof a)return e;const o=x(n[1],t);if(o instanceof a)return o;const r=T(o);if(!r)return w.NA;const s=n[2]===void 0||n[2]instanceof k?1:b(t.calc.scalar(n[2],t.frame));if(s instanceof a)return s;const c=s===0?P(e,r,o,t,!0):S(e,r,s<0);return c<0?w.NA:c+1}),E("LOOKUP",2,3,(n,t)=>{const e=N(n[0],t);if(e instanceof a)return e;const o=x(n[1],t);if(o instanceof a)return o;const r=o.rows>=o.cols,s={length:r?o.rows:o.cols,at:l=>r?o.at(l,0):o.at(0,l)},c=S(e,s);if(c<0)return w.NA;if(n[2]===void 0)return r?o.at(c,o.cols-1):o.at(o.rows-1,c);const i=x(n[2],t);if(i instanceof a)return i;const f=T(i);return f?f.at(c):w.NA});function _(n,t,e,o,r){const s=T(t);if(!s)return-1;const c=r===-1;if(Math.abs(r)===2){const u=S(n,s,r<0);if(u>=0&&$(s.at(u),n)===0)return u;if(o===0)return-1}const f=P(n,s,t,e,o===2,c?s.length-1:0,c?-1:1);if(f>=0||o===0||o===2)return f;let l=-1;for(let u=0;u<s.length;u++){const d=s.at(u);if(!X(d,n))continue;const m=$(d,n),h=l<0||(o<0?$(d,s.at(l))>0:$(d,s.at(l))<0);(o<0?m<0:m>0)&&h&&(l=u)}return l}const I=(n,t,e)=>{const o=(c,i)=>c===void 0||c instanceof k?i:b(e.calc.scalar(c,e.frame)),r=o(n,0);if(r instanceof a)return r;const s=o(t,1);return s instanceof a?s:[r,s]};E("XLOOKUP",3,6,(n,t)=>{const e=N(n[0],t);if(e instanceof a)return e;const o=x(n[1],t);if(o instanceof a)return o;const r=x(n[2],t);if(r instanceof a)return r;const s=I(n[4],n[5],t);if(s instanceof a)return s;const c=_(e,o,t,s[0],s[1]);if(c<0){const f=n[3];return f===void 0||f instanceof k?w.NA:t.calc.flat(f)}if(o.cols===1){if(r.cols===1)return r.at(c,0);const f=[];for(let l=0;l<r.cols;l++)f.push(r.at(c,l));return new O(1,r.cols,f)}if(r.rows===1)return r.at(0,c);const i=[];for(let f=0;f<r.rows;f++)i.push(r.at(f,c));return new O(r.rows,1,i)}),E("XMATCH",2,4,(n,t)=>{const e=N(n[0],t);if(e instanceof a)return e;const o=x(n[1],t);if(o instanceof a)return o;const r=I(n[2],n[3],t);if(r instanceof a)return r;const s=_(e,o,t,r[0],r[1]);return s<0?w.NA:s+1}),E("INDEX",2,4,(n,t)=>{let e=n[0];const o=h=>{if(h===void 0||h instanceof k)return 0;const p=b(t.calc.scalar(h,t.frame));return p instanceof a?p:Math.trunc(p)};if(e instanceof F){const h=o(n[3]??1);if(h instanceof a)return h;const p=e.parts[h-1];if(!p)return w.REF;e=p}if(e instanceof a)return e;const r=o(n[1]);if(r instanceof a)return r;const s=o(n[2]);if(s instanceof a)return s;if(r<0||s<0)return w.VALUE;if(e instanceof R){const h=n[2]===void 0&&e.rows===1,p=h?1:r,A=h?r:s;return p>e.rows||A>e.cols?w.REF:new R(e.sheet,p===0?e.top:e.top+p-1,A===0?e.left:e.left+A-1,p===0?e.bottom:e.top+p-1,A===0?e.right:e.left+A-1)}const c=x(e,t);if(c instanceof a)return c;const i=n[2]===void 0&&c.rows===1,f=i?1:r,l=i?r:s===0&&c.cols===1?1:s;if(f>c.rows||l>c.cols)return w.REF;if(f>0&&l>0)return c.at(f-1,l-1);const u=f===0?c.rows:1,d=l===0?c.cols:1,m=[];for(let h=0;h<u;h++)for(let p=0;p<d;p++)m.push(c.at(f===0?h:f-1,l===0?p:l-1));return new O(u,d,m)}),E("OFFSET",3,5,(n,t)=>{const e=n[0];if(e instanceof a)return e;if(!(e instanceof R))return w.VALUE;const o=(M,B)=>{if(M===void 0||M instanceof k)return B;const L=b(t.calc.scalar(M,t.frame));return L instanceof a?L:Math.trunc(L)},r=o(n[1],0),s=o(n[2],0),c=o(n[3],e.rows),i=o(n[4],e.cols);for(const M of[r,s,c,i])if(M instanceof a)return M;const[f,l,u,d]=[r,s,c,i];if(u===0||d===0)return w.REF;const m=e.top+(f??0),h=e.left+(l??0),p=m+(u??1)-1,A=h+(d??1)-1;return Math.min(m,p)<0||Math.min(h,A)<0||Math.max(m,p)>=K||Math.max(h,A)>=H?w.REF:new R(e.sheet,Math.min(m,p),Math.min(h,A),Math.max(m,p),Math.max(h,A))},{volatile:!0});const nn=/^(?:(.*)!)?R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?(?::R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?)?$/iu,y=(n,t)=>n===void 0?t:n.startsWith("[")?t+Number(n.slice(1,-1)):Number(n)-1;function tn(n,t,e){const o=nn.exec(n.trim());if(!o)return;const[,r,s,c,i,f]=o,l={row:y(s,t),col:y(c,e)};if(l.row<0||l.col<0)return;const u=V(l),d=r===void 0?"":`${r}!`;if(i===void 0&&f===void 0)return`${d}${u}`;const m={row:y(i,t),col:y(f,e)};return m.row<0||m.col<0?void 0:`${d}${u}:${V(m)}`}E("INDIRECT",1,2,(n,t)=>{const e=W(t.calc.scalar(n[0],t.frame));if(e instanceof a)return e;const o=n[1]===void 0?!0:U(t.calc.scalar(n[1],t.frame));if(o instanceof a)return o;const r=o?e:tn(e,t.frame.row,t.frame.col);if(r===void 0)return w.REF;const s=G(r);if(!s.ok)return w.REF;const{node:c}=s;if(c.kind!=="ref"&&c.kind!=="structured"&&c.kind!=="name"&&!(c.kind==="binary"&&c.op===":"))return w.REF;const i=t.calc.eval(c,{...t.frame,dr:0,dc:0});return i instanceof R||i instanceof F?i:w.REF},{volatile:!0});const j=(n,t,e)=>{if(n===void 0||n instanceof k)return t+1;if(n instanceof a)return n;if(!(n instanceof R))return w.VALUE;const[o,r]=e(n);if(r<=1)return o+1;const s=Array.from({length:r},(c,i)=>o+i+1);return e===z?new O(r,1,s):new O(1,r,s)},z=n=>[n.top,Math.min(n.rows,n.sheet.lastRow-n.top+1)],en=n=>[n.left,n.cols];E("ROW",0,1,(n,t)=>j(n[0],t.frame.row,z)),E("COLUMN",0,1,(n,t)=>j(n[0],t.frame.col,en)),E("ROWS",1,1,(n,t)=>{const e=n[0];if(e instanceof R)return e.rows;const o=x(e,t);return o instanceof a?o:o.rows}),E("COLUMNS",1,1,(n,t)=>{const e=n[0];if(e instanceof R)return e.cols;const o=x(e,t);return o instanceof a?o:o.cols}),E("AREAS",1,1,n=>{const t=n[0];return t instanceof R?1:t instanceof F?t.parts.length:w.VALUE}),Q("ADDRESS",2,5,(n,t,e,o,r)=>{const s=b(n),c=b(t),i=e==null?1:b(e);for(const M of[s,c,i])if(M instanceof a)return M;const[f,l,u]=[s,c,i];if((f??0)<1||(l??0)<1||(f??0)>K||(l??0)>H)return w.VALUE;const d=o==null?!0:U(o);if(d instanceof a)return d;const m=u===1||u===2,h=u===1||u===3,p=d?`${h?"$":""}${g((l??1)-1)}${m?"$":""}${String(f)}`:`R${m?String(f):`[${String(f)}]`}C${h?String(l):`[${String(l)}]`}`;if(r==null)return p;const A=W(r);return A instanceof a?A:`${q(A)}${p}`}),E("TRANSPOSE",1,1,(n,t)=>{const e=x(n[0],t);if(e instanceof a)return e;const o=[];for(let r=0;r<e.cols;r++)for(let s=0;s<e.rows;s++)o.push(e.at(s,r));return new O(e.cols,e.rows,o)}),J("SHEET",0,1,(n,t)=>{const e=n[0];if(e===void 0)return t.frame.sheet.index+1;const o=t.calc.eval(e,t.frame);if(o instanceof R)return o.sheet.index+1;const r=t.calc.scalar(o,t.frame);if(typeof r!="string")return w.NA;const s=t.calc.wb.sheet(r);return s?s.index+1:w.NA}),E("SHEETS",0,1,(n,t)=>t.calc.wb.sheets.length);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CellError as a,ERR as l,Matrix as R}from"../../values.js";import{toBool as q,toNumber as A}from"../coerce.js";import{Reference as P,Union as ot}from"../types.js";import{FUNCTIONS as ct,alias as O,cellsOf as B,eachRow as ft,many as y,number as U,numbersOf as T,raw as N,scalar as S}from"./define.js";import{besselI as it,besselJ as at,besselK as ut,besselY as lt,betaI as K,gammaQ as ht,normalCdf as mt}from"./special.js";const X=2**48;function H(e,r){const[t="0",n="0"]=e.toExponential().split("e");return+`${t}e${String(Number(n)+r)}`}const Mt=e=>Number(e.toPrecision(15));function G(e,r,t){const n=Math.trunc(r),s=Math.abs(Mt(e)),o=H(s,n);if(o>=2**53)return e;const c=H(t(o),-n);return e<0?-c:c}S("ROUND",2,2,U((e=0,r=0)=>G(e,r,t=>Math.floor(t+.5)))),S("ROUNDUP",2,2,U((e=0,r=0)=>G(e,r,Math.ceil))),S("ROUNDDOWN",2,2,U((e=0,r=0)=>G(e,r,Math.floor))),S("MOD",2,2,U((e=0,r=0)=>{if(r===0)return l.DIV0;const t=e%r;return t!==0&&t<0!=r<0?t+r:t})),S("QUOTIENT",2,2,U((e=0,r=0)=>r===0?l.DIV0:Math.trunc(e/r))),S("POWER",2,2,U((e=0,r=0)=>{if(e===0&&r===0)return l.NUM;if(e===0&&r<0)return l.DIV0;const t=e**r;return Number.isFinite(t)?t:l.NUM})),S("LOG",1,2,(e,r)=>{const t=A(e),n=r==null?10:A(r);return t instanceof a?t:n instanceof a?n:t<=0||n<=0?l.NUM:n===1?l.DIV0:n===10?Math.log10(t):n===2?Math.log2(t):Math.log(t)/Math.log(n)});function v(e,r){let[t,n]=[e,r];for(;n!==0;)[t,n]=[n,t%n];return t}function Y(e,r){const t=T(e,r);if(t instanceof a)return t;const n=t.map(Math.trunc);return n.some(s=>s<0||s>=2**53)?l.NUM:n}N("GCD",1,y,(e,r)=>{const t=Y(e,r);return t instanceof a?t:t.reduce(v,0)}),N("LCM",1,y,(e,r)=>{const t=Y(e,r);if(t instanceof a)return t;if(t.includes(0))return 0;const n=t.reduce((s,o)=>s*o/v(s,o),1);return Number.isFinite(n)?n:l.NUM}),S("BASE",2,3,U((e=0,r=0,t=Number.NaN)=>{const n=Math.trunc(e),s=Math.trunc(r),o=Number.isNaN(t)?0:Math.trunc(t);return n<0||n>=2**53||s<2||s>36||o<0||o>255?l.NUM:n.toString(s).toUpperCase().padStart(o,"0")}));const dt="MDCLXVI",z=[1e3,500,100,50,10,5,1];function Nt(e,r){const t=i=>z[i]??1,n=i=>dt.charAt(i),s=z.length-1;let o=e,c="";for(let i=0;i<=s/2;i++){const f=2*i,u=Math.floor(o/t(f));if(u%5===4){const h=u===4?f-1:f-2;let m=f,M=0;for(;M<r&&m<s;)M+=1,t(h)-t(m+1)<=o?m+=1:M=r;c+=n(m)+n(h),o+=t(m)-t(h)}else u>4&&(c+=n(f-1)),c+=n(f).repeat(u%5),o%=t(f)}return c}S("ROMAN",1,2,(e,r)=>{const t=A(e);if(t instanceof a)return t;let n=0;if(typeof r=="boolean")n=r?0:4;else if(r!=null){const o=A(r);if(o instanceof a)return o;n=Math.trunc(o)}const s=Math.trunc(t);return s<0||s>3999||n<0||n>4?l.VALUE:Nt(s,n)});function k(e){return!Number.isInteger(e)||e<0||e>=X?l.NUM:BigInt(e)}for(const[e,r]of[["BITAND",(t,n)=>t&n],["BITOR",(t,n)=>t|n],["BITXOR",(t,n)=>t^n]])S(e,2,2,U((t=0,n=0)=>{const s=k(t),o=k(n);return s instanceof a?s:o instanceof a?o:Number(r(s,o))}));for(const[e,r]of[["BITLSHIFT",1],["BITRSHIFT",-1]])S(e,2,2,U((t=0,n=0)=>{const s=k(t);if(s instanceof a)return s;const o=Math.trunc(n)*r;if(Math.abs(o)>53)return l.NUM;const c=o>=0?s<<BigInt(o):s>>BigInt(-o);return c>=BigInt(X)?l.NUM:Number(c)}));for(const[e,r,t]of[["BESSELJ",at,!1],["BESSELI",it,!1],["BESSELY",lt,!0],["BESSELK",ut,!0]])S(e,2,2,U((n=0,s=0)=>{const o=Math.trunc(s);if(o<0||t&&n<=0)return l.NUM;const c=r(o,n);return Number.isFinite(c)?c:l.NUM}));S("SLN",3,3,U((e=0,r=0,t=0)=>t===0?l.DIV0:(e-r)/t)),N("GEOMEAN",1,y,(e,r)=>{const t=T(e,r);return t instanceof a?t:t.length===0||t.some(n=>n<=0)?l.NUM:Math.exp(t.reduce((n,s)=>n+Math.log(s),0)/t.length)}),N("HARMEAN",1,y,(e,r)=>{const t=T(e,r);return t instanceof a?t:t.length===0||t.some(n=>n<=0)?l.NUM:t.length/t.reduce((n,s)=>n+1/s,0)}),N("KURT",1,y,(e,r)=>{const t=T(e,r);if(t instanceof a)return t;const n=t.length;if(n<4)return l.DIV0;const s=t.reduce((i,f)=>i+f,0)/n,o=t.reduce((i,f)=>i+(f-s)**2,0)/(n-1);if(o===0)return l.DIV0;const c=t.reduce((i,f)=>i+(f-s)**4,0)/o**2;return n*(n+1)/((n-1)*(n-2)*(n-3))*c-3*(n-1)**2/((n-2)*(n-3))});function W(e,r){const t=[];let n;return ft(e,r,(s,o)=>{if(!n){if(s instanceof a)n=s;else if(typeof s=="number")t.push(s);else if(o&&s!==null){const c=A(s);c instanceof a?n=c:t.push(c)}}}),n??t}N("MODE.SNGL",1,y,(e,r)=>{const t=W(e,r);if(t instanceof a)return t;const n=new Map;for(const c of t)n.set(c,(n.get(c)??0)+1);let s,o=1;for(const[c,i]of n)i>o&&(s=c,o=i);return s??l.NA}),O("MODE","MODE.SNGL"),N("MODE.MULT",1,y,(e,r)=>{const t=W(e,r);if(t instanceof a)return t;const n=new Map;for(const c of t)n.set(c,(n.get(c)??0)+1);let s=0;for(const c of n.values())s=Math.max(s,c);if(s<2)return l.NA;const o=[...n].filter(([,c])=>c===s).map(([c])=>c);return new R(o.length,1,o)});function pt(e,r){const t=r*(e.length-1),n=Math.floor(t),s=e[n]??0,o=e[n+1]??s;return s+(t-n)*(o-s)}N("QUARTILE.INC",2,2,(e,r)=>{const t=T([e[0]],r);if(t instanceof a)return t;const n=A(r.calc.scalar(e[1],r.frame));if(n instanceof a)return n;const s=Math.trunc(n);return t.length===0||s<0||s>4?l.NUM:pt([...t].sort((o,c)=>o-c),s/4)}),O("QUARTILE","QUARTILE.INC");function Z(e,r){const t=A(r.calc.scalar(e[0],r.frame));if(t instanceof a)return t;const n=T([e[1]],r);if(n instanceof a)return n;const s=e[2]===void 0?0:A(r.calc.scalar(e[2],r.frame));if(s instanceof a)return s;const o=n.filter(c=>c===t).length;return o===0?l.NA:{before:n.filter(c=>s===0?c>t:c<t).length,ties:o}}N("RANK.EQ",2,3,(e,r)=>{const t=Z(e,r);return t instanceof a?t:t.before+1}),N("RANK.AVG",2,3,(e,r)=>{const t=Z(e,r);return t instanceof a?t:t.before+(t.ties+1)/2}),O("RANK","RANK.EQ");function w(e,r){const t=B(e,r);if(t instanceof a)return t;const n=[];for(let s=0;s<t.rows;s++){const o=[];for(let c=0;c<t.cols;c++){const i=t.at(s,c);if(i instanceof a)return i;if(typeof i!="number")return l.VALUE;o.push(i)}n.push(o)}return n}const _=e=>new R(e.length,e[0]?.length??0,e.flat());function Et(e,r){const t=r[0]?.length??0;return e.map(n=>Array.from({length:t},(s,o)=>n.reduce((c,i,f)=>c+i*(r[f]?.[o]??0),0)))}N("MMULT",2,2,(e,r)=>{const t=w(e[0],r),n=w(e[1],r);return t instanceof a?t:n instanceof a?n:(t[0]?.length??0)!==n.length?l.VALUE:_(Et(t,n))});function x(e){const r=e.length,t=e.map((o,c)=>[...o,...Array.from({length:r},(i,f)=>c===f?1:0)]),n=(o,c)=>t[o]?.[c]??0;let s=1;for(let o=0;o<r;o++){let c=o;for(let f=o+1;f<r;f++)Math.abs(n(f,o))>Math.abs(n(c,o))&&(c=f);if(n(c,o)===0)return{determinant:0};if(c!==o){const[f=[],u=[]]=[t[o],t[c]];t[o]=u,t[c]=f,s=-s}const i=n(o,o);s*=i,t[o]=(t[o]??[]).map(f=>f/i);for(let f=0;f<r;f++){if(f===o)continue;const u=n(f,o),h=t[o]??[];t[f]=(t[f]??[]).map((m,M)=>m-u*(h[M]??0))}}return{determinant:s,inverse:t.map(o=>o.slice(r))}}const J=e=>e.length>0&&e.every(r=>r.length===e.length);N("MDETERM",1,1,(e,r)=>{const t=w(e[0],r);return t instanceof a?t:J(t)?x(t).determinant:l.VALUE}),N("MINVERSE",1,1,(e,r)=>{const t=w(e[0],r);if(t instanceof a)return t;if(!J(t))return l.VALUE;const{inverse:n}=x(t);return n?_(n):l.NUM}),S("MUNIT",1,1,U((e=0)=>{const r=Math.trunc(e);return r<1||r>73?l.VALUE:_(Array.from({length:r},(t,n)=>Array.from({length:r},(s,o)=>n===o?1:0)))}));function F(e,r,t){const n=B(e,t),s=B(r,t);if(n instanceof a)return n;if(s instanceof a)return s;if(n.rows*n.cols!==s.rows*s.cols)return l.NA;const o=[],c=[];for(let i=0;i<n.rows;i++)for(let f=0;f<n.cols;f++){const u=n.at(i,f),h=s.rows===n.rows?s.at(i,f):s.at(f,i);if(u instanceof a)return u;if(h instanceof a)return h;typeof u=="number"&&typeof h=="number"&&(o.push(u),c.push(h))}return{xs:o,ys:c}}for(const[e,r]of[["SUMX2MY2",(t,n)=>t*t-n*n],["SUMX2PY2",(t,n)=>t*t+n*n],["SUMXMY2",(t,n)=>(t-n)**2]])N(e,2,2,(t,n)=>{const s=F(t[0],t[1],n);return s instanceof a?s:s.xs.length===0?l.DIV0:s.xs.reduce((o,c,i)=>o+r(c,s.ys[i]??0),0)});N("SERIESSUM",4,4,(e,r)=>{const[t,n,s]=e.slice(0,3).map(c=>A(r.calc.scalar(c,r.frame)));if(t instanceof a)return t;if(n instanceof a)return n;if(s instanceof a)return s;const o=T([e[3]],r);return o instanceof a?o:o.reduce((c,i,f)=>c+i*(t??0)**((n??0)+f*(s??0)),0)}),N("FREQUENCY",2,2,(e,r)=>{const t=T([e[0]],r),n=T([e[1]],r);if(t instanceof a)return t;if(n instanceof a)return n;const s=n.map((c,i)=>({b:c,i})).sort((c,i)=>c.b-i.b),o=new Array(n.length+1).fill(0);for(const c of t){const i=s.find(u=>c<=u.b),f=i?i.i:n.length;o[f]=(o[f]??0)+1}return new R(o.length,1,o)}),N("PROB",3,4,(e,r)=>{const t=F(e[0],e[1],r);if(t instanceof a)return t;const n=A(r.calc.scalar(e[2],r.frame));if(n instanceof a)return n;const s=e[3]===void 0?n:A(r.calc.scalar(e[3],r.frame));if(s instanceof a)return s;const o=t.ys.reduce((c,i)=>c+i,0);return t.ys.some(c=>c<=0||c>1)||Math.abs(o-1)>1e-12?l.NUM:t.xs.reduce((c,i,f)=>i>=n&&i<=s?c+(t.ys[f]??0):c,0)});const $=e=>e.reduce((r,t)=>r+t,0);function j(e,r,t){const n=r.map(u=>t?[...u,1]:[...u]),s=n[0]?.length??0,o=Array.from({length:s},(u,h)=>Array.from({length:s},(m,M)=>n.reduce((E,g)=>E+(g[h]??0)*(g[M]??0),0))),{inverse:c}=x(o);if(!c)return;const i=Array.from({length:s},(u,h)=>n.reduce((m,M,E)=>m+(M[h]??0)*(e[E]??0),0)),f=c.map(u=>u.reduce((h,m,M)=>h+m*(i[M]??0),0));return t?f:[...f,0]}function tt(e,r,t){const n=w(e[0],r);if(n instanceof a)return n;const s=n.length===1,o=n.flat();if(t&&o.some(h=>h<=0))return l.NUM;const c=t?o.map(Math.log):o,i=e[1];if(i===void 0||!C(i))return{ys:c,xs:o.map((h,m)=>[m+1]),byRow:s};const f=w(i,r);if(f instanceof a)return f;const u=f[0]?.length??0;return s?u!==c.length?l.REF:{ys:c,xs:Array.from({length:u},(h,m)=>f.map(M=>M[m]??0)),byRow:s}:f.length!==c.length?l.REF:{ys:c,xs:f,byRow:s}}const C=e=>e instanceof P||e instanceof R||typeof e=="number",nt=(e,r)=>e===void 0||!C(e)&&typeof e!="boolean"?!0:q(r.calc.scalar(e,r.frame));function et(e){return(r,t)=>{const n=tt(r,t,e);if(n instanceof a)return n;const s=nt(r[3],t);if(s instanceof a)return s;const o=j(n.ys,n.xs,s);if(!o)return l.NUM;const c=r[2];let i=n.xs;if(c!==void 0&&C(c)){const u=w(c,t);if(u instanceof a)return u;const h=n.xs[0]?.length??1,m=u[0]?.length??0;i=n.byRow||h===1&&u.length===1?Array.from({length:m},(M,E)=>u.map(g=>g[E]??0)):u}const f=i.map(u=>{const h=u.reduce((m,M,E)=>m+M*(o[E]??0),0)+(o[u.length]??0);return e?Math.exp(h):h});return n.byRow?new R(1,f.length,f):new R(f.length,1,f)}}N("TREND",1,4,et(!1)),N("GROWTH",1,4,et(!0));function gt(e,r,t,n){const s=r.map(p=>n?[...p,1]:[...p]),o=s[0]?.length??0,{inverse:c}=x(Array.from({length:o},(p,d)=>Array.from({length:o},(b,D)=>s.reduce((st,Q)=>st+(Q[d]??0)*(Q[D]??0),0))));if(!c)return;const i=r.map(p=>p.reduce((d,b,D)=>d+b*(t[D]??0),0)+(t[p.length]??0)),f=e.reduce((p,d,b)=>p+(d-(i[b]??0))**2,0),u=n?$(e)/e.length:0,h=e.reduce((p,d)=>p+(d-u)**2,0),m=h-f,M=e.length-o,E=M>0?f/M:0,g=c.map((p,d)=>Math.sqrt(Math.max(0,(p[d]??0)*E))),I=r[0]?.length??0;return{errors:g,r2:h===0?1:m/h,sey:Math.sqrt(E),f:M>0&&f>0?m/I/(f/M):0,df:M,ssreg:m,ssresid:f}}function rt(e){return(r,t)=>{const n=tt(r,t,e);if(n instanceof a)return n;const s=nt(r[2],t);if(s instanceof a)return s;const o=j(n.ys,n.xs,s);if(!o)return l.NUM;const i=[...o.slice(0,-1).reverse(),o[o.length-1]??0],f=e?i.map(Math.exp):i,u=r[3],h=u===void 0||!At(u)?!1:q(t.calc.scalar(u,t.frame));if(h instanceof a)return h;if(!h)return new R(1,f.length,f);const m=gt(n.ys,n.xs,o,s);if(!m)return l.NUM;const M=f.length,E=I=>[...I,...new Array(M-I.length).fill(l.NA)],g=s?[...m.errors.slice(0,-1).reverse(),m.errors[m.errors.length-1]??0]:[...[...m.errors].reverse(),l.NA];return new R(5,M,[...f,...g,...E([m.r2,m.sey]),...E([m.f,m.df]),...E([m.ssreg,m.ssresid])])}}const At=e=>C(e)||typeof e=="boolean";N("LINEST",1,4,rt(!1)),N("LOGEST",1,4,rt(!0));const V=e=>$(e)/e.length,L=e=>{const r=V(e);return e.reduce((t,n)=>t+(n-r)**2,0)/(e.length-1)};N("CHISQ.TEST",2,2,(e,r)=>{const t=w(e[0],r),n=w(e[1],r);if(t instanceof a)return t;if(n instanceof a)return n;const s=t.length,o=t[0]?.length??0;if(n.length!==s||(n[0]?.length??0)!==o)return l.NA;if(s*o<2)return l.NA;let c=0;for(let f=0;f<s;f++)for(let u=0;u<o;u++){const h=n[f]?.[u]??0;if(h<0)return l.NUM;if(h===0)return l.DIV0;c+=((t[f]?.[u]??0)-h)**2/h}const i=s>1&&o>1?(s-1)*(o-1):s>1?s-1:o-1;return ht(i/2,c/2)}),O("CHITEST","CHISQ.TEST"),N("T.TEST",4,4,(e,r)=>{const t=A(r.calc.scalar(e[2],r.frame)),n=A(r.calc.scalar(e[3],r.frame));if(t instanceof a)return t;if(n instanceof a)return n;const s=Math.trunc(t),o=Math.trunc(n);if(s!==1&&s!==2||o<1||o>3)return l.NUM;let c,i;if(o===1){const u=F(e[0],e[1],r);if(u instanceof a)return u;const h=u.xs.map((m,M)=>m-(u.ys[M]??0));if(h.length<2)return l.DIV0;c=V(h)/Math.sqrt(L(h)/h.length),i=h.length-1}else{const u=T([e[0]],r),h=T([e[1]],r);if(u instanceof a)return u;if(h instanceof a)return h;if(u.length<2||h.length<2)return l.DIV0;const[m,M,E,g]=[L(u),L(h),u.length,h.length],I=Math.abs(V(u)-V(h));if(o===2){i=E+g-2;const p=((E-1)*m+(g-1)*M)/i;c=I/Math.sqrt(p*(1/E+1/g))}else{const p=m/E,d=M/g;c=I/Math.sqrt(p+d),i=(p+d)**2/(p**2/(E-1)+d**2/(g-1))}}return Number.isFinite(c)?K(i/2,.5,i/(i+c*c))*s/2:l.DIV0}),O("TTEST","T.TEST"),N("F.TEST",2,2,(e,r)=>{const t=T([e[0]],r),n=T([e[1]],r);if(t instanceof a)return t;if(n instanceof a)return n;if(t.length<2||n.length<2)return l.DIV0;const[s,o]=[L(t),L(n)];if(s===0||o===0)return l.DIV0;const c=s/o,[i,f]=[t.length-1,n.length-1],u=K(f/2,i/2,f/(i*c+f));return 2*Math.min(u,1-u)}),O("FTEST","F.TEST"),N("Z.TEST",2,3,(e,r)=>{const t=T([e[0]],r);if(t instanceof a)return t;const n=A(r.calc.scalar(e[1],r.frame));if(n instanceof a)return n;if(t.length===0)return l.NA;const s=e[2]===void 0?t.length<2?l.DIV0:Math.sqrt(L(t)):A(r.calc.scalar(e[2],r.frame));return s instanceof a?s:s===0?l.DIV0:1-mt((V(t)-n)/(s/Math.sqrt(t.length)))}),O("ZTEST","Z.TEST");const Tt={1:"AVERAGE",2:"COUNT",3:"COUNTA",4:"MAX",5:"MIN",6:"PRODUCT",7:"STDEV.S",8:"STDEV.P",9:"SUM",10:"VAR.S",11:"VAR.P",12:"MEDIAN",13:"MODE.SNGL",14:"LARGE",15:"SMALL",16:"PERCENTILE.INC",17:"QUARTILE.INC",18:"PERCENTILE.EXC",19:"QUARTILE.EXC"};N("AGGREGATE",3,y,(e,r)=>{const t=A(r.calc.scalar(e[0],r.frame)),n=A(r.calc.scalar(e[1],r.frame));if(t instanceof a)return t;if(n instanceof a)return n;const s=Tt[Math.trunc(t)],o=s===void 0?void 0:ct.get(s);if(o?.kind!=="raw")return l.VALUE;const c=![2,3,6,7].includes(Math.trunc(n)),i=[1,3,5,7].includes(Math.trunc(n)),f=M=>{const E=M instanceof ot?M.parts:[M],g=[];for(const p of E)if(p instanceof P){const d=p;for(let b=d.top;b<=Math.min(d.bottom,d.sheet.lastRow);b++)if(!(i&&(d.sheet.spec.rows?.[String(b+1)]?.hidden===!0||r.calc.filtered(d.sheet).has(b))))for(let D=d.left;D<=d.right;D++)g.push(r.calc.read(d.sheet,b,D))}else{const d=r.calc.flat(p);d instanceof R?g.push(...d.data):g.push(d)}const I=c?g:g.filter(p=>!(p instanceof a));return new R(I.length,1,I)},u=Math.trunc(t)>=14,h=e.slice(2),m=u?[f(h[0]),...h.slice(1)]:h.map(f);return o.call(m,r)});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** log Γ(x), x > 0. */
|
|
2
|
+
export declare function logGamma(x: number): number;
|
|
3
|
+
/** Γ(x); NaN at 0 and the negative integers. */
|
|
4
|
+
export declare function gamma(x: number): number;
|
|
5
|
+
/** The regularized lower incomplete gamma function P(a, x). */
|
|
6
|
+
export declare function gammaP(a: number, x: number): number;
|
|
7
|
+
/** The regularized upper incomplete gamma function Q(a, x). */
|
|
8
|
+
export declare function gammaQ(a: number, x: number): number;
|
|
9
|
+
/** The regularized incomplete beta function I_x(a, b). */
|
|
10
|
+
export declare function betaI(a: number, b: number, x: number): number;
|
|
11
|
+
export declare const erf: (x: number) => number;
|
|
12
|
+
export declare const erfc: (x: number) => number;
|
|
13
|
+
/** The standard normal density. */
|
|
14
|
+
export declare const normalPdf: (z: number) => number;
|
|
15
|
+
/** The standard normal distribution function. */
|
|
16
|
+
export declare const normalCdf: (z: number) => number;
|
|
17
|
+
/** The standard normal quantile, 0 < p < 1. */
|
|
18
|
+
export declare function normalInv(p: number): number;
|
|
19
|
+
/** Where a rising function of x reaches `target`: bisection on a bracket found from `start`. */
|
|
20
|
+
export declare function solve(f: (x: number) => number, target: number, low: number, start: number, high?: number): number;
|
|
21
|
+
/** J_n(x), n ≥ 0: Bessel's integral, on which the trapezoid rule converges at once. */
|
|
22
|
+
export declare function besselJ(n: number, x: number): number;
|
|
23
|
+
/** Y_n(x), n ≥ 0, x > 0. */
|
|
24
|
+
export declare function besselY(n: number, x: number): number;
|
|
25
|
+
/** I_n(x), n ≥ 0. */
|
|
26
|
+
export declare function besselI(n: number, x: number): number;
|
|
27
|
+
/** K_n(x), n ≥ 0, x > 0. */
|
|
28
|
+
export declare function besselK(n: number, x: number): number;
|
|
29
|
+
//# sourceMappingURL=special.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
const m=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.00016431823292116355,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],S=607/128,T=.5*Math.log(2*Math.PI);export function logGamma(t){if(Number.isInteger(t)&&t<=171)return Math.log(gamma(t));let e=m[0]??0;for(let s=1;s<m.length;s++)e+=(m[s]??0)/(t+s);const o=t+S+.5;return T+Math.log(e/t)+(t+.5)*Math.log(o)-o}export function gamma(t){if(t<=0&&Number.isInteger(t))return Number.NaN;if(Number.isInteger(t)&&t<=171){let e=1;for(let o=2;o<t;o++)e*=o;return e}return t<.5?Math.PI/(Math.sin(Math.PI*t)*gamma(1-t)):Math.exp(logGamma(t))}const I=1e-16,c=1e-300,b=1e5;export function gammaP(t,e){if(e<=0)return 0;if(e<t+1){let o=1/t,s=o,r=t;for(let a=0;a<b&&(r+=1,o*=e/r,s+=o,!(Math.abs(o)<Math.abs(s)*I));a++);return s*Math.exp(-e+t*Math.log(e)-logGamma(t))}return 1-gammaQ(t,e)}export function gammaQ(t,e){if(e<=0)return 1;if(e<t+1)return 1-gammaP(t,e);let o=e+1-t,s=1/c,r=1/o,a=r;for(let n=1;n<b;n++){const h=-n*(n-t);o+=2,r=h*r+o,Math.abs(r)<c&&(r=c),s=o+h/s,Math.abs(s)<c&&(s=c),r=1/r;const M=r*s;if(a*=M,Math.abs(M-1)<I)break}return Math.exp(-e+t*Math.log(e)-logGamma(t))*a}function g(t,e,o){const s=t+e,r=t+1,a=t-1;let n=1,h=1-s*o/r;Math.abs(h)<c&&(h=c),h=1/h;let M=h;for(let i=1;i<b;i++){const p=2*i;let u=i*(e-i)*o/((a+p)*(t+p));h=1+u*h,Math.abs(h)<c&&(h=c),n=1+u/n,Math.abs(n)<c&&(n=c),h=1/h,M*=h*n,u=-(t+i)*(s+i)*o/((t+p)*(r+p)),h=1+u*h,Math.abs(h)<c&&(h=c),n=1+u/n,Math.abs(n)<c&&(n=c),h=1/h;const P=h*n;if(M*=P,Math.abs(P-1)<I)break}return M}export function betaI(t,e,o){if(o<=0)return 0;if(o>=1)return 1;const s=Math.exp(logGamma(t+e)-logGamma(t)-logGamma(e)+t*Math.log(o)+e*Math.log1p(-o));return o<(t+1)/(t+e+2)?s*g(t,e,o)/t:1-s*g(e,t,1-o)/e}export const erf=t=>t===0?0:(t<0?-1:1)*gammaP(.5,t*t),erfc=t=>t<0?2-erfc(-t):gammaQ(.5,t*t),normalPdf=t=>Math.exp(-t*t/2)/Math.sqrt(2*Math.PI),normalCdf=t=>erfc(-t/Math.SQRT2)/2;const l=(t,e)=>t.reduce((o,s)=>o*e+s,0),f={a:[2509.0859296330846,33430.57558358813,67265.7709270087,45921.95393154987,13731.69376550946,1971.5909503065513,133.14166789178438,3.3871328727963665],b:[5226.495278852854,28729.085735721943,39307.89580009271,21213.794301586597,5394.196021424751,687.1870074920579,42.31333070160091,1],c:[.0007745450142783414,.022723844989269184,.2417807251774506,1.2704582524523684,3.6478483247632045,5.769497221460691,4.630337846156546,1.4234371107496837],d:[10507500716444169e-25,.0005475938084995344,.015198666563616457,.14810397642748008,.6897673349851,1.6763848301838038,2.053191626637759,1],e:[20103343992922881e-23,27115555687434876e-21,.0012426609473880784,.026532189526576124,.29656057182850487,1.7848265399172913,5.463784911164114,6.657904643501104],f:[20442631033899397e-31,1421511758316446e-22,18463183175100548e-21,.0007868691311456133,.014875361290850615,.1369298809227358,.599832206555888,1]};export function normalInv(t){const e=t-.5;if(e===0)return 0;if(Math.abs(e)<=.425){const a=.180625-e*e;return e*l(f.a,a)/l(f.b,a)}const o=e<0?t:1-t,s=Math.sqrt(-Math.log(o)),r=s<=5?l(f.c,s-1.6)/l(f.d,s-1.6):l(f.e,s-5)/l(f.f,s-5);return e<0?-r:r}export function solve(t,e,o,s,r=Number.POSITIVE_INFINITY){let a=o,n=Math.min(s,r);for(;t(n)<e&&n<r;)a=n,n=Math.min(n*2+1,r);for(let h=0;h<400;h++){const M=(a+n)/2;if(M===a||M===n)return M;t(M)<e?a=M:n=M}return(a+n)/2}function N(t,e,o,s){const r=(o-e)/s;let a=t(e)+t(o);for(let n=1;n<s;n++)a+=t(e+n*r)*(n%2===1?4:2);return a*r/3}const d=4e4;export function besselJ(t,e){const o=Math.max(256,4*Math.ceil(Math.abs(e)+t)+256),s=Math.PI/o;let r=.5*(Math.cos(0)+Math.cos(t*Math.PI));for(let a=1;a<o;a++){const n=a*s;r+=Math.cos(t*n-e*Math.sin(n))}return r*s/Math.PI}export function besselY(t,e){const o=N(n=>Math.sin(e*Math.sin(n)-t*n),0,Math.PI,d),s=Math.asinh((760+2*t*t)/e)+2,r=t%2===0?1:-1,a=N(n=>(Math.exp(t*n)+r*Math.exp(-t*n))*Math.exp(-e*Math.sinh(n)),0,s,d);return(o-a)/Math.PI}export function besselI(t,e){const o=Math.max(256,4*Math.ceil(Math.abs(e)+t)+256),s=Math.PI/o;let r=.5*(Math.exp(e)+Math.exp(-e)*Math.cos(t*Math.PI));for(let a=1;a<o;a++){const n=a*s;r+=Math.exp(e*Math.cos(n))*Math.cos(t*n)}return r*s/Math.PI}export function besselK(t,e){const o=Math.acosh(760/e+1)+2+t,s=4096,r=o/s;let a=.5*Math.exp(-e);for(let n=1;n<=s;n++){const h=n*r;a+=Math.exp(-e*Math.cosh(h))*Math.cosh(t*h)}return a*r}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{format as M,isValidFormat as D}from"numfmt";import{CellError as i,ERR as d}from"../../values.js";import{numberOfText as V,toBool as $,toNumber as h,toText as l}from"../coerce.js";import{alias as F,cellsOf as H,eachRow as N,many as C,number as x,raw as b,scalar as u}from"./define.js";import{wildcard as S}from"./criteria.js";const p=n=>r=>{const t=l(r);return t instanceof i?t:n(t)},m=(n,r)=>{if(n===void 0)return r;const t=h(n);return t instanceof i?t:t<0?d.VALUE:Math.trunc(t)},O=(n,r)=>Array.from(n,t=>{const e=r(t);return e.length===t.length?e:t}).join(""),I=n=>O(n,r=>r.toUpperCase()),R=n=>O(n,r=>r.toLowerCase());u("LEFT",1,2,(n,r)=>{const t=l(n),e=m(r,1);return t instanceof i?t:e instanceof i?e:t.slice(0,e)}),u("RIGHT",1,2,(n,r)=>{const t=l(n),e=m(r,1);return t instanceof i?t:e instanceof i?e:e===0?"":t.slice(-e)}),u("MID",3,3,(n,r,t)=>{const e=l(n),s=h(r),o=m(t,0);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;if(s<1)return d.VALUE;const c=Math.trunc(s)-1;return e.slice(c,c+o)}),u("LEN",1,1,p(n=>n.length)),u("LOWER",1,1,p(R)),u("UPPER",1,1,p(I)),u("PROPER",1,1,p(n=>R(n).replace(/(^|[^\p{L}])(\p{L})/gu,(r,t,e)=>`${t}${I(e)}`))),u("TRIM",1,1,p(n=>n.replace(/ +/gu," ").replace(/^ | $/gu,""))),u("CLEAN",1,1,p(n=>n.replace(/[\u0000-\u001f]/gu,""))),u("T",1,1,n=>typeof n=="string"?n:""),u("EXACT",2,2,(n,r)=>{const t=l(n),e=l(r);return t instanceof i?t:e instanceof i?e:t===e}),u("REPT",2,2,(n,r)=>{const t=l(n),e=m(r,0);return t instanceof i?t:e instanceof i?e:t.length*e>32767?d.VALUE:t.repeat(e)}),u("CHAR",1,1,x(n=>{const r=Math.trunc(n);return r<1||r>255?d.VALUE:X(r)})),u("UNICHAR",1,1,x(n=>{const r=Math.trunc(n);return r<1||r>1114111?d.VALUE:String.fromCodePoint(r)})),u("CODE",1,1,p(n=>n===""?d.VALUE:n.charCodeAt(0))),u("UNICODE",1,1,p(n=>n.codePointAt(0)??d.VALUE));const B="€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ";function X(n){return n>=128&&n<160?B.charAt(n-128):String.fromCharCode(n)}b("CONCAT",1,C,(n,r)=>{let t="",e;return N(n,r,s=>{if(e)return;const o=l(s);o instanceof i?e=o:t+=o}),e??t}),u("CONCATENATE",1,C,(...n)=>{let r="";for(const t of n){const e=l(t);if(e instanceof i)return e;r+=e}return r}),b("TEXTJOIN",3,C,(n,r)=>{const[t,e,...s]=n,o=H(t??"",r);if(o instanceof i)return o;const c=[];for(let E=0;E<o.rows;E++)for(let L=0;L<o.cols;L++){const g=l(o.at(E,L));if(g instanceof i)return g;c.push(g)}const a=$(r.calc.scalar(e??!0,r.frame));if(a instanceof i)return a;const f=[];let A;if(N(s,r,E=>{if(A)return;const L=l(E);L instanceof i?A=L:(!a||L!=="")&&f.push(L)}),A)return A;let U=f[0]??"";for(let E=1;E<f.length;E++)U+=`${c.length>0?c[(E-1)%c.length]??"":""}${f[E]??""}`;return U}),u("SUBSTITUTE",3,4,(n,r,t,e)=>{const s=l(n),o=l(r),c=l(t);if(s instanceof i)return s;if(o instanceof i)return o;if(c instanceof i)return c;if(o==="")return s;if(e===void 0)return s.split(o).join(c);const a=h(e);if(a instanceof i)return a;if(a<1)return d.VALUE;let f=-1;for(let A=0;A<Math.trunc(a);A++)if(f=s.indexOf(o,f+1),f<0)return s;return`${s.slice(0,f)}${c}${s.slice(f+o.length)}`}),u("REPLACE",4,4,(n,r,t,e)=>{const s=l(n),o=h(r),c=m(t,0),a=l(e);if(s instanceof i)return s;if(o instanceof i)return o;if(c instanceof i)return c;if(a instanceof i)return a;if(o<1)return d.VALUE;const f=Math.trunc(o)-1;return`${s.slice(0,f)}${a}${s.slice(f+c)}`}),u("FIND",2,3,(n,r,t)=>{const e=l(n),s=l(r),o=t===void 0?1:h(t);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;if(o<1||o>s.length+1)return d.VALUE;const c=s.indexOf(e,Math.trunc(o)-1);return c<0?d.VALUE:c+1}),u("SEARCH",2,3,(n,r,t)=>{const e=l(n),s=l(r),o=t===void 0?1:h(t);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;if(o<1||o>s.length+1)return d.VALUE;const c=Math.trunc(o)-1,a=S(`${e}*`);for(let f=c;f<=s.length;f++)if(a(s.slice(f)))return f+1;return d.VALUE}),u("VALUE",1,1,n=>typeof n=="number"?n:n==null?0:typeof n!="string"?d.VALUE:V(n)??d.VALUE),u("NUMBERVALUE",1,3,(n,r,t)=>{const e=l(n),s=l(r??"."),o=l(t??",");if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;const c=e.replace(/\s/gu,"").split(o).join("").replace(s,".");if(c==="")return 0;const a=/%*$/u.exec(c)?.[0].length??0,f=Number(c.slice(0,c.length-a));return Number.isNaN(f)?d.VALUE:f/100**a}),u("TEXT",2,2,(n,r)=>{const t=l(r);if(t instanceof i)return t;if(!D(t))return d.VALUE;if(typeof n=="boolean")return n?"TRUE":"FALSE";const e=typeof n=="string"?V(n)??n:n??0;if(e instanceof i)return e;try{return M(t,e)}catch{return d.VALUE}});function y(n,r,t){const e=t?"#,##0":"0",s=r>0?`.${"0".repeat(r)}`:"";return M(`${e}${s}`,n)}const P=(n,r)=>{const t=10**r;return Math.sign(n)*Math.round(Math.abs(n)*t+1e-9)/t};u("FIXED",1,3,(n,r,t)=>{const e=h(n),s=r==null?2:h(r),o=t===void 0?!1:$(t);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;const c=Math.trunc(s);return y(P(e,c),Math.max(0,c),!o)}),u("DOLLAR",1,2,(n,r)=>{const t=h(n),e=r==null?2:h(r);if(t instanceof i)return t;if(e instanceof i)return e;const s=Math.trunc(e),o=y(Math.abs(P(t,s)),Math.max(0,s),!0);return t<0?`($${o})`:`$${o}`});function j(n,r,t,e,s){const o=e?R(n):n,c=e?R(r):r,a=[];for(let f=o.indexOf(c);f>=0&&c!=="";)a.push({at:f,length:c.length}),f=o.indexOf(c,f+c.length);return t>0?(s&&a.push({at:n.length,length:0}),a[t-1]):(s&&a.unshift({at:0,length:0}),a[a.length+t])}function w(n){return(...r)=>{const[t,e,s,o,c,a]=r,f=l(t),A=l(e),U=s==null?1:h(s),E=o==null?0:h(o),L=c==null?0:h(c);if(f instanceof i)return f;if(A instanceof i)return A;if(U instanceof i)return U;if(E instanceof i)return E;if(L instanceof i)return L;const g=Math.trunc(U);if(g===0||Math.abs(g)>Math.max(f.length,1))return d.VALUE;if(A==="")return g>0===(n==="before")?"":f;const T=j(f,A,g,E===1,L===1);return T?n==="before"?f.slice(0,T.at):f.slice(T.at+T.length):a===void 0?d.NA:a}}u("TEXTBEFORE",2,6,w("before"),{errors:!0}),u("TEXTAFTER",2,6,w("after"),{errors:!0}),u("HYPERLINK",1,2,(n,r)=>r===void 0?n??null:r),u("ENCODEURL",1,1,p(n=>encodeURIComponent(n)));for(const n of["LEN","LEFT","RIGHT","MID","FIND","SEARCH","REPLACE"])F(`${n}B`,n);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Node } from "../formula/ast.js";
|
|
2
|
+
import type { Matrix, Scalar } from "../values.js";
|
|
3
|
+
import type { Worksheet } from "../workbook.js";
|
|
4
|
+
export declare class Reference {
|
|
5
|
+
readonly sheet: Worksheet;
|
|
6
|
+
readonly top: number;
|
|
7
|
+
readonly left: number;
|
|
8
|
+
readonly bottom: number;
|
|
9
|
+
readonly right: number;
|
|
10
|
+
constructor(sheet: Worksheet, top: number, left: number, bottom: number, right: number);
|
|
11
|
+
get rows(): number;
|
|
12
|
+
get cols(): number;
|
|
13
|
+
get single(): boolean;
|
|
14
|
+
/** The same place, as a key. */
|
|
15
|
+
get key(): string;
|
|
16
|
+
}
|
|
17
|
+
/** Several places at once: (A1,C3), or a 3D reference. */
|
|
18
|
+
export declare class Union {
|
|
19
|
+
readonly parts: readonly Reference[];
|
|
20
|
+
constructor(parts: readonly Reference[]);
|
|
21
|
+
}
|
|
22
|
+
/** A LAMBDA, with what it closes over. */
|
|
23
|
+
export declare class Lambda {
|
|
24
|
+
readonly params: readonly string[];
|
|
25
|
+
readonly body: Node;
|
|
26
|
+
readonly frame: Frame;
|
|
27
|
+
constructor(params: readonly string[], body: Node, frame: Frame);
|
|
28
|
+
}
|
|
29
|
+
/** A function's argument left empty. */
|
|
30
|
+
export declare class Missing {
|
|
31
|
+
readonly missing = true;
|
|
32
|
+
}
|
|
33
|
+
export declare const MISSING: Missing;
|
|
34
|
+
export type Value = Scalar | Matrix | Reference | Union | Lambda | Missing;
|
|
35
|
+
/** LET's and a LAMBDA's names. */
|
|
36
|
+
export interface Scope {
|
|
37
|
+
names: ReadonlyMap<string, Value>;
|
|
38
|
+
parent?: Scope;
|
|
39
|
+
}
|
|
40
|
+
/** Where a formula is being evaluated. */
|
|
41
|
+
export interface Frame {
|
|
42
|
+
sheet: Worksheet;
|
|
43
|
+
row: number;
|
|
44
|
+
col: number;
|
|
45
|
+
/** How far it is from where it was written. */
|
|
46
|
+
dr: number;
|
|
47
|
+
dc: number;
|
|
48
|
+
scope?: Scope;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export class Reference{sheet;top;left;bottom;right;constructor(t,i,r,e,o){this.sheet=t,this.top=i,this.left=r,this.bottom=e,this.right=o}get rows(){return this.bottom-this.top+1}get cols(){return this.right-this.left+1}get single(){return this.top===this.bottom&&this.left===this.right}get key(){return`${String(this.sheet.index)}!${String(this.top)},${String(this.left)}:${String(this.bottom)},${String(this.right)}`}}export class Union{parts;constructor(t){this.parts=t}}export class Lambda{params;body;frame;constructor(t,i,r){this.params=t,this.body=i,this.frame=r}}export class Missing{missing=!0}export const MISSING=new Missing;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ChartDef } from "@allyhub-next/chart";
|
|
2
|
+
import type { SheetChart, SheetChartType } from "@allyhub-next/formats";
|
|
3
|
+
import { type Area } from "./address.js";
|
|
4
|
+
import type { Calc } from "./calc/engine.js";
|
|
5
|
+
import type { Chart, Worksheet } from "./workbook.js";
|
|
6
|
+
/** What a chart is unless it says otherwise: Excel's new chart. */
|
|
7
|
+
export declare const SHEET_CHART_DEFAULTS: {
|
|
8
|
+
/** Pixels. */
|
|
9
|
+
readonly width: 480;
|
|
10
|
+
readonly height: 288;
|
|
11
|
+
/** Points. */
|
|
12
|
+
readonly size: 9;
|
|
13
|
+
readonly titleSize: 14;
|
|
14
|
+
readonly ink: "#595959";
|
|
15
|
+
/** Pixels to the point, at 96 to the inch. */
|
|
16
|
+
readonly pixelsToPoints: 0.75;
|
|
17
|
+
};
|
|
18
|
+
/** A chart as it is drawn now: what its cells compute, from the sheet it is on. */
|
|
19
|
+
export declare function chartDef(calc: Calc, sheet: Worksheet, chart: Chart): ChartDef;
|
|
20
|
+
/** A chart's size on the sheet, pixels. */
|
|
21
|
+
export declare const chartSize: (spec: SheetChart) => {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
export interface ChartSvgOptions {
|
|
26
|
+
/** The chart's ground. */
|
|
27
|
+
paper?: string;
|
|
28
|
+
/** Its edge; none for no edge. */
|
|
29
|
+
edge?: string;
|
|
30
|
+
font?: string;
|
|
31
|
+
}
|
|
32
|
+
/** A chart as an SVG of `width` × `height` pixels: the one drawing the grid, a PDF and a picture show. */
|
|
33
|
+
export declare function chartSvg(def: ChartDef, width: number, height: number, o?: ChartSvgOptions): string;
|
|
34
|
+
/** Every reference a chart holds through a change. */
|
|
35
|
+
export declare function chartAfter(chart: SheetChart, again: (text: string) => string): SheetChart;
|
|
36
|
+
export type NewChart = Pick<SheetChart, "type" | "categories" | "series" | "legend" | "title">;
|
|
37
|
+
/**
|
|
38
|
+
* What a chart of a range reads, as Excel's Insert Chart lays a selection
|
|
39
|
+
* out: a first row of text names the series, a first column of text or dates
|
|
40
|
+
* is the categories, and with more columns than rows each row is a series. A
|
|
41
|
+
* scatter's first column is its places across.
|
|
42
|
+
*/
|
|
43
|
+
export declare function chartOfRange(calc: Calc, sheet: Worksheet, from: Worksheet, area: Area, type: SheetChartType): NewChart | undefined;
|
|
44
|
+
/** The range a chart reads as one (Select Data's), when its pieces make one. */
|
|
45
|
+
export declare function chartDataRange(calc: Calc, sheet: Worksheet, chart: Chart): string | undefined;
|
|
46
|
+
/** A range typed in Select Data: its sheet and area. */
|
|
47
|
+
export declare function readDataRange(calc: Calc, sheet: Worksheet, text: string): {
|
|
48
|
+
sheet: Worksheet;
|
|
49
|
+
area: Area;
|
|
50
|
+
} | undefined;
|
|
51
|
+
/** Where a chart's top left is, in pixels from the sheet's, given each row's and column's start. */
|
|
52
|
+
export declare function chartPlace(spec: SheetChart, rowTop: (row: number) => number, columnLeft: (col: number) => number): {
|
|
53
|
+
left: number;
|
|
54
|
+
top: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{chartDrawing as B,isRound as F,isScatter as R}from"@allyhub-next/chart";import{cellName as U,columnLetter as q,contains as I,rangeName as j,readAddress as V,readArea as W}from"./address.js";import{Reference as N,Union as G}from"./calc/types.js";import{shownValue as J}from"./format.js";import{sheetPrefix as D}from"./formula/print.js";import{CellError as K,Matrix as T}from"./values.js";export const SHEET_CHART_DEFAULTS={width:480,height:288,size:9,titleSize:14,ink:"#595959",pixelsToPoints:.75};const Q={dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},k=e=>typeof e=="string"?Q[e]??"#000000":e.rgb;function z(e,o,n){const{node:t}=n;if(!t)return[];const i=e.eval(t,{sheet:o,row:0,col:0,dr:0,dc:0}),s=u=>{const a=u.sheet,h=e.filtered(a),m=[],x=Math.min(u.bottom,a.lastRow),g=Math.min(u.right,a.columnsUsed-1);for(let c=u.top;c<=x;c++)if(!(h.has(c)||a.spec.rows?.[String(c+1)]?.hidden===!0))for(let l=u.left;l<=g;l++)a.spec.columns?.[q(l)]?.hidden!==!0&&m.push({value:e.value(a,c,l),sheet:a,row:c,col:l});return m};if(i instanceof N)return s(i);if(i instanceof G)return i.parts.flatMap(s);if(i instanceof T)return i.data.map(u=>({value:u}));const r=e.flat(i);return r instanceof T?r.data.map(u=>({value:u})):[{value:r}]}const E=e=>{if(e.value===null)return"";const o=e.sheet&&e.row!==void 0&&e.col!==void 0?e.sheet.lookAt(e.row,e.col).format:void 0;return J(e.value,o)};function H(e){return typeof e=="number"?Number.isFinite(e)?e:null:e===null||e instanceof K?null:typeof e=="boolean"&&e?1:0}const P=e=>e&&{...e.min===void 0?{}:{minimum_scale:e.min},...e.max===void 0?{}:{maximum_scale:e.max},...e.major===void 0?{}:{major_unit:e.major},...e.gridlines===void 0?{}:{has_major_gridlines:e.gridlines},...e.visible===void 0?{}:{visible:e.visible},...e.format===void 0?{}:{number_format:e.format},...e.reverse===void 0?{}:{reverse_order:e.reverse},...e.title===void 0||e.title===""?{}:{title:e.title}},C=e=>e===void 0?void 0:{rgb:e};function X(e){if(e===void 0||e===!1)return;if(e===!0)return{show_value:!0};const o=typeof e.color=="string"?C(e.color):void 0;return{...e.value===void 0?{}:{show_value:e.value},...e.percentage===void 0?{}:{show_percentage:e.percentage},...e.category===void 0?{}:{show_category_name:e.category},...e.series===void 0?{}:{show_series_name:e.series},...e.format===void 0?{}:{number_format:e.format},...e.position===void 0?{}:{position:e.position},...e.size===void 0?{}:{size:e.size},...o?{color:o}:{}}}const Y=e=>{const o=e.find(n=>n.sheet);return o?.sheet&&o.row!==void 0&&o.col!==void 0?o.sheet.lookAt(o.row,o.col).format:void 0};export function chartDef(e,o,n){const{spec:t}=n,i=R(t.type),s=n.categories?z(e,o,n.categories):void 0,r=n.series.map((l,b)=>{const p=t.series[b],v=z(e,o,l.values),$=l.name?z(e,o,l.name)[0]:void 0,A=l.x?z(e,o,l.x):i?s:void 0,w=p.format??Y(v),y=C(p.color);return{name:($?E($):p.name)??`Series${String(b+1)}`,values:v.map(f=>H(f.value)),...A?{x:A.map(f=>H(f.value))}:{},...w===void 0?{}:{number_format:w},...y?{color:y}:{},...p.smooth===void 0?{}:{smooth:p.smooth},...p.line_width===void 0?{}:{line_width:p.line_width},...p.marker_size===void 0?{}:{marker_size:p.marker_size}}}),u=Math.max(0,...r.map(l=>l.values.length)),a=s?s.map(E):Array.from({length:u},(l,b)=>String(b+1)),h=n.title?z(e,o,n.title)[0]:void 0,m=h?E(h):t.title,x=X(t.labels),g=P(t.value_axis),c=P(t.category_axis);return{type:t.type,categories:a,series:r,...m===void 0||m===""?{}:{title:m},...t.legend===void 0?{}:{legend:t.legend},...x?{labels:x}:{},...t.gap_width===void 0?{}:{gap_width:t.gap_width},...t.overlap===void 0?{}:{overlap:t.overlap},...t.vary_by_categories===void 0?{}:{vary_by_categories:t.vary_by_categories},...t.hole_size===void 0?{}:{hole_size:t.hole_size},...g?{value_axis:g}:{},...c?{category_axis:c}:{},font_size:t.size??SHEET_CHART_DEFAULTS.size,title_size:t.title_size??SHEET_CHART_DEFAULTS.titleSize,font_color:C(t.color)??{rgb:SHEET_CHART_DEFAULTS.ink}}}export const chartSize=e=>({width:e.width??SHEET_CHART_DEFAULTS.width,height:e.height??SHEET_CHART_DEFAULTS.height});const Z={"&":"&","<":"<",">":">",'"':"""},O=e=>e.replace(/[&<>"]/gu,o=>Z[o]??o),d=e=>String(Number(e.toFixed(3)));function L(e){const o=e.fill===void 0?"none":k(e.fill),n=e.width>0?k(e.color):"none";return`<path d="${O(e.d)}" fill="${o}" stroke="${n}" stroke-width="${d(e.width)}" stroke-linejoin="round"/>`}function ee(e){const o=[];for(const n of[...e.grid,...e.shapes])o.push(L(n));for(const n of[...e.boxes,...e.keys])o.push(`<rect x="${d(n.x)}" y="${d(n.y)}" width="${d(n.width)}" height="${d(n.height)}" fill="${k(n.color)}"/>`);for(const n of[...e.axes,...e.lines])o.push(L(n));for(const n of e.dots)o.push(`<circle cx="${d(n.x)}" cy="${d(n.y)}" r="${d(n.r)}" fill="${k(n.color)}"/>`);for(const n of e.words){const t=n.rotate===void 0?"":` transform="rotate(${d(n.rotate)} ${d(n.x)} ${d(n.y)})"`;o.push(`<text x="${d(n.x)}" y="${d(n.y)}" font-size="${d(n.size)}" text-anchor="${n.anchor}" dominant-baseline="central" fill="${k(n.color)}"${t}>${O(n.text)}</text>`)}return o.join("")}export function chartSvg(e,o,n,t={}){const i=SHEET_CHART_DEFAULTS.pixelsToPoints,s=o*i,r=n*i,u=t.font??"Carlito, Calibri, Arial, sans-serif",a=t.paper??"#FFFFFF",h=t.edge??"#D9D9D9";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${d(s)} ${d(r)}" width="${d(o)}" height="${d(n)}" font-family="${O(u)}"><rect x="0.375" y="0.375" width="${d(s-.75)}" height="${d(r-.75)}" fill="${a}" stroke="${h==="none"?"none":h}" stroke-width="0.75"/>${ee(B(e,s,r))}</svg>`}export function chartAfter(e,o){const n=i=>i?.startsWith("=")===!0?o(i):i,t=n(e.title);return{...e,...t===void 0?{}:{title:t},...e.categories===void 0?{}:{categories:o(e.categories)},series:e.series.map(i=>{const s=n(i.name);return{...i,values:o(i.values),...i.x===void 0?{}:{x:o(i.x)},...s===void 0?{}:{name:s}}})}}function te(e,o,n,t){if(t){const i=t.data;if(n.top===i.top&&n.bottom===i.bottom&&n.left===n.right){const s=t.columns[n.left-t.at.col];if(s)return`${t.name}[${s.name}]`}}return`${o===e?"":D(o.name)}${j(n)}`}const ne=(e,o,n,t)=>typeof e.value(o,n,t)=="number",oe=(e,o,n,t)=>{const i=e.value(o,n,t);if(typeof i=="string")return!0;const s=o.lookAt(n,t).format;return typeof i=="number"&&s!==void 0&&/[ymd]/iu.test(s)};export function chartOfRange(e,o,n,t,i){const s=t.bottom-t.top+1,r=t.right-t.left+1,u=o.tables.find(f=>I(f.area,t.top,t.left)),a=f=>te(n,o,f,u),h=R(i),m=s>1&&Array.from({length:r},(f,_)=>t.left+_).some(f=>!ne(e,o,t.top,f)),x=r>1&&(h||Array.from({length:s-(m?1:0)},(f,_)=>_).every(f=>oe(e,o,t.top+(m?1:0)+f,t.left)||e.value(o,t.top+(m?1:0)+f,t.left)===null)),g=t.top+(m?1:0),c=t.left+(x?1:0);if(g>t.bottom||c>t.right)return;const l=!h&&!F(i)&&t.right-c>t.bottom-g,b=[],p=(f,_)=>e.value(o,f,_)===null?void 0:`=${o===n?"":D(o.name)}${U({row:f,col:_})}`,v=l?{first:g,last:t.bottom}:{first:c,last:t.right};for(let f=v.first;f<=v.last;f++){const _=l?{top:f,left:c,bottom:f,right:t.right}:{top:g,left:f,bottom:t.bottom,right:f},M=l?x?p(f,t.left):void 0:m?p(t.top,f):void 0;b.push({values:a(_),...M===void 0?{}:{name:M}})}const $=l?m?{top:t.top,left:c,bottom:t.top,right:t.right}:void 0:x?{top:g,left:t.left,bottom:t.bottom,right:t.left}:void 0,A=b.length>1&&!F(i),w=F(i)?b.slice(0,1):b,y=w.length===1?w[0]?.name:void 0;return{type:i,...$?{categories:a($)}:{},series:w,...A||F(i)?{legend:"bottom"}:{},...y===void 0?{}:{title:y}}}function S(e,o,n){if(!n?.node)return;const t=e.eval(n.node,{sheet:o,row:0,col:0,dr:0,dc:0});return t instanceof N?{sheet:t.sheet,area:{top:t.top,left:t.left,bottom:Math.min(t.bottom,Math.max(t.top,t.sheet.lastRow)),right:t.right}}:void 0}export function chartDataRange(e,o,n){const t=[S(e,o,n.categories),...n.series.flatMap(r=>[S(e,o,r.values),S(e,o,r.name),S(e,o,r.x)])].filter(r=>r!==void 0),i=t[0];if(!i||t.some(r=>r.sheet!==i.sheet))return;const s={top:Math.min(...t.map(r=>r.area.top)),left:Math.min(...t.map(r=>r.area.left)),bottom:Math.max(...t.map(r=>r.area.bottom)),right:Math.max(...t.map(r=>r.area.right))};return`${i.sheet===o?"":D(i.sheet.name)}${j(s)}`}export function readDataRange(e,o,n){const t=n.lastIndexOf("!"),i=t<0?void 0:n.slice(0,t).replace(/^'|'$/gu,""),s=i===void 0?o:e.wb.sheet(i.replaceAll("''","'")),r=W(n.slice(t+1).replaceAll("$",""));return s&&r?{sheet:s,area:r}:void 0}export function chartPlace(e,o,n){const t=V(e.at)??{row:0,col:0};return{left:n(t.col)+(e.x??0),top:o(t.row)+(e.y??0),...chartSize(e)}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Calc, type CalcOptions } from "./calc/engine.js";
|
|
2
|
+
import { type SheetProblem } from "./file.js";
|
|
3
|
+
import { type Workbook, type WorkbookFiles, type Worksheet } from "./workbook.js";
|
|
4
|
+
export interface CheckedWorkbook {
|
|
5
|
+
workbook?: Workbook;
|
|
6
|
+
calc?: Calc;
|
|
7
|
+
problems: SheetProblem[];
|
|
8
|
+
}
|
|
9
|
+
/** A workbook read, computed and checked. */
|
|
10
|
+
export declare function checkWorkbook(files: WorkbookFiles, o?: CalcOptions & {
|
|
11
|
+
scenario?: string | undefined;
|
|
12
|
+
}): CheckedWorkbook;
|
|
13
|
+
/** A place as a problem or a table names it. */
|
|
14
|
+
export declare const placeName: (sheet: Worksheet, row: number, col: number) => string;
|
|
15
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{cellName as d,rangeName as b}from"./address.js";import{ERR as p,Matrix as w,CellError as m}from"./values.js";import{analyse as $}from"./calc/analyse.js";import{Calc as k}from"./calc/engine.js";import{toBool as g}from"./calc/coerce.js";import{ENTRY as l}from"./file.js";import{fileCells as x}from"./files.js";import{applyScenario as y}from"./scenario.js";import{readWorkbook as S}from"./workbook.js";class O{problems;wb;lineOf;constructor(t,e){this.wb=t,this.problems=[...e.problems],this.lineOf=e.lineOf}at(t,e){const o=t.line??(t.path===void 0?void 0:this.lineOf(t.path));this.problems.push({file:t.file===""?l:t.file,...o===void 0?{}:{line:o},message:e})}formulas(){const t=new Map;for(const e of this.wb.sheets){for(const o of e.formulas)t.set(o.shared,e);for(const o of e.tables)for(const n of o.columns)n.formula&&t.set(n.formula,e);for(const o of e.conditions)for(const n of o.formulas)t.set(n,e);for(const o of e.validations)for(const n of o.formulas)n&&t.set(n,e);for(const o of e.charts){o.title&&t.set(o.title,e),o.categories&&t.set(o.categories,e);for(const n of o.series)t.set(n.values,e),n.x&&t.set(n.x,e),n.name&&t.set(n.name,e)}}for(const e of this.wb.names.values())e.formula&&t.set(e.formula,void 0);for(const e of this.wb.checks)t.set(e.formula,void 0);return t}formulaProblems(){for(const[t,e]of this.formulas()){const o=s=>{this.at(t.source,`${t.text}: ${s}`)};if(t.error){o(`does not parse: ${t.error.message}`);continue}const n=$(this.wb,t);t.analysis=n;for(const s of new Set(n.unknownNames))o(`there is no name ${s}`);for(const s of new Set(n.unknownFunctions))o(`there is no function ${s}`);for(const s of n.arguments)o(`${s.name} takes ${s.min===s.max?String(s.min):`${String(s.min)} to ${String(s.max)}`} arguments and is given ${String(s.given)}`);for(const s of n.reads){if(s.kind==="ref"){for(const r of[s.sheet,s.lastSheet])r!==void 0&&!this.wb.sheet(r)&&o(`there is no sheet ${r}`);continue}const f=s.table===void 0?e?.tableAt(t.row,t.col):this.wb.table(s.table);if(!f){o(s.table===void 0?"a column named with no table, outside a table":`there is no table ${s.table}`);continue}for(const r of s.columns)f.column(r)||o(`table ${f.name} has no column ${r}; it has ${f.columns.map(c=>c.name).join(", ")}`)}}}cycles(t){for(const e of t.cycles){const o=e.reduce((r,c,h)=>{const a=e[r];return a&&(c.row<a.row||c.row===a.row&&c.col<a.col)?h:r},0),n=[...e.slice(o),...e.slice(0,o)],s=n[0];if(!s)continue;const f=[...n,s].map(r=>`${r.sheet.name}!${d(r)}`).join(" → ");this.at(s.shared.source,`a circular reference: ${f}`)}}scenarios(){const{scenarios:t}=this.wb.file;for(const[e,o]of Object.entries(t??{}))for(const n of Object.keys(o))this.wb.name(n)||this.at({file:l,path:["scenarios",e,n]},`scenario ${e} sets ${n}, and there is no name ${n}`)}files(t,e){for(const o of this.wb.sheets)for(const{row:n,col:s,paths:f}of x(o,t))for(const r of f)e(r)||this.at(this.wb.sourceOf(o,n,s)??{file:l},`${placeName(o,n,s)} names ${r}, which is not there`)}checks(t){const e=this.wb.sheets[0];if(e)for(const o of this.wb.checks){if(!o.formula.node)continue;const n=t.evaluate(o.formula,e),s=u(n);s!==void 0&&this.at(o.source,`check "${o.name}" does not hold: ${o.formula.text} is ${s}`)}}}function u(i){if(i instanceof w){for(const e of i.data){const o=u(e);if(o!==void 0)return o}return}if(i instanceof m)return i.code;const t=g(i);return t instanceof m?p.VALUE.code:t?void 0:"FALSE"}export function checkWorkbook(i,t={}){const e=S(i),{workbook:o}=e;if(!o)return{problems:e.problems};const n=new O(o,e);n.scenarios(),t.scenario!==void 0&&y(o,t.scenario);const s=new k(o,t);return n.formulaProblems(),s.calculate(),n.cycles(s),n.checks(s),i.exists&&n.files(s,i.exists),{workbook:o,calc:s,problems:n.problems}}export const placeName=(i,t,e)=>`${i.name}!${b({top:t,left:e,bottom:t,right:e})}`;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** How a file writes its records: what the sheet's own writes keep. */
|
|
2
|
+
export interface CsvDialect {
|
|
3
|
+
/** "," for a sheet's file, "\t" for the clipboard. */
|
|
4
|
+
delimiter: string;
|
|
5
|
+
/** The line ending the file uses most: "\n" or "\r\n". */
|
|
6
|
+
newline: "\n" | "\r\n";
|
|
7
|
+
/** The file starts with a byte-order mark. */
|
|
8
|
+
bom: boolean;
|
|
9
|
+
/** The last record is followed by a line ending. */
|
|
10
|
+
finalNewline: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** One record of the file, and where it is. */
|
|
13
|
+
export interface CsvRecord {
|
|
14
|
+
fields: string[];
|
|
15
|
+
/** The record's text in the file, from its first character to its line ending (not included). */
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
/** The line it starts on, from 1. */
|
|
19
|
+
line: number;
|
|
20
|
+
}
|
|
21
|
+
/** What is wrong with a file as CSV, whatever is in it. */
|
|
22
|
+
export interface CsvProblem {
|
|
23
|
+
line: number;
|
|
24
|
+
message: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ParsedCsv {
|
|
27
|
+
/** The text as read, the byte-order mark included. */
|
|
28
|
+
source: string;
|
|
29
|
+
records: CsvRecord[];
|
|
30
|
+
dialect: CsvDialect;
|
|
31
|
+
problems: CsvProblem[];
|
|
32
|
+
}
|
|
33
|
+
export declare const DEFAULT_DIALECT: CsvDialect;
|
|
34
|
+
/**
|
|
35
|
+
* Reads CSV (or, with "\t", tab-separated text) into records. A line with
|
|
36
|
+
* nothing on it is a record of one empty field; a line ending at the very
|
|
37
|
+
* end of the text is not a record. A quote that is never closed is a
|
|
38
|
+
* problem, and the record runs to the end of the text.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readCsv(text: string, delimiter?: string): ParsedCsv;
|
|
41
|
+
/**
|
|
42
|
+
* The records of CSV text as rows, leaving out lines with nothing in them:
|
|
43
|
+
* what a reader of data wants (ctx.data). A sheet keeps every record.
|
|
44
|
+
*/
|
|
45
|
+
export declare function csvRows(text: string, delimiter?: string): string[][];
|
|
46
|
+
/** A field as CSV writes it: quoted only when it has to be. */
|
|
47
|
+
export declare function csvField(value: string, delimiter?: string): string;
|
|
48
|
+
/** A record as CSV writes it, without its line ending. */
|
|
49
|
+
export declare function csvRecord(fields: readonly string[], delimiter?: string): string;
|
|
50
|
+
/** Rows as a CSV file in a dialect. */
|
|
51
|
+
export declare function writeCsv(rows: readonly (readonly string[])[], dialect?: CsvDialect): string;
|
|
52
|
+
/**
|
|
53
|
+
* Cells as tab-separated text, the way a spreadsheet puts a range on the
|
|
54
|
+
* clipboard: a field with a tab, a line ending or a quote in it is quoted.
|
|
55
|
+
*/
|
|
56
|
+
export declare function toTsv(rows: readonly (readonly string[])[]): string;
|
|
57
|
+
/**
|
|
58
|
+
* Tab-separated text from the clipboard as rows. One line ending at the
|
|
59
|
+
* end is not a row (spreadsheets add one).
|
|
60
|
+
*/
|
|
61
|
+
export declare function fromTsv(text: string): string[][];
|
|
62
|
+
//# sourceMappingURL=csv.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const DEFAULT_DIALECT={delimiter:",",newline:`
|
|
3
|
+
`,bom:!1,finalNewline:!0};export function readCsv(n,e=","){const s=n.startsWith("\uFEFF"),o=[],a=[];let h=0,m=0,t=s?1:0,u=1;const c=n.length;for(;t<c;){const b=t,p=u,l=[];let r="",f=!1,d=!1,g=!1;for(;t<c;){const i=n.charAt(t);if(f){if(i==='"'){if(n.charAt(t+1)==='"'){r+='"',t+=2;continue}f=!1,t+=1;continue}i===`
|
|
4
|
+
`&&(u+=1),r+=i,t+=1;continue}if(i==='"'&&r===""&&!d){f=!0,d=!0,t+=1;continue}if(i===e){l.push(r),r="",d=!1,t+=1;continue}if(i==="\r"||i===`
|
|
5
|
+
`){const A=t;i==="\r"&&n.charAt(t+1)===`
|
|
6
|
+
`?(h+=1,t+=2):(i===`
|
|
7
|
+
`&&(m+=1),t+=1),u+=1,l.push(r),o.push({fields:l,start:b,end:A,line:p}),g=!0;break}r+=i,t+=1}g||(f&&a.push({line:p,message:'a quoted field is never closed: a " is missing'}),l.push(r),o.push({fields:l,start:b,end:c,line:p}))}const w=n.charAt(c-1);return{source:n,records:o,dialect:{delimiter:e,newline:h>m?`\r
|
|
8
|
+
`:`
|
|
9
|
+
`,bom:s,finalNewline:c>(s?1:0)&&(w===`
|
|
10
|
+
`||w==="\r")},problems:a}}export function csvRows(n,e=","){return readCsv(n,e).records.map(s=>s.fields).filter(s=>s.some(o=>o!==""))}export function csvField(n,e=","){return n.includes(e)||n.includes('"')||n.includes(`
|
|
11
|
+
`)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}export function csvRecord(n,e=","){return n.length===1&&n[0]===""?'""':n.map(s=>csvField(s,e)).join(e)}export function writeCsv(n,e=DEFAULT_DIALECT){const s=n.map(o=>csvRecord(o,e.delimiter)).join(e.newline);return`${e.bom?"\uFEFF":""}${s}${e.finalNewline&&n.length>0?e.newline:""}`}export function toTsv(n){return n.map(e=>csvRecord(e," ")).join(`
|
|
12
|
+
`)}export function fromTsv(n){return readCsv(n," ").records.map(e=>e.fields)}
|