allyhub 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/commands/auth.js +4 -4
- package/dist/commands/cloud-tools.js +11 -11
- package/dist/commands/dev.js +2 -2
- package/dist/commands/frames/compare.js +2 -2
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/report.js +2 -0
- package/dist/commands/frames.js +11 -9
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +4 -2
- package/dist/commands/inspect/facts.js +3 -3
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/orgs.js +2 -2
- package/dist/commands/render.js +2 -2
- package/dist/help.js +4 -4
- package/dist/main.js +8 -7
- package/dist/node_modules/@allyhub/3d-extension/dist/stage-routes.js +1 -1
- package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +29 -0
- package/dist/node_modules/@allyhub/browser/dist/emoji.js +57 -0
- package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +18 -0
- package/dist/node_modules/@allyhub/browser/dist/picture.js +2 -0
- package/dist/node_modules/@allyhub/browser/package.json +9 -1
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +9 -0
- package/dist/node_modules/@allyhub/build/dist/made-notes.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +17 -0
- package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
- package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
- package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
- package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
- package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
- package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
- package/dist/node_modules/@allyhub/dev-server/dist/exports.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/pages.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/ports.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/respond.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/reveal.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/watcher.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +51 -92
- package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +19 -6
- package/dist/node_modules/@allyhub/doc-print/dist/pages.js +5 -5
- package/dist/node_modules/@allyhub/doc-print/dist/print.js +10 -10
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
- package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/export.js +4 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +16 -6
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/article-build.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/article-kind.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/build-plugins.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/build.js +5 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/media.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/stage-module.js +82 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/workspace.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +287 -0
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +12 -0
- package/dist/node_modules/@allyhub/linkedin-model/LICENSE +241 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/article-check.js +5 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/article.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/check.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/count.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/edit.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/html.js +19 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/limits.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/little.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/post.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/requests.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/package.json +14 -0
- package/dist/node_modules/@allyhub/linkedin-view/LICENSE +241 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/article.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/fold.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/post.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/text.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/package.json +21 -0
- package/dist/node_modules/@allyhub/linkedin-view/src/style.css +600 -0
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/dist/encode.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/render.js +2 -2
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/report-extension/dist/build.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/check.js +3 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +5 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
- package/dist/node_modules/@allyhub/report-extension/dist/page.js +21 -0
- package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +21 -0
- package/dist/node_modules/@allyhub/report-extension/dist/styles.js +5 -0
- package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/package.json +182 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +132 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +105 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +17 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +38 -0
- package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
- package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +6 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/viewer.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -6
- package/dist/node_modules/@allyhub/sheet-extension/package.json +24 -9
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +22 -16
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
- package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +18 -18
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +17 -4
- package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
- package/dist/node_modules/@allyhub/website-extension/dist/preview.js +5 -5
- package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
- package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
- package/dist/node_modules/@allyhub/x-extension/dist/build.js +4 -3
- package/dist/node_modules/@allyhub/x-extension/package.json +43 -15
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +12 -10
- package/dist/text/facts-text.js +5 -5
- package/dist/text/index.js +1 -1
- package/dist/text/long-text.js +4 -0
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-BKmMA6gn.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-BEFBgb4k.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-_u5YfCjY.js} +1 -1
- package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-B5rJbBv0.js} +1 -1
- package/editor-web/assets/article-BUmD3xtR.js +8 -0
- package/editor-web/assets/article-DNioBb3p.js +7 -0
- package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-CzuzsGjI.js} +1 -1
- package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-DybfaO3Z.js} +1 -1
- package/editor-web/assets/bookmark-Dsd3kHJJ.js +1 -0
- package/editor-web/assets/button-eGxLxbv9.js +41 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BfqLHB5i.js} +1 -1
- package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
- package/editor-web/assets/channel-TNPgFDrw.js +1 -0
- package/editor-web/assets/chart-C37xvZT2.js +1 -0
- package/editor-web/assets/chart-no-axes-column-BVkeF_Mr.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-BVp1I_d0.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-CTdgWEMr.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-7pnsxeaP.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-Dc0Dvkq7.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-VAILIsfx.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-CUDx1Rv5.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DAoEe-dJ.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g0akya12.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-hTGjzXdJ.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BgLV8BIJ.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-Bw19OOSD.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-CMST9dyE.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-Bbpu36XF.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-C48Ri0Gs.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-DN1g01Oe.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-U6jbPr2d.js} +1 -1
- package/editor-web/assets/collaborator-B1u2td9m.js +1 -0
- package/editor-web/assets/createLucideIcon-GFZ_fxLc.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-gzkai_7-.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-DtSekSr6.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-CiUwYVT6.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-r9XHCV-k.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-DxVsDZ34.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-B0eNQoHV.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-C7f2MfJT.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-CSXcnvct.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-DXzOD_ii.js} +1 -1
- package/editor-web/assets/dist-BGRwhCQO.js +1 -0
- package/editor-web/assets/{dist-9ymlIMhr.js → dist-BW4X7BrF.js} +1 -1
- package/editor-web/assets/dist-BgDRE85b.js +2 -0
- package/editor-web/assets/dist-Blq5nJnU.js +24 -0
- package/editor-web/assets/dist-BuWaZ3Y4.js +274 -0
- package/editor-web/assets/dist-C1emZ9wX.js +37 -0
- package/editor-web/assets/dist-CC7OeU1e.js +6 -0
- package/editor-web/assets/dist-CX-fiPSn.js +38 -0
- package/editor-web/assets/dist-C_VvG-_9.js +5 -0
- package/editor-web/assets/dist-Ce7HrBxv.js +3 -0
- package/editor-web/assets/dist-D2k6w-_a.js +1 -0
- package/editor-web/assets/dist-DDv_SbKw.js +84 -0
- package/editor-web/assets/dist-DEoEO4zs.js +1 -0
- package/editor-web/assets/dist-DlDxxPIP.js +16 -0
- package/editor-web/assets/dist-Gz6NDS0J.js +4 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-Cs4YRvDD.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Bh3LZ9WI.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-C4vYTYXp.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-BN1kkHWS.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-CA1LkkC5.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-Dy5tA7dG.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-hJIB8EkH.js} +1 -1
- package/editor-web/assets/hint-B8JpEypy.js +1 -0
- package/editor-web/assets/index-CgB5osVc.js +28 -0
- package/editor-web/assets/index-Daytem9N.css +2 -0
- package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvzSf7rQ.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-BjIMm4Af.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bpz71S40.js} +1 -1
- package/editor-web/assets/{italic-CDhZKo_q.js → italic-D10w8n6C.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-DAB-pZjD.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-cYeyh3P6.js} +1 -1
- package/editor-web/assets/katex-5Z2zF-9g.js +257 -0
- package/editor-web/assets/link-BC5xK1-1.js +1 -0
- package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-req5LE0X.js} +3 -3
- package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-zFwZug4C.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-TStWb7DG.js} +1 -1
- package/editor-web/assets/minus-DaWs5i8B.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-smFhVKcB.js} +1 -1
- package/editor-web/assets/palette-BIOudGkm.js +1 -0
- package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DvSNRv0-.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-qjaGsBZG.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-Dd9P-Pdc.js} +1 -1
- package/editor-web/assets/play-CrMmPghG.js +1 -0
- package/editor-web/assets/progress-DE4C5_3x.js +6 -0
- package/editor-web/assets/props-form-CsmDBqzy.js +1 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-h2IIKUUA.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-DlVrSA1d.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-nFbuLAtc.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Daj8h2iV.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-eYJyl5PH.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-BTRhKZQq.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-CeLGUjdp.js} +1 -1
- package/editor-web/assets/react-WA6wlt8S.js +1 -0
- package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-VQP1EVOZ.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-Dmk9XRM5.js} +1 -1
- package/editor-web/assets/row-BRlEWRrK.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-Yn4zlrAM.js} +1 -1
- package/editor-web/assets/schemas-VikZYZIK.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-BTRnp_PW.js} +1 -1
- package/editor-web/assets/session-Do9AqS38.js +1 -0
- package/editor-web/assets/slides-diTEQ3C5.js +1 -0
- package/editor-web/assets/snapshots-BUGlKQIB.js +56 -0
- package/editor-web/assets/sound-Bj3o9_Fa.js +1 -0
- package/editor-web/assets/split-CNU1RHcX.js +3 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-kstrRKv2.js} +1 -1
- package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CfXx6IYH.js} +1 -1
- package/editor-web/assets/{svg-BjM9RazX.js → svg-Cx50MpxK.js} +1 -1
- package/editor-web/assets/swatch-WeJD41aW.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-DaZsZkeP.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +8 -0
- package/editor-web/assets/switch-N0G_sbqt.js +1 -0
- package/editor-web/assets/syntax-BVsgRJ4I.js +66 -0
- package/editor-web/assets/syntax-oWsKBWFw.js +1 -0
- package/editor-web/assets/table-B6hVZAMi.js +1 -0
- package/editor-web/assets/tabs-DIFDqj-l.js +1 -0
- package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-tEWvBY9p.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-CLCvY-Yf.js} +1 -1
- package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BP6nqpg2.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-BmN0gwdC.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DN29G_E_.js} +1 -1
- package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-CHR0nvWL.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-DTRS54cB.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-DAAc11Hx.js} +1 -1
- package/editor-web/assets/video-BlvmR8BK.js +1 -0
- package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-B-UYkmdB.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-BmbwCaky.js} +1 -1
- package/editor-web/assets/words-D_4T9Adq.js +3 -0
- package/editor-web/assets/words-WgdEQdYP.js +2 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-ChAfAq1U.js} +1 -1
- package/editor-web/index.html +6 -5
- package/package.json +8 -2
- package/editor-web/assets/alt-BOVao_9S.js +0 -4
- package/editor-web/assets/article-B6YCzhj8.js +0 -73
- package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
- package/editor-web/assets/channel-C26aBI4o.js +0 -1
- package/editor-web/assets/chart-BOnxneyw.js +0 -1
- package/editor-web/assets/choice-O5nwc2N0.js +0 -1
- package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
- package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
- package/editor-web/assets/dist-C6NqUEG4.js +0 -16
- package/editor-web/assets/dist-C9UGmCG9.js +0 -6
- package/editor-web/assets/dist-CAk5bjBm.js +0 -1
- package/editor-web/assets/dist-CKyfo5RM.js +0 -340
- package/editor-web/assets/dist-CRaWqNwq.js +0 -37
- package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
- package/editor-web/assets/dist-DXRmkezB.js +0 -38
- package/editor-web/assets/dist-EKK5i0dG.js +0 -219
- package/editor-web/assets/dist-hHJlpLWo.js +0 -5
- package/editor-web/assets/dist-oYKcwWUj.js +0 -4
- package/editor-web/assets/dist-shKo7XVN.js +0 -2
- package/editor-web/assets/dist-wrKxBrVu.js +0 -24
- package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
- package/editor-web/assets/hint-_AQWCDMj.js +0 -1
- package/editor-web/assets/index-BsstP-cI.js +0 -28
- package/editor-web/assets/index-DQRcmxBO.css +0 -2
- package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
- package/editor-web/assets/progress-0B_TVsPi.js +0 -6
- package/editor-web/assets/react-BP46yLMB.js +0 -1
- package/editor-web/assets/react-pgBZqVxJ.js +0 -96
- package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
- package/editor-web/assets/session-DiI9KYRI.js +0 -1
- package/editor-web/assets/slides-CCwgBcGH.js +0 -1
- package/editor-web/assets/sound-CqryteNl.js +0 -1
- package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
- package/editor-web/assets/switch-DltnKqN-.js +0 -1
- package/editor-web/assets/syntax-CC6QYhCz.js +0 -1
- package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
- package/editor-web/assets/video-DXFiCNGc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{C as r,G as i,H as a,U as o,_ as s,a as c,at as l,b as u,d,et as f,q as p,s as m,v as h}from"./chunk-DSNLSHJZ-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{C as r,G as i,H as a,U as o,_ as s,a as c,at as l,b as u,d,et as f,q as p,s as m,v as h}from"./chunk-DSNLSHJZ-CUDx1Rv5.js";import{t as g}from"./channel-TNPgFDrw.js";import"./chunk-YZO67HFG-Bbpu36XF.js";import{_,c as v}from"./chunk-7S6XSTFO-Dc0Dvkq7.js";import"./chunk-AQDTSKZB-VAILIsfx.js";import{t as y}from"./chunk-5VM5RSS4-ZNzvKenW.js";import"./chunk-UHW7PFBP-BgLV8BIJ.js";import{i as b,n as x,o as S,r as C}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{a as w}from"./chunk-HAGFOTED-DAoEe-dJ.js";import"./chunk-ZAUX2LTX-C48Ri0Gs.js";import"./chunk-WQQL4CDK-CMST9dyE.js";import{t as T}from"./chunk-55XCU76K-7pnsxeaP.js";import{t as E}from"./chunk-XXDRQBXY-i7MKP1NY.js";import{t as D}from"./chunk-VQ5W62QI-Bw19OOSD.js";import"./chunk-HNE4Q36P-g0akya12.js";import{i as O,n as k,r as A,t as j}from"./mermaid.core-zFwZug4C.js";var M={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},N=new Set([M.SHAPE_UNSUPPORTED,M.SHAPE_REMOVED,M.CONTAINMENT_VIOLATION]);new Set(Object.values(M).filter(e=>!N.has(e)));var P=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ee=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),te=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(P.get(e)??e)}e(I,`resolveShapeAlias`);function ne(e,n){for(let r of e)if(!r.isGroup){if(r.shape&&r.shape!==`squareRect`&&r.shape!==`rect`||(r.shape=F),ee.has(r.shape)){let e=`shape "${r.shape}" was removed in v0.8.1, using "${F}"`;n?.emitError?n.emitError(`SHAPE_REMOVED`,e,{nodeId:r.id}):t.warn(`agentflow: ${e}`),r.shape=F}else if(!te.has(r.shape)){let e=`shape "${r.shape}" is not supported, using "${F}"`;n?.emitWarning?n.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:r.id}):t.warn(`agentflow: ${e}`),r.shape=F}}}e(ne,`normaliseNodeShapes`);var L=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),R=L.size,z=e(e=>`af-kind-${e}`,`kindClass`),B=[...L.keys()],V=e(e=>Math.max(1,e-R),`containerSlotCount`),H=e((e,t)=>{let n=R+e%V(t);return t>0?n%t:n},`containerSlot`);function re(e,t,n){let r=u().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=H(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&L.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${z(e)}`.replace(/\s+/g,` `).trim())}}e(re,`assignColorSlots`);var ie=`agentflow-`,ae=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),oe=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),se={flow:`flowGroup`};function ce(e){if(Array.isArray(e))return e.map(e=>ce(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=ce(e[n]));return t}e(ce,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
|
|
2
2
|
`)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i<o.length;i++){let a=o[i];if(n)a===`\\`?i++:a===`"`&&(n=!1);else if(t)a===`'`&&(t=!1);else if(a===`"`)n=!0;else if(a===`'`)t=!0;else if(a===`#`&&(i===0||o[i-1]===` `||o[i-1]===` `)){e=i;break}else a===`[`||a===`{`?r++:(a===`]`||a===`}`)&&(r=Math.max(0,r-1))}if(t||n||r>0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;/:\s*[>|][\d+-]*\s*$/.test(s)?(i=o.length-o.trimStart().length,a.push(o)):a.push(s.replace(/,([\t ]*)$/,`$1`)+c)}return a.join(`
|
|
3
3
|
`)}e(le,`stripLineTrailingCommas`);var ue=class{constructor(){this.vertexCounter=0,this.config=u(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId=``,this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=p,this.getAccTitle=h,this.getAccDescription=s,this.getDiagramTitle=r,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{e(this,`AgentFlowDB`)}sanitizeText(e){return m.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,i,a,o={},s,c){if(!e||e.trim().length===0)return;let l;if(s!==void 0){let e;e=s.includes(`
|
|
4
4
|
`)?s+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{c as t,d as n,l as r,o as i,s as a,u as o,y as s}from"./react-WA6wlt8S.js";import{Tt as c,bt as l,gt as u,mt as d,t as f,vt as p,yt as m}from"./button-eGxLxbv9.js";import{A as h,B as g,I as _,P as v,Q as y,R as b,V as x,X as S,Y as C,at as w,et as T,f as E,h as D,j as O,m as k,o as ee,p as A,q as te,rt as ne,tt as j,x as re}from"./snapshots-BUGlKQIB.js";import{t as ie}from"./jsx-runtime-DePvh3-m.js";import{t as ae}from"./createLucideIcon-GFZ_fxLc.js";import{n as oe,t as se}from"./progress-DE4C5_3x.js";import{t as ce}from"./switch-N0G_sbqt.js";import{i as le,n as ue,r as de,t as fe}from"./hint-B8JpEypy.js";import{A as M,M as N,O as P,j as F,k as I,p as pe,tt as me}from"./index-CgB5osVc.js";var L={files:2e4,bytes:5368709120,redirects:2e3,headers:100},R={min:3,max:40},he=new Set(`abuse.account.accounts.admin.administrator.allyhub.api.app.assets.auth.autoconfig.autodiscover.billing.blog.cdn.dashboard.dev.dns.docs.download.downloads.ftp.help.hostmaster.imap.login.mail.mta-sts.ns1.ns2.ops.pop.postmaster.preview.root.security.signin.smtp.staging.static.status.studio.support.test.webmaster.wpad.www`.split(`.`));function z(e){if(e.length<R.min||e.length>R.max)return`length`;if(!/^[a-z0-9-]+$/u.test(e))return`characters`;if(e.startsWith(`-`)||e.endsWith(`-`))return`hyphenEnds`;if(e.includes(`--`))return`doubleHyphen`;if(he.has(e))return`reserved`}var ge={length:`An address is ${String(R.min)} to ${String(R.max)} characters.`,characters:`An address is lowercase letters, digits and hyphens.`,hyphenEnds:`An address neither starts nor ends with a hyphen.`,doubleHyphen:`An address does not have two hyphens in a row.`,reserved:`That address is reserved.`};function _e(e){let t=z(e);return t===void 0?void 0:ge[t]}var ve=j().superRefine((e,t)=>{let n=_e(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),ye=[200,301,302,303,307,308,404,410],B=j().min(1).max(1024).regex(/^\/[^\s]*$/u,`A rule's path starts with /.`),be=T({from:B,to:j().min(1).max(2048).regex(/^(\/[^\s]*|https?:\/\/[^\s]+)$/u,`A rule goes to a path or an http(s) address.`),status:ne(ye.map(e=>te(e))),force:x()}),xe=new Set([`accept-ranges`,`connection`,`content-encoding`,`content-length`,`content-range`,`date`,`keep-alive`,`set-cookie`,`strict-transport-security`,`trailer`,`transfer-encoding`,`upgrade`,`x-content-type-options`]),Se=j().regex(/^[A-Za-z0-9-]+$/u).max(128).refine(e=>!xe.has(e.toLowerCase()),`That header is the platform's.`),Ce=T({for:B,set:y(Se,j().max(2048))});T({format:te(1),files:y(k,A),redirects:g(be).max(L.redirects),headers:g(Ce).max(L.headers)});var V=[`upload`,`git`],H=T({kind:b(V),commit:j().min(1).max(64).optional(),digest:E.optional()}),U=S({id:j(),siteId:j(),source:S({...H.shape,kind:D(V)}),note:j().nullable(),files:C(),bytes:C(),createdBy:j(),createdAt:_(),live:x()}),W=S({id:j(),slug:j(),name:j(),url:w(),liveDeployment:j().nullable(),approved:x(),autoPublish:x(),indexing:x(),createdAt:_()});T({slug:ve,name:j().min(1).max(255)}),S({sites:g(W),domain:j(),hosting:x()});var we=S({site:W,deployments:g(U)});T({manifest:E,source:H,note:j().max(500).optional()}),S({site:W,deployment:U}),T({deployment:j().min(1)}),S({site:W,live:x(),confirm:w().optional()}),T({autoPublish:x().optional(),indexing:x().optional()}),S({site:j(),organization:j(),deployment:j(),manifest:E,indexing:x()});var Te=ae(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Ee=e=>e.state===`running`||e.state===`queued`;function De(e){if(e.state===`done`)return 1;if(!(e.total===void 0||e.total<=0))return Math.min(1,Math.max(0,e.completed/e.total))}var G=e(s(),1),K=ie(),q=T({item:h}),Oe=T({hosting:x(),detail:we.optional(),elsewhere:x().optional(),changed:x().optional(),slug:j().optional(),domain:j().optional()}),ke={confirm:j().optional()},Ae={"website/preview":v(q,T({url:j()}),`A website's address as its own dev server serves it, for a frame: its dependencies installed if it has none, then its website.json's dev command on a free port; it answers once the page does.`),"website/still":v(q.extend({width:C().int().positive().max(4096),height:C().int().positive().max(4096),scale:C().positive().max(4).default(1),hold:j().optional()}),T({image:T({mime:j(),data:j()})}),`A website's page as its own dev server serves it, drawn at a frame's size from its top: what Mark up lays over a website's frame where the window cannot read another origin's pixels.`),"website/hold":v(q.extend({width:C().int().positive().max(4096),height:C().int().positive().max(4096),scale:C().positive().max(4).default(1)}),T({hold:j()}),`A website's page opened at a frame's size and kept as it is while a person marks it: website/still and website/at draw and read it as it was, until website/release.`),"website/release":v(T({hold:j()}),T({}),`Lets a page held for notes go.`),"website/at":v(q.extend({width:C().int().positive().max(4096),height:C().int().positive().max(4096),points:g(T({x:C(),y:C()})).min(1).max(24),hold:j().optional()}),T({page:j(),elements:g(T({selector:j(),tag:j(),text:j()}))}),`What is at places of a website's page as its own dev server serves it, drawn at a frame's size from its top (as website/still draws it): what a person's mark on its frame is on.`),"website/status":v(q,Oe,`A website's hosted site, its versions, and whether what is here differs from what is live; where the server has no person's sign-in, not hosted.`),"website/publish":v(q.extend({slug:j().optional(),note:j().optional(),anew:x().optional()}),T({live:x(),url:j(),...ke}),"Builds a website, uploads it as a version and makes it live, for the person who pressed Publish. The first time, it waits for their yes in a browser (`confirm`, a page to open there)."),"website/live":v(q.extend({version:j().min(1)}),T({live:x(),...ke}),`Makes a version what the site serves, as the person asked.`),"website/settings":v(q.extend({autoPublish:x().optional(),indexing:x().optional()}),T({}),`Changes what the person controls of a site.`),"website/unpublish":v(q,T({}),`Takes a site offline; it keeps its address and versions.`),"website/remove":v(q,T({}),`Takes a site offline for good. Its address is never given to anyone else.`)},J=re(Ae),je=d(`overflow-hidden rounded-lg border border-rule`,{variants:{tone:{sheet:`bg-sheet`,paper:`bg-paper`,bare:`rounded-none border-0 bg-transparent`}},defaultVariants:{tone:`sheet`}});function Me({className:e,tone:t,...n}){return(0,K.jsx)(`div`,{"data-slot":`surface`,className:u(je({tone:t,className:e})),...n})}function Y({className:e,...t}){return(0,K.jsx)(Me,{className:u(`divide-y divide-rule`,e),...t})}function X({icon:e,label:t,detail:n,children:r,className:i}){return(0,K.jsxs)(`div`,{"data-slot":`setting-row`,className:u(`flex items-center gap-4 px-4.5 py-4`,i),children:[e!==void 0&&(0,K.jsx)(`span`,{className:`-mr-1 flex-none`,children:e}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`text-sm`,children:t}),n!==void 0&&(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-lead`,children:n})]}),r]})}function Z({label:e,detail:t,children:n}){return(0,K.jsxs)(`label`,{"data-slot":`setting-row`,className:`flex items-center gap-4 px-4.5 py-4 transition-colors has-[[role=checkbox]:not(:disabled),[role=switch]:not(:disabled)]:hover:bg-hover`,children:[(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block text-sm`,children:e}),t!==void 0&&(0,K.jsx)(`span`,{className:`mt-0.5 block text-xs text-lead`,children:t})]}),n]})}function Ne(e){let[n,r]=(0,G.useState)([]);return t(`jobs/changed`,({job:t,item:n})=>{n===e&&r(e=>[...e.filter(e=>e.id!==t.id),t])}),n}var Pe=(e,t)=>e.findLast(e=>(t===void 0||e.what===t)&&Ee(e)),Fe=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function Ie(e,t,n=Date.now()){let r=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),i=e-n;for(let[e,t]of Fe)if(Math.abs(i)>=t)return r.format(Math.round(i/t),e);return r.format(0,`minute`)}var Q={content:`max-w-[min(28rem,calc(100%-2rem))]`,header:`text-left`,footer:`flex-row justify-end`},Le=e=>e instanceof Error?e.message:String(e),Re=(e,t)=>({message:Le(e),...t!==void 0&&typeof e==`object`&&e&&e.code===O.conflict?{refused:t}:{}});function ze(e,t,n){let r=i(),[a,o]=(0,G.useState)(),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(),[d,f]=(0,G.useState)(),p=(0,G.useCallback)(()=>J(r,`website/status`,{item:e}).then(e=>{o(e),e.detail?.site.liveDeployment!=null&&f(void 0)}),[r,e]);(0,G.useEffect)(()=>{let e=()=>{p().catch(()=>void 0)};e();let t=()=>{document.visibilityState===`visible`&&e()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,t)}},[r,p,t]);let m=(0,G.useCallback)((e,t)=>{c(!0),u(void 0),e().then(p).catch(e=>{u(Re(e,t))}).finally(()=>{c(!1)})},[p]),h=(0,G.useCallback)(e=>{r[`items/open`]({target:{type:`browser`,url:e}}).catch(()=>void 0)},[r]),g=(0,G.useCallback)(e=>{e.confirm!==void 0&&(f(e.confirm),h(e.confirm))},[h]),_={item:e};return{status:a,publishing:Pe(n,`publish`),busy:s,failure:l,confirm:d,stopWaiting:()=>{f(void 0)},openAgain:()=>{d!==void 0&&h(d)},publish:(e={})=>{m(()=>J(r,`website/publish`,{..._,...e}).then(g),e.slug)},goLive:e=>{m(()=>J(r,`website/live`,{..._,version:e}).then(g))},settings:e=>{m(()=>J(r,`website/settings`,{..._,...e}))},unpublish:()=>{m(()=>J(r,`website/unpublish`,_))},remove:()=>{m(()=>J(r,`website/remove`,_))}}}function Be({words:e,from:t=`center`,children:n}){return(0,K.jsx)(fe,{disableHoverableContent:!0,children:(0,K.jsxs)(de,{children:[(0,K.jsx)(ue,{asChild:!0,children:(0,K.jsx)(`span`,{className:`flex min-w-0`,children:n})}),(0,K.jsx)(le,{side:`top`,align:t,sideOffset:6,collisionPadding:8,children:e})]})})}var Ve=e=>new URL(e).host;function He({hosting:e,said:t,settings:n,onSettings:r}){let i=t.w.hosting,{status:a,busy:o,failure:s,confirm:c,publishing:l}=e,[u,d]=(0,G.useState)(!1),[p,m]=(0,G.useState)(),h=a?.detail?.site,g=h?.liveDeployment!=null,_=p??a?.slug??``,v=_===``?void 0:z(_),y=!o&&_!==``&&v===void 0,b=v===`length`?i.slug.length(R.min,R.max):v===void 0?s?.refused===_?i.unavailable(`${_}.${a?.domain??``}`):void 0:i.slug[v];return a?.hosting===!0?(0,K.jsxs)(`div`,{className:`flex h-10 flex-none items-center gap-2 border-b border-rule bg-sheet px-3`,children:[g&&(0,K.jsxs)(`a`,{href:h.url,target:`_blank`,rel:`noreferrer`,className:`flex min-w-0 items-center gap-1.5 truncate font-mono text-xs text-lead hover:text-ink`,children:[(0,K.jsx)(me,{"aria-hidden":!0,className:`size-3.5 flex-none`}),Ve(h.url)]}),(0,K.jsx)(`span`,{className:`flex-1`}),s!==void 0&&!u&&(0,K.jsx)(`span`,{className:`min-w-0 truncate text-xs text-problem-text`,children:s.message}),a.elsewhere===!0&&(0,K.jsx)(`span`,{className:`text-xs whitespace-nowrap text-lead`,children:i.elsewhere}),g&&(0,K.jsx)(`span`,{className:`text-xs whitespace-nowrap text-lead`,children:a.changed===!0?i.unpublished:i.live}),(0,K.jsx)(Be,{words:n?i.preview:i.settings,from:`end`,children:(0,K.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":n?i.preview:i.settings,"aria-pressed":n,disabled:h===void 0,onClick:r,children:(0,K.jsx)(Te,{"aria-hidden":!0})})}),(0,K.jsxs)(f,{size:`xs`,disabled:o,onClick:()=>{h===void 0?d(!0):e.publish()},children:[l!==void 0&&(0,K.jsx)(oe,{value:De(l)}),o?i.publishing:g?i.update:i.publish]}),(0,K.jsx)(P,{open:u&&c===void 0&&h===void 0,onOpenChange:d,children:(0,K.jsxs)(I,{className:Q.content,children:[(0,K.jsx)(F,{className:Q.header,children:(0,K.jsx)(N,{className:`font-serif`,children:i.first})}),(0,K.jsxs)(`form`,{className:`contents`,onSubmit:t=>{t.preventDefault(),y&&e.publish({slug:_,...a.elsewhere===!0?{anew:!0}:{}})},children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(pe,{"aria-label":i.address,"aria-invalid":b!==void 0,"aria-describedby":`site-address-why`,value:_,onChange:e=>{m(e.target.value.toLowerCase())},className:`font-mono`}),(0,K.jsxs)(`span`,{className:`font-mono text-sm text-lead`,children:[`.`,a.domain]})]}),(0,K.jsx)(`p`,{id:`site-address-why`,role:`status`,className:`min-h-5 text-sm text-problem-text`,children:b})]}),(0,K.jsx)(`p`,{className:`text-sm text-lead`,children:a.elsewhere===!0?i.elsewhereNote:i.firstNote}),s!==void 0&&s.refused===void 0&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-problem-text`,children:[i.buildFailed,(0,K.jsx)(f,{type:`button`,size:`xs`,variant:`ghost`,className:`text-lead`,onClick:()=>{navigator.clipboard.writeText(s.message).catch(()=>void 0)},children:t.w.copy})]}),(0,K.jsx)(M,{className:Q.footer,children:(0,K.jsx)(f,{type:`submit`,disabled:!y,children:o?i.publishing:i.publish})})]})]})}),(0,K.jsx)(P,{open:c!==void 0&&!g,onOpenChange:t=>{t||e.stopWaiting()},children:(0,K.jsxs)(I,{className:Q.content,children:[(0,K.jsx)(F,{className:Q.header,children:(0,K.jsx)(N,{className:`font-serif`,children:i.askTitle})}),(0,K.jsx)(`p`,{className:`text-sm text-lead`,children:i.ask}),(0,K.jsxs)(M,{className:Q.footer,children:[(0,K.jsx)(f,{variant:`outline`,onClick:e.stopWaiting,children:t.w.cancel}),(0,K.jsx)(f,{autoFocus:!0,onClick:e.openAgain,children:i.openAgain})]})]})})]}):null}function Ue({hosting:e,said:t}){let n=t.w.hosting,{tag:r}=t,[i,a]=(0,G.useState)(!1),{status:o,busy:s}=e,c=o?.detail;if(c===void 0)return null;let{site:l,deployments:u}=c,d=Ve(l.url),p=u.find(e=>e.live)?.createdAt,m=e=>p!==void 0&&Date.parse(e)<Date.parse(p);return(0,K.jsxs)(`div`,{className:`absolute inset-0 overflow-y-auto bg-sheet`,children:[(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col gap-6 px-6 py-8`,children:[(0,K.jsxs)(Y,{children:[(0,K.jsx)(X,{label:n.address,children:(0,K.jsx)(`a`,{href:l.url,target:`_blank`,rel:`noreferrer`,className:`font-mono text-sm hover:underline`,children:d})}),(0,K.jsx)(Z,{label:n.agent,children:(0,K.jsx)(ce,{checked:l.autoPublish,disabled:s,onCheckedChange:t=>{e.settings({autoPublish:t})}})}),(0,K.jsx)(Z,{label:n.search,children:(0,K.jsx)(ce,{checked:l.indexing,disabled:s,onCheckedChange:t=>{e.settings({indexing:t})}})})]}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:n.versions}),(0,K.jsx)(Y,{children:u.map(t=>(0,K.jsx)(X,{label:t.note??Ie(Date.parse(t.createdAt),r),detail:t.note===null?void 0:Ie(Date.parse(t.createdAt),r),children:t.live?(0,K.jsx)(`span`,{className:`text-xs text-lead`,children:n.live}):(0,K.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:()=>{e.goLive(t.id)},children:m(t.createdAt)?n.rollBack:n.makeLive})},t.id))})]}),(0,K.jsxs)(Y,{children:[l.liveDeployment!==null&&(0,K.jsx)(X,{label:n.unpublishNote,children:(0,K.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:e.unpublish,children:n.unpublish})}),(0,K.jsx)(X,{label:n.removeNote(d),children:(0,K.jsx)(f,{variant:`outline`,size:`xs`,disabled:s,onClick:()=>{a(!0)},children:n.remove})})]})]}),(0,K.jsx)(P,{open:i,onOpenChange:a,children:(0,K.jsxs)(I,{className:Q.content,children:[(0,K.jsx)(F,{className:Q.header,children:(0,K.jsx)(N,{className:`font-serif`,children:n.remove})}),(0,K.jsx)(`p`,{className:`text-sm text-lead`,children:n.removeNote(d)}),(0,K.jsxs)(M,{className:Q.footer,children:[(0,K.jsx)(f,{variant:`outline`,onClick:()=>{a(!1)},children:t.w.cancel}),(0,K.jsx)(f,{variant:`destructive`,onClick:()=>{a(!1),e.remove()},children:n.remove})]})]})})]})}var $=m({en:{starting:`Starting the website…`,startingJob:e=>`Starting ${e}`,failed:`The website did not start`,copy:`Copy details`,retry:`Retry`,cancel:`Cancel`,asleep:`A website's preview needs the agent awake.`,edit:`Edit`,hosting:{buildFailed:`The website could not be built.`,publish:`Publish`,update:`Update`,settings:`Website settings`,preview:`Preview`,unpublished:`Unpublished changes`,address:`Address`,first:`Publish this website`,firstNote:`Anyone with the address can see it.`,publishing:`Publishing…`,askTitle:`Confirm in your browser`,ask:`A site's first publish is confirmed in your browser.`,openAgain:`Open again`,versions:`Versions`,live:`Live`,rollBack:`Roll back`,makeLive:`Make live`,elsewhere:`Published by another team`,elsewhereNote:`This folder names another team’s site. Publishing makes a new one of yours; theirs stays as it is. Anyone with the address can see it.`,slug:{length:(e,t)=>`An address is ${String(e)} to ${String(t)} characters.`,characters:`Use lowercase letters, digits and hyphens.`,hyphenEnds:`An address can’t start or end with a hyphen.`,doubleHyphen:`An address can’t have two hyphens in a row.`,reserved:`That address is reserved.`},unavailable:e=>`${e} is not available.`,agent:`Let the agent update the live site`,search:`Show in search engines`,unpublish:`Unpublish`,unpublishNote:`Takes the site offline within a minute. It keeps its address and versions.`,remove:`Delete site`,removeNote:e=>`${e} goes offline for good, and its address can never be used again.`}},"zh-cn":{starting:`正在启动网站…`,startingJob:e=>`正在启动 ${e}`,failed:`网站没有启动`,copy:`复制详情`,retry:`重试`,cancel:`取消`,asleep:`网站预览需要 Agent 处于唤醒状态。`,edit:`编辑`,hosting:{buildFailed:`网站没能构建成功。`,publish:`发布`,update:`更新`,settings:`网站设置`,preview:`预览`,unpublished:`有未发布的更改`,address:`地址`,first:`发布这个网站`,firstNote:`知道地址的人都能看到。`,publishing:`正在发布…`,askTitle:`请在浏览器中确认`,ask:`网站第一次发布需要在浏览器中确认。`,openAgain:`再次打开`,versions:`版本`,live:`线上`,rollBack:`回滚`,makeLive:`设为上线`,elsewhere:`由其他团队发布`,elsewhereNote:`这个文件夹指向另一个团队的网站。发布会为你新建一个网站,他们的保持不变。知道地址的人都能看到。`,slug:{length:(e,t)=>`地址为 ${String(e)} 到 ${String(t)} 个字符。`,characters:`只能用小写字母、数字和连字符。`,hyphenEnds:`地址不能以连字符开头或结尾。`,doubleHyphen:`地址里不能有两个连续的连字符。`,reserved:`这个地址是保留的。`},unavailable:e=>`${e} 不可用。`,agent:`允许 agent 更新线上网站`,search:`在搜索引擎中显示`,unpublish:`取消发布`,unpublishNote:`一分钟内让网站下线,地址和版本都会保留。`,remove:`删除网站`,removeNote:e=>`${e} 将永久下线,这个地址也不能再使用。`}},"zh-tw":{starting:`正在啟動網站…`,startingJob:e=>`正在啟動 ${e}`,failed:`網站沒有啟動`,copy:`複製詳情`,retry:`重試`,cancel:`取消`,asleep:`網站預覽需要 Agent 處於喚醒狀態。`,edit:`編輯`,hosting:{buildFailed:`網站無法建置。`,publish:`發布`,update:`更新`,settings:`網站設定`,preview:`預覽`,unpublished:`有未發布的變更`,address:`網址`,first:`發布這個網站`,firstNote:`知道網址的人都能看到。`,publishing:`正在發布…`,askTitle:`請在瀏覽器中確認`,ask:`網站第一次發布需要在瀏覽器中確認。`,openAgain:`再次開啟`,versions:`版本`,live:`線上`,rollBack:`復原`,makeLive:`設為上線`,elsewhere:`由其他團隊發布`,elsewhereNote:`這個資料夾指向另一個團隊的網站。發布會為你新建一個網站,他們的保持不變。知道網址的人都能看到。`,slug:{length:(e,t)=>`網址為 ${String(e)} 到 ${String(t)} 個字元。`,characters:`只能用小寫字母、數字和連字號。`,hyphenEnds:`網址不能以連字號開頭或結尾。`,doubleHyphen:`網址裡不能有兩個連續的連字號。`,reserved:`這個網址是保留的。`},unavailable:e=>`${e} 無法使用。`,agent:`允許 agent 更新線上網站`,search:`在搜尋引擎中顯示`,unpublish:`取消發布`,unpublishNote:`一分鐘內讓網站下線,網址和版本都會保留。`,remove:`刪除網站`,removeNote:e=>`${e} 將永久下線,這個網址也不能再使用。`}},ja:{starting:`ウェブサイトを起動しています…`,startingJob:e=>`${e} を起動しています`,failed:`ウェブサイトを起動できませんでした`,copy:`詳細をコピー`,retry:`再試行`,cancel:`キャンセル`,asleep:`ウェブサイトのプレビューにはエージェントが起きている必要があります。`,edit:`編集`,hosting:{buildFailed:`Web サイトをビルドできませんでした。`,publish:`公開`,update:`更新`,settings:`ウェブサイトの設定`,preview:`プレビュー`,unpublished:`未公開の変更`,address:`アドレス`,first:`このウェブサイトを公開`,firstNote:`アドレスを知っている人は誰でも見られます。`,publishing:`公開しています…`,askTitle:`ブラウザで確認してください`,ask:`サイトの最初の公開はブラウザで確認します。`,openAgain:`もう一度開く`,versions:`バージョン`,live:`公開中`,rollBack:`戻す`,makeLive:`公開する`,elsewhere:`別のチームが公開`,elsewhereNote:`このフォルダーは別のチームのサイトを指しています。公開するとあなたの新しいサイトができ、相手のサイトはそのままです。アドレスを知っている人は誰でも見られます。`,slug:{length:(e,t)=>`アドレスは ${String(e)}〜${String(t)} 文字です。`,characters:`小文字、数字、ハイフンだけが使えます。`,hyphenEnds:`アドレスの最初と最後にハイフンは使えません。`,doubleHyphen:`ハイフンを2つ続けては使えません。`,reserved:`このアドレスは予約されています。`},unavailable:e=>`${e} は使えません。`,agent:`公開中のサイトをエージェントに更新させる`,search:`検索エンジンに表示`,unpublish:`非公開にする`,unpublishNote:`1 分以内にサイトを非公開にします。アドレスとバージョンは残ります。`,remove:`サイトを削除`,removeNote:e=>`${e} は完全にオフラインになり、このアドレスは二度と使えません。`}},ko:{starting:`웹사이트를 시작하는 중…`,startingJob:e=>`${e} 시작하는 중`,failed:`웹사이트가 시작되지 않았습니다`,copy:`세부 정보 복사`,retry:`다시 시도`,cancel:`취소`,asleep:`웹사이트 미리보기는 에이전트가 깨어 있어야 합니다.`,edit:`편집`,hosting:{buildFailed:`웹사이트를 빌드하지 못했습니다.`,publish:`게시`,update:`업데이트`,settings:`웹사이트 설정`,preview:`미리 보기`,unpublished:`게시되지 않은 변경 사항`,address:`주소`,first:`이 웹사이트 게시`,firstNote:`주소를 아는 사람은 누구나 볼 수 있습니다.`,publishing:`게시 중…`,askTitle:`브라우저에서 확인하세요`,ask:`사이트의 첫 게시는 브라우저에서 확인합니다.`,openAgain:`다시 열기`,versions:`버전`,live:`게시 중`,rollBack:`되돌리기`,makeLive:`게시하기`,elsewhere:`다른 팀이 게시함`,elsewhereNote:`이 폴더는 다른 팀의 사이트를 가리킵니다. 게시하면 내 사이트가 새로 만들어지고, 그 팀의 사이트는 그대로 남습니다. 주소를 아는 사람은 누구나 볼 수 있습니다.`,slug:{length:(e,t)=>`주소는 ${String(e)}~${String(t)}자입니다.`,characters:`소문자, 숫자, 하이픈만 쓸 수 있습니다.`,hyphenEnds:`주소는 하이픈으로 시작하거나 끝날 수 없습니다.`,doubleHyphen:`하이픈을 두 개 연달아 쓸 수 없습니다.`,reserved:`예약된 주소입니다.`},unavailable:e=>`${e}은(는) 사용할 수 없습니다.`,agent:`에이전트가 게시된 사이트를 업데이트하도록 허용`,search:`검색 엔진에 표시`,unpublish:`게시 취소`,unpublishNote:`1분 안에 사이트를 내립니다. 주소와 버전은 그대로 남습니다.`,remove:`사이트 삭제`,removeNote:e=>`${e} 영구히 오프라인이 되며, 이 주소는 다시 사용할 수 없습니다.`}},es:{starting:`Iniciando el sitio web…`,startingJob:e=>`Iniciando ${e}`,failed:`El sitio web no se inició`,copy:`Copiar detalles`,retry:`Reintentar`,cancel:`Cancelar`,asleep:`La vista previa de un sitio web necesita al agente despierto.`,edit:`Editar`,hosting:{buildFailed:`No se pudo crear el sitio web.`,publish:`Publicar`,update:`Actualizar`,settings:`Ajustes del sitio web`,preview:`Vista previa`,unpublished:`Cambios sin publicar`,address:`Dirección`,first:`Publicar este sitio web`,firstNote:`Cualquiera con la dirección puede verlo.`,publishing:`Publicando…`,askTitle:`Confirma en tu navegador`,ask:`La primera publicación de un sitio se confirma en tu navegador.`,openAgain:`Abrir de nuevo`,versions:`Versiones`,live:`En línea`,rollBack:`Restaurar`,makeLive:`Poner en línea`,elsewhere:`Publicado por otro equipo`,elsewhereNote:`Esta carpeta es del sitio de otro equipo. Al publicar se crea uno nuevo tuyo; el suyo queda como está. Cualquiera con la dirección puede verlo.`,slug:{length:(e,t)=>`Una dirección tiene de ${String(e)} a ${String(t)} caracteres.`,characters:`Usa minúsculas, números y guiones.`,hyphenEnds:`Una dirección no empieza ni termina con guion.`,doubleHyphen:`Una dirección no lleva dos guiones seguidos.`,reserved:`Esa dirección está reservada.`},unavailable:e=>`${e} no está disponible.`,agent:`Dejar que el agente actualice el sitio publicado`,search:`Mostrar en buscadores`,unpublish:`Retirar`,unpublishNote:`Desconecta el sitio en menos de un minuto. Conserva su dirección y sus versiones.`,remove:`Eliminar sitio`,removeNote:e=>`${e} deja de estar en línea para siempre, y la dirección no podrá volver a usarse.`}},fr:{starting:`Démarrage du site web…`,startingJob:e=>`Démarrage de ${e}`,failed:`Le site web n’a pas démarré`,copy:`Copier les détails`,retry:`Réessayer`,cancel:`Annuler`,asleep:`L'aperçu d'un site web nécessite que l'agent soit éveillé.`,edit:`Modifier`,hosting:{buildFailed:`Le site n’a pas pu être construit.`,publish:`Publier`,update:`Mettre à jour`,settings:`Réglages du site web`,preview:`Aperçu`,unpublished:`Modifications non publiées`,address:`Adresse`,first:`Publier ce site web`,firstNote:`Toute personne ayant l'adresse peut le voir.`,publishing:`Publication…`,askTitle:`Confirmez dans votre navigateur`,ask:`La première publication d'un site se confirme dans votre navigateur.`,openAgain:`Rouvrir`,versions:`Versions`,live:`En ligne`,rollBack:`Restaurer`,makeLive:`Mettre en ligne`,elsewhere:`Publié par une autre équipe`,elsewhereNote:`Ce dossier désigne le site d’une autre équipe. Publier en crée un nouveau à vous ; le leur reste tel quel. Toute personne ayant l’adresse peut le voir.`,slug:{length:(e,t)=>`Une adresse compte de ${String(e)} à ${String(t)} caractères.`,characters:`Utilisez des minuscules, des chiffres et des tirets.`,hyphenEnds:`Une adresse ne commence ni ne finit par un tiret.`,doubleHyphen:`Une adresse n’a pas deux tirets d’affilée.`,reserved:`Cette adresse est réservée.`},unavailable:e=>`${e} n’est pas disponible.`,agent:`Laisser l'agent mettre à jour le site en ligne`,search:`Afficher dans les moteurs de recherche`,unpublish:`Dépublier`,unpublishNote:`Met le site hors ligne en moins d’une minute. Il garde son adresse et ses versions.`,remove:`Supprimer le site`,removeNote:e=>`${e} est mis hors ligne définitivement, et l'adresse ne pourra plus jamais servir.`}},de:{starting:`Website wird gestartet…`,startingJob:e=>`${e} wird gestartet`,failed:`Die Website wurde nicht gestartet`,copy:`Details kopieren`,retry:`Erneut versuchen`,cancel:`Abbrechen`,asleep:`Die Vorschau einer Website braucht einen wachen Agenten.`,edit:`Bearbeiten`,hosting:{buildFailed:`Die Website konnte nicht erstellt werden.`,publish:`Veröffentlichen`,update:`Aktualisieren`,settings:`Website-Einstellungen`,preview:`Vorschau`,unpublished:`Unveröffentlichte Änderungen`,address:`Adresse`,first:`Diese Website veröffentlichen`,firstNote:`Jeder mit der Adresse kann sie sehen.`,publishing:`Wird veröffentlicht…`,askTitle:`Im Browser bestätigen`,ask:`Die erste Veröffentlichung einer Website wird im Browser bestätigt.`,openAgain:`Erneut öffnen`,versions:`Versionen`,live:`Live`,rollBack:`Zurücksetzen`,makeLive:`Live schalten`,elsewhere:`Von einem anderen Team veröffentlicht`,elsewhereNote:`Dieser Ordner gehört zur Website eines anderen Teams. Beim Veröffentlichen entsteht eine neue von dir; ihre bleibt, wie sie ist. Jeder mit der Adresse kann sie sehen.`,slug:{length:(e,t)=>`Eine Adresse hat ${String(e)} bis ${String(t)} Zeichen.`,characters:`Nur Kleinbuchstaben, Ziffern und Bindestriche.`,hyphenEnds:`Eine Adresse beginnt und endet nicht mit einem Bindestrich.`,doubleHyphen:`Eine Adresse hat keine zwei Bindestriche hintereinander.`,reserved:`Diese Adresse ist reserviert.`},unavailable:e=>`${e} ist nicht verfügbar.`,agent:`Den Agenten die Live-Website aktualisieren lassen`,search:`In Suchmaschinen anzeigen`,unpublish:`Offline nehmen`,unpublishNote:`Nimmt die Website innerhalb einer Minute offline. Adresse und Versionen bleiben.`,remove:`Website löschen`,removeNote:e=>`${e} geht endgültig offline, und die Adresse kann nie wieder verwendet werden.`}},pt:{starting:`Iniciando o site…`,startingJob:e=>`Iniciando ${e}`,failed:`O site não foi iniciado`,copy:`Copiar detalhes`,retry:`Tentar de novo`,cancel:`Cancelar`,asleep:`A prévia de um site precisa do agente acordado.`,edit:`Editar`,hosting:{buildFailed:`Não foi possível montar o site.`,publish:`Publicar`,update:`Atualizar`,settings:`Configurações do site`,preview:`Pré-visualização`,unpublished:`Alterações não publicadas`,address:`Endereço`,first:`Publicar este site`,firstNote:`Qualquer pessoa com o endereço pode vê-lo.`,publishing:`Publicando…`,askTitle:`Confirme no navegador`,ask:`A primeira publicação de um site é confirmada no navegador.`,openAgain:`Abrir de novo`,versions:`Versões`,live:`No ar`,rollBack:`Restaurar`,makeLive:`Pôr no ar`,elsewhere:`Publicado por outra equipe`,elsewhereNote:`Esta pasta aponta para o site de outra equipe. Publicar cria um novo seu; o deles continua como está. Qualquer pessoa com o endereço pode vê-lo.`,slug:{length:(e,t)=>`Um endereço tem de ${String(e)} a ${String(t)} caracteres.`,characters:`Use letras minúsculas, números e hifens.`,hyphenEnds:`Um endereço não começa nem termina com hífen.`,doubleHyphen:`Um endereço não tem dois hifens seguidos.`,reserved:`Esse endereço é reservado.`},unavailable:e=>`${e} não está disponível.`,agent:`Deixar o agente atualizar o site no ar`,search:`Mostrar em buscadores`,unpublish:`Tirar do ar`,unpublishNote:`Deixa o site offline em até um minuto. Ele mantém o endereço e as versões.`,remove:`Excluir site`,removeNote:e=>`${e} sai do ar para sempre, e o endereço nunca mais poderá ser usado.`}}});function We({className:e}){let t=a();if(t===void 0)return null;let n=l(t.locale),{id:r,entry:i}=t.item;return(0,K.jsx)(qe,{id:r,entry:i,said:{w:$.of(n),tag:p[n]},className:e},r)}function Ge(e){let[t,n]=(0,G.useState)(0);return r(e,()=>{n(e=>e+1)}),t}function Ke(e){try{let t=JSON.parse(e).dev;return typeof t!=`string`||t.trim()===``}catch{return!1}}function qe({id:e,entry:r,said:a,className:s}){let l=i(),{w:d}=a,p=e.slice(e.lastIndexOf(`/`)+1),[m,h]=(0,G.useState)({at:`starting`}),[g,_]=(0,G.useState)(0),[v,y]=(0,G.useState)(!1),b=Ge(e),x=Ne(r),S=ze(e,b,x),C=m.at===`failed`?b:void 0;(0,G.useEffect)(()=>{let t=!0;return J(l,`website/preview`,{item:e}).then(({url:e})=>{t&&h({at:`ready`,url:e})},e=>{t&&h(ee(e)?{at:`asleep`}:{at:`failed`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[l,e,g,C]);let[w,T]=(0,G.useState)(!1);(0,G.useEffect)(()=>{let e=!0;return l[`files/read`]({path:r}).then(({text:t})=>{e&&T(Ke(t))},()=>void 0),()=>{e=!1}},[l,r,b]);let E=m.at===`failed`;t(`jobs/changed`,({job:e,item:t})=>{E&&t===r&&e.what===`start`&&e.state===`running`&&(h({at:`starting`}),_(e=>e+1))});let D=(0,G.useRef)(null);n({hold:()=>Promise.resolve({key:`website@${e}@${crypto.randomUUID()}`,what:p,source:{path:r}}),locate:()=>Promise.resolve({elements:[]})});let O=()=>{let e=D.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0},k=(0,G.useRef)(void 0),A=()=>k.current??Promise.resolve(void 0);return o({element:()=>D.current,hold:()=>{let t=O();return k.current=t?J(l,`website/hold`,{item:e,width:Math.round(t.width),height:Math.round(t.height),scale:Math.min(4,Math.max(1,window.devicePixelRatio))}).then(e=>e.hold,()=>void 0):Promise.resolve(void 0),k.current.then(()=>void 0)},release:()=>{let e=k.current;k.current=void 0,e?.then(e=>e===void 0?void 0:J(l,`website/release`,{hold:e}).catch(()=>void 0))},pictures:async()=>{let t=O();if(!t)return[];let n=await A(),{image:r}=await J(l,`website/still`,{item:e,width:Math.round(t.width),height:Math.round(t.height),scale:Math.min(4,Math.max(1,window.devicePixelRatio)),...n===void 0?{}:{hold:n}});return[{...r,rect:t}]},locate:async t=>{let n=O(),i=n?c(t).map(e=>({x:e.x-n.x,y:e.y-n.y})).filter(e=>e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height):[],a=await A(),o=n&&i.length>0?await J(l,`website/at`,{item:e,width:Math.round(n.width),height:Math.round(n.height),points:i,...a===void 0?{}:{hold:a}}).catch(()=>void 0):void 0,s=o?.page??``;return{elements:o&&o.elements.length>0?o.elements.map(e=>({name:`the element ${e.selector} of the page ${s}`,source:{path:r},...e.text===``?{}:{text:e.text}})):[{name:`the page of the website ${p}`,source:{path:r}}],where:`on the website ${p}${s===``?``:` at ${s}`}, as its dev server serves it`}}}),m.at===`asleep`?(0,K.jsxs)(`div`,{className:u(`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,s),children:[(0,K.jsx)(`p`,{className:`text-sm text-lead`,children:d.asleep}),(0,K.jsx)(f,{size:`xs`,onClick:()=>{l[`edit/request`]({}).catch(()=>void 0)},children:d.edit})]}):(0,K.jsxs)(`div`,{className:u(`absolute inset-0 flex flex-col`,s),children:[(0,K.jsx)(He,{hosting:S,said:a,settings:v,onSettings:()=>{y(e=>!e)}}),(0,K.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[m.at===`ready`&&(0,K.jsx)(`iframe`,{ref:D,title:p,src:m.url,"data-testid":`site`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`,className:`absolute inset-0 size-full border-0 bg-page`},w?b:void 0),m.at===`starting`&&(0,K.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-lead`,children:(0,K.jsx)(Je,{job:Pe(x,`start`),name:p,w:d})}),m.at===`failed`&&(0,K.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-ink`,children:d.failed}),(0,K.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,K.jsx)(f,{size:`xs`,variant:`ghost`,className:`text-lead`,onClick:()=>{navigator.clipboard.writeText(m.message).catch(()=>void 0)},children:d.copy}),(0,K.jsx)(f,{size:`xs`,onClick:()=>{h({at:`starting`}),_(e=>e+1)},children:d.retry})]})]}),v&&S.status?.detail!==void 0&&(0,K.jsx)(Ue,{hosting:S,said:a})]})]})}function Je({job:e,name:t,w:n}){if(e===void 0)return(0,K.jsx)(`span`,{className:`animate-pulse`,children:n.starting});let r=De(e);return(0,K.jsxs)(`span`,{role:`status`,className:`flex flex-col items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r===void 0&&(0,K.jsx)(oe,{className:`text-ink`}),n.startingJob(e.name??t)]}),r!==void 0&&(0,K.jsx)(se,{value:r*100,className:`h-1 w-48`})]})}export{$ as WORDS,We as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-GFZ_fxLc.js";var t=e(`group`,[[`path`,{d:`M3 7V5c0-1.1.9-2 2-2h2`,key:`adw53z`}],[`path`,{d:`M17 3h2c1.1 0 2 .9 2 2v2`,key:`an4l38`}],[`path`,{d:`M21 17v2c0 1.1-.9 2-2 2h-2`,key:`144t0e`}],[`path`,{d:`M7 21H5c-1.1 0-2-.9-2-2v-2`,key:`rtnfgi`}],[`rect`,{width:`7`,height:`5`,x:`7`,y:`7`,rx:`1`,key:`1eyiv7`}],[`rect`,{width:`7`,height:`5`,x:`10`,y:`12`,rx:`1`,key:`1qlmkx`}]]),n=[`nw`,`n`,`ne`,`e`,`se`,`s`,`sw`,`w`],r={nw:[0,0],n:[.5,0],ne:[1,0],e:[1,.5],se:[1,1],s:[.5,1],sw:[0,1],w:[0,.5]},i=(e,t)=>[e,e+t/2,e+t];function a(e,t,n){let r;for(let i of e)for(let e of t){let t=e-i;Math.abs(t)<=n&&(!r||Math.abs(t)<Math.abs(r.shift))&&(r={shift:t,at:e})}return r}function o(e,t,n,r){let o=[...n?i(0,n.width):[],...t.flatMap(e=>i(e.left,e.width))],s=[...n?i(0,n.height):[],...t.flatMap(e=>i(e.top,e.height))],c=a(i(e.left,e.width),o,r),l=a(i(e.top,e.height),s,r);return{frame:{...e,left:e.left+(c?.shift??0),top:e.top+(l?.shift??0)},guides:[...c?[{axis:`x`,at:c.at}]:[],...l?[{axis:`y`,at:l.at}]:[]]}}function s(e,t,n,r,o={}){let s=o.min??1,c=e.left,l=e.top,u=e.left+e.width,d=e.top+e.height;t.includes(`w`)&&(c+=n),t.includes(`e`)&&(u+=n),t.includes(`n`)&&(l+=r),t.includes(`s`)&&(d+=r);let f=[];if(o.snap){let{others:e,surface:n,tol:r}=o.snap,s=[...n?i(0,n.width):[],...e.flatMap(e=>i(e.left,e.width))],p=[...n?i(0,n.height):[],...e.flatMap(e=>i(e.top,e.height))],m=(e,t,n)=>{let i=a([e],t,r);return i?(f.push({axis:n,at:i.at}),i.at):e};t.includes(`w`)&&(c=m(c,s,`x`)),t.includes(`e`)&&(u=m(u,s,`x`)),t.includes(`n`)&&(l=m(l,p,`y`)),t.includes(`s`)&&(d=m(d,p,`y`))}if(u-c<s&&(t.includes(`w`)?c=u-s:u=c+s),d-l<s&&(t.includes(`n`)?l=d-s:d=l+s),o.keep&&t.length===2&&e.width>0&&e.height>0){let n=e.width/e.height,r=u-c,i=d-l;if(r/n>=i){let e=r/n;t.includes(`n`)?l=d-e:d=l+e}else{let e=i*n;t.includes(`w`)?c=u-e:u=c+e}}return{frame:{left:c,top:l,width:u-c,height:d-l},guides:f}}function c(e,t,n){let r=n*Math.PI/180,i=e.x-t.x,a=e.y-t.y;return{x:t.x+i*Math.cos(r)-a*Math.sin(r),y:t.y+i*Math.sin(r)+a*Math.cos(r)}}var l={nw:[1,1],n:[.5,1],ne:[0,1],e:[0,.5],se:[0,0],s:[.5,0],sw:[1,0],w:[1,.5]};function u(e,t,n,r,i,a,o){let u=c({x:r,y:i},{x:0,y:0},-t),d=s(e,n,u.x,u.y,{keep:a,...o===void 0?{}:{min:o}}).frame,[f,p]=l[n],m=e=>c({x:e.left+f*e.width,y:e.top+p*e.height},{x:e.left+e.width/2,y:e.top+e.height/2},t),h=m(e),g=m(d);return{...d,left:d.left+h.x-g.x,top:d.top+h.y-g.y}}function d(e,t,n=0){if(n===0)return e;let r=t.left+t.width/2,i=t.top+t.height/2,a=-n*Math.PI/180,o=e.x-r,s=e.y-i;return{x:r+o*Math.cos(a)-s*Math.sin(a),y:i+o*Math.sin(a)+s*Math.cos(a)}}function f(e,t,n){let[i,a]=r[n];return d({x:e.left+i*e.width,y:e.top+a*e.height},e,-t)}var p=(e,t)=>({left:Math.min(e.x,t.x),top:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)});function m(e){if(e.length===0)return{left:0,top:0,width:0,height:0};let t=Math.min(...e.map(e=>e.left)),n=Math.min(...e.map(e=>e.top)),r=Math.max(...e.map(e=>e.left+e.width)),i=Math.max(...e.map(e=>e.top+e.height));return{left:t,top:n,width:r-t,height:i-n}}export{d as a,o as c,f as i,m as l,r as n,s as o,p as r,u as s,n as t,t as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-GFZ_fxLc.js";import{C as t,E as n,S as r,_ as i,b as a,c as o,d as s,f as c,h as l,i as u,k as d,l as f,m as p,o as m,s as h,v as g,x as _}from"./dist-YW8hS4IM.js";var v=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ee=e(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),te=e(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ne=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function re(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var y=(e,n,i)=>{let a=re(e,i);if(!a)return!1;let o=C(a);if(!o){let t=a.blockRange(),i=t&&r(t);return i!=null&&(n&&n(e.tr.lift(t,i).scrollIntoView()),!0)}let s=o.nodeBefore;if(k(e,o,n,-1))return!0;if(a.parent.content.size==0&&(x(s,`end`)||m.isSelectable(s)))for(let r=a.depth;;r--){let i=t(e.doc,a.before(r),a.after(r),d.empty);if(i&&i.slice.size<i.to-i.from){if(n){let t=e.tr.step(i);t.setSelection(x(s,`end`)?f.findFrom(t.doc.resolve(t.mapping.map(o.pos,-1)),-1):m.create(t.doc,o.pos-s.nodeSize)),n(t.scrollIntoView())}return!0}if(r==1||a.node(r-1).childCount>1)break}return s.isAtom&&o.depth==a.depth-1?(n&&n(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},ie=(e,t,n)=>{let r=re(e,n);if(!r)return!1;let i=C(r);return i?b(e,i,t):!1},ae=(e,t,n)=>{let r=w(e,n);if(!r)return!1;let i=D(r);return i?b(e,i,t):!1};function b(e,n,r){let i=n.nodeBefore,a=n.pos-1;for(;!i.isTextblock;a--){if(i.type.spec.isolating)return!1;let e=i.lastChild;if(!e)return!1;i=e}let o=n.nodeAfter,c=n.pos+1;for(;!o.isTextblock;c++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let u=t(e.doc,a,c,d.empty);if(!u||u.from!=a||u instanceof l&&u.slice.size>=c-a)return!1;if(r){let t=e.tr.step(u);t.setSelection(s.create(t.doc,a)),r(t.scrollIntoView())}return!0}function x(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var S=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=C(r)}let o=a&&a.nodeBefore;return!o||!m.isSelectable(o)?!1:(t&&t(e.tr.setSelection(m.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function C(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function w(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var T=(e,n,r)=>{let i=w(e,r);if(!i)return!1;let a=D(i);if(!a)return!1;let o=a.nodeAfter;if(k(e,a,n,1))return!0;if(i.parent.content.size==0&&(x(o,`start`)||m.isSelectable(o))){let r=t(e.doc,i.before(),i.after(),d.empty);if(r&&r.slice.size<r.to-r.from){if(n){let t=e.tr.step(r);t.setSelection(x(o,`start`)?f.findFrom(t.doc.resolve(t.mapping.map(a.pos)),1):m.create(t.doc,t.mapping.map(a.pos))),n(t.scrollIntoView())}return!0}}return o.isAtom&&a.depth==i.depth-1?(n&&n(e.tr.delete(a.pos,a.pos+o.nodeSize).scrollIntoView()),!0):!1},E=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=D(r)}let o=a&&a.nodeAfter;return!o||!m.isSelectable(o)?!1:(t&&t(e.tr.setSelection(m.create(e.doc,a.pos)).scrollIntoView()),!0)};function D(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var oe=(e,t)=>{let n=e.selection,r=n instanceof m,a;if(r){if(n.node.isTextblock||!i(e.doc,n.from))return!1;a=n.from}else if(a=_(e.doc,n.from,-1),a==null)return!1;if(t){let n=e.tr.join(a);r&&n.setSelection(m.create(n.doc,a-e.doc.resolve(a).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},se=(e,t)=>{let n=e.selection,r;if(n instanceof m){if(n.node.isTextblock||!i(e.doc,n.to))return!1;r=n.to}else if(r=_(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},ce=(e,t)=>{let{$from:n,$to:i}=e.selection,a=n.blockRange(i),o=a&&r(a);return o!=null&&(t&&t(e.tr.lift(a,o).scrollIntoView()),!0)},le=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
2
|
+
`).scrollIntoView()),!0)};function O(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var ue=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=O(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(f.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},de=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof u||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=O(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(s.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},fe=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(g(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let i=n.blockRange(),a=i&&r(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)};function pe(e){return(t,n)=>{if(t.selection instanceof m&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!g(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof s||t.selection instanceof u)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],c,l,d=!1,f=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){d=i.end(t)==i.pos+(i.depth-t),f=i.start(t)==i.pos-(i.depth-t),l=O(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,d,i);o.unshift(n||(d&&l?{type:l}:null)),c=t;break}else{if(t==1)return!1;o.unshift(null)}let p=i.pos,h=g(r.doc,p,o.length,o);if(h||=(o[0]=l?{type:l}:null,g(r.doc,p,o.length,o)),!h)return!1;if(r.split(p,o.length,o),!d&&f&&i.node(c).type!=l){let e=r.mapping.slice(a),t=e.map(i.before(c)),n=r.doc.resolve(t);l&&i.node(c-1).canReplaceWith(n.index(),n.index()+1,l)&&r.setNodeMarkup(e.map(i.before(c)),l)}return n&&n(r.scrollIntoView()),!0}}var me=pe(),he=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(m.create(e.doc,i))),!0)},ge=(e,t)=>(t&&t(e.tr.setSelection(new u(e.doc))),!0);function _e(e,t,n){let r=t.nodeBefore,a=t.nodeAfter,o=t.index();return!r||!a||!r.type.compatibleContent(a.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(a.isTextblock||i(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function k(e,t,a,o){let s=t.nodeBefore,c=t.nodeAfter,l,u,m=s.type.spec.isolating||c.type.spec.isolating;if(!m&&_e(e,t,a))return!0;let h=!m&&t.parent.canReplace(t.index(),t.index()+1);if(h&&(l=(u=s.contentMatchAt(s.childCount)).findWrapping(c.type))&&u.matchType(l[0]||c.type).validEnd){if(a){let r=t.pos+c.nodeSize,o=n.empty;for(let e=l.length-1;e>=0;e--)o=n.from(l[e].create(null,o));o=n.from(s.copy(o));let u=e.tr.step(new p(t.pos-1,r,t.pos,r,new d(o,1,0),l.length,!0)),f=u.doc.resolve(r+2*l.length);f.nodeAfter&&f.nodeAfter.type==s.type&&i(u.doc,f.pos)&&u.join(f.pos),a(u.scrollIntoView())}return!0}let g=c.type.spec.isolating||o>0&&m?null:f.findFrom(t,1),_=g&&g.$from.blockRange(g.$to),v=_&&r(_);if(v!=null&&v>=t.depth)return a&&a(e.tr.lift(_,v).scrollIntoView()),!0;if(h&&x(c,`start`,!0)&&x(s,`end`)){let r=s,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=c,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(a){let r=n.empty;for(let e=i.length-1;e>=0;e--)r=n.from(i[e].copy(r));a(e.tr.step(new p(t.pos-i.length,t.pos+c.nodeSize,t.pos+l,t.pos+c.nodeSize-l,new d(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function A(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(s.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var j=A(-1),M=A(1);function ve(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),c=s&&a(s,e,t);return c?(r&&r(n.tr.wrap(s,c).scrollIntoView()),!0):!1}}function ye(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function N(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var P=N(ne,y,S),F=N(ne,T,E),I={Enter:N(le,de,fe,me),"Mod-Enter":ue,Backspace:P,"Mod-Backspace":P,"Shift-Backspace":P,Delete:F,"Mod-Delete":F,"Mod-a":ge},L={"Ctrl-h":I.Backspace,"Alt-Backspace":I[`Mod-Backspace`],"Ctrl-d":I.Delete,"Ctrl-Alt-Backspace":I[`Mod-Delete`],"Alt-Delete":I[`Mod-Delete`],"Alt-d":I[`Mod-Delete`],"Ctrl-a":j,"Ctrl-e":M};for(let e in I)L[e]=I[e];for(var be=(typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()==`darwin`)?L:I,R={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},z={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},xe=typeof navigator<`u`&&/Mac/.test(navigator.platform),Se=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),B=0;B<10;B++)R[48+B]=R[96+B]=String(B);for(var B=1;B<=24;B++)R[B+111]=`F`+B;for(var B=65;B<=90;B++)R[B]=String.fromCharCode(B+32),z[B]=String.fromCharCode(B);for(var V in R)z.hasOwnProperty(V)||(z[V]=R[V]);function Ce(e){var t=!(xe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Se&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?z:R)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var we=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Te=typeof navigator<`u`&&/Win/.test(navigator.platform);function Ee(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))we?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function De(e){let t=Object.create(null);for(let n in e)t[Ee(n)]=e[n];return t}function H(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Oe(e){return new h({props:{handleKeyDown:U(e)}})}function U(e){let t=De(e);return function(e,n){let r=Ce(n),i,a=t[H(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[H(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Te&&n.ctrlKey&&n.altKey)&&(i=R[n.keyCode])&&i!=r){let r=t[H(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var W=200,G=function(){};G.prototype.append=function(e){return e.length?(e=G.from(e),!this.length&&e||e.length<W&&this.leafAppend(e)||this.length<W&&e.leafPrepend(this)||this.appendInner(e)):this},G.prototype.prepend=function(e){return e.length?G.from(e).append(this):this},G.prototype.appendInner=function(e){return new Ae(this,e)},G.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?G.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},G.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},G.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},G.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},G.from=function(e){return e instanceof G?e:e&&e.length?new ke(e):G.empty};var ke=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=W)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=W)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(G);G.empty=new ke([]);var Ae=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(G),je=500,K=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step)i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);else{if(i){u.push(new q(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new q(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1}},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new q(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Ne&&(s=Me(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new c;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new q(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],i=this.items.length-n,a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new q(i,o,l))}else r.push(new q(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new q(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>je&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new q(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(G.from(i.reverse()),a)}};K.empty=new K(G.empty,0);function Me(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var q=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},J=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Ne=20;function Pe(e,t,n,r){let i=n.getMeta(Q),a;if(i)return i.historyState;n.getMeta(Be)&&(e=new J(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Q))return o.getMeta(Q).redo?new J(e.done.addTransform(n,void 0,r,Z(t)),e.undone,Ie(n.mapping.maps),e.prevTime,e.prevComposition):new J(e.done,e.undone.addTransform(n,void 0,r,Z(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Fe(n,e.prevRanges)),s=o?Y(e.prevRanges,n.mapping):Ie(n.mapping.maps);return new J(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Z(t)),K.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new J(e.done.rebased(n,a),e.undone.rebased(n,a),Y(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new J(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Fe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function Ie(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Y(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Le(e,t,n){let r=Z(t),i=Q.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new J(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Q,{redo:n,historyState:c})}var X=!1,Re=null;function Z(e){let t=e.plugins;if(Re!=t){X=!1,Re=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){X=!0;break}}return X}function ze(e){return e.setMeta(Be,!0)}var Q=new o(`history`),Be=new o(`closeHistory`);function Ve(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new h({key:Q,state:{init(){return new J(K.empty,K.empty,null,0,-1)},apply(t,n,r){return Pe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Ue:n==`historyRedo`?$:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function He(e,t){return(n,r)=>{let i=Q.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Le(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Ue=He(!1,!0),$=He(!0,!0);function We(e){return e.getMeta(Q)!=null}export{M as C,te as D,ve as E,ee as O,he as S,ye as T,ce as _,Ue as a,S as b,be as c,y as d,se as f,oe as g,ae as h,$ as i,v as k,de as l,ie as m,Ve as n,U as o,T as p,We as r,Oe as s,ze as t,ue as u,fe as v,j as w,E as x,le as y};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-COiEfhsA.js";import{a as n,c as r,d as i,m as a,o,p as s,s as c,u as l,y as u}from"./react-WA6wlt8S.js";import{Dt as d,Tt as f,_t as p,bt as m,gt as h,t as g,vt as _,wt as v,yt as y}from"./button-eGxLxbv9.js";import{A as b,B as x,J as S,P as C,R as w,S as T,V as E,W as D,X as O,Y as k,_ as ee,b as A,et as j,g as te,it as M,tt as N,x as ne}from"./snapshots-BUGlKQIB.js";import{n as re,t as ie}from"./schemas-VikZYZIK.js";import{t as P}from"./session-Do9AqS38.js";import{t as F}from"./jsx-runtime-DePvh3-m.js";import{t as I}from"./createLucideIcon-GFZ_fxLc.js";import{t as ae}from"./audio-lines-CzuzsGjI.js";import{D as oe,a as se,i as ce,k as le,l as ue,n as de,o as fe}from"./dist-CC7OeU1e.js";import{t as L}from"./play-CrMmPghG.js";import{n as pe,t as me}from"./undo-2-CHR0nvWL.js";import{i as he,n as R,r as z,t as B}from"./hint-B8JpEypy.js";import{Y as V,a as ge,gt as _e,lt as ve,n as ye,o as H,ot as U,r as be,s as xe,st as Se,u as Ce}from"./index-CgB5osVc.js";import{n as we,r as Te,t as Ee}from"./collaborator-B1u2td9m.js";import{O as De,a as Oe,c as ke,d as Ae,n as W,r as G,s as K,t as je}from"./dist-YW8hS4IM.js";var Me=[`error`,`saving`,`unsaved`,`saved`],Ne=class e{host;options;sessions=new Map;opening=new Map;done=[];undone=[];stateListeners=new Set;undoListeners=new Set;stops=[];last=`saved`;closed=!1;constructor(e,t){this.host=e,this.options={...t,report:!1}}static async open(t,n,r={}){let i=new e(t,r);return await Promise.all(n.map(e=>i.add(e))),i}add(e){let t=this.sessions.get(e);if(t)return Promise.resolve(t);let n=this.opening.get(e);return n||(n=P.open(this.host,e,this.options).then(t=>(this.sessions.set(e,t),this.opening.delete(e),this.stops.push(t.onState(()=>{this.stateChanged()})),this.closed&&t.close(),t)),this.opening.set(e,n)),n}file(e){return this.sessions.get(e)}get paths(){return[...this.sessions.keys()]}get state(){let e=[...this.sessions.values()].map(e=>e.state);return Me.find(t=>e.includes(t))??`saved`}get error(){return[...this.sessions.values()].find(e=>e.error!==void 0)?.error}onState(e){return this.stateListeners.add(e),()=>this.stateListeners.delete(e)}stateChanged(){let e=this.state;if(e!==this.last){this.last=e;for(let t of this.stateListeners)t(e);this.host[`editor/state`]&&this.host[`editor/state`]({state:e,...e===`error`&&this.error!==void 0?{message:this.error}:{}}).catch(()=>void 0)}}edited(e){for(let t of e)this.sessions.get(t)?.edited()}pushEdit(e){this.closed||(this.done.push(e),this.undone.length=0,this.edited(e.files),this.undoChanged())}amend(e){let t=this.done.pop();if(!t){this.pushEdit(e);return}let n=[...new Set([...t.files,...e.files])];this.done.push({label:e.label,files:n,undo:()=>{e.undo(),t.undo()},redo:()=>{t.redo(),e.redo()}}),this.undone.length=0,this.edited(e.files),this.undoChanged()}get canUndo(){return this.done.length>0}get canRedo(){return this.undone.length>0}get undoLabel(){return this.done.at(-1)?.label}get redoLabel(){return this.undone.at(-1)?.label}undo(){let e=this.done.pop();return e?(e.undo(),this.undone.push(e),this.edited(e.files),this.undoChanged(),!0):!1}redo(){let e=this.undone.pop();return e?(e.redo(),this.done.push(e),this.edited(e.files),this.undoChanged(),!0):!1}onUndo(e){return this.undoListeners.add(e),()=>this.undoListeners.delete(e)}undoChanged(){for(let e of this.undoListeners)e()}async flush(){await Promise.all([...this.sessions.values()].map(e=>e.flush()))}async close(){this.closed=!0;for(let e of this.stops.splice(0))e();await Promise.all([...this.sessions.values()].map(e=>e.close()))}},Pe=I(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Fe=I(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),Ie=I(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Le=I(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),Re=I(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]),ze=I(`step-back`,[[`path`,{d:`M13.971 4.285A2 2 0 0 1 17 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`19qhus`}],[`path`,{d:`M21 20V4`,key:`cb8qj8`}]]),Be=I(`step-forward`,[[`path`,{d:`M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`1ystz2`}],[`path`,{d:`M3 4v16`,key:`1ph11n`}]]),Ve=I(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),He=I(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),Ue=I(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),q=e(u(),1),J=F();function We({className:e,...t}){return(0,J.jsx)(`span`,{className:h(`text-muted-foreground font-mono text-micro leading-4 font-normal tracking-label uppercase`,e),...t})}function Ge({label:e,count:t=4,size:n=10,className:r}){return(0,J.jsx)(`span`,{role:`status`,"aria-label":e,className:h(`inline-flex items-end gap-[3px]`,r),children:Array.from({length:t},(e,t)=>(0,J.jsx)(`span`,{className:`bg-foreground animate-squares-drop block`,style:{width:n,height:n,animationDelay:`${String(t*120)}ms`}},t))})}function Ke({title:e,children:t,action:n,className:r}){return(0,J.jsxs)(`div`,{className:h(`animate-set-in flex flex-col items-center gap-5 px-6 py-16 text-center`,r),children:[(0,J.jsxs)(`div`,{className:`flex max-w-sm flex-col gap-1.5`,children:[(0,J.jsx)(`h2`,{className:`font-serif text-heading font-semibold`,children:e}),t?(0,J.jsx)(`div`,{className:`text-muted-foreground text-sm leading-relaxed`,children:t}):null]}),n]})}var qe=e=>Number.isFinite(e)&&e>0?e:0,Y=e=>{let t=qe(e);return`${String(Math.floor(t/60))}:${String(Math.floor(t%60)).padStart(2,`0`)}`},Je=e=>{let t=qe(e);return`${String(Math.floor(t/60))}:${(t%60).toFixed(1).padStart(4,`0`)}`},Ye=(e,t)=>Math.floor(e*t+1e-9)/t,Xe=e=>e.split(/[/\\]/u).at(-1)??e,Ze=S({fps:k(),width:k(),height:k(),duration:k(),parts:x(M())}),Qe=j({from:D().positive(),to:D().positive()}),$e=Qe.extend({key:N().min(1),layers:x(Qe).optional(),sounds:Qe.optional(),messages:x(Qe.extend({key:N().min(1)})).optional()}),et={"video/versions":C(j({item:b}),j({piece:N(),kind:N(),title:N().optional(),width:k(),height:k(),versions:x(j({key:N(),lang:N().optional()}))}),`A video's or a deck's versions, one per language: what its stage, its timeline and its exports are asked for.`),"video/stage":C(j({...A,start:j({t:k().nonnegative().optional(),part:N().optional(),offset:k().nonnegative().optional(),dur:k().positive().optional()}).optional(),play:E().optional(),chrome:E().optional(),mode:w([`code`]).optional()}),te,`The address of a version's stage page, for a sandboxed frame: it plays the piece and talks to its parent by postMessage.`),"video/timeline":C(j(A),j({timeline:Ze,text:x(M())}),`A version's timeline, drawn nowhere.`),"video/still":C(j({...A,t:k().nonnegative().optional()}),j({t:k(),image:T,width:D().positive(),height:D().positive(),duration:k().nonnegative()}),`A moment of a version as the render draws it, as a picture.`),"video/stills":C(j({...A,moments:x(k().nonnegative()).min(1).max(32)}),j({stills:x(j({t:k(),image:T}))}),"Several moments of a version as the render draws them: what `video/still` gives, on one page."),"video/sources":C(j({item:b}),j({files:x(j({path:b,parts:x($e),music:x(Qe).optional()}))}),`Where each part, its layers, its sounds and its script's messages are written in the piece's code and its script, by line, and the video's music: what a change to those lines changes.`)},tt=ne(et),nt=y({en:{loading:`Loading the preview`,loadFailed:`The preview did not load`,noVideo:`This is not a video`,previewTitle:`Preview`,denoising:`Denoising the speech; playing it as recorded`,uncut:e=>`No person matte for ${e} yet: layers behind the person show in front`,play:`Play`,pause:`Pause`,seek:`Seek`,toStart:`Go to start`,frameBack:`Previous frame`,frameForward:`Next frame`,mute:`Mute`,unmute:`Unmute`,volume:`Volume`,withKey:(e,t)=>`${e} (${t})`,keys:{space:`Space`,home:`Home`},prevPage:`Previous page`,nextPage:`Next page`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,timeOf:(e,t,n)=>`${e} of ${t}${n?`, ${n}`:``}`,hideTimeline:`Hide timeline`,showTimeline:`Show timeline`,rows:{scenes:`Scenes`,voice:`Speech`,music:`Music`,sound:`Sound`},noVoice:`No speech`,noMusic:`No music`,noCues:`No sound cues`,ducked:`lowered under speech`,version:`Language`,close:`Close`,previewFailed:`Something went wrong with this video.`,previewFailedKept:`Something went wrong with the latest change. This is the last version that worked.`,problemsHere:e=>`${String(e)} problem${e===1?``:`s`} in this version`,levelError:`Must fix`,levelWarn:`Suggestion`,previewSimpler:`Parts of this preview are drawn more simply than the export.`,script:`Script`,scriptHint:`Delete words to cut them. Delete struck words to keep them.`,scriptReadOnly:`What the video says.`,noScript:`Nobody speaks in this video.`,undo:`Undo`,redo:`Redo`,undoWhat:e=>`Undo ${e}`,redoWhat:e=>`Redo ${e}`,cutWords:`Cut`,keepWords:`Keep`,noEdits:`Words are cut only in a take whose code names an edits file: ask the agent to add one.`,resizeScript:`Script width`,resizeTimeline:`Timeline height`},"zh-cn":{loading:`正在加载预览`,loadFailed:`预览没能加载`,noVideo:`这不是视频`,previewTitle:`预览`,denoising:`正在降噪,先播原声`,uncut:e=>`${e} 还没有人像遮罩:人物后面的图层暂时画在人物前面`,play:`播放`,pause:`暂停`,seek:`进度`,toStart:`回到开头`,frameBack:`上一帧`,frameForward:`下一帧`,mute:`静音`,unmute:`取消静音`,volume:`音量`,withKey:(e,t)=>`${e}(${t})`,keys:{space:`空格`,home:`Home`},prevPage:`上一页`,nextPage:`下一页`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收起时间线`,showTimeline:`展开时间线`,rows:{scenes:`分段`,voice:`说话`,music:`音乐`,sound:`音效`},noVoice:`没有人说话`,noMusic:`没有音乐`,noCues:`没有音效`,ducked:`有人说话时压低`,version:`语言`,close:`关闭`,previewFailed:`这个视频出了点问题。`,previewFailedKept:`最新的改动出了点问题,这里是上一版正常的画面。`,problemsHere:e=>`这个版本有 ${String(e)} 个问题`,levelError:`必须改`,levelWarn:`建议`,previewSimpler:`此预览中有部分内容比导出的画面简化。`,script:`文稿`,scriptHint:`删掉文字就剪掉这段;删掉划线的文字就恢复。`,scriptReadOnly:`视频里说的话。`,noScript:`这个视频里没有人说话。`,undo:`撤销`,redo:`重做`,undoWhat:e=>`撤销「${e}」`,redoWhat:e=>`重做「${e}」`,cutWords:`剪掉`,keepWords:`保留`,noEdits:`只有代码里给这段录音指定了剪辑文件,才能在这里剪词:可以让 agent 加一个。`,resizeScript:`文稿宽度`,resizeTimeline:`时间线高度`},"zh-tw":{loading:`正在載入預覽`,loadFailed:`預覽未能載入`,noVideo:`這不是影片`,previewTitle:`預覽`,denoising:`正在降噪,先播放原始錄音`,uncut:e=>`${e} 還沒有人像遮罩:人物後方的圖層暫時顯示在人物前面`,play:`播放`,pause:`暫停`,seek:`播放位置`,toStart:`回到開頭`,frameBack:`上一格`,frameForward:`下一格`,mute:`靜音`,unmute:`取消靜音`,volume:`音量`,withKey:(e,t)=>`${e}(${t})`,keys:{space:`空白鍵`,home:`Home`},prevPage:`上一頁`,nextPage:`下一頁`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,timeOf:(e,t,n)=>`${e} / ${t}${n?`,${n}`:``}`,hideTimeline:`收合時間軸`,showTimeline:`展開時間軸`,rows:{scenes:`段落`,voice:`語音`,music:`音樂`,sound:`音效`},noVoice:`沒有語音`,noMusic:`沒有音樂`,noCues:`沒有音效`,ducked:`有語音時降低音量`,version:`語言`,close:`關閉`,previewFailed:`這部影片出了點問題。`,previewFailedKept:`最新的修改出了點問題,這裡是上一個正常的版本。`,problemsHere:e=>`這個版本有 ${String(e)} 個問題`,levelError:`必須修正`,levelWarn:`建議`,previewSimpler:`此預覽中有部分內容比匯出的畫面簡化。`,script:`文稿`,scriptHint:`刪掉文字就剪掉這段;刪掉劃線的文字就復原。`,scriptReadOnly:`影片裡說的話。`,noScript:`這部影片裡沒有人說話。`,undo:`復原`,redo:`重做`,undoWhat:e=>`復原「${e}」`,redoWhat:e=>`重做「${e}」`,cutWords:`剪掉`,keepWords:`保留`,noEdits:`只有程式碼為這段錄音指定了剪輯檔,才能在這裡剪詞:可以請 agent 加一個。`,resizeScript:`文稿寬度`,resizeTimeline:`時間軸高度`},ja:{loading:`プレビューを読み込み中`,loadFailed:`プレビューを読み込めませんでした`,noVideo:`これは動画ではありません`,previewTitle:`プレビュー`,denoising:`音声のノイズを除去中。録音のまま再生しています`,uncut:e=>`${e} の人物マットはまだありません。人物の後ろのレイヤーが前に表示されます`,play:`再生`,pause:`一時停止`,seek:`再生位置`,toStart:`先頭へ`,frameBack:`前のフレーム`,frameForward:`次のフレーム`,mute:`ミュート`,unmute:`ミュート解除`,volume:`音量`,withKey:(e,t)=>`${e}(${t})`,keys:{space:`スペース`,home:`Home`},prevPage:`前のページ`,nextPage:`次のページ`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,timeOf:(e,t,n)=>`${e} / ${t}${n?`、${n}`:``}`,hideTimeline:`タイムラインを隠す`,showTimeline:`タイムラインを表示`,rows:{scenes:`シーン`,voice:`音声`,music:`音楽`,sound:`効果音`},noVoice:`音声なし`,noMusic:`音楽なし`,noCues:`効果音なし`,ducked:`音声の間は音量を下げる`,version:`言語`,close:`閉じる`,previewFailed:`この動画で問題が起きました。`,previewFailedKept:`最新の変更で問題が起きました。これは最後に正しく動いたバージョンです。`,problemsHere:e=>`このバージョンに ${String(e)} 件の問題`,levelError:`要修正`,levelWarn:`提案`,previewSimpler:`このプレビューの一部は、書き出しより簡略に描画されています。`,script:`台本`,scriptHint:`言葉を削除するとカットされます。取り消し線の言葉を削除すると元に戻ります。`,scriptReadOnly:`動画の中で話していること。`,noScript:`この動画では誰も話していません。`,undo:`取り消す`,redo:`やり直す`,undoWhat:e=>`「${e}」を取り消す`,redoWhat:e=>`「${e}」をやり直す`,cutWords:`カット`,keepWords:`残す`,noEdits:`単語をカットできるのは、コードがカットファイルを指定しているテイクだけです。エージェントに追加を頼んでください。`,resizeScript:`台本の幅`,resizeTimeline:`タイムラインの高さ`},ko:{loading:`미리보기를 불러오는 중`,loadFailed:`미리보기를 불러오지 못했습니다`,noVideo:`동영상이 아닙니다`,previewTitle:`미리보기`,denoising:`음성의 잡음을 제거하는 중입니다. 녹음된 그대로 재생합니다`,uncut:e=>`${e}의 인물 매트가 아직 없습니다. 인물 뒤 레이어가 앞에 보입니다`,play:`재생`,pause:`일시정지`,seek:`재생 위치`,toStart:`처음으로`,frameBack:`이전 프레임`,frameForward:`다음 프레임`,mute:`음소거`,unmute:`음소거 해제`,volume:`볼륨`,withKey:(e,t)=>`${e} (${t})`,keys:{space:`스페이스`,home:`Home`},prevPage:`이전 페이지`,nextPage:`다음 페이지`,pageOf:(e,t)=>`${String(t)}페이지 중 ${String(e)}페이지`,timeOf:(e,t,n)=>`${e} / ${t}${n?`, ${n}`:``}`,hideTimeline:`타임라인 숨기기`,showTimeline:`타임라인 보기`,rows:{scenes:`장면`,voice:`음성`,music:`음악`,sound:`사운드`},noVoice:`음성 없음`,noMusic:`음악 없음`,noCues:`효과음 없음`,ducked:`음성 아래로 낮춤`,version:`언어`,close:`닫기`,previewFailed:`이 동영상에 문제가 생겼습니다.`,previewFailedKept:`최근 변경에서 문제가 생겼습니다. 마지막으로 정상 작동한 버전입니다.`,problemsHere:e=>`이 버전의 문제 ${String(e)}개`,levelError:`수정 필요`,levelWarn:`제안`,previewSimpler:`이 미리보기의 일부는 내보내기보다 단순하게 그려집니다.`,script:`대본`,scriptHint:`단어를 지우면 잘립니다. 줄 그어진 단어를 지우면 다시 살아납니다.`,scriptReadOnly:`영상에서 하는 말.`,noScript:`이 영상에는 말하는 사람이 없습니다.`,undo:`실행 취소`,redo:`다시 실행`,undoWhat:e=>`'${e}' 실행 취소`,redoWhat:e=>`'${e}' 다시 실행`,cutWords:`자르기`,keepWords:`남기기`,noEdits:`코드에 편집 파일이 지정된 테이크에서만 단어를 잘라낼 수 있습니다. 에이전트에게 추가해 달라고 요청하세요.`,resizeScript:`대본 너비`,resizeTimeline:`타임라인 높이`},es:{loading:`Cargando la vista previa`,loadFailed:`La vista previa no se cargó`,noVideo:`Esto no es un video`,previewTitle:`Vista previa`,denoising:`Reduciendo el ruido de la voz; se reproduce tal como se grabó`,uncut:e=>`Aún no hay máscara de persona para ${e}: las capas detrás de la persona se ven delante`,play:`Reproducir`,pause:`Pausa`,seek:`Buscar`,toStart:`Ir al inicio`,frameBack:`Fotograma anterior`,frameForward:`Fotograma siguiente`,mute:`Silenciar`,unmute:`Activar sonido`,volume:`Volumen`,withKey:(e,t)=>`${e} (${t})`,keys:{space:`Espacio`,home:`Inicio`},prevPage:`Página anterior`,nextPage:`Página siguiente`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar la línea de tiempo`,showTimeline:`Mostrar la línea de tiempo`,rows:{scenes:`Escenas`,voice:`Voz`,music:`Música`,sound:`Sonido`},noVoice:`Sin voz`,noMusic:`Sin música`,noCues:`Sin efectos de sonido`,ducked:`bajada bajo la voz`,version:`Idioma`,close:`Cerrar`,previewFailed:`Algo salió mal con este video.`,previewFailedKept:`Algo salió mal con el último cambio. Esta es la última versión que funcionó.`,problemsHere:e=>e===1?`1 problema en esta versión`:`${String(e)} problemas en esta versión`,levelError:`Corregir`,levelWarn:`Sugerencia`,previewSimpler:`Partes de esta vista previa se dibujan de forma más simple que la exportación.`,script:`Guion`,scriptHint:`Borra palabras para cortarlas. Borra las tachadas para recuperarlas.`,scriptReadOnly:`Lo que dice el vídeo.`,noScript:`Nadie habla en este vídeo.`,undo:`Deshacer`,redo:`Rehacer`,undoWhat:e=>`Deshacer: ${e}`,redoWhat:e=>`Rehacer: ${e}`,cutWords:`Cortar`,keepWords:`Mantener`,noEdits:`Solo se pueden cortar palabras en una toma cuyo código indique un archivo de cortes: pide al agente que añada uno.`,resizeScript:`Ancho del guion`,resizeTimeline:`Altura de la línea de tiempo`},fr:{loading:`Chargement de l’aperçu`,loadFailed:`L’aperçu ne s’est pas chargé`,noVideo:`Ce n’est pas une vidéo`,previewTitle:`Aperçu`,denoising:`Débruitage de la voix\xA0; lecture telle qu’enregistrée`,uncut:e=>`Pas encore de masque de personne pour ${e}\u00a0: les calques derrière la personne passent devant`,play:`Lire`,pause:`Pause`,seek:`Position`,toStart:`Aller au début`,frameBack:`Image précédente`,frameForward:`Image suivante`,mute:`Couper le son`,unmute:`Activer le son`,volume:`Volume`,withKey:(e,t)=>`${e} (${t})`,keys:{space:`Espace`,home:`Début`},prevPage:`Page précédente`,nextPage:`Page suivante`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,timeOf:(e,t,n)=>`${e} sur ${t}${n?`, ${n}`:``}`,hideTimeline:`Masquer la timeline`,showTimeline:`Afficher la timeline`,rows:{scenes:`Scènes`,voice:`Voix`,music:`Musique`,sound:`Son`},noVoice:`Pas de voix`,noMusic:`Pas de musique`,noCues:`Pas d’effets sonores`,ducked:`baissée sous la voix`,version:`Langue`,close:`Fermer`,previewFailed:`Un problème est survenu avec cette vidéo.`,previewFailedKept:`Un problème est survenu avec la dernière modification. Voici la dernière version qui fonctionnait.`,problemsHere:e=>e===1?`1 problème dans cette version`:`${String(e)} problèmes dans cette version`,levelError:`À corriger`,levelWarn:`Suggestion`,previewSimpler:`Certaines parties de cet aperçu sont dessinées plus simplement que l’export.`,script:`Script`,scriptHint:`Supprimez des mots pour les couper. Supprimez des mots barrés pour les garder.`,scriptReadOnly:`Ce que dit la vidéo.`,noScript:`Personne ne parle dans cette vidéo.`,undo:`Annuler`,redo:`Rétablir`,undoWhat:e=>`Annuler : ${e}`,redoWhat:e=>`Rétablir : ${e}`,cutWords:`Couper`,keepWords:`Garder`,noEdits:`On ne coupe des mots que dans une prise dont le code nomme un fichier de coupes : demandez à l’agent d’en ajouter un.`,resizeScript:`Largeur du script`,resizeTimeline:`Hauteur de la chronologie`},de:{loading:`Vorschau wird geladen`,loadFailed:`Die Vorschau wurde nicht geladen`,noVideo:`Das ist kein Video`,previewTitle:`Vorschau`,denoising:`Sprache wird entrauscht; Wiedergabe wie aufgenommen`,uncut:e=>`Noch keine Personenmaske für ${e}: Ebenen hinter der Person erscheinen davor`,play:`Abspielen`,pause:`Pause`,seek:`Springen`,toStart:`Zum Anfang`,frameBack:`Vorheriges Bild`,frameForward:`Nächstes Bild`,mute:`Stummschalten`,unmute:`Ton an`,volume:`Lautstärke`,withKey:(e,t)=>`${e} (${t})`,keys:{space:`Leertaste`,home:`Pos1`},prevPage:`Vorherige Seite`,nextPage:`Nächste Seite`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,timeOf:(e,t,n)=>`${e} von ${t}${n?`, ${n}`:``}`,hideTimeline:`Zeitleiste ausblenden`,showTimeline:`Zeitleiste einblenden`,rows:{scenes:`Szenen`,voice:`Sprache`,music:`Musik`,sound:`Ton`},noVoice:`Keine Sprache`,noMusic:`Keine Musik`,noCues:`Keine Soundeffekte`,ducked:`unter Sprache abgesenkt`,version:`Sprache`,close:`Schließen`,previewFailed:`Mit diesem Video ist etwas schiefgelaufen.`,previewFailedKept:`Bei der letzten Änderung ist etwas schiefgelaufen. Das ist die letzte Version, die funktioniert hat.`,problemsHere:e=>e===1?`1 Problem in dieser Version`:`${String(e)} Probleme in dieser Version`,levelError:`Muss behoben werden`,levelWarn:`Vorschlag`,previewSimpler:`Teile dieser Vorschau sind einfacher gezeichnet als der Export.`,script:`Skript`,scriptHint:`Wörter löschen schneidet sie heraus. Durchgestrichene Wörter löschen behält sie wieder.`,scriptReadOnly:`Was im Video gesagt wird.`,noScript:`In diesem Video spricht niemand.`,undo:`Rückgängig`,redo:`Wiederholen`,undoWhat:e=>`Rückgängig: ${e}`,redoWhat:e=>`Wiederholen: ${e}`,cutWords:`Schneiden`,keepWords:`Behalten`,noEdits:`Wörter lassen sich nur in einer Aufnahme schneiden, deren Code eine Schnittdatei nennt: Bitte den Agenten, eine anzulegen.`,resizeScript:`Breite des Skripts`,resizeTimeline:`Höhe der Zeitleiste`},pt:{loading:`Carregando a prévia`,loadFailed:`A prévia não carregou`,noVideo:`Isto não é um vídeo`,previewTitle:`Prévia`,denoising:`Removendo o ruído da fala; tocando como foi gravada`,uncut:e=>`Ainda não há máscara de pessoa para ${e}: as camadas atrás da pessoa aparecem na frente`,play:`Reproduzir`,pause:`Pausar`,seek:`Posição`,toStart:`Ir para o início`,frameBack:`Quadro anterior`,frameForward:`Próximo quadro`,mute:`Silenciar`,unmute:`Ativar som`,volume:`Volume`,withKey:(e,t)=>`${e} (${t})`,keys:{space:`Espaço`,home:`Home`},prevPage:`Página anterior`,nextPage:`Próxima página`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,timeOf:(e,t,n)=>`${e} de ${t}${n?`, ${n}`:``}`,hideTimeline:`Ocultar a linha do tempo`,showTimeline:`Mostrar a linha do tempo`,rows:{scenes:`Cenas`,voice:`Fala`,music:`Música`,sound:`Som`},noVoice:`Sem fala`,noMusic:`Sem música`,noCues:`Sem efeitos sonoros`,ducked:`abaixada sob a fala`,version:`Idioma`,close:`Fechar`,previewFailed:`Algo deu errado com este vídeo.`,previewFailedKept:`Algo deu errado com a última alteração. Esta é a última versão que funcionou.`,problemsHere:e=>e===1?`1 problema nesta versão`:`${String(e)} problemas nesta versão`,levelError:`Corrigir`,levelWarn:`Sugestão`,previewSimpler:`Partes desta prévia são desenhadas de forma mais simples que a exportação.`,script:`Roteiro`,scriptHint:`Apague palavras para cortá-las. Apague palavras riscadas para mantê-las.`,scriptReadOnly:`O que o vídeo diz.`,noScript:`Ninguém fala neste vídeo.`,undo:`Desfazer`,redo:`Refazer`,undoWhat:e=>`Desfazer: ${e}`,redoWhat:e=>`Refazer: ${e}`,cutWords:`Cortar`,keepWords:`Manter`,noEdits:`Só é possível cortar palavras numa tomada cujo código indique um arquivo de cortes: peça ao agente para adicionar um.`,resizeScript:`Largura do roteiro`,resizeTimeline:`Altura da linha do tempo`}});function X(){return nt.of(c()?.locale)}var rt={...ee,...et};function it(e,t,n){return at(rt,e,t,n)}function at(e,t,n,r){let i=o(),[a,s]=(0,q.useState)(),c=JSON.stringify([t,n,...r]);return(0,q.useEffect)(()=>{if(n===void 0)return;let r=!0;return ne(e)(i,t,n).then(e=>{r&&s({key:c,data:e})},e=>{r&&s({key:c,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!1}},[i,c]),{data:a?.data,error:a?.key===c?a.error:void 0}}function ot(){let[e,t]=(0,q.useState)(0);return r(`project/changed`,e=>{t(e.revision)}),e}function st(){let e=o(),[t,n]=(0,q.useState)();return(0,q.useEffect)(()=>{let t=!0;return _e(e,`check/results`,{}).then(e=>{t&&n(t=>t??e)},()=>void 0),()=>{t=!1}},[e]),r(`check/changed`,n),t}function ct(e,t){let n=o(),[r,i]=(0,q.useState)();(0,q.useEffect)(()=>{let r=!0;return n[`storage/get`]({key:e}).then(n=>{r&&i({key:e,value:n.value===null?t:n.value})},()=>{r&&i({key:e,value:t})}),()=>{r=!1}},[n,e]);let a=(0,q.useCallback)(t=>{i({key:e,value:t}),n[`storage/set`]({key:e,value:t}).catch(()=>void 0)},[n,e]);return[r?.key===e?r.value:void 0,a]}async function lt(e,t){try{return(await e[`files/url`]({path:t})).url}catch{return}}var ut=O({t:k().nonnegative()});function dt(e){let t=ut.safeParse(e);return t.success?t.data:void 0}var ft=e=>({t:Math.round(Math.max(0,e)*1e3)/1e3});function pt(e,t){return e.versions.find(e=>e.key===t)??e.versions[0]}function mt(e,t,n){return e.filter(e=>e.piece===t&&(e.combo===void 0||n.lang===void 0||e.combo.lang===n.lang))}function ht(e,t){try{return new Intl.DisplayNames([t],{type:`language`}).of(e)??e}catch{return e}}var gt=e=>e.still;function _t(e){let t=e?.t;return typeof t==`number`&&Number.isFinite(t)&&t>=0?t:void 0}var vt=e=>e?.sound===!0,yt=(e,t)=>e.from<=t.to&&t.from<=e.to;function bt(e,t){let n=e.find(e=>e.path===t.path);if(!n||t.from===void 0)return;let r={from:t.from,to:t.to??t.from};if(n.music?.some(e=>yt(e,r)))return{music:!0};let i=n.parts.filter(e=>yt(e,r)).sort((e,t)=>e.to-e.from-(t.to-t.from))[0];if(!i)return;let a=i.layers?.findIndex(e=>yt(e,r))??-1,o=i.messages?.find(e=>yt(e,r))?.key,s=i.sounds!==void 0&&yt(i.sounds,r);return{part:i.key,...a>=0?{layer:a}:{},...o===void 0?{}:{message:o},...s?{sounds:s}:{}}}function xt(e,t){return e.parts.find(e=>e.speech?.edits===t)?.key}var St=new Set([`start`,`end`,`still`,`at`]);function Ct(e,t){let n=e.start;return JSON.stringify({part:{...e,steps:e.steps?.map(e=>e-n)},text:t},(e,t)=>typeof t==`number`&&St.has(e)?Math.round((t-n)*1e3)/1e3:t)}function wt(e,t){let n=new Map(e.timeline.parts.map(t=>[t.key,Ct(t,e.text.find(e=>e.key===t.key))]));return t.timeline.parts.filter(e=>n.get(e.key)!==Ct(e,t.text.find(t=>t.key===e.key))).map(e=>e.key)}function Tt(e,t,n={}){let r=e.parts.find(e=>e.key===t);if(r)return{t:gt(r),part:t,...n.layer===void 0?{}:{layer:n.layer},...n.message===void 0?{}:{message:n.message}}}function Et(e){let t=e.audio.music,n=e.audio.mix;return JSON.stringify({file:t?.file,from:t?.from,loop:t?.loop,bpm:t?.tempo?.source===`given`?t.tempo.bpm:void 0,gain:t?.gain?.map(e=>e.db),mix:n?{music:n.music,musicAlone:n.musicAlone,duck:n.duck,musicFade:n.musicFade}:void 0})}function Dt(e,t){return JSON.stringify(e.filter(e=>e.part===t.key).map(e=>({...e,t:Math.round((e.t-t.start)*1e3)/1e3})))}function Ot(e,t){let n=new Map(e.parts.map(t=>[t.key,Dt(e.cues,t)]));return{music:Et(e)!==Et(t),cues:t.parts.filter(e=>(n.get(e.key)??`[]`)!==Dt(t.cues,e)).map(e=>e.key)}}function kt(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&Mt(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46){if(r++,r<e.length&&Mt(e.charCodeAt(r)))for(r++;r<e.length&&Mt(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r)}let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101)){if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&Mt(e.charCodeAt(r))){for(r++;r<e.length&&Mt(e.charCodeAt(r));)r++;n=r}else d=3}return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
2
|
+
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r}else{if(a>=0&&a<=31){if(jt(a)){t+=e.substring(i,r),d=2;break}d=6}r++}}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(At(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(At(t));return o=15}if(jt(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
3
|
+
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!jt(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,jt(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!Mt(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(At(e)||jt(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function At(e){return e===32||e===9}function jt(e){return e===10||e===13}function Mt(e){return e>=48&&e<=57}var Nt;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(Nt||={});var Z=Array(20).fill(0).map((e,t)=>` `.repeat(t)),Pt=200,Ft={" ":{"\n":Array(Pt).fill(0).map((e,t)=>`
|
|
4
|
+
`+` `.repeat(t)),"\r":Array(Pt).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(Pt).fill(0).map((e,t)=>`\r
|
|
5
|
+
`+` `.repeat(t))}," ":{"\n":Array(Pt).fill(0).map((e,t)=>`
|
|
6
|
+
`+` `.repeat(t)),"\r":Array(Pt).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(Pt).fill(0).map((e,t)=>`\r
|
|
7
|
+
`+` `.repeat(t))}},It=[`
|
|
8
|
+
`,`\r`,`\r
|
|
9
|
+
`];function Lt(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!Vt(e,a-1);)a--;let c=s;for(;c<e.length&&!Vt(e,c);)c++;i=e.substring(a,c),r=zt(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=Bt(n,e),l=It.includes(c),u=0,d=0,f;f=n.insertSpaces?Z[n.tabSize||4]??Rt(Z[1],n.tabSize||4):` `;let p=f===` `?` `:` `,m=kt(i,!1),h=!1;function g(){if(u>1)return Rt(c,u)+Rt(f,r+d);let e=f.length*(r+d);return!l||e>Ft[p][c].length?c+Rt(f,r+d):e<=0?c:Ft[p][c][e]}function _(){let e=m.scan();for(u=0;e===15||e===14;)e===14&&n.keepLines?u+=1:e===14&&(u=1),e=m.scan();return h=e===16||m.getTokenError()!==0,e}let v=[];function y(n,r,i){!h&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&v.push({offset:r,length:i-r,content:n})}let b=_();if(n.keepLines&&u>0&&y(Rt(c,u),0,0),b!==17){let e=m.getTokenOffset()+a;y(f.length*r<20&&n.insertSpaces?Z[f.length*r]:Rt(f,r),a,e)}for(;b!==17;){let e=m.getTokenOffset()+m.getTokenLength()+a,t=_(),r=``,i=!1;for(;u===0&&(t===12||t===13);){let n=m.getTokenOffset()+a;y(Z[1],e,n),e=m.getTokenOffset()+m.getTokenLength()+a,i=t===12,r=i?g():``,t=_()}if(t===2)b!==1&&d--,n.keepLines&&u>0||!n.keepLines&&b!==1?r=g():n.keepLines&&(r=Z[1]);else if(t===4)b!==3&&d--,n.keepLines&&u>0||!n.keepLines&&b!==3?r=g():n.keepLines&&(r=Z[1]);else{switch(b){case 3:case 1:d++,r=n.keepLines&&u>0||!n.keepLines?g():Z[1];break;case 5:r=n.keepLines&&u>0||!n.keepLines?g():Z[1];break;case 12:r=g();break;case 13:u>0?r=g():i||(r=Z[1]);break;case 6:n.keepLines&&u>0?r=g():i||(r=Z[1]);break;case 10:n.keepLines&&u>0?r=g():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&u>0?r=g():(t===12||t===13)&&!i?r=Z[1]:t!==5&&t!==17&&(h=!0);break;case 16:h=!0}u>0&&(t===12||t===13)&&(r=g())}t===17&&(r=n.keepLines&&u>0?g():n.insertFinalNewline?c:``);let o=m.getTokenOffset()+a;y(r,e,o),b=t}return v}function Rt(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}function zt(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===Z[1])r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}function Bt(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
|
|
10
|
+
`?`\r
|
|
11
|
+
`:`\r`;if(n===`
|
|
12
|
+
`)return`
|
|
13
|
+
`}return e&&e.eol||`
|
|
14
|
+
`}function Vt(e,t){return`\r
|
|
15
|
+
`.indexOf(e.charAt(t))!==-1}var Ht;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Ht||={});function Ut(e,t=[],n=Ht.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}Gt(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:Kt(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function Wt(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function Gt(e,t,n=Ht.DEFAULT){let r=kt(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16)}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),k()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function O(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,k()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function k(){switch(r.getToken()){case 3:return O();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):k()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function Kt(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function qt(e,t,n,r){let i=t.slice(),a=Ut(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=Wt(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return Jt(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=Wt(o,[s]);if(t!==void 0){if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return Jt(e,{offset:i,length:a-i,content:``},r)}return Jt(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r)}{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return Jt(e,a,r)}}if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return Jt(e,i,r)}if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return Jt(e,i,r)}if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return Jt(e,t,r)}throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function Jt(e,t,n){if(!n.formattingOptions)return[t];let r=Yt(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!Vt(r,i-1);)i--;for(;a<r.length&&!Vt(r,a);)a++}let o=Lt(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=Yt(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function Yt(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var Xt;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Xt||={});var Zt;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(Zt||={});var Qt=Ut,$t=Wt,en;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(en||={});function tn(e,t,n,r){return qt(e,t,n,r)}function nn(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=Yt(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}function rn(e){let t=e.includes(`\r
|
|
16
|
+
`)?`\r
|
|
17
|
+
`:`
|
|
18
|
+
`,n=/\n([ \t]+)"/.exec(e)?.[1]??` `;return n.startsWith(` `)?{insertSpaces:!1,tabSize:1,eol:t}:{insertSpaces:!0,tabSize:n.length,eol:t}}var an=80;function on(e){if(Array.isArray(e))return`[${e.map(on).join(`, `)}]`;if(typeof e==`object`&&e){let t=Object.entries(e).map(([e,t])=>`${JSON.stringify(e)}: ${on(t)}`);return t.length?`{ ${t.join(`, `)} }`:`{}`}return JSON.stringify(e)}var sn={type:`object`,offset:0,length:0};function cn(e,t,n,r){let i=rn(e);if(t.length===0){let e=i.insertSpaces?i.tabSize:` `;return`${JSON.stringify(n,null,e)}${i.eol??`
|
|
19
|
+
`}`}let a=[...t],o=e.trim()===``?`{}
|
|
20
|
+
`:e,s=$t(Qt(o)??sn,a),c=s===void 0||!o.slice(s.offset,s.offset+s.length).includes(`
|
|
21
|
+
`);if(o=nn(o,tn(o,a,n,{formattingOptions:i,...r?{getInsertionIndex:r}:{}})),typeof n==`object`&&n&&c){let e=$t(Qt(o)??sn,a),t=on(n);if(e){let n=o.lastIndexOf(`
|
|
22
|
+
`,e.offset)+1;e.offset-n+t.length+1<=an&&(o=o.slice(0,e.offset)+t+o.slice(e.offset+e.length))}}return o}var ln=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function un(e){if(typeof e!=`object`||!e||Array.isArray(e))return`an edits file is a JSON object: { version: 1, remove, sounds, inWord, maxPause, pad }`;let t=e;if(t.version!==1)return`version is 1`;for(let e of[`take`,`$schema`])if(t[e]!==void 0&&typeof t[e]!=`string`)return`${e} is a string`;let n=Object.keys(t).filter(e=>![`version`,`remove`,`sounds`,`inWord`,`maxPause`,`pad`,`take`,`$schema`].includes(e));if(n.length>0)return`unknown field${n.length>1?`s`:``} ${n.join(`, `)} (an edits file has version, remove, sounds, inWord, maxPause, pad and take)`;let r={};if(t.remove!==void 0){if(!Array.isArray(t.remove))return`remove is a list of { from, to, text }`;let e=[];for(let[n,r]of t.remove.entries()){let t=r,i=t?.from,a=t?.to,o=t?.text;if(typeof i!=`number`||typeof a!=`number`||!Number.isInteger(i)||!Number.isInteger(a)||i<0||a<i||o!==void 0&&typeof o!=`string`)return`remove[${String(n)}] is not { from, to, text } with word indices from ≤ to`;e.push({from:i,to:a,...o===void 0?{}:{text:o}})}r.remove=e}for(let e of[`sounds`,`inWord`]){if(t[e]===void 0)continue;if(!Array.isArray(t[e]))return`${e} is a list of { from, to } in seconds of the take`;let n=[];for(let[r,i]of t[e].entries()){let t=i,a=t?.from,o=t?.to;if(!ln(a)||!ln(o)||o<=a)return`${e}[${String(r)}] is not { from, to } in seconds with from < to`;n.push({from:a,to:o})}r[e]=n}let i=t.maxPause;if(i!==void 0){if(typeof i!=`number`||!Number.isFinite(i)||i<.05||i>10)return`maxPause is seconds, from 0.05 to 10`;r.maxPause=i}let a=t.pad;if(a!==void 0){let e=a,t=typeof a==`object`&&e!==null&&!Array.isArray(a),n=t?Object.keys(e).filter(e=>e!==`before`&&e!==`after`):[],i=e=>e===void 0||ln(e)&&e<=2;if(!t||n.length>0||!i(e.before)||!i(e.after))return`pad is { before, after }: seconds of silence kept before and after each cut, each from 0 to 2`;let o=e.before,s=e.after;r.pad={...o===void 0?{}:{before:o},...s===void 0?{}:{after:s}}}return r}function dn(e,t){if(e.length===0)return 0;let n=e[0];if(!n||t<=n.t)return n?.db??0;for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];if(r&&i&&t<=i.t)return i.t===r.t?i.db:r.db+(i.db-r.db)*(t-r.t)/(i.t-r.t)}return e.at(-1)?.db??0}function fn(e,t){let n=e.speed??1,r=e.cuts&&e.cuts.length>0?e.cuts:[{at:e.start,from:e.from}];for(let i=0;i<r.length;i++){let a=r[i];if(!a)continue;let o=r[i+1]?.at??e.end,s=a.from+(o-a.at)*n;if(t>=a.from-1e-6&&t<s+1e-6)return a.at+(t-a.from)/n}}function pn(e,t){return(e?.remove??[]).some(e=>t>=e.from&&t<=e.to)}function mn(e,t,n){return e.parts.flatMap(e=>{let r=e.speech;if(!r)return[];let i=t.get(r.file);if(!i)return[];let[a,o]=r.words??[0,i.length-1],s=r.edits===void 0?void 0:n.get(r.edits),c=[];for(let e=a;e<=o&&e<i.length;e++){let t=i[e];if(!t)continue;let n=pn(s,e),a=n?void 0:fn(r,t.start),o=n?void 0:fn(r,Math.max(t.start,t.end-1e-4));c.push({i:e,text:t.text,start:t.start,end:t.end,removed:n,...a===void 0?{}:{film:a},...o===void 0?{}:{filmEnd:o}})}return[{part:e.key,title:e.title??e.key,file:r.file,...r.edits===void 0?{}:{edits:r.edits},words:c}]})}function hn(e){let t=[...e].sort((e,t)=>e.from-t.from),n=[];for(let e of t){let t=n.at(-1);t&&e.from<=t.to+1?(t.to=Math.max(t.to,e.to),delete t.text):n.push({...e})}return n}function gn(e,t,n){return e.slice(t,n+1).map(e=>e.text).join(` `)}function _n(e,t){return e.map(e=>({from:e.from,to:e.to,text:gn(t,e.from,e.to)}))}function vn(e,t,n,r){let[i,a]=t<=n?[t,n]:[n,t],o=_n(hn([...e?.remove??[],{from:i,to:a}]),r);return{version:1,...e??{},remove:o}}function yn(e,t,n,r){let[i,a]=t<=n?[t,n]:[n,t],o=[];for(let t of e?.remove??[])t.to<i||t.from>a?o.push(t):(t.from<i&&o.push({from:t.from,to:i-1}),t.to>a&&o.push({from:a+1,to:t.to}));let s={version:1,...e??{},remove:_n(hn(o),r)};return s.remove?.length===0&&delete s.remove,s}function bn(e,t){let n=e=>{let t=new Set;for(let n of e?.remove??[])for(let e=n.from;e<=n.to;e++)t.add(e);return t},r=n(e),i=n(t);return{cut:[...i].filter(e=>!r.has(e)).sort((e,t)=>e-t),kept:[...r].filter(e=>!i.has(e)).sort((e,t)=>e-t)}}var xn=/[.?!…。?!](["'”’)\]」』]*)$/u;function Sn(e){let t=[[]];for(let n of e)t.at(-1)?.push(n),xn.test(n.text)&&t.push([]);return t.length>1&&t.at(-1)?.length===0&&t.pop(),t}function Cn(e){if(e.trim()!==``)try{let t=un(JSON.parse(e));return typeof t==`string`?void 0:t}catch{return}}var wn=class{text;constructor(e){this.text=e}get list(){return Cn(this.text)}setRemove(e){let t=e?.length?e:void 0;this.text=this.text.trim()===``?`${JSON.stringify({version:1,...t?{remove:t}:{}},null,2)}\n`:cn(this.text,[`remove`],t)}take(e,t){let n=this.list?.remove,r=JSON.stringify(n)===JSON.stringify(Cn(t)?.remove);this.text=r||e.trim()===``?e:cn(e,[`remove`],n)}};function Tn(e){let t=o(),[n,r]=(0,q.useState)(0),i=(0,q.useCallback)(()=>{r(e=>e+1)},[]),a=(0,q.useRef)(void 0),s=(0,q.useRef)(void 0),c=(0,q.useRef)(new Map),l=(0,q.useRef)(new Map),[u,d]=(0,q.useState)();(0,q.useEffect)(()=>{if(e)return;let n=Ne.open(t,[]);a.current=n;let r=c.current,o=l.current,u;return n.then(e=>{s.current=e,u=e.onUndo(i),i()}),()=>{u?.(),a.current=void 0,s.current=void 0,r.clear(),o.clear(),n.then(e=>e.close())}},[t,e,i]);let f=(0,q.useCallback)(e=>{let t=a.current;if(t===void 0)return;let n=l.current.get(e);return n||(n=t.then(async t=>{let n=await t.add(e),r=c.current.get(e);if(r)return r;let a=new wn(n.text);return n.attach({save:()=>a.text===n.text?void 0:a.text,take:(t,n,r)=>{a.take(t,n),r?.kind===`agent`&&d({path:e,...bn(Cn(n),Cn(t))}),i()}}),c.current.set(e,a),i(),a}),l.current.set(e,n)),n},[i]),p=t=>{let n=c.current.get(t);if(!n)e||f(t);else return n.list},m=(t,n)=>{let r=s.current;!e&&r&&n.length!==0&&(async()=>{let e=[];for(let t of n){let n=f(t.path);if(n===void 0)return;e.push(n)}let a=await Promise.all(e),o=n.flatMap((e,t)=>{let n=a[t];if(!n)return[];let r=n.list?.remove,i=e.next(n.list).remove;return n.setRemove(i),{undo:()=>{n.setRemove(r)},redo:()=>{n.setRemove(i)}}});r.pushEdit({label:t,files:[...new Set(n.map(e=>e.path))],undo:()=>{for(let e of[...o].reverse())e.undo();i()},redo:()=>{for(let e of o)e.redo();i()}}),i()})()},h=s.current;return{listOf:p,apply:m,undo:()=>{s.current?.undo()},redo:()=>{s.current?.redo()},canUndo:h?.canUndo??!1,canRedo:h?.canRedo??!1,undoLabel:h?.undoLabel,redoLabel:h?.redoLabel,tick:n,byAgent:u}}var En=(e,t)=>({...e,outline:e.outline.map(e=>e.map(e=>({x:(e.x-t.x)/t.width,y:(e.y-t.y)/t.height})))}),Dn=(e,t)=>({...e,outline:e.outline.map(e=>e.map(e=>({x:t.x+e.x*t.width,y:t.y+e.y*t.height})))}),On=e=>e.outline.map(e=>`M${e.map(e=>`${String(e.x)} ${String(e.y)}`).join(`L`)}Z`).join(``),kn=(e,t)=>e!==void 0&&On(e)===On(t);function An({moment:e,box:t,pick:n,label:r,ref:i}){let[a,o]=(0,q.useState)(),[s,c]=(0,q.useState)(),l=t=>t?.moment===e?t.layer:void 0,u=l(s),d=l(a);(0,q.useImperativeHandle)(i,()=>({selected:()=>{let e=t();return u&&e?Dn(u,e):void 0}}),[u]);let f=(0,q.useRef)({busy:!1,over:!1}),p=(0,q.useRef)(!0);(0,q.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=async e=>{let r=t(),i=r?await n(e):void 0;return i&&r?En(i,r):void 0},h=t=>{let n=f.current;if(n.over=t!==void 0,t===void 0){delete n.next,o(void 0);return}if(n.next=t,n.busy)return;n.busy=!0;let r=()=>{let t=n.next;delete n.next,t===void 0?n.busy=!1:m(t).then(t=>{p.current&&(n.over&&o(t?{layer:t,moment:e}:void 0),r())})};r()},g=u!==void 0;(0,q.useEffect)(()=>{if(!g)return;let e=e=>{e.key===`Escape`&&c(void 0)};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[g]);let _=u?(e=>{let t=e.outline.flat(),n=t.map(e=>e.x),r=t.map(e=>e.y);return{centre:(Math.min(...n)+Math.max(...n))/2,bottom:Math.max(...r)}})(u):void 0;return(0,J.jsxs)(`div`,{role:`application`,"aria-label":r,"data-testid":`stage-select`,className:`absolute inset-0`,onPointerMove:e=>{e.buttons===0&&h({x:e.clientX,y:e.clientY})},onPointerLeave:()=>{h(void 0)},onPointerDown:t=>{if(t.button!==0&&t.button!==2)return;let n=t.button===2;m({x:t.clientX,y:t.clientY}).then(t=>{p.current&&(t?c({layer:t,moment:e}):n||c(void 0))})},children:[(0,J.jsxs)(`svg`,{"aria-hidden":!0,"data-note-chrome":``,viewBox:`0 0 1 1`,preserveAspectRatio:`none`,className:`pointer-events-none absolute inset-0 size-full overflow-visible`,children:[d&&!kn(u,d)?(0,J.jsxs)(`g`,{"data-testid":`stage-hovered`,children:[(0,J.jsx)(`path`,{d:On(d),vectorEffect:`non-scaling-stroke`,className:`stroke-sheet/80 fill-none stroke-[3px]`}),(0,J.jsx)(`path`,{d:On(d),vectorEffect:`non-scaling-stroke`,className:`stroke-pencil fill-none stroke-1`})]}):null,u?(0,J.jsxs)(`g`,{"data-testid":`stage-selected`,children:[(0,J.jsx)(`path`,{d:On(u),vectorEffect:`non-scaling-stroke`,className:`stroke-sheet fill-none stroke-[5px]`}),(0,J.jsx)(`path`,{d:On(u),vectorEffect:`non-scaling-stroke`,className:`stroke-pencil fill-none stroke-2`})]}):null]}),_?(0,J.jsx)(`div`,{className:`absolute mt-2 -translate-x-1/2`,style:{left:`${String(_.centre*100)}%`,top:`${String(Math.min(1,_.bottom)*100)}%`},children:(0,J.jsx)(fe,{})}):null]})}function jn(e,t){return`${e.file===void 0?e.key===void 0?`the ${e.layer} layer`:`layer ${JSON.stringify(e.key)} (${e.layer})`:`the footage ${e.file}`}${e.name===void 0||e.name===e.key?``:`, at ${JSON.stringify(e.name)} in it,`} of ${t} ${e.part}`}function Mn(e){if(typeof e==`object`&&e&&e.allyhub===!0&&typeof e.type==`string`)return e}function Nn(e,t){e?.postMessage({allyhub:!0,...t},`*`)}function Pn(e,t,n,r,i=window){if(!e||t.width===0||t.height===0)return Promise.resolve([]);let a=crypto.randomUUID();return new Promise(o=>{let s=e=>{clearTimeout(l),i.removeEventListener(`message`,c),o(e)},c=t=>{if(t.source!==e)return;let n=Mn(t.data);n?.type===`located`&&n.id===a&&s(n.layers)},l=setTimeout(()=>{s([])},r);i.addEventListener(`message`,c),Nn(e,{type:`locate`,id:a,mark:v(n,({x:e,y:n})=>({x:(e-t.x)/t.width,y:(n-t.y)/t.height}))})})}function Fn(e,t,n,r,i=window){if(!e||t.width===0||t.height===0)return Promise.resolve(void 0);let a=crypto.randomUUID();return new Promise(o=>{let s=e=>{clearTimeout(l),i.removeEventListener(`message`,c),o(e&&{...e,outline:e.outline.map(e=>e.map(e=>({x:t.x+e.x*t.width,y:t.y+e.y*t.height})))})},c=t=>{if(t.source!==e)return;let n=Mn(t.data);n?.type===`picked`&&n.id===a&&s(n.picked)},l=setTimeout(()=>{s(void 0)},r);i.addEventListener(`message`,c),Nn(e,{type:`pick`,id:a,at:{x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}})})}function In(e,t,n){let r=new Map(t.map(e=>[e.key,e])),i=e.parts.flatMap(e=>{let t=e.speech;if(!t)return[];let n=r.get(e.key);return[{...n?.speechKey===void 0?{}:{key:n.speechKey},part:e.key,start:t.start,end:t.end,text:n?.spoken??``,file:t.file,from:t.from,speed:t.speed??1,...t.cuts?{cuts:t.cuts}:{}}]}),a=n?.music,o;if(a&&a.segments.length>0){let t=a.segments[0],n=a.segments.at(-1),r=Math.min(e.duration,a.until??(n?n.at+n.dur:e.duration)),i=[];for(let e=1;e<a.duck.length;e++){let t=a.duck[e-1],n=a.duck[e];if(t&&n&&t.db<0&&n.db<0){let e=i.at(-1);e&&Math.abs(e.end-t.t)<1e-9?e.end=n.t:i.push({start:t.t,end:n.t})}}o={file:a.file,start:t?.at??0,end:r,stretches:a.segments.map(e=>({at:e.at,from:e.from,dur:e.dur})),ducked:i,duck:a.duck,fadeIn:a.fadeIn,fadeOut:a.fadeOut}}return{cues:e.cues,speech:i,music:o}}function Ln(e,t){if(t<e.start||t>=e.end)return;let n=e.start,r=e.from;for(let i of e.cuts??[]){if(i.at>t)break;n=i.at,r=i.from}return r+(t-n)*e.speed}function Rn(e,t){for(let n=e.stretches.length-1;n>=0;n--){let r=e.stretches[n];if(r&&t>=r.at&&t<r.at+r.dur)return r.from+(t-r.at)}}function zn(e,t){let n=10**(dn(e.duck,t)/20);return e.fadeIn>0&&t-e.start<e.fadeIn&&(n*=Math.max(0,t-e.start)/e.fadeIn),e.fadeOut>0&&e.end-t<e.fadeOut&&(n*=Math.max(0,e.end-t)/e.fadeOut),Math.max(0,n)}function Bn(e){let t=new Set((e.index??[]).filter(e=>e.matte===!0).map(e=>e.file));return e.parts.flatMap(n=>{let r=(e.footage??[]).find(e=>e.part===n.key&&t.has(e.file));return r?[{part:n.key,file:r.file}]:[]})}var Vn=48,Hn=20,Un=`allyhub.video.volume`;function Wn(){try{let e=JSON.parse(localStorage.getItem(Un)??`null`);if(typeof e==`object`&&e&&`level`in e&&typeof e.level==`number`&&`muted`in e&&typeof e.muted==`boolean`)return{level:Math.min(1,Math.max(0,e.level)),muted:e.muted}}catch{}return{level:1,muted:!1}}var Gn=e=>e.muted?0:e.level,Kn=1e3,qn=20,Jn=1500,Yn=15e3,Xn=1500,Zn=300,Qn=e=>({timeline:e.timeline,texts:e.text,uncut:Bn(e.timeline)});function $n({item:e,version:t,revision:n,width:r,height:s,start:u,overlay:p,onLoaded:m,onError:g,onState:_,timelineOpen:v,onTimelineOpen:y,ref:b}){let x=X(),S=o(),C=(0,q.useRef)(null),w=(0,q.useRef)(new Map),[T,E]=(0,q.useState)(),[D,O]=(0,q.useState)(),[k,ee]=(0,q.useState)(),[A,j]=(0,q.useState)(),[te,M]=(0,q.useState)(),[N,ne]=(0,q.useState)(!1),[re,ie]=(0,q.useState)(),P=a(re),[F,I]=(0,q.useState)({t:u?.t??0,part:void 0,playing:!1}),[ae,oe]=(0,q.useState)(Wn),se=(0,q.useRef)(ae),[ce,le]=(0,q.useState)(0),[de,fe]=(0,q.useState)(),pe=(0,q.useRef)(1),me=(0,q.useRef)(void 0),he=(0,q.useRef)(!1),R=(0,q.useCallback)(e=>{let t=ft(e);me.current!==t.t&&(me.current=t.t,S[`editor/place`]({place:t}).catch(()=>void 0))},[S]),z=(0,q.useRef)({shown:T,pending:D,play:F,view:A,onLoaded:m,onError:g,onState:_});(0,q.useEffect)(()=>{z.current={shown:T,pending:D,play:F,view:A,onLoaded:m,onError:g,onState:_}});let B=e=>e===void 0?void 0:C.current?.querySelector(`iframe[data-frame="${String(e.id)}"]`)?.contentWindow,V=e=>{Nn(B(z.current.shown),e)};(0,q.useImperativeHandle)(b,()=>({seek:e=>{V({type:`seek`,t:e}),R(e)},play:()=>{V({type:`play`})},pause:()=>{V({type:`pause`})},objects:e=>new Promise(t=>{let n=setTimeout(()=>{w.current.delete(e),t(void 0)},Xn);w.current.set(e,e=>{clearTimeout(n),t(e)}),V({type:`objects`,t:e})})}));let ge=n=>tt(S,`video/stage`,{item:e,version:t,start:n,chrome:!1}).then(e=>(ie(e.probe),e.url)),_e=`${e}\n${t}`,ve=(0,q.useRef)(e);(0,q.useEffect)(()=>{let{shown:t,play:n}=z.current,r=ve.current===e;ve.current=e;let i={t:0},a=t?r?{t:n.t}:i:u??i,o=!0;return ge(a).then(e=>{o&&(E({id:pe.current++,src:e}),O(void 0),ee(void 0),M(void 0))},e=>{if(!o)return;let t=e instanceof Error?e.message:String(e);M(t),z.current.onError?.(t)}),()=>{o=!1}},[_e]);let ye=(0,q.useRef)(n);(0,q.useEffect)(()=>{if(n===ye.current)return;ye.current=n;let{shown:e,play:t,view:r}=z.current;if(!e)return;let i=r?.timeline.parts.find(e=>t.t>=e.start&&t.t<e.end),a=i?{t:t.t,part:i.key,offset:t.t-i.start,dur:i.end-i.start}:{t:t.t},o=!0;return ge(a).then(e=>{o&&O({id:pe.current++,src:e,from:t.t})},e=>{o&&z.current.onError?.(e instanceof Error?e.message:String(e))}),()=>{o=!1}},[n]),(0,q.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{ee(void 0)},Zn);return()=>{clearTimeout(e)}},[k]),(0,q.useEffect)(()=>{if(!D)return;let e=setTimeout(()=>{O(void 0),z.current.onError?.(x.loadFailed)},Yn);return()=>{clearTimeout(e)}},[D,x.loadFailed]),(0,q.useEffect)(()=>{let e=e=>{let t=Mn(e.data);if(!t)return;let{shown:n,pending:r}=z.current,i=[n,r].find(t=>t!==void 0&&B(t)===e.source);if(!i)return;let a=i.id===r?.id;if(t.type===`objects`){if(a)return;w.current.get(t.t)?.(t),w.current.delete(t.t);let n=z.current.play.t;Math.abs(t.t-n)>1e-6&&Nn(e.source,{type:`seek`,t:n})}else if(t.type===`sound`)i.denoising=t.denoising,a||ne(t.denoising);else if(t.type===`loaded`){Nn(e.source,{type:`volume`,level:Gn(se.current)});let n={kind:t.kind,timeline:t.timeline,text:t.text,reads:t.reads,problems:t.problems,mix:t.mix};if(a){i.loaded=n;return}j(Qn(n)),M(void 0),z.current.onLoaded?.(n)}else if(t.type===`error`)a?O(void 0):M(t.message),z.current.onError?.(t.message);else if(t.type===`time`){if(a){if(!i.loaded)return;ee(n&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?n:void 0),E(i),O(void 0),le(e=>e+1),ne(i.denoising===!0),j(Qn(i.loaded)),M(void 0),z.current.onLoaded?.(i.loaded);let t=z.current.play.t;if(i.from!==void 0&&Math.abs(t-i.from)>1e-6){Nn(e.source,{type:`seek`,t});return}}let r={t:t.t,part:t.part,playing:t.playing};r.playing&&he.current||R(r.t),he.current=r.playing,fe(i.id),I(r),z.current.onState?.(r)}};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[R]);let H=A?.timeline,[U,be]=H?[H.width,H.height]:[r,s],xe=A?.uncut.find(e=>e.part===F.part);(0,q.useEffect)(()=>{se.current=ae,V({type:`volume`,level:Gn(ae)});try{localStorage.setItem(Un,JSON.stringify(ae))}catch{}},[ae]);let Se=F.playing;(0,q.useEffect)(()=>{if(H===void 0)return;let e=1/H.fps,t=Math.max(0,H.duration-e),n=e=>{let n=Math.min(Math.max(Ye(e,H.fps),0),t);Nn(B(z.current.shown),{type:`seek`,t:n}),R(n)},r=r=>{if(r.metaKey||r.ctrlKey||r.altKey||r.defaultPrevented)return;let i=r.target;if(i instanceof HTMLElement&&(i.isContentEditable||i.closest(`input,textarea,select,button,a,[role=slider],[role=menuitem],[role=dialog]`)))return;let a=z.current.play.t,o=r.key.length===1?r.key.toLowerCase():r.key;if(o===` `||o===`k`)Nn(B(z.current.shown),{type:Se?`pause`:`play`});else if(o===`ArrowLeft`)n(a-e);else if(o===`ArrowRight`)n(a+e);else if(o===`Home`)n(0);else if(o===`End`)n(t);else if(o===`m`)oe(e=>({...e,muted:!e.muted}));else return;r.preventDefault()};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r)}},[Se,H,R]);let Ce=e=>{V({type:`seek`,t:e}),R(e)},we=(e,t)=>(0,J.jsx)(`iframe`,{"data-frame":e.id,src:e.src,title:x.previewTitle,...P?{sandbox:`allow-scripts`}:{},allow:`autoplay`,"data-testid":t===`shown`?`stage`:t===`pending`?`stage-pending`:`stage-leaving`,className:h(`absolute -inset-0.5 size-[calc(100%+4px)] border-0`,t===`pending`&&`pointer-events-none opacity-0`,t===`leaving`&&`ak-stage-leaving pointer-events-none z-[1]`)},e.id),Te=H?`bg-background`:`bg-black`,Ee=()=>{let e=C.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0},De=ue()!==void 0,Oe=(0,q.useRef)(null),ke=c()?.item.entry,Ae=e=>{let t=e.piece??ke;return{name:jn(e,`part`),...t===void 0?{}:{source:{path:t}},...e.text===void 0?{}:{text:e.text}}},W=()=>{let{t:e,part:t}=z.current.play;return`on the picture at ${e.toFixed(2)} s${t===void 0?``:`, in the part ${t}`}`},G=e=>({element:Ae(e),outline:e.outline,where:W()}),K=e=>{let t=Ee();return t?Fn(B(z.current.shown),t,e,Jn):Promise.resolve(void 0)},je=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`absolute inset-0 isolate`,children:[k&&P!==void 0?we(k,`leaving`):null,T&&P!==void 0?we(T,`shown`):null,D&&P!==void 0?we(D,`pending`):null]}),De&&T&&H&&!F.playing&&F.t>=.05?(0,J.jsx)(An,{ref:Oe,moment:`${String(T.id)}@${F.t.toFixed(4)}`,box:Ee,pick:K,label:x.previewTitle}):null,H||te!==void 0?null:(0,J.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,J.jsx)(Ge,{label:x.loading,className:`[&>span]:bg-on-media/80`})}),N?(0,J.jsx)(`span`,{className:`bg-background/90 text-muted-foreground absolute top-2 right-2 rounded-sm px-2 py-0.5 font-mono text-micro`,"data-testid":`denoising`,children:x.denoising}):null,H?(0,J.jsx)(`span`,{"aria-hidden":!0,"data-testid":`play-affordance`,"data-shown":!F.playing&&F.t<.05?``:void 0,className:`bg-foreground/92 text-background pointer-events-none absolute top-1/2 left-1/2 flex size-14 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md opacity-0 transition-opacity data-[shown]:opacity-100`,children:(0,J.jsx)(L,{className:`size-6 translate-x-px fill-current`})}):null,xe?(0,J.jsx)(`span`,{className:`bg-background/90 text-muted-foreground absolute top-2 left-2 max-w-[calc(100%-1rem)] rounded-sm px-2 py-0.5 font-mono text-micro`,"data-testid":`uncut`,children:x.uncut(xe.file)}):null,p]}),Me=de!==void 0&&de===T?.id,Ne=async()=>{V({type:`pause`});let e=Date.now()+Kn;for(;z.current.play.playing&&Date.now()<e;)await new Promise(e=>{setTimeout(e,qn)})};i({hold:async()=>{await Ne();let{t:n,part:r}=z.current.play;return{key:`${e}@${t}@${n.toFixed(3)}@${String(z.current.shown?.id??0)}`,what:`The video ${e}, version ${t}, at ${n.toFixed(2)} s${r===void 0?``:`, in the part ${r}`}`,...ke===void 0?{}:{source:{path:ke}}}},locate:e=>{let t=Ee(),n=f(e)[0],r=t!==void 0&&n!==void 0&&n.x>=t.x&&n.x<=t.x+t.width&&n.y>=t.y&&n.y<=t.y+t.height,i=[...document.querySelectorAll(`[data-row]`)].filter(t=>d(e,t.getBoundingClientRect())).map(e=>({name:`the ${e.dataset.row??``} row of the timeline`}));return Promise.resolve({elements:i,...r?{}:{where:`on the timeline`}})},selected:()=>{let e=Oe.current?.selected();return Promise.resolve(e?[G(e)]:[])}}),l({element:()=>T?C.current:void 0,pictures:async()=>{let n=Ee();if(!n)return[];let r=await tt(S,`video/still`,{item:e,version:t,t:z.current.play.t}).catch(()=>void 0);return r?[{rect:n,mime:r.image.mime,data:r.image.data}]:[]},locate:async e=>{let t=Ee(),{t:n,part:r}=z.current.play;return{elements:(t?await Pn(B(z.current.shown),t,e,Jn):[]).map(Ae),where:`on the picture at ${n.toFixed(2)} s${r===void 0?``:`, in the part ${r}`}`}},pick:async e=>{let t=await K(e);return t?G(t):void 0}});let Pe=!v,Fe=Vn+(Pe?Hn:0)+3,Ie=`min(100cqw - 2px, (100cqh - ${String(Fe)}px) * ${String(U/be)})`;return(0,J.jsx)(`div`,{className:`flex h-full min-h-0 flex-col gap-2`,"data-testid":`video-preview`,"data-t":F.t.toFixed(4),"data-ready":Me?``:void 0,"data-swaps":ce,children:(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center [container-type:size]`,children:(0,J.jsxs)(`div`,{className:`box-content overflow-hidden border shadow-[0_1px_2px_rgb(0_0_0/0.06),0_14px_36px_-14px_rgb(0_0_0/0.22)]`,style:{width:Ie},"data-testid":`player`,children:[(0,J.jsx)(`div`,{ref:C,className:h(`relative mx-auto overflow-hidden`,Te),style:{width:Ie,height:`calc(${Ie} * ${String(be/U)})`},children:je}),H?(0,J.jsx)(tr,{timeline:H,state:F,folded:Pe,volume:ae,onVolume:oe,onOpen:y,onToggle:()=>{V({type:F.playing?`pause`:`play`})},onSeek:Ce}):(0,J.jsx)(`div`,{className:`border-t`,style:{height:Fe-3}})]})})})}var er=2;function tr({timeline:e,state:t,folded:n,volume:r,onVolume:i,onOpen:a,onToggle:o,onSeek:s}){let c=X(),{duration:l,fps:u}=e,d=Math.max(0,l-1/u),f=e=>{s(Math.min(Math.max(Ye(e,u),0),d))},p=(e,t,n,r,i)=>(0,J.jsx)(g,{size:`icon-sm`,variant:`ghost`,className:h(`text-muted-foreground`,i.className),"aria-label":e,title:c.withKey(e,t),"data-testid":i.testid,onClick:r,children:n});return(0,J.jsxs)(`div`,{className:`border-t [container-type:inline-size]`,"data-testid":`transport`,children:[n?(0,J.jsx)(`div`,{className:`px-3 pt-1`,style:{height:Hn},children:(0,J.jsx)(rr,{timeline:e,state:t,onSeek:s})}):null,(0,J.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-2 px-3`,style:{height:Vn},children:[(0,J.jsxs)(`span`,{className:`min-w-0 justify-self-start truncate font-mono text-xs tabular-nums`,"data-testid":`clock`,children:[Y(Math.min(t.t,l)),(0,J.jsxs)(`span`,{className:`text-muted-foreground @max-[18rem]:hidden`,children:[` / `,Y(l)]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[p(c.toStart,c.keys.home,(0,J.jsx)(Re,{}),()=>{f(0)},{testid:`to-start`,className:`@max-[22rem]:hidden`}),p(c.frameBack,`←`,(0,J.jsx)(ze,{}),()=>{f(t.t-1/u)},{testid:`frame-back`,className:`@max-[22rem]:hidden`}),(0,J.jsx)(g,{size:`icon`,className:`mx-1 rounded-full`,"aria-label":t.playing?c.pause:c.play,title:c.withKey(t.playing?c.pause:c.play,c.keys.space),"data-testid":`play`,onClick:o,children:t.playing?(0,J.jsx)(Ie,{className:`fill-current`}):(0,J.jsx)(L,{className:`translate-x-px fill-current`})}),p(c.frameForward,`→`,(0,J.jsx)(Be,{}),()=>{f(t.t+1/u)},{testid:`frame-forward`,className:`@max-[22rem]:hidden`})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-0.5 justify-self-end`,children:[(0,J.jsx)(nr,{volume:r,onVolume:i}),n?(0,J.jsx)(g,{size:`icon-sm`,variant:`ghost`,className:`text-muted-foreground -mr-1`,"aria-label":c.showTimeline,title:c.showTimeline,"aria-expanded":!1,"data-testid":`timeline-toggle`,onClick:()=>{a(!0)},children:(0,J.jsx)(Se,{})}):null]})]})]})}function nr({volume:e,onVolume:t}){let n=X(),r=Gn(e),i=r===0?Ue:r<.5?He:Ve,a=e.muted?n.unmute:n.mute;return(0,J.jsxs)(`div`,{className:`group/volume flex items-center`,"data-testid":`volume`,children:[(0,J.jsx)(`input`,{type:`range`,min:0,max:100,step:1,value:Math.round(r*100),"aria-label":n.volume,"data-testid":`volume-slider`,className:`accent-foreground h-1 w-0 cursor-pointer opacity-0 group-focus-within/volume:mr-1 group-focus-within/volume:w-20 group-focus-within/volume:opacity-100 group-hover/volume:mr-1 group-hover/volume:w-20 group-hover/volume:opacity-100 motion-safe:transition-[width,opacity,margin] motion-safe:duration-150`,onChange:e=>{let n=Number(e.currentTarget.value)/100;t({level:n,muted:n===0})}}),(0,J.jsx)(g,{size:`icon-sm`,variant:`ghost`,className:`text-muted-foreground`,"aria-label":a,title:n.withKey(a,`M`),"aria-pressed":e.muted,"data-testid":`mute`,onClick:()=>{t(e.muted&&e.level===0?{level:1,muted:!1}:{...e,muted:!e.muted})},children:(0,J.jsx)(i,{})})]})}function rr({timeline:e,state:t,onSeek:n}){let r=X(),{duration:i,fps:a}=e,o=Math.max(0,i-1/a),s=e.parts.length?e.parts.map((e,t)=>({key:e.key,name:e.title??String(t+1),start:e.start,end:e.end})):[{key:``,name:``,start:0,end:i}],c=(s.length-1)*er,[l,u]=(0,q.useState)(),[d,f]=(0,q.useState)(),p=Math.min(l??t.t,i),m=e=>Math.max(0,s.findIndex((t,n)=>n===s.length-1||e<t.end)),h=s[m(p)],g=e=>{let t=e.currentTarget.getBoundingClientRect(),n=Math.min(t.width,Math.max(0,e.clientX-t.left)),r=Math.max(1,t.width-c),l=0,u=i;for(let e of s){let t=r*(e.end-e.start)/Math.max(i,1e-6);if(n<=l+t+er/2){let r=Math.min(1,Math.max(0,(n-l)/Math.max(t,1)));u=e.start+r*(e.end-e.start);break}l+=t+er}return{x:n,t:Math.min(Math.max(Ye(u,a),0),o)}},_=e=>{n(Math.min(Math.max(Ye(e,a),0),o))},v=d?s[m(d.t)]?.name:void 0;return(0,J.jsxs)(`div`,{role:`slider`,tabIndex:0,"aria-label":r.seek,"aria-valuemin":0,"aria-valuemax":Math.round(i*100)/100,"aria-valuenow":Math.round(p*100)/100,"aria-valuetext":r.timeOf(Y(p),Y(i),h?.name??``),"data-testid":`scrubber`,className:`group/scrub focus-visible:outline-ring relative h-6 min-w-0 flex-1 cursor-pointer touch-none rounded-sm outline-none focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId);let t=g(e);u(t.t),f(t),n(t.t)},onPointerMove:e=>{let t=g(e);f(t),l!==void 0&&t.t!==l&&(u(t.t),n(t.t))},onPointerUp:()=>{u(void 0)},onPointerCancel:()=>{u(void 0)},onPointerLeave:()=>{f(void 0)},onKeyDown:e=>{if(e.key===`ArrowLeft`)_(t.t-1);else if(e.key===`ArrowRight`)_(t.t+1);else if(e.key===`Home`)_(0);else if(e.key===`End`)_(o);else return;e.preventDefault()},children:[(0,J.jsx)(`div`,{className:`absolute inset-x-0 top-1/2 flex h-1 -translate-y-1/2 transition-[height] duration-100 group-hover/scrub:h-1.5`,style:{gap:er},children:s.map(e=>{let t=Math.max(e.end-e.start,1e-6),n=Math.min(1,Math.max(0,(p-e.start)/t));return(0,J.jsx)(`span`,{"data-chapter":e.key,className:`bg-rule-strong relative min-w-0 overflow-hidden`,style:{flexGrow:t,flexBasis:0},children:(0,J.jsx)(`span`,{className:`bg-foreground absolute inset-y-0 left-0`,style:{width:`${String(n*100)}%`}})},e.key)})}),(0,J.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground ring-background pointer-events-none absolute top-1/2 h-3 w-[3px] -translate-x-1/2 -translate-y-1/2 ring-1`,style:{left:`calc((100% - ${String(c)}px) * ${String(p/Math.max(i,1e-6))} + ${String(m(p)*er)}px)`}}),d?(0,J.jsxs)(`span`,{role:`tooltip`,"data-testid":`scrub-tip`,className:`bg-popover text-popover-foreground shadow-overlay pointer-events-none absolute bottom-full z-10 mb-1.5 flex max-w-[16rem] -translate-x-1/2 items-baseline gap-2 rounded-sm px-2 py-1 whitespace-nowrap`,style:{left:d.x},children:[v?(0,J.jsx)(`span`,{className:`truncate font-serif text-dense`,children:v}):null,(0,J.jsx)(`span`,{className:`text-muted-foreground font-mono text-micro tabular-nums`,children:Y(d.t)})]}):null]})}var ir={error:0,warn:1};function ar(e){let t=new Set;return[...e].sort((e,t)=>ir[e.level]-ir[t.level]).filter(e=>{let n=`${e.code}\u0000${e.message}\u0000${e.where?.file??``}`;return!t.has(n)&&(t.add(n),!0)})}function or(e){return{shown:ar(e.filter(e=>e.ofPage!==!0)),simpler:e.some(e=>e.ofPage===!0)}}function sr({error:e,problems:t,compact:n}){let r=X(),[i,a]=(0,q.useState)(!1),{shown:o,simpler:s}=or(t);return e===void 0?!o.length&&!s?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`pointer-events-none absolute bottom-2 left-2 z-20 flex max-w-[calc(100%-1rem)] items-center gap-2`,children:[o.length>0&&(0,J.jsxs)(g,{variant:`secondary`,size:`xs`,className:`bg-background/90 text-foreground pointer-events-auto h-auto gap-1.5 rounded-sm px-2 py-1 font-mono text-micro font-normal has-[>svg]:px-2`,onClick:()=>{a(!i)},"aria-expanded":i,"data-testid":`problems-chip`,children:[(0,J.jsx)(V,{className:h(`size-3.5`,o.some(e=>e.level===`error`)?`text-problem-text`:`text-caution-text`)}),r.problemsHere(o.length)]}),s&&(0,J.jsx)(`span`,{className:`bg-background/80 text-muted-foreground truncate rounded-sm px-2 py-1 text-micro`,"data-testid":`preview-simpler`,children:r.previewSimpler})]}),i&&o.length>0?(0,J.jsxs)(`div`,{className:`bg-card absolute bottom-10 left-2 z-30 flex max-h-[60%] w-[min(420px,calc(100%-1rem))] flex-col rounded-md border shadow-[var(--allyhub-shadow-overlay)]`,"data-testid":`problems`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-end border-b px-1 py-1`,children:(0,J.jsx)(g,{size:`icon-xs`,variant:`ghost`,"aria-label":r.close,onClick:()=>{a(!1)},children:(0,J.jsx)(p,{})})}),(0,J.jsx)(`ul`,{className:`divide-y overflow-y-auto`,children:o.map((e,t)=>(0,J.jsxs)(`li`,{"data-code":e.code,className:`px-3 py-2 text-sm leading-relaxed`,children:[(0,J.jsxs)(`span`,{className:`text-muted-foreground mr-2 font-mono text-micro`,children:[e.level===`error`?r.levelError:r.levelWarn,` ·`,` `,e.code]}),e.message]},`${e.code}-${String(t)}`))})]}):null]}):(0,J.jsx)(`div`,{className:h(`z-20 overflow-auto text-left`,n?`bg-background/94 absolute inset-x-0 bottom-0 max-h-[45%] border-t px-4 py-3`:`bg-background/96 absolute inset-0 grid content-center justify-items-center p-5 text-center`),"data-testid":`stage-overlay`,"data-compact":n?`true`:void 0,role:`alert`,children:(0,J.jsxs)(`p`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,J.jsx)(V,{className:`text-problem-text size-4`,"aria-hidden":!0}),n?r.previewFailedKept:r.previewFailed]})})}function cr(e){let t=(0,q.useRef)(void 0),n=t=>Math.round(Math.max(e.min,Math.min(e.max,t))),r=e.orientation===`vertical`,i=e.after===!0?-1:1,a=e=>r?e.clientX:e.clientY,[o,s]=r?[`ArrowLeft`,`ArrowRight`]:[`ArrowUp`,`ArrowDown`];return(0,J.jsx)(`div`,{role:`separator`,"aria-orientation":e.orientation,"aria-label":e.label,"aria-valuenow":e.value,"aria-valuemin":e.min,"aria-valuemax":e.max,tabIndex:0,"data-testid":e.testid,className:r?`group relative z-30 w-px shrink-0 cursor-col-resize bg-border outline-none before:absolute before:inset-y-0 before:-inset-x-1.5 before:content-['']`:`group relative z-30 h-px shrink-0 cursor-row-resize bg-border outline-none before:absolute before:-inset-y-1.5 before:inset-x-0 before:content-['']`,onPointerDown:n=>{t.current={at:a(n),value:e.value},n.currentTarget.setPointerCapture(n.pointerId)},onPointerMove:r=>{let o=t.current;o&&e.onChange(n(o.value+i*(a(r)-o.at)))},onPointerUp:()=>{t.current=void 0},onKeyDown:t=>{let r=(t.shiftKey?40:8)*i;if(t.key===s)e.onChange(n(e.value+r));else if(t.key===o)e.onChange(n(e.value-r));else return;t.preventDefault()},children:(0,J.jsx)(`span`,{"aria-hidden":!0,className:`group-hover:bg-rule-strong group-focus-visible:bg-pencil pointer-events-none absolute inset-0`})})}function lr(e,t,n,r=4){let i=e.map(({x:e,width:n},r)=>{let i=e+n>t&&e-n>=0?`before`:`after`;return i===`after`?{i:r,side:i,from:e,to:e+n}:{i:r,side:i,from:e-n,to:e}}),a=[],o=e.map(()=>null);for(let e of[...i].sort((e,t)=>e.from-t.from||e.i-t.i)){let t=0;for(;t<n&&(a[t]??-1/0)+r>e.from;)t++;t!==n&&(a[t]=e.to,o[e.i]={lane:t,side:e.side})}return o}var ur=.01,dr=new Map;async function fr(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.arrayBuffer(),r=await new OfflineAudioContext(1,1,44100).decodeAudioData(n),i=r.sampleRate/50,a=Math.ceil(r.length/i),o=new Float32Array(a),s=0;for(let e=0;e<r.numberOfChannels;e++){let t=r.getChannelData(e);for(let e=0;e<a;e++){let n=Math.min(t.length,Math.floor((e+1)*i)),r=o[e]??0;for(let a=Math.floor(e*i);a<n;a++){let e=Math.abs(t[a]??0);e>r&&(r=e)}o[e]=r,r>s&&(s=r)}}if(s<ur)return;let c=Float32Array.from(o).sort(),l=c[Math.floor(c.length*.95)]??s;return{duration:r.duration,data:o,max:l>0?l:s}}catch{return}}function pr(e){let t=dr.get(e);return t||(t=fr(e),dr.set(e,t)),t}function mr(e){let[t,n]=(0,q.useState)();(0,q.useEffect)(()=>{if(e===void 0)return;let t=!0;return pr(e).then(r=>{t&&n({url:e,peaks:r})}),()=>{t=!1}},[e]);let r=t?.url===e?t:void 0;return{peaks:r?.peaks,settled:e===void 0||r!==void 0}}function hr(e,t,n){let r=Math.max(0,Math.floor(t*50)),i=Math.min(e.data.length,Math.max(r+1,Math.ceil(n*50))),a=0;for(let t=r;t<i;t++){let n=e.data[t]??0;n>a&&(a=n)}return a}var gr={scenes:`text-track-scene`,voice:`text-track-voice`,music:`text-track-music`,sound:`text-track-sound`},Q={ruler:28,scenes:36,voice:40,music:32,sound:28},_r={parts:[],music:!1,cues:[],listening:!1,round:0};function vr(e){return Q.ruler+1+Q.scenes+1+e.reduce((e,t)=>e+Q[t]+1,0)}var yr=6;function br(e,t){let n=e=>e.join(` `).replace(/\s+([.,!?;:。,!?;:、])/g,`$1`).trim(),[r,...i]=e;if(r===t&&i.length>0){let e=n(i);if(/^[^a-z]/.test(e))return e}return n(e)}function xr(e){return e<=60?{minor:1,major:5}:e<=180?{minor:1,major:10}:e<=600?{minor:5,major:30}:e<=1800?{minor:10,major:60}:{minor:60,major:300}}var $=(e,t)=>`${String(e/Math.max(t,1e-6)*100)}%`;function Sr({title:e,mono:t=!1,time:n,line:r,children:i}){return(0,J.jsxs)(z,{children:[(0,J.jsx)(R,{asChild:!0,children:i}),(0,J.jsx)(he,{side:`top`,sideOffset:6,className:`max-w-[20rem]`,children:(0,J.jsxs)(`span`,{className:`flex flex-col gap-0.5 text-left`,children:[(0,J.jsx)(`span`,{className:h(t&&`font-mono text-micro`),children:e}),(0,J.jsx)(`span`,{className:`font-mono text-micro tabular-nums opacity-70`,children:n}),r?(0,J.jsx)(`span`,{className:`opacity-80`,children:r}):null]})})]})}function Cr(e){let t=o(),[n,r]=(0,q.useState)();return(0,q.useEffect)(()=>{let n=!0;return lt(t,e).then(t=>{n&&r({file:e,url:t})}),()=>{n=!1}},[t,e]),n?.file===e?n.url:void 0}function wr({file:e,from:t,to:n,sample:r,alpha:i,className:a}){let o=(0,q.useRef)(null),{peaks:s,settled:c}=mr(Cr(e)),[l,u]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{let e=o.current;if(!e||!s)return;let a=()=>{let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),c=Math.round(e.clientHeight*a);if(!o||!c)return;e.width=o,e.height=c;let l=e.getContext(`2d`);if(!l)return;l.fillStyle=getComputedStyle(e).color,l.globalAlpha=i;let d=1/Math.max(s.max,.05),f=n-t,p=c-2*Math.round(2*a);for(let e=0;e<o;e+=2){let n=r(t+e/o*f);if(!n)continue;let i=hr(s,n.at,n.at+2/o*f)*d*n.gain,a=Math.max(1,Math.round(Math.min(1,i)**Tr*p));l.fillRect(e,Math.round((c-a)/2),1,a)}u(!0)};a();let c=new ResizeObserver(a);c.observe(e);let l=new MutationObserver(a);return l.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{c.disconnect(),l.disconnect()}},[s,t,n,r,i]),(0,J.jsx)(`canvas`,{ref:o,"aria-hidden":!0,"data-wave":l?`ready`:c?`none`:`pending`,className:h(`pointer-events-none absolute inset-0 size-full opacity-0 transition-opacity data-[wave=ready]:opacity-100`,a)})}var Tr=.7,Er=`focus-visible:outline-ring absolute inset-y-1 overflow-hidden rounded-xs border focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`;function Dr({line:e,duration:t,onSeek:n}){let r=(0,q.useCallback)(t=>{let n=Ln(e,t);return n===void 0?void 0:{at:n,gain:1}},[e]);return(0,J.jsx)(Sr,{title:e.text,time:`${Je(e.start)} – ${Je(e.end)} · ${Xe(e.file)}`,children:(0,J.jsxs)(`button`,{type:`button`,"data-sentence":e.key??e.part,"data-start":e.start.toFixed(4),className:h(Er,`bg-track-voice/15 border-track-voice/60 hover:bg-track-voice/25 text-left`),style:{left:$(e.start,t),width:$(e.end-e.start,t)},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{n(e.start)},children:[(0,J.jsx)(`span`,{className:`absolute inset-x-1.5 top-0 block h-[14px] truncate text-micro leading-[14px]`,children:e.text}),(0,J.jsx)(`span`,{className:`absolute inset-x-0 top-[14px] bottom-0`,children:(0,J.jsx)(wr,{file:e.file,from:e.start,to:e.end,sample:r,alpha:.7,className:`text-track-voice`})})]})})}var Or=2,kr=.75;function Ar({parts:e,duration:t}){let n=(0,q.useRef)(null),r=(0,q.useRef)(new Map),[i,a]=(0,q.useState)(0),[o,s]=(0,q.useState)(()=>new Map),c=e.flatMap(e=>(e.anchors??[]).map(t=>({id:`${e.key}@${t.name}`,part:e.key,anchor:t}))),l=c.map(e=>e.id).join(`
|
|
23
|
+
`);(0,q.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{a(e.clientWidth);let t=new Map;for(let[e,n]of r.current)t.set(e,n.offsetWidth);s(e=>e.size===t.size&&[...t].every(([t,n])=>e.get(t)===n)?e:t)};t();let i=new ResizeObserver(t);i.observe(e);for(let e of r.current.values())i.observe(e);return()=>{i.disconnect()}},[l]);let u=lr(c.map(e=>({x:e.anchor.at/Math.max(t,1e-6)*i,width:o.get(e.id)??0})),i,Or);return(0,J.jsx)(`div`,{ref:n,className:`pointer-events-none absolute inset-0`,children:c.map((e,n)=>(0,J.jsx)(jr,{part:e.part,anchor:e.anchor,duration:t,place:u[n]??null,nameRef:t=>(r.current.set(e.id,t),()=>{r.current.delete(e.id)})},e.id))})}function jr({part:e,anchor:t,duration:n,place:r,nameRef:i}){let{at:a,end:o}=t,s=(a,o)=>(0,J.jsx)(`span`,{"data-anchor":`${e}:${t.name}${a?`:end`:``}`,"data-time":o.toFixed(4),title:t.name,className:`before:bg-foreground/70 absolute inset-y-0 z-10 -ml-1 w-2 before:absolute before:inset-y-0 before:left-1/2 before:w-px`,style:{left:$(o,n)},children:!a&&(0,J.jsx)(`span`,{ref:i,"data-anchor-lane":r?String(r.lane):void 0,className:h(`bg-background text-muted-foreground absolute rounded-xs px-0.5 font-mono text-micro leading-3 whitespace-nowrap`,r?.side===`before`?`right-1/2 mr-px`:`left-1/2 ml-px`,!r&&`invisible`),style:{bottom:`${String((r?.lane??0)*kr)}rem`},children:t.name})},a?`end`:`at`);return(0,J.jsxs)(J.Fragment,{children:[o!==void 0&&o>a&&(0,J.jsx)(`span`,{className:`bg-foreground/50 pointer-events-none absolute bottom-0 z-10 h-px`,style:{left:$(a,n),width:$(o-a,n)}}),s(!1,a),o!==void 0&&s(!0,o)]})}function Mr({music:e,duration:t,ducked:n}){let{start:r,end:i}=e,a=(0,q.useCallback)(t=>{let n=Rn(e,t);return n===void 0?void 0:{at:n,gain:zn(e,t)}},[e]),o=Xe(e.file);return(0,J.jsx)(Sr,{mono:!0,title:o,time:`${Je(r)} – ${Je(i)}`,line:e.ducked.length?n:void 0,children:(0,J.jsxs)(`div`,{"data-music":o,className:h(Er,`bg-track-music/15 border-track-music/60`),style:{left:$(r,t),width:$(i-r,t)},children:[(0,J.jsx)(wr,{file:e.file,from:r,to:i,sample:a,alpha:.6,className:`text-track-music`}),(0,J.jsx)(`span`,{className:`bg-background/85 text-foreground absolute top-1/2 left-1.5 -translate-y-1/2 rounded-xs px-1 font-mono text-micro leading-[14px]`,children:o})]})})}var Nr=(0,q.memo)(function({timeline:e,texts:t,tracks:n,rows:r,current:i,second:a,marks:o,onSeek:s}){let c=X(),{duration:l,parts:u}=e,d=e=>(0,J.jsx)(`span`,{className:`text-muted-foreground bg-background pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 px-1 text-xs leading-4`,children:e}),f=n.speech,p=n.music?[n.music]:[],m=n.cues,g=e=>u.find(t=>t.key===e)?.title??e;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`relative border-t`,style:{height:Q.scenes+1},"data-row":`scenes`,children:[u.map((e,n)=>{let r=e.key===i,o=e.title??e.key,c=t.find(t=>t.key===e.key),u=c?.spoken??br(c?.onScreen??[],o),d=(e.end-e.start)*a<56;return(0,J.jsx)(Sr,{title:(0,J.jsx)(`span`,{className:`font-serif text-dense`,children:o}),time:`${Je(e.start)} – ${Je(e.end)}`,line:u||void 0,children:(0,J.jsxs)(`button`,{type:`button`,"data-chapter":e.key,"data-start":e.start.toFixed(4),"aria-current":r?`true`:void 0,className:h(Er,`flex items-center gap-1.5 px-2 text-left transition-colors`,r?`bg-track-scene/25 border-track-scene`:`bg-track-scene/10 border-track-scene/45 hover:bg-track-scene/20`),style:{left:$(e.start,l),width:`calc(${$(e.end-e.start,l)} - 1px)`},onPointerDown:e=>{e.stopPropagation()},onClick:()=>{s(e.start)},children:[(0,J.jsx)(`span`,{className:h(`font-mono text-micro tabular-nums`,r?`text-foreground/70`:`text-muted-foreground`),children:String(n+1)}),d?null:(0,J.jsx)(`span`,{className:h(`min-w-0 truncate font-serif text-xs`,r?`font-semibold`:`text-foreground/80`),children:o})]})},e.key)}),u.filter(e=>o.parts.includes(e.key)).map(e=>(0,J.jsx)(`span`,{"aria-hidden":!0,"data-testid":`agent-changed`,"data-part":e.key,className:`ak-agent-wash bg-agent/25 outline-agent pointer-events-none absolute inset-y-1 rounded-xs outline-2`,style:{left:$(e.start,l),width:`calc(${$(e.end-e.start,l)} - 1px)`}},`${String(o.round)}:${e.key}`))]}),r.includes(`voice`)?(0,J.jsxs)(`div`,{className:`relative border-t`,style:{height:Q.voice+1},"data-row":`voice`,children:[f.length>0?f.map(e=>(0,J.jsx)(Dr,{line:e,duration:l,onSeek:s},`${e.part}@${String(e.start)}`)):d(c.noVoice),(0,J.jsx)(Ar,{parts:u,duration:l})]}):null,r.includes(`music`)?(0,J.jsxs)(`div`,{className:`relative border-t`,style:{height:Q.music+1},"data-row":`music`,children:[p.length?p.map(e=>(0,J.jsx)(Mr,{music:e,duration:l,ducked:c.ducked},`${e.file}@${String(e.start)}`)):d(c.noMusic),o.music?p.map(e=>(0,J.jsx)(`span`,{"aria-hidden":!0,"data-testid":`agent-music`,className:`outline-agent pointer-events-none absolute inset-y-1 rounded-xs outline-2`,style:{left:$(e.start,l),width:$(e.end-e.start,l)}},`${e.file}@${String(e.start)}`)):null]}):null,r.includes(`sound`)?(0,J.jsxs)(`div`,{className:`relative border-t`,style:{height:Q.sound+1},"data-row":`sound`,children:[(0,J.jsx)(`span`,{className:`bg-rule-strong absolute inset-x-0 top-1/2 h-px`}),m.length?m.map((e,t)=>(0,J.jsx)(Sr,{mono:!0,title:e.sound,time:`${Je(e.t)} · ${g(e.part)}`,line:e.what,children:(0,J.jsx)(`span`,{"data-cue":e.sound,"data-agent":o.cues.includes(e.part)?``:void 0,className:`absolute top-1/2 block size-[7px] -translate-y-1/2`,style:{left:$(e.t,l)},children:(0,J.jsx)(`span`,{className:h(`block size-full rotate-45`,o.cues.includes(e.part)?`bg-agent`:`bg-track-sound`,e.t*a<5?`translate-x-[2px]`:`-translate-x-1/2`)})})},`${e.sound}@${String(e.t)}#${String(t)}`)):d(c.noCues)]}):null]})});function Pr({timeline:e,texts:t,tracks:n,rows:r,state:i,agent:a,marks:o=_r,transport:s,onSeek:c}){let l=X(),{duration:u,fps:d,parts:f}=e,p=Math.max(0,u-1/d),m=(0,q.useRef)(null),_=(0,q.useRef)(null),[v,y]=(0,q.useState)(0),[b,x]=(0,q.useState)(!1),[S,C]=(0,q.useState)();(0,q.useLayoutEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{y(e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]);let w=v>0&&v/u<yr,T=w?Math.ceil(u*yr):v,E=T/Math.max(u,1e-6),{t:D,playing:O}=i;(0,q.useEffect)(()=>{let e=_.current;if(!e)return;let t=t=>{let n=Math.min(Math.max(t,0),u)*E;e.style.transform=`translateX(${String(n)}px)`;let r=m.current;w&&O&&r&&(n<r.scrollLeft+24||n>r.scrollLeft+r.clientWidth-24)&&(r.scrollLeft=Math.max(0,n-r.clientWidth*.2))};if(t(D),!O)return;let n=performance.now(),r=requestAnimationFrame(function e(i){t(Math.min(D+(i-n)/1e3,p)),r=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(r)}},[D,O,E,u,p,w]);let k=e=>{let t=e.currentTarget.getBoundingClientRect(),n=Math.min(t.width,Math.max(0,e.clientX-t.left))/Math.max(t.width,1)*u;return Math.min(Math.max(Ye(n,d),0),p)},ee=e=>{c(Math.min(Math.max(Ye(e,d),0),p))},A=f.find(e=>i.t>=e.start&&i.t<e.end)??f.at(-1),{minor:j,major:te}=xr(u),M=[];for(let e=0;e<=u+1e-6;e+=j)M.push(e);let N=(e,t)=>(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 overflow-hidden border-t pr-2 pl-3 max-[559px]:justify-center max-[559px]:px-0`,style:{height:Q[e]+1},"data-track":e,children:[(0,J.jsx)(`span`,{role:`img`,"aria-label":l.rows[e],className:h(`shrink-0 [&_svg]:size-3.5`,gr[e]),children:t}),(0,J.jsx)(We,{"aria-hidden":!0,className:`text-micro whitespace-nowrap max-[559px]:hidden`,children:l.rows[e]})]});return(0,J.jsx)(B,{children:(0,J.jsxs)(`div`,{className:`relative flex`,style:{height:vr(r)},"data-testid":`timeline`,children:[(0,J.jsxs)(`div`,{className:`w-max min-w-20 shrink-0 border-r max-[559px]:w-10 max-[559px]:min-w-10`,children:[s?(0,J.jsx)(`div`,{className:`flex items-center gap-1.5 pr-1 pl-2 max-[559px]:justify-center max-[559px]:px-0`,style:{height:Q.ruler},"data-testid":`timeline-corner`,children:(0,J.jsx)(g,{size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground ml-auto`,"aria-label":l.hideTimeline,title:l.hideTimeline,"aria-expanded":!0,"data-testid":`timeline-toggle`,onClick:s.onFold,children:(0,J.jsx)(ve,{})})}):(0,J.jsx)(`div`,{style:{height:Q.ruler}}),N(`scenes`,(0,J.jsx)(U,{})),r.includes(`voice`)?N(`voice`,(0,J.jsx)(Pe,{})):null,r.includes(`music`)?N(`music`,(0,J.jsx)(Fe,{})):null,r.includes(`sound`)?N(`sound`,(0,J.jsx)(ae,{})):null]}),(0,J.jsx)(`div`,{ref:m,className:h(`relative min-w-0 flex-1 overflow-y-hidden border-l border-transparent`,w?`overflow-x-auto`:`overflow-x-hidden`),"data-testid":`tracks`,children:(0,J.jsxs)(`div`,{className:`relative h-full cursor-pointer touch-none`,style:{width:T||`100%`},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),x(!0),c(k(e))},onPointerMove:e=>{let t=k(e);C(t),b&&c(t)},onPointerUp:()=>{x(!1)},onPointerCancel:()=>{x(!1)},onPointerLeave:()=>{C(void 0)},children:[(0,J.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":l.seek,"aria-valuemin":0,"aria-valuemax":Math.round(u*100)/100,"aria-valuenow":Math.round(i.t*100)/100,"aria-valuetext":l.timeOf(Y(i.t),Y(u),A?.title??``),"data-testid":`scrubber`,className:`focus-visible:outline-ring relative outline-none focus-visible:outline-1 focus-visible:outline-solid focus-visible:-outline-offset-1`,style:{height:Q.ruler},onKeyDown:e=>{if(e.key===`ArrowLeft`)ee(i.t-1);else if(e.key===`ArrowRight`)ee(i.t+1);else if(e.key===`Home`)ee(0);else if(e.key===`End`)ee(p);else return;e.preventDefault()},children:M.map(e=>{let t=Math.abs(e/te-Math.round(e/te))<1e-6;return(0,J.jsxs)(`span`,{className:`absolute bottom-0`,style:{left:$(e,u)},children:[(0,J.jsx)(`span`,{className:h(`absolute bottom-0 left-0 w-px`,t?`bg-lead-soft h-2`:`bg-rule-strong h-1`)}),t&&(u-e)*E>34?(0,J.jsx)(`span`,{className:`text-muted-foreground absolute bottom-[7px] left-1 font-mono text-micro leading-none tabular-nums`,children:Y(e)}):null]},e)})}),(0,J.jsx)(Nr,{timeline:e,texts:t,tracks:n,rows:r,current:i.part??A?.key,second:E,marks:o,onSeek:c}),S===void 0?null:(0,J.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-0 z-10`,style:{transform:`translateX(${String(S*E)}px)`},"data-testid":`hover-guide`,children:[(0,J.jsx)(`span`,{className:`bg-foreground/25 absolute inset-y-0 left-0 w-px`}),(0,J.jsx)(`span`,{className:`bg-popover text-popover-foreground absolute top-0.5 left-1 rounded-xs border px-1 font-mono text-micro leading-[14px] tabular-nums`,children:Y(S)})]}),a?.t===void 0?null:(0,J.jsx)(we,{"aria-hidden":!0,"data-testid":`agent-marker`,className:`z-20`,label:a.label,flag:Math.min(a.t,u)*E>T-140?`before`:`after`,style:{left:Math.min(a.t,u)*E}}),(0,J.jsxs)(`div`,{ref:_,"aria-hidden":!0,className:`pointer-events-none absolute inset-y-0 left-0 z-20 will-change-transform`,"data-testid":`playhead`,children:[(0,J.jsx)(`span`,{className:`bg-foreground absolute inset-y-0 left-0 w-px`}),(0,J.jsx)(`svg`,{viewBox:`0 0 9 9`,className:`text-foreground absolute top-0 -left-1 size-[9px]`,children:(0,J.jsx)(`path`,{d:`M0 0h9v4L4.5 9 0 4z`,fill:`currentColor`})})]})]})}),a&&o.listening&&r.length>0?(0,J.jsx)(Ee,{"aria-hidden":!0,"data-testid":`agent-listening`,label:a.label,className:`z-30`,style:{left:0,right:0,top:Q.ruler+1+Q.scenes+1,bottom:0}}):null]})})}var Fr=new ke(`scriptAgent`),Ir=new De({nodes:{doc:{content:`part*`},part:{content:`sentence+`,attrs:{part:{default:``},title:{default:``}},toDOM:e=>[`div`,{"data-part":String(e.attrs.part),class:`ak-script-part`},0]},sentence:{content:`word*`,toDOM:()=>[`div`,{class:`ak-script-sentence`},0]},word:{inline:!0,atom:!0,selectable:!1,group:`inline`,attrs:{part:{default:``},i:{default:0},text:{default:``},removed:{default:!1},film:{default:null}},leafText:e=>`${String(e.attrs.text)} `,toDOM:e=>[`span`,{"data-word":String(e.attrs.i),"data-removed":e.attrs.removed===!0?``:void 0,class:`ak-word`},[`span`,{class:`ak-word-text`},String(e.attrs.text)],` `]},text:{group:`inline`}}});function Lr(e){return Ir.node(`doc`,null,e.map(e=>Ir.node(`part`,{part:e.part,title:e.title},Sn(e.words).map(t=>Ir.node(`sentence`,null,t.map(t=>Ir.node(`word`,{part:e.part,i:t.i,text:t.text,removed:t.removed,film:t.film??null})))))))}function Rr(e,t,n){let r;return e.descendants((e,i)=>{if(e.type.name!==`word`)return!0;let a=i+e.nodeSize;return n===`before`&&a<=t&&(r={from:i,to:a}),n===`after`&&i>=t&&!r&&(r={from:i,to:a}),!1}),r}function zr(e,t,n){let r=new Map;return e.nodesBetween(t,n,e=>{if(e.type.name!==`word`)return;let t=String(e.attrs.part),n=Number(e.attrs.i),i=e.attrs.removed===!0,a=r.get(t);a?(a.first=Math.min(a.first,n),a.last=Math.max(a.last,n),a.struck=a.struck&&i):r.set(t,{part:t,first:n,last:n,struck:i})}),[...r.values()]}var Br=44,Vr=48;function Hr(e,t){let n=e.state.selection;if(n.empty||!t)return;let r=zr(e.state.doc,n.from,n.to);if(r.length===0)return;let i=t.getBoundingClientRect(),a=e.coordsAtPos(n.from,1),o=e.coordsAtPos(n.to,-1),s=a.top-i.top+t.scrollTop-Br;return{top:s>=t.scrollTop?s:o.bottom-i.top+t.scrollTop+6,left:Math.min(Math.max(Vr,(a.left+o.right)/2-i.left+t.scrollLeft),Math.max(Vr,t.clientWidth-Vr)),runs:r,restore:r.every(e=>e.struck)}}function Ur({script:e,t,playing:n=!1,readOnly:r,agent:i,following:a=!1,onSeek:o,onToggle:s,note:c,onCut:l}){let u=X(),d=(0,q.useRef)(null),f=(0,q.useRef)(null),p=(0,q.useRef)(null),[m,g]=(0,q.useState)(),_=(0,q.useRef)({onSeek:o,onCut:l,onToggle:s,t,readOnly:r});(0,q.useEffect)(()=>{_.current={onSeek:o,onCut:l,onToggle:s,t,readOnly:r}}),(0,q.useEffect)(()=>{let e=d.current;if(!e)return;let t=new K({state:{init:()=>-1,apply:(e,n)=>{let r=e.getMeta(t);return typeof r==`number`?r:n}},props:{decorations(e){let n=t.getState(e)??-1;if(n<0)return W.empty;let r;return e.doc.descendants((e,t)=>{if(e.type.name!==`word`)return!0;let i=e.attrs.film;return i!==null&&i<=n&&(r=je.node(t,t+e.nodeSize,{class:`ak-word-now`})),!0}),r?W.create(e.doc,[r]):W.empty}}}),n=new K({key:Fr,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(Fr);return n===void 0?t:n}},props:{decorations(e){let t=Fr.getState(e);if(!t)return W.empty;let n=new Set(t.words?.cut),r=new Set(t.words?.kept),i=[];return e.doc.descendants((e,a)=>{if(e.type.name===`part`)return e.attrs.part===t.part&&(i.push(je.node(a,a+e.nodeSize,{class:`ak-script-agent`,"data-agent":t.label,"data-testid":`script-agent`})),!0);if(e.type.name!==`word`)return!0;let o=e.attrs.i,s=n.has(o)?`cut`:r.has(o)?`kept`:void 0;return s&&i.push(je.node(a,a+e.nodeSize,{class:`ak-word-agent`,"data-agent-word":s})),!1}),W.create(e.doc,i)}}}),r=new K({props:{decorations(e){let{from:t,to:n,empty:r}=e.selection;if(r)return W.empty;let i=[];return e.doc.nodesBetween(t,n,(e,r)=>e.type.name!==`word`||(r<n&&r+e.nodeSize>t&&i.push(je.node(r,r+e.nodeSize,{class:`ak-word-picked`})),!1)),W.create(e.doc,i)}}}),i=new G(e,{state:Oe.create({doc:Lr([]),plugins:[t,n,r]}),attributes:{class:`outline-none`,"aria-label":u.script,role:`textbox`,"aria-multiline":`true`,spellcheck:`false`},editable:()=>!_.current.readOnly,dispatchTransaction(e){e.docChanged||(this.updateState(this.state.apply(e)),e.selectionSet&&g(Hr(this,f.current)))},handleKeyDown(e,t){if(t.key===` `&&!t.metaKey&&!t.ctrlKey&&!t.altKey)return _.current.onToggle?.(),!0;if(t.key!==`Backspace`&&t.key!==`Delete`)return t.key.length===1&&!t.metaKey&&!t.ctrlKey;if(_.current.readOnly)return!0;let n=e.state.selection,r=n.from,i=n.to;if(n.empty){let n=Rr(e.state.doc,r,t.key===`Backspace`?`before`:`after`);if(!n)return!0;({from:r,to:i}=n)}let a=zr(e.state.doc,r,i);return a.length===0||_.current.onCut(a.map(e=>({part:e.part,first:e.first,last:e.last,restore:e.struck}))),!0},handleDoubleClickOn(e,t,n){return n.type.name===`word`&&(e.dispatch(e.state.tr.setSelection(Ae.create(e.state.doc,t,t+n.nodeSize))),!0)},handleClickOn(e,t,n){if(n.type.name!==`word`)return!1;let r=n.attrs.film;return r!==null&&_.current.onSeek(r),!1},handleDOMEvents:{blur:()=>(g(void 0),!1),focus:e=>(g(Hr(e,f.current)),!1)},handlePaste:()=>!0,handleDrop:()=>!0});return p.current=i,()=>{i.destroy(),p.current=null}},[]),(0,q.useEffect)(()=>{let t=p.current;if(!t)return;let n=Lr(e);if(n.eq(t.state.doc))return;let r=t.state.selection,i=n.content.size,a=Oe.create({doc:n,plugins:t.state.plugins,selection:Ae.between(n.resolve(Math.min(r.from,i)),n.resolve(Math.min(r.to,i)))});t.updateState(a),t.hasFocus()&&g(Hr(t,f.current))},[e]);let v=i?.part,y=i?.label,b=i?.words,x=JSON.stringify(b??null);return(0,q.useEffect)(()=>{let e=p.current;e&&e.dispatch(e.state.tr.setMeta(Fr,v===void 0||y===void 0?null:{part:v,label:y,words:b}))},[v,y,x,e]),(0,q.useEffect)(()=>{if(!a||v===void 0)return;let e=d.current?.querySelector(`[data-part="${CSS.escape(v)}"]`);(e?.querySelector(`.ak-word-agent`)??e)?.scrollIntoView({block:`nearest`})},[a,v,x]),(0,q.useEffect)(()=>{let e=p.current;if(!e)return;let n=e.state.plugins[0];n&&e.dispatch(e.state.tr.setMeta(n,t))},[t]),(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`script`,"data-playing":n?``:void 0,children:[(0,J.jsxs)(`div`,{className:`text-muted-foreground border-b px-3 py-2 text-micro`,children:[e.length===0?u.noScript:r?u.scriptReadOnly:u.scriptHint,c===void 0||e.length===0?null:(0,J.jsx)(`span`,{className:`mt-1 block`,"data-testid":`script-note`,children:c})]}),(0,J.jsxs)(`div`,{ref:f,className:`relative min-h-0 flex-1 overflow-auto`,children:[(0,J.jsx)(`div`,{ref:d,className:h(`px-3 py-2 text-read`,`[&_.ak-script-part]:mb-3 [&_.ak-script-part]:rounded-sm [&_.ak-script-sentence]:mb-1`,`[&_.ak-word]:cursor-pointer [&_.ak-word-text]:-mx-0.5 [&_.ak-word-text]:rounded-[3px] [&_.ak-word-text]:px-0.5 [&_.ak-word:not(.ak-word-now):hover_.ak-word-text]:bg-secondary`,`[&_.ak-word[data-removed]_.ak-word-text]:text-muted-foreground [&_.ak-word[data-removed]_.ak-word-text]:line-through`,`[&_.ak-word-agent_.ak-word-text]:bg-agent/15 [&_.ak-word-agent_.ak-word-text]:text-agent-text`,`[&_.ak-word-now_.ak-word-text]:bg-here [[data-playing]_&_.ak-word-now_.ak-word-text]:bg-highlight [[data-playing]_&_.ak-word-now_.ak-word-text]:text-on-highlight`,`[&_*::selection]:bg-transparent [&_.ak-word.ak-word-picked_.ak-word-text]:bg-[var(--allyhub-pencil-select)] [&_.ak-word.ak-word-picked_.ak-word-text]:text-foreground`)}),m&&!r?(0,J.jsx)(`div`,{className:`bg-sheet border-rule absolute z-10 flex -translate-x-1/2 items-center rounded-lg border p-1 shadow-[var(--shadow-overlay)]`,style:{top:m.top,left:m.left},"data-testid":`script-bar`,children:(0,J.jsxs)(ye,{"data-testid":m.restore?`keep-words`:`cut-words`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{l(m.runs.map(e=>({part:e.part,first:e.first,last:e.last,restore:m.restore})))},children:[m.restore?(0,J.jsx)(le,{}):(0,J.jsx)(Le,{}),m.restore?u.keepWords:u.cutWords]})}):null]})]})}var Wr=1200,Gr=4e3,Kr=150,qr=640,Jr={initial:272,least:200,share:.5},Yr=[[`voice`,`music`,`sound`],[`voice`],[]],Xr=vr(Yr[0]??[]),Zr=vr([]);function Qr(e,t){let n=o(),[r,i]=(0,q.useState)(new Map),a=e.join(`
|
|
24
|
+
`);return(0,q.useEffect)(()=>{let t=!0;return Promise.all(e.map(async e=>{try{let t=await n[`files/read`]({path:re(e)}),r=ie(`words`,JSON.parse(t.text));return r.ok?[e,r.value.words]:void 0}catch{return}})).then(e=>{t&&i(new Map(e.filter(e=>e!==void 0)))}),()=>{t=!1}},[n,a,t]),r}var $r=e=>e instanceof HTMLElement&&e.closest(`[data-testid=script]`)===null&&(e.isContentEditable||e.closest(`input,textarea,select,[role=dialog]`)!==null);function ei({item:e,piece:t,version:r,revision:i,start:a,problems:c,stageProblems:l=!0,loaded:u,onLoaded:d}){let f=X(),p=o(),m=s(),h=(0,q.useRef)(null),[_,v]=(0,q.useState)(),[y,b]=(0,q.useState)(),[x,S]=(0,q.useState)({t:a?.t??0,part:void 0,playing:!1});(0,q.useEffect)(()=>{if(_===void 0)return;let e=setTimeout(()=>{b(_)},Wr);return()=>{clearTimeout(e)}},[_]);let C=_!==void 0&&y===_?_:void 0,[w,T]=(0,q.useState)(r.key);w!==r.key&&(T(r.key),v(void 0));let E=(0,q.useRef)(null),[D,O]=(0,q.useState)(1/0);(0,q.useEffect)(()=>{let e=E.current;if(!e)return;let t=new ResizeObserver(()=>{O(e.clientWidth)});return t.observe(e),()=>{t.disconnect()}},[]);let[k=Jr.initial,ee]=ct(`video-editor.script-width`,Jr.initial),[A=Xr,j]=ct(`video-editor.timeline-height`,Xr),[te=!0,M]=ct(`video-editor.timeline`,!0),N=Math.max(Jr.least,Math.round((Number.isFinite(D)?D:1600)*Jr.share)),ne=Math.min(N,Math.max(Jr.least,k)),re=Yr.find(e=>vr(e)<=A)??Yr[2]??[],ie=(0,q.useMemo)(()=>u?.kind===`video`?In(u.timeline,u.text,u.mix):void 0,[u]),P=u?.kind===`video`?u.timeline:void 0,F=Qr((0,q.useMemo)(()=>[...new Set((P?.parts??[]).flatMap(e=>e.speech?[e.speech.file]:[]))],[P]),i),I=Tn(m),ae=new Map;for(let e of P?.parts??[]){let t=e.speech?.edits;if(t===void 0)continue;let n=I.listOf(t);n&&ae.set(t,n)}let se=(0,q.useMemo)(()=>P?mn(P,F,ae):[],[P,F,I.tick]),ce=se.filter(e=>e.edits!==void 0),le=m||ce.length===0,ue=!m&&ce.length<se.length?f.noEdits:void 0,de=e=>{let t=[];for(let n of e){let e=se.find(e=>e.part===n.part);if(e?.edits===void 0)continue;let r=F.get(e.file)??[];t.push({path:e.edits,next:e=>n.restore?yn(e,n.first,n.last,r):vn(e,n.first,n.last,r)})}I.apply(e.every(e=>e.restore)?f.keepWords:f.cutWords,t)},fe=(0,q.useRef)(I);(0,q.useEffect)(()=>{fe.current=I}),(0,q.useEffect)(()=>{if(m)return;let e=e=>{if($r(e.target))return;let t=e.target instanceof HTMLElement&&e.target.closest(`[data-testid=script]`)!==null;if(e.defaultPrevented&&!t||!(e.metaKey||e.ctrlKey)||e.altKey)return;let n=e.key.toLowerCase(),r=fe.current,i=n===`z`&&e.shiftKey||n===`y`&&!e.shiftKey;if(n===`z`&&!e.shiftKey&&r.canUndo)r.undo();else if(i&&r.canRedo)r.redo();else return;e.preventDefault()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[m]);let{agent:L,following:he}=n(),R=L?.doing!==void 0,z=oe(),[B,V]=(0,q.useState)(),ge=L?.source?.path;(0,q.useEffect)(()=>{if(ge===void 0||B?.revision===i)return;let t=!0;return tt(p,`video/sources`,{item:e}).then(e=>{t&&V({revision:i,files:e.files})},()=>void 0),()=>{t=!1}},[p,e,i,ge,B?.revision]);let[_e,ve]=(0,q.useState)(u),[ye,H]=(0,q.useState)(),[U,be]=(0,q.useState)();if(u!==_e&&(ve(u),_e&&u&&L?.doing===`editing`)){let e=wt({timeline:_e.timeline,text:_e.text},u),t=Ot(_e.timeline,u.timeline),[n]=e,r=n===void 0?void 0:Tt(u.timeline,n);r&&H(r),(e.length>0||t.music||t.cues.length>0)&&be({parts:e,...t,round:(U?.round??0)+1})}(0,q.useEffect)(()=>{if(!U)return;let e=setTimeout(()=>{be(void 0)},Gr);return()=>{clearTimeout(e)}},[U]);let[xe,Se]=(0,q.useState)(),[Ce,we]=(0,q.useState)(I.byAgent);I.byAgent!==Ce&&(we(I.byAgent),Se(I.byAgent));let[De,Oe]=(0,q.useState)(R);De!==R&&(Oe(R),R||(H(void 0),Se(void 0)));let ke=R?L.source:void 0,Ae=ke&&P?xt(P,ke.path):void 0,W=ke&&B&&Ae===void 0?bt(B.files,ke):void 0,G=(()=>{if(!R||!P)return;let e=_t(L.place);return e===void 0?(Ae===void 0?W?.part===void 0?void 0:Tt(P,W.part,W):Tt(P,Ae))??ye:{t:e}})(),K=G?.t,je=L?z(L):``,Me=W?.music===!0,Ne=W?.sounds===!0&&W.part!==void 0?W.part:void 0,Pe=R&&vt(L.place),Fe=(0,q.useMemo)(()=>({parts:U?.parts??[],music:U?.music===!0||Me,cues:[...new Set([...U?.cues??[],...Ne===void 0?[]:[Ne]])],listening:Pe,round:U?.round??0}),[U,Me,Ne,Pe]),Ie=xe&&P&&G?.part!==void 0&&xt(P,xe.path)===G.part?{cut:xe.cut,kept:xe.kept}:void 0,Le=(0,q.useRef)(x.t);(0,q.useEffect)(()=>{Le.current=x.t}),(0,q.useEffect)(()=>{he&&K!==void 0&&!x.playing&&(Math.abs(Le.current-K)<1/240||h.current?.seek(K))},[he,K,x.playing]);let Re=K!==void 0&&!x.playing&&Math.abs(x.t-K)<=1/(P?.fps??30)+1e-6,ze=G?.part,Be=G?.layer,Ve=G?.message,He=Re&&ze!==void 0&&(Be!==void 0||Ve!==void 0),[Ue,We]=(0,q.useState)();(0,q.useEffect)(()=>{if(!He)return;let e=!0,t=setTimeout(()=>{h.current?.objects(x.t).then(t=>{e&&We(t)})},Kr);return()=>{e=!1,clearTimeout(t)}},[He,x.t,u]);let Ge=He&&Ue&&Math.abs(Ue.t-x.t)<1e-6?Ue:void 0,Ke=(Be===void 0?void 0:Ge?.layers?.find(e=>e.part===ze&&e.index===Be)?.box)??(Ve===void 0?void 0:Ge?.texts.find(e=>e.keys.includes(Ve))?.box),qe=(e,t)=>`${String(e/t*100)}%`,Y=()=>{x.playing?h.current?.pause():h.current?.play()},Je=[...c,...l?u?.problems??[]:[]],Ye=se.length>0&&D>=qr,Xe=(e,t,n,r,i)=>(0,J.jsx)(g,{size:`icon-sm`,variant:`ghost`,"aria-label":e,title:e,disabled:r,"data-testid":i,onClick:n,children:t});return(0,J.jsxs)(`div`,{ref:E,className:`bg-paper flex size-full min-h-0 flex-col`,"data-testid":`workbench`,children:[(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[Ye?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`flex min-h-0 shrink-0`,style:{width:ne},children:(0,J.jsxs)(`aside`,{className:`bg-background flex min-h-0 flex-col overflow-hidden w-full`,"aria-label":f.script,children:[(0,J.jsxs)(`div`,{className:`flex h-9 items-center gap-1 border-b pr-1 pl-3`,children:[(0,J.jsx)(`h2`,{className:`flex-1 text-xs font-medium`,children:f.script}),le?null:(0,J.jsxs)(J.Fragment,{children:[Xe(I.undoLabel===void 0?f.undo:f.undoWhat(I.undoLabel),(0,J.jsx)(me,{}),I.undo,!I.canUndo,`undo`),Xe(I.redoLabel===void 0?f.redo:f.redoWhat(I.redoLabel),(0,J.jsx)(pe,{}),I.redo,!I.canRedo,`redo`)]})]}),(0,J.jsx)(Ur,{script:se,t:x.t,playing:x.playing,readOnly:le,note:ue,agent:L&&G?.part!==void 0?{part:G.part,label:je,words:Ie}:void 0,following:he,onSeek:e=>{h.current?.seek(e)},onToggle:Y,onCut:de})]})}),(0,J.jsx)(cr,{orientation:`vertical`,value:ne,min:Jr.least,max:N,label:f.resizeScript,onChange:ee,testid:`script-splitter`})]}):null,(0,J.jsx)(`div`,{className:`bg-stone-2 min-h-0 min-w-0 flex-1 px-4 py-3 min-[560px]:px-6`,children:(0,J.jsx)($n,{ref:h,item:e,version:r.key,revision:i,start:a,width:t.width,height:t.height,timelineOpen:te,onTimelineOpen:M,overlay:(0,J.jsxs)(J.Fragment,{children:[L&&Re&&P?Ke?(0,J.jsx)(Ee,{"data-testid":`agent-box`,label:je,style:{left:qe(Ke[0],P.width),top:qe(Ke[1],P.height),width:qe(Ke[2],P.width),height:qe(Ke[3],P.height)}}):(0,J.jsx)(Te,{"data-testid":`agent-tag`,label:je,className:`absolute top-2 left-2`}):null,(0,J.jsx)(sr,{error:C,problems:Je,compact:u!==void 0})]}),onState:S,onLoaded:e=>{d(e),v(void 0)},onError:v})})]}),P&&ie&&te?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(cr,{orientation:`horizontal`,value:vr(re),min:Zr,max:Xr,after:!0,label:f.resizeTimeline,onChange:j,testid:`timeline-splitter`}),(0,J.jsx)(`div`,{className:`bg-background shrink-0`,children:(0,J.jsx)(Pr,{timeline:P,texts:u?.text??[],tracks:ie,rows:re,state:x,agent:L?{t:K,label:je}:void 0,marks:Fe,transport:{onFold:()=>{M(!1)}},onSeek:e=>{h.current?.seek(e)}})})]}):null]})}function ti(e,t,n){let r=t.versions.filter(e=>n?.includes(e.key)!==!1).flatMap(n=>mt(e,t.piece,n)).filter(e=>e.level===`error`).map(e=>`${e.code}: ${e.message}`);return new Set(r).size}function ni(){let e=X(),t=c(),n=t?.item.id,r=_[m(t?.locale)],i=dt(t?.place),a=ot(),{data:o,error:s}=it(`video/versions`,n===void 0?void 0:{item:n},[a]),[l,u]=ct(`video-editor.version:${n??``}`,``),d=st(),f=o?pt(o,l):void 0,[p,h]=(0,q.useState)(),g=f&&p?.key===`${n??``}\n${f.key}`?p.loaded:void 0;if(n===void 0||!o&&!s)return(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,J.jsx)(Ge,{label:e.loading})});if(!o||!f)return(0,J.jsx)(Ke,{title:e.noVideo,className:`h-full justify-center`,children:s?.message});let v=t?.viewer===!0,y=d&&!v?mt(d.problems,o.piece,f):[],b=e=>e.lang===void 0?e.key:ht(e.lang,r),x=o.kind===`video`?g?.timeline:void 0,S=o.kind===`video`&&g!==void 0&&!g.text.some(e=>e.spoken!==void 0);return(0,J.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col`,"data-testid":`video-editor`,children:[(0,J.jsx)(se,{start:o.versions.length>1?(0,J.jsx)(ce,{testid:`video-bar`,children:(0,J.jsx)(de,{id:`language`,children:(0,J.jsxs)(ge,{value:f.key,onValueChange:e=>{u(e)},children:[(0,J.jsx)(be,{"aria-label":e.version,className:`max-w-[16rem]`,"data-testid":`version`,children:(0,J.jsx)(Ce,{})}),(0,J.jsx)(H,{position:`popper`,align:`start`,children:o.versions.map(e=>(0,J.jsx)(xe,{value:e.key,className:`text-xs`,title:e.key,children:b(e)},e.key))})]})})}):void 0,exports:{versions:o.versions.map(e=>({key:e.key,label:b(e)})),shown:f.key,facts:[`${String(o.width)} × ${String(o.height)}`,...x?[`${String(x.fps)} fps`,Y(x.duration)]:[]].join(` · `),unavailable:S?{srt:e.noVoice}:{},check:{waiting:d?.status===`waiting`||d?.status===`running`,problems:e=>d?.status===`done`?ti(d.problems,o,e):0}}}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,J.jsx)(ei,{item:n,piece:o,version:f,revision:a,start:i,problems:y,stageProblems:!v,loaded:g,onLoaded:e=>{h({key:`${n}\n${f.key}`,loaded:e})}})})]})}var ri=t({Preview:()=>$n,VideoEditor:()=>ni,WORDS:()=>nt,Workbench:()=>ei,aboutVersion:()=>mt,default:()=>ni,languageName:()=>ht,locateInStage:()=>Pn,musicAt:()=>Rn,musicGain:()=>zn,mustFix:()=>ti,pickInStage:()=>Fn,placeLabels:()=>lr,postCommand:()=>Nn,speechAt:()=>Ln,stageLayerName:()=>jn,stageMessage:()=>Mn,tracksOf:()=>In,uncutParts:()=>Bn,useCheck:()=>st,useRevision:()=>ot,useStored:()=>ct,useTool:()=>it,useToolOf:()=>at,useVideoWords:()=>X,versionNamed:()=>pt});export{Ie as _,jn as a,pt as c,ct as d,it as f,Ge as g,Ke as h,Fn as i,st as l,tt as m,ti as n,Mn as o,at as p,Pn as r,ht as s,ri as t,ot as u};
|