allyhub 0.15.2 → 0.17.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 +24 -0
- package/dist/commands/add.js +1 -1
- package/dist/commands/cloud-tools.js +1 -1
- package/dist/commands/dev.js +6 -2
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/frames/doc.js +1 -1
- package/dist/commands/inspect/common.js +3 -3
- package/dist/commands/inspect/facts.js +2 -2
- package/dist/commands/inspect/index.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/inspect/uses.js +3 -0
- package/dist/commands/mail.js +6 -6
- package/dist/commands/render.js +1 -1
- package/dist/main.js +8 -8
- package/dist/node_modules/@allyhub/3d-extension/dist/cli/scenery-text.js +2 -2
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/content.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +2 -2
- package/dist/node_modules/@allyhub/build/dist/imports.d.ts +17 -0
- package/dist/node_modules/@allyhub/build/dist/imports.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +3 -2
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +19 -3
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/uses.d.ts +27 -6
- package/dist/node_modules/@allyhub/build/dist/uses.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/work.d.ts +9 -1
- package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +2 -2
- package/dist/node_modules/@allyhub/canvas-model/package.json +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/blobs.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +12 -3
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/deletion.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -2
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +40 -40
- package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/parse.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +26 -26
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/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/slides.d.ts +15 -3
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +70 -11
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/workspace.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +3 -3
- 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/dist/load.js +2 -2
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/data/leads.csv +5 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +19 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/briefs/launch.docx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/markup.json +11 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/decks/pitch.pptx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/markup.json +11 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/data/plans.xlsx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +10 -0
- package/dist/node_modules/@allyhub/office-extension/package.json +124 -0
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +53 -10
- package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/digest.js +1 -1
- package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -11
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
- package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +4 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +45 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
- package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
- package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +26 -20
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
- package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/film.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/piece.js +2 -2
- 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/dist/index.js +4 -4
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/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/dynamic.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/logical.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/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +3 -3
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/evaluate.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/audio-icon.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +5 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/item.js +2 -0
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub/slides-runtime/dist/slide-css.js +20 -0
- 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/install.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +2 -2
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +20 -20
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/doc.js +17 -2
- package/dist/node_modules/@allyhub/telemetry/dist/level.js +2 -2
- package/dist/node_modules/@allyhub/telemetry/dist/levels.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/dist/scrub.js +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
- package/dist/node_modules/@allyhub/text-extension/markup/markup.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/archive/assets.zip +0 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/markup.json +10 -0
- package/dist/node_modules/@allyhub/text-extension/package.json +35 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +3 -3
- package/dist/node_modules/@allyhub/video-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +13 -12
- package/dist/project.js +1 -1
- package/dist/telemetry.js +3 -3
- package/dist/text/console-text.js +2 -2
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-9z0ZEYUq.js → abnfDiagram-WEYOIA3C-CHNpVSPv.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-ELMO_PA6.js → architecture-WOLXFQ4H-gPsJqQwV.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-C0yuCWU3.js → architectureDiagram-ZHVYKT53-CEIDcC6r.js} +1 -1
- package/editor-web/assets/arrow-down-B8VUPCGi.js +1 -0
- package/editor-web/assets/arrow-up-Ds4juY8X.js +1 -0
- package/editor-web/assets/article-BHTjq0_Y.js +3 -0
- package/editor-web/assets/article-DfELjJ2o.js +7 -0
- package/editor-web/assets/{audio-lines-1s1eRs4Q.js → audio-lines-PZj77e7t.js} +1 -1
- package/editor-web/assets/bar-button-J9vbfzTx.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-vi6JOg4o.js → blockDiagram-RJAE7QA3-CUzEGVet.js} +4 -4
- package/editor-web/assets/browser-C1XuTMlp.js +1 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-Agf_H8uS.js → c4Diagram-XDPPPE54-CB94NR9s.js} +1 -1
- package/editor-web/assets/calc-worker-BdHh5LXM.js +45 -0
- package/editor-web/assets/channel-DCDCx5Es.js +1 -0
- package/editor-web/assets/chart-amT4lgX3.js +2 -0
- package/editor-web/assets/chart-file-CfbWK9l1.js +1 -0
- package/editor-web/assets/{chart-no-axes-column-CJmeYOSo.js → chart-no-axes-column-Be0lFcGF.js} +1 -1
- package/editor-web/assets/{chunk-2E7WHVMD-XalaZaha.js → chunk-2E7WHVMD-DFYo_Boi.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-DUlRZkCS.js → chunk-4EMNKR2T-CLLjmweX.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-DTa7whGr.js → chunk-55XCU76K-CkwQ_3m1.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-85zCPzj0.js → chunk-7S6XSTFO-V-AvHpAB.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-CWBseIyh.js → chunk-AQDTSKZB-PjHyYpb8.js} +1 -1
- package/editor-web/assets/chunk-DSNLSHJZ-QaczBS3J.js +127 -0
- package/editor-web/assets/{chunk-HAGFOTED-DFWda2Rk.js → chunk-HAGFOTED-aLaQB5Xu.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-aXibFitC.js → chunk-HNE4Q36P-De3ftDQR.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CtJUuFdN.js → chunk-NQOKRVIF-CrhVQyvP.js} +17 -17
- package/editor-web/assets/{chunk-UHW7PFBP-B6QKSKWE.js → chunk-UHW7PFBP-BFmZ5ZLn.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-CF6Al55P.js → chunk-VQ5W62QI-CzppUHLA.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-w2TKLkyw.js → chunk-WQQL4CDK-BrAU7V6v.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-DVGOATM3.js → chunk-YZO67HFG-BSiF71qj.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-Cq7MMjDP.js → chunk-ZAUX2LTX-BJc4r5b1.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-GMW_lBh4.js → chunk-ZCHMQSOR-CkGTuehB.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-C7AK5Bkj.js → classDiagram-v2-4MYWR3UA-Byxc7J88.js} +7 -7
- package/editor-web/assets/code-CD-CbJG9.js +1 -0
- package/editor-web/assets/collaborator-BU4qU7O3.js +1 -0
- package/editor-web/assets/{copy-DvOiv9Ra.js → copy-CuJSs0nI.js} +1 -1
- package/editor-web/assets/{createLucideIcon-REX213UO.js → createLucideIcon-lm_6n8YT.js} +1 -1
- package/editor-web/assets/csv-Bwre9FdI.js +11 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-ZnDieQsN.js → cynefin-EF2NZ3EQ-BSxkVbdf.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-BrukKIBF.js → cynefinDiagram-WF24UDRP-IkCgARNs.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-DfO0S2p_.js → dagre-NK4GIZVX-9PgeH6nY.js} +1 -1
- package/editor-web/assets/deck-tTzKONci.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-D43RLesi.js → diagram-CBK3MWTC-DRzeg3Ds.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-bA1B1QQG.js → diagram-I5XIIV2D-B_zeKMN6.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-DAdXBD2K.js → diagram-ODIL2UCW-FFm0O8SN.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-C_KyEaws.js → diagram-PFBEJUXE-DrtCT8OA.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-oXTtENF7.js → diagram-RJA3I4VV-DtxJ3V0q.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Czupe6mO.js → diagram-TYUNFSNR-DmxF_8H_.js} +16 -16
- package/editor-web/assets/dist-BEpzsYn_.js +6 -0
- package/editor-web/assets/dist-BUD4ywMB.js +18 -0
- package/editor-web/assets/{dist-BrGYx10E.js → dist-Bd8IxQPP.js} +1 -1
- package/editor-web/assets/dist-C21CkR7Z.js +531 -0
- package/editor-web/assets/dist-C56mWAec.js +5 -0
- package/editor-web/assets/dist-CAb3W9_P.js +43 -0
- package/editor-web/assets/dist-CEknsRDd.js +24 -0
- package/editor-web/assets/dist-CbZAznNW.js +19 -0
- package/editor-web/assets/{dist-2lNSE-G_.js → dist-D3C6FyrO.js} +1 -1
- package/editor-web/assets/dist-DDzjbKIg.js +4 -0
- package/editor-web/assets/dist-DaEbElXI.js +3 -0
- package/editor-web/assets/dist-Dr3o4vee.js +1 -0
- package/editor-web/assets/{dist-BtRMClDw.js → dist-DruvDNQe.js} +1 -1
- package/editor-web/assets/dist-JLyDtl9X.js +1 -0
- package/editor-web/assets/dist-PBbWAsrV.js +17 -0
- package/editor-web/assets/dist-ZZlQa66J.js +1 -0
- package/editor-web/assets/dist-bQKpw3Zz.js +16 -0
- package/editor-web/assets/dist-d4dayaWE.js +17 -0
- package/editor-web/assets/docx-draw-9Q_fArBC.js +4 -0
- package/editor-web/assets/docx-preview-pcg9ioe3.js +21 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BOhNZmtp.js → ebnfDiagram-V4P3TTPT-DSX1Aoty.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-DoZH3OoE.js → elk-QONTBCTQ-C7gy9q56.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-Bv0KDJi4.js → erDiagram-KYQIGQAA-CKx_HoY4.js} +2 -2
- package/editor-web/assets/esm-BZb5QMQf.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-C-_xzqfj.js → eventmodeling-K75KTNOO-DL4HvSrd.js} +1 -1
- package/editor-web/assets/{file-exclamation-point-C_fX4fpI.js → file-exclamation-point-_L3ElCJ5.js} +1 -1
- package/editor-web/assets/file-question-mark-DlIjUK37.js +1 -0
- package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CAuJlaZX.js → ganttDiagram-R7GPNTJY-N-AP4slN.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-Dx2xLi5C.js → gitGraph-VSP46ZUC-BKRGJKWm.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DHsk_UOT.js → gitGraphDiagram-PDYL7XHY-ClwL7w2_.js} +1 -1
- package/editor-web/assets/{group-pebHQTdP.js → group-BdrTp7gi.js} +1 -1
- package/editor-web/assets/hint-rlht0uxG.js +1 -0
- package/editor-web/assets/index-BedbINE5.css +2 -0
- package/editor-web/assets/index-DG2nHq4D.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-CnKQHx5m.js → info-OHQRW6UA-DpcY8t23.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-ibAVFw_2.js → infoDiagram-MVDRKAX5-ChtmtWni.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-C1OCHt3y.js → ishikawaDiagram-HPEHV2GE-BZNTuG_F.js} +1 -1
- package/editor-web/assets/iso-ahTwmFwH.js +56 -0
- package/editor-web/assets/{italic-CtlNOXN9.js → italic-zw4_eUNF.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-BDdqMOM1.js → journeyDiagram-BOSHW7O7-C3uVmZbL.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-CSAS_zGn.js → kanban-definition-FNSA4HC5-puEhftGG.js} +4 -4
- package/editor-web/assets/{link-CW2KxKT_.js → link-DopSU3aa.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-DTLyYXbn.js → mermaid-parser.core-Bw8re-WE.js} +3 -3
- package/editor-web/assets/mermaid.core-Cc2GIqBr.js +44 -0
- package/editor-web/assets/{mindmap-definition-6OY57UG3-DSWHcglH.js → mindmap-definition-6OY57UG3-C6MUl_S_.js} +3 -3
- package/editor-web/assets/minus-CbPnUIOy.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-_k1BF29s.js → packet-JDAUHWVQ-C75RnvC5.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-B22YyWAa.js → pegDiagram-ECIUJNBX-ChjmsdV4.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-CSwV32hj.js → pie-XZMESJXO-BaKxJQpj.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-rSFNeWnq.js → pieDiagram-GNMPY74T-CT2ez8pr.js} +1 -1
- package/editor-web/assets/progress-CwKcXARv.js +6 -0
- package/editor-web/assets/props-form-D5oKHfpk.js +1 -0
- package/editor-web/assets/purify.es-B9ve_eFf.js +3 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-Xrntfg4j.js → quadrantDiagram-D57K4MC3-BJItlTfk.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-Dwq5qiNw.js → radar-ABXABTNO-DnLzBlTo.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-sIUGWcZh.js → railroad-I3PHUGI6-D5hj6Yv3.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-1rWlT9BX.js → railroad-abnf-LNEFI6M7-DUZlZoPu.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DWdkzEHc.js → railroad-ebnf-DWYD2UWJ-CDyyDC6d.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CME0JBbV.js → railroad-peg-JR7BVNR7-CC3ImNnT.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-Ch4BpP22.js → railroadDiagram-Y72NRBL7-Bjw-8Se5.js} +1 -1
- package/editor-web/assets/{react-Bk7NnOLX.js → react-Edyoga_4.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-CgE-x3wN.js → requirementDiagram-EQYSW5RA-CDFnuEIO.js} +1 -1
- package/editor-web/assets/row-C_svyL8o.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-DBf4G6n3.js → sankeyDiagram-SY24JHO5-CQPVLY1w.js} +1 -1
- package/editor-web/assets/schemas-moE_A7Nj.js +1 -0
- package/editor-web/assets/{scissors-BURkYWPv.js → scissors-B_xOiUhd.js} +1 -1
- package/editor-web/assets/{search-jKDvFIEU.js → search-Ba2BbT6T.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-Bz07CoUS.js → sequenceDiagram-BLEHNHQU-BQzuLmBX.js} +1 -1
- package/editor-web/assets/{session-CUCSWPTE.js → session-s1I85rox.js} +1 -1
- package/editor-web/assets/{sigma-CY2Chbro.js → sigma-DSUsJhMn.js} +1 -1
- package/editor-web/assets/slides-oQ_C0SVJ.js +1 -0
- package/editor-web/assets/snapshots-BPJKywuN.js +1 -0
- package/editor-web/assets/{sound-DUCxe9eC.js → sound-bTlco_K3.js} +1 -1
- package/editor-web/assets/split-7CVjIkSU.js +3 -0
- package/editor-web/assets/square-arrow-out-up-right-DF5dvsSp.js +1 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DuqAmDPP.js → stateDiagram-v2-A6IESKWZ-DOuageUf.js} +7 -7
- package/editor-web/assets/{sticky-note-C5qUDHhC.js → sticky-note-BdkIu5_D.js} +1 -1
- package/editor-web/assets/{strikethrough-DP-7tMz0.js → strikethrough-BwXWi4zg.js} +1 -1
- package/editor-web/assets/surface-DtCjIlrq.js +1 -0
- package/editor-web/assets/svg-CWIBMIQ9.js +1 -0
- package/editor-web/assets/swatch-DhztHwPU.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-C7sOL6rB.js → swimlanes-B3ENRKFQ-CXKkok7X.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +8 -0
- package/editor-web/assets/switch-8MU4Nfxe.js +1 -0
- package/editor-web/assets/{syntax-DSsHrzWF.js → syntax-CU_WPKxt.js} +1 -1
- package/editor-web/assets/{table-CTjNpE4W.js → table-DRbddzx0.js} +1 -1
- package/editor-web/assets/tabs-CiF1N-pL.js +1 -0
- package/editor-web/assets/tag-CIfWT8B_.js +1 -0
- package/editor-web/assets/text-align-start-Cic2-TLh.js +1 -0
- package/editor-web/assets/textarea-D7TnPwv1.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-CaLYz9mc.js → timeline-definition-JXYKGLGB-DgAjAeZp.js} +3 -3
- package/editor-web/assets/{treeView-D4JQ5SDB-D1P1Kyxc.js → treeView-D4JQ5SDB-C0Xvnhck.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-2YaFL53t.js → treemap-SAJKECNS-aXfKAeSX.js} +1 -1
- package/editor-web/assets/{undo-2-DUGGyBdX.js → undo-2-C47jrRp5.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-uYdbUhUS.js → usecaseDiagram-WPOLBNNX-CvUlBa-L.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DHepmX4t.js → vennDiagram-Q3Y3IDCW-qMJ1iCxs.js} +3 -3
- package/editor-web/assets/{video-Xl-OaXRc.js → video-DQrjo1TI.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-Dx0MOPV1.js → wardley-7MLQ67FV-DEdnH0by.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BX8ElwDW.js → wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js} +1 -1
- package/editor-web/assets/{whole-word-6DliXke2.js → whole-word-D3ZAtnkw.js} +1 -1
- package/editor-web/assets/{words-B2FXYyeZ.js → words-0Ww2RyT4.js} +1 -1
- package/editor-web/assets/{words-DFIhHhHF.js → words-XlXG79Ur.js} +1 -1
- package/editor-web/assets/workbook-FSSUiIp9.js +45 -0
- package/editor-web/assets/x-DlhyIKuu.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DoWQRJUS.js → xychartDiagram-4URNHDU4-DV4bSzTb.js} +1 -1
- package/editor-web/assets/{zoom-in-C4lxmIDE.js → zoom-in-PgsC94hP.js} +1 -1
- package/editor-web/index.html +8 -6
- package/package.json +2 -2
- package/editor-web/assets/arrow-down-DzZjFrBL.js +0 -1
- package/editor-web/assets/arrow-up-hdmh9LVD.js +0 -1
- package/editor-web/assets/article-DHFgHYjv.js +0 -3
- package/editor-web/assets/article-Dt9id9Y9.js +0 -7
- package/editor-web/assets/button-BVQH7zxz.js +0 -41
- package/editor-web/assets/calc-worker-jImBXoeb.js +0 -45
- package/editor-web/assets/channel-Dkg198L0.js +0 -1
- package/editor-web/assets/chart-BC3kUUDD.js +0 -2
- package/editor-web/assets/chunk-DSNLSHJZ-BFnyvrWg.js +0 -129
- package/editor-web/assets/code-BID_OoRp.js +0 -1
- package/editor-web/assets/collaborator-2qfw-8OJ.js +0 -1
- package/editor-web/assets/dist-5HNrQ9AU.js +0 -45
- package/editor-web/assets/dist-BPecIPz6.js +0 -530
- package/editor-web/assets/dist-BXJKASX4.js +0 -24
- package/editor-web/assets/dist-BeDRTqQ8.js +0 -38
- package/editor-web/assets/dist-BlL-4sl3.js +0 -43
- package/editor-web/assets/dist-BuqBg8k8.js +0 -1
- package/editor-web/assets/dist-BwW08gSh.js +0 -1
- package/editor-web/assets/dist-C30Thvb3.js +0 -1
- package/editor-web/assets/dist-Cj5AmpVb.js +0 -5
- package/editor-web/assets/dist-CjjnDOa8.js +0 -3
- package/editor-web/assets/dist-D7ur8721.js +0 -6
- package/editor-web/assets/dist-DOHhp09C.js +0 -4
- package/editor-web/assets/dist-LhFEYZza.js +0 -16
- package/editor-web/assets/flowDiagram-IUGLLWBU-C7ZmHJZW.js +0 -1
- package/editor-web/assets/hint-mQB8slJ2.js +0 -1
- package/editor-web/assets/index-BGAXezRR.js +0 -28
- package/editor-web/assets/index-Br4a-QEv.css +0 -2
- package/editor-web/assets/mermaid.core-B8478wZ1.js +0 -44
- package/editor-web/assets/minus-D1tgAHbU.js +0 -1
- package/editor-web/assets/progress-udl4pNsP.js +0 -6
- package/editor-web/assets/props-form-B6mYjTgZ.js +0 -1
- package/editor-web/assets/row-dgHEAE7h.js +0 -1
- package/editor-web/assets/schemas-B89k2jEC.js +0 -1
- package/editor-web/assets/slides-BdaWgL_N.js +0 -1
- package/editor-web/assets/snapshots-CTS2iez5.js +0 -56
- package/editor-web/assets/split-mDSkdQkd.js +0 -3
- package/editor-web/assets/surface-D9qJjJQL.js +0 -1
- package/editor-web/assets/svg-nJtFNJ-7.js +0 -1
- package/editor-web/assets/swatch-S8YuBYyj.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CQ2aWYP-.js +0 -8
- package/editor-web/assets/switch-D5kPl2jO.js +0 -1
- package/editor-web/assets/tabs-C0AHyuE5.js +0 -1
- package/editor-web/assets/textarea-mzr9Kfuf.js +0 -1
|
@@ -1,530 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-B8478wZ1.js","./index-BGAXezRR.js","./rolldown-runtime-COiEfhsA.js","./react-Bk7NnOLX.js","./jsx-runtime-DePvh3-m.js","./button-BVQH7zxz.js","./createLucideIcon-REX213UO.js","./snapshots-CTS2iez5.js","./layout-SWqqA0yV.js","./index-Br4a-QEv.css","./chunk-Y2CYZVJY-DsF7k-Jl.js","./d3-selection-COWvaQNI.js","./chunk-DSNLSHJZ-BFnyvrWg.js","./chunk-YZO67HFG-DVGOATM3.js","./chunk-7S6XSTFO-85zCPzj0.js","./dist-DdXDFcej.js","./chunk-AQDTSKZB-CWBseIyh.js","./chunk-DUW6YSOI-Dgx8z5s3.js","./chunk-UHW7PFBP-B6QKSKWE.js","./chunk-HAGFOTED-DFWda2Rk.js","./chunk-J5ZVWO5B-oDCd-gWO.js","./rough.esm-Dy-Kn_BL.js","./chunk-ZAUX2LTX-Cq7MMjDP.js","./chunk-WQQL4CDK-w2TKLkyw.js","./chunk-HNE4Q36P-aXibFitC.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{a as n,c as r,d as i,o as a,s as o,u as s,v as c}from"./react-Bk7NnOLX.js";import{A as l,At as u,C as d,D as f,E as p,F as m,I as h,L as g,M as _,N as v,O as y,Ot as b,P as x,S,St as C,T as w,Tt as T,_ as E,b as D,bt as O,c as k,d as A,f as j,g as M,gt as N,h as P,ht as ee,j as F,k as I,l as te,m as ne,mt as L,p as re,s as ie,u as ae,v as oe,vt as se,w as ce,x as le,y as ue,yt as de}from"./button-BVQH7zxz.js";import{A as fe,B as pe,J as me,P as he,Q as ge,S as _e,V as ve,W as ye,Y as be,et as xe,it as Se,tt as Ce,x as we}from"./snapshots-CTS2iez5.js";import{g as Te,i as Ee}from"./slides-BdaWgL_N.js";import{t as De}from"./session-CUCSWPTE.js";import{t as Oe}from"./jsx-runtime-DePvh3-m.js";import{t as ke}from"./createLucideIcon-REX213UO.js";import{a as Ae,c as je,d as Me,f as Ne,i as Pe,l as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be,u as Ve}from"./props-form-B6mYjTgZ.js";import{a as He,b as Ue,i as We,n as Ge,s as Ke,v as qe,x as Je,y as Ye}from"./chart-BC3kUUDD.js";import{C as Xe,E as Ze,b as Qe,c as $e,i as et,v as tt,w as nt,x as rt}from"./dist-D7ur8721.js";import{t as it}from"./code-BID_OoRp.js";import{a as at,i as ot,n as st,o as ct,r as lt,t as ut}from"./svg-nJtFNJ-7.js";import{t as dt}from"./copy-DvOiv9Ra.js";import{a as ft,c as pt,i as mt,l as ht,n as gt,s as _t,t as vt}from"./syntax-DSsHrzWF.js";import{D as yt,O as bt,a as xt,i as St,n as Ct,o as wt,t as Tt}from"./dist-BrGYx10E.js";import{t as Et}from"./minus-D1tgAHbU.js";import{$ as Dt,A as Ot,B as kt,D as At,E as jt,F as Mt,H as Nt,I as Pt,J as Ft,L as It,M as Lt,N as Rt,O as zt,P as Bt,R as Vt,S as Ht,T as Ut,U as Wt,V as Gt,a as Kt,at as qt,b as Jt,c as Yt,d as Xt,et as Zt,f as Qt,g as $t,i as en,l as tn,m as nn,n as rn,nt as an,o as on,r as sn,st as cn,tt as ln,u as un,ut as dn,v as fn,w as pn,z as mn}from"./dist-2lNSE-G_.js";import{t as hn}from"./sigma-CY2Chbro.js";import{t as gn}from"./table-CTjNpE4W.js";import{n as _n,t as vn}from"./swatch-S8YuBYyj.js";import{t as yn}from"./switch-D5kPl2jO.js";import{i as bn,n as xn,r as Sn,t as Cn}from"./hint-mQB8slJ2.js";import{E as wn,Q as Tn,Z as En,_ as Dn,_t as On,a as kn,bt as An,c as jn,et as Mn,f as Nn,h as Pn,ht as Fn,i as In,l as Ln,mt as Rn,nt as zn,o as Bn,ot as Vn,p as Hn,pt as Un,q as Wn,st as Gn,t as Kn,tt as qn,u as Jn,xt as Yn}from"./index-BGAXezRR.js";import{t as Xn}from"./row-dgHEAE7h.js";import{A as Zn,B as Qn,D as $n,E as er,F as tr,H as nr,I as rr,P as ir,R as ar,S as or,U as sr,V as cr,h as lr,i as ur,k as dr,n as fr,p as pr,r as mr,t as hr,z as gr}from"./syntax-C0iPON60.js";import{a as _r,c as vr,t as yr}from"./browser-C9NP0ZYz.js";import{r as br,t as xr}from"./lib-KOEbW83T.js";import{D as Sr,E as Cr,S as wr,T as Tr,_ as Er,c as Dr,d as Or,f as kr,g as Ar,h as jr,k as Mr,l as Nr,m as Pr,n as Fr,o as Ir,s as Lr,t as Rr,u as zr,w as Br,y as Vr}from"./dist-YW8hS4IM.js";import{t as Hr}from"./textarea-mzr9Kfuf.js";var Ur=ke(`a-large-small`,[[`path`,{d:`m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16`,key:`xik6mr`}],[`path`,{d:`M15.697 14h5.606`,key:`1stdlc`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]),Wr=ke(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Gr=ke(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Kr=ke(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),qr=ke(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Jr=ke(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Yr=ke(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),Xr=ke(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Zr=ke(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),Qr=ke(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),$r=ke(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),ei=ke(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),ti=ke(`notebook-text`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M9.5 8h5`,key:`11mslq`}],[`path`,{d:`M9.5 12H16`,key:`ktog6x`}],[`path`,{d:`M9.5 16H14`,key:`p1seyn`}]]),ni=ke(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),ri=ke(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),ii=ke(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),ai=ke(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),oi=ke(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),R=e(c(),1),z=Oe();function si(e,t,n){let r=t*Math.min(n,1-n),i=t=>{let i=(t+e/30)%12;return 255*(n-r*Math.max(-1,Math.min(i-3,9-i,1)))};return[i(0),i(8),i(4)]}function ci(e,t){if(e===void 0)return;let n=(t[e]??e).trim().toLowerCase(),r=/^#([0-9a-f])([0-9a-f])([0-9a-f])f?$/.exec(n);if(r)return r.slice(1).map(e=>e+e).join(``).toUpperCase();let i=/^#([0-9a-f]{6})([0-9a-f]{2})?$/.exec(n);if(i?.[1]!==void 0)return i[1].toUpperCase();let a=/^(rgb|hsl)a?\(([^)]*)\)$/.exec(n),[o=NaN,s=NaN,c=NaN]=(a?.[2]??``).split(/[\s,/]+/).filter(Boolean).map(Number.parseFloat);if(a&&![o,s,c].some(Number.isNaN))return(a[1]===`rgb`?[o,s,c]:si(o,s/100,c/100)).map(e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`)).join(``).toUpperCase()}var li=[`#2A78D6`,`#EB6834`,`#1BAF7A`,`#EDA100`,`#E87BA4`,`#008300`],ui={ink:`#1F1D1A`,lead:`#605B51`,leadSoft:`#847F72`,rule:`#EAE6DE`,ruleStrong:`#959083`,ruleMid:`#D6D1C6`,stone:`#F8F6F1`,stone2:`#EFECE5`,stone3:`#E4E0D7`,sheet:`#FFFFFF`},di={good:`#448361`,bad:`#D44C47`,flat:ui.lead},fi=e=>{let t=Number.parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]};function pi(e,t){let[n,r,i]=fi(e),a=0,o=1/0;return t.forEach((e,t)=>{let[s,c,l]=fi(e),u=2*(n-s)**2+4*(r-c)**2+3*(i-l)**2;u<o&&(o=u,a=t)}),a}function mi(e){let t=[...li];if(e===void 0)return t;let n=pi(e,t);return[e,...t.filter((e,t)=>t!==n)]}function hi(e,t){let n=Number.parseInt(e.slice(1),16),r=e=>Math.round(255-(255-e)*t).toString(16).padStart(2,`0`);return`#${r(n>>16&255)}${r(n>>8&255)}${r(n&255)}`.toUpperCase()}function gi(e){let t=mi(e.accent),n=Object.fromEntries(Array.from({length:12},(e,n)=>{let r=t[n%t.length]??ui.leadSoft;return[[`cScale${String(n)}`,hi(r,.22)],[`cScaleLabel${String(n)}`,ui.ink],[`cScalePeer${String(n)}`,hi(r,.6)],[`cScaleInv${String(n)}`,hi(r,.7)]]}).flat()),r=Object.fromEntries(t.map((e,t)=>[`pie${String(t+1)}`,e])),i=t[0]??li[0];return{startOnLoad:!1,securityLevel:`strict`,htmlLabels:!1,fontFamily:e.font,theme:`base`,themeCSS:`.grid .tick line { stroke: ${ui.rule}; } .grid .tick text { fill: ${ui.lead}; } .grid path { stroke-width: 0; } .lineWrapper line, line.lineWrapper { stroke: ${ui.leadSoft}; } .cluster-label text, .cluster-label tspan { font-weight: 600; }`,look:`classic`,layout:`dagre`,elk:{considerModelOrder:`NODES_AND_EDGES`,forceNodeModelOrder:!0,mergeEdges:!1},flowchart:{htmlLabels:!1,nodeSpacing:36,rankSpacing:44,padding:10,curve:`basis`},sequence:{actorMargin:40,width:120,height:44,boxMargin:8,messageFontSize:14,mirrorActors:!1},gantt:{barHeight:22,barGap:6,fontSize:12,sectionFontSize:12},themeVariables:{fontFamily:e.font,fontSize:`14px`,background:ui.sheet,primaryColor:ui.stone,primaryBorderColor:ui.ruleMid,primaryTextColor:ui.ink,secondaryColor:ui.stone2,secondaryBorderColor:ui.ruleMid,secondaryTextColor:ui.ink,tertiaryColor:ui.sheet,tertiaryBorderColor:ui.rule,tertiaryTextColor:ui.ink,mainBkg:ui.stone,nodeBorder:ui.ruleMid,clusterBkg:`#FCFBF8`,clusterBorder:ui.rule,titleColor:ui.ink,textColor:ui.ink,lineColor:ui.leadSoft,edgeLabelBackground:ui.sheet,actorBkg:ui.stone,actorBorder:ui.ruleMid,actorTextColor:ui.ink,actorLineColor:ui.ruleMid,signalColor:ui.lead,signalTextColor:ui.ink,labelBoxBkgColor:ui.stone,labelBoxBorderColor:ui.ruleMid,noteBkgColor:`#FBF3DB`,noteBorderColor:`#E9D9A6`,noteTextColor:ui.ink,sectionBkgColor:ui.stone,altSectionBkgColor:ui.sheet,sectionBkgColor2:ui.stone,gridColor:ui.rule,taskBkgColor:hi(i,.35),taskBorderColor:hi(i,.8),taskTextColor:ui.ink,taskTextLightColor:ui.ink,taskTextOutsideColor:ui.ink,activeTaskBkgColor:hi(i,.18),activeTaskBorderColor:hi(i,.8),doneTaskBkgColor:ui.stone2,doneTaskBorderColor:ui.ruleMid,critBkgColor:hi(`#D6403A`,.3),critBorderColor:`#D6403A`,...n,...r,pieStrokeColor:ui.sheet,pieOuterStrokeColor:ui.rule,pieTitleTextColor:ui.ink,pieSectionTextColor:ui.ink,pieLegendTextColor:ui.ink}}}var _i=[`apa`,`mla`,`gbt7714`];function vi(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`):[]}function yi(e){let t=[],n;for(let r of e.split(`;`)){let e=/^\s*-?@([\w:.#$%&+?<>~/-]+)\s*(?:,\s*(.+?))?\s*$/u.exec(r);e?.[1]&&(t.push(e[1]),e[2]!==void 0&&(n=e[2]))}return{keys:t,...n===void 0?{}:{locator:n}}}function bi(e){let t=[],n=e=>{for(let n of e)if(n.cite!==void 0)for(let e of yi(n.cite).keys)t.includes(e)||t.push(e)};for(let t of _a(e))if(`content`in t&&n(t.content),t.type===`table`)for(let e of t.rows)for(let t of e)n(t);return t}var xi=e=>{let t=e.issued?.[`date-parts`]?.[0];return t?.[0]===void 0?e.issued?.literal??`n.d.`:String(t[0])},Si=e=>e!==void 0&&/[㐀-鿿]/u.test(e);function Ci(e){if(e.literal!==void 0)return e.literal;let t=e.family??``;if(Si(t))return`${t}${e.given??``}`;let n=(e.given??``).split(/[\s.-]+/u).filter(e=>e!==``).map(e=>e.charAt(0).toUpperCase()).join(``);return n===``?t:`${t} ${n}`}function wi(e){if(e.literal!==void 0)return e.literal;if(Si(e.family))return`${e.family??``}${e.given??``}`;let t=(e.given??``).split(/[\s.]+/u).filter(e=>e!==``).map(e=>`${e.charAt(0).toUpperCase()}.`).join(` `);return t===``?e.family??``:`${e.family??``}, ${t}`}var Ti=`\0`,Ei=e=>`${Ti}${e.replaceAll(Ti,``)}${Ti}`,Di=e=>e.split(Ti).map((e,t)=>t%2==1?{text:e,italic:!0}:{text:e}).filter(e=>e.text!==``);function Oi(e){return e.literal===void 0?Si(e.family)?`${e.family??``}${e.given??``}`:e.given===void 0||e.given===``?e.family??``:`${e.family??``}, ${e.given}`:e.literal}function ki(e){return e.literal===void 0?Si(e.family)?`${e.family??``}${e.given??``}`:[e.given,e.family].filter(e=>e!==void 0&&e!==``).join(` `):e.literal}var Ai=e=>e[`container-title`]!==void 0||[`article-journal`,`article-magazine`,`article-newspaper`,`chapter`,`webpage`,`post-weblog`,`paper-conference`].includes(e.type??``);function ji(e){let t=e.author??e.editor??[],[n,r]=t,i=n===void 0?``:t.length===1?Oi(n):t.length===2&&r!==void 0?`${Oi(n)}, and ${ki(r)}`:`${Oi(n)}, et al`,a=i===``?``:i.endsWith(`.`)?`${i} `:`${i}. `,o=e.title??``,s=Ai(e)?`“${o}.” `:`${Ei(o)}. `,c=e.issued?.[`date-parts`]?.[0],l=c?.[0]===void 0?e.issued?.literal:String(c[0]),u=e.page===void 0?void 0:`${/[-–]/u.test(e.page)?`pp.`:`p.`} ${e.page.replace(`-`,`–`)}`,d=e[`container-title`],f=[d===void 0?void 0:Ei(d),e.volume===void 0?void 0:`vol. ${String(e.volume)}`,e.issue===void 0?void 0:`no. ${String(e.issue)}`,e.publisher,l,u].filter(e=>e!==void 0&&e!==``),p=e.DOI===void 0?e.URL:`https://doi.org/${e.DOI}`,m=[...f,...p===void 0?[]:[p]];return`${a}${s}${m.length===0?``:`${m.join(`, `)}.`}`.trim()}var Mi={"article-journal":`J`,article:`J`,"article-magazine":`J`,book:`M`,chapter:`M`,"paper-conference":`C`,thesis:`D`,report:`R`,webpage:`EB/OL`,"post-weblog":`EB/OL`,patent:`P`,"article-newspaper":`N`,standard:`S`,dataset:`DS`};function Ni(e,t,n){return Di(Pi(e,t,n))}function Pi(e,t,n){if(t===`mla`)return ji(e);let r=e.author??e.editor??[];if(t===`gbt7714`){let t=Si(e.title)||r.some(e=>Si(e.family)),i=r.slice(0,3).map(Ci),a=r.length>3?`${i.join(`, `)}, ${t?`等`:`et al`}`:i.join(`, `),o=Mi[e.type??``]??`Z`,s=e[`container-title`],c=e.volume===void 0?``:`, ${String(e.volume)}${e.issue===void 0?``:`(${String(e.issue)})`}`,l=e.page===void 0?``:`: ${e.page}`,u=s===void 0?[e[`publisher-place`],e.publisher].filter(e=>e!==void 0).join(`: `)+`${e.publisher===void 0?``:`, `}${xi(e)}${l}`:`${s}, ${xi(e)}${c}${l}`,d=e.DOI===void 0?e.URL===void 0?``:` ${e.URL}.`:` DOI: ${e.DOI}.`;return`${n===void 0?``:`[${String(n)}] `}${a===``?``:`${a}. `}${e.title??``}[${o}]. ${u}.${d}`}let i=r.map(wi),a=i.length<=1?i[0]??``:i.length<=20?`${i.slice(0,-1).join(`, `)}, & ${i.at(-1)??``}`:`${i.slice(0,19).join(`, `)}, … ${i.at(-1)??``}`,o=e[`container-title`],s=e.volume===void 0?``:`, ${Ei(String(e.volume))}${e.issue===void 0?``:`(${String(e.issue)})`}`,c=e.page===void 0?``:`, ${e.page.replace(`-`,`–`)}`,l=o===void 0?e.publisher===void 0?``:` ${e.publisher}.`:` ${Ei(o)}${s}${c}.`,u=e.DOI===void 0?e.URL===void 0?``:` ${e.URL}`:` https://doi.org/${e.DOI}`,d=a===``?``:a.endsWith(`.`)?`${a} `:`${a}. `,f=e.title??``;return`${d}(${xi(e)}). ${o===void 0?Ei(f):f}.${l}${u}`}function Fi(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i=bi(e).flatMap(e=>{let t=r.get(e);return t===void 0?[]:[t]});return(n===`gbt7714`?i:[...i].sort((e,t)=>{let r=e=>(e.author?.[0]?.family??e.author?.[0]?.literal??e.title??``).toLowerCase();return r(e).localeCompare(r(t))||(n===`mla`?(e.title??``).localeCompare(t.title??``):xi(e).localeCompare(xi(t)))})).map((e,t)=>{let r=Ni(e,n,n===`gbt7714`?t+1:void 0);return{item:e,n:t+1,text:r.map(e=>e.text).join(``),pieces:r}})}function Ii(e,t,n,r){let{keys:i,locator:a}=yi(e),o=new Map(t.map(e=>[e.id,e]));if(r===`gbt7714`){let t=i.map(e=>n.get(e));if(t.some(e=>e===void 0))return`[${e}]`;let r=[...new Set(t)].sort((e,t)=>e-t),o=[];for(let e=0;e<r.length;){let t=e;for(;t+1<r.length&&(r[t+1]??0)===(r[t]??0)+1;)t++;o.push(t-e>=2?`${String(r[e])}-${String(r[t])}`:r.slice(e,t+1).join(`, `)),e=t+1}return`[${o.join(`, `)}]${a===void 0?``:a.replace(/^p+\.\s*/u,``)}`}if(r===`mla`){let e=i.map(e=>{let t=o.get(e);if(t===void 0)return`@${e}`;let n=t.author??t.editor??[],r=e=>e===void 0?``:Si(e.family)?`${e.family??``}${e.given??``}`:e.family??e.literal??``;return n.length===0?Ai(t)?`“${t.title??e}”`:t.title??e:n.length===1?r(n[0]):n.length===2?`${r(n[0])} and ${r(n[1])}`:`${r(n[0])} et al.`}),t=a?.replace(/^pp?\.\s*/u,``);return`(${e.join(`; `)}${t===void 0?``:` ${t}`})`}return`(${i.map(e=>{let t=o.get(e);if(t===void 0)return`@${e}`;let n=t.author??t.editor??[],r=e=>e===void 0?``:Si(e.family)?`${e.family??``}${e.given??``}`:e.family??e.literal??``;return`${n.length===0?t.title??e:n.length===1?r(n[0]):n.length===2?`${r(n[0])} & ${r(n[1])}`:`${r(n[0])} et al.`}, ${xi(t)}`}).join(`; `)}${a===void 0?``:`, ${a}`})`}var Li={a3:[297,420],a4:[210,297],a5:[148,210],b5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},Ri=[`sans`,`serif`,`mono`,`times`,`song`,`hei`,`fangsong`,`kai`,`xiaobiaosong`],zi={初号:42,小初:36,一号:26,小一:24,二号:22,小二:18,三号:16,小三:15,四号:14,小四:12,五号:10.5,小五:9,六号:7.5,小六:6.5,七号:5.5,八号:5},Bi=[`left`,`center`,`right`,`outside`,`inside`],Vi=[`apa`,`mla`,`brief`,`memo`,`business-letter`],Hi=new Map([[`report`,`brief`]]),Ui={apa:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:`left`,title:{size:12,weight:`bold`,align:`center`},headings:{1:{size:12,weight:`bold`,align:`center`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`,italic:!0},6:{size:12,weight:`bold`}},header:{right:`{page}`},footer:!1,citationStyle:`apa`},mla:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:`left`,title:{size:12,weight:`normal`,align:`center`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:{right:`{page}`},footer:!1,citationStyle:`mla`},brief:{size:10.5,lineHeight:1.2,paragraphSpacing:.7,title:{size:24,weight:`bold`},headings:{1:{size:18,weight:`bold`},2:{size:14,weight:`bold`,rule:!0},3:{size:11.5,weight:`bold`}}},memo:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:`left`,title:{size:12,weight:`bold`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:!1,footer:{center:`{page}`}},"business-letter":{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:`left`,title:{size:12,weight:`bold`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:!1,footer:!1,pageNumbers:!1}},Wi=e=>Ui[e];function Gi(e){if(e.preset===void 0)return e;let t=Ui[e.preset],n={...t.headings};for(let[r,i]of Object.entries(e.headings??{}))n[Number(r)]={...t.headings?.[Number(r)],...i};return{...t,...e,...t.title||e.title?{title:{...t.title,...e.title}}:{},...Object.keys(n).length>0?{headings:n}:{}}}var Ki=e=>typeof e==`number`?e:zi[e],qi={paper:`letter`,margins:{top:18,right:20,bottom:18,left:20},size:11,lineHeight:1.15,textIndent:0,paragraphSpacing:.5,headingScale:{title:2.3,1:1.75,2:1.45,3:1.15,4:1,5:1,6:1},footer:{left:`{title}`,right:`{page} / {pages}`}},Ji=[`preset`,`paper`,`orientation`,`margins`,`font`,`size`,`line-height`,`text-indent`,`paragraph-spacing`,`text-align`,`grid`,`title`,`headings`,`header`,`footer`,`captions`,`bibliography`,`citation-style`,`accent`,`cover`,`cover-y`,`page-numbers`,`picture-dpi`],Yi=[`left`,`center`,`right`],Xi=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Zi=e=>typeof e==`number`&&Number.isFinite(e)&&e>0;function Qi(e){if(Zi(e))return e;if(typeof e==`string`){let t=e.trim();if(Object.hasOwn(zi,t))return t;let n=/^(\d+(?:\.\d+)?)\s*pt$/u.exec(t);if(n)return Number(n[1])}}var $i=`a size in pt (12) or a Chinese size (${Object.keys(zi).join(`, `)})`;function ea(e,t,n){if(!Xi(e)){n(`${t} holds font, size, weight, align, italic and rule`);return}let r={};for(let[i,a]of Object.entries(e))if(i===`font`)Ri.includes(a)?r.font=a:n(`${t}'s font is ${Ri.join(`, `)}, not ${JSON.stringify(a)}`);else if(i===`size`){let e=Qi(a);e===void 0?n(`${t}'s size is ${$i}`):r.size=e}else i===`weight`?a===`normal`||a===`bold`?r.weight=a:n(`${t}'s weight is normal or bold, not ${JSON.stringify(a)}`):i===`align`?Yi.includes(a)?r.align=a:n(`${t}'s align is left, center or right, not ${JSON.stringify(a)}`):i===`italic`?typeof a==`boolean`?r.italic=a:n(`${t}'s italic is true or false, not ${JSON.stringify(a)}`):i===`rule`?typeof a==`boolean`?r.rule=a:n(`${t}'s rule is true or false, not ${JSON.stringify(a)}`):n(`${t} holds font, size, weight, align, italic and rule: ${i} is not one of them`);return r}function ta(e,t,n){if(e===!1)return!1;if(typeof e==`string`)return{center:e};if(!Xi(e)){n(`a page's ${t} is false, words, or words by place (${Bi.join(`, `)}) with a font and a size`);return}let r={};for(let[i,a]of Object.entries(e))if(i===`font`)Ri.includes(a)?r.font=a:n(`a page's ${t} font is ${Ri.join(`, `)}, not ${JSON.stringify(a)}`);else if(i===`size`){let e=Qi(a);e===void 0?n(`a page's ${t} size is ${$i}`):r.size=e}else Bi.includes(i)?typeof a!=`string`&&typeof a!=`number`?n(`a page's ${t} ${i} is words`):r[i]=String(a):n(`a page's ${t} holds ${Bi.join(`, `)}, font and size: ${i} is not one of them`);return r}function na(e,t){let n={};for(let[r,i]of Object.entries(e))switch(r){case`preset`:{let e=typeof i==`string`?Hi.get(i):void 0;Vi.includes(i)?n.preset=i:e===void 0?t(`a page's preset is ${Vi.join(` or `)}, not ${JSON.stringify(i)}`):n.preset=e;break}case`paper`:{let e=typeof i==`string`?i.trim().toLowerCase():void 0;e!==void 0&&Object.hasOwn(Li,e)?n.paper=e:Array.isArray(i)&&i.length===2&&i.every(Zi)?n.paper=i:t(`a page's paper is ${Object.keys(Li).join(`, `)} or its width and height in mm ([210, 297]), not ${JSON.stringify(i)}`);break}case`orientation`:i===`portrait`||i===`landscape`?n.orientation=i:t(`a page's orientation is portrait or landscape, not ${JSON.stringify(i)}`);break;case`margins`:typeof i==`number`&&i>=0||Array.isArray(i)&&(i.length===2||i.length===4)&&i.every(e=>typeof e==`number`&&e>=0)?n.margins=i:t(`a page's margins are mm: one for all four, [top and bottom, sides], or [top, right, bottom, left]`);break;case`font`:Ri.includes(i)?n.font=i:t(`a page's font is ${Ri.join(`, `)}, not ${JSON.stringify(i)}`);break;case`size`:{let e=Qi(i);e===void 0?t(`a page's size is ${$i}`):n.size=e;break}case`line-height`:Zi(i)?n.lineHeight=i:typeof i==`string`&&/^\d+(\.\d+)?pt$/u.test(i.trim())?n.lineHeight=i.trim():t(`a page's line-height is a multiple (1.5) or pt (28pt), not ${JSON.stringify(i)}`);break;case`text-indent`:typeof i==`number`&&i>=0?n.textIndent=i:t(`a page's text-indent is how many characters a paragraph's first line is set in (2)`);break;case`paragraph-spacing`:typeof i==`number`&&i>=0?n.paragraphSpacing=i:t(`a page's paragraph-spacing is the space between paragraphs in em (0.5)`);break;case`text-align`:i===`left`||i===`justify`?n.textAlign=i:t(`a page's text-align is left or justify, not ${JSON.stringify(i)}`);break;case`grid`:{let e=Xi(i)?i.chars:void 0,r=Xi(i)?i.lines:void 0;Xi(i)&&Object.keys(i).length===2&&Zi(e)&&Zi(r)&&Number.isInteger(e)&&Number.isInteger(r)?n.grid={chars:e,lines:r}:t(`a page's grid is { chars, lines }: characters to a line and lines to a page`);break}case`title`:{let e=ea(i,`the title`,t);e&&(n.title=e);break}case`headings`:{if(!Xi(i)){t(`a page's headings are by level: { 1: { font, size }, 2: … }`);break}let e={};for(let[n,r]of Object.entries(i)){let i=Number(n);if(!Number.isInteger(i)||i<1||i>6){t(`a heading's level is 1 to 6, not ${n}`);continue}let a=ea(r,`heading ${n}`,t);a&&(e[i]=a)}n.headings=e;break}case`header`:case`footer`:{let e=ta(i,r,t);e!==void 0&&(n[r]=e);break}case`captions`:i===`numbered`||i===`plain`?n.captions=i:t(`a page's captions are numbered or plain, not ${JSON.stringify(i)}`);break;case`bibliography`:typeof i==`string`&&i.trim()!==``?n.bibliography=i.trim():t(`a page's bibliography is a CSL-JSON file's path`);break;case`citation-style`:_i.includes(i)?n.citationStyle=i:t(`a page's citation-style is ${_i.join(` or `)}, not ${JSON.stringify(i)}`);break;case`accent`:typeof i==`string`&&i.trim()!==``?n.accent=i.trim():t(`a page's accent is a colour`);break;case`cover`:typeof i==`string`&&i.trim()!==``?n.cover=i.trim():t(`a page's cover is a picture's path`);break;case`cover-y`:typeof i==`number`&&i>=0&&i<=100?n.coverY=i:t(`a cover's cover-y is 0 (its top) to 100 (its bottom), not ${JSON.stringify(i)}`);break;case`picture-dpi`:i===!1?n.pictureDpi=!1:typeof i==`number`&&i>=72&&i<=2400?n.pictureDpi=i:t(`a page's picture-dpi is 72 to 2400 (dots an inch of paper), or false to print pictures as they are, not ${JSON.stringify(i)}`);break;case`page-numbers`:i===!1?n.pageNumbers=!1:i!==!0&&t(`a page's page-numbers is true or false, not ${JSON.stringify(i)}`);break;default:t(`the front matter holds ${Ji.join(`, `)}: ${r} is not one of them`)}return n}var ra=e=>({...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.weight===void 0?{}:{weight:e.weight},...e.align===void 0?{}:{align:e.align},...e.italic===void 0?{}:{italic:e.italic},...e.rule===void 0?{}:{rule:e.rule}}),ia=e=>e===!1?!1:Object.keys(e).length===1&&e.center!==void 0?e.center:{...e},aa=e=>/^[ab]\d$/u.test(e)?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function oa(e){return{...e.preset===void 0?{}:{preset:e.preset},...e.paper===void 0?{}:{paper:typeof e.paper==`string`?aa(e.paper):[...e.paper]},...e.orientation===void 0?{}:{orientation:e.orientation},...e.margins===void 0?{}:{margins:typeof e.margins==`number`?e.margins:[...e.margins]},...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.lineHeight===void 0?{}:{"line-height":e.lineHeight},...e.textIndent===void 0?{}:{"text-indent":e.textIndent},...e.paragraphSpacing===void 0?{}:{"paragraph-spacing":e.paragraphSpacing},...e.textAlign===void 0?{}:{"text-align":e.textAlign},...e.grid===void 0?{}:{grid:{...e.grid}},...e.title===void 0?{}:{title:ra(e.title)},...e.headings===void 0?{}:{headings:Object.fromEntries(Object.entries(e.headings).map(([e,t])=>[e,ra(t)]))},...e.header===void 0?{}:{header:ia(e.header)},...e.footer===void 0?{}:{footer:ia(e.footer)},...e.captions===void 0?{}:{captions:e.captions},...e.bibliography===void 0?{}:{bibliography:e.bibliography},...e.citationStyle===void 0?{}:{"citation-style":e.citationStyle},...e.accent===void 0?{}:{accent:e.accent},...e.cover===void 0?{}:{cover:e.cover},...e.cover===void 0||e.coverY===void 0?{}:{"cover-y":e.coverY},...e.pageNumbers===!1?{"page-numbers":!1}:{},...e.pictureDpi===void 0?{}:{"picture-dpi":e.pictureDpi}}}function sa(e){let t=e.delta?.trim().charAt(0),n=t===`+`||t===`↑`;return!n&&t!==`-`&&t!==`−`&&t!==`–`&&t!==`↓`?`flat`:n===(e.downIsGood===!0)?`bad`:`good`}var ca=[`value`,`percentage`,`category`,`series`],la=[`bold`,`italic`,`underline`,`strike`],ua=(e,t)=>e.note===void 0&&t.note===void 0&&e.cite===void 0&&t.cite===void 0&&e.href===t.href&&JSON.stringify(pa(e.styles))===JSON.stringify(pa(t.styles));function da(e){let t=[],n=(e,n,r)=>{if(e===``)return;let i={text:e,styles:n,...r===void 0?{}:{href:r}},a=t.at(-1);a&&ua(a,i)?a.text+=e:t.push(i)};return e.forEach((r,i)=>{if(r.note!==void 0||r.cite!==void 0||r.text===``&&r.href!==void 0){t.push({...r});return}let{styles:a,href:o}=r,s=!a.code&&o===void 0&&la.some(e=>a[e])?/^(\s*)([\s\S]*?)(\s*)$/u.exec(r.text):null;if(!s){n(r.text,a,o);return}let[,c=``,l=``,u=``]=s,d={...a};delete d.bold,delete d.italic,delete d.underline,delete d.strike;let f=e[i-1]?.note!==void 0,p=e[i+1]?.note!==void 0;n(c,f?a:d,o),n(l,l===``?d:a,o),n(u,p?a:d,o)}),t}var fa=e=>e.length>0&&e.every(e=>typeof e==`object`&&!!e&&typeof e.text==`string`&&typeof e.styles==`object`);function pa(e){if(Array.isArray(e))return(fa(e)?da(e):e).map(pa);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e).sort()){let r=e[n];r!==void 0&&(t[n]=pa(r))}return t}return e}var ma=e=>JSON.stringify(pa(e)),ha=(e,t)=>e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&ma(e)===ma(r)}),ga=e=>e.type===`columns`?e.columns.flatMap(e=>e.blocks):`children`in e?e.children??[]:[];function*_a(e){for(let t of e)yield t,yield*_a(ga(t))}function va(e){return ya(e).numbers}function ya(e){let t=new Map,n=new Set,r=new Set([..._a(e)].flatMap(e=>e.type===`note`?[e.label.toLowerCase()]:[])),i=e=>{for(let i of e){let e=i.note?.toLowerCase();e!==void 0&&r.has(e)&&!t.has(e)&&(t.set(e,t.size+1),n.add(i))}};for(let t of _a(e))if(t.type!==`note`&&(`content`in t&&i(t.content),t.type===`table`))for(let e of t.rows)for(let t of e)i(t);return{numbers:t,first:n}}var ba=e=>e.filter(e=>e.type!==`source`);function xa(e){let t=e.of.lastIndexOf(`#`),n=t<0?``:e.of.slice(t+1);return n!==``&&n!=="default"?n:((t<0?e.of:e.of.slice(0,t)).split(`/`).pop()??``).replace(/\.[^.]+$/u,``)}function Sa(e){let t=e.width??720;return{name:e.of,props:{...e.props},width:t,height:e.height??Math.round(t*.5625),t:e.at??0}}var Ca={gray:`#8B8A85`,brown:`#9A6B4B`,red:`#D6403A`,orange:`#EB6834`,yellow:`#EDA100`,green:`#1BAF7A`,blue:`#2A78D6`,purple:`#8A5CD6`,pink:`#E87BA4`},wa=ui.lead,Ta={grid:ui.rule,axis:ui.ruleMid},Ea={gap:80,overlap:-8},Da={size:10,title:13},Oa=e=>{let t=ci(e,Ca);return t===void 0?void 0:`#${t}`},ka=.55;function Aa(e={},t=[]){let[n=li[0],...r]=mi(e.accent===void 0?void 0:Oa(e.accent)),i=[n,n,...r];t.slice(0,i.length).forEach((e,t)=>{let n=Oa(e);n!==void 0&&(i[t]=n)}),t.length<2&&(i[1]=hi(i[0]??n,ka));let[a,o,s,c,l,u]=i;return{dk1:wa,lt1:`#FFFFFF`,dk2:`#37352F`,lt2:`#EFEFED`,accent1:a,accent2:o,accent3:s,accent4:c,accent5:l,accent6:u,hlink:a,folHlink:a}}var ja=new Set([`line`,`line-markers`,`scatter-lines`]),Ma={width:560,aspect:.6};function Na(e,t=720){let n=e.kind!==void 0&&We(e.kind),r=e.width??(n?Math.min(t,Ma.width):t);return{width:r,height:e.height??Math.round(r*(n?Ma.aspect:.5625))}}function Pa(e){let t=e.trim().replace(/,/gu,``);if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:void 0}function Fa(e,t){let n=He(e.kind),r=e.labels,i=e.min!==void 0||e.max!==void 0||e.format!==void 0?{...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.format===void 0?{}:{format:e.format}}:void 0,a={...r===void 0?{}:{labels:{...r.includes(`value`)?{value:!0}:{},...r.includes(`percentage`)?{percentage:!0}:{},...r.includes(`category`)?{category:!0}:{},...r.includes(`series`)?{series:!0}:{},...e.format===void 0?{}:{format:e.format}}},...i===void 0?{}:{value_axis:i},...We(e.kind)?{vary_by_categories:!0}:{}};if(e.table===void 0)return e.data===void 0||e.categories===void 0?void 0:{type:e.kind,data:e.data,categories:e.categories,series:e.series??[],...a};let[o=[],...s]=e.table,c=Math.max(0,...e.table.map(e=>e.length)),l=(e,t)=>e[t]??``,u=e=>s.map((n,r)=>{let i=Pa(l(n,e));return i===void 0?(t.push(`row ${String(r+1)} of its table: "${l(n,e)}" under ${l(o,e)||`column ${String(e+1)}`} is not a number`),null):i}),d=Array.from({length:Math.max(0,c-1)},(e,t)=>{let r=t+1;return{name:l(o,r)||`Series ${String(r)}`,values:u(r),...n?{x:u(0)}:{}}});if(d.length!==0)return{type:e.kind,...n?{}:{categories:s.map(e=>l(e,0))},series:d,...a}}function Ia(e,t){if(e.legend!==`none`)return e.legend===void 0?We(e.kind)?`right`:t.series.length>1?`top`:void 0:e.legend}function La(e,t={}){let n=[],r=Fa(e,n);if(!r)return{problems:[...n,`it has no numbers to draw`]};let i=Ae(r,{title:e.title,base:t.base??``,rows:e=>{let n=t.data?.(e);if(n===void 0)throw Error(`there is no such file or table`);return n},problem:e=>n.push(e)});if(!i)return{problems:n};let a=Ia(e,i),o=Aa(t.page,e.colors),s=[o.accent1,o.accent2,o.accent3,o.accent4,o.accent5,o.accent6],c=e=>({rgb:s[e%s.length]??`#000000`}),l=i.series.length===1&&!We(e.kind)&&(e.colors?.length??0)>1?(e.colors??[]).map(Oa):void 0,u=l!==void 0||Ke(i),d=He(e.kind),f=e.table===void 0?e.categories:e.table[0]?.[0],p=i.series.length===1?i.series[0]?.name:void 0,m={gridline_color:{rgb:Ta.grid},line_color:{rgb:Ta.axis}},h=Ge(e.kind),g=e.kind.endsWith(`-clustered`),_={...i,category_axis:{...m,...i.category_axis,...d&&f!==void 0&&f!==``?{title:f}:{}},value_axis:{...m,...i.value_axis,...d&&p!==void 0&&p!==``?{title:p}:{}},...h&&i.gap_width===void 0?{gap_width:Ea.gap}:{},...g&&i.series.length>1&&i.overlap===void 0?{overlap:Ea.overlap}:{},series:i.series.map((t,n)=>{let r=u||t.color!==void 0?t:{...t,color:c(n)};return e.smooth&&ja.has(e.kind)?{...r,smooth:!0}:r}),...l===void 0?{}:{vary_by_categories:!0},...u?{category_colors:i.categories.map((e,t)=>{let n=l?.[t%l.length];return n===void 0?c(l===void 0?t:0):{rgb:n}})}:{},...a===void 0?{}:{legend:a},font_size:Da.size,title_size:Da.title,font_color:{rgb:wa}};return a===void 0&&delete _.legend,{chart:_,problems:n}}function Ra(e,t){if(e.alt!==void 0)return e.alt;let n=t?.series.map(e=>e.name).join(`, `)??``,r=[e.title,n].filter(e=>e!==void 0&&e!==``);return r.length>0?r.join(`: `):`Chart`}var za={ink:`#D4D3CF`,grid:`#3A3936`,axis:`#5C5B57`};function Ba(e,t={}){let n=La(e,t),{problems:r}=n;if(!n.chart)return{problems:r};let i=e=>({...e,gridline_color:{rgb:za.grid},line_color:{rgb:za.axis}}),a=t.dark===!0?{...n.chart,font_color:{rgb:za.ink},value_axis:i(n.chart.value_axis),category_axis:i(n.chart.category_axis)}:n.chart,{width:o,height:s}=Na(e,t.room);return{svg:ut(a,o,s,{colors:Aa(t.page,e.colors),paper:`none`,edge:`none`,...t.font===void 0?{}:{font:t.font},label:Ra(e,a)}),problems:r}}var Va=`\\p{RI}\\p{RI}|[#*0-9]\\uFE0F?\\u20E3|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)\\p{EMod}?(?:\\u200D(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F?)\\p{EMod}?)*`,Ha=`display:inline;width:1em;height:1em;margin:0 0.05em;vertical-align:-0.12em`;function Ua(e={}){let t=JSON.stringify(e.scope??`body`),n=e.face===void 0?`undefined`:JSON.stringify(e.face),r=String(e.size??128);return`(async () => {
|
|
3
|
-
const pattern = new RegExp(${JSON.stringify(Va)}, "gu");
|
|
4
|
-
const root = document.querySelector(${t});
|
|
5
|
-
if (!root) return;
|
|
6
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
7
|
-
const nodes = [];
|
|
8
|
-
for (let n = walker.nextNode(); n; n = walker.nextNode()) {
|
|
9
|
-
pattern.lastIndex = 0;
|
|
10
|
-
const p = n.parentElement;
|
|
11
|
-
if (p && !p.closest("script, style, textarea, title") && pattern.test(n.data)) nodes.push(n);
|
|
12
|
-
}
|
|
13
|
-
pattern.lastIndex = 0;
|
|
14
|
-
if (nodes.length === 0) return;
|
|
15
|
-
const face = ${n};
|
|
16
|
-
if (face !== undefined) {
|
|
17
|
-
const all = nodes.map((n) => n.data.match(pattern).join("")).join("");
|
|
18
|
-
const faces = await document.fonts.load("64px " + JSON.stringify(face), all).catch(() => []);
|
|
19
|
-
if (faces.length === 0) return;
|
|
20
|
-
}
|
|
21
|
-
await document.fonts.ready;
|
|
22
|
-
const size = ${r};
|
|
23
|
-
const canvas = document.createElement("canvas");
|
|
24
|
-
canvas.width = canvas.height = size;
|
|
25
|
-
const ctx = canvas.getContext("2d");
|
|
26
|
-
ctx.textAlign = "center";
|
|
27
|
-
ctx.textBaseline = "middle";
|
|
28
|
-
const drawn = new Map();
|
|
29
|
-
const picture = (e, family) => {
|
|
30
|
-
const key = family + "\\u0000" + e;
|
|
31
|
-
if (!drawn.has(key)) {
|
|
32
|
-
ctx.clearRect(0, 0, size, size);
|
|
33
|
-
ctx.font = (size * 0.86) + "px " + family;
|
|
34
|
-
ctx.fillText(e, size / 2, size / 2);
|
|
35
|
-
drawn.set(key, canvas.toDataURL("image/png"));
|
|
36
|
-
}
|
|
37
|
-
const img = document.createElement("img");
|
|
38
|
-
img.className = "emoji";
|
|
39
|
-
img.alt = e;
|
|
40
|
-
img.setAttribute("style", ${JSON.stringify(Ha)});
|
|
41
|
-
img.src = drawn.get(key);
|
|
42
|
-
return img;
|
|
43
|
-
};
|
|
44
|
-
for (const n of nodes) {
|
|
45
|
-
const family = face !== undefined ? JSON.stringify(face) : getComputedStyle(n.parentElement).fontFamily;
|
|
46
|
-
const parts = [];
|
|
47
|
-
let at = 0;
|
|
48
|
-
for (const m of n.data.matchAll(pattern)) {
|
|
49
|
-
if (m.index > at) parts.push(document.createTextNode(n.data.slice(at, m.index)));
|
|
50
|
-
parts.push(picture(m[0], family));
|
|
51
|
-
at = m.index + m[0].length;
|
|
52
|
-
}
|
|
53
|
-
if (at < n.data.length) parts.push(document.createTextNode(n.data.slice(at)));
|
|
54
|
-
n.replaceWith(...parts);
|
|
55
|
-
}
|
|
56
|
-
await Promise.all([...root.querySelectorAll("img.emoji")].map((i) => i.decode().catch(() => undefined)));
|
|
57
|
-
})()`}function Wa(e,t=720){let n=e.columns.map(e=>e.width??1),r=n.reduce((e,t)=>e+t,0)||1,i=Math.max(0,t-32*(e.columns.length-1));return n.map(e=>Math.round(i*e/r))}function Ga(e){return e?{figure:`图`,table:`表`}:{figure:`Figure`,table:`Table`}}function Ka(e){switch(e.type){case`image`:case`component`:case`table`:return e.caption;case`chart`:return e.title;default:return}}function qa(e){return e.type===`image`||e.type===`component`||e.type===`table`||e.type===`chart`?e.id:void 0}function Ja(e){let t=0,n=0;for(let r of _a(e))if(`content`in r)for(let e of r.content)t+=(e.text.match(/[㐀-鿿-ヿ]/gu)??[]).length,n+=(e.text.match(/[A-Za-z]+/gu)??[]).length;return t>n}function Ya(e,t={}){let n=new Map;if(Gi(t).captions===`plain`)return n;let r=Ga(Ja(e)),i={figure:0,table:0};for(let t of _a(e)){if(Ka(t)===void 0)continue;let e=t.type===`table`?`table`:`figure`;i[e]+=1,n.set(t,{kind:e,n:i[e],label:`${r[e]} ${String(i[e])}`})}return n}var B=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},Xa=/([A-Z])/g,Za=e=>e.replace(Xa,`-$1`).toLowerCase(),Qa={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},$a=/[&><"']/g,eo=e=>String(e).replace($a,e=>Qa[e]),to=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?to(e.body[0]):e:e.type===`font`?to(e.body):e,no=new Set([`mathord`,`textord`,`atom`]),ro=e=>no.has(to(e).type),io=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},ao={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function oo(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function so(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:oo(Array.isArray(e.type)?e.type[0]:e.type)}function co(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?so(r):a?a(i):i}var lo=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(ao)){var n=ao[t];n&&co(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=io(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},uo=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return bo[xo[this.id]]}sub(){return bo[So[this.id]]}fracNum(){return bo[Co[this.id]]}fracDen(){return bo[wo[this.id]]}cramp(){return bo[To[this.id]]}text(){return bo[Eo[this.id]]}isTight(){return this.size>=2}},fo=0,po=1,mo=2,ho=3,go=4,_o=5,vo=6,yo=7,bo=[new uo(fo,0,!1),new uo(po,0,!0),new uo(mo,1,!1),new uo(ho,1,!0),new uo(go,2,!1),new uo(_o,2,!0),new uo(vo,3,!1),new uo(yo,3,!0)],xo=[go,_o,go,_o,vo,yo,vo,yo],So=[_o,_o,_o,_o,yo,yo,yo,yo],Co=[mo,ho,go,_o,vo,yo,vo,yo],wo=[ho,ho,_o,_o,yo,yo,yo,yo],To=[po,po,ho,ho,_o,_o,yo,yo],Eo=[fo,po,mo,ho,mo,ho,mo,ho],Do={DISPLAY:bo[fo],TEXT:bo[mo],SCRIPT:bo[go],SCRIPTSCRIPT:bo[vo]},Oo=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function ko(e){for(var t=0;t<Oo.length;t++)for(var n=Oo[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Ao=[];Oo.forEach(e=>e.blocks.forEach(e=>Ao.push(...e)));function jo(e){for(var t=0;t<Ao.length;t+=2)if(e>=Ao[t]&&e<=Ao[t+1])return!0;return!1}var Mo=e=>e+` `+e,No=80,Po=function(e,t){return`M95,`+(622+e+t)+`
|
|
58
|
-
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
59
|
-
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
60
|
-
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
61
|
-
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
62
|
-
c69,-144,104.5,-217.7,106.5,-221
|
|
63
|
-
l`+e/2.075+` -`+e+`
|
|
64
|
-
c5.3,-9.3,12,-14,20,-14
|
|
65
|
-
H400000v`+(40+e)+`H845.2724
|
|
66
|
-
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
67
|
-
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
68
|
-
M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Fo=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
69
|
-
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
70
|
-
c340,-704.7,510.7,-1060.3,512,-1067
|
|
71
|
-
l`+e/2.084+` -`+e+`
|
|
72
|
-
c4.7,-7.3,11,-11,19,-11
|
|
73
|
-
H40000v`+(40+e)+`H1012.3
|
|
74
|
-
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
75
|
-
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
76
|
-
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
77
|
-
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
78
|
-
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Io=function(e,t){return`M983 `+(10+e+t)+`
|
|
79
|
-
l`+e/3.13+` -`+e+`
|
|
80
|
-
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
81
|
-
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
82
|
-
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
83
|
-
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
84
|
-
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
85
|
-
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
86
|
-
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
87
|
-
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Lo=function(e,t){return`M424,`+(2398+e+t)+`
|
|
88
|
-
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
89
|
-
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
90
|
-
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
91
|
-
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
92
|
-
l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
93
|
-
v`+(40+e)+`H1014.6
|
|
94
|
-
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
95
|
-
c-2,6,-10,9,-24,9
|
|
96
|
-
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
|
|
97
|
-
h400000v`+(40+e)+`h-400000z`},Ro=function(e,t){return`M473,`+(2713+e+t)+`
|
|
98
|
-
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
|
|
99
|
-
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
100
|
-
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
101
|
-
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
102
|
-
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
103
|
-
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
104
|
-
606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},zo=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},Bo=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
|
|
105
|
-
H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
106
|
-
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
107
|
-
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
108
|
-
219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},Vo=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=Po(t,No);break;case`sqrtSize1`:r=Fo(t,No);break;case`sqrtSize2`:r=Io(t,No);break;case`sqrtSize3`:r=Lo(t,No);break;case`sqrtSize4`:r=Ro(t,No);break;case`sqrtTall`:r=Bo(t,No,n)}return r},Ho=function(e,t){switch(e){case`⎜`:return Mo(`M291 0 H417 V`+t+` H291z`);case`∣`:return Mo(`M145 0 H188 V`+t+` H145z`);case`∥`:return Mo(`M145 0 H188 V`+t+` H145z`)+Mo(`M367 0 H410 V`+t+` H367z`);case`⎟`:return Mo(`M457 0 H583 V`+t+` H457z`);case`⎢`:return Mo(`M319 0 H403 V`+t+` H319z`);case`⎥`:return Mo(`M263 0 H347 V`+t+` H263z`);case`⎪`:return Mo(`M384 0 H504 V`+t+` H384z`);case`⏐`:return Mo(`M312 0 H355 V`+t+` H312z`);case`‖`:return Mo(`M257 0 H300 V`+t+` H257z`)+Mo(`M478 0 H521 V`+t+` H478z`);default:return``}},Uo={doubleleftarrow:`M262 157
|
|
109
|
-
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
110
|
-
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
111
|
-
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
112
|
-
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
113
|
-
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
114
|
-
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
115
|
-
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
116
|
-
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
117
|
-
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
118
|
-
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
119
|
-
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
120
|
-
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
121
|
-
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
122
|
-
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
123
|
-
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
124
|
-
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
125
|
-
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
126
|
-
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
127
|
-
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
128
|
-
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
129
|
-
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
130
|
-
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
131
|
-
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
132
|
-
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
133
|
-
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
134
|
-
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
135
|
-
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
136
|
-
435 0h399565z`,leftgroupunder:`M400000 262
|
|
137
|
-
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
138
|
-
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
139
|
-
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
140
|
-
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
141
|
-
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
142
|
-
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
143
|
-
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
144
|
-
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
145
|
-
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
146
|
-
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
147
|
-
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
148
|
-
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
149
|
-
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
150
|
-
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
151
|
-
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
152
|
-
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
153
|
-
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
154
|
-
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Mo(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:Mo(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:Mo(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:Mo(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
155
|
-
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
156
|
-
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
157
|
-
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Mo(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
|
|
158
|
-
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
159
|
-
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
160
|
-
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
161
|
-
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
162
|
-
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
163
|
-
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
164
|
-
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
165
|
-
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
166
|
-
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
167
|
-
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
168
|
-
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
169
|
-
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
170
|
-
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
171
|
-
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
172
|
-
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
173
|
-
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
174
|
-
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
175
|
-
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
176
|
-
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
177
|
-
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
178
|
-
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
179
|
-
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
180
|
-
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
181
|
-
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
182
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
183
|
-
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
184
|
-
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
185
|
-
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
186
|
-
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
187
|
-
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
188
|
-
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
189
|
-
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
190
|
-
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
191
|
-
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
192
|
-
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
193
|
-
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
194
|
-
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
195
|
-
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
196
|
-
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
197
|
-
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
198
|
-
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
199
|
-
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
200
|
-
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
201
|
-
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
202
|
-
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
203
|
-
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
204
|
-
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
205
|
-
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
206
|
-
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Mo(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:Mo(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:Mo(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
207
|
-
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
208
|
-
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
209
|
-
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
210
|
-
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
211
|
-
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
212
|
-
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
213
|
-
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
214
|
-
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
215
|
-
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
216
|
-
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
217
|
-
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
218
|
-
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
219
|
-
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
220
|
-
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
221
|
-
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
222
|
-
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
223
|
-
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
224
|
-
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
225
|
-
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
226
|
-
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
227
|
-
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
228
|
-
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
229
|
-
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
230
|
-
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
231
|
-
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
232
|
-
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
233
|
-
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
234
|
-
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
235
|
-
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
236
|
-
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
237
|
-
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
238
|
-
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
239
|
-
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
240
|
-
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
241
|
-
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
242
|
-
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
243
|
-
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
244
|
-
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
245
|
-
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
246
|
-
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
247
|
-
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
248
|
-
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
249
|
-
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
250
|
-
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
251
|
-
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
252
|
-
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
253
|
-
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
254
|
-
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
255
|
-
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
256
|
-
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
257
|
-
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
258
|
-
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
259
|
-
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
260
|
-
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
261
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
262
|
-
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
263
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
264
|
-
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
265
|
-
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
266
|
-
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
267
|
-
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
268
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
269
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
270
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
271
|
-
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
272
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
273
|
-
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
274
|
-
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
275
|
-
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
276
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
277
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
278
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
279
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Wo=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
|
|
280
|
-
H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
|
|
281
|
-
M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
282
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
283
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
284
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
285
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
|
286
|
-
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
287
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
288
|
-
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
|
|
289
|
-
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
|
|
290
|
-
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
|
|
291
|
-
M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
|
|
292
|
-
M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
293
|
-
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
294
|
-
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
295
|
-
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
296
|
-
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
297
|
-
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
298
|
-
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
299
|
-
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
300
|
-
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
301
|
-
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
|
302
|
-
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
303
|
-
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
304
|
-
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
305
|
-
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
306
|
-
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
307
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function Go(e){return`toText`in e}var Ko=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(Go(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},qo={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Jo={ex:!0,em:!0,mu:!0},Yo=function(e){return typeof e!=`string`&&(e=e.unit),e in qo||e in Jo||e===`ex`},Xo=function(e,t){var n;if(e.unit in qo)n=qo[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new B(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Zo=function(e){return+e.toFixed(4)+`em`},Qo=function(e){return e.filter(e=>e).join(` `)},$o=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=Za(n)+`:`+r+`;`)}return t},es=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},ts=function(e){var t=document.createElement(e);t.className=Qo(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},ns=/[\s"'>/=\x00-\x1f]/,rs=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+eo(Qo(this.classes))+`"`);var n=$o(this.style);n&&(t+=` style="`+eo(n)+`"`);for(var r of Object.keys(this.attributes)){if(ns.test(r))throw new B(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+eo(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},is=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,es.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return ts.call(this,`span`)}toMarkup(){return rs.call(this,`span`)}},as=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,es.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return ts.call(this,`a`)}toMarkup(){return rs.call(this,`a`)}},os=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+eo(this.src)+`"`+(` alt="`+eo(this.alt)+`"`),t=$o(this.style);return t&&(e+=` style="`+eo(t)+`"`),e+=`'/>`,e}},ss={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},cs=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=ko(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=ss[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=Zo(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=Qo(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=eo(Qo(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+Zo(this.italic)+`;`),n+=$o(this.style),n&&(e=!0,t+=` style="`+eo(n)+`"`);var r=eo(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},ls=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+eo(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},us=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,Uo[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+eo(this.alternate)+`"/>`:`<path d="`+eo(Uo[this.pathName])+`"/>`}},ds=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+eo(this.attributes[t])+`"`;return e+=`/>`,e}};function fs(e){if(e instanceof cs)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function ps(e){if(e instanceof is)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var ms=e=>e instanceof is||e instanceof as||e instanceof Ko,hs={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},gs={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},_s={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function vs(e,t){hs[e]=t}function ys(e,t,n){if(!hs[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=hs[t][r];if(!i&&e[0]in _s&&(r=_s[e[0]].charCodeAt(0),i=hs[t][r]),!i&&n===`text`&&jo(r)&&(i=hs[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var bs={};function xs(e){var t=e>=5?0:e>=3?1:2;if(!bs[t]){var n=bs[t]={cssEmPerMu:gs.quad[t]/18};for(var r of Object.keys(gs))n[r]=gs[r][t]}return bs[t]}var Ss={math:{},text:{}};function V(e,t,n,r,i,a){Ss[e][i]={font:t,group:n,replace:r},a&&r&&(Ss[e][r]=Ss[e][i])}var H=`math`,U=`text`,W=`main`,G=`ams`,Cs=`accent-token`,ws=`bin`,Ts=`close`,Es=`inner`,Ds=`mathord`,Os=`op-token`,ks=`open`,As=`punct`,K=`rel`,js=`spacing`,q=`textord`;V(H,W,K,`≡`,`\\equiv`,!0),V(H,W,K,`≺`,`\\prec`,!0),V(H,W,K,`≻`,`\\succ`,!0),V(H,W,K,`∼`,`\\sim`,!0),V(H,W,K,`⊥`,`\\perp`),V(H,W,K,`⪯`,`\\preceq`,!0),V(H,W,K,`⪰`,`\\succeq`,!0),V(H,W,K,`≃`,`\\simeq`,!0),V(H,W,K,`∣`,`\\mid`,!0),V(H,W,K,`≪`,`\\ll`,!0),V(H,W,K,`≫`,`\\gg`,!0),V(H,W,K,`≍`,`\\asymp`,!0),V(H,W,K,`∥`,`\\parallel`),V(H,W,K,`⋈`,`\\bowtie`,!0),V(H,W,K,`⌣`,`\\smile`,!0),V(H,W,K,`⊑`,`\\sqsubseteq`,!0),V(H,W,K,`⊒`,`\\sqsupseteq`,!0),V(H,W,K,`≐`,`\\doteq`,!0),V(H,W,K,`⌢`,`\\frown`,!0),V(H,W,K,`∋`,`\\ni`,!0),V(H,W,K,`∝`,`\\propto`,!0),V(H,W,K,`⊢`,`\\vdash`,!0),V(H,W,K,`⊣`,`\\dashv`,!0),V(H,W,K,`∋`,`\\owns`),V(H,W,As,`.`,`\\ldotp`),V(H,W,As,`⋅`,`\\cdotp`),V(H,W,As,`⋅`,`·`),V(U,W,q,`⋅`,`·`),V(H,W,q,`#`,`\\#`),V(U,W,q,`#`,`\\#`),V(H,W,q,`&`,`\\&`),V(U,W,q,`&`,`\\&`),V(H,W,q,`ℵ`,`\\aleph`,!0),V(H,W,q,`∀`,`\\forall`,!0),V(H,W,q,`ℏ`,`\\hbar`,!0),V(H,W,q,`∃`,`\\exists`,!0),V(H,W,q,`∇`,`\\nabla`,!0),V(H,W,q,`♭`,`\\flat`,!0),V(H,W,q,`ℓ`,`\\ell`,!0),V(H,W,q,`♮`,`\\natural`,!0),V(H,W,q,`♣`,`\\clubsuit`,!0),V(H,W,q,`℘`,`\\wp`,!0),V(H,W,q,`♯`,`\\sharp`,!0),V(H,W,q,`♢`,`\\diamondsuit`,!0),V(H,W,q,`ℜ`,`\\Re`,!0),V(H,W,q,`♡`,`\\heartsuit`,!0),V(H,W,q,`ℑ`,`\\Im`,!0),V(H,W,q,`♠`,`\\spadesuit`,!0),V(H,W,q,`§`,`\\S`,!0),V(U,W,q,`§`,`\\S`),V(H,W,q,`¶`,`\\P`,!0),V(U,W,q,`¶`,`\\P`),V(H,W,q,`†`,`\\dag`),V(U,W,q,`†`,`\\dag`),V(U,W,q,`†`,`\\textdagger`),V(H,W,q,`‡`,`\\ddag`),V(U,W,q,`‡`,`\\ddag`),V(U,W,q,`‡`,`\\textdaggerdbl`),V(H,W,Ts,`⎱`,`\\rmoustache`,!0),V(H,W,ks,`⎰`,`\\lmoustache`,!0),V(H,W,Ts,`⟯`,`\\rgroup`,!0),V(H,W,ks,`⟮`,`\\lgroup`,!0),V(H,W,ws,`∓`,`\\mp`,!0),V(H,W,ws,`⊖`,`\\ominus`,!0),V(H,W,ws,`⊎`,`\\uplus`,!0),V(H,W,ws,`⊓`,`\\sqcap`,!0),V(H,W,ws,`∗`,`\\ast`),V(H,W,ws,`⊔`,`\\sqcup`,!0),V(H,W,ws,`◯`,`\\bigcirc`,!0),V(H,W,ws,`∙`,`\\bullet`,!0),V(H,W,ws,`‡`,`\\ddagger`),V(H,W,ws,`≀`,`\\wr`,!0),V(H,W,ws,`⨿`,`\\amalg`),V(H,W,ws,`&`,`\\And`),V(H,W,K,`⟵`,`\\longleftarrow`,!0),V(H,W,K,`⇐`,`\\Leftarrow`,!0),V(H,W,K,`⟸`,`\\Longleftarrow`,!0),V(H,W,K,`⟶`,`\\longrightarrow`,!0),V(H,W,K,`⇒`,`\\Rightarrow`,!0),V(H,W,K,`⟹`,`\\Longrightarrow`,!0),V(H,W,K,`↔`,`\\leftrightarrow`,!0),V(H,W,K,`⟷`,`\\longleftrightarrow`,!0),V(H,W,K,`⇔`,`\\Leftrightarrow`,!0),V(H,W,K,`⟺`,`\\Longleftrightarrow`,!0),V(H,W,K,`↦`,`\\mapsto`,!0),V(H,W,K,`⟼`,`\\longmapsto`,!0),V(H,W,K,`↗`,`\\nearrow`,!0),V(H,W,K,`↩`,`\\hookleftarrow`,!0),V(H,W,K,`↪`,`\\hookrightarrow`,!0),V(H,W,K,`↘`,`\\searrow`,!0),V(H,W,K,`↼`,`\\leftharpoonup`,!0),V(H,W,K,`⇀`,`\\rightharpoonup`,!0),V(H,W,K,`↙`,`\\swarrow`,!0),V(H,W,K,`↽`,`\\leftharpoondown`,!0),V(H,W,K,`⇁`,`\\rightharpoondown`,!0),V(H,W,K,`↖`,`\\nwarrow`,!0),V(H,W,K,`⇌`,`\\rightleftharpoons`,!0),V(H,G,K,`≮`,`\\nless`,!0),V(H,G,K,``,`\\@nleqslant`),V(H,G,K,``,`\\@nleqq`),V(H,G,K,`⪇`,`\\lneq`,!0),V(H,G,K,`≨`,`\\lneqq`,!0),V(H,G,K,``,`\\@lvertneqq`),V(H,G,K,`⋦`,`\\lnsim`,!0),V(H,G,K,`⪉`,`\\lnapprox`,!0),V(H,G,K,`⊀`,`\\nprec`,!0),V(H,G,K,`⋠`,`\\npreceq`,!0),V(H,G,K,`⋨`,`\\precnsim`,!0),V(H,G,K,`⪹`,`\\precnapprox`,!0),V(H,G,K,`≁`,`\\nsim`,!0),V(H,G,K,``,`\\@nshortmid`),V(H,G,K,`∤`,`\\nmid`,!0),V(H,G,K,`⊬`,`\\nvdash`,!0),V(H,G,K,`⊭`,`\\nvDash`,!0),V(H,G,K,`⋪`,`\\ntriangleleft`),V(H,G,K,`⋬`,`\\ntrianglelefteq`,!0),V(H,G,K,`⊊`,`\\subsetneq`,!0),V(H,G,K,``,`\\@varsubsetneq`),V(H,G,K,`⫋`,`\\subsetneqq`,!0),V(H,G,K,``,`\\@varsubsetneqq`),V(H,G,K,`≯`,`\\ngtr`,!0),V(H,G,K,``,`\\@ngeqslant`),V(H,G,K,``,`\\@ngeqq`),V(H,G,K,`⪈`,`\\gneq`,!0),V(H,G,K,`≩`,`\\gneqq`,!0),V(H,G,K,``,`\\@gvertneqq`),V(H,G,K,`⋧`,`\\gnsim`,!0),V(H,G,K,`⪊`,`\\gnapprox`,!0),V(H,G,K,`⊁`,`\\nsucc`,!0),V(H,G,K,`⋡`,`\\nsucceq`,!0),V(H,G,K,`⋩`,`\\succnsim`,!0),V(H,G,K,`⪺`,`\\succnapprox`,!0),V(H,G,K,`≆`,`\\ncong`,!0),V(H,G,K,``,`\\@nshortparallel`),V(H,G,K,`∦`,`\\nparallel`,!0),V(H,G,K,`⊯`,`\\nVDash`,!0),V(H,G,K,`⋫`,`\\ntriangleright`),V(H,G,K,`⋭`,`\\ntrianglerighteq`,!0),V(H,G,K,``,`\\@nsupseteqq`),V(H,G,K,`⊋`,`\\supsetneq`,!0),V(H,G,K,``,`\\@varsupsetneq`),V(H,G,K,`⫌`,`\\supsetneqq`,!0),V(H,G,K,``,`\\@varsupsetneqq`),V(H,G,K,`⊮`,`\\nVdash`,!0),V(H,G,K,`⪵`,`\\precneqq`,!0),V(H,G,K,`⪶`,`\\succneqq`,!0),V(H,G,K,``,`\\@nsubseteqq`),V(H,G,ws,`⊴`,`\\unlhd`),V(H,G,ws,`⊵`,`\\unrhd`),V(H,G,K,`↚`,`\\nleftarrow`,!0),V(H,G,K,`↛`,`\\nrightarrow`,!0),V(H,G,K,`⇍`,`\\nLeftarrow`,!0),V(H,G,K,`⇏`,`\\nRightarrow`,!0),V(H,G,K,`↮`,`\\nleftrightarrow`,!0),V(H,G,K,`⇎`,`\\nLeftrightarrow`,!0),V(H,G,K,`△`,`\\vartriangle`),V(H,G,q,`ℏ`,`\\hslash`),V(H,G,q,`▽`,`\\triangledown`),V(H,G,q,`◊`,`\\lozenge`),V(H,G,q,`Ⓢ`,`\\circledS`),V(H,G,q,`®`,`\\circledR`),V(U,G,q,`®`,`\\circledR`),V(H,G,q,`∡`,`\\measuredangle`,!0),V(H,G,q,`∄`,`\\nexists`),V(H,G,q,`℧`,`\\mho`),V(H,G,q,`Ⅎ`,`\\Finv`,!0),V(H,G,q,`⅁`,`\\Game`,!0),V(H,G,q,`‵`,`\\backprime`),V(H,G,q,`▲`,`\\blacktriangle`),V(H,G,q,`▼`,`\\blacktriangledown`),V(H,G,q,`■`,`\\blacksquare`),V(H,G,q,`⧫`,`\\blacklozenge`),V(H,G,q,`★`,`\\bigstar`),V(H,G,q,`∢`,`\\sphericalangle`,!0),V(H,G,q,`∁`,`\\complement`,!0),V(H,G,q,`ð`,`\\eth`,!0),V(U,W,q,`ð`,`ð`),V(H,G,q,`╱`,`\\diagup`),V(H,G,q,`╲`,`\\diagdown`),V(H,G,q,`□`,`\\square`),V(H,G,q,`□`,`\\Box`),V(H,G,q,`◊`,`\\Diamond`),V(H,G,q,`¥`,`\\yen`,!0),V(U,G,q,`¥`,`\\yen`,!0),V(H,G,q,`✓`,`\\checkmark`,!0),V(U,G,q,`✓`,`\\checkmark`),V(H,G,q,`ℶ`,`\\beth`,!0),V(H,G,q,`ℸ`,`\\daleth`,!0),V(H,G,q,`ℷ`,`\\gimel`,!0),V(H,G,q,`ϝ`,`\\digamma`,!0),V(H,G,q,`ϰ`,`\\varkappa`),V(H,G,ks,`┌`,`\\@ulcorner`,!0),V(H,G,Ts,`┐`,`\\@urcorner`,!0),V(H,G,ks,`└`,`\\@llcorner`,!0),V(H,G,Ts,`┘`,`\\@lrcorner`,!0),V(H,G,K,`≦`,`\\leqq`,!0),V(H,G,K,`⩽`,`\\leqslant`,!0),V(H,G,K,`⪕`,`\\eqslantless`,!0),V(H,G,K,`≲`,`\\lesssim`,!0),V(H,G,K,`⪅`,`\\lessapprox`,!0),V(H,G,K,`≊`,`\\approxeq`,!0),V(H,G,ws,`⋖`,`\\lessdot`),V(H,G,K,`⋘`,`\\lll`,!0),V(H,G,K,`≶`,`\\lessgtr`,!0),V(H,G,K,`⋚`,`\\lesseqgtr`,!0),V(H,G,K,`⪋`,`\\lesseqqgtr`,!0),V(H,G,K,`≑`,`\\doteqdot`),V(H,G,K,`≓`,`\\risingdotseq`,!0),V(H,G,K,`≒`,`\\fallingdotseq`,!0),V(H,G,K,`∽`,`\\backsim`,!0),V(H,G,K,`⋍`,`\\backsimeq`,!0),V(H,G,K,`⫅`,`\\subseteqq`,!0),V(H,G,K,`⋐`,`\\Subset`,!0),V(H,G,K,`⊏`,`\\sqsubset`,!0),V(H,G,K,`≼`,`\\preccurlyeq`,!0),V(H,G,K,`⋞`,`\\curlyeqprec`,!0),V(H,G,K,`≾`,`\\precsim`,!0),V(H,G,K,`⪷`,`\\precapprox`,!0),V(H,G,K,`⊲`,`\\vartriangleleft`),V(H,G,K,`⊴`,`\\trianglelefteq`),V(H,G,K,`⊨`,`\\vDash`,!0),V(H,G,K,`⊪`,`\\Vvdash`,!0),V(H,G,K,`⌣`,`\\smallsmile`),V(H,G,K,`⌢`,`\\smallfrown`),V(H,G,K,`≏`,`\\bumpeq`,!0),V(H,G,K,`≎`,`\\Bumpeq`,!0),V(H,G,K,`≧`,`\\geqq`,!0),V(H,G,K,`⩾`,`\\geqslant`,!0),V(H,G,K,`⪖`,`\\eqslantgtr`,!0),V(H,G,K,`≳`,`\\gtrsim`,!0),V(H,G,K,`⪆`,`\\gtrapprox`,!0),V(H,G,ws,`⋗`,`\\gtrdot`),V(H,G,K,`⋙`,`\\ggg`,!0),V(H,G,K,`≷`,`\\gtrless`,!0),V(H,G,K,`⋛`,`\\gtreqless`,!0),V(H,G,K,`⪌`,`\\gtreqqless`,!0),V(H,G,K,`≖`,`\\eqcirc`,!0),V(H,G,K,`≗`,`\\circeq`,!0),V(H,G,K,`≜`,`\\triangleq`,!0),V(H,G,K,`∼`,`\\thicksim`),V(H,G,K,`≈`,`\\thickapprox`),V(H,G,K,`⫆`,`\\supseteqq`,!0),V(H,G,K,`⋑`,`\\Supset`,!0),V(H,G,K,`⊐`,`\\sqsupset`,!0),V(H,G,K,`≽`,`\\succcurlyeq`,!0),V(H,G,K,`⋟`,`\\curlyeqsucc`,!0),V(H,G,K,`≿`,`\\succsim`,!0),V(H,G,K,`⪸`,`\\succapprox`,!0),V(H,G,K,`⊳`,`\\vartriangleright`),V(H,G,K,`⊵`,`\\trianglerighteq`),V(H,G,K,`⊩`,`\\Vdash`,!0),V(H,G,K,`∣`,`\\shortmid`),V(H,G,K,`∥`,`\\shortparallel`),V(H,G,K,`≬`,`\\between`,!0),V(H,G,K,`⋔`,`\\pitchfork`,!0),V(H,G,K,`∝`,`\\varpropto`),V(H,G,K,`◀`,`\\blacktriangleleft`),V(H,G,K,`∴`,`\\therefore`,!0),V(H,G,K,`∍`,`\\backepsilon`),V(H,G,K,`▶`,`\\blacktriangleright`),V(H,G,K,`∵`,`\\because`,!0),V(H,G,K,`⋘`,`\\llless`),V(H,G,K,`⋙`,`\\gggtr`),V(H,G,ws,`⊲`,`\\lhd`),V(H,G,ws,`⊳`,`\\rhd`),V(H,G,K,`≂`,`\\eqsim`,!0),V(H,W,K,`⋈`,`\\Join`),V(H,G,K,`≑`,`\\Doteq`,!0),V(H,G,ws,`∔`,`\\dotplus`,!0),V(H,G,ws,`∖`,`\\smallsetminus`),V(H,G,ws,`⋒`,`\\Cap`,!0),V(H,G,ws,`⋓`,`\\Cup`,!0),V(H,G,ws,`⩞`,`\\doublebarwedge`,!0),V(H,G,ws,`⊟`,`\\boxminus`,!0),V(H,G,ws,`⊞`,`\\boxplus`,!0),V(H,G,ws,`⋇`,`\\divideontimes`,!0),V(H,G,ws,`⋉`,`\\ltimes`,!0),V(H,G,ws,`⋊`,`\\rtimes`,!0),V(H,G,ws,`⋋`,`\\leftthreetimes`,!0),V(H,G,ws,`⋌`,`\\rightthreetimes`,!0),V(H,G,ws,`⋏`,`\\curlywedge`,!0),V(H,G,ws,`⋎`,`\\curlyvee`,!0),V(H,G,ws,`⊝`,`\\circleddash`,!0),V(H,G,ws,`⊛`,`\\circledast`,!0),V(H,G,ws,`⋅`,`\\centerdot`),V(H,G,ws,`⊺`,`\\intercal`,!0),V(H,G,ws,`⋒`,`\\doublecap`),V(H,G,ws,`⋓`,`\\doublecup`),V(H,G,ws,`⊠`,`\\boxtimes`,!0),V(H,G,K,`⇢`,`\\dashrightarrow`,!0),V(H,G,K,`⇠`,`\\dashleftarrow`,!0),V(H,G,K,`⇇`,`\\leftleftarrows`,!0),V(H,G,K,`⇆`,`\\leftrightarrows`,!0),V(H,G,K,`⇚`,`\\Lleftarrow`,!0),V(H,G,K,`↞`,`\\twoheadleftarrow`,!0),V(H,G,K,`↢`,`\\leftarrowtail`,!0),V(H,G,K,`↫`,`\\looparrowleft`,!0),V(H,G,K,`⇋`,`\\leftrightharpoons`,!0),V(H,G,K,`↶`,`\\curvearrowleft`,!0),V(H,G,K,`↺`,`\\circlearrowleft`,!0),V(H,G,K,`↰`,`\\Lsh`,!0),V(H,G,K,`⇈`,`\\upuparrows`,!0),V(H,G,K,`↿`,`\\upharpoonleft`,!0),V(H,G,K,`⇃`,`\\downharpoonleft`,!0),V(H,W,K,`⊶`,`\\origof`,!0),V(H,W,K,`⊷`,`\\imageof`,!0),V(H,G,K,`⊸`,`\\multimap`,!0),V(H,G,K,`↭`,`\\leftrightsquigarrow`,!0),V(H,G,K,`⇉`,`\\rightrightarrows`,!0),V(H,G,K,`⇄`,`\\rightleftarrows`,!0),V(H,G,K,`↠`,`\\twoheadrightarrow`,!0),V(H,G,K,`↣`,`\\rightarrowtail`,!0),V(H,G,K,`↬`,`\\looparrowright`,!0),V(H,G,K,`↷`,`\\curvearrowright`,!0),V(H,G,K,`↻`,`\\circlearrowright`,!0),V(H,G,K,`↱`,`\\Rsh`,!0),V(H,G,K,`⇊`,`\\downdownarrows`,!0),V(H,G,K,`↾`,`\\upharpoonright`,!0),V(H,G,K,`⇂`,`\\downharpoonright`,!0),V(H,G,K,`⇝`,`\\rightsquigarrow`,!0),V(H,G,K,`⇝`,`\\leadsto`),V(H,G,K,`⇛`,`\\Rrightarrow`,!0),V(H,G,K,`↾`,`\\restriction`),V(H,W,q,`‘`,"`"),V(H,W,q,`$`,`\\$`),V(U,W,q,`$`,`\\$`),V(U,W,q,`$`,`\\textdollar`),V(H,W,q,`%`,`\\%`),V(U,W,q,`%`,`\\%`),V(H,W,q,`_`,`\\_`),V(U,W,q,`_`,`\\_`),V(U,W,q,`_`,`\\textunderscore`),V(H,W,q,`∠`,`\\angle`,!0),V(H,W,q,`∞`,`\\infty`,!0),V(H,W,q,`′`,`\\prime`),V(H,W,q,`△`,`\\triangle`),V(H,W,q,`Γ`,`\\Gamma`,!0),V(H,W,q,`Δ`,`\\Delta`,!0),V(H,W,q,`Θ`,`\\Theta`,!0),V(H,W,q,`Λ`,`\\Lambda`,!0),V(H,W,q,`Ξ`,`\\Xi`,!0),V(H,W,q,`Π`,`\\Pi`,!0),V(H,W,q,`Σ`,`\\Sigma`,!0),V(H,W,q,`Υ`,`\\Upsilon`,!0),V(H,W,q,`Φ`,`\\Phi`,!0),V(H,W,q,`Ψ`,`\\Psi`,!0),V(H,W,q,`Ω`,`\\Omega`,!0),V(H,W,q,`A`,`Α`),V(H,W,q,`B`,`Β`),V(H,W,q,`E`,`Ε`),V(H,W,q,`Z`,`Ζ`),V(H,W,q,`H`,`Η`),V(H,W,q,`I`,`Ι`),V(H,W,q,`K`,`Κ`),V(H,W,q,`M`,`Μ`),V(H,W,q,`N`,`Ν`),V(H,W,q,`O`,`Ο`),V(H,W,q,`P`,`Ρ`),V(H,W,q,`T`,`Τ`),V(H,W,q,`X`,`Χ`),V(H,W,q,`¬`,`\\neg`,!0),V(H,W,q,`¬`,`\\lnot`),V(H,W,q,`⊤`,`\\top`),V(H,W,q,`⊥`,`\\bot`),V(H,W,q,`∅`,`\\emptyset`),V(H,G,q,`∅`,`\\varnothing`),V(H,W,Ds,`α`,`\\alpha`,!0),V(H,W,Ds,`β`,`\\beta`,!0),V(H,W,Ds,`γ`,`\\gamma`,!0),V(H,W,Ds,`δ`,`\\delta`,!0),V(H,W,Ds,`ϵ`,`\\epsilon`,!0),V(H,W,Ds,`ζ`,`\\zeta`,!0),V(H,W,Ds,`η`,`\\eta`,!0),V(H,W,Ds,`θ`,`\\theta`,!0),V(H,W,Ds,`ι`,`\\iota`,!0),V(H,W,Ds,`κ`,`\\kappa`,!0),V(H,W,Ds,`λ`,`\\lambda`,!0),V(H,W,Ds,`μ`,`\\mu`,!0),V(H,W,Ds,`ν`,`\\nu`,!0),V(H,W,Ds,`ξ`,`\\xi`,!0),V(H,W,Ds,`ο`,`\\omicron`,!0),V(H,W,Ds,`π`,`\\pi`,!0),V(H,W,Ds,`ρ`,`\\rho`,!0),V(H,W,Ds,`σ`,`\\sigma`,!0),V(H,W,Ds,`τ`,`\\tau`,!0),V(H,W,Ds,`υ`,`\\upsilon`,!0),V(H,W,Ds,`ϕ`,`\\phi`,!0),V(H,W,Ds,`χ`,`\\chi`,!0),V(H,W,Ds,`ψ`,`\\psi`,!0),V(H,W,Ds,`ω`,`\\omega`,!0),V(H,W,Ds,`ε`,`\\varepsilon`,!0),V(H,W,Ds,`ϑ`,`\\vartheta`,!0),V(H,W,Ds,`ϖ`,`\\varpi`,!0),V(H,W,Ds,`ϱ`,`\\varrho`,!0),V(H,W,Ds,`ς`,`\\varsigma`,!0),V(H,W,Ds,`φ`,`\\varphi`,!0),V(H,W,ws,`∗`,`*`,!0),V(H,W,ws,`+`,`+`),V(H,W,ws,`−`,`-`,!0),V(H,W,ws,`⋅`,`\\cdot`,!0),V(H,W,ws,`∘`,`\\circ`,!0),V(H,W,ws,`÷`,`\\div`,!0),V(H,W,ws,`±`,`\\pm`,!0),V(H,W,ws,`×`,`\\times`,!0),V(H,W,ws,`∩`,`\\cap`,!0),V(H,W,ws,`∪`,`\\cup`,!0),V(H,W,ws,`∖`,`\\setminus`,!0),V(H,W,ws,`∧`,`\\land`),V(H,W,ws,`∨`,`\\lor`),V(H,W,ws,`∧`,`\\wedge`,!0),V(H,W,ws,`∨`,`\\vee`,!0),V(H,W,q,`√`,`\\surd`),V(H,W,ks,`⟨`,`\\langle`,!0),V(H,W,ks,`∣`,`\\lvert`),V(H,W,ks,`∥`,`\\lVert`),V(H,W,Ts,`?`,`?`),V(H,W,Ts,`!`,`!`),V(H,W,Ts,`⟩`,`\\rangle`,!0),V(H,W,Ts,`∣`,`\\rvert`),V(H,W,Ts,`∥`,`\\rVert`),V(H,W,K,`=`,`=`),V(H,W,K,`:`,`:`),V(H,W,K,`≈`,`\\approx`,!0),V(H,W,K,`≅`,`\\cong`,!0),V(H,W,K,`≥`,`\\ge`),V(H,W,K,`≥`,`\\geq`,!0),V(H,W,K,`←`,`\\gets`),V(H,W,K,`>`,`\\gt`,!0),V(H,W,K,`∈`,`\\in`,!0),V(H,W,K,``,`\\@not`),V(H,W,K,`⊂`,`\\subset`,!0),V(H,W,K,`⊃`,`\\supset`,!0),V(H,W,K,`⊆`,`\\subseteq`,!0),V(H,W,K,`⊇`,`\\supseteq`,!0),V(H,G,K,`⊈`,`\\nsubseteq`,!0),V(H,G,K,`⊉`,`\\nsupseteq`,!0),V(H,W,K,`⊨`,`\\models`),V(H,W,K,`←`,`\\leftarrow`,!0),V(H,W,K,`≤`,`\\le`),V(H,W,K,`≤`,`\\leq`,!0),V(H,W,K,`<`,`\\lt`,!0),V(H,W,K,`→`,`\\rightarrow`,!0),V(H,W,K,`→`,`\\to`),V(H,G,K,`≱`,`\\ngeq`,!0),V(H,G,K,`≰`,`\\nleq`,!0),V(H,W,js,`\xA0`,`\\ `),V(H,W,js,`\xA0`,`\\space`),V(H,W,js,`\xA0`,`\\nobreakspace`),V(U,W,js,`\xA0`,`\\ `),V(U,W,js,`\xA0`,` `),V(U,W,js,`\xA0`,`\\space`),V(U,W,js,`\xA0`,`\\nobreakspace`),V(H,W,js,``,`\\nobreak`),V(H,W,js,``,`\\allowbreak`),V(H,W,As,`,`,`,`),V(H,W,As,`;`,`;`),V(H,G,ws,`⊼`,`\\barwedge`,!0),V(H,G,ws,`⊻`,`\\veebar`,!0),V(H,W,ws,`⊙`,`\\odot`,!0),V(H,W,ws,`⊕`,`\\oplus`,!0),V(H,W,ws,`⊗`,`\\otimes`,!0),V(H,W,q,`∂`,`\\partial`,!0),V(H,W,ws,`⊘`,`\\oslash`,!0),V(H,G,ws,`⊚`,`\\circledcirc`,!0),V(H,G,ws,`⊡`,`\\boxdot`,!0),V(H,W,ws,`△`,`\\bigtriangleup`),V(H,W,ws,`▽`,`\\bigtriangledown`),V(H,W,ws,`†`,`\\dagger`),V(H,W,ws,`⋄`,`\\diamond`),V(H,W,ws,`⋆`,`\\star`),V(H,W,ws,`◃`,`\\triangleleft`),V(H,W,ws,`▹`,`\\triangleright`),V(H,W,ks,`{`,`\\{`),V(U,W,q,`{`,`\\{`),V(U,W,q,`{`,`\\textbraceleft`),V(H,W,Ts,`}`,`\\}`),V(U,W,q,`}`,`\\}`),V(U,W,q,`}`,`\\textbraceright`),V(H,W,ks,`{`,`\\lbrace`),V(H,W,Ts,`}`,`\\rbrace`),V(H,W,ks,`[`,`\\lbrack`,!0),V(U,W,q,`[`,`\\lbrack`,!0),V(H,W,Ts,`]`,`\\rbrack`,!0),V(U,W,q,`]`,`\\rbrack`,!0),V(H,W,ks,`(`,`\\lparen`,!0),V(H,W,Ts,`)`,`\\rparen`,!0),V(U,W,q,`<`,`\\textless`,!0),V(U,W,q,`>`,`\\textgreater`,!0),V(H,W,ks,`⌊`,`\\lfloor`,!0),V(H,W,Ts,`⌋`,`\\rfloor`,!0),V(H,W,ks,`⌈`,`\\lceil`,!0),V(H,W,Ts,`⌉`,`\\rceil`,!0),V(H,W,q,`\\`,`\\backslash`),V(H,W,q,`∣`,`|`),V(H,W,q,`∣`,`\\vert`),V(U,W,q,`|`,`\\textbar`,!0),V(H,W,q,`∥`,`\\|`),V(H,W,q,`∥`,`\\Vert`),V(U,W,q,`∥`,`\\textbardbl`),V(U,W,q,`~`,`\\textasciitilde`),V(U,W,q,`\\`,`\\textbackslash`),V(U,W,q,`^`,`\\textasciicircum`),V(H,W,K,`↑`,`\\uparrow`,!0),V(H,W,K,`⇑`,`\\Uparrow`,!0),V(H,W,K,`↓`,`\\downarrow`,!0),V(H,W,K,`⇓`,`\\Downarrow`,!0),V(H,W,K,`↕`,`\\updownarrow`,!0),V(H,W,K,`⇕`,`\\Updownarrow`,!0),V(H,W,Os,`∐`,`\\coprod`),V(H,W,Os,`⋁`,`\\bigvee`),V(H,W,Os,`⋀`,`\\bigwedge`),V(H,W,Os,`⨄`,`\\biguplus`),V(H,W,Os,`⋂`,`\\bigcap`),V(H,W,Os,`⋃`,`\\bigcup`),V(H,W,Os,`∫`,`\\int`),V(H,W,Os,`∫`,`\\intop`),V(H,W,Os,`∬`,`\\iint`),V(H,W,Os,`∭`,`\\iiint`),V(H,W,Os,`∏`,`\\prod`),V(H,W,Os,`∑`,`\\sum`),V(H,W,Os,`⨂`,`\\bigotimes`),V(H,W,Os,`⨁`,`\\bigoplus`),V(H,W,Os,`⨀`,`\\bigodot`),V(H,W,Os,`∮`,`\\oint`),V(H,W,Os,`∯`,`\\oiint`),V(H,W,Os,`∰`,`\\oiiint`),V(H,W,Os,`⨆`,`\\bigsqcup`),V(H,W,Os,`∫`,`\\smallint`),V(U,W,Es,`…`,`\\textellipsis`),V(H,W,Es,`…`,`\\mathellipsis`),V(U,W,Es,`…`,`\\ldots`,!0),V(H,W,Es,`…`,`\\ldots`,!0),V(H,W,Es,`⋯`,`\\@cdots`,!0),V(H,W,Es,`⋱`,`\\ddots`,!0),V(H,W,q,`⋮`,`\\varvdots`),V(U,W,q,`⋮`,`\\varvdots`),V(H,W,Cs,`ˊ`,`\\acute`),V(H,W,Cs,`ˋ`,`\\grave`),V(H,W,Cs,`¨`,`\\ddot`),V(H,W,Cs,`~`,`\\tilde`),V(H,W,Cs,`ˉ`,`\\bar`),V(H,W,Cs,`˘`,`\\breve`),V(H,W,Cs,`ˇ`,`\\check`),V(H,W,Cs,`^`,`\\hat`),V(H,W,Cs,`⃗`,`\\vec`),V(H,W,Cs,`˙`,`\\dot`),V(H,W,Cs,`˚`,`\\mathring`),V(H,W,Ds,``,`\\@imath`),V(H,W,Ds,``,`\\@jmath`),V(H,W,q,`ı`,`ı`),V(H,W,q,`ȷ`,`ȷ`),V(U,W,q,`ı`,`\\i`,!0),V(U,W,q,`ȷ`,`\\j`,!0),V(U,W,q,`ß`,`\\ss`,!0),V(U,W,q,`æ`,`\\ae`,!0),V(U,W,q,`œ`,`\\oe`,!0),V(U,W,q,`ø`,`\\o`,!0),V(U,W,q,`Æ`,`\\AE`,!0),V(U,W,q,`Œ`,`\\OE`,!0),V(U,W,q,`Ø`,`\\O`,!0),V(U,W,Cs,`ˊ`,`\\'`),V(U,W,Cs,`ˋ`,"\\`"),V(U,W,Cs,`ˆ`,`\\^`),V(U,W,Cs,`˜`,`\\~`),V(U,W,Cs,`ˉ`,`\\=`),V(U,W,Cs,`˘`,`\\u`),V(U,W,Cs,`˙`,`\\.`),V(U,W,Cs,`¸`,`\\c`),V(U,W,Cs,`˚`,`\\r`),V(U,W,Cs,`ˇ`,`\\v`),V(U,W,Cs,`¨`,`\\"`),V(U,W,Cs,`˝`,`\\H`),V(U,W,Cs,`◯`,`\\textcircled`);var Ms={"--":!0,"---":!0,"``":!0,"''":!0};V(U,W,q,`–`,`--`,!0),V(U,W,q,`–`,`\\textendash`),V(U,W,q,`—`,`---`,!0),V(U,W,q,`—`,`\\textemdash`),V(U,W,q,`‘`,"`",!0),V(U,W,q,`‘`,`\\textquoteleft`),V(U,W,q,`’`,`'`,!0),V(U,W,q,`’`,`\\textquoteright`),V(U,W,q,`“`,"``",!0),V(U,W,q,`“`,`\\textquotedblleft`),V(U,W,q,`”`,`''`,!0),V(U,W,q,`”`,`\\textquotedblright`),V(H,W,q,`°`,`\\degree`,!0),V(U,W,q,`°`,`\\degree`),V(U,W,q,`°`,`\\textdegree`,!0),V(H,W,q,`£`,`\\pounds`),V(H,W,q,`£`,`\\mathsterling`,!0),V(U,W,q,`£`,`\\pounds`),V(U,W,q,`£`,`\\textsterling`,!0),V(H,G,q,`✠`,`\\maltese`),V(U,G,q,`✠`,`\\maltese`);for(var Ns=`0123456789/@."`,Ps=0;Ps<Ns.length;Ps++){var Fs=Ns.charAt(Ps);V(H,W,q,Fs,Fs)}for(var Is=`0123456789!@*()-=+";:?/.,`,Ls=0;Ls<Is.length;Ls++){var Rs=Is.charAt(Ls);V(U,W,q,Rs,Rs)}for(var zs=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,Bs=0;Bs<zs.length;Bs++){var Vs=zs.charAt(Bs);V(H,W,Ds,Vs,Vs),V(U,W,q,Vs,Vs)}V(H,G,q,`C`,`ℂ`),V(U,G,q,`C`,`ℂ`),V(H,G,q,`H`,`ℍ`),V(U,G,q,`H`,`ℍ`),V(H,G,q,`N`,`ℕ`),V(U,G,q,`N`,`ℕ`),V(H,G,q,`P`,`ℙ`),V(U,G,q,`P`,`ℙ`),V(H,G,q,`Q`,`ℚ`),V(U,G,q,`Q`,`ℚ`),V(H,G,q,`R`,`ℝ`),V(U,G,q,`R`,`ℝ`),V(H,G,q,`Z`,`ℤ`),V(U,G,q,`Z`,`ℤ`),V(H,W,Ds,`h`,`ℎ`),V(U,W,Ds,`h`,`ℎ`);for(var Hs,Us=0;Us<zs.length;Us++){var Ws=zs.charAt(Us);Hs=String.fromCharCode(55349,56320+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56372+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56424+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56580+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56684+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56736+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56788+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56840+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56944+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Us<26&&(Hs=String.fromCharCode(55349,56632+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs),Hs=String.fromCharCode(55349,56476+Us),V(H,W,Ds,Ws,Hs),V(U,W,q,Ws,Hs))}Hs=String.fromCharCode(55349,56668),V(H,W,Ds,`k`,Hs),V(U,W,q,`k`,Hs);for(var Gs=0;Gs<10;Gs++){var Ks=Gs.toString();Hs=String.fromCharCode(55349,57294+Gs),V(H,W,Ds,Ks,Hs),V(U,W,q,Ks,Hs),Hs=String.fromCharCode(55349,57314+Gs),V(H,W,Ds,Ks,Hs),V(U,W,q,Ks,Hs),Hs=String.fromCharCode(55349,57324+Gs),V(H,W,Ds,Ks,Hs),V(U,W,q,Ks,Hs),Hs=String.fromCharCode(55349,57334+Gs),V(H,W,Ds,Ks,Hs),V(U,W,q,Ks,Hs)}for(var qs=`ÐÞþ`,Js=0;Js<qs.length;Js++){var Ys=qs.charAt(Js);V(H,W,Ds,Ys,Ys),V(U,W,q,Ys,Ys)}var Xs={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},Zs={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},Qs={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},$s={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},ec={mathClass:``,textClass:``,font:``},tc={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},nc={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},rc={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},ic={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},ac={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},oc={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},sc={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},cc=[Xs,Xs,Zs,Zs,Qs,Qs,$s,ec,ec,ec,tc,tc,nc,nc,rc,rc,ic,ic,ac,ac,oc,oc,ec,ec,sc,sc],lc=[Xs,ec,ic,ac,sc],uc=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return cc[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return lc[Math.floor((r-120782)/10)];if(r===120485||r===120486)return cc[0];if(120486<r&&r<120782)return ec;throw new B(`Unsupported character: `+e)};function dc(e){var t=e.strict,n=e.errorCode,r=e.errorMsg,i=e.token,a=e.report,o=t;if(typeof t==`function`){if(a)o=t(n,r,i);else try{o=t(n,r,i)}catch{o=`error`}}switch(o){case!0:case`error`:if(a)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(r+` [`+n+`]`),i);return!0;case!1:case`ignore`:if(!a)return!1;break;default:if(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(r+` [`+n+`]`)),!a)return!1}}var fc=function(e,t,n){if(Ss[n][e]){var r=Ss[n][e].replace;r&&(e=r)}return{value:e,metrics:ys(e,t,n)}},pc=function(e,t,n,r,i){var a=fc(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new cs(e,o.height,o.depth,c,o.skew,o.width,i)}else dc({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new cs(e,0,0,0,0,0,i);s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();return l&&(s.style.color=l),s},mc=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&fc(e,`Main-Bold`,t).metrics?pc(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||Ss[t][e].font===`main`?pc(e,`Main-Regular`,t,n,r):pc(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},hc=function(e,t,n){return n!==`textord`&&fc(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},gc=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=uc(i);f=m.font,p=m[r+`Class`]}if(f)return pc(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=hc(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=kc[o].fontName,g=[o]):(h=Oc(s,c,l),g=[s,c,l]);if(fc(i,h,r).metrics)return pc(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(Ms,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(pc(i[y],h,r,t,a.concat(g)));return Cc(v)}}if(n===`mathord`)return pc(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=Ss[r][i]&&Ss[r][i].font;if(b===`ams`)return pc(i,Oc(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return pc(i,Oc(`textrm`,c,l),r,t,a.concat(c,l));var x=Oc(b,c,l);return pc(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},_c=(e,t)=>{if(Qo(e.classes)!==Qo(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},vc=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof cs&&r instanceof cs&&_c(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},yc=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},J=function(e,t,n,r){var i=new is(e,t,n,r);return yc(i),i},bc=(e,t,n,r)=>new is(e,t,n,r),xc=function(e,t,n){var r=J([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Zo(r.height),r.maxFontSize=1,r},Sc=function(e,t,n,r){var i=new as(e,t,n,r);return yc(i),i},Cc=function(e){var t=new Ko(e);return yc(t),t},wc=function(e,t){return e instanceof Ko?J([],[e],t):e},Tc=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},Ec=function(e,t){for(var n=Tc(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=J([`pstrut`],[]);l.style.height=Zo(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=J(_,[l,g],void 0,v);y.style.top=Zo(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=J([`vlist`],u);b.style.height=Zo(f);var x;if(d<0){var S=J([`vlist`],[J([],[])]);S.style.height=Zo(-d),x=[J([`vlist-r`],[b,J([`vlist-s`],[new cs(``)])]),J([`vlist-r`],[S])]}else x=[J([`vlist-r`],[b])];var C=J([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},Dc=(e,t)=>{var n=J([`mspace`],[],t),r=Xo(e,t);return n.style.marginRight=Zo(r),n},Oc=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},kc={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},Ac={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},jc=function(e,t){var n=Ac[e],r=n[0],i=n[1],a=n[2],o=bc([`katex-overlay`],[new ls([new us(r)],{width:Zo(i),height:Zo(a),style:`width:`+Zo(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=Zo(a),o.style.width=Zo(i),o},Mc={number:3,unit:`mu`},Nc={number:4,unit:`mu`},Pc={number:5,unit:`mu`},Fc={mord:{mop:Mc,mbin:Nc,mrel:Pc,minner:Mc},mop:{mord:Mc,mop:Mc,mrel:Pc,minner:Mc},mbin:{mord:Nc,mop:Nc,mopen:Nc,minner:Nc},mrel:{mord:Pc,mop:Pc,mopen:Pc,minner:Pc},mopen:{},mclose:{mop:Mc,mbin:Nc,mrel:Pc,minner:Mc},mpunct:{mord:Mc,mop:Mc,mrel:Pc,mopen:Mc,mclose:Mc,mpunct:Mc,minner:Mc},minner:{mord:Mc,mop:Mc,mbin:Nc,mrel:Pc,mopen:Mc,mpunct:Mc,minner:Mc}},Ic={mord:{mop:Mc},mop:{mord:Mc,mop:Mc},mbin:{},mrel:{},mopen:{},mclose:{mop:Mc},mpunct:{},minner:{mop:Mc}},Lc={},Rc={},zc={};function Bc(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)Lc[n[a]]=e;t&&(r&&(Rc[t]=r),i&&(zc[t]=i))}function Vc(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(Rc[t]=n),r&&(zc[t]=r)}var Hc=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Uc=function(e){return e.type===`ordgroup`?e.body:[e]},Wc=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Gc=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),Kc={display:Do.DISPLAY,text:Do.TEXT,script:Do.SCRIPT,scriptscript:Do.SCRIPTSCRIPT},qc={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Jc=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=el(e[a],t);if(o instanceof Ko){var s=o.children;i.push(...s)}else i.push(o)}if(vc(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(Kc[l.style]))}var u=J([r[0]||`leftmost`],[],t),d=J([r[1]||`rightmost`],[],t),f=n===`root`;return Yc(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Gc.has(r)?t.classes[0]=`mord`:r===`mbin`&&Wc.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),Yc(i,(e,t)=>{var n=Qc(t),r=Qc(e),i=n&&r?e.hasClass(`mtight`)?Ic[n]?.[r]:Fc[n]?.[r]:null;if(i)return Dc(i,c)},{node:u},d,f),i},Yc=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=Xc(o);if(s)Yc(s.children,t,n,null,i);else{var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=J([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},Xc=function(e){return e instanceof Ko||e instanceof as||e instanceof is&&e.hasClass(`enclosing`)?e:null},Zc=function(e,t){var n=Xc(e);if(n){var r=n.children;if(r.length){if(t===`right`)return Zc(r[r.length-1],`right`);if(t===`left`)return Zc(r[0],`left`)}}return e},Qc=function(e,t){return e?(t&&(e=Zc(e,t)),qc[e.classes[0]]||null):null},$c=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return J(t.concat(n))},el=function(e,t,n){if(!e)return J();if(Rc[e.type]){var r=Rc[e.type](e,t);if(n&&t.size!==n.size){r=J(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new B(`Got group of unknown type: '`+e.type+`'`)};function tl(e,t){var n=J([`katex-base`],e,t),r=J([`katex-strut`]);return r.style.height=Zo(n.height+n.depth),n.depth&&(r.style.verticalAlign=Zo(-n.depth)),n.children.unshift(r),n}function nl(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Jc(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(tl(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(tl(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(tl(o,t));var l;n?(l=tl(Jc(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=J([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=Zo(u.height+u.depth),u.depth&&(d.style.verticalAlign=Zo(-u.depth))}return u}function rl(e){return new Ko(e)}var Y=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=Qo(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof il&&this.children[i+1]instanceof il){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof il;)a+=this.children[++i].toText();e.appendChild(new il(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=eo(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+eo(Qo(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},il=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return eo(this.toText())}toText(){return this.text}},al=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?` `:e>=-.05556&&e<=-.05555?` `:e>=-.1667&&e<=-.1666?` `:e>=-.2223&&e<=-.2222?` `:e>=-.2778&&e<=-.2777?` `:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,Zo(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+Zo(this.width)+`"/>`}toText(){return this.character?this.character:` `}},ol=new Set([`\\imath`,`\\jmath`]),sl=new Set([`mrow`,`mtable`]),cl=function(e,t,n){var r,i;return Ss[t][e]&&Ss[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(Ms,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=Ss[t][e].replace),new il(e)},ll=function(e){return e.length===1?e[0]:new Y(`mrow`,e)},ul={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},dl=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=ul[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(ol.has(a))return null;if(Ss[r][a]){var o=Ss[r][a].replace;o&&(a=o)}var s=kc[n].fontName;return ys(a,s,r)?kc[n].variant:null};function fl(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof il&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof il&&n.text===`,`}return!1}var pl=function(e,t,n){if(e.length===1){var r=hl(e[0],t);return n&&r instanceof Y&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=hl(e[o],t);if(s instanceof Y&&a instanceof Y){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)||s.type===`mn`&&a.type===`mn`||fl(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&fl(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||fl(a))){var c=s.children[0];c instanceof Y&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof il&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof il&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},ml=function(e,t,n){return ll(pl(e,t,n))},hl=function(e,t){if(!e)return new Y(`mrow`);if(zc[e.type])return zc[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function gl(e,t,n,r,i){var a=pl(e,n),o=a.length===1&&a[0]instanceof Y&&sl.has(a[0].type)?a[0]:new Y(`mrow`,a),s=new Y(`annotation`,[new il(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Y(`math`,[new Y(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),J([i?`katex`:`katex-mathml`],[c])}var _l=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],vl=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],yl=function(e,t){return t.size<2?e:_l[e-1][t.size-1]},bl=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=vl[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this.strict=t.strict,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:yl(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:vl[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=yl(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=xs(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};bl.BASESIZE=6;var xl=e=>new bl({style:e.displayMode?Do.DISPLAY:Do.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),Sl=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=J(n,[e])}return e},Cl=function(e,t,n){var r=xl(n),i;return n.output===`mathml`?gl(e,t,r,n.displayMode,!0):(i=n.output===`html`?J([`katex`],[nl(e,r)]):J([`katex`],[gl(e,t,r,n.displayMode,!1),nl(e,r)]),Sl(i,n))},wl=function(e,t){return Sl(J([`katex`],[nl(e,xl(t))]),t)},Tl={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},El=function(e){var t=new Y(`mo`,[new il(Tl[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},Dl={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},Ol=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),kl=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(Ol.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:bc([],[new ls([new us(o)],{width:`100%`,height:Zo(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=Dl[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
|
|
308
|
-
`+h+` children.`);for(var v=0;v<h;v++){var y=new ls([new us(d[v])],{width:`400em`,height:Zo(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=bc([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=Zo(m),l.push(b)}return{span:J([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=Zo(o),a>0&&(i.style.minWidth=Zo(a)),i},Al=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=J([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new ds({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new ds({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=bc([],[new ls(c,{width:`100%`,height:Zo(o)})],i)}return a.height=o,a.style.height=Zo(o),a},jl=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],Ml=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],Nl=new Set(jl),Pl=new Set(Ml);function Fl(e){return Nl.has(e)}function Il(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function Ll(e){var t=Rl(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function Rl(e){return e.type===`atom`||Pl.has(e.type)?e:null}function zl(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new B(t,e);return r}var Bl=e=>{if(e instanceof cs)return e;if(ms(e)&&e.children.length===1)return Bl(e.children[0])},Vl=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Il(e.base,`accent`),n=r.base,e.base=n,i=ps(el(e,t)),e.base=r):(r=Il(e,`accent`),n=r.base);var a=el(n,t.havingCrampedStyle()),o=r.isShifty&&ro(n),s=0;o&&(s=Bl(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=kl(r,t),u=Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+Zo(2*s)+`)`,marginLeft:Zo(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=jc(`vec`,t),f=Ac.vec[1]):(d=gc({type:`textord`,mode:r.mode,text:r.label},t),d=fs(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=J([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=Zo(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=J([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},Hl=(e,t)=>{var n=e.isStretchy?El(e.label):new Y(`mo`,[cl(e.label,e.mode)]),r=new Y(`mover`,[hl(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},Ul=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Bc({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=Hc(t[0]),r=!Ul.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Vl,mathmlBuilder:Hl}),Bc({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(dc({strict:e.parser.settings.strict,errorCode:`mathVsTextAccents`,errorMsg:`LaTeX's accent `+e.funcName+` works only in text mode`,report:!0}),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Bc({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=el(e.base,t),r=kl(e,t),i=e.label===`\\utilde`?.12:0;return J([`mord`,`accentunder`],[Ec({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=El(e.label),r=new Y(`munder`,[hl(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var Wl=e=>{var t=new Y(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Bc({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=wc(el(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=wc(el(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=kl(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return J([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=El(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=Wl(hl(e.body,t));r=e.below?new Y(`munderover`,[n,Wl(hl(e.below,t)),i]):new Y(`mover`,[n,i])}else e.below?r=new Y(`munder`,[n,Wl(hl(e.below,t))]):(r=Wl(),r=new Y(`mover`,[n,r]));return r}});function Gl(e,t){var n=Jc(e.body,t,!0);return J([e.mclass],n,t)}function Kl(e,t){var n,r=pl(e.body,t);return e.mclass===`minner`?n=new Y(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Y(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Y(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Bc({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Uc(i),isCharacterBox:ro(i)}},htmlBuilder:Gl,mathmlBuilder:Kl});var ql=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Bc({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:ql(t[0]),body:Uc(t[1]),isCharacterBox:ro(t[1])}}}),Bc({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:ql(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Uc(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:ro(c)}}}),Bc({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:ql(t[0]),body:Uc(t[0])}},htmlBuilder(e,t){var n=Jc(e.body,t,!0),r=J([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Y(`mstyle`,pl(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Jl={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},Yl=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),Xl=e=>e.type===`textord`&&e.text===`@`,Zl=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Ql(e,t,n){var r=Jl[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function $l(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new B(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=Yl(),c=0;c<o.length;c++)if(!Xl(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=Ll(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(Zl(o[p],l)){f=!1,c=p;break}if(Xl(o[p]))throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new B(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[Ql(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=Yl()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Bc({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=wc(el(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=Zo(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Y(`mrow`,[hl(e.label,t)]);return n=new Y(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Y(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Bc({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=wc(el(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Y(`mrow`,[hl(e.fragment,t)])}}),Bc({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=zl(Il(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new B(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new B(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),Bc({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=Il(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Uc(i)}},htmlBuilder:(e,t)=>Cc(Jc(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Y(`mstyle`,pl(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Bc({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=Il(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Bc({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text===`[`?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!dc({strict:t.settings.strict,errorCode:`newLineInDisplayMode`,errorMsg:`In LaTeX, \\\\ or \\newline does nothing in display mode`,report:!1});return{type:`cr`,mode:t.mode,newLine:r,size:n&&Il(n,`size`).value}},htmlBuilder(e,t){var n=J([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=Zo(Xo(e.size,t)))),n},mathmlBuilder(e,t){var n=new Y(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,Zo(Xo(e.size,t)))),n}});var eu={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},tu=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},nu=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},ru=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Bc({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(eu[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=eu[r.text]),Il(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Bc({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new B(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new B(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new B(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===eu[n]),{type:`internal`,mode:t.mode}}}),Bc({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=tu(t.gullet.popToken());return t.gullet.consumeSpaces(),ru(t,r,nu(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Bc({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=tu(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return ru(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var iu=function(e,t,n){var r=ys(Ss.math[e]&&Ss.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},au=function(e,t,n,r){var i=n.havingBaseStyle(t),a=J(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},ou=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=Zo(i),e.height-=i,e.depth+=i},su=function(e,t,n,r,i,a){var o=au(pc(e,`Main-Regular`,i,r),t,r,a);return n&&ou(o,r,t),o},cu=function(e,t,n,r){return pc(e,`Size`+t+`-Regular`,n,r)},lu=function(e,t,n,r,i,a){var o=cu(e,t,i,r),s=au(J([`delimsizing`,`size`+t],[o],r),Do.TEXT,r,a);return n&&ou(s,r,Do.TEXT),s},uu=function(e,t,n,r){return{type:`elem`,elem:J([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[J([],[pc(e,t,n,r)])])}},du=function(e,t,n){var r=hs[`Size4-Regular`][e.charCodeAt(0)]?hs[`Size4-Regular`][e.charCodeAt(0)][4]:hs[`Size1-Regular`][e.charCodeAt(0)][4],i=bc([],[new ls([new us(`inner`,Ho(e,Math.round(1e3*t)))],{width:Zo(r),height:Zo(t),style:`width:`+Zo(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=Zo(t),i.style.width=Zo(r),{type:`elem`,elem:i}},fu=.008,pu={type:`kern`,size:-1*fu},mu=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),hu=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),gu=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):mu.has(e)?(c=`∣`,u=`vert`,d=333):hu.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=iu(o,f,i),m=p.height+p.depth,h=iu(c,f,i),g=h.height+h.depth,_=iu(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=iu(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var D=C-m-v,O=Math.round(C*1e3),k=Wo(u,Math.round(D*1e3)),A=new us(u,k),j=Zo(d/1e3),M=Zo(O/1e3),N=bc([],[new ls([A],{width:j,height:M,viewBox:`0 0 `+d+` `+O})],r);N.height=O/1e3,N.style.width=j,N.style.height=M,E.push({type:`elem`,elem:N})}else{if(E.push(uu(l,f,i,r)),E.push(pu),s===null){var P=C-m-v+2*fu;E.push(du(c,P,r))}else{var ee=(C-m-v-y)/2+2*fu;E.push(du(c,ee,r)),E.push(pu),E.push(uu(s,f,i,r)),E.push(pu),E.push(du(c,ee,r))}E.push(pu),E.push(uu(o,f,i,r))}var F=r.havingBaseStyle(Do.TEXT);return au(J([`delimsizing`,`mult`],[Ec({positionType:`bottom`,positionData:T,children:E})],F),Do.TEXT,r,a)},_u=80,vu=.08,yu=function(e,t,n,r,i){return bc([`hide-tail`],[new ls([new us(e,Vo(e,r,n))],{width:`400em`,height:Zo(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},bu=function(e,t){var n=t.havingBaseSizing(),r=Au(`\\surd`,e*n.sizeMultiplier,Ou,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+_u,e<1?i=1:e<1.4&&(i=.7),s=(1+a+vu)/i,c=(1+a)/i,o=yu(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+_u)*wu[r.size],c=(wu[r.size]+a)/i,s=(wu[r.size]+a+vu)/i,o=yu(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+vu,c=e+a,l=Math.floor(1e3*e+a)+_u,o=yu(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=Zo(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},xu=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),Su=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),Cu=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),wu=[0,1.2,1.8,2.4,3],Tu=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),xu.has(e)||Cu.has(e))return lu(e,t,!1,n,r,i);if(Su.has(e))return gu(e,wu[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},Eu=[{type:`small`,style:Do.SCRIPTSCRIPT},{type:`small`,style:Do.SCRIPT},{type:`small`,style:Do.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],Du=[{type:`small`,style:Do.SCRIPTSCRIPT},{type:`small`,style:Do.SCRIPT},{type:`small`,style:Do.TEXT},{type:`stack`}],Ou=[{type:`small`,style:Do.SCRIPTSCRIPT},{type:`small`,style:Do.SCRIPT},{type:`small`,style:Do.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],ku=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},Au=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=iu(e,ku(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},ju=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=Cu.has(e)?Eu:xu.has(e)?Ou:Du,s=Au(e,t,o,r);return s.type===`small`?su(e,s.style,n,r,i,a):s.type===`large`?lu(e,s.size,n,r,i,a):gu(e,t,n,r,i,a)},Mu=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return ju(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},Nu={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},Pu=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function Fu(e){return`isMiddle`in e}function Iu(e,t){var n=Rl(e);if(n&&Pu.has(n.text))return n;throw n?new B(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new B(`Invalid delimiter type '`+e.type+`'`,e)}Bc({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=Iu(Hc(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:Nu[e.funcName].size,mclass:Nu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?J([e.mclass]):Tu(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(cl(e.delim,e.mode));var n=new Y(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=Zo(wu[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function Lu(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Bc({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new B(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:Iu(t[0],e).text,color:n}}}),Bc({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Iu(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Il(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{Lu(e);for(var n=Jc(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];Fu(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?$c(t,[`mopen`]):Mu(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(Fu(u)){var d=u.isMiddle;n[l]=Mu(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=$c(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=Mu(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),J([`minner`],n,t)},mathmlBuilder:(e,t)=>{Lu(e);var n=pl(e.body,t);if(e.left!==`.`){var r=new Y(`mo`,[cl(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Y(`mo`,[cl(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return ll(n)}}),Bc({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Iu(t[0],e);if(!e.parser.leftrightDepth)throw new B(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=$c(t,[]):(n=Tu(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Y(`mo`,[e.delim===`\\vert`||e.delim===`|`?cl(`|`,`text`):cl(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Bc({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Il(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=wc(el(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=ro(e.body);if(r===`sout`)a=J([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=Xo({number:.6,unit:`pt`},t),l=Xo({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=Zo(d/2+c);var f=Math.floor(1e3*d*i);a=bc([`hide-tail`],[new ls([new us(`phase`,zo(f))],{width:`400em`,height:Zo(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=Zo(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=Al(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=Zo(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=Zo(h),a.style.borderRightWidth=Zo(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?J([`mord`,`cancel-lap`],[g],t):J([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Y(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[hl(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+Zo(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Bc({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=Il(t[0],`color-token`).color,o=Il(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Bc({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),Bc({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Bc({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&dc({strict:n.settings.strict,errorCode:`mathVsSout`,errorMsg:`LaTeX's \\sout works only in text mode`,report:!0});var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Bc({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var Ru={};function zu(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)Ru[n[c]]=s;a&&(Rc[t]=a),o&&(zc[t]=o)}var Bu={};function X(e,t){Bu[e]=t}var Vu=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},Hu=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,Vu.range(this,t))}};function Uu(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Wu=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},Gu=new Set([`gather`,`gather*`]);function Ku(e){if(!e.includes(`ed`))return!e.includes(`*`)}function qu(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new Hu(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(Uu(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new B(`Too many tab characters: &`,e.nextToken);dc({strict:e.settings.strict,errorCode:`textEnv`,errorMsg:`Too few columns specified in the {array} column argument.`,report:!0})}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(Uu(e)),m=[],h.push(m),y()}else throw new B(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function Ju(e){return e.slice(0,1)===`d`?`display`:`text`}var Yu=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(Do.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?Xo({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=el(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=Xo(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,D=e.cols||[],O=[],k,A,j=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var M=s[n],N=M.pos-E,P=e.tags[n],ee=void 0;ee=P===!0?J([`eqn-num`],[],t):P===!1?J([],[],t):J([],Jc(P,t,!0),t),ee.depth=M.depth,ee.height=M.height,j.push({type:`elem`,elem:ee,shift:N})}for(r=0,A=0;r<o||A<D.length;++r,++A){for(var F=D[A],I=!0;(te=F)?.type===`separator`;){var te;if(I||(k=J([`arraycolsep`],[]),k.style.width=Zo(t.fontMetrics().doubleRuleSep),O.push(k)),F.separator===`|`||F.separator===`:`){var ne=F.separator===`|`?`solid`:`dashed`,L=J([`vertical-separator`],[],t);L.style.height=Zo(_),L.style.borderRightWidth=Zo(l),L.style.borderRightStyle=ne,L.style.margin=`0 `+Zo(-l/2);var re=_-E;re&&(L.style.verticalAlign=Zo(-re)),O.push(L)}else throw new B(`Invalid separator type: `+F.separator);A++,F=D[A],I=!1}if(!(r>=o)){var ie=void 0;(r>0||e.hskipBeforeAndAfter)&&(ie=F?.pregap??d,ie!==0&&(k=J([`arraycolsep`],[]),k.style.width=Zo(ie),O.push(k)));var ae=[];for(n=0;n<i;++n){var oe=s[n],se=oe.cells[r];if(se){var ce=oe.pos-E;se.depth=oe.depth,se.height=oe.height,ae.push({type:`elem`,elem:se,shift:ce})}}var le=Ec({positionType:`individualShift`,children:ae}),ue=J([`col-align-`+(F?.align||`c`)],[le]);O.push(ue),(r<o-1||e.hskipBeforeAndAfter)&&(ie=F?.postgap??d,ie!==0&&(k=J([`arraycolsep`],[]),k.style.width=Zo(ie),O.push(k)))}}var de=J([`mtable`],O);if(c.length>0){for(var fe=xc(`katex-hline`,t,l),pe=xc(`katex-hdashline`,t,l),me=[{type:`elem`,elem:de,shift:0}];c.length>0;){var he=c.pop(),ge=he.pos-E;he.isDashed?me.push({type:`elem`,elem:pe,shift:ge}):me.push({type:`elem`,elem:fe,shift:ge})}de=Ec({positionType:`individualShift`,children:me})}if(j.length===0)return J([`mord`],[de],t);var _e=J([`katex-tag`],[Ec({positionType:`individualShift`,children:j})],t);return Cc([de,_e])},Xu={c:`center `,l:`left `,r:`right `},Zu=function(e,t){for(var n=[],r=new Y(`mtd`,[],[`mtr-glue`]),i=new Y(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Y(`mtd`,[hl(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Y(`mtr`,s))}var l=new Y(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,Zo(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=Xu[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Y(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Y(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},Qu=function(e,t){e.envName.includes(`ed`)||Wu(e);var n=[],r=e.envName===`split`,i=qu(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:Ku(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=zl(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new B(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)Il(Il(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new B(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};zu({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(Rl(t[0])?[t[0]]:Il(t[0],`ordgroup`).body).map(function(e){var t=Ll(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new B(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return qu(e.parser,r,Ju(e.envName))},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new B(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=qu(e.parser,r,Ju(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=qu(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(Rl(t[0])?[t[0]]:Il(t[0],`ordgroup`).body).map(function(e){var t=Ll(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new B(`Unknown column alignment: `+t,e)});if(n.length>1)throw new B(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=qu(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new B(`{subarray} can contain only one column`);return i},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=qu(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},Ju(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:Qu,htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Gu.has(e.envName)&&Wu(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:Ku(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return qu(e.parser,t,`display`)},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:Qu,htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Wu(e);var t={autoTag:Ku(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return qu(e.parser,t,`display`)},htmlBuilder:Yu,mathmlBuilder:Zu}),zu({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Wu(e),$l(e.parser)},htmlBuilder:Yu,mathmlBuilder:Zu}),X(`\\nonumber`,`\\gdef\\@eqnsw{0}`),X(`\\notag`,`\\nonumber`),Bc({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var $u=Ru;Bc({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);var a=zl(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call($u,a))throw new B(`No such environment: `+a,i);var o=$u[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Il(n.parseFunction(),`environment`);if(p.name!==a)throw new B(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var ed=(e,t)=>{var n=e.font,r=t.withFont(n);return el(e.body,r)},td=(e,t)=>{var n=e.font,r=t.withFont(n);return hl(e.body,r)},nd={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Bc({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=Hc(t[0]),a=r in nd?nd[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:ed,mathmlBuilder:td}),Bc({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:ql(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:ro(r)}}}),Bc({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var rd=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=el(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=el(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=Xo(e.barSize,t),u=xc(`frac-line`,t,d)):u=xc(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===Do.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===Do.DISPLAY.size?t.fontMetrics().delim1:n.size===Do.SCRIPTSCRIPT.size?t.havingStyle(Do.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?$c(t,[`mopen`]):ju(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?J([]):e.rightDelim==null?$c(t,[`mclose`]):ju(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return J([`mord`].concat(a.sizingClasses(t)),[x,J([`mfrac`],[g]),S],t)},id=(e,t)=>{var n=new Y(`mfrac`,[hl(e.numer,t),hl(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=Xo(e.barSize,t);n.setAttribute(`linethickness`,Zo(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Y(`mo`,[new il(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Y(`mo`,[new il(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return ll(i)}return n},ad=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Bc({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),ad({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:rd,mathmlBuilder:id}),Bc({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var od=[`display`,`text`,`script`,`scriptscript`],sd=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Bc({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=Hc(t[0]),o=a.type===`atom`&&a.family===`open`?sd(a.text):null,s=Hc(t[1]),c=s.type===`atom`&&s.family===`close`?sd(s.text):null,l=Il(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Il(p.body[0],`textord`);f=od[Number(m.text)]}}else p=Il(p,`textord`),f=od[Number(p.text)];return ad({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Bc({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Il(t[0],`size`).value,token:r}}}),Bc({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=Il(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var cd=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?el(e.sup,t.havingStyle(n.sup()),t):el(e.sub,t.havingStyle(n.sub()),t),i=Il(e.base,`horizBrace`)):i=Il(e,`horizBrace`);var a=el(i.base,t.havingBaseStyle(Do.DISPLAY)),o=kl(i,t),s=i.isOver?Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):Ec({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=J([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):Ec({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return J([`minner`,i.isOver?`mover`:`munder`],[s],t)};Bc({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:cd,mathmlBuilder:(e,t)=>{var n=El(e.label);return new Y(e.isOver?`mover`:`munder`,[hl(e.base,t),n])}}),Bc({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=Il(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Uc(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Jc(e.body,t,!1);return Sc(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ml(e.body,t);return n instanceof Y||(n=new Y(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Bc({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=Il(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:Uc(s)}}}),Bc({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:Uc(t[0])}},htmlBuilder(e,t){return Cc(Jc(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Y(`mrow`,pl(e.body,t.withFont(``)))}}),Bc({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=Il(t[0],`raw`).string,a=t[1];n.settings.strict&&dc({strict:n.settings.strict,errorCode:`htmlExtension`,errorMsg:`HTML extension is disabled on strict mode`,report:!0});var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new B(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:Uc(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Jc(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=J(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>ml(e.body,t)}),Bc({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:Uc(t[0]),mathml:Uc(t[1])}),htmlBuilder:(e,t)=>Cc(Jc(e.html,t,!1)),mathmlBuilder:(e,t)=>ml(e.mathml,t)});var ld=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!Yo(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Bc({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Il(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=ld(d);break;case`height`:a=ld(d);break;case`totalheight`:o=ld(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=Il(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=Xo(e.height,t),r=0;e.totalheight.number>0&&(r=Xo(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Xo(e.width,t));var a={height:Zo(n+r)};i>0&&(a.width=Zo(i)),r>0&&(a.verticalAlign=Zo(-r));var o=new os(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Y(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=Xo(e.height,t),i=0;if(e.totalheight.number>0&&(i=Xo(e.totalheight,t)-r,n.setAttribute(`valign`,Zo(-i))),n.setAttribute(`height`,Zo(r+i)),e.width.number>0){var a=Xo(e.width,t);n.setAttribute(`width`,Zo(a))}return n.setAttribute(`src`,e.src),n}}),Bc({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=Il(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||dc({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&dc({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&dc({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` doesn't support mu units`,report:!0})}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Dc(e.dimension,t)},mathmlBuilder(e,t){return new al(Xo(e.dimension,t))}}),Bc({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=J([],[el(e.body,t)]),n=J([`katex-inner`],[n],t)):n=J([`katex-inner`],[el(e.body,t)]);var r=J([`katex-fix`],[]),i=J([e.alignment],[n,r],t),a=J([`katex-strut`]);return a.style.height=Zo(i.height+i.depth),i.depth&&(a.style.verticalAlign=Zo(-i.depth)),i.children.unshift(a),i=J([`katex-thinbox`],[i],t),J([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Y(`mpadded`,[hl(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Bc({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Bc({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new B(`Mismatched `+e.funcName)}});var ud=(e,t)=>{switch(t.style.size){case Do.DISPLAY.size:return e.display;case Do.TEXT.size:return e.text;case Do.SCRIPT.size:return e.script;case Do.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Bc({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:Uc(t[0]),text:Uc(t[1]),script:Uc(t[2]),scriptscript:Uc(t[3])}),htmlBuilder:(e,t)=>Cc(Jc(ud(e,t),t,!1)),mathmlBuilder:(e,t)=>ml(ud(e,t),t)});var dd=(e,t,n,r,i,a,o)=>{e=J([],[e]);var s=n&&ro(n),c,l;if(t){var u=el(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=el(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=Ec({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:Zo(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:Zo(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=Ec({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:Zo(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=Ec({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:Zo(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=J([`mspace`],[],r);m.style.marginRight=Zo(a),p.unshift(m)}return J([`mop`,`op-limits`],p,r)},fd=new Set([`\\smallint`]),pd=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Il(e.base,`op`),i=!0):a=Il(e,`op`);var o=t.style,s=!1;o.size===Do.DISPLAY.size&&a.symbol&&!fd.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=pc(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=jc(d+`Size`+(s?`2`:`1`),t);c=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=Jc(a.body,t,!0);p.length===1&&p[0]instanceof cs?(c=p[0],c.classes[0]=`mop`):c=J([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(mc(a.name[h],a.mode,t));c=J([`mop`],m,t)}var g=0,_=0;return(c instanceof cs||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?dd(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=Zo(g)),c)},md=(e,t)=>{var n;if(e.symbol)n=new Y(`mo`,[cl(e.name,e.mode)]),fd.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Y(`mo`,pl(e.body,t));else{n=new Y(`mi`,[new il(e.name.slice(1))]);var r=new Y(`mo`,[cl(``,`text`)]);n=e.parentIsSupSub?new Y(`mrow`,[n,r]):rl([n,r])}return n},hd={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Bc({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=hd[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:pd,mathmlBuilder:md}),Bc({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Uc(r)}}});var gd={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Bc({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Bc({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Bc({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=gd[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var _d=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Il(e.base,`operatorname`),i=!0):a=Il(e,`operatorname`);var o;if(a.body.length>0){for(var s=Jc(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof cs&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=J([`mop`],s,t)}else o=J([`mop`],[],t);return i?dd(o,n,r,t,t.style,0,0):o};Bc({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:Uc(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:_d,mathmlBuilder:(e,t)=>{for(var n=pl(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof al)){if(a instanceof Y)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof il?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new il(n.map(e=>e.toText()).join(``))]);var s=new Y(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Y(`mo`,[cl(``,`text`)]);return e.parentIsSupSub?new Y(`mrow`,[s,c]):rl([s,c])}}),X(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),Vc({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?Cc(Jc(e.body,t,!1)):J([`mord`],Jc(e.body,t,!0),t)},mathmlBuilder(e,t){return ml(e.body,t,!0)}}),Bc({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=el(e.body,t.havingCrampedStyle()),r=xc(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return J([`mord`,`katex-overline`],[Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Y(`mo`,[new il(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Y(`mover`,[hl(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Bc({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:Uc(r)}},htmlBuilder:(e,t)=>Cc(Jc(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Y(`mphantom`,pl(e.body,t))}),X(`\\hphantom`,`\\smash{\\phantom{#1}}`),Bc({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>J([`mord`,`rlap`],[J([`katex-inner`],[el(e.body,t.withPhantom())]),J([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Y(`mpadded`,[new Y(`mphantom`,pl(Uc(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Bc({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=Il(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=el(e.body,t);return Ec({positionType:`shift`,positionData:-Xo(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Y(`mpadded`,[hl(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var vd=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Bc({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:vd,htmlBuilder(e,t){return J([`mord`,`reflectbox`],[el(e.body,t)],t)},mathmlBuilder(e,t){return hl(e.body,t)}}),Bc({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:vd}),Bc({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),Bc({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=Il(t[0],`size`),o=Il(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Il(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=J([`mord`,`katex-rule`],[],t),r=Xo(e.width,t),i=Xo(e.height,t),a=e.shift?Xo(e.shift,t):0;return n.style.borderRightWidth=Zo(r),n.style.borderTopWidth=Zo(i),n.style.bottom=Zo(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Xo(e.width,t),r=Xo(e.height,t),i=e.shift?Xo(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Y(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,Zo(n)),o.setAttribute(`height`,Zo(r));var s=new Y(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,Zo(i)):(s.setAttribute(`height`,Zo(i)),s.setAttribute(`depth`,Zo(-i))),s.setAttribute(`voffset`,Zo(i)),s}});function yd(e,t,n){for(var r=Jc(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return Cc(r)}var bd=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Bc({type:`sizing`,names:bd,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:bd.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return yd(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Y(`mstyle`,pl(e.body,n));return r.setAttribute(`mathsize`,Zo(n.sizeMultiplier)),r}}),Bc({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&Il(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=Ll(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=J([],[el(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return J([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return J([`mord`],[Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Y(`mpadded`,[hl(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Bc({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=el(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=wc(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Do.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=bu(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=Zo(l);var f=Ec({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(Do.SCRIPTSCRIPT),m=el(e.index,p,t);return J([`mord`,`sqrt`],[J([`katex-root`],[Ec({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return J([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Y(`mroot`,[hl(n,t),hl(r,t)]):new Y(`msqrt`,[hl(n,t)])}});var xd={display:Do.DISPLAY,text:Do.TEXT,script:Do.SCRIPT,scriptscript:Do.SCRIPTSCRIPT};function Sd(e){return e in xd}Bc({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!Sd(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=xd[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),yd(e.body,r,t)},mathmlBuilder(e,t){var n=xd[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Y(`mstyle`,pl(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var Cd=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===Do.DISPLAY.size||n.alwaysHandleSupSub)?pd:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===Do.DISPLAY.size||n.limits)?_d:null:n.type===`accent`?ro(n.base)?Vl:null:n.type===`horizBrace`&&!e.sub===n.isOver?cd:null:null};Vc({type:`supsub`,htmlBuilder(e,t){var n=Cd(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=el(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&ro(r);if(i){var p=t.havingStyle(t.style.sup());s=el(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=el(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===Do.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=Zo(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof cs||y)&&(v=Zo(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=Ec({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=Ec({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=Ec({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return J([Qc(o,`right`)||`mord`],[o,J([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[hl(e.base,t)];e.sub&&a.push(hl(e.sub,t)),e.sup&&a.push(hl(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===Do.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===Do.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===Do.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===Do.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===Do.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===Do.DISPLAY)?`munder`:`msub`}return new Y(o,a)}}),Vc({type:`atom`,htmlBuilder(e,t){return mc(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Y(`mo`,[cl(e.text,e.mode)]);if(e.family===`bin`){var r=dl(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var wd={mi:`italic`,mn:`normal`,mtext:`normal`};Vc({type:`mathord`,htmlBuilder(e,t){return gc(e,t)},mathmlBuilder(e,t){var n=new Y(`mi`,[cl(e.text,e.mode,t)]),r=dl(e,t)||`italic`;return r!==wd[n.type]&&n.setAttribute(`mathvariant`,r),n}}),Vc({type:`textord`,htmlBuilder(e,t){return gc(e,t)},mathmlBuilder(e,t){var n=cl(e.text,e.mode,t),r=dl(e,t)||`normal`,i=e.mode===`text`?new Y(`mtext`,[n]):/[0-9]/.test(e.text)?new Y(`mn`,[n]):e.text===`\\prime`?new Y(`mo`,[n]):new Y(`mi`,[n]);return r!==wd[i.type]&&i.setAttribute(`mathvariant`,r),i}});var Td=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),Ed=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);Vc({type:`spacing`,htmlBuilder(e,t){var n=Ed.get(e.text),r=Td.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=gc(e,t);return a.classes.push(i),a}return J([`mspace`,i],[mc(e.text,e.mode,t)],t)}if(r)return J([`mspace`,r],[],t);throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(Ed.has(e.text))n=new Y(`mtext`,[new il(`\xA0`)]);else if(Td.has(e.text))return new Y(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var Dd=()=>{var e=new Y(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};Vc({type:`tag`,mathmlBuilder(e,t){var n=new Y(`mtable`,[new Y(`mtr`,[Dd(),new Y(`mtd`,[ml(e.body,t)]),Dd(),new Y(`mtd`,[ml(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var Od={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},kd={"\\textbf":`textbf`,"\\textmd":`textmd`},Ad={"\\textit":`textit`,"\\textup":`textup`},jd=(e,t)=>{var n=e.font;return n?Od[n]?t.withTextFontFamily(Od[n]):kd[n]?t.withTextFontWeight(kd[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(Ad[n]):t};Bc({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:Uc(i),font:r}},htmlBuilder(e,t){var n=jd(e,t);return J([`mord`,`text`],Jc(e.body,n,!0),n)},mathmlBuilder(e,t){var n=jd(e,t);return ml(e.body,n)}}),Bc({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=el(e.body,t),r=xc(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return J([`mord`,`katex-underline`],[Ec({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Y(`mo`,[new il(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Y(`munder`,[hl(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Bc({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=el(e.body,t),r=t.fontMetrics().axisHeight;return Ec({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Y(`mrow`,[new Y(`mpadded`,[hl(e.body,t)],[`vcenter`])])}}),Bc({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new B(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=Md(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(pc(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return J([`mord`,`text`].concat(i.sizingClasses(t)),vc(r),i)},mathmlBuilder(e,t){var n=new Y(`mtext`,[new il(Md(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var Md=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),Nd=Lc,Pd=`[ \r
|
|
309
|
-
]`,Fd=`\\\\[a-zA-Z@]+`,Id=`\\\\[^\ud800-\udfff]`,Ld=`(`+Fd+`)`+Pd+`*`,Rd=`\\\\(
|
|
310
|
-
|[ \r ]+
|
|
311
|
-
?)[ \r ]*`,zd=`[̀-ͯ]`,Bd=RegExp(zd+`+$`),Vd=`(`+Pd+`+)|`+(Rd+`|`)+`([!-\\[\\]-‧-豈-]`+(zd+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(zd+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+Ld)+(`|`+Id+`)`),Hd=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Vd,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Hu(`EOF`,new Vu(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new Hu(e[t],new Vu(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
|
|
312
|
-
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,dc({strict:this.settings.strict,errorCode:`commentAtEnd`,errorMsg:`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`,report:!0})):this.tokenRegex.lastIndex=i+1,this.lex()}return new Hu(r,new Vu(this,t,this.tokenRegex.lastIndex))}},Ud=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},Wd=Bu;X(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),X(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),X(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),X(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),X(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),X(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),X(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Gd={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};X(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new B("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Gd[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=Gd[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var Kd=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new B(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new B(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new B(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new B(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};X(`\\newcommand`,e=>Kd(e,!1,!0,!1)),X(`\\renewcommand`,e=>Kd(e,!0,!1,!1)),X(`\\providecommand`,e=>Kd(e,!0,!0,!0)),X(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),X(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),X(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Nd[n],Ss.math[n],Ss.text[n]),``}),X(`\\bgroup`,`{`),X(`\\egroup`,`}`),X(`~`,`\\nobreakspace`),X(`\\lq`,"`"),X(`\\rq`,`'`),X(`\\aa`,`\\r a`),X(`\\AA`,`\\r A`),X(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),X(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),X(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),X(`ℬ`,`\\mathscr{B}`),X(`ℰ`,`\\mathscr{E}`),X(`ℱ`,`\\mathscr{F}`),X(`ℋ`,`\\mathscr{H}`),X(`ℐ`,`\\mathscr{I}`),X(`ℒ`,`\\mathscr{L}`),X(`ℳ`,`\\mathscr{M}`),X(`ℛ`,`\\mathscr{R}`),X(`ℭ`,`\\mathfrak{C}`),X(`ℌ`,`\\mathfrak{H}`),X(`ℨ`,`\\mathfrak{Z}`),X(`\\Bbbk`,`\\Bbb{k}`),X(`\\llap`,`\\mathllap{\\textrm{#1}}`),X(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),X(`\\clap`,`\\mathclap{\\textrm{#1}}`),X(`\\mathstrut`,`\\vphantom{(}`),X(`\\underbar`,`\\underline{\\text{#1}}`),X(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),X(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),X(`\\ne`,`\\neq`),X(`≠`,`\\neq`),X(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),X(`∉`,`\\notin`),X(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),X(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),X(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),X(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),X(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),X(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),X(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),X(`⟂`,`\\perp`),X(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),X(`∌`,`\\notni`),X(`⌜`,`\\ulcorner`),X(`⌝`,`\\urcorner`),X(`⌞`,`\\llcorner`),X(`⌟`,`\\lrcorner`),X(`©`,`\\copyright`),X(`®`,`\\textregistered`),X(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),X(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),X(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),X(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),X(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),X(`⋮`,`\\vdots`),X(`\\varGamma`,`\\mathit{\\Gamma}`),X(`\\varDelta`,`\\mathit{\\Delta}`),X(`\\varTheta`,`\\mathit{\\Theta}`),X(`\\varLambda`,`\\mathit{\\Lambda}`),X(`\\varXi`,`\\mathit{\\Xi}`),X(`\\varPi`,`\\mathit{\\Pi}`),X(`\\varSigma`,`\\mathit{\\Sigma}`),X(`\\varUpsilon`,`\\mathit{\\Upsilon}`),X(`\\varPhi`,`\\mathit{\\Phi}`),X(`\\varPsi`,`\\mathit{\\Psi}`),X(`\\varOmega`,`\\mathit{\\Omega}`),X(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),X(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),X(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),X(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),X(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),X(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),X(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),X(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var qd={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},Jd=new Set([`bin`,`rel`]);X(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in qd?t=qd[n]:(n.slice(0,4)===`\\not`||n in Ss.math&&Jd.has(Ss.math[n].group))&&(t=`\\dotsb`),t});var Yd={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};X(`\\dotso`,function(e){return e.future().text in Yd?`\\ldots\\,`:`\\ldots`}),X(`\\dotsc`,function(e){var t=e.future().text;return t in Yd&&t!==`,`?`\\ldots\\,`:`\\ldots`}),X(`\\cdots`,function(e){return e.future().text in Yd?`\\@cdots\\,`:`\\@cdots`}),X(`\\dotsb`,`\\cdots`),X(`\\dotsm`,`\\cdots`),X(`\\dotsi`,`\\!\\cdots`),X(`\\dotsx`,`\\ldots\\,`),X(`\\DOTSI`,`\\relax`),X(`\\DOTSB`,`\\relax`),X(`\\DOTSX`,`\\relax`),X(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),X(`\\,`,`\\tmspace+{3mu}{.1667em}`),X(`\\thinspace`,`\\,`),X(`\\>`,`\\mskip{4mu}`),X(`\\:`,`\\tmspace+{4mu}{.2222em}`),X(`\\medspace`,`\\:`),X(`\\;`,`\\tmspace+{5mu}{.2777em}`),X(`\\thickspace`,`\\;`),X(`\\!`,`\\tmspace-{3mu}{.1667em}`),X(`\\negthinspace`,`\\!`),X(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),X(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),X(`\\enspace`,`\\kern.5em `),X(`\\enskip`,`\\hskip.5em\\relax`),X(`\\quad`,`\\hskip1em\\relax`),X(`\\qquad`,`\\hskip2em\\relax`),X(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),X(`\\tag@paren`,`\\tag@literal{({#1})}`),X(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new B(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),X(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),X(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),X(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),X(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),X(`\\newline`,`\\\\\\relax`),X(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var Xd=Zo(hs[`Main-Regular`][84][1]-.7*hs[`Main-Regular`][65][1]);X(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+Xd+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),X(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+Xd+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),X(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),X(`\\@hspace`,`\\hskip #1\\relax`),X(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),X(`\\ordinarycolon`,`:`),X(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),X(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),X(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),X(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),X(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),X(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),X(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),X(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),X(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),X(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),X(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),X(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),X(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),X(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),X(`∷`,`\\dblcolon`),X(`∹`,`\\eqcolon`),X(`≔`,`\\coloneqq`),X(`≕`,`\\eqqcolon`),X(`⩴`,`\\Coloneqq`),X(`\\ratio`,`\\vcentcolon`),X(`\\coloncolon`,`\\dblcolon`),X(`\\colonequals`,`\\coloneqq`),X(`\\coloncolonequals`,`\\Coloneqq`),X(`\\equalscolon`,`\\eqqcolon`),X(`\\equalscoloncolon`,`\\Eqqcolon`),X(`\\colonminus`,`\\coloneq`),X(`\\coloncolonminus`,`\\Coloneq`),X(`\\minuscolon`,`\\eqcolon`),X(`\\minuscoloncolon`,`\\Eqcolon`),X(`\\coloncolonapprox`,`\\Colonapprox`),X(`\\coloncolonsim`,`\\Colonsim`),X(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),X(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),X(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),X(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),X(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),X(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),X(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),X(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),X(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),X(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),X(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),X(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),X(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),X(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),X(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),X(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),X(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),X(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),X(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),X(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),X(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),X(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),X(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),X(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),X(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),X(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),X(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),X(`\\imath`,`\\html@mathml{\\@imath}{ı}`),X(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),X(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),X(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),X(`⟦`,`\\llbracket`),X(`⟧`,`\\rrbracket`),X(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),X(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),X(`↤`,`\\mapsfrom`),X(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),X(`⦃`,`\\lBrace`),X(`⦄`,`\\rBrace`),X(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),X(`⦵`,`\\minuso`),X(`\\darr`,`\\downarrow`),X(`\\dArr`,`\\Downarrow`),X(`\\Darr`,`\\Downarrow`),X(`\\lang`,`\\langle`),X(`\\rang`,`\\rangle`),X(`\\uarr`,`\\uparrow`),X(`\\uArr`,`\\Uparrow`),X(`\\Uarr`,`\\Uparrow`),X(`\\N`,`\\mathbb{N}`),X(`\\R`,`\\mathbb{R}`),X(`\\Z`,`\\mathbb{Z}`),X(`\\alef`,`\\aleph`),X(`\\alefsym`,`\\aleph`),X(`\\Alpha`,`\\mathrm{A}`),X(`\\Beta`,`\\mathrm{B}`),X(`\\bull`,`\\bullet`),X(`\\Chi`,`\\mathrm{X}`),X(`\\clubs`,`\\clubsuit`),X(`\\cnums`,`\\mathbb{C}`),X(`\\Complex`,`\\mathbb{C}`),X(`\\Dagger`,`\\ddagger`),X(`\\diamonds`,`\\diamondsuit`),X(`\\empty`,`\\emptyset`),X(`\\Epsilon`,`\\mathrm{E}`),X(`\\Eta`,`\\mathrm{H}`),X(`\\exist`,`\\exists`),X(`\\harr`,`\\leftrightarrow`),X(`\\hArr`,`\\Leftrightarrow`),X(`\\Harr`,`\\Leftrightarrow`),X(`\\hearts`,`\\heartsuit`),X(`\\image`,`\\Im`),X(`\\infin`,`\\infty`),X(`\\Iota`,`\\mathrm{I}`),X(`\\isin`,`\\in`),X(`\\Kappa`,`\\mathrm{K}`),X(`\\larr`,`\\leftarrow`),X(`\\lArr`,`\\Leftarrow`),X(`\\Larr`,`\\Leftarrow`),X(`\\lrarr`,`\\leftrightarrow`),X(`\\lrArr`,`\\Leftrightarrow`),X(`\\Lrarr`,`\\Leftrightarrow`),X(`\\Mu`,`\\mathrm{M}`),X(`\\natnums`,`\\mathbb{N}`),X(`\\Nu`,`\\mathrm{N}`),X(`\\Omicron`,`\\mathrm{O}`),X(`\\plusmn`,`\\pm`),X(`\\rarr`,`\\rightarrow`),X(`\\rArr`,`\\Rightarrow`),X(`\\Rarr`,`\\Rightarrow`),X(`\\real`,`\\Re`),X(`\\reals`,`\\mathbb{R}`),X(`\\Reals`,`\\mathbb{R}`),X(`\\Rho`,`\\mathrm{P}`),X(`\\sdot`,`\\cdot`),X(`\\sect`,`\\S`),X(`\\spades`,`\\spadesuit`),X(`\\sub`,`\\subset`),X(`\\sube`,`\\subseteq`),X(`\\supe`,`\\supseteq`),X(`\\Tau`,`\\mathrm{T}`),X(`\\thetasym`,`\\vartheta`),X(`\\weierp`,`\\wp`),X(`\\Zeta`,`\\mathrm{Z}`),X(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),X(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),X(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),X(`\\bra`,`\\mathinner{\\langle{#1}|}`),X(`\\ket`,`\\mathinner{|{#1}\\rangle}`),X(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),X(`\\Bra`,`\\left\\langle#1\\right|`),X(`\\Ket`,`\\left|#1\\right\\rangle`);var Zd=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};X(`\\bra@ket`,Zd(!1)),X(`\\bra@set`,Zd(!0)),X(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),X(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),X(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),X(`\\angln`,`{\\angl n}`),X(`\\blue`,`\\textcolor{##6495ed}{#1}`),X(`\\orange`,`\\textcolor{##ffa500}{#1}`),X(`\\pink`,`\\textcolor{##ff00af}{#1}`),X(`\\red`,`\\textcolor{##df0030}{#1}`),X(`\\green`,`\\textcolor{##28ae7b}{#1}`),X(`\\gray`,`\\textcolor{gray}{#1}`),X(`\\purple`,`\\textcolor{##9d38bd}{#1}`),X(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),X(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),X(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),X(`\\blueD`,`\\textcolor{##11accd}{#1}`),X(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),X(`\\tealA`,`\\textcolor{##94fff5}{#1}`),X(`\\tealB`,`\\textcolor{##26edd5}{#1}`),X(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),X(`\\tealD`,`\\textcolor{##01a995}{#1}`),X(`\\tealE`,`\\textcolor{##208170}{#1}`),X(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),X(`\\greenB`,`\\textcolor{##8af281}{#1}`),X(`\\greenC`,`\\textcolor{##74cf70}{#1}`),X(`\\greenD`,`\\textcolor{##1fab54}{#1}`),X(`\\greenE`,`\\textcolor{##0d923f}{#1}`),X(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),X(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),X(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),X(`\\goldD`,`\\textcolor{##e07d10}{#1}`),X(`\\goldE`,`\\textcolor{##a75a05}{#1}`),X(`\\redA`,`\\textcolor{##fca9a9}{#1}`),X(`\\redB`,`\\textcolor{##ff8482}{#1}`),X(`\\redC`,`\\textcolor{##f9685d}{#1}`),X(`\\redD`,`\\textcolor{##e84d39}{#1}`),X(`\\redE`,`\\textcolor{##bc2612}{#1}`),X(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),X(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),X(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),X(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),X(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),X(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),X(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),X(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),X(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),X(`\\purpleE`,`\\textcolor{##543b78}{#1}`),X(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),X(`\\mintB`,`\\textcolor{##edf2df}{#1}`),X(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),X(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),X(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),X(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),X(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),X(`\\grayE`,`\\textcolor{##babec2}{#1}`),X(`\\grayF`,`\\textcolor{##888d93}{#1}`),X(`\\grayG`,`\\textcolor{##626569}{#1}`),X(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),X(`\\grayI`,`\\textcolor{##21242c}{#1}`),X(`\\kaBlue`,`\\textcolor{##314453}{#1}`),X(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var Qd={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},$d=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Ud(Wd,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Hd(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new Hu(`EOF`,n.loc)),this.pushTokens(r),new Hu(``,Vu.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new B(`Extra }`,i)}else if(i.text===`EOF`)throw new B(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new B(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new B(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new B(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new B(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new B(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Hu(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new Hd(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(Nd,e)||Object.prototype.hasOwnProperty.call(Ss.math,e)||Object.prototype.hasOwnProperty.call(Ss.text,e)||Object.prototype.hasOwnProperty.call(Qd,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(Nd,e)&&!Nd[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},ef=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,tf=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),nf={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},rf={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},af=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new $d(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Hu(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&Nd[i.text]&&Nd[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new B(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new B(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new B(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new B(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new B(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new B(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(tf[i.text]){var s=ef.test(i.text),c=[];for(c.push(new Hu(tf[i.text])),this.consume();;){var l=this.fetch().text;if(!tf[l]||ef.test(l)!==s)break;c.unshift(new Hu(tf[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Nd[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new B(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new B(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new B(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Nd[e];if(o&&o.handler)return o.handler(a,t,n);throw new B(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new B(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:this.gullet.consumeSpaces();var i=this.gullet.lexer.catcodes[`%`];this.gullet.lexer.setCatcode(`%`,12);var a=this.parseStringGroup(n);return this.gullet.lexer.setCatcode(`%`,i),a==null?null:{type:`raw`,mode:`text`,string:a.text};case`primitive`:if(n)throw new B(`A primitive argument cannot be optional`);var o=this.parseGroup(e);if(o==null)throw new B(`Expected group as `+e,this.fetch());return o;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new B(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new B(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new B(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new B(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Yo(i))throw new B(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){var t=this.gullet.lexer.catcodes[`%`],n=this.gullet.lexer.catcodes[`~`];this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var r=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,t),this.gullet.lexer.setCatcode(`~`,n),r==null)return null;var i=r.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:i}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:Vu.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(Qd,r)){if(this.settings.throwOnError)throw new B(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:Vu.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:Vu.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:Vu.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new B(`\\verb assertion failed --
|
|
313
|
-
please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(rf,t[0])&&!Ss[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&dc({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=rf[t[0]]+t.slice(1));var i=Bd.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Ss[this.mode][t]){this.settings.strict&&this.mode===`math`&&qs.includes(t)&&dc({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=Ss[this.mode][t].group,s=Vu.range(e);a=Fl(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(jo(t.charCodeAt(0))?this.mode===`math`&&dc({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):dc({strict:this.settings.strict,errorCode:`unknownSymbol`,errorMsg:`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),report:!0,token:e})),a={type:`textord`,mode:`text`,loc:Vu.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!nf[l])throw new B(`Unknown accent ' `+l+`'`,e);var u=nf[l][this.mode]||nf[l].text;if(!u)throw new B(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:Vu.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};af.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var of=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new af(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new B(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new Hu(`\\df@tag`)])}]}return r},sf=function(e,t,n){t.textContent=``;var r=df(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),sf=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var cf=function(e,t){return df(e,t).toMarkup()},lf=function(e,t){return of(e,new lo(t))},uf=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=J([`katex-error`],[new cs(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},df=function(e,t){var n=new lo(t);try{return Cl(of(e,n),e,n)}catch(t){return uf(t,e,n)}},ff={version:`0.19.1`,render:sf,renderToString:cf,ParseError:B,SETTINGS_SCHEMA:ao,__parse:lf,__renderToDomTree:df,__renderToHTMLTree:function(e,t){var n=new lo(t);try{return wl(of(e,n),n)}catch(t){return uf(t,e,n)}},__setFontMetrics:vs,__defineSymbol:V,__defineFunction:Bc,__defineMacro:X,__domTree:{Span:is,Anchor:as,SymbolNode:cs,SvgNode:ls,PathNode:us,LineNode:ds}};function pf(e){try{return{html:ff.renderToString(e,{displayMode:!0,throwOnError:!0,output:`htmlAndMathml`,strict:`ignore`})}}catch(t){let n=t instanceof Error?t.message:String(t);return{html:ff.renderToString(e,{displayMode:!0,throwOnError:!1,output:`htmlAndMathml`,strict:`ignore`}),error:n}}}var mf={math:`math`,mermaid:`mermaid`},hf=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,gf=/^([—–-]|n\/a|N\/A|NA)$/u,_f=e=>e.map(e=>e.text).join(``).trim();function vf(e){let t=e.head===void 0||e.head===`both`,n=e.head===`column`||e.head===`both`,r=t?e.rows.slice(1):e.rows,i=Math.max(0,...e.rows.map(e=>e.length)),a=new Set;for(let e=+!!n;e<i;e++){let t=r.map(t=>_f(t[e]??[]));t.some(e=>hf.test(e))&&t.every(e=>e===``||hf.test(e)||gf.test(e))&&a.add(e)}return a}function yf(e){return e?.type===`heading`&&e.level===1&&e.toggle!==!0&&(e.children?.length??0)===0}function bf(e){let t=e[0];return yf(t)?{title:t,body:e.slice(1)}:{title:void 0,body:[...e]}}function xf(e){return yf(e)?e.content.map(e=>e.text).join(``):``}function Sf(e,t){let n=t.replace(/\s+/g,` `).trim();if(n===``)return;if(yf(e)&&xf(e)===n)return e;let r=[{text:n,styles:{}}];return{type:`heading`,level:1,...yf(e)&&e.look?{look:e.look}:{},content:r}}function Cf(e,t){return e?[e,...t]:[...t]}var wf={sans:`Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`,serif:`Caladea, Cambria, "Noto Serif SC", "Songti SC", Georgia, serif`,times:`Tinos, "Times New Roman", Times, "Noto Serif SC", serif`,mono:`Cousine, "Courier New", "Noto Sans SC", monospace`,song:`"Noto Serif SC", "Songti SC", SimSun, "宋体", serif`,hei:`"Noto Sans SC", "PingFang SC", SimHei, "黑体", sans-serif`,fangsong:`FangSong, STFangsong, "仿宋", "FangSong_GB2312", "Noto Serif SC", serif`,kai:`"LXGW WenKai", KaiTi, STKaiti, "楷体", "Noto Serif SC", serif`,xiaobiaosong:`"FZXiaoBiaoSong-B05S", "方正小标宋简体", "Noto Serif SC", "Songti SC", serif`};function Tf(e={}){let t=Gi(e).font??`sans`;return{text:wf[t],heading:wf[t],mono:wf.mono}}var Ef=(e={})=>e.accent===void 0?void 0:Oa(e.accent);function Df(e){let t=new Map,n=new Map;for(let r of _a(e)){if(r.type!==`heading`)continue;let e=r.content.map(e=>e.text).join(``).trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,``).replace(/\s/gu,`-`),i=e===``?`section`:e,a=n.get(i)??0;n.set(i,a+1),t.set(r,a===0?i:`${i}-${String(a)}`)}return t}function Of(e,t){let n=Math.min(...e),r=Math.max(...e)-n||1;return`<svg class="stat-trend" viewBox="0 0 100 24" preserveAspectRatio="none" aria-hidden="true"><path d="${e.map((t,i)=>[i/Math.max(1,e.length-1)*100,22-(t-n)/r*20]).map(([e,t],n)=>`${n===0?`M`:`L`}${(e??0).toFixed(1)} ${(t??0).toFixed(1)}`).join(` `)}" fill="none" stroke="${t}" stroke-width="1.5" vector-effect="non-scaling-stroke" stroke-linejoin="round" stroke-linecap="round"/></svg>`}`${ui.ink}${ui.lead}${ui.leadSoft}${ui.ruleStrong}${ui.ink}${ui.ink}${ui.leadSoft}${ui.ruleStrong}${ui.ruleStrong}${ui.lead}${ui.stone2}${ui.stone}${ui.stone}${ui.ruleMid}${ui.ruleStrong}${ui.ruleStrong}${ui.ruleStrong}${ui.stone3}${ui.leadSoft}${ui.rule}${ui.ruleStrong}${ui.rule}${ui.sheet}${ui.lead}${ui.rule}${ui.sheet}${ui.lead}${ui.ink}${ui.stone}${ui.ruleMid}${ui.leadSoft}${ui.lead}${ui.rule}${ui.lead}${ui.leadSoft}${ui.ruleMid}`,`${Ua({scope:`main`,face:`Noto Color Emoji`})}`;function kf(){return{enter:{mdxFlowExpression:Af,mdxTextExpression:jf},exit:{mdxFlowExpression:Mf,mdxFlowExpressionChunk:Nf,mdxTextExpression:Mf,mdxTextExpressionChunk:Nf}}}function Af(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function jf(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function Mf(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function Nf(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}var Pf=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Ff={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function If(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Lf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Rf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function zf(e){return Rf(e)||If(e)}var Bf=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Vf(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?zf:u===`decimal`?If:Lf;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Pf.includes(y)&&(_=y,v=nr(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&nr(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):zf(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Hf(e))h(7,S),C=`�`;else if(e in Ff)h(6,S),C=Ff[e];else{let t=``;Uf(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Bf[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Hf(e){return e>=55296&&e<=57343||e>1114111}function Uf(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}function Wf(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new mt("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new mt(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new mt("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=Vf(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new mt("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+sr(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new mt("Expected a closing tag for `"+S(r)+"` ("+sr({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new mt("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+sr(t.end)+") or another opening tag after the start of `"+t.type+"` ("+sr(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Gf(){return{enter:{mdxjsEsm:Kf},exit:{mdxjsEsm:qf,mdxjsEsmData:Jf}}}function Kf(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function qf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function Jf(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Yf(){return[kf(),Wf(),Gf()]}var Xf={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Zf={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Qf={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},$f=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ep=[12288,12288,65281,65376,65504,65510],tp=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],np=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],rp=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],ip=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},ap=19968,[op,sp]=cp(rp);function cp(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(ap>=i&&ap<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var lp=e=>e<161||e>1114109?!1:ip($f,e),up=e=>e<12288||e>65510?!1:ip(ep,e),dp=e=>e<8361||e>65518?!1:ip(tp,e),fp=e=>e<32||e>10630?!1:ip(np,e),pp=e=>e>=op&&e<=sp?!0:e<4352||e>262141?!1:ip(rp,e);function mp(e){return lp(e)?`ambiguous`:up(e)?`fullwidth`:dp(e)?`halfwidth`:fp(e)?`narrow`:pp(e)?`wide`:`neutral`}function hp(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function gp(e){return hp(e),mp(e)}function _p(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function vp(e){if(!e||e<4352)return!1;switch(gp(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!_p(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function yp(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function bp(e){return e!==null&&e>=65024&&e<=65038}var xp=Cp(/\p{P}|\p{S}/u),Sp=Cp(/\s/);function Cp(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function wp(e){return!!(e&Zf.characterGroupWhitespace)}function Tp(e){return(e&Ap.cjkPunctuation)===Zf.characterGroupPunctuation}function Ep(e){return!!(e&Ap.cjk)}function Dp(e){return!!(e&Ap.cjkOrIvs)}function Op(e){return e===Ap.nonEmojiGeneralUseVS}function kp(e){return!!(e&Ap.spaceOrPunctuation)}var Ap;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(Ap||={});function jp(e){if(e===Xf.eof||tr(e)||Sp(e))return Zf.characterGroupWhitespace;let t=0;if(e>=4352){if(bp(e))return Ap.nonEmojiGeneralUseVS;switch(vp(e)){case null:return Ap.ivs;case!0:t|=Ap.cjk}}return xp(e)&&(t|=Zf.characterGroupPunctuation),t}function Mp(e,t,n){if(!Op(e))return e;let r=t(),i=jp(r);return!r||wp(i)?e:yp(r,n)?Ap.cjkPunctuation:Np(i)}function Np(e){return e&~Ap.ivs}function Pp(e){return!!(e&&e>=55296&&e<=56319)}function Fp(e){return!!(e&&e>=56320&&e<=57343)}function Ip(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Lp(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var Rp=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Lp(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function zp(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var Bp={name:`attention`,resolveAll:Vp,tokenize:Hp};function Vp(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Up(d,-c),Up(f,c),o={type:c>1?Qf.strongSequence:Qf.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Qf.strongSequence:Qf.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Qf.strongText:Qf.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Qf.strong:Qf.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Qn(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Qn(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=Qn(l,$n(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Qn(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Qn(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,cr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Hp(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=Fp(a)?Ip(a,r(),i):a,s=jp(o),c=new Rp(o,r(),i),l=Mp(s,c.value.bind(c),o),u;return d;function d(t){return t===Xf.asterisk||Xf.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=jp(Pp(a)?zp(a,r(),i):a),d=Tp(l),p=o===Xf.asterisk||o===Xf.underscore,m=d||wp(l)||p,h=Tp(c),g=a===Xf.asterisk||a===Xf.underscore,_=h||wp(c)||g,v=Dp(l),y=!_||h&&(m||v)||n.includes(a)&&a!==Xf.asterisk&&a!==Xf.underscore,b=!m||d&&(_||Ep(c))||n.includes(o)&&o!==Xf.asterisk&&o!==Xf.underscore;return s._open=!!(u===Xf.asterisk?y:y&&(kp(l)||!b)),s._close=!!(u===Xf.asterisk?b:b&&(kp(c)||!y)),t(a)}}function Up(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Wp(){return{text:{[Xf.asterisk]:Bp,[Xf.underscore]:Bp},insideSpan:{null:[Bp]}}}var Gp=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Kp=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],qp=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,Jp=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,Yp={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},Xp=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,Zp={5:Xp,"5module":Xp+` export import`,6:Xp+` const class extends export import super`},Qp=/^in(stanceof)?$/,$p=RegExp(`[`+Jp+`]`),em=RegExp(`[`+Jp+qp+`]`);function tm(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function nm(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&$p.test(String.fromCharCode(e)):t!==!1&&tm(e,Kp)}function rm(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&em.test(String.fromCharCode(e)):t===!1?!1:tm(e,Kp)||tm(e,Gp)}var im=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function am(e,t){return new im(e,{beforeExpr:!0,binop:t})}var om={beforeExpr:!0},sm={startsExpr:!0},cm={};function lm(e,t){return t===void 0&&(t={}),t.keyword=e,cm[e]=new im(e,t)}var Z={num:new im(`num`,sm),regexp:new im(`regexp`,sm),string:new im(`string`,sm),name:new im(`name`,sm),privateId:new im(`privateId`,sm),eof:new im(`eof`),bracketL:new im(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new im(`]`),braceL:new im(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new im(`}`),parenL:new im(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new im(`)`),comma:new im(`,`,om),semi:new im(`;`,om),colon:new im(`:`,om),dot:new im(`.`),question:new im(`?`,om),questionDot:new im(`?.`),arrow:new im(`=>`,om),template:new im(`template`),invalidTemplate:new im(`invalidTemplate`),ellipsis:new im(`...`,om),backQuote:new im("`",sm),dollarBraceL:new im("${",{beforeExpr:!0,startsExpr:!0}),eq:new im(`=`,{beforeExpr:!0,isAssign:!0}),assign:new im(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new im(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new im(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:am(`||`,1),logicalAND:am(`&&`,2),bitwiseOR:am(`|`,3),bitwiseXOR:am(`^`,4),bitwiseAND:am(`&`,5),equality:am(`==/!=/===/!==`,6),relational:am(`</>/<=/>=`,7),bitShift:am(`<</>>/>>>`,8),plusMin:new im(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:am(`%`,10),star:am(`*`,10),slash:am(`/`,10),starstar:new im(`**`,{beforeExpr:!0}),coalesce:am(`??`,1),_break:lm(`break`),_case:lm(`case`,om),_catch:lm(`catch`),_continue:lm(`continue`),_debugger:lm(`debugger`),_default:lm(`default`,om),_do:lm(`do`,{isLoop:!0,beforeExpr:!0}),_else:lm(`else`,om),_finally:lm(`finally`),_for:lm(`for`,{isLoop:!0}),_function:lm(`function`,sm),_if:lm(`if`),_return:lm(`return`,om),_switch:lm(`switch`),_throw:lm(`throw`,om),_try:lm(`try`),_var:lm(`var`),_const:lm(`const`),_while:lm(`while`,{isLoop:!0}),_with:lm(`with`),_new:lm(`new`,{beforeExpr:!0,startsExpr:!0}),_this:lm(`this`,sm),_super:lm(`super`,sm),_class:lm(`class`,sm),_extends:lm(`extends`,om),_export:lm(`export`),_import:lm(`import`,sm),_null:lm(`null`,sm),_true:lm(`true`,sm),_false:lm(`false`,sm),_in:lm(`in`,{beforeExpr:!0,binop:7}),_instanceof:lm(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:lm(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:lm(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:lm(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},um=/\r\n?|\n|\u2028|\u2029/,dm=new RegExp(um.source,`g`);function fm(e){return e===10||e===13||e===8232||e===8233}function pm(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(fm(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var mm=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,hm=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,gm=Object.prototype,_m=gm.hasOwnProperty,vm=gm.toString,ym=Object.hasOwn||(function(e,t){return _m.call(e,t)}),bm=Array.isArray||(function(e){return vm.call(e)===`[object Array]`}),xm=Object.create(null);function Sm(e){return xm[e]||(xm[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function Cm(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wm=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Tm=function(e,t){this.line=e,this.column=t};Tm.prototype.offset=function(e){return new Tm(this.line,this.column+e)};var Em=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function Dm(e,t){for(var n=1,r=0;;){var i=pm(e,r,t);if(i<0)return new Tm(n,t-r);++n,r=i}}var Om={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},km=!1;function Am(e){var t={};for(var n in Om)t[n]=e&&ym(e,n)?e[n]:Om[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!km&&typeof console==`object`&&console.warn&&(km=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
314
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),bm(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(bm(t.onComment)&&(t.onComment=jm(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function jm(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new Em(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var Mm=1,Nm=2,Pm=4,Fm=8,Im=16,Lm=32,Rm=64,zm=128,Bm=256,Vm=512,Hm=1024,Um=Mm|Nm|Bm;function Wm(e,t){return Nm|(e?Pm:0)|(t?Fm:0)}var Gm=0,Km=1,qm=2,Jm=3,Ym=4,Xm=5,Zm=function(e,t,n){this.options=e=Am(e),this.sourceFile=e.sourceFile,this.keywords=Sm(Zp[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=Yp[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=Sm(r);var i=(r?r+` `:``)+Yp.strict;this.reservedWordsStrict=Sm(i),this.reservedWordsStrictBind=Sm(i+` `+Yp.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
|
|
315
|
-
`,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(um).length)):this.lineStart=0,this.type=Z.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?Nm:Mm),this.regexpState=null,this.privateNameStack=[]},Qm={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Zm.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},Qm.inFunction.get=function(){return(this.currentVarScope().flags&Nm)>0},Qm.inGenerator.get=function(){return(this.currentVarScope().flags&Fm)>0},Qm.inAsync.get=function(){return(this.currentVarScope().flags&Pm)>0},Qm.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(Bm|Vm))return!1;if(t&Nm)return(t&Pm)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Qm.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Mm)},Qm.allowSuper.get=function(){return(this.currentThisScope().flags&Rm)>0||this.options.allowSuperOutsideMethod},Qm.allowDirectSuper.get=function(){return(this.currentThisScope().flags&zm)>0},Qm.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Qm.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(Bm|Vm)||t&Nm&&!(t&Im))return!0}return!1},Qm.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&Hm||!this.inModule&&e&Mm)},Qm.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Bm)>0},Zm.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Zm.parse=function(e,t){return new this(t,e).parse()},Zm.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Zm.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Zm.prototype,Qm);var $m=Zm.prototype,eh=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;$m.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){hm.lastIndex=e,e+=hm.exec(this.input)[0].length;var t=eh.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){hm.lastIndex=e+t[0].length;var n=hm.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||um.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&th(this,r))}e+=t[0].length,hm.lastIndex=e,e+=hm.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function th(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!rm(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}$m.eat=function(e){return this.type===e&&(this.next(),!0)},$m.isContextual=function(e){return this.type===Z.name&&this.value===e&&!this.containsEsc},$m.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},$m.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},$m.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},$m.canInsertSemicolon=function(){return this.type===Z.eof||this.type===Z.braceR||um.test(this.input.slice(this.lastTokEnd,this.start))},$m.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},$m.semicolon=function(){!this.eat(Z.semi)&&!this.insertSemicolon()&&this.unexpected()},$m.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},$m.expect=function(e){this.eat(e)||this.unexpected()},$m.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var nh=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};$m.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},$m.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},$m.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},$m.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var rh=Zm.prototype;rh.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==Z.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var ih={kind:`loop`},ah={kind:`switch`};rh.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;hm.lastIndex=this.pos;var t=hm.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(nm(r)){var i=n;do n+=r<=65535?1:2;while(rm(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!Qp.test(a))return!0}return!1},rh.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;hm.lastIndex=this.pos;var e=hm.exec(this.input),t=this.pos+e[0].length,n;return!um.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(rm(n=this.fullCharCodeAt(t+8))||n===92))},rh.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;hm.lastIndex=this.pos;var n=hm.exec(this.input),r=this.pos+n[0].length;if(um.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||rm(a=this.fullCharCodeAt(i))||a===92)return!1;hm.lastIndex=i;var o=hm.exec(this.input);if(r=i+o[0].length,o&&um.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!nm(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(rm(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);if(Qp.test(l))return!1;if(t&&!e&&l===`of`){hm.lastIndex=r;var u=hm.exec(this.input);if(r+=u[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},rh.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},rh.isUsing=function(e){return this.isUsingKeyword(!1,e)},rh.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=Z._var,a=`let`),r){case Z._break:case Z._continue:return this.parseBreakContinueStatement(i,r.keyword);case Z._debugger:return this.parseDebuggerStatement(i);case Z._do:return this.parseDoStatement(i);case Z._for:return this.parseForStatement(i);case Z._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case Z._class:return e&&this.unexpected(),this.parseClass(i,!0);case Z._if:return this.parseIfStatement(i);case Z._return:return this.parseReturnStatement(i);case Z._switch:return this.parseSwitchStatement(i);case Z._throw:return this.parseThrowStatement(i);case Z._try:return this.parseTryStatement(i);case Z._const:case Z._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case Z._while:return this.parseWhileStatement(i);case Z._with:return this.parseWithStatement(i);case Z.braceL:return this.parseBlock(!0,i);case Z.semi:return this.parseEmptyStatement(i);case Z._export:case Z._import:if(this.options.ecmaVersion>10&&r===Z._import){hm.lastIndex=this.pos;var o=hm.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===Z._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===Z.name&&d.type===`Identifier`&&this.eat(Z.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},rh.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(Z.semi)||this.insertSemicolon()?e.label=null:this.type===Z.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},rh.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},rh.parseDoStatement=function(e){return this.next(),this.labels.push(ih),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(Z._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Z.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},rh.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(ih),this.enterScope(0),this.expect(Z.parenL),this.type===Z.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===Z._var||this.type===Z._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new nh,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===Z._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===Z._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},rh.parseForAfterInit=function(e,t,n){return(this.type===Z._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===Z._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},rh.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,sh|(n?0:ch),!1,t)},rh.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(Z._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},rh.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(Z.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},rh.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Z.braceL),this.labels.push(ah),this.enterScope(Hm);for(var t,n=!1;this.type!==Z.braceR;)if(this.type===Z._case||this.type===Z._default){var r=this.type===Z._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(Z.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},rh.parseThrowStatement=function(e){return this.next(),um.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var oh=[];rh.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?Lm:0),this.checkLValPattern(e,t?Ym:qm),this.expect(Z.parenR),e},rh.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Z._catch){var t=this.startNode();this.next(),this.eat(Z.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(Z._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},rh.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},rh.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ih),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},rh.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},rh.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},rh.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===Z._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},rh.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},rh.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(Z.braceL),e&&this.enterScope(0);this.type!==Z.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},rh.parseFor=function(e,t){return e.init=t,this.expect(Z.semi),e.test=this.type===Z.semi?null:this.parseExpression(),this.expect(Z.semi),e.update=this.type===Z.parenR?null:this.parseExpression(),this.expect(Z.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},rh.parseForIn=function(e,t){var n=this.type===Z._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(Z.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},rh.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(Z.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===Z._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==Z._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==Z._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(Z.comma))break}return e},rh.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?Km:qm,!1)};var sh=1,ch=2,lh=4;rh.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===Z.star&&t&ch&&this.unexpected(),e.generator=this.eat(Z.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&sh&&(e.id=t&lh&&this.type!==Z.name?null:this.parseIdent(),e.id&&!(t&ch)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Km:qm:Jm));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wm(e.async,e.generator)),t&sh||(e.id=this.type===Z.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&sh?`FunctionDeclaration`:`FunctionExpression`)},rh.parseFunctionParams=function(e){this.expect(Z.parenL),e.params=this.parseBindingList(Z.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},rh.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(Z.braceL);this.type!==Z.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&uh(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},rh.parseClassElement=function(e){if(this.eat(Z.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(Z.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===Z.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===Z.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(Z.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===Z.parenL||o!==`method`||i||a){var l=!n.static&&dh(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},rh.isClassElementNameStart=function(){return this.type===Z.name||this.type===Z.privateId||this.type===Z.num||this.type===Z.string||this.type===Z.bracketL||this.type.keyword},rh.parseClassElementName=function(e){this.type===Z.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},rh.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&dh(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},rh.parseClassField=function(e){return dh(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&dh(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(Z.eq)?(this.enterScope(Vm|Rm),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},rh.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Bm|Rm);this.type!==Z.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},rh.parseClassId=function(e,t){this.type===Z.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,qm,!1)):(t===!0&&this.unexpected(),e.id=null)},rh.parseClassSuper=function(e){e.superClass=this.eat(Z._extends)?this.parseExprSubscripts(null,!1):null},rh.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},rh.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];ym(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function uh(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function dh(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}rh.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==Z.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},rh.parseExport=function(e,t){if(this.next(),this.eat(Z.star))return this.parseExportAllDeclaration(e,t);if(this.eat(Z._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==Z.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},rh.parseExportDeclaration=function(e){return this.parseStatement(null)},rh.parseExportDefaultDeclaration=function(){var e;if(this.type===Z._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,sh|lh,!1,e)}if(this.type===Z._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},rh.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),ym(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},rh.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},rh.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},rh.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},rh.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},rh.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(Z.braceL);!this.eat(Z.braceR);){if(n)n=!1;else if(this.expect(Z.comma),this.afterTrailingComma(Z.braceR))break;t.push(this.parseExportSpecifier(e))}return t},rh.parseImport=function(e){return this.next(),this.type===Z.string?(e.specifiers=oh,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===Z.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},rh.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,qm),this.finishNode(e,`ImportSpecifier`)},rh.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,qm),this.finishNode(e,`ImportDefaultSpecifier`)},rh.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,qm),this.finishNode(e,`ImportNamespaceSpecifier`)},rh.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===Z.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(Z.comma)))return e;if(this.type===Z.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(Z.braceL);!this.eat(Z.braceR);){if(t)t=!1;else if(this.expect(Z.comma),this.afterTrailingComma(Z.braceR))break;e.push(this.parseImportSpecifier())}return e},rh.parseWithClause=function(){var e=[];if(!this.eat(Z._with))return e;this.expect(Z.braceL);for(var t={},n=!0;!this.eat(Z.braceR);){if(n)n=!1;else if(this.expect(Z.comma),this.afterTrailingComma(Z.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;ym(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},rh.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===Z.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(Z.colon),this.type!==Z.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},rh.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Z.string){var e=this.parseLiteral(this.value);return wm.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},rh.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},rh.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var fh=Zm.prototype;fh.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},fh.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},fh.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},fh.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==Z.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},fh.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Z.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(Z.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case Z.braceL:return this.parseObj(!0)}return this.parseIdent()},fh.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(Z.comma),t&&this.type===Z.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===Z.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===Z.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},fh.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},fh.parseBindingListItem=function(e){return e},fh.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Z.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},fh.checkLValSimple=function(e,t,n){t===void 0&&(t=Gm);var r=t!==Gm;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===qm&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(ym(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Xm&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},fh.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=Gm),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},fh.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=Gm),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var ph=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},mh={b_stat:new ph(`{`,!1),b_expr:new ph(`{`,!0),b_tmpl:new ph("${",!1),p_stat:new ph(`(`,!1),p_expr:new ph(`(`,!0),q_tmpl:new ph("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ph(`function`,!1),f_expr:new ph(`function`,!0),f_expr_gen:new ph(`function`,!0,!1,null,!0),f_gen:new ph(`function`,!1,!1,null,!0)},hh=Zm.prototype;hh.initialContext=function(){return[mh.b_stat]},hh.curContext=function(){return this.context[this.context.length-1]},hh.braceIsBlock=function(e){var t=this.curContext();return t===mh.f_expr||t===mh.f_stat?!0:e===Z.colon&&(t===mh.b_stat||t===mh.b_expr)?!t.isExpr:e===Z._return||e===Z.name&&this.exprAllowed?um.test(this.input.slice(this.lastTokEnd,this.start)):e===Z._else||e===Z.semi||e===Z.eof||e===Z.parenR||e===Z.arrow?!0:e===Z.braceL?t===mh.b_stat:e===Z._var||e===Z._const||e===Z.name?!1:!this.exprAllowed},hh.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},hh.updateContext=function(e){var t,n=this.type;n.keyword&&e===Z.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},hh.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},Z.parenR.updateContext=Z.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===mh.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},Z.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?mh.b_stat:mh.b_expr),this.exprAllowed=!0},Z.dollarBraceL.updateContext=function(){this.context.push(mh.b_tmpl),this.exprAllowed=!0},Z.parenL.updateContext=function(e){var t=e===Z._if||e===Z._for||e===Z._with||e===Z._while;this.context.push(t?mh.p_stat:mh.p_expr),this.exprAllowed=!0},Z.incDec.updateContext=function(){},Z._function.updateContext=Z._class.updateContext=function(e){e.beforeExpr&&e!==Z._else&&(e!==Z.semi||this.curContext()===mh.p_stat)&&!(e===Z._return&&um.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==Z.colon&&e!==Z.braceL||this.curContext()!==mh.b_stat)?this.context.push(mh.f_expr):this.context.push(mh.f_stat),this.exprAllowed=!1},Z.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},Z.backQuote.updateContext=function(){this.curContext()===mh.q_tmpl?this.context.pop():this.context.push(mh.q_tmpl),this.exprAllowed=!1},Z.star.updateContext=function(e){if(e===Z._function){var t=this.context.length-1;this.context[t]===mh.f_expr?this.context[t]=mh.f_expr_gen:this.context[t]=mh.f_gen}this.exprAllowed=!0},Z.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==Z.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var gh=Zm.prototype;gh.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},gh.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===Z.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(Z.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},gh.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new nh,r=!0);var s=this.start,c=this.startLoc;(this.type===Z.parenL||this.type===Z.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===Z.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===Z.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},gh.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(Z.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(Z.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},gh.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},gh.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==Z._in)&&a>r){var o=this.type===Z.logicalOR||this.type===Z.logicalAND,s=this.type===Z.coalesce;s&&(a=Z.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===Z.coalesce||s&&(this.type===Z.logicalOR||this.type===Z.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},gh.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},gh.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===Z.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&_h(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&vh(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===Z.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==Z._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(Z.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function _h(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&_h(e.expression)}function vh(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&vh(e.expression)||e.type===`ParenthesizedExpression`&&vh(e.expression)}gh.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},gh.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},gh.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Z.arrow)},gh.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},gh.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(Z.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(Z.bracketL);if(l||c&&this.type!==Z.parenL&&this.type!==Z.backQuote||this.eat(Z.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(Z.bracketR)):u.property=this.type===Z.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(Z.parenL)){var d=new nh,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(Z.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===Z.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},gh.parseExprAtom=function(e,t,n){this.type===Z.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case Z._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===Z.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==Z.dot&&this.type!==Z.bracketL&&this.type!==Z.parenL&&this.unexpected(),this.finishNode(r,`Super`);case Z._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case Z.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(Z._function))return this.overrideContext(mh.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(Z.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===Z.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(Z.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case Z.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case Z.num:case Z.string:return this.parseLiteral(this.value);case Z._null:case Z._true:case Z._false:return r=this.startNode(),r.value=this.type===Z._null?null:this.type===Z._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case Z.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case Z.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(Z.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case Z.braceL:return this.overrideContext(mh.b_expr),this.parseObj(!1,e);case Z._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case Z._class:return this.parseClass(this.startNode(),!1);case Z._new:return this.parseNew();case Z.backQuote:return this.parseTemplate();case Z._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},gh.parseExprAtomDefault=function(){this.unexpected()},gh.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===Z.parenL&&!e)return this.parseDynamicImport(t);if(this.type===Z.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},gh.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(Z.parenR)?e.options=null:(this.expect(Z.comma),this.afterTrailingComma(Z.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(Z.parenR)||(this.expect(Z.comma),this.afterTrailingComma(Z.parenR)||this.unexpected())));else if(!this.eat(Z.parenR)){var t=this.start;this.eat(Z.comma)&&this.eat(Z.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},gh.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},gh.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},gh.parseParenExpression=function(){this.expect(Z.parenL);var e=this.parseExpression();return this.expect(Z.parenR),e},gh.shouldParseArrow=function(e){return!this.canInsertSemicolon()},gh.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new nh,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==Z.parenR;){if(l?l=!1:this.expect(Z.comma),a&&this.afterTrailingComma(Z.parenR,!0)){u=!0;break}if(this.type===Z.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===Z.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(Z.parenR),e&&this.shouldParseArrow(c)&&this.eat(Z.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},gh.parseParenItem=function(e){return e},gh.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var yh=[];gh.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Z.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(Z.parenL)?this.parseExprList(Z.parenR,this.options.ecmaVersion>=8,!1):yh,this.finishNode(e,`NewExpression`)},gh.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===Z.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
316
|
-
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
317
|
-
`),cooked:this.value},this.next(),n.tail=this.type===Z.backQuote,this.finishNode(n,`TemplateElement`)},gh.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===Z.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(Z.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(Z.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},gh.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===Z.name||this.type===Z.num||this.type===Z.string||this.type===Z.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Z.star)&&!um.test(this.input.slice(this.lastTokEnd,this.start))},gh.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(Z.braceR);){if(r)r=!1;else if(this.expect(Z.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Z.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},gh.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(Z.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===Z.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===Z.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(Z.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(Z.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},gh.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},gh.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===Z.colon&&this.unexpected(),this.eat(Z.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===Z.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==Z.comma&&this.type!==Z.braceR&&this.type!==Z.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===Z.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},gh.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Z.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Z.bracketR),e.key;e.computed=!1}return e.key=this.type===Z.num||this.type===Z.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},gh.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},gh.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wm(t,r.generator)|Rm|(n?zm:0)),this.expect(Z.parenL),r.params=this.parseBindingList(Z.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},gh.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Wm(n,!1)|Im),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},gh.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==Z.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Xm),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},gh.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},gh.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,Km,t?null:n)}},gh.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(Z.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===Z.comma?o=null:this.type===Z.ellipsis?(o=this.parseSpread(r),r&&this.type===Z.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},gh.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&Um)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},gh.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},gh.parseIdentNode=function(){var e=this.startNode();return this.type===Z.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=Z.name):this.unexpected(),e},gh.parsePrivateIdent=function(){var e=this.startNode();return this.type===Z.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},gh.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===Z.semi||this.canInsertSemicolon()||this.type!==Z.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(Z.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},gh.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var bh=Zm.prototype;bh.raise=function(e,t){var n=Dm(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},bh.raiseRecoverable=bh.raise,bh.curPosition=function(){if(this.options.locations)return new Tm(this.curLine,this.pos-this.lineStart)};var xh=Zm.prototype,Sh=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};xh.enterScope=function(e){this.scopeStack.push(new Sh(e))},xh.exitScope=function(){this.scopeStack.pop()},xh.treatFunctionsAsVarInScope=function(e){return e.flags&Nm||!this.inModule&&e.flags&Mm},xh.declareName=function(e,t,n){var r=!1;if(t===qm){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Mm&&delete this.undefinedExports[e]}else if(t===Ym)this.currentScope().lexical.push(e);else if(t===Jm){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&Lm&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Mm&&delete this.undefinedExports[e],s.flags&Um)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},xh.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},xh.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},xh.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Um|Vm|Bm))return t}},xh.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Um|Vm|Bm)&&!(t.flags&Im))return t}};var Ch=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Em(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},wh=Zm.prototype;wh.startNode=function(){return new Ch(this,this.start,this.startLoc)},wh.startNodeAt=function(e,t){return new Ch(this,e,t)};function Th(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}wh.finishNode=function(e,t){return Th.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},wh.finishNodeAt=function(e,t,n,r){return Th.call(this,e,t,n,r)},wh.copyNode=function(e){var t=new Ch(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Eh=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,Dh=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,Oh=Dh+` Extended_Pictographic`,kh=Oh,Ah=kh+` EBase EComp EMod EPres ExtPict`,jh=Ah,Mh={9:Dh,10:Oh,11:kh,12:Ah,13:jh,14:jh},Nh={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},Ph=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,Fh=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,Ih=Fh+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,Lh=Ih+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,Rh=Lh+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,zh=Rh+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,Bh={9:Fh,10:Ih,11:Lh,12:Rh,13:zh,14:zh+` `+Eh},Vh={};function Hh(e){var t=Vh[e]={binary:Sm(Mh[e]+` `+Ph),binaryOfStrings:Sm(Nh[e]),nonBinary:{General_Category:Sm(Ph),Script:Sm(Bh[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Uh=0,Wh=[9,10,11,12,13,14];Uh<Wh.length;Uh+=1){var Gh=Wh[Uh];Hh(Gh)}var Kh=Zm.prototype,qh=function(e,t){this.parent=e,this.base=t||this};qh.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},qh.prototype.sibling=function(){return new qh(this.parent,this.base)};var Jh=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=Vh[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Jh.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},Jh.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},Jh.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Jh.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},Jh.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},Jh.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Jh.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Jh.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Jh.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Kh.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function Yh(e){for(var t in e)return!0;return!1}Kh.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Yh(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Kh.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},Kh.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new qh(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Kh.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Kh.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Kh.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Kh.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Kh.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Kh.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Kh.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Kh.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Kh.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},Kh.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Kh.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&Xh(n);)t+=Cm(n),e.advance();return t};function Xh(e){return e===105||e===109||e===115}Kh.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Kh.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Kh.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Zh(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Zh(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Kh.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Zh(n);)e.advance();return e.pos!==t},Kh.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},Kh.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Kh.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Kh.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Cm(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Cm(e.lastIntValue);return!0}return!1},Kh.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Qh(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Qh(e){return nm(e,!0)||e===36||e===95}Kh.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),$h(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function $h(e){return rm(e,!0)||e===36||e===95||e===8204||e===8205}Kh.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Kh.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Kh.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Kh.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Kh.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Kh.regexp_eatZero=function(e){return e.current()===48&&!dg(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Kh.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},Kh.regexp_eatControlLetter=function(e){var t=e.current();return eg(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function eg(e){return e>=65&&e<=90||e>=97&&e<=122}Kh.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&tg(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function tg(e){return e>=0&&e<=1114111}Kh.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},Kh.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var ng=0,rg=1,ig=2;Kh.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ag(t))return e.lastIntValue=-1,e.advance(),rg;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===ig&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return ng};function ag(e){return e===100||e===68||e===115||e===83||e===119||e===87}Kh.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),rg}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return ng},Kh.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){ym(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Kh.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return rg;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return ig;e.raise(`Invalid property name`)},Kh.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;og(t=e.current());)e.lastStringValue+=Cm(t),e.advance();return e.lastStringValue!==``};function og(e){return eg(e)||e===95}Kh.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;sg(t=e.current());)e.lastStringValue+=Cm(t),e.advance();return e.lastStringValue!==``};function sg(e){return og(e)||dg(e)}Kh.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Kh.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===ig&&e.raise(`Negated character class may contain strings`),!0}return!1},Kh.regexp_classContents=function(e){return e.current()===93?rg:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),rg)},Kh.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Kh.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||mg(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},Kh.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Kh.regexp_classSetExpression=function(e){var t=rg,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===ig&&(t=ig);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==ig&&(t=rg):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===ig&&(t=ig)}},Kh.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},Kh.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?rg:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Kh.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===ig&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Kh.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},Kh.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===ig&&(t=ig);return t},Kh.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?rg:ig},Kh.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&cg(n)||lg(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function cg(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function lg(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Kh.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return ug(t)?(e.lastIntValue=t,e.advance(),!0):!1};function ug(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Kh.regexp_eatClassControlLetter=function(e){var t=e.current();return dg(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Kh.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Kh.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;dg(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function dg(e){return e>=48&&e<=57}Kh.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;fg(n=e.current());)e.lastIntValue=16*e.lastIntValue+pg(n),e.advance();return e.pos!==t};function fg(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function pg(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Kh.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},Kh.regexp_eatOctalDigit=function(e){var t=e.current();return mg(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function mg(e){return e>=48&&e<=55}Kh.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!fg(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+pg(i),e.advance()}return!0};var hg=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Em(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},gg=Zm.prototype;gg.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new hg(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},gg.getToken=function(){return this.next(),new hg(this)},typeof Symbol<`u`&&(gg[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===Z.eof,value:t}}}}),gg.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(Z.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},gg.readToken=function(e){return nm(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},gg.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},gg.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},gg.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=pm(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},gg.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!fm(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},gg.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&mm.test(String.fromCharCode(e)))++this.pos;else break loop}}},gg.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},gg.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(Z.ellipsis)):(++this.pos,this.finishToken(Z.dot))},gg.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(Z.assign,2):this.finishOp(Z.slash,1)},gg.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?Z.star:Z.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=Z.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(Z.assign,n+1):this.finishOp(r,n)},gg.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Z.assign,3):this.finishOp(e===124?Z.logicalOR:Z.logicalAND,2):t===61?this.finishOp(Z.assign,2):this.finishOp(e===124?Z.bitwiseOR:Z.bitwiseAND,1)},gg.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(Z.assign,2):this.finishOp(Z.bitwiseXOR,1)},gg.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||um.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(Z.incDec,2):t===61?this.finishOp(Z.assign,2):this.finishOp(Z.plusMin,1)},gg.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(Z.assign,n+1):this.finishOp(Z.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(Z.relational,n))},gg.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(Z.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Z.arrow)):this.finishOp(e===61?Z.eq:Z.prefix,1)},gg.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(Z.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Z.assign,3):this.finishOp(Z.coalesce,2)}return this.finishOp(Z.question,1)},gg.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),nm(t,!0)||t===92))return this.finishToken(Z.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Cm(t)+`'`)},gg.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Z.parenL);case 41:return++this.pos,this.finishToken(Z.parenR);case 59:return++this.pos,this.finishToken(Z.semi);case 44:return++this.pos,this.finishToken(Z.comma);case 91:return++this.pos,this.finishToken(Z.bracketL);case 93:return++this.pos,this.finishToken(Z.bracketR);case 123:return++this.pos,this.finishToken(Z.braceL);case 125:return++this.pos,this.finishToken(Z.braceR);case 58:return++this.pos,this.finishToken(Z.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Z.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Z.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Cm(e)+`'`)},gg.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},gg.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(um.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new Jh(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(Z.regexp,{pattern:i,flags:o,value:c})},gg.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function _g(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function vg(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}gg.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=vg(this.input.slice(t,this.pos)),++this.pos):nm(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(Z.num,n)},gg.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=vg(this.input.slice(t,this.pos));return++this.pos,nm(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(Z.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),nm(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=_g(this.input.slice(t,this.pos),n);return this.finishToken(Z.num,a)},gg.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},gg.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(fm(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(Z.string,t)};var yg={};gg.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===yg)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},gg.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw yg;this.raise(e,t)},gg.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===Z.template||this.type===Z.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(Z.dollarBraceL)):(++this.pos,this.finishToken(Z.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(Z.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(fm(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
318
|
-
`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},gg.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(Z.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
319
|
-
`&&++this.pos;case`
|
|
320
|
-
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},gg.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
321
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Cm(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return fm(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},gg.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},gg.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(rm(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?nm:rm)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Cm(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},gg.readWord=function(){var e=this.readWord1(),t=Z.name;return this.keywords.test(e)&&(t=cm[e]),this.finishToken(t,e)},Zm.acorn={Parser:Zm,version:`8.19.0`,defaultOptions:Om,Position:Tm,SourceLocation:Em,getLineInfo:Dm,Node:Ch,TokenType:im,tokTypes:Z,keywordTypes:cm,TokContext:ph,tokContexts:mh,isIdentifierChar:rm,isIdentifierStart:nm,Token:hg,isNewLine:fm,lineBreak:um,lineBreakG:dm,nonASCIIwhitespace:mm};var bg=t(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}})),xg=t(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(n,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],r=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,D=Object.prototype,O=D.hasOwnProperty,k=D.toString,A=Object.hasOwn||(function(e,t){return O.call(e,t)}),j=Array.isArray||(function(e){return k.call(e)===`[object Array]`}),M=Object.create(null);function N(e){return M[e]||(M[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function P(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ee=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,F=function(e,t){this.line=e,this.column=t};F.prototype.offset=function(e){return new F(this.line,this.column+e)};var I=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function te(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new F(n,t-r);++n,r=i}}var ne={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},L=!1;function re(e){var t={};for(var n in ne)t[n]=e&&A(e,n)?e[n]:ne[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!L&&typeof console==`object`&&console.warn&&(L=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
322
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),j(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(j(t.onComment)&&(t.onComment=ie(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function ie(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new I(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ae=1,oe=2,se=4,ce=8,le=16,ue=32,de=64,fe=128,pe=256,me=512,he=1024,ge=ae|oe|pe;function _e(e,t){return oe|(e?se:0)|(t?ce:0)}var ve=0,ye=1,be=2,xe=3,Se=4,Ce=5,we=function(e,t,n){this.options=e=re(e),this.sourceFile=e.sourceFile,this.keywords=N(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=N(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=N(i),this.reservedWordsStrictBind=N(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
|
|
323
|
-
`,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(x).length)):this.lineStart=0,this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?oe:ae),this.regexpState=null,this.privateNameStack=[]},Te={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};we.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},Te.inFunction.get=function(){return(this.currentVarScope().flags&oe)>0},Te.inGenerator.get=function(){return(this.currentVarScope().flags&ce)>0},Te.inAsync.get=function(){return(this.currentVarScope().flags&se)>0},Te.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(pe|me))return!1;if(t&oe)return(t&se)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Te.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ae)},Te.allowSuper.get=function(){return(this.currentThisScope().flags&de)>0||this.options.allowSuperOutsideMethod},Te.allowDirectSuper.get=function(){return(this.currentThisScope().flags&fe)>0},Te.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Te.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(pe|me)||t&oe&&!(t&le))return!0}return!1},Te.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&he||!this.inModule&&e&ae)},Te.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&pe)>0},we.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},we.parse=function(e,t){return new this(t,e).parse()},we.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},we.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(we.prototype,Te);var Ee=we.prototype,De=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Ee.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){E.lastIndex=e,e+=E.exec(this.input)[0].length;var t=De.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){E.lastIndex=e+t[0].length;var n=E.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&Oe(this,r))}e+=t[0].length,E.lastIndex=e,e+=E.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function Oe(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!p(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}Ee.eat=function(e){return this.type===e&&(this.next(),!0)},Ee.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},Ee.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Ee.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},Ee.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Ee.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},Ee.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ee.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},Ee.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Ee.expect=function(e){this.eat(e)||this.unexpected()},Ee.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var ke=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ee.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Ee.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Ee.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Ee.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Ae=we.prototype;Ae.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var je={kind:`loop`},Me={kind:`switch`};Ae.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;E.lastIndex=this.pos;var t=E.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(f(r)){var i=n;do n+=r<=65535?1:2;while(p(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!c.test(a))return!0}return!1},Ae.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;E.lastIndex=this.pos;var e=E.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.fullCharCodeAt(t+8))||n===92))},Ae.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;E.lastIndex=this.pos;var n=E.exec(this.input),r=this.pos+n[0].length;if(x.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||p(a=this.fullCharCodeAt(i))||a===92)return!1;E.lastIndex=i;var o=E.exec(this.input);if(r=i+o[0].length,o&&x.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!f(s)&&s!==92)return!1;var l=r;do r+=s<=65535?1:2;while(p(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(l,r);if(c.test(u))return!1;if(t&&!e&&u===`of`){E.lastIndex=r;var d=E.exec(this.input);if(r+=d[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},Ae.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},Ae.isUsing=function(e){return this.isUsingKeyword(!1,e)},Ae.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){E.lastIndex=this.pos;var o=E.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===b.name&&d.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},Ae.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Ae.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Ae.parseDoStatement=function(e){return this.next(),this.labels.push(je),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Ae.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(je),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new ke,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},Ae.parseForAfterInit=function(e,t,n){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===b._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},Ae.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Pe|(n?0:Fe),!1,t)},Ae.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Ae.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Ae.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(Me),this.enterScope(he);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Ae.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Ne=[];Ae.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?ue:0),this.checkLValPattern(e,t?Se:be),this.expect(b.parenR),e},Ae.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Ae.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Ae.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(je),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Ae.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Ae.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Ae.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Ae.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Ae.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Ae.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Ae.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Ae.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(b.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==b._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==b._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(b.comma))break}return e},Ae.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?ye:be,!1)};var Pe=1,Fe=2,Ie=4;Ae.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&Fe&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Pe&&(e.id=t&Ie&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&Fe)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ye:be:xe));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_e(e.async,e.generator)),t&Pe||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Pe?`FunctionDeclaration`:`FunctionExpression`)},Ae.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Ae.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Le(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Ae.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&Re(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},Ae.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},Ae.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Ae.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Re(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},Ae.parseClassField=function(e){return Re(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Re(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)?(this.enterScope(me|de),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},Ae.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(pe|de);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},Ae.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,be,!1)):(t===!0&&this.unexpected(),e.id=null)},Ae.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},Ae.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Ae.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];A(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Le(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Re(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}Ae.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},Ae.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Ae.parseExportDeclaration=function(e){return this.parseStatement(null)},Ae.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Pe|Ie,!1,e)}if(this.type===b._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},Ae.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),A(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Ae.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},Ae.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Ae.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Ae.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},Ae.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},Ae.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Ne,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Ae.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,be),this.finishNode(e,`ImportSpecifier`)},Ae.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,be),this.finishNode(e,`ImportDefaultSpecifier`)},Ae.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,be),this.finishNode(e,`ImportNamespaceSpecifier`)},Ae.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},Ae.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},n=!0;!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;A(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},Ae.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},Ae.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return ee.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},Ae.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Ae.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var ze=we.prototype;ze.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},ze.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},ze.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},ze.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},ze.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},ze.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(b.comma),t&&this.type===b.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},ze.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ze.parseBindingListItem=function(e){return e},ze.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},ze.checkLValSimple=function(e,t,n){t===void 0&&(t=ve);var r=t!==ve;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===be&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(A(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Ce&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},ze.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=ve),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},ze.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=ve),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Be=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},Ve={b_stat:new Be(`{`,!1),b_expr:new Be(`{`,!0),b_tmpl:new Be("${",!1),p_stat:new Be(`(`,!1),p_expr:new Be(`(`,!0),q_tmpl:new Be("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Be(`function`,!1),f_expr:new Be(`function`,!0),f_expr_gen:new Be(`function`,!0,!1,null,!0),f_gen:new Be(`function`,!1,!1,null,!0)},He=we.prototype;He.initialContext=function(){return[Ve.b_stat]},He.curContext=function(){return this.context[this.context.length-1]},He.braceIsBlock=function(e){var t=this.curContext();return t===Ve.f_expr||t===Ve.f_stat?!0:e===b.colon&&(t===Ve.b_stat||t===Ve.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===Ve.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},He.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},He.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},He.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===Ve.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Ve.b_stat:Ve.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(Ve.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?Ve.p_stat:Ve.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&(e!==b.semi||this.curContext()===Ve.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==b.colon&&e!==b.braceL||this.curContext()!==Ve.b_stat)?this.context.push(Ve.f_expr):this.context.push(Ve.f_stat),this.exprAllowed=!1},b.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===Ve.q_tmpl?this.context.pop():this.context.push(Ve.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===Ve.f_expr?this.context[t]=Ve.f_expr_gen:this.context[t]=Ve.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Ue=we.prototype;Ue.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},Ue.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===b.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(b.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},Ue.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ke,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Ue.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Ue.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Ue.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Ue.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Ue.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&We(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Ge(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(b.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function We(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&We(e.expression)}function Ge(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Ge(e.expression)||e.type===`ParenthesizedExpression`&&Ge(e.expression)}Ue.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},Ue.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},Ue.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},Ue.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Ue.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):u.property=this.type===b.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new ke,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Ue.parseExprAtom=function(e,t,n){this.type===b.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(r,`Super`);case b._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case b.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(Ve.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===b.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case b.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return r=this.startNode(),r.value=this.type===b._null?null:this.type===b._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case b.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case b.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case b.braceL:return this.overrideContext(Ve.b_expr),this.parseObj(!1,e);case b._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Ue.parseExprAtomDefault=function(){this.unexpected()},Ue.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},Ue.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Ue.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Ue.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Ue.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},Ue.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Ue.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new ke,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},Ue.parseParenItem=function(e){return e},Ue.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Ke=[];Ue.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(b.parenL)?this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):Ke,this.finishNode(e,`NewExpression`)},Ue.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
324
|
-
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
325
|
-
`),cooked:this.value},this.next(),n.tail=this.type===b.backQuote,this.finishNode(n,`TemplateElement`)},Ue.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===b.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(b.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(b.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Ue.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},Ue.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Ue.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Ue.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Ue.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===b.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==b.comma&&this.type!==b.braceR&&this.type!==b.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Ue.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Ue.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Ue.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_e(t,r.generator)|de|(n?fe:0)),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Ue.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(_e(n,!1)|le),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Ue.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==b.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Ce),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Ue.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Ue.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,ye,t?null:n)}},Ue.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(r),r&&this.type===b.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Ue.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&ge)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Ue.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Ue.parseIdentNode=function(){var e=this.startNode();return this.type===b.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=b.name):this.unexpected(),e},Ue.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Ue.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Ue.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var qe=we.prototype;qe.raise=function(e,t){var n=te(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},qe.raiseRecoverable=qe.raise,qe.curPosition=function(){if(this.options.locations)return new F(this.curLine,this.pos-this.lineStart)};var Je=we.prototype,Ye=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Je.enterScope=function(e){this.scopeStack.push(new Ye(e))},Je.exitScope=function(){this.scopeStack.pop()},Je.treatFunctionsAsVarInScope=function(e){return e.flags&oe||!this.inModule&&e.flags&ae},Je.declareName=function(e,t,n){var r=!1;if(t===be){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&ae&&delete this.undefinedExports[e]}else if(t===Se)this.currentScope().lexical.push(e);else if(t===xe){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&ue&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&ae&&delete this.undefinedExports[e],s.flags&ge)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Je.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Je.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Je.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ge|me|pe))return t}},Je.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ge|me|pe)&&!(t.flags&le))return t}};var Xe=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new I(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ze=we.prototype;Ze.startNode=function(){return new Xe(this,this.start,this.startLoc)},Ze.startNodeAt=function(e,t){return new Xe(this,e,t)};function Qe(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Ze.finishNode=function(e,t){return Qe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ze.finishNodeAt=function(e,t,n,r){return Qe.call(this,e,t,n,r)},Ze.copyNode=function(e){var t=new Xe(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var $e=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,et=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,tt=et+` Extended_Pictographic`,nt=tt,rt=nt+` EBase EComp EMod EPres ExtPict`,it=rt,at={9:et,10:tt,11:nt,12:rt,13:it,14:it},ot={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},st=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,ct=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,lt=ct+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,ut=lt+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,dt=ut+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,ft=dt+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,pt={9:ct,10:lt,11:ut,12:dt,13:ft,14:ft+` `+$e},mt={};function ht(e){var t=mt[e]={binary:N(at[e]+` `+st),binaryOfStrings:N(ot[e]),nonBinary:{General_Category:N(st),Script:N(pt[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var gt=0,_t=[9,10,11,12,13,14];gt<_t.length;gt+=1){var vt=_t[gt];ht(vt)}var yt=we.prototype,bt=function(e,t){this.parent=e,this.base=t||this};bt.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},bt.prototype.sibling=function(){return new bt(this.parent,this.base)};var xt=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=mt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};xt.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},xt.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},xt.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},xt.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},xt.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},xt.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},xt.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},xt.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},xt.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},yt.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function St(e){for(var t in e)return!0;return!1}yt.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&St(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},yt.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},yt.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new bt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},yt.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},yt.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},yt.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},yt.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},yt.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},yt.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},yt.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},yt.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},yt.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},yt.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},yt.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&Ct(n);)t+=P(n),e.advance();return t};function Ct(e){return e===105||e===109||e===115}yt.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},yt.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},yt.regexp_eatSyntaxCharacter=function(e){var t=e.current();return wt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function wt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}yt.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!wt(n);)e.advance();return e.pos!==t},yt.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},yt.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},yt.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},yt.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=P(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=P(e.lastIntValue);return!0}return!1},yt.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Tt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Tt(e){return f(e,!0)||e===36||e===95}yt.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Et(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Et(e){return p(e,!0)||e===36||e===95||e===8204||e===8205}yt.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},yt.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},yt.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},yt.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},yt.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},yt.regexp_eatZero=function(e){return e.current()===48&&!Rt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},yt.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},yt.regexp_eatControlLetter=function(e){var t=e.current();return Dt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Dt(e){return e>=65&&e<=90||e>=97&&e<=122}yt.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ot(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function Ot(e){return e>=0&&e<=1114111}yt.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},yt.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var kt=0,At=1,jt=2;yt.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Mt(t))return e.lastIntValue=-1,e.advance(),At;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===jt&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return kt};function Mt(e){return e===100||e===68||e===115||e===83||e===119||e===87}yt.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),At}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return kt},yt.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){A(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},yt.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return At;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return jt;e.raise(`Invalid property name`)},yt.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Nt(t=e.current());)e.lastStringValue+=P(t),e.advance();return e.lastStringValue!==``};function Nt(e){return Dt(e)||e===95}yt.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Pt(t=e.current());)e.lastStringValue+=P(t),e.advance();return e.lastStringValue!==``};function Pt(e){return Nt(e)||Rt(e)}yt.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},yt.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===jt&&e.raise(`Negated character class may contain strings`),!0}return!1},yt.regexp_classContents=function(e){return e.current()===93?At:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),At)},yt.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},yt.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Vt(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},yt.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},yt.regexp_classSetExpression=function(e){var t=At,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===jt&&(t=jt);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==jt&&(t=At):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===jt&&(t=jt)}},yt.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},yt.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?At:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},yt.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===jt&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},yt.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},yt.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===jt&&(t=jt);return t},yt.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?At:jt},yt.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Ft(n)||It(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Ft(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function It(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}yt.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Lt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Lt(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}yt.regexp_eatClassControlLetter=function(e){var t=e.current();return Rt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},yt.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},yt.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Rt(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Rt(e){return e>=48&&e<=57}yt.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;zt(n=e.current());)e.lastIntValue=16*e.lastIntValue+Bt(n),e.advance();return e.pos!==t};function zt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Bt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}yt.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},yt.regexp_eatOctalDigit=function(e){var t=e.current();return Vt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Vt(e){return e>=48&&e<=55}yt.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!zt(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Bt(i),e.advance()}return!0};var Ht=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new I(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Ut=we.prototype;Ut.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Ht(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ut.getToken=function(){return this.next(),new Ht(this)},typeof Symbol<`u`&&(Ut[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),Ut.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(b.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Ut.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Ut.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},Ut.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Ut.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=w(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Ut.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!C(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Ut.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&T.test(String.fromCharCode(e)))++this.pos;else break loop}}},Ut.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Ut.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},Ut.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},Ut.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?b.star:b.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=b.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(b.assign,n+1):this.finishOp(r,n)},Ut.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(e===124?b.logicalOR:b.logicalAND,2):t===61?this.finishOp(b.assign,2):this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)},Ut.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},Ut.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||x.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):t===61?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},Ut.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(b.relational,n))},Ut.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(e===61?b.eq:b.prefix,1)},Ut.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(b.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},Ut.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),f(t,!0)||t===92))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+P(t)+`'`)},Ut.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+P(e)+`'`)},Ut.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Ut.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(x.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new xt(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(b.regexp,{pattern:i,flags:o,value:c})},Ut.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Wt(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Gt(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Ut.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Gt(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,n)},Ut.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Gt(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Wt(this.input.slice(t,this.pos),n);return this.finishToken(b.num,a)},Ut.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Ut.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(C(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)};var Kt={};Ut.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Kt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Ut.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Kt;this.raise(e,t)},Ut.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===b.template||this.type===b.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(C(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
326
|
-
`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Ut.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
327
|
-
`&&++this.pos;case`
|
|
328
|
-
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},Ut.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
329
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return P(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Ut.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Ut.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=P(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Ut.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var qt=`8.19.0`;we.acorn={Parser:we,version:qt,defaultOptions:ne,Position:F,SourceLocation:I,getLineInfo:te,Node:Xe,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:Be,tokContexts:Ve,isIdentifierChar:p,isIdentifierStart:f,Token:Ht,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function Jt(e,t){return we.parse(e,t)}function Yt(e,t,n){return we.parseExpressionAt(e,t,n)}function Xt(e,t){return we.tokenizer(e,t)}e.Node=Xe,e.Parser=we,e.Position=F,e.SourceLocation=I,e.TokContext=Be,e.Token=Ht,e.TokenType=m,e.defaultOptions=ne,e.getLineInfo=te,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=Jt,e.parseExpressionAt=Yt,e.tokContexts=Ve,e.tokTypes=b,e.tokenizer=Xt,e.version=qt}))})),Sg=t(((e,t)=>{var n=bg(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return o(xg()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||xg(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`>`:`}`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
|
|
330
|
-
`:`\r
|
|
331
|
-
`):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function Cg(e){return e}var wg={}.hasOwnProperty,Tg=Symbol(`continue`),Eg=Symbol(`exit`),Dg=Symbol(`skip`);function Og(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return Ag(e)&&(s.displayName=`node (`+Cg(e.type)+`)`),s;function s(){let s=n?kg(n(e,t,a,o)):[];if(s[0]===Eg)return s;if(s[0]!==Dg){let t;for(t in e)if(wg.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(Ag(r)){let e=i(r,t,a,n)();if(e[0]===Eg)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(Ag(r)){let e=i(r,t,void 0,n)();if(e[0]===Eg)return e}}}return r?kg(r(e,t,a,o)):s}}}function kg(e){return Array.isArray(e)?e:typeof e==`number`?[Tg,e]:[e]}function Ag(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function jg(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=Ng(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&Mg(m);if(g&&!t.allowEmpty)throw new mt(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(Mg(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,Og(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=Pg(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function Mg(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function Ng(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=Fg(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function Pg(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function Fg(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
332
|
-
`;break;case-3:a=`\r
|
|
333
|
-
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function Ig(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=Lg(n.start,r[0]||t.start),a=Lg(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function Lg(e,t){if(e&&typeof e==`object`){let n=`line`in e?Rg(e.line):void 0,r=`column`in e?Rg(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:Rg(t)}}}function Rg(e){return typeof e==`number`&&e>-1?e:void 0}var zg=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,Bg=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,Vg=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,Hg=`#unexpected-type-in-code-expected-an-object-spread-spread`,Ug=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,Wg=`#could-not-parse-expression-with-acorn`;function Gg(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new mt("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=zg+Bg,e}if(ir(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?Kg.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||ir(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new mt("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=zg+Vg,e}return rr(t)?dr(e,_,`linePrefix`,3)(t):_(t)}}function Kg(e,t,n,r,i,a,o){let s=jg(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=Ig(e),n=new mt("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=zg+Hg,n}if(e.expression.properties[1]){let t=Ig(e.expression.properties[1]),n=new mt(`Unexpected extra content in spread: only a single spread is supported`,{place:t.start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw n.url=zg+Ug,n}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=Ig(e.expression.properties[0]),n=new mt("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=zg+Hg,n}}if(s.error){let e=new mt(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=zg+Wg,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function qg(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return Gg.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return rr(t)?dr(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||ir(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return Gg.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var Jg=`https://github.com/micromark/micromark-extension-mdx-jsx`;function Yg(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return ee;function ee(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),F}function F(e){return tr(e)?n(e):(N=I,Se(e))}function I(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=te,Se;if(t===62)return xe(t);if(t!==null&&t>=0&&_t(t))return e.enter(d),e.enter(f),e.consume(t),ne;Te(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function te(t){if(t===62)return xe(t);if(t!==null&&t>=0&&_t(t))return e.enter(d),e.enter(f),e.consume(t),ne;Te(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ne(t){if(t!==null&&t>=0&&ft(t,{jsx:!0}))return e.consume(t),ne;if(t===46||t===47||t===58||t===62||t===123||tr(t)||ar(t))return e.exit(f),N=L,Se(t);Te(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function L(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=re,Se;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=oe,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&_t(t))return e.exit(d),le(t);Te(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function re(t){if(t!==null&&t>=0&&_t(t))return e.enter(m),e.consume(t),ie;Te(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ie(t){if(t!==null&&t>=0&&ft(t,{jsx:!0}))return e.consume(t),ie;if(t===46||t===47||t===62||t===123||tr(t)||ar(t))return e.exit(m),N=ae,Se(t);Te(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ae(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=re,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&_t(t))return e.exit(d),le(t);Te(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe(t){if(t!==null&&t>=0&&_t(t))return e.enter(g),e.consume(t),se;Te(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function se(t){if(t!==null&&t>=0&&ft(t,{jsx:!0}))return e.consume(t),se;if(t===47||t===62||t===123||tr(t)||ar(t))return e.exit(g),N=ce,Se(t);Te(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ce(t){if(t===47||t===62||t===123||t!==null&&t>=0&&_t(t))return e.exit(d),le(t);Te(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=be,Se;if(t===62)return xe(t);if(t===123)return Gg.call(M,e,ue,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&_t(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),de;Te(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(e){return N=le,Se(e)}function de(t){if(t!==null&&t>=0&&ft(t,{jsx:!0}))return e.consume(t),de;if(t===47||t===58||t===61||t===62||t===123||tr(t)||ar(t))return e.exit(S),N=fe,Se(t);Te(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function fe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=pe,Se;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=ge,Se;if(t===47||t===62||t===123||tr(t)||ar(t)||t!==null&&t>=0&&_t(t))return e.exit(x),e.exit(b),N=le,Se(t);Te(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&_t(t))return e.enter(w),e.consume(t),me;Te(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function me(t){if(t!==null&&t>=0&&ft(t,{jsx:!0}))return e.consume(t),me;if(t===47||t===61||t===62||t===123||tr(t)||ar(t))return e.exit(w),e.exit(x),N=he,Se(t);Te(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function he(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=ge,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&_t(t))return e.exit(b),le(t);Te(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ge(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,ve;if(t===123)return Gg.call(M,e,_e,k,A,j,r,i,a,!1,!1,o)(t);Te(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function _e(t){return e.exit(b),N=le,Se(t)}function ve(t){return t===null&&Te(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=le,Se):ir(t)?(N=ve,Se(t)):(e.enter(O),ye(t))}function ye(t){return t===null||t===P||ir(t)?(e.exit(O),ve(t)):(e.consume(t),ye)}function be(e){if(e===62)return xe(e);Te(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function xe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Se(t){return ir(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),we):rr(t)||ar(t)?(e.enter(`esWhitespace`),Ce(t)):N(t)}function Ce(t){return ir(t)?(e.exit(`esWhitespace`),Se(t)):rr(t)||ar(t)?(e.consume(t),Ce):(e.exit(`esWhitespace`),N(t))}function we(e){if(!o&&M.parser.lazy[M.now().line]){let e=new mt("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=Jg+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Se(e)}function Te(e,t,n){let r=new mt(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Xg(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=Jg+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Xg(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function Zg(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return Yg.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function Qg(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return Yg.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return rr(e)?dr(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||ir(e)?r(e):i(e)}}}function $g(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:Qg(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:Zg(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}var e_=e(Sg(),1);function t_(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var n_={tokenize:o_,partial:!0},r_=`https://github.com/micromark/micromark-extension-mdxjs-esm`,i_=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function a_(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return Zn(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||ir(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):ir(e)?t.check(n_,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=jg(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
|
|
334
|
-
`:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new mt(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=r_+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!i_.has(e.type)){let t=new mt("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:Ig(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=r_+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function o_(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(er,t,n)}}function s_(e){let t=Object.assign({acorn:Zm.extend((0,e_.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return gr([a_(t),qg(t),$g(t),t_()])}var c_=`Block`,l_=`Callout`,u_=`Table`,d_=`Component`,f_=[`of`,`width`,`height`,`at`,`alt`,`title`,`align`,`id`],p_=`PageBreak`,m_=`Card`,h_=`Stats`,g_=`Stat`,__=[`label`,`value`,`delta`,`note`,`down-is-good`,`trend`],v_=`Columns`,y_=`Column`,b_=`Chart`,x_=[`type`,`title`,`data`,`categories`,`series`,`legend`,`labels`,`format`,`min`,`max`,`colors`,`smooth`,`width`,`height`,`alt`,`id`],S_=`Bibliography`,C_=`TableOfContents`,w_=e=>e.split(`,`).map(e=>e.trim()).filter(e=>e!==``),T_=new Set([`center`,`right`,`justify`]),E_=(e,t)=>{let n=t.position?.start.offset,r=t.position?.end.offset;return n===void 0||r===void 0?``:e.source.slice(n,r)};function D_(e,t,n){let r=t.position?.start;e.problems.push({message:n,...r?{line:r.line,column:r.column}:{}})}var O_=(e,t)=>e.bold===t.bold&&e.italic===t.italic&&e.underline===t.underline&&e.strike===t.strike&&e.code===t.code&&e.color===t.color&&e.background===t.background&&e.tag===t.tag;function k_(e,t,n,r){if(t===``)return;let i=e.at(-1);i&&i.note===void 0&&i.cite===void 0&&i.href===r&&O_(i.styles,n)?i.text+=t:e.push({text:t,styles:{...n},...r===void 0?{}:{href:r}})}function A_(e,t,n){let r=new Map;for(let i of t.attributes)i.type!==`mdxJsxAttribute`||!n.includes(i.name)?D_(e,t,`<${t.name??``}> takes ${n.join(`, `)}: ${i.type===`mdxJsxAttribute`?i.name:`{…}`} is not one of them`):i.value===null||i.value===void 0?r.set(i.name,``):typeof i.value==`string`?r.set(i.name,i.value):D_(e,t,`${i.name} of <${t.name??``}> is a plain string`);return r}function j_(e,t,n){switch(t.name){case`u`:return{...n,underline:!0};case`strong`:case`b`:return{...n,bold:!0};case`em`:case`i`:return{...n,italic:!0};case`del`:case`s`:return{...n,strike:!0};case`code`:return{...n,code:!0};case`Tag`:{let r=A_(e,t,[`color`]).get(`color`);return{...n,tag:r===void 0||r===``?`gray`:r}}case`span`:{let r=A_(e,t,[`color`,`bg`]),i=r.get(`color`),a=r.get(`bg`);return{...n,...i?{color:i}:{},...a?{background:a}:{}}}default:return}}function M_(e,t,n,r,i){for(let a of t)switch(a.type){case`text`:for(let[,t]of a.value.matchAll(/\[\^([^\]\s]+)\]/gu))D_(e,a,`the footnote [^${t??``}] has no note: write [^${t??``}]: … on a line of its own`);for(let e of a.value.replace(/\r?\n/g,` `).split(/(\[-?@[^\]]+\])/u)){if(e===``)continue;let t=/^\[(-?@[^\]]+)\]$/u.exec(e)?.[1];t!==void 0&&yi(t).keys.length>0?i.push({text:e,styles:{...n},cite:t}):k_(i,e,n,r)}break;case`strong`:M_(e,a.children,{...n,bold:!0},r,i);break;case`emphasis`:M_(e,a.children,{...n,italic:!0},r,i);break;case`delete`:M_(e,a.children,{...n,strike:!0},r,i);break;case`inlineCode`:k_(i,a.value,{...n,code:!0},r);break;case`break`:k_(i,`
|
|
335
|
-
`,n,r);break;case`link`:a.children.length===0?i.push({text:``,styles:{...n},href:a.url}):M_(e,a.children,n,a.url,i);break;case`footnoteReference`:{let e=a.label??a.identifier;i.push({text:e,styles:{...n},...r===void 0?{}:{href:r},note:e});break}case`mdxJsxTextElement`:{if(a.name===`br`){k_(i,`
|
|
336
|
-
`,n,r);break}let t=j_(e,a,n);if(t){M_(e,a.children,t,r,i);break}D_(e,a,`<${a.name??``}> inside a line is not drawn: a tag the doc's code draws goes on lines of its own`),k_(i,E_(e,a),n,r);break}case`mdxTextExpression`:D_(e,a,`{…} in a line is not drawn: write \\{ for a brace`),k_(i,E_(e,a),n,r);break;default:D_(e,a,`${a.type} is not drawn in a doc`),k_(i,E_(e,a),n,r)}}function N_(e,t){let n=[];return M_(e,t,{},void 0,n),n}var P_=e=>e?.type===`mdxJsxFlowElement`&&e.name===`br`&&e.children.length===0;function F_(e,t){let[n,...r]=t;if(n?.type===`paragraph`){let t=N_(e,n.children);return{content:t.length===1&&t[0]?.text===`
|
|
337
|
-
`&&Object.keys(t[0].styles).length===0?[]:t,under:Z_(e,r)}}return P_(n)?{content:[],under:Z_(e,r)}:{content:[],under:Z_(e,t)}}var I_=(e,t)=>t.length>0?{...e,children:t}:e;function L_(e,t,n,r){let{content:i,under:a}=F_(e,t.children);return typeof t.checked==`boolean`?I_({type:`check`,checked:t.checked,content:i},a):I_(n?{type:`numbered`,...r===void 0||r===1?{}:{start:r},content:i}:{type:`bullet`,content:i},a)}function R_(e,t){return t.children.map(t=>N_(e,t.children))}function z_(e,t){return t?{[e]:t}:{}}function B_(e,t){let n=A_(e,t,[`align`,`color`,`bg`,`toggle`]),r=Z_(e,t.children),[i,...a]=r;if(i===void 0)return D_(e,t,`<${c_}> holds a block: this one is empty`),[];if(i.type===`embed`||i.type===`source`)return D_(e,t,`<${c_}> holds a block of the doc's own, not a tag or an import`),r;let o=n.get(`align`);o!==void 0&&!T_.has(o)&&D_(e,t,`align is center, right or justify, not "${o}"`);let s={...o!==void 0&&T_.has(o)?{align:o}:{},...z_(`color`,n.get(`color`)),...z_(`background`,n.get(`bg`))},c=i;if(n.has(`toggle`)&&(c.type===`heading`?c={...c,toggle:!0}:c.type===`paragraph`?c={type:`toggle`,content:c.content}:D_(e,t,`toggle is for a heading or a line of text`)),Object.keys(s).length>0&&(`content`in c?c={...c,look:s}:D_(e,t,`a ${c.type} has no look to set`)),a.length>0){if(`content`in c)c={...c,children:[...c.children??[],...a]};else return D_(e,t,`a ${c.type} holds no blocks under it`),[c,...a]}return[c]}function V_(e,t){let n=A_(e,t,[`icon`,`color`,`bg`]),{content:r,under:i}=F_(e,t.children),a={...z_(`color`,n.get(`color`)),...z_(`background`,n.get(`bg`))};return[I_({type:`callout`,...z_(`icon`,n.get(`icon`)),...Object.keys(a).length>0?{look:a}:{},content:r},i)]}function H_(e,t){let n=A_(e,t,[`title`,`subtitle`]),r=Z_(e,t.children);return[I_({type:`card`,...z_(`title`,n.get(`title`)),...z_(`subtitle`,n.get(`subtitle`))},r)]}function U_(e,t){A_(e,t,[]);let n=[];for(let r of t.children){if(r.type!==`mdxJsxFlowElement`||r.name!==`Stat`||r.children.length>0)return D_(e,r,`<${h_}> holds <${g_} label="…" value="…" />s, one to a line`),[];let t=A_(e,r,__),i=t.get(`label`),a=t.get(`value`);if(a===void 0||i===void 0)return D_(e,r,`a <${g_}> has a label and a value`),[];let o=t.get(`trend`),s=o?.split(`,`).map(e=>Number(e.trim()));if(s!==void 0&&!s.every(e=>Number.isFinite(e)))return D_(e,r,`a stat's trend is numbers, oldest first, comma-separated ("12,15,14,19"), not "${o??``}"`),[];n.push({label:i,value:a,...z_(`delta`,t.get(`delta`)),...z_(`note`,t.get(`note`)),...t.has(`down-is-good`)&&t.get(`down-is-good`)!==`false`?{downIsGood:!0}:{},...s===void 0||s.length<2?{}:{trend:s}})}return n.length===0?(D_(e,t,`<${h_}> holds one <${g_} /> or more`),[]):[{type:`stats`,stats:n}]}function W_(e,t){let n=A_(e,t,[`src`,`alt`,`title`,`width`,`align`,`id`]),r=n.get(`src`);if(!r)return D_(e,t,`<img> names its picture: src is missing`),[];let i=Number(n.get(`width`)),a=n.get(`align`);return a!==void 0&&a!==`center`&&a!==`right`&&D_(e,t,`a picture's align is center or right, not "${a}"`),[{type:`image`,src:r,...z_(`alt`,n.get(`alt`)),...z_(`caption`,n.get(`title`)),...Number.isFinite(i)&&i>0?{width:Math.round(i)}:{},...a===`center`||a===`right`?{align:a}:{},...z_(`id`,n.get(`id`))}]}function G_(e,t){if(t.children.length>0)return D_(e,t,`<${d_}> holds nothing: its props are its attributes`),[];let n=new Map,r={};for(let i of t.attributes){if(i.type!==`mdxJsxAttribute`){D_(e,t,`<${d_}>'s attributes are plain strings, not {…}`);continue}let a=i.value===null||i.value===void 0?``:typeof i.value==`string`?i.value:void 0;a===void 0?D_(e,t,`${i.name} of <${d_}> is a plain string`):f_.includes(i.name)?n.set(i.name,a):r[i.name]=a}let i=n.get(`of`)??``;if(i.trim()===``)return D_(e,t,`<${d_}> names its component: of is missing (of="../ui.ts#Dialog")`),[];let a=r=>{let i=n.get(r);if(i===void 0)return;let a=Number(i);if(Number.isFinite(a)&&a>0)return Math.round(a);D_(e,t,`${r} of <${d_}> is a number of pixels, not "${i}"`)},o=a(`width`),s=a(`height`),c=n.get(`at`),l=c===void 0?void 0:Number(c);l!==void 0&&!(Number.isFinite(l)&&l>=0)&&D_(e,t,`at of <${d_}> is seconds, 0 or more, not "${c??``}"`);let u=n.get(`align`);return u!==void 0&&u!==`center`&&u!==`right`&&D_(e,t,`a component's align is center or right, not "${u}"`),[{type:`component`,of:i,...o===void 0?{}:{width:o},...s===void 0?{}:{height:s},...l!==void 0&&Number.isFinite(l)&&l>=0?{at:l}:{},...z_(`alt`,n.get(`alt`)),...z_(`caption`,n.get(`title`)),...u===`center`||u===`right`?{align:u}:{},...z_(`id`,n.get(`id`)),props:r}]}function K_(e,t){let n=A_(e,t,x_),r=n=>{D_(e,t,n)},i=n.get(`type`);if(i===void 0||i===``)return r(`<${b_}> says what it is drawn as: type is missing (${Te.join(`, `)})`),[];if(!Te.includes(i))return r(`a chart's type is ${Te.join(`, `)}, not "${i}"`),[];let[a,...o]=t.children;if(o.length>0||a!==void 0&&a.type!==`table`)return r(`<${b_}> holds one table: its numbers`),[];let s=a?.type===`table`?a.children.map(t=>t.children.map(t=>N_(e,t.children).map(e=>e.text).join(``).trim())):void 0,c=n.get(`data`),l=n.get(`categories`),u=n.get(`series`);if(s!==void 0&&c!==void 0)return r(`a chart's numbers are its table or the file data names, not both`),[];if(s===void 0&&(c===void 0||c===``))return r(`<${b_}> has numbers: a table inside it, or data="…" naming a file of them`),[];if(s!==void 0){(l!==void 0||u!==void 0)&&r(`categories and series name a file's columns: a chart's own table has its series in its head row and its categories in its first column`);let e=Math.min(...s.map(e=>e.length));(s.length<2||e<2)&&r(`a chart's table has a head row and a row of numbers, a column of categories and a column of numbers`)}else(l===void 0||l===``)&&r(`with data, categories names the column of the categories`),(u===void 0||w_(u).length===0)&&r(`with data, series names the columns of the numbers (series="revenue,cost")`);let d=n.get(`legend`),f=[...Ee,`none`];d!==void 0&&!f.includes(d)&&r(`a chart's legend is ${f.join(`, `)}, not "${d}"`);let p=n.get(`labels`),m=p===void 0?void 0:p===``?[`value`]:w_(p),h=m?.filter(e=>!ca.includes(e));h?.length&&r(`a chart's labels are ${ca.join(`, `)}, not ${h.map(e=>`"${e}"`).join(`, `)}`);let g=(e,t)=>{let i=n.get(e);if(i===void 0)return;let a=Number(i);if(i.trim()!==``&&Number.isFinite(a)&&(!t||a>0))return t?Math.round(a):a;r(`${e} of <${b_}> is ${t?`a number of pixels`:`a number`}, not "${i}"`)},_=g(`min`,!1),v=g(`max`,!1),y=g(`width`,!0),b=g(`height`,!0),x=n.get(`colors`);return[{type:`chart`,kind:i,...z_(`title`,n.get(`title`)),...s===void 0?{}:{table:s},...c===void 0||c===``?{}:{data:c},...s===void 0?z_(`categories`,l):{},...s===void 0&&u!==void 0&&w_(u).length>0?{series:w_(u)}:{},...d!==void 0&&f.includes(d)?{legend:d}:{},...m!==void 0&&!h?.length?{labels:m}:{},...z_(`format`,n.get(`format`)),..._===void 0?{}:{min:_},...v===void 0?{}:{max:v},...x!==void 0&&w_(x).length>0?{colors:w_(x)}:{},...n.has(`smooth`)&&n.get(`smooth`)!==`false`?{smooth:!0}:{},...y===void 0?{}:{width:y},...b===void 0?{}:{height:b},...z_(`alt`,n.get(`alt`)),...z_(`id`,n.get(`id`))}]}function q_(e,t){A_(e,t,[]);let n=[];for(let r of t.children){if(r.type!==`mdxJsxFlowElement`||r.name!==`Column`)return D_(e,r,`<${v_}> holds <${y_}>s, each around its blocks`),[];let t=A_(e,r,[`width`]).get(`width`),i=t===void 0?void 0:Number(t);t!==void 0&&!(Number.isFinite(i)&&(i??0)>0)&&D_(e,r,`a column's width is a share against the others' (1, 2, 0.5), not "${t}"`);let a=Z_(e,r.children);if(a.some(e=>e.type===`columns`))return D_(e,r,`a <${y_}> holds no <${v_}>`),[];n.push({...i!==void 0&&Number.isFinite(i)&&i>0&&i!==1?{width:i}:{},blocks:a})}return n.length<2?(D_(e,t,`<${v_}> holds two or more <${y_}>s`),[]):[{type:`columns`,columns:n}]}function J_(e,t){let n=A_(e,t,[`widths`,`head`,`caption`,`id`]),r=Z_(e,t.children),[i,...a]=r;if(i?.type!==`table`||a.length>0)return D_(e,t,`<${u_}> holds one table`),r;let o=n.get(`head`);o!==void 0&&![`none`,`column`,`both`,`row`].includes(o)&&D_(e,t,`a table's head is none, row, column or both, not "${o}"`);let s=n.get(`widths`)?.split(`,`).map(e=>{let t=Number(e.trim());return e.trim()!==``&&Number.isFinite(t)&&t>0?Math.round(t):null});return[{...i,...o===`none`||o===`column`||o===`both`?{head:o}:{},...s?.some(e=>e!==null)?{widths:s}:{},...z_(`caption`,n.get(`caption`)),...z_(`id`,n.get(`id`))}]}function Y_(e,t){switch(t.type){case`paragraph`:{let n=t.children.length===1?t.children[0]:void 0;if(n?.type===`image`)return[{type:`image`,src:n.url,...n.alt?{alt:n.alt}:{},...n.title?{caption:n.title}:{}}];let r=N_(e,t.children),i=r.map(e=>e.text).join(``).trim();return i.startsWith(`$$`)&&i.endsWith(`$$`)&&i.length>4&&D_(e,t,"$$ is not drawn in a doc: an equation is a ```math code block"),[{type:`paragraph`,content:r}]}case`heading`:return[{type:`heading`,level:t.depth,content:N_(e,t.children)}];case`list`:{let n=t.ordered===!0;return t.children.map((r,i)=>L_(e,r,n,i===0&&n?t.start??void 0:void 0))}case`blockquote`:{let{content:n,under:r}=F_(e,t.children);return[I_({type:`quote`,content:n},r)]}case`code`:return[{type:`code`,...t.lang?{language:t.lang}:{},code:t.value}];case`table`:return[{type:`table`,rows:t.children.map(t=>R_(e,t))}];case`thematicBreak`:return[{type:`divider`}];case`mdxJsxFlowElement`:{let n=n=>n.length>0?n:[{type:`embed`,source:E_(e,t)}];if(t.name===`Block`)return n(B_(e,t));if(t.name===`Table`)return J_(e,t);if(t.name===`Callout`)return V_(e,t);if(t.name===`Component`)return n(G_(e,t));if(t.name===`Chart`)return n(K_(e,t));if(t.name===`Columns`)return n(q_(e,t));if(t.name===`Card`)return n(H_(e,t));if(t.name===`Stats`)return n(U_(e,t));if(t.name===`Stat`)return D_(e,t,`a <${g_} /> stands inside <${h_}>`),n([]);if(t.name===`PageBreak`){let r=A_(e,t,[`orientation`]).get(`orientation`);return t.children.length>0?(D_(e,t,`<${p_} /> holds nothing`),n([])):r!==void 0&&r!==`portrait`&&r!==`landscape`?(D_(e,t,`a page break's orientation is portrait or landscape, not "${r}"`),n([])):[{type:`pagebreak`,...r===void 0?{}:{orientation:r}}]}if(t.name===`Bibliography`)return t.attributes.length>0||t.children.length>0?(D_(e,t,`<${S_} /> takes nothing`),n([])):[{type:`bibliography`}];if(t.name===`TableOfContents`){let r=A_(e,t,[`levels`,`title`]),i=r.get(`levels`),a=r.get(`title`),o=i===void 0?void 0:Number(i);return t.children.length>0||o!==void 0&&!(Number.isInteger(o)&&o>=1&&o<=6)?(D_(e,t,`<${C_} /> holds nothing, and its levels are 1 to 6 (the deepest heading it lists)`),n([])):[{type:`toc`,...o===void 0?{}:{levels:o},...a===void 0?{}:{title:a}}]}return t.name===`Column`?(D_(e,t,`a <${y_}> stands inside <${v_}>`),n([])):t.name===`img`&&t.children.length===0?n(W_(e,t)):P_(t)?[{type:`paragraph`,content:[]}]:[{type:`embed`,source:E_(e,t)}]}case`footnoteDefinition`:{let{content:n,under:r}=F_(e,t.children);return[I_({type:`note`,label:t.label??t.identifier,content:n},r)]}case`mdxjsEsm`:case`definition`:return[{type:`source`,source:E_(e,t)}];case`mdxFlowExpression`:return D_(e,t,`{…} on its own is not drawn in a doc`),[{type:`source`,source:E_(e,t)}];default:return D_(e,t,`${t.type} is not drawn in a doc`),[{type:`source`,source:E_(e,t)}]}}function X_(e,t){return t.map((n,r)=>{let i=Y_(e,n),a=t[r-1],o=i[0];return n.type===`list`&&n.ordered===!0&&a?.type===`list`&&a.ordered===!0&&o?.type===`numbered`&&o.start===void 0&&(i[0]={...o,start:n.start??1}),i})}function Z_(e,t){return X_(e,t).flat()}function Q_(e){let t={source:e,problems:[]},n;try{n=or(e,{extensions:[br(),s_(),mr(),hr(),fr(),vt(),Wp()],mdastExtensions:[xr(),Yf(),lr(),ur(),pr(),gt()]})}catch(t){let n=t;return{source:e,blocks:[],segments:[],page:{},problems:[{message:n.reason??n.message??`The file is not MDX`,...typeof n.line==`number`?{line:n.line}:{},...typeof n.column==`number`?{column:n.column}:{}}]}}let[r]=n.children,i=r?.type===`yaml`?r:void 0,a=i?n.children.slice(1):n.children,o=i?$_(t,i):{},s=[],c=X_(t,a);a.forEach((e,t)=>{let n=e.position?.start.offset,r=e.position?.end.offset;n!==void 0&&r!==void 0&&s.push({start:n,end:r,blocks:c[t]??[]})});let l=i?.position?.start.offset,u=i?.position?.end.offset;return{source:e,blocks:s.flatMap(e=>e.blocks),segments:s,problems:t.problems,page:o,...l===void 0||u===void 0?{}:{frontMatter:{start:l,end:u}}}}function $_(e,t){let n;try{n=yr(t.value)}catch(n){return D_(e,t,`the front matter is not YAML: ${n instanceof Error?n.message:String(n)}`),{}}return n==null?{}:typeof n!=`object`||Array.isArray(n)?(D_(e,t,`the front matter holds keys: ${Ji.join(`, `)}`),{}):na(n,n=>{D_(e,t,n)})}var ev=[`link`,`span`,`tag`,`underline`,`bold`,`italic`,`strike`,`code`];function tv(e,t){switch(t){case`link`:return e.href;case`tag`:return e.styles.tag;case`span`:return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??``}\n${e.styles.background??``}`:void 0;default:return e.styles[t]?`on`:void 0}}var nv=(e,t)=>t===void 0?``:` ${e}="${t.replace(/&/g,`&`).replace(/"/g,`"`)}"`,rv=e=>e!==void 0&&/[\p{L}\p{N}]/u.test(e);function iv(e,t,n=t){let r=``,i=Array.from(e);return i.forEach((e,a)=>{let o=i[a-1],s=i[a+1];switch(e){case`\\`:case`*`:case"`":case`[`:case`]`:case`<`:case`>`:case`{`:case`}`:case`~`:r+=`\\${e}`;break;case`_`:r+=rv(o)&&rv(s)?e:`\\${e}`;break;case`&`:r+=/^&(#\d+|#x[0-9a-f]+|[a-z][a-z0-9]*);/i.test(i.slice(a,a+34).join(``))?`&`:e;break;case`|`:r+=t?`\\|`:e;break;case`!`:r+=s===void 0?`\\!`:e;break;case`
|
|
338
|
-
`:r+=n?`<br />`:`\\
|
|
339
|
-
`;break;default:r+=e}}),r}function av(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(e=>e.length)),n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${n}${r}${e}${r}${n}`}var ov={bold:`**`,italic:`*`,strike:`~~`},sv={underline:`u`,bold:`strong`,italic:`em`,strike:`del`,code:`code`};function cv(e,t){let n=``,r=0,i=!0;for(;r<e.length;){let a=e[r];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){n+=a.note===void 0?`[${a.cite??``}]`:`[^${a.note}]`,i=!1,r++;continue}let o=ev.find(e=>!t.used.has(e)&&tv(a,e)!==void 0);if(o===void 0){n+=iv(a.text,t.inTable,t.oneLine),i=!0,r++;continue}let s=tv(a,o),c=r+1;for(;c<e.length;){let n=e[c];if(n===void 0||tv(n,o)!==s||o===`code`&&ev.some(e=>e!==`code`&&!t.used.has(e)&&tv(n,e)!==void 0))break;c++}let l=e.slice(r,c),u=new Set([...t.used,o]),d=l.map(e=>e.text).join(``),f=e[c],p=f===void 0||ev.every(e=>t.used.has(e)||tv(f,e)===void 0);if(o===`code`)n+=d.includes(`
|
|
340
|
-
`)||t.inTable&&d.includes(`|`)?`<code>${iv(d,t.inTable,t.oneLine)}</code>`:av(d);else if(o===`link`){let e=cv(l,{...t,used:u}),r=(s??``).replace(/[\s<>\\]/g,e=>encodeURIComponent(e)),i=lv(r)?r:r.replace(/[()]/g,`\\$&`);n+=`[${e}](${i})`}else if(o===`tag`){let e=cv(l,{...t,used:u});n+=`<Tag${nv(`color`,s)}>${e}</Tag>`}else if(o===`span`){let e=cv(l,{...t,used:u}),r=l[0];n+=`<span${nv(`color`,r?.styles.color)}${nv(`bg`,r?.styles.background)}>${e}</span>`}else{let a=cv(l,{...t,used:u}),s=ov[o],f=Array.from(d),m=r===0&&c===e.length,h=t.used.has(`bold`)||t.used.has(`italic`)||t.used.has(`strike`),g=e=>e!==void 0&&ev.every(t=>u.has(t)||tv(e,t)===void 0),_=o===`bold`&&l.every(e=>e.styles.italic===!0&&ev.every(t=>t===`italic`||u.has(t)||tv(e,t)===void 0)),v=s!==void 0&&rv(f[0])&&rv(f.at(-1))&&!d.includes(`
|
|
341
|
-
`)&&i&&p&&(!h||m&&o===`italic`&&t.used.has(`bold`))&&(g(l[0])&&g(l.at(-1))||_);n+=v?`${s}${a}${s}`:`<${sv[o]}>${a}</${sv[o]}>`}i=!1,r=c}return n}function lv(e){let t=0;for(let n of e)if(n===`(`)t+=1;else if(n===`)`&&--t<0)return!1;return t===0}function uv(e){if(/^[ \t]/.test(e)||/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;let t=/^(\d{1,9})([.)])(\s|$)/.exec(e);return t?.[1]===void 0?e:`${t[1]}\\${e.slice(t[1].length)}`}function dv(e,t=!1,n=t){let r=cv(e.filter(e=>e.text!==``||e.href!==void 0).map((e,t,n)=>{if(e.note===void 0)return e;let r=n.slice(0,t).findLast(e=>e.note===void 0);return r===void 0?e:{...e,styles:{...r.styles},...r.href===void 0?{}:{href:r.href}}}),{inTable:t,oneLine:n,used:new Set}),i=e=>e.replace(/ +$/,``).replace(/^ +/,e=>` `.repeat(e.length));return n?i(r):r.split(`
|
|
342
|
-
`).map(e=>uv(i(e))).join(`
|
|
343
|
-
`)}var fv=(e,t)=>e.split(`
|
|
344
|
-
`).map((e,n)=>n===0||e===``?e:`${t}${e}`).join(`
|
|
345
|
-
`),pv=e=>e.type===`bullet`||e.type===`numbered`||e.type===`check`,mv=e=>`${nv(`align`,e?.align)}${nv(`color`,e?.color)}${nv(`bg`,e?.background)}`,hv=e=>e!==void 0&&Object.keys(e).length>0;function gv(e){return!(`content`in e)||e.type===`callout`?!1:hv(e.look)||e.type===`toggle`||e.type===`heading`&&e.toggle?!0:(e.type===`paragraph`||e.type===`heading`)&&(e.children?.length??0)>0}function _v(e){let t=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(e=>e.trim().length));return"`".repeat(t+1)}function vv(e,t,n){let r=e.type===`numbered`?`${String(t)}${n} `:e.type===`check`?`- [${e.checked?`x`:` `}] `:`- `,i=` `.repeat(e.type===`numbered`?r.length:2),a=e.children??[],o=dv(e.content)||(e.type===`check`&&(e.children??[]).length===0?`<br />`:``);if(a.length===0)return`${r}${fv(o,i)}`.trimEnd();let s=o===``?`<br />`:o,[c]=a,l=c!==void 0&&pv(c)&&dv(c.content)!==``&&(c.type!==`numbered`||(c.start??1)===1),u=a.every(pv)&&o!==``&&l;return`${r}${fv(s,i)}${u?`
|
|
346
|
-
`:`
|
|
347
|
-
|
|
348
|
-
`}${i}${fv(Tv(a),i)}`}function yv(e){switch(e.type){case`paragraph`:{let t=dv(e.content);return t===``?`<br />`:t}case`heading`:return`${`#`.repeat(e.level)} ${dv(e.content,!1,!0).replace(/(^| )(#+)$/,`$1\\$2`)}`.trimEnd();case`toggle`:return dv(e.content)||`<br />`;case`quote`:{let t=dv(e.content);return(e.children?.length?[t===``?`<br />`:t,Tv(e.children)]:[t]).join(`
|
|
349
|
-
|
|
350
|
-
`).split(`
|
|
351
|
-
`).map(e=>e===``?`>`:`> ${e}`).join(`
|
|
352
|
-
`)}case`callout`:{let t=dv(e.content),n=[t===``?`<br />`:t,...e.children?.length?[Tv(e.children)]:[]].join(`
|
|
353
|
-
|
|
354
|
-
`);return`<${l_}${nv(`icon`,e.icon)}${nv(`color`,e.look?.color)}${nv(`bg`,e.look?.background)}>\n\n${n}\n\n</${l_}>`}case`card`:{let t=e.children?.length?Tv(e.children):``;return`<${m_}${nv(`title`,e.title)}${nv(`subtitle`,e.subtitle)}>\n\n${t===``?`<br />`:t}\n\n</${m_}>`}case`stats`:return[`<${h_}>`,...e.stats.map(e=>`<${g_}${nv(`label`,e.label)}${nv(`value`,e.value)}${nv(`delta`,e.delta)}${nv(`note`,e.note)}${e.downIsGood?` down-is-good`:``}${nv(`trend`,e.trend?.join(`,`))} />`),`</${h_}>`].join(`
|
|
355
|
-
`);case`code`:{let t=_v(e.code);return`${t}${e.language??``}\n${e.code}\n${t}`}case`image`:{let t=e.src.replace(/[\s()<>\\]/g,e=>encodeURIComponent(e));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${nv(`src`,e.src)}${nv(`alt`,e.alt)}${nv(`title`,e.caption)}${nv(`width`,e.width===void 0?void 0:String(e.width))}${nv(`align`,e.align)}${nv(`id`,e.id)} />`;let n=e.caption===void 0?``:` "${e.caption.replace(/["\\]/g,`\\$&`)}"`;return``}case`table`:{let t=Math.max(1,...e.rows.map(e=>e.length)),n=e=>`| ${Array.from({length:t},(t,n)=>dv(e[n]??[],!0)).join(` | `)} |`,[r,...i]=e.rows,a=[n(r??[]),`| ${Array.from({length:t},()=>`---`).join(` | `)} |`,...i.map(n)].join(`
|
|
356
|
-
`),o=e.widths?.some(e=>e!==null)?e.widths.map(e=>e===null?``:String(e)).join(`,`):void 0;return o===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${u_}${nv(`widths`,o)}${nv(`head`,e.head)}${nv(`caption`,e.caption)}${nv(`id`,e.id)}>\n\n${a}\n\n</${u_}>`}case`divider`:return`---`;case`component`:{let t=e=>e===void 0?void 0:String(e),n=Object.entries(e.props).map(([e,t])=>nv(e,t)).join(``);return`<${d_}${nv(`of`,e.of)}${nv(`width`,t(e.width))}${nv(`height`,t(e.height))}${nv(`at`,t(e.at))}${n}${nv(`alt`,e.alt)}${nv(`title`,e.caption)}${nv(`align`,e.align)}${nv(`id`,e.id)} />`}case`chart`:return bv(e);case`pagebreak`:return`<${p_}${nv(`orientation`,e.orientation)} />`;case`bibliography`:return`<${S_} />`;case`toc`:return`<${C_}${nv(`levels`,e.levels===void 0?void 0:String(e.levels))}${nv(`title`,e.title)} />`;case`note`:{let t=dv(e.content)||`<br />`,n=e.children?.length?`\n\n${Tv(e.children).split(`
|
|
357
|
-
`).map(e=>e===``?e:` ${e}`).join(`
|
|
358
|
-
`)}`:``;return`[^${e.label}]: ${fv(t,` `)}${n}`}case`columns`:return[`<${v_}>`,...e.columns.map(e=>{let t=Tv(e.blocks);return`<${y_}${nv(`width`,e.width===void 0?void 0:String(e.width))}>\n\n${t===``?`<br />`:t}\n\n</${y_}>`}),`</${v_}>`].join(`
|
|
359
|
-
|
|
360
|
-
`);case`embed`:case`source`:return e.source}}function bv(e){let t=e=>e===void 0?void 0:String(e),n=e=>e===void 0?void 0:e.join(`,`),r=e.labels?.length===1&&e.labels[0]===`value`?` labels`:nv(`labels`,n(e.labels)),i=[nv(`type`,e.kind),nv(`title`,e.title),nv(`data`,e.data),nv(`categories`,e.categories),nv(`series`,n(e.series)),nv(`legend`,e.legend),r,nv(`format`,e.format),nv(`min`,t(e.min)),nv(`max`,t(e.max)),nv(`colors`,n(e.colors)),e.smooth?` smooth`:``,nv(`width`,t(e.width)),nv(`height`,t(e.height)),nv(`alt`,e.alt),nv(`id`,e.id)].join(``);if(e.table===void 0)return`<${b_}${i} />`;let a=Math.max(1,...e.table.map(e=>e.length)),o=e=>`| ${Array.from({length:a},(t,n)=>iv(e[n]??``,!0)).join(` | `)} |`,[s,...c]=e.table;return`<${b_}${i}>\n\n${[o(s??[]),`| ${Array.from({length:a},()=>`---`).join(` | `)} |`,...c.map(o)].join(`
|
|
361
|
-
`)}\n\n</${b_}>`}function xv(e){let t=oa(e);if(Object.keys(t).length===0)return``;let n=new _r(t);return vr(n,{Seq:(e,t)=>{t.flow=!0},Map:(e,t,n)=>{n.length>1&&(t.flow=!0)}}),n.toString({lineWidth:0}).trimEnd()}function Sv(e,t){let n=xv(t),r=n===``?``:`---\n${n}\n---`,i=e.frontMatter;if(i===void 0){if(r===``)return e.source;let t=e.source.replace(/^\s+/u,``);return t===``?`${r}\n`:`${r}\n\n${t}`}let a=e.source.slice(i.end).replace(/^\s+/u,``);return r===``?a:a===``?`${r}\n`:`${r}\n\n${a}`}function Cv(e){let t=e.type===`toggle`||e.type===`heading`&&e.toggle,{children:n}=e,r={...e};delete r.look,delete r.children;let i=r.type===`toggle`?{type:`paragraph`,content:r.content}:r.type===`heading`?{type:`heading`,level:r.level,content:r.content}:r,a=pv(i)||i.type===`quote`?Tv([{...i,...n?{children:n}:{}}]):Tv([i,...n??[]]);return`<${c_}${mv(e.look)}${t?` toggle`:``}>\n\n${a}\n\n</${c_}>`}function wv(e,t){return pv(e)&&pv(t)&&!gv(e)&&!gv(t)&&e.type===`numbered`==(t.type===`numbered`)&&(t.type!==`numbered`||t.start===void 0)}function Tv(e){let t=[],n=0,r;for(;n<e.length;){let i=e[n];if(i===void 0)break;if(gv(i)){t.push(Cv(i)),r=void 0,n++;continue}if(!pv(i)){t.push(n===0&&i.type===`divider`?`***`:yv(i)),r=void 0,n++;continue}let a=i.type===`numbered`,o=i.type===`numbered`?i.start??1:1,s=a&&r===`.`?`)`:`.`,c=[],l=n;for(;l<e.length;){let t=e[l];if(t===void 0||!pv(t)||gv(t)||t.type===`numbered`!==a||l>n&&!wv(i,t))break;c.push(vv(t,o+(l-n),s)),l++}let u=c.some(e=>e.includes(`
|
|
362
|
-
|
|
363
|
-
`));t.push(c.join(u?`
|
|
364
|
-
|
|
365
|
-
`:`
|
|
366
|
-
`)),r=a?s:void 0,n=l}return t.join(`
|
|
367
|
-
|
|
368
|
-
`)}function Ev(e,t){let n=t.map(ma),r=e.segments.map(e=>({...e,keys:e.blocks.map(ma)})),i=r.length,a=n.length,o=(e,t)=>{let i=r[e]?.keys??[];return i.length>0&&t+i.length<=a&&i.every((e,r)=>n[t+r]===e)},s=Array.from({length:i+1},()=>Array(a+1).fill(0)),c=(e,t)=>s[e]?.[t]??0;for(let e=i-1;e>=0;e--)for(let t=a;t>=0;t--){let n=r[e]?.keys.length??0,i=Math.max(c(e+1,t),t<a?c(e,t+1):0);o(e,t)&&(i=Math.max(i,n+c(e+1,t+n)));let l=s[e];l&&(l[t]=i)}let l=[],u=0,d=0,f=[],p=()=>{f.length>0&&l.push({blocks:f}),f=[]};for(;u<i||d<a;){let e=r[u]?.keys.length??0;if(u<i&&o(u,d)&&c(u,d)===e+c(u+1,d+e))p(),l.push({kept:u}),d+=e,u++;else if(u<i&&c(u,d)===c(u+1,d))u++;else{let e=t[d];e&&f.push(e),d++}}p();let m=e.source,h=e=>{let t=r[e];return t!==void 0&&!m.slice(t.start,t.end).includes(`
|
|
369
|
-
|
|
370
|
-
`)};for(let e=0;e<l.length;e++){let t=l[e];if(!t||!(`kept`in t))continue;let n=r[t.kept]?.blocks??[],i=n[0],a=n.at(-1),o=l[e-1],s=l[e+1],c=o&&`blocks`in o?o.blocks.at(-1):void 0,u=s&&`blocks`in s?s.blocks[0]:void 0,d=c!==void 0&&i!==void 0&&wv(c,i),f=u!==void 0&&a!==void 0&&wv(a,u);(d||f)&&h(t.kept)&&(l[e]={blocks:[...n]})}for(let e=l.length-1;e>0;e--){let t=l[e],n=l[e-1];t&&n&&`blocks`in t&&`blocks`in n&&(n.blocks.push(...t.blocks),l.splice(e,1))}let g=r[0],_=r.at(-1),v=g?m.slice(0,g.start):e.frontMatter?`${m.slice(0,e.frontMatter.end)}\n\n`:``,y=_?m.slice(_.end):m===``?``:`
|
|
371
|
-
`,b=v,x;return l.forEach((e,t)=>{if(t>0){let n=l[t-1],i=`kept`in e&&n&&`kept`in n&&x!==void 0&&e.kept===x+1?m.slice(r[x]?.end??0,r[e.kept]?.start??0):`
|
|
372
|
-
|
|
373
|
-
`;b+=i}if(`kept`in e){let t=r[e.kept];t&&(b+=m.slice(t.start,t.end)),x=e.kept}else b+=Tv(e.blocks),x=void 0}),l.length===0&&e.frontMatter!==void 0?`${m.slice(0,e.frontMatter.end)}\n`:(e.frontMatter===void 0&&t[0]?.type===`divider`&&(b=b.replace(/^---[ \t]*(?=\n|$)/u,`***`)),b+(y===``&&b!==``?`
|
|
374
|
-
`:y))}var Dv={ground:`#ECE3CC`,ink:`#2F4A2E`,middle:`#5E7D3A`,soft:`#F6F0E0`,notes:[`#C4683A`,`#6F8FAE`,`#6B5A7A`,`#D9A93A`],tone:`#C4683A`},Ov={ground:`#E6D8BB`,ink:`#1F3B63`,middle:`#4A6F96`,soft:`#F4ECDB`,notes:[`#1F3B63`,`#4A6F96`,`#8FB3D9`,`#B7A27C`],tone:`#8FB3D9`},kv={ground:`#E8E2D2`,ink:`#3E3A4C`,middle:`#7F7B9C`,soft:`#F4F0E6`,notes:[`#B9776A`,`#6B8AA6`,`#7D9474`,`#D2A874`],tone:`#A85F55`},Av={ground:`#DDE6E2`,ink:`#22303B`,middle:`#5B8299`,soft:`#EEF3F0`,notes:[`#5F8A6A`,`#3F6F9A`,`#9A5A40`,`#C4A066`],tone:`#C4A066`},jv=[`dots`,`scales`,`bay`,`stacks`,`steam`,`dusk`,`lake`],Mv=1800,Nv=600,Pv=`width="${String(Mv)}" height="${String(Nv)}"`,Q=e=>String(Math.round(e*10)/10),Fv=e=>String(Math.round(e));function Iv(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function Lv(e,t){let n=e[Math.min(e.length-1,Math.floor(t*e.length))];if(n===void 0)throw Error(`An empty list.`);return n}function Rv(e,t){return`<linearGradient id="${e}" x1="0" y1="0" x2="0" y2="1">${t.map(([e,t,n])=>`<stop offset="${Q(e)}" stop-color="${t}"${n===void 0?``:` stop-opacity="${Q(n)}"`}/>`).join(``)}</linearGradient>`}var zv=`<filter id="grain" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency=".75" numOctaves="2" seed="3" stitchTiles="stitch"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0 0 0 -.18"/></filter>`,Bv=`<rect ${Pv} filter="url(#grain)" opacity=".5"/>`;function Vv(e,t,n=.012){return`<filter id="${e}" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency="${String(n)}" numOctaves="3" seed="7"/><feDisplacementMap in="SourceGraphic" scale="${String(t)}" xChannelSelector="R" yChannelSelector="G"/></filter>`}function Hv(e,t){return`<filter id="${e}" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${String(t)}"/></filter>`}function Uv(e,t){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${String(Mv)} ${String(Nv)}" preserveAspectRatio="xMidYMid slice"><defs>${zv}${e}</defs>${t}${Bv}</svg>`}var Wv=class{by=new Map;add(e,t){this.by.set(e,`${this.by.get(e)??``}${t}`)}draw(e){let t=``;for(let[n,r]of this.by)t+=`<path d="${r}" stroke="${n}" stroke-width="${Q(e)}" stroke-linecap="round" fill="none"/>`;return t}};function Gv(e,t,n){let r=(e,t)=>Number.parseInt(e.slice(1+t*2,3+t*2),16);return`#${[0,1,2].map(i=>Math.round(r(e,i)+(r(t,i)-r(e,i))*n).toString(16).padStart(2,`0`)).join(``)}`}function Kv(e,t,n,r){let i=``;for(let a=-20;a<=1820;a+=12){let o=e-t*(Math.sin(a*n+r)*.55+Math.sin(a*n*2.3+r*1.7)*.3+Math.sin(a*n*5.9+r*.6)*.12);i+=`${i===``?`M`:`L`}${Fv(a)} ${Fv(o)}`}return`${i}L1820 620L-20 620Z`}function qv(){let e=Dv,t=Iv(1884),n={base:`#E7E3CF`,own:[e.soft,e.ground,`#E9DDB0`,`#F1E7C6`],other:[`#BCCAD6`,`#CFC6DA`]},r={base:`#AEBBC8`,own:[`#94A9C0`,e.notes[1],`#C3CFDA`,e.soft],other:[`#E2C27E`,`#C99FB8`]},i={base:`#97A350`,own:[`#A6B262`,`#C6B65A`,e.notes[3],`#93A752`,`#D8B85A`],other:[e.notes[0],`#E09A68`]},a={base:`#34463E`,own:[e.ink,`#3E3A4C`,`#3B5848`,`#46506A`],other:[e.notes[2],e.notes[1],`#8C6A8E`]},o={base:`#3E5836`,own:[e.ink,`#46633A`,`#3B5848`,`#55703F`],other:[e.notes[2],e.notes[1]]},s={base:`#2F3A30`,own:[e.ink,`#2B3530`,`#3E3A4C`],other:[e.notes[2],`#4E4466`]},c={base:`#3A3550`,own:[`#3E3A4C`,`#4E4466`,`#2F3A4A`,`#5A4E74`],other:[e.notes[1],`#8C6A8E`]},l={base:`#4E4466`,own:[e.notes[2],`#5A4E74`,`#3E3A4C`,`#6E5E86`],other:[`#8C6A8E`]},u=e=>228+Math.sin(e/210)*5+Math.sin(e/47)*3,d=e=>300+Math.sin(e/260)*12+Math.sin(e/61)*4,f=e=>336+e*.17+Math.sin(e/140)*14,p=[[150,.05],[420,-.04],[1540,.06],[1720,-.03]],m=(e,t)=>t<470&&p.some(([n,r])=>Math.abs(e-(n+(t-400)*r))<8+Math.max(0,Math.min(1,t/420))*12),h=(e,t)=>p.some(([n])=>((e-n)/230)**2+((t-40)/150)**2<1+Math.sin(e/23+t/31)*.12),g=1180,_=(e,t)=>t>316&&t<414&&Math.abs(e-g-(t-316)*.08)<20+(t-316)*.2||((e-g-36)/26)**2+((t-344)/28)**2<1||((e-g)/18)**2+((t-298)/30)**2<1||((e-g+3)/13)**2+((t-258)/15)**2<1,v=(e,t)=>t<240&&((e-g+16)/78)**2+((t-240)/52)**2<1,y=(e,t)=>v(e,t)?l:_(e,t)?c:m(e,t)?s:h(e,t)?o:t<u(e)?n:t<d(e)?r:t>f(e)?a:i,b=new Wv;for(let e=4;e<Nv;e+=15*.82)for(let i=4+t()*15;i<Mv;i+=15*(.8+t()*.4)){let a=i+(t()-.5)*15*.5,o=e+(t()-.5)*15*.5,s=y(a,o);if((s===n||s===r)&&t()<.3)continue;let c=t()<.72?Lv(s.own,t()):Lv(s.other,t()),l=(t()-.5)*1.6;b.add(c,`M${Fv(a)} ${Fv(o)}l${Fv(Math.cos(l)*4)} ${Fv(Math.sin(l)*4)}`)}let x=e=>Array.from({length:37},(t,n)=>`L${Fv(n*50)} ${Fv(e(n*50))}`).join(``);return Uv(``,`${`<rect ${Pv} fill="${n.base}"/><path d="M0 600L0 ${Fv(u(0))}${x(u)}L1800 600Z" fill="${r.base}"/><path d="M0 600L0 ${Fv(d(0))}${x(d)}L1800 600Z" fill="${i.base}"/><path d="M0 600L0 ${Fv(f(0))}${x(f)}L1800 600Z" fill="${a.base}"/>`}${b.draw(9)}`)}function Jv(){let e=Ov,[,,t,n]=e.notes,r=(t,n,r,i)=>`<g id="${t}"><circle r="110" fill="${n}" stroke="${e.ink}" stroke-width="3.6"/>${[.8,.62,.44,.26].map((e,t)=>`<circle r="${Q(110*e)}" fill="none" stroke="${t===3?i:r}" stroke-width="${t===3?`4.4`:`3.4`}"/>`).join(``)}</g>`,i=``,a=0;for(let e=432;e<710;e+=55,a++)for(let t=a%2==0?0:110;t<2020;t+=220)i+=`<use href="#${a%4==2?`b`:`a`}" x="${Q(t)}" y="${Q(e)}"/>`;let o=``;for(let e=1;e<6;e++){let t=-96+e*32;o+=`M${Q(t)} -206Q${Q(t+14)} -112 ${Q(t)} -24`}let s=`<g transform="translate(1250 ${Q(346.2)}) scale(.62) rotate(-3)" stroke="${e.ink}" stroke-linejoin="round"><path d="M-96 -206H96Q124 -112 96 -24H-96Q-68 -112 -96 -206Z" fill="${Gv(e.soft,n,.3)}" stroke-width="4.6"/><path d="${o}" fill="none" stroke-width="3.4"/><g fill="${e.ink}"><path d="M-210 -26L-170 -6H150L232 -58L218 4Q160 30 40 30H-150Q-196 12 -210 -26Z"/><path d="M-4 -234H4V-6H-4Z"/><path d="M-110 -214H110" stroke-width="8"/></g></g>`;return Uv(`${r(`a`,e.soft,e.middle,n)}${r(`b`,t,e.ink,e.soft)}${Rv(`bokashi`,[[0,e.ink],[.22,e.middle],[.5,Gv(e.tone,e.soft,.5)],[.62,e.soft]])}${Vv(`cut`,3,.04)}`,`<rect ${Pv} fill="url(#bokashi)"/><g filter="url(#cut)">${s}${i}</g>`)}function Yv(){let e=Ov,t=Iv(1857),n=new Wv;for(let r=0;r<22;r++){let i=r/21,a=342+i**1.6*250,o=10+i*34,s=o*(1.6+t()*.6);for(let r=-t()*s;r<Mv;r+=s)n.add(i<.35?e.soft:i<.7?e.tone:e.middle,`M${Fv(r)} ${Fv(a+(t()-.5)*4)}h${Fv(o)}`)}let r=(t,n,r)=>`<path d="M${Q(t)} ${Q(n)}l${Q(r*.1)} ${Q(-r)}l${Q(r*.55)} ${Q(r*.12)}l${Q(-r*.05)} ${Q(r*.88)}Z" fill="${e.soft}"/><path d="M${Q(t-r*.2)} ${Q(n)}h${Q(r*1.1)}l${Q(-r*.15)} ${Q(r*.14)}h${Q(-r*.8)}Z" fill="${e.ink}"/>`,i=(e,t,n)=>{let r=`M${Q(e-n/2)} ${Q(t)}`;for(let i=0;i<6;i++){let a=e-n/2+i*n/6;r+=`Q${Q(a+n/12)} ${Q(t-n*(.16+.08*Math.sin(i*1.7)))} ${Q(a+n/6)} ${Q(t)}`}return`${r}Q${Q(e)} ${Q(t+n*.08)} ${Q(e-n/2)} ${Q(t)}Z`},a=`<path d="M-20 600 C 40 470 90 380 150 300 C 200 236 280 196 380 178 L 386 192 C 300 210 228 252 186 318 C 140 390 104 480 70 600 Z"/>
|
|
375
|
-
<path d="M170 300 C 230 290 300 300 360 330 L 352 340 C 296 314 236 306 176 314 Z"/>
|
|
376
|
-
<path d="M250 214 C 300 170 360 150 420 150 L 420 162 C 364 164 310 182 262 222 Z"/>
|
|
377
|
-
<path d="${i(370,168,170)}${i(440,146,120)}${i(300,236,150)}${i(380,332,150)}${i(110,262,190)}${i(60,380,160)}${i(200,168,120)}"/>`;return Uv(`${Rv(`sky`,[[0,e.ink],[.24,e.middle],[.5,e.ground],[.56,e.soft]])}${Rv(`sea`,[[0,e.tone],[.35,e.middle],[.8,e.ink]])}${Vv(`block`,3,.03)}`,`<rect ${Pv} fill="url(#sky)"/>
|
|
378
|
-
<rect y="330" width="${String(Mv)}" height="270" fill="url(#sea)"/>
|
|
379
|
-
<g filter="url(#block)">
|
|
380
|
-
<path d="M1040 334 L1250 210 Q1270 200 1290 210 L1500 334 Z" fill="${e.middle}"/>
|
|
381
|
-
<path d="M1196 242 L1250 210 Q1270 200 1290 210 L1344 242 L1322 238 L1304 252 L1286 236 L1268 254 L1250 238 L1232 252 L1216 238 Z" fill="#FFFDF6"/>
|
|
382
|
-
<path d="M560 336 C 700 324 860 326 1000 334 L 1000 340 L 560 340 Z" fill="${e.ink}" opacity=".75"/>
|
|
383
|
-
${r(760,352,34)}${r(850,348,22)}${r(1560,352,28)}
|
|
384
|
-
${n.draw(3)}
|
|
385
|
-
<g fill="${e.ground}"><rect x="440" y="250" width="560" height="24" rx="12"/><rect x="620" y="284" width="380" height="18" rx="9"/><rect x="1420" y="262" width="440" height="22" rx="11"/><rect x="1180" y="140" width="680" height="20" rx="10"/></g>
|
|
386
|
-
<g fill="#13263F">${a}</g>
|
|
387
|
-
</g>`)}function Xv(){let e=kv,t=Iv(1891),n=(e,t,n)=>{let r=`M${Q(e-n)} ${Q(t)}C${Q(e-n*1.04)} ${Q(t-n*.35)} ${Q(e-n*1.12)} ${Q(t-n*.7)} ${Q(e-n*1.08)} ${Q(t-n*.86)}C${Q(e-n*.92)} ${Q(t-n*1.4)} ${Q(e-n*.42)} ${Q(t-n*2.08)} ${Q(e-n*.04)} ${Q(t-n*2.16)}`,i=`${r}Q${Q(e+n*.04)} ${Q(t-n*2.2)} ${Q(e+n*.12)} ${Q(t-n*2.16)}C${Q(e+n*.5)} ${Q(t-n*2.06)} ${Q(e+n*.96)} ${Q(t-n*1.4)} ${Q(e+n*1.1)} ${Q(t-n*.86)}C${Q(e+n*1.14)} ${Q(t-n*.7)} ${Q(e+n*1.04)} ${Q(t-n*.35)} ${Q(e+n)} ${Q(t)}Z`,a=`shade${Fv(e)}`;return`<path d="M${Q(e)} ${Q(t+n*.02)}L${Q(e+n*5)} ${Q(t+n*.12)}Q${Q(e+n*5.2)} ${Q(t+n*.22)} ${Q(e+n*4.8)} ${Q(t+n*.3)}L${Q(e-n*.7)} ${Q(t+n*.22)}Z" fill="#6A62A0" opacity=".6" filter="url(#soft)"/>
|
|
388
|
-
<clipPath id="${a}"><path d="M${Q(e+n*.2)} ${Q(t-n*2.3)}Q${Q(e-n*.25)} ${Q(t-n)} ${Q(e+n*.05)} ${Q(t+n*.1)}H${Q(e+n*1.3)}V${Q(t-n*2.3)}Z"/></clipPath>
|
|
389
|
-
<g filter="url(#dab)">
|
|
390
|
-
<path d="${i}" fill="#B07468"/>
|
|
391
|
-
<path d="${i}" fill="#55508A" opacity=".55" clip-path="url(#${a})"/>
|
|
392
|
-
<path d="${r}" stroke="#F0A860" stroke-width="${Q(n*.13)}" fill="none" stroke-linecap="round"/>
|
|
393
|
-
</g>`},r=new Wv;for(let n=0;n<1800;n++){let n=t()*Mv,i=t()*Nv,a=i<150?[`#8E86A4`,`#A08AA0`,e.middle,`#B49AA4`]:i<270?[e.notes[0],`#C98B78`,`#D9A88A`,`#B9A0B0`]:i<318?[`#E7C996`,`#F0D9AE`,e.notes[3],`#DDB792`]:i<352?[`#9C93AE`,e.middle,`#A79AB0`]:[`#C9A877`,`#B9A06E`,`#9DA578`,e.notes[2],`#D7B680`,`#A48FA6`],o=8+t()*14;r.add(Lv(a,t()),`M${Fv(n)} ${Fv(i)}l${Fv(o)} ${Fv((t()-.5)*3)}`)}let i=`M-20 360`;for(let e=-20;e<=1840;e+=60)i+=`L${Fv(e)} ${Fv(328-Math.sin(e/300)*10-t()*8)}`;return i+=`L1840 362Z`,Uv(`${Rv(`sky`,[[0,`#8F87A6`],[.32,e.notes[0]],[.5,`#E9C995`],[.56,`#EED7A8`]])}${Rv(`field`,[[0,`#CFAE7A`],[1,`#8F9670`]])}<radialGradient id="sun" cx=".16" cy=".5" r=".32"><stop offset="0" stop-color="#FBEBC4"/><stop offset="1" stop-color="#FBEBC4" stop-opacity="0"/></radialGradient>${Vv(`paint`,8,.02)}${Vv(`dab`,7,.09)}${Hv(`soft`,5)}`,`<rect ${Pv} fill="url(#sky)"/><rect y="350" width="${String(Mv)}" height="250" fill="url(#field)"/>
|
|
394
|
-
<g filter="url(#paint)">
|
|
395
|
-
<rect ${Pv} fill="url(#sky)"/>
|
|
396
|
-
<rect y="350" width="${String(Mv)}" height="250" fill="url(#field)"/>
|
|
397
|
-
<path d="${i}" fill="#9A92AE"/>
|
|
398
|
-
<g opacity=".55">${r.draw(6)}</g>
|
|
399
|
-
<rect ${Pv} fill="url(#sun)"/>
|
|
400
|
-
</g>
|
|
401
|
-
${n(1040,452,72)}${n(1350,408,40)}`)}function Zv(){let e=Av,[,t,n,r]=e.notes,i=Iv(1877),a={x:900,y:70},o=``;for(let e=-9;e<=9;e++){let t=a.x+e*110,n=a.y+Math.abs(e)*((300-a.y)/9);o+=`M${Fv(t)} ${Fv(n)}V${Fv(n-140)}`}let s=(t,n)=>{let r=``;for(let e=0;e<8;e++){let i=e*Math.PI/4;r+=`M${Q(t)} ${Q(432-n)}l${Q(Math.cos(i)*n*.86)} ${Q(Math.sin(i)*n*.86)}`}return`<circle cx="${Q(t)}" cy="${Q(432-n)}" r="${Q(n)}" fill="none" stroke="${e.ink}" stroke-width="9"/><path d="${r}" stroke="${e.ink}" stroke-width="4"/><circle cx="${Q(t)}" cy="${Q(432-n)}" r="${Q(n*.18)}" fill="${e.ink}"/>`},c=[560,676],l=``,u=``;for(let t=0;t<34;t++){let n=((t+i())/34)**1.3,r=446+n*900+(i()-.5)*60*(1+n),a=246-Math.sqrt(n)*90+n*40+(i()-.5)*40*(1+n),o=34+n*120+i()*30,s=26+n*46+i()*16;u+=`<ellipse cx="${Q(r+14)}" cy="${Q(a+s*.5)}" rx="${Q(o*.9)}" ry="${Q(s*.6)}"/>`,l+=`<ellipse cx="${Q(r)}" cy="${Q(a)}" rx="${Q(o)}" ry="${Q(s)}" fill="${Lv([e.soft,`#FFFFFF`,e.ground],i())}" opacity="${Q(.95-n*.5)}"/>`}return Uv(`${Rv(`lazare-air`,[[0,Gv(e.middle,e.ink,.25)],[.5,Gv(e.middle,e.soft,.55)],[.72,e.soft],[1,e.ground]])}${Hv(`lazare-steam`,16)}${Hv(`lazare-far`,6)}${Vv(`lazare-paint`,6,.015)}`,`<rect ${Pv} fill="url(#lazare-air)"/>
|
|
402
|
-
<g filter="url(#lazare-far)" opacity=".55"><path d="M520 426V330H600V300H660V318H740V286H800V310H880V276H930V300H1010V322H1090V296H1150V330H1240V426Z" fill="${Gv(e.middle,e.soft,.45)}"/></g>
|
|
403
|
-
<g filter="url(#lazare-paint)">
|
|
404
|
-
<path d="M-20 300 L${String(a.x)} ${String(a.y)} L1820 300 V-20 H-20 Z" fill="${Gv(e.middle,e.ink,.35)}" opacity=".55"/>
|
|
405
|
-
<path d="${o}" stroke="${e.ink}" stroke-width="3" opacity=".3"/>
|
|
406
|
-
<path d="M-20 300 L${String(a.x)} ${String(a.y)} L1820 300" stroke="${e.ink}" stroke-width="9" fill="none" opacity=".7"/>
|
|
407
|
-
<path d="M-20 292 H1820" stroke="${e.ink}" stroke-width="4" opacity=".4"/>
|
|
408
|
-
<rect x="-20" y="432" width="1840" height="208" fill="${Gv(e.middle,e.ink,.45)}"/>
|
|
409
|
-
<path d="M-20 434 H1820" stroke="${e.ink}" stroke-width="6"/>
|
|
410
|
-
<path d="M-20 472 H1820" stroke="${Gv(e.middle,e.soft,.4)}" stroke-width="3" opacity=".6"/>
|
|
411
|
-
<path d="M1300 432 V352 H1720 V432 Z" fill="${Gv(e.middle,e.ink,.5)}" opacity=".55"/>
|
|
412
|
-
<path d="M1320 368 H1700" stroke="${e.soft}" stroke-width="10" stroke-dasharray="34 18" opacity=".35"/>
|
|
413
|
-
<path d="M856 404 V318 H1010 V404 Z" fill="${Gv(e.ink,t,.2)}"/>
|
|
414
|
-
<path d="M370 388 H1020 V404 H370 Z" fill="${e.ink}"/>
|
|
415
|
-
<path d="M420 322 H740 V388 H420 Z" fill="${Gv(e.ink,t,.35)}"/>
|
|
416
|
-
<path d="M420 338 H740" stroke="${r}" stroke-width="3" opacity=".7"/>
|
|
417
|
-
<path d="M420 322 Q382 324 382 355 Q382 386 420 388 Z" fill="${e.ink}"/>
|
|
418
|
-
<path d="M430 322 V276 H424 V264 H466 V276 H460 V322 Z" fill="${e.ink}"/>
|
|
419
|
-
<path d="M560 322 Q560 296 584 296 Q608 296 608 322 Z" fill="${r}"/>
|
|
420
|
-
<path d="M732 398 V270 H842 V398 Z" fill="${Gv(e.ink,t,.2)}"/>
|
|
421
|
-
<path d="M720 270 H854 V258 H720 Z" fill="${e.ink}"/>
|
|
422
|
-
<rect x="756" y="290" width="60" height="44" rx="4" fill="${Gv(e.soft,r,.25)}" opacity=".85"/>
|
|
423
|
-
<rect x="362" y="378" width="22" height="26" fill="${n}"/>
|
|
424
|
-
${s(452,30)}${c.map(e=>s(e,46)).join(``)}${s(900,26)}${s(970,26)}
|
|
425
|
-
<path d="M${Q(c[0]??0)} 402 H${Q(c[1]??0)}" stroke="${r}" stroke-width="8" stroke-linecap="round"/>
|
|
426
|
-
</g>
|
|
427
|
-
<g filter="url(#lazare-steam)"><g fill="${Gv(e.middle,e.ink,.2)}" opacity=".35">${u}</g>${l}</g>`)}function Qv(){let e=kv,[t,,,n]=e.notes,r=[{base:352,amp:46,f:.0042,phase:.6,fill:Gv(t,e.middle,.45)},{base:388,amp:52,f:.0055,phase:2.1,fill:e.middle},{base:428,amp:48,f:.0071,phase:4,fill:Gv(e.middle,e.ink,.55)},{base:486,amp:40,f:.0093,phase:1.2,fill:e.ink}];return Uv(`${Rv(`dusk-sky`,[[0,Gv(e.tone,t,.35)],[.36,Gv(t,n,.25)],[.56,n],[.68,Gv(n,e.soft,.6)]])}<radialGradient id="dusk-glow" cx="1140" cy="328" r="440" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="${e.soft}" stop-opacity=".85"/><stop offset=".25" stop-color="${n}" stop-opacity=".45"/><stop offset="1" stop-color="${n}" stop-opacity="0"/></radialGradient>${Hv(`dusk-mist`,14)}${Vv(`dusk-cut`,4,.03)}`,`<rect ${Pv} fill="url(#dusk-sky)"/><rect ${Pv} fill="url(#dusk-glow)"/>
|
|
428
|
-
<circle cx="1140" cy="328" r="66" fill="${e.soft}"/>
|
|
429
|
-
<g filter="url(#dusk-cut)">${r.map((t,n)=>`<path d="${Kv(t.base,t.amp,t.f,t.phase)}" fill="${t.fill}"/>${n<r.length-1?`<rect y="${String(t.base+4)}" width="${String(Mv)}" height="26" fill="${e.soft}" opacity=".16" filter="url(#dusk-mist)"/>`:``}`).join(``)}</g>`)}function $v(){let e=Ov,t=Iv(1833),n=[{base:330,amp:40,f:.0038,phase:1.4,fill:Gv(e.tone,e.middle,.35)},{base:372,amp:46,f:.0052,phase:3.3,fill:Gv(e.tone,e.middle,.8)},{base:418,amp:36,f:.0069,phase:.4,fill:Gv(e.middle,e.ink,.45)}],r=new Wv;for(let n=0;n<64;n++){let n=t(),i=468+n*124,a=t()<.7,o=a?640+(t()-.5)*(90+n*220):t()*Mv,s=(a?24:40)+t()*(a?70:90);r.add(a?e.soft:Gv(e.tone,e.soft,.5),`M${Fv(o-s/2)} ${Fv(i)}h${Fv(s)}`)}let i=``;for(let e=0;e<7;e++){let n=1060+e*52+(t()-.5)*16,r=214+Math.abs(e-2)*16+(t()-.5)*8,a=15-Math.abs(e-2)*1.2;i+=`M${Q(n-a)} ${Q(r-a*.3)}Q${Q(n-a*.45)} ${Q(r-a*.5)} ${Q(n)} ${Q(r)}Q${Q(n+a*.45)} ${Q(r-a*.5)} ${Q(n+a)} ${Q(r-a*.3)}`}return Uv(`${Rv(`lake-sky`,[[0,e.tone],[.55,Gv(e.tone,e.soft,.7)],[.74,e.soft]])}${Rv(`lake-water`,[[0,Gv(e.middle,e.ink,.35)],[1,e.ink]])}<radialGradient id="lake-glow" cx="640" cy="318" r="380" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="${e.soft}" stop-opacity=".95"/><stop offset=".3" stop-color="${Gv(e.soft,e.notes[3],.3)}" stop-opacity=".45"/><stop offset="1" stop-color="${e.soft}" stop-opacity="0"/></radialGradient>${Hv(`lake-mist`,16)}${Vv(`lake-cut`,4,.03)}`,`<rect ${Pv} fill="url(#lake-sky)"/><rect ${Pv} fill="url(#lake-glow)"/>
|
|
430
|
-
<g filter="url(#lake-cut)">${n.map(t=>`<path d="${Kv(t.base,t.amp,t.f,t.phase)}" fill="${t.fill}"/><rect y="${String(t.base+6)}" width="${String(Mv)}" height="24" fill="${e.soft}" opacity=".18" filter="url(#lake-mist)"/>`).join(``)}
|
|
431
|
-
<rect y="452" width="${String(Mv)}" height="148" fill="url(#lake-water)"/></g>
|
|
432
|
-
<g opacity=".5">${r.draw(3)}</g>
|
|
433
|
-
<path d="${i}" fill="none" stroke="${e.ink}" stroke-width="3.4" stroke-linecap="round" opacity=".8"/>`)}var ey={dots:qv,scales:Jv,bay:Yv,stacks:Xv,steam:Zv,dusk:Qv,lake:$v},ty=new Map;function ny(e){let t=ty.get(e);return t===void 0&&(t=ey[e](),ty.set(e,t)),t}function ry(e){return`cover-${e}.svg`}var iy={slash_menu:{heading:{title:`Heading 1`,subtext:`Top-level heading`,aliases:[`h`,`heading1`,`h1`],group:`Headings`},heading_2:{title:`Heading 2`,subtext:`Key section heading`,aliases:[`h2`,`heading2`,`subheading`],group:`Headings`},heading_3:{title:`Heading 3`,subtext:`Subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`],group:`Headings`},heading_4:{title:`Heading 4`,subtext:`Minor subsection heading`,aliases:[`h4`,`heading4`,`subheading4`],group:`Subheadings`},heading_5:{title:`Heading 5`,subtext:`Small subsection heading`,aliases:[`h5`,`heading5`,`subheading5`],group:`Subheadings`},heading_6:{title:`Heading 6`,subtext:`Lowest-level heading`,aliases:[`h6`,`heading6`,`subheading6`],group:`Subheadings`},toggle_heading:{title:`Toggle Heading 1`,subtext:`Toggleable top-level heading`,aliases:[`h`,`heading1`,`h1`,`collapsable`],group:`Subheadings`},toggle_heading_2:{title:`Toggle Heading 2`,subtext:`Toggleable key section heading`,aliases:[`h2`,`heading2`,`subheading`,`collapsable`],group:`Subheadings`},toggle_heading_3:{title:`Toggle Heading 3`,subtext:`Toggleable subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`,`collapsable`],group:`Subheadings`},quote:{title:`Quote`,subtext:`Quote or excerpt`,aliases:[`quotation`,`blockquote`,`bq`],group:`Basic blocks`},toggle_list:{title:`Toggle List`,subtext:`List with hideable sub-items`,aliases:[`li`,`list`,`toggleList`,`toggle list`,`collapsable list`],group:`Basic blocks`},numbered_list:{title:`Numbered List`,subtext:`List with ordered items`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`],group:`Basic blocks`},bullet_list:{title:`Bullet List`,subtext:`List with unordered items`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`],group:`Basic blocks`},check_list:{title:`Check List`,subtext:`List with checkboxes`,aliases:[`ul`,`li`,`list`,`checklist`,`check list`,`checked list`,`checkbox`],group:`Basic blocks`},paragraph:{title:`Paragraph`,subtext:`The body of your document`,aliases:[`p`,`paragraph`],group:`Basic blocks`},code_block:{title:`Code Block`,subtext:`Code block with syntax highlighting`,aliases:[`code`,`pre`],group:`Basic blocks`},page_break:{title:`Page Break`,subtext:`Page separator`,aliases:[`page`,`break`,`separator`],group:`Basic blocks`},table:{title:`Table`,subtext:`Table with editable cells`,aliases:[`table`],group:`Advanced`},image:{title:`Image`,subtext:`Resizable image with caption`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`],group:`Media`},video:{title:`Video`,subtext:`Resizable video with caption`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`],group:`Media`},audio:{title:`Audio`,subtext:`Embedded audio with caption`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`],group:`Media`},file:{title:`File`,subtext:`Embedded file`,aliases:[`file`,`upload`,`embed`,`media`,`url`],group:`Media`},emoji:{title:`Emoji`,subtext:`Search for and insert an emoji`,aliases:[`emoji`,`emote`,`emotion`,`face`],group:`Others`},divider:{title:`Divider`,subtext:`Visually divide blocks`,aliases:[`divider`,`hr`,`line`,`horizontal rule`],group:`Basic blocks`}},placeholders:{default:`Enter text or type '/' for commands`,heading:`Heading`,toggleListItem:`Toggle`,bulletListItem:`List`,numberedListItem:`List`,checkListItem:`List`,emptyDocument:void 0,new_comment:`Write a comment...`,edit_comment:`Edit comment...`,comment_reply:`Add comment...`},file_blocks:{add_button_text:{image:`Add image`,video:`Add video`,audio:`Add audio`,file:`Add file`}},toggle_blocks:{add_block_button:`Empty toggle. Click to add a block.`,toggle_button:`Expand or collapse`},code_block:{add_source_button_text:`Add source code`,ok_button_text:`OK`},side_menu:{add_block_label:`Add block`,drag_handle_label:`Open block menu`},drag_handle:{delete_menuitem:`Delete`,colors_menuitem:`Colors`,header_row_menuitem:`Header row`,header_column_menuitem:`Header column`},table_handle:{delete_column_menuitem:`Delete column`,delete_row_menuitem:`Delete row`,add_left_menuitem:`Add column left`,add_right_menuitem:`Add column right`,add_above_menuitem:`Add row above`,add_below_menuitem:`Add row below`,split_cell_menuitem:`Split cell`,merge_cells_menuitem:`Merge cells`,background_color_menuitem:`Background color`},suggestion_menu:{no_items_title:`No items found`},color_picker:{text_title:`Text`,background_title:`Background`,colors:{default:`Auto`,gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`}},formatting_toolbar:{bold:{tooltip:`Bold`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italic`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Underline`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Strike`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Colors`},link:{tooltip:`Create link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Edit caption`,input_placeholder:`Edit caption`},file_replace:{tooltip:{image:`Replace image`,video:`Replace video`,audio:`Replace audio`,file:`Replace file`}},file_rename:{tooltip:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`},input_placeholder:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`}},file_download:{tooltip:{image:`Download image`,video:`Download video`,audio:`Download audio`,file:`Download file`}},file_delete:{tooltip:{image:`Delete image`,video:`Delete video`,audio:`Delete audio`,file:`Delete file`}},file_preview_toggle:{tooltip:`Toggle preview`},nest:{tooltip:`Nest block`,secondary_tooltip:`Tab`},unnest:{tooltip:`Unnest block`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Align text left`},align_center:{tooltip:`Align text center`},align_right:{tooltip:`Align text right`},align_justify:{tooltip:`Justify text`},table_cell_merge:{tooltip:`Merge cells`},comment:{tooltip:`Add comment`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload image`,video:`Upload video`,audio:`Upload audio`,file:`Upload file`},upload_error:`Error: Upload failed`},embed:{title:`Embed`,embed_button:{image:`Embed image`,video:`Embed video`,audio:`Embed audio`,file:`Embed file`},url_placeholder:`Enter URL`}},link_toolbar:{delete:{tooltip:`Remove link`},edit:{text:`Edit link`,tooltip:`Edit`},open:{tooltip:`Open in new tab`},form:{title_placeholder:`Edit title`,url_placeholder:`Edit URL`}},comments:{edited:`edited`,save_button_text:`Save`,cancel_button_text:`Cancel`,deleted_reference_text:`Original content deleted`,discard_pending_comment:`Are you sure you want to discard this comment?`,actions:{add_reaction:`Add reaction`,resolve:`Resolve`,reopen:`Re-open`,edit_comment:`Edit comment`,delete_comment:`Delete comment`,more_actions:`More actions`},reactions:{reacted_by:`Reacted by`},sidebar:{marked_as_resolved:`Marked as resolved`,more_replies:e=>`${e} more replies`}},suggestion_changes:{formatting_change:`Formatting Change`,deleted:`Deleted`,inserted:`Inserted`,inserted_by:e=>`Inserted by: ${e}`,deleted_by:e=>`Deleted by: ${e}`,changed:`Changed`,changed_by:e=>`Changed by: ${e}`,formatting_change_by:(e,t)=>`Formatting change (${e}) by: ${t}`},versioning:{start_of_document:`Start of document`,compare_since_beginning_menuitem:`Compare since beginning`,title:`History`,close:`Close`,show_named_only:`Show named versions only`,show_all:`Show all versions`,comparison_on:`Turn on comparison`,comparison_off:`Turn off comparison`,versions_list:`Versions`,empty:`No versions yet`,empty_named_only:`No named versions`,current_version:`Current version`,before_restore:`Before restore`,comparing_to:`Comparing to`,restored_from:e=>`Restored from ${e}`,more_actions:`More actions`,version_name_input:`Version name`,name_version_menuitem:`Name this version`,rename_menuitem:`Rename`,compare_with_menuitem:`Compare with this version`,restore_menuitem:`Restore`,delete_menuitem:`Delete`,action_failed:`Something went wrong. Please try again.`,history_load_failed:`Failed to load version history`},exporter:{open_file:`Open file`,open_video_file:`Open video`,open_audio_file:`Open audio`},generic:{loading:`Loading...`,load_more:`Load more`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},ay={en:iy,"zh-cn":{slash_menu:{heading:{title:`一级标题`,subtext:`用于顶级标题`,aliases:[`h`,`heading1`,`h1`,`标题`,`一级标题`],group:`标题`},heading_2:{title:`二级标题`,subtext:`用于关键部分`,aliases:[`h2`,`heading2`,`subheading`,`标题`,`二级标题`,`副标题`],group:`标题`},heading_3:{title:`三级标题`,subtext:`用于小节和分组标题`,aliases:[`h3`,`heading3`,`subheading`,`标题`,`三级标题`],group:`标题`},heading_4:{title:`四级标题`,subtext:`用于较小的子节标题`,aliases:[`h4`,`heading4`,`subheading4`,`四级标题`],group:`副标题`},heading_5:{title:`五级标题`,subtext:`用于较小的子节标题`,aliases:[`h5`,`heading5`,`subheading5`,`五级标题`],group:`副标题`},heading_6:{title:`六级标题`,subtext:`用于最低层级的标题`,aliases:[`h6`,`heading6`,`subheading6`,`六级标题`],group:`副标题`},toggle_heading:{title:`可折叠一级标题`,subtext:`可折叠的顶级标题`,aliases:[`h`,`heading1`,`h1`,`标题`,`一级标题`,`折叠`],group:`副标题`},toggle_heading_2:{title:`可折叠二级标题`,subtext:`可折叠的关键部分标题`,aliases:[`h2`,`heading2`,`subheading`,`标题`,`二级标题`,`副标题`,`折叠`],group:`副标题`},toggle_heading_3:{title:`可折叠三级标题`,subtext:`可折叠的小节和分组标题`,aliases:[`h3`,`heading3`,`subheading`,`标题`,`三级标题`,`折叠`],group:`副标题`},quote:{title:`引用`,subtext:`引用或摘录`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本块`},numbered_list:{title:`有序列表`,subtext:`用于显示有序列表`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`,`列表`,`有序列表`],group:`基础`},bullet_list:{title:`无序列表`,subtext:`用于显示无序列表`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`,`列表`,`无序列表`],group:`基础`},check_list:{title:`检查清单`,subtext:`用于显示带有复选框的列表`,aliases:[`ul`,`li`,`checklist`,`checked list`,`列表`,`检查清单`,`勾选列表`,`复选框`],group:`基础`},toggle_list:{title:`可折叠列表`,subtext:`带有可隐藏子项的列表`,aliases:[`li`,`列表`,`可折叠列表`,`折叠列表`],group:`基础`},paragraph:{title:`段落`,subtext:`用于文档正文`,aliases:[`p`,`paragraph`,`text`,`正文`],group:`基础`},code_block:{title:`代码块`,subtext:`用于显示带有语法高亮的代码块`,aliases:[`code`,`pre`,`代码`,`预格式`],group:`基础`},page_break:{title:`分页符`,subtext:`页面分隔符`,aliases:[`page`,`break`,`separator`,`分页`,`分隔符`],group:`基础`},table:{title:`表格`,subtext:`使用表格`,aliases:[`table`,`表格`],group:`高级功能`},image:{title:`图片`,subtext:`插入图片`,aliases:[`图片`,`上传图片`,`上传`,`image`,`img`,`相册`,`媒体`,`url`],group:`媒体`},video:{title:`视频`,subtext:`插入视频`,aliases:[`视频`,`视频上传`,`上传`,`video`,`mp4`,`电影`,`媒体`,`url`,`驱动`,`dropbox`],group:`媒体`},audio:{title:`音频`,subtext:`插入音频`,aliases:[`音频`,`音频上传`,`上传`,`audio`,`mp3`,`声音`,`媒体`,`url`,`驱动`,`dropbox`],group:`媒体`},file:{title:`文件`,subtext:`插入文件`,aliases:[`文件`,`上传`,`file`,`嵌入`,`媒体`,`url`],group:`媒体`},emoji:{title:`表情符号`,subtext:`用于插入表情符号`,aliases:[`表情符号`,`emoji`,`face`,`emote`,`表情`,`表情表达`,`表情`],group:`其他`},divider:{title:`分隔线`,subtext:`分隔线区块`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基础区块`}},placeholders:{default:`输入 '/' 以使用命令`,heading:`标题`,toggleListItem:`切换`,bulletListItem:`列表`,numberedListItem:`列表`,checkListItem:`列表`,new_comment:`写评论...`,edit_comment:`编辑评论...`,comment_reply:`添加评论...`},file_blocks:{add_button_text:{image:`添加图片`,video:`添加视频`,audio:`添加音频`,file:`添加文件`}},toggle_blocks:{add_block_button:`空的切换区。点击添加区块。`,toggle_button:`展开或收起`},code_block:{add_source_button_text:`添加源代码`,ok_button_text:`确定`},side_menu:{add_block_label:`添加块`,drag_handle_label:`打开菜单`},drag_handle:{delete_menuitem:`删除`,colors_menuitem:`颜色`,header_row_menuitem:`行标题`,header_column_menuitem:`列标题`},table_handle:{delete_column_menuitem:`删除列`,delete_row_menuitem:`删除行`,add_left_menuitem:`左侧添加列`,add_right_menuitem:`右侧添加列`,add_above_menuitem:`上方添加行`,add_below_menuitem:`下方添加行`,split_cell_menuitem:`拆分单元格`,merge_cells_menuitem:`合并单元格`,background_color_menuitem:`背景色`},suggestion_menu:{no_items_title:`无匹配项`},color_picker:{text_title:`文本`,background_title:`背景色`,colors:{default:`自动`,gray:`灰色`,brown:`棕色`,red:`红色`,orange:`橙色`,yellow:`黄色`,green:`绿色`,blue:`蓝色`,purple:`紫色`,pink:`粉色`}},formatting_toolbar:{bold:{tooltip:`加粗`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜体`,secondary_tooltip:`Mod+I`},underline:{tooltip:`下划线`,secondary_tooltip:`Mod+U`},strike:{tooltip:`删除线`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`代码标记`,secondary_tooltip:``},colors:{tooltip:`颜色`},link:{tooltip:`添加链接`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`编辑标题`,input_placeholder:`编辑标题`},file_replace:{tooltip:{image:`替换图片`,video:`替换视频`,audio:`替换音频`,file:`替换文件`}},file_rename:{tooltip:{image:`重命名图片`,video:`重命名视频`,audio:`重命名音频`,file:`重命名文件`},input_placeholder:{image:`重命名图片`,video:`重命名视频`,audio:`重命名音频`,file:`重命名文件`}},file_download:{tooltip:{image:`下载图片`,video:`下载视频`,audio:`下载音频`,file:`下载文件`}},file_delete:{tooltip:{image:`删除图片`,video:`删除视频`,audio:`删除音频`,file:`删除文件`}},file_preview_toggle:{tooltip:`切换预览`},nest:{tooltip:`嵌套`,secondary_tooltip:`Tab`},unnest:{tooltip:`取消嵌套`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`左对齐`},align_center:{tooltip:`居中`},align_right:{tooltip:`右对齐`},align_justify:{tooltip:`文本对齐`},table_cell_merge:{tooltip:`合并单元格`},comment:{tooltip:`添加评论`}},file_panel:{upload:{title:`上传`,file_placeholder:{image:`上传图片`,video:`上传视频`,audio:`上传音频`,file:`上传文件`},upload_error:`Error:上传失败`},embed:{title:`嵌入`,embed_button:{image:`嵌入图片`,video:`嵌入视频`,audio:`嵌入音频`,file:`嵌入文件`},url_placeholder:`输入图片地址`}},link_toolbar:{delete:{tooltip:`清除链接`},edit:{text:`编辑链接`,tooltip:`编辑`},open:{tooltip:`新窗口打开`},form:{title_placeholder:`编辑标题`,url_placeholder:`编辑链接地址`}},comments:{edited:`已编辑`,save_button_text:`保存`,cancel_button_text:`取消`,deleted_reference_text:`原始内容已删除`,discard_pending_comment:`确定要放弃此评论吗?`,actions:{add_reaction:`添加反应`,resolve:`解决`,reopen:`重新打开`,edit_comment:`编辑评论`,delete_comment:`删除评论`,more_actions:`更多操作`},reactions:{reacted_by:`已回应`},sidebar:{marked_as_resolved:`标记为已解决`,more_replies:e=>`还有 ${e} 条回复`}},suggestion_changes:{formatting_change:`格式更改`,deleted:`已删除`,inserted:`已插入`,inserted_by:e=>`插入者:${e}`,deleted_by:e=>`删除者:${e}`,changed:`已更改`,changed_by:e=>`更改者:${e}`,formatting_change_by:(e,t)=>`格式更改(${e}),更改者:${t}`},versioning:{start_of_document:`文档开始`,compare_since_beginning_menuitem:`从头开始比较`,title:`历史记录`,close:`关闭`,show_named_only:`仅显示已命名的版本`,show_all:`显示所有版本`,comparison_on:`开启对比`,comparison_off:`关闭对比`,versions_list:`版本`,empty:`暂无版本`,empty_named_only:`暂无命名版本`,current_version:`当前版本`,before_restore:`恢复前`,comparing_to:`对比对象`,restored_from:e=>`恢复自 ${e}`,more_actions:`更多操作`,version_name_input:`版本名称`,name_version_menuitem:`命名此版本`,rename_menuitem:`重命名`,compare_with_menuitem:`与此版本对比`,restore_menuitem:`恢复`,delete_menuitem:`删除`,action_failed:`出错了,请重试。`,history_load_failed:`无法加载版本历史记录`},exporter:{open_file:`打开文件`,open_video_file:`打开视频`,open_audio_file:`打开音频`},generic:{loading:`加载中...`,load_more:`加载更多`,ctrl_shortcut:`Ctrl`,form_submit:`确定`}},"zh-tw":{slash_menu:{heading:{title:`一級標題`,subtext:`用於頂級標題`,aliases:[`h`,`heading1`,`h1`,`標題`,`一級標題`],group:`標題`},heading_2:{title:`二級標題`,subtext:`用於關鍵部分`,aliases:[`h2`,`heading2`,`subheading`,`標題`,`二級標題`,`副標題`],group:`標題`},heading_3:{title:`三級標題`,subtext:`用於小節和分組標題`,aliases:[`h3`,`heading3`,`subheading`,`標題`,`三級標題`],group:`標題`},heading_4:{title:`四級標題`,subtext:`用於小節和分組標題`,aliases:[`h4`,`heading4`,`subheading`,`標題`,`四級標題`],group:`副標題`},heading_5:{title:`五級標題`,subtext:`用於小節和分組標題`,aliases:[`h5`,`heading5`,`subheading`,`標題`,`五級標題`],group:`副標題`},heading_6:{title:`六級標題`,subtext:`用於小節和分組標題`,aliases:[`h6`,`heading6`,`subheading`,`標題`,`六級標題`],group:`副標題`},toggle_heading:{title:`可摺疊一級標題`,subtext:`可摺疊的頂級標題`,aliases:[`h`,`heading1`,`h1`,`標題`,`一級標題`,`摺疊`],group:`副標題`},toggle_heading_2:{title:`可摺疊二級標題`,subtext:`可摺疊的關鍵部分標題`,aliases:[`h2`,`heading2`,`subheading`,`標題`,`二級標題`,`副標題`,`摺疊`],group:`副標題`},toggle_heading_3:{title:`可摺疊三級標題`,subtext:`可摺疊的小節和分組標題`,aliases:[`h3`,`heading3`,`subheading`,`標題`,`三級標題`,`摺疊`],group:`副標題`},quote:{title:`引用`,subtext:`引用或摘錄`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本區塊`},numbered_list:{title:`有序列表`,subtext:`用於顯示有序列表`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`,`列表`,`有序列表`],group:`基礎`},bullet_list:{title:`無序列表`,subtext:`用於顯示無序列表`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`,`列表`,`無序列表`],group:`基礎`},check_list:{title:`檢查清單`,subtext:`用於顯示帶有核取方塊的列表`,aliases:[`ul`,`li`,`checklist`,`checked list`,`列表`,`檢查清單`,`勾選列表`,`核取方塊`],group:`基礎`},toggle_list:{title:`可摺疊列表`,subtext:`帶有可隱藏子項的列表`,aliases:[`li`,`列表`,`可摺疊列表`,`摺疊列表`],group:`基礎`},paragraph:{title:`段落`,subtext:`用於文件正文`,aliases:[`p`,`paragraph`,`text`,`正文`],group:`基礎`},code_block:{title:`程式碼區塊`,subtext:`用於顯示帶有語法標記的程式碼區塊`,aliases:[`code`,`pre`,`程式碼`,`預格式`],group:`基礎`},page_break:{title:`分頁符`,subtext:`頁面分隔符`,aliases:[`page`,`break`,`separator`,`分頁`,`分隔符`],group:`基礎`},table:{title:`表格`,subtext:`使用表格`,aliases:[`table`,`表格`],group:`進階功能`},image:{title:`圖片`,subtext:`插入圖片`,aliases:[`圖片`,`上傳圖片`,`上傳`,`image`,`img`,`相簿`,`媒體`,`url`],group:`媒體`},video:{title:`影片`,subtext:`插入影片`,aliases:[`影片`,`影片上傳`,`上傳`,`video`,`mp4`,`電影`,`媒體`,`url`,`雲端硬碟`,`dropbox`],group:`媒體`},audio:{title:`音訊`,subtext:`插入音訊`,aliases:[`音訊`,`音訊上傳`,`上傳`,`audio`,`mp3`,`聲音`,`媒體`,`url`,`雲端硬碟`,`dropbox`],group:`媒體`},file:{title:`檔案`,subtext:`插入檔案`,aliases:[`檔案`,`上傳`,`file`,`嵌入`,`媒體`,`url`],group:`媒體`},emoji:{title:`表情符號`,subtext:`用於插入表情符號`,aliases:[`表情符號`,`emoji`,`face`,`emote`,`表情`,`表情表達`,`表情`],group:`其他`},divider:{title:`分隔線`,subtext:`分隔線區塊`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基礎區塊`}},placeholders:{default:`輸入 '/' 以使用指令`,heading:`標題`,toggleListItem:`切換`,bulletListItem:`列表`,numberedListItem:`列表`,checkListItem:`列表`,new_comment:`撰寫評論...`,edit_comment:`編輯評論...`,comment_reply:`新增評論...`},file_blocks:{add_button_text:{image:`新增圖片`,video:`新增影片`,audio:`新增音訊`,file:`新增檔案`}},toggle_blocks:{add_block_button:`空的切換區。點擊新增區塊。`,toggle_button:`展開或收合`},code_block:{add_source_button_text:`新增原始碼`,ok_button_text:`確定`},side_menu:{add_block_label:`新增區塊`,drag_handle_label:`開啟選單`},drag_handle:{delete_menuitem:`刪除`,colors_menuitem:`顏色`,header_row_menuitem:`列標題`,header_column_menuitem:`欄標題`},table_handle:{delete_column_menuitem:`刪除欄`,delete_row_menuitem:`刪除列`,add_left_menuitem:`左側新增欄`,add_right_menuitem:`右側新增欄`,add_above_menuitem:`上方新增列`,add_below_menuitem:`下方新增列`,split_cell_menuitem:`分割儲存格`,merge_cells_menuitem:`合併儲存格`,background_color_menuitem:`背景色`},suggestion_menu:{no_items_title:`無相符項目`},color_picker:{text_title:`文字`,background_title:`背景色`,colors:{default:`自動`,gray:`灰色`,brown:`棕色`,red:`紅色`,orange:`橙色`,yellow:`黃色`,green:`綠色`,blue:`藍色`,purple:`紫色`,pink:`粉色`}},formatting_toolbar:{bold:{tooltip:`粗體`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜體`,secondary_tooltip:`Mod+I`},underline:{tooltip:`底線`,secondary_tooltip:`Mod+U`},strike:{tooltip:`刪除線`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`程式碼標記`,secondary_tooltip:``},colors:{tooltip:`顏色`},link:{tooltip:`新增連結`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`編輯標題`,input_placeholder:`編輯標題`},file_replace:{tooltip:{image:`替換圖片`,video:`替換影片`,audio:`替換音訊`,file:`替換檔案`}},file_rename:{tooltip:{image:`重新命名圖片`,video:`重新命名影片`,audio:`重新命名音訊`,file:`重新命名檔案`},input_placeholder:{image:`重新命名圖片`,video:`重新命名影片`,audio:`重新命名音訊`,file:`重新命名檔案`}},file_download:{tooltip:{image:`下載圖片`,video:`下載影片`,audio:`下載音訊`,file:`下載檔案`}},file_delete:{tooltip:{image:`刪除圖片`,video:`刪除影片`,audio:`刪除音訊`,file:`刪除檔案`}},file_preview_toggle:{tooltip:`切換預覽`},nest:{tooltip:`巢狀`,secondary_tooltip:`Tab`},unnest:{tooltip:`取消巢狀`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`靠左對齊`},align_center:{tooltip:`置中`},align_right:{tooltip:`靠右對齊`},align_justify:{tooltip:`兩端對齊`},table_cell_merge:{tooltip:`合併儲存格`},comment:{tooltip:`新增評論`}},file_panel:{upload:{title:`上傳`,file_placeholder:{image:`上傳圖片`,video:`上傳影片`,audio:`上傳音訊`,file:`上傳檔案`},upload_error:`錯誤:上傳失敗`},embed:{title:`嵌入`,embed_button:{image:`嵌入圖片`,video:`嵌入影片`,audio:`嵌入音訊`,file:`嵌入檔案`},url_placeholder:`輸入圖片網址`}},link_toolbar:{delete:{tooltip:`清除連結`},edit:{text:`編輯連結`,tooltip:`編輯`},open:{tooltip:`在新視窗開啟`},form:{title_placeholder:`編輯標題`,url_placeholder:`編輯連結網址`}},comments:{edited:`已編輯`,save_button_text:`儲存`,cancel_button_text:`取消`,deleted_reference_text:`原始內容已刪除`,discard_pending_comment:`確定要捨棄此評論嗎?`,actions:{add_reaction:`新增回應`,resolve:`解決`,reopen:`重新開啟`,edit_comment:`編輯評論`,delete_comment:`刪除評論`,more_actions:`更多操作`},reactions:{reacted_by:`已回應`},sidebar:{marked_as_resolved:`標記為已解決`,more_replies:e=>`還有 ${e} 則回覆`}},suggestion_changes:{formatting_change:`格式變更`,deleted:`已刪除`,inserted:`已插入`,inserted_by:e=>`插入者:${e}`,deleted_by:e=>`刪除者:${e}`,changed:`已變更`,changed_by:e=>`變更者:${e}`,formatting_change_by:(e,t)=>`格式變更(${e}),變更者:${t}`},versioning:{start_of_document:`文件開始`,compare_since_beginning_menuitem:`從頭開始比較`,title:`版本紀錄`,close:`關閉`,show_named_only:`僅顯示已命名的版本`,show_all:`顯示所有版本`,comparison_on:`開啟比較`,comparison_off:`關閉比較`,versions_list:`版本`,empty:`尚無版本`,empty_named_only:`尚無命名版本`,current_version:`目前版本`,before_restore:`還原前`,comparing_to:`比較對象`,restored_from:e=>`已從 ${e} 還原`,more_actions:`更多操作`,version_name_input:`版本名稱`,name_version_menuitem:`為此版本命名`,rename_menuitem:`重新命名`,compare_with_menuitem:`與此版本比較`,restore_menuitem:`還原`,delete_menuitem:`刪除`,action_failed:`發生錯誤,請再試一次。`,history_load_failed:`無法載入版本歷史記錄`},exporter:{open_file:`開啟檔案`,open_video_file:`開啟影片`,open_audio_file:`開啟音訊`},generic:{loading:`載入中...`,load_more:`載入更多`,ctrl_shortcut:`Ctrl`,form_submit:`確定`}},ja:{slash_menu:{heading:{title:`見出し1`,subtext:`トップレベルの見出しに使用`,aliases:[`h`,`見出し1`,`h1`,`大見出し`],group:`見出し`},heading_2:{title:`見出し2`,subtext:`重要なセクションに使用`,aliases:[`h2`,`見出し2`,`subheading`,`中見出し`],group:`見出し`},heading_3:{title:`見出し3`,subtext:`セクションやグループの見出しに使用`,aliases:[`h3`,`見出し3`,`subheading`,`小見出し`],group:`見出し`},heading_4:{title:`見出し4`,subtext:`小さなサブセクションの見出しに使用`,aliases:[`h4`,`見出し4`,`subheading4`,`小見出し4`],group:`サブ見出し`},heading_5:{title:`見出し5`,subtext:`小さなサブセクションの見出しに使用`,aliases:[`h5`,`見出し5`,`subheading5`,`小見出し5`],group:`サブ見出し`},heading_6:{title:`見出し6`,subtext:`最下位レベルの見出しに使用`,aliases:[`h6`,`見出し6`,`subheading6`,`小見出し6`],group:`サブ見出し`},toggle_heading:{title:`折りたたみ見出し1`,subtext:`内容の表示/非表示が切り替え可能なトップレベルの見出し`,aliases:[`h`,`見出し1`,`h1`,`大見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},toggle_heading_2:{title:`折りたたみ見出し2`,subtext:`内容の表示/非表示が切り替え可能な重要なセクションの見出し`,aliases:[`h2`,`見出し2`,`subheading`,`中見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},toggle_heading_3:{title:`折りたたみ見出し3`,subtext:`内容の表示/非表示が切り替え可能なセクションやグループの見出し`,aliases:[`h3`,`見出し3`,`subheading`,`小見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},quote:{title:`引用`,subtext:`引用または抜粋`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本ブロック`},numbered_list:{title:`番号付リスト`,subtext:`番号付リストを表示するために使用`,aliases:[`ol`,`li`,`numberedlist`,`numbered list`,`リスト`,`番号付リスト`,`番号 リスト`],group:`基本ブロック`},bullet_list:{title:`箇条書き`,subtext:`箇条書きを表示するために使用`,aliases:[`ul`,`li`,`bulletlist`,`bullet list`,`リスト`,`箇条書きリスト`],group:`基本ブロック`},check_list:{title:`チェックリスト`,subtext:`チェックボックス付きリストを表示するために使用されます`,aliases:[`ul`,`li`,`list`,`checklist`,`checked list`,`リスト`,`チェックリスト`,`チェックされたリスト`],group:`基本ブロック`},toggle_list:{title:`折りたたみリスト`,subtext:`サブ項目を非表示にできるリスト`,aliases:[`li`,`リスト`,`折りたたみリスト`,`トグルリスト`,`折りたたみリスト`],group:`基本ブロック`},paragraph:{title:`標準テキスト`,subtext:`本文に使用`,aliases:[`p`,`paragraph`,`標準テキスト`],group:`基本ブロック`},code_block:{title:`コードブロック`,subtext:`シンタックスハイライト付きのコードブロック`,aliases:[`code`,`pre`,`コード`,`コードブロック`],group:`基本ブロック`},page_break:{title:`改ページ`,subtext:`ページ区切り`,aliases:[`page`,`break`,`separator`,`改ページ`,`区切り`],group:`基本ブロック`},table:{title:`表`,subtext:`表に使用`,aliases:[`table`,`表`,`テーブル`],group:`高度なブロック`},image:{title:`画像`,subtext:`画像を挿入`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`,`画像`],group:`メディア`},video:{title:`ビデオ`,subtext:`ビデオを挿入`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`,`ビデオ`],group:`メディア`},audio:{title:`オーディオ`,subtext:`オーディオを挿入`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`,`オーディオ`],group:`メディア`},file:{title:`ファイル`,subtext:`ファイルを挿入`,aliases:[`file`,`upload`,`embed`,`media`,`url`,`ファイル`],group:`メディア`},emoji:{title:`絵文字`,subtext:`絵文字を挿入するために使用します`,aliases:[`絵文字`,`顔文字`,`感情表現`,`顔`],group:`その他`},divider:{title:`区切り`,subtext:`区切りを表示するために使用`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基本ブロック`}},placeholders:{default:`テキストを入力するか'/' を入力してコマンド選択`,heading:`見出し`,toggleListItem:`トグル`,bulletListItem:`リストを追加`,numberedListItem:`リストを追加`,checkListItem:`リストを追加`,new_comment:`コメントを書く...`,edit_comment:`コメントを編集...`,comment_reply:`コメントを追加...`},file_blocks:{add_button_text:{image:`画像を追加`,video:`ビデオを追加`,audio:`オーディオを追加`,file:`ファイルを追加`}},toggle_blocks:{add_block_button:`空のトグルです。クリックしてブロックを追加。`,toggle_button:`展開または折りたたみ`},code_block:{add_source_button_text:`ソースコードを追加`,ok_button_text:`OK`},side_menu:{add_block_label:`ブロックを追加`,drag_handle_label:`ブロックメニュー`},drag_handle:{delete_menuitem:`削除`,colors_menuitem:`色を変更`,header_row_menuitem:`行の見出し`,header_column_menuitem:`列の見出し`},table_handle:{delete_column_menuitem:`列を削除`,delete_row_menuitem:`行を削除`,add_left_menuitem:`左に列を追加`,add_right_menuitem:`右に列を追加`,add_above_menuitem:`上に行を追加`,add_below_menuitem:`下に行を追加`,split_cell_menuitem:`セルを分割`,merge_cells_menuitem:`セルを結合`,background_color_menuitem:`背景色を変更`},suggestion_menu:{no_items_title:`アイテムが見つかりません`},color_picker:{text_title:`文字色`,background_title:`背景色`,colors:{default:`自動`,gray:`グレー`,brown:`茶色`,red:`赤`,orange:`オレンジ`,yellow:`黄色`,green:`緑`,blue:`青`,purple:`紫`,pink:`ピンク`}},formatting_toolbar:{bold:{tooltip:`太字`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜体`,secondary_tooltip:`Mod+I`},underline:{tooltip:`下線`,secondary_tooltip:`Mod+U`},strike:{tooltip:`打ち消し`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`コード`,secondary_tooltip:``},colors:{tooltip:`色`},link:{tooltip:`リンク`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`キャプションを編集`,input_placeholder:`キャプションを編集`},file_replace:{tooltip:{image:`画像を置換`,video:`ビデオを置換`,audio:`オーディオを置換`,file:`ファイルを置換`}},file_rename:{tooltip:{image:`画像の名前を変更`,video:`ビデオの名前を変更`,audio:`オーディオの名前を変更`,file:`ファイルの名前を変更`},input_placeholder:{image:`画像の名前を変更`,video:`ビデオの名前を変更`,audio:`オーディオの名前を変更`,file:`ファイルの名前を変更`}},file_download:{tooltip:{image:`画像をダウンロード`,video:`ビデオをダウンロード`,audio:`オーディオをダウンロード`,file:`ファイルをダウンロード`}},file_delete:{tooltip:{image:`画像を削除`,video:`ビデオを削除`,audio:`オーディオを削除`,file:`ファイルを削除`}},file_preview_toggle:{tooltip:`プレビューの切り替え`},nest:{tooltip:`インデント増`,secondary_tooltip:`Tab`},unnest:{tooltip:`インデント減`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`左揃え`},align_center:{tooltip:`中央揃え`},align_right:{tooltip:`右揃え`},align_justify:{tooltip:`両端揃え`},table_cell_merge:{tooltip:`セルを結合`},comment:{tooltip:`コメントを追加`}},file_panel:{upload:{title:`アップロード`,file_placeholder:{image:`画像をアップロード`,video:`ビデオをアップロード`,audio:`オーディオをアップロード`,file:`ファイルをアップロード`},upload_error:`エラー: アップロードが失敗しました`},embed:{title:`埋め込み`,embed_button:{image:`画像を埋め込む`,video:`ビデオを埋め込む`,audio:`オーディオを埋め込む`,file:`ファイルを埋め込む`},url_placeholder:`URLを入力`}},link_toolbar:{delete:{tooltip:`リンクを解除`},edit:{text:`リンクを編集`,tooltip:`編集`},open:{tooltip:`新しいタブでリンクを開く`},form:{title_placeholder:`タイトルを編集`,url_placeholder:`URLを編集`}},comments:{edited:`編集済み`,save_button_text:`保存`,cancel_button_text:`キャンセル`,deleted_reference_text:`元のコンテンツが削除されました`,discard_pending_comment:`このコメントを破棄してもよろしいですか?`,actions:{add_reaction:`リアクションを追加`,resolve:`解決`,reopen:`再開`,edit_comment:`コメントを編集`,delete_comment:`コメントを削除`,more_actions:`その他の操作`},reactions:{reacted_by:`リアクションした人`},sidebar:{marked_as_resolved:`解決済みとしてマーク`,more_replies:e=>`${e} 件の追加返信`}},suggestion_changes:{formatting_change:`書式の変更`,deleted:`削除済み`,inserted:`挿入済み`,inserted_by:e=>`挿入者: ${e}`,deleted_by:e=>`削除者: ${e}`,changed:`変更済み`,changed_by:e=>`変更者: ${e}`,formatting_change_by:(e,t)=>`書式の変更 (${e}) 変更者: ${t}`},versioning:{start_of_document:`ドキュメントの開始`,compare_since_beginning_menuitem:`最初から比較`,title:`履歴`,close:`閉じる`,show_named_only:`名前付きバージョンのみ表示`,show_all:`すべてのバージョンを表示`,comparison_on:`比較を有効にする`,comparison_off:`比較を無効にする`,versions_list:`バージョン`,empty:`バージョンはまだありません`,empty_named_only:`名前付きのバージョンはありません`,current_version:`現在のバージョン`,before_restore:`復元前`,comparing_to:`比較対象`,restored_from:e=>`${e} から復元`,more_actions:`その他の操作`,version_name_input:`バージョン名`,name_version_menuitem:`このバージョンに名前を付ける`,rename_menuitem:`名前を変更`,compare_with_menuitem:`このバージョンと比較`,restore_menuitem:`復元`,delete_menuitem:`削除`,action_failed:`問題が発生しました。もう一度お試しください。`,history_load_failed:`バージョン履歴を読み込めませんでした`},exporter:{open_file:`ファイルを開く`,open_video_file:`動画を開く`,open_audio_file:`音声を開く`},generic:{loading:`読み込み中...`,load_more:`さらに読み込む`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},ko:{slash_menu:{heading:{title:`제목1`,subtext:`섹션 제목(대)`,aliases:[`h`,`제목1`,`h1`,`대제목`],group:`제목`},heading_2:{title:`제목2`,subtext:`섹션 제목(중)`,aliases:[`h2`,`제목2`,`중제목`],group:`제목`},heading_3:{title:`제목3`,subtext:`섹션 제목(소)`,aliases:[`h3`,`제목3`,`subheading`],group:`제목`},heading_4:{title:`제목4`,subtext:`하위 소단락 제목`,aliases:[`h4`,`제목4`,`소제목4`],group:`소제목`},heading_5:{title:`제목5`,subtext:`작은 하위 섹션 제목`,aliases:[`h5`,`제목5`,`소제목5`],group:`소제목`},heading_6:{title:`제목6`,subtext:`가장 하위 수준 제목`,aliases:[`h6`,`제목6`,`소제목6`],group:`소제목`},toggle_heading:{title:`접을 수 있는 제목1`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(대)`,aliases:[`h`,`제목1`,`h1`,`대제목`,`접기`,`토글`],group:`소제목`},toggle_heading_2:{title:`접을 수 있는 제목2`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(중)`,aliases:[`h2`,`제목2`,`중제목`,`접기`,`토글`],group:`소제목`},toggle_heading_3:{title:`접을 수 있는 제목3`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(소)`,aliases:[`h3`,`제목3`,`subheading`,`접기`,`토글`],group:`소제목`},quote:{title:`인용`,subtext:`인용문 또는 발췌`,aliases:[`quotation`,`blockquote`,`bq`],group:`기본 블록`},numbered_list:{title:`번호 매기기 목록`,subtext:`번호가 매겨진 목록을 추가합니다.`,aliases:[`ol`,`li`,`목록`,`번호 매기기 목록`,`번호 목록`],group:`기본 블록`},bullet_list:{title:`글머리 기호 목록`,subtext:`간단한 글머리 기호를 추가합니다.`,aliases:[`ul`,`li`,`목록`,`글머리 기호 목록`,`글머리 목록`],group:`기본 블록`},check_list:{title:`체크리스트`,subtext:`체크박스가 있는 목록을 표시하는 데 사용`,aliases:[`ul`,`li`,`목록`,`체크리스트`,`체크 리스트`,`체크된 목록`,`체크박스`],group:`기본 블록`},toggle_list:{title:`접을 수 있는 목록`,subtext:`숨길 수 있는 하위 항목이 있는 목록`,aliases:[`li`,`목록`,`접을 수 있는 목록`,`토글 목록`,`접기 목록`],group:`기본 블록`},paragraph:{title:`본문`,subtext:`일반 텍스트`,aliases:[`p`,`paragraph`,`본문`],group:`기본 블록`},code_block:{title:`코드 블록`,subtext:`구문 강조가 있는 코드 블록`,aliases:[`code`,`pre`],group:`기본 블록`},page_break:{title:`페이지 나누기`,subtext:`페이지 구분자`,aliases:[`page`,`break`,`separator`,`페이지`,`구분자`],group:`기본 블록`},table:{title:`표`,subtext:`간단한 표를 추가합니다.`,aliases:[`표`],group:`고급`},image:{title:`이미지`,subtext:`이미지 파일을 업로드합니다.`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`이미지`,`url`],group:`미디어`},video:{title:`비디오`,subtext:`비디오 삽입`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`동영상`,`url`],group:`미디어`},audio:{title:`오디오`,subtext:`오디오 삽입`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`오디오`,`url`],group:`미디어`},file:{title:`파일`,subtext:`파일 삽입`,aliases:[`file`,`upload`,`embed`,`media`,`파일`,`url`],group:`미디어`},emoji:{title:`이모지`,subtext:`이모지 삽입용으로 사용됩니다`,aliases:[`이모지`,`emoji`,`감정 표현`,`emotion expression`,`표정`,`face expression`,`얼굴`,`face`],group:`기타`},divider:{title:`구분선`,subtext:`구분선 블록`,aliases:[`divider`,`hr`,`horizontal rule`],group:`기본 블록`}},placeholders:{default:`텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.`,heading:`제목`,toggleListItem:`토글`,bulletListItem:`목록`,numberedListItem:`목록`,checkListItem:`목록`,new_comment:`댓글 작성...`,edit_comment:`댓글 수정...`,comment_reply:`댓글 추가...`},file_blocks:{add_button_text:{image:`이미지 추가`,video:`비디오 추가`,audio:`오디오 추가`,file:`파일 추가`}},toggle_blocks:{add_block_button:`비어 있는 토글입니다. 클릭하여 블록을 추가하세요.`,toggle_button:`펼치기 또는 접기`},code_block:{add_source_button_text:`소스 코드 추가`,ok_button_text:`확인`},side_menu:{add_block_label:`블록 추가`,drag_handle_label:`블록 메뉴 열기`},drag_handle:{delete_menuitem:`삭제`,colors_menuitem:`색깔`,header_row_menuitem:`행 제목`,header_column_menuitem:`열 제목`},table_handle:{delete_column_menuitem:`열 1개 삭제`,delete_row_menuitem:`행 삭제`,add_left_menuitem:`왼쪽에 열 1개 추가`,add_right_menuitem:`오른쪽에 열 1개 추가`,add_above_menuitem:`위에 행 1개 추가`,add_below_menuitem:`아래에 행 1개 추가`,split_cell_menuitem:`셀 분할`,merge_cells_menuitem:`셀 병합`,background_color_menuitem:`배경색 변경`},suggestion_menu:{no_items_title:`항목을 찾을 수 없음`},color_picker:{text_title:`텍스트`,background_title:`배경`,colors:{default:`자동`,gray:`회색`,brown:`갈색`,red:`빨간색`,orange:`주황색`,yellow:`노란색`,green:`녹색`,blue:`파란색`,purple:`보라색`,pink:`분홍색`}},formatting_toolbar:{bold:{tooltip:`진하게`,secondary_tooltip:`Mod+B`},italic:{tooltip:`기울임`,secondary_tooltip:`Mod+I`},underline:{tooltip:`밑줄`,secondary_tooltip:`Mod+U`},strike:{tooltip:`취소선`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`코드`,secondary_tooltip:``},colors:{tooltip:`색깔`},link:{tooltip:`링크 만들기`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`이미지 캡션 수정`,input_placeholder:`이미지 캡션 수정`},file_replace:{tooltip:{image:`이미지 교체`,video:`비디오 교체`,audio:`오디오 교체`,file:`파일 교체`}},file_rename:{tooltip:{image:`이미지 이름 변경`,video:`비디오 이름 변경`,audio:`오디오 이름 변경`,file:`파일 이름 변경`},input_placeholder:{image:`이미지 이름 변경`,video:`비디오 이름 변경`,audio:`오디오 이름 변경`,file:`파일 이름 변경`}},file_download:{tooltip:{image:`이미지 다운로드`,video:`비디오 다운로드`,audio:`오디오 다운로드`,file:`파일 다운로드`}},file_delete:{tooltip:{image:`이미지 삭제`,video:`비디오 삭제`,audio:`오디오 삭제`,file:`파일 삭제`}},file_preview_toggle:{tooltip:`미리보기 전환`},nest:{tooltip:`중첩 블록`,secondary_tooltip:`Tab`},unnest:{tooltip:`비중첩 블록`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`텍스트 왼쪽 맞춤`},align_center:{tooltip:`텍스트 가운데 맞춤`},align_right:{tooltip:`텍스트 오른쪽 맞춤`},align_justify:{tooltip:`텍스트 양쪽 맞춤`},table_cell_merge:{tooltip:`셀 병합`},comment:{tooltip:`코멘트 추가`}},file_panel:{upload:{title:`업로드`,file_placeholder:{image:`이미지 업로드`,video:`비디오 업로드`,audio:`오디오 업로드`,file:`파일 업로드`},upload_error:`오류: 업로드 실패`},embed:{title:`임베드`,embed_button:{image:`이미지 삽입`,video:`비디오 삽입`,audio:`오디오 삽입`,file:`파일 삽입`},url_placeholder:`URL을 입력하세요.`}},link_toolbar:{delete:{tooltip:`링크 삭제`},edit:{text:`링크 수정`,tooltip:`수정`},open:{tooltip:`새 탭으로 열기`},form:{title_placeholder:`제목 수정`,url_placeholder:`URL 수정`}},comments:{edited:`수정됨`,save_button_text:`저장`,cancel_button_text:`취소`,deleted_reference_text:`원본 콘텐츠 삭제됨`,discard_pending_comment:`이 댓글을 삭제하시겠습니까?`,actions:{add_reaction:`반응 추가`,resolve:`해결`,reopen:`다시 열기`,edit_comment:`댓글 수정`,delete_comment:`댓글 삭제`,more_actions:`더 많은 작업`},reactions:{reacted_by:`반응한 사람`},sidebar:{marked_as_resolved:`해결됨으로 표시됨`,more_replies:e=>`${e}개의 추가 답글`}},suggestion_changes:{formatting_change:`서식 변경`,deleted:`삭제됨`,inserted:`삽입됨`,inserted_by:e=>`삽입한 사람: ${e}`,deleted_by:e=>`삭제한 사람: ${e}`,changed:`변경됨`,changed_by:e=>`변경한 사람: ${e}`,formatting_change_by:(e,t)=>`서식 변경 (${e}) 변경한 사람: ${t}`},versioning:{start_of_document:`문서 시작`,compare_since_beginning_menuitem:`처음부터 비교`,title:`기록`,close:`닫기`,show_named_only:`이름이 지정된 버전만 표시`,show_all:`모든 버전 표시`,comparison_on:`비교 켜기`,comparison_off:`비교 끄기`,versions_list:`버전`,empty:`아직 버전이 없습니다`,empty_named_only:`이름이 지정된 버전이 없습니다`,current_version:`현재 버전`,before_restore:`복원 전`,comparing_to:`비교 대상`,restored_from:e=>`${e}에서 복원됨`,more_actions:`추가 작업`,version_name_input:`버전 이름`,name_version_menuitem:`이 버전의 이름 지정`,rename_menuitem:`이름 바꾸기`,compare_with_menuitem:`이 버전과 비교`,restore_menuitem:`복원`,delete_menuitem:`삭제`,action_failed:`문제가 발생했습니다. 다시 시도해 주세요.`,history_load_failed:`버전 기록을 불러오지 못했습니다`},exporter:{open_file:`파일 열기`,open_video_file:`동영상 열기`,open_audio_file:`오디오 열기`},generic:{loading:`불러오는 중...`,load_more:`더 불러오기`,ctrl_shortcut:`Ctrl`,form_submit:`확인`}},es:{slash_menu:{heading:{title:`Encabezado 1`,subtext:`Encabezado de primer nivel`,aliases:[`h`,`encabezado1`,`h1`],group:`Encabezados`},heading_2:{title:`Encabezado 2`,subtext:`Encabezado de sección principal`,aliases:[`h2`,`encabezado2`,`subencabezado`],group:`Encabezados`},heading_3:{title:`Encabezado 3`,subtext:`Encabezado de subsección y grupo`,aliases:[`h3`,`encabezado3`,`subencabezado`],group:`Encabezados`},heading_4:{title:`Encabezado 4`,subtext:`Encabezado de subsección menor`,aliases:[`h4`,`encabezado4`,`subencabezado4`],group:`Subencabezados`},heading_5:{title:`Encabezado 5`,subtext:`Encabezado de subsección pequeña`,aliases:[`h5`,`encabezado5`,`subencabezado5`],group:`Subencabezados`},heading_6:{title:`Encabezado 6`,subtext:`Encabezado de nivel más bajo`,aliases:[`h6`,`encabezado6`,`subencabezado6`],group:`Subencabezados`},toggle_heading:{title:`Encabezado Plegable 1`,subtext:`Encabezado de primer nivel que se puede plegar`,aliases:[`h`,`encabezado1`,`h1`,`plegable`,`contraible`],group:`Subencabezados`},toggle_heading_2:{title:`Encabezado Plegable 2`,subtext:`Encabezado de sección principal que se puede plegar`,aliases:[`h2`,`encabezado2`,`subencabezado`,`plegable`,`contraible`],group:`Subencabezados`},toggle_heading_3:{title:`Encabezado Plegable 3`,subtext:`Encabezado de subsección y grupo que se puede plegar`,aliases:[`h3`,`encabezado3`,`subencabezado`,`plegable`,`contraible`],group:`Subencabezados`},quote:{title:`Cita`,subtext:`Cita o extracto`,aliases:[`quotation`,`blockquote`,`bq`],group:`Bloques básicos`},numbered_list:{title:`Lista Numerada`,subtext:`Lista con elementos ordenados`,aliases:[`ol`,`li`,`lista`,`lista numerada`],group:`Bloques básicos`},bullet_list:{title:`Lista con Viñetas`,subtext:`Lista con elementos no ordenados`,aliases:[`ul`,`li`,`lista`,`lista con viñetas`],group:`Bloques básicos`},check_list:{title:`Lista de Verificación`,subtext:`Lista con casillas de verificación`,aliases:[`ul`,`li`,`lista`,`lista de verificación`,`lista de chequeo`,`checkbox`],group:`Bloques básicos`},toggle_list:{title:`Lista Plegable`,subtext:`Lista con subelementos ocultables`,aliases:[`li`,`lista`,`lista plegable`,`lista colapsable`],group:`Bloques básicos`},paragraph:{title:`Párrafo`,subtext:`El cuerpo de tu documento`,aliases:[`p`,`párrafo`],group:`Bloques básicos`},code_block:{title:`Bloque de Código`,subtext:`Bloque de código con resaltado de sintaxis`,aliases:[`code`,`pre`],group:`Bloques básicos`},page_break:{title:`Salto de página`,subtext:`Separador de página`,aliases:[`page`,`break`,`separator`,`salto`,`separador`],group:`Bloques básicos`},table:{title:`Tabla`,subtext:`Tabla con celdas editables`,aliases:[`tabla`],group:`Avanzado`},image:{title:`Imagen`,subtext:`Imagen redimensionable con leyenda`,aliases:[`imagen`,`subir imagen`,`cargar`,`img`,`foto`,`media`,`url`],group:`Medios`},video:{title:`Vídeo`,subtext:`Vídeo redimensionable con leyenda`,aliases:[`video`,`subir vídeo`,`cargar`,`mp4`,`película`,`media`,`url`],group:`Medios`},audio:{title:`Audio`,subtext:`Audio incrustado con leyenda`,aliases:[`audio`,`subir audio`,`cargar`,`mp3`,`sonido`,`media`,`url`],group:`Medios`},file:{title:`Archivo`,subtext:`Archivo incrustado`,aliases:[`archivo`,`cargar`,`incrustar`,`media`,`url`],group:`Medios`},emoji:{title:`Emoji`,subtext:`Busca e inserta un emoji`,aliases:[`emoji`,`emoticono`,`emoción`,`cara`],group:`Otros`},divider:{title:`Divisor`,subtext:`Divisor de bloques`,aliases:[`divisor`,`hr`,`horizontal rule`],group:`Bloques básicos`}},placeholders:{default:`Escribe o teclea '/' para comandos`,heading:`Encabezado`,toggleListItem:`Plegable`,bulletListItem:`Lista`,numberedListItem:`Lista`,checkListItem:`Lista`,new_comment:`Escribe un comentario...`,edit_comment:`Editar comentario...`,comment_reply:`Agregar comentario...`},file_blocks:{add_button_text:{image:`Agregar imagen`,video:`Agregar vídeo`,audio:`Agregar audio`,file:`Agregar archivo`}},toggle_blocks:{add_block_button:`Toggle vacío. Haz clic para añadir un bloque.`,toggle_button:`Expandir o contraer`},code_block:{add_source_button_text:`Agregar código fuente`,ok_button_text:`Aceptar`},side_menu:{add_block_label:`Agregar bloque`,drag_handle_label:`Abrir menú de bloque`},drag_handle:{delete_menuitem:`Eliminar`,colors_menuitem:`Colores`,header_row_menuitem:`Fila de encabezado`,header_column_menuitem:`Columna de encabezado`},table_handle:{delete_column_menuitem:`Eliminar columna`,delete_row_menuitem:`Eliminar fila`,add_left_menuitem:`Agregar columna a la izquierda`,add_right_menuitem:`Agregar columna a la derecha`,add_above_menuitem:`Agregar fila arriba`,add_below_menuitem:`Agregar fila abajo`,split_cell_menuitem:`Dividir celda`,merge_cells_menuitem:`Combinar celdas`,background_color_menuitem:`Color de fondo`},suggestion_menu:{no_items_title:`No se encontraron elementos`},color_picker:{text_title:`Texto`,background_title:`Fondo`,colors:{default:`Automático`,gray:`Gris`,brown:`Marrón`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,green:`Verde`,blue:`Azul`,purple:`Morado`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Negrita`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Cursiva`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Subrayado`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Tachado`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Código`,secondary_tooltip:``},colors:{tooltip:`Colores`},link:{tooltip:`Crear enlace`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Editar leyenda`,input_placeholder:`Editar leyenda`},file_replace:{tooltip:{image:`Reemplazar imagen`,video:`Reemplazar vídeo`,audio:`Reemplazar audio`,file:`Reemplazar archivo`}},file_rename:{tooltip:{image:`Renombrar imagen`,video:`Renombrar vídeo`,audio:`Renombrar audio`,file:`Renombrar archivo`},input_placeholder:{image:`Renombrar imagen`,video:`Renombrar vídeo`,audio:`Renombrar audio`,file:`Renombrar archivo`}},file_download:{tooltip:{image:`Descargar imagen`,video:`Descargar vídeo`,audio:`Descargar audio`,file:`Descargar archivo`}},file_delete:{tooltip:{image:`Eliminar imagen`,video:`Eliminar vídeo`,audio:`Eliminar audio`,file:`Eliminar archivo`}},file_preview_toggle:{tooltip:`Alternar vista previa`},nest:{tooltip:`Anidar bloque`,secondary_tooltip:`Tab`},unnest:{tooltip:`Desanidar bloque`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Alinear texto a la izquierda`},align_center:{tooltip:`Alinear texto al centro`},align_right:{tooltip:`Alinear texto a la derecha`},align_justify:{tooltip:`Justificar texto`},table_cell_merge:{tooltip:`Combinar celdas`},comment:{tooltip:`Añadir comentario`}},file_panel:{upload:{title:`Subir`,file_placeholder:{image:`Subir imagen`,video:`Subir vídeo`,audio:`Subir audio`,file:`Subir archivo`},upload_error:`Error: Fallo en la subida`},embed:{title:`Incrustar`,embed_button:{image:`Incrustar imagen`,video:`Incrustar vídeo`,audio:`Incrustar audio`,file:`Incrustar archivo`},url_placeholder:`Introduce la URL`}},link_toolbar:{delete:{tooltip:`Eliminar enlace`},edit:{text:`Editar enlace`,tooltip:`Editar`},open:{tooltip:`Abrir en nueva pestaña`},form:{title_placeholder:`Editar título`,url_placeholder:`Editar URL`}},comments:{edited:`editado`,save_button_text:`Guardar`,cancel_button_text:`Cancelar`,deleted_reference_text:`Contenido original eliminado`,discard_pending_comment:`¿Seguro que quieres descartar este comentario?`,actions:{add_reaction:`Agregar reacción`,resolve:`Resolver`,reopen:`Reabrir`,edit_comment:`Editar comentario`,delete_comment:`Eliminar comentario`,more_actions:`Más acciones`},reactions:{reacted_by:`Reaccionado por`},sidebar:{marked_as_resolved:`Marcado como resuelto`,more_replies:e=>`${e} respuestas más`}},suggestion_changes:{formatting_change:`Cambio de formato`,deleted:`Eliminado`,inserted:`Insertado`,inserted_by:e=>`Insertado por: ${e}`,deleted_by:e=>`Eliminado por: ${e}`,changed:`Modificado`,changed_by:e=>`Modificado por: ${e}`,formatting_change_by:(e,t)=>`Cambio de formato (${e}) por: ${t}`},versioning:{start_of_document:`Inicio del documento`,compare_since_beginning_menuitem:`Comparar desde el inicio`,title:`Historial`,close:`Cerrar`,show_named_only:`Mostrar solo versiones con nombre`,show_all:`Mostrar todas las versiones`,comparison_on:`Activar comparación`,comparison_off:`Desactivar comparación`,versions_list:`Versiones`,empty:`Aún no hay versiones`,empty_named_only:`No hay versiones con nombre`,current_version:`Versión actual`,before_restore:`Antes de restaurar`,comparing_to:`Comparando con`,restored_from:e=>`Restaurado desde ${e}`,more_actions:`Más acciones`,version_name_input:`Nombre de la versión`,name_version_menuitem:`Nombrar esta versión`,rename_menuitem:`Cambiar nombre`,compare_with_menuitem:`Comparar con esta versión`,restore_menuitem:`Restaurar`,delete_menuitem:`Eliminar`,action_failed:`Algo salió mal. Inténtalo de nuevo.`,history_load_failed:`No se pudo cargar el historial de versiones`},exporter:{open_file:`Abrir archivo`,open_video_file:`Abrir vídeo`,open_audio_file:`Abrir audio`},generic:{loading:`Cargando...`,load_more:`Cargar más`,ctrl_shortcut:`Ctrl`,form_submit:`Aceptar`}},fr:{slash_menu:{heading:{title:`Titre 1`,subtext:`Utilisé pour un titre de premier niveau`,aliases:[`h`,`titre1`,`h1`],group:`Titres`},heading_2:{title:`Titre 2`,subtext:`Titre de deuxième niveau Utilisé pour les sections clés`,aliases:[`h2`,`titre2`,`sous-titre`],group:`Titres`},heading_3:{title:`Titre 3`,subtext:`Titre de troisième niveau utilisé pour les sous-sections et les titres de groupe`,aliases:[`h3`,`titre3`,`sous-titre`],group:`Titres`},heading_4:{title:`Titre 4`,subtext:`Titre de sous‑section mineure`,aliases:[`h4`,`titre4`,`sous‑titre4`],group:`Sous-titres`},heading_5:{title:`Titre 5`,subtext:`Titre de sous-section mineure`,aliases:[`h5`,`titre5`,`sous-titre5`],group:`Sous-titres`},heading_6:{title:`Titre 6`,subtext:`Titre de niveau le plus bas`,aliases:[`h6`,`titre6`,`sous-titre6`],group:`Sous-titres`},toggle_heading:{title:`Titre Repliable 1`,subtext:`Titre de premier niveau qui peut être replié pour masquer son contenu`,aliases:[`h`,`titre1`,`h1`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},toggle_heading_2:{title:`Titre Repliable 2`,subtext:`Titre de section qui peut être replié pour masquer son contenu`,aliases:[`h2`,`titre2`,`sous-titre`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},toggle_heading_3:{title:`Titre Repliable 3`,subtext:`Titre de sous-section qui peut être replié pour masquer son contenu`,aliases:[`h3`,`titre3`,`sous-titre`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},quote:{title:`Citation`,subtext:`Citation ou extrait`,aliases:[`quotation`,`blockquote`,`bq`],group:`Blocs de base`},numbered_list:{title:`Liste Numérotée`,subtext:`Utilisé pour afficher une liste numérotée`,aliases:[`ol`,`li`,`liste`,`listenumérotée`,`liste numérotée`],group:`Blocs de base`},bullet_list:{title:`Liste à puces`,subtext:`Utilisé pour afficher une liste à puce non numérotée`,aliases:[`ul`,`li`,`liste`,`listeàpuces`,`liste à puces`,`bullet points`,`bulletpoints`],group:`Blocs de base`},check_list:{title:`Liste de tâches`,subtext:`Utilisé pour afficher une liste avec des cases à cocher`,aliases:[`ul`,`li`,`liste`,`liste de vérification`,`liste cochée`,`case à cocher`,`checklist`,`checkbox`,`check box`,`to do`,`todo`],group:`Blocs de base`},toggle_list:{title:`Liste repliable`,subtext:`Liste avec des sous-éléments masquables`,aliases:[`li`,`liste`,`liste pliable`,`liste escamotable`,`liste repliable`],group:`Blocs de base`},paragraph:{title:`Paragraphe`,subtext:`Utilisé pour le corps de votre document`,aliases:[`p`,`paragraphe`,`texte`],group:`Blocs de base`},code_block:{title:`Bloc de code`,subtext:`Bloc de code avec coloration syntaxique`,aliases:[`code`,`pre`],group:`Blocs de base`},page_break:{title:`Saut de page`,subtext:`Séparateur de page`,aliases:[`page`,`break`,`separator`,`saut`,`séparateur`],group:`Blocs de base`},table:{title:`Tableau`,subtext:`Utilisé pour les tableaux`,aliases:[`tableau`,`grille`],group:`Avancé`},image:{title:`Image`,subtext:`Insérer une image`,aliases:[`image`,`uploadImage`,`télécharger image`,`téléverser image`,`uploader image`,`img`,`photo`,`média`,`url`],group:`Médias`},video:{title:`Vidéo`,subtext:`Insérer une vidéo`,aliases:[`vidéo`,`télécharger vidéo`,`téléverser vidéo`,`mp4`,`film`,`média`,`url`],group:`Média`},audio:{title:`Audio`,subtext:`Insérer un audio`,aliases:[`audio`,`télécharger audio`,`téléverser audio`,`mp3`,`son`,`média`,`url`],group:`Média`},file:{title:`Fichier`,subtext:`Insérer un fichier`,aliases:[`fichier`,`téléverser fichier`,`intégrer fichier`,`insérer fichier`,`média`,`url`],group:`Média`},emoji:{title:`Emoji`,subtext:`Utilisé pour insérer un emoji`,aliases:[`emoji`,`émoticône`,`émotion`,`visage`,`smiley`],group:`Autres`},divider:{title:`Diviseur`,subtext:`Utilisé pour diviser les blocs`,aliases:[`diviseur`,`hr`,`horizontal rule`],group:`Blocs de base`}},placeholders:{default:`Entrez du texte ou tapez '/' pour faire apparaître les options de mise en page`,heading:`Titre`,toggleListItem:`Basculer`,bulletListItem:`Liste`,numberedListItem:`Liste`,checkListItem:`Liste`,new_comment:`Écrire un commentaire...`,edit_comment:`Modifier le commentaire...`,comment_reply:`Ajouter un commentaire...`},file_blocks:{add_button_text:{image:`Ajouter une image`,video:`Ajouter une vidéo`,audio:`Ajouter un audio`,file:`Ajouter un fichier`}},toggle_blocks:{add_block_button:`Liste repliable vide. Cliquez pour ajouter un bloc.`,toggle_button:`Déplier ou replier`},code_block:{add_source_button_text:`Ajouter le code source`,ok_button_text:`OK`},side_menu:{add_block_label:`Ajouter un bloc`,drag_handle_label:`Ouvrir le menu du bloc`},drag_handle:{delete_menuitem:`Supprimer`,colors_menuitem:`Couleurs`,header_row_menuitem:`En-tête de ligne`,header_column_menuitem:`En-tête de colonne`},table_handle:{delete_column_menuitem:`Supprimer la colonne`,delete_row_menuitem:`Supprimer la ligne`,add_left_menuitem:`Ajouter une colonne à gauche`,add_right_menuitem:`Ajouter une colonne à droite`,add_above_menuitem:`Ajouter une ligne au-dessus`,add_below_menuitem:`Ajouter une ligne en dessous`,split_cell_menuitem:`Diviser la cellule`,merge_cells_menuitem:`Fusionner les cellules`,background_color_menuitem:`Couleur de fond`},suggestion_menu:{no_items_title:`Aucun élément trouvé`},color_picker:{text_title:`Texte`,background_title:`Fond`,colors:{default:`Auto`,gray:`Gris`,brown:`Marron`,red:`Rouge`,orange:`Orange`,yellow:`Jaune`,green:`Vert`,blue:`Bleu`,purple:`Violet`,pink:`Rose`}},formatting_toolbar:{bold:{tooltip:`Gras`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italique`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Souligner`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Barré`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Couleurs`},link:{tooltip:`Créer un lien`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Modifier la légende`,input_placeholder:`Modifier la légende`},file_replace:{tooltip:{image:`Remplacer l'image`,video:`Remplacer la vidéo`,audio:`Remplacer l'audio`,file:`Remplacer le fichier`}},file_rename:{tooltip:{image:`Renommer l'image`,video:`Renommer la vidéo`,audio:`Renommer l'audio`,file:`Renommer le fichier`},input_placeholder:{image:`Renommer l'image`,video:`Renommer la vidéo`,audio:`Renommer l'audio`,file:`Renommer le fichier`}},file_download:{tooltip:{image:`Télécharger l'image`,video:`Télécharger la vidéo`,audio:`Télécharger l'audio`,file:`Télécharger le fichier`}},file_delete:{tooltip:{image:`Supprimer l'image`,video:`Supprimer la vidéo`,audio:`Supprimer l'audio`,file:`Supprimer le fichier`}},file_preview_toggle:{tooltip:`Basculer l'aperçu`},nest:{tooltip:`Augmenter le retrait du bloc`,secondary_tooltip:`Tab`},unnest:{tooltip:`Diminuer le retait du bloc`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Aligner le texte à gauche`},align_center:{tooltip:`Aligner le texte au centre`},align_right:{tooltip:`Aligner le texte à droite`},align_justify:{tooltip:`Justifier le texte`},table_cell_merge:{tooltip:`Fusionner les cellules`},comment:{tooltip:`Ajouter un commentaire`}},file_panel:{upload:{title:`Télécharger`,file_placeholder:{image:`Télécharger une image`,video:`Télécharger une vidéo`,audio:`Télécharger un fichier audio`,file:`Télécharger un fichier`},upload_error:`Erreur : échec du téléchargement`},embed:{title:`Intégrer`,embed_button:{image:`Intégrer une image`,video:`Intégrer une vidéo`,audio:`Intégrer un fichier audio`,file:`Intégrer un fichier`},url_placeholder:`Entrez l'URL`}},link_toolbar:{delete:{tooltip:`Supprimer le lien`},edit:{text:`Modifier le lien`,tooltip:`Modifier`},open:{tooltip:`Ouvrir dans un nouvel onglet`},form:{title_placeholder:`Modifier le titre`,url_placeholder:`Modifier l'URL`}},comments:{edited:`modifié`,save_button_text:`Enregistrer`,cancel_button_text:`Annuler`,deleted_reference_text:`Contenu d'origine supprimé`,discard_pending_comment:`Voulez-vous vraiment abandonner ce commentaire ?`,actions:{add_reaction:`Ajouter une réaction`,resolve:`Résoudre`,reopen:`Rouvrir`,edit_comment:`Modifier le commentaire`,delete_comment:`Supprimer le commentaire`,more_actions:`Plus d'actions`},reactions:{reacted_by:`Réagi par`},sidebar:{marked_as_resolved:`Marqué comme résolu`,more_replies:e=>`${e} réponses de plus`}},suggestion_changes:{formatting_change:`Modification de mise en forme`,deleted:`Supprimé`,inserted:`Inséré`,inserted_by:e=>`Inséré par : ${e}`,deleted_by:e=>`Supprimé par : ${e}`,changed:`Modifié`,changed_by:e=>`Modifié par : ${e}`,formatting_change_by:(e,t)=>`Modification de mise en forme (${e}) par : ${t}`},versioning:{start_of_document:`Début du document`,compare_since_beginning_menuitem:`Comparer depuis le début`,title:`Historique`,close:`Fermer`,show_named_only:`Afficher uniquement les versions nommées`,show_all:`Afficher toutes les versions`,comparison_on:`Activer la comparaison`,comparison_off:`Désactiver la comparaison`,versions_list:`Versions`,empty:`Aucune version pour l'instant`,empty_named_only:`Aucune version nommée`,current_version:`Version actuelle`,before_restore:`Avant la restauration`,comparing_to:`Comparé à`,restored_from:e=>`Restauré depuis ${e}`,more_actions:`Plus d'actions`,version_name_input:`Nom de la version`,name_version_menuitem:`Nommer cette version`,rename_menuitem:`Renommer`,compare_with_menuitem:`Comparer avec cette version`,restore_menuitem:`Restaurer`,delete_menuitem:`Supprimer`,action_failed:`Une erreur s'est produite. Veuillez réessayer.`,history_load_failed:`Impossible de charger l'historique des versions`},exporter:{open_file:`Ouvrir le fichier`,open_video_file:`Ouvrir la vidéo`,open_audio_file:`Ouvrir l'audio`},generic:{loading:`Chargement...`,load_more:`Charger plus`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},de:{slash_menu:{heading:{title:`Überschrift 1`,subtext:`Hauptebene Überschrift`,aliases:[`h`,`überschrift1`,`h1`],group:`Überschriften`},heading_2:{title:`Überschrift 2`,subtext:`Wichtige Abschnittsüberschrift`,aliases:[`h2`,`überschrift2`,`unterüberschrift`],group:`Überschriften`},heading_3:{title:`Überschrift 3`,subtext:`Unterabschnitts- und Gruppenüberschrift`,aliases:[`h3`,`überschrift3`,`unterüberschrift`],group:`Überschriften`},heading_4:{title:`Überschrift 4`,subtext:`Überschrift für kleinere Unterabschnitte`,aliases:[`h4`,`überschrift4`,`unterüberschrift4`],group:`Unterüberschriften`},heading_5:{title:`Überschrift 5`,subtext:`Überschrift für tiefere Unterabschnitte`,aliases:[`h5`,`überschrift5`,`unterüberschrift5`],group:`Unterüberschriften`},heading_6:{title:`Überschrift 6`,subtext:`Überschrift auf der untersten Ebene`,aliases:[`h6`,`überschrift6`,`unterüberschrift6`],group:`Unterüberschriften`},toggle_heading:{title:`Aufklappbare Überschrift 1`,subtext:`Aufklappbare Hauptebene Überschrift`,aliases:[`h`,`überschrift1`,`h1`,`aufklappbar`,`einklappbar`],group:`Unterüberschrift`},toggle_heading_2:{title:`Aufklappbare Überschrift 2`,subtext:`Aufklappbare wichtige Abschnittsüberschrift`,aliases:[`h2`,`überschrift2`,`unterüberschrift`,`aufklappbar`,`einklappbar`],group:`Unterüberschriften`},toggle_heading_3:{title:`Aufklappbare Überschrift 3`,subtext:`Aufklappbare Unterabschnitts- und Gruppenüberschrift`,aliases:[`h3`,`überschrift3`,`unterüberschrift`,`aufklappbar`,`einklappbar`],group:`Unterüberschriften`},quote:{title:`Zitat`,subtext:`Zitat oder Auszug`,aliases:[`quotation`,`blockquote`,`bq`],group:`Grundlegende Blöcke`},numbered_list:{title:`Nummerierte Liste`,subtext:`Liste mit nummerierten Elementen`,aliases:[`ol`,`li`,`liste`,`nummerierteliste`,`nummerierte liste`],group:`Grundlegende Blöcke`},bullet_list:{title:`Aufzählungsliste`,subtext:`Liste mit unnummerierten Elementen`,aliases:[`ul`,`li`,`liste`,`aufzählungsliste`,`aufzählung liste`],group:`Grundlegende Blöcke`},check_list:{title:`Checkliste`,subtext:`Liste mit Kontrollkästchen`,aliases:[`ul`,`li`,`liste`,`checkliste`,`check liste`,`geprüfte liste`,`kontrollkästchen`],group:`Grundlegende Blöcke`},toggle_list:{title:`Aufklappbare Liste`,subtext:`Liste mit ausblendbare Unterpunkten`,aliases:[`li`,`liste`,`aufklappbare liste`,`einklappbare liste`,`aufklappbareListe`,`aufklappbare liste`],group:`Grundlegende Blöcke`},paragraph:{title:`Absatz`,subtext:`Der Hauptteil Ihres Dokuments`,aliases:[`p`,`absatz`],group:`Grundlegende Blöcke`},code_block:{title:`Codeblock`,subtext:`Codeblock mit Syntaxhervorhebung`,aliases:[`code`,`pre`],group:`Grundlegende Blöcke`},page_break:{title:`Seitenumbruch`,subtext:`Seitentrenner`,aliases:[`page`,`break`,`separator`,`seitenumbruch`,`trenner`],group:`Grundlegende Blöcke`},table:{title:`Tabelle`,subtext:`Tabelle mit editierbaren Zellen`,aliases:[`tabelle`],group:`Erweitert`},image:{title:`Bild`,subtext:`Größenveränderbares Bild mit Beschriftung`,aliases:[`bild`,`bildhochladen`,`hochladen`,`img`,`bild`,`medien`,`url`],group:`Medien`},video:{title:`Video`,subtext:`Größenveränderbares Video mit Beschriftung`,aliases:[`video`,`videoupload`,`hochladen`,`mp4`,`film`,`medien`,`url`],group:`Medien`},audio:{title:`Audio`,subtext:`Eingebettetes Audio mit Beschriftung`,aliases:[`audio`,`audioupload`,`hochladen`,`mp3`,`ton`,`medien`,`url`],group:`Medien`},file:{title:`Datei`,subtext:`Eingebettete Datei`,aliases:[`datei`,`hochladen`,`einbetten`,`medien`,`url`],group:`Medien`},emoji:{title:`Emoji`,subtext:`Nach Emoji suchen und einfügen`,aliases:[`emoji`,`emote`,`emotion`,`gesicht`],group:`Andere`},divider:{title:`Trennlinie`,subtext:`Trennlinie zwischen Blöcken`,aliases:[`trennlinie`,`hr`,`horizontal rule`],group:`Grundlegende Blöcke`}},placeholders:{default:`Text eingeben oder '/' für Befehle tippen`,heading:`Überschrift`,toggleListItem:`Umschalten`,bulletListItem:`Liste`,numberedListItem:`Liste`,checkListItem:`Liste`,new_comment:`Einen Kommentar schreiben …`,edit_comment:`Kommentar bearbeiten …`,comment_reply:`Kommentar hinzufügen …`},file_blocks:{add_button_text:{image:`Bild hinzufügen`,video:`Video hinzufügen`,audio:`Audio hinzufügen`,file:`Datei hinzufügen`}},toggle_blocks:{add_block_button:`Leerer aufklappbarer Bereich. Klicken, um einen Block hinzuzufügen.`,toggle_button:`Aufklappen oder zuklappen`},code_block:{add_source_button_text:`Quellcode hinzufügen`,ok_button_text:`OK`},side_menu:{add_block_label:`Block hinzufügen`,drag_handle_label:`Blockmenü öffnen`},drag_handle:{delete_menuitem:`Löschen`,colors_menuitem:`Farben`,header_row_menuitem:`Kopfzeile`,header_column_menuitem:`Kopfspalte`},table_handle:{delete_column_menuitem:`Spalte löschen`,delete_row_menuitem:`Zeile löschen`,add_left_menuitem:`Spalte links hinzufügen`,add_right_menuitem:`Spalte rechts hinzufügen`,add_above_menuitem:`Zeile oberhalb hinzufügen`,add_below_menuitem:`Zeile unterhalb hinzufügen`,split_cell_menuitem:`Zelle teilen`,merge_cells_menuitem:`Zellen zusammenführen`,background_color_menuitem:`Hintergrundfarbe`},suggestion_menu:{no_items_title:`Keine Elemente gefunden`},color_picker:{text_title:`Text`,background_title:`Hintergrund`,colors:{default:`Automatisch`,gray:`Grau`,brown:`Braun`,red:`Rot`,orange:`Orange`,yellow:`Gelb`,green:`Grün`,blue:`Blau`,purple:`Lila`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Fett`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Kursiv`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Unterstrichen`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Durchgestrichen`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Farben`},link:{tooltip:`Link erstellen`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Beschriftung bearbeiten`,input_placeholder:`Beschriftung bearbeiten`},file_replace:{tooltip:{image:`Bild ersetzen`,video:`Video ersetzen`,audio:`Audio ersetzen`,file:`Datei ersetzen`}},file_rename:{tooltip:{image:`Bild umbenennen`,video:`Video umbenennen`,audio:`Audio umbenennen`,file:`Datei umbenennen`},input_placeholder:{image:`Bild umbenennen`,video:`Video umbenennen`,audio:`Audio umbenennen`,file:`Datei umbenennen`}},file_download:{tooltip:{image:`Bild herunterladen`,video:`Video herunterladen`,audio:`Audio herunterladen`,file:`Datei herunterladen`}},file_delete:{tooltip:{image:`Bild löschen`,video:`Video löschen`,audio:`Audio löschen`,file:`Datei löschen`}},file_preview_toggle:{tooltip:`Vorschau umschalten`},nest:{tooltip:`Block verschachteln`,secondary_tooltip:`Tab`},unnest:{tooltip:`Block entnesten`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Text linksbündig`},align_center:{tooltip:`Text zentrieren`},align_right:{tooltip:`Text rechtsbündig`},align_justify:{tooltip:`Text Blocksatz`},table_cell_merge:{tooltip:`Zellen zusammenführen`},comment:{tooltip:`Kommentar hinzufügen`}},file_panel:{upload:{title:`Hochladen`,file_placeholder:{image:`Bild hochladen`,video:`Video hochladen`,audio:`Audio hochladen`,file:`Datei hochladen`},upload_error:`Fehler: Hochladen fehlgeschlagen`},embed:{title:`Einbetten`,embed_button:{image:`Bild einbetten`,video:`Video einbetten`,audio:`Audio einbetten`,file:`Datei einbetten`},url_placeholder:`URL eingeben`}},link_toolbar:{delete:{tooltip:`Link entfernen`},edit:{text:`Link bearbeiten`,tooltip:`Bearbeiten`},open:{tooltip:`In neuem Tab öffnen`},form:{title_placeholder:`Titel bearbeiten`,url_placeholder:`URL bearbeiten`}},comments:{edited:`bearbeitet`,save_button_text:`Speichern`,cancel_button_text:`Abbrechen`,deleted_reference_text:`Originalinhalt gelöscht`,discard_pending_comment:`Möchten Sie diesen Kommentar wirklich verwerfen?`,actions:{add_reaction:`Reaktion hinzufügen`,resolve:`Lösen`,reopen:`Wieder öffnen`,edit_comment:`Kommentar bearbeiten`,delete_comment:`Kommentar löschen`,more_actions:`Weitere Aktionen`},reactions:{reacted_by:`Reagiert von`},sidebar:{marked_as_resolved:`Als gelöst markiert`,more_replies:e=>`${e} weitere Antworten`}},suggestion_changes:{formatting_change:`Formatierungsänderung`,deleted:`Gelöscht`,inserted:`Eingefügt`,inserted_by:e=>`Eingefügt von: ${e}`,deleted_by:e=>`Gelöscht von: ${e}`,changed:`Geändert`,changed_by:e=>`Geändert von: ${e}`,formatting_change_by:(e,t)=>`Formatierungsänderung (${e}) von: ${t}`},versioning:{start_of_document:`Anfang des Dokuments`,compare_since_beginning_menuitem:`Seit Beginn vergleichen`,title:`Verlauf`,close:`Schließen`,show_named_only:`Nur benannte Versionen anzeigen`,show_all:`Alle Versionen anzeigen`,comparison_on:`Vergleich einschalten`,comparison_off:`Vergleich ausschalten`,versions_list:`Versionen`,empty:`Noch keine Versionen`,empty_named_only:`Keine benannten Versionen`,current_version:`Aktuelle Version`,before_restore:`Vor der Wiederherstellung`,comparing_to:`Verglichen mit`,restored_from:e=>`Wiederhergestellt aus ${e}`,more_actions:`Weitere Aktionen`,version_name_input:`Versionsname`,name_version_menuitem:`Diese Version benennen`,rename_menuitem:`Umbenennen`,compare_with_menuitem:`Mit dieser Version vergleichen`,restore_menuitem:`Wiederherstellen`,delete_menuitem:`Löschen`,action_failed:`Etwas ist schiefgelaufen. Bitte versuche es erneut.`,history_load_failed:`Versionsverlauf konnte nicht geladen werden`},exporter:{open_file:`Datei öffnen`,open_video_file:`Video öffnen`,open_audio_file:`Audio öffnen`},generic:{loading:`Wird geladen...`,load_more:`Mehr laden`,ctrl_shortcut:`Strg`,form_submit:`OK`}},pt:{slash_menu:{heading:{title:`Título`,subtext:`Usado para um título de nível superior`,aliases:[`h`,`titulo1`,`h1`],group:`Títulos`},heading_2:{title:`Título 2`,subtext:`Usado para seções principais`,aliases:[`h2`,`titulo2`,`subtitulo`],group:`Títulos`},heading_3:{title:`Título 3`,subtext:`Usado para subseções e títulos de grupo`,aliases:[`h3`,`titulo3`,`subtitulo`],group:`Títulos`},heading_4:{title:`Título 4`,subtext:`Usado para subseções menores`,aliases:[`h4`,`titulo4`,`subtitulo4`],group:`Subtítulos`},heading_5:{title:`Título 5`,subtext:`Usado para títulos de subseções pequenas`,aliases:[`h5`,`titulo5`,`subtitulo5`],group:`Subtítulos`},heading_6:{title:`Título 6`,subtext:`Usado para títulos de nível mais baixo`,aliases:[`h6`,`titulo6`,`subtitulo6`],group:`Subtítulos`},toggle_heading:{title:`Título Expansível`,subtext:`Título expansível de nível superior`,aliases:[`h`,`titulo1`,`h1`,`expansível`],group:`Subtítulos`},toggle_heading_2:{title:`Título Expansível 2`,subtext:`Título expansível para seções principais`,aliases:[`h2`,`titulo2`,`subtitulo`,`expansível`],group:`Subtítulos`},toggle_heading_3:{title:`Título Expansível 3`,subtext:`Título expansível para subseções e títulos de grupo`,aliases:[`h3`,`titulo3`,`subtitulo`,`expansível`],group:`Subtítulos`},quote:{title:`Citação`,subtext:`Citação ou trecho`,aliases:[`quotation`,`blockquote`,`bq`],group:`Blocos básicos`},numbered_list:{title:`Lista Numerada`,subtext:`Usado para exibir uma lista numerada`,aliases:[`ol`,`li`,`lista`,`listanumerada`,`lista numerada`],group:`Blocos básicos`},bullet_list:{title:`Lista com Marcadores`,subtext:`Usado para exibir uma lista não ordenada`,aliases:[`ul`,`li`,`lista`,`listamarcadores`,`lista com marcadores`],group:`Blocos básicos`},check_list:{title:`Lista de verificação`,subtext:`Usado para exibir uma lista com caixas de seleção`,aliases:[`ul`,`li`,`lista`,`lista de verificação`,`lista marcada`,`caixa de seleção`],group:`Blocos básicos`},toggle_list:{title:`Lista expansível`,subtext:`Lista com subitens ocultáveis`,aliases:[`li`,`lista`,`lista expansível`,`lista recolhível`],group:`Blocos básicos`},paragraph:{title:`Parágrafo`,subtext:`Usado para o corpo do seu documento`,aliases:[`p`,`paragrafo`],group:`Blocos básicos`},code_block:{title:`Bloco de Código`,subtext:`Usado para exibir código com destaque de sintaxe`,aliases:[`codigo`,`pre`],group:`Blocos básicos`},page_break:{title:`Quebra de página`,subtext:`Separador de página`,aliases:[`page`,`break`,`separator`,`quebra`,`separador`],group:`Blocos básicos`},table:{title:`Tabela`,subtext:`Usado para tabelas`,aliases:[`tabela`],group:`Avançado`},image:{title:`Imagem`,subtext:`Inserir uma imagem`,aliases:[`imagem`,`uploadImagem`,`upload`,`img`,`foto`,`media`,`url`],group:`Mídia`},video:{title:`Vídeo`,subtext:`Inserir um vídeo`,aliases:[`vídeo`,`uploadVídeo`,`upload`,`mp4`,`filme`,`mídia`,`url`],group:`Mídia`},audio:{title:`Áudio`,subtext:`Inserir um áudio`,aliases:[`áudio`,`uploadÁudio`,`upload`,`mp3`,`som`,`mídia`,`url`],group:`Mídia`},file:{title:`Arquivo`,subtext:`Inserir um arquivo`,aliases:[`arquivo`,`upload`,`incorporar`,`mídia`,`url`],group:`Mídia`},emoji:{title:`Emoji`,subtext:`Usado para inserir um emoji`,aliases:[`emoji`,`emoticon`,`expressão emocional`,`rosto`],group:`Outros`},divider:{title:`Separador`,subtext:`Separador de blocos`,aliases:[`separador`,`hr`,`horizontal rule`],group:`Blocos básicos`}},placeholders:{default:`Digite texto ou use '/' para comandos`,heading:`Título`,toggleListItem:`Alternar`,bulletListItem:`Lista`,numberedListItem:`Lista`,checkListItem:`Lista`,new_comment:`Escreva um comentário...`,edit_comment:`Editar comentário...`,comment_reply:`Adicionar comentário...`},file_blocks:{add_button_text:{image:`Adicionar imagem`,video:`Adicionar vídeo`,audio:`Adicionar áudio`,file:`Adicionar arquivo`}},toggle_blocks:{add_block_button:`Toggle vazio. Clique para adicionar um bloco.`,toggle_button:`Expandir ou recolher`},code_block:{add_source_button_text:`Adicionar código-fonte`,ok_button_text:`OK`},side_menu:{add_block_label:`Adicionar bloco`,drag_handle_label:`Abrir menu do bloco`},drag_handle:{delete_menuitem:`Excluir`,colors_menuitem:`Cores`,header_row_menuitem:`Cabeçalho de linha`,header_column_menuitem:`Cabeçalho de coluna`},table_handle:{delete_column_menuitem:`Excluir coluna`,delete_row_menuitem:`Excluir linha`,add_left_menuitem:`Adicionar coluna à esquerda`,add_right_menuitem:`Adicionar coluna à direita`,add_above_menuitem:`Adicionar linha acima`,add_below_menuitem:`Adicionar linha abaixo`,split_cell_menuitem:`Dividir célula`,merge_cells_menuitem:`Juntar células`,background_color_menuitem:`Alterar cor de fundo`},suggestion_menu:{no_items_title:`Nenhum item encontrado`},color_picker:{text_title:`Texto`,background_title:`Fundo`,colors:{default:`Automático`,gray:`Cinza`,brown:`Marrom`,red:`Vermelho`,orange:`Laranja`,yellow:`Amarelo`,green:`Verde`,blue:`Azul`,purple:`Roxo`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Negrito`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Itálico`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Sublinhado`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Riscado`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`Código`,secondary_tooltip:``},colors:{tooltip:`Cores`},link:{tooltip:`Criar link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Editar legenda`,input_placeholder:`Editar legenda`},file_replace:{tooltip:{image:`Substituir imagem`,video:`Substituir vídeo`,audio:`Substituir áudio`,file:`Substituir arquivo`}},file_rename:{tooltip:{image:`Renomear imagem`,video:`Renomear vídeo`,audio:`Renomear áudio`,file:`Renomear arquivo`},input_placeholder:{image:`Renomear imagem`,video:`Renomear vídeo`,audio:`Renomear áudio`,file:`Renomear arquivo`}},file_download:{tooltip:{image:`Baixar imagem`,video:`Baixar vídeo`,audio:`Baixar áudio`,file:`Baixar arquivo`}},file_delete:{tooltip:{image:`Excluir imagem`,video:`Excluir vídeo`,audio:`Excluir áudio`,file:`Excluir arquivo`}},file_preview_toggle:{tooltip:`Alternar visualização`},nest:{tooltip:`Aninhar bloco`,secondary_tooltip:`Tab`},unnest:{tooltip:`Desaninhar bloco`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Alinhar à esquerda`},align_center:{tooltip:`Alinhar ao centro`},align_right:{tooltip:`Alinhar à direita`},align_justify:{tooltip:`Justificar texto`},table_cell_merge:{tooltip:`Juntar células`},comment:{tooltip:`Adicionar comentário`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload de imagem`,video:`Upload de vídeo`,audio:`Upload de áudio`,file:`Upload de arquivo`},upload_error:`Erro: Falha no upload`},embed:{title:`Incorporar`,embed_button:{image:`Incorporar imagem`,video:`Incorporar vídeo`,audio:`Incorporar áudio`,file:`Incorporar arquivo`},url_placeholder:`Insira a URL`}},link_toolbar:{delete:{tooltip:`Remover link`},edit:{text:`Editar link`,tooltip:`Editar`},open:{tooltip:`Abrir em nova aba`},form:{title_placeholder:`Editar título`,url_placeholder:`Editar URL`}},comments:{edited:`editado`,save_button_text:`Salvar`,cancel_button_text:`Cancelar`,deleted_reference_text:`Conteúdo original excluído`,discard_pending_comment:`Tem certeza de que deseja descartar este comentário?`,actions:{add_reaction:`Adicionar reação`,resolve:`Resolver`,reopen:`Reabrir`,edit_comment:`Editar comentário`,delete_comment:`Excluir comentário`,more_actions:`Mais ações`},reactions:{reacted_by:`Reagido por`},sidebar:{marked_as_resolved:`Marcado como resolvido`,more_replies:e=>`${e} respostas a mais`}},suggestion_changes:{formatting_change:`Alteração de formatação`,deleted:`Excluído`,inserted:`Inserido`,inserted_by:e=>`Inserido por: ${e}`,deleted_by:e=>`Excluído por: ${e}`,changed:`Alterado`,changed_by:e=>`Alterado por: ${e}`,formatting_change_by:(e,t)=>`Alteração de formatação (${e}) por: ${t}`},versioning:{start_of_document:`Início do documento`,compare_since_beginning_menuitem:`Comparar desde o início`,title:`Histórico`,close:`Fechar`,show_named_only:`Mostrar apenas versões nomeadas`,show_all:`Mostrar todas as versões`,comparison_on:`Ativar comparação`,comparison_off:`Desativar comparação`,versions_list:`Versões`,empty:`Ainda não há versões`,empty_named_only:`Não há versões nomeadas`,current_version:`Versão atual`,before_restore:`Antes da restauração`,comparing_to:`Comparando com`,restored_from:e=>`Restaurado de ${e}`,more_actions:`Mais ações`,version_name_input:`Nome da versão`,name_version_menuitem:`Nomear esta versão`,rename_menuitem:`Renomear`,compare_with_menuitem:`Comparar com esta versão`,restore_menuitem:`Restaurar`,delete_menuitem:`Excluir`,action_failed:`Algo deu errado. Tente novamente.`,history_load_failed:`Falha ao carregar o histórico de versões`},exporter:{open_file:`Abrir arquivo`,open_video_file:`Abrir vídeo`,open_audio_file:`Abrir áudio`},generic:{loading:`Carregando...`,load_more:`Carregar mais`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}}},oy=de({en:{loading:`Opening…`,unreadable:`This doc cannot be shown right now: its file is not written as a doc. Here is what it says.`,duplicate:`Duplicate`,remove:`Delete`,colors:`Colors`,tag:`Tag`,noTag:`No tag`,nothing:`No block by that name`,nothingToLink:`Nothing in the project by that name`,turnInto:`Turn into`,aligns:{left:`Left`,center:`Center`,right:`Right`,justify:`Justify`},copyPlace:`Copy its place in the file`,find:`Find something to do…`,text:`text`,background:`background`,placeholder:`Write, or press / for blocks`,heading:`Heading`,colorNames:{gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`},embed:`Drawn by code`,title:`Title`,untitled:`Untitled`,outline:`On this page`,blocks:{paragraph:`Text`,heading1:`Heading 1`,heading2:`Heading 2`,heading3:`Heading 3`,bullet:`Bulleted list`,numbered:`Numbered list`,check:`To-do list`,toggle:`Toggle`,quote:`Quote`,callout:`Callout`,code:`Code`,divider:`Divider`,table:`Table`,image:`Image`,chart:`Chart`,equation:`Equation`,diagram:`Diagram`,columns2:`2 columns`,columns3:`3 columns`,footnote:`Footnote`,pagebreak:`Page break`,pagebreakLandscape:`Page break, landscape after it`,pagebreakPortrait:`Page break, portrait after it`,toc:`Contents`,bibliography:`Bibliography`,card:`Card`,stats:`Figures`},component:`Component`,stats:{label:`Label`,value:`Value`,delta:`Change`,note:`Note`,trend:`Trend: 12, 15, 14`,add:`Add a figure`,remove:`Remove this figure`},card:{title:`Card title`,subtitle:`A line under it`},sample:{category:e=>`Category ${String(e)}`,series:e=>`Series ${String(e)}`},chart:{types:{"column-clustered":`Clustered column`,"column-stacked":`Stacked column`,"column-stacked-100":`100% stacked column`,"bar-clustered":`Clustered bar`,"bar-stacked":`Stacked bar`,"bar-stacked-100":`100% stacked bar`,line:`Line`,"line-markers":`Line with markers`,area:`Area`,"area-stacked":`Stacked area`,"area-stacked-100":`100% stacked area`,pie:`Pie`,doughnut:`Doughnut`,scatter:`Scatter`,"scatter-lines":`Scatter with straight lines and markers`,"scatter-smooth":`Scatter with smooth lines and markers`},type:`Chart type`,title:`Chart title`,legend:`Legend`,legendAt:{none:`None`,bottom:`Bottom`,top:`Top`,left:`Left`,right:`Right`},dataLabels:`Data labels`,smooth:`Smooth lines`,barColors:`Colour of each bar`,addCategory:`Add category`,addSeries:`Add series`,deleteCategory:`Delete category`,deleteSeries:`Delete series`,cell:(e,t)=>`Row ${String(e)}, column ${String(t)}`,fromFile:e=>`The numbers come from ${e}: change them there.`,notHere:e=>`The numbers from ${e} are not here yet.`,cannotDraw:`This chart cannot be drawn`},emptyEquation:`Empty equation`,emptyDiagram:`Empty diagram`,style:`Style`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Accent`,defaultColor:`Default`,pageNumbers:`Page numbers`,page:{preset:`Preset`,none:`None`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Brief`,memo:`Memo`,"business-letter":`Business letter`},paper:`Paper`,orientation:`Orientation`,portrait:`Portrait`,landscape:`Landscape`,margins:`Margins`,marginNames:{normal:`Normal`,narrow:`Narrow`,wide:`Wide`},size:`Text size`,pt:e=>`${String(e)} pt`,lineHeight:`Line height`,grid:`The grid`,indent:`Indent first lines`},tocEmpty:`No headings yet`,sourcesEmpty:`Cite a source with [@key] to list it here`,pages:`Pages`,pagesPrinting:`Printing…`,pagesFailed:e=>`The pages could not be printed: ${e}`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,pageBlock:e=>`A block on page ${String(e)}: show it in the text`,cover:{add:`Add cover`,change:`Change cover`,reposition:`Reposition`,remove:`Remove`,drag:`Drag image to reposition`,save:`Save position`,cancel:`Cancel`,upload:`Upload`,none:`No pictures in the project`,gallery:`Gallery`,project:`Project`,names:{dots:`Pointillist`,scales:`Sea scales`,bay:`Evening bay`,stacks:`Wheat stacks`,steam:`Steam train`,dusk:`Mountains at dusk`,lake:`Lake at dawn`}}},"zh-cn":{loading:`正在打开…`,unreadable:`这份文档现在显示不了:文件的写法不对。下面是它的原文。`,duplicate:`复制一份`,remove:`删除`,colors:`颜色`,tag:`标签`,noTag:`不加标签`,nothing:`没有叫这个名字的块`,nothingToLink:`项目里没有叫这个名字的内容`,turnInto:`转换为`,aligns:{left:`左对齐`,center:`居中`,right:`右对齐`,justify:`两端对齐`},copyPlace:`复制它在文件里的位置`,find:`输入要做的事…`,text:`文字`,background:`背景`,placeholder:`输入文字,或按 / 选择块`,heading:`标题`,colorNames:{gray:`灰色`,brown:`棕色`,red:`红色`,orange:`橙色`,yellow:`黄色`,green:`绿色`,blue:`蓝色`,purple:`紫色`,pink:`粉色`},embed:`由代码绘制`,title:`标题`,untitled:`未命名`,outline:`本页目录`,blocks:{paragraph:`正文`,heading1:`一级标题`,heading2:`二级标题`,heading3:`三级标题`,bullet:`无序列表`,numbered:`有序列表`,check:`待办清单`,toggle:`折叠`,quote:`引用`,callout:`提示块`,code:`代码`,divider:`分隔线`,table:`表格`,image:`图片`,chart:`图表`,equation:`公式`,diagram:`图示`,columns2:`2 栏`,columns3:`3 栏`,footnote:`脚注`,pagebreak:`分页符`,pagebreakLandscape:`分页符,之后横向`,pagebreakPortrait:`分页符,之后纵向`,toc:`目录`,bibliography:`参考文献`,card:`卡片`,stats:`数字卡`},component:`组件`,stats:{label:`名称`,value:`数值`,delta:`变化`,note:`备注`,trend:`走势:12, 15, 14`,add:`添加一个数字`,remove:`删除这个数字`},card:{title:`卡片标题`,subtitle:`副标题`},sample:{category:e=>`类别 ${String(e)}`,series:e=>`系列 ${String(e)}`},chart:{types:{"column-clustered":`簇状柱形图`,"column-stacked":`堆积柱形图`,"column-stacked-100":`百分比堆积柱形图`,"bar-clustered":`簇状条形图`,"bar-stacked":`堆积条形图`,"bar-stacked-100":`百分比堆积条形图`,line:`折线图`,"line-markers":`带数据标记的折线图`,area:`面积图`,"area-stacked":`堆积面积图`,"area-stacked-100":`百分比堆积面积图`,pie:`饼图`,doughnut:`圆环图`,scatter:`散点图`,"scatter-lines":`带直线和数据标记的散点图`,"scatter-smooth":`带平滑线和数据标记的散点图`},type:`图表类型`,title:`图表标题`,legend:`图例`,legendAt:{none:`无`,bottom:`底部`,top:`顶部`,left:`左侧`,right:`右侧`},dataLabels:`数据标签`,smooth:`平滑曲线`,barColors:`每根柱子的颜色`,addCategory:`添加类别`,addSeries:`添加系列`,deleteCategory:`删除类别`,deleteSeries:`删除系列`,cell:(e,t)=>`第 ${String(e)} 行,第 ${String(t)} 列`,fromFile:e=>`数值来自 ${e}:请在那里修改。`,notHere:e=>`${e} 的数值还没到。`,cannotDraw:`这个图表画不出来`},emptyEquation:`空公式`,emptyDiagram:`空图示`,style:`样式`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋体`,hei:`黑体`,fangsong:`仿宋`,kai:`楷体`,xiaobiaosong:`小标宋`},accent:`强调色`,defaultColor:`默认`,pageNumbers:`页码`,page:{preset:`预设`,none:`无`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`简报`,memo:`备忘录`,"business-letter":`商务信函`},paper:`纸张`,orientation:`方向`,portrait:`纵向`,landscape:`横向`,margins:`页边距`,marginNames:{normal:`普通`,narrow:`窄`,wide:`宽`},size:`字号`,pt:e=>`${String(e)} 磅`,lineHeight:`行距`,grid:`按网格`,indent:`首行缩进`},tocEmpty:`还没有标题`,sourcesEmpty:`用 [@key] 引用文献后会列在这里`,pages:`分页`,pagesPrinting:`正在排版…`,pagesFailed:e=>`无法排出页面:${e}`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,pageBlock:e=>`第 ${String(e)} 页上的一块:在正文中显示`,cover:{add:`添加封面`,change:`更换封面`,reposition:`调整位置`,remove:`移除`,drag:`拖动图片以调整位置`,save:`保存位置`,cancel:`取消`,upload:`上传`,none:`项目中没有图片`,gallery:`图库`,project:`项目`,names:{dots:`点彩`,scales:`青海波`,bay:`暮色海湾`,stacks:`麦垛`,steam:`蒸汽火车`,dusk:`暮山`,lake:`晨湖`}}},"zh-tw":{loading:`正在打開…`,unreadable:`目前無法顯示這份文件:它的檔案不是以文件的格式撰寫。以下是檔案的原文。`,duplicate:`複製一份`,remove:`刪除`,colors:`顏色`,tag:`標籤`,noTag:`不加標籤`,nothing:`沒有這個名稱的區塊`,nothingToLink:`專案中沒有這個名稱的內容`,turnInto:`轉換為`,aligns:{left:`靠左對齊`,center:`置中`,right:`靠右對齊`,justify:`左右對齊`},copyPlace:`拷貝它在檔案中的位置`,find:`搜尋要做的事…`,text:`文字`,background:`背景`,placeholder:`輸入文字,或按 / 選擇區塊`,heading:`標題`,colorNames:{gray:`灰色`,brown:`棕色`,red:`紅色`,orange:`橘色`,yellow:`黃色`,green:`綠色`,blue:`藍色`,purple:`紫色`,pink:`粉紅色`},embed:`由程式碼繪製`,title:`標題`,untitled:`未命名`,outline:`本頁內容`,blocks:{paragraph:`文字`,heading1:`標題 1`,heading2:`標題 2`,heading3:`標題 3`,bullet:`項目符號清單`,numbered:`編號清單`,check:`待辦清單`,toggle:`摺疊`,quote:`引言`,callout:`標註`,code:`程式碼`,divider:`分隔線`,table:`表格`,image:`圖片`,chart:`圖表`,equation:`方程式`,diagram:`圖示`,columns2:`2 欄`,columns3:`3 欄`,footnote:`註腳`,pagebreak:`分頁符號`,pagebreakLandscape:`分頁符,之後橫向`,pagebreakPortrait:`分頁符,之後縱向`,toc:`目錄`,bibliography:`參考文獻`,card:`卡片`,stats:`數字卡`},component:`元件`,stats:{label:`名稱`,value:`數值`,delta:`變化`,note:`備註`,trend:`走勢:12, 15, 14`,add:`新增一個數字`,remove:`刪除這個數字`},card:{title:`卡片標題`,subtitle:`副標題`},sample:{category:e=>`類別 ${String(e)}`,series:e=>`數列 ${String(e)}`},chart:{types:{"column-clustered":`群組直條圖`,"column-stacked":`堆疊直條圖`,"column-stacked-100":`百分比堆疊直條圖`,"bar-clustered":`群組橫條圖`,"bar-stacked":`堆疊橫條圖`,"bar-stacked-100":`百分比堆疊橫條圖`,line:`折線圖`,"line-markers":`含有資料標記的折線圖`,area:`區域圖`,"area-stacked":`堆疊區域圖`,"area-stacked-100":`百分比堆疊區域圖`,pie:`圓形圖`,doughnut:`環圈圖`,scatter:`散佈圖`,"scatter-lines":`帶有直線和資料標記的散佈圖`,"scatter-smooth":`帶有平滑線和資料標記的散佈圖`},type:`圖表類型`,title:`圖表標題`,legend:`圖例`,legendAt:{none:`無`,bottom:`下`,top:`上`,left:`左`,right:`右`},dataLabels:`資料標籤`,smooth:`平滑曲線`,barColors:`每根長條的顏色`,addCategory:`新增類別`,addSeries:`新增數列`,deleteCategory:`刪除類別`,deleteSeries:`刪除數列`,cell:(e,t)=>`第 ${String(e)} 列,第 ${String(t)} 欄`,fromFile:e=>`數值來自 ${e}:請在那裡修改。`,notHere:e=>`${e} 的數值還沒到。`,cannotDraw:`這個圖表畫不出來`},emptyEquation:`空方程式`,emptyDiagram:`空圖示`,style:`樣式`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋體`,hei:`黑體`,fangsong:`仿宋`,kai:`楷體`,xiaobiaosong:`小標宋`},accent:`強調色`,defaultColor:`預設`,pageNumbers:`頁碼`,page:{preset:`預設`,none:`無`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`簡報`,memo:`備忘錄`,"business-letter":`商務信函`},paper:`紙張`,orientation:`方向`,portrait:`縱向`,landscape:`橫向`,margins:`邊界`,marginNames:{normal:`一般`,narrow:`窄`,wide:`寬`},size:`字級`,pt:e=>`${String(e)} pt`,lineHeight:`行距`,grid:`依格線`,indent:`首行縮排`},tocEmpty:`還沒有標題`,sourcesEmpty:`用 [@key] 引用文獻後會列在這裡`,pages:`分頁`,pagesPrinting:`正在排版…`,pagesFailed:e=>`無法排出頁面:${e}`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,pageBlock:e=>`第 ${String(e)} 頁上的一塊:在正文中顯示`,cover:{add:`新增封面`,change:`更換封面`,reposition:`調整位置`,remove:`移除`,drag:`拖曳圖片以調整位置`,save:`儲存位置`,cancel:`取消`,upload:`上傳`,none:`專案中沒有圖片`,gallery:`圖庫`,project:`專案`,names:{dots:`點彩`,scales:`青海波`,bay:`暮色海灣`,stacks:`麥垛`,steam:`蒸汽火車`,dusk:`暮山`,lake:`晨湖`}}},ja:{loading:`開いています…`,unreadable:`このドキュメントは現在表示できません:ファイルがドキュメントの形式で書かれていません。ファイルの内容は次のとおりです。`,duplicate:`複製`,remove:`削除`,colors:`カラー`,tag:`タグ`,noTag:`タグなし`,nothing:`その名前のブロックはありません`,nothingToLink:`その名前のものはプロジェクトにありません`,turnInto:`ブロックタイプの変更`,aligns:{left:`左揃え`,center:`中央揃え`,right:`右揃え`,justify:`両端揃え`},copyPlace:`ファイル内の位置をコピー`,find:`操作を検索…`,text:`文字`,background:`背景`,placeholder:`入力するか、/ でブロックを選択`,heading:`見出し`,colorNames:{gray:`グレー`,brown:`ブラウン`,red:`レッド`,orange:`オレンジ`,yellow:`イエロー`,green:`グリーン`,blue:`ブルー`,purple:`パープル`,pink:`ピンク`},embed:`コードで描画`,title:`タイトル`,untitled:`無題`,outline:`このページの内容`,blocks:{paragraph:`テキスト`,heading1:`見出し 1`,heading2:`見出し 2`,heading3:`見出し 3`,bullet:`箇条書きリスト`,numbered:`番号付きリスト`,check:`ToDo リスト`,toggle:`トグル`,quote:`引用`,callout:`コールアウト`,code:`コード`,divider:`区切り線`,table:`表`,image:`画像`,chart:`グラフ`,equation:`数式`,diagram:`ダイアグラム`,columns2:`2列`,columns3:`3列`,footnote:`脚注`,pagebreak:`改ページ`,pagebreakLandscape:`改ページ(以降は横向き)`,pagebreakPortrait:`改ページ(以降は縦向き)`,toc:`目次`,bibliography:`参考文献`,card:`カード`,stats:`数値カード`},component:`コンポーネント`,stats:{label:`ラベル`,value:`値`,delta:`変化`,note:`注記`,trend:`推移:12, 15, 14`,add:`数値を追加`,remove:`この数値を削除`},card:{title:`カードのタイトル`,subtitle:`サブタイトル`},sample:{category:e=>`分類 ${String(e)}`,series:e=>`系列 ${String(e)}`},chart:{types:{"column-clustered":`集合縦棒`,"column-stacked":`積み上げ縦棒`,"column-stacked-100":`100% 積み上げ縦棒`,"bar-clustered":`集合横棒`,"bar-stacked":`積み上げ横棒`,"bar-stacked-100":`100% 積み上げ横棒`,line:`折れ線`,"line-markers":`マーカー付き折れ線`,area:`面`,"area-stacked":`積み上げ面`,"area-stacked-100":`100% 積み上げ面`,pie:`円`,doughnut:`ドーナツ`,scatter:`散布図`,"scatter-lines":`散布図 (直線とマーカー)`,"scatter-smooth":`散布図 (平滑線とマーカー)`},type:`グラフの種類`,title:`グラフ タイトル`,legend:`凡例`,legendAt:{none:`なし`,bottom:`下`,top:`上`,left:`左`,right:`右`},dataLabels:`データ ラベル`,smooth:`滑らかな線`,barColors:`棒ごとの色`,addCategory:`分類を追加`,addSeries:`系列を追加`,deleteCategory:`分類を削除`,deleteSeries:`系列を削除`,cell:(e,t)=>`${String(e)} 行目、${String(t)} 列目`,fromFile:e=>`数値は ${e} から読み込まれます。そちらで変更してください。`,notHere:e=>`${e} の数値はまだ届いていません。`,cannotDraw:`このグラフは描画できません`},emptyEquation:`空の数式`,emptyDiagram:`空のダイアグラム`,style:`スタイル`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋朝体`,hei:`黒体`,fangsong:`仿宋体`,kai:`楷書体`,xiaobiaosong:`小標宋`},accent:`アクセント`,defaultColor:`デフォルト`,pageNumbers:`ページ番号`,page:{preset:`プリセット`,none:`なし`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`ブリーフ`,memo:`社内メモ`,"business-letter":`ビジネスレター`},paper:`用紙`,orientation:`向き`,portrait:`縦`,landscape:`横`,margins:`余白`,marginNames:{normal:`標準`,narrow:`狭い`,wide:`広い`},size:`文字サイズ`,pt:e=>`${String(e)} pt`,lineHeight:`行の高さ`,grid:`グリッド`,indent:`段落の字下げ`},tocEmpty:`まだ見出しがありません`,sourcesEmpty:`[@key] で文献を引用すると、ここに並びます`,pages:`ページ`,pagesPrinting:`印刷中…`,pagesFailed:e=>`ページを印刷できませんでした:${e}`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,pageBlock:e=>`${String(e)} ページのブロック:本文で表示`,cover:{add:`カバーを追加`,change:`カバーを変更`,reposition:`位置を調整`,remove:`削除`,drag:`画像をドラッグして位置を調整`,save:`位置を保存`,cancel:`キャンセル`,upload:`アップロード`,none:`プロジェクトに画像がありません`,gallery:`ギャラリー`,project:`プロジェクト`,names:{dots:`点描`,scales:`青海波`,bay:`夕暮れの入江`,stacks:`積みわら`,steam:`蒸気機関車`,dusk:`夕暮れの山`,lake:`夜明けの湖`}}},ko:{loading:`여는 중…`,unreadable:`지금은 이 문서를 표시할 수 없습니다. 파일이 문서 형식으로 쓰여 있지 않습니다. 파일 내용은 다음과 같습니다.`,duplicate:`복제`,remove:`삭제`,colors:`색상`,tag:`태그`,noTag:`태그 없음`,nothing:`해당 이름의 블록이 없습니다`,nothingToLink:`프로젝트에 해당 이름의 항목이 없습니다`,turnInto:`변환`,aligns:{left:`왼쪽`,center:`가운데`,right:`오른쪽`,justify:`양쪽 맞춤`},copyPlace:`파일 내 위치 복사`,find:`할 작업 찾기…`,text:`텍스트`,background:`배경`,placeholder:`입력하거나 /를 눌러 블록 추가`,heading:`제목`,colorNames:{gray:`회색`,brown:`갈색`,red:`빨간색`,orange:`주황색`,yellow:`노란색`,green:`초록색`,blue:`파란색`,purple:`보라색`,pink:`분홍색`},embed:`코드로 그린 항목`,title:`제목`,untitled:`제목 없음`,outline:`이 페이지의 내용`,blocks:{paragraph:`텍스트`,heading1:`제목 1`,heading2:`제목 2`,heading3:`제목 3`,bullet:`글머리 기호 목록`,numbered:`번호 매기기 목록`,check:`할 일 목록`,toggle:`토글`,quote:`인용`,callout:`콜아웃`,code:`코드`,divider:`구분선`,table:`표`,image:`이미지`,chart:`차트`,equation:`수식`,diagram:`다이어그램`,columns2:`2열`,columns3:`3열`,footnote:`각주`,pagebreak:`페이지 나누기`,pagebreakLandscape:`페이지 나누기, 이후 가로`,pagebreakPortrait:`페이지 나누기, 이후 세로`,toc:`목차`,bibliography:`참고 문헌`,card:`카드`,stats:`수치 카드`},component:`컴포넌트`,stats:{label:`이름`,value:`값`,delta:`변화`,note:`메모`,trend:`추이: 12, 15, 14`,add:`수치 추가`,remove:`이 수치 삭제`},card:{title:`카드 제목`,subtitle:`부제`},sample:{category:e=>`항목 ${String(e)}`,series:e=>`계열 ${String(e)}`},chart:{types:{"column-clustered":`묶은 세로 막대형`,"column-stacked":`누적 세로 막대형`,"column-stacked-100":`100% 기준 누적 세로 막대형`,"bar-clustered":`묶은 가로 막대형`,"bar-stacked":`누적 가로 막대형`,"bar-stacked-100":`100% 기준 누적 가로 막대형`,line:`꺾은선형`,"line-markers":`표식이 있는 꺾은선형`,area:`영역형`,"area-stacked":`누적 영역형`,"area-stacked-100":`100% 기준 누적 영역형`,pie:`원형`,doughnut:`도넛형`,scatter:`분산형`,"scatter-lines":`직선 및 표식이 있는 분산형`,"scatter-smooth":`곡선 및 표식이 있는 분산형`},type:`차트 종류`,title:`차트 제목`,legend:`범례`,legendAt:{none:`없음`,bottom:`아래쪽`,top:`위쪽`,left:`왼쪽`,right:`오른쪽`},dataLabels:`데이터 레이블`,smooth:`부드러운 선`,barColors:`막대별 색`,addCategory:`항목 추가`,addSeries:`계열 추가`,deleteCategory:`항목 삭제`,deleteSeries:`계열 삭제`,cell:(e,t)=>`${String(e)}행, ${String(t)}열`,fromFile:e=>`숫자는 ${e}에서 가져옵니다. 그곳에서 변경하세요.`,notHere:e=>`${e}의 숫자가 아직 오지 않았습니다.`,cannotDraw:`이 차트를 그릴 수 없습니다`},emptyEquation:`빈 수식`,emptyDiagram:`빈 다이어그램`,style:`스타일`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`송체`,hei:`흑체`,fangsong:`방송체`,kai:`해서체`,xiaobiaosong:`소표송`},accent:`강조 색`,defaultColor:`기본값`,pageNumbers:`페이지 번호`,page:{preset:`프리셋`,none:`없음`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`브리프`,memo:`메모`,"business-letter":`비즈니스 서신`},paper:`용지`,orientation:`방향`,portrait:`세로`,landscape:`가로`,margins:`여백`,marginNames:{normal:`보통`,narrow:`좁게`,wide:`넓게`},size:`글자 크기`,pt:e=>`${String(e)} pt`,lineHeight:`줄 높이`,grid:`격자`,indent:`첫 줄 들여쓰기`},tocEmpty:`아직 제목이 없습니다`,sourcesEmpty:`[@key]로 출처를 인용하면 여기에 나열됩니다`,pages:`페이지`,pagesPrinting:`인쇄 중…`,pagesFailed:e=>`페이지를 인쇄하지 못했습니다: ${e}`,pageOf:(e,t)=>`${String(t)}쪽 중 ${String(e)}쪽`,pageBlock:e=>`${String(e)}쪽의 블록: 본문에서 보기`,cover:{add:`커버 추가`,change:`커버 변경`,reposition:`위치 변경`,remove:`제거`,drag:`이미지를 드래그하여 위치 변경`,save:`위치 저장`,cancel:`취소`,upload:`업로드`,none:`프로젝트에 이미지가 없습니다`,gallery:`갤러리`,project:`프로젝트`,names:{dots:`점묘`,scales:`청해파`,bay:`저녁 만`,stacks:`밀짚 더미`,steam:`증기 기관차`,dusk:`해 질 녘 산`,lake:`새벽 호수`}}},es:{loading:`Abriendo…`,unreadable:`Este documento no se puede mostrar ahora: su archivo no está escrito como un documento. Esto es lo que dice.`,duplicate:`Duplicar`,remove:`Eliminar`,colors:`Colores`,tag:`Etiqueta`,noTag:`Sin etiqueta`,nothing:`Ningún bloque con ese nombre`,nothingToLink:`No hay nada en el proyecto con ese nombre`,turnInto:`Convertir en`,aligns:{left:`Izquierda`,center:`Centro`,right:`Derecha`,justify:`Justificar`},copyPlace:`Copiar su posición en el archivo`,find:`Busca qué hacer…`,text:`texto`,background:`fondo`,placeholder:`Escribe o pulsa / para ver los bloques`,heading:`Encabezado`,colorNames:{gray:`Gris`,brown:`Marrón`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,green:`Verde`,blue:`Azul`,purple:`Morado`,pink:`Rosa`},embed:`Dibujado con código`,title:`Título`,untitled:`Sin título`,outline:`En esta página`,blocks:{paragraph:`Texto`,heading1:`Encabezado 1`,heading2:`Encabezado 2`,heading3:`Encabezado 3`,bullet:`Lista con viñetas`,numbered:`Lista numerada`,check:`Lista de tareas`,toggle:`Desplegable`,quote:`Cita`,callout:`Destacado`,code:`Código`,divider:`Separador`,table:`Tabla`,image:`Imagen`,chart:`Gráfico`,equation:`Ecuación`,diagram:`Diagrama`,columns2:`2 columnas`,columns3:`3 columnas`,footnote:`Nota al pie`,pagebreak:`Salto de página`,pagebreakLandscape:`Salto de página, luego horizontal`,pagebreakPortrait:`Salto de página, luego vertical`,toc:`Índice`,bibliography:`Bibliografía`,card:`Tarjeta`,stats:`Cifras`},component:`Componente`,stats:{label:`Etiqueta`,value:`Valor`,delta:`Cambio`,note:`Nota`,trend:`Tendencia: 12, 15, 14`,add:`Añadir una cifra`,remove:`Quitar esta cifra`},card:{title:`Título de la tarjeta`,subtitle:`Subtítulo`},sample:{category:e=>`Categoría ${String(e)}`,series:e=>`Serie ${String(e)}`},chart:{types:{"column-clustered":`Columna agrupada`,"column-stacked":`Columna apilada`,"column-stacked-100":`Columna 100% apilada`,"bar-clustered":`Barra agrupada`,"bar-stacked":`Barra apilada`,"bar-stacked-100":`Barra 100% apilada`,line:`Línea`,"line-markers":`Línea con marcadores`,area:`Área`,"area-stacked":`Área apilada`,"area-stacked-100":`Área 100% apilada`,pie:`Circular`,doughnut:`Anillo`,scatter:`Dispersión`,"scatter-lines":`Dispersión con líneas rectas y marcadores`,"scatter-smooth":`Dispersión con líneas suavizadas y marcadores`},type:`Tipo de gráfico`,title:`Título del gráfico`,legend:`Leyenda`,legendAt:{none:`Ninguna`,bottom:`Abajo`,top:`Arriba`,left:`Izquierda`,right:`Derecha`},dataLabels:`Etiquetas de datos`,smooth:`Líneas suavizadas`,barColors:`Color de cada barra`,addCategory:`Agregar categoría`,addSeries:`Agregar serie`,deleteCategory:`Eliminar categoría`,deleteSeries:`Eliminar serie`,cell:(e,t)=>`Fila ${String(e)}, columna ${String(t)}`,fromFile:e=>`Los números vienen de ${e}: cámbialos allí.`,notHere:e=>`Los números de ${e} aún no han llegado.`,cannotDraw:`Este gráfico no se puede dibujar`},emptyEquation:`Ecuación vacía`,emptyDiagram:`Diagrama vacío`,style:`Estilo`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Acento`,defaultColor:`Predeterminado`,pageNumbers:`Números de página`,page:{preset:`Plantilla`,none:`Ninguna`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Brief`,memo:`Memorándum`,"business-letter":`Carta comercial`},paper:`Papel`,orientation:`Orientación`,portrait:`Vertical`,landscape:`Horizontal`,margins:`Márgenes`,marginNames:{normal:`Normal`,narrow:`Estrecho`,wide:`Ancho`},size:`Tamaño del texto`,pt:e=>`${String(e)} pt`,lineHeight:`Interlineado`,grid:`La cuadrícula`,indent:`Sangrar primeras líneas`},tocEmpty:`Aún no hay encabezados`,sourcesEmpty:`Cita una fuente con [@key] para listarla aquí`,pages:`Páginas`,pagesPrinting:`Imprimiendo…`,pagesFailed:e=>`No se pudieron imprimir las páginas: ${e}`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,pageBlock:e=>`Un bloque en la página ${String(e)}: mostrarlo en el texto`,cover:{add:`Añadir portada`,change:`Cambiar portada`,reposition:`Reposicionar`,remove:`Quitar`,drag:`Arrastra la imagen para reposicionarla`,save:`Guardar posición`,cancel:`Cancelar`,upload:`Subir`,none:`No hay imágenes en el proyecto`,gallery:`Galería`,project:`Proyecto`,names:{dots:`Puntillismo`,scales:`Escamas de mar`,bay:`Bahía al atardecer`,stacks:`Almiares`,steam:`Tren de vapor`,dusk:`Montañas al anochecer`,lake:`Lago al alba`}}},fr:{loading:`Ouverture…`,unreadable:`Ce document ne peut pas être affiché pour l’instant\xA0: son fichier n’est pas écrit comme un document. Voici ce qu’il contient.`,duplicate:`Dupliquer`,remove:`Supprimer`,colors:`Couleurs`,tag:`Étiquette`,noTag:`Sans étiquette`,nothing:`Aucun bloc de ce nom`,nothingToLink:`Rien de ce nom dans le projet`,turnInto:`Transformer en`,aligns:{left:`À gauche`,center:`Centré`,right:`À droite`,justify:`Justifié`},copyPlace:`Copier son emplacement dans le fichier`,find:`Rechercher une action…`,text:`texte`,background:`fond`,placeholder:`Écrivez, ou tapez / pour les blocs`,heading:`Titre`,colorNames:{gray:`Gris`,brown:`Marron`,red:`Rouge`,orange:`Orange`,yellow:`Jaune`,green:`Vert`,blue:`Bleu`,purple:`Violet`,pink:`Rose`},embed:`Dessiné par du code`,title:`Titre`,untitled:`Sans titre`,outline:`Sur cette page`,blocks:{paragraph:`Texte`,heading1:`Titre 1`,heading2:`Titre 2`,heading3:`Titre 3`,bullet:`Liste à puces`,numbered:`Liste numérotée`,check:`Liste de tâches`,toggle:`Bloc dépliable`,quote:`Citation`,callout:`Encadré`,code:`Code`,divider:`Séparateur`,table:`Tableau`,image:`Image`,chart:`Graphique`,equation:`Équation`,diagram:`Diagramme`,columns2:`2 colonnes`,columns3:`3 colonnes`,footnote:`Note de bas de page`,pagebreak:`Saut de page`,pagebreakLandscape:`Saut de page, puis paysage`,pagebreakPortrait:`Saut de page, puis portrait`,toc:`Sommaire`,bibliography:`Bibliographie`,card:`Carte`,stats:`Chiffres clés`},component:`Composant`,stats:{label:`Libellé`,value:`Valeur`,delta:`Variation`,note:`Note`,trend:`Tendance : 12, 15, 14`,add:`Ajouter un chiffre`,remove:`Retirer ce chiffre`},card:{title:`Titre de la carte`,subtitle:`Sous-titre`},sample:{category:e=>`Catégorie ${String(e)}`,series:e=>`Série ${String(e)}`},chart:{types:{"column-clustered":`Histogramme groupé`,"column-stacked":`Histogramme empilé`,"column-stacked-100":`Histogramme empilé 100 %`,"bar-clustered":`Barres groupées`,"bar-stacked":`Barres empilées`,"bar-stacked-100":`Barres empilées 100 %`,line:`Courbes`,"line-markers":`Courbes avec marques`,area:`Aires`,"area-stacked":`Aires empilées`,"area-stacked-100":`Aires empilées 100 %`,pie:`Secteurs`,doughnut:`Anneau`,scatter:`Nuage de points`,"scatter-lines":`Nuage de points avec lignes droites et marqueurs`,"scatter-smooth":`Nuage de points avec courbes lissées et marqueurs`},type:`Type de graphique`,title:`Titre du graphique`,legend:`Légende`,legendAt:{none:`Aucune`,bottom:`Bas`,top:`Haut`,left:`Gauche`,right:`Droite`},dataLabels:`Étiquettes de données`,smooth:`Lignes lissées`,barColors:`Couleur de chaque barre`,addCategory:`Ajouter une catégorie`,addSeries:`Ajouter une série`,deleteCategory:`Supprimer la catégorie`,deleteSeries:`Supprimer la série`,cell:(e,t)=>`Ligne ${String(e)}, colonne ${String(t)}`,fromFile:e=>`Les nombres viennent de ${e} : modifiez-les là-bas.`,notHere:e=>`Les nombres de ${e} ne sont pas encore là.`,cannotDraw:`Ce graphique ne peut pas être dessiné`},emptyEquation:`Équation vide`,emptyDiagram:`Diagramme vide`,style:`Style`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Accent`,defaultColor:`Par défaut`,pageNumbers:`Numéros de page`,page:{preset:`Modèle`,none:`Aucun`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Brief`,memo:`Note de service`,"business-letter":`Lettre commerciale`},paper:`Papier`,orientation:`Orientation`,portrait:`Portrait`,landscape:`Paysage`,margins:`Marges`,marginNames:{normal:`Normales`,narrow:`Étroites`,wide:`Larges`},size:`Taille du texte`,pt:e=>`${String(e)} pt`,lineHeight:`Interligne`,grid:`La grille`,indent:`Retrait de première ligne`},tocEmpty:`Pas encore de titres`,sourcesEmpty:`Citez une source avec [@key] pour la lister ici`,pages:`Pages`,pagesPrinting:`Impression…`,pagesFailed:e=>`Les pages n’ont pas pu être imprimées : ${e}`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,pageBlock:e=>`Un bloc de la page ${String(e)} : le montrer dans le texte`,cover:{add:`Ajouter une couverture`,change:`Changer de couverture`,reposition:`Repositionner`,remove:`Retirer`,drag:`Faites glisser l’image pour la repositionner`,save:`Enregistrer la position`,cancel:`Annuler`,upload:`Importer`,none:`Aucune image dans le projet`,gallery:`Galerie`,project:`Projet`,names:{dots:`Pointillisme`,scales:`Écailles de mer`,bay:`Baie au soir`,stacks:`Meules de blé`,steam:`Train à vapeur`,dusk:`Montagnes au crépuscule`,lake:`Lac à l'aube`}}},de:{loading:`Wird geöffnet …`,unreadable:`Dieses Dokument kann gerade nicht angezeigt werden: Seine Datei ist nicht als Dokument geschrieben. Hier steht, was sie enthält.`,duplicate:`Duplizieren`,remove:`Löschen`,colors:`Farben`,tag:`Etikett`,noTag:`Kein Etikett`,nothing:`Kein Block mit diesem Namen`,nothingToLink:`Nichts im Projekt mit diesem Namen`,turnInto:`Umwandeln in`,aligns:{left:`Links`,center:`Zentriert`,right:`Rechts`,justify:`Blocksatz`},copyPlace:`Stelle in der Datei kopieren`,find:`Aktion suchen …`,text:`Text`,background:`Hintergrund`,placeholder:`Schreib, oder drück / für Blöcke`,heading:`Überschrift`,colorNames:{gray:`Grau`,brown:`Braun`,red:`Rot`,orange:`Orange`,yellow:`Gelb`,green:`Grün`,blue:`Blau`,purple:`Lila`,pink:`Pink`},embed:`Per Code gezeichnet`,title:`Titel`,untitled:`Ohne Titel`,outline:`Auf dieser Seite`,blocks:{paragraph:`Text`,heading1:`Überschrift 1`,heading2:`Überschrift 2`,heading3:`Überschrift 3`,bullet:`Aufzählung`,numbered:`Nummerierte Liste`,check:`To-do-Liste`,toggle:`Toggle-Liste`,quote:`Zitat`,callout:`Hinweis`,code:`Code`,divider:`Trennlinie`,table:`Tabelle`,image:`Bild`,chart:`Diagramm`,equation:`Formel`,diagram:`Schaubild`,columns2:`2 Spalten`,columns3:`3 Spalten`,footnote:`Fußnote`,pagebreak:`Seitenumbruch`,pagebreakLandscape:`Seitenumbruch, danach Querformat`,pagebreakPortrait:`Seitenumbruch, danach Hochformat`,toc:`Inhalt`,bibliography:`Literaturverzeichnis`,card:`Karte`,stats:`Kennzahlen`},component:`Komponente`,stats:{label:`Bezeichnung`,value:`Wert`,delta:`Veränderung`,note:`Anmerkung`,trend:`Verlauf: 12, 15, 14`,add:`Kennzahl hinzufügen`,remove:`Diese Kennzahl entfernen`},card:{title:`Kartentitel`,subtitle:`Untertitel`},sample:{category:e=>`Kategorie ${String(e)}`,series:e=>`Datenreihe ${String(e)}`},chart:{types:{"column-clustered":`Gruppierte Säulen`,"column-stacked":`Gestapelte Säulen`,"column-stacked-100":`Gestapelte Säulen (100 %)`,"bar-clustered":`Gruppierte Balken`,"bar-stacked":`Gestapelte Balken`,"bar-stacked-100":`Gestapelte Balken (100 %)`,line:`Linie`,"line-markers":`Linie mit Datenpunkten`,area:`Fläche`,"area-stacked":`Gestapelte Fläche`,"area-stacked-100":`Gestapelte Fläche (100 %)`,pie:`Kreis`,doughnut:`Ring`,scatter:`Punkt (XY)`,"scatter-lines":`Punkte mit geraden Linien und Datenpunkten`,"scatter-smooth":`Punkte mit interpolierten Linien und Datenpunkten`},type:`Diagrammtyp`,title:`Diagrammtitel`,legend:`Legende`,legendAt:{none:`Keine`,bottom:`Unten`,top:`Oben`,left:`Links`,right:`Rechts`},dataLabels:`Datenbeschriftungen`,smooth:`Glatte Linien`,barColors:`Farbe je Balken`,addCategory:`Kategorie hinzufügen`,addSeries:`Datenreihe hinzufügen`,deleteCategory:`Kategorie löschen`,deleteSeries:`Datenreihe löschen`,cell:(e,t)=>`Zeile ${String(e)}, Spalte ${String(t)}`,fromFile:e=>`Die Zahlen stammen aus ${e}: Ändern Sie sie dort.`,notHere:e=>`Die Zahlen aus ${e} sind noch nicht da.`,cannotDraw:`Dieses Diagramm kann nicht gezeichnet werden`},emptyEquation:`Leere Formel`,emptyDiagram:`Leeres Schaubild`,style:`Stil`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Akzent`,defaultColor:`Standard`,pageNumbers:`Seitenzahlen`,page:{preset:`Vorlage`,none:`Keine`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Briefing`,memo:`Memo`,"business-letter":`Geschäftsbrief`},paper:`Papier`,orientation:`Ausrichtung`,portrait:`Hochformat`,landscape:`Querformat`,margins:`Ränder`,marginNames:{normal:`Normal`,narrow:`Schmal`,wide:`Breit`},size:`Schriftgröße`,pt:e=>`${String(e)} pt`,lineHeight:`Zeilenhöhe`,grid:`Das Raster`,indent:`Erste Zeile einrücken`},tocEmpty:`Noch keine Überschriften`,sourcesEmpty:`Eine Quelle mit [@key] zitieren, um sie hier aufzuführen`,pages:`Seiten`,pagesPrinting:`Wird gedruckt …`,pagesFailed:e=>`Die Seiten konnten nicht gedruckt werden: ${e}`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,pageBlock:e=>`Ein Block auf Seite ${String(e)}: im Text zeigen`,cover:{add:`Titelbild hinzufügen`,change:`Titelbild ändern`,reposition:`Neu positionieren`,remove:`Entfernen`,drag:`Bild ziehen, um es neu zu positionieren`,save:`Position speichern`,cancel:`Abbrechen`,upload:`Hochladen`,none:`Keine Bilder im Projekt`,gallery:`Galerie`,project:`Projekt`,names:{dots:`Pointillismus`,scales:`Meeresschuppen`,bay:`Bucht am Abend`,stacks:`Weizenschober`,steam:`Dampflok`,dusk:`Berge in der Dämmerung`,lake:`See im Morgenlicht`}}},pt:{loading:`Abrindo…`,unreadable:`Não é possível mostrar este documento agora: o arquivo não está escrito como documento. Veja o que ele diz.`,duplicate:`Duplicar`,remove:`Excluir`,colors:`Cores`,tag:`Etiqueta`,noTag:`Sem etiqueta`,nothing:`Nenhum bloco com esse nome`,nothingToLink:`Nada no projeto com esse nome`,turnInto:`Transformar em`,aligns:{left:`À esquerda`,center:`Centralizado`,right:`À direita`,justify:`Justificado`},copyPlace:`Copiar a posição no arquivo`,find:`Buscar uma ação…`,text:`texto`,background:`fundo`,placeholder:`Escreva ou pressione / para blocos`,heading:`Título`,colorNames:{gray:`Cinza`,brown:`Marrom`,red:`Vermelho`,orange:`Laranja`,yellow:`Amarelo`,green:`Verde`,blue:`Azul`,purple:`Roxo`,pink:`Rosa`},embed:`Desenhado por código`,title:`Título`,untitled:`Sem título`,outline:`Nesta página`,blocks:{paragraph:`Texto`,heading1:`Título 1`,heading2:`Título 2`,heading3:`Título 3`,bullet:`Lista com marcadores`,numbered:`Lista numerada`,check:`Lista de tarefas`,toggle:`Lista de alternância`,quote:`Citação`,callout:`Destaque`,code:`Código`,divider:`Divisor`,table:`Tabela`,image:`Imagem`,chart:`Gráfico`,equation:`Equação`,diagram:`Diagrama`,columns2:`2 colunas`,columns3:`3 colunas`,footnote:`Nota de rodapé`,pagebreak:`Quebra de página`,pagebreakLandscape:`Quebra de página, depois paisagem`,pagebreakPortrait:`Quebra de página, depois retrato`,toc:`Sumário`,bibliography:`Bibliografia`,card:`Cartão`,stats:`Números`},component:`Componente`,stats:{label:`Rótulo`,value:`Valor`,delta:`Variação`,note:`Nota`,trend:`Tendência: 12, 15, 14`,add:`Adicionar um número`,remove:`Remover este número`},card:{title:`Título do cartão`,subtitle:`Subtítulo`},sample:{category:e=>`Categoria ${String(e)}`,series:e=>`Série ${String(e)}`},chart:{types:{"column-clustered":`Colunas Agrupadas`,"column-stacked":`Colunas Empilhadas`,"column-stacked-100":`Colunas 100% Empilhadas`,"bar-clustered":`Barras Agrupadas`,"bar-stacked":`Barras Empilhadas`,"bar-stacked-100":`Barras 100% Empilhadas`,line:`Linhas`,"line-markers":`Linhas com Marcadores`,area:`Área`,"area-stacked":`Área Empilhada`,"area-stacked-100":`Área 100% Empilhada`,pie:`Pizza`,doughnut:`Rosca`,scatter:`Dispersão`,"scatter-lines":`Dispersão com Linhas Retas e Marcadores`,"scatter-smooth":`Dispersão com Linhas Suaves e Marcadores`},type:`Tipo de gráfico`,title:`Título do gráfico`,legend:`Legenda`,legendAt:{none:`Nenhuma`,bottom:`Inferior`,top:`Superior`,left:`Esquerda`,right:`Direita`},dataLabels:`Rótulos de dados`,smooth:`Linhas suavizadas`,barColors:`Cor de cada barra`,addCategory:`Adicionar categoria`,addSeries:`Adicionar série`,deleteCategory:`Excluir categoria`,deleteSeries:`Excluir série`,cell:(e,t)=>`Linha ${String(e)}, coluna ${String(t)}`,fromFile:e=>`Os números vêm de ${e}: altere-os lá.`,notHere:e=>`Os números de ${e} ainda não chegaram.`,cannotDraw:`Não é possível desenhar este gráfico`},emptyEquation:`Equação vazia`,emptyDiagram:`Diagrama vazio`,style:`Estilo`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Destaque`,defaultColor:`Padrão`,pageNumbers:`Números de página`,page:{preset:`Predefinição`,none:`Nenhuma`,presets:{apa:`APA 7`,mla:`MLA 9`,brief:`Briefing`,memo:`Memorando`,"business-letter":`Carta comercial`},paper:`Papel`,orientation:`Orientação`,portrait:`Retrato`,landscape:`Paisagem`,margins:`Margens`,marginNames:{normal:`Normais`,narrow:`Estreitas`,wide:`Largas`},size:`Tamanho do texto`,pt:e=>`${String(e)} pt`,lineHeight:`Altura da linha`,grid:`A grade`,indent:`Recuar a primeira linha`},tocEmpty:`Ainda sem títulos`,sourcesEmpty:`Cite uma fonte com [@key] para listá-la aqui`,pages:`Páginas`,pagesPrinting:`Imprimindo…`,pagesFailed:e=>`Não foi possível imprimir as páginas: ${e}`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,pageBlock:e=>`Um bloco na página ${String(e)}: mostrar no texto`,cover:{add:`Adicionar capa`,change:`Alterar capa`,reposition:`Reposicionar`,remove:`Remover`,drag:`Arraste a imagem para reposicioná-la`,save:`Salvar posição`,cancel:`Cancelar`,upload:`Enviar`,none:`Nenhuma imagem no projeto`,gallery:`Galeria`,project:`Projeto`,names:{dots:`Pontilhismo`,scales:`Escamas do mar`,bay:`Baía ao entardecer`,stacks:`Medas de trigo`,steam:`Trem a vapor`,dusk:`Montanhas ao entardecer`,lake:`Lago ao amanhecer`}}}});function sy(e){return C(ay,e)}var cy=e=>e.map(ma),ly=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function uy(e,t,n){let r=cy(e),i=cy(t),a=new Map(Rn(r,i)),o=new Map(Rn(r,cy(n))),s=new Set(a.values()),c=new Set;for(let e=0;e<r.length;e++){let t=a.get(e);t!==void 0&&!o.has(e)&&c.add(t)}let l=new Map([...o].map(([e,t])=>[t,e])),u=new Map,d=-1;n.forEach((e,t)=>{let n=l.get(t);n===void 0?u.set(d,[...u.get(d)??[],e]):d=n});let f=e=>{for(let t=e;t>=0;t--){let e=a.get(t);if(e!==void 0)return e+1}return 0},p=new Map;for(let[e,n]of u){let c=f(e),l=c;for(;l<t.length&&!s.has(l);)l++;if(ly(i.slice(c,l),cy(n)))continue;let u=e+1<r.length&&!o.has(e+1),d=e>=0&&!a.has(e),m=u||d?l:c;p.set(m,[...p.get(m)??[],...n])}let m=[];for(let e=0;e<=t.length;e++){m.push(...p.get(e)??[]);let n=t[e];n&&!c.has(e)&&m.push(n)}return m}function dy(e,t){if(!e.some(e=>e.type===`source`))return[...t];let n=new Map(Rn(cy(ba(e)),cy(t))),r=new Map,i=-1,a=0;for(let o of e){if(o.type!==`source`){i++;let e=n.get(i);e!==void 0&&(a=e+1);continue}let e=i<0?0:(n.get(i)??a-1)+1,s=Math.max(0,Math.min(t.length,e));r.set(s,[...r.get(s)??[],o])}let o=[];for(let e=0;e<=t.length;e++){o.push(...r.get(e)??[]);let n=t[e];n&&o.push(n)}return o}function fy(e){if(e.coverY!==50)return xv(e);let t={...e};return delete t.coverY,xv(t)}var py=(e,t)=>fy(e)===fy(t);function my(e,t){let n={...e};return delete n.pageNumbers,t?n:{...n,pageNumbers:!1}}function hy(e,t){let n={...e};return delete n.cover,delete n.coverY,t===void 0?n:{...n,cover:t}}function gy(e,t){let n=Math.round(Math.min(100,Math.max(0,t))),r={...e};return delete r.coverY,n===50?r:{...r,coverY:n}}var _y=e=>e.blocks.length===0&&e.problems.length>0,vy=class{doc;constructor(e){this.doc=Q_(e)}get source(){return this.doc.source}get problems(){return this.doc.problems}get unreadable(){return _y(this.doc)}lineOf(e){let t=0;for(let n of this.doc.segments){let r=ba(n.blocks).length;if(e<t+r)return this.doc.source.slice(0,n.start).split(`
|
|
434
|
-
`).length;t+=r}}indexAtLine(e){let t=0,n;for(let r of this.doc.segments){if(this.doc.source.slice(0,r.start).split(`
|
|
435
|
-
`).length>e)break;let i=ba(r.blocks).length;i>0&&(n=t),t+=i}return n}get page(){return this.doc.page}shown(){return ba(this.doc.blocks)}textFor(e,t=this.doc.page){let n=dy(this.doc.blocks,e),r=ha(n,this.doc.blocks)?this.doc.source:Ev(this.doc,n),i=py(t,this.doc.page)?r:Sv({source:r,frontMatter:this.doc.frontMatter},t);return i===this.doc.source?void 0:i}adopt(e){e!==this.doc.source&&(this.doc=Q_(e))}incoming(e,t){if(e===this.doc.source)return;let n=this.shown(),r=Q_(e);if(this.doc=r,_y(r))return;let i=uy(n,t,ba(r.blocks));return ha(i,t)?void 0:i}},yy=t((e=>{var t=c();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,l=r[1];return o(function(){c.value=n,c.getSnapshot=t,u(c)&&l({inst:c})},[e,n,t]),a(function(){return u(c)&&l({inst:c}),e(function(){u(c)&&l({inst:c})})},[e]),s(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),by=t(((e,t)=>{t.exports=yy()})),xy=t((e=>{var t=c(),n=by();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,c){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),c!==void 0&&f.hasValue){var t=f.value;if(c(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return c!==void 0&&c(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,c]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Sy=t(((e,t)=>{t.exports=xy()})),Cy=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),wy=Sy(),Ty=e(u(),1),Ey=e(Cy(),1),Dy=(0,R.createContext)(void 0);function Oy(e){return(0,R.useContext)(Dy)}function ky(e){let t=Oy(e);if(!t?.editor)throw Error(`useBlockNoteEditor was called outside of a BlockNoteContext provider or BlockNoteView component`);return t.editor}function Ay(e,t=e=>e){return(0,wy.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,jy)}function jy(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=My(e);return n.length===My(t).length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}function My(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var Ny=typeof window<`u`?R.useLayoutEffect:R.useEffect,Py=class{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e,t){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor._tiptapEditor,r={all:[`transaction`,`create`,`mount`,`unmount`],mount:[`create`,`mount`,`unmount`],selection:[`selectionUpdate`],change:[`update`]};for(let i of r[t])n.on(i,e);return()=>{for(let i of r[t])n.off(i,e)}}}};function Fy(e){let t=Oy(),n=e.editor||t?.editor||null,r=e.on||`all`,[i]=(0,R.useState)(()=>new Py(n)),a=(0,wy.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,e.equalityFn??Ey.default);return Ny(()=>i.watch(n,r),[n,i,r]),(0,R.useDebugValue)(a),a}function Iy(e){let t=Oy();if(e||=t?.editor,!e)throw Error("'editor' is required in `useEditorDOMElement`, either from BlockNoteContext or as a function argument");return Fy({editor:e,selector:e=>e.editor.domElement,equalityFn:(e,t)=>e===t,on:`mount`})}var Ly=(0,R.createContext)(void 0);function Ry(){return(0,R.useContext)(Ly)}var zy=typeof window<`u`?R.useInsertionEffect:R.useEffect,By=(0,R.createContext)(null);function Vy(){let e=(0,R.useContext)(By),t=Iy();return e||(t?.parentElement??null)}function Hy(e){return(0,z.jsx)(By.Provider,{value:null,children:e.children})}function Uy(e){let{target:t,children:n}=e,r=ky(),i=Ry()?.applyThemedRoot,[a]=(0,R.useState)(()=>typeof document>`u`?null:document.createElement(`div`));return zy(()=>{if(a&&t)return t.appendChild(a),()=>a.remove()},[a,t]),zy(()=>{a&&t&&i?.(a)},[a,t,i]),zy(()=>{if(a&&t)return r.registerPortalElement(a),()=>r.unregisterPortalElement(a)},[r,a,t]),t===void 0?n:(0,z.jsx)(By.Provider,{value:a,children:n})}function Wy(e){return(0,z.jsx)(Uy,{target:e.target,children:(0,z.jsx)(Gy,{children:e.children})})}function Gy(e){let t=Vy();return t?(0,Ty.createPortal)(e.children,t):null}function Ky(){let[e]=(0,R.useState)(()=>{if(typeof document>`u`)return null;let e=document.createElement(`span`);return e.className=`bn-portal-anchor`,e}),t=(0,R.useCallback)(t=>{t&&e&&e.parentElement!==t&&t.appendChild(e)},[e]);return{anchor:e,holder:(0,z.jsx)(`span`,{ref:t,className:qy,style:{position:`absolute`,width:0,height:0,overflow:`visible`}})}}var qy=`bn-portal-anchor-holder`;function Jy(e){return Array.from(e.childNodes).some(e=>!(e instanceof Element&&e.classList.contains(qy)))}function Yy(e){let{anchor:t,holder:n}=Ky(),r=Vy(),i=t??r,a=typeof e.children==`function`?e.children(i):e.children;return(0,z.jsxs)(z.Fragment,{children:[n,(0,z.jsx)(By.Provider,{value:i,children:a})]})}var Xy=(0,R.createContext)(void 0);function Zy(){return(0,R.useContext)(Xy)}function Qy(){return Oy().editor.dictionary}var $y={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},eb=R.createContext&&R.createContext($y),tb=[`attr`,`size`,`title`];function nb(e,t){if(e==null)return{};var n,r,i=rb(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rb(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ib(){return ib=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ib.apply(null,arguments)}function ab(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ob(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ab(Object(n),!0).forEach(function(t){sb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ab(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sb(e,t,n){return(t=cb(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cb(e){var t=lb(e,`string`);return typeof t==`symbol`?t:t+``}function lb(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ub(e){return e&&e.map((e,t)=>R.createElement(e.tag,ob({key:t},e.attr),ub(e.child)))}function db(e){return t=>R.createElement(fb,ib({attr:ob({},e.attr)},t),ub(e.child))}function fb(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=nb(e,tb),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),R.createElement(`svg`,ib({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:ob(ob({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&R.createElement(`title`,null,i),e.children)};return eb===void 0?t($y):R.createElement(eb.Consumer,null,e=>t(e))}function pb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z`},child:[]}]})(e)}function mb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13H8ZM8 11C8.82843 11 9.5 10.3284 9.5 9.5C9.5 8.67157 8.82843 8 8 8C7.17157 8 6.5 8.67157 6.5 9.5C6.5 10.3284 7.17157 11 8 11ZM16 11C16.8284 11 17.5 10.3284 17.5 9.5C17.5 8.67157 16.8284 8 16 8C15.1716 8 14.5 8.67157 14.5 9.5C14.5 10.3284 15.1716 11 16 11Z`},child:[]}]})(e)}function hb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11V13H19V11H5Z`},child:[]}]})(e)}function gb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z`},child:[]}]})(e)}function _b(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V12L17.206 8.207L11.2071 14.2071L9.79289 12.7929L15.792 6.793L12 3H21Z`},child:[]}]})(e)}function vb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z`},child:[]}]})(e)}function yb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function bb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function xb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z`},child:[]}]})(e)}function Sb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z`},child:[]}]})(e)}function Cb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z`},child:[]}]})(e)}function wb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 18V20H2V18H22ZM2 3.5L10 8.5L2 13.5V3.5ZM22 11V13H12V11H22ZM22 4V6H12V4H22Z`},child:[]}]})(e)}function Tb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L12.0012 14.7562L11.995 18.995L16.2414 19.0012L17.571 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z`},child:[]}]})(e)}function Eb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 15V18H24V20H21V23H19V20H16V18H19V15H21ZM21.0082 3C21.556 3 22 3.44495 22 3.9934L22.0007 13.3417C21.3749 13.1204 20.7015 13 20 13V5H4L4.001 19L13.2929 9.70715C13.6528 9.34604 14.22 9.31823 14.6123 9.62322L14.7065 9.70772L18.2521 13.2586C15.791 14.0069 14 16.2943 14 19C14 19.7015 14.1204 20.3749 14.3417 21.0007L2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082ZM8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7Z`},child:[]}]})(e)}function Db(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z`},child:[]}]})(e)}function Ob(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z`},child:[]}]})(e)}function kb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z`},child:[]}]})(e)}function Ab(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 6V21H11V6H5V4H19V6H13Z`},child:[]}]})(e)}function jb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 10V14H19V10H13ZM11 10H5V14H11V10ZM13 19H19V16H13V19ZM11 19V16H5V19H11ZM13 5V8H19V5H13ZM11 5H5V8H11V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z`},child:[]}]})(e)}function Mb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z`},child:[]}]})(e)}function Nb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 4H3V6H21V4ZM21 11H8V13H21V11ZM21 18H8V20H21V18ZM5 11H3V20H5V11Z`},child:[]}]})(e)}function Pb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z`},child:[]}]})(e)}function Fb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z`},child:[]}]})(e)}function Ib(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM4.5 6.5C3.67157 6.5 3 5.82843 3 5C3 4.17157 3.67157 3.5 4.5 3.5C5.32843 3.5 6 4.17157 6 5C6 5.82843 5.32843 6.5 4.5 6.5ZM4.5 13.5C3.67157 13.5 3 12.8284 3 12C3 11.1716 3.67157 10.5 4.5 10.5C5.32843 10.5 6 11.1716 6 12C6 12.8284 5.32843 13.5 4.5 13.5ZM4.5 20.4C3.67157 20.4 3 19.7284 3 18.9C3 18.0716 3.67157 17.4 4.5 17.4C5.32843 17.4 6 18.0716 6 18.9C6 19.7284 5.32843 20.4 4.5 20.4ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function Lb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function Rb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z`},child:[]}]})(e)}function zb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z`},child:[]}]})(e)}function Bb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z`},child:[]}]})(e)}function Vb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z`},child:[]}]})(e)}function Hb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z`},child:[]}]})(e)}function Ub(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z`},child:[]}]})(e)}function Wb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z`},child:[]}]})(e)}function Gb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21.097 8L18.499 12.5C20.7091 12.5 22.5 14.2909 22.5 16.5C22.5 18.7091 20.7091 20.5 18.5 20.5C16.2909 20.5 14.5 18.7091 14.5 16.5C14.5 15.7636 14.699 15.0737 15.0461 14.4811L18.788 8H21.097ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 14.5C17.3954 14.5 16.5 15.3954 16.5 16.5C16.5 17.6046 17.3954 18.5 18.5 18.5C19.6046 18.5 20.5 17.6046 20.5 16.5C20.5 15.3954 19.6046 14.5 18.5 14.5Z`},child:[]}]})(e)}function Kb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8V10H17.6769L17.2126 12.6358C17.5435 12.5472 17.8912 12.5 18.25 12.5C20.4591 12.5 22.25 14.2909 22.25 16.5C22.25 18.7091 20.4591 20.5 18.25 20.5C16.4233 20.5 14.8827 19.2756 14.4039 17.6027L16.3271 17.0519C16.5667 17.8881 17.3369 18.5 18.25 18.5C19.3546 18.5 20.25 17.6046 20.25 16.5C20.25 15.3954 19.3546 14.5 18.25 14.5C17.6194 14.5 17.057 14.7918 16.6904 15.2478L14.8803 14.3439L16 8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function qb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM22 8V16H23.5V18H22V20H20V18H14.5V16.66L19.5 8H22ZM20 11.133L17.19 16H20V11.133Z`},child:[]}]})(e)}function Jb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function Yb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z`},child:[]}]})(e)}function Xb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z`},child:[]}]})(e)}function Zb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5.55397 22H3.3999L10.9999 3H12.9999L20.5999 22H18.4458L16.0458 16H7.95397L5.55397 22ZM8.75397 14H15.2458L11.9999 5.88517L8.75397 14Z`},child:[]}]})(e)}function Qb(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z`},child:[]}]})(e)}function $b(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z`},child:[]}]})(e)}function ex(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z`},child:[]}]})(e)}function tx(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z`},child:[]}]})(e)}function nx(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z`},child:[]}]})(e)}function rx(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z`},child:[]}]})(e)}function ix(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z`},child:[]}]})(e)}function ax(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z`},child:[]}]})(e)}function ox(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.29117 20.8242L2 22L3.17581 16.7088C2.42544 15.3056 2 13.7025 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C10.2975 22 8.6944 21.5746 7.29117 20.8242ZM7.58075 18.711L8.23428 19.0605C9.38248 19.6745 10.6655 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 13.3345 4.32549 14.6175 4.93949 15.7657L5.28896 16.4192L4.63416 19.3658L7.58075 18.711Z`},child:[]}]})(e)}function sx(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.24264 17.9967H3V13.754L14.435 2.319C14.8256 1.92848 15.4587 1.92848 15.8492 2.319L18.6777 5.14743C19.0682 5.53795 19.0682 6.17112 18.6777 6.56164L7.24264 17.9967ZM3 19.9967H21V21.9967H3V19.9967Z`},child:[]}]})(e)}function cx(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 7V11L2 6L8 1V5H13C17.4183 5 21 8.58172 21 13C21 17.4183 17.4183 21 13 21H4V19H13C16.3137 19 19 16.3137 19 13C19 9.68629 16.3137 7 13 7H8Z`},child:[]}]})(e)}var lx=`input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),area[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)`,ux=typeof Element>`u`,dx=ux?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fx=!ux&&Element.prototype.getRootNode?function(e){return e==null||e.getRootNode==null?void 0:e.getRootNode()}:function(e){return e?.ownerDocument},px=function(e,t){t===void 0&&(t=!0);var n=e==null||e.getAttribute==null?void 0:e.getAttribute(`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):px(e.parentNode))},mx=function(e){var t,n=e==null||e.getAttribute==null||(t=e.getAttribute(`contenteditable`))==null?void 0:t.toLowerCase();return n===``||n===`true`||n===`plaintext-only`},hx=function(e,t,n){if(px(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(lx));return t&&dx.call(e,lx)&&r.unshift(e),r=r.filter(n),r},gx=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!px(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=gx(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{dx.call(a,lx)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!px(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=gx(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},_x=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},vx=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||mx(e))&&!_x(e)?0:e.tabIndex},yx=function(e,t){var n=vx(e);return n<0&&t&&!_x(e)?0:n},bx=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xx=function(e){return e.tagName===`INPUT`},Sx=function(e){return xx(e)&&e.type===`hidden`},Cx=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},wx=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Tx=function(e){if(!e.name)return!0;var t=e.form||fx(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=wx(r,e.form);return!i||i===e},Ex=function(e){return xx(e)&&e.type===`radio`},Dx=function(e){return Ex(e)&&!Tx(e)},Ox=function(e){var t=e&&fx(e),n=t?.host,r=!1;if(t&&t!==e){var i,a;for(r=!!((i=n)!=null&&(i=i.ownerDocument)!=null&&i.contains(n)||e!=null&&(a=e.ownerDocument)!=null&&a.contains(e));!r&&n;){var o;t=fx(n),n=t?.host,r=!!((o=n)!=null&&(o=o.ownerDocument)!=null&&o.contains(n))}}return r},kx=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Ax=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=dx.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(dx.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=fx(e);if(s&&!s.shadowRoot&&r(s)===!0)return kx(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(Ox(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return kx(e);return!1},jx=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return dx.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Mx=function(e,t){return!(t.disabled||Sx(t)||Ax(t,e)||Cx(t)||jx(t))},Nx=function(e,t){return!(Dx(t)||vx(t)<0||!Mx(e,t))},Px=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Fx=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=yx(a,i),s=i?Fx(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(bx).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Ix=function(e,t){return t||={},Fx(t.getShadowRoot?gx([e],t.includeContainer,{filter:Nx.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Px}):hx(e,t.includeContainer,Nx.bind(null,t)))},Lx=function(e,t){return t||={},t.getShadowRoot?gx([e],t.includeContainer,{filter:Mx.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):hx(e,t.includeContainer,Mx.bind(null,t))},Rx=function(e,t){if(t||={},!e)throw Error(`No node provided`);return dx.call(e,lx)!==!1&&Nx(t,e)};function zx(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Bx(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function Vx(){return/apple/i.test(navigator.vendor)}function Hx(){let e=/android/i;return e.test(zx())||e.test(Bx())}function Ux(){return Bx().includes(`jsdom/`)}var Wx=`data-floating-ui-focusable`,Gx=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Kx(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function qx(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Jx(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Yx(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Xx(e){return e.matches(`html,body`)}function Zx(e){return e?.ownerDocument||document}function Qx(e){return d(e)&&e.matches(Gx)}function $x(e){return e?e.getAttribute(`role`)===`combobox`&&Qx(e):!1}function eS(e){return e?e.hasAttribute(Wx)?e:e.querySelector(`[`+Wx+`]`)||e:null}function tS(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...tS(e,t.id,n)])}function nS(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function rS(e){e.preventDefault(),e.stopPropagation()}function iS(e){return`nativeEvent`in e}function aS(e){return e.mozInputSource===0&&e.isTrusted?!0:Hx()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function oS(e){return Ux()?!1:!Hx()&&e.width===0&&e.height===0||Hx()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function sS(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var cS=typeof document<`u`?R.useLayoutEffect:function(){},lS={...R};function uS(e){let t=R.useRef(e);return cS(()=>{t.current=e}),t}var dS=lS.useInsertionEffect||(e=>e());function fS(e){let t=R.useRef(()=>{});return dS(()=>{t.current=e}),R.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var pS=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function mS(e,t){let n=Ix(e,pS()),r=n.length;if(r===0)return;let i=Kx(Zx(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function hS(e){return mS(Zx(e).body,1)||e}function gS(e){return mS(Zx(e).body,-1)||e}function _S(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!qx(n,r)}function vS(e){Ix(e,pS()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function yS(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function bS(e){let t=R.useRef(void 0),n=R.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return R.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var xS=`data-floating-ui-focusable`,SS=`active`,CS=`selected`,wS=`ArrowLeft`,TS=`ArrowRight`,ES=`ArrowUp`,DS=`ArrowDown`,OS=[wS,TS],kS=[ES,DS];[...OS,...kS];var AS={...R},jS=!1,MS=0,NS=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+MS++;function PS(){let[e,t]=R.useState(()=>jS?NS():void 0);return cS(()=>{e??t(NS())},[]),R.useEffect(()=>{jS=!0},[]),e}var FS=AS.useId||PS;function IS(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var LS=R.createContext(null),RS=R.createContext(null),zS=()=>R.useContext(LS)?.id||null,BS=()=>R.useContext(RS);function VS(e){return`data-floating-ui-`+e}function HS(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var US=VS(`safe-polygon`);function WS(e,t,n){if(n&&!sS(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function GS(e){return typeof e==`function`?e():e}function KS(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=BS(),m=zS(),h=uS(l),g=uS(c),_=uS(n),v=uS(d),y=R.useRef(),b=R.useRef(-1),x=R.useRef(),C=R.useRef(-1),w=R.useRef(!0),T=R.useRef(!1),E=R.useRef(()=>{}),D=R.useRef(!1),O=fS(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});R.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(HS(b),HS(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),R.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=Zx(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=R.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=WS(g.current,`close`,y.current);i&&!x.current?(HS(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(HS(b),r(!1,e,n))},[g,r]),A=fS(()=>{E.current(),x.current=void 0}),j=fS(()=>{if(T.current){let e=Zx(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(US),T.current=!1}}),M=fS(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);R.useEffect(()=>{if(!s)return;function e(e){if(HS(b),w.current=!1,u&&!sS(y.current)||GS(v.current)>0&&!WS(g.current,`open`))return;let t=WS(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}E.current();let t=Zx(o.floating);if(HS(C),D.current=!1,h.current&&i.current.floatingContext){n||HS(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)}}else y.current===`touch`&&qx(o.floating,e.relatedTarget)||k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){HS(b)}function l(e){M()||k(e,!1)}if(S(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),cS(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=o.floating;if(S(o.domReference)&&e){var t;let n=Zx(o.floating).body;n.setAttribute(US,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),cS(()=>{n||(y.current=void 0,D.current=!1,A(),j())},[n,A,j]),R.useEffect(()=>()=>{A(),HS(b),HS(C),j()},[s,o.domReference,A,j]);let N=R.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!_.current&&r(!0,t,`hover`)}u&&!sS(y.current)||n||GS(v.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(HS(C),y.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,GS(v.current))))}}},[u,r,n,_,v]);return R.useMemo(()=>s?{reference:N}:{},[s,N])}var qS=0;function JS(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(qS);let a=()=>e?.focus({preventScroll:n});i?a():qS=requestAnimationFrame(a)}function YS(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function XS(e){return`composedPath`in e?e.composedPath()[0]:e.target}function ZS(e){return e?.ownerDocument||document}var QS={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function $S(e){return e===`inert`?QS.inert:e===`aria-hidden`?QS[`aria-hidden`]:QS.none}var eC=new WeakSet,tC={},nC=0,rC=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function iC(e){return e?f(e)?e.host:iC(e.parentNode):null}var aC=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=iC(t);return e.contains(n)?n:null}).filter(e=>e!=null);function oC(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=aC(t,e),s=new Set,c=new Set(o),l=[];tC[i]||(tC[i]=new WeakMap);let u=tC[i];o.forEach(d),f(t),s.clear();function d(e){e&&!s.has(e)&&(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){e&&!c.has(e)&&[].forEach.call(e.children,e=>{if(oe(e)!==`script`){if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=$S(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&eC.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}}})}return nC++,()=>{l.forEach(e=>{let t=$S(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!eC.has(e)&&a&&e.removeAttribute(a),eC.delete(e)),r||e.removeAttribute(i)}),nC--,nC||(QS.inert=new WeakMap,QS[`aria-hidden`]=new WeakMap,QS.none=new WeakMap,eC=new WeakSet,tC={})}}function sC(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=ZS(e[0]).body;return oC(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var cC={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},lC=R.forwardRef(function(e,t){let[n,r]=R.useState();cS(()=>{Vx()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[VS(`focus-guard`)]:``,style:cC};return(0,z.jsx)(`span`,{...e,...i})}),uC={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},dC=R.createContext(null),fC=VS(`portal`);function pC(e){e===void 0&&(e={});let{id:t,root:n}=e,r=FS(),i=hC(),[a,o]=R.useState(null),s=R.useRef(null);return cS(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),cS(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(fC,``),e.appendChild(n),s.current=n,o(n)},[t,r]),cS(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!w(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(fC,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function mC(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=pC({id:n,root:r}),[o,s]=R.useState(null),c=R.useRef(null),l=R.useRef(null),u=R.useRef(null),d=R.useRef(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return R.useEffect(()=>{if(!a||!i||f)return;function e(e){a&&_S(e)&&(e.type===`focusin`?yS:vS)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),R.useEffect(()=>{a&&(p||yS(a))},[p,a]),(0,z.jsxs)(dC.Provider,{value:R.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&(0,z.jsx)(lC,{"data-type":`outside`,ref:c,onFocus:e=>{if(_S(e,a)){var t;(t=u.current)==null||t.focus()}else gS(o?o.domReference:null)?.focus()}}),m&&a&&(0,z.jsx)(`span`,{"aria-owns":a.id,style:uC}),a&&Ty.createPortal(t,a),m&&a&&(0,z.jsx)(lC,{"data-type":`outside`,ref:l,onFocus:e=>{if(_S(e,a)){var t;(t=d.current)==null||t.focus()}else hS(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var hC=()=>R.useContext(dC);function gC(e){return R.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var _C=20,vC=[];function yC(){vC=vC.filter(e=>e.deref()?.isConnected)}function bC(e){yC(),e&&oe(e)!==`body`&&(vC.push(new WeakRef(e)),vC.length>_C&&(vC=vC.slice(-20)))}function xC(){return yC(),vC[vC.length-1]?.deref()}function SC(e){let t=pS();return Rx(e,t)?e:Ix(e,t)[0]||e}function CC(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=pS(),i=Lx(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Rx(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var wC=R.forwardRef(function(e,t){return(0,z.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:cC})});function TC(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0,outsideElementsInert:p=!1,getInsideElements:m=()=>[]}=e,{open:h,onOpenChange:g,events:_,dataRef:v,elements:{domReference:y,floating:b}}=t,x=fS(()=>v.current.floatingContext?.nodeId),S=fS(m),C=typeof o==`number`&&o<0,w=$x(y)&&C,T=rC(),E=!T||a,D=!E||T&&p,O=uS(i),k=uS(o),A=uS(s),j=BS(),M=hC(),N=R.useRef(null),P=R.useRef(null),ee=R.useRef(!1),F=R.useRef(!1),I=R.useRef(-1),te=R.useRef(-1),ne=M!=null,L=eS(b),re=fS(function(e){return e===void 0&&(e=L),e?Ix(e,pS()):[]}),ie=fS(e=>{let t=re(e);return O.current.map(e=>y&&e===`reference`?y:L&&e===`floating`?L:t).filter(Boolean).flat()});R.useEffect(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){qx(L,Kx(Zx(L)))&&re().length===0&&!w&&rS(e);let t=ie(),n=Jx(e);O.current[0]===`reference`&&n===y&&(rS(e),e.shiftKey?JS(t[t.length-1]):JS(t[1])),O.current[1]===`floating`&&n===L&&e.shiftKey&&(rS(e),JS(t[0]))}}let t=Zx(L);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,L,l,O,w,re,ie]),R.useEffect(()=>{if(r||!b)return;function e(e){let t=Jx(e),n=re().indexOf(t);n!==-1&&(I.current=n)}return b.addEventListener(`focusin`,e),()=>{b.removeEventListener(`focusin`,e)}},[r,b,re]),R.useEffect(()=>{if(r||!f)return;function e(){F.current=!0,setTimeout(()=>{F.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=Jx(e);queueMicrotask(()=>{let i=x(),a=!(qx(y,t)||qx(b,t)||qx(t,b)||qx(M?.portalNode,t)||t!=null&&t.hasAttribute(VS(`focus-guard`))||j&&(tS(j.nodesRef.current,i).find(e=>qx(e.context?.elements.floating,t)||qx(e.context?.elements.domReference,t))||nS(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,eS(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&L&&CC(L,O),c&&n!==y&&!(r!=null&&r.isConnected)&&Kx(Zx(L))===Zx(L).body){d(L)&&L.focus();let e=I.current,t=re(),n=t[e]||t[t.length-1]||L;d(n)&&n.focus()}v.current.insideReactTree?v.current.insideReactTree=!1:(w||!l)&&t&&a&&!F.current&&t!==xC()&&(ee.current=!0,g(!1,e,`focus-out`))})}let n=!(j||!M);function i(){HS(te),v.current.insideReactTree=!0,te.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}if(b&&d(y))return y.addEventListener(`focusout`,t),y.addEventListener(`pointerdown`,e),b.addEventListener(`focusout`,t),n&&b.addEventListener(`focusout`,i,!0),()=>{y.removeEventListener(`focusout`,t),y.removeEventListener(`pointerdown`,e),b.removeEventListener(`focusout`,t),n&&b.removeEventListener(`focusout`,i,!0)}},[r,y,b,L,l,j,M,g,f,c,re,w,x,O,v]);let ae=R.useRef(null),oe=R.useRef(null),se=gC([ae,M?.beforeInsideRef]),ce=gC([oe,M?.afterInsideRef]);R.useEffect(()=>{var e,t;if(r||!b)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+VS(`portal`)+`]`))||[]),i=(t=(j?nS(j.nodesRef.current,x()):[]).find(e=>$x(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[b,i,...n,...S(),N.current,P.current,ae.current,oe.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,O.current.includes(`reference`)||w?y:null].filter(e=>e!=null),o=l||w?sC(a,!D,D):sC(a);return()=>{o()}},[r,y,b,l,O,M,w,E,D,j,x,S]),cS(()=>{if(r||!d(L))return;let e=Kx(Zx(L));queueMicrotask(()=>{let t=ie(L),n=k.current,r=(typeof n==`number`?t[n]:n.current)||L,i=qx(L,e);!C&&!i&&h&&JS(r,{preventScroll:r===L})})},[r,h,L,C,ie,k]),cS(()=>{if(r||!L)return;let e=Zx(L);bC(Kx(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(ee.current=!0),t===`outside-press`){if(r)ee.current=!1;else if(aS(n)||oS(n))ee.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?ee.current=!1:ee.current=!0}}}_.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,cC),ne&&y&&y.insertAdjacentElement(`afterend`,n);function i(){if(typeof A.current==`boolean`){let e=y||xC();return e&&e.isConnected?e:n}return A.current.current||n}return()=>{_.off(`openchange`,t);let r=Kx(e),a=qx(b,r)||j&&tS(j.nodesRef.current,x(),!1).some(e=>qx(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=SC(o);A.current&&!ee.current&&d(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,b,L,A,v,_,j,ne,y,x]),R.useEffect(()=>(queueMicrotask(()=>{ee.current=!1}),()=>{queueMicrotask(yC)}),[r]),cS(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,l,h,g,f,y]),cS(()=>{r||L&&CC(L,O)},[r,L,O]);function le(e){return r||!u||!l?null:(0,z.jsx)(wC,{ref:e===`start`?N:P,onClick:e=>g(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let ue=!r&&E&&(!l||!w)&&(ne||l);return(0,z.jsxs)(z.Fragment,{children:[ue&&(0,z.jsx)(lC,{"data-type":`inside`,ref:se,onFocus:e=>{if(l){let e=ie();JS(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(ee.current=!1,_S(e,M.portalNode))hS(y)?.focus();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}}),!w&&le(`start`),n,le(`end`),ue&&(0,z.jsx)(lC,{"data-type":`inside`,ref:ce,onFocus:e=>{if(l)JS(ie()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(f&&(ee.current=!0),_S(e,M.portalNode))gS(y)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}}})]})}var EC={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},DC={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},OC=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function kC(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:f=`pointerdown`,ancestorScroll:p=!1,bubbles:m,capture:h}=t,g=BS(),_=fS(typeof c==`function`?c:()=>!1),v=typeof c==`function`?_:c,b=R.useRef(!1),{escapeKey:x,outsidePress:C}=OC(m),{escapeKey:w,outsidePress:T}=OC(h),O=R.useRef(!1),k=fS(e=>{if(!n||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=g?tS(g.nodesRef.current,t):[];if(!x&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}r(!1,iS(e)?e.nativeEvent:e,`escape-key`)}),A=fS(e=>{var t;let n=()=>{var t;k(e),(t=Jx(e))==null||t.removeEventListener(`keydown`,n)};(t=Jx(e))==null||t.addEventListener(`keydown`,n)}),j=fS(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=b.current;if(b.current=!1,l===`click`&&n||t||typeof v==`function`&&!v(e))return;let o=Jx(e),s=`[`+VS(`inert`)+`]`,c=Zx(i.floating).querySelectorAll(s),u=S(o)?o:null;for(;u&&!ce(u);){let e=D(u);if(ce(e)||!S(e))break;u=e}if(c.length&&S(o)&&!Xx(o)&&!qx(o,i.floating)&&Array.from(c).every(e=>!qx(u,e)))return;if(d(o)&&P){let t=ce(o),n=E(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let f=a.current.floatingContext?.nodeId,p=g&&tS(g.nodesRef.current,f).some(t=>Yx(e,t.context?.elements.floating));if(Yx(e,i.floating)||Yx(e,i.domReference)||p)return;let m=g?tS(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r(!1,e,`outside-press`)}),M=fS(e=>{var t;let n=()=>{var t;j(e),(t=Jx(e))==null||t.removeEventListener(l,n)};(t=Jx(e))==null||t.addEventListener(l,n)});R.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=x,a.current.__outsidePressBubbles=C;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),O.current=!0}function u(){e=window.setTimeout(()=>{O.current=!1},y()?5:0)}let d=Zx(i.floating);s&&(d.addEventListener(`keydown`,w?A:k,w),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),v&&d.addEventListener(l,T?M:j,T);let f=[];return p&&(S(i.domReference)&&(f=ue(i.domReference)),S(i.floating)&&(f=f.concat(ue(i.floating))),!S(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(ue(i.reference.contextElement)))),f=f.filter(e=>e!==d.defaultView?.visualViewport),f.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,w?A:k,w),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),v&&d.removeEventListener(l,T?M:j,T),f.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,v,l,n,r,p,o,x,C,k,w,A,j,T,M]),R.useEffect(()=>{a.current.insideReactTree=!1},[a,v,l]);let N=R.useMemo(()=>({onKeyDown:k,...u&&{[EC[f]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...f!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[k,r,u,f]),P=R.useMemo(()=>{function e(e){e.button===0&&(b.current=!0)}return{onKeyDown:k,onMouseDown:e,onMouseUp:e,[DC[l]]:()=>{a.current.insideReactTree=!0}}},[k,l,a]);return R.useMemo(()=>o?{reference:N,floating:P}:{},[o,N,P])}function AC(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=FS(),a=R.useRef({}),[o]=R.useState(()=>IS()),s=zS()!=null,[c,l]=R.useState(r.reference),u=fS((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=R.useMemo(()=>({setPositionReference:l}),[]),f=R.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return R.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function jC(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=AC({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=R.useState(null),[l,u]=R.useState(null),d=o?.domReference||s,f=R.useRef(null),p=BS();cS(()=>{d&&(f.current=d)},[d]);let m=ne({...n,elements:{...o,...l&&{reference:l}}}),h=R.useCallback(e=>{let t=S(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=R.useCallback(e=>{(S(e)||e===null)&&(f.current=e,c(e)),(S(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!S(e))&&m.refs.setReference(e)},[m.refs]),_=R.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=R.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=R.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return cS(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),R.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function MC(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[SS]:t,[CS]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[xS]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[SS,CS].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function NC(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=R.useCallback(t=>MC(t,e,`reference`),t),a=R.useCallback(t=>MC(t,e,`floating`),n),o=R.useCallback(t=>MC(t,e,`item`),r);return R.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var PC=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function FC(e,t){return typeof e==`function`?e(t):e}function IC(e,t){let[n,r]=R.useState(e);return e&&!n&&r(!0),R.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function LC(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=R.useState(`unmounted`),c=IC(n,a);return!c&&o===`close`&&s(`unmounted`),cS(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{Ty.flushSync(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function RC(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=R.useMemo(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=R.useState(()=>({...FC(a,l),...FC(n,l)})),{isMounted:h,status:g}=LC(e,{duration:o}),_=uS(n),v=uS(r),y=uS(i),b=uS(a);return cS(()=>{let e=FC(_.current,l),t=FC(y.current,l),n=FC(b.current,l),r=FC(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(PC).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(PC).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function zC(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...zC(e,t.id,n)])}function BC(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function VC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function HC(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){HS(i),u()}if(HS(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=XS(e),v=e.type===`mouseleave`,y=YS(c.floating,_),b=YS(c.domReference,_),x=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),w=s.split(`-`)[0],T=n>C.right-C.width/2,E=o>C.bottom-C.height/2,D=VC(g,x),O=C.width>x.width,k=C.height>x.height,A=(O?x:C).left,j=(O?x:C).right,M=(k?x:C).top,N=(k?x:C).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&S(e.relatedTarget)&&YS(c.floating,e.relatedTarget)||f&&zC(f.nodesRef.current,d).length)return;if(w===`top`&&o>=x.bottom-1||w===`bottom`&&o<=x.top+1||w===`left`&&n>=x.right-1||w===`right`&&n<=x.left+1)return p();let P=[];switch(w){case`top`:P=[[A,x.top+1],[A,C.bottom-1],[j,C.bottom-1],[j,x.top+1]];break;case`bottom`:P=[[A,C.top+1],[A,x.bottom-1],[j,x.bottom-1],[j,C.top+1]];break;case`left`:P=[[C.right-1,N],[C.right-1,M],[x.left+1,M],[x.left+1,N]];break;case`right`:P=[[x.right-1,N],[x.right-1,M],[C.left+1,M],[C.left+1,N]]}function ee(e){let[n,r]=e;switch(w){case`top`:return[[O?n+t/2:T?n+t*4:n-t*4,r+t+1],[O?n-t/2:T?n+t*4:n-t*4,r+t+1],[C.left,T||O?C.bottom-t:C.top],[C.right,T?O?C.bottom-t:C.top:C.bottom-t]];case`bottom`:return[[O?n+t/2:T?n+t*4:n-t*4,r-t],[O?n-t/2:T?n+t*4:n-t*4,r-t],[C.left,T||O?C.top+t:C.bottom],[C.right,T?O?C.top+t:C.bottom:C.top+t]];case`left`:{let e=[n+t+1,k?r+t/2:E?r+t*4:r-t*4],i=[n+t+1,k?r-t/2:E?r+t*4:r-t*4];return[[E||k?C.right-t:C.left,C.top],[E?k?C.right-t:C.left:C.right-t,C.bottom],e,i]}case`right`:return[[n-t,k?r+t/2:E?r+t*4:r-t*4],[n-t,k?r-t/2:E?r+t*4:r-t*4],[E||k?C.left+t:C.right,C.top],[E?k?C.left+t:C.right:C.left+t,C.bottom]]}}if(!BC([m,h],P)){if(a&&!D)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}BC([m,h],ee([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var UC=`annotation`;function WC(e){return e&&Vt(e.options.extensions).some(e=>{if(e.type!==`mark`)return!1;let t=Gt(e,`group`);return typeof t==`string`&&t.split(` `).includes(`annotation`)})?UC:``}function GC(e){return e?Vt(e.options.extensions).filter(e=>{if(e.type!==`mark`)return!1;let t=Gt(e,`group`);return typeof t!=`string`||!t.split(` `).includes(`annotation`)}).map(e=>e.name).join(` `):`_`}var KC=class{listeners=new Set;state;prevState;options;constructor(e,t){this.prevState=e,this.state=e,this.options=t}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});setState(e){this.prevState=this.state,this.state=qC(e)?e(this.prevState):e,XC(this)}_notify(){let e={prevVal:this.prevState,currentVal:this.state};for(let t of this.listeners)t(e)}};function qC(e){return typeof e==`function`}var JC=!1,YC=new Set;function XC(e){YC.add(e);let t=!JC;JC=!0;try{if(e.options?.onUpdate?.(e.state,e.prevState),!t)return;for(;YC.size>0;){let e=Array.from(YC);YC.clear();for(let t of e)t._notify()}}finally{t&&(JC=!1,YC.clear())}}var ZC=Symbol(`originalFactory`);function QC(e){if(typeof e==`object`&&`key`in e)return function t(){return e[ZC]=t,e};if(typeof e!=`function`)throw Error(`factory must be a function`);return function t(n){return r=>{let i=e({editor:r.editor,options:n});return i[ZC]=t,i}}}function $C(e,t){return new KC(e,t)}crypto.subtle;var ew=crypto.getRandomValues.bind(crypto),tw=()=>ew(new Uint32Array(1))[0],nw=`10000000-1000-4000-8000-100000000000`,rw=typeof crypto<`u`&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>nw.replace(/[018]/g,e=>(e^tw()&15>>e/4).toString(16)),iw,aw;if(typeof WeakMap<`u`){let e=new WeakMap;iw=t=>e.get(t),aw=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;iw=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},aw=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var ow=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return iw(e)||aw(e,sw(e))}};function sw(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=cw(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new ow(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&lw(s,o,e),s}function cw(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function lw(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r==null||c.colwidth&&c.colwidth[n]==r||((s||=uw(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function uw(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function dw(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var fw=new Dr(`selectingCells`);function pw(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function mw(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function hw(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function gw(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=pw(t.$head)||_w(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function _w(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function vw(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function yw(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function bw(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function xw(e,t,n){let r=e.node(-1),i=ow.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Sw(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Cw(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function ww(e,t,n){let r=dw(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var Tw=class e extends Nr{constructor(e,t=e){let n=e.node(-1),r=ow.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new zr(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(vw(r)&&vw(i)&&bw(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return Or.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=ow.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Sw(e,0,l)),u>0&&(e=Sw(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(Cr.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new Mr(Cr.from(o),1,1)}replace(e,t=Mr.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?Mr.empty:t)}let i=Nr.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new Mr(Cr.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=ow.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=ow.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=ow.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=ow.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Ew(this.$anchorCell.pos,this.$headCell.pos)}};Tw.prototype.visible=!1,Nr.jsonID(`cell`,Tw);var Ew=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&bw(t,n)?new Tw(t,n):Nr.near(n,1)}};function Dw(e){if(!(e.selection instanceof Tw))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Rr.node(n,n+e.nodeSize,{class:`selectedCell`}))}),Fr.create(e.doc,t)}function Ow({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function kw({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Aw(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof Ir&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=Tw.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=Tw.rowSelection(e,e)}else if(!n){let e=ow.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=Tw.create(i,t+1,n)}}else r instanceof Or&&Ow(r)?a=Or.create(i,r.from):r instanceof Or&&kw(r)&&(a=Or.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var jw=new Dr(`fix-tables`);function Mw(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Mw(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Nw(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Pw(e,t,r,n))};return t?t.doc!=e.doc&&Mw(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Pw(e,t,n,r){let i=ow.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Sw(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=dw(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(jw,{fixTables:!0})}function Fw(e){let t=e.selection,n=gw(e),r=n.node(-1),i=n.start(-1),a=ow.get(r);return{...t instanceof Tw?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Iw(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;ww(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Cw(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?dw(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Lw(e,t){if(!hw(e))return!1;if(t){let n=Fw(e);t(Iw(e.tr,n,n.left))}return!0}function Rw(e,t){if(!hw(e))return!1;if(t){let n=Fw(e);t(Iw(e.tr,n,n.right))}return!0}function zw(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Sw(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Bw(e,t){if(!hw(e))return!1;if(t){let n=Fw(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;zw(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=ow.get(e)}t(r)}return!0}function Vw(e,t,n){let r=dw(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function Hw(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Vw(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?dw(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,dw(r.type.schema).row.create(null,o)),e}function Uw(e,t){if(!hw(e))return!1;if(t){let n=Fw(e);t(Hw(e.tr,n,n.top))}return!0}function Ww(e,t){if(!hw(e))return!1;if(t){let n=Fw(e);t(Hw(e.tr,n,n.bottom))}return!0}function Gw(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Kw(e,t){if(!hw(e))return!1;if(t){let n=Fw(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Gw(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=ow.get(n.table)}t(r)}return!0}function qw(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Jw({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function Yw(e,t){let n=e.selection;if(!(n instanceof Tw)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Fw(e),{map:i}=r;if(Jw(i,r))return!1;if(t){let n=e.tr,a={},o=Cr.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!a[l]&&u){if(a[l]=!0,s==null)s=l,c=u;else{qw(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Cw(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=qw(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new Tw(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Xw(e,t){let n=dw(e.schema);return Zw(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Zw(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof Tw){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=mw(r.$from),!i)return!1;a=pw(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=Fw(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof Tw&&u.setSelection(new Tw(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Qw(e){return function(t,n){if(!hw(t))return!1;if(n){let r=dw(t.schema),i=Fw(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function $w(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function eT(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Qw(e):function(t,n){if(!hw(t))return!1;if(n){let r=dw(t.schema),i=Fw(t),a=t.tr,o=$w(`row`,i,r),s=$w(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}eT(`row`,{useDeprecatedLogic:!0}),eT(`column`,{useDeprecatedLogic:!0}),eT(`cell`,{useDeprecatedLogic:!0});function tT(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function nT(e){return function(t,n){if(!hw(t))return!1;let r=tT(gw(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(Or.between(e,yw(e))).scrollIntoView())}return!0}}function rT(e,t){let n=e.selection;if(!(n instanceof Tw))return!1;if(t){let r=e.tr,i=dw(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new Mr(i,0,0))}),r.docChanged&&t(r)}return!0}function iT(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=oT(dw(o).row,new Mr(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?oT(dw(o).row,new Mr(t,n,r)).content:t);else return null;return aT(o,s)}function aT(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(Cr.empty),n[i]<r){let a=dw(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(Cr.from(o))}return{height:t.length,width:r,rows:t}}function oT(e,t){let n=e.createAndFill();return new Ar(n).replace(0,n.content.size,t).doc}function sT({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Sw(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(Cr.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(Cr.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function cT(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=dw(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,Cr.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function lT(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function uT(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Sw(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Sw(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function dT(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=ow.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=ow.get(a),f=d.mapping.maps.length}cT(d,o,a,n,l,u,f)&&p(),lT(d,o,a,n,c,l,s,f)&&p(),lT(d,o,a,n,c,l,u,f)&&p(),uT(d,o,a,n,s,u,c,f)&&p(),uT(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new Mr(i.rows[e-s],0,0))}p(),d.setSelection(new Tw(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var fT=wt({ArrowLeft:mT(`horiz`,-1),ArrowRight:mT(`horiz`,1),ArrowUp:mT(`vert`,-1),ArrowDown:mT(`vert`,1),"Shift-ArrowLeft":hT(`horiz`,-1),"Shift-ArrowRight":hT(`horiz`,1),"Shift-ArrowUp":hT(`vert`,-1),"Shift-ArrowDown":hT(`vert`,1),Backspace:rT,"Mod-Backspace":rT,Delete:rT,"Mod-Delete":rT});function pT(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function mT(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Tw)return pT(n,r,Nr.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=yT(i,e,t);if(o==null)return!1;if(e==`horiz`)return pT(n,r,Nr.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=xw(i,e,t),s;return s=a?Nr.near(a,1):t<0?Nr.near(n.doc.resolve(i.before(-1)),-1):Nr.near(n.doc.resolve(i.after(-1)),1),pT(n,r,s)}}}function hT(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Tw)o=a;else{let r=yT(i,e,t);if(r==null)return!1;o=new Tw(n.doc.resolve(r))}let s=xw(o.$headCell,e,t);return s?pT(n,r,new Tw(o.$anchorCell,s)):!1}}function gT(e,t){let n=e.state.doc,r=pw(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Tw(r))),!0):!1}function _T(e,t,n){if(!hw(e.state))return!1;let r=iT(n),i=e.state.selection;if(i instanceof Tw){r||={width:1,height:1,rows:[Cr.from(oT(dw(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=ow.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=sT(r,o.right-o.left,o.bottom-o.top),dT(e.state,e.dispatch,a,o,r),!0}if(r){let t=gw(e.state),n=t.start(-1);return dT(e.state,e.dispatch,n,ow.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function vT(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=bT(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof Tw)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=pw(e.state.selection.$anchor))!=null&&xT(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=xT(e,n),i=fw.getState(e.state)==null;if(!r||!bw(t,r)){if(i)r=t;else return}let a=new Tw(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(fw,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),fw.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(fw,-1))}function o(r){let o=r,s=fw.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(bT(e,o.target)!=n&&(c=xT(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function yT(e,t,n){if(!(e.state.selection instanceof Or))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function bT(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function xT(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&pw(e.state.doc.resolve(r))||pw(e.state.doc.resolve(i))}var ST=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),CT(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,CT(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function CT(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var wT=new Dr(`tableColumnResizing`);function TT({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=ST,lastColumnResizable:i=!0}={}){let a=new Lr({key:wT,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=dw(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new ET(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=wT.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{DT(t,n,e,i)},mouseleave:e=>{OT(e)},mousedown:(e,r)=>{kT(e,r,t,n)}},decorations:e=>{let t=wT.getState(e);if(t&&t.activeHandle>-1)return RT(e,t.activeHandle)},nodeViews:{}}});return a}var ET=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(wT);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return vw(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function DT(e,t,n,r){if(!e.editable)return;let i=wT.getState(e.state);if(i&&!i.dragging){let a=jT(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=MT(e,t,`left`,n):i-t.clientX<=n&&(o=MT(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=ow.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}PT(e,o)}}}function OT(e){if(!e.editable)return;let t=wT.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&PT(e,-1)}function kT(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=wT.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=AT(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(wT,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=wT.getState(e.state);r?.dragging&&(FT(e,r.activeHandle,NT(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(wT,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=wT.getState(e.state);if(i&&i.dragging){let a=NT(i.dragging,t,n);IT(e,i.activeHandle,a,r)}}return IT(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function AT(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function jT(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function MT(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=pw(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=ow.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function NT(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function PT(e,t){e.dispatch(e.state.tr.setMeta(wT,{setHandle:t}))}function FT(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=ow.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():LT(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function IT(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=ow.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&CT(a,c.firstChild,c,r,s,n)}function LT(e){return Array(e).fill(0)}function RT(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return Fr.empty;let a=ow.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,wT.getState(e)?.dragging&&n.push(Rr.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Rr.widget(s,c))}}return Fr.create(e.doc,n)}function zT({allowTableNodeSelection:e=!1}={}){return new Lr({key:fw,state:{init(){return null},apply(e,t){let n=e.getMeta(fw);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Dw,handleDOMEvents:{mousedown:vT},createSelectionBetween(e){return fw.getState(e.state)==null?null:e.state.selection},handleTripleClick:gT,handleKeyDown:fT,handlePaste:_T},appendTransaction(t,n,r){return Aw(r,Nw(r,n),e)}})}var BT=`childContainer`,VT=`blockGroupChild`;function HT(e){return e.isInGroup(`childContainer`)&&e.isInGroup(`bnBlock`)}function UT(e,t){return e.nodes.blockGroup.createChecked({},t)}function WT(e){return HT(e)&&e.spec.blockConfig?.placeable===`namedOnly`}var GT={min:30,max:49},KT=101;function qT(e){if(e===void 0)return 40;let t=Math.round((e-KT)/10);return Math.min(GT.max,Math.max(GT.min,40+t))}function JT(e){return e!==void 0&&`min`in e?e.min??1:1}function YT(e,t){if(e.length===0)return VT;let n=[`blockContainer`,...Object.entries(t).filter(([t,{config:n}])=>n.layoutOnly===!0&&n.placeable!==`namedOnly`&&!e.includes(t)).map(([e])=>e)];return n.length===1?n[0]:`(${n.join(` | `)})`}function XT(e={},t=VT){let{allow:n=`blocks`}=e,r=JT(e),i;if(n===`blocks`)i=t;else{if(n.length===0)throw Error("Layout block `allow` permits nothing. A layout block must accept at least one block or layout block type; drop `children` entirely for a block that holds none.");i=n.length===1?n[0]:`(${n.join(` | `)})`}return i+(r===0?`*`:r===1?`+`:`{${r},}`)}function ZT(e,t){return t===`start`?e.beforePos+4:e.afterPos-4}function QT(e,t){return!e.hasContent||e.contentKind===`none`?null:e.contentKind===`table`?ZT(e.content,t):t===`start`?e.contentStart:e.contentEnd}function $T(e,t,n){let r=QT(t,n);if(r!==null)return Or.create(e,r);if(t.hasContent)return Ir.create(e,t.content.beforePos);let{node:i,childrenStart:a,childrenEnd:o}=t.children,s=n===`start`?i.firstChild:i.lastChild;return s?$T(e,aE(s,n===`start`?a:o-s.nodeSize),n):Ir.create(e,t.block.beforePos)}function eE(e){return e.marks.some(e=>[`y-attributed-delete`].includes(e.type.name))}var tE=new WeakMap;function nE(e){let t=tE.get(e);if(t===void 0){let n=new Map,r=new Map;e.descendants(e=>{let t=e.attrs.id;if(t){let i=r.get(t)??0;eE(e)&&!n.has(e)&&n.set(e,`${t}-${i}`),r.set(t,i+1)}return!0}),t=n,tE.set(e,t)}return t}function rE(e,t){let n=e.attrs.id;if(!n)throw Error(`Node ${e.type.name} does not have an ID`);if(eE(e)){let r=nE(t).get(e);if(r===void 0)throw Error(`Node ${e.type.name} with ID ${n} not found in document`);return r}return n}function iE(e,t){let n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup(`bnBlock`))return{posBeforeNode:n.pos,node:n.nodeAfter};let r=n.depth,i=n.node(r);for(;r>0;){if(i.type.isInGroup(`bnBlock`))return{posBeforeNode:n.before(r),node:i};r--,i=n.node(r)}let a=[];e.descendants((e,t)=>{e.type.isInGroup(`bnBlock`)&&a.push(t)}),console.warn(`Position ${t} is not within a blockContainer node.`);let o=e.resolve(a.find(e=>e>=t)||a[a.length-1]);return{posBeforeNode:o.pos,node:o.nodeAfter}}function aE(e,t){if(!e.type.isInGroup(`bnBlock`))throw Error(`Attempted to get block node at position but found node of different type ${e.type.name}`);let n={node:e,beforePos:t,afterPos:t+e.nodeSize};if(HT(e.type))return{hasContent:!1,block:n,children:{...n,childrenStart:n.beforePos+1,childrenEnd:n.afterPos-1},blockNoteType:e.type.name};if(e.type.name===`blockContainer`){let r=e.firstChild;if(!r||!r.type.isInGroup(`blockContent`))throw Error(`blockContainer must start with a block content node.`);let i={node:r,beforePos:t+1,afterPos:t+1+r.nodeSize},a;if(e.childCount>1){let t=e.child(1);if(e.childCount!==2||t.type.name!==`blockGroup`)throw Error(`blockContainer may only have a blockGroup after its content.`);a={node:t,beforePos:i.afterPos,afterPos:n.afterPos-1,childrenStart:i.afterPos+1,childrenEnd:n.afterPos-2}}let o=i.node.type.spec.blockConfig;if(!o)throw Error(`Block content node "${i.node.type.name}" was not built from a block spec, so it has no content kind. Register it with \`createBlockSpec\`/\`createBlockSpecFromTiptapNode\` instead of joining the \`blockContent\` group directly.`);return{hasContent:!0,block:n,content:i,children:a,contentStart:i.beforePos+1,contentEnd:i.afterPos-1,contentKind:o.content,isContentEmpty:i.node.childCount===0,blockNoteType:i.node.type.name}}throw Error(`Node "${e.type.name}" is not a container or blockContainer.`)}function oE(e,t){let n=e.resolve(t);if(!n.nodeAfter)throw Error(`Attempted to get block node at position ${t} but a node at this position does not exist`);return aE(n.nodeAfter,n.pos)}function sE(e,t){let n=iE(e.doc,t);return aE(n.node,n.posBeforeNode)}function cE(e){return sE(e,e.selection.anchor)}function lE(e,t){let n=e.resolve(t),r=n.node();if(r.type.isInGroup(`bnBlock`))return oE(e,n.before(n.depth));if(r.type.isInGroup(`childContainer`)&&n.depth>1)return oE(e,n.before(n.depth-1))}function uE(e,t){let n=e.resolve(t),r=n.index();if(r!==0)return oE(e,n.posAtIndex(r-1))}function dE(e,t){let n=e.resolve(t),r=n.index();if(r!==n.node().childCount-1)return oE(e,n.posAtIndex(r+1))}function fE(e){for(;e.children&&e.children.node.childCount;){let t=e.children.node.lastChild;e=aE(t,e.children.childrenEnd-t.nodeSize)}return e}function pE(e,t,n,r){if(n===`before`||n===`after`){let i=n===`before`?t.block.beforePos:t.block.afterPos,a=e.resolve(i);return a.parent.canReplaceWith(a.index(),a.index(),r)?{pos:i}:null}if(!t.children){let e=r.schema.nodes.blockGroup;return t.hasContent&&e?.contentMatch.matchType(r)?{pos:t.content.afterPos,wrapIn:e}:null}let i=n===`last-child`;for(;t.children;){let e=t.children,n=i?e.node.childCount:0;if(e.node.canReplaceWith(n,n,r))return{pos:i?e.childrenEnd:e.childrenStart};let a=i?e.node.lastChild:e.node.firstChild;if(!a||!HT(a.type))break;t=aE(a,i?e.childrenEnd-a.nodeSize:e.childrenStart)}return null}function mE(e){for(;!e.hasContent;){let{node:t,childrenStart:n}=e.children;if(!t.firstChild)return null;e=aE(t.firstChild,n)}return e}function hE(e,t,n,r=`before`){for(;;){let i=e.resolve(t),a=i.node();if(a.canReplaceWith(i.index(),i.index(),n))return t;if(i.depth>0&&HT(a.type))t=r===`before`?i.before():i.after();else return}}function gE(e,t){let n=e.resolve(t),r=[];for(let e=n.depth;e>0;e--){let t=n.node(e);if(!HT(t.type))break;t.attrs.id&&r.push({id:t.attrs.id,depth:e})}return r}function _E(e,t){return t.length===1&&t[0].before===e?t[0]:Lt(e,[...t])}function vE(e){let{mapping:t,steps:n}=e,r=t.maps;for(let e=0;e<r.length;e++)if(t.getMirror(e)!==void 0)return kt({mapping:t,steps:n});let i=new bE(r),a=[];return r.forEach((e,t)=>{let r=[];if(e.forEach((e,t)=>r.push({from:e,to:t})),!r.length){let{from:e,to:i}=n[t];if(e===void 0||i===void 0)return;r.push({from:e,to:i})}for(let{from:e,to:n}of r){let r=i.mapForward(e,-1,t),o=i.mapForward(n,1,t);a.push({oldRange:{from:i.mapBackward(r,-1),to:i.mapBackward(o,1)},newRange:{from:r,to:o}})}}),yE(a)}function yE(e){let t=new Set,n=e.filter(({oldRange:e,newRange:n})=>{let r=`${e.from},${e.to},${n.from},${n.to}`;return!t.has(r)&&(t.add(r),!0)});if(n.length===1)return n;let r=n.map((e,t)=>t).sort((e,t)=>n[e].newRange.from-n[t].newRange.from),i=new SE(r.map(e=>n[e].newRange.to),`max`);return n.filter((e,t)=>{let a=0,o=r.length-1;for(;a<o;){let t=a+o+1>>1;n[r[t]].newRange.from<=e.newRange.from?a=t:o=t-1}return!i.someBefore(a,t=>t>=e.newRange.to,e=>r[e]!==t)})}var bE=class{maps;inverted;firstStarts=[];oldEnds=[];newEnds=[];shift=[0];trees;constructor(e){this.maps=e,this.inverted=Array(e.length);for(let t of e){let e=1/0,n=-1/0,r=-1/0,i=0;t.forEach((t,a,o,s)=>{e=Math.min(e,t,o),n=Math.max(n,a),r=Math.max(r,s),i+=s-o-(a-t)}),this.firstStarts.push(e),this.oldEnds.push(n),this.newEnds.push(r),this.shift.push(this.shift[this.shift.length-1]+i)}}mapForward(e,t,n){let r=0,i=n;for(;i<this.maps.length;)if(e<this.firstStarts[i])r=Math.max(r,0)+1,r>xE?(i=this.getTrees().firstStart.firstFrom(i,t=>t<=e),r=0):i++;else if(e>this.oldEnds[i]){if(r=Math.min(r,0)-1,r<-xE){let t=e-this.shift[i],n=this.getTrees().forwardShiftFrom.firstFrom(i,e=>e>=t);e+=this.shift[n]-this.shift[i],i=n,r=0}else e+=this.shift[i+1]-this.shift[i],i++}else e=this.maps[i].map(e,t),r=0,i++;return e}mapBackward(e,t){let n=0,r=this.maps.length-1;for(;r>=0;)if(e<this.firstStarts[r])n=Math.max(n,0)+1,n>xE?(r=this.getTrees().firstStart.lastFrom(r,t=>t<=e),n=0):r--;else if(e>this.newEnds[r]){if(n=Math.min(n,0)-1,n<-xE){let t=e-this.shift[r+1],i=this.getTrees().backwardShiftFrom.lastFrom(r,e=>e>=t);e-=this.shift[r+1]-this.shift[i+1],r=i,n=0}else e-=this.shift[r+1]-this.shift[r],r--}else this.inverted[r]??=this.maps[r].invert(),e=this.inverted[r].map(e,t),n=0,r--;return e}getTrees(){return this.trees??={firstStart:new SE(this.firstStarts,`min`),forwardShiftFrom:new SE(this.oldEnds.map((e,t)=>e-this.shift[t]),`max`),backwardShiftFrom:new SE(this.newEnds.map((e,t)=>e-this.shift[t+1]),`max`)},this.trees}},xE=8,SE=class{values;kind;size;tree;constructor(e,t){this.values=e,this.kind=t,this.size=e.length,this.tree=Array(4*Math.max(1,e.length)),e.length&&this.build(1,0,e.length-1)}firstFrom(e,t){let n=this.first(1,0,this.size-1,e,t);return n===-1?this.size:n}lastFrom(e,t){return this.last(1,0,this.size-1,e,t)}someBefore(e,t,n){for(let r=this.lastFrom(e,t);r!==-1;){if(n(r))return!0;r=r===0?-1:this.lastFrom(r-1,t)}return!1}build(e,t,n){if(t===n){this.tree[e]=this.values[t];return}let r=t+n>>1;this.build(2*e,t,r),this.build(2*e+1,r+1,n),this.tree[e]=this.kind===`min`?Math.min(this.tree[2*e],this.tree[2*e+1]):Math.max(this.tree[2*e],this.tree[2*e+1])}first(e,t,n,r,i){if(n<r||!i(this.tree[e]))return-1;if(t===n)return t;let a=t+n>>1,o=this.first(2*e,t,a,r,i);return o===-1?this.first(2*e+1,a+1,n,r,i):o}last(e,t,n,r,i){if(t>r||!i(this.tree[e]))return-1;if(t===n)return t;let a=t+n>>1,o=this.last(2*e+1,a+1,n,r,i);return o===-1?this.last(2*e,t,a,r,i):o}};function CE(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function wE(e){return CE(e.filter((t,n)=>e.indexOf(t)!==n))}function TE(e){return e.marks.some(e=>e.type.name===`y-attributed-delete`)}var EE=Ut.create({name:`uniqueID`,priority:1e4,addOptions(){return{types:[],setIdAttribute:!1,isWithinEditor:void 0,generateID:()=>{let e=globalThis.window??globalThis;if(e.__TEST_OPTIONS){let t=e.__TEST_OPTIONS;return t.mockID===void 0?t.mockID=0:t.mockID++,t.mockID.toString()}return rw()}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>{let t={"data-id":e.id};return this.options.setIdAttribute?{...t,id:e.id}:t}}}}]},addProseMirrorPlugins(){let{isWithinEditor:e}=this.options,t=null,n=!1;return[new Lr({key:new Dr(`uniqueID`),appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged)||t.doc.eq(n.doc))return;let{tr:r}=n,{types:i,generateID:a}=this.options,o=_E(t.doc,e),{mapping:s}=o;if(vE(o).forEach(({newRange:e})=>{let o=Mt(n.doc,e,e=>i.includes(e.type.name)),c=wE(o.filter(({node:e})=>!TE(e)).map(({node:e})=>e.attrs.id).filter(e=>e!==null));o.forEach(({node:e,pos:i})=>{if(TE(e))return;let o=r.doc.nodeAt(i)?.attrs.id;if(o===null){let o=t.doc.type.createAndFill().content;if(t.doc.content.findDiffStart(o)===null){let t=JSON.parse(JSON.stringify(n.doc.toJSON()));if(t.content[0].content[0].attrs.id=`initialBlockId`,JSON.stringify(t.content)===JSON.stringify(o.toJSON())){r.setNodeMarkup(i,void 0,{...e.attrs,id:`initialBlockId`});return}}r.setNodeMarkup(i,void 0,{...e.attrs,id:a()})}else c.includes(o)&&s.invert().mapResult(i).deleted&&r.setNodeMarkup(i,void 0,{...e.attrs,id:a()})})}),r.steps.length)return r.setMeta(`uniqueID`,!0),r},view(n){let r=r=>{let i=n.dom.parentElement;t=i?.contains(r.target)||e?.(r.target)?i:null};return window.addEventListener(`dragstart`,r),{destroy(){window.removeEventListener(`dragstart`,r)}}},props:{handleDOMEvents:{drop:(e,r)=>(n=t!==e.dom.parentElement||r.dataTransfer?.effectAllowed===`copy`,t=null,!1),paste:()=>(n=!0,!1)},transformPasted:e=>{if(!n)return e;let{types:t}=this.options,r=e=>{let n=[];return e.forEach(e=>{if(e.isText){n.push(e);return}if(!t.includes(e.type.name)){n.push(e.copy(r(e.content)));return}let i=e.type.create({...e.attrs,id:null},r(e.content),e.marks);n.push(i)}),Cr.from(n)};return n=!1,new Mr(r(e.content),e.openStart,e.openEnd)}}})]}});function DE(e){return e.type===`link`}function OE(e){return typeof e!=`string`&&e.type===`link`}function kE(e){return typeof e!=`string`&&e.type===`text`}function AE(e){return ME(e)?{...e}:jE(e)?{type:`tableCell`,content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??`default`,textColor:e.props?.textColor??`default`,textAlignment:e.props?.textAlignment??`left`,colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:`tableCell`,content:[].concat(e),props:{backgroundColor:`default`,textColor:`default`,textAlignment:`left`,colspan:1,rowspan:1}}}function jE(e){return e!=null&&typeof e!=`string`&&!Array.isArray(e)&&e.type===`tableCell`}function ME(e){return jE(e)&&e.props!==void 0&&e.content!==void 0}function NE(e){return ME(e)?e.props.colspan??1:1}function PE(e){return ME(e)?e.props.rowspan??1:1}var FE=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}};function IE(e,t=!0){let{"data-test":n,...r}=e;if(Object.keys(r).length>0&&t)throw Error(`Object must be empty `+JSON.stringify(e))}var LE=()=>typeof navigator<`u`&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function RE(e,t=`Ctrl`){return LE()?e.replace(`Mod`,`⌘`):e.replace(`Mod`,t)}function zE(...e){return[...new Set(e.filter(e=>e).join(` `).split(` `))].join(` `)}var BE=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),VE,HE=()=>typeof navigator>`u`||typeof window>`u`?!1:(VE===void 0&&(VE=navigator.maxTouchPoints>0&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches),VE);function UE(e,t,n,r){let i=document.createElement(`div`);i.className=zE(`bn-block-content`,n.class),i.setAttribute(`data-content-type`,e);for(let[e,t]of Object.entries(n))e!==`class`&&i.setAttribute(e,t);let a=document.createElement(t);a.className=zE(`bn-inline-content`,r.class);for(let[e,t]of Object.entries(r))e!==`class`&&a.setAttribute(e,t);return i.appendChild(a),{dom:i,contentDOM:a}}var WE=(e,t)=>{let n=UO(e,t.pmSchema);n.type.name===`blockContainer`&&(n=n.firstChild);let r=t.pmSchema.nodes[n.type.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=r(n);if(typeof i!=`object`||!(`dom`in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return i};function GE(e,t=`<br>`){let n=e.querySelectorAll(`p`);if(n.length>1){let e=n[0];for(let r=1;r<n.length;r++){let i=n[r];e.innerHTML+=t+i.innerHTML,i.remove()}}}var KE=`blockLevelSuggestion`;function qE(e){return e&&e.options.extensions.some(e=>{if(e.type!==`mark`)return!1;let t=Gt(e,`group`);return typeof t==`string`&&t.split(` `).includes(`blockLevelSuggestion`)})?KE:``}function JE(e){return e.type!==`attributes`||!e.attributeName?!1:e.attributeName.startsWith(`data-darkreader`)?!0:e.attributeName===`style`?(e.target.getAttribute(`style`)??``).includes(`--darkreader`)||(e.oldValue??``).includes(`--darkreader`):!1}function YE(e){let t=e.ignoreMutation?.bind(e),n=e.contentDOM;e.ignoreMutation=e=>JE(e)?!0:t?t(e):!n&&e.type!==`selection`}function XE(e){return`data-`+e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function ZE(e){let t=e.split(`/`);return!t.length||t[t.length-1]===``?e:t[t.length-1]}function QE(e){let t=[`mp4`,`webm`,`ogg`,`mov`,`mkv`,`flv`,`avi`,`wmv`,`m4v`];try{let n=new URL(e).pathname.split(`.`).pop()?.toLowerCase()||``;return t.includes(n)}catch{return!1}}function $E(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(e=>e in t)}function eD(e,t){let n={};for(let r of $E(e,t)){let i=e[r];i!==void 0&&i!==t[r].default&&(n[XE(r)]=String(i))}return n}function tD(e,t){for(let[n,r]of Object.entries(t))e.setAttribute(n,r)}function nD(e,t,n){let r=eD(t,n);for(let i of $E(t,n)){let t=XE(i);t in r?e.setAttribute(t,r[t]):e.removeAttribute(t)}}function rD(e){return`doc`in e?e.doc.type.schema:e.type.schema}function iD(e){return e.cached.blockNoteEditor}function aD(e){return iD(e).schema}function oD(e){return aD(e).blockSchema}function sD(e){return aD(e).inlineContentSchema}function cD(e){return aD(e).styleSchema}function lD(e){return iD(e).blockCache}function uD(e,t){if(oD(e)[t.name]?.content===`plain`)return!0;let n=sD(e)[t.name];return typeof n==`object`&&n.content===`plain`}function dD(e){let t=``;return e.forEach(e=>{eE(e)||(t+=e.textContent)}),t}function fD(e,t,n){let r={type:`tableContent`,columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},i=[];e.content.forEach((e,a,o)=>{let s={cells:[]};o===0&&e.content.forEach(e=>{let t=e.attrs.colwidth;t??=Array(e.attrs.colspan??1).fill(void 0),r.columnWidths.push(...t)}),s.cells=e.content.content.map((e,r)=>(i[o]||(i[o]=[]),i[o][r]=e.type.name===`tableHeader`,{type:`tableCell`,content:e.content.content.map(e=>pD(e,t,n)).reduce((e,t)=>{if(!e.length)return t;let n=e[e.length-1],r=t[0];return r&&kE(n)&&kE(r)&&JSON.stringify(n.styles)===JSON.stringify(r.styles)?(n.text+=`
|
|
436
|
-
`+r.text,e.push(...t.slice(1)),e):(e.push(...t),e)},[]),props:{colspan:e.attrs.colspan,rowspan:e.attrs.rowspan,backgroundColor:e.attrs.backgroundColor,textColor:e.attrs.textColor,textAlignment:e.attrs.textAlignment}})),r.rows.push(s)});for(let e=0;e<i.length;e++)i[e]?.every(e=>e)&&(r.headerRows=(r.headerRows??0)+1);for(let e=0;e<i[0]?.length;e++)i?.every(t=>t[e])&&(r.headerCols=(r.headerCols??0)+1);return r}function pD(e,t,n){let r=[],i;return e.content.forEach(e=>{if(e.type.name===`hardBreak`){if(i){if(kE(i))i.text+=`
|
|
437
|
-
`;else if(DE(i))i.content[i.content.length-1].text+=`
|
|
438
|
-
`;else throw Error(`unexpected`)}else i={type:`text`,text:`
|
|
439
|
-
`,styles:{}};return}if(e.type.name!==`link`&&e.type.name!==`text`){if(!t[e.type.name]){console.warn(`unrecognized inline content type`,e.type.name);return}i&&=(r.push(i),void 0),r.push(mD(e,t,n));return}let a={},o;for(let t of e.marks)if(t.type.name===`link`)o=t;else{let e=n[t.type.name];if(!e){if(t.type.spec.blocknoteIgnore)continue;throw Error(`style ${t.type.name} not found in styleSchema`)}if(e.propSchema===`boolean`)a[e.type]=!0;else if(e.propSchema===`string`)a[e.type]=t.attrs.stringValue;else throw new FE(e.propSchema)}i?kE(i)?o?(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):JSON.stringify(i.styles)===JSON.stringify(a)?i.text+=e.textContent:(r.push(i),i={type:`text`,text:e.textContent,styles:a}):DE(i)&&(o?i.href===o.attrs.href?JSON.stringify(i.content[i.content.length-1].styles)===JSON.stringify(a)?i.content[i.content.length-1].text+=e.textContent:i.content.push({type:`text`,text:e.textContent,styles:a}):(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):(r.push(i),i={type:`text`,text:e.textContent,styles:a})):i=o?{type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}:{type:`text`,text:e.textContent,styles:a}}),i&&r.push(i),r}function mD(e,t,n){if(e.type.name===`text`||e.type.name===`link`)throw Error(`unexpected`);let r={},i=t[e.type.name];for(let[t,n]of Object.entries(e.attrs)){if(!i)throw Error(`ic node is of an unrecognized type: `+e.type.name);t in i.propSchema&&(r[t]=n)}let a;return a=i.content===`styled`?pD(e,t,n):i.content===`plain`?dD(e):void 0,{type:e.type.name,props:r,content:a}}function hD(e,t){let n=e.type.schema,r=oD(n),i=sD(n),a=cD(n),o=lD(n);if(!e.type.isInGroup(`bnBlock`))throw Error(`Node should be a block, but is instead: `+e.type.name);let s=o?.get(e);if(s)return s;let c=aE(e,0),l;try{l=rE(c.block.node,t)}catch{l=EE.options.generateID()}let u=r[c.blockNoteType];if(!u)throw Error(`Block is of an unrecognized type: `+c.blockNoteType);let d={};for(let[t,n]of Object.entries({...e.attrs,...c.hasContent?c.content.node.attrs:{}})){let e=u.propSchema;t in e&&(e[t].default!==void 0||n!==void 0)&&(d[t]=n)}let f=[];c.children?.node.forEach(e=>{f.push(hD(e,t))});let p;switch(c.contentKind){case`inline`:p=pD(c.content.node,i,a);break;case`table`:p=fD(c.content.node,i,a);break;case`plain`:{let e=dD(c.content.node);p=e.length>0?[{type:`text`,text:e,styles:{}}]:[];break}case`none`:case void 0:p=void 0;break;default:throw new FE(c)}let m={id:l,type:u.type,props:d,content:p,children:f};return o?.set(e,m),m}function gD(e){let t=[];return e.firstChild&&e.firstChild.descendants(n=>(t.push(hD(n,e)),!1)),t}function _D(e){function t(n,r,i){if(n.type.name!==`blockGroup`&&!HT(n.type))throw Error(`unexpected`);let a=[],o,s;return n.forEach((c,l,u)=>{let d=u===0,f=u===n.childCount-1,p=HT(c.type);if(!p){if(c.type.name!==`blockContainer`)throw Error(`unexpected`);if(c.childCount===0)return;if(c.childCount>2)throw Error(`unexpected, blockContainer.childCount: `+c.childCount)}let m=!p&&c.firstChild.type.name===`blockGroup`;if(m&&!d)throw Error(`unexpected`);if(m||p&&(d&&r>0||f&&i>0)){let e=t(p?c:c.firstChild,d?Math.max(0,r-1):0,f?Math.max(0,i-1):0);d&&(o=e.blockCutAtStart),f&&(s=e.blockCutAtEnd),a.push(...e.blocks);return}if(p){a.push(hD(c,e.content.firstChild));return}let h=hD(c,e.content.firstChild),g=c.childCount>1?c.child(1):void 0,_=[];if(g){let e=t(g,0,f?Math.max(0,i-1):0);_=e.blocks,f&&(s=e.blockCutAtEnd)}f&&!g&&i>1&&(s=h.id),d&&r>1&&(o=h.id),a.push({...h,children:_})}),{blocks:a,blockCutAtStart:o,blockCutAtEnd:s}}if(e.content.childCount===0)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(e.content.childCount!==1)throw Error(`slice must be a single block, did you forget includeParents=true?`);return t(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function vD(e,t,n,r,i){e&&(nD(e,n,r),e.setAttribute(`data-node-type`,t),i&&e.setAttribute(`data-id`,i))}var yD=`data-frame-slot`;function bD(e){e.setAttribute(yD,``)}function xD(e){if(e.hasAttribute(`data-frame-slot`))return e;for(let t of e.querySelectorAll(`[${yD}]`))if(t.closest(`[data-node-type]`)===e)return t}function SD(e,t,n){vD(t.dom,e.type,n.props,e.propSchema,n.id),bD(t.slot)}function CD(e,t){let n=e.blockImplementations[t.type],r=n.implementation.renderFrame?.call({renderType:`dom`,props:void 0,propSchema:n.config.propSchema},t,e);if(n.config.layoutOnly===!0){if(!r)throw Error(`Layout block "${t.type}" must draw its frame: \`renderFrame\` returned undefined.`);SD(n.config,r,t)}return r}function wD(e){let{props:t,editor:n,blockNode:r}=e;return n.blockImplementations[r(t.node).type.name].implementation.frameView?.(t)??TD(e)}function TD(e){let{props:t,editor:n,blockNode:r,unframed:i}=e,a=n.blockImplementations[r(t.node).type.name].config;function o(e,t){a.layoutOnly===!0&&SD(a,e,t)}function s(e){let i=n.blockImplementations[r(e).type.name],a=i.implementation.renderFrame;if(!a)return;let s=hD(e,t.view.state.doc),c=a.call({renderType:`nodeView`,props:t,propSchema:i.config.propSchema},s,n);if(c)return o(c,s),c}let c=s(t.node),l,u;if(c)l=c.dom,u=c.slot;else if(i)l=i,u=i;else throw Error(`Block "${r(t.node).type.name}" must draw its frame: \`renderFrame\` returned undefined.`);let d=t.node;return{dom:l,slot:u,get node(){return d},update(e){let n=r(d),i=r(e);if(!c){let t=i.sameMarkup(n)?void 0:s(e);return t?(t.destroy?.(),!1):(d=e,!0)}if(i.type!==n.type)return!1;if(c.update){let n=hD(e,t.view.state.doc);if(c.update(n)===!1)return!1;o(c,n)}else if(!i.sameMarkup(n))return!1;return d=e,!0},destroy:()=>c?.destroy?.()}}var ED=new Set([`dragenter`,`dragover`,`dragleave`,`drop`,`copy`,`cut`,`paste`]);function DD(e,t){let n=t.target;return n instanceof globalThis.Node&&e.dom.contains(n)&&!e.slot.contains(n)&&!ED.has(t.type)}function OD(e,t){return t.type===`selection`?!1:JE(t)||t.target===e.slot&&t.type===`attributes`?!0:e.dom.contains(t.target)&&!e.slot.contains(t.target)}function kD(e){return{stopEvent:t=>DD(e,t),ignoreMutation:t=>OD(e,t),selectNode:e.selectNode?.bind(e),deselectNode:e.deselectNode?.bind(e),destroy:e.destroy?.bind(e)}}function AD(e,t){let{isLayoutBlock:n,hardBreakShortcut:r}=t,i={enter:r===`enter`?`line-break`:`split`,shiftEnter:r===`none`?`same-as-enter`:`line-break`,splitKeepsType:!1,splitKeepsChildren:!1,resetsTo:{type:`paragraph`},emptyEnterResets:!1,emptyChildEnter:n?`exit-at-end`:`outdent`,childrenCanOutdent:!n};if(typeof e==`function`)return t=>jD(i,e(t));let a=jD(i,e);return()=>a}function jD(e,t){let n={...e};for(let[e,r]of Object.entries(t??{}))r!==void 0&&Object.assign(n,{[e]:r});return t?.splitKeepsChildren===void 0&&(n.splitKeepsChildren=n.enter===`into-children`),n}function MD(e,t){let n=t.layoutOnly===!0;return{...e,selectable:e?.selectable??!0,code:n?!1:e?.code??!1,defining:n?!0:e?.defining??!0,isolating:n?!1:e?.isolating??!0,draggable:e?.draggable??t.placeable!==`namedOnly`}}function ND(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={default:n.default,keepOnSplit:!0,parseHTML:t=>{let r=t.getAttribute(XE(e));if(r===null)return null;if(n.default===void 0&&n.type===`boolean`||n.default!==void 0&&typeof n.default==`boolean`)return r===`true`||r!==`false`&&null;if(n.default===void 0&&n.type===`number`||n.default!==void 0&&typeof n.default==`number`){let e=parseFloat(r);return!Number.isNaN(e)&&Number.isFinite(e)?e:null}return r},renderHTML:t=>eD({[e]:t[e]},{[e]:n})}}),t}function PD(e,t){let n=e();if(n===void 0)throw Error(`Cannot find node position`);let r=t.resolve(n).node();if(!r)throw Error(`Cannot find block container`);return hD(r,t)}function FD(e,t,n){try{return PD(e,n)}catch(e){let r=n.type.schema.nodes.blockContainer?.createAndFill(null,t);if(r)return hD(r,n);throw e}}var ID=11;function LD(e){return e.nodeType===ID}function RD(e,t){if(t&&!LD(e))for(let[n,r]of Object.entries(t))n===`class`?e.className=zE(e.className,r):e.setAttribute(n,r)}function zD(e,t,n,r,i=!1,a){let o=document.createElement(`div`);if(a!==void 0)for(let[e,t]of Object.entries(a))e!==`class`&&o.setAttribute(e,t);return o.className=zE(`bn-block-content`,a?.class||``),o.setAttribute(`data-content-type`,t),tD(o,eD(n,r)),i&&o.setAttribute(`data-file-block`,``),o.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=zE(`bn-inline-content`,e.contentDOM.className)),{...e,dom:o}}function BD(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,meta:MD(void 0,{}),keyboard:AD(void 0,{isLayoutBlock:!1,hardBreakShortcut:void 0}),render:WE,toExternalHTML:WE},extensions:n}}function VD(e,t){e.stopEvent=e=>(e.type===`mousedown`&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function HD(e,t){let n=e.layoutOnly===!0;if(!(e.content===`table`||n&&!t.parseContent))return(r,i)=>{if(t.parseContent){let e=t.parseContent({el:r,schema:i});if(e!==void 0)return e}if(n)return Br.fromSchema(i).parse(r,{topNode:i.nodes.blockGroup.create(),preserveWhitespace:!0}).content;if(e.content===`none`)return Cr.empty;let a=r.cloneNode(!0);GE(a,e.content===`plain`||t.meta?.code?`
|
|
440
|
-
`:`<br>`);let o=Br.fromSchema(i).parse(a,{topNode:i.nodes.paragraph.create(),preserveWhitespace:e.content!==`plain`||`full`});if(e.content===`inline`)return o.content;let s=[];return o.content.forEach(e=>{if(e.isText){s.push(e);return}let t=e.type===i.linebreakReplacement?`
|
|
441
|
-
`:e.textContent;t&&s.push(i.text(t,e.marks))}),Cr.fromArray(s)}}function UD(e,t){let n=[e.layoutOnly===!0?{tag:`[data-node-type=${e.type}]`,contentElement:e=>xD(e)??e}:{tag:`[data-content-type=`+e.type+`]`,contentElement:`.bn-inline-content`,preserveWhitespace:e.content===`plain`?`full`:void 0}];return t.parse&&n.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t.parse?.(e);return n!==void 0&&n},preserveWhitespace:!0,getContent:HD(e,t)}),n}function WD(e,t){if(e.layoutOnly!==!0){if(!t.render)throw Error(`Block "${e.type}" must declare \`render\`.`)}else{if(t.render)throw Error(`Layout block "${e.type}" draws its box in \`renderFrame\`, and has no content for \`render\` to draw.`);if(!t.renderFrame)throw Error(`Layout block "${e.type}" must declare \`renderFrame\`.`)}}function GD(e,t){let n=wD({props:t,editor:t.extension.options.editor,blockNode:e=>e}),r={dom:n.dom,contentDOM:n.slot,update(e,t,r){return e.attrs.id===n.node.attrs.id&&n.update(e,t,r)},...kD(n)};return e.meta.selectable||VD(r,t.editor),r}function KD(e,t,n){if(e.layoutOnly===!0)return GD(t,n);let r=FD(n.getPos,n.node,n.view.state.doc),i=t.render.call({blockContentDOMAttributes:n.extension.options.domAttributes?.blockContent||{},props:n,renderType:`nodeView`,propSchema:e.propSchema},r,n.extension.options.editor);return t.meta.selectable||VD(i,n.editor),YE(i),i}function qD(e){let t=e!==void 0&&`exclude`in e?e.exclude:[];return t===void 0||t.length===0?XT(e):function(){return XT(e,YT(t,this.options.editor.schema.blockSpecs))}}function JD(e,t,n){let r=e.layoutOnly===!0;return zt.create({name:e.type,content:r?qD(e.children):e.content===`inline`?`inline*`:e.content===`plain`?`text*`:e.content===`none`?``:e.content,marks(){return r?qE(this.editor):e.content===`plain`?WC(this.editor):void 0},group:r?[`bnBlock`,BT,...e.placeable===`namedOnly`?[]:[VT]].join(` `):`blockContent`,selectable:t.meta.selectable,isolating:t.meta.isolating,code:t.meta.code,defining:t.meta.defining,priority:r?qT(n):n,addAttributes(){return ND(e.propSchema)},parseHTML(){return UD(e,t)},renderHTML({HTMLAttributes:n}){if(r){let t=document.createElement(`div`);t.setAttribute(`data-node-type`,e.type);for(let[e,r]of Object.entries(n))t.setAttribute(e,r);return{dom:t,contentDOM:t}}let i=document.createElement(`div`);return zD({dom:i,contentDOM:e.content===`inline`||e.content===`plain`?i:void 0},e.type,{},e.propSchema,t.meta.fileBlockAccept!==void 0,n)},addNodeView(){return n=>KD(e,t,n)}})}function YD(e,t,n,r){let i=e.layoutOnly===!0,a={...t,meta:MD(t.meta,e)},o=a.node??JD(e,a,r);if(o.name!==e.type)throw Error(`Node name does not match block type. This is a bug in BlockNote.`);WD(e,a);let s=o.extend({extendNodeSchema(t){return t.name===o.name?{blockConfig:e}:{}}}),{experimental_keyboard:c,render:l,toExternalHTML:u,...d}=a;return{config:e,implementation:{...d,keyboard:AD(c,{isLayoutBlock:i,hardBreakShortcut:a.meta.hardBreakShortcut}),node:s,...l&&{render(t,n){let r=s.options.domAttributes?.blockContent||{};return l.call({blockContentDOMAttributes:r,props:void 0,renderType:`dom`,propSchema:e.propSchema},t,n)}},...u&&{toExternalHTML:(t,n,r)=>{let a=s.options.domAttributes?.blockContent||{},o=u.call({blockContentDOMAttributes:a,propSchema:e.propSchema},t,n,r);return o&&i&&!LD(o.dom)&&nD(o.dom,t.props,e.propSchema),o}}},extensions:n}}function XD(e){return e}function ZD(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t,o=n?typeof n==`function`?n(r):n:void 0,s=i.layoutOnly===!0;WD(i,a);let c=a.render,l=a.toExternalHTML;return{config:i,implementation:{...a,...l&&{toExternalHTML(e,t,n){let r=l.call({blockContentDOMAttributes:this.blockContentDOMAttributes},e,t,n);if(r!==void 0)return s?(RD(r.dom,this.blockContentDOMAttributes),r):zD(r,e.type,e.props,this.propSchema??i.propSchema,a.meta?.fileBlockAccept!==void 0)}},...c&&{render(e,t){return zD(c.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},e,t),e.type,e.props,this.propSchema??i.propSchema,a.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}}},extensions:o}}}function QD(e,t,n,r){return e.dom.setAttribute(`data-inline-content-type`,t),tD(e.dom,eD(n,r)),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function $D(e){return{Backspace:({editor:t})=>{let n=t.state.selection.$from;return t.state.selection.empty&&n.node().type.name===e.type&&n.parentOffset===0}}}function eO(e,t,n){return{config:e,implementation:t,extensions:n}}function tO(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function nO(e){return e===`boolean`?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:e=>e.getAttribute(`data-value`),renderHTML:e=>e.stringValue===void 0?{}:{"data-value":e.stringValue}}}}function rO(e,t,n,r){return e.dom.setAttribute(`data-style-type`,t),r===`string`&&e.dom.setAttribute(`data-value`,n),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function iO(e,t){return{config:e,implementation:t}}function aO(e,t){return iO({type:e.name,propSchema:t},{mark:e,render(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=Tr.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a},toExternalHTML(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=Tr.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a}})}function oO(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function sO(e,t){let n=[{tag:`[data-style-type="${e.type}"]`,contentElement:e=>{let t=e;return t.matches(`[data-editable]`)?t:t.querySelector(`[data-editable]`)||t}}];return t&&n.push({tag:`*`,consuming:!1,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n!==void 0&&{stringValue:n}}}),n}function cO(e,t){let n=At.create({name:e.type,addAttributes(){return nO(e.propSchema)},parseHTML(){return sO(e,t.parse)},renderHTML({mark:n}){return rO((t.toExternalHTML||t.render)(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:n})=>rO(t.render(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)}});return iO(e,{...t,mark:n,render:n=>rO(t.render(n),e.type,n,e.propSchema),toExternalHTML:n=>rO((t.toExternalHTML||t.render)(n),e.type,n,e.propSchema)})}function lO(e){let t=dO(e),{roots:n,nonRoots:r}=fO(t),i=[];for(;n.size;){i.push(n);let r=new Set;for(let i of n){let n=e.get(i);if(n)for(let e of n){let n=t.get(e);if(n===void 0)continue;let i=n-1;t.set(e,i),i===0&&r.add(e)}}n=r}if(r=fO(t).nonRoots,r.size)throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(`, `)}`);return i}function uO(e){return lO(pO(e))}function dO(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,0);for(let e of r){let n=t.get(e)??0;t.set(e,n+1)}}return t}function fO(e){let t=new Set,n=new Set;for(let[r,i]of e.entries())i===0?t.add(r):n.add(r);return{roots:t,nonRoots:n}}function pO(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,new Set);for(let e of r)t.has(e)||t.set(e,new Set),t.get(e).add(n)}return t}function mO(){return new Map}function hO(e,t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),e}function gO(e){let t=mO();for(let n of e)Array.isArray(n.runsBefore)&&n.runsBefore.length>0?n.runsBefore.forEach(e=>{hO(t,n.key,e)}):hO(t,`default`,n.key);let n=uO(t),r=n.findIndex(e=>e.has(`default`));return e=>91+(n.findIndex(t=>t.has(e))+r)*10}function _O(e){for(let[t,{config:n}]of Object.entries(e)){if(n.layoutOnly===!0&&n.content!==`none`&&vO(t,'`layoutOnly: true` is only for blocks without content (`content: "none"`). A layout block holds only child blocks, no content of its own.'),n.placeable===`namedOnly`&&n.layoutOnly!==!0&&vO(t,'`placeable: "namedOnly"` is only for layout blocks (`layoutOnly: true`). Only a layout block can be limited to the blocks that name it in `children.allow`.'),!n.children)continue;let{allow:r=`blocks`,min:i,exclude:a,dissolve:o}=n.children;if(n.layoutOnly!==!0)(r!==`blocks`||i!==void 0||a!==void 0||o!==void 0)&&vO(t,'restricting child types, a minimum count or `dissolve` requires `layoutOnly: true`. Other blocks can always have any child blocks (`{ allow: "blocks" }`).');else{if(r===`blocks`&&(i!==void 0||o!==void 0)&&vO(t,`\`children.${i===void 0?`dissolve`:`min`}\` needs an \`allow\` list. A layout block that accepts any blocks always holds at least one child, and dissolves when its last child is removed.`),i!==void 0&&!(Number.isInteger(i)&&i>=0)&&vO(t,`\`children.min\` must be a whole number that is 0 or more, not ${String(i)}.`),a!==void 0){r!==`blocks`&&vO(t,"`children.exclude` is only for a layout block that accepts any blocks. An `allow` list already names exactly what the layout block holds.");for(let n of a){Object.prototype.hasOwnProperty.call(e,n)||vO(t,`\`exclude\` contains "${n}", which is not a configured block type.`);let{config:r}=e[n];r.layoutOnly!==!0&&vO(t,`\`exclude\` contains "${n}", which is not a layout block. Only layout blocks (\`layoutOnly: true\`) can be excluded.`),r.placeable===`namedOnly`&&vO(t,`\`exclude\` contains "${n}", which is \`placeable: "namedOnly"\` and never a child of a layout block that accepts any blocks.`)}}if(r!==`blocks`)for(let n of r)Object.prototype.hasOwnProperty.call(e,n)||vO(t,`\`allow\` contains "${n}", which is not a configured block type.`),e[n].config.layoutOnly!==!0&&vO(t,`\`allow\` contains "${n}", which is not a layout block. An \`allow\` list can name only layout blocks (\`layoutOnly: true\`); naming other blocks is not supported yet. Use \`allow: "blocks"\` to accept all other blocks.`)}}let t=new Set(Object.values(e).flatMap(({config:e})=>e.children?.allow&&e.children.allow!==`blocks`?e.children.allow:[]));for(let[n,{config:r}]of Object.entries(e))r.placeable===`namedOnly`&&!t.has(n)&&vO(n,'`placeable: "namedOnly"` limits this block to the blocks that name it in `children.allow`, but no block names it. Name it in the `allow` list of a layout block.')}function vO(e,t){throw Error(`Invalid config for block "${e}": ${t}`)}function yO(e){return e&&Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var bO=class{opts;BlockNoteEditor=`only for types`;Block=`only for types`;PartialBlock=`only for types`;inlineContentSpecs;styleSpecs;blockSpecs;blockSchema;inlineContentSchema;styleSchema;constructor(e){this.opts=e;let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a}init(){let e=gO(Object.entries({...this.opts.blockSpecs,...this.opts.inlineContentSpecs,...this.opts.styleSpecs}).map(([e,t])=>({key:e,runsBefore:t.implementation?.runsBefore??[]})));_O(this.opts.blockSpecs);let t=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t,n])=>[t,YD(n.config,n.implementation,n.extensions,e(t))])),n=Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t,n])=>typeof n.config==`object`?[t,{...n,implementation:{...n.implementation,node:n.implementation?.node.extend({priority:e(t)})}}]:[t,n])),r=Object.fromEntries(Object.entries(this.opts.styleSpecs).map(([t,n])=>[t,{...n,implementation:{...n.implementation,mark:n.implementation?.mark.extend({priority:e(t)})}}]));return{blockSpecs:t,blockSchema:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.config])),inlineContentSpecs:yO(n),styleSpecs:yO(r),inlineContentSchema:tO(n),styleSchema:oO(r)}}extend(e){this.opts={blockSpecs:{...this.opts.blockSpecs,...e.blockSpecs},inlineContentSpecs:{...this.opts.inlineContentSpecs,...e.inlineContentSpecs},styleSpecs:{...this.opts.styleSpecs,...e.styleSpecs}};let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();return this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a,this}};function xO(e){let{height:t,width:n}=wO(e),r=Array(t).fill(!1).map(()=>Array(n).fill(null)),i=(e,i)=>{for(let a=e;a<t;a++)for(let e=i;e<n;e++)if(!r[a][e])return{row:a,col:e};throw Error(`Unable to create occupancy grid for table, no more available cells`)};for(let t=0;t<e.content.rows.length;t++)for(let n=0;n<e.content.rows[t].cells.length;n++){let a=AE(e.content.rows[t].cells[n]),o=PE(a),s=NE(a),{row:c,col:l}=i(t,n);for(let e=c;e<c+o;e++)for(let i=l;i<l+s;i++){if(r[e][i])throw Error(`Unable to create occupancy grid for table, cell at ${e},${i} is already occupied`);r[e][i]={row:t,col:n,rowspan:o,colspan:s,cell:a}}}return r}function SO(e){let t=new Set;return e.map(e=>({cells:e.map(e=>!t.has(e.row+`:`+e.col)&&(t.add(e.row+`:`+e.col),e.cell)).filter(e=>e!==!1)}))}function CO(e,t,n=xO(t)){for(let t=0;t<n.length;t++)for(let r=0;r<n[t].length;r++){let i=n[t][r];if(i&&i.row===e.row&&i.col===e.col)return{row:t,col:r,cell:i.cell}}throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function wO(e){let t=e.content.rows.length,n=0;return e.content.rows.forEach(e=>{let t=0;e.cells.forEach(e=>{t+=NE(e)}),n=Math.max(n,t)}),{height:t,width:n}}function TO(e,t,n=xO(t)){let r=n[e.row]?.[e.col];if(r)return{row:r.row,col:r.col,cell:r.cell}}function EO(e,t){let n=xO(e);if(t<0||t>=n.length)return[];let r=0;for(let e=0;e<t;e++){let e=n[r]?.[0];if(!e)return[];r+=e.rowspan}let i=Array(n[0].length).fill(!1).map((t,i)=>TO({row:r,col:i},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function DO(e,t){let n=xO(e);if(t<0||t>=n[0].length)return[];let r=0;for(let e=0;e<t;e++){let e=n[0]?.[r];if(!e)return[];r+=e.colspan}let i=Array(n.length).fill(!1).map((t,i)=>TO({row:i,col:r},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function OO(e,t,n,r=xO(e)){let{col:i}=CO({row:0,col:t},e,r),{col:a}=CO({row:0,col:n},e,r);return r.forEach(e=>{let[t]=e.splice(i,1);e.splice(a,0,t)}),SO(r)}function kO(e,t,n,r=xO(e)){let{row:i}=CO({row:t,col:0},e,r),{row:a}=CO({row:n,col:0},e,r),[o]=r.splice(i,1);return r.splice(a,0,o),SO(r)}function AO(e){return e?jE(e)?AO(e.content):typeof e==`string`?e.length===0:Array.isArray(e)?e.every(e=>typeof e==`string`?e.length===0:kE(e)?e.text.length===0:OE(e)?typeof e.content==`string`?e.content.length===0:e.content.every(e=>e.text.length===0):!1):!1:!0}function jO(e,t,n=xO(e)){if(t===`columns`){let e=0;for(let t=n[0].length-1;t>=0&&n.every(e=>AO(e[t].cell)&&e[t].colspan===1);t--)e++;for(let t=n.length-1;t>=0;t--){let r=Math.max(n[t].length-e,1);n[t]=n[t].slice(0,r)}return SO(n)}let r=0;for(let e=n.length-1;e>=0&&n[e].every(e=>AO(e.cell)&&e.rowspan===1);e--)r++;let i=Math.min(r,n.length-1);return n.splice(n.length-i,i),SO(n)}function MO(e,t,n,r=xO(e)){let{width:i,height:a}=wO(e);if(t===`columns`)r.forEach((e,t)=>{if(n>=0)for(let r=0;r<n;r++)e.push({row:t,col:Math.max(...e.map(e=>e.col))+1,rowspan:1,colspan:1,cell:AE(``)});else e.splice(i+n,-1*n)});else if(n>0)for(let e=0;e<n;e++){let t=Array(i).fill(null).map((t,n)=>({row:a+e,col:n,rowspan:1,colspan:1,cell:AE(``)}));r.push(t)}else n<0&&r.splice(a+n,-1*n);return SO(r)}function NO(e,t,n){let r=EO(e,n);if(!r.some(e=>PE(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=PE(e.cell);i=Math.max(i,e.row+t-1),a=Math.min(a,e.row)}),t<n?n===i:n===a}function PO(e,t,n){let r=DO(e,n);if(!r.some(e=>NE(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=NE(e.cell);i=Math.max(i,e.col+t-1),a=Math.min(a,e.col)}),t<n?n===i:n===a}function FO(e,t,n){let r=CO(e,n),i=CO(t,n);return r.col===i.col}function IO(e,t,n,r){let i=[];for(let[r,a]of Object.entries(e.styles||{})){let e=n[r];if(!e)throw Error(`style ${r} not found in styleSchema`);if(e.propSchema===`boolean`)a&&i.push(t.mark(r));else if(e.propSchema===`string`)a&&i.push(t.mark(r,{stringValue:a}));else throw new FE(e.propSchema)}let a=r&&t.nodes[r]&&uD(t,t.nodes[r])?[...t.nodes[r].allowedMarks(i)]:i;return r&&uD(t,t.nodes[r])?e.text.length>0?[t.text(e.text,a)]:[]:e.text.split(/(\n)/g).filter(e=>e.length>0).map(e=>e===`
|
|
442
|
-
`?t.nodes.hardBreak.createChecked():t.text(e,a))}function LO(e,t,n){let r=t.marks.link.create({href:e.href});return RO(e.content,t,n).map(e=>{if(e.type.name===`text`)return e.mark([...e.marks,r]);if(e.type.name===`hardBreak`)return e;throw Error(`unexpected node type`)})}function RO(e,t,n,r){let i=[];if(typeof e==`string`)return i.push(...IO({type:`text`,text:e,styles:{}},t,n,r)),i;for(let a of e)i.push(...IO(a,t,n,r));return i}function zO(e,t,n,r=cD(t)){let i=[];for(let a of e)typeof a==`string`?i.push(...RO(a,t,r,n)):OE(a)?i.push(...LO(a,t,r)):kE(a)?i.push(...RO([a],t,r,n)):i.push(VO(a,t,r));return i}function BO(e,t,n=cD(t)){let r=[],i=Array(e.headerRows??0).fill(!0),a=Array(e.headerCols??0).fill(!0),o=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){let c=e.rows[s],l=[],u=i[s];for(let r=0;r<c.cells.length;r++){let i=c.cells[r],d=a[r],f=null,p=CO({row:s,col:r},{type:`table`,content:e}),m=o[p.col]?[o[p.col]]:null;if(i){if(typeof i==`string`)f=t.text(i);else if(jE(i)){i.content&&(f=zO(i.content,t,`tableParagraph`,n));let e=NE(i);e>1&&(m=Array(e).fill(!1).map((e,t)=>o[p.col+t]??void 0))}else f=zO(i,t,`tableParagraph`,n)}let h=t.nodes[d||u?`tableHeader`:`tableCell`].createChecked({...jE(i)?i.props:{},colwidth:m},t.nodes.tableParagraph.createChecked(void 0,f));l.push(h)}let d=t.nodes.tableRow.createChecked({},l);r.push(d)}return r}function VO(e,t,n){let r,i=e.type;if(i===void 0&&(i=`paragraph`),!t.nodes[i])throw Error(`node type ${i} not found in schema`);if(!e.content)r=t.nodes[i].createChecked(e.props);else if(typeof e.content==`string`){let a=zO([e.content],t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(Array.isArray(e.content)){let a=zO(e.content,t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(e.content.type===`tableContent`){let a=BO(e.content,t,n);r=t.nodes[i].createChecked(e.props,a)}else throw new FE(e.content.type);return r}function HO(e){if(e.isText)return e;let t=[];e.forEach(e=>t.push(HO(e)));let n=e.type.isInGroup(`bnBlock`)&&e.attrs.id===null;return e.type.create(n?{...e.attrs,id:EE.options.generateID()}:e.attrs,Cr.from(t),e.marks)}function UO(e,t,n=cD(t)){let r=e.id;r===void 0&&(r=EE.options.generateID());let i=[];if(e.children)for(let r of e.children)i.push(UO(r,t,n));if(!e.type||t.nodes[e.type].isInGroup(`blockContent`)){let a=VO(e,t,n),o=i.length>0?UT(t,i):void 0;return t.nodes.blockContainer.createChecked({id:r,...e.props},o?[a,o]:a)}if(HT(t.nodes[e.type])){let n=t.nodes[e.type],a={id:r,...e.props},o=n.createAndFill(a,i);if(!o)throw Error(`Cannot create block "${e.type}": its children don't fit its \`children\` config (it accepts \`${n.spec.content}\`).`);return HO(o)}throw Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}var WO={gray:{text:`#9b9a97`,background:`#ebeced`},brown:{text:`#64473a`,background:`#e9e5e3`},red:{text:`#e03e3e`,background:`#fbe4e4`},orange:{text:`#d9730d`,background:`#f6e9d9`},yellow:{text:`#dfab01`,background:`#fbf3db`},green:{text:`#4d6461`,background:`#ddedea`},blue:{text:`#0b6e99`,background:`#ddebf1`},purple:{text:`#6940a5`,background:`#eae4f2`},pink:{text:`#ad1a72`,background:`#f4dfeb`}},GO={backgroundColor:{default:`default`},textColor:{default:`default`},textAlignment:{default:`left`,values:[`left`,`center`,`right`,`justify`]}},KO=e=>{let t={};return e.hasAttribute(`data-background-color`)?t.backgroundColor=e.getAttribute(`data-background-color`):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute(`data-text-color`)?t.textColor=e.getAttribute(`data-text-color`):e.style.color&&(t.textColor=e.style.color),t.textAlignment=GO.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},qO=(e,t)=>{e.backgroundColor&&e.backgroundColor!==GO.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in WO?WO[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==GO.textColor.default&&(t.style.color=e.textColor in WO?WO[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==GO.textAlignment.default&&(t.style.textAlign=e.textAlignment)},JO=(e=`backgroundColor`)=>({default:GO.backgroundColor.default,parseHTML:e=>e.hasAttribute(`data-background-color`)?e.getAttribute(`data-background-color`):e.style.backgroundColor?e.style.backgroundColor:GO.backgroundColor.default,renderHTML:t=>t[e]===GO.backgroundColor.default?{}:{"data-background-color":t[e]}}),YO=(e=`textColor`)=>({default:GO.textColor.default,parseHTML:e=>e.hasAttribute(`data-text-color`)?e.getAttribute(`data-text-color`):e.style.color?e.style.color:GO.textColor.default,renderHTML:t=>t[e]===GO.textColor.default?{}:{"data-text-color":t[e]}}),XO=(e,t)=>{let n=e.querySelector(t);if(n)return{targetElement:n,caption:e.querySelector(`figcaption`)?.textContent??void 0}},ZO=QC(({editor:e})=>{let t=$C(void 0);function n(){t.setState(void 0)}return{key:`filePanel`,store:t,mount({signal:t}){let r=e.onChange(n,!1),i=e.onSelectionChange(n,!1);t.addEventListener(`abort`,()=>{r(),i()})},closeMenu:n,showMenu(e){t.setState(e)}}}),QO=(e,t,n)=>{let r=document.createElement(`div`);r.className=`bn-add-file-button`;let i=document.createElement(`div`);i.className=`bn-add-file-button-icon`,n?i.appendChild(n):i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,r.appendChild(i);let a=document.createElement(`p`);a.className=`bn-add-file-button-text`,a.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,r.appendChild(a);let o=e=>{e.preventDefault(),e.stopPropagation()},s=()=>{t.isEditable&&t.getExtension(ZO)?.showMenu(e.id)};return r.addEventListener(`mousedown`,o,!0),r.addEventListener(`click`,s,!0),{dom:r,destroy:()=>{r.removeEventListener(`mousedown`,o,!0),r.removeEventListener(`click`,s,!0)}}},$O=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,ek=e=>{let t=document.createElement(`div`);t.className=`bn-file-name-with-icon`;let n=document.createElement(`div`);n.className=`bn-file-icon`,n.innerHTML=$O,t.appendChild(n);let r=document.createElement(`p`);return r.className=`bn-file-name`,r.textContent=e.props.name,t.appendChild(r),{dom:t}},tk=(e,t,n,r)=>{let i=e.props.url!==``&&!!e.props.caption,a=document.createElement(i?`figure`:`div`);if(a.className=`bn-file-block-content-wrapper`,e.props.url===``){let n=QO(e,t,r);a.appendChild(n.dom);let i=t.onUploadStart(t=>{if(t===e.id){a.removeChild(n.dom);let e=document.createElement(`div`);e.className=`bn-file-loading-preview`,e.textContent=`Loading...`,a.appendChild(e)}});return{dom:a,destroy:()=>{i(),n.destroy()}}}let o={dom:a};if(e.props.showPreview===!1||!n){let t=ek(e);a.appendChild(t.dom),o.destroy=()=>{t.destroy?.()}}else a.appendChild(n.dom);if(e.props.caption){let t=document.createElement(`figcaption`);t.className=`bn-file-caption`,t.textContent=e.props.caption,a.appendChild(t)}return o},nk=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},rk=(e,t)=>{let n=document.createElement(`div`),r=document.createElement(`p`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},ik=e=>({url:e.src||void 0}),ak=XD(e=>({type:`audio`,propSchema:{backgroundColor:GO.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0}},content:`none`})),ok=(e={})=>e=>{if(e.tagName===`AUDIO`){if(e.closest(`figure`))return;let{backgroundColor:t}=KO(e);return{...ik(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=XO(e,`audio`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=KO(e);return{...ik(n),backgroundColor:i,caption:r}}},sk=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>`;let i=document.createElement(`audio`);return i.className=`bn-audio`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.controls=!0,i.contentEditable=`false`,i.draggable=!1,tk(t,n,{dom:i},r.firstElementChild)},ck=(e={})=>(e,t)=>{if(!e.props.url)return{dom:document.createElement(`audio`)};let n;return e.props.showPreview?(n=document.createElement(`audio`),n.src=e.props.url):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?nk(n,e.props.caption):rk(n,e.props.caption):{dom:n}},lk=ZD(ak,e=>({meta:{fileBlockAccept:[`audio/*`]},parse:ok(e),render:sk(e),toExternalHTML:ck(e),runsBefore:[`file`]})),uk=e=>{{if(e.tagName!==`PRE`||e.childElementCount!==1||e.firstElementChild?.tagName!==`CODE`)return;let t=e.firstElementChild;return{language:t.getAttribute(`data-language`)||t.className.split(` `).find(e=>e.startsWith(`language-`))?.replace(`language-`,``)}}},dk=({el:e,schema:t},n)=>{let r=Br.fromSchema(t),i=e.firstElementChild;return r.parse(i,{preserveWhitespace:`full`,topNode:t.nodes[n].create()}).content},fk=e=>{let t=document.createElement(`pre`),n=document.createElement(`code`);return n.className=`language-${e.props.language}`,n.dataset.language=e.props.language,t.appendChild(n),{dom:t,contentDOM:n}};function pk(e,t){let n=t.trim().toLowerCase();return Object.entries(e.supportedLanguages??{}).find(([e,{aliases:t}])=>e.toLowerCase()===n||t?.some(e=>e.toLowerCase()===n))?.[0]}var mk=e=>(t,n)=>QC({key:t,keyboardShortcuts:{Delete:({editor:e})=>e.transact(t=>{let{block:r}=e.getTextCursorPosition();if(r.type!==n)return!1;let{$from:i}=t.selection;return!i.parent.textContent&&(e.removeBlocks([r]),!0)}),Tab:({editor:t})=>e.indentLineWithTab!==!1&&t.transact(e=>{let{block:r}=t.getTextCursorPosition();return r.type===n&&(e.insertText(` `),!0)}),Enter:({editor:e})=>e.transact(t=>{let{block:r,nextBlock:i}=e.getTextCursorPosition();if(r.type!==n)return!1;let{$from:a}=t.selection,o=a.parentOffset===a.parent.nodeSize-2,s=a.parent.textContent.endsWith(`
|
|
443
|
-
|
|
444
|
-
`);if(o&&s){if(t.delete(a.pos-2,a.pos),i)return e.setTextCursorPosition(i,`start`),!0;let[n]=e.insertBlocks([{type:`paragraph`}],r,`after`);return e.setTextCursorPosition(n,`start`),!0}return t.insertText(`
|
|
445
|
-
`),!0}),"Shift-Enter":({editor:e})=>e.transact(()=>{let{block:t}=e.getTextCursorPosition();if(t.type!==n)return!1;let[r]=e.insertBlocks([{type:`paragraph`}],t,`after`);return e.setTextCursorPosition(r,`start`),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{let r=t[1].trim();return{type:n,props:{language:{language:pk(e,r)??(r||e.defaultLanguage||`text`)}.language},content:[]}}}]}),hk=(e,t,n,r)=>{if(!(n in r))throw Error(`Language ${n} is not supported.`);let i=document.createElement(`select`);Object.entries(r).forEach(([e,{name:t}])=>{let n=document.createElement(`option`);n.value=e,n.text=t,i.appendChild(n)}),i.value=n;let a=n=>{t.isEditable&&t.updateBlock(e.id,{props:{language:n.target.value}})};t.isEditable?i.addEventListener(`change`,a):i.disabled=!0;let o=document.createElement(`div`);return o.contentEditable=`false`,o.appendChild(i),{dom:o,destroy:()=>i.removeEventListener(`change`,a)}},gk=(e,t,n)=>{let r=document.createElement(`pre`),i=document.createElement(`code`);r.appendChild(i);let a=document.createDocumentFragment(),o;return n&&Object.keys(n.supportedLanguages).length>1&&(o=hk(e,t,n.selectedLanguage,n.supportedLanguages),a.appendChild(o.dom)),a.appendChild(r),{dom:a,contentDOM:i,destroy:()=>{o?.destroy()}}},_k=`code-block-keyboard-shortcuts`,vk=ZD(XD(({defaultLanguage:e=`text`})=>({type:`codeBlock`,propSchema:{language:{default:e}},content:`plain`})),e=>({meta:{code:!0,defining:!0,isolating:!1,highlight:e=>e.props.language},parse:e=>uk(e),parseContent:e=>dk(e,`codeBlock`),render:(t,n)=>gk(t,n,e.supportedLanguages&&{selectedLanguage:t.props.language,supportedLanguages:e.supportedLanguages}),toExternalHTML:e=>fk(e)}),e=>[mk(e)(_k,`codeBlock`)]),yk=ZD(XD(()=>({type:`divider`,propSchema:{},content:`none`})),{meta:{isolating:!1},parse(e){if(e.tagName===`HR`)return{}},render(){return{dom:document.createElement(`hr`)}}},[QC({key:`divider-block-shortcuts`,inputRules:[{find:RegExp(`^---$`),replace(){return{type:`divider`,props:{},content:[]}}}]})]),bk=e=>({url:e.src||void 0}),xk=ZD(XD(()=>({type:`file`,propSchema:{backgroundColor:GO.backgroundColor,name:{default:``},url:{default:``},caption:{default:``}},content:`none`})),{meta:{fileBlockAccept:[`*/*`]},parse:e=>{if(e.tagName===`EMBED`){if(e.closest(`figure`))return;let{backgroundColor:t}=KO(e);return{...bk(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=XO(e,`embed`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=KO(e);return{...bk(n),backgroundColor:i,caption:r}}},render(e,t){return tk(e,t)},toExternalHTML(e){if(!e.props.url)return{dom:document.createElement(`embed`)};let t=document.createElement(`a`);return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?rk(t,e.props.caption):{dom:t}}});function Sk(e,t,n){let r=Br.fromSchema(t),i=e.querySelector(`:scope > summary`),a;if(i){let e=i.cloneNode(!0);GE(e),a=r.parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}else a=Cr.empty;let o=document.createElement(`div`);o.setAttribute(`data-node-type`,`blockGroup`);let s=!1;for(let t of Array.from(e.childNodes))t.tagName!==`SUMMARY`&&(t.nodeType!==3||t.textContent?.trim())&&(s=!0,o.appendChild(t.cloneNode(!0)));let c=t.nodes[n].create({},a);if(!s)return c.content;let l=r.parse(o,{topNode:t.nodes.blockGroup.create()});return l.content.size>0?c.content.addToEnd(l):c.content}var Ck={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?`true`:`false`),get:e=>window.localStorage.getItem(`toggle-${e.id}`)===`true`},wk=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>`;function Tk(e){return Ck.get(e)}function Ek(e,t,n=Ck){let r=document.createElement(`div`);r.className=`bn-toggle-wrapper bn-toggle-frame`;let i=document.createElement(`button`);i.className=`bn-toggle-button`,i.type=`button`,i.setAttribute(`aria-label`,t.dictionary.toggle_blocks.toggle_button),i.innerHTML=wk,i.addEventListener(`mousedown`,e=>e.preventDefault());let a=document.createElement(`div`);a.className=`bn-toggle-slot`;let o=document.createElement(`button`);o.className=`bn-toggle-add-block-button`,o.type=`button`,o.textContent=t.dictionary.toggle_blocks.add_block_button,o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>{t.transact(()=>{let n=t.updateBlock(e.id,{children:[{}]});t.setTextCursorPosition(n.children[0],`end`),t.focus()})}),r.append(i,a);let s=e.children.length,c=n.get(e);function l(){i.setAttribute(`aria-expanded`,String(c));let e=c&&s===0&&t.isEditable;e&&!o.isConnected?r.append(o):e||o.remove()}return i.addEventListener(`click`,()=>{c=!c,n.set(e,c),l()}),l(),{dom:r,slot:a,update(e){let t=e.children.length,r=c;return t>s&&(c=!0),c!==r&&n.set(e,c),s=t,l(),!0}}}var Dk=[1,2,3,4,5,6];function Ok(e,t){return t?{level:e,isToggleable:!1}:{level:e}}var kk=(e,t)=>({editor:n})=>{let r=n.getTextCursorPosition();return n.schema.blockSchema[r.block.type].content===`inline`&&(n.updateBlock(r.block,{type:`heading`,props:Ok(e,t)}),!0)},Ak=ZD(XD(({defaultLevel:e=1,levels:t=Dk,allowToggleHeadings:n=!0}={})=>({type:`heading`,propSchema:{...GO,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:`inline`})),({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1,dropsIntoChildren:t=>e&&t.props.isToggleable===!0},experimental_keyboard:e?e=>{if(!e.props.isToggleable)return{};let t=Tk(e);return{resetsTo:{type:`heading`,props:{isToggleable:!1}},emptyEnterResets:!0,enter:t?`into-children`:`split`,splitKeepsChildren:!t,emptyChildEnter:t?`stay`:`outdent`}}:void 0,parse(t){if(e&&t.tagName===`DETAILS`){let e=t.querySelector(`:scope > summary`);if(!e)return;let n=e.querySelector(`h1, h2, h3, h4, h5, h6`);return n?{...KO(n),level:parseInt(n.tagName[1]),isToggleable:!0}:void 0}let n;switch(t.tagName){case`H1`:n=1;break;case`H2`:n=2;break;case`H3`:n=3;break;case`H4`:n=4;break;case`H5`:n=5;break;case`H6`:n=6;break;default:return}return{...KO(t),level:n}},...e?{parseContent:({el:e,schema:t})=>{if(e.tagName===`DETAILS`)return Sk(e,t,`heading`)}}:{},runsBefore:[`toggleListItem`],render(e){let t=document.createElement(`h${e.props.level}`);return{dom:t,contentDOM:t}},renderFrame(t,n){if(!e||!t.props.isToggleable)return;let r=Ek(t,n);return{...r,update:e=>!!e.props.isToggleable&&r.update(e)}},toExternalHTML(t){let n=document.createElement(`h${t.props.level}`);if(qO(t.props,n),e&&t.props.isToggleable){let e=document.createElement(`details`);e.setAttribute(`open`,``);let t=document.createElement(`summary`);return t.appendChild(n),e.appendChild(t),{dom:e,contentDOM:n,childrenDOM:e}}return{dom:n,contentDOM:n}}}),({levels:e=Dk,allowToggleHeadings:t=!0}={})=>[QC({key:`heading-shortcuts`,keyboardShortcuts:Object.fromEntries(e.map(e=>[`Mod-Alt-${e}`,kk(e,t)])??[]),inputRules:e.map(e=>({find:RegExp(`^(#{${e}})\\s$`),replace({match:e}){return{type:`heading`,props:Ok(e[1].length,t)}}}))})]),jk=(e,t,n,r,i)=>{let{dom:a,destroy:o}=tk(e,t,n,i),s=a;s.style.position=`relative`,e.props.url&&e.props.showPreview&&(e.props.previewWidth?s.style.width=`${e.props.previewWidth}px`:s.style.width=`fit-content`);let c=document.createElement(`div`);c.className=`bn-resize-handle`,c.style.left=`4px`,c.style.display=`none`,r.appendChild(c);let l=document.createElement(`div`);l.className=`bn-resize-handle`,l.style.right=`4px`,l.style.display=`none`,r.appendChild(l);let u=document.createElement(`div`);u.style.position=`absolute`,u.style.height=`100%`,u.style.width=`100%`;let d,f=e.props.previewWidth,p=n=>{if(!d){t.isEditable||(c.style.display=`none`,l.style.display=`none`);return}let r,i=`touches`in n?n.touches[0].clientX:n.clientX;r=e.props.textAlignment===`center`?d.handleUsed===`left`?d.initialWidth+(d.initialClientX-i)*2:d.initialWidth+(i-d.initialClientX)*2:d.handleUsed===`left`?d.initialWidth+d.initialClientX-i:d.initialWidth+i-d.initialClientX,f=Math.min(Math.max(r,64),t.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE),s.style.width=`${f}px`},m=n=>{n.target&&s.contains(n.target)&&t.isEditable||(c.style.display=`none`,l.style.display=`none`),d&&(d=void 0,s.contains(u)&&s.removeChild(u),t.updateBlock(e,{props:{previewWidth:f}}))},h=()=>{t.isEditable&&(c.style.display=``,l.style.display=``)},g=e=>{e.relatedTarget!==c&&e.relatedTarget!==l&&(d||t.isEditable&&(c.style.display=`none`,l.style.display=`none`))},_=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`left`,initialWidth:s.clientWidth,initialClientX:t}},v=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`right`,initialWidth:s.clientWidth,initialClientX:t}};return window.addEventListener(`mousemove`,p),window.addEventListener(`touchmove`,p),window.addEventListener(`mouseup`,m),window.addEventListener(`touchend`,m),s.addEventListener(`mouseenter`,h),s.addEventListener(`mouseleave`,g),c.addEventListener(`mousedown`,_),c.addEventListener(`touchstart`,_),l.addEventListener(`mousedown`,v),l.addEventListener(`touchstart`,v),{dom:s,destroy:()=>{o?.(),window.removeEventListener(`mousemove`,p),window.removeEventListener(`touchmove`,p),window.removeEventListener(`mouseup`,m),window.removeEventListener(`touchend`,m),s.removeEventListener(`mouseenter`,h),s.removeEventListener(`mouseleave`,g),c.removeEventListener(`mousedown`,_),c.removeEventListener(`touchstart`,_),l.removeEventListener(`mousedown`,v),l.removeEventListener(`touchstart`,v)}}},Mk=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.alt||void 0}),Nk=XD((e={})=>({type:`image`,propSchema:{textAlignment:GO.textAlignment,backgroundColor:GO.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`})),Pk=(e={})=>e=>{if(e.tagName===`IMG`){if(e.closest(`figure`))return;let{backgroundColor:t}=KO(e);return{...Mk(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=XO(e,`img`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=KO(e);return{...Mk(n),backgroundColor:i,caption:r}}},Fk=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`img`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.alt=t.props.name||``,a.contentEditable=`false`,a.draggable=!1,t.props.previewWidth&&(a.width=t.props.previewWidth),i.appendChild(a),jk(t,n,{dom:i},i,r.firstElementChild)},Ik=(e={})=>(e,t)=>{if(!e.props.url)return{dom:document.createElement(`img`)};let n;return e.props.showPreview?(n=document.createElement(`img`),n.src=e.props.url,n.alt=e.props.name||``,e.props.previewWidth&&(n.width=e.props.previewWidth)):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?nk(n,e.props.caption):rk(n,e.props.caption):{dom:n}},Lk=ZD(Nk,e=>({meta:{fileBlockAccept:[`image/*`]},parse:Pk(e),render:Fk(e),toExternalHTML:Ik(e),runsBefore:[`file`]}));function Rk(e,t,n){let r=Br.fromSchema(t),i=e,a=document.createElement(`div`);a.setAttribute(`data-node-type`,`blockGroup`);for(let e of Array.from(i.childNodes))a.appendChild(e.cloneNode(!0));let o=r.parse(a,{topNode:t.nodes.blockGroup.create()});o.firstChild?.firstChild?.type.name===`checkListItem`&&(o=o.copy(o.content.cut(o.firstChild.firstChild.nodeSize+2)));let s=o.firstChild?.firstChild;if(!s?.isTextblock)return Cr.from(o);let c=t.nodes[n].create({},s.content),l=o.content.cut(s.nodeSize+2);if(l.size>0){let e=o.copy(l);return c.content.addToEnd(e)}return c.content}var zk=ZD(XD(()=>({type:`bulletListItem`,propSchema:{...GO},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t===null||t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`||!e.closest(`ul, ol`))return KO(e)},parseContent:({el:e,schema:t})=>Rk(e,t,`bulletListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return qO(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[QC({key:`bullet-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-8":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`bulletListItem`,props:{}}),!0)}},inputRules:[{find:/^\s?[-+*]\s$/,replace({editor:e}){if(cE(e.prosemirrorState).blockNoteType!==`heading`)return{type:`bulletListItem`,props:{}}}}]})]),Bk=ZD(XD(()=>({type:`checkListItem`,propSchema:{...GO,checked:{default:!1,type:`boolean`}},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName===`input`)return e.closest(`[data-content-type]`)||e.closest(`li`)?void 0:e.type===`checkbox`?{checked:e.checked}:void 0;if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)){let t=e.querySelector(`input[type=checkbox]`)||null;return t===null?void 0:{...KO(e),checked:t.checked}}},parseContent:({el:e,schema:t})=>Rk(e,t,`checkListItem`),render(e,t){let n=document.createDocumentFragment(),r=document.createElement(`input`);r.type=`checkbox`,r.checked=e.props.checked,e.props.checked&&r.setAttribute(`checked`,``),r.disabled=!t.isEditable,r.addEventListener(`change`,()=>{t.isEditable&&t.updateBlock(e,{props:{checked:!e.props.checked}})});let i=document.createElement(`p`),a=document.createElement(`div`);return a.contentEditable=`false`,a.appendChild(r),n.appendChild(a),n.appendChild(i),{dom:n,contentDOM:i}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`input`);n.type=`checkbox`,n.checked=e.props.checked,e.props.checked&&n.setAttribute(`checked`,``);let r=document.createElement(`p`);return qO(e.props,t),t.appendChild(n),t.appendChild(r),{dom:t,contentDOM:r}},runsBefore:[`bulletListItem`]},[QC({key:`check-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-9":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`checkListItem`,props:{}}),!0)}},inputRules:[{find:/^\s?\[\s*\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!1}}}},{find:/^\s?\[[Xx]\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!0}}}}]})]);function Vk(e,t,n,r){let i=!!e.firstChild.attrs.start,a=aE(e,t);if(!a.hasContent)throw Error(`impossible`);let o=n.doc.resolve(a.block.beforePos).nodeBefore,s=o?r.get(o):void 0;if(s!==void 0){let t=s+1;return r.set(e,t),{index:t,isFirst:!1,hasStart:i}}let c=[{node:e,pos:t}],l=o,u=a.block.beforePos;for(;l&&r.get(l)===void 0;){let e=aE(l,u-l.nodeSize);if(e.blockNoteType!==`numberedListItem`)break;c.push({node:l,pos:u-l.nodeSize});let t=n.doc.resolve(e.block.beforePos).nodeBefore;u=e.block.beforePos,l=t}let d,f,p=c[c.length-1],m=aE(p.node,p.pos);if(!m.hasContent)throw Error(`impossible`);let h=n.doc.resolve(m.block.beforePos).nodeBefore,g=h?r.get(h):void 0;g===void 0?(d=(p.node.firstChild.attrs.start||1)-1,f=!0):(d=g,f=!1);for(let e=c.length-1;e>=0;e--){let t=c[e];f&&e<c.length-1&&(f=!1),d++,r.set(t.node,d)}return{index:d,isFirst:c.length===1?f||g===void 0:!1,hasStart:i}}function Hk(e,t){let n=new Map,r=t.decorations.map(e.mapping,e.doc),i=e.changedRange()??{from:0,to:e.doc.nodeSize-2},a=[],o=new Set;e.doc.nodesBetween(i.from,e.doc.nodeSize-2,(t,s,c)=>{if(c&&o.has(c))return!1;if(t.type.name===`blockContainer`&&t.firstChild.type.name===`numberedListItem`){let{index:l,isFirst:u,hasStart:d}=Vk(t,s,e,n),f=e.doc.nodeAt(s+1);if(r.find(s+1,s+1+f.nodeSize,e=>e.index===l&&e.isFirst===u&&e.hasStart===d).length===0)a.push(Rr.node(s+1,s+1+f.nodeSize,{"data-index":l.toString()},{index:l,isFirst:u,hasStart:d}));else if(s>=i.to&&c)return o.add(c),!1}});let s=a.flatMap(e=>r.find(e.from,e.to));return{decorations:r.remove(s).add(e.doc,a)}}var Uk=ZD(XD(()=>({type:`numberedListItem`,propSchema:{...GO,start:{default:void 0,type:`number`}},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`OL`||t.tagName===`DIV`&&t.parentElement?.tagName===`OL`)){let n=parseInt(t.getAttribute(`start`)||`1`),r=KO(e);return e.previousElementSibling||n===1?r:{...r,start:n}}},parseContent:({el:e,schema:t})=>Rk(e,t,`numberedListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return qO(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[QC({key:`numbered-list-item-shortcuts`,inputRules:[{find:/^\s?(\d+)\.\s$/,replace({match:e,editor:t}){if(cE(t.prosemirrorState).blockNoteType===`heading`)return;let n=parseInt(e[1]);return{type:`numberedListItem`,props:{start:n===1?void 0:n}}}}],keyboardShortcuts:{"Mod-Shift-7":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`numberedListItem`,props:{}}),!0)}},prosemirrorPlugins:[new Lr({key:new Dr(`numbered-list-indexing-decorations`),state:{init(e,t){return Hk(t.tr,{decorations:Fr.empty})},apply(e,t){return!e.docChanged&&t.decorations?t:Hk(e,t)}},props:{decorations(e){return this.getState(e)?.decorations??Fr.empty}}})]})]),Wk=ZD(XD(()=>({type:`toggleListItem`,propSchema:{...GO},content:`inline`})),{experimental_keyboard:e=>{let t=Tk(e);return{splitKeepsType:!0,emptyEnterResets:!0,enter:t?`into-children`:`split`,splitKeepsChildren:!t,emptyChildEnter:t?`stay`:`outdent`}},meta:{isolating:!1,dropsIntoChildren:()=>!0},parse(e){if(e.tagName===`DETAILS`)return KO(e);if(e.tagName===`LI`){let t=e.parentElement;if(t&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)&&e.querySelector(`:scope > details`))return KO(e)}},parseContent:({el:e,schema:t})=>{let n=e.tagName===`DETAILS`?e:e.querySelector(`:scope > details`);if(!n)throw Error(`No details found in toggleListItem parseContent`);return Sk(n,t,`toggleListItem`)},runsBefore:[`bulletListItem`],render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},renderFrame:Ek,toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`details`);n.setAttribute(`open`,``);let r=document.createElement(`summary`),i=document.createElement(`p`);return r.appendChild(i),n.appendChild(r),qO(e.props,t),t.appendChild(n),{dom:t,contentDOM:i,childrenDOM:n}}},[QC({key:`toggle-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-6":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`toggleListItem`,props:{}}),!0)}}})]),Gk=ZD(XD(()=>({type:`paragraph`,propSchema:GO,content:`inline`})),{meta:{isolating:!1},parse:e=>{if(e.tagName===`P`&&e.textContent?.trim())return KO(e)},render:()=>{let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`p`);return qO(e.props,t),{dom:t,contentDOM:t}},runsBefore:[`default`,`heading`]},[QC({key:`paragraph-shortcuts`,keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`paragraph`,props:{}}),!0)}}})]),Kk=ZD(XD(()=>({type:`quote`,propSchema:{backgroundColor:GO.backgroundColor,textColor:GO.textColor},content:`inline`})),{meta:{isolating:!1},parse(e){if(e.tagName===`BLOCKQUOTE`){let{backgroundColor:t,textColor:n}=KO(e);return{backgroundColor:t,textColor:n}}},render(){let e=document.createElement(`blockquote`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`blockquote`);return qO(e.props,t),{dom:t,contentDOM:t}}},[QC({key:`quote-block-shortcuts`,keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`quote`,props:{}}),!0)}},inputRules:[{find:RegExp(`^>\\s$`),replace(){return{type:`quote`,props:{}}}},{find:RegExp(`^\\p{Quotation_Mark}\\s$`,`u`),replace(){return{type:`quote`,props:{}}}}]})]),qk=Ut.create({name:`BlockNoteTableExtension`,addProseMirrorPlugins:()=>[TT({cellMinWidth:35,defaultCellMinWidth:120,View:null}),zT()],addKeyboardShortcuts(){return{Enter:()=>hw(this.editor.state)?this.editor.commands.command(({state:e,dispatch:t})=>{let n=gw(e),r=n?xw(n,`vert`,1):null;return r&&t&&t(e.tr.setSelection(Or.between(r,yw(r))).scrollIntoView()),!0}):!1,Backspace:()=>{let e=this.editor.state.selection,t=e.empty,n=e.$head.parentOffset===0,r=e.$head.node().type.name===`tableParagraph`;return t&&n&&r},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>hw(e)?(nT(1)(e,t,n),!0):!1),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>hw(e)?(nT(-1)(e,t,n),!0):!1)}},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Ot(Gt(e,`tableRole`,t))}}}),Jk={textColor:GO.textColor},Yk=zt.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,marks(){return qE(this.editor)},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getContent:(e,t)=>eA(e,t)}]},renderHTML({HTMLAttributes:e}){return[`th`,an(this.options.HTMLAttributes,e),0]}}),Xk=zt.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,marks(){return qE(this.editor)},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getContent:(e,t)=>eA(e,t)}]},renderHTML({HTMLAttributes:e}){return[`td`,an(this.options.HTMLAttributes,e),0]}}),Zk=zt.create({name:`table`,content:`tableRow+`,group:`blockContent`,tableRole:`table`,marks(){return qE(this.editor)},isolating:!0,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let n=UE(this.name,`table`,{...this.options.domAttributes?.blockContent||{},...t},this.options.domAttributes?.inlineContent||{}),r=document.createElement(`colgroup`);for(let t of e.children[0].children)if(t.attrs.colwidth)for(let e of t.attrs.colwidth){let t=document.createElement(`col`);e&&(t.style=`width: ${e}px`),r.appendChild(t)}else r.appendChild(document.createElement(`col`));return n.dom.firstChild?.appendChild(r),n},addNodeView(){return({node:e,HTMLAttributes:t})=>{class n extends ST{node;cellMinWidth;blockContentHTMLAttributes;constructor(e,t,n){super(e,t),this.node=e,this.cellMinWidth=t,this.blockContentHTMLAttributes=n;let r=document.createElement(`div`);r.className=zE(`bn-block-content`,n.class),r.setAttribute(`data-content-type`,`table`);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);let i=this.dom,a=document.createElement(`div`);a.className=`tableWrapper-inner`,a.appendChild(i.firstChild),i.appendChild(a),r.appendChild(i);let o=document.createElement(`div`);o.className=`table-widgets-container`,o.style.position=`relative`,i.appendChild(o),this.dom=r}ignoreMutation(e){return!e.target.closest(`.tableWrapper-inner`)||super.ignoreMutation(e)}update(e){return super.update(e)?(nD(this.dom,e.attrs,Jk),!0):!1}}return new n(e,120,{...this.options.domAttributes?.blockContent||{},...t})}}}),Qk=zt.create({name:`tableParagraph`,group:`tableContent`,content:`inline*`,parseHTML(){return[{tag:`p`,getAttrs:e=>{if(typeof e==`string`||!e.textContent||!e.closest(`[data-content-type]`))return!1;let t=e.parentElement;return t===null?!1:t.tagName===`TD`||t.tagName===`TH`?{}:!1},node:`tableParagraph`}]},renderHTML({HTMLAttributes:e}){return[`p`,e,0]}}),$k=zt.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)+`,tableRole:`row`,marks(){return qE(this.editor)},parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,an(this.options.HTMLAttributes,e),0]}});function eA(e,t){let n=Br.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return n.content.descendants(e=>{if(e.isInline)return r.push(e),!1}),Cr.fromArray(r)}var tA=()=>BD({node:Zk,type:`table`,content:`table`},Jk,[QC({key:`table-extensions`,tiptapExtensions:[qk,Qk,Yk,Xk,$k]}),QC({key:`table-keyboard-delete`,keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof Tw))return!1;let t=e.getTextCursorPosition().block,n=t.content,r=0;for(let e of n.rows)for(let t of e.cells){if(`type`in t&&t.content.length>0||!(`type`in t)&&t.length>0)return!1;r++}let i=0;return e.prosemirrorState.selection.forEachCell(()=>{i++}),i<r?!1:(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})]),nA=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.getAttribute(`data-name`)||void 0}),rA=XD(e=>({type:`video`,propSchema:{textAlignment:GO.textAlignment,backgroundColor:GO.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`})),iA=e=>e=>{if(e.tagName===`VIDEO`){if(e.closest(`figure`))return;let{backgroundColor:t}=KO(e);return{...nA(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=XO(e,`video`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=KO(e);return{...nA(n),backgroundColor:i,caption:r}}},aA=ZD(rA,e=>({meta:{fileBlockAccept:[`video/*`]},parse:iA(e),render(t,n){let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`video`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.controls=!0,a.contentEditable=`false`,a.draggable=!1,t.props.previewWidth&&(a.width=t.props.previewWidth),i.appendChild(a),jk(t,n,{dom:i},i,r.firstElementChild)},toExternalHTML(e){if(!e.props.url)return{dom:document.createElement(`video`)};let t;return e.props.showPreview?(t=document.createElement(`video`),t.src=e.props.url,e.props.previewWidth&&(t.width=e.props.previewWidth)):(t=document.createElement(`a`),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?nk(t,e.props.caption):rk(t,e.props.caption):{dom:t}},runsBefore:[`file`]}));function oA(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(let[r,i]of Object.entries(n)){if(!(r in e.schema.blockSpecs[t].config.propSchema))return!1;if(typeof i==`string`){if(e.schema.blockSpecs[t].config.propSchema[r].default!==void 0&&typeof e.schema.blockSpecs[t].config.propSchema[r].default!==i||e.schema.blockSpecs[t].config.propSchema[r].type!==void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[r].default!==i.default||e.schema.blockSpecs[t].config.propSchema[r].default===void 0&&i.default===void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i.type||typeof e.schema.blockSpecs[t].config.propSchema[r].values!=typeof i.values)return!1;if(typeof e.schema.blockSpecs[t].config.propSchema[r].values==`object`&&typeof i.values==`object`){for(let n of i.values)if(!e.schema.blockSpecs[t].config.propSchema[r].values.includes(n))return!1}}}return!0}function sA(e,t,n,r){return oA(t,n,r)&&e.type===n}function cA(e){return e instanceof Tw}function lA(e){let t=e.type.spec.tableRole;return t===`cell`||t===`header_cell`}var uA={1:`heading`,2:`heading_2`,3:`heading_3`,4:`heading_4`,5:`heading_5`,6:`heading_6`},dA={1:`toggle_heading`,2:`toggle_heading_2`,3:`toggle_heading_3`};function fA(e){let t=[];if(oA(e,`paragraph`)&&t.push({key:`paragraph`,type:`paragraph`}),oA(e,`heading`,{level:`number`})){let n=e.schema.blockSchema.heading.propSchema.level.values,r=oA(e,`heading`,{level:`number`,isToggleable:`boolean`});for(let e of[1,2,3,4,5,6])n?.includes(e)&&t.push({key:uA[e],type:`heading`,props:r?{level:e,isToggleable:!1}:{level:e}});if(r)for(let e of[1,2,3])n?.includes(e)&&t.push({key:dA[e],type:`heading`,props:{level:e,isToggleable:!0}})}for(let[n,r]of[[`quote`,`quote`],[`toggle_list`,`toggleListItem`],[`bullet_list`,`bulletListItem`],[`numbered_list`,`numberedListItem`],[`check_list`,`checkListItem`]])oA(e,r)&&t.push({key:n,type:r});return t}var pA=QC(({editor:e})=>{let t=$C(!1),n=()=>e.transact(e=>{if(e.selection.empty||e.selection instanceof Or&&e.doc.textBetween(e.selection.from,e.selection.to).length===0)return!1;let t=!1;return e.selection.content().content.descendants(e=>(e.type.spec.content===`text*`&&(t=!0),!t)),!t});return{key:`formattingToolbar`,store:t,mount({dom:r,signal:i}){let a=!1,o=!1,s=e.onChange(()=>{a||o||t.setState(n())}),c=e.onSelectionChange(()=>{a||o||t.setState(n())}),l=e.onFocusChange((r,{focused:i})=>{i?a||o||e.isFocused()&&t.setState(n()):t.setState(!1)},{includeEditorUI:!0});r.addEventListener(`pointerdown`,()=>{a=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`pointerup`,()=>{a=!1,e.isFocused()&&t.setState(n())},{signal:i,capture:!0}),r.addEventListener(`pointercancel`,()=>{a=!0},{signal:i,capture:!0}),e.prosemirrorView.root.addEventListener(`dragstart`,()=>{o=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`dragend`,()=>{o=!1},{signal:i}),i.addEventListener(`abort`,()=>{s(),c(),l()})}}});function mA(e,t,n=`left`){let r=e.getExtension(`yPositionMapping`);if(r)return r.mapPosition(t,n);let i=e.getExtension(`positionMapping`);if(i)return i.mapPosition(t,n);throw Error(`No position mapping extension found`)}var hA=Pt(e=>e.type.name===`blockContainer`),gA=class{editor;state;emitUpdate;rootEl;pluginState;constructor(e,t,n){this.editor=e,this.pluginState=void 0,this.emitUpdate=e=>{if(!this.state)throw Error(`Attempting to update uninitialized suggestions menu`);t(e,{...this.state,ignoreQueryLength:this.pluginState?.ignoreQueryLength})},this.rootEl=n.root,this.rootEl?.addEventListener(`scroll`,this.handleScroll,!0)}handleScroll=e=>{if(this.state?.show){let t=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!t||e.target instanceof Node&&!e.target.contains(t))return;this.state.referencePos=t.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter)}};update(e,t){let n=_A.getState(t),r=_A.getState(e.state),i=n===void 0&&r!==void 0,a=n!==void 0&&r===void 0;if(!i&&(n===void 0||r===void 0)&&!a)return;if(this.pluginState=a?n:r,a||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}let o=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&o&&(this.state={show:!0,referencePos:o.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){this.rootEl?.removeEventListener(`scroll`,this.handleScroll,!0)}closeMenu=()=>{this.editor.transact(e=>e.setMeta(_A,null))};clearQuery=()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(e=>e.selection.from)}).run()}},_A=new Dr(`SuggestionMenuPlugin`),vA=QC(({editor:e})=>{let t=new Map,n,r=$C(void 0);return{key:`suggestionMenu`,store:r,addSuggestionMenu:e=>{t.set(e.triggerCharacter,e)},removeSuggestionMenu:e=>{t.delete(e)},closeMenu:()=>{n?.closeMenu()},clearQuery:()=>{n?.clearQuery()},shown:()=>n?.state?.show||!1,openSuggestionMenu:(t,n)=>{e.headless||(e.focus(),e.transact(e=>{n?.deleteTriggerCharacter&&e.insertText(t),e.scrollIntoView().setMeta(_A,{triggerCharacter:t,deleteTriggerCharacter:n?.deleteTriggerCharacter||!1,ignoreQueryLength:n?.ignoreQueryLength||!1})}))},prosemirrorPlugins:[new Lr({key:_A,view:t=>(n=new gA(e,(e,t)=>{r.setState({...t,triggerCharacter:e})},t),n),state:{init(){},apply:(t,r,i,a)=>{if(t.selection.$from.parent.type.spec.code)return r;let o=t.getMeta(_A);if(typeof o==`object`&&o){r&&n?.closeMenu();let t=mA(e,a.selection.from-o.triggerCharacter.length);return{triggerCharacter:o.triggerCharacter,deleteTriggerCharacter:o.deleteTriggerCharacter!==!1,queryStartPos:()=>t()+o.triggerCharacter.length,query:``,decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:o?.ignoreQueryLength}}if(r===void 0)return r;if(a.selection.from!==a.selection.to||o===null||t.getMeta(`focus`)||t.getMeta(`blur`)||t.getMeta(`pointer`)||r.triggerCharacter!==void 0&&a.selection.from<r.queryStartPos()||!a.selection.$from.sameParent(a.doc.resolve(r.queryStartPos())))return;let s={...r};return s.query=a.doc.textBetween(r.queryStartPos(),a.selection.from),s}},props:{handleTextInput(e,n,r,i){let a=e.state.doc,o=[...t.entries()].sort(([e],[t])=>t.length-e.length);for(let[t,r]of o){let o=a.textBetween(Math.max(0,n-(t.length-i.length)),n)+i;if(t===o){if(r.shouldOpen&&!r.shouldOpen(e.state.tr))continue;return e.dispatch(e.state.tr.insertText(i)),e.dispatch(e.state.tr.setMeta(_A,{triggerCharacter:o}).scrollIntoView()),!0}}return!1},decorations(e){let t=this.getState(e);if(t===void 0)return null;if(!t.deleteTriggerCharacter){let n=hA(e.selection);if(n)return Fr.create(e.doc,[Rr.node(n.pos,n.pos+n.node.nodeSize,{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}return Fr.create(e.doc,[Rr.inline(t.queryStartPos()-t.triggerCharacter.length,t.queryStartPos(),{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}}})]}});function yA(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;n===`none`;){if(t=e.getTextCursorPosition().nextBlock,t===void 0){let t=e.document[e.document.length-1],n=e.insertBlocks([{type:`paragraph`}],t,`after`)[0];e.setTextCursorPosition(n,`end`);return}n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,`end`)}}function bA(e,t){let n=e.getTextCursorPosition().block;if(n.content===void 0)throw Error(`Slash Menu open in a block that doesn't contain content.`);let r;return Array.isArray(n.content)&&(n.content.length===1&&kE(n.content[0])&&n.content[0].type===`text`&&n.content[0].text===`/`||n.content.length===0)?(r=e.updateBlock(n,t),e.setTextCursorPosition(r)):(r=e.insertBlocks([t],n,`after`)[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),yA(e),r}function xA(e){let t=[],n=new Map(fA(e).map(e=>[e.key,e]));function r(r,i){let a=n.get(r);a&&t.push({onItemClick:()=>{bA(e,{type:a.type,props:a.props})},badge:i,key:r,...e.dictionary.slash_menu[r]})}return r(`heading`,RE(`Mod-Alt-1`)),r(`heading_2`,RE(`Mod-Alt-2`)),r(`heading_3`,RE(`Mod-Alt-3`)),r(`quote`),r(`toggle_list`,RE(`Mod-Shift-6`)),r(`numbered_list`,RE(`Mod-Shift-7`)),r(`bullet_list`,RE(`Mod-Shift-8`)),r(`check_list`,RE(`Mod-Shift-9`)),r(`paragraph`,RE(`Mod-Alt-0`)),oA(e,`codeBlock`)&&t.push({onItemClick:()=>{bA(e,{type:`codeBlock`})},badge:RE(`Mod-Alt-c`),key:`code_block`,...e.dictionary.slash_menu.code_block}),oA(e,`divider`)&&t.push({onItemClick:()=>{bA(e,{type:`divider`})},key:`divider`,...e.dictionary.slash_menu.divider}),oA(e,`table`)&&t.push({onItemClick:()=>{bA(e,{type:`table`,content:{type:`tableContent`,rows:[{cells:[``,``,``]},{cells:[``,``,``]}]}})},badge:void 0,key:`table`,...e.dictionary.slash_menu.table}),oA(e,`image`,{url:`string`})&&t.push({onItemClick:()=>{let t=bA(e,{type:`image`});e.getExtension(ZO)?.showMenu(t.id),e.getExtension(pA)?.store.setState(!1)},key:`image`,...e.dictionary.slash_menu.image}),oA(e,`video`,{url:`string`})&&t.push({onItemClick:()=>{let t=bA(e,{type:`video`});e.getExtension(ZO)?.showMenu(t.id),e.getExtension(pA)?.store.setState(!1)},key:`video`,...e.dictionary.slash_menu.video}),oA(e,`audio`,{url:`string`})&&t.push({onItemClick:()=>{let t=bA(e,{type:`audio`});e.getExtension(ZO)?.showMenu(t.id),e.getExtension(pA)?.store.setState(!1)},key:`audio`,...e.dictionary.slash_menu.audio}),oA(e,`file`,{url:`string`})&&t.push({onItemClick:()=>{let t=bA(e,{type:`file`});e.getExtension(ZO)?.showMenu(t.id),e.getExtension(pA)?.store.setState(!1)},key:`file`,...e.dictionary.slash_menu.file}),r(`toggle_heading`),r(`toggle_heading_2`),r(`toggle_heading_3`),r(`heading_4`,RE(`Mod-Alt-4`)),r(`heading_5`,RE(`Mod-Alt-5`)),r(`heading_6`,RE(`Mod-Alt-6`)),t.push({onItemClick:()=>{e.getExtension(vA)?.openSuggestionMenu(`:`,{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:`emoji`,...e.dictionary.slash_menu.emoji}),t}function SA(e,t){return e.filter(({title:e,aliases:n})=>e.toLowerCase().includes(t.toLowerCase())||n&&n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).length!==0)}var CA={audio:lk(),bulletListItem:zk(),checkListItem:Bk(),codeBlock:vk(),divider:yk(),file:xk(),heading:Ak(),image:Lk(),numberedListItem:Uk(),paragraph:Gk(),quote:Kk(),table:tA(),toggleListItem:Wk(),video:aA()},wA=cO({type:`textColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==GO.textColor.default&&(t.style.color=e in WO?WO[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.color)return e.style.color}}),TA=cO({type:`backgroundColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==GO.backgroundColor.default&&(t.style.backgroundColor=e in WO?WO[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.backgroundColor)return e.style.backgroundColor}}),EA={bold:aO(Ht,`boolean`),italic:aO(fn,`boolean`),underline:aO(nn,`boolean`),strike:aO($t,`boolean`),code:aO(Jt.extend({excludes(){return GC(this.editor)},addInputRules(){return[Zt({find:/(^|[^`])`([^`]+)`(?!`)$/,type:this.type}),new jt({find:/(^|[^`])`([^`]+)`(?!`) $/,handler:({state:e,range:t,match:n})=>{let{tr:r,schema:i}=e,a=n[1],o=n[2];r.replaceWith(t.from+a.length,t.to,[i.text(o,[this.type.create()]),i.text(` `)])}})]}}),`boolean`),textColor:wA,backgroundColor:TA};oO(EA);var DA={text:{config:`text`,implementation:{}},link:{config:`link`,implementation:{}}},OA=tO(DA),kA=class e extends bO{static create(t){return new e({blockSpecs:t?.blockSpecs??CA,inlineContentSpecs:t?.inlineContentSpecs??DA,styleSpecs:t?.styleSpecs??EA})}},AA=new Dr(`blocknote-show-selection`),jA=QC(({editor:e})=>{let t=$C({enabledSet:new Set},{onUpdate(){e.transact(e=>e.setMeta(AA,{}))}});return{key:`showSelection`,store:t,prosemirrorPlugins:[new Lr({key:AA,props:{decorations:e=>{let{doc:n,selection:r}=e;if(t.state.enabledSet.size===0)return Fr.empty;let i=Rr.inline(r.from,r.to,{"data-show-selection":`true`});return Fr.create(n,[i])}}})],showSelection(e,n){t.setState({enabledSet:e?new Set([...t.state.enabledSet,n]):new Set([...t.state.enabledSet].filter(e=>e!==n))})}}});function MA(e){if(!e)throw Error(`resolveUsers is required to create a user store`);let t=$C(new Map),n=new Set,r={store:t,async loadUsers(e){await i(e.filter(e=>!t.state.has(e)&&!n.has(e)))},async refetchUsers(e){await i(e.filter(e=>!n.has(e)))},getUser(e){return t.state.get(e)},setUser(e){let n=Array.isArray(e)?e:[e];t.setState(e=>{let t=new Map(e);for(let e of n)t.set(e.id,e);return t})}};async function i(i){if(i.length!==0){for(let e of i)n.add(e);try{let n=await e(i,r);n.length>0&&t.setState(e=>{let t=new Map(e);for(let e of n)t.set(e.id,e);return t})}finally{for(let e of i)n.delete(e)}}}return r}function NA(e){return typeof e==`function`?MA(e):e??MA(async()=>[])}var PA=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),FA=class e{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,t,n){e<0||this.cache.set(e,[t,n])}replace(e,t,n,r){this.remove(e),this.set(t,n,r)}remove(e){this.cache.delete(e)}invalidate(t){let n=new e(this.cache),r=t.mapping;return this.cache.forEach(([e,i],a)=>{if(a<0)return;let o=r.mapResult(a),s=t.doc.nodeAt(o.pos);if(o.deleted||!s?.eq(e))n.remove(a);else if(a!==o.pos){let e=i.map(e=>e.map(r,0,0)).filter(e=>e!=null);n.replace(a,o.pos,s,e)}}),n}};function IA({parser:e,nodeTypes:t=[`code_block`,`codeBlock`],languageExtractor:n=e=>e.attrs.language}){let r=new Dr(`prosemirror-highlight`);return new Lr({key:r,state:{init(r,i){let a=new FA,[o,s]=LA(i.doc,e,t,n,a);return{cache:a,decorations:o,promises:s}},apply:(r,i)=>{let a=i.cache.invalidate(r),o=!!r.getMeta(`prosemirror-highlight-refresh`);if(!r.docChanged&&!o)return{cache:a,decorations:i.decorations?.map(r.mapping,r.doc),promises:i.promises};let[s,c]=LA(r.doc,e,t,n,a);return{cache:a,decorations:s,promises:c}}},view:e=>{let t=new Set,n=()=>{if(t.size>0||e.isDestroyed)return;let n=e.state.tr.setMeta(`prosemirror-highlight-refresh`,!0);e.dispatch(n)},i=()=>{let i=r.getState(e.state);for(let e of i?.promises??[])t.add(e),e.then(()=>{t.delete(e),n()}).catch(n=>{console.error(`[prosemirror-highlight] Error resolving parser:`,n),t.delete(e)})};return i(),{update:()=>{i()}}},props:{decorations(e){return this.getState(e)?.decorations}}})}function LA(e,t,n,r,i){let a=[],o=[],s=RA(e,n);try{for(let[e,n]of s){let s=r(e),c=i.get(n);if(c){let[e,t]=c;t.length>0&&a.push(t)}else{let r=t({content:e.textContent,language:s||void 0,pos:n,size:e.nodeSize});r&&Array.isArray(r)?(i.set(n,e,r),r.length>0&&a.push(r)):r instanceof Promise?(i.remove(n),o.push(r)):console.error(`[prosemirror-highlight] Invalid parser result:`,r)}}}catch(e){console.error(`[prosemirror-highlight] Error parsing code blocks:`,e)}return[a.length>0?Fr.create(e,a.flat()):void 0,o]}function RA(e,t){let n=[];return e.descendants((e,r)=>{if(e.type.inlineContent&&t.includes(e.type.name))return n.push([e,r]),!1}),n}function zA(e,t){return function({content:n,language:r,pos:i,size:a}){let o=[],{tokens:s,fg:c,bg:l,rootStyle:u}=e.codeToTokens(n,{lang:r,...t??{theme:e.getLoadedThemes()[0]}}),d=u||(c&&l?`--prosemirror-highlight:${c};--prosemirror-highlight-bg:${l}`:``);if(d){let e=Rr.node(i,i+a,{style:d});o.push(e)}let f=i+1;for(let e of s){for(let t of e){let e=f+t.content.length,n=Rr.inline(f,e,{style:BA(t.htmlStyle??`color: ${t.color}`),class:`shiki`});o.push(n),f=e}f+=1}return o}}function BA(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var VA=e(PA(),1);function HA(e,t){let n,r;if(t.firstChild.descendants((i,a)=>n?!1:!UA(i)||!i.attrs.id||rE(i,t)!==e||(n=i,r=a+1,!1)),n!==void 0&&r!==void 0)return{node:n,posBeforeNode:r}}function UA(e){return e.type.isInGroup(`bnBlock`)}var WA=`[data-node-type][data-id]:not([data-node-type="blockOuter"])`;function GA(e,t){if(!t.dom.contains(e))return;let n=e.closest(`.bn-editor`);if(n&&n!==t.dom)return;let r=e.closest(WA);return r&&r!==t.dom&&t.dom.contains(r)?r:void 0}function KA(e,t,n){let r=e.nodeDOM(t);if(!(r instanceof Element))return;let i=r.matches(`[data-node-type][data-id]:not([data-node-type="blockOuter"])`)?r:r.querySelector(WA);return i?.getAttribute(`data-id`)===n?i:void 0}function qA(e,t){let n=GA(e,t);if(!n)return;let r=n.getAttribute(`data-id`),i=n.getAttribute(`data-node-type`),a=i===`blockContainer`?n.querySelector(`[data-content-type]`)?.getAttribute(`data-content-type`):i,o=n.ownerDocument.defaultView?.HTMLElement;if(!o||!(n instanceof o)||!r||!a)throw Error(`Block root is missing its HTML element, ID, or block type.`);return{node:n,id:r,type:a}}function JA(e,t,n){let r=qA(e,t);for(;r;){if(n(r.type))return r;let e=r.node.parentElement;r=e?qA(e,t):void 0}}function YA(e){let t=e.closest(`.bn-editor`),n=[];for(let r of e.querySelectorAll(WA))r.parentElement?.closest(`[data-node-type][data-id]:not([data-node-type="blockOuter"])`)===e&&r.closest(`.bn-editor`)===t&&n.push(r);return n}function XA(e){let t=Array.from(e.classList).filter(e=>!e.startsWith(`bn-`))||[];t.length>0?e.className=t.join(` `):e.removeAttribute(`class`)}function ZA(e,t,n,r){let i;if(!t)throw Error(`blockContent is required`);if(typeof t==`string`)i=zO([t],e.pmSchema,r?.blockType);else if(Array.isArray(t))i=zO(t,e.pmSchema,r?.blockType);else if(t.type===`tableContent`)i=BO(t,e.pmSchema);else throw new FE(t.type);let a=(r?.document??document).createDocumentFragment();for(let t of i)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let i=e.schema.inlineContentSpecs[t.type.name].implementation;if(i){let o=mD(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=i.toExternalHTML?i.toExternalHTML(o,e):i.render.call({renderType:`dom`,props:void 0},o,()=>{},e);if(s){if(a.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,r);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=(e.schema.styleSpecs[r.type.name].implementation.toExternalHTML??e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=Tr.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}a.appendChild(n)}else{let e=n.serializeFragment(Cr.from([t]),r);a.appendChild(e)}return a.childNodes.length===1&&a.firstChild?.nodeType===1&&XA(a.firstChild),a}function QA(e,t,n,r,i){let a=e.toExternalHTML?.call({},t,n,{nestingLevel:i});if(a)return{output:a};let o=CD(n,t);if(r){if(!o)throw Error(`Layout block "${t.type}" drew no frame. This is a bug in BlockNote.`);return{output:{dom:o.dom,childrenDOM:o.slot}}}if(!e.render)throw Error(`Block "${t.type}" has no \`render\`. This is a bug in BlockNote.`);return{output:e.render.call({},t,n),frame:o}}function $A(e,t,n,r,i,a,o,s){let c=s?.document??document,l=t.pmSchema.nodes.blockContainer,u=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))!(e in u)&&r.default!==void 0&&(u[e]=r.default);let d=l.spec?.toDOM?.(l.create({id:n.id,...u})),f=Array.from(d.dom.attributes),p=t.blockImplementations[n.type].implementation,m={...n,props:u,children:n.children??[]},h=HT(t.pmSchema.nodes[n.type]),{output:g,frame:_}=QA(p,m,t,h,o),v=c.createDocumentFragment(),y;if(LD(g.dom)||(y=g.dom),y?.classList.contains(`bn-block-content`)){let e=[...f,...Array.from(y.attributes)].filter(e=>e.name.startsWith(`data`)&&e.name!==`data-content-type`&&e.name!==`data-file-block`&&e.name!==`data-node-view-wrapper`&&e.name!==`data-node-type`&&e.name!==`data-id`&&e.name!==`data-editable`);for(let t of e)y.firstChild.setAttribute(t.name,t.value);XA(y.firstChild),o>0&&y.firstChild.setAttribute(`data-nesting-level`,o.toString()),v.append(...Array.from(y.childNodes))}else v.append(g.dom),h&&(y?.removeAttribute(`data-node-type`),y?.removeAttribute(`data-id`),g.childrenDOM?.removeAttribute(`data-frame-slot`)),o>0&&y?.setAttribute(`data-nesting-level`,o.toString());if(g.contentDOM){if(n.content){let e=ZA(t,n.content,r,{...s,blockType:n.type});g.contentDOM.appendChild(e)}let e=t.pmSchema.nodes[n.type];e?.inlineContent&&!e.spec.code&&g.contentDOM.childNodes.length===0&&g.contentDOM.appendChild(c.createTextNode(``))}let b=g.childrenDOM;_&&(_.slot.append(v),v.append(_.dom),b=_.slot);let x;if(i.has(n.type)?x=`OL`:a.has(n.type)&&(x=`UL`),x){if(e.lastChild?.nodeName!==x){let t=c.createElement(x);x===`OL`&&`start`in u&&u.start&&u?.start!==1&&t.setAttribute(`start`,String(u.start)),e.append(t)}e.lastChild.appendChild(v)}else e.append(v);if(n.children&&n.children.length>0){let l=c.createDocumentFragment();if(ej(l,t,n.children,r,i,a,o+1,s),e.lastChild?.nodeName===`UL`||e.lastChild?.nodeName===`OL`)for(;l.firstChild?.nodeName===`UL`||l.firstChild?.nodeName===`OL`;)e.lastChild.lastChild.appendChild(l.firstChild);b?b.append(l):t.pmSchema.nodes[n.type].isInGroup(`blockContent`)||!g.contentDOM?e.append(l):g.contentDOM.append(l)}}var ej=(e,t,n,r,i,a,o=0,s)=>{for(let c of n)$A(e,t,c,r,i,a,o,s)},tj=(e,t,n,r,i,a)=>{let o=(a?.document??document).createDocumentFragment();return ej(o,e,t,n,r,i,0,a),o},nj=(e,t)=>{let n=Tr.fromSchema(e);return{exportBlocks:(e,r)=>{let i=tj(t,e,n,new Set([`numberedListItem`]),new Set([`bulletListItem`,`checkListItem`,`toggleListItem`]),r),a=document.createElement(`div`);return a.append(i),a.innerHTML},exportInlineContent:(e,r)=>{let i=ZA(t,e,n,r),a=document.createElement(`div`);return a.append(i.cloneNode(!0)),a.innerHTML}}};function rj(e){let{mapping:t,steps:n}=e,r=1/0,i=-1/0;for(let e=0;e<t.maps.length;e++){let a=t.maps[e];e&&(r=a.map(r,1),i=a.map(i,-1));let o=!1;if(a.forEach((e,t,n,a)=>{o=!0,r=Math.min(r,n),i=Math.max(i,a)}),!o){let t=n[e];typeof t.pos==`number`?(r=Math.min(r,t.pos),i=Math.max(i,t.pos+1)):typeof t.from==`number`&&typeof t.to==`number`&&(r=Math.min(r,t.from),i=Math.max(i,t.to))}}return r===1/0?null:{from:r,to:i}}function ij(e,t){if(t===0)return;let n=e.resolve(t);for(let t=n.depth;t>0;t--){let r=n.node(t);if(UA(r))return rE(r,e)}}function aj(e){return e.getMeta(`paste`)?{type:`paste`}:e.getMeta(`uiEvent`)===`drop`?{type:`drop`}:e.getMeta(`history$`)?{type:e.getMeta(`history$`).redo?`redo`:`undo`}:e.getMeta(`y-sync$`)?e.getMeta(`y-sync$`).isUndoRedoOperation?{type:`undo-redo`}:{type:`yjs-remote`}:{type:`local`}}function oj(e,t){let n={},r={},i=Math.max(0,Math.min(t.from,e.content.size)),a=Math.max(i,Math.min(t.to,e.content.size));return e.nodesBetween(i,a,(t,i)=>{if(!UA(t))return!0;let a=ij(e,i),o=a??`__root__`;r[o]||(r[o]=[]);let s=hD(t,e),c=rE(t,e);return n[c]={block:s,parentId:a},r[o].push(c),!0}),{byId:n,childrenByParent:r}}function sj(e,t){let n=new Set;if(!e||!t)return n;let r=new Set(e),i=t.filter(e=>r.has(e)),a=e.filter(e=>i.includes(e));if(a.length<=1||i.length<=1)return n;let o={};for(let e=0;e<a.length;e++)o[a[e]]=e;let s=i.map(e=>o[e]),c=s.length,l=[],u=[],d=Array(c).fill(-1),f=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n};for(let e=0;e<c;e++){let t=s[e],n=f(l,t);n>0&&(d[e]=u[n-1]),n===l.length?(l.push(t),u.push(e)):(l[n]=t,u[n]=e)}let p=new Set,m=u[u.length-1]??-1;for(;m!==-1;)p.add(m),m=d[m];for(let e=0;e<i.length;e++)p.has(e)||n.add(i[e]);return n}function cj(e,t=[]){let n=aj(e),r=_E(e.before,[e,...t]),i=rj(r);if(!i)return[];let a=r.mapping.invert(),o={from:a.map(i.from,-1),to:a.map(i.to,1)},s=oj(r.before,o),c=oj(r.doc,i),l=[],u=new Set;Object.keys(c.byId).filter(e=>!(e in s.byId)).forEach(e=>{l.push({type:`insert`,block:c.byId[e].block,source:n,prevBlock:void 0}),u.add(e)}),Object.keys(s.byId).filter(e=>!(e in c.byId)).forEach(e=>{l.push({type:`delete`,block:s.byId[e].block,source:n,prevBlock:void 0}),u.add(e)}),Object.keys(c.byId).filter(e=>e in s.byId).forEach(e=>{let t=s.byId[e],r=c.byId[e];t.parentId===r.parentId?(0,VA.default)({...t.block,children:void 0},{...r.block,children:void 0})||(l.push({type:`update`,block:r.block,prevBlock:t.block,source:n}),u.add(e)):(l.push({type:`move`,block:r.block,prevBlock:t.block,source:n,prevParent:t.parentId?s.byId[t.parentId]?.block:void 0,currentParent:r.parentId?c.byId[r.parentId]?.block:void 0}),u.add(e))});let d=s.childrenByParent,f=c.childrenByParent,p=new Set([...Object.keys(d),...Object.keys(f)]),m=new Set;return p.forEach(e=>{let t=sj(d[e],f[e]);t.size!==0&&t.forEach(t=>{let r=s.byId[t],i=c.byId[t];r&&i&&r.parentId===i.parentId&&(u.has(t)||(r.parentId??`__root__`)===e&&(m.has(t)||(m.add(t),l.push({type:`move`,block:i.block,prevBlock:r.block,source:n,prevParent:r.parentId?s.byId[r.parentId]?.block:void 0,currentParent:i.parentId?c.byId[i.parentId]?.block:void 0}),u.add(t))))})}),l}var lj=QC(()=>{let e=[];return{key:`blockChange`,prosemirrorPlugins:[new Lr({key:new Dr(`blockChange`),filterTransaction:t=>{let n;return e.reduce((e,r)=>e===!1?e:r({getChanges(){return n||(n=cj(t),n)},tr:t})!==!1,!0)}})],subscribe(t){return e.push(t),()=>{e.splice(e.indexOf(t),1)}}}});function uj(e,t){return!e||!t?!1:!!e.closest(`.${t}`)}function dj(e,t,n,r,i){let a=e.state.doc.resolve(t.pos);if(a.parent.inlineContent||t.orientation===`inline`)return null;let o=a.nodeBefore,s=a.nodeAfter;if(!o&&!s)return null;let c=t.orientation===`block-vertical-left`||t.orientation===`block-vertical-right`,l=c?t.pos:t.pos-(o?o.nodeSize:0),u=e.nodeDOM(l);if(!u)return null;let d=u.getBoundingClientRect();if(c){let e=n/2*r,i=t.orientation===`block-vertical-left`?d.left:d.right;return{left:i-e,right:i+e,top:d.top,bottom:d.bottom}}let f=o?d.bottom:d.top;o&&s&&(f=(f+e.nodeDOM(t.pos).getBoundingClientRect().top)/2);let p=n/2*i;return{left:d.left,right:d.right,top:f-p,bottom:f+p}}function fj(e,t,n,r){let i=e.coordsAtPos(t.pos),a=n/2*r;return{left:i.left-a,right:i.left+a,top:i.top,bottom:i.bottom}}function pj(e,t){e.classList.toggle(`prosemirror-dropcursor-inline`,t===`inline`),e.classList.toggle(`prosemirror-dropcursor-block-horizontal`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-left`,t===`block-vertical-left`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-right`,t===`block-vertical-right`),e.classList.toggle(`prosemirror-dropcursor-block`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-vertical`,t===`block-vertical-left`||t===`block-vertical-right`)}function mj(e){if(!e||e===document.body&&getComputedStyle(e).position===`static`)return{parentLeft:-window.pageXOffset,parentTop:-window.pageYOffset};let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return{parentLeft:t.left-e.scrollLeft*n,parentTop:t.top-e.scrollTop*r}}function hj(e){let t=[];function n(e,r){let i=e.type.spec.blockConfig?.children,a=e.type.name===`blockContainer`&&e.firstChild?.type.name===`blockGroup`,o=HT(e.type)&&(!i||WT(e.type)||e.childCount<JT(i));a||o||!e.type.isInGroup(`bnBlock`)?e.forEach(e=>n(e,o?r:e)):t.push(hD(e,r))}return e.forEach(e=>n(e,e)),t}function gj(e,t,n){let r=t.dragging?.slice;if(!r||r.openStart>0)return;let i=hj(r.content),a=t.posAtCoords(n);if(i.length===0||!a||a.inside<0)return;let o=t.state.doc.resolve(a.inside+1),s=o.depth;for(;s>0&&!o.node(s).type.isInGroup(`bnBlock`);){if(o.node(s).type.name===`blockGroup`)return;s--}if(s===0)return;let c=aE(o.node(s),o.before(s));if(!c.hasContent||!e.schema.blockSpecs[c.blockNoteType]?.implementation.meta.dropsIntoChildren?.(hD(c.block.node,t.state.doc)))return;let l=c.block.node.attrs.id,u=e=>e.id===l||e.children.some(u);if(!i.some(u))return{blockInfo:c,draggedBlocks:i,pos:c.children?c.children.childrenStart:c.block.afterPos-1}}var _j=new Dr(`dropInto`),vj=QC(({editor:e,options:t})=>{let n=null,r=null,i=-1,a=null,o={width:t.dropCursor?.width??5,color:t.dropCursor?.color??`#ddeeff`,exclude:t.dropCursor?.exclude??`bn-drag-exclude`,hooks:t.dropCursor?.hooks},s=t=>{let n=e.prosemirrorView,r=_j.getState(n.state);(r?.blockId!==t?.blockId||r?.pos!==t?.pos)&&n.dispatch(n.state.tr.setMeta(_j,{into:t}))},c=e=>{(e?.pos!==n?.pos||e?.orientation!==n?.orientation)&&(n=e,e==null?(s(void 0),r&&r.parentNode&&r.parentNode.removeChild(r),r=null):l())},l=()=>{if(!n)return;let t=e.prosemirrorView,i=t.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,c=a.height/i.offsetHeight,l=dj(t,n,o.width,s,c)??fj(t,n,o.width,s),u=t.dom.offsetParent;r||(r=u.appendChild(document.createElement(`div`)),r.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,o.color&&(r.style.backgroundColor=o.color)),pj(r,n.orientation);let{parentLeft:d,parentTop:f}=mj(u);r.style.left=(l.left-d)/s+`px`,r.style.top=(l.top-f)/c+`px`,r.style.width=(l.right-l.left)/s+`px`,r.style.height=(l.bottom-l.top)/c+`px`},u=e=>{clearTimeout(i),i=window.setTimeout(()=>c(null),e)},d=e=>{let t=e;a=t.target instanceof Element?t.target:null},f=t=>{let n=t;if(a&&uj(a,o.exclude)||n.target instanceof Element&&uj(n.target,o.exclude))return;let r=e.prosemirrorView;if(!r.editable)return;let i=r.posAtCoords({left:n.clientX,top:n.clientY}),l=i&&i.inside>=0&&r.state.doc.nodeAt(i.inside),d=l&&l.type.spec.disableDropCursor,f=typeof d==`function`?d(r,i,n):d;if(i&&!f){let t=i.pos;if(r.dragging&&r.dragging.slice){let e=Vr(r.state.doc,t,r.dragging.slice);e!=null&&(t=e)}let a=!r.state.doc.resolve(t).parent.inlineContent,l=gj(e,r,{left:n.clientX,top:n.clientY}),d=l?{pos:l.pos,orientation:`block-horizontal`}:{pos:t,orientation:a?`block-horizontal`:`inline`},f=d;if(o.hooks?.computeDropPosition){let t=o.hooks.computeDropPosition({editor:e,event:n,view:r,defaultPosition:d});if(t===null){c(null);return}f=t}if(c(f),l&&f.pos===l.pos&&f.orientation===`block-horizontal`){let{block:e}=l.blockInfo;s({blockId:e.node.attrs.id,draggedBlocks:l.draggedBlocks,pos:e.beforePos})}else s(void 0);u(5e3)}},p=t=>{let n=t;n.relatedTarget instanceof Node&&e.prosemirrorView.dom.contains(n.relatedTarget)||c(null)},m=()=>{u(20)},h=()=>{u(20),a=null};return{key:`dropCursor`,prosemirrorPlugins:[new Lr({key:_j,state:{init:()=>void 0,apply(e,t){let n=e.getMeta(_j);if(n)return n.into;if(!t)return;let{pos:r,deletedAfter:i}=e.mapping.mapResult(t.pos,1);return i?void 0:{...t,pos:r}}},props:{decorations(e){let t=_j.getState(e),n=t&&e.doc.nodeAt(t.pos);return!t||!n?Fr.empty:Fr.create(e.doc,[Rr.node(t.pos,t.pos+n.nodeSize,{"data-drop-target":`true`})])},handleDrop(t,n,r,i){let a=_j.getState(t.state);if(s(void 0),!a||!e.getBlock(a.blockId))return!1;let{blockId:o,draggedBlocks:c}=a;return e.transact(()=>{i&&e.removeBlocks(c.filter(t=>e.getBlock(t.id)));let t=e.getBlock(o);if(!t)throw Error(`The drop target was removed with the dragged blocks`);t.children.length>0?e.insertBlocks(c,t.children[0],`before`):e.updateBlock(t,{children:c})}),!0}}})],mount({signal:e,dom:t,root:n}){n.addEventListener(`dragstart`,d,{capture:!0,signal:e}),t.addEventListener(`dragover`,f,{signal:e}),t.addEventListener(`dragleave`,p,{signal:e}),t.addEventListener(`drop`,m,{signal:e}),t.addEventListener(`dragend`,h,{signal:e}),e.addEventListener(`abort`,()=>{clearTimeout(i),c(null)})}}}),yj=QC(()=>({key:`history`,prosemirrorPlugins:[Ct()],undoCommand:xt,redoCommand:St})),bj=new Dr(`inline-content-boundary-edit`);function xj(e,t,n){if(!e.empty)return e.from<=n.from&&e.to>=n.to;let r=n.to-n.from===1;return t===`Backspace`?r&&e.from===n.to:r&&e.from===n.from}var Sj=QC(()=>({key:`inlineContentBoundaryEdit`,prosemirrorPlugins:[new Lr({key:bj,props:{handleKeyDown:(e,t)=>{if(!e.editable)return!1;let n=t.key.length===1&&!t.ctrlKey&&!t.metaKey;if(!n&&t.key!==`Backspace`&&t.key!==`Delete`)return!1;let{selection:r}=e.state,i=r.$from.node();if(!i.type.spec.inline)return!1;let a=r.$from.before(),o=a+1,s=a+1+i.content.size;if(n&&i.content.size===0){let n=e.state.tr.insert(o,e.state.schema.text(t.key));return n.setSelection(Or.create(n.doc,o+t.key.length)),e.dispatch(n),!0}if(i.content.size>0&&xj(r,t.key,{from:o,to:s})){let t=e.state.tr.delete(o,s);return t.setSelection(Or.create(t.doc,o)),e.dispatch(t),!0}return!1}}})]})),Cj=QC(({editor:e})=>{function t(t){let n=e.prosemirrorView.nodeDOM(t);for(;n&&n.parentElement;){if(n.nodeName===`A`)return n;n=n.parentElement}return null}function n(t){let n=e.getLinkMarkAtPos(t);if(n)return{range:{from:n.from,to:n.to},mark:{attrs:{href:n.href}},get text(){return n.text},get position(){return qt(e.prosemirrorView,n.from,n.to).toJSON()}}}function r(){return e.transact(e=>{if(e.selection.empty)return n(e.selection.anchor)})}return{key:`linkToolbar`,getLinkAtSelection:r,getLinkElementAtPos:t,getMarkAtPos(e,t){return n(e)},getLinkAtElement(t){return e.transact(()=>n(e.prosemirrorView.posAtDOM(t,0)+1))},editLink(t,n,r=e.transact(e=>e.selection.anchor)){e.editLink(t,n,r)},deleteLink(t=e.transact(e=>e.selection.anchor)){e.deleteLink(t)}}}),wj=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`],Tj=`https`,Ej=new Dr(`node-selection-keyboard`),Dj=QC(({editor:e})=>({key:`nodeSelectionKeyboard`,prosemirrorPlugins:[new Lr({key:Ej,props:{handleKeyDown:(t,n)=>{let{selection:r}=t.state;if(r instanceof Ir){if(n.ctrlKey||n.metaKey)return!1;if(n.key===`ArrowDown`&&!n.shiftKey&&!n.altKey&&!n.isComposing&&!r.node.isInline&&r.eq(Nr.atEnd(t.state.doc))){let{block:t}=e.getTextCursorPosition();if(e.schema.blockSchema[t.type].content===`none`)return e.transact(n=>{let[r]=e.insertBlocks([{type:`paragraph`}],t,`after`);e.setTextCursorPosition(r,`start`),n.scrollIntoView()}),n.preventDefault(),!0}if(n.key.length===1)return n.preventDefault(),!0;if(n.key===`Enter`&&!n.isComposing&&!n.shiftKey&&!n.altKey&&!n.ctrlKey&&!n.metaKey){let e=t.state.tr;return t.dispatch(e.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new Or(e.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),Oj=new Dr(`blocknote-placeholder`),kj=QC(({editor:e,options:t})=>{let n=t.placeholders,r=`placeholder-selector-${rw()}`;return{key:`placeholder`,prosemirrorPlugins:[new Lr({key:Oj,view:t=>{let i=document.createElement(`style`),a=e._tiptapEditor.options.injectNonce;a&&i.setAttribute(`nonce`,a),t.root instanceof window.ShadowRoot?t.root.append(i):t.root.head.appendChild(i);let o=i.sheet,s=(e=``)=>`.${r} .bn-block-content${e}:has(.ProseMirror-trailingBreak:only-child):after`;try{let{default:e,emptyDocument:t,...r}=n||{};for(let[e,t]of Object.entries(r)){let n=`[data-content-type="${e}"]`;o.insertRule(`${s(n)} { content: ${JSON.stringify(t)}; }`)}o.insertRule(`${s(`[data-is-only-empty-block]`)} { content: ${JSON.stringify(t)}; }`),o.insertRule(`${s(`[data-is-empty-and-focused]`)} { content: ${JSON.stringify(e)}; }`)}catch(e){console.warn(`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,e)}return{destroy:()=>{i.remove()}}},props:{attributes:{class:r},decorations:t=>{let{doc:n,selection:r}=t;if(!e.isEditable||!r.empty||r.$from.parent.type.spec.code)return;let i=[];t.doc.content.size===6&&i.push(Rr.node(2,4,{"data-is-only-empty-block":`true`}));let a=r.$anchor,o=a.parent;if(o.content.size===0){let e=a.before();i.push(Rr.node(e,e+o.nodeSize,{"data-is-empty-and-focused":`true`}))}return Fr.create(n,i)}}})]}}),Aj=QC(({editor:e})=>{let t=new kr,n=0;function r(){t=new kr,n=0}let i=typeof FinalizationRegistry<`u`?new FinalizationRegistry(()=>{n--,n===0&&r()}):null;return e.on(`create`,()=>{e._tiptapEditor.on(`transaction`,({transaction:e})=>{n!==0&&t.appendMapping(e.mapping)}),e._tiptapEditor.on(`destroy`,()=>{r()})}),{key:`positionMapping`,mapPosition:(e,r=`left`)=>{n++;let a=t.maps.length,o=()=>t.slice(a).map(e,r===`left`?-1:1);return i&&i.register(o,void 0),o}}}),jj=new Dr(`previous-blocks`),Mj={index:`index`,level:`level`,type:`type`,depth:`depth`,"depth-change":`depth-change`},Nj=QC(()=>{let e,t=!1;return{key:`previousBlockType`,prosemirrorPlugins:[new Lr({key:jj,view(n){return t=!0,{update:async(t,n)=>{this.key?.getState(t.state).updatedBlocks.size>0&&(e=setTimeout(()=>{t.dispatch(t.state.tr.setMeta(jj,{clearUpdate:!0}))},0))},destroy:()=>{t=!1,e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(e,n,r,i){if(n.currentTransactionOldBlockAttrs={},n.updatedBlocks.clear(),!e.docChanged||!t)return n;let a=rj(e);if(!a)return n;let o=e.mapping.invert(),s={from:o.map(a.from,-1),to:o.map(a.to,1)},c={},l=Mt(r.doc,s,e=>e.attrs.id),u=new Map(l.map(e=>[rE(e.node,r.doc),e])),d=Mt(i.doc,a,e=>e.attrs.id);for(let e of d){let t=rE(e.node,i.doc),a=u.get(t),o=a?.node.firstChild,s=e.node.firstChild;if(a&&o&&s){let l={index:s.attrs.index,level:s.attrs.level,type:s.type.name,depth:i.doc.resolve(e.pos).depth},u={index:o.attrs.index,level:o.attrs.level,type:o.type.name,depth:r.doc.resolve(a.pos).depth};c[t]=u,n.currentTransactionOldBlockAttrs[t]=u,(u.index!==l.index||u.level!==l.level||u.type!==l.type||u.depth!==l.depth)&&(u[`depth-change`]=u.depth-l.depth,n.updatedBlocks.add(t))}}return n.prevTransactionOldBlockAttrs=c,n}},props:{decorations(e){let t=this.getState(e);if(t.updatedBlocks.size===0)return;let n=[];return e.doc.descendants((r,i)=>{if(!r.attrs.id)return;let a=rE(r,e.doc);if(!t.updatedBlocks.has(a))return;let o=t.currentTransactionOldBlockAttrs[a],s={};for(let[e,t]of Object.entries(o))s[`data-prev-`+Mj[e]]=t||`none`;n.push(Rr.node(i,i+r.nodeSize,{...s}))}),Fr.create(e.doc,n)}}})]}}),Pj=new Dr(`bn-read-only`),Fj=QC(({editor:e,options:t})=>{let n=$C({isEditable:t?.editable??!0,enabledSet:new Set},{onUpdate(t,n){(t.isEditable&&t.enabledSet.size===0)!==(n.isEditable&&n.enabledSet.size===0)&&(e.headless||e.transact(e=>e.setMeta(`editable`,!0)))}});return{key:`readOnly`,store:n,prosemirrorPlugins:[new Lr({key:Pj,props:{editable:()=>n.state.isEditable&&n.state.enabledSet.size===0}})],setEditable(e){n.state.isEditable!==e&&n.setState({...n.state,isEditable:e})},setReadOnly(e,t){n.setState({...n.state,enabledSet:e?new Set([...n.state.enabledSet,t]):new Set([...n.state.enabledSet].filter(e=>e!==t))})}}});function Ij(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r];if(!(t.y<i.top||t.y>i.bottom)){if(t.x>=i.left&&t.x<=i.right)return r;n??=r}}return n}function Lj(e,t){for(;e.matches(WA);){let n=YA(e),r=Ij(n.map(e=>e.getBoundingClientRect()),t);if(r===void 0)break;e=n[r]}return e}var Rj=10;function zj(e,t,n){return Math.min(Math.max(e,t),n)}function Bj(e,t){for(let n of e.root.elementsFromPoint(t.x,t.y)){let t=GA(n,e);if(t)return t}}function Vj(e,t){let n=e.dom.firstElementChild?.getBoundingClientRect();if(!n||t.y<n.top||t.y>n.bottom)return;let r=Math.min(Rj,n.width/2),i=Bj(e,{x:zj(t.x,n.left+r,n.right-r),y:t.y});return i?Lj(i,t):void 0}function Hj(e,t,n,r,i,a){function o(t){let n=t?JA(t,e,r):void 0;return n?{kind:`block`,block:n}:{kind:`none`}}if(t&&e.dom.contains(t)){if(t.closest(`.bn-editor`)!==e.dom)return{kind:`none`};let r=GA(t,e);return o(r?Lj(r,n):Vj(e,n))}if(t&&i(t))return{kind:`editorUI`};let s=e.dom.getBoundingClientRect();return n.x>=s.left&&n.x<=s.right&&n.y>=s.top&&n.y<=s.bottom?{kind:`none`}:n.y>=s.top&&n.y<=s.bottom&&Math.max(s.left-n.x,n.x-s.right)<=a&&!t?.closest(`.bn-editor`)?o(Vj(e,n)):{kind:`none`}}var Uj=3;function Wj(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function Gj(e,t){let n=0;for(let r=0;r<t.length;r++){let i=Math.sign(Wj(t[r],t[(r+1)%t.length],e));if(i!==0){if(n===0)n=i;else if(i!==n)return!1}}return!0}function Kj(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i,o=a===0?0:zj(((e.x-t.x)*r+(e.y-t.y)*i)/a,0,1);return Math.hypot(e.x-(t.x+o*r),e.y-(t.y+o*i))}function qj(e,t){return Math.hypot(e.x-zj(e.x,t.left,t.right),e.y-zj(e.y,t.top,t.bottom))}function Jj(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=[];for(let e of t){for(;n.length>=2&&Wj(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}let r=[];for(let e of[...t].reverse()){for(;r.length>=2&&Wj(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return n.pop(),r.pop(),n.concat(r)}function Yj(e,t,n){if(qj(e,n)>=qj(t,n))return!1;let r=Jj([t,{x:n.left,y:n.top},{x:n.right,y:n.top},{x:n.right,y:n.bottom},{x:n.left,y:n.bottom}]);return r.length>=3&&Gj(e,r)?!0:r.some((t,n)=>Kj(e,t,r[(n+1)%r.length])<=Uj)}function Xj(e){return e.synthetic===!0}function Zj(e,t,n){let r={x:t.clientX,y:t.clientY},i=t.target instanceof Element?t.target.closest(`.bn-editor`):null,a=i?[i]:Array.from(e.root.querySelectorAll(`.bn-editor`)).filter(e=>qj(r,e.getBoundingClientRect())<=n),o=t;if(a.length===0)return null;let s=a[0],c=Number.MAX_VALUE;for(let e of a){let t=e.querySelector(`.bn-block-group`).getBoundingClientRect(),n=o.clientX<t.left?t.left-o.clientX:o.clientX>t.right?o.clientX-t.right:0,r=o.clientY<t.top?t.top-o.clientY:o.clientY>t.bottom?o.clientY-t.bottom:0,i=Math.sqrt(n**2+r**2);i<c&&(c=i,s=e)}return{element:s,distance:c}}function Qj(e,t,n,r){function i(n){return e.dragging!==null||t()||n.dataTransfer?.types.includes(`blocknote/html`)||n.target instanceof Node&&e.dom.contains(n.target)}function a(){let t=new Event(`dragleave`,{bubbles:!1});t.synthetic=!0,e.dom.dispatchEvent(t)}function o(t){let n=e.dom.firstChild.getBoundingClientRect(),r=Object.assign(new Event(t.type,t),{clientX:Math.min(Math.max(t.clientX,n.left),n.left+n.width),clientY:Math.min(Math.max(t.clientY,n.top),n.top+n.height),dataTransfer:t.dataTransfer,preventDefault:()=>t.preventDefault(),synthetic:!0});e.dom.dispatchEvent(r)}function s(r){if(!i(r))return;let a=!r.dataTransfer?.types.includes(`blocknote/html`)&&!!e.dragging,o=t(),s=a||o,c=Zj(e,r,n);if(!c)return;let l=c.element===e.dom,u=l&&c.distance===0;if(l||s)return{isDropPoint:l,isDropWithinEditorBounds:u,isDragOrigin:s}}function c(t){let n=t.dataTransfer?.getData(`blocknote/html`);if(!n||e.dragging)return;let r=new(e.dom.ownerDocument.defaultView??globalThis.window).DOMParser().parseFromString(n,`text/html`).body,{nodes:i}=e.state.schema,a=i[t.dataTransfer.getData(`blocknote/parent`)]??i.blockGroup,o=Br.fromSchema(e.state.schema).parse(r,{topNode:a.create()});e.dragging={slice:new Mr(o.content,0,0),move:!0}}function l(e){if(Xj(e)||!i(e))return;let t=s(e);!t||!t.isDropPoint?a():t.isDropWithinEditorBounds||o(e)}function u(t){if(Xj(t)||!i(t))return;let n=s(t);if(!n){a();return}let{isDropPoint:r,isDropWithinEditorBounds:c,isDragOrigin:l}=n;if(!c&&r&&o(t),r){if(e.dragging)return;e.dispatch(e.state.tr.setSelection(Or.create(e.state.tr.doc,e.state.tr.selection.anchor)))}else l&&setTimeout(()=>e.dispatch(e.state.tr.deleteSelection()),0)}function d(t){Xj(t)||(e.dragging=null)}let f=e.root;f.addEventListener(`dragstart`,c,{signal:r}),f.addEventListener(`dragover`,l,{signal:r}),f.addEventListener(`drop`,u,{signal:r,capture:!0}),f.addEventListener(`dragend`,d,{signal:r,capture:!0})}var $j=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`;function eM(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;r+i<e.length&&e.charCodeAt(r+i)>=48&&e.charCodeAt(r+i)<=57;)i++;if(i>0){t.push(n.join(``));let a=parseInt(e.substring(r,r+i),10);for(;a-->0;)n.pop();r+=i}else n.push(e[r]),r++}return t}var tM=new Set(eM($j)),nM=new Set([`localhost`]),rM=/[.,;:!?"']+$/,iM=/(?:https?|ftp|ftps):\/\/[^\s]+/g,aM=/mailto:[^\s]+/g,oM=/[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/g,sM=/(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:[/?#][^\s]*)?/g;function cM(e){let t=e,n=!0;for(;n;){n=!1;let e=t;t=t.replace(rM,``),t!==e&&(n=!0);for(let[e,r]of[[`(`,`)`],[`[`,`]`]])for(;t.endsWith(r);){let i=lM(t,e);if(lM(t,r)>i)t=t.slice(0,-1),n=!0;else break}}return t}function lM(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function uM(e){let t=e.split(`.`);return t[t.length-1].toLowerCase()}function dM(e){let t=uM(e);return tM.has(t)}function fM(e,t,n){return t===`email`?`mailto:`+e:/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)||/^mailto:/i.test(e)?e:n+`://`+e}function pM(e,t){if(!e)return[];let n=t?.defaultProtocol||`http`,r=[];for(let t of e.matchAll(iM))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(aM))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(oM))r.push({type:`email`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(sM))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[],a=-1;for(let e of r)e.start>=a&&(i.push(e),a=e.end);let o=[];for(let e of i){let t=cM(e.value);if(!t)continue;let r=e.start,i=r+t.length;if(e.type===`url`&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)){let e=new URL(`http://`+t).hostname;if(!dM(e))continue}if(e.type===`email`){let e=t.split(`@`)[1];if(!dM(e))continue}let a=fM(t,e.type,n);o.push({type:e.type,value:t,isLink:!0,href:a,start:r,end:i})}return o}function mM(e,t=`http`){if(!e)return[_M(e,0,0)];for(let[n,r]of[[`(`,`)`],[`[`,`]`],[`{`,`}`]])if(e.startsWith(n)&&e.endsWith(r)&&e.length>2){let i=e.slice(1,-1);if(hM(i))return[_M(n,0,1),gM(i,1,1+i.length,t),_M(r,1+i.length,e.length)]}if(e.endsWith(`.`)&&e.length>1){let n=e.slice(0,-1);if(hM(n))return[gM(n,0,n.length,t),_M(`.`,n.length,e.length)]}return hM(e)?[gM(e,0,e.length,t)]:[_M(e,0,e.length)]}function hM(e){if(/^(?:https?|ftp|ftps):\/\/[^\s]+$/.test(e)||/^mailto:[^\s]+$/.test(e)||nM.has(e.toLowerCase()))return!0;let t=e.match(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+([a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/);if(t){let e=t[1].toLowerCase();if(tM.has(e))return!0}return!1}function gM(e,t,n,r){let i=e.includes(`@`)&&!e.includes(`://`)&&!e.startsWith(`mailto:`)?`email`:`url`;return{type:i,value:e,isLink:!0,href:fM(e,i,r),start:t,end:n}}function _M(e,t,n){return{type:`text`,value:e,isLink:!1,href:e,start:t,end:n}}function vM(e){if(!/^(https?:\/\/|www\.)/i.test(e))return;let t=pM(e.replace(/&[a-zA-Z0-9]+;$/,``),{defaultProtocol:`http`})[0];if(t&&t.start===0)return{value:t.value,href:t.href}}function yM(e){let t=document.createElement(`div`);return t.innerHTML=e,bM(t,{indent:``,inListItem:!1}).trim()+`
|
|
446
|
-
`}function bM(e,t){let n=``,r=Array.from(e.childNodes);for(let e=0;e<r.length;e++){let i=r[e];n+=xM(i,t)}return n}function xM(e,t){if(e.nodeType===3)return e.textContent||``;if(e.nodeType!==1)return``;let n=e;switch(n.tagName.toLowerCase()){case`p`:return SM(n,t);case`h1`:case`h2`:case`h3`:case`h4`:case`h5`:case`h6`:return CM(n,t);case`blockquote`:return wM(n,t);case`pre`:return TM(n,t);case`ul`:return AM(n,t);case`ol`:return jM(n,t);case`table`:return PM(n,t);case`hr`:return t.indent+`***
|
|
447
|
-
|
|
448
|
-
`;case`math`:return DM(n,t);case`img`:return RM(n,t);case`video`:return zM(n,t);case`audio`:return BM(n,t);case`embed`:return VM(n,t);case`figure`:return HM(n,t);case`a`:return KM(n,t);case`details`:return YM(n,t);case`div`:return bM(n,t);case`br`:return``;default:return bM(n,t)}}function SM(e,t){let n=QM(XM(e));return t.inListItem?n:t.indent+n+`
|
|
449
|
-
|
|
450
|
-
`}function CM(e,t){let n=parseInt(e.tagName[1],10),r=`#`.repeat(n)+` `,i=XM(e);return t.indent+r+i+`
|
|
451
|
-
|
|
452
|
-
`}function wM(e,t){let n=Array.from(e.children).filter(e=>{let t=e.tagName.toLowerCase();return[`p`,`ul`,`ol`,`pre`,`blockquote`,`table`,`hr`].includes(t)}),r;if(n.length>0){let e=[];for(let t of n)t.tagName.toLowerCase()===`p`?e.push(XM(t)):e.push(xM(t,{indent:``,inListItem:!1}).trim());r=e.join(`
|
|
453
|
-
|
|
454
|
-
`)}else r=XM(e);return r.split(`
|
|
455
|
-
`).map(e=>t.indent+`> `+e).join(`
|
|
456
|
-
`)+`
|
|
457
|
-
|
|
458
|
-
`}function TM(e,t){let n=e.querySelector(`code`);if(!n)return``;let r=n.getAttribute(`data-language`)||kM(n.className)||``,i=OM(n),a=Math.max(0,...(i.match(/`+/g)??[]).map(e=>e.length)),o="`".repeat(Math.max(3,a+1));return i?[o+r,...(i.endsWith(`
|
|
459
|
-
`)?i.slice(0,-1):i).split(`
|
|
460
|
-
`),o].map(e=>e&&t.indent+e).join(`
|
|
461
|
-
`)+`
|
|
462
|
-
|
|
463
|
-
`:t.indent+o+r+`
|
|
464
|
-
`+t.indent+o+`
|
|
465
|
-
|
|
466
|
-
`}function EM(e){return(e.querySelector(`annotation[encoding="application/x-tex"]`)?.textContent??e.textContent??``).trim()}function DM(e,t){return[`$$`,...EM(e).split(`
|
|
467
|
-
`),`$$`].map(e=>e&&t.indent+e).join(`
|
|
468
|
-
`)+`
|
|
469
|
-
|
|
470
|
-
`}function OM(e){let t=``;for(let n of Array.from(e.childNodes))n.nodeType===3?t+=n.textContent||``:n.nodeType===1&&(n.tagName.toLowerCase()===`br`?t+=`
|
|
471
|
-
`:t+=OM(n));return t}function kM(e){let t=e.match(/language-(\S+)/);return t?t[1]:``}function AM(e,t){let n=``,r=Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`li`);for(let e of r)n+=MM(e,`bullet`,t);return t.inListItem||(n+=`
|
|
472
|
-
`),n}function jM(e,t){let n=``,r=Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`li`),i=parseInt(e.getAttribute(`start`)||`1`,10);for(let e=0;e<r.length;e++){let a=i+e;n+=MM(r[e],`ordered`,t,a)}return t.inListItem||(n+=`
|
|
473
|
-
`),n}function MM(e,t,n,r){let i=null,a=null;for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();e===`input`&&t.type===`checkbox`&&(i=t),e===`details`&&(a=t)}let o,s;i?(o=`* ${i.checked?`[x]`:`[ ]`} `,s=2):t===`ordered`?(o=`${r}. `,s=o.length):(o=`* `,s=2);let c,l;if(a){let e=a.querySelector(`summary`)?.querySelector(`p`);l=a,c=e?XM(e):``}else l=NM(e,i),c=l?XM(l):``;let u=n.indent+o+c+`
|
|
474
|
-
`,d=n.indent+` `.repeat(s),f={indent:d,inListItem:!0};if(a){let e=a.querySelector(`summary`);for(let t of Array.from(a.children))if(t!==e){if(t.tagName.toLowerCase()===`p`){let e=XM(t);u+=`
|
|
475
|
-
`+d+e+`
|
|
476
|
-
`}else u+=xM(t,f)}}let p=Array.from(e.children);for(let e of p){let t=e.tagName.toLowerCase();if(e!==l&&e!==i&&t!==`input`){if(t===`ul`||t===`ol`)u+=xM(e,f);else if(t===`p`){let t=XM(e);u+=`
|
|
477
|
-
`+d+t+`
|
|
478
|
-
`}else u+=`
|
|
479
|
-
`+xM(e,f)}}return u}function NM(e,t){for(let n of Array.from(e.children)){if(n===t||n.tagName.toLowerCase()===`input`)continue;let e=n.tagName.toLowerCase();if(e===`p`||e===`span`)return n}return null}function PM(e,t){let n=e.querySelector(`colgroup`),r=0;n&&(r=n.querySelectorAll(`col`).length);let i=[],a=!1,o=e.querySelectorAll(`tr`),s=[];o.forEach((e,t)=>{s[t]||(s[t]=[]);let n=e.querySelectorAll(`th, td`),i=0;n.forEach(e=>{for(;s[t][i]!==void 0;)i++;t===0&&e.tagName.toLowerCase()===`th`&&(a=!0);let n=FM(XM(e).trim()),r=parseInt(e.getAttribute(`colspan`)||`1`,10),o=parseInt(e.getAttribute(`rowspan`)||`1`,10);for(let e=0;e<o;e++)for(let a=0;a<r;a++){let r=t+e;s[r]||(s[r]=[]),s[r][i+a]=e===0&&a===0?n:``}i+=r}),s[t]&&(r=Math.max(r,s[t].length))});for(let e of s){let t=[];for(let n=0;n<r;n++)t.push(e&&e[n]!==void 0?e[n]??``:``);i.push(t)}if(i.length===0)return``;let c=[];for(let e=0;e<r;e++){let t=3;for(let n of i){let r=e<n.length?n[e].length:0;t=Math.max(t,r)}c.push(Math.max(t,10))}let l=``;if(a){l+=t.indent+IM(i[0],c,r)+`
|
|
480
|
-
`,l+=t.indent+LM(c,r)+`
|
|
481
|
-
`;for(let e=1;e<i.length;e++)l+=t.indent+IM(i[e],c,r)+`
|
|
482
|
-
`}else{let e=Array(r).fill(``);l+=t.indent+IM(e,c,r)+`
|
|
483
|
-
`,l+=t.indent+LM(c,r)+`
|
|
484
|
-
`;for(let e of i)l+=t.indent+IM(e,c,r)+`
|
|
485
|
-
`}return l+=`
|
|
486
|
-
`,l}function FM(e){return e.replace(/\|/g,`\\|`)}function IM(e,t,n){let r=[];for(let i=0;i<n;i++){let n=i<e.length?e[i]:``;r.push(` `+n.padEnd(t[i])+` `)}return`|`+r.join(`|`)+`|`}function LM(e,t){let n=[];for(let r=0;r<t;r++)n.push(` `+`-`.repeat(e[r])+` `);return`|`+n.join(`|`)+`|`}function RM(e,t){let n=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``;return n?t.indent+`\n\n`:`
|
|
487
|
-
|
|
488
|
-
`}function zM(e,t){let n=e.getAttribute(`src`)||e.getAttribute(`data-url`)||``,r=e.getAttribute(`data-name`)||e.getAttribute(`title`)||``;return n?t.indent+`\n\n`:`
|
|
489
|
-
|
|
490
|
-
`}function BM(e,t){let n=e.getAttribute(`src`)||``;return n?t.indent+`<audio src="${WM(n)}" controls></audio>\n\n`:`
|
|
491
|
-
|
|
492
|
-
`}function VM(e,t){let n=e.getAttribute(`src`)||``;return n?t.indent+`[](${n})\n\n`:`
|
|
493
|
-
|
|
494
|
-
`}function HM(e,t){let n=e.querySelector(`img`),r=e.querySelector(`video`),i=e.querySelector(`audio`),a=e.querySelector(`a`),o=e.querySelector(`figcaption`)?.textContent?.trim()||``;return n?UM(`img`,n.getAttribute(`src`)||``,n.getAttribute(`alt`)||``,o,t):r?UM(`video`,r.getAttribute(`src`)||r.getAttribute(`data-url`)||``,r.getAttribute(`data-name`)||r.getAttribute(`title`)||``,o,t):i?UM(`audio`,i.getAttribute(`src`)||``,``,o,t):a?KM(a,t):``}function UM(e,t,n,r,i){if(!t)return``;if(!r&&e!==`audio`)return i.indent+`\n\n`;let a=n&&n!==r?e===`img`?` alt="${WM(n)}"`:e===`video`?` data-name="${WM(n)}"`:``:``,o=e===`img`?`<img${a} src="${WM(t)}">`:`<${e} src="${WM(t)}"${a} controls></${e}>`,s=r?`<figcaption>${GM(r)}</figcaption>`:``;return i.indent+`<figure>${o}${s}</figure>\n\n`}function WM(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function GM(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function KM(e,t){let n=e.getAttribute(`href`)||``,r=e.textContent?.trim()||``;return n?t.indent+qM(r,n)+`
|
|
495
|
-
|
|
496
|
-
`:t.indent+r+`
|
|
497
|
-
|
|
498
|
-
`}function qM(e,t){if(!e)return t;if(e===t){let e=vM(t);if(!/^(https?:\/\/|www\.)/i.test(t)||e?.href===t&&e.value===t)return t}return`[${e}](${JM(t)})`}function JM(e){return e.replace(/[\\()]/g,`\\$&`)}function YM(e,t){let n=e.querySelector(`summary`);if(!n)return bM(e,t);let r=n.querySelector(`h1, h2, h3, h4, h5, h6`);if(r){let i=CM(r,t);for(let r of Array.from(e.children))r!==n&&(i+=xM(r,t));return i}return bM(n,t)}function XM(e){let t=``;for(let n of Array.from(e.childNodes))if(n.nodeType===3)t+=n.textContent||``;else if(n.nodeType===1){let e=n;switch(e.tagName.toLowerCase()){case`strong`:case`b`:{let{content:n,trailing:r}=ZM(XM(e));t+=n?`**${n}**${r}`:r;break}case`em`:case`i`:{let{content:n,trailing:r}=ZM(XM(e));t+=n?`*${n}*${r}`:r;break}case`s`:case`del`:t+=`~~${XM(e)}~~`;break;case`code`:{let n=e.textContent||``,r=Math.max(0,...(n.match(/`+/g)??[]).map(e=>e.length)),i="`".repeat(r+1),a=n.startsWith("`")||n.endsWith("`");t+=i+(a?` ${n} `:n)+i;break}case`u`:t+=XM(e);break;case`a`:{let n=e.getAttribute(`href`)||``,r=XM(e);t+=qM(r,n);break}case`br`:t+=`\\
|
|
499
|
-
`;break;case`math`:{let n=EM(e).split(`
|
|
500
|
-
`).map(e=>e.trim()).join(` `);t+=`$${n}$`;break}case`span`:t+=XM(e);break;case`img`:{let n=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``;t+=``;break}case`video`:{let n=e.getAttribute(`src`)||e.getAttribute(`data-url`)||``,r=e.getAttribute(`data-name`)||e.getAttribute(`title`)||``;t+=``;break}case`p`:t+=XM(e);break;case`input`:break;default:t+=XM(e)}}return t}function ZM(e){let t=e.match(/^(.*?)(\s*)$/);return t?{content:t[1],trailing:t[2]}:{content:e,trailing:``}}function QM(e){let t=e.replace(/^(\\\n)+/,``);return t=t.replace(/(\\\n)+$/,``),t}function $M(e){return yM(e.split(``).join(``))}function eN(e,t,n,r){return $M(nj(t,n).exportBlocks(e,r))}var tN=class e extends Nr{nodes;constructor(e,t){super(e,t);let n=e.node();this.nodes=[],e.doc.nodesBetween(e.pos,t.pos,(e,t,r)=>{if(r!==null&&r.eq(n))return this.nodes.push(e),!1})}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}content(){return new Mr(Cr.from(this.nodes),0,0)}eq(t){if(!(t instanceof e)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let e=0;e<this.nodes.length;e++)if(!this.nodes[e].eq(t.nodes[e]))return!1;return!0}map(t,n){let r=n.mapResult(this.from),i=n.mapResult(this.to);return i.deleted?Nr.near(t.resolve(r.pos)):r.deleted?Nr.near(t.resolve(i.pos)):new e(t.resolve(r.pos),t.resolve(i.pos))}toJSON(){return{type:`multiple-node`,anchor:this.anchor,head:this.head}}};Nr.jsonID(`multiple-node`,tN);var nN;function rN(e,t){let n,r,i=t.resolve(e.from).node().type.spec.group===`blockContent`,a=t.resolve(e.to).node().type.spec.group===`blockContent`,o=Math.min(e.$anchor.depth,e.$head.depth);if(i&&a){let i=e.$from.start(o-1),a=e.$to.end(o-1);n=t.resolve(i-1).pos,r=t.resolve(a+1).pos}else n=e.from,r=e.to;return{from:n,to:r}}function iN(e,t,n=t){t===n&&(n+=e.state.doc.resolve(t+1).node().nodeSize);let r=e.domAtPos(t).node.cloneNode(!1);r.style.removeProperty(`display`);for(let i=t;i<n;i+=e.state.doc.nodeAt(i).nodeSize){let t=e.nodeDOM(i);if(!t)throw Error(`The dragged block at ${i} has no DOM.`);r.appendChild(t.cloneNode(!0))}aN(e.root),nN=r,nN.querySelectorAll(`iframe, embed, object`).forEach(e=>e.parentElement?.removeChild(e));let i=e.dom.className.split(` `).filter(e=>e!==`ProseMirror`&&e!==`bn-root`&&e!==`bn-editor`).join(` `);nN.className=nN.className+` bn-drag-preview `+i,e.root instanceof ShadowRoot?e.root.appendChild(nN):e.root.body.appendChild(nN)}function aN(e){nN!==void 0&&(e instanceof ShadowRoot?e.removeChild(nN):e.body.removeChild(nN),nN=void 0)}function oN(e,t,n){if(!e.dataTransfer||n.headless)return;let r=n.prosemirrorView,i=HA(t.id,r.state.doc);if(!i)throw Error(`Block with ID ${t.id} not found`);let a=i.posBeforeNode;if(a!=null){let t=r.state.selection,i=r.state.doc,{from:o,to:s}=rN(t,i),c=o<=a&&a<s,l=t.$anchor.node()!==t.$head.node()||t instanceof tN;c&&l?(r.dispatch(r.state.tr.setSelection(tN.create(i,o,s))),iN(r,o,s)):(r.dispatch(r.state.tr.setSelection(Ir.create(r.state.doc,a))),iN(r,a));let u=r.state.selection.content(),d=n.pmSchema,f=r.serializeForClipboard(u).dom.innerHTML,p=nj(d,n),m=hj(u.content),h=p.exportBlocks(m,{}),g=$M(h);e.dataTransfer.clearData(),e.dataTransfer.setData(`blocknote/html`,f),e.dataTransfer.setData(`blocknote/parent`,r.state.selection.$from.parent.type.name),e.dataTransfer.setData(`text/html`,h),e.dataTransfer.setData(`text/plain`,g),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setDragImage(nN,0,0)}}var sN=350;function cN(e){if(!e||!(`nodeType`in e))return null;let t=e;return t.nodeType===Node.ELEMENT_NODE?t:t.parentElement}var lN=new Dr(`SideMenuPlugin`),uN=QC(({editor:e,options:t})=>{let n=$C(void 0),r=t?.sideMenu?.hoverMargin??0,i=!1,a=!1,o,s,c,l;function u(t){return e.schema.blockSpecs[t].implementation.meta.draggable}function d(){l&&=(clearTimeout(l.timer),void 0)}function f(){let e=n.state;e?.show&&n.setState({...e,show:!1})}function p(t){let r=e.getBlock(t.id);r?n.setState({show:!0,referencePos:t.node.getBoundingClientRect(),block:r}):f()}function m(t,s,m){if(i||a)return;if(s&&o?.contains(s)){d(),c=t;return}if(!e.isEditable){d(),f();return}let h=Hj(e.prosemirrorView,s,t,u,e.isWithinEditor,r);if(h.kind===`editorUI`)return;let _=n.state,v=_?.show?_.block.id:void 0;if(h.kind===`block`&&h.block.id===v)d(),c=t;else{if(m&&v!==void 0&&o?.isConnected){let e=l?.exit??c??t;if(Yj(t,e,o.getBoundingClientRect())){d(),l={exit:e,timer:setTimeout(g,sN)};return}}d(),h.kind===`block`?(c=t,p(h.block)):f()}}function h(){aN(e.prosemirrorView.root),a=!1}function g(){l=void 0,_()}function _(){if(!s)return;let t=e.prosemirrorView,n=o?.isConnected?o.getBoundingClientRect():void 0,r=n!==void 0&&s.x>=n.left&&s.x<=n.right&&s.y>=n.top&&s.y<=n.bottom?{x:n.right+1,y:s.y}:s;m(r,t.root.elementsFromPoint(r.x,r.y).find(n=>t.dom.contains(n)||!e.isWithinEditor(n))??null,!1)}return{key:`sideMenu`,store:n,prosemirrorPlugins:[new Lr({key:lN,appendTransaction:(e,t,n)=>e.some(e=>e.getMeta(`uiEvent`)===`drop`)?n.tr.scrollIntoView():null})],mount({root:r,signal:o}){Qj(e.prosemirrorView,()=>a,t?.sideMenu?.dropMargin??250,o),r.addEventListener(`mousemove`,e=>{let{clientX:t,clientY:n,buttons:r}=e;if(i||typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n))return;a&&r===0&&h();let o={x:t,y:n};s=o,m(o,cN(e.target),!0)},{signal:o,capture:!0}),r.addEventListener(`mouseout`,e=>{e.relatedTarget===null&&!i&&!a&&(s=void 0,d(),f())},{signal:o,capture:!0}),r.addEventListener(`keydown`,()=>{n.state?.show&&e.isFocused()&&(d(),f())},{signal:o,capture:!0});let c=e.onChange(()=>{n.state?.show&&(d(),_())});o.addEventListener(`abort`,()=>{c(),d(),f()})},setMenuElement(e){o=e},blockDragStart(t,n){a=!0,oN(t,n,e)},blockDragEnd(){h(),e.blur()},get menuFrozen(){return i},freezeMenu(){i=!0,d();let e=n.state;e&&n.setState({...e,show:!0})},unfreezeMenu(){i=!1,f()},hideMenuIfNotFrozen(){!i&&!a&&(d(),f())}}}),dN=QC(({editor:e})=>{let t=$C({popupOpen:void 0,selected:void 0}),n=t=>!!e.schema.blockSpecs[t.type]?.implementation.meta.hasPreview,r=e=>({editor:r})=>{let{block:i,prevBlock:a,nextBlock:o}=r.getTextCursorPosition();if(!n(i)||t.state.popupOpen===i.id)return!1;let s=e===`prev`?a:o;return s?(r.setTextCursorPosition(s.id,e===`prev`?`end`:`start`),!0):!1};return{key:`sourceBlockWithPreview`,store:t,keyboardShortcuts:{Enter:({editor:e})=>{let{block:r}=e.getTextCursorPosition();if(!n(r))return!1;if(t.state.popupOpen===r.id&&e.schema.blockSpecs[r.type].implementation.keyboard(r).enter===`line-break`){let t=e.prosemirrorView;return t.dispatch(t.state.tr.insertText(`
|
|
501
|
-
`)),!0}return e.setTextCursorPosition(r.id,`end`),t.setState(e=>({...e,popupOpen:t.state.popupOpen===r.id?void 0:r.id})),!0},Escape:({editor:e})=>{let{block:r}=e.getTextCursorPosition();return!n(r)||t.state.popupOpen!==r.id?!1:(e.setTextCursorPosition(r.id,`end`),t.setState(e=>({...e,popupOpen:void 0})),!0)},"Mod-a":({editor:e})=>{let{block:r}=e.getTextCursorPosition();if(!n(r)||t.state.popupOpen!==r.id)return!1;let i=e.prosemirrorView,{$from:a}=i.state.selection;return a.parent.type.name===r.type&&(i.dispatch(i.state.tr.setSelection(Or.create(i.state.doc,a.start(),a.end()))),!0)},ArrowUp:r(`prev`),ArrowLeft:r(`prev`),ArrowDown:r(`next`),ArrowRight:r(`next`)},mount:({dom:r,signal:i})=>{let a=e.onSelectionChange(()=>{let{block:r}=e.getTextCursorPosition(),i=n(r)?r.id:void 0,a=t.state.popupOpen&&t.state.popupOpen!==r.id?void 0:t.state.popupOpen;(i!==t.state.selected||a!==t.state.popupOpen)&&t.setState(e=>({...e,selected:i,popupOpen:a}))});i.addEventListener(`abort`,a),r.addEventListener(`keydown`,r=>{if(!e.isEditable)return;let{block:i}=e.getTextCursorPosition();if(n(i)&&t.state.popupOpen!==i.id){if(r.key===`Backspace`||r.key===`Delete`){r.preventDefault(),r.stopImmediatePropagation(),e.removeBlocks([i.id]);return}(r.key.length===1&&!r.ctrlKey&&!r.metaKey||r.key===`Tab`)&&(r.preventDefault(),r.stopImmediatePropagation())}},{capture:!0,signal:i}),r.addEventListener(`blur`,()=>t.setState(e=>({...e,popupOpen:void 0})),{capture:!0,signal:i})}}}),fN=QC(({editor:e})=>{let t=$C({selected:void 0}),n=t=>!!e.schema.inlineContentSpecs[t]?.implementation?.meta?.hasPreview,r=e=>({editor:t})=>{let{$from:r}=t.prosemirrorState.selection,i=r.node();if(!n(i.type.name))return!1;let a=t.prosemirrorView,o=Nr.near(a.state.doc.resolve(e===`before`?r.before():r.after()),e===`before`?-1:1);return a.dispatch(a.state.tr.setSelection(o)),!0};return{key:`sourceInlineContentWithPreview`,store:t,keyboardShortcuts:{Enter:r(`after`),"Shift-Enter":r(`after`),Escape:r(`after`),ArrowUp:r(`before`),ArrowDown:r(`after`),"Mod-a":({editor:e})=>{let{$from:t}=e.prosemirrorState.selection;if(!n(t.node().type.name))return!1;let r=e.prosemirrorView;return r.dispatch(r.state.tr.setSelection(Or.create(r.state.doc,t.start(),t.end()))),!0}},mount:({dom:r,signal:i})=>{let a=e.onSelectionChange(()=>{let{$from:r}=e.prosemirrorState.selection,i=r.node();t.setState({selected:n(i.type.name)?r.before():void 0})});i.addEventListener(`abort`,a),r.addEventListener(`keydown`,t=>{if(t.key!==`ArrowUp`&&t.key!==`ArrowDown`)return;let{$from:i}=e.prosemirrorState.selection;n(i.node().type.name)||(r.classList.add(`bn-suppress-source-popup-caret`),requestAnimationFrame(()=>r.classList.remove(`bn-suppress-source-popup-caret`)))},{capture:!0,signal:i}),r.addEventListener(`blur`,()=>t.setState({selected:void 0}),{capture:!0,signal:i})}}}),pN=Symbol.for(`blocknote.shikiParser`),mN=Symbol.for(`blocknote.shikiHighlighterPromise`),hN=[`text`,`none`,`plaintext`,`txt`];function gN(e,t,n){let r=globalThis,i,a,o=new Set;return IA({parser:t=>{if(!e.createHighlighter)return[];if(!i)return r[mN]=r[mN]||e.createHighlighter(),r[mN].then(e=>{i=e});let n=t.language;return!n||hN.includes(n)||o.has(n)?[]:i.getLoadedLanguages().includes(n)?(a||(a=r[pN]||zA(i,_N(i)),r[pN]=a),a(t)):i.loadLanguage(n).catch(()=>{o.add(n)})},languageExtractor:e=>{let t={type:e.type.name,props:e.attrs};return(n.blockSpecs[t.type]||n.inlineContentSpecs[t.type])?.implementation.meta.highlight?.(t)??void 0},nodeTypes:t})}function _N(e){let t=e.getLoadedThemes(),n=t.find(e=>/light/i.test(e)),r=t.find(e=>/dark/i.test(e));if(n&&r)return{themes:{light:n,dark:r},defaultColor:!1}}function vN(e){let t=Object.values(e.blockSpecs).filter(e=>typeof e?.config==`object`&&e.config.content===`plain`&&!!e.implementation.meta.highlight).map(e=>e.config.type),n=Object.values(e.inlineContentSpecs).filter(e=>typeof e?.config==`object`&&e.config.content===`plain`&&!!e.implementation?.meta?.highlight).map(e=>e.config.type);return[...t,...n]}QC(({editor:e,options:t})=>({key:`syntaxHighlighting`,prosemirrorPlugins:[gN(t,vN(e.schema),e.schema)]}));var yN;async function bN(){return yN||(yN=(async()=>{let[e,t]=await Promise.all([Wn(()=>import(`./module-BrWgIX20.js`),[],import.meta.url),Wn(()=>import(`./native-Cqs-2kTC.js`),[],import.meta.url)]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),yN)}async function xN(e,t){if(!(`text`in e.schema.inlineContentSchema)||e.schema.inlineContentSchema.text!==OA.text)return[];let{emojiData:n,emojiMart:r}=await bN();return(t.trim()===``?Object.values(n.emojis):await r.SearchIndex.search(t)).map(t=>({id:t.skins[0].native,onItemClick:()=>e.insertInlineContent(t.skins[0].native+` `)}))}var SN;function CN(e){SN||(SN=document.createElement(`div`),SN.innerHTML=`_`,SN.style.opacity=`0`,SN.style.height=`1px`,SN.style.width=`1px`,e instanceof Document?e.body.appendChild(SN):e.appendChild(SN))}function wN(e){SN&&=(e instanceof Document?e.body.removeChild(SN):e.removeChild(SN),void 0)}function TN(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function EN(e){let t=e;for(;t&&t.nodeName!==`TD`&&t.nodeName!==`TH`&&!t.classList.contains(`tableWrapper`);){if(t.classList.contains(`ProseMirror`))return;let e=t.parentNode;if(!e||!(e instanceof Element))return;t=e}return t.nodeName===`TD`||t.nodeName===`TH`?{type:`cell`,domNode:t,tbodyNode:t.closest(`tbody`)}:{type:`wrapper`,domNode:t,tbodyNode:t.querySelector(`tbody`)}}function DN(e,t){let n=t.querySelectorAll(e);for(let e=0;e<n.length;e++)n[e].style.visibility=`hidden`}var ON=class{editor;pmView;state;emitUpdate;tableId;tablePos;tableElement;menuFrozen=!1;mouseState=`up`;prevWasEditable=null;constructor(e,t,n){this.editor=e,this.pmView=t,this.emitUpdate=()=>{n(this.state)},t.dom.addEventListener(`mousemove`,this.mouseMoveHandler),t.dom.addEventListener(`mousedown`,this.viewMousedownHandler),window.addEventListener(`mouseup`,this.mouseUpHandler),t.root.addEventListener(`dragover`,this.dragOverHandler),t.root.addEventListener(`drop`,this.dropHandler)}viewMousedownHandler=()=>{this.mouseState=`down`};hideHandles=()=>{this.state?.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate())};mouseUpHandler=e=>{this.mouseState=`up`,this.mouseMoveHandler(e)};mouseMoveHandler=e=>{if(this.menuFrozen||this.mouseState===`selecting`||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;let t=EN(e.target);if(t?.type===`cell`&&this.mouseState===`down`&&!this.state?.draggingState){this.mouseState=`selecting`,this.hideHandles();return}if(!t||!this.editor.isEditable){this.hideHandles();return}if(!t.tbodyNode)return;let n=t.tbodyNode.getBoundingClientRect(),r=qA(t.domNode,this.pmView);if(!r){this.hideHandles();return}let{pmNodeInfo:i,doc:a}=this.editor.transact(e=>({pmNodeInfo:HA(r.id,e.doc),doc:e.doc}));if(!i){this.hideHandles();return}let o=hD(i.node,a);if(!sA(o,this.editor,`table`)){this.hideHandles();return}let s=o;this.tablePos=i.posBeforeNode+1,this.tableElement=r.node,this.tableId=r.id;let c=t.domNode.closest(`.tableWrapper`)?.querySelector(`.table-widgets-container`);if(t?.type===`wrapper`){let t=e.clientY>=n.bottom-1&&e.clientY<n.bottom+20,r=e.clientX>=n.right-1&&e.clientX<n.right+20,i=this.state?.block?.id!==s.id||e.clientX>n.right||e.clientY>n.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:t,showAddOrRemoveColumnsButton:r,referencePosTable:n,block:s,widgetContainer:c,colIndex:i?void 0:this.state?.colIndex,rowIndex:i?void 0:this.state?.rowIndex,referencePosCell:i?void 0:this.state?.referencePosCell}}else{let e=TN(t.domNode),i=TN(t.domNode.parentElement),a=t.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===r.id&&this.state.rowIndex===i&&this.state.colIndex===e)return;this.state={show:!0,showAddOrRemoveColumnsButton:e===s.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:i===s.content.rows.length-1,referencePosTable:n,block:s,draggingState:void 0,referencePosCell:a,colIndex:e,rowIndex:i,widgetContainer:c}}return this.emitUpdate(),!1};dragOverHandler=e=>{if(this.state?.draggingState===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`,DN(`.prosemirror-dropcursor-block, .prosemirror-dropcursor-inline`,this.pmView.root);let t={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(e=>e.tagName===`TD`||e.tagName===`TH`);if(n.length===0)return;let r=n[0],i=!1,a=TN(r.parentElement),o=TN(r),s=this.state.draggingState.draggedCellOrientation===`row`?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation===`row`?a:o)!==s;(this.state.rowIndex!==a||this.state.colIndex!==o)&&(this.state.rowIndex=a,this.state.colIndex=o,this.state.referencePosCell=r.getBoundingClientRect(),i=!0);let l=this.state.draggingState.draggedCellOrientation===`row`?t.top:t.left;this.state.draggingState.mousePos!==l&&(this.state.draggingState.mousePos=l,i=!0),i&&this.emitUpdate(),c&&this.editor.transact(e=>e.setMeta(kN,!0))};dropHandler=e=>{if(this.mouseState=`up`,this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw Error(`Attempted to drop table row or column, but no table block was hovered prior.`);e.preventDefault();let{draggingState:t,colIndex:n,rowIndex:r}=this.state;this.state.draggingState=void 0;let i=this.state.block.content.columnWidths;if(t.draggedCellOrientation===`row`){if(!NO(this.state.block,t.originalIndex,r))return!1;let e=kO(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,rows:e}})}else{if(!PO(this.state.block,t.originalIndex,n))return!1;let e=OO(this.state.block,t.originalIndex,n),[r]=i.splice(t.originalIndex,1);i.splice(n,0,r),this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,columnWidths:i,rows:e}})}return this.editor.setTextCursorPosition(this.state.block.id),!0};getTablePos(e){if(this.tableId===void 0)return;let t=HA(this.tableId,e);return t&&t.posBeforeNode+1}update(){if(!this.state||!this.state.show)return;let e=this.editor.getBlock(this.state.block.id);if(!e||e.type!==`table`||!this.tableElement?.isConnected){this.state=void 0,this.tableId=void 0,this.tablePos=void 0,this.tableElement=void 0,this.emitUpdate();return}this.state.block=e,this.tablePos=this.getTablePos(this.pmView.state.doc);let{height:t,width:n}=wO(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=n&&(this.state.colIndex=n-1));let r=this.tableElement.querySelector(`tbody`);if(!r)throw Error(`Table block does not contain a 'tbody' HTML element. This should never happen.`);if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){let e=r.children[this.state.rowIndex].children[this.state.colIndex];e?this.state.referencePosCell=e.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=r.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener(`mousemove`,this.mouseMoveHandler),window.removeEventListener(`mouseup`,this.mouseUpHandler),this.pmView.dom.removeEventListener(`mousedown`,this.viewMousedownHandler),this.pmView.root.removeEventListener(`dragover`,this.dragOverHandler),this.pmView.root.removeEventListener(`drop`,this.dropHandler)}},kN=new Dr(`TableHandlesPlugin`),AN=QC(({editor:e})=>{let t,n=$C(void 0);return{key:`tableHandles`,store:n,prosemirrorPlugins:[new Lr({key:kN,view:r=>(t=new ON(e,r,e=>{n.setState(e?.block?{...e,draggingState:e.draggingState?{...e.draggingState}:void 0}:void 0)}),t),props:{decorations:e=>{if(t===void 0||t.state===void 0||t.state.draggingState===void 0)return;let n=t.getTablePos(e.doc);if(n===void 0)return;let r=t.state.draggingState.draggedCellOrientation===`row`?t.state.rowIndex:t.state.colIndex;if(r===void 0)return;let i=[],{block:a,draggingState:o}=t.state,{originalIndex:s,draggedCellOrientation:c}=o;if(r===s||!a||c===`row`&&!NO(a,s,r)||c===`col`&&!PO(a,s,r))return Fr.create(e.doc,i);let l=e.doc.resolve(n+1);return t.state.draggingState.draggedCellOrientation===`row`?EO(t.state.block,r).forEach(({row:t,col:n})=>{let a=e.doc.resolve(l.posAtIndex(t)+1),o=e.doc.resolve(a.posAtIndex(n)+1),c=o.node(),u=o.pos+(r>s?c.nodeSize-2:0);i.push(Rr.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.left=`0`,e.style.right=`0`,r>s?e.style.bottom=`-2px`:e.style.top=`-3px`,e.style.height=`4px`,e}))}):DO(t.state.block,r).forEach(({row:t,col:n})=>{let a=e.doc.resolve(l.posAtIndex(t)+1),o=e.doc.resolve(a.posAtIndex(n)+1),c=o.node(),u=o.pos+(r>s?c.nodeSize-2:0);i.push(Rr.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.top=`0`,e.style.bottom=`0`,r>s?e.style.right=`-2px`:e.style.left=`-3px`,e.style.width=`4px`,e}))}),Fr.create(e.doc,i)}}})],colDragStart(n){if(t===void 0||t.state===void 0||t.state.colIndex===void 0)throw Error(`Attempted to drag table column, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`col`,originalIndex:t.state.colIndex,mousePos:n.clientX},t.emitUpdate(),e.transact(e=>e.setMeta(kN,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.colIndex,newIndex:t.state.colIndex,tablePos:t.tablePos})),!e.headless&&(CN(e.prosemirrorView.root),n.dataTransfer.setDragImage(SN,0,0),n.dataTransfer.effectAllowed=`move`)},rowDragStart(n){if(t.state===void 0||t.state.rowIndex===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`row`,originalIndex:t.state.rowIndex,mousePos:n.clientY},t.emitUpdate(),e.transact(e=>e.setMeta(kN,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.rowIndex,newIndex:t.state.rowIndex,tablePos:t.tablePos})),!e.headless&&(CN(e.prosemirrorView.root),n.dataTransfer.setDragImage(SN,0,0),n.dataTransfer.effectAllowed=`copyMove`)},dragEnd(){if(t.state===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState=void 0,t.emitUpdate(),e.transact(e=>e.setMeta(kN,null)),!e.headless&&wN(e.prosemirrorView.root)},freezeHandles(){t.menuFrozen=!0},unfreezeHandles(){t.menuFrozen=!1},hideHandlesIfNotFrozen(){t.menuFrozen||t.hideHandles()},getCellsAtRowHandle(e,t){return EO(e,t)},getCellsAtColumnHandle(e,t){return DO(e,t)},setCellSelection(e,n,r=n){if(!t)throw Error(`Table handles view not initialized`);let i=t.getTablePos(e.doc);if(i===void 0)throw Error(`Attempted to select table cells, but the hovered table is no longer in the document.`);let a=e.doc.resolve(i+1),o=e.doc.resolve(a.posAtIndex(n.row)+1),s=e.doc.resolve(o.posAtIndex(n.col)),c=e.doc.resolve(a.posAtIndex(r.row)+1),l=e.doc.resolve(c.posAtIndex(r.col)),u=e.tr;return u.setSelection(new Tw(s,l)),e.apply(u)},addRowOrColumn(t,n){e.exec((e,r)=>{let i=this.setCellSelection(e,n.orientation===`row`?{row:t,col:0}:{row:0,col:t});return n.orientation===`row`?n.side===`above`?Uw(i,r):Ww(i,r):n.side===`left`?Lw(i,r):Rw(i,r)})},removeRowOrColumn(t,n){return n===`row`?e.exec((e,n)=>Kw(this.setCellSelection(e,{row:t,col:0}),n)):e.exec((e,n)=>Bw(this.setCellSelection(e,{row:0,col:t}),n))},mergeCells(t){return e.exec((e,n)=>Yw(t?this.setCellSelection(e,t.relativeStartCell,t.relativeEndCell):e,n))},splitCell(t){return e.exec((e,n)=>Xw(t?this.setCellSelection(e,t):e,n))},getCellSelection(){return e.transact(e=>{let t=e.selection,n=t.$from,r=t.$to;if(cA(t)){let{ranges:e}=t;e.forEach(e=>{n=e.$from.min(n??e.$from),r=e.$to.max(r??e.$to)})}else{let i=t.$from.pos-t.$from.parentOffset-1,a=t.$to.pos-t.$to.parentOffset-1;if(i<0||a<0||(n=e.doc.resolve(i),r=e.doc.resolve(a),!lA(n.parent)||!lA(r.parent)))return}let i=e.doc.resolve(n.pos-n.parentOffset-1),a=e.doc.resolve(r.pos-r.parentOffset-1),o=e.doc.resolve(i.pos-i.parentOffset-1),s=n.index(i.depth),c=i.index(o.depth),l=r.index(a.depth),u=a.index(o.depth),d=[];for(let e=c;e<=u;e++)for(let t=s;t<=l;t++)d.push({row:e,col:t});return{from:{row:c,col:s},to:{row:u,col:l},cells:d}})},getMergeDirection(t){return e.transact(e=>{let n=cA(e.selection)?e.selection:void 0;if(!n||!t||n.ranges.length<=1)return;let r=this.getCellSelection();if(r)return FO(r.from,r.to,t)?`vertical`:`horizontal`})},cropEmptyRowsOrColumns(e,t){return jO(e,t)},addRowsOrColumns(e,t,n){return MO(e,t,n)}}}),jN=new Dr(`trailingNode`);function MN(e){let t=e.lastChild,n=t?.firstChild;return t?.type.name!==`blockContainer`||n?.type.name!==`paragraph`||n.content.size!==0}function NN(e){if(!e.type.schema.nodes.column){let t=e.lastChild;return t&&MN(t)?[e.content.size-1]:[]}let t=[];return e.descendants((e,n,r)=>!e.isTextblock&&((e.type.name===`column`||e.type.name===`blockGroup`&&r?.type.name===`doc`)&&MN(e)&&t.push(n+e.nodeSize-1),!0)),t}var PN=QC(({editor:e})=>{function t(t){return Rr.widget(t,()=>{let t=document.createElement(`div`);return t.className=`bn-trailing-block`,t.contentEditable=`false`,t.addEventListener(`mousedown`,n=>{n.preventDefault();let r=e.prosemirrorView;if(!r)return;let i=r.state.doc.resolve(r.posAtDOM(t,0)).parent.lastChild?.attrs.id;i&&(e.transact(t=>{let[n]=e.insertBlocks([{type:`paragraph`}],i,`after`);e.setTextCursorPosition(n,`start`),t.scrollIntoView()}),r.focus())}),t},{side:1})}function n(e,n,r){let i=n.map(e.mapping,e.doc),a=new Set(r?NN(e.doc):[]),o=new Set,s=[];for(let e of i.find())a.has(e.from)&&!o.has(e.from)?o.add(e.from):s.push(e);let c=[...a].filter(e=>!o.has(e)),l=i;return s.length>0&&(l=l.remove(s)),c.length>0&&(l=l.add(e.doc,c.map(t))),l}return{key:`trailingNode`,prosemirrorPlugins:[new Lr({key:jN,state:{init:(t,r)=>n(r.tr,Fr.empty,e.isEditable),apply:(t,r)=>!t.docChanged&&!t.getMeta(jN)?r:n(t,r,e.isEditable)},view(e){let t=e.editable;return{update(e){e.editable!==t&&(t=e.editable,e.dispatch(e.state.tr.setMeta(jN,!0)))}}},props:{decorations:e=>jN.getState(e),handleKeyDown:(t,n)=>{if(n.key!==`ArrowRight`&&n.key!==`ArrowDown`)return!1;let{selection:r}=t.state;if(!r.empty)return!1;let i=Nr.atEnd(t.state.doc);if(r.$head.pos!==i.$head.pos)return!1;let a=t.state.doc.lastChild;return!e.isEditable||!a||!MN(a)?!1:(n.preventDefault(),!0)}}})]}}),FN=class{match;handler;undoable;inCode;inCodeMark;constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?IN(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function IN(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var LN=500;function RN({rules:e}){let t=new Lr({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return zN(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&zN(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function zN(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state.tr.insertText(r,t,n),s=o.mapping.map(t),c=o.mapping.map(n),l=null,u=o.doc.resolve(s),d=u.parent.textBetween(Math.max(0,u.parentOffset-LN),u.parentOffset,null,``);for(let t=0;t<i.length;t++){let n=i[t];if(!n.inCodeMark&&u.marks().some(e=>e.type.spec.code))continue;if(u.parent.type.spec.code){if(!n.inCode)continue}else if(n.inCode===`only`)continue;let f=n.match.exec(d);if(!f||f[0].length<r.length)continue;l??=e.state.apply(o);let p=n.handler(l,f,s-f[0].length,c);if(p)return e.dispatch(o),e.dispatch(Tt(e.state.tr)),n.undoable&&p.setMeta(a,{transform:p,from:s,to:c,text:r}),e.dispatch(p),!0}return!1}new FN(/--$/,`—`,{inCodeMark:!1}),new FN(/\.\.\.$/,`…`,{inCodeMark:!1}),new FN(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new FN(/"$/,`”`,{inCodeMark:!1}),new FN(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new FN(/'$/,`’`,{inCodeMark:!1});var BN=Ut.create({name:`gapCursor`,addProseMirrorPlugins(){return[Xt()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:Ot(Gt(e,`allowGapCursor`,t))??null}}});function VN(e){return e.matches(`[data-editable]`)?e:e.querySelector(`[data-editable]`)||e}function HN(e,t){return Br.fromSchema(t).parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}function UN(e,t){let n=[];return e.forEach(e=>{if(e.isText)n.push(e);else{let r=e.type===t.linebreakReplacement?`
|
|
502
|
-
`:e.textContent;r&&n.push(t.text(r,e.marks))}}),Cr.fromArray(n)}function WN(e,t,n){let r=e.content===`plain`||n&&e.content===`styled`?t=>(r,i)=>{let a=n?.({el:r,schema:i});if(a!==void 0)return e.content===`plain`?UN(a,i):a;let o=HN(t(r),i);return e.content===`plain`?UN(o,i):o}:void 0,i=[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:e=>VN(e),getContent:r?(e,t)=>r(VN)(e,t):void 0}];return t&&i.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n!==void 0&&n},preserveWhitespace:r?!0:void 0,getContent:r?(e,t)=>r(e=>e)(e,t):void 0}),i}function GN(e,t,n,r=`before`){let i=typeof n==`string`?n:n.id,a=rD(e),o=t.map(e=>{let t=UO(e,a);return t.check(),t}),s=HA(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);if(o.length===0)return[];let c=pE(e.doc,oE(e.doc,s.posBeforeNode),r,o[0].type);if(!c)throw Error(`Cannot insert blocks at "${r}" of block "${i}": no valid position for them`);if(c.wrapIn&&!c.wrapIn.validContent(Cr.from(o)))throw Error(`Cannot insert blocks at "${r}" of block "${i}": a "${c.wrapIn.name}" doesn't accept them`);let l=c.wrapIn?Cr.from(c.wrapIn.create(null,o)):Cr.from(o),u=e.doc.resolve(c.pos);if(!u.parent.canReplace(u.index(),u.index(),l))throw Error(`Cannot insert blocks at "${r}" of block "${i}": a "${u.parent.type.name}" doesn't accept them`);return e.step(new jr(c.pos,c.pos,new Mr(l,0,0))),o.map(t=>hD(t,e.doc))}function KN(e){if(e.type.name===`blockContainer`){let t=e.firstChild;return e.childCount===1&&!!t&&t.type.name===`paragraph`&&t.childCount===0}return HT(e.type)?e.childCount===1?KN(e.firstChild):e.childCount===0&&JT(e.type.spec.blockConfig?.children)>=1:!1}function qN(e,t){let n=e.doc.resolve(t).nodeAfter;if(!n||!HT(n.type))throw Error(`Invalid layoutBlockPos: does not point to a layout block node.`);if(WT(n.type))return;let r=n.type.spec.blockConfig?.children;if(r&&`dissolve`in r&&r.dissolve===!1)return;let i=JT(n.type.spec.blockConfig?.children),a=[],o=[];if(n.forEach((e,n)=>{if(!KN(e))a.push({node:e,offset:n});else if(HT(e.type)){let r=t+1+n;o.push({from:r,to:r+e.nodeSize})}}),a.length>=i){for(let{from:t,to:n}of o.reverse())e.delete(t,n);return}if(a.length===1){let[{node:r,offset:i}]=a,o=t+1+i,s=WT(r.type)?{from:o+1,to:o+r.nodeSize-1}:{from:o,to:o+r.nodeSize};e.step(new Pr(t,t+n.nodeSize,s.from,s.to,Mr.empty,0,!1));return}let s=[];for(let{node:e}of a)WT(e.type)?e.forEach(e=>s.push(e)):s.push(e);e.replaceWith(t,t+n.nodeSize,Cr.from(s))}function JN(e,t){[...t].sort((e,t)=>t.depth-e.depth).forEach(({id:t})=>{let n=HA(t,e.doc);n&&HT(n.node.type)&&qN(e,n.posBeforeNode)})}function YN(e,t,n,r={}){let i=rD(e),a=n.map(e=>{let t=UO(e,i);return t.check(),t}),o=new Set(t.map(e=>typeof e==`string`?e:e.id)),s=[],c=[],l=typeof t[0]==`string`?t[0]:t[0].id,u=e.steps.length,d=t=>e.mapping.slice(u).map(t);if(e.doc.descendants((t,r)=>{if(o.size===0)return!1;if(!t.type.isInGroup(`bnBlock`))return!0;let i=rE(t,e.doc);if(!o.has(i))return!0;s.push(hD(t,e.doc)),o.delete(i),n.length>0&&i===l&&e.insert(d(r),a);let u=e.doc.resolve(d(r));for(let e of gE(u.doc,u.pos))c.some(t=>t.id===e.id)||c.push(e);let f=u.node();return f.type.name===`blockGroup`&&u.node(u.depth-1).type.name!==`doc`&&f.childCount===1?e.delete(u.before(),u.after()):e.delete(u.pos,u.pos+t.nodeSize),!1}),o.size>0){let e=[...o].join(`
|
|
503
|
-
`);throw Error(`Blocks with the following IDs could not be found in the editor: `+e)}return r.fixLayoutBlocks!==!1&&JN(e,c),{insertedBlocks:a.map(t=>hD(t,e.doc)),removedBlocks:s}}var XN=(e,t)=>({tr:n,dispatch:r})=>(r&&ZN(n,e,t),!0);function ZN(e,t,n,r,i){let a=e.mapping.maps.length,o=oE(e.doc,t),s=o.hasContent&&o.blockNoteType===`table`?iP(e):null,c=rD(e);if(r!==void 0&&i!==void 0&&r>i)throw Error(`Invalid replaceFromPos or replaceToPos`);let l=n.type||o.blockNoteType,u=c.nodes[l],d=u.isInGroup(`bnBlock`)?u:c.nodes.blockContainer,f=o.hasContent&&r!==void 0&&r>=o.contentStart&&r<=o.contentEnd?r-o.contentStart:void 0,p=o.hasContent&&i!==void 0&&i>=o.contentStart&&i<=o.contentEnd?i-o.contentStart:void 0;if(o.hasContent!==u.isInGroup(`blockContent`)||!o.hasContent&&!u.validContent(o.block.node.content)){let t=hD(o.block.node,e.doc),r=oD(c)[l],i,a=[...t.children];Array.isArray(t.content)&&t.content.length&&(r.content===`inline`||r.content===`plain`?i=t.content:HT(u)&&a.unshift({type:`paragraph`,content:t.content}));let s=UO({id:t.id,...i?{content:i}:{},...a.length>0?{children:a}:{},...n},c);s.check();let d=e.doc.resolve(o.block.beforePos);if(!d.parent.canReplace(d.index(),d.index(),Cr.from(s)))throw Error(`Cannot update block to "${l}": a "${d.parent.type.name}" doesn't accept it`);e.replaceWith(o.block.beforePos,o.block.afterPos,s)}else nP(n,e,o),o.hasContent&&QN(n,e,c.nodes[o.blockNoteType],u,o,f,p),eP(e,o.block.beforePos,d,{...n.props}),s&&o.hasContent&&aP(e,e.mapping.slice(a).map(o.content.beforePos),s)}function QN(e,t,n,r,i,a,o){let s=rD(t),c=`keep`;if(e.content){if(typeof e.content==`string`)c=zO([e.content],s,r.name);else if(Array.isArray(e.content))c=zO(e.content,s,r.name);else if(e.content.type===`tableContent`)c=BO(e.content,s);else throw new FE(e.content.type)}else{let e=i.content.node.content;if(n.spec.content!==``&&r.spec.content!==n.spec.content&&!r.validContent(e)){if(r.inlineContent&&n.inlineContent){let e=i.content.node.textContent;c=e.length>0?[s.text(e)]:[]}else c=[]}}if(c===`keep`)eP(t,i.content.beforePos,r,{...e.props});else if(a!==void 0||o!==void 0){let n=tP(t,i.content.beforePos,r,{...e.props}),s=n+1+(a??0),l=n+1+(o??i.content.node.content.size),u=t.doc.resolve(n).depth,d=t.doc.resolve(s).depth,f=t.doc.resolve(l).depth;t.replace(s,l,new Mr(Cr.from(c),d-u-1,f-u-1))}else r===n||r.validContent(i.content.node.content)?$N(t,tP(t,i.content.beforePos,r,{...e.props}),Cr.from(c)):t.replaceWith(i.content.beforePos,i.content.afterPos,r.createChecked({...i.content.node.attrs,...e.props},c))}function $N(e,t,n){let r=e.doc.nodeAt(t);if(!r)throw RangeError(`No node at given position`);let i=r.content,a=t+1;if(r.isTextblock){let t=i.findDiffStart(n);if(t===null)return;let{a:r,b:o}=i.findDiffEnd(n),s=Math.max(0,t-r,t-o);s>0&&(r+=s,o+=s),e.replace(a+t,a+r,new Mr(n.cut(t,o),0,0));return}let o=i.childCount,s=n.childCount,c=0;for(;c<o&&c<s&&i.child(c).eq(n.child(c));)c++;let l=o,u=s;for(;l>c&&u>c&&i.child(l-1).eq(n.child(u-1));)l--,u--;if(c===l&&c===u)return;let d=a;for(let e=0;e<c;e++)d+=i.child(e).nodeSize;let f=d;for(let e=c;e<l;e++)f+=i.child(e).nodeSize;let p=[];for(let e=c;e<u;e++)p.push(n.child(e));e.step(new jr(d,f,new Mr(Cr.from(p),0,0)))}function eP(e,t,n,r){let i=e.doc.nodeAt(t);if(!i)throw RangeError(`No node at given position`);let a=n.spec.attrs??{},o={};for(let e of Object.keys(r))e in a&&(o[e]=r[e]);let s={...i.attrs,...o};if(i.type===n)for(let n of Object.keys(s))s[n]!==i.attrs[n]&&e.setNodeAttribute(t,n,s[n]);else e.setNodeMarkup(t,n,s)}function tP(e,t,n,r){let i=e.mapping.maps.length;return eP(e,t,n,r),e.mapping.slice(i).map(t,-1)}function nP(e,t,n){let r=rD(t);if(e.children!==void 0&&e.children.length>0){let i=e.children.map(e=>{let t=UO(e,r);return t.check(),t});n.children?$N(t,n.children.beforePos,Cr.from(i)):n.hasContent&&t.insert(n.content.afterPos,UT(r,i))}}function rP(e,t,n,r,i){let a=typeof t==`string`?t:t.id,o=HA(a,e.doc);if(!o)throw Error(`Block with ID ${a} not found`);ZN(e,o.posBeforeNode,n,r,i);let s=e.doc.resolve(o.posBeforeNode).nodeAfter;if(!s)throw Error(`Block with ID ${a} not found after update`);return hD(s,e.doc)}function iP(e){let t=`selection`in e?e.selection:null;if(!(t instanceof Or))return null;let n=e.doc.resolve(t.head),r=-1,i=-1;for(let e=n.depth;e>=0;e--){let t=n.node(e).type.name;if(r<0&&(t===`tableCell`||t===`tableHeader`)&&(r=e),t===`table`){i=e;break}}if(r<0||i<0)return null;let a=n.before(r),o=n.before(i),s=e.doc.nodeAt(o);if(!s||s.type.name!==`table`)return null;let c=ow.get(s),l=a-(o+1),u=c.map.indexOf(l);if(u<0)return null;let d=Math.floor(u/c.width),f=u%c.width,p=a+1+1;return{row:d,col:f,offset:Math.max(0,t.head-p)}}function aP(e,t,n){let r=e.doc.nodeAt(t);if(!r||r.type.name!==`table`)return!1;let i=ow.get(r),a=Math.max(0,Math.min(n.row,i.height-1)),o=Math.max(0,Math.min(n.col,i.width-1)),s=a*i.width+o,c=i.map[s];if(c==null)return!1;let l=t+1+c+1,u=e.doc.nodeAt(l),d=l+1,f=u?u.content.size:0,p=d+Math.max(0,Math.min(n.offset,f));return`selection`in e&&e.setSelection(Or.create(e.doc,p)),!0}var oP=[[`textColor`,`data-text-color`],[`backgroundColor`,`data-background-color`]];function sP(e){return typeof e==`string`&&e!=="default"}function cP(e){return oP.some(([t])=>sP(e[t]))}function lP(e,t){for(let[n,r]of oP){let i=t?.[n];sP(i)?e.setAttribute(r,i):e.removeAttribute(r)}}var uP={blockColor:`data-block-color`,blockStyle:`data-block-style`,id:`data-id`,depth:`data-depth`,depthChange:`data-depth-change`},dP=zt.create({name:`blockContainer`,group:`blockGroupChild bnBlock`,content:`blockContent blockGroup?`,priority:50,defining:!0,marks(){return qE(this.editor)},parseHTML(){return[{tag:`div[data-node-type=`+this.name+`]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t={};for(let[n,r]of Object.entries(uP))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t},contentElement:e=>xD(e)??e},{tag:`div[data-node-type="blockOuter"]`,skip:!0}]},renderHTML({HTMLAttributes:e}){let t=document.createElement(`div`);t.className=`bn-block-outer`,t.setAttribute(`data-node-type`,`blockOuter`);for(let[n,r]of Object.entries(e))n!==`class`&&t.setAttribute(n,r);let n={...this.options.domAttributes?.block||{},...e},r=document.createElement(`div`);r.className=zE(`bn-block`,n.class),r.setAttribute(`data-node-type`,this.name);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);return t.appendChild(r),{dom:t,contentDOM:r}},addNodeView(){return(e=>{let{dom:t,contentDOM:n}=this.type.spec.toDOM(e.node),r=this.options.editor,i=wD({props:e,editor:r,blockNode:e=>e.firstChild,unframed:n});i.dom!==n&&n.appendChild(i.dom);let a=e.node.firstChild.attrs;return cP(a)&&lP(n,a),{dom:t,contentDOM:i.slot,update(e,t,r){let a=i.node;return!e.sameMarkup(a)||!i.update(e,t,r)?!1:(e.firstChild.sameMarkup(a.firstChild)||lP(n,e.firstChild.attrs),!0)},...kD(i)}})}});function fP(e,t,n,r,i){let a;if(!t)throw Error(`blockContent is required`);if(typeof t==`string`)a=zO([t],e.pmSchema,r);else if(Array.isArray(t))a=zO(t,e.pmSchema,r);else if(t.type===`tableContent`)a=BO(t,e.pmSchema);else throw new FE(t.type);let o=(i?.document??document).createDocumentFragment();for(let t of a)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let r=e.schema.inlineContentSpecs[t.type.name].implementation;if(r){let a=mD(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=r.render.call({renderType:`dom`,props:void 0},a,()=>{},e);if(s){if(o.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,i);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=e.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=Tr.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}o.appendChild(n)}else{let e=n.serializeFragment(Cr.from([t]),i);o.appendChild(e)}return o}function pP(e,t,n,r){let i=e.pmSchema.nodes.blockContainer,a=t.props||{};for(let[n,r]of Object.entries(e.schema.blockSchema[t.type].propSchema))!(n in a)&&r.default!==void 0&&(a[n]=r.default);let o=t.children||[],s=e.blockImplementations[t.type].implementation,c={...t,props:a,children:o};if(HT(e.pmSchema.nodes[t.type])){let i=CD(e,c);if(!i)throw Error(`Layout block "${t.type}" drew no frame. This is a bug in BlockNote.`);return o.length>0&&i.slot.append(mP(e,o,n,r)),i.dom}if(!s.render)throw Error(`Block "${t.type}" has no \`render\`. This is a bug in BlockNote.`);let l=s.render.call({renderType:`dom`,props:void 0},c,e);if(l.contentDOM&&t.content){let i=fP(e,t.content,n,t.type,r);l.contentDOM.appendChild(i)}let u=i.spec?.toDOM?.(i.create({id:t.id,...a}));u.contentDOM&&lP(u.contentDOM,a);let d=u.contentDOM,f=CD(e,c);return f&&(bD(f.slot),u.contentDOM?.appendChild(f.dom),d=f.slot),d?.appendChild(l.dom),o.length>0&&d?.appendChild(hP(e,o,n,r)),u.dom}function mP(e,t,n,r){let i=(r?.document??document).createDocumentFragment();for(let a of t){let t=pP(e,a,n,r);i.appendChild(t)}return i}var hP=(e,t,n,r)=>{let i=e.pmSchema.nodes.blockGroup,a=i.spec.toDOM(i.create({})),o=mP(e,t,n,r);return a.contentDOM?.appendChild(o),a.dom},gP=e=>(e.querySelectorAll(`[data-content-type="numberedListItem"]`).forEach(e=>{let t=e.closest(`.bn-block-outer`)?.previousElementSibling?.querySelector(`[data-content-type="numberedListItem"]`);if(!t)e.setAttribute(`data-index`,e.getAttribute(`data-start`)||`1`);else{let n=t.getAttribute(`data-index`);e.setAttribute(`data-index`,(parseInt(n||`0`)+1).toString())}}),e),_P=e=>(e.querySelectorAll(`[data-content-type="checkListItem"] input`).forEach(e=>{e.disabled=!0}),e),vP=e=>(e.querySelectorAll(`.bn-toggle-button[aria-expanded="false"]`).forEach(e=>{e.setAttribute(`aria-expanded`,`true`)}),e),yP=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{e.setAttribute(`style`,`--default-cell-min-width: 120px;`),e.setAttribute(`data-show-children`,`true`)}),e),bP=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{let t=document.createElement(`div`);t.className=`tableWrapper`;let n=document.createElement(`div`);n.className=`tableWrapper-inner`,t.appendChild(n),e.parentElement?.appendChild(t),t.appendChild(e)}),e),xP=e=>(e.querySelectorAll(`.bn-inline-content:empty`).forEach(e=>{let t=document.createElement(`span`);t.className=`ProseMirror-trailingBreak`,t.setAttribute(`style`,`display: inline-block;`),e.appendChild(t)}),e),SP=(e,t)=>{let n=Tr.fromSchema(e),r=[gP,_P,vP,yP,bP,xP];return{serializeBlocks:(e,i)=>{let a=hP(t,e,n,i);for(let e of r)a=e(a);return a.outerHTML}}},CP=class{callbacks={};on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}};function wP(e,t){return e.flatMap(e=>WT(t.nodes[e.type])?wP(e.children,t):[e])}function TP(e){return e.transact(e=>{let t=sE(e,e.selection.anchor),n=rE(t.block.node,e.doc);if(e.selection instanceof Tw)return{type:`cell`,anchorBlockId:n,anchorCellOffset:e.selection.$anchorCell.pos-t.block.beforePos,headCellOffset:e.selection.$headCell.pos-t.block.beforePos};if(e.selection instanceof Ir)return{type:`node`,anchorBlockId:n};{let r=sE(e,e.selection.head);return{type:`text`,anchorBlockId:n,headBlockId:rE(r.block.node,e.doc),anchorOffset:e.selection.anchor-t.block.beforePos,headOffset:e.selection.head-r.block.beforePos}}})}function EP(e,t){let n=HA(t.anchorBlockId,e.doc)?.posBeforeNode;if(n===void 0)throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let r;if(t.type===`cell`)r=Tw.create(e.doc,n+t.anchorCellOffset,n+t.headCellOffset);else if(t.type===`node`){let t=oE(e.doc,n);r=Ir.create(e.doc,t.hasContent?t.content.beforePos:n)}else{let i=HA(t.headBlockId,e.doc)?.posBeforeNode;if(i===void 0)throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);r=Or.create(e.doc,n+t.anchorOffset,i+t.headOffset)}e.setSelection(r)}function DP(e,t,n,r){e.transact(i=>{YN(i,t,[],{fixLayoutBlocks:!1}),GN(i,wP(t,e.pmSchema),n,r)})}function OP(e,t,n){e.transact(r=>{let i=e.getSelection()?.blocks||[e.getTextCursorPosition().block],a=TP(e);DP(e,i,t,n),EP(r,a)})}function kP(e,t){let n=wP([t],e.pmSchema)[0],r=n&&e.pmSchema.nodes[n.type];return r&&HT(r)?r:e.pmSchema.nodes.blockContainer}function AP(e,t,n,r,i){let a=n===`up`?`before`:`after`,o=n===`up`?`after`:`before`;for(;r||i;){let s=r&&r.children.length>0,c=r?s?r.children[n===`up`?r.children.length-1:0]:r:i,l=s?o:a;if(e.transact(e=>{let n=HA(c.id,e.doc);return n!==void 0&&pE(e.doc,oE(e.doc,n.posBeforeNode),l,t)!==null}))return{referenceBlock:c,placement:l};i=e.getParentBlock(c),r=l===o?c:n===`up`?e.getPrevBlock(c):e.getNextBlock(c)}}function jP(e,t,n){e.transact(()=>{let r;if(n){let t=e.getBlock(n);if(!t)return;r=[t]}else r=e.getSelection()?.blocks||[e.getTextCursorPosition().block];let i=r[t===`up`?0:r.length-1],a=AP(e,kP(e,r[0]),t,t===`up`?e.getPrevBlock(i):e.getNextBlock(i),e.getParentBlock(i));a&&(n?DP(e,r,a.referenceBlock,a.placement):OP(e,a.referenceBlock,a.placement))})}function MP(e,t){jP(e,`up`,t)}function NP(e,t){jP(e,`down`,t)}function PP(e,t){return e.childCount>0&&e.type.isInGroup(`childContainer`)&&e.type.contentMatch.matchType(t)!==null}function FP(e,t,n){let{$from:r,$to:i}=e.selection,a=r.blockRange(i,e=>PP(e,t));if(!a)return!1;let o=a.startIndex;if(o===0)return!1;let s=a.parent.child(o-1);if(s.type!==t)return!1;let c=s.lastChild&&s.lastChild.type===n?2:1,l=new Mr(Cr.from(t.create(null,Cr.from(n.create()))),c,0),u=a.start,d=a.end;return e.step(new Pr(u-c,d,u,d,l,2-c,!0)).scrollIntoView(),!0}function IP(e){return t=>FP(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup)}function LP(e){return e.transact(IP(e))}function RP(e,t,n,r){let i=r.end,a=r.$to.end(r.depth);if(i<a){let o=r.parent.child(r.endIndex-1),s=o.lastChild&&o.lastChild.type===n;e.step(new Pr(i-(s?2:1),a,i,a,new Mr(Cr.from(t.create(null,n.create())),s?2:1,0),+!s,!0)),r=new Sr(e.doc.resolve(r.$from.pos),e.doc.resolve(a),r.depth)}let o=wr(r);if(o==null)return!1;e.lift(r,o);let s=e.doc.resolve(e.mapping.map(i,-1)-1);return Er(e.doc,s.pos)&&s.nodeBefore.type===s.nodeAfter.type&&e.join(s.pos),e.scrollIntoView(),!0}function zP(e,t,n,r){let{$from:i,$to:a}=e.selection,o=i.blockRange(a,e=>PP(e,t));if(!o)return!1;let s=i.node(o.depth-1);return s.type===t&&!r(s)?!1:s.type===t&&RP(e,t,n,o)}function BP(e){return t=>zP(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup,n=>{let r=hD(n,t.doc);return e.schema.blockSpecs[r.type].implementation.keyboard(r).childrenCanOutdent})}function VP(e){return e.transact(BP(e))}function HP(e){return e.canExec(t=>IP(e)(t.tr))}function UP(e){return e.canExec(t=>BP(e)(t.tr))}function WP(e,t){let n=HA(typeof t==`string`?t:t.id,e);if(n)return hD(n.node,e)}function GP(e,t){let n=HA(typeof t==`string`?t:t.id,e);if(!n)return;let r=e.resolve(n.posBeforeNode).nodeBefore;if(r)return hD(r,e)}function KP(e,t){let n=HA(typeof t==`string`?t:t.id,e);if(!n)return;let r=e.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(r)return hD(r,e)}function qP(e,t){let n=HA(typeof t==`string`?t:t.id,e);if(!n)return;let r=lE(e,n.posBeforeNode);if(r)return hD(r.block.node,e)}var JP=class{editor;constructor(e){this.editor=e}get document(){return this.editor.transact(e=>gD(e.doc))}getBlock(e){return this.editor.transact(t=>WP(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>GP(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>KP(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>qP(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse();function r(n){for(let i of n)if(e(i)===!1||!r(t?i.children.slice().reverse():i.children))return!1;return!0}r(n)}insertBlocks(e,t,n=`before`){return this.editor.transact(r=>GN(r,e,t,n))}updateBlock(e,t){return this.editor.transact(n=>rP(n,e,t))}removeBlocks(e){return this.editor.transact(t=>YN(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>YN(n,e,t))}canNestBlock(){return HP(this.editor)}nestBlock(){LP(this.editor)}canUnnestBlock(){return UP(this.editor)}unnestBlock(){VP(this.editor)}moveBlocksUp(e){return MP(this.editor,e)}moveBlocksDown(e){return NP(this.editor,e)}},YP=class extends CP{editor;constructor(e){super(),this.editor=e,e.on(`create`,()=>{e._tiptapEditor.on(`update`,({transaction:t,appendedTransactions:n})=>{this.emit(`onChange`,{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on(`selectionUpdate`,({transaction:t})=>{this.emit(`onSelectionChange`,{editor:e,transaction:t})}),e._tiptapEditor.on(`focus`,({event:t})=>{this.emit(`onFocusChange`,{editor:e,focused:!0,event:t})}),e._tiptapEditor.on(`blur`,({event:t})=>{this.emit(`onFocusChange`,{editor:e,focused:!1,event:t})}),e._tiptapEditor.on(`mount`,()=>{this.emit(`onMount`,{editor:e})}),e._tiptapEditor.on(`unmount`,()=>{this.emit(`onUnmount`,{editor:e})});let t;this.onMount(()=>{t=this.attachUIFocusTracker()}),this.onUnmount(()=>{t&&t()})})}attachUIFocusTracker(){if(typeof document>`u`)return()=>{};let e=this.editor.isFocused({includeEditorUI:!0}),t,n=t=>{let n=this.editor.isFocused({includeEditorUI:!0});n!==e&&(e=n,this.emit(`onFocusChangeWithinUI`,{editor:this.editor,focused:n,event:t}))},r=e=>n(e),i=e=>{clearTimeout(t),t=setTimeout(()=>n(e))};return document.addEventListener(`focusin`,r,!0),document.addEventListener(`focusout`,i,!0),()=>{clearTimeout(t),document.removeEventListener(`focusin`,r,!0),document.removeEventListener(`focusout`,i,!0)}}onChange(e,t=!0){return this.on(`onChange`,({transaction:n,appendedTransactions:r})=>{(t||!XP(n))&&e(this.editor,{getChanges(){return cj(n,r)}})})}onSelectionChange(e,t=!1){return this.on(`onSelectionChange`,({transaction:n})=>{(t||!XP(n))&&e(this.editor)})}onFocusChange(e,t){return this.on(t?.includeEditorUI?`onFocusChangeWithinUI`:`onFocusChange`,({focused:t,event:n})=>e(this.editor,{focused:t,event:n}))}onMount(e){return this.on(`onMount`,e)}onUnmount(e){return this.on(`onUnmount`,e)}};function XP(e){return!!e.getMeta(`y-sync$`)}function ZP(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function QP(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||``)}function $P(e){e.querySelectorAll(`li > ul, li > ol`).forEach(e=>{let t=ZP(e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement(`afterend`,e),r.reverse().forEach(t=>{if(QP(t))return;let n=document.createElement(`li`);n.append(t),e.insertAdjacentElement(`afterend`,n)}),n.childNodes.length===0&&n.remove()})}function eF(e){e.querySelectorAll(`li + ul, li + ol`).forEach(e=>{let t=e.previousElementSibling,n=document.createElement(`div`);t.insertAdjacentElement(`afterend`,n),n.append(t);let r=document.createElement(`div`);for(r.setAttribute(`data-node-type`,`blockGroup`),n.append(r);n.nextElementSibling?.nodeName===`UL`||n.nextElementSibling?.nodeName===`OL`;)r.append(n.nextElementSibling)})}var tF=null;function nF(){return tF||=document.implementation.createHTMLDocument(`title`)}function rF(e){if(typeof e==`string`){let t=nF().createElement(`div`);t.innerHTML=e,e=t}return $P(e),eF(e),e}function iF(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||``))return!0;return!1}function aF(e){let t=new Set([`PRE`,`CODE`]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g,` `))}function oF(e){iF(e)||aF(e)}function sF(e){let t=[];for(let n of e)if(n.type===`text`){let e=n.text.split(``).join(``);e.length>0&&t.push({...n,text:e})}else Array.isArray(n.content)?t.push({...n,content:sF(n.content)}):t.push(n);return t}function cF(e){for(let t of e)Array.isArray(t.content)&&(t.content=sF(t.content)),t.children.length>0&&cF(t.children)}function lF(e,t){let n=rF(e);oF(n);let r=Br.fromSchema(t).parse(n,{topNode:t.nodes.blockGroup.create()}),i=[];for(let e=0;e<r.childCount;e++)i.push(hD(r.child(e),r));return cF(i),i}function uF(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function dF(e){return e?/\w/.test(e):!1}function fF(e,t,n){let r=t>0?e[t-1]:void 0,i=t+n<e.length?e[t+n]:void 0;return dF(r)&&dF(i)}function pF(e,t){if(e[t]!==`\\`||t+1>=e.length)return null;let n=e[t+1];return n===`
|
|
504
|
-
`?{html:`<br>
|
|
505
|
-
`,end:t+2}:"\\`*_{}[]()#+-.!~|>".includes(n)?{html:uF(n),end:t+2}:null}function mF(e,t){return e[t]==="`"?PF(e,t):null}function hF(e,t){return e[t]!==`!`||e[t+1]!==`[`?null:FF(e,t)}function gF(e,t){return e[t]===`[`?IF(e,t):null}function _F(e,t){let n=e.substring(t);if(e[t]===`<`){let e=n.match(/^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^\s<>]*)>/);if(e){let n=e[1];return{html:`<a href="${uF(n)}">${uF(n)}</a>`,end:t+e[0].length}}let r=n.match(/^<([^\s<>]+)>/),i=r?.[1],a=i?pM(i).find(e=>e.type===`email`&&e.start===0&&e.end===i.length):void 0;return r&&i&&a?{html:`<a href="${uF(a.href)}">${uF(i)}</a>`,end:t+r[0].length}:null}if(t>0&&/[a-zA-Z0-9_]/.test(e[t-1]))return null;let r=n.match(/^(https?:\/\/|www\.)[^\s<>]+/i);if(!r)return null;let i=vM(r[0]);return i?{html:`<a href="${uF(i.href)}">${uF(i.value)}</a>`,end:t+i.value.length}:null}function vF(e,t,n){return e[t]!==`~`||e[t+1]!==`~`?null:BF(e,t,`~~`,`<del>`,`</del>`,n)}function yF(e,t,n){return e[t]===`*`&&e[t+1]===`*`&&e[t+2]===`*`||e[t]===`_`&&e[t+1]===`_`&&e[t+2]===`_`&&!fF(e,t,3)?BF(e,t,e.substring(t,t+3),`<strong><em>`,`</em></strong>`,n):null}function bF(e,t,n){return e[t]===`*`&&e[t+1]===`*`||e[t]===`_`&&e[t+1]===`_`&&!fF(e,t,2)?BF(e,t,e.substring(t,t+2),`<strong>`,`</strong>`,n):null}function xF(e,t,n){return e[t]===`*`||e[t]===`_`&&!fF(e,t,1)?BF(e,t,e[t],`<em>`,`</em>`,n):null}function SF(e,t){return e[t]===`
|
|
506
|
-
`?{html:`<br>
|
|
507
|
-
`,end:t+1}:null}var CF=/^<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?>/,wF=/^<!--[\s\S]*?-->/,TF=/^<!\[CDATA\[[\s\S]*?\]\]>/,EF=/^<\?[\s\S]*?\?>/,DF=/^<![A-Za-z][\s\S]*?>/;function OF(e,t){if(e[t]!==`<`)return null;let n=e.substring(t);for(let e of[wF,TF,EF,DF,CF]){let r=n.match(e);if(r)return{html:r[0],end:t+r[0].length}}return null}var kF=new Set(`\\\`![~*_
|
|
508
|
-
<`);function AF(e,t){let n=e[t];return kF.has(n)?!0:n===`h`?e.startsWith(`http://`,t)||e.startsWith(`https://`,t):n===`w`&&e.startsWith(`www.`,t)}var jF=[pF,mF,hF,gF,_F,vF,yF,bF,xF,OF,SF],MF=jF.filter(e=>e!==gF&&e!==_F);function NF(e,t=!0){let n=``,r=0,i=t?jF:MF;for(;r<e.length;){if(e[r]===`
|
|
509
|
-
`&&r>=2&&e[r-1]===` `&&e[r-2]===` `){n=n.replace(/ +$/,``),n+=`<br>
|
|
510
|
-
`,r++;continue}let a=!1;if(AF(e,r))for(let o of i){let i=o(e,r,t);if(i){n+=i.html,r=i.end,a=!0;break}}if(!a){let t=r;for(r++;r<e.length&&!AF(e,r);)r++;n+=uF(e.substring(t,r))}}return n}function PF(e,t){let n=0,r=t;for(;r<e.length&&e[r]==="`";)n++,r++;let i=r;for(;i<e.length;)if(e[i]==="`"){let t=0,a=i;for(;i<e.length&&e[i]==="`";)t++,i++;if(t===n){let t=e.substring(r,a);return t=t.replace(/\n/g,` `),t.length>=2&&t[0]===` `&&t[t.length-1]===` `&&/[^ ]/.test(t)&&(t=t.substring(1,t.length-1)),{html:`<code>${uF(t)}</code>`,end:i}}}else i++;return null}function FF(e,t){let n=LF(e,t+1);if(n===-1)return null;let r=t+2;if(e[n+1]!==`(`)return null;let i=n+2,a=RF(e,i-1);if(a===-1)return null;let o=e.substring(r,n),{url:s,title:c}=zF(e.substring(i,a));if(QE(s)){let e=o||c;return{html:`<video src="${uF(s)}"${e?` data-name="${uF(e)}"`:``} data-url="${uF(s)}" controls></video>`,end:a+1}}let l=c===void 0?``:` title="${uF(c)}"`;return{html:`<img src="${uF(s)}" alt="${uF(o)}"${l}>`,end:a+1}}function IF(e,t){let n=t+1,r=LF(e,t);if(r===-1||e[r+1]!==`(`)return null;let i=r+2,a=RF(e,r+1);if(a===-1)return null;let o=e.substring(n,r),{url:s,title:c}=zF(e.substring(i,a)),l=c===void 0?``:` title="${uF(c)}"`;return{html:`<a href="${uF(s)}"${l}>${NF(o,!1)}</a>`,end:a+1}}function LF(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`\\`&&r+1<e.length)r++;else if(e[r]===`[`&&n++,e[r]===`]`&&(n--,n===0))return r;return-1}function RF(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`\\`&&r+1<e.length)r++;else if(e[r]===`(`&&n++,e[r]===`)`&&(n--,n===0))return r;return-1}function zF(e){e=e.trim();let t,n;if(e.startsWith(`<`)){let r=e.indexOf(`>`);r===-1?(t=e.substring(1),n=``):(t=e.substring(1,r),n=e.substring(r+1).trim())}else{let r=e.length;for(let t=0;t<e.length;t++)if(e[t]===`\\`&&t+1<e.length)t++;else if(e[t]===` `||e[t]===` `||e[t]===`
|
|
511
|
-
`){r=t;break}t=e.substring(0,r),n=e.substring(r).trim()}let r;if(n.length>0){let e=n.match(/^"([^"]*)"$|^'([^']*)'$|^\(([^)]*)\)$/);e&&(r=e[1]??e[2]??e[3])}return{url:t,title:r}}function BF(e,t,n,r,i,a){let o=n.length,s=t+o;if(s>=e.length||e[s]===` `||e[s]===` `)return null;let c=s;for(;c<e.length;)if(e[c]===`\\`&&c+1<e.length)c+=2;else{if(e.substring(c,c+o)===n){if(e[c-1]===` `||e[c-1]===` `||o===1&&(c>0&&e[c-1]===n[0]&&!(c>=2&&e[c-2]===`\\`)||c+o<e.length&&e[c+o]===n[0])){c++;continue}let t=e.substring(s,c);if(t.length===0){c++;continue}return{html:r+NF(t,a)+i,end:c+o}}c++}return null}var VF=new Set(`address.article.aside.audio.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`));function HF(e){if(/^ {0,3}<(!--|\?|![A-Za-z]|!\[CDATA\[)/.test(e))return!0;let t=e.match(/^ {0,3}<\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s|\/?>|$)/);return t?VF.has(t[1].toLowerCase()):!1}function UF(e){let t=e.split(`
|
|
512
|
-
`),n=[],r=0,i=!0;for(;r<t.length;){let e=t[r];if(e.trim()===``){i=!0,r++;continue}let a=e.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(a){let e=a[1],o=e[0],s=e.length,c=a[2].trim(),l=[];for(r++;r<t.length;){if(t[r].match(RegExp(`^ {0,3}${o}{${s},}\\s*$`))){r++;break}l.push(t[r]),r++}n.push({type:`codeBlock`,language:c||``,code:l.join(`
|
|
513
|
-
`)}),i=!1;continue}let o=e.match(/^(#{1,6})\s+(.+?)(?:\s+#+\s*|\s*)$/);if(o){n.push({type:`heading`,level:o[1].length,content:o[2]}),i=!1,r++;continue}if(/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)){let t=n[n.length-1];if(!i&&e.trim().match(/^-+$/)&&t&&t.type===`paragraph`){let e=t;n[n.length-1]={type:`heading`,level:2,content:e.content},i=!1,r++;continue}n.push({type:`hr`}),i=!1,r++;continue}if(r+1<t.length){let a=t[r+1];if(/^={1,}\s*$/.test(a)&&e.trim().length>0){n.push({type:`heading`,level:1,content:e.trim()}),i=!1,r+=2;continue}}let s=WF(t,r);if(s){n.push(s.token),r=s.nextLine,i=!1;continue}if(/^\s{0,3}>/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,``)),r++;for(;r<t.length;){let n=t[r];if(n.trim()===``||/^\s{0,3}>/.test(n)||/^(#{1,6})\s/.test(n)||/^(`{3,}|~{3,})/.test(n)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(n)||/^\s*([-*+]|\d+[.)])\s+/.test(n)||/^\s*\|(.+\|)+\s*$/.test(n))break;e.push(n),r++}n.push({type:`blockquote`,content:e.join(`
|
|
514
|
-
`)}),i=!1;continue}let c=e.match(/^(\s*)([-*+]|\d+[.)])(\s+)(\[[ xX]\] )?(.*)$/);if(c){let e=c[1].length,a=c[2],o=c[3],s=c[4],l=c[5],u,d,f;s?(u=`task`,f=s.trim()!==`[ ]`):/^\d+[.)]$/.test(a)?(u=`ordered`,d=parseInt(a,10)):u=`bullet`;let p=e+a.length+o.length+(s?s.length:0),m=e+1,h=e=>{if(e.trim()===``)return!0;let t=e.match(/^\s*/)[0].length;return!!(t>=p||t>=m&&e.match(/^\s*([-*+]|\d+[.)])\s+/))};r++;let g=[];for(;r<t.length;){let e=t[r];if(e.trim()===``){let e=r+1;for(;e<t.length&&t[e].trim()===``;)e++;if(e<t.length&&h(t[e])){g.push(``),r++;continue}break}if(!h(e))break;e.match(/^\s*/)[0].length>=p?g.push(e.substring(p)):g.push(e.substring(m)),r++}let _=g.join(`
|
|
515
|
-
`).replace(/^\n+|\n+$/g,``);n.push({type:`listItem`,listType:u,indent:e,content:l.trim(),start:d,checked:f,childContent:_||void 0}),i=!1;continue}if(HF(e)){let e=[];for(;r<t.length&&t[r].trim()!==``;)e.push(t[r]),r++;n.push({type:`rawHtml`,content:e.join(`
|
|
516
|
-
`)}),i=!1;continue}let l=[e];for(r++;r<t.length;){let e=t[r];if(e.trim()===``||/^(#{1,6})\s/.test(e)||/^(`{3,}|~{3,})/.test(e)||/^\s{0,3}>/.test(e)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)||/^\s*([-*+]|\d+[.)])\s+/.test(e)||/^\s*\|(.+\|)+\s*$/.test(e)||HF(e)||r+1<t.length&&/^[=-]+\s*$/.test(t[r+1])&&e.trim().length>0)break;l.push(e),r++}n.push({type:`paragraph`,content:l.map(e=>e.replace(/^ {1,3}/,``)).join(`
|
|
517
|
-
`).replace(/[ \t]+$/,``)}),i=!1}return n}function WF(e,t){if(t+1>=e.length)return null;let n=e[t],r=e[t+1];if(!r.includes(`|`)||!/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(r)||!n.includes(`|`))return null;let i=GF(n),a=KF(r),o=[],s=t+2;for(;s<e.length;){let t=e[s];if(!t.includes(`|`))break;o.push(GF(t)),s++}return{token:{type:`table`,headers:i,rows:o,alignments:a},nextLine:s}}function GF(e){let t=e.trim(),n=t.startsWith(`|`)?t.substring(1):t,r=n.endsWith(`|`)?n.substring(0,n.length-1):n,i=[],a=``;for(let e=0;e<r.length;e++)r[e]===`\\`&&e+1<r.length&&r[e+1]===`|`?(a+=`|`,e++):r[e]===`|`?(i.push(a.trim()),a=``):a+=r[e];return i.push(a.trim()),i}function KF(e){return GF(e).map(e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:r?`right`:n?`left`:null})}function qF(e){let t=``,n=0;for(;n<e.length;){let r=e[n];switch(r.type){case`heading`:{let e=r;t+=`<h${e.level}>${NF(e.content)}</h${e.level}>`,n++;break}case`paragraph`:t+=`<p>${NF(r.content)}</p>`,n++;break;case`codeBlock`:{let e=r,i=e.language?` data-language="${uF(e.language)}"`:``;t+=`<pre><code${i}>${uF(e.code)}</code></pre>`,n++;break}case`blockquote`:{let e=qF(UF(r.content));t+=`<blockquote>${e}</blockquote>`,n++;break}case`hr`:t+=`<hr>`,n++;break;case`listItem`:{let r=JF(e,n);t+=r.html,n=r.nextIndex;break}case`table`:t+=XF(r),n++;break;case`rawHtml`:t+=r.content,n++;break;default:n++}}return t}function JF(e,t){let n=``,r=t,i=null;for(;r<e.length&&e[r].type===`listItem`;){let t=e[r],a=YF(t.listType);if(i!==null&&i!==a&&(n+=`</${i===`ordered`?`ol`:`ul`}>`,i=null),i===null){if(a===`ordered`){let e=t.start!==void 0&&t.start!==1?` start="${t.start}"`:``;n+=`<ol${e}>`}else n+=`<ul>`;i=a}if(t.listType===`task`){let e=t.checked?` checked`:``;n+=`<li><input type="checkbox" disabled${e}><p>${NF(t.content)}</p>`}else n+=`<li><p>${NF(t.content)}</p>`;if(t.childContent){let e=UF(t.childContent);n+=qF(e)}n+=`</li>`,r++}return i!==null&&(n+=`</${i===`ordered`?`ol`:`ul`}>`),{html:n,nextIndex:r}}function YF(e){return e===`ordered`?`ordered`:`bullet`}function XF(e){let t=`<table>`,n=e.headers.every(e=>e.trim()===``),r=e.headers.length;if(!n){t+=`<thead><tr>`;for(let n=0;n<r;n++){let r=e.alignments[n],i=r?` align="${r}"`:``;t+=`<th${i}>${NF(e.headers[n])}</th>`}t+=`</tr></thead>`}if(e.rows.length>0){t+=`<tbody>`;for(let n of e.rows){t+=`<tr>`;for(let i=0;i<r;i++){let r=i<n.length?n[i]:``,a=e.alignments[i],o=a?` align="${a}"`:``;t+=`<td${o}>${NF(r)}</td>`}t+=`</tr>`}t+=`</tbody>`}return t+=`</table>`,t}function ZF(e){return qF(UF(e))}function QF(e){return ZF(e)}function $F(e,t){return lF(QF(e),t)}var eI=class{editor;constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return nj(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){return SP(this.editor.pmSchema,this.editor).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return lF(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return eN(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){return $F(e,this.editor.pmSchema)}pasteHTML(e,t=!1){let n=e;if(!t){let t=this.tryParseHTMLToBlocks(e);n=this.blocksToFullHTML(t)}n&&this.editor.prosemirrorView?.pasteHTML(n)}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=QF(e);return this.pasteHTML(t)}};function tI(e){let{block:t}=cE(e),n=e.doc.resolve(t.beforePos).nodeBefore,r=e.doc.resolve(t.afterPos).nodeAfter,i=lE(e.doc,t.beforePos)?.block.node;return{block:hD(t.node,e.doc),prevBlock:n===null?void 0:hD(n,e.doc),nextBlock:r===null?void 0:hD(r,e.doc),parentBlock:i===void 0?void 0:hD(i,e.doc)}}function nI(e,t,n=`start`){let r=typeof t==`string`?t:t.id,i=HA(r,e.doc);if(!i)throw Error(`Block with ID ${r} not found`);e.setSelection($T(e.doc,aE(i.node,i.posBeforeNode),n))}var rI=[`vscode-editor-data`,`blocknote/html`,`text/markdown`,`text/html`,`text/plain`,`Files`];function iI(e,t){if(!e.startsWith(`.`)||!t.startsWith(`.`))throw Error(`The strings provided are not valid file extensions.`);return e===t}function aI(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==2)throw Error(`The string ${e} is not a valid MIME type.`);if(r.length!==2)throw Error(`The string ${t} is not a valid MIME type.`);return n[1]===`*`||r[1]===`*`?n[0]===r[0]:(n[0]===`*`||r[0]===`*`||n[0]===r[0])&&n[1]===r[1]}function oI(e,t,n,r=`after`){let i;return i=Array.isArray(t.content)&&t.content.length===0?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id,i}async function sI(e,t){if(!t.uploadFile){console.warn(`Attempted ot insert file, but uploadFile is not set in the BlockNote editor options`);return}let n=`dataTransfer`in e?e.dataTransfer:e.clipboardData;if(n===null)return;let r=null;for(let e of rI)if(n.types.includes(e)){r=e;break}if(r!==`Files`)return;let i=n.items;if(i){e.preventDefault();for(let n=0;n<i.length;n++){let r=`file`;for(let e of Object.values(t.schema.blockSpecs))for(let t of e.implementation.meta.fileBlockAccept||[]){let a=t.startsWith(`.`),o=i[n].getAsFile();if(o&&(!a&&o.type&&aI(i[n].type,t)||a&&iI(`.`+o.name.split(`.`).pop(),t))){r=e.config.type;break}}let a=i[n].getAsFile();if(a){let n={type:r,props:{name:a.name}},i;if(e.type===`paste`){let e=t.getTextCursorPosition().block;i=oI(t,e,n)}else if(e.type===`drop`){let r={left:e.clientX,top:e.clientY},a=t.prosemirrorView.posAtCoords(r);if(!a)return;i=t.transact(e=>{let i=rE(sE(e,a.pos).block.node,e.doc),o=(t.domElement?.querySelector(`[data-id="${i}"]`))?.getBoundingClientRect(),s=t.getBlock(i);if(s)return oI(t,s,n,o&&(o.top+o.bottom)/2>r.top?`before`:`after`)})}else return;if(!i)return;let o=await t.uploadFile(a,i),s=typeof o==`string`?{props:{url:o}}:{...o};t.updateBlock(i,s)}}}}var cI=e=>Ut.create({name:`dropFile`,addProseMirrorPlugins(){return[new Lr({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of rI)if(n.dataTransfer.types.includes(e)){r=e;break}return r===null||r===`Files`&&(sI(n,e),!0)}}}})]}}),lI=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,uI=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,dI=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,fI=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,pI=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,mI=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,hI=/\n{2} {0,3}-{2,48}\n{2}/,gI=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,_I=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,vI=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,yI=/^\s*\|(.+\|)+\s*$/m,bI=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,xI=/^\s*\|(.+\|)+\s*$/m,SI=e=>lI.test(e)||uI.test(e)||dI.test(e)||fI.test(e)||pI.test(e)||mI.test(e)||hI.test(e)||gI.test(e)||_I.test(e)||vI.test(e)||yI.test(e)||bI.test(e)||xI.test(e);function CI(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData(`text/plain`);if(!r||!n.nodes.codeBlock)return!1;let i=e.clipboardData.getData(`vscode-editor-data`),a=(i?JSON.parse(i):void 0)?.mode;return a?(t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g,`
|
|
518
|
-
`)}</code></pre>`),!0):!1}function wI({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData(`text/plain`);if(n)return t.pasteText(n),!0}let i;for(let t of rI)if(e.clipboardData.types.includes(t)){i=t;break}if(!i)return!0;if(i===`vscode-editor-data`){if(CI(e,t.prosemirrorView))return!0;i=`text/plain`}if(i===`Files`)return sI(e,t),!0;let a=e.clipboardData.getData(i);if(i===`blocknote/html`)return t.pasteHTML(a,!0),!0;if(i===`text/markdown`)return t.pasteMarkdown(a),!0;if(n){let n=e.clipboardData.getData(`text/plain`);if(SI(n))return t.pasteMarkdown(n),!0}return i===`text/html`?(t.pasteHTML(a),!0):r?(t.pasteMarkdown(a),!0):(t.pasteText(a),!0)}var TI=(e,t)=>Ut.create({name:`pasteFromClipboard`,addProseMirrorPlugins(){return[new Lr({props:{handleDOMEvents:{paste(n,r){if(r.preventDefault(),e.isEditable)return t({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>wI({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]}});function EI(e,t,n){let r=!1,i=e.state.selection instanceof Tw;if(!i){let n=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,i=[];for(let e=0;e<n.childCount;e++)i.push(n.child(e));r=i.find(e=>e.type.isInGroup(`bnBlock`)||e.type.name===`blockGroup`||e.type.spec.group===`blockContent`)===void 0,r&&(t=n)}let a,o=nj(e.state.schema,n);if(i){t.firstChild?.type.name===`table`&&(t=t.firstChild.content);let e=fD(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=`<table>${o.exportInlineContent(e,{})}</table>`}else if(r){let e=pD(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=o.exportInlineContent(e,{})}else{let e=hj(t);a=o.exportBlocks(e,{})}return a}function DI(e,t){`node`in e.state.selection&&e.state.selection.node.type.spec.group===`blockContent`&&t.transact(t=>t.setSelection(new Ir(t.doc.resolve(e.state.selection.from-1))));let n=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,r=e.state.selection.content().content,i=EI(e,r,t),{$from:a,$to:o}=e.state.selection,s=a.parent.type.name,c=t.schema.blockSpecs[s];return{clipboardHTML:n,externalHTML:i,markdown:a.sameParent(o)&&c?.implementation.meta.code===!0?e.state.doc.textBetween(a.pos,o.pos):$M(i)}}var OI=e=>{if(e.state.selection.empty)return!0;let t=window.getSelection();if(t&&!t.isCollapsed){let e=t.focusNode;for(;e;){if(e instanceof HTMLElement&&e.getAttribute(`contenteditable`)===`false`)return!0;e=e.parentElement}}return!1},kI=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=DI(t,e);n.clipboardData.setData(`blocknote/html`,r),n.clipboardData.setData(`text/html`,i),n.clipboardData.setData(`text/plain`,a)},AI=e=>Ut.create({name:`copyToClipboard`,addProseMirrorPlugins(){return[new Lr({props:{handleDOMEvents:{copy(t,n){return OI(t)||kI(e,t,n),!0},cut(t,n){return OI(t)||(kI(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection())),!0},dragstart(t,n){if(!(`node`in t.state.selection)||t.state.selection.node.type.spec.group!==`blockContent`)return;e.transact(e=>e.setSelection(new Ir(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=DI(t,e);return n.dataTransfer.setData(`blocknote/html`,r),n.dataTransfer.setData(`text/html`,i),n.dataTransfer.setData(`text/plain`,a),!0}}}})]}}),jI=Ut.create({name:`blockBackgroundColor`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{backgroundColor:JO()}}]}}),MI=zt.create({name:`hardBreak`,inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,an(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
519
|
-
`}});function NI(e,t){return e.contentKind===`inline`&&t.contentKind===`inline`?t.content.node.content:void 0}function PI(e,t,n,r){if(!n.children)return!1;let i=NI(n,r);if(i===void 0||i.size>0&&!n.content.node.type.validContent(n.content.node.content.append(i)))return!1;if(t){let a=e.tr;n.children.node.childCount===1&&!r.children?a.delete(n.children.beforePos,n.children.afterPos):a.replaceWith(r.block.beforePos,r.block.afterPos,r.children?.node.content??Cr.empty);let o=n.contentEnd;i.size>0&&a.insert(o,i),a.setSelection(Nr.near(a.doc.resolve(o),-1)),t(a.scrollIntoView())}return!0}var FI=e=>({state:t,dispatch:n})=>{let r=oE(t.doc,e);if(!r.hasContent)return!1;let i=uE(t.doc,r.block.beforePos);if(!i){let e=lE(t.doc,r.block.beforePos);return e?.hasContent?PI(t,n,e,r):!1}let a=fE(i);if(!a.hasContent||NI(a,r)===void 0)return!1;if(a.isContentEmpty&&a.content.node.sameMarkup(r.content.node)){if(n){let e=t.tr.delete(r.block.beforePos,r.block.afterPos).replaceWith(a.block.beforePos,a.block.afterPos,r.block.node);e.setSelection(Or.create(e.doc,a.contentStart)),n(e.scrollIntoView())}return!0}if(n&&r.children){let e=t.doc.resolve(r.children.childrenStart).blockRange(t.doc.resolve(r.children.childrenEnd));if(!e)throw Error(`Children of a block are expected to form a block range`);t.tr.lift(e,t.doc.resolve(r.block.beforePos).depth)}return n&&n(t.tr.delete(a.contentEnd,r.contentStart)),!0},II=(e,t,n,r)=>({state:i,dispatch:a})=>!a||LI(i.tr,e,t,n,r),LI=(e,t,n,r,i)=>{let a=iE(e.doc,t),o=aE(a.node,a.posBeforeNode);if(!o.hasContent)return!1;let s=rD(e),c=[{type:o.block.node.type,attrs:r?{...o.block.node.attrs,id:void 0}:{}},{type:n?o.content.node.type:s.nodes.paragraph,attrs:r?{...o.content.node.attrs}:{}}],l=i&&t!==o.contentStart?o.children:void 0;if(l&&e.delete(l.beforePos,l.afterPos),e.split(t,2,c),l){let t=e.doc.nodeAt(o.block.beforePos);if(!t?.firstChild)throw Error(`Split lost its original block`);e.insert(o.block.beforePos+1+t.firstChild.nodeSize,l.node)}return!0};function RI(e,t,n){let r=gE(e.doc,t.beforePos);e.delete(t.beforePos,t.afterPos);let i=e.mapping.map(n);e.insert(i,t.node);let a=e.steps.length;JN(e,r),e.setSelection(Or.near(e.doc.resolve(e.mapping.slice(a).map(i)+1)))}function zI(e,t,n,r=n.block){return e.insertContentAt(n.block.afterPos,n.children?.node.content||Cr.empty).deleteRange({from:r.beforePos,to:r.afterPos}).insertContentAt(t.contentEnd,NI(t,n)??null).setTextSelection(t.contentEnd).scrollIntoView().run()}var BI=Ut.create({priority:50,addKeyboardShortcuts(){let e=this.options.editor;function t(t,n){let r=hD(t,n);return e.schema.blockSpecs[r.type].implementation.keyboard(r)}function n(e){return n=>t(n,e).childrenCanOutdent}let r=()=>this.editor.commands.first(({chain:e,commands:r})=>[()=>r.deleteSelection(),()=>r.undoInputRule(),()=>r.command(({state:e})=>{let n=cE(e);if(!n.hasContent||e.selection.from!==n.contentStart)return!1;let i=t(n.block.node,e.doc).resetsTo,a=n.content.node;return a.type.name===i.type&&Object.entries(i.props??{}).every(([e,t])=>a.attrs[e]===t)?!1:r.command(XN(n.block.beforePos,i))}),()=>r.command(({state:t})=>{let n=cE(t);if(!n.hasContent)return!1;let{block:r}=n,i=uE(t.doc,n.block.beforePos);if(i&&!i.hasContent)return!1;let a=t.selection.from===n.contentStart,o=t.selection.empty,s=r.beforePos;return a&&o?e().command(FI(s)).scrollIntoView().run():!1}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=cE(e);if(!r.hasContent||e.selection.from!==r.contentStart)return!1;let i=r.block.node.type,a=uE(t.doc,r.block.beforePos),o;if(a){if(a.hasContent)return!1}else{let e=t.doc.resolve(r.block.beforePos);if(!HT(e.parent.type))return!1;let n=t.doc.resolve(e.before()),s=n.nodeBefore;HT(n.parent.type)&&s&&HT(s.type)?a=aE(s,n.pos-s.nodeSize):o=hE(t.doc,n.pos,i)}return a&&(o=pE(t.doc,a,`last-child`,i)?.pos),o!==void 0&&(n&&RI(t,r.block,o),!0)}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=cE(e);if(!r.hasContent||!e.selection.empty||r.contentKind!==`inline`||!r.isContentEmpty)return!1;let i=uE(e.doc,r.block.beforePos),a=i?void 0:lE(e.doc,r.block.beforePos),o=i?fE(i):a;return o?.hasContent?(n&&(a?.children?.node.childCount===1&&!r.children?t.delete(a.children.beforePos,a.children.afterPos):t.replaceWith(r.block.beforePos,r.block.afterPos,r.children?.node.content??Cr.empty),t.setSelection(o.contentKind===`none`?Ir.create(t.doc,o.content.beforePos):Or.near(t.doc.resolve(o.contentEnd),-1)),t.scrollIntoView()),!0):!1}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=cE(e);if(!r.hasContent)return!1;let i=e.selection.from===r.contentStart,a=e.selection.empty,o=uE(e.doc,r.block.beforePos);if(o&&i&&a){let e=fE(o);if(!e.hasContent)return!1;if(e.contentKind===`none`||e.contentKind===`inline`&&e.isContentEmpty)return n&&(t.delete(r.block.beforePos,r.block.afterPos),t.replaceWith(e.block.beforePos,e.block.afterPos,r.block.node),t.setSelection(Or.near(t.doc.resolve(e.block.beforePos+2))),t.scrollIntoView()),!0}return!1}),()=>r.command(({state:e,tr:t})=>{let r=cE(e);return!r.hasContent||!e.selection.empty||e.selection.from!==r.contentStart?!1:zP(t,t.doc.type.schema.nodes.blockContainer,t.doc.type.schema.nodes.blockGroup,n(t.doc))})]),i=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.command(({state:t})=>{let n=cE(t);if(!n.hasContent||!n.children)return!1;let{children:r}=n;if(r.node.childCount===0)return!1;let i=t.selection.from===n.contentEnd,a=t.selection.empty,o=oE(t.doc,r.childrenStart);return o.hasContent&&i&&a?zI(e(),n,o,r.node.childCount===1?r:o.block):!1}),()=>t.command(({state:t})=>{let n=cE(t);if(!n.hasContent)return!1;let{block:r}=n,i=dE(t.doc,n.block.beforePos);if(!i||!i.hasContent)return!1;let a=t.selection.from===n.contentEnd,o=t.selection.empty,s=r.afterPos;return a&&o?e().command(FI(s)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=cE(e);if(!r.hasContent||e.selection.from!==r.contentEnd)return!1;let i=t.doc.resolve(r.block.afterPos);for(;!i.nodeAfter&&i.depth>0&&HT(i.parent.type);)i=t.doc.resolve(i.after());let a=i.nodeAfter;if(!a||i.pos===r.block.afterPos&&!HT(a.type))return!1;let o=mE(aE(a,i.pos));return o?(n&&RI(t,o.block,r.block.afterPos),!0):!1}),()=>t.command(({state:t})=>{let n=cE(t);if(!n.hasContent)return!1;let r=t.selection.from===n.contentEnd,i=t.selection.empty;if(r&&i){let r,i=n;for(;i&&(r=dE(t.doc,i.block.beforePos),!r);)i=lE(t.doc,i.block.beforePos);return!r||!r.hasContent?!1:zI(e(),n,r,r.block)}return!1}),()=>t.command(({state:t})=>{let n=cE(t);if(!n.hasContent)return!1;if(n.isContentEmpty&&n.contentKind===`inline`){let r=dE(t.doc,n.block.beforePos);if(!r||!r.hasContent)return!1;let i=e();return i.command(({tr:e})=>(e.setSelection($T(e.doc,r,`start`)),!0)),i.deleteRange({from:n.block.beforePos,to:n.block.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=cE(t);if(!n.hasContent)return!1;let r=t.selection.from===n.contentEnd,i=t.selection.empty,a=dE(t.doc,n.block.beforePos);return!a||!a.hasContent?!1:a&&r&&i&&(a.contentKind===`none`||a.contentKind===`inline`&&a.isContentEmpty)?e().deleteRange({from:a.block.beforePos,to:a.block.afterPos}).insertContentAt(n.block.afterPos,a.children?.node.content??null).run():!1})]),a=(e=!1)=>this.editor.commands.first(({commands:r,tr:i})=>[()=>r.command(({state:e})=>{let n=cE(e);if(!n.hasContent||!e.selection.empty||!n.isContentEmpty)return!1;let i=t(n.block.node,e.doc);return i.emptyEnterResets?r.command(XN(n.block.beforePos,i.resetsTo)):!1}),()=>r.command(({state:e,tr:r})=>{let i=cE(e);if(!i.hasContent)return!1;let{block:a}=i,{depth:o}=e.doc.resolve(a.beforePos),s=e.selection.$anchor.parentOffset===0,c=e.selection.anchor===e.selection.head,l=i.isContentEmpty;if(s&&c&&l&&o>1){let i=lE(e.doc,a.beforePos);return i&&t(i.block.node,e.doc).emptyChildEnter!==`outdent`?!1:zP(r,r.doc.type.schema.nodes.blockContainer,r.doc.type.schema.nodes.blockGroup,n(r.doc))}return!1}),()=>r.command(({state:n})=>{let r=cE(n),a=this.options.editor.schema.blockSpecs[r.blockNoteType],o=t(r.block.node,n.doc);if(o.enter===`line-break`||e&&o.shiftEnter===`line-break`){if(a?.config?.content===`plain`)return i.insertText(`
|
|
520
|
-
`,i.selection.head),!0;let e=i.storedMarks||i.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return i.insert(i.selection.head,i.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=cE(e);if(!i.hasContent)return!1;let a=e.selection.anchor===e.selection.head,o=i.isContentEmpty;if(!a||!o)return!1;let s=n.doc.resolve(i.block.beforePos);if(n.doc.resolve(i.block.afterPos).nodeAfter!==null)return!1;let c=lE(n.doc,i.block.beforePos);if(!c||t(c.block.node,n.doc).emptyChildEnter!==`exit-at-end`||s.index()===0&&c.hasContent)return!1;let l=hE(n.doc,c.block.afterPos,e.schema.nodes.blockContainer,`after`);return l!==void 0&&(r&&(RI(n,i.block,l),n.scrollIntoView()),!0)}),()=>r.command(({state:e,dispatch:n,tr:r})=>{let i=cE(e);if(!i.hasContent)return!1;let{block:a}=i,o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=i.isContentEmpty;if(o&&s&&c&&t(i.block.node,e.doc).enter!==`into-children`){let t=a.afterPos,o=t+2;if(n){let n=e.schema.nodes.blockContainer.createAndFill(void 0,[e.schema.nodes.paragraph.createAndFill()||void 0,i.children?.node].filter(e=>e!==void 0));r.insert(t,n).setSelection(new Or(r.doc.resolve(o))).scrollIntoView(),i.children&&r.delete(i.children.beforePos,i.children.afterPos)}return!0}return!1}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=cE(e);if(!i.hasContent||i.contentKind===`table`||!e.selection.empty||i.isContentEmpty||e.selection.from!==i.contentStart)return!1;if(r){let r=t(i.block.node,e.doc).splitKeepsType?i.content.node.type:e.schema.nodes.paragraph,a=e.schema.nodes.blockContainer.create(void 0,r.create());n.insert(i.block.beforePos,a).scrollIntoView()}return!0}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=cE(e);if(!i.hasContent||t(i.block.node,e.doc).enter!==`into-children`||!e.selection.empty||e.selection.from<i.contentStart||e.selection.from>i.contentEnd)return!1;if(r){let t=i.content.node.cut(e.selection.from-i.contentStart),r=e.schema.nodes.blockContainer.create(void 0,e.schema.nodes.paragraph.create(void 0,t.content));n.delete(e.selection.from,i.contentEnd);let a=oE(n.doc,i.block.beforePos).children,o=a?a.childrenStart:n.mapping.map(i.content.afterPos);n.insert(o,a?r:e.schema.nodes.blockGroup.create(void 0,r)).setSelection(new Or(n.doc.resolve(o+(a?2:3)))).scrollIntoView()}return!0}),()=>r.command(({state:e,chain:n})=>{let r=cE(e);if(!r.hasContent)return!1;let i=e.selection.$anchor.parentOffset===0;if(!r.isContentEmpty){let a=t(r.block.node,e.doc),o=i||a.splitKeepsType;return n().deleteSelection().command(II(e.selection.from,o,i,a.splitKeepsChildren)).scrollIntoView().run(),!0}return!1})]),o=this.options;function s(e){let{editor:t,tabBehavior:n}=o;return n!==`prefer-indent`&&(t.getExtension(pA)?.store.state||t.getExtension(ZO)?.store.state!==void 0)?!1:e?VP(t):LP(t)}return{Backspace:r,Delete:i,Enter:()=>a(),"Shift-Enter":()=>a(!0),Tab:()=>s(!1),"Shift-Tab":()=>s(!0),"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo(),"Mod-a":()=>{let e=this.editor.view,{doc:t,selection:n,tr:r}=e.state,i=Or.between(Nr.atStart(t).$from,Nr.atEnd(t).$to);if(this.options.selectAllBehavior===`document`)return e.dispatch(r.setSelection(i)),!0;let a,o=cE(e.state);if(o.hasContent){let e=o.contentStart,n=o.contentEnd,r=Or.between(t.resolve(e),t.resolve(n));!r.empty&&r.from>=e&&r.to<=n&&(a=r)}let s=!a||n.from<a.from||n.to>a.to||n.from===a.from&&n.to===a.to;return a&&!s?r.setSelection(a).scrollIntoView():r.setSelection(i),e.dispatch(r),!0}}}}),VI=Ut.create({name:`textAlignment`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{textAlignment:{default:`left`,parseHTML:e=>e.getAttribute(`data-text-alignment`),renderHTML:e=>e.textAlignment===`left`?{}:{"data-text-alignment":e.textAlignment}}}}]}}),HI=Ut.create({name:`blockTextColor`,addGlobalAttributes(){return[{types:[`table`,`tableCell`,`tableHeader`],attributes:{textColor:YO()}}]}}),UI=`[\0- \xA0 -\u2029 ]`,WI=new RegExp(UI),GI=RegExp(`${UI}$`),KI=new RegExp(UI,`g`);function qI(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function JI(e){return new Lr({key:new Dr(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(vE(_E(n.doc,t)).forEach(({newRange:t})=>{let n=Mt(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!GI.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(WI).filter(Boolean);if(t.length<=0)return;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return;let c=mM(n,e.defaultProtocol);if(!qI(c))return;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Wt(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function YI(e){return new Lr({key:new Dr(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement&&r.target.getAttribute(`data-inline-content-type`)===`link`)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.tiptapEditor.view.dom;i=t.closest(`a[data-inline-content-type="link"]`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;if(e.onClick){if(!e.editor)throw Error(`BlockNoteEditor not found in Link click handler`);return e.onClick(r,e.editor)??!0}let a=mn(t.state,e.type.name),o=i.href??a.href,s=i.target??a.target;return o?(window.open(o,s),!0):!1}}})}function XI(e){return new Lr({key:new Dr(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i,isValidLink:a}=e,{state:o}=t,{selection:s}=o,{empty:c}=s;if(c)return!1;let l=``;r.content.forEach(e=>{l+=e.textContent});let u=pM(l,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!l||!u||!a(u.value)||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}var ZI=`https`,QI=/^(?:(?:http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))/i;function $I(e){if(!e)return!0;let t=e.replace(KI,``);return QI.test(t)}function eL(e){let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}var tL=At.create({name:`link`,keepOnSplit:!1,exitable:!0,inclusive:!1,addOptions(){return{HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,className:`bn-inline-content-section`,"data-inline-content-type":`link`},editor:void 0,onClick:void 0,isValidLink:$I}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}}}},parseHTML(){let e=this.options.isValidLink;return[{tag:`a[href]`,getAttrs:t=>{let n=t.getAttribute(`href`);return!n||!e(n)?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isValidLink(e.href)?[`a`,an(e,this.options.HTMLAttributes),0]:[`a`,an({...e,href:``},this.options.HTMLAttributes),0]},addPasteRules(){let e=this.options.isValidLink;return[ln({find:t=>{let n=[];if(t){let r=pM(t,{defaultProtocol:ZI}).filter(t=>t.isLink&&e(t.value));for(let e of r)eL(e.value)&&n.push({text:e.value,data:{href:e.href},index:e.start})}return n},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[];return e.push(JI({type:this.type,defaultProtocol:ZI,validate:this.options.isValidLink,shouldAutoLink:eL})),e.push(YI({type:this.type,tiptapEditor:this.editor,editor:this.options.editor,onClick:this.options.onClick})),e.push(XI({editor:this.editor,defaultProtocol:ZI,type:this.type,shouldAutoLink:eL,isValidLink:this.options.isValidLink})),e}}),nL=QC(({editor:e,options:t})=>({key:`link`,tiptapExtensions:[tL.configure({HTMLAttributes:t.HTMLAttributes??{},editor:e,onClick:t.onClick,...t.isValidLink?{isValidLink:t.isValidLink}:{}})]})),rL=zt.create({name:`blockGroup`,group:BT,content:`blockGroupChild+`,marks(){return qE(this.editor)},parseHTML(){return[{tag:`div`,getAttrs:e=>typeof e!=`string`&&e.getAttribute(`data-node-type`)===`blockGroup`&&null}]},renderHTML({HTMLAttributes:e}){let t={...this.options.domAttributes?.blockGroup||{},...e},n=document.createElement(`div`);n.className=zE(`bn-block-group`,t.class),n.setAttribute(`data-node-type`,`blockGroup`);for(let[e,r]of Object.entries(t))e!==`class`&&n.setAttribute(e,r);return{dom:n,contentDOM:n}}}),iL=zt.create({name:`doc`,topNode:!0,content:`blockGroup`,marks(){return qE(this.editor)}});function aL(e,t){return[Bt.ClipboardTextSerializer,Bt.Commands,Bt.Editable,Bt.FocusEvents,Bt.Tabindex,BN,EE.configure({types:[`blockContainer`,...Object.values(e.schema.blockSpecs).filter(e=>e.config.layoutOnly===!0).map(e=>e.config.type)],setIdAttribute:t.setIdAttribute,isWithinEditor:e.isWithinEditor}),MI,Qt,...Object.values(e.schema.styleSpecs).map(t=>t.implementation.mark.configure({editor:e})),HI,jI,VI,Ut.create({name:`OverrideEscape`,addKeyboardShortcuts:()=>({Escape:()=>!e.getExtension(vA)?.shown()&&(e.blur(),!0)})}),iL,dP.configure({editor:e,domAttributes:t.domAttributes}),BI.configure({editor:e,tabBehavior:t.tabBehavior,selectAllBehavior:t.selectAllBehavior??`block-first`}),rL.configure({domAttributes:t.domAttributes}),...Object.values(e.schema.inlineContentSpecs).filter(e=>e.config!==`link`&&e.config!==`text`).map(t=>t.implementation.node.configure({editor:e})),...Object.values(e.schema.blockSpecs).flatMap(n=>[...`node`in n.implementation?[n.implementation.node.configure({editor:e,domAttributes:t.domAttributes})]:[]]),AI(e),TI(e,t.pasteHandler||(e=>e.defaultPasteHandler())),cI(e)]}function oL(e,t){let n=[lj(),vj(t),ZO(t),pA(t),nL({HTMLAttributes:t.links?.HTMLAttributes??{},onClick:t.links?.onClick,...t.links?.isValidLink?{isValidLink:t.links.isValidLink}:{}}),Cj(t),Dj(),kj(t),Fj({editable:t._tiptapOptions?.editable}),jA(t),uN(t),dN(),fN(),vA(t),yj(),Sj(),Aj(),...t.trailingBlock===!1?[]:[PN()]];return`table`in e.schema.blockSpecs&&n.push(AN(t)),t.animations!==!1&&n.push(Nj()),n}var sL=class{editor;options;disabledExtensions=new Set;extensions=[];abortMap=new Map;extensionFactories=new Map;extensionPlugins=new Map;runtimeExtensions=new Set;blockNoteExtensionDependents=new Map;constructor(e,t){this.editor=e,this.options=t,e.onMount(()=>{for(let e of this.extensions)this.mountExtension(e)}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]);for(let e of oL(this.editor,this.options))this.addExtension(e);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}mountExtension(e){if(!e.mount||this.abortMap.has(e))return;let t=new window.AbortController;this.abortMap.set(e,t);let n=e.mount({dom:this.editor.prosemirrorView.dom,root:this.editor.prosemirrorView.root,signal:t.signal});n&&(t.signal.aborted?n():t.signal.addEventListener(`abort`,n,{once:!0}))}registerExtension(e){this.replaceExtension(void 0,e)}addExtension(e,t){let n;if(n=typeof e==`function`?e({editor:this.editor}):e,!n||this.disabledExtensions.has(n.key))return;if(t){let e=this.blockNoteExtensionDependents.get(n.key);e||(e=new Set,this.blockNoteExtensionDependents.set(n.key,e)),e.add(t)}if(this.extensions.some(e=>e.key===n.key))return;let r=n[ZC];if(typeof r==`function`&&this.extensionFactories.set(r,n),this.extensions.push(n),n.blockNoteExtensions)for(let e of n.blockNoteExtensions)this.addExtension(e,n.key);return n}resolveExtensions(e){let t=[];if(typeof e==`function`){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if(typeof e==`object`&&`key`in e)t.push(e);else if(typeof e==`string`){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){let t=[...new Set(this.resolveExtensions(e))].filter(e=>this.extensions.includes(e));return t.length&&this.replaceExtension(t,[]),Array.isArray(e)?t:t[0]}replaceExtension(e,t,n){let r=this.resolveExtensions(e);e&&!r.length&&console.warn(`No extensions found to unregister`,e);let i=!1,a=new Set,o=new Set;for(let t of r)this.extensions=this.extensions.filter(e=>e!==t),this.extensionFactories.forEach((e,n)=>{e===t&&this.extensionFactories.delete(n)}),this.abortMap.get(t)?.abort(),this.abortMap.delete(t),this.extensionPlugins.get(t)?.forEach(e=>{a.add(e);let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;typeof n==`string`&&o.add(n)}),this.extensionPlugins.delete(t),this.runtimeExtensions.delete(t),t.tiptapExtensions&&!i&&(i=!0,console.warn(`Extension ${t.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));let s=[].concat(t).filter(Boolean).map(e=>this.addExtension(e)).filter(Boolean),c=[];for(let e of s)this.runtimeExtensions.add(e),e?.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),e?.inputRules?.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{c.push(e)});if((a.size||o.size||c.length||n?.resetPluginStateFor.length)&&this.updatePlugins(e=>[...e.filter(e=>{if(a.has(e))return!1;if(o.size){let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;if(typeof n==`string`&&o.has(n))return!1}return!0}),...c],n?.resetPluginStateFor),!this.editor.headless)for(let e of s)this.mountExtension(e)}updatePlugins(e,t){let n=this.editor.prosemirrorState,r=new Set(t),i=(r.size?n.reconfigure({plugins:n.plugins.filter(e=>!e.spec.key||!r.has(e.spec.key))}):n).reconfigure({plugins:e(n.plugins.slice())});this.editor.prosemirrorView.updateState(i)}getTiptapExtensions(){let e=aL(this.editor,this.options).filter(e=>!this.disabledExtensions.has(e.name)),t=gO(this.extensions.map(e=>{let t=this.blockNoteExtensionDependents.get(e.key);return t?.size?{key:e.key,runsBefore:[...e.runsBefore??[],...t]}:e})),n=new Map;for(let r of this.extensions){r.tiptapExtensions&&e.push(...r.tiptapExtensions);let i=t(r.key),{plugins:a,inputRules:o}=this.getProsemirrorPluginsFromExtension(r);a.length&&e.push(Ut.create({name:r.key,priority:i,addProseMirrorPlugins:()=>this.runtimeExtensions.has(r)?[]:this.extensionPlugins.get(r)??[]})),o.length&&(n.has(i)||n.set(i,[]),n.get(i).push(...o))}e.push(Ut.create({name:`blocknote-runtime-extensions`,priority:-1/0,addProseMirrorPlugins:()=>this.extensions.filter(e=>this.runtimeExtensions.has(e)).flatMap(e=>this.extensionPlugins.get(e)??[])})),e.push(Ut.create({name:`blocknote-input-rules`,addProseMirrorPlugins(){let e=[];Array.from(n.keys()).sort((e,t)=>e-t).reverse().forEach(t=>{e.push(...n.get(t))});let t=RN({rules:e});return[t,new Lr({props:{handleKeyDown(e,n){if(n.key!==`Enter`||n.shiftKey||n.ctrlKey||n.metaKey||n.altKey)return!1;let{$cursor:r}=e.state.selection;return r?!!t.props.handleTextInput?.call(t,e,r.pos,r.pos,`
|
|
521
|
-
`,()=>e.state.tr.insertText(`
|
|
522
|
-
`,r.pos,r.pos)):!1}}})]}}));for(let t of this.options._tiptapOptions?.extensions??[])e.push(t);return e}getProsemirrorPluginsFromExtension(e){let t=[...e.prosemirrorPlugins??[]],n=[];if(!e.prosemirrorPlugins?.length&&!Object.keys(e.keyboardShortcuts||{}).length&&!e.inputRules?.length)return{plugins:t,inputRules:n};if(this.extensionPlugins.set(e,t),e.inputRules?.length&&n.push(...e.inputRules.map(e=>new FN(e.find,(t,n,r,i)=>{let a=e.replace({match:n,range:{from:r,to:i},editor:this.editor});if(a){let e=t.tr,n=cE(e);return!n.hasContent||this.editor.schema.blockSchema[n.blockNoteType]?.content!==`inline`?null:(e.deleteRange(r,i),ZN(e,n.block.beforePos,a),nI(e,rE(n.block.node,e.doc),`start`),e)}return null},{undoable:!0}))),Object.keys(e.keyboardShortcuts||{}).length){let n,r=wt(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e,t])=>[e,()=>{if(!n)throw Error(`Keyboard shortcut called outside handleKeyDown`);return t({editor:this.editor,event:n})}])));t.push(new Lr({props:{handleKeyDown:(e,t)=>{let i=n;n=t;try{return r(e,t)}finally{n=i}}}}))}return{plugins:t,inputRules:n}}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if(typeof e==`string`)return this.extensions.find(t=>t.key===e)||void 0;if(typeof e==`function`)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return typeof e==`string`?this.extensions.some(t=>t.key===e):typeof e==`object`&&`key`in e?this.extensions.some(t=>t.key===e.key):typeof e==`function`&&this.extensionFactories.has(e)}};function cL(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}function lL(e){if(e.selection.empty||`node`in e.selection)return;let t=e.doc.resolve(iE(e.doc,e.selection.from).posBeforeNode),n=e.doc.resolve(iE(e.doc,e.selection.to).posBeforeNode),r=(n,r)=>{let i=t.posAtIndex(n,r),a=e.doc.resolve(i).nodeAfter;if(!a)throw Error(`Error getting selection - node not found at position ${i}`);return hD(a,e.doc)},i=[],a=t.sharedDepth(n.pos),o=t.index(a),s=n.index(a);if(t.depth>a){i.push(hD(t.nodeAfter,e.doc));for(let e=t.depth;e>a;e--)if(t.node(e).type.isInGroup(`childContainer`)){let n=t.index(e)+1,a=t.node(e).childCount;for(let t=n;t<a;t++)i.push(r(t,e))}}else i.push(r(o,a));for(let e=o+1;e<=s;e++)i.push(r(e,a));if(i.length===0)throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);return{blocks:i}}function uL(e,t,n){let r=typeof t==`string`?t:t.id,i=typeof n==`string`?n:n.id;if(r===i)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${r})`);let a=HA(r,e.doc);if(!a)throw Error(`Block with ID ${r} not found`);let o=HA(i,e.doc);if(!o)throw Error(`Block with ID ${i} not found`);let s=aE(a.node,a.posBeforeNode),c=aE(o.node,o.posBeforeNode),l=QT(s,`start`);if(l===null)throw Error(`Attempting to set selection anchor in block without content (id ${r})`);let u=QT(c,`end`);if(u===null)throw Error(`Attempting to set selection head in block without content (id ${i})`);e.setSelection(Or.create(e.doc,l,u))}function dL(e,t=!1){let n=t?cL(e.doc,e.selection):e.selection,r=n.$from,i=n.$to;for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>0;)i=e.doc.resolve(i.pos+1);for(;i.parentOffset===0&&i.depth>0;)i=e.doc.resolve(i.pos-1);for(;r.parentOffset===0&&r.depth>0;)r=e.doc.resolve(r.pos-1);for(;r.parentOffset>=r.parent.nodeSize-2&&r.depth>0;)r=e.doc.resolve(r.pos+1);let a=_D(e.doc.slice(r.pos,i.pos,!0));return{_meta:{startPos:r.pos,endPos:i.pos},...a}}var fL=class{editor;constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>lL(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>dL(t,e))}setSelection(e,t){return this.editor.transact(n=>uL(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>tI(e))}setTextCursorPosition(e,t=`start`){return this.editor.transact(n=>nI(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if(Dt(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return qt(this.editor.prosemirrorView,n,r).toJSON()}},pL=class{editor;constructor(e){this.editor=e}activeTransaction=null;can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}isInCan=!1;exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");if(this.isInCan)return this.canExec(e);let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,e=>this.prosemirrorView.dispatch(e),n)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,void 0,n)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){this.prosemirrorView?.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return!1}if(this.editor.headless){let e=this.editor.getExtension(Fj)?.store.state;if(e)return e.isEditable&&e.enabledSet.size===0}return this.editor._tiptapEditor.isEditable===void 0||this.editor._tiptapEditor.isEditable}set isEditable(e){if(this.editor._tiptapEditor)this.editor.getExtension(Fj).setEditable(e);else if(!this.editor.headless)throw Error(`no editor, but also not headless?`)}undo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.undoCommand);throw Error(`No undo plugin found`)}redo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.redoCommand);throw Error(`No redo plugin found`)}};function mL(e,t,n,r={updateSelection:!0}){let{from:i,to:a}=typeof t==`number`?{from:t,to:t}:{from:t.from,to:t.to},o=!0,s=!0,c=``;if(n.forEach(e=>{e.check(),o&&e.isText&&e.marks.length===0?c+=e.text:o=!1,s=s?e.isBlock:!1}),i===a&&s){let{parent:t}=e.doc.resolve(i);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(--i,a+=1)}return o?e.insertText(c,i,a):e.replaceWith(i,a,n),r.updateSelection&&cn(e,e.steps.length-1,-1),!0}var hL=class{editor;constructor(e){this.editor=e}insertInlineContent(e,{updateSelection:t=!1}={}){let n=zO(e,this.editor.pmSchema);this.editor.transact(e=>{mL(e,{from:e.selection.from,to:e.selection.to},n,{updateSelection:t})})}getActiveStyles(){return this.editor.transact(e=>{let t={},n=e.selection.empty&&e.storedMarks||e.selection.$to.marks();for(let e of n){let n=this.editor.schema.styleSchema[e.type.name];n?n.propSchema===`boolean`?t[n.type]=!0:t[n.type]=e.attrs.stringValue:e.type.name!==`link`&&!e.type.spec.blocknoteIgnore&&console.warn(`mark not found in styleschema`,e.type.name)}return t})}addStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.setMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.setMark(t,{stringValue:n});else throw new FE(e.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.toggleMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.toggleMark(t,{stringValue:n});else throw new FE(e.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getLinkMarkAtPos(e){return this.editor.transact(t=>{let n=this.editor.pmSchema.marks.link,r=Nt(t.doc.resolve(e),n);if(!r)return;let i=t.doc.nodeAt(r.from)?.marks.find(e=>e.type===n);if(i)return{href:i.attrs.href,from:r.from,to:r.to,text:t.doc.textBetween(r.from,r.to)}})}getSelectedLinkUrl(){return this.editor.transact(e=>(e.doc.nodeAt(e.selection.from)?.marks.find(e=>e.type.name===`link`))?.attrs.href)}createLink(e,t){e!==``&&this.editor.transact(n=>{let{from:r,to:i}=n.selection,a=this.editor.pmSchema.mark(`link`,{href:e});t?n.insertText(t,r,i).addMark(r,r+t.length,a):n.addMark(r,i,a)})}editLink(e,t,n=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(r=>{let{from:i,to:a}=this.getLinkMarkAtPos(n)||{from:r.selection.from,to:r.selection.to},o=this.editor.pmSchema.mark(`link`,{href:e});t!==r.doc.textBetween(i,a)&&r.insertText(t,i,a),r.addMark(i,i+t.length,o)}),this.editor.prosemirrorView.focus()}deleteLink(e=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(t=>{let{from:n,to:r}=this.getLinkMarkAtPos(e)||{from:t.selection.from,to:t.selection.to};t.removeMark(n,r,this.editor.pmSchema.marks.link).setMeta(`preventAutolink`,!0)}),this.editor.prosemirrorView.focus()}};function gL(e){return It(e.state.selection.$from,e=>e.type.name===`tableCell`||e.type.name===`tableHeader`)!==void 0}function _L(e,t){let n=t.nodes.hardBreak,r=Cr.empty;return e.forEach(e=>{e.isTextblock&&e.childCount>0?(r=r.append(e.content),r=r.addToEnd(n.create())):e.isText?r=r.addToEnd(e):e.isBlock&&e.childCount>0&&(r=r.append(_L(e.content,t)),r=r.addToEnd(n.create()))}),r.lastChild?.type===n&&(r=r.cut(0,r.size-1)),r}function vL(e,t){let n=[];return e.forEach((e,r,i)=>{i!==t&&n.push(e)}),Cr.from(n)}function yL(e,t){let n=[];for(let r=0;r<e.childCount;r++)if(e.child(r).type.name===`tableRow`){if(n.length>0&&n[n.length-1].type.name===`table`){let t=n[n.length-1],i=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=i}else{let i=t.nodes.table.createChecked(void 0,e.child(r));n.push(i)}}else n.push(e.child(r));return e=Cr.from(n),e}function bL(e,t){let n=Cr.from(e.content);n=yL(n,t.state.schema);let r=xL(n,t,e);if(r)return r;let i=t.state.schema.nodes.tableParagraph;if(i&&gL(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup(`tableContent`)&&(e=!0)}),!e&&!i.validContent(n))return new Mr(_L(n,t.state.schema),0,0)}if(!SL(n,t))return new Mr(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if(n.child(e).type.spec.group===`blockContent`){let r=[n.child(e)];if(e+1<n.childCount&&n.child(e+1).type.name===`blockGroup`){let t=n.child(e+1).child(0).child(0);(t.type.name===`bulletListItem`||t.type.name===`numberedListItem`||t.type.name===`checkListItem`)&&(r.push(n.child(e+1)),n=vL(n,e+1))}let i=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,i)}return new Mr(n,e.openStart,e.openEnd)}function xL(e,t,n){if(gL(t)||t.dragging)return null;let r=cE(t.state);if(!r.hasContent||r.content.node.type.name===`paragraph`||r.contentKind!==`inline`||!r.isContentEmpty)return null;let i=r.content.node,a=e.firstChild,o=a?.firstChild,s=o?.firstChild;if(a?.type.name!==`blockGroup`||o?.type.name!==`blockContainer`||s?.type.name!==`paragraph`)return null;let c=i.type.create(i.attrs,s.content),l=o.copy(o.content.replaceChild(0,c)),u=a.copy(a.content.replaceChild(0,l));return new Mr(e.replaceChild(0,u),n.openStart,n.openEnd)}function SL(e,t){let n=e.childCount===1,r=e.firstChild?.type.spec.content===`inline*`,i=e.firstChild?.type.spec.content===`tableRow+`;if(n){if(r)return!1;if(i){let e=cE(t.state);if(e.hasContent)return e.contentKind!==`table`}}return!0}var CL={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},wL=class e extends CP{options;pmSchema;_tiptapEditor;elementRenderer=null;blockCache=new WeakMap;dictionary;schema;blockImplementations;inlineContentImplementations;styleImplementations;uploadFile;onUploadStartCallbacks=[];onUploadEndCallbacks=[];resolveFileUrl;settings;static create(t){return new e(t??{})}constructor(e){super(),this.options=e,this.dictionary=e.dictionary||iy,this.settings={tables:{splitCells:e?.tables?.splitCells??!1,cellBackgroundColor:e?.tables?.cellBackgroundColor??!1,cellTextColor:e?.tables?.cellTextColor??!1,headers:e?.tables?.headers??!1}};let t={defaultStyles:!0,schema:e.schema||kA.create(),...e,placeholders:{...this.dictionary.placeholders,...e.placeholders}};if(this.schema=t.schema,this.blockImplementations=t.schema.blockSpecs,this.inlineContentImplementations=t.schema.inlineContentSpecs,this.styleImplementations=t.schema.styleSpecs,t.uploadFile){let e=t.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=t.resolveFileUrl,this._eventManager=new YP(this),this._extensionManager=new sL(this,t);let n=this._extensionManager.getTiptapExtensions(),r={...CL,...t._tiptapOptions,editable:!0,element:null,autofocus:t.autofocus??!1,extensions:n,editorProps:{scrollMargin:{top:72,bottom:72,left:0,right:0},...t._tiptapOptions?.editorProps,attributes:{tabIndex:`0`,...t._tiptapOptions?.editorProps?.attributes,...t.domAttributes?.editor,class:zE(`bn-editor`,t.defaultStyles?`bn-default-styles`:``,t.domAttributes?.editor?.class||``)},transformPasted:bL}};try{let e=t.initialContent||[{type:`paragraph`,id:EE.options.generateID()}];if(!Array.isArray(e)||e.length===0)throw Error(`initialContent must be a non-empty array of blocks, received: `+JSON.stringify(e));let n=Ft(r.extensions);n.cached.blockNoteEditor=this;let i=e.map(e=>UO(e,n,this.schema.styleSchema).toJSON()),a=Rt({type:`doc`,content:[{type:`blockGroup`,content:i}]},n,r.parseOptions);a.check(),this._tiptapEditor=new pn({...r,content:a.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}this.pmSchema.cached.blockNoteEditor=this,this._tiptapEditor.on(`mount`,()=>{this.headless=!1}),this._tiptapEditor.on(`unmount`,()=>{this.headless=!0}),this._tiptapEditor.on(`destroy`,()=>{this.emit(`destroy`)}),this._blockManager=new JP(this),this._exportManager=new eI(this),this._selectionManager=new fL(this),this._stateManager=new pL(this),this._styleManager=new hL(this),this.emit(`create`)}_blockManager;_eventManager;_exportManager;_extensionManager;_selectionManager;_stateManager;_styleManager;get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}unregisterExtension(e){return this._extensionManager.unregisterExtension(e)}registerExtension=(...e)=>this._extensionManager.registerExtension(...e);replaceExtension=(...e)=>this._extensionManager.replaceExtension(...e);getExtension=(e=>this._extensionManager.getExtension(e));mount=e=>{this._tiptapEditor.mount({mount:e}),this._tiptapEditor.isEditorContentInitialized=!0};unmount=()=>{this._tiptapEditor.isEditorContentInitialized=!1,this._tiptapEditor.unmount()};get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}_portalElements=new Map;registerPortalElement=e=>{this._portalElements.set(e,(this._portalElements.get(e)??0)+1)};unregisterPortalElement=e=>{let t=this._portalElements.get(e);t!==void 0&&(t<=1?this._portalElements.delete(e):this._portalElements.set(e,t-1))};isWithinEditor=e=>{if(this.domElement?.parentElement?.contains(e))return!0;for(let t of this._portalElements.keys())if(t.contains(e))return!0;return!1};isFocused(e){if(this.headless)return!1;let t=this.prosemirrorView?.hasFocus()||!1;if(!e?.includeEditorUI)return t;let n=typeof document<`u`?document.activeElement:null;return t||!!n&&this.isWithinEditor(n)}headless=!0;focus(){this.headless||this.prosemirrorView.focus()}blur(){this.headless||this.domElement?.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on(`update`,e)}onEditorSelectionChange(e){this._tiptapEditor.on(`selectionUpdate`,e)}onBeforeChange(e){return this._extensionManager.getExtension(lj).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t=`start`){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n=`before`){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}getLinkMarkAtPos(e){return this._styleManager.getLinkMarkAtPos(e)}editLink(e,t,n){this._styleManager.editLink(e,t,n)}deleteLink(e){this._styleManager.deleteLink(e)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(e){return this._blockManager.moveBlocksUp(e)}moveBlocksDown(e){return this._blockManager.moveBlocksDown(e)}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onFocusChange(e,t){return this._eventManager.onFocusChange(e,t)}onMount(e){return this._eventManager.onMount(e)}onUnmount(e){return this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return e.length===0||e.length===1&&e[0].type===`paragraph`&&e[0].content.length===0}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}};function TL(e,t){let n=(t?.editor??ky()).getExtension(e);if(!n)throw Error(`Extension not found`,{cause:{plugin:e}});return n}function EL(e,t){let{store:n}=TL(e,t);if(!n)throw Error(`Store not found on plugin`,{cause:{plugin:e}});return Ay(n,t?.selector)}function DL(e){let t=new DOMRect,n=`getBoundingClientRect`in e?()=>e.getBoundingClientRect():()=>e.element.getBoundingClientRect();return()=>e.element&&(e.cacheMountedBoundingClientRect??!0)?(e.element.isConnected&&(t=n()),t):n()}function OL(e,t){return e?t?(n,r,i)=>{let a=e(n,r,i),o=t(n,r,i);return()=>{a?.(),o?.()}}:e:t}var kL=e=>{let t=ky(),n=Vy(),{whileElementsMounted:r,middleware:i,...a}=e.useFloatingOptions??{},{refs:o,floatingStyles:s,context:c,middlewareData:l}=jC({whileElementsMounted:OL(P,e.useFloatingOptions?.whileElementsMounted),middleware:[...i??[],k()],...a}),{isMounted:u,styles:d}=RC(c,e.useTransitionStylesProps),{status:f}=LC(c,e.useTransitionStatusProps),{getFloatingProps:p}=NC([kC(c,e.useDismissProps),KS(c,{enabled:!1,...e.useHoverProps})]),m=(0,R.useRef)(``),h=(0,R.useRef)(null),g=bS([h,o.setFloating]);if((0,R.useEffect)(()=>{if(e.reference){let n=`element`in e.reference?e.reference.element:void 0;n!==void 0&&(e.focusManagerProps?.disabled||!t.isWithinEditor(n))&&o.setReference(n);let r=`getClientRects`in e.reference?e.reference.getClientRects:n?()=>n.getClientRects():void 0;o.setPositionReference({getBoundingClientRect:DL(e.reference),...r?{getClientRects:r}:{},contextElement:n})}},[e.reference,o,e.focusManagerProps?.disabled,t]),(0,R.useEffect)(()=>{(f===`initial`||f===`open`)&&h.current&&Jy(h.current)&&(m.current=h.current.innerHTML)},[f,e.reference,e.children]),!u||!n)return!1;let _={...e.elementProps,style:{display:`flex`,...e.elementProps?.style,zIndex:`calc(var(--bn-ui-base-z-index, 0) + ${e.elementProps?.style?.zIndex||0})`,...s,...d,...l.hide?.referenceHidden?{visibility:`hidden`}:{}},...p()};return f===`close`?(0,z.jsx)(mC,{root:n,children:(0,z.jsx)(`div`,{ref:g,..._,dangerouslySetInnerHTML:{__html:m.current}})}):e.focusManagerProps?.disabled?(0,z.jsx)(mC,{root:n,children:(0,z.jsx)(`div`,{ref:g,..._,children:(0,z.jsx)(Yy,{children:e.children})})}):(0,z.jsx)(mC,{root:n,children:(0,z.jsx)(TC,{...e.focusManagerProps,context:c,children:(0,z.jsx)(`div`,{ref:g,..._,children:(0,z.jsx)(Yy,{children:e.children})})})})},AL=e=>{let{position:t,children:n,...r}=e,{from:i,to:a}=t||{},o=ky(),s=Iy(),c=(0,R.useMemo)(()=>{if(i!==void 0&&a!==void 0)return{element:s?.firstElementChild||void 0,getBoundingClientRect:()=>qt(o.prosemirrorView,i,a??i)}},[o,s,i,a]);return(0,z.jsx)(kL,{reference:c,...r,children:t!==void 0&&n})},jL=(e={},t=[])=>(0,R.useMemo)(()=>{let t=wL.create(e);return window&&(window.ProseMirror=t._tiptapEditor),t},t),ML=e=>{let[t,n]=(0,R.useState)(!1),r=Fy({editor:e.editor,selector:({editor:e})=>e.isEmpty}),i=Zy(),a=(0,R.useCallback)(()=>{n(!0)},[]),o=(0,R.useCallback)(()=>{n(!1)},[]);return(0,R.useEffect)(()=>{e.editable&&e.autoFocus&&e.editor.focus()},[e.autoFocus,e.editable,e.editor]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(i.Comments.Editor,{autoFocus:e.autoFocus,className:`bn-comment-editor`,editor:e.editor,onFocus:a,onBlur:o,editable:e.editable}),e.actions&&(0,z.jsx)(`div`,{className:`bn-comment-actions-wrapper`,children:e.actions({isFocused:t,isEmpty:r})})]})},{textColor:NL,backgroundColor:PL,...FL}=EA,IL=kA.create({blockSpecs:{paragraph:Gk()},styleSpecs:FL});function LL(e){return!e.hasUnsavedContent||!e.confirmBeforeDiscard||(e.confirm??(e=>window.confirm(e)))(e.message)}var RL=QC(({editor:e,options:{submitOnEnter:t=!0,onSubmit:n}})=>{let r=!1;async function i(){if(!(!e.isEditable||e.isEmpty||r)){r=!0;try{await n(e)}finally{r=!1}}}function a({event:t}){let n=e.prosemirrorView;return!n.editable||n.composing||t.isComposing||t.keyCode===229?!1:(t.repeat||i(),!0)}return{key:`commentEditorSubmit`,submit:i,runsBefore:[`default`],keyboardShortcuts:{"Mod-Enter":a,...t?{Enter:a}:{}}}}),zL=At.create({name:`comment`,excludes:``,inclusive:!1,keepOnSplit:!0,group:UC,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute(`data-orphan`),renderHTML:e=>e.orphan?{"data-orphan":`true`}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute(`data-bn-thread-id`),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:``}}},renderHTML({HTMLAttributes:e}){return[`span`,an(e,{class:`bn-thread-mark`})]},parseHTML(){return[{tag:`span.bn-thread-mark`}]},extendMarkSchema(e){return e.name===`comment`?{blocknoteIgnore:!0}:{}}}),BL=new Dr(`blocknote-comments`);function VL(e,t){let n=new Map;return e.descendants((e,r)=>{e.marks.forEach(i=>{if(i.type.name===t){let t=i.attrs.threadId;if(!t)return;let a=r,o=a+e.nodeSize,s=n.get(t)??{from:1/0,to:0};n.set(t,{from:Math.min(a,s.from),to:Math.max(o,s.to)})}})}),n}var HL=QC(({editor:e,options:{schema:t,threadStore:n,resolveUsers:r,confirmBeforeDiscard:i=!0,submitOnEnter:a=!0}})=>{if(!r)throw Error(`resolveUsers is required to be defined when using comments`);if(!n)throw Error(`threadStore is required to be defined when using comments`);let o=NA(r),s=zL.name,c=$C({pendingComment:!1,selectedThreadId:void 0,threadPositions:new Map},{onUpdate(t,n){t.selectedThreadId!==n.selectedThreadId&&e.transact(e=>e.setMeta(BL,!0))}}),l=t=>{e.transact(e=>{e.doc.descendants((n,r)=>{n.marks.forEach(i=>{if(i.type.name===s){let a=i.type,o=i.attrs.threadId,s=t.get(o),l=!!(!s||s.resolved||s.deletedAt);if(l!==i.attrs.orphan){let t=Math.max(r,0),s=Math.min(r+n.nodeSize,e.doc.content.size-1,e.doc.content.size-1);e.removeMark(t,s,i),e.addMark(t,s,a.create({...i.attrs,orphan:l})),l&&c.state.selectedThreadId===o&&c.setState(e=>({...e,selectedThreadId:void 0}))}}})})})};return{key:`comments`,store:c,userStore:o,runsBefore:[`link`],tiptapExtensions:[zL],prosemirrorPlugins:[new Lr({key:BL,state:{init(){return{decorations:Fr.empty}},apply(e,t){let n=e.getMeta(BL);if(!e.docChanged&&!n)return t;let r=e.docChanged?VL(e.doc,s):c.state.threadPositions;(r.size>0||c.state.threadPositions.size>0)&&c.setState(e=>({...e,threadPositions:r}));let i=[];if(c.state.selectedThreadId){let e=r.get(c.state.selectedThreadId);e&&i.push(Rr.inline(e.from,e.to,{class:`bn-thread-mark-selected`}))}return{decorations:Fr.create(e.doc,i)}}},props:{decorations(e){return BL.getState(e)?.decorations??Fr.empty},handleClick:(e,t,n)=>{if(n.button!==0)return!1;let r=e.state.doc.nodeAt(t);if(!r)return c.setState(e=>({...e,selectedThreadId:void 0})),!1;let i=r.marks.find(e=>e.type.name===s&&e.attrs.orphan!==!0);if(!i)return c.state.selectedThreadId!==void 0&&c.setState(e=>({...e,selectedThreadId:void 0})),!1;let a=i.attrs.threadId;return a!==c.state.selectedThreadId&&(c.setState(e=>({...e,selectedThreadId:a})),!0)}}})],threadStore:n,mount(){let t=n.subscribe(l);l(n.getThreads());let r=e.onSelectionChange(()=>{c.state.pendingComment&&c.setState(e=>({...e,pendingComment:!1}))});return()=>{t(),r()}},selectThread(t,n=!0){if(c.state.selectedThreadId!==t&&(c.setState(e=>({...e,pendingComment:!1,selectedThreadId:t})),t&&n)){let n=c.state.threadPositions.get(t);if(!n)return;(e.prosemirrorView?.domAtPos(n.from).node)?.scrollIntoView({behavior:`smooth`,block:`center`})}},startPendingComment(){c.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!0})),e.domElement?.focus(),e.getExtension(jA)?.showSelection(!0,`comments`)},stopPendingComment(){c.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!1})),e.getExtension(jA)?.showSelection(!1,`comments`)},async createThread(t){let r=await n.createThread(t);n.addThreadToDocument?await n.addThreadToDocument({threadId:r.id,selection:e.transact(e=>e.selection),editor:e}):e._tiptapEditor.commands.setMark(s,{orphan:!1,threadId:r.id})},commentEditorSchema:t,confirmBeforeDiscard:i,submitOnEnter:a}}),UL=Yn(),WL=Object.defineProperty,GL=(e,t)=>{let n={};for(var r in e)WL(n,r,{get:e[r],enumerable:!0});return t||WL(n,Symbol.toStringTag,{value:`Module`}),n},KL=e=>{let{blockId:t,children:n,...r}=e,i=ky(),a=(0,R.useMemo)(()=>i.transact(e=>{if(!t)return;let n=HA(t,e.doc);if(!n)return;let r=KA(i.prosemirrorView,n.posBeforeNode,t);return r?{element:r}:void 0}),[i,t]);return(0,z.jsx)(kL,{reference:a,...r,children:t!==void 0&&n})},qL=e=>{let t=Zy(),n=Qy(),r=ky(),i=r.getBlock(e.blockId),[a,o]=(0,R.useState)(``),s=(0,R.useCallback)(e=>{o(e.currentTarget.value)},[]),c=(0,R.useCallback)(()=>{r.getBlock(e.blockId)&&r.updateBlock(e.blockId,{props:{name:ZE(a),url:a}})},[r,e.blockId,a]);return i?(0,z.jsx)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:(0,z.jsx)(t.Generic.Form.Root,{onSubmit:c,submitButton:(0,z.jsx)(t.FilePanel.Button,{className:`bn-button`,type:`submit`,"data-test":`embed-input-button`,children:n.file_panel.embed.embed_button[i.type]||n.file_panel.embed.embed_button.file}),children:(0,z.jsx)(t.FilePanel.TextInput,{className:`bn-text-input`,placeholder:n.file_panel.embed.url_placeholder,value:a,onChange:s,"data-test":`embed-input`})})}):null},JL=e=>{let t=Zy(),n=Qy(),{setLoading:r}=e,i=ky(),a=i.getBlock(e.blockId),[o,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{o&&setTimeout(()=>{s(!1)},3e3)},[o]);let c=(0,R.useCallback)(t=>{if(t===null)return;async function n(t){if(r(!0),i.uploadFile!==void 0)try{let n=await i.uploadFile(t,e.blockId);if(!i.getBlock(e.blockId))return;typeof n==`string`&&(n={props:{name:t.name,url:n}}),i.updateBlock(e.blockId,n)}catch{s(!0)}finally{r(!1)}}n(t)},[e.blockId,i,r]);if(!a)return null;let l=i.schema.blockSpecs[a.type],u=l.implementation.meta.fileBlockAccept?.length?l.implementation.meta.fileBlockAccept.join(`,`):`*/*`;return(0,z.jsxs)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,z.jsx)(t.FilePanel.FileInput,{className:`bn-file-input`,"data-test":`upload-input`,accept:u,placeholder:n.file_panel.upload.file_placeholder[a.type]||n.file_panel.upload.file_placeholder.file,value:null,onChange:c}),o&&(0,z.jsx)(`div`,{className:`bn-error-text`,children:n.file_panel.upload.upload_error})]})},YL=e=>{let t=Zy(),n=Qy(),r=ky(),[i,a]=(0,R.useState)(!1),o=e.tabs??[...r.uploadFile===void 0?[]:[{name:n.file_panel.upload.title,tabPanel:(0,z.jsx)(JL,{blockId:e.blockId,setLoading:a})}],{name:n.file_panel.embed.title,tabPanel:(0,z.jsx)(qL,{blockId:e.blockId})}],[s,c]=(0,R.useState)(e.defaultOpenTab||o[0].name);return(0,z.jsx)(t.FilePanel.Root,{className:`bn-panel`,defaultOpenTab:s,openTab:s,setOpenTab:c,tabs:o,loading:i})},XL=e=>{let t=ky(),n=TL(ZO),r=EL(ZO),i=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{e||n.closeMenu(),i===`escape-key`&&t.focus()},middleware:[A(10),ie()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:90},...e.floatingUIOptions?.elementProps}}),[r,t,n,e.floatingUIOptions]),a=e.filePanel||YL;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(KL,{blockId:r,...i,children:r&&(0,z.jsx)(a,{blockId:r})})})},ZL={bold:$b,italic:Vb,underline:kb,strike:Mb,code:ix};function QL(e,t){return e in t.schema.styleSchema&&t.schema.styleSchema[e].type===e&&t.schema.styleSchema[e].propSchema===`boolean`}var $L=e=>{let t=Qy(),n=Zy(),r=ky(),i=Fy({editor:r,selector:({editor:t})=>{if(t.isEditable&&QL(e.basicTextStyle,t)&&(t.getSelection()?.blocks||[t.getTextCursorPosition().block]).find(e=>e.content!==void 0))return e.basicTextStyle in t.getActiveStyles()?{active:!0}:{active:!1}}}),a=(0,R.useCallback)(e=>{r.focus(),r.toggleStyles({[e]:!0})},[r]);if(i===void 0)return null;let o=ZL[e.basicTextStyle];return(0,z.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":e.basicTextStyle,onClick:()=>a(e.basicTextStyle),isSelected:i.active,label:t.formatting_toolbar[e.basicTextStyle].tooltip,mainTooltip:t.formatting_toolbar[e.basicTextStyle].tooltip,secondaryTooltip:RE(t.formatting_toolbar[e.basicTextStyle].secondary_tooltip,t.generic.ctrl_shortcut),icon:(0,z.jsx)(o,{})})},eR=(0,R.createContext)(`desktop`);function tR(){return(0,R.useContext)(eR)}var nR=e=>{let t=e.textColor||`default`,n=e.backgroundColor||`default`,r=e.size||16,i=(0,R.useMemo)(()=>({pointerEvents:`none`,fontSize:(r*.75).toString()+`px`,height:r.toString()+`px`,lineHeight:r.toString()+`px`,textAlign:`center`,width:r.toString()+`px`}),[r]);return(0,z.jsx)(`div`,{className:`bn-color-icon`,"data-background-color":n,"data-text-color":t,style:i,children:`A`})},rR=[`default`,`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`],iR=e=>{let t=Zy(),n=Qy();return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(()=>e.text?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(t.Generic.Menu.Label,{children:n.color_picker.text_title}),rR.map(r=>(0,z.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick?.(),e.text.setColor(r)},"data-test":`text-color-`+r,icon:(0,z.jsx)(nR,{textColor:r,size:e.iconSize}),checked:e.text.color===r,children:n.color_picker.colors[r]},`text-color-`+r))]}):null,{}),(0,z.jsx)(()=>e.background?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(t.Generic.Menu.Label,{children:n.color_picker.background_title}),rR.map(r=>(0,z.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick?.(),e.background.setColor(r)},"data-test":`background-color-`+r,icon:(0,z.jsx)(nR,{backgroundColor:r,size:e.iconSize}),checked:e.background.color===r,children:n.color_picker.colors[r]},`background-color-`+r))]}):null,{})]})};function aR(e,t){return`${e}Color`in t.schema.styleSchema&&t.schema.styleSchema[`${e}Color`].type===`${e}Color`&&t.schema.styleSchema[`${e}Color`].propSchema===`string`}var oR=()=>{let e=Zy(),t=Qy(),n=tR(),r=Vy(),i=ky(),a=aR(`text`,i),o=aR(`background`,i),s=Fy({editor:i,selector:({editor:e})=>{if(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return;let t=aR(`text`,e),n=aR(`background`,e);if(t||n)return{textColor:t?e.getActiveStyles().textColor||`default`:void 0,backgroundColor:n?e.getActiveStyles().backgroundColor||`default`:void 0}}}),c=(0,R.useCallback)(e=>{if(!a)throw Error(`Tried to set text color, but style does not exist in editor schema.`);e==="default"?i.removeStyles({textColor:e}):i.addStyles({textColor:e}),i.focus()},[i,a]),l=(0,R.useCallback)(e=>{if(!o)throw Error(`Tried to set background color, but style does not exist in editor schema.`);e==="default"?i.removeStyles({backgroundColor:e}):i.addStyles({backgroundColor:e}),i.focus()},[o,i]);return s===void 0?null:(0,z.jsxs)(e.Generic.Menu.Root,{portalElement:r,preventFocusOnOpen:n===`mobile`,children:[(0,z.jsx)(e.Generic.Menu.Trigger,{children:(0,z.jsx)(e.FormattingToolbar.Button,{className:`bn-button`,"data-test":`colors`,label:t.formatting_toolbar.colors.tooltip,mainTooltip:t.formatting_toolbar.colors.tooltip,icon:(0,z.jsx)(nR,{textColor:s.textColor,backgroundColor:s.backgroundColor,size:20})})}),(0,z.jsx)(e.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,z.jsx)(iR,{text:s.textColor?{color:s.textColor,setColor:c}:void 0,background:s.backgroundColor?{color:s.backgroundColor,setColor:l}:void 0})})]})};function sR(){let e=Qy();return(0,z.jsx)(`button`,{className:`bn-screen-reader-only-submit`,tabIndex:-1,type:`submit`,children:e.generic.form_submit})}var cR=e=>{for(let t of wj)if(e.startsWith(t))return e;return`${Tj}://${e}`},lR=e=>{let t=Zy(),n=Qy(),{editLink:r}=TL(Cj),{url:i,text:a,showTextField:o}=e,[s,c]=(0,R.useState)(i),[l,u]=(0,R.useState)(a);(0,R.useEffect)(()=>{c(i),u(a)},[a,i]);let d=(0,R.useCallback)(e=>c(e.currentTarget.value),[]),f=(0,R.useCallback)(e=>u(e.currentTarget.value),[]),p=(0,R.useCallback)(()=>{r(cR(s),l,e.range.from),e.setToolbarOpen?.(!1),e.setToolbarPositionFrozen?.(!1)},[r,s,l,e]);return(0,z.jsxs)(t.Generic.Form.Root,{onSubmit:p,submitButton:(0,z.jsx)(sR,{}),children:[(0,z.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`url`,icon:(0,z.jsx)(zb,{}),autoFocus:!0,placeholder:n.link_toolbar.form.url_placeholder,value:s,onChange:d}),o!==!1&&(0,z.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`title`,icon:(0,z.jsx)(Ab,{}),placeholder:n.link_toolbar.form.title_placeholder,value:l,onChange:f})]})};function uR(e){return`link`in e.schema.inlineContentSchema&&e.schema.inlineContentSchema.link===`link`}var dR=()=>{let e=ky(),t=Iy(),n=Zy(),r=Qy(),i=Vy(),a=TL(pA),{showSelection:o}=TL(jA),[s,c]=(0,R.useState)(!1);(0,R.useEffect)(()=>(o(s,`createLinkButton`),()=>o(!1,`createLinkButton`)),[s,o]);let l=(0,R.useCallback)(t=>{t||e.focus(),c(t)},[e]),u=Fy({editor:e,selector:({editor:e})=>{if(e.isEditable&&!e.prosemirrorState.selection.empty&&uR(e)&&!cA(e.prosemirrorState.selection)&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{url:e.getSelectedLinkUrl(),text:e.getSelectedText(),range:{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}}}});return(0,R.useEffect)(()=>{c(!1)},[u]),(0,R.useEffect)(()=>{let n=t=>{e.isEditable&&(t.ctrlKey||t.metaKey)&&t.key===`k`&&(c(!0),t.preventDefault())};return t?.addEventListener(`keydown`,n),()=>{t?.removeEventListener(`keydown`,n)}},[e,t]),u===void 0?null:(0,z.jsxs)(n.Generic.Popover.Root,{open:s,onOpenChange:l,portalElement:i,children:[(0,z.jsx)(n.Generic.Popover.Trigger,{children:(0,z.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":`createLink`,label:r.formatting_toolbar.link.tooltip,mainTooltip:r.formatting_toolbar.link.tooltip,secondaryTooltip:RE(r.formatting_toolbar.link.secondary_tooltip,r.generic.ctrl_shortcut),icon:(0,z.jsx)(zb,{}),onClick:()=>l(!s)})}),(0,z.jsx)(n.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,z.jsx)(lR,{url:u.url||``,text:u.text,range:u.range,showTextField:!1,setToolbarOpen:e=>a.store.setState(e)})})]})},fR=()=>{let e=Qy(),t=Zy(),n=Vy(),r=ky(),i=Fy({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(sA(n,e,n.type,{url:`string`,caption:`string`}))return n}}),[a,o]=(0,R.useState)(!1),s=(0,R.useCallback)(e=>{e||r.focus(),o(e)},[r]),c=(0,R.useCallback)(e=>{i!==void 0&&oA(r,i.type,{caption:`string`})&&r.updateBlock(i.id,{props:{caption:e.currentTarget.value}})},[i,r]);return i===void 0?null:(0,z.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:s,portalElement:n,children:[(0,z.jsx)(t.Generic.Popover.Trigger,{children:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_caption.tooltip,mainTooltip:e.formatting_toolbar.file_caption.tooltip,icon:(0,z.jsx)(Hb,{}),onClick:()=>s(!a)})}),(0,z.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,z.jsx)(t.Generic.Form.Root,{onSubmit:()=>s(!1),submitButton:(0,z.jsx)(sR,{}),children:(0,z.jsx)(t.Generic.Form.TextInput,{name:`file-caption`,icon:(0,z.jsx)(Hb,{}),value:i.props.caption,autoFocus:!0,placeholder:e.formatting_toolbar.file_caption.input_placeholder,onChange:c})})})]})},pR=()=>{let e=Qy(),t=Zy(),n=ky(),r=Fy({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(sA(n,e,n.type,{url:`string`}))return n}}),i=(0,R.useCallback)(()=>{r!==void 0&&(n.focus(),n.removeBlocks([r.id]))},[r,n]);return r===void 0?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,mainTooltip:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,icon:(0,z.jsx)(bb,{}),onClick:i})},mR=()=>{let e=Qy(),t=Zy(),n=Vy(),r=ky(),i=Fy({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(sA(n,e,n.type,{url:`string`,name:`string`}))return n}}),[a,o]=(0,R.useState)(!1),s=(0,R.useCallback)(e=>{e||r.focus(),o(e)},[r]),c=(0,R.useCallback)(e=>{i!==void 0&&oA(r,i.type,{name:`string`})&&r.updateBlock(i.id,{props:{name:e.currentTarget.value}})},[i,r]);return i===void 0?null:(0,z.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:s,portalElement:n,children:[(0,z.jsx)(t.Generic.Popover.Trigger,{children:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_rename.tooltip[i.type]||e.formatting_toolbar.file_rename.tooltip.file,mainTooltip:e.formatting_toolbar.file_rename.tooltip[i.type]||e.formatting_toolbar.file_rename.tooltip.file,icon:(0,z.jsx)(Zb,{}),onClick:()=>s(!a)})}),(0,z.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,z.jsx)(t.Generic.Form.Root,{onSubmit:()=>s(!1),submitButton:(0,z.jsx)(sR,{}),children:(0,z.jsx)(t.Generic.Form.TextInput,{name:`file-name`,icon:(0,z.jsx)(Zb,{}),value:i.props.name,autoFocus:!0,placeholder:e.formatting_toolbar.file_rename.input_placeholder[i.type]||e.formatting_toolbar.file_rename.input_placeholder.file,onChange:c})})})]})},hR=()=>{let e=Qy(),t=Zy(),n=Vy(),r=ky(),i=Fy({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(sA(n,e,n.type,{url:`string`}))return n}});return i===void 0?null:(0,z.jsxs)(t.Generic.Popover.Root,{onOpenChange:e=>{e||r.focus()},portalElement:n,children:[(0,z.jsx)(t.Generic.Popover.Trigger,{children:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,mainTooltip:e.formatting_toolbar.file_replace.tooltip[i.type]||e.formatting_toolbar.file_replace.tooltip.file,label:e.formatting_toolbar.file_replace.tooltip[i.type]||e.formatting_toolbar.file_replace.tooltip.file,icon:(0,z.jsx)(Tb,{})})}),(0,z.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-panel-popover`,variant:`panel-popover`,children:(0,z.jsx)(YL,{blockId:i.id})})]})},gR=()=>{let e=Qy(),t=Zy(),n=ky(),r=Fy({editor:n,selector:({editor:e})=>{if(e.isEditable&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{canNestBlock:e.canNestBlock()}}}),i=(0,R.useCallback)(()=>{r!==void 0&&r.canNestBlock&&(n.focus(),n.nestBlock())},[n,r]);return r===void 0?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`nestBlock`,onClick:i,isDisabled:!r.canNestBlock,label:e.formatting_toolbar.nest.tooltip,mainTooltip:e.formatting_toolbar.nest.tooltip,secondaryTooltip:RE(e.formatting_toolbar.nest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,z.jsx)(Ub,{})})},_R=()=>{let e=Qy(),t=Zy(),n=ky(),r=Fy({editor:n,selector:({editor:e})=>{if(e.isEditable&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{canUnnestBlock:e.canUnnestBlock()}}}),i=(0,R.useCallback)(()=>{r!==void 0&&r.canUnnestBlock&&(n.focus(),n.unnestBlock())},[n,r]);return r===void 0?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`unnestBlock`,onClick:i,isDisabled:!r.canUnnestBlock,label:e.formatting_toolbar.unnest.tooltip,mainTooltip:e.formatting_toolbar.unnest.tooltip,secondaryTooltip:RE(e.formatting_toolbar.unnest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,z.jsx)(Wb,{})})},vR={paragraph:Ab,heading:Xb,heading_2:Yb,heading_3:Jb,heading_4:qb,heading_5:Kb,heading_6:Gb,toggle_heading:Xb,toggle_heading_2:Yb,toggle_heading_3:Jb,quote:Nb,toggle_list:wb,bullet_list:Ib,numbered_list:Lb,check_list:Rb},yR=e=>fA(e).map(({key:t,type:n,props:r})=>({name:e.dictionary.slash_menu[t].title,type:n,props:r,icon:vR[t]})),bR=e=>{let t=Zy(),n=tR(),r=Vy(),i=ky(),a=Fy({editor:i,selector:({editor:e})=>e.getSelection()?.blocks||[e.getTextCursorPosition().block]}),o=a[0],s=(0,R.useMemo)(()=>(e.items||yR(i)).filter(e=>oA(i,e.type,Object.fromEntries(Object.entries(e.props||{}).map(([e,t])=>[e,typeof t])))),[i,e.items]),c=(0,R.useMemo)(()=>s.map(e=>{let t=e.icon,n=e.type===o.type,r=Object.entries(e.props||{}).filter(([e,t])=>t!==o.props[e]).length===0;return{text:e.name,icon:(0,z.jsx)(t,{size:16}),onClick:()=>{i.focus(),i.transact(()=>{for(let t of a)i.updateBlock(t,{type:e.type,props:e.props})})},isSelected:n&&r}}),[i,s,o.props,o.type,a]);return!(0,R.useMemo)(()=>c.find(e=>e.isSelected)!==void 0,[c])||!i.isEditable?null:(0,z.jsx)(t.FormattingToolbar.Select,{className:`bn-select`,items:c,portalElement:r,preventFocusOnOpen:n===`mobile`})},xR=()=>{let e=Qy(),t=Zy(),n=ky(),r=TL(`comments`),{store:i}=TL(pA),a=Fy({editor:n,selector:({editor:e})=>e.prosemirrorState.selection.empty}),o=(0,R.useCallback)(()=>{r.startPendingComment(),i.setState(!1)},[r,i]);return a?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,z.jsx)(ox,{}),onClick:o})},SR=()=>ky().getExtension(`comments`)?(0,z.jsx)(xR,{}):null,CR=()=>{let e=Qy(),t=Zy(),n=ky(),r=Fy({editor:n,selector:({editor:e})=>e.prosemirrorState.selection.empty}),i=(0,R.useCallback)(()=>{n._tiptapEditor.chain().focus().addPendingComment().run()},[n]);return!n._tiptapEditor.commands.addPendingComment||!n.isEditable||r?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,z.jsx)(ox,{}),onClick:i})};function wR(e,t){try{let n=new URL(e,t);if(n.protocol!==`javascript:`)return n.href}catch{}return`#`}var TR=()=>{let e=Qy(),t=Zy(),n=ky(),r=Fy({editor:n,selector:({editor:e})=>{let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(sA(n,e,n.type,{url:`string`}))return n}}),i=(0,R.useCallback)(()=>{r!==void 0&&(n.focus(),n.resolveFileUrl?n.resolveFileUrl(r.props.url).then(e=>window.open(wR(e,window.location.href))):window.open(wR(r.props.url,window.location.href)))},[r,n]);return r===void 0?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,mainTooltip:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,icon:(0,z.jsx)(vb,{}),onClick:i})},ER=()=>{let e=Qy(),t=Zy(),n=ky(),r=Fy({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(sA(n,e,n.type,{url:`string`,showPreview:`boolean`}))return n}}),i=(0,R.useCallback)(()=>{r!==void 0&&oA(n,r.type,{showPreview:`boolean`})&&n.updateBlock(r.id,{props:{showPreview:!r.props.showPreview}})},[r,n]);return r===void 0?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:`Toggle preview`,mainTooltip:e.formatting_toolbar.file_preview_toggle.tooltip,icon:(0,z.jsx)(Eb,{}),isSelected:r.props.showPreview,onClick:i})},DR=()=>{let e=Qy(),t=Zy(),n=ky(),r=TL(AN),i=Fy({editor:n,selector:({editor:e})=>{if(!e.isEditable||!e.settings.tables.splitCells)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(n.type===`table`)return{mergeDirection:r.getMergeDirection(n)}}}),a=(0,R.useCallback)(()=>{r?.mergeCells()},[r]);return i===void 0?null:(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.table_cell_merge.tooltip,mainTooltip:e.formatting_toolbar.table_cell_merge.tooltip,icon:i.mergeDirection===`horizontal`?(0,z.jsx)(Fb,{}):(0,z.jsx)(Pb,{}),onClick:a})},OR=()=>ky().getExtension(AN)?(0,z.jsx)(DR,{}):null,kR={left:tx,center:rx,right:ex,justify:nx},AR=e=>{let t=Zy(),n=Qy(),r=ky(),i=Fy({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block],n=t[0];if(sA(n,e,n.type,{textAlignment:GO.textAlignment}))return{textAlignment:n.props.textAlignment,blocks:t};if(t.length===1&&sA(n,e,`table`))return e.getExtension(AN)?.getCellSelection()?{textAlignment:AE(n.content.rows[0].cells[0]).props.textAlignment,blocks:[n]}:void 0}}),a=(0,R.useCallback)(e=>{if(i!==void 0){r.focus();for(let t of i.blocks)if(sA(t,r,t.type,{textAlignment:GO.textAlignment})&&oA(r,t.type,{textAlignment:GO.textAlignment}))r.updateBlock(t,{props:{textAlignment:e}});else if(t.type===`table`){let n=r.getExtension(AN)?.getCellSelection();if(!n)continue;let i=t.content.rows.map(e=>({...e,cells:e.cells.map(e=>AE(e))}));n.cells.forEach(({row:t,col:n})=>{i[t].cells[n].props.textAlignment=e}),r.updateBlock(t,{type:`table`,content:{...t.content,type:`tableContent`,rows:i}}),r.setTextCursorPosition(t)}}},[r,i]);if(i===void 0)return null;let o=kR[e.textAlignment];return(0,z.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`alignText${e.textAlignment.slice(0,1).toUpperCase()+e.textAlignment.slice(1)}`,onClick:()=>a(e.textAlignment),isSelected:i.textAlignment===e.textAlignment,label:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,mainTooltip:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,icon:(0,z.jsx)(o,{})})},jR=e=>[(0,z.jsx)(bR,{items:e},`blockTypeSelect`),(0,z.jsx)(OR,{},`tableCellMergeButton`),(0,z.jsx)(fR,{},`fileCaptionButton`),(0,z.jsx)(hR,{},`replaceFileButton`),(0,z.jsx)(mR,{},`fileRenameButton`),(0,z.jsx)(pR,{},`fileDeleteButton`),(0,z.jsx)(TR,{},`fileDownloadButton`),(0,z.jsx)(ER,{},`filePreviewButton`),(0,z.jsx)($L,{basicTextStyle:`bold`},`boldStyleButton`),(0,z.jsx)($L,{basicTextStyle:`italic`},`italicStyleButton`),(0,z.jsx)($L,{basicTextStyle:`underline`},`underlineStyleButton`),(0,z.jsx)($L,{basicTextStyle:`strike`},`strikeStyleButton`),(0,z.jsx)(AR,{textAlignment:`left`},`textAlignLeftButton`),(0,z.jsx)(AR,{textAlignment:`center`},`textAlignCenterButton`),(0,z.jsx)(AR,{textAlignment:`right`},`textAlignRightButton`),(0,z.jsx)(oR,{},`colorStyleButton`),(0,z.jsx)(gR,{},`nestBlockButton`),(0,z.jsx)(_R,{},`unnestBlockButton`),(0,z.jsx)(dR,{},`createLinkButton`),(0,z.jsx)(SR,{},`addCommentButton`),(0,z.jsx)(CR,{},`addTiptapCommentButton`)],MR=e=>{let t=Zy();return(0,z.jsx)(t.FormattingToolbar.Root,{className:`bn-toolbar bn-formatting-toolbar`,children:e.children||jR(e.blockTypeSelectItems)})},NR=e=>{switch(e){case`left`:return`top-start`;case`center`:return`top`;case`right`:return`top-end`;default:return`top-start`}},PR=e=>{let t=ky(),n=TL(pA,{editor:t}),r=EL(pA,{editor:t}),i=Fy({editor:t,selector:({editor:e})=>n.store.state?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=Fy({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block;return sA(t,e,t.type,{textAlignment:GO.textAlignment})?NR(t.props.textAlignment):`top-start`}}),o=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,r,i)=>{n.store.setState(e),i===`escape-key`&&t.focus()},placement:a,middleware:[A(10),j(),ie()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:40},...e.floatingUIOptions?.elementProps}}),[r,a,e.floatingUIOptions,n.store,t]),s=e.formattingToolbar||MR;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(AL,{position:i,...o,children:r&&(0,z.jsx)(s,{})})})};function FR(e,t){let n=Oy(),r=t??n?.editor;if(!r)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);let i=e?.includeEditorUI??!1,a=(0,R.useRef)(void 0);(a.current===void 0||a.current.editor!==r||a.current.includeEditorUI!==i)&&(a.current={editor:r,includeEditorUI:i,value:r.isFocused({includeEditorUI:i})});let o=(0,R.useCallback)(e=>(a.current={editor:r,includeEditorUI:i,value:r.isFocused({includeEditorUI:i})},e(),r.onFocusChange((t,n)=>{a.current={editor:r,includeEditorUI:i,value:n.focused},e()},{includeEditorUI:i})),[r,i]),s=(0,R.useCallback)(()=>a.current.value,[]);return(0,R.useSyncExternalStore)(o,s,s)}var IR=0,LR=0;function RR(){if(typeof window>`u`)return!1;let e=window.visualViewport,t=e?.scale??1,n=(e?.height??window.innerHeight)*t,r=document.documentElement.clientWidth;return Math.abs(r-LR)>LR*.2&&(LR=r,IR=0),IR=Math.max(IR,n),IR-n>150}var zR=[`--bn-vv-top`,`--bn-vv-left`,`--bn-vv-width`,`--bn-vv-height`,`--bn-vv-scale`],BR=0;function VR(){let[e,t]=(0,R.useState)(RR);return(0,R.useLayoutEffect)(()=>{let e=document.documentElement,n=window.visualViewport,r=()=>document.querySelectorAll(`.bn-scroll-container`),i=()=>{e.style.setProperty(`--bn-vv-top`,`${n?.offsetTop??0}px`),e.style.setProperty(`--bn-vv-left`,`${n?.offsetLeft??0}px`),e.style.setProperty(`--bn-vv-width`,`${n?.width??window.innerWidth}px`),e.style.setProperty(`--bn-vv-height`,`${n?.height??window.innerHeight}px`),e.style.setProperty(`--bn-vv-scale`,`${n?.scale??1}`)},a=(e,t)=>e.toggleAttribute(`data-bn-allow-pull-to-refresh`,!t&&e.scrollTop<=0),o=()=>{let e=RR();t(e),i();for(let t of r())a(t,e)};BR++,o(),n?.addEventListener(`resize`,o),n?.addEventListener(`scroll`,o),window.addEventListener(`resize`,o);let s=e=>{e.target instanceof HTMLElement&&e.target.classList.contains(`bn-scroll-container`)&&a(e.target,RR())};return document.addEventListener(`scroll`,s,{capture:!0,passive:!0}),()=>{if(n?.removeEventListener(`resize`,o),n?.removeEventListener(`scroll`,o),window.removeEventListener(`resize`,o),document.removeEventListener(`scroll`,s,{capture:!0}),BR--,BR===0){for(let t of zR)e.style.removeProperty(t);for(let e of r())e.removeAttribute(`data-bn-allow-pull-to-refresh`);IR=0,LR=0}}},[]),e}var HR=e=>{let t=VR(),n=FR({includeEditorUI:!0});if(!t||!n)return null;let r=e.formattingToolbar||MR;return(0,z.jsx)(Wy,{target:document.body,children:(0,z.jsx)(eR.Provider,{value:`mobile`,children:(0,z.jsx)(Yy,{children:(0,z.jsx)(`div`,{className:`bn-mobile-formatting-toolbar`,children:(0,z.jsx)(r,{})})})})})},UR=e=>{let t=VR();return HE()&&t?(0,z.jsx)(HR,{formattingToolbar:e.formattingToolbar}):(0,z.jsx)(PR,{...e})},WR=e=>{let t=Zy(),n=Qy(),{deleteLink:r}=TL(Cj);return(0,z.jsx)(t.LinkToolbar.Button,{className:`bn-button`,label:n.link_toolbar.delete.tooltip,mainTooltip:n.link_toolbar.delete.tooltip,isSelected:!1,onClick:()=>{r(e.range.from),e.setToolbarOpen?.(!1)},icon:(0,z.jsx)(Bb,{})})},GR=e=>{let t=Zy(),n=Vy(),r=Qy();return(0,z.jsxs)(t.Generic.Popover.Root,{onOpenChange:e.setToolbarPositionFrozen,portalElement:n,children:[(0,z.jsx)(t.Generic.Popover.Trigger,{children:(0,z.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:r.link_toolbar.edit.tooltip,isSelected:!1,children:r.link_toolbar.edit.text})}),(0,z.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,z.jsx)(lR,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen})})]})},KR=e=>{let t=Zy(),n=Qy();return(0,z.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.open.tooltip,label:n.link_toolbar.open.tooltip,isSelected:!1,onClick:()=>{window.open(wR(e.url,window.location.href),`_blank`)},icon:(0,z.jsx)(_b,{})})},qR=e=>{let t=Zy();return(0,z.jsx)(t.LinkToolbar.Root,{className:`bn-toolbar bn-link-toolbar`,children:e.children||(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(GR,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen}),(0,z.jsx)(KR,{url:e.url}),(0,z.jsx)(WR,{range:e.range,setToolbarOpen:e.setToolbarOpen})]})})},JR=e=>{let t=ky(),n=Fy({editor:t,selector:({editor:e})=>e?.isEditable??!1}),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(!1),s=Iy(),c=TL(Cj),[l,u]=(0,R.useState)(void 0);(0,R.useEffect)(()=>{if(!n){u(void 0),i(!1);return}let e=()=>{let e=c.getLinkAtSelection();e?(u({cursorType:`text`,url:e.mark.attrs.href,text:e.text,range:e.range,element:c.getLinkElementAtPos(e.range.from)}),a||i(!0)):(u(void 0),a||i(!1))},r=e=>{if(l!==void 0&&l.cursorType===`text`||!(e.target instanceof HTMLElement))return;let t=c.getLinkAtElement(e.target);t&&u({cursorType:`mouse`,url:t.mark.attrs.href,text:t.text,range:t.range,element:c.getLinkElementAtPos(t.range.from)})},o=t.onChange(e),d=t.onSelectionChange(e);return s?.addEventListener(`mouseover`,r),()=>{o(),d(),s?.removeEventListener(`mouseover`,r)}},[t,s,n,c,l,a]);let d=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,n,r)=>{a||(l===void 0||l.cursorType!==`text`||r!==`hover`)&&(r===`escape-key`&&t.focus(),i(e))},placement:`top-start`,middleware:[A(10),ie()],...e.floatingUIOptions?.useFloatingOptions},useHoverProps:{enabled:l!==void 0&&l.cursorType===`mouse`,delay:{open:250,close:250},handleClose:HC(),...e.floatingUIOptions?.useHoverProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:50},...e.floatingUIOptions?.elementProps}}),[t,l,e.floatingUIOptions,r,a]),f=(0,R.useMemo)(()=>l?.element?{element:l.element}:void 0,[l?.element]);if(!n)return null;let p=e.linkToolbar||qR;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(kL,{reference:f,...d,children:l&&(0,z.jsx)(p,{url:l.url,text:l.text,range:l.range,setToolbarOpen:i,setToolbarPositionFrozen:o})})})};function YR(e){return db({tag:`svg`,attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z`},child:[]},{tag:`path`,attr:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z`},child:[]}]})(e)}var XR=()=>{let e=Zy(),t=Qy(),n=ky(),r=TL(vA),i=EL(uN,{editor:n,selector:e=>e?.block}),a=(0,R.useCallback)(()=>{if(i===void 0)return;let e=i.content;if(e!==void 0&&Array.isArray(e)&&e.length===0)n.setTextCursorPosition(i),r.openSuggestionMenu(`/`);else{let e=n.insertBlocks([{type:`paragraph`}],i,`after`)[0];n.setTextCursorPosition(e),r.openSuggestionMenu(`/`)}},[i,n,r]);return i===void 0?null:(0,z.jsx)(e.SideMenu.Button,{className:`bn-button`,label:t.side_menu.add_block_label,icon:(0,z.jsx)(YR,{size:24,onClick:a,"data-test":`dragHandleAdd`})})};function ZR(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m7 10 5 5 5-5z`},child:[]}]})(e)}function QR(e){return db({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`},child:[]}]})(e)}var $R=e=>{let t=Zy(),n=Vy(),r=ky(),i=EL(uN,{editor:r,selector:e=>e?.block});return i===void 0||!sA(i,r,i.type,{textColor:`string`})&&!sA(i,r,i.type,{backgroundColor:`string`})?null:(0,z.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,z.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children})}),(0,z.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,z.jsx)(iR,{iconSize:18,text:sA(i,r,i.type,{textColor:`string`})&&oA(r,i.type,{textColor:`string`})?{color:i.props.textColor,setColor:e=>r.updateBlock(i,{type:i.type,props:{textColor:e}})}:void 0,background:sA(i,r,i.type,{backgroundColor:`string`})&&oA(r,i.type,{backgroundColor:`string`})?{color:i.props.backgroundColor,setColor:e=>r.updateBlock(i,{props:{backgroundColor:e}})}:void 0})})]})},ez=e=>{let t=Zy(),n=ky(),r=EL(uN,{editor:n,selector:e=>e?.block});return r===void 0?null:(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{let e=n.getSelection()?.blocks,t=e&&e.some(e=>e.id===r.id)?e:[r];n.removeBlocks(t)},children:e.children})},tz=e=>{let t=Zy(),n=ky(),r=EL(uN,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerRows;return(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerRows:i?void 0:1}})},children:e.children})},nz=e=>{let t=Zy(),n=ky(),r=EL(uN,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerCols;return(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerCols:i?void 0:1}})},children:e.children})},rz=e=>{let t=Zy(),n=Qy();return(0,z.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-drag-handle-menu`,children:e.children||(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ez,{children:n.drag_handle.delete_menuitem}),(0,z.jsx)($R,{children:n.drag_handle.colors_menuitem}),(0,z.jsx)(tz,{children:n.drag_handle.header_row_menuitem}),(0,z.jsx)(nz,{children:n.drag_handle.header_column_menuitem})]})})},iz=e=>{let t=Zy(),n=Vy(),r=Qy(),i=TL(uN),a=EL(uN,{selector:e=>e?.block});if(a===void 0)return null;let o=e.dragHandleMenu||rz;return(0,z.jsxs)(t.Generic.Menu.Root,{onOpenChange:e=>{e?i.freezeMenu():i.unfreezeMenu()},position:`left`,portalElement:n,children:[(0,z.jsx)(t.Generic.Menu.Trigger,{children:(0,z.jsx)(t.SideMenu.Button,{label:r.side_menu.drag_handle_label,draggable:!0,onDragStart:e=>i.blockDragStart(e,a),onDragEnd:i.blockDragEnd,className:`bn-button`,icon:(0,z.jsx)(QR,{size:24,"data-test":`dragHandle`})})}),(0,z.jsx)(o,{children:e.children})]})},az=e=>{let t=Zy();return(0,z.jsx)(t.SideMenu.Root,{className:`bn-side-menu`,children:e.children||(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(XR,{}),(0,z.jsx)(iz,{dragHandleMenu:e.dragHandleMenu})]})})};function oz(e,t){if(t.type===`heading`)switch(t.props.level){case 1:return 39;case 2:return 27;case 3:return 18.5;default:return 0}return e.schema.blockSpecs[t.type]?.implementation.meta?.fileBlockAccept&&!t.props.url?12:t.type===`file`?4:t.type===`audio`||t.type===`table`?15:0}var sz=e=>{let t=ky(),{show:n,block:r}=EL(uN,{selector:e=>e===void 0?void 0:{show:e.show,block:e.block}})||{},i=(0,R.useCallback)((e,n,r)=>{let i=t.getExtension(uN);i?.setMenuElement(n);let a=!1,o=P(e,n,()=>{a?i?.hideMenuIfNotFrozen():a=!0},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1});return()=>{o(),i?.setMenuElement(void 0)}},[t]),a=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,placement:`left-start`,middleware:[A({crossAxis:r?oz(t,r):0})],whileElementsMounted:i,...e.floatingUIOptions?.useFloatingOptions},useDismissProps:{enabled:!1,...e.floatingUIOptions?.useDismissProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:20},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,n,r,t,i]),o=e.sideMenu||az;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(KL,{blockId:n?r?.id:void 0,...a,children:r?.id&&(0,z.jsx)(o,{})})})},cz=({format:e,dictionary:t})=>{let n=t.suggestion_changes.formatting_change;if(e.length===0)return n;let r=t.formatting_toolbar,i=[];for(let t of e){if(t===`link`)return n;let e=r[t],a=e&&typeof e==`object`&&`tooltip`in e?e.tooltip:void 0;if(typeof a!=`string`)return n;i.push(a)}return i.join(`, `)},lz=e=>{let t=Zy(),n=Qy(),r=(0,R.useMemo)(()=>{let t=n.suggestion_changes,r=e.formatChangeLabel??cz,i=e.users.join(`, `);if(e.modificationType===`insert`)return i?t.inserted_by(i):t.inserted;if(e.modificationType===`delete`)return i?t.deleted_by(i):t.deleted;if(e.modificationType===`change`)return i?t.changed_by(i):t.changed;if(e.modificationType===`attrs`)return i?`${t.formatting_change}: ${i}`:t.formatting_change;let a=e.format?r({format:e.format,dictionary:n}):``;return!a||a===t.formatting_change?i?`${t.formatting_change}: ${i}`:t.formatting_change:i?t.formatting_change_by(a,i):`${t.formatting_change} (${a})`},[n,e]);return(0,z.jsx)(t.AttributionTooltip.Root,{className:`bn-suggestion-tooltip`,markClassName:e.className,backgroundColor:e.className?void 0:e.color,children:r})};function uz(e){let t=e.firstElementChild??e,n=t.getBoundingClientRect();return n.width||n.height?t:t.firstElementChild??t}function dz(e,t){let{anchor:n,reference:r,...i}=e;return{...i,formatChangeLabel:t}}var fz=e=>{let t=EL(`attribution`,{selector:e=>e}),n=(0,R.useMemo)(()=>t?{element:t.reference??uz(t.anchor)}:void 0,[t]),r=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!t,placement:`top-start`,middleware:[te(),A(4),ie(),j({padding:4})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:1e4,pointerEvents:`none`},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,t]),i=e.attributionTooltip||lz,a=t?dz(t,e.formatChangeLabel):void 0;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(kL,{reference:n,...r,children:a&&(0,z.jsx)(i,{...a})})})},pz=10,mz=10,hz=600,gz=300,_z={name:`placeBelowUnlessCramped`,async fn(e){let{rects:t,placement:n,platform:r}=e,i={...t.floating,height:gz},a=await r.detectOverflow({...e,rects:{...t,floating:i},y:t.reference.y+t.reference.height+pz},{padding:mz}),o=`bottom-start`;return a.bottom>0&&(await r.detectOverflow({...e,rects:{...t,floating:i},y:t.reference.y-pz-gz},{padding:mz})).top<a.bottom&&(o=`top-start`),o===n?{}:{reset:{placement:o}}}};function vz(e){let t=e.getBoundingClientRect().width;t>=(parseFloat(e.style.minWidth)||0)+1&&(e.style.minWidth=`${Math.ceil(t)}px`)}var yz=[_z,A(pz),j(),re({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,Math.min(t,hz))}px`,vz(e.floating)},padding:mz})];async function bz(e,t){return(await xN(e,t)).map(({id:e,onItemClick:t})=>({id:e,onItemClick:t,icon:e}))}function xz(e){let t=Zy(),n=Qy(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o,columns:s}=e,c=i===`loading-initial`||i===`loading`?(0,z.jsx)(t.GridSuggestionMenu.Loader,{className:`bn-grid-suggestion-menu-loader`,columns:s}):null,l=(0,R.useMemo)(()=>{let e=[];for(let n=0;n<r.length;n++){let i=r[n];e.push((0,z.jsx)(t.GridSuggestionMenu.Item,{className:`bn-grid-suggestion-menu-item`,item:i,id:`bn-grid-suggestion-menu-item-${n}`,isSelected:n===a,onClick:()=>o?.(i)},i.id))}return e},[t,r,o,a]);return(0,z.jsxs)(t.GridSuggestionMenu.Root,{id:`bn-grid-suggestion-menu`,columns:s,className:`bn-grid-suggestion-menu`,children:[c,l,l.length===0&&e.loadingState===`loaded`&&(0,z.jsx)(t.GridSuggestionMenu.EmptyItem,{className:`bn-grid-suggestion-menu-empty-item`,columns:s,children:n.suggestion_menu.no_items_title})]})}function Sz(e){return e===void 0?void 0:`bn-suggestion-menu-item-`+e}function Cz(e,t,n,r=3){let i=(0,R.useRef)(0);(0,R.useEffect)(()=>{t!==void 0&&(e.length>0?i.current=t.length:t.length-i.current>r&&n())},[n,r,e.length,t])}function wz(e,t){let[n,r]=(0,R.useState)([]),[i,a]=(0,R.useState)(!1),o=(0,R.useRef)(void 0),s=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{let n=e;o.current=e,a(!0),t(e).then(e=>{o.current===n&&(r(e),a(!1),s.current=n)})},[e,t]),{items:n||[],usedQuery:s.current,loadingState:s.current===void 0?`loading-initial`:i?`loading`:`loaded`}}function Tz(e,t,n,r,i){let a=Iy(e),[o,s]=(0,R.useState)(0);return(0,R.useEffect)(()=>{let e=e=>(e.key===`ArrowLeft`&&(e.preventDefault(),n.length&&s((o-1+n.length)%n.length)),e.key===`ArrowRight`&&(e.preventDefault(),n.length&&s((o+1+n.length)%n.length)),e.key===`ArrowUp`?(e.preventDefault(),n.length&&s((o-r+n.length)%n.length),!0):e.key===`ArrowDown`?(e.preventDefault(),n.length&&s((o+r)%n.length),!0):e.key===`Enter`&&!e.isComposing&&(e.stopPropagation(),e.preventDefault(),n.length&&i?.(n[o]),!0));return a?.addEventListener(`keydown`,e,!0),()=>{a?.removeEventListener(`keydown`,e,!0)}},[a,n,o,i,r,r!==void 0&&r>1]),(0,R.useEffect)(()=>{s(0)},[t]),{selectedIndex:n.length===0?void 0:o}}function Ez(e){let t=Oy().setContentEditableProps,n=ky(),{getItems:r,gridSuggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c,columns:l}=e,u=(0,R.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:d,usedQuery:f,loadingState:p}=wz(a,r);Cz(d,f,s);let{selectedIndex:m}=Tz(n,a,d,l,u);return(0,R.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,R.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":Sz(m)})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,m]),(0,z.jsx)(i,{items:d,onItemClick:u,loadingState:p,selectedIndex:m,columns:l})}function Dz(e){let t=ky(),n=Iy(),{triggerCharacter:r,gridSuggestionMenuComponent:i,columns:a,shouldOpen:o,minQueryLength:s,onItemClick:c,getItems:l}=e,u=(0,R.useMemo)(()=>c||(e=>{e.onItemClick(t)}),[t,c]),d=(0,R.useMemo)(()=>l||(async e=>await bz(t,e)),[t,l]),f=TL(vA);(0,R.useEffect)(()=>{f.addSuggestionMenu({triggerCharacter:r,shouldOpen:o})},[f,r,o]);let p=EL(vA),m=EL(vA,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),h=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:p?.show&&p?.triggerCharacter===r,onOpenChange:e=>{e||f.closeMenu()},placement:`bottom-start`,middleware:yz,...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:70},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,p?.show,p?.triggerCharacter,f,r]);return!p||!p.ignoreQueryLength&&s&&(p.query.startsWith(` `)||p.query.length<s)?null:(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(kL,{reference:m,...h,children:r&&(0,z.jsx)(Ez,{query:p.query,closeMenu:f.closeMenu,clearQuery:f.clearQuery,getItems:d,columns:a,gridSuggestionMenuComponent:i||xz,onItemClick:u})})})}function Oz(e){let t=Zy(),n=Qy(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o}=e,s=i===`loading-initial`||i===`loading`?(0,z.jsx)(t.SuggestionMenu.Loader,{className:`bn-suggestion-menu-loader`}):null,c=(0,R.useMemo)(()=>{let e,n=[];for(let i=0;i<r.length;i++){let s=r[i];s.group!==e&&(e=s.group,n.push((0,z.jsx)(t.SuggestionMenu.Label,{className:`bn-suggestion-menu-label`,children:e},e))),n.push((0,z.jsx)(t.SuggestionMenu.Item,{className:zE(`bn-suggestion-menu-item`,s.size===`small`?`bn-suggestion-menu-item-small`:``),item:s,id:`bn-suggestion-menu-item-${i}`,isSelected:i===a,onClick:()=>o?.(s)},s.title))}return n},[t,r,o,a]);return(0,z.jsxs)(t.SuggestionMenu.Root,{id:`bn-suggestion-menu`,className:`bn-suggestion-menu`,children:[c,c.length===0&&(e.loadingState===`loading`||e.loadingState===`loaded`)&&(0,z.jsx)(t.SuggestionMenu.EmptyItem,{className:`bn-suggestion-menu-item`,children:n.suggestion_menu.no_items_title}),s]})}function kz(e,t){let[n,r]=(0,R.useState)(0);return{selectedIndex:n,setSelectedIndex:r,handler:i=>{if(i.key===`ArrowUp`)return i.preventDefault(),e.length&&r((n-1+e.length)%e.length),!0;if(i.key===`ArrowDown`)return i.preventDefault(),e.length&&r((n+1)%e.length),!0;if(i.key===`PageUp`)return i.preventDefault(),e.length&&r(0),!0;if(i.key===`PageDown`)return i.preventDefault(),e.length&&r(e.length-1),!0;let a=Az(i)?i.nativeEvent.isComposing:i.isComposing;return i.key===`Enter`&&!a&&(i.preventDefault(),i.stopPropagation(),e.length&&t?.(e[n]),!0)}}}function Az(e){return e.nativeEvent!==void 0}function jz(e,t,n,r,i){let a=Iy(),{selectedIndex:o,setSelectedIndex:s,handler:c}=kz(n,r);return(0,R.useEffect)(()=>{let e=i||a;return e?.addEventListener(`keydown`,c,!0),()=>{e?.removeEventListener(`keydown`,c,!0)}},[a,n,o,r,i,c]),(0,R.useEffect)(()=>{s(0)},[t,s]),{selectedIndex:n.length===0?void 0:o}}function Mz(e){let t=Oy().setContentEditableProps,n=ky(),{getItems:r,suggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c}=e,l=(0,R.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:u,usedQuery:d,loadingState:f}=wz(a,r);Cz(u,d,s);let{selectedIndex:p}=jz(n,a,u,l);return(0,R.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,R.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":Sz(p)})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,p]),(0,z.jsx)(i,{items:u,onItemClick:l,loadingState:f,selectedIndex:p})}var Nz={heading:Xb,heading_2:Yb,heading_3:Jb,heading_4:qb,heading_5:Kb,heading_6:Gb,toggle_heading:Xb,toggle_heading_2:Yb,toggle_heading_3:Jb,quote:Nb,toggle_list:wb,numbered_list:Lb,bullet_list:Ib,check_list:Rb,paragraph:Ab,table:jb,image:Db,video:Ob,audio:Cb,file:ax,emoji:mb,code_block:Qb,divider:hb};function Pz(e){return xA(e).map(e=>{let t=Nz[e.key];return{...e,icon:(0,z.jsx)(t,{size:18})}})}function Fz(e){let t=ky(),n=Iy(),{triggerCharacter:r,suggestionMenuComponent:i,shouldOpen:a,minQueryLength:o,onItemClick:s,getItems:c}=e,l=(0,R.useMemo)(()=>s||(e=>{e.onItemClick(t)}),[t,s]),u=(0,R.useMemo)(()=>c||(async e=>SA(Pz(t),e)),[t,c]),d=TL(vA);(0,R.useEffect)(()=>{d.addSuggestionMenu({triggerCharacter:r,shouldOpen:a})},[d,r,a]);let f=EL(vA),p=EL(vA,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),m=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:f?.show&&f?.triggerCharacter===r,onOpenChange:e=>{e||d.closeMenu()},placement:`bottom-start`,middleware:yz,...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:80},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,f?.show,f?.triggerCharacter,d,r]);return!f||!f.ignoreQueryLength&&o&&(f.query.startsWith(` `)||f.query.length<o)?null:(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(kL,{reference:p,...m,children:r&&(0,z.jsx)(Mz,{query:f.query,closeMenu:d.closeMenu,clearQuery:d.clearQuery,getItems:u,suggestionMenuComponent:i||Oz,onItemClick:l})})})}var Iz=(e,t=.3)=>{let n=Math.floor(e)+t,r=Math.ceil(e)-t;return e>=n&&e<=r?Math.round(e):e<n?Math.floor(e):Math.ceil(e)},Lz=e=>{let t=Zy(),n=ky(),r=TL(AN),i=EL(AN,{selector:e=>e?.block}),a=(0,R.useRef)(!1),[o,s]=(0,R.useState)(),c=(0,R.useCallback)(t=>{r.freezeHandles(),e.hideOtherElements(!0),i&&(s({originalContent:i.content,originalCroppedContent:{rows:r.cropEmptyRowsOrColumns(i,e.orientation===`addOrRemoveColumns`?`columns`:`rows`)},startPos:e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY}),a.current=!1,t.preventDefault())},[i,e,r]),l=(0,R.useCallback)(()=>{i&&!a.current&&n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns(i,`columns`,1):r.addRowsOrColumns(i,`rows`,1)}})},[i,n,e.orientation,r]);return(0,R.useEffect)(()=>{let t=t=>{if(!i)return;if(!o)throw Error(`editingState is undefined`);a.current=!0;let s=(e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY)-o.startPos,c=e.orientation===`addOrRemoveColumns`?o.originalCroppedContent.rows[0]?.cells.length??0:o.originalCroppedContent.rows.length,l=e.orientation===`addOrRemoveColumns`?o.originalContent.rows[0]?.cells.length??0:o.originalContent.rows.length,u=e.orientation===`addOrRemoveColumns`?i.content.rows[0].cells.length:i.content.rows.length,d=l+Iz(s/(e.orientation===`addOrRemoveColumns`?120:31),.3);d>=c&&d>0&&d!==u&&(n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`columns`,d-c):r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`rows`,d-c)}}),i.content&&n.setTextCursorPosition(i))};return o&&window.addEventListener(`mousemove`,t),()=>{window.removeEventListener(`mousemove`,t)}},[i,o,n,e.orientation,r]),(0,R.useEffect)(()=>{let t=()=>{e.hideOtherElements(!1),r.unfreezeHandles(),s(void 0)};return o&&window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mouseup`,t)}},[o,e,r]),n.isEditable?(0,z.jsx)(t.TableHandle.ExtendButton,{className:zE(`bn-extend-button`,e.orientation===`addOrRemoveColumns`?`bn-extend-button-add-remove-columns`:`bn-extend-button-add-remove-rows`,o===null?``:`bn-extend-button-editing`),onClick:l,onMouseDown:c,children:e.children||(0,z.jsx)(Sb,{size:18,"data-test":`extendButton`})}):null},Rz=e=>{let t=Zy(),n=Vy(),r=Qy(),i=ky(),{block:a,colIndex:o,rowIndex:s}=EL(AN,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})}),c=(e,t)=>{if(a===void 0||o===void 0||s===void 0)return;let n=a.content.rows.map(e=>({...e,cells:e.cells.map(e=>AE(e))}));t===`text`?n[s].cells[o].props.textColor=e:n[s].cells[o].props.backgroundColor=e,i.updateBlock(a,{type:`table`,content:{...a.content,rows:n}}),i.setTextCursorPosition(a)};if(a===void 0||o===void 0||s===void 0)return null;let l=a.content.rows[s]?.cells?.[o];return!l||i.settings.tables.cellTextColor===!1&&i.settings.tables.cellBackgroundColor===!1?null:(0,z.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,z.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||r.drag_handle.colors_menuitem})}),(0,z.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,z.jsx)(iR,{iconSize:18,text:i.settings.tables.cellTextColor?{color:ME(l)?l.props.textColor:`default`,setColor:e=>c(e,`text`)}:void 0,background:i.settings.tables.cellBackgroundColor?{color:ME(l)?l.props.backgroundColor:`default`,setColor:e=>c(e,`background`)}:void 0})})]})},zz=()=>{let e=Zy(),t=Qy(),n=ky(),r=TL(AN),{block:i,colIndex:a,rowIndex:o}=EL(AN,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})});if(i===void 0||a===void 0||o===void 0)return null;let s=i.content.rows[o]?.cells?.[a];return!s||!ME(s)||PE(s)===1&&NE(s)===1||!n.settings.tables.splitCells?null:(0,z.jsx)(e.Generic.Menu.Item,{onClick:()=>{r.splitCell({row:o,col:a})},children:t.table_handle.split_cell_menuitem})},Bz=e=>{let t=Zy();return(0,z.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-table-handle-menu`,children:e.children||(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(zz,{}),(0,z.jsx)(Rz,{})]})})},Vz=e=>{let t=Zy(),n=Vy(),r=ky(),i=TL(AN),a=e.tableCellMenu||Bz;return!r.settings.tables.splitCells&&!r.settings.tables.cellBackgroundColor&&!r.settings.tables.cellTextColor?null:(0,z.jsxs)(t.Generic.Menu.Root,{onOpenChange:t=>{t?(i.freezeHandles(),e.hideOtherElements(!0)):(i.unfreezeHandles(),e.hideOtherElements(!1),r.focus())},position:`right`,portalElement:n,children:[(0,z.jsx)(t.Generic.Menu.Trigger,{children:(0,z.jsx)(t.Generic.Menu.Button,{className:`bn-table-cell-handle`,children:e.children||(0,z.jsx)(ZR,{size:12,"data-test":`tableCellHandle`})})}),(0,z.jsx)(a,{})]})},Hz=e=>{let t=Zy(),n=Qy(),r=TL(AN),i=EL(AN,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,z.jsx)(t.Generic.Menu.Item,{onClick:()=>{r.addRowOrColumn(i,e.orientation===`row`?{orientation:`row`,side:e.side}:{orientation:`column`,side:e.side})},children:n.table_handle[`add_${e.side}_menuitem`]})},Uz=e=>{let t=Zy(),n=Qy(),r=TL(AN),i=EL(AN,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,z.jsx)(t.Generic.Menu.Item,{onClick:()=>r.removeRowOrColumn(i,e.orientation),children:e.orientation===`row`?n.table_handle.delete_row_menuitem:n.table_handle.delete_column_menuitem})},Wz=e=>{let t=Zy(),n=Vy(),r=Qy(),i=ky(),a=TL(AN),{block:o,index:s}=EL(AN,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})}),c=(0,R.useMemo)(()=>a===void 0||o===void 0||s===void 0?[]:e.orientation===`row`?a.getCellsAtRowHandle(o,s):a.getCellsAtColumnHandle(o,s),[o,s,e.orientation,a]),l=(e,t)=>{if(o===void 0)return;let n=o.content.rows.map(e=>({...e,cells:e.cells.map(e=>AE(e))}));c.forEach(({row:r,col:i})=>{t===`text`?n[r].cells[i].props.textColor=e:n[r].cells[i].props.backgroundColor=e}),i.updateBlock(o,{type:`table`,content:{...o.content,rows:n}}),i.setTextCursorPosition(o)};if(!c||!c[0]||!a||i.settings.tables.cellTextColor===!1&&i.settings.tables.cellBackgroundColor===!1)return null;let u=AE(c[0].cell);return(0,z.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,z.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||r.drag_handle.colors_menuitem})}),(0,z.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,z.jsx)(iR,{iconSize:18,text:i.settings.tables.cellTextColor?{color:c.every(({cell:e})=>ME(e)&&e.props.textColor===u.props.textColor)?u.props.textColor:`default`,setColor:e=>{l(e,`text`)}}:void 0,background:i.settings.tables.cellBackgroundColor?{color:c.every(({cell:e})=>ME(e)&&e.props.backgroundColor===u.props.backgroundColor)?u.props.backgroundColor:`default`,setColor:e=>l(e,`background`)}:void 0})})]})},Gz=e=>{let t=Zy(),n=Qy(),r=ky(),i=TL(AN),{block:a,index:o}=EL(AN,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})});if(i===void 0||a===void 0||o!==0||e.orientation!==`row`||!r.settings.tables.headers)return null;let s=!!a.content.headerRows;return(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerRows:s?void 0:1}})},children:n.drag_handle.header_row_menuitem})},Kz=e=>{let t=Zy(),n=Qy(),r=ky(),i=TL(AN),a=EL(AN,{selector:e=>e?.block}),o=EL(AN,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});if(!i||o!==0||!a||e.orientation!==`column`||!r.settings.tables.headers)return null;let s=!!a.content.headerCols;return(0,z.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerCols:s?void 0:1}})},children:n.drag_handle.header_column_menuitem})},qz=e=>{let t=Zy();return(0,z.jsx)(t.Generic.Menu.Dropdown,{className:`bn-table-handle-menu`,children:e.children||(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Uz,{orientation:e.orientation}),(0,z.jsx)(Hz,{orientation:e.orientation,side:e.orientation===`row`?`above`:`left`}),(0,z.jsx)(Hz,{orientation:e.orientation,side:e.orientation===`row`?`below`:`right`}),(0,z.jsx)(Gz,{orientation:e.orientation}),(0,z.jsx)(Kz,{orientation:e.orientation}),(0,z.jsx)(Wz,{orientation:e.orientation})]})})},Jz=e=>{let t=ky(),n=Zy(),r=Vy(),[i,a]=(0,R.useState)(!1),o=e.tableHandleMenu||qz,s=TL(AN),c=EL(AN),l=(0,R.useMemo)(()=>!s||!c||!c.block||c.block.type!==`table`?!1:e.orientation===`column`?s.getCellsAtColumnHandle(c.block,c.colIndex).every(({cell:e})=>NE(e)===1):s.getCellsAtRowHandle(c.block,c.rowIndex).every(({cell:e})=>PE(e)===1),[e.orientation,c,s]);return c?(0,z.jsxs)(n.Generic.Menu.Root,{onOpenChange:n=>{n?(s.freezeHandles(),e.hideOtherElements(!0)):(s.unfreezeHandles(),e.hideOtherElements(!1),t.focus())},position:`right`,portalElement:r,children:[(0,z.jsx)(n.Generic.Menu.Trigger,{children:(0,z.jsx)(n.TableHandle.Root,{className:zE(`bn-table-handle`,i?`bn-table-handle-dragging`:``,l?``:`bn-table-handle-not-draggable`),draggable:l,onDragStart:t=>{a(!0),e.hideOtherElements(!0),e.orientation===`column`?s.colDragStart(t):s.rowDragStart(t)},onDragEnd:()=>{s.dragEnd(),e.hideOtherElements(!1),a(!1)},style:e.orientation===`column`?{transform:`rotate(0.25turn)`}:void 0,children:e.children||(0,z.jsx)(QR,{size:24,"data-test":`tableHandle`})})}),(0,z.jsx)(o,{orientation:e.orientation})]}):null},Yz=e=>{let t=ky(),[n,r]=(0,R.useState)(),i=EL(AN),a=(0,R.useMemo)(()=>{let e={};if(i===void 0)return{};let n=HA(i.block.id,t.prosemirrorState.doc);if(!n)return{};let r=n.posBeforeNode+1,a=t.prosemirrorView.domAtPos(r+1).node;if(!(a instanceof Element))return{};if(e.tableReference={element:a},i.rowIndex===void 0||i.colIndex===void 0)return e;let o=t.prosemirrorState.doc.resolve(r+1).posAtIndex(i.rowIndex),s=t.prosemirrorState.doc.resolve(o+1).posAtIndex(i.colIndex),c=t.prosemirrorView.domAtPos(s+1).node;return c instanceof Element?(e.cellReference={element:c},e.rowReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(e.x,i.draggingState&&i.draggingState.draggedCellOrientation===`row`?i.draggingState.mousePos-t.height/2:t.y,e.width,t.height)}},e.columnReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(i.draggingState&&i.draggingState.draggedCellOrientation===`col`?i.draggingState.mousePos-t.width/2:t.x,e.y,t.width,e.height)}},e):{}},[t,i]),o=(0,R.useCallback)((e,n,r)=>{let i=!1;return P(e,n,()=>{i?t.getExtension(AN)?.hideHandlesIfNotFrozen():i=!0},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1})},[t]),s=(0,R.useMemo)(()=>i===void 0?void 0:{rowTableHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`),placement:`left`,middleware:[A(-10)],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},columnTableHandle:{useFloatingOptions:{open:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`),placement:`top`,middleware:[A(-12)],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},tableCellHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`),placement:`top-end`,middleware:[A({mainAxis:-15,crossAxis:-1})],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendRowsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`),placement:`bottom`,whileElementsMounted:o,middleware:[re({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendColumnsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`),placement:`right`,whileElementsMounted:o,middleware:[re({apply({rects:e,elements:t}){Object.assign(t.floating.style,{height:`${e.reference.height}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}}},[n,i,o]);if(!i)return null;let c=e.tableHandle||Jz,l=e.extendButton||Lz,u=e.tableCellHandle||Vz;return(0,z.jsxs)(Uy,{target:e.portalElement,children:[(0,z.jsx)(kL,{reference:a?.rowReference,...s?.rowTableHandle,children:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`)&&(0,z.jsx)(c,{orientation:`row`,hideOtherElements:e=>r(e?`rowTableHandle`:void 0)})}),(0,z.jsx)(kL,{reference:a?.columnReference,...s?.columnTableHandle,children:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`)&&(0,z.jsx)(c,{orientation:`column`,hideOtherElements:e=>r(e?`columnTableHandle`:void 0)})}),(0,z.jsx)(kL,{reference:a?.cellReference,...s?.tableCellHandle,children:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`)&&(0,z.jsx)(u,{hideOtherElements:e=>r(e?`tableCellHandle`:void 0)})}),(0,z.jsx)(kL,{reference:a?.tableReference,...s?.extendRowsButton,children:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`)&&(0,z.jsx)(l,{orientation:`addOrRemoveRows`,hideOtherElements:e=>r(e?`extendRowsButton`:void 0)})}),(0,z.jsx)(kL,{reference:a?.tableReference,...s?.extendColumnsButton,children:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`)&&(0,z.jsx)(l,{orientation:`addOrRemoveColumns`,hideOtherElements:e=>r(e?`extendColumnsButton`:void 0)})})]})};function Xz(e){if(e!==void 0){if(typeof e==`string`){if(typeof document>`u`)return;let t=document.querySelector(e);if(!t){console.warn(`[BlockNote] portalElements selector "${e}" did not match any element`);return}return t}return e}}var Zz=(0,R.lazy)(()=>Promise.resolve().then(()=>PB)),Qz=(0,R.lazy)(()=>Promise.resolve().then(()=>zB));function $z(e){let t=ky();if(!t)throw Error(`BlockNoteDefaultUI must be used within a BlockNoteContext.Provider`);let n=e.portalElements,r=Xz(n?.formattingToolbar),i=Xz(n?.linkToolbar),a=Xz(n?.slashMenu),o=Xz(n?.emojiPicker),s=Xz(n?.sideMenu),c=Xz(n?.filePanel),l=Xz(n?.tableHandles),u=Xz(n?.comments),d=Xz(n?.attributionTooltip);return(0,z.jsxs)(z.Fragment,{children:[t.getExtension(pA)&&e.formattingToolbar!==!1&&(0,z.jsx)(UR,{portalElement:r}),t.getExtension(Cj)&&e.linkToolbar!==!1&&(0,z.jsx)(JR,{portalElement:i}),t.getExtension(vA)&&e.slashMenu!==!1&&(0,z.jsx)(Fz,{triggerCharacter:`/`,shouldOpen:e=>!e.selection.$from.parent.type.isInGroup(`tableContent`),portalElement:a}),t.getExtension(vA)&&e.emojiPicker!==!1&&(0,z.jsx)(Dz,{triggerCharacter:`:`,columns:10,minQueryLength:2,portalElement:o}),t.getExtension(uN)&&e.sideMenu!==!1&&(0,z.jsx)(sz,{portalElement:s}),t.getExtension(ZO)&&e.filePanel!==!1&&(0,z.jsx)(XL,{portalElement:c}),t.getExtension(AN)&&e.tableHandles!==!1&&(0,z.jsx)(Yz,{portalElement:l}),t.getExtension(HL)&&e.comments!==!1&&(0,z.jsxs)(R.Suspense,{children:[(0,z.jsx)(Zz,{portalElement:u}),(0,z.jsx)(Qz,{portalElement:u})]}),t.getExtension(`attribution`)&&e.attributionTooltip!==!1&&(0,z.jsx)(fz,{portalElement:d})]})}var eB=!1;function tB(){typeof process>`u`&&(eB||typeof document>`u`||(eB=!0,(document.querySelector(`meta[name="viewport"]`)?.getAttribute(`content`)??``).replace(/\s/g,``).includes(`interactive-widget=resizes-content`)||console.warn(`[BlockNote] This page's viewport meta tag is missing "interactive-widget=resizes-content" in its content attribute. Add it to ensure proper mobile functionality, e.g. <meta name="viewport" content="width=device-width, initial-scale=1, interactive-widget=resizes-content">. See https://www.blocknotejs.org/docs/getting-started#mobile-compatibility for more information`)))}function nB(e,t){let n=Oy(),r=t??n?.editor,i=(0,R.useRef)(e);Ny(()=>{i.current=e}),(0,R.useEffect)(()=>{if(!r)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return r.onChange((...e)=>i.current(...e))},[r])}function rB(e,t,n){let r=Oy(),i=t??r?.editor,a=(0,R.useRef)(e);Ny(()=>{a.current=e}),(0,R.useEffect)(()=>{if(!i)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return i.onSelectionChange(e=>a.current(e),n)},[i,n])}var iB=()=>{let e=(0,R.useMemo)(()=>window.matchMedia?.(`(prefers-color-scheme: dark)`),[]),t=(0,R.useMemo)(()=>window.matchMedia?.(`(prefers-color-scheme: light)`),[]),n=e?.matches,r=t?.matches,[i,a]=(0,R.useState)(n?`dark`:r?`light`:`no-preference`);return(0,R.useEffect)(()=>{a(n?`dark`:r?`light`:`no-preference`)},[n,r]),(0,R.useEffect)(()=>{if(typeof e?.addEventListener==`function`){let n=({matches:e})=>e&&a(`dark`),r=({matches:e})=>e&&a(`light`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,r),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,r)}}{let n=()=>a(e.matches?`dark`:t.matches?`light`:`no-preference`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,n),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,n)}}},[e,t]),window.matchMedia,i};function aB(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:(0,Ty.createPortal)(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var oB=({contentComponent:e})=>{let t=(0,R.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,z.jsx)(z.Fragment,{children:Object.values(t)})},sB=(0,R.forwardRef)((e,t)=>{let[n,r]=(0,R.useState)();return(0,R.useImperativeHandle)(t,()=>(e,t)=>{(0,Ty.flushSync)(()=>{r({node:e,container:t})}),r(void 0)},[]),(0,z.jsx)(z.Fragment,{children:n&&(0,Ty.createPortal)(n.node,n.container)})}),cB=()=>{};function lB(e,t){let{editor:n,className:r,theme:i,children:a,editable:o,onSelectionChange:s,onChange:c,formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g,portalElements:_,applyThemedRoot:v,autoFocus:y,renderEditor:b=!0,...x}=e,S=(0,R.useMemo)(()=>Xz(_?.default),[_?.default]),[C,w]=(0,R.useState)(),T=Oy(),E=iB(),D=T?.colorSchemePreference||E,O=i||(D===`dark`?`dark`:`light`),k=Zy(),A=(0,R.useMemo)(()=>({formattingToolbar:k?l:!1,linkToolbar:k?u:!1,sideMenu:k?p:!1,slashMenu:k?d:!1,filePanel:k?m:!1,tableHandles:k?h:!1,emojiPicker:k?f:!1,comments:k?g:!1,portalElements:_}),[g,k,f,m,l,u,p,d,h,_]);nB(c||cB,n),rB(s||cB,n);let j=(0,R.useCallback)(e=>{n.elementRenderer=e},[n]),M=(0,R.useCallback)(e=>{e.className=zE(`bn-root`,O,r||``),e.setAttribute(`data-color-scheme`,O),v?.(e)},[O,r,v]),N=(0,R.useMemo)(()=>({...T,editor:n,setContentEditableProps:w,colorSchemePreference:O}),[T,n,O]),P=(0,R.useMemo)(()=>({editorProps:{autoFocus:y,contentEditableProps:C,editable:o},defaultUIProps:A,applyThemedRoot:M}),[y,C,o,A,M]);return(0,z.jsx)(Dy.Provider,{value:N,children:(0,z.jsxs)(Ly.Provider,{value:P,children:[(0,z.jsx)(sB,{ref:j}),(0,z.jsx)(uB,{className:r,renderEditor:b,editorColorScheme:O,defaultPortalElement:S,ref:t,...x,children:a})]})})}var uB=R.forwardRef(({className:e,renderEditor:t,editorColorScheme:n,defaultPortalElement:r,children:i,...a},o)=>(0,z.jsx)(`div`,{className:zE(`bn-root`,`bn-container`,n,e),"data-color-scheme":n,...a,ref:o,children:(0,z.jsx)(Hy,{children:(0,z.jsx)(Uy,{target:r,children:t?(0,z.jsx)(fB,{children:i}):i})})})),dB=R.forwardRef(lB),fB=e=>{let t=Ry(),n=ky(),r=(0,R.useMemo)(()=>aB(),[]);(0,R.useEffect)(()=>{tB()},[]);let i=(0,R.useCallback)(e=>{n.isEditable=t.editorProps.editable!==!1,n._tiptapEditor.contentComponent=r,e?n.mount(e):n.unmount()},[t.editorProps.editable,n,r]);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(oB,{contentComponent:r}),(0,z.jsx)(pB,{...t.editorProps,...e,mount:i}),(0,z.jsx)($z,{...t.defaultUIProps}),e.children]})},pB=e=>{let{autoFocus:t,mount:n,contentEditableProps:r}=e;return(0,z.jsx)(`div`,{"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"data-bn-autofocus":t,ref:n,...r})};function mB(e,t){let n,r=document.createElement(`div`),i;if(t?.elementRenderer)t.elementRenderer(e(e=>n=e||void 0),r);else{if(!t?.headless)throw Error(`elementRenderer not available, expected headless editor`);i=(0,UL.createRoot)(r),(0,Ty.flushSync)(()=>{i.render(e(e=>n=e||void 0))})}if(!r.childElementCount)return i?.unmount(),{dom:document.createElement(`span`)};n?.setAttribute(`data-tmp-find`,`true`);let a=r.cloneNode(!0),o=a.firstElementChild,s=a.querySelector(`[data-tmp-find]`);return s?.removeAttribute(`data-tmp-find`),i?.unmount(),{dom:o,contentDOM:s||void 0}}function hB(e,t){let n=(0,R.useRef)(t),r=e.view.state.doc;if(e.node.type.isInGroup(`bnBlock`))return hD(e.node,r);try{n.current=PD(e.getPos,r)}catch{}return n.current}var gB={display:`contents`},_B=`data-bn-children-ref`;function vB(e){let t=e.querySelector(`[${_B}]`);return e.hasAttribute(_B)&&(t=e),t?.removeAttribute(_B),t??void 0}function yB(e,t){function n(){let n=e.querySelector(`[data-id]`);return n?.getAttribute(`data-id`)===t()?n:e}e.getBoundingClientRect=()=>Element.prototype.getBoundingClientRect.call(n()),e.getClientRects=()=>Element.prototype.getClientRects.call(n())}function bB(e){return(0,z.jsx)(rn,{onDragOver:e=>e.preventDefault(),...Object.fromEntries(Object.entries(e.domAttributes||{}).filter(([e])=>e!==`class`)),className:zE(`bn-block-content`,e.domAttributes?.class||``),"data-content-type":e.blockType,...eD(e.blockProps,e.propSchema),"data-file-block":e.isFileBlock===!0||void 0,children:e.children})}function xB(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t;WD(i,a);let{render:o,renderFrame:s,toExternalHTML:c,...l}=a,u=n?typeof n==`function`?n(r):n:void 0,d=i.layoutOnly===!0;function f(e){let{BlockContent:t,block:n,editor:r}=e;return mB(a=>{let o=(0,z.jsx)(t,{block:n,editor:r,childrenRef:e.childrenRef,contentRef:e=>{a(e),e&&!d&&(e.className=zE(`bn-inline-content`,e.className))},context:e.context});return d?o:(0,z.jsx)(bB,{blockType:n.type,blockProps:n.props,propSchema:i.propSchema,domAttributes:e.domAttributes,isFileBlock:e.isFileBlock,children:o})},r)}let p=s;function m(e,t,n){bD(e);let r=e.closest(`[data-node-view-wrapper]`)?.firstElementChild;if(!(r instanceof HTMLElement))throw Error(`Layout block content must be inside its node view wrapper.`);vD(r,i.type,t.props,i.propSchema,t.id),r.toggleAttribute(`data-selected`,n)}function h(e){let t=hD(e.node,e.view.state.doc);if(t.type!==i.type)throw Error(`Frame for "${i.type}" received block "${t.type}".`);let n=Yt().nodeViewContentRef,r=(0,R.useRef)(null),a=(0,R.useRef)(null);if(!n||!p)throw Error(`Frame node view requires a frame and content mount.`);let o=(0,R.useRef)({block:t,selected:e.selected});(0,R.useLayoutEffect)(()=>{o.current={block:t,selected:e.selected},d&&a.current&&m(a.current,t,e.selected)});let s=(0,R.useCallback)(e=>{a.current=e,e&&(e.dataset.nodeViewContent=``),n(e??(d?null:r.current)),d&&e&&m(e,o.current.block,o.current.selected)},[n]),c=(0,R.useCallback)(e=>{r.current=e,!a.current&&!d&&n(e)},[n]);return(0,z.jsx)(rn,{ref:c,style:gB,children:(0,z.jsx)(p,{block:t,editor:e.extension.options.editor,slotRef:s})})}return{config:i,implementation:{...l,...c&&{toExternalHTML(e,t,n){let r=f({BlockContent:c,block:e,editor:t,domAttributes:this.blockContentDOMAttributes,isFileBlock:a.meta?.fileBlockAccept!==void 0,context:n,childrenRef:e=>e?.setAttribute(_B,``)});return{...r,childrenDOM:vB(r.dom)}}},...o&&{render(e,t){if(this.renderType===`nodeView`){let n=e,r=o,s=this.blockContentDOMAttributes;function c(e){let o=hB(e,n),c=Yt().nodeViewContentRef;if(!c)throw Error(`nodeViewContentRef is not set`);let l=c;function u(e){l(e),e&&(e.dataset.nodeViewContent=``,e.className=zE(`bn-inline-content`,e.className))}return(0,z.jsx)(bB,{blockType:o.type,blockProps:o.props,propSchema:i.propSchema,isFileBlock:!!a.meta?.fileBlockAccept,domAttributes:s,children:(0,z.jsx)(r,{block:o,editor:t,contentRef:u})})}return on(c,{className:`bn-react-node-view-renderer`})(this.props)}return f({BlockContent:o,block:e,editor:t,domAttributes:this.blockContentDOMAttributes})}},...p?{renderFrame(e,t){let{dom:n,contentDOM:r}=mB(n=>(0,z.jsx)(p,{block:e,editor:t,slotRef:n}),t);return r?{dom:n,slot:r}:void 0},frameView:e=>{let t=on(h,{className:`bn-react-node-view-renderer bn-frame-node-view`})(e);if(!(t instanceof Kt))throw Error(`React frames need an editor that renders React node views.`);let n=t.dom,r=t.contentDOM;if(!r)throw Error(`React frame node view has no content DOM.`);return d&&(r.style.display=`contents`,yB(n,()=>t.node.attrs.id)),{dom:n,slot:r,get node(){return t.node},update(e,n,r){return!d&&e.firstChild?.type!==t.node.firstChild?.type?!1:t.update(e,n,r)},selectNode:()=>t.selectNode(),deselectNode:()=>t.deselectNode(),destroy:()=>t.destroy()}}}:{}},extensions:u}}}var SB;async function CB(){return SB||(SB=(async()=>{let[e,t]=await Promise.all([Wn(()=>import(`./module-BrWgIX20.js`),[],import.meta.url),Wn(()=>import(`./native-Cqs-2kTC.js`),[],import.meta.url)]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),SB)}function wB(e){let t=(0,R.useRef)(null),n=(0,R.useRef)(null);return n.current&&n.current.update(e),(0,R.useEffect)(()=>((async()=>{let{emojiMart:r}=await CB();n.current=new r.Picker({...e,ref:t})})(),()=>{n.current=null}),[]),R.createElement(`div`,{ref:t})}var TB=e=>{let[t,n]=(0,R.useState)(!1),r=Zy(),i=Oy(),a=Vy();return(0,z.jsxs)(r.Generic.Popover.Root,{open:t,portalElement:a,children:[(0,z.jsx)(r.Generic.Popover.Trigger,{children:(0,z.jsx)(`div`,{onClick:r=>{r.preventDefault(),r.stopPropagation(),n(!t),e.onOpenChange?.(!t)},style:{display:`flex`,justifyContent:`center`,alignItems:`center`},children:e.children})}),(0,z.jsx)(r.Generic.Popover.Content,{className:`bn-emoji-picker-popover`,variant:`panel-popover`,children:(0,z.jsx)(wB,{perLine:7,onClickOutside:()=>{n(!1),e.onOpenChange?.(!1)},onEmojiSelect:t=>{e.onEmojiSelect(t),n(!1),e.onOpenChange?.(!1)},theme:i?.colorSchemePreference})})]})};function EB(e){let{userStore:t}=TL(HL),n=e.join(`,`);return(0,R.useEffect)(()=>{t.loadUsers(e)},[t,n]),Ay(t.store,t=>{let n=new Map;for(let r of e){let e=t.get(r);e&&n.set(r,e)}return n})}function DB(e){return EB([e]).get(e)}var OB=e=>{let t=Zy(),n=Qy(),r=TL(HL),i=e.comment.reactions.find(t=>t.emoji===e.emoji);if(!i)throw Error(`Trying to render reaction badge for non-existing reaction`);let[a,o]=(0,R.useState)([]),s=EB(a);return(0,z.jsx)(t.Generic.Badge.Root,{className:zE(`bn-badge`,`bn-comment-reaction`),text:i.userIds.length.toString(),icon:i.emoji,isSelected:r.threadStore.auth.canDeleteReaction(e.comment,i.emoji),onClick:()=>e.onReactionSelect(i.emoji),onMouseEnter:()=>o(i.userIds),mainTooltip:n.comments.reactions.reacted_by,secondaryTooltip:`${Array.from(s.values()).map(e=>e.username).join(`
|
|
523
|
-
`)}`},i.emoji)},kB=(0,R.memo)(({isEmpty:e,comment:t,isEditing:n,threadStore:r,onReactionSelect:i,onEditSubmit:a,onEditCancel:o,onEmojiPickerOpenChange:s,Components:c,dict:l})=>{let u=r.auth.canAddReaction(t);return(0,z.jsxs)(z.Fragment,{children:[t.reactions.length>0&&!n&&(0,z.jsxs)(c.Generic.Badge.Group,{className:zE(`bn-badge-group`,`bn-comment-reactions`),children:[t.reactions.map(e=>(0,z.jsx)(OB,{comment:t,emoji:e.emoji,onReactionSelect:i},e.emoji)),u&&(0,z.jsx)(TB,{onEmojiSelect:e=>i(e.native),onOpenChange:s,children:(0,z.jsx)(c.Generic.Badge.Root,{className:zE(`bn-badge`,`bn-comment-add-reaction`),text:`+`,icon:(0,z.jsx)(pb,{size:16}),mainTooltip:l.comments.actions.add_reaction})})]}),n&&(0,z.jsxs)(c.Generic.Toolbar.Root,{variant:`action-toolbar`,className:zE(`bn-action-toolbar`,`bn-comment-actions`),children:[(0,z.jsx)(c.Generic.Toolbar.Button,{mainTooltip:l.comments.save_button_text,variant:`compact`,onClick:a,isDisabled:e,children:l.comments.save_button_text}),(0,z.jsx)(c.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:l.comments.cancel_button_text,variant:`compact`,onClick:o,children:l.comments.cancel_button_text})]})]})}),AB=({comment:e,thread:t,showResolveButton:n})=>{let r=TL(HL),i=Qy(),[a,o]=(0,R.useState)(!1),s=jL({initialContent:e.body,trailingBlock:!1,dictionary:{...i,placeholders:{emptyDocument:i.placeholders.edit_comment}},schema:r.commentEditorSchema||IL,extensions:[RL({submitOnEnter:r.submitOnEnter,onSubmit:async n=>{await r.threadStore.updateComment({commentId:e.id,comment:{body:n.document},threadId:t.id}),o(!1)}})]}),c=Zy(),l=Vy(),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(!1),m=r.threadStore,h=(0,R.useCallback)(()=>{o(!0)},[]),g=(0,R.useCallback)(()=>{s.replaceBlocks(s.document,e.body),o(!1)},[s,e.body]),_=s.getExtension(RL).submit,v=(0,R.useCallback)(async()=>{await m.deleteComment({commentId:e.id,threadId:t.id})},[e,t.id,m]),y=(0,R.useCallback)(async n=>{m.auth.canAddReaction(e,n)?await m.addReaction({threadId:t.id,commentId:e.id,emoji:n}):m.auth.canDeleteReaction(e,n)&&await m.deleteReaction({threadId:t.id,commentId:e.id,emoji:n})},[m,e,t.id]),b=(0,R.useCallback)(async()=>{await m.resolveThread({threadId:t.id})},[t.id,m]),x=(0,R.useCallback)(async()=>{await m.unresolveThread({threadId:t.id})},[t.id,m]),S=DB(e.userId);if(!e.body)return null;let C,w=m.auth.canAddReaction(e),T=m.auth.canDeleteComment(e),E=m.auth.canUpdateComment(e),D=n&&(t.resolved?m.auth.canUnresolveThread(t):m.auth.canResolveThread(t));a||(C=(0,z.jsxs)(c.Generic.Toolbar.Root,{className:zE(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:[w&&(0,z.jsx)(TB,{onEmojiSelect:e=>y(e.native),onOpenChange:d,children:(0,z.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.add_reaction,variant:`compact`,children:(0,z.jsx)(pb,{size:16})},`add-reaction`)}),D&&(t.resolved?(0,z.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.reopen,variant:`compact`,onClick:x,children:(0,z.jsx)(cx,{size:16})},`reopen`):(0,z.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.resolve,variant:`compact`,onClick:b,children:(0,z.jsx)(xb,{size:16})},`resolve`)),(T||E)&&(0,z.jsxs)(c.Generic.Menu.Root,{position:`bottom-start`,onOpenChange:p,portalElement:l,children:[(0,z.jsx)(c.Generic.Menu.Trigger,{children:(0,z.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.more_actions,variant:`compact`,children:(0,z.jsx)(gb,{size:16})},`more-actions`)}),(0,z.jsxs)(c.Generic.Menu.Dropdown,{className:`bn-menu-dropdown`,children:[E&&(0,z.jsx)(c.Generic.Menu.Item,{icon:(0,z.jsx)(sx,{}),onClick:h,children:i.comments.actions.edit_comment},`edit-comment`),T&&(0,z.jsx)(c.Generic.Menu.Item,{icon:(0,z.jsx)(yb,{}),onClick:v,children:i.comments.actions.delete_comment},`delete-comment`)]})]})]}));let O=e.createdAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`});if(!e.body)throw Error(`soft deletes are not yet supported`);return(0,z.jsx)(c.Comments.Comment,{authorInfo:S??`loading`,timeString:O,edited:e.updatedAt.getTime()!==e.createdAt.getTime(),showActions:f||`hover`,actions:C,className:`bn-thread-comment`,emojiPickerOpen:u,children:(0,z.jsx)(ML,{autoFocus:a,editor:s,editable:a,actions:e.reactions.length>0||a?({isFocused:t,isEmpty:n})=>(0,z.jsx)(kB,{isFocused:t,isEmpty:n,comment:e,isEditing:a,threadStore:m,onReactionSelect:y,onEditSubmit:_,onEditCancel:g,onEmojiPickerOpenChange:d,Components:c,dict:i}):void 0})})},jB=({thread:e,maxCommentsBeforeCollapse:t})=>{let n=Zy(),r=Qy(),i=EB(e.resolvedBy?[e.resolvedBy]:[]),a=e.comments.map((t,n)=>(0,z.jsx)(AB,{thread:e,comment:t,showResolveButton:n===0},t.id+JSON.stringify(t.body||`{}`)));if(e.resolved&&e.resolvedUpdatedAt&&e.resolvedBy){if(!i.get(e.resolvedBy))throw Error(`User ${e.resolvedBy} resolved thread ${e.id}, but their data could not be found.`);let t=e.comments.findLastIndex(t=>e.resolvedUpdatedAt.getTime()>t.createdAt.getTime())+1;a.splice(t,0,(0,z.jsx)(n.Comments.Comment,{className:`bn-thread-comment`,authorInfo:e.resolvedBy&&i.get(e.resolvedBy)||`loading`,timeString:e.resolvedUpdatedAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),edited:!1,showActions:!1,children:(0,z.jsx)(`div`,{className:`bn-resolved-text`,children:r.comments.sidebar.marked_as_resolved})},`resolved-comment`))}return t&&a.length>t&&a.splice(1,a.length-2,(0,z.jsx)(n.Comments.ExpandSectionsPrompt,{className:`bn-thread-expand-prompt`,children:r.comments.sidebar.more_replies(e.comments.length-2)},`expand-prompt`)),a},MB=(0,R.memo)(({isEmpty:e,onSave:t,Components:n,dict:r})=>(0,z.jsx)(n.Generic.Toolbar.Root,{className:zE(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:(0,z.jsx)(n.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:r.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:t,children:r.comments.save_button_text})}));function NB(e){let t=e.newCommentEditor,n=Zy(),r=Qy(),i=t.getExtension(RL);if(!i)throw Error(`FloatingComposer's newCommentEditor must include CommentEditorSubmitExtension.`);let a=i.submit;return(0,z.jsx)(n.Comments.Card,{className:`bn-thread`,children:(0,z.jsx)(ML,{autoFocus:!0,editable:!0,editor:t,actions:({isFocused:e,isEmpty:t})=>(0,z.jsx)(MB,{isFocused:e,isEmpty:t,onSave:a,Components:n,dict:r})})})}var PB=GL({default:()=>FB});function FB(e){let t=ky(),n=Qy(),r=TL(HL),i=EL(HL,{editor:t,selector:e=>e.pendingComment}),a=jL({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.new_comment}},schema:r.commentEditorSchema||IL,extensions:[RL({submitOnEnter:r.submitOnEnter,onSubmit:async e=>{await r.createThread({initialComment:{body:e.document}}),r.stopPendingComment(),t.transact(e=>{e.setSelection(Or.create(e.doc,e.selection.to))}),t.focus()}})]},[i]),o=Fy({editor:t,selector:({editor:e})=>i?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),s=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!i,onOpenChange:e=>{if(!e){if(!LL({hasUnsavedContent:!a.isEmpty,confirmBeforeDiscard:r.confirmBeforeDiscard,message:n.comments.discard_pending_comment}))return;r.stopPendingComment(),t.focus()}},placement:`bottom`,middleware:[A(10),j(),ie()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...e.floatingUIOptions?.elementProps}}),[r,n,t,a,i,e.floatingUIOptions]),c=e.floatingComposer||NB;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(AL,{position:o,...s,children:(0,z.jsx)(c,{newCommentEditor:a})})})}var IB=(0,R.memo)(({isEmpty:e,onNewCommentSave:t,Components:n,dict:r})=>e?null:(0,z.jsx)(n.Generic.Toolbar.Root,{variant:`action-toolbar`,className:zE(`bn-action-toolbar`,`bn-comment-actions`),children:(0,z.jsx)(n.Generic.Toolbar.Button,{mainTooltip:r.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:t,children:r.comments.save_button_text})})),LB=({thread:e,selected:t,orphaned:n,referenceText:r,maxCommentsBeforeCollapse:i,onFocus:a,onBlur:o,tabIndex:s,newCommentEditor:c})=>{let l=Zy(),u=Qy(),d=TL(HL),f=(0,R.useRef)(e.id);f.current=e.id;let p=jL({trailingBlock:!1,dictionary:{...u,placeholders:{emptyDocument:u.placeholders.comment_reply}},schema:d.commentEditorSchema||IL,extensions:[RL({submitOnEnter:d.submitOnEnter,onSubmit:async e=>{await d.threadStore.addComment({comment:{body:e.document},threadId:f.current}),e.removeBlocks(e.document)}})]}),m=c??p,h=m.getExtension(RL);if(!h)throw Error(`Thread's newCommentEditor must include CommentEditorSubmitExtension.`);let g=h.submit;return(0,z.jsxs)(l.Comments.Card,{className:zE(`bn-thread`,n&&`bn-thread-orphaned`),headerText:r,onFocus:a,onBlur:o,selected:t,tabIndex:s,children:[(0,z.jsx)(l.Comments.CardSection,{className:`bn-thread-comments`,children:(0,z.jsx)(jB,{thread:e,maxCommentsBeforeCollapse:t?void 0:i||5})}),t&&(0,z.jsx)(l.Comments.CardSection,{className:`bn-thread-composer`,children:(0,z.jsx)(ML,{autoFocus:!1,editable:!0,editor:m,actions:({isFocused:e,isEmpty:t})=>(0,z.jsx)(IB,{isFocused:e,isEmpty:t,onNewCommentSave:g,Components:l,dict:u})})})]})};function RB(){let e=TL(HL).threadStore,t=(0,R.useRef)(void 0);t.current||=e.getThreads();let n=(0,R.useCallback)(n=>e.subscribe(e=>{t.current=e,n()}),[e]);return(0,R.useSyncExternalStore)(n,()=>t.current)}var zB=GL({default:()=>BB});function BB(e){let t=ky(),n=Qy(),r=TL(HL),i=EL(HL,{editor:t,selector:e=>e.selectedThreadId?{id:e.selectedThreadId,position:e.threadPositions.get(e.selectedThreadId)}:void 0}),a=jL({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.comment_reply}},schema:r.commentEditorSchema||IL,extensions:[RL({submitOnEnter:r.submitOnEnter,onSubmit:async e=>{i&&(await r.threadStore.addComment({comment:{body:e.document},threadId:i.id}),e.removeBlocks(e.document))}})]},[i?.id]),o=RB(),s=(0,R.useMemo)(()=>i?o.get(i.id):void 0,[i,o]),c=(0,R.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!i,onOpenChange:(e,i,o)=>{if(!e){if(!LL({hasUnsavedContent:!a.isEmpty,confirmBeforeDiscard:r.confirmBeforeDiscard,message:n.comments.discard_pending_comment}))return;o===`escape-key`&&t.focus(),r.selectThread(void 0)}},placement:`bottom`,middleware:[A(10),j(),ie()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:30},...e.floatingUIOptions?.elementProps}}),[r,n,t,a,e.floatingUIOptions,i]),l=e.floatingThread||LB;return(0,z.jsx)(Uy,{target:e.portalElement,children:(0,z.jsx)(AL,{position:i?.position,...c,children:s&&(0,z.jsx)(l,{thread:s,selected:!0,newCommentEditor:a})})})}R.memo(({thread:e,selectedThreadId:t,maxCommentsBeforeCollapse:n,referenceText:r,orphaned:i})=>{let a=TL(HL),o=(0,R.useCallback)(t=>{t.target.closest(`.bn-action-toolbar`)||a.selectThread(e.id)},[a,e.id]),s=(0,R.useCallback)(e=>{if(!e.relatedTarget||e.relatedTarget.closest(`.bn-action-toolbar`))return;let t=e.target instanceof Node?e.target:null,n=e.relatedTarget instanceof Node?e.relatedTarget.closest(`.bn-thread`):null;t&&n&&n.contains(t)||a.selectThread(void 0)},[a]);return(0,z.jsx)(LB,{thread:e,selected:e.id===t,orphaned:i,referenceText:r,maxCommentsBeforeCollapse:n,onFocus:o,onBlur:s,tabIndex:0})});function VB(e){let t=(0,R.useRef)(null);return(0,R.useEffect)(()=>{e&&t.current?.focus({preventScroll:!0})},[e]),t}function HB(e){return e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement&&e.currentTarget.contains(e.relatedTarget)}function UB({onBlur:e,onFocus:t}={}){let n=(0,R.useRef)(null),[r,i]=(0,R.useState)(!1),a=(0,R.useRef)(!1),o=e=>{i(e),a.current=e},s=(0,R.useCallback)(e=>{a.current||(o(!0),t?.(e))},[t]),c=(0,R.useCallback)(t=>{a.current&&!HB(t)&&(o(!1),e?.(t))},[e]);return(0,R.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`focusin`,s),e.addEventListener(`focusout`,c),()=>{e?.removeEventListener(`focusin`,s),e?.removeEventListener(`focusout`,c)}},[s,c]),{ref:n,focused:r}}function WB(e){return(0,z.jsx)(rn,{as:`span`,className:`bn-inline-content-section`,"data-inline-content-type":e.inlineContentType,...eD(e.inlineContentProps,e.propSchema),children:e.children})}function GB(e,t,n){let r=zt.create({name:e.type,inline:!0,group:`inline`,selectable:e.content!==`none`,atom:e.content===`none`,draggable:t.meta?.draggable,code:t.meta?.code,content:e.content===`styled`?`inline*`:e.content===`plain`?`text*`:``,marks(){return e.content===`plain`?WC(this.editor):void 0},addAttributes(){return ND(e.propSchema)},addKeyboardShortcuts(){return $D(e)},parseHTML(){return WN(e,t.parse,t.parseContent)},renderHTML({node:n}){let r=this.options.editor,i=mD(n,r.schema.inlineContentSchema,r.schema.styleSchema),a=t.toExternalHTML||t.render;return QD(mB(e=>(0,z.jsx)(a,{contentRef:t=>{e(t),t&&(t.dataset.editable=``)},inlineContent:i,updateInlineContent:()=>{},editor:r,node:n,getPos:()=>void 0}),r),e.type,n.attrs,e.propSchema)},addNodeView(){let n=this.options.editor;return r=>on(r=>{let i=Yt().nodeViewContentRef;if(!i)throw Error(`nodeViewContentRef is not set`);let a=t.render;return(0,z.jsx)(WB,{inlineContentProps:r.node.attrs,inlineContentType:e.type,propSchema:e.propSchema,children:(0,z.jsx)(a,{contentRef:e=>{i(e),e&&(e.dataset.editable=``)},editor:n,node:r.node,getPos:r.getPos,inlineContent:mD(r.node,n.schema.inlineContentSchema,n.schema.styleSchema),updateInlineContent:e=>{let t=zO([e],n.pmSchema),i=r.getPos();i!==void 0&&n.transact(e=>e.replaceWith(i,i+r.node.nodeSize,t))}})})},{className:`bn-ic-react-node-view-renderer`,as:`span`})(r)}});return eO(e,{...t,node:r,render(n,r,i){let a=t.render,o=zO([n],i.pmSchema)[0];return mB(t=>(0,z.jsx)(WB,{inlineContentProps:n.props,inlineContentType:e.type,propSchema:e.propSchema,children:(0,z.jsx)(a,{contentRef:e=>{t(e),e&&(e.dataset.editable=``)},editor:i,inlineContent:n,updateInlineContent:r,node:o,getPos:()=>void 0})}),i)},toExternalHTML(n,r){let i=t.toExternalHTML||t.render,a=zO([n],r.pmSchema)[0];return mB(t=>(0,z.jsx)(WB,{inlineContentProps:n.props,inlineContentType:e.type,propSchema:e.propSchema,children:(0,z.jsx)(i,{contentRef:e=>{t(e),e&&(e.dataset.editable=``)},editor:r,inlineContent:n,updateInlineContent:()=>{},node:a,getPos:()=>void 0})}),r)}},n)}function KB(e,t){let n=At.create({name:e.type,addAttributes(){return nO(e.propSchema)},parseHTML(){return sO(e)},renderHTML({mark:n}){let r=t.render;return rO(mB(t=>(0,z.jsx)(r,{editor:this.options.editor,value:e.propSchema===`boolean`?void 0:n.attrs.stringValue,contentRef:e=>{t(e),e&&(e.dataset.editable=``)}}),this.options.editor),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){let n=this.options.editor;return r=>{let i=en(r=>{let i=(0,R.useContext)(sn).markViewContentRef;if(!i)throw Error(`markViewContentRef is not set`);let a=t.render;return(0,z.jsx)(a,{editor:n,contentRef:e=>{i(e),e&&(e.dataset.markViewContent=``)},value:e.propSchema===`boolean`?void 0:r.mark.attrs.stringValue})})(r);return i.didMountContentDomElement=!0,i}}});return iO(e,{...t,mark:n,render(n,r){let i=t.render;return rO(mB(e=>(0,z.jsx)(i,{editor:r,value:n,contentRef:t=>{e(t),t&&(t.dataset.editable=``)}}),r),e.type,n,e.propSchema)},toExternalHTML(n,r){let i=t.render;return rO(mB(e=>(0,z.jsx)(i,{editor:r,value:n,contentRef:t=>{e(t),t&&(t.dataset.editable=``)}}),r),e.type,n,e.propSchema)}})}function qB(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top<r.top,a=n.bottom>r.bottom;return i&&a?`both`:i?`top`:a?`bottom`:`none`}function JB(e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function YB(e){return(0,R.useMemo)(()=>JB(e),e)}function XB(e){HE()?e.preventDefault():BE()&&e.currentTarget.focus()}var ZB={};function QB(e,t){let n=R.useRef(ZB);return n.current===ZB&&(n.current=e(t)),n}function $B(e,t,n,r){let i=QB(tV).current;return nV(i,e,t,n,r)&&iV(i,[e,t,n,r]),i.callback}function eV(e){let t=QB(tV).current;return rV(t,e)&&iV(t,e),t.callback}function tV(){return{callback:null,cleanup:null,refs:[]}}function nV(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function rV(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function iV(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var aV=19;function oV(e){return aV>=e}function sV(e){if(!R.isValidElement(e))return null;let t=e,n=t.props;return(oV(19)?n?.ref:t.ref)??null}function cV(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function lV(){}var uV=Object.freeze([]),dV=Object.freeze({});function fV(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function pV(e,t){return typeof e==`function`?e(t):e}function mV(e,t){return typeof e==`function`?e(t):e}var hV={};function gV(e,t,n,r,i){if(!n&&!r&&!i&&!e)return vV(t);let a=vV(e);return t&&(a=yV(a,t)),n&&(a=yV(a,n)),r&&(a=yV(a,r)),i&&(a=yV(a,i)),a}function _V(e){if(e.length===0)return hV;if(e.length===1)return vV(e[0]);let t=vV(e[0]);for(let n=1;n<e.length;n+=1)t=yV(t,e[n]);return t}function vV(e){return CV(e)?{...e(hV)}:bV(e)}function yV(e,t){return CV(t)?t(e):xV(e,t)}function bV(e){let t={...e};for(let e in t){let n=t[e];SV(e,n)&&(t[e]=TV(n))}return t}function xV(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=cV(e.style,r);break;case`className`:e[n]=DV(e.className,r);break;default:e[n]=SV(n,r)?wV(e[n],r):r}}return e}function SV(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function CV(e){return typeof e==`function`}function wV(e,t){return t?e?(...n)=>{let r=n[0];if(OV(r)){let i=r;EV(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:TV(t):e}function TV(e){return e&&((...t)=>{let n=t[0];return OV(n)&&EV(n),e(...t)})}function EV(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function DV(e,t){return t?e?t+` `+e:t:e}function OV(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function kV(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=NV(r));let i=AV(t,n,r);if(n.enabled===!1)return null;let a=n.state??dV;return PV(e,r,i,a)}function AV(e,t,n){let{className:r,style:i}=e,{state:a=dV,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?pV(r,a):void 0,d=l?mV(i,a):void 0,f=l?fV(a,c):dV,p=l&&s?jV(s):void 0,m=l?cV(f,p)??{}:dV;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?eV([m.ref,sV(n),...o]):$B(m.ref,sV(n),o):$B(null,null)),l?(u!==void 0&&(m.className=DV(m.className,u)),d!==void 0&&(m.style=cV(m.style,d)),m):dV}function jV(e){return Array.isArray(e)?_V(e):gV(void 0,e)}var MV=Symbol.for(`react.lazy`);function NV(e){if(e?.$$typeof!==MV)return e;let t=R.Children.toArray(e)[0];return R.isValidElement(t)?t:e}function PV(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=gV(n,t.props);return e.ref=n.ref,R.cloneElement(t,e)}return FV(e,n)}function FV(e,t){return e===`button`?(0,R.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,R.createElement)(`img`,{alt:``,...t,key:t.key}):R.createElement(e,t)}function IV(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var LV=IV(`https://base-ui.com/production-error`,`Base UI`),RV=R.createContext(void 0);function zV(){let e=R.useContext(RV);if(e===void 0)throw Error(LV(13));return e}var BV={imageLoadingStatus:()=>null},VV=R.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=R.useState(`idle`),c={imageLoadingStatus:o},l=R.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=kV(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:BV});return(0,z.jsx)(RV.Provider,{value:l,children:u})}),HV={...R},UV=HV.useInsertionEffect,WV=UV&&UV!==HV.useLayoutEffect?UV:e=>e();function GV(e){let t=QB(KV).current;return t.next=e,WV(t.effect),t.trampoline}function KV(){let e={next:void 0,callback:qV,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function qV(){}var $=typeof document<`u`?R.useLayoutEffect:()=>{};function JV(e){R.useEffect(e,uV)}var YV=null;globalThis.requestAnimationFrame;var XV=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},ZV=class e{static create(){return new e}static request(e){return XV.request(e)}static cancel(e){return XV.cancel(e)}currentId=YV;request(e){this.cancel(),this.currentId=XV.request(()=>{this.currentId=YV,e()})}cancel=()=>{this.currentId!==YV&&(XV.cancel(this.currentId),this.currentId=YV)};disposeEffect=()=>this.cancel};function QV(){let e=QB(ZV.create).current;return JV(e.disposeEffect),e}function $V(e){return e==null?e:`current`in e?e.current:e}function eH(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var tH=`data-starting-style`,nH=`data-ending-style`,rH=null;function iH(e){if(!rH){let e=[];rH=e,queueMicrotask(()=>{rH=null,Ty.flushSync(()=>{for(let t of e)t()})})}rH.push(e)}function aH(e,t=!1,n=!1){let r=QV();return GV((i,a=null)=>{r.cancel();let o=$V(e);if(o==null)return;let s=o,c=()=>{n?iH(()=>{a?.aborted||i()}):Ty.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(eH(s).map(e=>e.finished.then(lV))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(eH(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=tH;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function oH(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=GV(a),s=aH(r,n,i);R.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var sH={[tH]:``},cH={[nH]:``},lH={transitionStatus(e){return e===`starting`?sH:e===`ending`?cH:null}};function uH(e,t=!1,n=!1,r=!1){let[i,a]=R.useState(e&&t?`idle`:void 0),[o,s]=R.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),$(()=>{if(!e&&o&&i!==`ending`&&n){let e=ZV.request(()=>{a(`ending`)});return()=>{ZV.cancel(e)}}},[e,o,i,n]),$(()=>{if(!e||t||i===void 0)return;let n=ZV.request(()=>{a(void 0)});return()=>{ZV.cancel(n)}},[t,e,i]),$(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=ZV.request(()=>{a(`idle`)});return()=>{ZV.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function dH(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=R.useState(`idle`),s=o[1];return $(()=>{if(!a)return lV;if(!e&&!i)return s(`error`),lV;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var fH={...BV,...lH},pH=R.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=zV(),[f,p]=dH(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=uH(m),v=R.useRef(null),y=R.useRef(!0);$(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=GV(e=>{i?.(e),d(e)});$(()=>{f!==`idle`&&x(f)},[f,x]),$(()=>()=>d(`idle`),[d]),oH({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=kV(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:fH,enabled:C});return C?T:null}),mH=0,hH=class e{static create(){return new e}currentId=mH;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=mH,t()},e)}isStarted(){return this.currentId!==mH}clear=()=>{this.currentId!==mH&&(clearTimeout(this.currentId),this.currentId=mH)};disposeEffect=()=>this.clear};function gH(){let e=QB(hH.create).current;return JV(e.disposeEffect),e}var _H=R.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=zV(),[c,l]=R.useState(i===0),u=gH();return R.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),kV(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:BV,enabled:s!==`loaded`&&(i===0||c)})}),vH=`-`,yH=e=>{let t=CH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(vH);return n[0]===``&&n.length!==1&&n.shift(),bH(n,t)||SH(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},bH=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?bH(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(vH);return t.validators.find(({validator:e})=>e(a))?.classGroupId},xH=/^\[(.+)\]$/,SH=e=>{if(xH.test(e)){let t=xH.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},CH=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return DH(Object.entries(e.classGroups),n).forEach(([e,n])=>{wH(n,r,e,t)}),r},wH=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:TH(t,e);r.classGroupId=n}else if(typeof e==`function`){if(EH(e)){wH(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n})}else Object.entries(e).forEach(([e,i])=>{wH(i,TH(t,e),n,r)})})},TH=(e,t)=>{let n=e;return t.split(vH).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},EH=e=>e.isThemeGetter,DH=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,OH=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},kH=`!`,AH=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(kH);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},jH=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},MH=e=>({cache:OH(e.cacheSize),parseClassName:AH(e),...yH(e)}),NH=/\s+/,PH=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(NH),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f||(p=r(u),!p)){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=jH(c).join(`:`),h=l?m+kH:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function FH(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=IH(t))&&(r&&(r+=` `),r+=n);return r}var IH=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=IH(e[r]))&&(n&&(n+=` `),n+=t);return n};function LH(e,...t){let n,r,i,a=o;function o(o){return n=MH(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=PH(e,n);return i(e,a),a}return function(){return a(FH.apply(null,arguments))}}var RH=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},zH=/^\[(?:([a-z-]+):)?(.+)\]$/i,BH=/^\d+\/\d+$/,VH=new Set([`px`,`full`,`screen`]),HH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,UH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qH=e=>YH(e)||VH.has(e)||BH.test(e),JH=e=>cU(e,`length`,lU),YH=e=>!!e&&!Number.isNaN(Number(e)),XH=e=>cU(e,`number`,YH),ZH=e=>!!e&&Number.isInteger(Number(e)),QH=e=>e.endsWith(`%`)&&YH(e.slice(0,-1)),$H=e=>zH.test(e),eU=e=>HH.test(e),tU=new Set([`length`,`size`,`percentage`]),nU=e=>cU(e,tU,uU),rU=e=>cU(e,`position`,uU),iU=new Set([`image`,`url`]),aU=e=>cU(e,iU,fU),oU=e=>cU(e,``,dU),sU=()=>!0,cU=(e,t,n)=>{let r=zH.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},lU=e=>UH.test(e)&&!WH.test(e),uU=()=>!1,dU=e=>GH.test(e),fU=e=>KH.test(e),pU=LH(()=>{let e=RH(`colors`),t=RH(`spacing`),n=RH(`blur`),r=RH(`brightness`),i=RH(`borderColor`),a=RH(`borderRadius`),o=RH(`borderSpacing`),s=RH(`borderWidth`),c=RH(`contrast`),l=RH(`grayscale`),u=RH(`hueRotate`),d=RH(`invert`),f=RH(`gap`),p=RH(`gradientColorStops`),m=RH(`gradientColorStopPositions`),h=RH(`inset`),g=RH(`margin`),_=RH(`opacity`),v=RH(`padding`),y=RH(`saturate`),b=RH(`scale`),x=RH(`sepia`),S=RH(`skew`),C=RH(`space`),w=RH(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,$H,t],O=()=>[$H,t],k=()=>[``,qH,JH],A=()=>[`auto`,YH,$H],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],ee=()=>[``,`0`,$H],F=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],I=()=>[YH,$H];return{cacheSize:500,separator:`:`,theme:{colors:[sU],spacing:[qH,JH],blur:[`none`,``,eU,$H],brightness:I(),borderColor:[e],borderRadius:[`none`,``,`full`,eU,$H],borderSpacing:O(),borderWidth:k(),contrast:I(),grayscale:ee(),hueRotate:I(),invert:ee(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[QH,JH],inset:D(),margin:D(),opacity:I(),padding:O(),saturate:I(),scale:I(),sepia:ee(),skew:I(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,$H]}],container:[`container`],columns:[{columns:[eU]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),$H]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,ZH,$H]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,$H]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:[`first`,`last`,`none`,ZH,$H]}],"grid-cols":[{"grid-cols":[sU]}],"col-start-end":[{col:[`auto`,{span:[`full`,ZH,$H]},$H]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[sU]}],"row-start-end":[{row:[`auto`,{span:[ZH,$H]},$H]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,$H]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,$H]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,$H,t]}],"min-w":[{"min-w":[$H,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[$H,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[eU]},eU]}],h:[{h:[$H,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[$H,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[$H,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[$H,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,eU,JH]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,XH]}],"font-family":[{font:[sU]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,$H]}],"line-clamp":[{"line-clamp":[`none`,YH,XH]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,qH,$H]}],"list-image":[{"list-image":[`none`,$H]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,$H]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,qH,JH]}],"underline-offset":[{"underline-offset":[`auto`,qH,$H]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$H]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$H]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),rU]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,nU]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},aU]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[qH,$H]}],"outline-w":[{outline:[qH,JH]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[qH,JH]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,eU,oU]}],"shadow-color":[{shadow:[sU]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,eU,$H]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,$H]}],duration:[{duration:I()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,$H]}],delay:[{delay:I()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,$H]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ZH,$H]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,$H]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$H]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$H]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[qH,JH,XH]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function mU(e){return kV(e.defaultTagName??`div`,e,e)}var hU=R.createContext(void 0);function gU(e=!1){let t=R.useContext(hU);if(t===void 0&&!e)throw Error(LV(16));return t}function _U(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:R.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function vU(e){return e?.ownerDocument||document}function yU(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(le(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function bU(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=R.useRef(null),s=gU(!0),c=a??s!==void 0,{props:l}=_U({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=R.useCallback(()=>{let e=o.current;xU(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return $(u,[u]),{getButtonProps:R.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return gV({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(EV(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=xU(r),s=!i&&SU(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),yU(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),yU(r,e)))},onKeyUp(e){t||(EV(e),a?.(e),e.target===e.currentTarget&&i&&c&&xU(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),yU(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:GV(e=>{o.current=e,u()})}}function xU(e){return d(e)&&e.tagName===`BUTTON`}function SU(e){return d(e)&&e.tagName===`A`&&!!e.href}var CU=R.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=bU({disabled:i,focusableWhenDisabled:a,native:o});return kV(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),wU=R.createContext(void 0);function TU(e){let t=R.useContext(wU);if(t===void 0&&!e)throw Error(LV(33));return t}var EU=R.createContext(void 0);function DU(e){let t=R.useContext(EU);if(t===void 0&&!e)throw Error(LV(36));return t}var OU=`data-open`,kU=`data-closed`,AU=`data-anchor-hidden`,jU=`data-popup-open`,MU=`data-pressed`,NU={[jU]:``},PU={[jU]:``,[MU]:``},FU={[OU]:``},IU={[kU]:``},LU={[AU]:``},RU={open(e){return e?NU:null}},zU={open(e){return e?PU:null}},BU={open(e){return e?FU:IU},anchorHidden(e){return e?LU:null}},VU={...BU,...lH},HU=R.createContext(void 0);function UU(e=!0){let t=R.useContext(HU);if(t===void 0&&!e)throw Error(LV(25));return t}var WU=`none`,GU=`trigger-press`,KU=`trigger-hover`,qU=`trigger-focus`,JU=`outside-press`,YU=`item-press`,XU=`focus-out`,ZU=`escape-key`,QU=`list-navigation`,$U=`keyboard`,eW=`pointer`,tW=`cancel-open`,nW=`sibling-open`,rW=`disabled`,iW=`missing`,aW=`initial`,oW=`imperative-action`,sW=`window-resize`;function cW({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=R.useRef(e!==void 0),[a,o]=R.useState(()=>t);return[i&&e!==void 0?e:a,R.useCallback(e=>{i||o(e)},[])]}var lW=R.createContext(null);function uW(e=`root`){let t=R.useContext(lW),n=R.useContext(EU);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var dW={visible:!0,ref:null};function fW(){return dW}function pW(e,t,n=`root`){let r=uW(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??fW)({label:e.label,children:e.children,render:e.render}),a=$B(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var mW=R.createContext(void 0);function hW(){let e=R.useContext(mW);if(e===void 0)throw Error(LV(30));return e}function gW(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:_W,platform:vW,maxTouchPoints:yW}=gW(),bW=_W.toLowerCase(),xW=vW.toLowerCase(),SW=/^i(os$|p)/.test(xW)||xW===`macintel`&&yW>1,CW=`android`,wW=xW===CW||bW.includes(CW),TW=!SW&&xW.startsWith(`mac`);xW.startsWith(`win`),!wW&&/^(linux|chrome os)/.test(xW);var EW=TW||SW,DW=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!DW&&bW.includes(`firefox`),!DW&&bW.includes(`chrom`);var OW=EW,kW=/jsdom|happydom/.test(bW);function AW(e){e.preventDefault()}function jW(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=DU(),u=UU(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return R.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?AW:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:YU})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!TW&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&yU(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var MW={type:`regular-item`};function NW(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=R.useRef(null),{getButtonProps:d,buttonRef:f}=bU({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=jW({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=R.useCallback(e=>gV(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=$B(u,f);return R.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var PW=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function FW(){return R.useContext(PW)}function IW(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=FW(),u=R.useRef(-1),[d,f]=R.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=R.useRef(null),h=R.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return $(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function LW(){let[,e]=R.useState({});return R.useCallback(()=>{e({})},[])}var RW=0;function zW(e,t=`mui`){let n=R.useRef(void 0),r=LW(),i=e??n.current;return R.useEffect(()=>{n.current??(RW+=1,n.current=`${t}-${RW}`,e??r())},[e,t,r]),i}var BW=HV.useId;function VW(e,t){if(BW!==void 0){let n=BW();return e??(t?`${t}-${n}`:n)}return zW(e,t)}function HW(e){return VW(e,`base-ui`)}var UW=`data-checked`,WW=`data-unchecked`,GW={checked(e){return e?{[UW]:``}:{[WW]:``}},...lH};function KW(e,t,n,r){let i=!1,a=!1,o=r??dV;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function qW(e,t,n){let r=n??dV;return{reason:e,event:t??new Event(`base-ui`),...r}}var JW=R.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l=!1,onCheckedChange:u,style:d,...f}=e,{store:p}=DU(),m=IW({guess:!0,label:a}),h=HW(i),g=p.useState(`disabled`),_=p.useState(`isActive`,m.index),v=p.useState(`floatingNodeId`),y=p.useState(`itemProps`),b=s||g,{getItemProps:x,itemRef:S}=NW({closeOnClick:c,disabled:b,highlighted:_,id:h,store:p,nativeButton:o,nodeId:v,itemMetadata:MW}),C=R.useMemo(()=>({disabled:b,highlighted:_,checked:l}),[b,_,l]);function w(e){let t=KW(YU,e.nativeEvent,void 0,{preventUnmountOnClose:lV});u?.(!l,t)}let T=kV(`div`,e,{state:C,stateAttributesMapping:GW,props:[y,{role:`menuitemcheckbox`,"aria-checked":l,onClick:w},f,x],ref:[S,t,m.ref]});return(0,z.jsx)(mW.Provider,{value:C,children:T})}),YW=R.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:i,...a}=e,[o,s]=cW({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),c=pW(e,t);function l(e,t){i?.(e,t),t.isCanceled||s(e)}return c.visible?(0,z.jsx)(JW,{...a,checked:o,onCheckedChange:l,ref:c.ref}):null}),XW=R.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=hW(),c=R.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=uH(s.checked);return oH({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),kV(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:GW,props:{"aria-hidden":!0,...o},enabled:a||u})}),ZW=R.createContext(void 0);function QW(){let e=R.useContext(ZW);if(e===void 0)throw Error(LV(31));return e}var $W=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=R.useState(void 0),c=kV(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,z.jsx)(ZW.Provider,{value:s,children:c})}),eG=R.forwardRef(function(e,t){let n=uW()?.Group??$W;return(0,z.jsx)(n,{...e,ref:t})}),tG=R.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=HW(a),c=QW();return $(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),kV(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),nG=R.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=DU(),f=IW({guess:!0,label:a}),p=HW(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=NW({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:MW});return kV(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),rG=R.forwardRef(function(e,t){let n=pW(e,t);return n.visible?(0,z.jsx)(nG,{...e,ref:n.ref}):null});function iG(e){e.preventDefault(),e.stopPropagation()}function aG(e){return`nativeEvent`in e}function oG(e){return e.pointerType===``&&e.isTrusted?!0:wW&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function sG(e){return kW?!1:!wW&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(wW||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function cG(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function lG(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function uG(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function dG(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function fG(e,t){let n=e;for(;n;){if(S(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(f(n)?n.host:null)}return null}function pG(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var mG=`data-base-ui-focusable`,hG=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,gG=`ArrowLeft`,_G=`ArrowRight`,vG=`ArrowUp`,yG=`ArrowDown`,bG=`data-trigger-disabled`;function xG(e,t){if(!S(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(bG);for(let[,e]of t.entries())if(dG(e,n))return!e.hasAttribute(bG);return!1}function SG(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function CG(e){return e.matches(`html,body`)}function wG(e){return d(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function TG(e){return fG(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${hG}`)!=null}function EG(e){return e?e.getAttribute(`role`)===`combobox`&&wG(e):!1}function DG(e){if(!e||kW)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function OG(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function kG(e,t){return t!=null&&!cG(t)?0:typeof e==`function`?e():e}function AG(e,t,n){let r=kG(e,n);return typeof r==`number`?r:r?.[t]}function jG(e){return typeof e==`function`?e():e}function MG(e,t){return t||e===`click`||e===`mousedown`}function NG(e){return e?.includes(`mouse`)&&e!==`mousedown`}var PG=R.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new hH,currentIdRef:{current:null},currentContextRef:{current:null}});function FG(e,t){e.current=t.current}function IG(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=R.useRef(n),a=R.useRef(n),o=R.useRef(null),s=R.useRef(null),c=gH();return $(()=>{a.current=n,o.current?i.current={open:AG(i.current,`open`),close:AG(n,`close`)}:i.current=n},[n,o,i,a]),(0,z.jsx)(PG.Provider,{value:R.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function LG(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=R.useContext(PG),[d,f]=R.useState(!1),p=R.useRef(n);return $(()=>{p.current=n},[n]),$(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),$(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:AG(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,KW(WU))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),$(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,FG(a,s),u.clear()}},[c,i,a,r,s,u]),R.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function RG(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zG(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function BG(e){let t=QB(VG,e).current;return t.next=e,$(t.effect),t}function VG(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var HG={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},UG={...HG,position:`fixed`,margin:0,top:0,left:0},WG={...HG,position:`absolute`},GG=R.forwardRef(function(e,t){let[n,r]=R.useState();$(()=>{OW&&DW&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,z.jsx)(`span`,{...e,ref:t,style:UG,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function KG(e,t){return t<0||t>=e.length}function qG(e,t){return XG(e.current,{disabledIndices:t})}function JG(e,t){return XG(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function YG(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>XG(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:KG(e,u)?-1:u,wrapped:d}}function XG(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ZG(e,a,r));return a}function ZG(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!$G(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function QG(e){return e.visibility===`hidden`||e.visibility===`collapse`}function $G(e,t=e?E(e):null){return!e||!e.isConnected||!t||QG(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var eK=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function tK(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return f(n)?n.host:null}function nK(e){for(let t of Array.from(e.children))if(oe(t)===`summary`)return t;return null}function rK(e,t){let n=nK(t);return!!n&&(e===n||dG(n,e))}function iK(e){let t=e?oe(e):``;return e!=null&&e.matches(eK)&&(t!==`summary`||e.parentElement!=null&&oe(e.parentElement)===`details`&&nK(e.parentElement)===e)&&(t!==`details`||nK(e)==null)&&(t!==`input`||e.type!==`hidden`)}function aK(e){if(!iK(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=tK(t)){let n=t!==e,r=oe(t)===`slot`;if(t.hasAttribute(`inert`)||n&&oe(t)===`details`&&!t.open&&!rK(e,t)||t.hasAttribute(`hidden`)||!r&&!oK(t,n))return!1}return!0}function oK(e,t){let n=E(e);return t?n.display!==`none`:$G(e,n)}function sK(e){let t=e.tabIndex;if(t<0){let t=oe(e);if(t===`details`||t===`audio`||t===`video`||d(e)&&e.isContentEditable)return 0}return t}function cK(e){if(oe(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function lK(e,t){let n=cK(e);if(!n)return!0;let r=t.find(e=>{let t=cK(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cK(e);return t?.name===n.name&&t.form===n.form})===n}function uK(e){if(d(e)&&oe(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return d(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dK(e,t){uK(e).forEach(e=>{iK(e)&&t.push(e),dK(e,t)})}function fK(e,t,n){uK(e).forEach(e=>{d(e)&&e.matches(t)&&n.push(e),fK(e,t,n)})}function pK(e){return aK(e)&&sK(e)>=0}function mK(e){let t=[];return dK(e,t),t.filter(aK)}function hK(e){let t=mK(e);return t.filter(e=>sK(e)>=0&&lK(e,t))}function gK(e,t){let n=hK(e),r=n.length;if(r===0)return;let i=uG(vU(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _K(e){return gK(vU(e).body,1)||e}function vK(e){return gK(vU(e).body,-1)||e}function yK(e,t,n){if(!e)return null;let r=[];dK(vU(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(aK);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!dG(n,o)&&pK(o)&&lK(o,a))return o}return r[i]}function bK(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!dG(n,r)}function xK(e){hK(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function SK(e){let t=[];fK(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function CK(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...CK(e,t.id,n)])}function wK(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function TK(e){return`data-base-ui-${e}`}var EK=0;function DK(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(EK);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),lV;let o=requestAnimationFrame(a);return EK=o,()=>{EK===o&&(cancelAnimationFrame(o),EK=0)}}var OK=`data-base-ui-inert`,kK=new WeakMap,AK=new WeakSet,jK=new WeakMap,MK=0;function NK(e){return e?f(e)?e.host:NK(e.parentNode):null}var PK=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=NK(t);return e.contains(n)?n:null}).filter(e=>e!=null),FK=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},IK=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{oe(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function LK(e,t,n,{mark:r=!0}){let i=PK(t,e),a=r?IK(t,FK(i),new Set(i)):[],o=[],s=[];if(n){let e=PK(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);IK(t,FK(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(kK.get(e)||0)+1;kK.set(e,r),o.push(e),r===1&&n&&AK.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(jK.get(e)||0)+1;jK.set(e,t),s.push(e),t===1&&e.setAttribute(OK,``)}),MK+=1,()=>{o.forEach(e=>{let t=(kK.get(e)||0)-1;kK.set(e,t),t||(AK.has(e)||e.removeAttribute(`aria-hidden`),AK.delete(e))}),r&&s.forEach(e=>{let t=(jK.get(e)||0)-1;jK.set(e,t),t||e.removeAttribute(OK)}),--MK,MK||(kK=new WeakMap,AK=new WeakSet,jK=new WeakMap)}}function RK(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=vU(e[0]).body;return LK(e,i,n,{mark:r})}var zK={style:{transition:`none`}},BK=`data-base-ui-click-trigger`,VK={fallbackAxisSide:`none`},HK={fallbackAxisSide:`end`},UK={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},WK=R.createContext(null),GK=()=>R.useContext(WK),KK=TK(`portal`);function qK(e={}){let{ref:t,container:n,componentProps:r=dV,elementProps:i}=e,a=VW(),o=GK()?.portalNode,[s,c]=R.useState(null),[l,u]=R.useState(null),d=GV(e=>{e!==null&&u(e)}),f=R.useRef(null);$(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(w(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=kV(`div`,r,{ref:[t,d],props:[{id:a,[KK]:``},i]}),m=s&&p?Ty.createPortal(p,s):null;return{node:l,nodeId:R.isValidElement(p)?p.props.id:void 0,subtree:m}}var JK=R.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=qK({container:o,ref:t,componentProps:e,elementProps:c}),f=R.useRef(null),p=R.useRef(null),m=R.useRef(null),h=R.useRef(null),[g,_]=R.useState(null),v=R.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;R.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&bK(e)&&(e.type===`focusin`?v.current&&=(SK(l),!1):(xK(l),v.current=!0))}return zG(RG(l,`focusin`,e,!0),RG(l,`focusout`,e,!0))},[l,y]),$(()=>{l&&b===!0&&v.current&&(SK(l),v.current=!1)},[b,l]);let S=R.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,z.jsxs)(R.Fragment,{children:[d,(0,z.jsxs)(WK.Provider,{value:S,children:[x&&l&&(0,z.jsx)(GG,{"data-type":`outside`,ref:f,onFocus:e=>{bK(e,l)?m.current?.focus():vK(g?g.domReference:null)?.focus()}}),x&&l&&(0,z.jsx)(`span`,{role:s,"aria-owns":u,style:UK}),l&&Ty.createPortal(a,l),x&&l&&(0,z.jsx)(GG,{"data-type":`outside`,ref:p,onFocus:e=>{bK(e,l)?h.current?.focus():(_K(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,KW(`focus-out`,e.nativeEvent)))}})]})]})});function YK(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var XK=class{nodesRef={current:[]};events=YK();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ZK=R.createContext(null),QK=R.createContext(null),$K=()=>R.useContext(ZK)?.id||null,eq=e=>{let t=R.useContext(QK);return e??t};function tq(e){let t=VW(),n=eq(e),r=$K();return $(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function nq(e){let{children:t,id:n}=e,r=$K();return(0,z.jsx)(ZK.Provider,{value:R.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function rq(e){let{children:t,externalTree:n}=e,r=QB(()=>n??new XK).current;return(0,z.jsx)(QK.Provider,{value:r,children:t})}function iq(e,t){let n=le(pG(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(oG(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var aq=20,oq=[];function sq(){oq=oq.filter(e=>e.deref()?.isConnected)}function cq(e){sq(),e&&oe(e)!==`body`&&(oq.push(new WeakRef(e)),oq.length>aq&&(oq=oq.slice(-20)))}function lq(){return sq(),oq[oq.length-1]?.deref()}function uq(e){return e?pK(e)?e:hK(e)[0]||e:null}function dq(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mK(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pK(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function fq(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=GV(()=>x.current.floatingContext?.nodeId),C=i===!1,w=EG(v)&&C,T=BG(i),E=BG(a),D=BG(o),O=BG(u),k=BG(_),A=eq(h),j=GK(),M=R.useRef(!1),N=R.useRef(!1),P=R.useRef(!1),ee=R.useRef(null),F=R.useRef(``),I=R.useRef(``),te=R.useRef(null),ne=R.useRef(null),L=$B(te,m,j?.beforeInsideRef),re=$B(ne,j?.afterInsideRef),ie=gH(),ae=gH(),se=QV(),ce=j!=null,le=OG(y),ue=GV((e=le)=>e?hK(e):[]),de=GV(()=>g?.().filter(e=>e!=null)??[]);R.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&dG(le,uG(vU(le)))&&ue().length===0&&!w&&iG(e)}return RG(vU(le),`keydown`,e)},[r,le,c,w,ue]),R.useEffect(()=>{if(r||!_)return;let e=vU(le);function t(){P.current=!1}function n(e){let t=pG(e),n=de(),r=dG(y,t)||dG(v,t)||dG(j?.portalNode,t)||n.some(e=>e===t||dG(e,t));P.current=!r,I.current=e.pointerType||`keyboard`,fG(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,ae.start(0,()=>{N.current=!1}))}function i(){I.current=`keyboard`}return zG(RG(e,`pointerdown`,n,!0),RG(e,`pointerup`,t,!0),RG(e,`pointercancel`,t,!0),RG(e,`keydown`,i,!0),t)},[r,y,v,le,_,j,ae,de]),R.useEffect(()=>{if(r||!l)return;let e=vU(le);function n(){N.current=!0,ae.start(0,()=>{N.current=!1})}function i(e){let t=pG(e);pK(t)&&(ee.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=pG(n);c&&r==null&&a!=null&&dG(y,a)&&cq(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=de(),m=r?.hasAttribute(TK(`focus-guard`))&&[te.current,ne.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,$V(p),$V(f)].includes(r),h=!(dG(v,r)||dG(y,r)||dG(r,y)||dG(j?.portalNode,r)||u.some(e=>e===r||dG(e,r))||l.hasMatchingElement(e=>dG(e,r))||m||A&&(CK(A.nodesRef.current,o).find(e=>dG(e.context?.elements.floating,r)||dG(e.context?.elements.domReference,r))||wK(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,OG(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&le&&dq(le),s&&i!==v&&!$G(a)&&uG(e)===e.body){if(d(le)&&(le.focus(),s===`popup`)){se.request(()=>{le.focus()});return}let e=ue(),t=ee.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||le;d(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&h&&!N.current&&(w||r!==lq())&&(M.current=!0,t.setOpen(!1,KW(XU,n)))})}function o(){P.current||(x.current.insideReactTree=!0,ie.start(0,()=>{x.current.insideReactTree=!1}))}let u=d(v)?v:null;if(y||u)return zG(u&&RG(u,`focusout`,a),u&&RG(u,`pointerdown`,n),y&&RG(y,`focusin`,i),y&&RG(y,`focusout`,a),y&&j&&RG(y,`focusout`,o,!0))},[r,v,y,le,c,A,j,t,l,s,ue,w,S,x,ie,ae,se,f,p,de]),R.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${TK(`portal`)}]`)||[]),t=(A?wK(A.nodesRef.current,S()):[]).find(e=>EG(e.context?.elements.domReference||null))?.context?.elements.domReference,n=RK([y,...e,te.current,ne.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...de(),t,$V(p),$V(f),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=RK([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,j,w,A,S,f,p,de]),$(()=>{if(!_||r||!d(le))return;F.current=``,I.current=``;let e=vU(le),t=uG(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||dG(le,t))return;let i=null,a=()=>(i??=ue(le),i[0]||le),o;o=r===!0||r===null?a():$V(r),o||=a();let s=dG(le,uG(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&oG(c);DK(o,{sync:l,preventScroll:o===le,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=uG(e);return!(t!==o&&dG(le,t))}})})},[r,_,le,ue,T,O,k,x]);let fe=R.useRef(null);$(()=>{if(r||!le){fe.current=null;return}fe.current&&=(fe.current.cancelled=!0,null);let e=vU(le),t=uG(e),n=O.current==null;cq(t);function i(e){if(e.open||(F.current=iq(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(TK(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(oG(e.nativeEvent)||sG(e.nativeEvent))M.current=!1;else{let e=!1;vU(le).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&oe(t)!==`body`?t:null,s=n?o||a:a||o;return s||=lq()||null,typeof i==`boolean`?s:$V(i)||s||null}return()=>{b.off(`openchange`,i);let t=uG(e),n=de(),r=dG(y,t)||n.some(e=>e===t||dG(e,t))||A&&CK(A.nodesRef.current,S(),!1).some(e=>dG(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s),l={cancelled:!1};fe.current=l,queueMicrotask(()=>{fe.current===l&&(fe.current=null);let n=uq(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&d(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,le,E,D,O,b,A,v,S,de]),$(()=>{if(!DW||_||!y)return;let e=uG(vU(y));d(e)&&wG(e)&&dG(y,e)&&e.blur()},[_,y]),$(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),$(()=>{if(!r&&le)return dq(le),()=>{queueMicrotask(sq)}},[r,le]);let pe=!r&&(!c||!w)&&(ce||c);return(0,z.jsxs)(R.Fragment,{children:[pe&&(0,z.jsx)(GG,{"data-type":`inside`,ref:L,onFocus:e=>{if(c){let e=ue();DK(e[e.length-1])}else j?.portalNode&&(M.current=!1,bK(e,j.portalNode)?_K(v)?.focus():$V(p??j.beforeOutsideRef)?.focus())}}),n,pe&&(0,z.jsx)(GG,{"data-type":`inside`,ref:re,onFocus:e=>{c?DK(ue()[0]):j?.portalNode&&(l&&(M.current=!0),bK(e,j.portalNode)?vK(v)?.focus():$V(f??j.afterOutsideRef)?.focus())}})]})}function pq(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=GU}=t,l=e.context.dataRef,u=R.useRef(void 0),d=QV(),f=gH(),p=R.useMemo(()=>{function t(t,n,r,i){let a=KW(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=cG(e.pointerType,!0)&&sG(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||cG(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=pG(s),p=wG(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:cG(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return R.useMemo(()=>n?{reference:p}:dV,[n,p])}function mq(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function hq(e){return e!=null&&e.clientX!=null}function gq(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=R.useRef(!1),l=R.useRef(null),[u,d]=R.useState(),[f,p]=R.useState([]),m=GV(t=>{e.set(`positionReference`,t)}),h=GV((t,n,i)=>{c.current||(!s.current.openEvent||hq(s.current.openEvent))&&e.set(`positionReference`,mq(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=GV(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=cG(u)?a:i;R.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=le(a);function r(t){let n=pG(t);dG(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||hq(s.current.openEvent)?l.current=RG(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),R.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),R.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),R.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=R.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return R.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function _q(){return!1}function vq(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function yq(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=_q,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:p,events:m}=e.context,h=eq(c),g=GV(typeof i==`function`?i:()=>!1),_=typeof i==`function`?g:i,v=_!==!1,y=GV(()=>a),{escapeKey:b,outsidePress:x}=vq(s),C=R.useRef(!1),w=R.useRef(!1),T=R.useRef(!1),O=R.useRef(!1),k=R.useRef(!1),A=R.useRef(``),j=R.useRef(null),M=gH(),N=gH(),P=gH(),ee=GV(()=>{N.clear(),p.current.insideReactTree=!1}),F=GV(e=>{let t=p.current.floatingContext?.nodeId;return(h?CK(h.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=GV(t=>SG(t,e.select(`floatingElement`))||SG(t,e.select(`domReferenceElement`))),te=GV(t=>{o()&&e.setOpen(!1,KW(GU,t.nativeEvent))}),ne=GV(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=aG(t)?t.nativeEvent:t;if(k.current||i.isComposing||!b&&F(`__escapeKeyBubbles`))return;let a=KW(ZU,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!b&&!a.isPropagationAllowed&&t.stopPropagation()}),L=GV(()=>{p.current.insideReactTree=!0,N.start(0,ee)}),re=GV(t=>{if(!l||!n||t.button!==0)return;let r=pG(t.nativeEvent);dG(e.select(`floatingElement`),r)&&(C.current||(C.current=!0,w.current=!1))}),ie=GV(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)});R.useEffect(()=>{function e(e){e.open||(O.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),R.useEffect(()=>ee,[ee]),R.useEffect(()=>{if(!l||!n)return l||(O.current=!1,k.current=!1,A.current=``,j.current=null),ee;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=x;let t=new hH,i=vU(u);function a(){P.clear(),k.current=!0}function o(){k.current=!0,P.start(DW?5:0,()=>{k.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function c(){C.current=!1,w.current=!1}function m(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function g(e){let t=m();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function N(e){let t=p.current.floatingContext?.nodeId,n=h&&CK(h.nodesRef.current,t).some(t=>SG(e,t.context?.elements.floating));return I(e)||n}function te(n){if(g(n)){n.type!==`click`&&!I(n)&&(t.clear(),T.current=!1),ee();return}if(p.current.insideReactTree){ee();return}let r=pG(n),i=`[${TK(`inert`)}]`,a=S(r)?r.getRootNode():null,o=Array.from((f(a)?a:vU(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>dG(e,r))))return;let c=S(r)?r:null;for(;c&&!ce(c);){let e=D(c);if(ce(e)||!S(e))break;c=e}if(!(o.length&&S(r)&&!CG(r)&&!dG(r,e.select(`floatingElement`))&&o.every(e=>!dG(c,e)))){if(d(r)&&!(`touches`in n)){let e=ce(r),t=E(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!N(n)){if(m()===`intentional`){if(n.detail!==0&&!oG(n)&&!O.current)return;if(T.current){t.clear(),T.current=!1;return}}typeof _==`function`&&!_(n)||F(`__outsidePressBubbles`)||(e.setOpen(!1,KW(JU,n)),ee())}}}function L(t){m()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!I(t)&&te(t)}function re(t){if(m()!==`sloppy`||!e.select(`open`)||!n||I(t))return;let r=t.touches[0];r&&(j.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ie(e,t){let n=pG(e);if(!n)return;let r=RG(n,e.type,()=>{t(e),r()})}function ae(e){A.current=`touch`,ie(e,re)}function oe(e){M.clear(),e.type===`pointerdown`&&(e.button===0&&(O.current=!0),A.current=e.pointerType),(e.type!==`mousedown`||!j.current||j.current.dismissOnMouseDown)&&ie(e,e=>{e.type===`pointerdown`?L(e):te(e)})}function se(e){if(e.type===`pointercancel`&&(O.current=!1),!C.current)return;let n=w.current;c(),m()===`intentional`&&(e.type===`pointercancel`?n&&s():N(e)||(n?s():(typeof _!=`function`||_(e))&&(t.clear(),T.current=!0,ee())))}function le(e){if(m()!==`sloppy`||!j.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-j.current.startX),r=Math.abs(t.clientY-j.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(j.current.dismissOnTouchEnd=!0),i>10&&(te(e),M.clear(),j.current=null)}function ue(e){ie(e,le)}function de(e){m()===`sloppy`&&j.current&&!I(e)&&(j.current.dismissOnTouchEnd&&te(e),M.clear(),j.current=null)}function fe(e){ie(e,de)}let pe=zG(r&&zG(RG(i,`keydown`,ne),RG(i,`compositionstart`,a),RG(i,`compositionend`,o)),v&&zG(RG(i,`click`,oe,!0),RG(i,`pointerdown`,oe,!0),RG(i,`pointerup`,se,!0),RG(i,`pointercancel`,se,!0),RG(i,`mousedown`,oe,!0),RG(i,`mouseup`,se,!0),RG(i,`touchstart`,ae,{capture:!0,passive:!0}),RG(i,`touchmove`,ue,{capture:!0,passive:!0}),RG(i,`touchend`,fe,{capture:!0,passive:!0})));return()=>{pe(),t.clear(),c(),T.current=!1}},[p,u,r,v,_,l,n,b,x,ne,ee,y,F,I,h,e,M,P]);let ae=R.useMemo(()=>({onKeyDown:ne,onPointerDown:te,onClick:te}),[ne,te]),oe=R.useMemo(()=>({onKeyDown:ne,onPointerDown:ie,onMouseDown:ie,onClickCapture:L,onMouseDownCapture(e){L(),re(e)},onPointerDownCapture(e){L(),re(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[ne,L,re,ie]);return R.useMemo(()=>n?{reference:ae,floating:oe,trigger:ae}:{},[n,ae,oe])}function bq(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),$(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};S(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function xq(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=GV(i),{mounted:c,setMounted:l,transitionStatus:u}=uH(t,!1,!1,o),d=!t&&r;$(()=>{t&&s(!1)},[t,s]);let f=R.useRef(c),p=R.useRef(!1),m=LW(),h=()=>{f.current=!1,l(!1),a()};$(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=GV(()=>{f.current&&(t?(p.current=!0,m()):h())});return oH({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Sq={tabIndex:-1,[mG]:``};function Cq(e){return t=>t!==`touch`||e.current}function wq(e,t=!1){let n=VW(),r=$K()!=null,i=QB(()=>e(n,r)).current;return bq({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Tq({handle:e,store:t}){return $(()=>e.attachStore(t),[e,t]),null}function Eq(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Dq(e,t){let n=R.useRef(null);return GV(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Eq(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Eq(t))})}function Oq(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function kq(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Aq(e,t,n,r={}){let i=n.reason,a=i===KU,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=kq(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Oq(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Ty.flushSync(l):l()}function jq(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Dq(e,n),o=GV(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=GV(e=>{a(e),e&&o(e)});return $(()=>(s(t.current),()=>s(null)),[s,t,n,e]),$(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Mq(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=R.useRef(null),i=e.useState(`open`);$(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=KW(WU);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Nq(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=xq({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return QB(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Pq(e,t){e.useSyncedValues(t),$(()=>()=>{e.update({activeTriggerProps:dV,inactiveTriggerProps:dV,popupProps:dV})},[e])}function Fq(e,t){$(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),$(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Iq=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Lq=[],Rq=void 0;function zq(){return Rq}function Bq(e){Lq.push(e)}function Vq(e){let t=(t,n)=>{let r=QB(Uq).current,i;try{Rq=r;for(let e of Lq)e.before(r);i=e(t,n);for(let e of Lq)e.after(r);r.didInitialize=!0}finally{Rq=void 0}return i};return t.displayName=e.displayName||e.name,t}function Hq(e){return R.forwardRef(Vq(e))}function Uq(){return{didInitialize:!1}}var Wq=un(),Gq=tn(),Kq=oV(19)?Yq:Xq;function qq(e,t,n,r,i){return Kq(e,t,n,r,i)}function Jq(e,t,n,r,i){let a=R.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Wq.useSyncExternalStore)(e.subscribe,a,a)}Bq({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Wq.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Yq(e,t,n,r,i){let a=zq();if(!a)return Jq(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Xq(e,t,n,r,i){return(0,Gq.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Zq=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return qq(this,e,t,n,r)}},Qq=class extends Zq{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){R.useDebugValue(e);let n=this;$(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;$(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;$(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){R.useDebugValue(e);let n=this,r=t!==void 0;$(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return R.useDebugValue(e),qq(this,this.selectors[e],t,n,r)}useContextCallback(e,t){R.useDebugValue(e);let n=GV(t??lV);this.context[e]=n}useStateSetter(e){let t=R.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},$q={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},eJ=class extends Qq{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:YK(),nested:n,triggerElements:i},$q),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&lG(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function tJ(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new eJ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:dV,inactiveTriggerProps:dV,popupProps:dV}}var nJ=e=>e.triggerIdProp??e.activeTriggerId,rJ=e=>e.openProp??e.open,iJ=e=>(e.popupElement?.id??e.floatingId)||void 0;function aJ(e,t){return t!==void 0&&rJ(e)&&nJ(e)===t}function oJ(e,t){return aJ(e,t)?!0:t!==void 0&&rJ(e)&&nJ(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var sJ={open:rJ,mounted:e=>e.mounted,transitionStatus:e=>rJ(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:nJ,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:iJ,isTriggerActive:(e,t)=>t!==void 0&&nJ(e)===t,isOpenedByTrigger:(e,t)=>aJ(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nJ(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>oJ(e,t)?iJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function cJ(e){let t=R.useCallback(t=>e===void 0?lV:e.subscribeStore(t),[e]),n=R.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Wq.useSyncExternalStore)(t,n,()=>e?.serverStore)}function lJ(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=VW(),a=$K()!=null,o=QB(()=>new eJ({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Iq,floatingId:i,syncOnly:!1,nested:a})).current;return $(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=S(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var uJ=TW&&DW;function dJ(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=R.useRef(!1),s=R.useRef(null),c=R.useRef(!0),l=gH();R.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=le(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&d(t)&&t===uG(vU(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return zG(RG(r,`blur`,i),uJ&&RG(r,`keydown`,a,!0),uJ&&RG(r,`pointerdown`,l,!0))},[e,n]),R.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);S(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=R.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=pG(n.nativeEvent);if(S(a)){if(uJ&&!n.relatedTarget){if(!c.current&&!wG(a))return}else if(!DG(a))return}let u=xG(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,KW(qU,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,KW(qU,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=S(r)&&r.hasAttribute(TK(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=uG(vU(t));!r&&n===t||dG(a.current.floatingContext?.refs.floating.current,n)||dG(t,n)||o||xG(r??n,e.context.triggerElements)||e.setOpen(!1,KW(qU,i))})}}},[a,r,e,l]);return R.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var fJ=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new hH;restTimeout=new hH;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},pJ=new WeakMap;function mJ(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&pJ.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),pJ.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function hJ(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=pJ.get(n);a&&a!==e&&mJ(a),mJ(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,pJ.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function gJ(e){let t=e.context.dataRef.current,n=QB(()=>t.hoverInteractionState??fJ.create()).current;return t.hoverInteractionState||=n,JV(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function _J(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=eq(),u=$K(),d=gJ(e),f=gH(),p=GV(()=>MG(c.current.openEvent?.type,d.interactedInside)),m=GV(()=>NG(c.current.openEvent?.type)),h=GV(()=>{mJ(d)});$(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),R.useEffect(()=>h,[h]),$(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&S(s)&&o){let e=s,t=o,n=vU(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??fG(e,`[data-rootownerid]`)??n.body;return hJ(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),R.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&CK(l.nodesRef.current,u).length>0)}function a(t){let n=AG(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,KW(KU,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=pG(e);TG(t)?d.interactedInside=fG(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(xG(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&S(o)&&CK(l.nodesRef.current,r,!1).some(e=>dG(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,KW(KU,n)),l.events.emit(`floating.closed`,n)})}let y=o;return zG(y&&RG(y,`mouseenter`,g),y&&RG(y,`mouseleave`,_),y&&RG(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var vJ={current:null};function yJ(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=vJ,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=eq(l),v=gJ(e),y=R.useRef(!1),b=BG(i),x=BG(r),C=BG(o),w=BG(n),T=BG(p),E=BG(f),D=GV(()=>MG(h.current.openEvent?.type,v.interactedInside)),O=GV(()=>T.current?.()!==!1),k=GV((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!dG(t,n);if(!S(r))return!1;let a=r;return i.hasMatchingElement(e=>dG(e,a))&&(!t||!dG(t,a))}),A=GV(()=>{v.handler&&=(vU(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=GV(()=>{mJ(v)});return u&&(v.handleCloseOptions=i?.__options),R.useEffect(()=>A,[A]),R.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===KU,A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,A]),R.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=AG(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,KW(KU,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,KW(KU,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!S(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!cG(v.pointerType))return;let n=jG(C.current),r=AG(x.current,`open`,v.pointerType),i=pG(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(S(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(dG(t,i)){c=t;break}}S(o)&&S(s)&&!e.context.triggerElements.hasElement(o)&&dG(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&S(c)&&S(s)&&dG(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,KW(KU,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,KW(KU,t,c))}):g&&O()&&e.setOpen(!0,KW(KU,t,c)))}function o(n){if(D()){j();return}A();let r=vU(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!xG(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&dG(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){dG(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?RG(r,`mouseout`,l):void 0;return s?zG(RG(r,`mousemove`,i,{once:!0}),RG(r,`mouseenter`,i),RG(r,`mouseleave`,o),f):zG(RG(r,`mouseenter`,i),RG(r,`mouseleave`,o),f)},[A,j,h,x,e,n,b,v,u,k,D,a,s,C,c,_,w,d,E,O,m]),R.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!cG(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;hJ(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=jG(C.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,D())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,KW(KU,n,r))}v.pointerType===`touch`?Ty.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,C,O])}function bJ(e){return DW&&e.movementX===0&&e.movementY===0}function xJ(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function SJ(e,t){return xJ(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function CJ(e,t,n){return xJ(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function wJ(e,t,n){return xJ(t,n?e===gG:e===_G,e===yG)}function TJ(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:xJ(t,n?e===_G:e===gG,e===vG)}function EJ(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=OG(D),j=EG(O),M=BG(A),N=$K(),P=eq(S),ee=R.useRef(p),F=R.useRef(o??-1),I=R.useRef(null),te=R.useRef(!0),ne=GV(e=>{i(F.current===-1?null:F.current,e)}),L=R.useRef(!!D),re=R.useRef(E),ie=R.useRef(!1),ae=R.useRef(!1),oe=R.useRef(null),se=BG(g),ce=BG(E),le=BG(o),ue=BG(x),de=QV(),fe=QV(),pe=GV(()=>{de.cancel();function e(e){f||(oe.current=DK(e,{sync:ie.current,preventScroll:!0}))}let t=n.current[F.current],r=ae.current;t&&e(t),(ie.current?e=>e():e=>de.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),ye&&(r||!te.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});$(()=>{k.current.orientation=_},[k,_]),$(()=>{E||(I.current=null),E&&p===`auto`||(ee.current=p)},[E,p]),$(()=>{a&&(E&&D?(F.current=o??-1,ee.current&&o!=null&&(ae.current=!0,ne())):L.current&&(F.current=-1,ne()))},[a,E,D,o,ne]),$(()=>{if(a){if(!E)ie.current=!1;else if(D){if(r==null){if(ie.current=!1,le.current!=null)return;if(L.current&&(F.current=-1,pe()),(!re.current||!L.current)&&ee.current&&(I.current!=null||ee.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>fe.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||CJ(I.current,v,u)||l?qG(n):JG(n),I.current=null,ne())};t()}}else KG(n.current,r)||(F.current=r,pe(),ae.current=!1)}}},[a,E,D,r,le,l,n,v,u,ne,pe,fe]),$(()=>{if(!a||D||!P||f||!L.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=uG(vU(O??t??null)),r=e.some(e=>e.context&&dG(e.context.elements.floating,n));t&&!r&&te.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,f]),$(()=>{re.current=E,L.current=!!D});let me=r!=null,he=GV(e=>{if(!ce.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,ne(e))}),ge=GV(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),_e=GV(()=>qG(n,se.current)),ve=GV(t=>{if(te.current=!1,ie.current=!0,t.which===229||!ce.current&&t.currentTarget===M.current)return;if(l&&TJ(t.key,_,u,T)){SJ(t.key,ge())||iG(t),e.setOpen(!1,KW(QU,t.nativeEvent));let n=C?.current??O;d(n)&&n.focus();return}r!=null&&r!==F.current&&!KG(n.current,r)&&(F.current=r);let i=F.current,a=qG(n,g),o=JG(n,g);if(j||(t.key===`Home`&&(iG(t),F.current=a,ne(t)),t.key===`End`&&(iG(t),F.current=o,ne(t))),w!=null){let e=w(t,F.current,n,_,c,u,g,a,o);if(e!=null&&e!==F.current&&(F.current=e,ne(t)),_===`both`)return}if(SJ(t.key,_)){iG(t);let e=uG(t.currentTarget.ownerDocument);if(E&&!f&&dG(t.currentTarget,e)&&!n.current.some(t=>t!=null&&dG(t,e))){F.current=CJ(t.key,_,u)?a:o,ne(t),r===F.current&&pe();return}let{index:l,wrapped:d}=YG(n.current,i,{decrement:!CJ(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});d&&(ie.current=!1),F.current=l,ne(t)}}),ye=R.useMemo(()=>({onFocus(e){ie.current=!0,he(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){bJ(e)||(ie.current=!0,ae.current=!1,m&&he(e))},onPointerLeave(e){if(!ce.current||!te.current||e.pointerType===`touch`)return;ie.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&ue.current&&(oe.current?.(),oe.current=null,F.current=-1,ne(e),!f)){let e=M.current,t=uG(vU(e));e&&dG(e,t)&&e.focus({preventScroll:!0})}}}),[he,ce,M,m,n,ne,ue,f]),be=R.useMemo(()=>f&&E&&me&&{"aria-activedescendant":`${b}-${r}`},[f,E,me,b,r]),xe=R.useMemo(()=>({...j?{}:be,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!f){let n=pG(t.nativeEvent);if(n&&!dG(M.current,n))return;iG(t);let r=KW(XU,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&d(i)&&i.focus()}else ve(t)},onPointerMove(e){bJ(e)||(te.current=!0)}}),[be,ve,M,j,e,E,f,O,C]),Se=R.useMemo(()=>{function t(t){e.setOpen(!0,KW(QU,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&oG(e.nativeEvent)&&(ee.current=!f)}function r(e){ee.current=p,p===`auto`&&sG(e.nativeEvent)&&(ee.current=!0)}return{onKeyDown(n){let r=e.select(`open`);te.current=!1;let i=n.key.startsWith(`Arrow`),a=wJ(n.key,ge(),u),o=SJ(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!l||wG(n.currentTarget)))return ve(n);if(r||h||!i){if(s){let e=SJ(n.key,ge());I.current=l&&e?null:n.key}l?a&&(iG(n),r?(F.current=_e(),ne(n),f&&M.current?.focus()):t(n)):o&&(le.current!=null&&(F.current=le.current),iG(n),!r&&h?t(n):ve(n),r&&ne(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(F.current=-1,ne(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ve,p,_e,l,ne,e,h,_,v,ge,u,le,f,M]),Ce=R.useMemo(()=>({...be,...Se}),[be,Se]);return R.useMemo(()=>a?{reference:Ce,floating:xe,item:ye,trigger:Se}:{},[a,Ce,xe,Se,ye])}function DJ(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=GV(s),f=e.useState(`open`),p=gH(),m=R.useRef(``),h=R.useRef(u??i??-1),g=R.useRef(null),_=GV(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!$G(n)||n?.matches(`:disabled`)?!1:o==null||!ZG(uV,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(iG(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(iG(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=GV(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);dG(r,n)||dG(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});$(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=R.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return R.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var OJ=.1,kJ=OJ*OJ,AJ=.5;function jJ(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function MJ(e,t,n,r,i,a,o,s,c,l){let u=!1;return jJ(e,t,n,r,i,a)&&(u=!u),jJ(e,t,i,a,o,s)&&(u=!u),jJ(e,t,o,s,c,l)&&(u=!u),jJ(e,t,c,l,n,r)&&(u=!u),u}function NJ(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function PJ(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function FJ(e={}){let{blockPointerEvents:t=!1}=e,n=new hH,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*kJ;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=pG(r),g=r.type===`mouseleave`,_=dG(u,h),v=dG(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&S(r.relatedTarget)&&dG(u,r.relatedTarget))return;function y(){return!!(s&&CK(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>x.width,D=C.height>x.height,O=(E?x:C).left,k=(E?x:C).right,A=(D?x:C).top,j=(D?x:C).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let M=!1;switch(c){case`top`:M=PJ(d,f,O,x.top+1,k,C.bottom-1);break;case`bottom`:M=PJ(d,f,O,C.top+1,k,x.bottom-1);break;case`left`:M=PJ(d,f,C.right-1,j,x.left+1,A);break;case`right`:M=PJ(d,f,x.right-1,j,C.left+1,A)}if(M)return;if(l&&!NJ(d,f,x)||!g&&p(d,f)){b();return}let N=!1;switch(c){case`top`:{let n=E?AJ/2:AJ*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+AJ+1,o=w||E?C.bottom-AJ:C.top,s=w?E?C.bottom-AJ:C.top:C.bottom-AJ;N=MJ(d,f,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?AJ/2:AJ*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-AJ,o=w||E?C.top+AJ:C.bottom,s=w?E?C.top+AJ:C.bottom:C.top+AJ;N=MJ(d,f,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?AJ/2:AJ*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+AJ+1,o=T||D?C.right-AJ:C.left,s=T?D?C.right-AJ:C.left:C.right-AJ;N=MJ(d,f,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?AJ/2:AJ*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-AJ,o=T||D?C.left+AJ:C.right,s=T?D?C.left+AJ:C.right:C.left+AJ;N=MJ(d,f,a,r,a,i,o,C.top,s,C.bottom);break}}N?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var IJ=R.createContext(void 0);function LJ(e){let t=R.useContext(IJ);if(t===void 0&&!e)throw Error(LV(69));return t}var RJ=`ArrowUp`,zJ=`ArrowDown`,BJ=`ArrowLeft`,VJ=`ArrowRight`,HJ=new Set([RJ,zJ,BJ,VJ,`Home`,`End`]),UJ=[`Shift`,`Control`,`Alt`,`Meta`];function WJ(e){return d(e)&&e.tagName===`INPUT`}function GJ(e){return!!(WJ(e)&&e.selectionStart!=null||d(e)&&e.tagName===`TEXTAREA`)}function KJ(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=qJ(e,t,`left`),a=JJ(e),o=JJ(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=qJ(e,t,`top`),r=JJ(e),i=JJ(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function qJ(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function JJ(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function YJ(e){return e===`starting`?zK:dV}var XJ=R.createContext(void 0);function ZJ(){return R.useContext(XJ)}function QJ(e,t){let n=NV(e.render);if(R.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function $J(e,t,n){let r=QJ(e,t),i=r===t?void 0:r;return[r,R.useCallback(e=>n?.(e?i:void 0),[i,n])]}function eY(e,t,n){let r=NV(e.render),i=R.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var tY=R.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=DU(),m=ZJ(),{side:h,align:g}=TU(),_=LJ(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[ee,F]=$J(e,u,d),I=eY(e,C,N),te=w.type===`menu`?m:void 0,ne=w.type===`context-menu`,L=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(L=()=>l.state.activeIndex===null&&P),oH({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),R.useEffect(()=>{function e(e){l.setOpen(!1,KW(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),_J(D,{enabled:A&&!j&&!ne&&w.type!==`menubar`,closeDelay:k});let re=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ie,handleFocus:ae}=(R.useContext(lW)?.useParentHandoff??rY)(l,w,v,f),oe=kV(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},ref:[t,l.context.popupRef,re,F],stateAttributesMapping:VU,props:[b,{id:ee,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":I},onKeyDown(e){te?.onPopupKeyDown?.(e),_&&HJ.has(e.key)&&e.stopPropagation()},onFocus:ae},YJ(y),c,{"data-rootownerid":E}]}),se=w.type===void 0||ne;(C||w.type===`menubar`&&T!==`outside-press`)&&(se=!0);let ce=te?.getReturnElement??ie;return(0,z.jsx)(fq,{context:D,openInteractionType:M,modal:ne,disabled:!x,returnFocus:a??ce??se,explicitReturnFocus:a===void 0&&ce?!1:void 0,initialFocus:L,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:oe})}),nY={parentVirtualFocusRef:void 0,handleFocus:void 0};function rY(){return nY}var iY=R.forwardRef(function(e,t){let n=uW()?.Popup??tY;return(0,z.jsx)(n,{...e,ref:t})}),aY=R.createContext(void 0);function oY(){let e=R.useContext(aY);if(e===void 0)throw Error(LV(32));return e}var sY=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=DU();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,z.jsx)(aY.Provider,{value:n,children:(0,z.jsx)(JK,{ref:t,...r,portalOwnerRole:o})})});function cY(e){return oV(19)?e:e?`true`:void 0}function lY(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=R.useState(null),d=R.useRef(null),f=eq(n),p=R.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=ne({...e,elements:{...p,...l&&{reference:l}}}),h=R.useCallback(e=>{let t=S(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=R.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=R.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=R.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return $(()=>{o&&(d.current=o)},[o]),$(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),R.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var uY=R.createContext(void 0);function dY(){return R.useContext(uY)?.direction??`ltr`}var fY=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:u,padding:d=0}=l(e,t)||{};if(u==null)return{};let f=x(d),p={x:n,y:r},m=_(i),h=v(m),g=await o.getDimensions(u),y=m===`y`,b=y?`top`:`left`,S=y?`bottom`:`right`,C=y?`clientHeight`:`clientWidth`,w=a.reference[h]+a.reference[m]-p[m]-a.floating[h],T=p[m]-a.reference[m],E=s.floating[C]||a.floating[h],D=w/2-T/2,O=E/2-g[h]/2-1,k=Math.min(f[b],O),A=Math.min(f[S],O),j=k,M=E-g[h]-A,N=E/2-g[h]/2+D,P=I(j,N,M),ee=!c.arrow&&F(i)!=null&&N!==P&&a.reference[h]/2-(N<j?k:A)-g[h]/2<0,te=ee?N<j?N-j:N-M:0;return{[m]:p[m]+te,data:{[m]:P,centerOffset:N-P-te,...ee&&{alignmentOffset:te}},reset:ee}}}),pY=(e,t)=>{let{name:n,fn:r}=fY(e);return{name:n,fn:r,options:[e,t]}},mY={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},hY={sideX:`left`,sideY:`top`},gY=`--available-width`,_Y=`--available-height`,vY=`--anchor-width`,yY=`--anchor-height`,bY=`--transform-origin`,xY=gY,SY=_Y;function CY(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function wY(e,t,n){let{rects:r,placement:i}=e;return{side:CY(t,m(i),n),align:F(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function TY(e){return EY(e,lY)}function EY(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:g=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,T=y.side||`flip`,E=y.align||`flip`,D=y.fallbackAxisSide||`end`,O=b?.crossAxis??!1,k=b?.rootBoundary,M=typeof n==`function`?n:void 0,N=GV(M),ee=M?N:n,I=BG(n),te=BG(v),ne=dY()===`rtl`,[L,oe]=R.useState(null);!v&&L!==null&&oe(null);let se=C===`placement`,ce=L?m(L):null,ue=L&&se?F(L)||`center`:null,de=ce||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":ne?`left`:`right`,"inline-start":ne?`right`:`left`}[i],fe=ue||o,pe=fe===`center`?de:`${de}-${fe}`,me=l;typeof me==`number`?me={top:me,right:me,bottom:me,left:me}:me&&={top:me.top||0,right:me.right||0,bottom:me.bottom||0,left:me.left||0};let he=+(i===`bottom`),ge=+(i===`top`),_e=+(i===`right`),ve=+(i===`left`),ye={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:me},be=R.useRef(null),xe=BG(a),Se=BG(s),Ce=typeof a==`function`?0:a,we=typeof s==`function`?0:s,Te=[];p&&Te.push(p),Te.push(A(e=>{let t=wY(e,i,ne),n=typeof xe.current==`function`?xe.current(t):xe.current,r=typeof Se.current==`function`?Se.current(t):Se.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[Ce,we,ne,i]));let Ee=E===`none`&&T!==`shift`,De=!Ee&&(u||O||T===`shift`),Oe=T===`none`?null:ie({...ye,padding:{top:me.top+1+he,right:me.right+1+ve,bottom:me.bottom+1+ge,left:me.left+1+_e},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ke=Ee?null:j({...ye,rootBoundary:k,mainAxis:E!==`none`,crossAxis:De,limiter:u||O?void 0:ae(e=>{if(!be.current)return{};let{width:t,height:n}=be.current.getBoundingClientRect(),r=h(m(e.placement)),i=r===`y`?t:n,a=r===`y`?me.left+me.right:me.top+me.bottom;return{offset:i/2+a/2}})},[ye,u,O,k,me,E]);T===`shift`||E===`shift`||fe===`center`?Te.push(ke,Oe):Te.push(Oe,ke),Te.push(re({...ye,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!te.current)return;let i=e.style;i.setProperty(xY,`${t}px`),i.setProperty(SY,`${n}px`);let a=le(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(vY,`${u}px`),i.setProperty(yY,`${d}px`)}}),pY(e=>({element:be.current||vU(e.elements.floating).createElement(`div`),padding:be.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=m(r),u=F(r),d=h(l)===`y`,f=be.current,p=typeof a==`function`?a(wY(e,i,ne)):a,g;g=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let _=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return De&&d&&Math.abs(n.shift?.y||0)>p&&(_=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(bY,d?`${g} ${_}`:`${_} ${g}`),{}}},mY,S),$(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let Ae=R.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:je,elements:Me,x:Ne,y:Pe,middlewareData:Fe,update:Ie,placement:Le,context:Re,isPositioned:ze,floatingStyles:Be}=t({rootContext:_,open:g?v:void 0,placement:pe,middleware:Te,strategy:r,whileElementsMounted:g?void 0:(...e)=>P(...e,Ae),nodeId:x,externalTree:w}),{sideX:Ve,sideY:He}=Fe.adaptiveOrigin||hY,Ue=ze?r:`fixed`,We=R.useMemo(()=>{let e;return e=ze?S?{position:Ue,[Ve]:Ne,[He]:Pe}:{...Be,position:Ue}:{position:Ue,top:0,left:0},e[xY]=`100vw`,e[SY]=`100vh`,ze||(e.opacity=0),e},[S,Ue,Ve,Ne,He,Pe,Be,ze]),Ge=R.useRef(null);$(()=>{if(!v)return;let e=I.current,t=typeof e==`function`?e():e,n=(DY(t)?t.current:t)||null;n!==Ge.current&&(je.setPositionReference(n),Ge.current=n)},[v,je,ee,I]),R.useEffect(()=>{if(!v)return;let e=I.current;typeof e!=`function`&&DY(e)&&e.current!==Ge.current&&(je.setPositionReference(e.current),Ge.current=e.current)},[v,je,ee,I]),R.useEffect(()=>{if(g&&v&&Me.reference&&Me.floating)return P(Me.reference,Me.floating,Ie,Ae)},[g,v,Me,Ie,Ae]);let Ke=m(Le),qe=CY(i,Ke,ne),Je=F(Le)||`center`,Ye=!!Fe.hide?.referenceHidden;$(()=>{C&&v&&ze&&(Ke!==de||se&&Je!==fe)&&oe(Le)},[C,se,v,ze,Le,Ke,Je,de,fe]);let Xe=R.useMemo(()=>({position:`absolute`,top:Fe.arrow?.y,left:Fe.arrow?.x}),[Fe.arrow]),Ze=Fe.arrow?.centerOffset!==0;return R.useMemo(()=>({positionerStyles:We,arrowStyles:Xe,arrowRef:be,arrowUncentered:Ze,side:qe,align:Je,physicalSide:Ke,anchorHidden:Ye,refs:je,context:Re,isPositioned:ze,update:Ie}),[We,Xe,be,Ze,qe,Je,Ke,Ye,je,Re,ze,Ie])}function DY(e){return e!=null&&`current`in e}function OY(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=GV(i),[,o]=R.useState(0),s=QB(AY).current,c=QB(kY).current,l=R.useRef(0),u=R.useRef(!0),d=R.useRef(null),f=R.useRef(null),p=GV(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=GV((e,t)=>{c.set(e,t),p()}),h=GV(e=>{c.delete(e),p()}),g=GV(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!NY(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&PY(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=MY(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=GV(()=>{let[e,t]=jY(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});$(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),$(()=>{u.current&&v()}),$(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=GV(e=>(s.add(e),()=>{s.delete(e)})),b=R.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,z.jsx)(PW.Provider,{value:b,children:t})}function kY(){return new Map}function AY(){return new Set}function jY(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>PY(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function MY(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function NY(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function PY(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var FY=R.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function IY(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=R.useRef(null),o=R.useRef(null),s=aH(r);$(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),$(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function LY(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),kV(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},YJ(r),i],stateAttributesMapping:BU})}var RY={},zY={},BY=``;function VY(e,t){return p(e)?e:t}function HY(e,t,n){return/hidden|clip/.test(e.getComputedStyle(VY(t,n)).overflowY)}function UY(e){if(typeof document>`u`)return!1;let t=vU(e);return le(t).innerWidth-t.documentElement.clientWidth>0}function WY(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=vU(e),n=t.documentElement,r=t.body,i=VY(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function GY(e){let t=vU(e),n=t.documentElement,r=t.body,i=VY(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function KY(e){let t=vU(e),n=t.documentElement,r=t.body,i=le(n),a=0,o=0,s=!1,c=ZV.create();if(DW&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,RY={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},BY=n.style.scrollBehavior,zY={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=VY(n,r);s=WY(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,RY),Object.assign(r.style,zY),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=BY)}function d(){u(),c.request(l)}l();let f=RG(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var qY=new class{lockCount=0;restore=null;timeoutLock=hH.create();timeoutUnlock=hH.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=vU(e),n=t.documentElement,r=t.body,i=le(n);if(HY(i,n,r)){let t=new i.MutationObserver(()=>{HY(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=SW||!UY(e);this.restore=a?GY(e):KY(e)}};function JY(e=!0,t=null){$(()=>{if(e)return qY.acquire(t)},[e,t])}var YY=20;function XY(e,t,n,r){let[i,a]=R.useState(!1);$(()=>{if(!e||!t||n==null){a(!1);return}let r=vU(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-YY)},[e,t,n]),JY(e&&(!t||i),r)}var ZY=R.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=VK,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=DU(),x=oY(),S=UU(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),ee=v.useState(`lastOpenChangeReason`),F=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),te=w.useState(`domReferenceElement`),ne=n,L=c,re=l,ie=s,ae=h;C.type===`context-menu`&&(ne=n??C.context?.anchor,ie??=`start`,!o&&ie!==`center`&&(re=e.alignOffset??2,L=e.sideOffset??-5));let oe=o,se=ie;C.type===`menu`?(oe??=`inline-end`,se??=`start`,ae=e.collisionAvoidance??HK):C.type===`menubar`&&(oe??=C.context.orientation===`vertical`?`inline-end`:`bottom`,se??=`start`);let ce=C.type===`context-menu`,le=TY({anchor:ne,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:oe,sideOffset:L,align:se,alignOffset:re,arrowPadding:ce?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:ae,shift:ce?{crossAxis:!(`side`in ae&&ae.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});R.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&v.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,KW(nW)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,F]),R.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,KW(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ue=gH();R.useEffect(()=>{D||ue.clear()},[D,ue]),R.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ue.isStarted()||ue.start(e,()=>{v.setOpen(!1,KW(nW))}):v.setOpen(!1,KW(nW))}else ue.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ue]),R.useEffect(()=>{let e={open:D,nodeId:F,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,F,I]),IY({store:v,domReference:te,positionerElement:M,open:D});let de={open:D,side:le.side,align:le.align,anchorHidden:le.anchorHidden,nested:C.type===`menu`,instant:N},fe=C.type===`menubar`&&C.context.modal;XY(D&&(fe||O&&ee!==`trigger-hover`),k===`touch`,M,A);let pe=LY(e,de,{styles:le.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),me=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&ee!==`trigger-hover`||C.type===`menubar`&&C.context.modal),he=null;return C.type===`menubar`?he=C.context.contentElement:C.type===void 0&&(he=A),(0,z.jsxs)(wU.Provider,{value:le,children:[me&&(0,z.jsx)(FY,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:cY(!D),cutout:he}),(0,z.jsx)(nq,{id:F,children:(0,z.jsx)(OY,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:pe})})]})}),QY=R.createContext(null);function $Y(e){let t=R.useContext(QY);if(t===null&&!e)throw Error(LV(5));return t}function eX(e){let t=R.useRef(``),n=R.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:R.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function tX(e,t){let n=R.useRef(e),r=GV(t);$(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function nX(e,t){let{onClick:n,onPointerDown:r}=eX(GV((n,r)=>{(typeof e==`function`?e():e)||t(r||(SW?`touch`:``))}));return R.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function rX(e){let[t,n]=R.useState(null),r=nX(e,n);return tX(e,t=>{t&&!e&&n(null)}),R.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function iX(e){return e==null?WU:e.type.startsWith(`key`)?$U:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?eW:WU}var aX={...sJ,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=sJ.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>DW&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!sJ.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},oX=class extends Qq{constructor(e,t,n=!1){let r=new Iq,i=cX(r,t,n,e);super(i,sX(r),aX),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function sX(e){return{positionerRef:R.createRef(),popupRef:R.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:R.createRef(),beforeTriggerFocusGuardRef:R.createRef(),beforeContentFocusGuardRef:R.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function cX(e,t,n=!1,r){return{...tJ(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:dV,inputProps:dV,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new XK,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:dV,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var lX=R.createContext(null);function uX(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function dX(e,t){return e===`list-navigation`||uX(e,t)}var fX=Vq(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=UU(!0),C=DU(!0),w=$Y(!0),T=C?.store,E=C?.virtualFocus??!1,D=R.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=HW(),k=HW(),[A,j]=R.useState(void 0),M=(A??k)||void 0,N=$K(),P=D.type===`menu`?D.store:void 0,ee=(n??o)&&P?.state.transitionStatus===`starting`,F=QB(()=>ee?P?.state.instantType:void 0).current,I=QB(()=>{let e=new oX({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:F},M,N!=null);return e.context.virtualFocusRef=y,e}).current;I.useControlledProp(`openProp`,n),I.useControlledProp(`triggerIdProp`,m),I.useContextCallback(`onOpenChangeComplete`,i);let te=I.useState(`floatingTreeRoot`),ne=tq(te),L=I.useState(`open`),re=I.useState(`activeTriggerElement`),ie=I.useState(`positionerElement`),ae=I.useState(`hoverEnabled`),oe=I.useState(`disabled`),se=I.useState(`lastOpenChangeReason`),ce=I.useState(`parent`),le=I.useState(`activeIndex`),ue=I.useState(`keyboardOpen`),de=I.useState(`payload`),fe=I.useState(`floatingParentNodeId`),pe=R.useRef(null),me=R.useRef(ce.type!==`context-menu`),he=gH(),ge=R.useRef(!0),_e=gH(),ve=fe!=null,{openMethod:ye,triggerProps:be}=rX(L);I.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ce.type===void 0?c:void 0,openMethod:ye,rootId:O}),Mq(I);let{forceUnmount:xe,transitionStatus:Se}=Nq(L,I,()=>{I.set(`allowMouseEnter`,!1)},ee),Ce=aH(I.context.popupRef);R.useEffect(()=>{if(F===void 0)return;let e=()=>{I.state.instantType===F&&I.set(`instantType`,void 0)};if(!L){e();return}if(Se!==void 0)return;if(I.context.popupRef.current==null){e();return}let t=new AbortController;return Ce(e,t.signal),()=>{t.abort()}},[F,L,Se,Ce,I]),$(()=>{S&&!C?I.update({parent:{type:`context-menu`,context:S},floatingNodeId:ne,floatingParentNodeId:N}):(C||!I.select(`activeTriggerElement`))&&I.update({floatingNodeId:ne,floatingParentNodeId:N})},[S,C,ne,N,re,I]),R.useEffect(()=>{L||(pe.current=null),ce.type===`context-menu`&&(L?he.start(500,()=>{me.current=!0}):(he.clear(),me.current=!1))},[he,L,ce.type]),$(()=>{!L&&!ae&&I.set(`hoverEnabled`,!0)},[L,ae,I]);let we=GV((e,t)=>{let n=t.reason;if(!e&&!I.select(`open`)||L===e&&t.trigger===re&&se===n)return;let i=kq(t);if(!e&&t.trigger==null&&(t.trigger=re??void 0),r?.(e,t),t.isCanceled)return;I.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ge.current)return;e&&n===`trigger-focus`?(ge.current=!1,_e.start(300,()=>{ge.current=!0})):(ge.current=!0,_e.clear());let o=!e&&(n===`escape-key`||n==null);pe.current=t.event;let s=Oq(I.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&dX(n,a),s.instantType=ce.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:uX(n,a)?`click`:o?`dismiss`:void 0,I.update(s)}),Te=bq({popupStore:I,floatingRootContext:I.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:we}),Ee=Te.context.events;$(()=>{let e=({open:e,eventDetails:t})=>we(e,t);return Ee.on(`setOpen`,e),()=>{Ee?.off(`setOpen`,e)}},[Ee,we]),$(()=>I.subscribeToParentMenu(),[I]);let De=R.useCallback(()=>{I.setOpen(!1,KW(oW))},[I]);R.useImperativeHandle(d,()=>({unmount:xe,close:De}),[xe,De]);let Oe;ce.type===`context-menu`&&(Oe=ce.context),R.useImperativeHandle(Oe?.positionerRef,()=>ie,[ie]),R.useImperativeHandle(Oe?.actionsRef,()=>({setOpen:we}),[we]);let ke=yq(Te,{enabled:!oe,bubbles:{escapeKey:f&&ce.type===`menu`},outsidePress(){return ce.type!==`context-menu`||pe.current?.type===`contextmenu`||me.current},externalTree:ve?te:void 0}),Ae=dY(),je=EJ(Te,{enabled:!oe,listRef:I.context.itemDomElements,activeIndex:le,virtual:v,nested:ce.type===`menubar`||!v&&ce.type!==void 0,parentOrientation:ce.type===`menubar`?ce.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?ue:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:Ae===`rtl`,disabledIndices:uV,onNavigate(e,t){I.setActiveIndex(e,iX(t),t?.nativeEvent)},openOnArrowKeyDown:ce.type!==`context-menu`&&!(v&&_),externalTree:!v&&ve?te:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),Me=R.useCallback(e=>{I.context.typingRef.current=e},[I]),Ne=DJ(Te,{enabled:!oe&&!v,listRef:I.context.itemLabels,elementsRef:I.context.itemDomElements,activeIndex:le,resetMs:500,onMatch:(e,t)=>{L&&e!==le&&I.setActiveIndex(e,$U,t.nativeEvent)},onTyping:Me}),Pe=GV(a),Fe=R.useRef(-1),Ie=GV(()=>{let e=I.state.activeIndex,t=e===null?void 0:I.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Fe.current===n&&I.context.reportedItem===t)return;Fe.current=n,I.context.reportedItem=t,v&&I.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=I.context;I.context.highlightReason=WU,I.context.highlightEvent=void 0,a&&Pe(t,qW(r,i,{label:t===void 0?void 0:I.context.itemLabels.current[n]??void 0}))});$(()=>{Ie()},[le,Ie]);let Le=R.useMemo(()=>{if(!v)return je.reference;if(!je.trigger)return dV;let{onFocus:e,...t}=je.trigger;return t},[v,je.reference,je.trigger]);I.useSyncedValue(`inputProps`,v?je.reference??dV:dV);let Re=R.useMemo(()=>{let e=gV(Ne.reference,Le,ke.reference,{onMouseMove(){I.set(`allowMouseEnter`,!0)}},be);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=L,e},[I,Ne.reference,Le,ke.reference,be,L]),ze=R.useMemo(()=>{let e=gV(je.trigger,ke.trigger,be);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[je.trigger,ke.trigger,be]);QB(()=>(I.update({inactiveTriggerProps:ze}),null)),Pq(I,{floatingRootContext:Te,activeTriggerProps:Re,inactiveTriggerProps:ze,popupProps:R.useMemo(()=>gV(Sq,{onMouseMove(){I.set(`allowMouseEnter`,!0),ce.type===`menu`&&I.set(`hoverEnabled`,!1)},onClick(){I.select(`hoverEnabled`)&&I.set(`hoverEnabled`,!1)},onKeyDown(e){let t=I.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ne.floating,je.floating,ke.floating),[ce.type,I,Ne.floating,je.floating,ke.floating]),itemProps:je.item??dV});let Be=R.useMemo(()=>({store:I,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:Ie}),[I,D,u,l,b,k,v,E,Ie]),Ve=typeof t==`function`?t({payload:de}):t,He=(0,z.jsxs)(EU.Provider,{value:Be,children:[p&&(0,z.jsx)(Tq,{handle:p,store:I}),Ve]});return(ce.type===void 0||ce.type===`context-menu`)&&(He=(0,z.jsx)(rq,{externalTree:te,children:He})),He});function pX(e){let t=R.useContext(lX);if(t===null)return(0,z.jsx)(fX,{...e});let n=t.Root;return(0,z.jsx)(lX.Provider,{value:null,children:(0,z.jsx)(n,{...t.options,...e})})}var mX={};function hX(e){DU();let t=R.useContext(lX);if(t!==null){let n=t.SubmenuRoot;return(0,z.jsx)(lX.Provider,{value:null,children:(0,z.jsx)(n,{...t.options,...e})})}return(0,z.jsx)(XJ.Provider,{value:mX,children:(0,z.jsx)(fX,{...e,isSubmenu:!0})})}var gX=5;function _X(e,t){let n=vX(t);return e.clientX>=n.left-gX&&e.clientX<=n.right+gX&&e.clientY>=n.top-gX&&e.clientY<=n.bottom+gX}function vX(e){let t=e.getBoundingClientRect(),n=le(e);if(kW)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function yX(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=gU(),{ref:i,index:a}=IW(e),o=n===a,s=R.useRef(null),c=$B(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function bX(e){let{render:t,className:n,style:r,state:i=dV,props:a=uV,refs:o=uV,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=yX({metadata:s});return kV(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function xX(e){if(d(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ce(e))return xX(D(e))}function SX(e,t){function n(n,r,i){let a=n.currentTarget;Ty.flushSync(()=>{e.setOpen(!1,KW(XU,n.nativeEvent,a))}),yK(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&bK(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function CX(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=R.useRef(!1);return R.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,vU(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:dV,[t,n,r])}var wX=Hq(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=DU(!0),h=cJ(d)??m?.store;if(!h)throw Error(LV(85));let g=HW(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=R.useRef(null),S=EX(),C=gU(!0),w=eq(),T=R.useMemo(()=>w??new XK,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=jq(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:tq(T),floatingParentNodeId:$K(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=bU({disabled:A,native:o});R.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=R.useRef(null),P=gH(),ee=GV(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;dG(N.current,t)||dG(h.select(`positionerElement`),t)||t===N.current||t!=null&&xX(t)===h.select(`rootId`)||_X(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:tW})});R.useEffect(()=>{let e=vU(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,ee,{once:!0}),()=>{e.removeEventListener(`mouseup`,ee)}},[y,ee,h]);let F=O&&S.context.hasSubmenuOpen,I=yJ(v,{enabled:(c??F)&&!A&&(!O||F&&!D),handleClose:FJ({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),te=TX(y,h.select(`lastOpenChangeReason`)),ne=pq(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&te}),L=dJ(v,{enabled:!A&&F}),re=CX({open:y,enabled:O,mouseDownAction:`open`}),ie=R.useMemo(()=>gV(L.reference,ne.reference),[L.reference,ne.reference]),ae=h.useState(`triggerProps`,D),oe=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:se,handleFocusTargetFocus:ce}=SX(h,x),le={disabled:A,open:y},ue=[N,t,M,E,x],de=[ie,I??dV,ae,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),vU(e.currentTarget).addEventListener(`mouseup`,ee,{once:!0}))}},oe,O?{role:`menuitem`}:{},re,p,j],fe=kV(`button`,e,{enabled:!O,stateAttributesMapping:zU,state:le,ref:ue,props:de});return O?(0,z.jsx)(bX,{tag:`button`,render:n,className:r,style:i,state:le,refs:ue,props:de,stateAttributesMapping:zU}):y?(0,z.jsxs)(R.Fragment,{children:[(0,z.jsx)(GG,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:se},`${g}-pre-focus-guard`),(0,z.jsx)(R.Fragment,{children:fe},g),(0,z.jsx)(GG,{ref:h.context.triggerFocusTargetRef,onFocus:ce},`${g}-post-focus-guard`)]}):(0,z.jsx)(R.Fragment,{children:fe},g)});function TX(e,t){let n=gH(),[r,i]=R.useState(!1);return $(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function EX(){let e=$Y(!0);return R.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function DX(e){let[t,n]=R.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var OX=R.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return kV(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function kX(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var AX={"aria-expanded":void 0},jX=R.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=DU(!0);if(p?.parent.type!==`menu`)throw Error(LV(37));let m=TU(),h=ZJ(),{store:g,parentVirtualFocus:_}=p,v=p.parent.store,y=IW({guess:!0,label:a}),b=HW(o),x=g.useState(`open`),S=R.useRef(!1),C=g.useState(`positionerElement`),w=g.useState(`floatingRootContext`),T=g.useState(`floatingTreeRoot`),E=g.useState(`triggerPopupId`,b),D=Dq(b,g),O=GV(e=>{D(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:u})}),k=R.useRef(null),A=R.useCallback(e=>{k.current=e,g.set(`activeTriggerElement`,e)},[g]);$(()=>(O(k.current),()=>O(null)),[O,b,g]),$(()=>{if(!x||!C)return;function e(e){pG(e)===g.context.beforeContentFocusGuardRef.current&&(S.current=e.relatedTarget===k.current)}return C.addEventListener(`focusout`,e,!0),()=>{S.current=!1,C.removeEventListener(`focusout`,e,!0)}},[x,C,g]),g.useSyncedValue(`closeDelay`,u);let j=g.useState(`disabled`),M=v.useState(`disabled`),N=d||j||M,P=v.useState(`itemProps`),ee=v.useState(`isActive`,y.index),F=R.useMemo(()=>({type:`submenu-trigger`,setActive(e){v.select(`highlightItemOnHover`)&&v.setActiveIndex(y.index,eW,e)}}),[v,y.index]),{getItemProps:I,itemRef:te}=NW({closeOnClick:!1,disabled:N,highlighted:ee,id:b,store:g,typingRef:v.context.typingRef,nativeButton:s,itemMetadata:F,nodeId:m?.context.nodeId}),ne=yJ(w,{enabled:g.useState(`hoverEnabled`)&&c&&!N,handleClose:FJ({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>v.select(`allowMouseEnter`):void 0,triggerElementRef:k,externalTree:T,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),L=pq(w,{enabled:!N,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??dV,re=g.useState(`triggerProps`,!0);delete re.id;let ie={disabled:N,highlighted:ee,open:x},ae=g.useState(`openMethod`),oe=g.useState(`lastOpenChangeReason`)===`list-navigation`||ae===`keyboard`,se=x&&oe&&OW;return kV(`div`,e,{state:ie,stateAttributesMapping:RU,props:[L,ne,re,h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0,P,se?AX:void 0,{"aria-controls":E,tabIndex:_||!(x||ee)?-1:0,onFocus(e){g.select(`open`)&&S.current&&(S.current=!1,g.setOpen(!1,KW(XU,e.nativeEvent)))},onBlur(){ee&&v.setActiveIndex(null,WU)}},f,I],ref:[t,y.ref,te,O,A]})}),MX=R.forwardRef(function(e,t){let n=pW(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?gV(n.props,e):e;return(0,z.jsx)(jX,{...r,ref:n.ref})});function NX(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function PX(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function FX(e){return PX(e?.[0])}function IX(e){return FX(e)?e.flatMap(e=>e.items):e}function LX(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(FX(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function RX(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return NX(e)}function zX(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?NX(e.value):NX(e)}function BX(e,t,n){function r(){return RX(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=IX(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function VX(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,z.jsx)(R.Fragment,{children:BX(r,t,n)},i)),e),[])}var HX=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),UX=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),WX=e=>{let t=UX(e);return t.charAt(0).toUpperCase()+t.slice(1)},GX=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),KX=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},qX={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},JX=(0,R.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,R.createElement)(`svg`,{ref:c,...qX,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:GX(`lucide`,i),...!a&&!KX(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,R.createElement)(e,t)),...Array.isArray(a)?a:[a]])),YX=(e,t)=>{let n=(0,R.forwardRef)(({className:n,...r},i)=>(0,R.createElement)(JX,{ref:i,iconNode:t,className:GX(`lucide-${HX(WX(e))}`,`lucide-${e}`,n),...r}));return n.displayName=WX(e),n},XX=YX(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ZX=YX(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),QX=YX(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),$X=YX(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),eZ=`data-valid`,tZ=`data-invalid`,nZ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},rZ={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},iZ={valid(e){return e===null?null:e?{[eZ]:``}:{[tZ]:``}}},aZ={invalid:void 0,name:void 0,validityData:{state:nZ,errors:[],error:``,value:``,initialValue:null},setValidityData:lV,disabled:void 0,setTouched:lV,setDirty:lV,setFilled:lV,setFocused:lV,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:rZ,registerFieldControl:lV,validation:{getValidationProps:(e,t=dV)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:lV,getInputControl:()=>null,commit:async()=>{},change:lV}},oZ=R.createContext(aZ);function sZ(e=!0){let t=R.useContext(oZ);if(t.setValidityData===lV&&!e)throw Error(LV(28));return t}var cZ=R.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:lV,validationMode:`onSubmit`,submitCountRef:{current:0}});function lZ(){return R.useContext(cZ)}var uZ=R.createContext({controlId:void 0,registerControlId:lV,resetControlId:lV,labelId:void 0,setLabelId:lV,messageIds:[],setMessageIds:lV,getDescriptionProps:e=>e});function dZ(){return R.useContext(uZ)}function fZ(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=dZ(),o=HW(),s=QB(()=>Symbol()),c=R.useRef(!1),l=R.useRef(!1),u=GV(()=>{c.current&&i!==lV&&(c.current=!1,i(s.current,void 0))});return $(()=>{if(!n||i===lV){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),$(()=>u,[u]),(n?r:void 0)??t??o}function pZ(e,t,n){let{setFocused:r,focusOwnerRef:i}=sZ(),a=GV(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return $(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function mZ(e,t,n,r,i=!0,a){let{registerFieldControl:o}=sZ(),s=QB(()=>Symbol());$(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),$(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var hZ=R.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=sZ(),{clearErrors:S,elementRef:C,submitCountRef:w}=lZ(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=dZ(),k=fZ({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=GV(()=>x.inputRef.current?.value);mZ(x.inputRef,k,j,M,!T,a),$(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),tX(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=R.useRef(null),P=pZ(T,N),ee=gH();return kV(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=KW(WU,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;ee.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:iZ})}),gZ=R.forwardRef(function(e,t){return(0,z.jsx)(hZ,{ref:t,...e})}),_Z=R.createContext(void 0);function vZ(e){let t=R.useContext(_Z);if(t===void 0&&!e)throw Error(LV(47));return t}var yZ={...sJ,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!sJ.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&sJ.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>sJ.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bZ=class extends Qq{constructor(e,t,n){let r=new Iq;super(xZ(e,r,t,n),SZ(r),yZ)}setOpen=(e,t)=>{let n=t.reason===KU,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=kq(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Oq(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),Ty.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function xZ(e,t,n,r=!1){let i={...tJ(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function SZ(e){return{popupRef:R.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:R.createRef(),beforeTriggerFocusGuardRef:R.createRef(),beforeContentFocusGuardRef:R.createRef(),stickIfOpenTimeout:new hH,stickIfOpen:!0,triggerElements:e}}var CZ=Vq(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=TZ(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Fq(u,d),Mq(u);let{forceUnmount:m}=Nq(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),R.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),R.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,KW(oW))}),[m,u]);let h=d||f||s!=null;return(0,z.jsxs)(_Z.Provider,{value:u,children:[s&&(0,z.jsx)(Tq,{handle:s,store:u}),h&&(0,z.jsx)(EZ,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function wZ(e){return vZ(!0)?(0,z.jsx)(CZ,{props:e}):(0,z.jsx)(rq,{children:(0,z.jsx)(CZ,{props:e})})}function TZ(e,t){let n=wq((e,n)=>new bZ(t,e,n));return R.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function EZ({store:e,modal:t}){let n=yq(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Pq(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var DZ=Hq(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=vZ(!0),h=cJ(s)??m;if(!h)throw Error(LV(74));let g=HW(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=R.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=jq(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=yJ(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:FJ(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=pq(v,{stickIfOpen:GV(()=>h.context.stickIfOpen)}),k=nX(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=bU({disabled:a,native:o}),N={open(e){return w?zU.open(e):RU.open(e)}},{handlePreFocusGuardFocus:P,handleFocusTargetFocus:ee}=SX(h,x),F=kV(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[BK]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:N}),I=(0,z.jsx)(R.Fragment,{children:F},g);return E?(0,z.jsxs)(R.Fragment,{children:[(0,z.jsx)(GG,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:P}),I,(0,z.jsx)(GG,{ref:h.context.triggerFocusTargetRef,onFocus:ee})]}):I}),OZ=R.createContext(void 0);function kZ(){let e=R.useContext(OZ);if(e===void 0)throw Error(LV(45));return e}var AZ=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return vZ().useState(`mounted`)||n?(0,z.jsx)(OZ.Provider,{value:n,children:(0,z.jsx)(JK,{ref:t,...r})}):null}),jZ=R.createContext(void 0);function MZ(){let e=R.useContext(jZ);if(!e)throw Error(LV(46));return e}var NZ=R.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=HK,..._}=e,v=vZ(),y=kZ(),b=tq(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=TY({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});IY({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;XY(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=LY(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,z.jsxs)(jZ.Provider,{value:j,children:[S&&M&&(0,z.jsx)(FY,{inert:cY(!C),cutout:T}),(0,z.jsx)(nq,{id:b,children:P})]})}),PZ=R.createContext(void 0);function FZ(){let[e,t]=R.useState(0),n=GV(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:R.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var IZ=R.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=vZ(),l=MZ(),u=LJ(!0)!=null,{context:f,hasClosePart:p}=FZ(),m=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);oH({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),_J(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Cq(c.context.popupRef):a,j=x!==!1&&p;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=kV(`div`,e,{state:{open:m,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...Sq,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&HJ.has(e.key)&&e.stopPropagation()}},YJ(_),s],stateAttributesMapping:VU});return(0,z.jsx)(fq,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:d(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,z.jsx)(PZ.Provider,{value:f,children:N})})});function LZ(e){let t=R.useRef(!0);t.current&&(t.current=!1,e())}var RZ=R.createContext(void 0),zZ=R.createContext(void 0);function BZ(){let e=R.useContext(RZ);if(e===void 0)throw Error(LV(60));return e}function VZ(){let e=R.useContext(zZ);if(e===void 0)throw Error(LV(61));return e}function HZ(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var UZ=(e,t)=>Object.is(e,t);function WZ(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function GZ(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!HZ(e,t,(e,t)=>WZ(e,t,n)):e!==t}function KZ(e,t,n){return e?e.some(e=>e!==void 0&&WZ(t,e,n)):!1}function qZ(e,t,n){return e?e.findIndex(e=>e!==void 0&&WZ(e,t,n)):-1}function JZ(e,t){if(t!==UZ)return n=>KZ(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function YZ(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(JZ(t,n)):qZ(e,t,n);return i===-1?null:i}function XZ(e,t,n,r,i,a){return KZ(r,t,i)?a!=null&&e>a&&KZ(r,n[a],i)?a:e:e===a?YZ(n,r,i,!0):a}function ZZ(e,t,n){return e.filter(e=>!WZ(t,e,n))}var QZ={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:zX(t,r)!==``},hasNullItemLabel:(e,t)=>t?LX(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>WZ(t,e,n)):WZ(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function $Z(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function eQ(e,t){return Math.max(0,e-t)}function tQ(e,t){if(t<=0)return 0;let n=$Z(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function nQ(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=UZ,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=lZ(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=sZ(),ee=fZ({id:t}),F=M||d,I=j??c,[te,ne]=cW({controlled:n,default:y?r??uV:r,name:`Select`,state:`value`}),[L,re]=cW({controlled:a,default:o,name:`Select`,state:`open`}),ie=R.useRef([]),ae=R.useRef([]),oe=R.useRef(null),se=R.useRef(null),ce=R.useRef(0),le=R.useRef(null),ue=R.useRef([]),de=R.useRef(!1),fe=R.useRef(null),pe=R.useRef(null),me=R.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),he=R.useRef(!1),ge=R.useRef(te),{openMethod:_e,triggerProps:ve}=rX(L),ye=QB(()=>new Qq({id:ee,labelId:void 0,modal:m,multiple:y,disabled:F,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:te,open:L,mounted:L,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:dV,triggerProps:dV,itemRoot:{props:dV,multiple:y,disabled:F,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:lV,setOpen:lV,handleScrollArrowVisibility:lV,onOpenChangeComplete:lV,listRef:ie,popupRef:oe,scrollHandlerRef:se,scrollArrowsMountedCountRef:ce,valueRef:le,valuesRef:ue,labelsRef:ae,typingRef:de,selectionRef:me,firstItemTextRef:fe,selectedItemTextRef:pe,alignItemWithTriggerActiveRef:he,initialValueRef:ge},QZ)).current,[be,xe]=R.useState(!1),{mounted:Se,transitionStatus:Ce,forceUnmount:we}=xq({open:L,ref:oe,preventUnmountOnClose:be,setPreventUnmountOnClose:xe,onUnmount(){ye.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),Te=ye.useState(`activeIndex`),Ee=ye.useState(`selectedIndex`),De=ye.useState(`triggerElement`),Oe=ye.useState(`positionerElement`),ke=DX(_e),Ae=_e??ke,je=R.useMemo(()=>y?``:zX(te,x),[y,te,x]),Me=R.useMemo(()=>y&&Array.isArray(te)?te.map(e=>zX(e,x)):zX(te,x),[y,te,x]);mZ(BG(De),ee,te,GV(()=>Me),!F,c);let Ne=y?Array.isArray(te)&&te.length>0:te!=null&&je!==``;$(()=>{A(Ne)},[Ne,A]),$(function(){let e=YZ(ue.current,te,S,y);e===null&&(pe.current=null),!L&&ye.set(`selectedIndex`,e)},[y,L,te,S,ye]),tX(te,()=>{T(I),E(GZ(te,k.initialValue,S)),N.change(te)});let Pe=GV((e,t)=>{let n=t,r=kq(n);s?.(e,n),!t.isCanceled&&(e||xe(r()),re(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(D(!0),O(!1),P===`onBlur`&&N.commit(te)))});R.useImperativeHandle(h,()=>({unmount:we,close:()=>{ye.state.open&&Pe(!1,KW(oW))}}),[we,Pe,ye]);let Fe=GV((e,t)=>{i?.(e,t),!t.isCanceled&&ne(e)}),Ie=GV(e=>{let t=eQ(e.scrollHeight,e.clientHeight),n=tQ(e.scrollTop,t),r=n>0,i=n<t;ye.set(`scrollUpArrowVisible`,r),ye.set(`scrollDownArrowVisible`,i)}),Le=lJ({open:L,onOpenChange:Pe,elements:{reference:De,floating:Oe}}),Re=pq(Le,{enabled:!F,event:`mousedown`}),ze=yq(Le),Be=EJ(Le,{enabled:!F,listRef:ie,activeIndex:Te,selectedIndex:Ee,disabledIndices:uV,onNavigate(e){(e!==null||L)&&ye.set(`activeIndex`,e)},focusItemOnHover:C}),Ve=DJ(Le,{enabled:!F&&(L||!f&&!y),listRef:ae,activeIndex:Te,selectedIndex:Ee,disabledIndices:e=>kX(ie.current[e]),onMatch(e){L?ye.set(`activeIndex`,e):Fe(ue.current[e],KW(WU))},onTyping(e){de.current=e}}),He=R.useMemo(()=>gV(Ve.reference,Be.reference,ze.reference,Re.reference,ve),[Re.reference,Ve.reference,Be.reference,ze.reference,ve]),Ue=R.useMemo(()=>gV(Sq,Ve.floating,Be.floating,ze.floating),[Ve.floating,Be.floating,ze.floating]),We=Be.item??dV,Ge=R.useMemo(()=>({props:We,multiple:y,disabled:F,readOnly:f,isItemEqualToValue:S}),[We,y,F,f,S]);ye.useContextCallback(`setValue`,Fe),ye.useContextCallback(`setOpen`,Pe),ye.useContextCallback(`handleScrollArrowVisibility`,Ie),ye.useContextCallback(`onOpenChangeComplete`,_),LZ(()=>{ye.update({popupProps:Ue,triggerProps:He,itemRoot:Ge})}),ye.useSyncedValues({id:ee,modal:m,multiple:y,disabled:F,readOnly:f,required:p,highlightItemOnHover:C,value:te,open:L,mounted:Se,transitionStatus:Ce,popupProps:Ue,triggerProps:He,itemRoot:Ge,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ae});let Ke=$B(g,N.inputRef),qe=y?void 0:I,Je=R.useMemo(()=>!y||!Array.isArray(te)||!I?null:te.map(e=>{let t=zX(e,x);return(0,z.jsx)(`input`,{type:`hidden`,form:l,name:I,value:t,disabled:F},t)}),[y,te,l,I,x,F]);return(0,z.jsxs)(RZ.Provider,{value:ye,children:[(0,z.jsx)(zZ.Provider,{value:Le,children:w}),(0,z.jsx)(`input`,{...N.getValidationProps(F,{onFocus(){ye.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||F||f)return;let t=e.currentTarget.value,n=KW(WU,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ue.current.findIndex(t=>zX(t,x).toLowerCase()===e||RX(t,b).toLowerCase()===e);r===-1&&(r=ue.current.findIndex((t,n)=>{let r=ae.current[n];return r!=null&&r.toLowerCase()===e}));let i=ue.current[r];i!=null&&Fe(i,n)}ye.set(`forceMount`,!0),queueMicrotask(r)}}),id:ee&&qe==null?`${ee}-hidden-input`:void 0,form:l,name:qe,autoComplete:u,value:je,disabled:F,required:p&&!(y&&Ne),readOnly:f,ref:Ke,style:I?WG:UG,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Je]})}function rQ(e,t){return e??t}var iQ=`data-popup-side`,aQ=400,oQ={...zU,...iZ,popupSide:e=>e?{[iQ]:e}:null,value:()=>null},sQ=R.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=sZ(),{labelId:m}=dZ(),h=BZ(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=rQ(m,O);fZ({id:i});let N=BG(w),P=R.useRef(null),ee=pZ(y,P),{getButtonProps:F,buttonRef:I}=bU({disabled:y,native:o}),te=h.useStateSetter(`triggerElement`),ne=gH(),L=gH(),re=gH();R.useEffect(()=>{if(b)return re.start(aQ,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{re.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},L.clear()},[b,h,L,re]);let ie=gV(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??OG(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){ee(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,KW(WU,e.nativeEvent)),ne.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){dG(w,e.relatedTarget)||(l(!0),ee(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=vU(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;dG(P.current,t)||dG(N.current,t)||_X(e,P.current)||h.context.setOpen(!1,KW(tW,e))}L.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,F),ae=d.getValidationProps(y,ie);ae.role=`combobox`;let oe={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return kV(`button`,e,{ref:[t,P,I,te],state:oe,stateAttributesMapping:oQ,props:ae})}),cQ={value:()=>null},lQ=R.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=BZ(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?VX(l,u,d):BX(l,u,d)),kV(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:cQ})}),uQ=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return kV(`span`,e,{state:{open:BZ().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:RU})}),dQ=R.forwardRef(function(e,t){let n=BZ(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,z.jsx)(JK,{ref:t,...e}):null}),fQ=R.createContext(void 0);function pQ(){let e=R.useContext(fQ);if(!e)throw Error(LV(59));return e}function mQ(e,t){e&&Object.assign(e.style,t)}var hQ={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},gQ={position:`fixed`},_Q=R.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=VK,style:_,...v}=e,y=BZ(),b=VZ(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=R.useRef(null),j=R.useRef(null),[M,N]=R.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),R.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),XY((P||C)&&x,T===`touch`,E,D);let ee=TY({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),F=P?`none`:ee.side,I=P?gQ:ee.positionerStyles,te={open:x,side:F,align:ee.align,anchorHidden:ee.anchorHidden};$(()=>{y.set(`popupSide`,ee.side)},[y,ee.side]);let ne=LY(e,te,{styles:I,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),L=R.useRef(0),re=GV(e=>{if(y.context.valuesRef.current.length===0)return;let t=L.current;L.current=e.size;let n=KW(WU);if(t!==0&&!y.state.multiple&&w!==null&&qZ(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&qZ(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>qZ(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};mQ(E,e),mQ(y.context.popupRef.current,e)}}),ie=R.useMemo(()=>({...ee,side:F,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[ee,F,P,N]);return(0,z.jsx)(OY,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:re,children:(0,z.jsxs)(fQ.Provider,{value:ie,children:[S&&C&&(0,z.jsx)(FY,{inert:cY(!x),cutout:D}),ne]})})}),vQ=`base-ui-disable-scrollbar`,yQ={className:vQ,getElement(e){return(0,z.jsx)(`style`,{nonce:e,href:vQ,precedence:`base-ui:low`,children:`.${vQ}{scrollbar-width:none}.${vQ}::-webkit-scrollbar{display:none}`})}},bQ=R.createContext(void 0),xQ={disableStyleElements:!1};function SQ(){return R.useContext(bQ)??xQ}var CQ=`--transform-origin`,wQ={...BU,...lH},TQ=R.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=BZ(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=VZ(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=pQ(),_=LJ(!0)!=null,v=dY(),{nonce:y,disableStyleElements:b}=SQ(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=R.useRef(!1),j=R.useRef(!1),M=R.useRef({}),N=QV(),P=GV(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=OQ(O),i=kQ(O.getBoundingClientRect().height,`y`,r),a=vU(O),o=le(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=EQ(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=DQ(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=$Z(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=$Z(g,0,DQ(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});R.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),oH({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let ee={open:S,transitionStatus:E,side:f,align:p};$(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),$(()=>{S||m||(j.current=!1,A.current=!1,mQ(O,M.current))},[S,m,O]),$(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(CQ),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=MQ(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=le(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=vU(D),c=OQ(D),l=AQ(D.getBoundingClientRect(),c),d=AQ(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=EQ(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=AQ(n.getBoundingClientRect(),c);T=AQ(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),ee=S-_-y,F=N-P,I=C-5;O.style.left=`${$Z(E,5,I-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let te=DQ(p),ne=F>=te-1;ne&&(P=Math.min(S,d.height)-(F-te));let L=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),re=(r.visualViewport?.scale??1)!==1&&DW;if(L||re){mQ(O,M.current),g(!1);return}let ie=Math.max(b,P);if(ne){let e=Math.max(0,S-N);O.style.top=d.height>=ee?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=DQ(p)}else O.style.bottom=`0`,p.scrollTop=F;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=$Z(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(CQ,`50% ${i}%`)}(ie===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),R.useEffect(()=>{if(!m||!O||!S)return;let e=le(O);function t(e){s.context.setOpen(!1,KW(sW,e))}return RG(e,`resize`,t)},[s,m,O,S]);let F={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&HJ.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:hQ},className:!k&&m?yQ.className:void 0},I=kV(`div`,e,{ref:[t,s.context.popupRef],state:ee,stateAttributesMapping:wQ,props:[T,F,YJ(E),o]});return(0,z.jsxs)(R.Fragment,{children:[!b&&yQ.getElement(y),(0,z.jsx)(fq,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:I})]})});function EQ(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function DQ(e){return eQ(e.scrollHeight,e.clientHeight)}function OQ(e){return M.getScale(e)}function kQ(e,t,n){return e/n[t]}function AQ(e,t){return g({x:kQ(e.x,`x`,t),y:kQ(e.y,`y`,t),width:kQ(e.width,`x`,t),height:kQ(e.height,`y`,t)})}var jQ=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function MQ(e){let{style:t}=e,n={};for(let[e,r]of jQ)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of jQ){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var NQ=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=BZ(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=pQ(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:hQ},className:u&&d!==`touch`?yQ.className:void 0};return kV(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),PQ=R.createContext(void 0);function FQ(){let e=R.useContext(PQ);if(!e)throw Error(LV(57));return e}var IQ=R.memo(R.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=R.useRef(null),d=IW({guess:!0,label:o,textRef:u}),f=BZ(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=R.useRef(null);$(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),$(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=XZ(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&WZ(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=R.useRef(`mouse`),E=R.useRef(!1),{getButtonProps:D,buttonRef:O}=bU({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?ZZ(n,a,_):[...n,a];f.context.setValue(r,KW(YU,e))}else f.context.setValue(a,KW(YU,e)),f.context.setOpen(!1,KW(YU,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&oG(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=kV(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=R.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,z.jsx)(PQ.Provider,{value:P,children:N})})),LQ=R.memo(R.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=R.useRef(null),{transitionStatus:l,setMounted:u}=uH(o),d=kV(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:lH});return oH({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),RQ=R.forwardRef(function(e,t){let{selected:n}=FQ();return e.keepMounted||n?(0,z.jsx)(LQ,{...e,selected:n,ref:t}):null}),zQ=R.memo(R.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=FQ(),a=BZ(),{render:o,className:s,style:c,...l}=e;return kV(`div`,e,{ref:[R.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),BQ=R.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=BZ(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=pQ(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=gH(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=uH(g);$(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),oH({open:g,ref:v,onComplete(){g||x(!1)}});let S=kV(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=eQ(e.scrollHeight,e.clientHeight),r=tQ(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=VQ(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:lH});return y||o?S:null});function VQ(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?tQ(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?tQ(l.offsetTop+l.offsetHeight-r+i,a):a}var HQ=R.forwardRef(function(e,t){return(0,z.jsx)(BQ,{...e,ref:t,direction:`down`})}),UQ=R.forwardRef(function(e,t){return(0,z.jsx)(BQ,{...e,ref:t,direction:`up`})}),WQ=R.createContext(void 0);function GQ(){let e=R.useContext(WQ);if(e===void 0)throw Error(LV(64));return e}var KQ=`data-activation-direction`,qQ={tabActivationDirection:e=>({[KQ]:e})},JQ=R.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=R.useRef([]),[f,p]=R.useState(()=>new Map),[m,h]=cW({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=R.useState(()=>new Map),y=R.useRef(void 0),b=R.useCallback(e=>YQ(_,e),[_]),[x,S]=R.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=XQ(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;$(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=GV((e,t)=>{t.activationDirection=XQ(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=GV((e,t)=>{i?.(e,KW(t,void 0,void 0,{activationDirection:`none`}))}),j=GV((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=R.useCallback(e=>f.get(e),[f]),N=R.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=R.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),ee=R.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),F=R.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),I=R.useRef(!u),te=R.useRef(r),ne=R.useRef(u),L=R.useRef(!1);$(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),I.current=!1}if(_.size===0){L.current&&m!==null&&!y.current?.isConnected&&e(null,iW);return}L.current=!0,y.current=_.keys().next().value;let t=ee?.disabled,n=ee==null&&m!==null;if(!t&&m===te.current&&(ne.current=!1),ne.current&&t&&m===te.current)return;let r=I.current;if(t||n){let n=F??null;if(m===n){I.current=!1;return}let i=iW;r?i=aW:t&&(i=rW),e(n,i)}else r&&ee!=null&&(A(m,aW),I.current=!1)},[F,g,A,ee,h,_,m]);let re=kV(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:qQ});return(0,z.jsx)(WQ.Provider,{value:P,children:(0,z.jsx)(OY,{elementsRef:d,children:re})})});function YQ(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function XQ(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=YQ(r,e),c=YQ(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var ZQ=`data-composite-item-active`,QQ=R.createContext(void 0);function $Q(){let e=R.useContext(QQ);if(e===void 0)throw Error(LV(65));return e}var e$=R.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=GQ(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=$Q(),{highlightedIndex:v,onHighlightedIndexChange:y}=gU(),b=HW(o),{compositeProps:x,compositeRef:S,index:C}=yX({metadata:R.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=R.useRef(!1),E=R.useRef(null),D=GV(e=>{E.current?.(),E.current=e?g(e):null});$(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=uG(vU(e));if(t&&dG(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=bU({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=R.useRef(!1),M=R.useRef(!1);function N(e){f(a,KW(WU,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function ee(e){w||r||h&&(!j.current||M.current)&&N(e)}function F(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=vU(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return kV(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:ee,onPointerDown:F,[ZQ]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:qQ})}),t$=`data-index`,n$={...qQ,...lH},r$=R.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=GQ(),p=HW(),{ref:m,index:h}=IW(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=uH(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=R.useRef(null),w=kV(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:cY(!g),[t$]:h},s],stateAttributesMapping:n$});return oH({open:g,ref:C,onComplete(){g||y(!1)}}),$(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function i$(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=uV}=e,[p,m]=R.useState(0),h=r!=null,g=R.useRef(null),_=$B(g,c),v=R.useRef([]),y=R.useRef(!1),b=R.useRef(null),x=o??p,S=GV((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];KJ(g.current,t,a,n)}}),C=GV(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||ZG(e,x,d)?S(a$(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(ZG(t,x,d)){let e=XG(t,{disabledIndices:d});KG(t,e)||S(e)}KJ(g.current,r,a,n)});$(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(ZG(e,x,d)){let t=XG(e,{disabledIndices:d});KG(e,t)||S(t)}},[d,o,x,v,S]);let w=GV((e,t,n)=>i?i(e,t,n,v):n),T=GV(e=>{let o=e.key===`Home`||e.key===`End`;if(!HJ.has(e.key)||!l&&o||o$(e,f)||!g.current)return;let s=a===`rtl`,c=s?BJ:VJ,p=s?VJ:BJ,m=n===`vertical`?zJ:c,_=n===`vertical`?RJ:p,y=pG(e.nativeEvent);if(y!=null&&GJ(y)&&!kX(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=qG(v,d),T=JG(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=XG(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!KG(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=pG(e.nativeEvent);t&&n!=null&&GJ(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function a$(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!ZG(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function o$(e,t){for(let n of UJ)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function s$(e){let{render:t,className:n,style:r,refs:i=uV,props:a=uV,state:o=dV,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=i$({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:dY(),disabledIndices:v,modifierKeys:y}),k=kV(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=R.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,z.jsx)(hU.Provider,{value:A,children:(0,z.jsx)(OY,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var c$=R.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=GQ(),[d,f]=R.useState(0),[p,m]=R.useState(null),h=R.useRef(new Set),g=R.useRef(new Set),_=R.useRef(null);$(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=GV(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=GV(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=R.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,z.jsx)(QQ.Provider,{value:S,children:(0,z.jsx)(s$,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:qQ,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:uV})})}),l$=R.createContext(void 0);function u$(){return R.useContext(l$)}var d$=R.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=HW(u||void 0),h=u$(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=cW({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=bU({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=KW(WU,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],T=kV(`button`,e,{enabled:!h,state:S,ref:C,props:w}),E=R.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,z.jsx)(bX,{tag:`button`,render:c,className:n,style:f,metadata:E,state:S,refs:C,props:w}):T}),f$=R.createContext(void 0);function p$(e){let t=R.useContext(f$);if(t===void 0&&!e)throw Error(LV(72));return t}var m$={...sJ,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},h$=class extends Qq{constructor(e,t,n){let r=new Iq;super(g$(e,r,t,n),_$(r),m$)}setOpen=(e,t)=>{Aq(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,KW(GU,e))}};function g$(e,t,n,r=!1){return{...tJ(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function _$(e){return{popupRef:R.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var v$=Vq(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=wq((e,t)=>new h$({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Mq(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Nq(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=R.useRef(null);$(()=>{m&&t&&p.setOpen(!1,KW(rW))},[m,t,p]),$(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),$(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),R.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,KW(oW))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,z.jsxs)(f$.Provider,{value:p,children:[l&&(0,z.jsx)(Tq,{handle:l,store:p}),T&&(0,z.jsx)(y$,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function y$({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=yq(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=gq(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=R.useMemo(()=>gV(a.reference,i.reference),[a.reference,i.reference]);return Pq(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??dV}),null}var b$=R.createContext(void 0);function x$(){return R.useContext(b$)}var S$=`data-base-ui-tooltip-trigger`;function C$(e){let t=pG(e);return S(t)?t:null}var w$=Hq(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=p$(!0),m=cJ(a)??p;if(!m)throw Error(LV(82));let h=HW(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=R.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=jq(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=x$(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=LG(v,{open:_}),O=gJ(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=BG(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=R.useRef(!1),ee=gH(),F=R.useRef(void 0);function I(){return D&&w.current!=null?0:c??C??600}function te(e){let t=y.current;if(!t||!e)return!1;let n=fG(e,`[${S$}]`);return n!==null&&n!==t&&dG(t,n)}function ne(e){let t=te(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,ee.clear()),t}let L=yJ(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?FJ():null,restMs:I,delay(){return u==null&&D?{close:AG(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),re=dJ(v,{enabled:!A}).reference,ie=e=>{let t=P.current,n=C$(e),r=ne(n),i=y.current,a=i&&n&&dG(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,KW(KU,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&cG(F.current)){let t=()=>{P.current||j.current||m.select(`open`)||m.setOpen(!0,KW(KU,e,i))},n=I();n===0?(ee.clear(),t()):ee.start(n,t)}},ae=m.useState(`appliedTriggerProps`,S||M!==`none`);return kV(`button`,e,{state:{open:_},ref:[t,x,y],props:[L,re,ae,{onMouseOver(e){ie(e.nativeEvent)},onFocus(e){te(C$(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,ee.clear(),F.current=void 0},onPointerEnter(e){F.current=e.pointerType},onPointerDown(e){F.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[bG]:A?``:void 0,[S$]:A?void 0:``},f],stateAttributesMapping:RU})}),T$=R.createContext(void 0);function E$(){let e=R.useContext(T$);if(e===void 0)throw Error(LV(70));return e}var D$=R.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=qK({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,z.jsxs)(R.Fragment,{children:[l,c&&Ty.createPortal(n,c)]})}),O$=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return p$().useState(`mounted`)||n?(0,z.jsx)(T$.Provider,{value:n,children:(0,z.jsx)(D$,{ref:t,...r})}):null}),k$=R.createContext(void 0);function A$(){let e=R.useContext(k$);if(e===void 0)throw Error(LV(71));return e}var j$=R.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=HK,style:g,..._}=e,v=p$(),y=E$(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=TY({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=LY(e,R.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,z.jsx)(k$.Provider,{value:D,children:O})}),M$=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=p$(),{side:s,align:c}=A$(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);oH({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),_J(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return kV(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Sq,f,YJ(d),a],stateAttributesMapping:VU})}),N$=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=p$(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=A$();return kV(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:BU})}),P$=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=R.useMemo(()=>({open:t,close:n}),[t,n]);return(0,z.jsx)(b$.Provider,{value:t,children:(0,z.jsx)(IG,{delay:i,timeoutMs:r,children:e.children})})},F$=e=>{let{children:t,onSubmit:n,submitButton:r,...i}=e;return IE(i),(0,z.jsxs)(`form`,{className:`bn-form`,onSubmit:e=>{e.preventDefault(),n?.()},children:[t,r===`none`?null:r]})};function I$(...e){return pU(ee(e))}function L$({className:e,size:t=`default`,...n}){return(0,z.jsx)(VV,{"data-slot":`avatar`,"data-size":t,className:I$(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function R$({className:e,...t}){return(0,z.jsx)(pH,{"data-slot":`avatar-image`,className:I$(`aspect-square size-full rounded-full object-cover`,e),...t})}function z$({className:e,...t}){return(0,z.jsx)(_H,{"data-slot":`avatar-fallback`,className:I$(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var B$=L(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function V$({className:e,variant:t=`default`,render:n,...r}){return mU({defaultTagName:`span`,props:gV({className:I$(B$({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var H$=L(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function U$({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,z.jsx)(CU,{"data-slot":`button`,className:I$(H$({variant:t,size:n,className:e})),...r})}function W$({className:e,size:t=`default`,...n}){return(0,z.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:I$(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function G$({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`card-content`,className:I$(`px-(--card-spacing)`,e),...t})}function K$({...e}){return(0,z.jsx)(pX,{"data-slot":`dropdown-menu`,...e})}function q$({...e}){return(0,z.jsx)(wX,{"data-slot":`dropdown-menu-trigger`,...e})}function J$({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,container:a,...o}){return(0,z.jsx)(sY,{container:a,children:(0,z.jsx)(ZY,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,z.jsx)(iY,{"data-slot":`dropdown-menu-content`,className:I$(`z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o})})})}function Y$({...e}){return(0,z.jsx)(eG,{"data-slot":`dropdown-menu-group`,...e})}function X$({className:e,inset:t,...n}){return(0,z.jsx)(tG,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:I$(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function Z$({className:e,inset:t,variant:n=`default`,...r}){return(0,z.jsx)(rG,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:I$(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Q$({...e}){return(0,z.jsx)(hX,{"data-slot":`dropdown-menu-sub`,...e})}function $$({className:e,inset:t,children:n,...r}){return(0,z.jsxs)(MX,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:I$(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,z.jsx)(QX,{className:`ml-auto`})]})}function e1({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,z.jsx)(J$,{"data-slot":`dropdown-menu-sub-content`,className:I$(`w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function t1({className:e,children:t,checked:n,inset:r,...i}){return(0,z.jsxs)(YW,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:I$(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,z.jsx)(XW,{children:(0,z.jsx)(XX,{})})}),t]})}function n1({className:e,...t}){return(0,z.jsx)(OX,{"data-slot":`dropdown-menu-separator`,className:I$(`-mx-1 my-1 h-px bg-border`,e),...t})}function r1({className:e,type:t,...n}){return(0,z.jsx)(gZ,{type:t,"data-slot":`input`,className:I$(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function i1({className:e,...t}){return(0,z.jsx)(`label`,{"data-slot":`label`,className:I$(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function a1({...e}){return(0,z.jsx)(wZ,{"data-slot":`popover`,...e})}function o1({...e}){return(0,z.jsx)(DZ,{"data-slot":`popover-trigger`,...e})}function s1({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,container:a,...o}){return(0,z.jsx)(AZ,{container:a,children:(0,z.jsx)(NZ,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,z.jsx)(IZ,{"data-slot":`popover-content`,className:I$(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}var c1=nQ;function l1({className:e,...t}){return(0,z.jsx)(lQ,{"data-slot":`select-value`,className:I$(`flex flex-1 text-left`,e),...t})}function u1({className:e,size:t=`default`,children:n,...r}){return(0,z.jsxs)(sQ,{"data-slot":`select-trigger`,"data-size":t,className:I$(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,z.jsx)(uQ,{render:(0,z.jsx)(ZX,{className:`text-muted-foreground pointer-events-none size-4`})})]})}function d1({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,container:s,...c}){return(0,z.jsx)(dQ,{container:s,children:(0,z.jsx)(_Q,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,z.jsxs)(TQ,{"data-slot":`select-content`,"data-align-trigger":o,className:I$(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[(0,z.jsx)(p1,{}),(0,z.jsx)(NQ,{children:t}),(0,z.jsx)(m1,{})]})})})}function f1({className:e,children:t,...n}){return(0,z.jsxs)(IQ,{"data-slot":`select-item`,className:I$(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,z.jsx)(zQ,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,z.jsx)(RQ,{render:(0,z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,z.jsx)(XX,{className:`pointer-events-none`})})]})}function p1({className:e,...t}){return(0,z.jsx)(UQ,{"data-slot":`select-scroll-up-button`,className:I$(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,z.jsx)($X,{})})}function m1({className:e,...t}){return(0,z.jsx)(HQ,{"data-slot":`select-scroll-down-button`,className:I$(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,z.jsx)(ZX,{})})}function h1({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`skeleton`,className:I$(`animate-pulse rounded-md bg-muted`,e),...t})}function g1({className:e,orientation:t=`horizontal`,...n}){return(0,z.jsx)(JQ,{"data-slot":`tabs`,"data-orientation":t,className:I$(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var _1=L(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function v1({className:e,variant:t=`default`,...n}){return(0,z.jsx)(c$,{"data-slot":`tabs-list`,"data-variant":t,className:I$(_1({variant:t}),e),...n})}function y1({className:e,...t}){return(0,z.jsx)(e$,{"data-slot":`tabs-trigger`,className:I$(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function b1({className:e,...t}){return(0,z.jsx)(r$,{"data-slot":`tabs-content`,className:I$(`flex-1 text-sm outline-none`,e),...t})}var x1=L(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-muted`},size:{default:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function S1({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,z.jsx)(d$,{"data-slot":`toggle`,className:I$(x1({variant:t,size:n,className:e})),...r})}function C1({delay:e=0,...t}){return(0,z.jsx)(P$,{"data-slot":`tooltip-provider`,delay:e,...t})}function w1({...e}){return(0,z.jsx)(v$,{"data-slot":`tooltip`,...e})}function T1({...e}){return(0,z.jsx)(w$,{"data-slot":`tooltip-trigger`,...e})}function E1({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,container:o,...s}){return(0,z.jsx)(O$,{container:o,children:(0,z.jsx)(j$,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,z.jsxs)(M$,{"data-slot":`tooltip-content`,className:I$(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[a,(0,z.jsx)(N$,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var D1={Avatar:{Avatar:L$,AvatarFallback:z$,AvatarImage:R$},Badge:{Badge:V$},Button:{Button:U$},Card:{Card:W$,CardContent:G$},DropdownMenu:{DropdownMenu:K$,DropdownMenuCheckboxItem:t1,DropdownMenuContent:J$,DropdownMenuGroup:Y$,DropdownMenuItem:Z$,DropdownMenuLabel:X$,DropdownMenuSeparator:n1,DropdownMenuSub:Q$,DropdownMenuSubContent:e1,DropdownMenuSubTrigger:$$,DropdownMenuTrigger:q$},Input:{Input:r1},Label:{Label:i1},Popover:{Popover:a1,PopoverContent:s1,PopoverTrigger:o1},Select:{Select:c1,SelectContent:d1,SelectItem:f1,SelectTrigger:u1,SelectValue:l1},Skeleton:{Skeleton:h1},Tabs:{Tabs:g1,TabsContent:b1,TabsList:v1,TabsTrigger:y1},Toggle:{Toggle:S1},Tooltip:{Tooltip:w1,TooltipContent:E1,TooltipProvider:C1,TooltipTrigger:T1}},O1=(0,R.createContext)(void 0);function k1(){return(0,R.useContext)(O1)}var A1=(0,R.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:c,placeholder:l,disabled:u,onKeyDown:d,onChange:f,autoComplete:p,"aria-activedescendant":m,rightSection:h,...g}=e;IE(g);let _=YB([VB(c),t]),v=k1();return(0,z.jsxs)(`div`,{className:I$(n,`border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,`text-foreground items-center gap-2`),children:[o,(0,z.jsxs)(`div`,{className:`flex-1`,children:[i&&(0,z.jsx)(v.Label.Label,{htmlFor:i,children:i}),(0,z.jsx)(v.Input.Input,{className:I$(n,`h-auto border-none p-0`),id:i,name:r,placeholder:l,disabled:u,value:s,onKeyDown:d,onChange:f,ref:_,"aria-activedescendant":m})]}),h]})});function j1(e){return e?{onFocusCapture(e){let t=e.relatedTarget;t instanceof HTMLElement&&!e.currentTarget.contains(t)&&t.focus({preventScroll:!0})}}:{}}var M1=(0,R.createContext)({portalElement:null,preventFocusOnOpen:!1}),N1=e=>{let{children:t,onOpenChange:n,position:r,portalElement:i,preventFocusOnOpen:a,sub:o,...s}=e;IE(s);let c=k1(),l={portalElement:i,preventFocusOnOpen:a??!1};return o?(0,z.jsx)(c.DropdownMenu.DropdownMenuSub,{onOpenChange:n,children:(0,z.jsx)(M1.Provider,{value:l,children:t})}):(0,z.jsx)(c.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:n,children:(0,z.jsx)(M1.Provider,{value:l,children:t})})},P1=e=>{let{children:t,sub:n,...r}=e;IE(r);let i=k1();return n?(0,z.jsx)(i.DropdownMenu.DropdownMenuSubTrigger,{children:t}):(0,z.jsx)(i.DropdownMenu.DropdownMenuTrigger,{render:t})},F1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;IE(a);let o=k1(),{portalElement:s,preventFocusOnOpen:c}=(0,R.useContext)(M1);return i?(0,z.jsx)(o.DropdownMenu.DropdownMenuSubContent,{className:n,container:s,ref:t,children:r}):(0,z.jsx)(o.DropdownMenu.DropdownMenuContent,{className:n,container:s,ref:t,...j1(c),children:r})}),I1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,disabled:o,subTrigger:s,onClick:c,...l}=e;IE(l);let u=k1();return s?(0,z.jsxs)(z.Fragment,{children:[i,r]}):a===void 0?(0,z.jsxs)(u.DropdownMenu.DropdownMenuItem,{className:n,ref:t,onClick:c,disabled:o,onMouseDown:XB,...l,children:[i,r,s&&(0,z.jsx)(QX,{className:`ml-auto h-4 w-4`})]}):(0,z.jsxs)(u.DropdownMenu.DropdownMenuCheckboxItem,{className:I$(n,`gap-1`,a?``:`px-2`),ref:t,checked:a,onClick:c,disabled:o,onMouseDown:XB,...l,children:[i,r]})}),L1=(0,R.forwardRef)((e,t)=>{let{className:n,...r}=e;IE(r);let i=k1();return(0,z.jsx)(i.DropdownMenu.DropdownMenuSeparator,{className:n,ref:t})}),R1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;IE(i);let a=k1();return(0,z.jsx)(a.DropdownMenu.DropdownMenuGroup,{children:(0,z.jsx)(a.DropdownMenu.DropdownMenuLabel,{className:n,ref:t,children:r})})}),z1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;IE(u,!1);let d=k1();return(0,z.jsxs)(d.Button.Button,{variant:`ghost`,className:I$(n,`text-gray-400`),ref:t,"aria-label":l,onClick:a,onDragStart:s,onDragEnd:o,draggable:c,...u,children:[i,r]})}),B1=(0,R.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...c}=e;IE(c);let l=k1();return(0,z.jsxs)(l.Tabs.Tabs,{className:I$(n,`bg-popover max-w-screen rounded-lg p-2`),ref:t,value:a,defaultValue:i,onValueChange:o,children:[(0,z.jsx)(l.Tabs.TabsList,{children:r.map(e=>(0,z.jsx)(l.Tabs.TabsTrigger,{value:e.name,children:e.name},e.name))}),r.map(e=>(0,z.jsx)(l.Tabs.TabsContent,{value:e.name,children:(0,z.jsx)(l.Card.Card,{children:(0,z.jsx)(l.Card.CardContent,{className:`p-4`,children:e.tabPanel})})},e.name))]})}),V1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IE(i),(0,z.jsx)(`div`,{className:I$(n,`flex flex-col items-start justify-center gap-2`),ref:t,children:r})}),H1=(0,R.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;IE(s);let c=k1();return(0,z.jsx)(c.Input.Input,{"data-test":`embed-input`,className:I$(n,`w-80 max-w-full`),ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),U1=(0,R.createContext)(null),W1=e=>{let{children:t,open:n,onOpenChange:r,position:i,portalElement:a,...o}=e;IE(o);let s=k1();return(0,z.jsx)(s.Popover.Popover,{open:n,onOpenChange:r,children:(0,z.jsx)(U1.Provider,{value:a,children:t})})},G1=(0,R.forwardRef)((e,t)=>{let{children:n,...r}=e;IE(r);let i=k1();return(0,z.jsx)(i.Popover.PopoverTrigger,{ref:t,render:n})}),K1=(0,R.forwardRef)((e,t)=>{let{className:n,variant:r,children:i,...a}=e;IE(a);let o=k1(),s=(0,R.useContext)(U1);return(0,z.jsx)(o.Popover.PopoverContent,{sideOffset:8,container:s,initialFocus:!1,className:I$(n,`flex flex-col gap-2`,r===`panel-popover`?`w-fit max-w-none border-none p-0 shadow-none`:``),ref:t,children:i})}),q1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IE(i,!1),(0,z.jsx)(`div`,{className:n,ref:t,...i,children:r})}),J1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;IE(u,!1);let d=k1();return(0,z.jsxs)(d.Button.Button,{variant:`ghost`,className:I$(n,`text-gray-400`),ref:t,"aria-label":l,onClick:a,onDragStart:s,onDragEnd:o,draggable:c,...u,children:[i,r]})}),Y1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return IE(o),(0,z.jsx)(`div`,{className:I$(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,`grid`,n),style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),X1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return IE(a),(0,z.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),Z1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return IE(a),(0,z.jsx)(`div`,{id:i,role:`listbox`,className:I$(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,n),ref:t,children:r})}),Q1=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IE(i),(0,z.jsx)(`div`,{className:I$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,n),ref:t,children:(0,z.jsx)(`div`,{children:r})})}),$1=(0,R.forwardRef)((e,t)=>{let n=k1(),{className:r,item:i,isSelected:a,onClick:o,id:s,...c}=e;IE(c);let l=(0,R.useRef)(null);return(0,R.useEffect)(()=>{l.current&&a&&qB(l.current,l.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&l.current.scrollIntoView({block:`nearest`})},[a]),(0,z.jsxs)(`div`,{className:I$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,e.item.size===`small`?`gap-3 py-1`:``,r),"data-highlighted":!0,ref:JB([t,l]),id:s,onMouseDown:e=>e.preventDefault(),onClick:o,role:`option`,"aria-selected":a||void 0,children:[i.icon&&(0,z.jsx)(`div`,{className:I$(`p-3`,e.item.size===`small`?`p-0`:``,r),"data-position":`left`,children:i.icon}),(0,z.jsxs)(`div`,{className:`flex-1`,children:[(0,z.jsx)(`div`,{className:I$(`text-base`,e.item.size===`small`?`text-sm`:``,r),children:i.title}),(0,z.jsx)(`div`,{className:I$(`text-xs`,e.item.size===`small`?`hidden`:``,r),children:i.subtext})]}),i.badge&&(0,z.jsx)(`div`,{"data-position":`right`,className:`text-xs`,children:(0,z.jsx)(n.Badge.Badge,{variant:`secondary`,children:i.badge})})]})}),e0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IE(i),(0,z.jsx)(`div`,{className:I$(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),ref:t,children:r})}),t0=(0,R.forwardRef)((e,t)=>{let{className:n,...r}=e;return IE(r),(0,z.jsx)(`div`,{className:I$(n,`animate-spin`),ref:t,children:(0,z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1em`,viewBox:`0 -960 960 960`,width:`1em`,fill:`#e8eaed`,children:(0,z.jsx)(`path`,{d:`M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z`})})})}),n0=(0,R.forwardRef)((e,t)=>{let{className:n,markClassName:r,backgroundColor:i,children:a,...o}=e;return IE(o),(0,z.jsx)(`span`,{className:I$(n,r),style:r?void 0:{backgroundColor:i},ref:t,children:a})}),r0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,onMouseDown:i,onClick:a,...o}=e;IE(o,!1);let s=k1();return(0,z.jsx)(s.Button.Button,{variant:`ghost`,className:I$(n,`h-full w-full p-0 text-gray-400`,n?.includes(`extend-button-add-remove-columns`)?`ml-1`:`mt-1`,n?.includes(`extend-button-editing`)?`bg-accent text-accent-foreground`:``),ref:t,onClick:a,onMouseDown:i,...o,children:r})}),i0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:c,...l}=e;IE(l,!1);let u=k1();return(0,z.jsx)(u.Button.Button,{variant:`ghost`,className:I$(n,`h-fit w-fit p-0 text-gray-400`),ref:t,"aria-label":c,draggable:i,onDragStart:a,onDragEnd:o,style:s,...l,children:r})}),a0=(0,R.forwardRef)((e,t)=>{let{className:n,"aria-label":r,children:i,onMouseEnter:a,onMouseLeave:o,trapFocus:s,variant:c,...l}=e;IE(l);let u=k1();return(0,z.jsx)(u.Tooltip.TooltipProvider,{delay:0,children:(0,z.jsx)(`div`,{className:I$(n,`bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md`,c===`action-toolbar`?`w-fit`:``),role:`toolbar`,"aria-label":r,ref:t,onMouseEnter:a,onMouseLeave:o,children:i})})}),o0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:c,onClick:l,label:u,variant:d,onMouseDown:f,...p}=e;IE(p,!1);let m=k1(),h=Vy(),g=e=>{XB(e),f?.(e)},_=s===void 0?(0,z.jsxs)(m.Button.Button,{className:I$(n,d===`compact`?`h-6 min-w-6 p-0`:``),variant:`ghost`,size:d===`compact`?`sm`:`default`,disabled:c,onClick:l,ref:t,"aria-label":u,...p,onMouseDown:g,children:[o,r]}):(0,z.jsxs)(m.Toggle.Toggle,{className:I$(n,`aria-expanded:bg-accent aria-expanded:text-accent-foreground`,d===`compact`?`h-6 min-w-6 p-0`:``),size:d===`compact`?`sm`:`default`,"aria-label":u,onClick:l,pressed:s,disabled:c,ref:t,...p,onMouseDown:g,children:[o,r]});return(0,z.jsxs)(m.Tooltip.Tooltip,{children:[(0,z.jsx)(m.Tooltip.TooltipTrigger,{render:_}),(0,z.jsxs)(m.Tooltip.TooltipContent,{container:h,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,z.jsx)(`span`,{children:i}),a&&(0,z.jsx)(`span`,{children:a})]})]})}),s0=(0,R.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,portalElement:a,preventFocusOnOpen:o,...s}=e;IE(s);let c=k1(),l=e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.icon,e.text]}),u=r.filter(e=>e.isSelected)[0];return u?(0,z.jsxs)(c.Select.Select,{value:u.text,onValueChange:e=>r.find(t=>t.text===e).onClick?.(),disabled:i,children:[(0,z.jsx)(c.Select.SelectTrigger,{className:`border-none`,onMouseDown:XB,children:(0,z.jsx)(c.Select.SelectValue,{})}),(0,z.jsx)(c.Select.SelectContent,{className:n,container:a,alignItemWithTrigger:!1,ref:t,...j1(o??!1),children:r.map(e=>(0,z.jsx)(c.Select.SelectItem,{disabled:e.isDisabled,value:e.text,onMouseDown:XB,children:(0,z.jsx)(l,{...e})},e.text))})]}):null}),c0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,selected:i,headerText:a,onFocus:o,onBlur:s,tabIndex:c,...l}=e;IE(l);let u=k1();return(0,z.jsxs)(u.Card.Card,{className:I$(n,`w-[300px]`,i?`bg-accent text-accent-foreground`:``),onFocus:o,onBlur:s,tabIndex:c,ref:t,children:[a&&(0,z.jsx)(`div`,{className:`px-4 pt-4 text-sm italic`,children:a}),r]})}),l0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IE(i),(0,z.jsx)(`div`,{className:I$(n,`p-4`,n?.includes(`thread-comments`)?`flex flex-col gap-6 border-b`:``),ref:t,children:r})}),u0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;IE(i,!1);let a=k1();return(0,z.jsx)(a.Button.Button,{className:I$(n,`text-foreground w-fit bg-transparent p-0 hover:bg-transparent`),ref:t,children:r})}),d0=(0,R.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=Qy();IE(a,!1);let s=k1();return n===`loading`?(0,z.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,z.jsx)(s.Skeleton.Skeleton,{className:`size-7 animate-pulse rounded-full bg-neutral-400`}),(0,z.jsx)(s.Skeleton.Skeleton,{className:`h-3 w-32 animate-pulse rounded-full bg-neutral-400`})]}):(0,z.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,z.jsxs)(s.Avatar.Avatar,{children:[(0,z.jsx)(s.Avatar.AvatarImage,{src:n.avatarUrl,alt:n.username,className:`h-7 rounded-full`}),(0,z.jsx)(s.Avatar.AvatarFallback,{children:n.username[0]})]}),(0,z.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`text-sm font-bold`,children:n.username}),(0,z.jsxs)(`span`,{className:`text-xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),f0=(0,R.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,actions:o,edited:s,emojiPickerOpen:c,children:l,...u}=e;IE(u);let[d,f]=(0,R.useState)(!1),{focused:p,ref:m}=UB(),h=o&&(r===!0||r===void 0||r===`hover`&&d||p||c);return(0,z.jsxs)(`div`,{ref:t,className:I$(n,`relative flex flex-col gap-2`),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[h?(0,z.jsx)(`div`,{className:`absolute top-0 right-0 z-10`,ref:m,children:o}):null,(0,z.jsx)(d0,{...e}),l]})}),p0=(0,R.forwardRef)((e,t)=>{let{className:n,onFocus:r,onBlur:i,autoFocus:a,editor:o,editable:s,...c}=e;IE(c);let l=Oy();return(0,z.jsx)(E0,{autoFocus:a,className:I$(n,``),theme:l?.colorSchemePreference,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,ref:t,onFocus:r,onBlur:i,children:(0,z.jsx)(UR,{formattingToolbar:m0})})}),m0=()=>{let e=jR([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`);return(0,z.jsx)(MR,{blockTypeSelectItems:[],children:e})},h0=(0,R.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:c,onMouseEnter:l,...u}=e;IE(u,!1);let d=k1(),f=Vy(),p=(0,z.jsxs)(d.Button.Button,{variant:a?`secondary`:`outline`,className:I$(n,`flex h-7 items-center gap-1 rounded-full px-2.5`),onClick:c,onMouseEnter:l,ref:t,children:[(0,z.jsx)(`span`,{children:i}),(0,z.jsx)(`span`,{children:r})]});return o?(0,z.jsxs)(d.Tooltip.Tooltip,{children:[(0,z.jsx)(d.Tooltip.TooltipTrigger,{render:p}),(0,z.jsxs)(d.Tooltip.TooltipContent,{container:f,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,z.jsx)(`span`,{children:o}),s&&(0,z.jsx)(`span`,{children:s})]})]}):p}),g0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;IE(i);let a=k1();return(0,z.jsx)(a.Tooltip.TooltipProvider,{delay:0,children:(0,z.jsx)(`div`,{className:I$(n,`flex w-full flex-row flex-wrap gap-1`),ref:t,children:r})})}),_0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,"aria-label":i,...a}=e;return IE(a,!1),(0,z.jsx)(`div`,{className:I$(n,`flex min-h-0 flex-1 flex-col overflow-hidden px-4`),ref:t,role:`region`,"aria-label":i,children:r})});function v0(e){let{className:t,title:n,actions:r,closeAction:i,...a}=e;return IE(a,!1),(0,z.jsxs)(`div`,{className:I$(t,`flex shrink-0 items-center justify-between pt-4 pb-2`),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`h2`,{className:`text-card-foreground m-0 text-lg font-bold`,children:n}),r]}),i]})}function y0(e){let t=k1();return e.mode===`display`?(0,z.jsx)(`span`,{className:`bn-snapshot-name`,children:e.value}):(0,z.jsx)(`span`,{className:`bn-snapshot-name-sizer`,"data-value":e.value===``?e.placeholder:e.value,children:(0,z.jsx)(t.Input.Input,{ref:e.inputRef,className:`bn-snapshot-name h-auto shadow-none focus-visible:ring-0`,type:`text`,value:e.value,placeholder:e.placeholder,"aria-label":e[`aria-label`],onChange:e.onChange,onClick:e.onClick,onKeyDown:e.onKeyDown,onBlur:e.onBlur})})}var b0=(0,R.forwardRef)((e,t)=>{let{className:n,id:r,"aria-label":i,state:a,tabIndex:o,"aria-busy":s,onClick:c,onKeyDown:l,onFocus:u,actions:d,name:f,date:p,restoredFrom:m,secondaryLabel:h,comparingLabel:g,comparingIcon:_,...v}=e;IE(v,!1);let y=k1();return(0,z.jsxs)(y.Card.Card,{className:I$(n,`group relative mb-1 flex w-full cursor-pointer flex-col gap-1.5 overflow-visible rounded-lg border border-transparent px-3.5 py-3 text-card-foreground shadow-none transition-colors hover:bg-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`,(a===`selected`||a===`comparison-source`)&&`selected bg-primary text-primary-foreground hover:bg-primary focus-visible:-outline-offset-4 focus-visible:outline-primary-foreground`,a===`comparison-baseline`&&`comparing bg-primary/10`,(a===`comparison-source`||a===`comparison-baseline`)&&`border-primary ring-1 ring-primary`),id:r,role:`listitem`,"aria-label":i,"aria-current":a===`selected`||a===`comparison-source`?`true`:void 0,"aria-busy":s,tabIndex:o,onClick:c,onKeyDown:l,onFocus:u,ref:t,children:[g&&(0,z.jsxs)(`div`,{className:`bn-snapshot-comparing-to text-primary dark:text-primary flex items-center gap-1 text-[13px] font-semibold`,children:[_,(0,z.jsx)(`span`,{children:g})]}),(0,z.jsxs)(`div`,{className:`bn-snapshot-body flex flex-col gap-0.5 text-[13px]`,children:[(0,z.jsx)(`div`,{className:`bn-snapshot-title-row flex min-h-5 min-w-0 items-center gap-1.5 pr-5`,children:f}),p&&(0,z.jsx)(`div`,{className:`bn-snapshot-date leading-[1.3]`,children:p}),m&&(0,z.jsx)(`div`,{className:`bn-snapshot-original-date text-muted-foreground leading-[1.3]`,children:m}),h&&(0,z.jsx)(`div`,{className:`bn-snapshot-secondary-label text-muted-foreground leading-[1.3]`,children:h})]}),d&&(0,z.jsx)(`div`,{className:`bn-snapshot-menu absolute top-2 right-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 group-focus-visible:opacity-100`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:d})]})}),x0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,type:i,onClick:a,label:o,...s}=e;IE(s);let c=k1();return(0,z.jsx)(c.Button.Button,{type:i,className:n,"aria-label":o,ref:t,onClick:a,children:r})}),S0=(0,R.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;IE(s);let c=k1();return(0,z.jsx)(c.Input.Input,{type:`file`,className:n,ref:t,accept:r,value:i?i.name:void 0,onChange:async e=>o?.(e.target.files[0]),placeholder:a})}),C0=(0,R.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;IE(s);let c=(0,R.useRef)(null);return(0,R.useEffect)(()=>{c.current&&r&&qB(c.current,c.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,z.jsx)(`div`,{className:I$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm p-2 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,`text-base!`,n),ref:JB([t,c]),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),w0=(0,R.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return IE(a),(0,z.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),T0={FormattingToolbar:{Root:a0,Button:o0,Select:s0},FilePanel:{Root:B1,Button:x0,FileInput:S0,TabPanel:V1,TextInput:H1},LinkToolbar:{Root:a0,Button:o0,Select:s0},SideMenu:{Root:q1,Button:J1},SuggestionMenu:{Root:Z1,Item:$1,EmptyItem:Q1,Label:e0,Loader:t0},GridSuggestionMenu:{Root:Y1,Item:C0,EmptyItem:X1,Loader:w0},TableHandle:{Root:i0,ExtendButton:r0},Comments:{Comment:f0,Editor:p0,Card:c0,CardSection:l0,ExpandSectionsPrompt:u0},Versioning:{Sidebar:_0,Header:v0,Name:y0,Snapshot:b0,Loader:t0},AttributionTooltip:{Root:n0},Generic:{Badge:{Root:h0,Group:g0},Toolbar:{Root:a0,Button:o0,Select:s0},Form:{Root:F$,TextInput:A1},Menu:{Root:N1,Trigger:P1,Dropdown:F1,Divider:L1,Label:R1,Item:I1,Button:z1},Popover:{Root:W1,Trigger:G1,Content:K1}}},E0=e=>{let{className:t,shadCNComponents:n,...r}=e,i=(0,R.useMemo)(()=>({...D1,...n}),[n]);return(0,z.jsx)(O1.Provider,{value:i,children:(0,z.jsx)(Xy.Provider,{value:T0,children:(0,z.jsx)(dB,{className:zE(`bn-shadcn`,t||``),...r})})})},D0={"doc/data":he(xe({item:fe}),xe({data:ge(Ce(),Se()),sources:pe(me({id:Ce()})).optional()}),`The numbers a doc's charts read from the project's files (a sheet's table, a CSV, a data file of rows): what its editor draws them with.`),"doc/pages":he(xe({item:fe,width:ye().min(100).max(2400).optional()}),xe({pages:pe(xe({n:ye().positive(),width:be().positive(),height:be().positive(),landscape:ve(),image:_e})),blocks:pe(xe({n:ye().nonnegative(),places:pe(xe({page:ye().positive(),top:be(),bottom:be(),left:be(),right:be()}))}))}),"A doc's pages as render prints them, each a picture, and where each of its blocks lies on them: what its page view shows, measured as `allyhub inspect pages` measures them.")},O0=we(D0);function k0(e){let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=e=>typeof e==`string`&&e!==``?e:void 0;return t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,r=n(t.delta),i=n(t.note),a=Array.isArray(t.trend)?t.trend.filter(e=>typeof e==`number`):[];return[{label:typeof t.label==`string`?t.label:``,value:typeof t.value==`string`?t.value:``,...r===void 0?{}:{delta:r},...i===void 0?{}:{note:i},...t.downIsGood===!0?{downIsGood:!0}:{},...a.length<2?{}:{trend:a}}]})}function A0(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([e])=>e!==`type`)))}function j0(e){if(typeof e==`string`)try{let t=JSON.parse(e);return typeof t.of!=`string`||t.of===``?void 0:{type:`component`,of:t.of,...typeof t.width==`number`?{width:t.width}:{},...typeof t.height==`number`?{height:t.height}:{},...typeof t.at==`number`?{at:t.at}:{},...typeof t.alt==`string`?{alt:t.alt}:{},...typeof t.caption==`string`?{caption:t.caption}:{},...t.align===`center`||t.align===`right`?{align:t.align}:{},props:Object.fromEntries(Object.entries(t.props??{}).filter(e=>typeof e[1]==`string`))}}catch{return}}function M0(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([e])=>e!==`type`)))}var N0=[...Ee,`none`];function P0(e){if(typeof e!=`string`)return;let t;try{t=JSON.parse(e)}catch{return}let n=t.kind;if(typeof n!=`string`||!Te.includes(n))return;let r=e=>typeof t[e]==`string`?{[e]:t[e]}:{},i=e=>typeof t[e]==`number`&&Number.isFinite(t[e])?{[e]:t[e]}:{},a=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:void 0,o=Array.isArray(t.table)?t.table.map(a):void 0,s=a(t.series),c=a(t.colors),l=a(t.labels)?.filter(e=>ca.includes(e)),u=t.legend;return{type:`chart`,kind:n,...r(`title`),...o?.every(e=>e!==void 0)?{table:o}:{},...r(`data`),...r(`categories`),...s===void 0?{}:{series:s},...typeof u==`string`&&N0.includes(u)?{legend:u}:{},...l===void 0?{}:{labels:l},...r(`format`),...i(`min`),...i(`max`),...c===void 0?{}:{colors:c},...t.smooth===!0?{smooth:!0}:{},...i(`width`),...i(`height`),...r(`alt`),...r(`id`)}}var F0={[mf.math]:`math`,[mf.mermaid]:`diagram`},I0=`default`,L0=`💡`,R0={paragraph:`paragraph`,heading:`heading`,bullet:`bulletListItem`,numbered:`numberedListItem`,check:`checkListItem`,toggle:`toggleListItem`,quote:`quote`};function z0(e){let t=Object.keys(e).sort();return t.length===0?``:JSON.stringify(Object.fromEntries(t.map(t=>[t,e[t]])))}var B0=[`bold`,`italic`,`underline`,`strike`,`code`];function V0(e){if(typeof e!=`string`||e===``)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let n=t,r=n.color,i=n.background;return{...Object.fromEntries(B0.filter(e=>n[e]===!0).map(e=>[e,!0])),...typeof r==`string`?{color:r}:{},...typeof i==`string`?{background:i}:{}}}function H0(e){let t=[];for(let n of e){if(n.cite!==void 0){t.push({type:`citation`,props:{cite:n.cite,styles:z0(n.styles)}});continue}if(n.text===``&&n.href?.startsWith(`#`)===!0){t.push({type:`reference`,props:{target:n.href.slice(1),styles:z0(n.styles)}});continue}if(n.note!==void 0){t.push({type:`footnote`,props:{label:n.note,styles:z0(n.styles),href:n.href??``}});continue}let e=n.styles,r={type:`text`,text:n.text,styles:{...e.bold?{bold:!0}:{},...e.italic?{italic:!0}:{},...e.underline?{underline:!0}:{},...e.strike?{strike:!0}:{},...e.code?{code:!0}:{},...e.color===void 0?{}:{textColor:e.color},...e.background===void 0?{}:{backgroundColor:e.background},...e.tag===void 0?{}:{tag:e.tag}}};if(n.href===void 0){t.push(r);continue}let i=t.at(-1);i?.type===`link`&&i.href===n.href?i.content.push(r):t.push({type:`link`,href:n.href,content:[r]})}return t}var U0=e=>({textAlignment:e?.align??`left`,textColor:e?.color??I0,backgroundColor:e?.background??I0});function W0(e){let t={...e};delete t.children;let n=JSON.stringify(t),r=2166136261;for(let e=0;e<n.length;e++)r=Math.imul(r^n.charCodeAt(e),16777619)>>>0;return r.toString(36)}var G0=new Map,K0=e=>e.type===`image`&&e.id!==void 0?{id:e.id}:e.type===`table`&&(e.id!==void 0||e.caption!==void 0)?{...e.id===void 0?{}:{id:e.id},...e.caption===void 0?{}:{caption:e.caption}}:void 0;function q0(e){let t=new Map,n=(e,r)=>e.map((e,i)=>{let a=r[i];if(!a)return e;let o=W0(a),s=t.get(o)??0;t.set(o,s+1);let c=`d${o}${s===0?``:`-${String(s)}`}`,l=K0(a);if(l&&G0.set(c,l),a.type===`columns`)return{...e,id:c,children:(e.children??[]).map((e,t)=>({...e,id:`${c}-c${String(t)}`,children:n(e.children??[],a.columns[t]?.blocks??[])}))};let u=`children`in a?a.children??[]:[];return{...e,id:c,...e.children?{children:n(e.children,u)}:{}}});return n(J0(e),e)}function J0(e){return e.map(e=>{switch(e.type){case`paragraph`:case`bullet`:case`toggle`:case`quote`:case`heading`:case`numbered`:case`check`:return{type:R0[e.type]??`paragraph`,props:{...U0(e.look),...e.type===`heading`?{level:e.level,isToggleable:e.toggle===!0}:{},...e.type===`numbered`&&e.start!==void 0?{start:e.start}:{},...e.type===`check`?{checked:e.checked}:{}},content:H0(e.content),children:J0(e.children??[])};case`card`:return{type:`card`,props:{subtitle:e.subtitle??``},content:e.title===void 0?[]:[{type:`text`,text:e.title,styles:{}}],children:J0(e.children??[])};case`stats`:return{type:`stats`,props:{data:JSON.stringify(e.stats)}};case`callout`:return{type:`callout`,props:{icon:e.icon??``,textColor:e.look?.color??I0,backgroundColor:e.look?.background??I0},content:H0(e.content),children:J0(e.children??[])};case`code`:{let t=e.language===void 0?void 0:F0[e.language];return t===void 0?{type:`codeBlock`,props:{language:e.language??`text`},content:[{type:`text`,text:e.code,styles:{}}]}:{type:t,props:{code:e.code}}}case`image`:return{type:`image`,props:{url:e.src,name:e.alt??``,caption:e.caption??``,textAlignment:e.align??`left`,...e.width===void 0?{}:{previewWidth:e.width}}};case`table`:{let t=vf(e);return{type:`table`,content:{type:`tableContent`,headerRows:e.head===`none`||e.head===`column`?0:1,headerCols:+(e.head===`column`||e.head===`both`),columnWidths:Array.from({length:Math.max(0,...e.rows.map(e=>e.length))},(t,n)=>e.widths?.[n]??void 0),rows:e.rows.map(e=>({cells:e.map((e,n)=>t.size===0?H0(e):{type:`tableCell`,props:t.has(n)?{textAlignment:`right`}:{},content:H0(e)})}))}}}case`divider`:return{type:`divider`};case`pagebreak`:return{type:`pagebreak`,props:{orientation:e.orientation??``}};case`toc`:return{type:`toc`,props:{levels:e.levels??3,title:e.title??``,untitled:e.title===``}};case`bibliography`:return{type:`bibliography`};case`note`:return{type:`note`,props:{label:e.label},content:H0(e.content),children:J0(e.children??[])};case`component`:return{type:`component`,props:{data:A0(e)}};case`chart`:return{type:`chart`,props:{data:M0(e)}};case`columns`:return{type:`columns`,children:e.columns.map(e=>({type:`column`,props:{width:e.width??1},children:J0(e.blocks)}))};case`embed`:case`source`:return{type:`embed`,props:{source:e.source}}}})}function Y0(e){if(typeof e!=`number`||!Number.isFinite(e)||e<=0)return;let t=Math.round(e*100)/100;return t===1||t<=0?void 0:t}var X0=(e,t)=>JSON.stringify(e,Object.keys(e).sort())===JSON.stringify(t,Object.keys(t).sort());function Z0(e){if(typeof e==`string`)return e===``?[]:[{text:e,styles:{}}];if(!Array.isArray(e))return[];let t=[],n=(e,n,r)=>{if(e===``)return;let i=t.at(-1);i&&i.note===void 0&&i.cite===void 0&&i.href===r&&X0(i.styles,n)?i.text+=e:t.push({text:e,styles:n,...r===void 0?{}:{href:r}})},r=(e,t)=>{if(e.text===``)return;let r=e.styles,i=typeof r.textColor==`string`?r.textColor:I0,a=typeof r.backgroundColor==`string`?r.backgroundColor:I0,o={...r.bold===!0?{bold:!0}:{},...r.italic===!0?{italic:!0}:{},...r.underline===!0?{underline:!0}:{},...r.strike===!0?{strike:!0}:{},...r.code===!0?{code:!0}:{},...i===I0?{}:{color:i},...a===I0?{}:{background:a},...typeof r.tag==`string`&&r.tag!==``?{tag:r.tag}:{}};n(e.text,o,t)};for(let n of e)if(n.type===`text`)r(n);else if(n.type===`link`)for(let e of n.content)r(e,n.href);else if(n.type===`citation`){let{cite:e,styles:r}=n.props;e!==``&&t.push({text:`[${e}]`,styles:V0(r),cite:e})}else if(n.type===`reference`){let{target:e,styles:r}=n.props;e!==``&&t.push({text:``,styles:V0(r),href:`#${e}`})}else{let{label:e,styles:r,href:i}=n.props;if(e===``)continue;t.push({text:e,styles:V0(r),note:e,...typeof i==`string`&&i!==``?{href:i}:{}})}return da(t)}function Q0(e){let t=e?.textAlignment,n=e?.textColor,r=e?.backgroundColor,i={...t===`center`||t===`right`||t===`justify`?{align:t}:{},...typeof n==`string`&&n!==I0?{color:n}:{},...typeof r==`string`&&r!==I0?{background:r}:{}};return Object.keys(i).length>0?{look:i}:{}}var $0=e=>{let t=t2(e.children??[]);return t.length>0?{children:t}:{}},e2=e=>e===2||e===3||e===4||e===5||e===6?e:1;function t2(e){let t=[];for(let n of e){let e=n.props??{};switch(n.type){case`paragraph`:t.push({type:`paragraph`,...Q0(e),content:Z0(n.content),...$0(n)});break;case`heading`:t.push({type:`heading`,level:e2(e.level),...e.isToggleable===!0?{toggle:!0}:{},...Q0(e),content:Z0(n.content),...$0(n)});break;case`bulletListItem`:t.push({type:`bullet`,...Q0(e),content:Z0(n.content),...$0(n)});break;case`numberedListItem`:{let r=e.start;t.push({type:`numbered`,...typeof r==`number`?{start:r}:{},...Q0(e),content:Z0(n.content),...$0(n)});break}case`checkListItem`:t.push({type:`check`,checked:e.checked===!0,...Q0(e),content:Z0(n.content),...$0(n)});break;case`toggleListItem`:t.push({type:`toggle`,...Q0(e),content:Z0(n.content),...$0(n)});break;case`quote`:t.push({type:`quote`,...Q0(e),content:Z0(n.content),...$0(n)});break;case`card`:{let r=Z0(n.content).map(e=>e.text).join(``),i=e.subtitle;t.push({type:`card`,...r===``?{}:{title:r},...typeof i==`string`&&i!==``?{subtitle:i}:{},...$0(n)});break}case`stats`:{let n=e.data,r=k0(typeof n==`string`?n:``);r.length>0&&t.push({type:`stats`,stats:r});break}case`callout`:{let r=e.icon,i=Q0(e);t.push({type:`callout`,...typeof r==`string`&&r!==``?{icon:r}:{},...i.look?.color!==void 0||i.look?.background!==void 0?{look:{...i.look.color===void 0?{}:{color:i.look.color},...i.look.background===void 0?{}:{background:i.look.background}}}:{},content:Z0(n.content),...$0(n)});break}case`codeBlock`:{let r=e.language;t.push({type:`code`,...typeof r==`string`&&r!==``&&r!==`text`?{language:r}:{},code:Z0(n.content).map(e=>e.text).join(``)});break}case`image`:{let r=e.url,i=e.name,a=e.caption;if(typeof r!=`string`||r===``)break;let o=e.previewWidth,s=e.textAlignment;t.push({type:`image`,src:r,...typeof i==`string`&&i!==``?{alt:i}:{},...typeof a==`string`&&a!==``?{caption:a}:{},...typeof o==`number`&&o>0?{width:Math.round(o)}:{},...s===`center`||s===`right`?{align:s}:{},...n.id===void 0?{}:G0.get(n.id)});break}case`table`:{let e=n.content;if(e===void 0||typeof e==`string`||Array.isArray(e))break;let r=(e.headerRows??0)>0,i=(e.headerCols??0)>0,a=(e.columnWidths??[]).map(e=>typeof e==`number`&&e>0?Math.round(e):null);t.push({type:`table`,rows:e.rows.map(e=>e.cells.map(e=>Z0(Array.isArray(e)?e:e.content))),...r&&i?{head:`both`}:i?{head:`column`}:r?{}:{head:`none`},...a.some(e=>e!==null)?{widths:a}:{},...n.id===void 0?{}:G0.get(n.id)});break}case`divider`:t.push({type:`divider`});break;case`pagebreak`:{let n=e.orientation;t.push({type:`pagebreak`,...n===`landscape`||n===`portrait`?{orientation:n}:{}});break}case`bibliography`:t.push({type:`bibliography`});break;case`toc`:{let n=e.levels,r=e.title;t.push({type:`toc`,...typeof n==`number`&&n!==3?{levels:n}:{},...e.untitled===!0?{title:``}:typeof r==`string`&&r!==``?{title:r}:{}});break}case`note`:{let r=e.label;t.push({type:`note`,label:typeof r==`string`?r:``,content:Z0(n.content),...$0(n)});break}case`embed`:{let n=e.source;typeof n==`string`&&n!==``&&t.push({type:`embed`,source:n});break}case`component`:{let n=j0(e.data);n&&t.push(n);break}case`chart`:{let n=P0(e.data);n&&t.push(n);break}case`math`:case`diagram`:{let r=e.code;t.push({type:`code`,language:n.type===`math`?mf.math:mf.mermaid,code:typeof r==`string`?r:``});break}case`columns`:{let e=(n.children??[]).filter(e=>e.type===`column`).map(e=>{let t=Y0(e.props?.width);return{...t===void 0?{}:{width:t},blocks:t2(e.children??[]).flatMap(e=>e.type===`columns`?e.columns.flatMap(e=>e.blocks):[e])}});e.length<2?t.push(...e.flatMap(e=>e.blocks)):t.push({type:`columns`,columns:e});break}}}return t.map((e,n)=>{if(e.type!==`numbered`||e.start!==1||t[n-1]?.type===`numbered`)return e;let r={...e};return delete r.start,r})}var n2=40,r2=5;function i2(e,t,n=0){if(t===``)return;let r=t.slice(0,n2),i=e.indexOf(r);for(let t=0;t<n&&i>=0;t++)i=e.indexOf(r,i+r.length);return i<0?void 0:e.slice(0,i).split(`
|
|
524
|
-
`).length}function a2(e){let t=document.createRange();t.selectNodeContents(e);let n=[...t.getClientRects()];return n.length>0?n:[e.getBoundingClientRect()]}function o2(e,t,n,r,i){let a=[];for(let o of s2(e,n,r,i))if((o.blank?[o.block.getBoundingClientRect()]:a2(o.block)).some(e=>b(t,e))&&(a.push(o.element),a.length===r2))break;return a}function s2(e,t,n,r){let i=new Map;return[...e.querySelectorAll(`.bn-block-content`)].map(e=>{let a=e.textContent.trim(),o=a===``?r?.(e):void 0,s=o?.written??a,c=i.get(s)??0;i.set(s,c+1);let l=i2(n,s,c);return{block:e,blank:o!==void 0,element:{name:o?.name??`the block`,source:{path:t,...l===void 0?{}:{line:l}},...a===``?{}:{text:a}}}})}var c2=.5;function l2(e){let t=[];for(let n of e){if(n.width<=0||n.height<=0)continue;let e=t.find(e=>Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y)>Math.min(e.height,n.height)*c2);if(!e){t.push({x:n.x,y:n.y,width:n.width,height:n.height});continue}let r=Math.max(e.x+e.width,n.x+n.width),i=Math.max(e.y+e.height,n.y+n.height);e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.width=r-e.x,e.height=i-e.y}return t.map(e=>[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}])}var u2=3;function d2(e,t){let n=(t?[]:a2(e)).filter(e=>e.width>0&&e.height>0),r=n.length>0?n:[e.getBoundingClientRect()],i=Math.min(...r.map(e=>e.left))-u2,a=Math.min(...r.map(e=>e.top))-u2,o=Math.max(...r.map(e=>e.right))+u2,s=Math.max(...r.map(e=>e.bottom))+u2;return o>i&&s>a?[[{x:i,y:a},{x:o,y:a},{x:o,y:s},{x:i,y:s}]]:[]}function f2(e,t,n,r,i){let a=e=>t.x>=e.left&&t.x<=e.right&&t.y>=e.top&&t.y<=e.bottom,o=s2(e,n,r,i),s=o.findLast(e=>(e.blank?[e.block.getBoundingClientRect()]:a2(e.block)).some(a))??o.findLast(e=>a(e.block.getBoundingClientRect()));if(!s)return;let c=d2(s.block,s.blank);return c.length>0?{element:s.element,outline:c}:void 0}var p2=120;function m2(e,t,n,r,i){if(!t||t.collapsed)return[];let a=[];for(let o of s2(e,n,r,i)){if(!t.intersectsNode(o.block))continue;let e=t.cloneRange();o.block.contains(t.startContainer)||e.setStart(o.block,0),o.block.contains(t.endContainer)||e.setEnd(o.block,o.block.childNodes.length);let n=e.toString().trim(),r=n===(o.element.text??``);if(n===``&&!o.blank)continue;let i=o.blank?d2(o.block,!0):l2(e.getClientRects());i.length!==0&&a.push({element:r||o.blank?o.element:{...o.element,name:`the words ${JSON.stringify(n.slice(0,p2))} of the block`},outline:i})}return a}function h2(e){let{children:t,...n}=e;return delete n.id,{...n,...t?{children:t.map(h2)}:{}}}var g2=e=>Array.isArray(e.content)?e.content.map(e=>e.type===`text`?e.text:e.type===`link`?e.content.map(e=>e.text).join(``):e.type===`footnote`?e.props.label:e.type===`citation`?`[${e.props.cite}]`:``).join(``):``;function _2(e){let t=e.getSelection()?.blocks??[];return t.length>0?t:[e.getTextCursorPosition().block]}var v2=`.doc-scroll, .doc-body, .doc-column, .doc-title-row, .bn-container`,y2=`.doc-slash-menu, .bn-suggestion-menu, .bn-grid-suggestion-menu`;function b2(e,t){let n=document.createRange();n.selectNodeContents(e);let r=Array.from(n.getClientRects()),i=r[0];if(!i)return!0;let a=window.getSelection(),o=a&&a.rangeCount>0?a.getRangeAt(0).getClientRects()[0]:void 0;return o?o.top-i.top<i.height*.6:t||r.every(e=>Math.abs(e.top-i.top)<4)}function x2(e,t,n={}){let{onActions:r,onTitle:i}=n;(0,R.useEffect)(()=>{let n=t.current;if(!n)return;let a=e._tiptapEditor.view,o=a.dom,s=()=>{let t=window.getSelection();if(!t?.focusNode||!t.anchorNode||a.composing)return;let n=e=>o.contains(e)&&(e instanceof Element?e:e.parentElement)?.closest(`.bn-inline-content`)!=null;if(!n(t.focusNode)||!n(t.anchorNode))return;let r=a.state.selection;if(r.toJSON().type===`text`)try{let n=a.posAtDOM(t.anchorNode,t.anchorOffset),i=a.posAtDOM(t.focusNode,t.focusOffset);if(n===r.anchor&&i===r.head)return;e._tiptapEditor.commands.setTextSelection({from:Math.min(n,i),to:Math.max(n,i)})}catch{}},c=(t,n)=>{try{if(t!==n)return e.setSelection(t,n),!0;let r=o.querySelector(`.bn-block-outer[data-id="${CSS.escape(t)}"] .bn-inline-content`);return r?(e._tiptapEditor.commands.setTextSelection({from:a.posAtDOM(r,0),to:a.posAtDOM(r,r.childNodes.length)}),!0):!1}catch{return!1}},l=t=>{if(t.isComposing)return;s();let n=t.metaKey||t.ctrlKey;if(i&&!n&&!t.shiftKey&&!t.altKey&&(t.key===`ArrowUp`||t.key===`Backspace`)&&!document.querySelector(y2)){let n=e.getTextCursorPosition().block,r=e.document[0],s=a.state.selection,c=r?.id!==void 0&&n.id===r.id?o.querySelector(`.bn-block-outer[data-id="${CSS.escape(r.id)}"] .bn-inline-content`):null;if(r?.id!==void 0&&c&&s.anchor===s.head&&s.toJSON().type===`text`){let o=s.head===a.posAtDOM(c,0);if(t.key===`ArrowUp`&&b2(c,o)){t.preventDefault(),t.stopPropagation(),i();return}if(t.key===`Backspace`&&o&&n.type===`paragraph`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation();let a=g2(n);e.document.length>1?e.removeBlocks([r.id]):a!==``&&e.updateBlock(r.id,{type:`paragraph`,content:[]}),i(a);return}}}if(t.key===` `&&!n&&!t.altKey){let n=e.getTextCursorPosition().block;if(n.type===`paragraph`&&n.id!==void 0&&g2(n)===`"`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation(),e.updateBlock(n.id,{type:`quote`,content:[]});return}if(n.type===`paragraph`&&n.id!==void 0&&g2(n)===`>`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation();try{window.localStorage.setItem(`toggle-${n.id}`,`true`)}catch{}e.updateBlock(n.id,{type:`toggleListItem`,content:[]})}}else if(t.key===`Enter`&&!n&&!t.shiftKey&&!t.altKey){let n=e.getTextCursorPosition().block;if(n.type!==`callout`||n.id===void 0||g2(n)===``)return;let r=o.querySelector(`.bn-block-outer[data-id="${CSS.escape(n.id)}"] .bn-inline-content`),i=a.state.selection;if(!r||i.anchor!==i.head||i.head!==a.posAtDOM(r,r.childNodes.length))return;t.preventDefault(),t.stopPropagation();let s=n.children?.[0];s?.id===void 0?e.updateBlock(n.id,{type:n.type,children:[{type:`paragraph`}]}):e.insertBlocks([{type:`paragraph`}],s.id,`before`);let c=e.getBlock(n.id)?.children?.[0];c?.id!==void 0&&e.setTextCursorPosition(c.id,`start`)}else if(t.key===`Escape`&&!n&&!document.querySelector(y2)){let n=e.getTextCursorPosition().block;(e.getSelection()?.blocks??[]).length===0&&n.id!==void 0&&c(n.id,n.id)&&t.preventDefault()}else if(n&&!t.shiftKey&&!t.altKey&&t.key===`d`){let n=_2(e),r=n.at(-1);if(r?.id===void 0)return;t.preventDefault(),t.stopPropagation(),e.insertBlocks(n.map(h2),r.id,`after`)}else if(n&&!t.shiftKey&&!t.altKey&&t.key===`/`){let n=e.getTextCursorPosition().block;if(n.id===void 0||!r)return;t.preventDefault(),t.stopPropagation(),r(n.id)}},u=()=>Array.from(o.querySelectorAll(`:scope > .bn-block-group > .bn-block-outer`)).map(e=>({id:e.getAttribute(`data-id`)??``,box:e.getBoundingClientRect()})),d=(t,n)=>{let r=u(),a=r.at(-1);if(!a){e.focus();return}if(i&&r[0]&&n<r[0].box.top){i();return}let o=r.find(e=>n>=e.box.top&&n<=e.box.bottom),s=o??(n<(r[0]?.box.top??0)?r[0]:a);if(s){try{e.setTextCursorPosition(s.id,o&&t<s.box.left?`start`:`end`)}catch{}e.focus()}},f,p=e=>{if(!f)return;let t=e.clientX-f.x,n=e.clientY-f.y;if(!f.box&&Math.hypot(t,n)<6)return;f.box||(f.box=document.createElement(`div`),f.box.className=`doc-marquee`,document.body.append(f.box));let r=Math.min(f.y,e.clientY),i=Math.max(f.y,e.clientY);Object.assign(f.box.style,{left:`${String(Math.min(f.x,e.clientX))}px`,top:`${String(r)}px`,width:`${String(Math.abs(t))}px`,height:`${String(Math.abs(n))}px`});let a=u().filter(e=>e.box.bottom>=r&&e.box.top<=i),o=a[0],s=a.at(-1);o&&s&&c(o.id,s.id)},m=t=>{let n=f;f=void 0,window.removeEventListener(`mousemove`,p),window.removeEventListener(`mouseup`,m),n?.box?(n.box.remove(),e.focus()):n&&d(t.clientX,t.clientY)},h=e=>{if(e.button!==0)return;let t=e.target;t&&!o.contains(t)&&t.matches(v2)&&(e.preventDefault(),f={x:e.clientX,y:e.clientY,box:void 0},window.addEventListener(`mousemove`,p),window.addEventListener(`mouseup`,m))};return o.addEventListener(`keydown`,l,!0),n.addEventListener(`mousedown`,h),()=>{o.removeEventListener(`keydown`,l,!0),n.removeEventListener(`mousedown`,h),window.removeEventListener(`mousemove`,p),window.removeEventListener(`mouseup`,m),f?.box?.remove()}},[e,r,i,t])}var S2=/^([a-z][a-z0-9+.-]*:|\/\/|#)/i;function C2(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i++;let a=n.slice(i).map(()=>`..`),o=[...a,...r.slice(i)].join(`/`);return a.length===0?`./${o}`:o}var w2=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`))),T2=e=>e.slice(e.lastIndexOf(`/`)+1);function E2(e,t){if(S2.test(t))return;let n=t.split(/[?#]/)[0]??``,r;try{r=decodeURIComponent(n)}catch{return}let i=[];for(let t of`${e}/${r}`.split(`/`))if(t!==``&&t!==`.`){if(t!==`..`)i.push(t);else if(i.pop()===void 0)return}return i.length===0?void 0:i.join(`/`)}function D2(e,t){let n=w2(e);return t.filter(t=>t.entry!==e).map(e=>({title:e.title??T2(An(e.entry)),href:C2(n,e.entry),kind:e.kind,place:e.dir}))}var O2=(e,t)=>E2(w2(e),t);async function k2(e){let t=await fetch(e);if(!t.ok)return;let n=await t.blob(),r=new FileReader,i=await new Promise((t,i)=>{r.onload=()=>{t(typeof r.result==`string`?r.result:``)},r.onerror=()=>{i(Error(`The picture at ${e} could not be read.`))},r.readAsDataURL(n)}),a=i.indexOf(`,`),o=/^data:([^;,]+)/u.exec(i)?.[1];return o===void 0||a<0?void 0:{mime:o,data:i.slice(a+1)}}var A2=(0,R.createContext)(void 0);function j2({data:e,onData:t}){let n=(0,R.useContext)(A2),r=a(),i=j0(e),o=i?Sa(i):void 0,c=Re(n?.item,void 0,o!==void 0),l=Pe(n?.item,void 0,c===void 0&&o?[o]:[]),u=(0,R.useRef)(null),d=(0,R.useRef)(void 0),[f,p]=(0,R.useState)(),[m,h]=(0,R.useState)(),[g,_]=(0,R.useState)(!1),v=JSON.stringify(o);(0,R.useEffect)(()=>{let e=u.current;if(!e||!c||!o)return;if(d.current?.url===c.url){d.current.mounted.draw(o);return}let t=d.current?.mounted,n=Ie(e,c,o,{onDrawn:e=>{t?.remove(),h(void 0),e&&p(e)},onError:e=>{t?.remove(),h(e)}});d.current={url:c.url,mounted:n,...t?{old:t}:{}}},[c,v]);let y=()=>{let e=u.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0};if(s({element:()=>c&&o?u.current:void 0,pictures:async()=>{let e=y();if(!e||!o||n===void 0)return[];let t=(await On(r,`components/stills`,{item:n.item,components:[{...o}]}).catch(()=>void 0))?.stills[0]?.url,i=t===void 0?void 0:await k2(t).catch(()=>void 0);return i?[{rect:e,...i}]:[]},locate:()=>{if(!i||n===void 0)return Promise.resolve({elements:[]});let e=i.of.split(`#`)[0]??i.of,t=E2(w2(n.path),e)??e;return Promise.resolve({elements:[{name:`the component ${xa(i)}`,source:{path:t},...i.alt===void 0?{}:{text:i.alt}}]})}}),(0,R.useEffect)(()=>()=>{d.current?.old?.remove(),d.current?.mounted.remove(),d.current=void 0},[]),!i||!o)return(0,z.jsxs)(`div`,{contentEditable:!1,className:`doc-embed`,children:[(0,z.jsx)(ii,{size:18,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`doc-embed-note`,children:n?.words?.embed})]});let b=c===void 0?l.get(JSON.stringify(o)):void 0,x=(0,z.jsxs)(`div`,{ref:u,className:`doc-component-frame`,style:{width:`min(100%, ${String(o.width)}px)`,aspectRatio:`${String(o.width)} / ${String(o.height)}`},children:[b!==void 0&&(0,z.jsx)(`img`,{src:b,alt:i.alt??``,className:`doc-component-still`}),m!==void 0&&(0,z.jsxs)(`div`,{role:`alert`,className:`doc-component-error`,children:[(0,z.jsx)(ii,{size:16,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:xa(i)}),(0,z.jsx)(`span`,{className:`doc-component-error-text`,children:m})]})]}),S=!n?.readOnly&&f!==void 0&&Object.keys(f.props).length>0;return(0,z.jsxs)(`figure`,{contentEditable:!1,"data-doc-component":``,className:`doc-component`,style:i.align===void 0?void 0:{textAlign:i.align},children:[(0,z.jsxs)(tt,{open:S&&g,onOpenChange:_,children:[(0,z.jsx)(rt,{asChild:!0,children:(0,z.jsx)(`button`,{type:`button`,className:`doc-component-button`,"aria-label":xa(i),disabled:!S,children:x})}),S&&(0,z.jsx)(Qe,{align:`start`,className:`w-72`,children:(0,z.jsx)(Be,{types:f.props,values:i.props,locale:n?.locale??`en`,onChange:(e,n)=>{let r=Object.fromEntries(Object.entries(i.props).flatMap(([t,r])=>t===e?n===void 0?[]:[[t,n]]:[[t,r]]));n!==void 0&&!(e in r)&&(r[e]=n),t(A0({...i,props:r}))}})})]}),i.caption!==void 0&&(0,z.jsx)(`figcaption`,{children:i.caption})]})}var M2=xB({type:`component`,propSchema:{data:{default:``}},content:`none`},{render:e=>(0,z.jsx)(j2,{data:e.block.props.data,onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})}),N2=`--doc-col-gap`,P2=`--doc-col-share`,F2=80,I2=e=>Math.round(e*100)/100,L2=e=>Y0(e?.props?.width)??1;function R2({editor:e,id:t}){let n=TL(uN),r=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=e=>{e.target===r.current&&(e.stopPropagation(),n.hideMenuIfNotFrozen())};return window.addEventListener(`mousemove`,e,!0),()=>{window.removeEventListener(`mousemove`,e,!0)}},[n]),(0,z.jsx)(`div`,{ref:r,contentEditable:!1,className:`doc-col-sizer`,onPointerDown:n=>{if(n.button!==0)return;let r=e.getParentBlock(t)?.children??[],i=r.findIndex(e=>e.id===t),a=r[i-1],o=n.currentTarget.parentElement,s=o?.closest(`.doc-cols`)?.querySelector(`[data-doc-col="${CSS.escape(a?.id??``)}"]`);if(!a?.id||!o||!s)return;n.preventDefault();let c=n.currentTarget;c.setPointerCapture(n.pointerId);let l=s.getBoundingClientRect().width,u=o.getBoundingClientRect().width,d=L2(a)+L2(r[i]),f=n.clientX,p=[L2(a),L2(r[i])],m=e=>{let t=Math.min(Math.max(l+e.clientX-f,F2),l+u-F2),n=I2(d*t/(l+u));p=[n,I2(d-n)],s.style.setProperty(P2,String(p[0])),o.style.setProperty(P2,String(p[1]))},h=()=>{c.removeEventListener(`pointermove`,m),c.removeEventListener(`pointerup`,h),c.removeEventListener(`pointercancel`,h),c.removeAttribute(`data-dragging`),s.style.setProperty(P2,String(L2(a))),o.style.setProperty(P2,String(L2(r[i])));let[n,l]=p;(n!==L2(a)||l!==L2(r[i]))&&e.transact(()=>{e.updateBlock(a.id??``,{type:`column`,props:{width:n}}),e.updateBlock(t,{type:`column`,props:{width:l}})})};c.setAttribute(`data-dragging`,``),c.addEventListener(`pointermove`,m),c.addEventListener(`pointerup`,h),c.addEventListener(`pointercancel`,h)},"aria-hidden":!0})}var z2=xB({type:`columns`,propSchema:{},content:`none`,layoutOnly:!0,children:{allow:[`column`],min:2}},{renderFrame:e=>(0,z.jsx)(`div`,{className:`doc-cols`,style:{[N2]:`32px`},ref:e.slotRef})});function B2({editor:e,id:t,width:n,slotRef:r}){let i=(0,R.useContext)(A2)?.readOnly??!1,a=Fy({editor:e,selector:()=>e.getParentBlock(t)?.children?.[0]?.id===t});return(0,z.jsxs)(`div`,{className:`doc-col`,"data-doc-col":t,style:{[P2]:String(n)},children:[!a&&!i&&e.isEditable&&(0,z.jsx)(R2,{editor:e,id:t}),(0,z.jsx)(`div`,{className:`doc-col-blocks`,ref:r})]})}var V2=xB({type:`column`,propSchema:{width:{default:1}},content:`none`,layoutOnly:!0,placeable:`namedOnly`,children:{exclude:[`columns`]}},{renderFrame:e=>(0,z.jsx)(B2,{editor:e.editor,id:e.block.id,width:e.block.props.width,slotRef:e.slotRef})});function H2(e,t){for(let n=e.getParentBlock(t);n;n=n.id===void 0?void 0:e.getParentBlock(n.id))if(n.type===`column`)return!0;return!1}function U2(e,t){let n=e;return Fy({editor:e,selector:()=>{let e=n.getParentBlock(t);for(;e?.id!==void 0&&e.type!==`column`;)e=n.getParentBlock(e.id);if(e?.type!==`column`||e.id===void 0)return;let r=n.getParentBlock(e.id),i=(r?.children??[]).map(e=>({width:L2(e),blocks:[]}));return Wa({columns:i})[i.length===0?0:(r?.children??[]).findIndex(t=>t.id===e.id)]}})}var W2=(0,R.createContext)({page:{},base:``,data:void 0,wantData:()=>void 0,dark:!1}),G2=e=>Tf(e).text,K2=[`bottom`,`top`,`left`,`right`,`none`];function q2(e){return{type:`chart`,kind:`column-clustered`,table:[[``,e.series(1),e.series(2)],[e.category(1),`4`,`3`],[e.category(2),`6`,`5`],[e.category(3),`5`,`7`]]}}var J2=e=>Math.max(0,...e.map(e=>e.length)),Y2=(e,t,n,r)=>e.map((e,i)=>i===t?Array.from({length:Math.max(e.length,n+1)},(t,i)=>i===n?r:e[i]??``):[...e]),X2=(e,t)=>[...e.map(e=>[...e]),[t.category(e.length),...Array.from({length:J2(e)-1},()=>``)]],Z2=(e,t)=>{let n=J2(e);return e.map((e,r)=>[...Array.from({length:n},(t,n)=>e[n]??``),r===0?t.series(n):``])},Q2=(e,t)=>e.length<=2||t<1?e.map(e=>[...e]):e.filter((e,n)=>n!==t).map(e=>[...e]),$2=(e,t)=>J2(e)<=2||t<1?e.map(e=>[...e]):e.map(e=>e.filter((e,n)=>n!==t));function e4(e){let[t,n]=(0,R.useState)(e.text),r=()=>{t!==e.text&&e.onCommit(t)},i=(t,n)=>{t.preventDefault(),r(),t.currentTarget.closest(`table`)?.querySelector(`[data-row="${String(e.row+n)}"][data-col="${String(e.col)}"]`)?.focus()};return(0,z.jsx)(`input`,{value:t,"aria-label":e.label,"data-row":e.row,"data-col":e.col,spellCheck:!1,className:N(`text-dense h-7 w-full min-w-14 bg-transparent px-1.5 outline-none`,`focus:bg-sheet focus:outline-pencil focus:outline-1 focus:-outline-offset-1`,e.row>0&&e.col>0&&`text-right tabular-nums`,(e.row===0||e.col===0)&&`font-medium`),onChange:e=>{n(e.target.value)},onFocus:t=>{t.target.select(),e.onFocus()},onBlur:r,onKeyDown:r=>{r.key===`Escape`&&t!==e.text?(r.preventDefault(),r.stopPropagation(),n(e.text)):r.key===`Enter`?i(r,r.shiftKey?-1:1):r.key===`ArrowDown`?i(r,1):r.key===`ArrowUp`&&i(r,-1)}})}function t4({table:e,w:t,sample:n,remove:r,onTable:i}){let[a,o]=(0,R.useState)(),s=J2(e);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsx)(`div`,{className:`border-rule max-h-56 overflow-auto rounded-md border`,children:(0,z.jsx)(`table`,{className:`w-full border-collapse`,children:(0,z.jsx)(`tbody`,{children:e.map((n,r)=>(0,z.jsx)(`tr`,{className:N(`border-rule border-b last:border-b-0`,r===0&&`bg-paper`),children:Array.from({length:s},(a,s)=>{let c=n[s]??``;return(0,z.jsx)(`td`,{className:`border-rule border-l p-0 first:border-l-0`,children:(0,z.jsx)(e4,{row:r,col:s,text:c,label:t.cell(r+1,s+1),onCommit:t=>{i(Y2(e,r,s,t))},onFocus:()=>{o({row:r,col:s})}},c)},s)})},r))})})}),(0,z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,z.jsx)(Kn,{icon:!0,"aria-label":t.addCategory,title:t.addCategory,onClick:()=>{i(X2(e,n))},children:(0,z.jsx)(Ne,{})}),(0,z.jsx)(Kn,{icon:!0,"aria-label":t.addSeries,title:t.addSeries,onClick:()=>{i(Z2(e,n))},children:(0,z.jsx)(Me,{})}),(0,z.jsxs)(Hn,{children:[(0,z.jsx)(wn,{asChild:!0,children:(0,z.jsx)(Kn,{icon:!0,"aria-label":r,title:r,children:(0,z.jsx)(_n,{})})}),(0,z.jsxs)(Pn,{align:`start`,className:`text-sm`,children:[(0,z.jsx)(Dn,{disabled:e.length<=2,onSelect:()=>{i(Q2(e,a&&a.row>0?a.row:e.length-1)),o(void 0)},children:t.deleteCategory}),(0,z.jsx)(Dn,{disabled:s<=2,onSelect:()=>{i($2(e,a&&a.col>0?a.col:s-1)),o(void 0)},children:t.deleteSeries})]})]})]})]})}function n4({block:e,legend:t,problems:n,words:r,onChange:i}){let a=r.chart,o=e.labels?.includes(`value`)===!0,[s,...c]=e.table??[],l=s?.length===2&&/^(column|bar)-/u.test(e.kind)?c.map(e=>e[0]??``):[],u=t=>{let n=e.colors?.[t];return n!==void 0&&v4.includes(n)?n:`default`},[d,f]=(0,R.useState)(e.title??``),p=t=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,z.jsxs)(In,{value:e.kind,onValueChange:t=>{i({...e,kind:t})},children:[(0,z.jsx)(jn,{size:`sm`,className:`w-full`,"aria-label":a.type,children:(0,z.jsx)(Ln,{})}),(0,z.jsx)(kn,{children:Te.map(e=>(0,z.jsx)(Bn,{value:e,children:a.types[e]},e))})]}),(0,z.jsx)(Nn,{value:d,placeholder:a.title,"aria-label":a.title,className:`h-8 text-sm`,onChange:t=>{f(t.target.value),i(t.target.value===``?p(`title`):{...e,title:t.target.value})}}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`text-lead text-xs`,children:a.legend}),(0,z.jsxs)(In,{value:t,onValueChange:t=>{i({...e,legend:t})},children:[(0,z.jsx)(jn,{size:`sm`,"aria-label":a.legend,children:(0,z.jsx)(Ln,{})}),(0,z.jsx)(kn,{children:K2.map(e=>(0,z.jsx)(Bn,{value:e,children:a.legendAt[e]},e))})]}),(0,z.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm`,children:[(0,z.jsx)(`span`,{children:a.dataLabels}),(0,z.jsx)(yn,{size:`sm`,checked:o,onCheckedChange:t=>{let n=(e.labels??[]).filter(e=>e!==`value`),r=t?[`value`,...n]:n;i(r.length===0?p(`labels`):{...e,labels:[...r]})}})]})]}),ja.has(e.kind)&&(0,z.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(`span`,{children:a.smooth}),(0,z.jsx)(yn,{size:`sm`,checked:e.smooth===!0,onCheckedChange:t=>{i(t?{...e,smooth:!0}:p(`smooth`))}})]}),l.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(`span`,{className:`text-lead text-xs`,children:a.barColors}),(0,z.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:l.map((t,n)=>(0,z.jsxs)(In,{value:u(n),onValueChange:t=>{let r=l.map((e,r)=>r===n?t:u(r));i(r.every(e=>e==="default")?p(`colors`):{...e,colors:r})},children:[(0,z.jsxs)(jn,{size:`sm`,"aria-label":t,children:[(0,z.jsx)(`span`,{className:`truncate`,children:t}),(0,z.jsx)(Ln,{})]}),(0,z.jsxs)(kn,{children:[(0,z.jsx)(Bn,{value:`default`,children:r.defaultColor}),v4.map(e=>(0,z.jsx)(Bn,{value:e,children:r.colorNames[e]},e))]})]},n))})]}),e.table===void 0?(0,z.jsx)(`p`,{className:`text-lead text-xs`,children:a.fromFile(e.data??``)}):(0,z.jsx)(t4,{table:e.table,w:a,sample:r.sample,remove:r.remove,onTable:t=>{i({...e,table:t})}}),n.length>0&&(0,z.jsx)(`p`,{role:`alert`,className:`text-problem-text max-h-24 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:n.join(`
|
|
525
|
-
`)})]})}function r4({data:e,room:t,onData:n}){let r=(0,R.useContext)(A2),i=(0,R.useContext)(W2),[a,o]=(0,R.useState)(!1),s=(0,R.useMemo)(()=>P0(e),[e]),c=s?.data!==void 0,{wantData:l}=i;(0,R.useEffect)(()=>{c&&l()},[c,l]);let u=c&&i.data===void 0,d=(0,R.useMemo)(()=>({page:i.page,base:i.base,data:e=>i.data?.[e],font:G2(i.page),dark:i.dark,...t===void 0?{}:{room:t}}),[i.page,i.base,i.data,i.dark,t]),f=(0,R.useMemo)(()=>s===void 0||u?void 0:Ba(s,d),[s,u,d]),p=r?.words;if(!s||!p)return(0,z.jsxs)(`div`,{contentEditable:!1,className:`doc-embed`,children:[(0,z.jsx)(Je,{size:18,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`doc-embed-note`,children:p?.embed})]});let m=Na(s,t),h=!r.readOnly,g=s.legend??(a?La(s,d).chart?.legend??`none`:`none`);return(0,z.jsx)(`figure`,{contentEditable:!1,"data-doc-chart":``,className:`doc-component`,children:(0,z.jsxs)(tt,{open:h&&a,onOpenChange:o,children:[(0,z.jsx)(rt,{asChild:!0,children:(0,z.jsx)(`button`,{type:`button`,className:`doc-component-button`,"aria-label":s.alt??s.title??p.blocks.chart,disabled:!h,children:(0,z.jsx)(`div`,{className:`doc-component-frame doc-chart-frame`,style:{width:`min(100%, ${String(m.width)}px)`,aspectRatio:`${String(m.width)} / ${String(m.height)}`},children:u?(0,z.jsx)(`div`,{className:`doc-chart-waiting`,children:p.chart.notHere(s.data??``)}):f?.svg===void 0?(0,z.jsxs)(`div`,{role:`alert`,className:`doc-component-error`,children:[(0,z.jsx)(Je,{size:16,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:p.chart.cannotDraw}),(0,z.jsx)(`span`,{className:`doc-component-error-text`,children:f?.problems.join(`
|
|
526
|
-
`)})]}):(0,z.jsx)(`div`,{className:`doc-chart-svg`,dangerouslySetInnerHTML:{__html:f.svg}})})})}),h&&(0,z.jsx)(Qe,{align:`start`,className:`w-[min(26rem,calc(100vw-2rem))]`,children:(0,z.jsx)(n4,{block:s,legend:g,problems:f?.svg===void 0?[]:f.problems,words:p,onChange:e=>{n(M0(e))}})})]})})}var i4=xB({type:`chart`,propSchema:{data:{default:``}},content:`none`},{render:function(e){return(0,z.jsx)(r4,{data:e.block.props.data,room:U2(e.editor,e.block.id),onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})}}),a4=e=>e.map(e=>e.note===void 0?e.text:``).join(``);function o4(e){let t=new Map;for(let n of _a(e)){if(n.type!==`note`)continue;let e=[..._a(n.children??[])].flatMap(e=>`content`in e?[a4(e.content)]:[]),r=n.label.toLowerCase();t.has(r)||t.set(r,[a4(n.content),...e].filter(e=>e!==``).join(` `))}return{numbers:va(e),words:t}}var s4=(e,t)=>JSON.stringify([[...e.numbers],[...e.words]])===JSON.stringify([[...t.numbers],[...t.words]]);function c4(e){let t=0,n=e=>{/^\d+$/.test(e)&&(t=Math.max(t,Number(e)))};for(let t of _a(e)){t.type===`note`&&n(t.label);let e=`content`in t?[t.content]:t.type===`table`?t.rows.flat():[];for(let t of e.flat())t.note!==void 0&&n(t.note)}return String(t+1)}function*l4(e){for(let t of e)yield t,yield*l4(t.children??[])}function u4(e,t){let n=t.toLowerCase();for(let t of l4(e)){let e=t.props?.label;if(t.type===`note`&&typeof e==`string`&&e.toLowerCase()===n)return t}}function d4(e,t){let n=va(t2(e)),r=t.map(e=>({label:e,n:n.get(e.toLowerCase())??0})).sort((e,t)=>t.n-e.n);for(let{label:t}of r){let n=u4(e,t)?.id;if(n!==void 0)return{id:n,placement:`after`}}let i=[...l4(e)].find(e=>e.type===`note`)?.id;if(i!==void 0)return{id:i,placement:`before`};let a=e.at(-1)?.id;return a===void 0?void 0:{id:a,placement:`after`}}function f4(e){let{doc:t,selection:n}=e._tiptapEditor.state,r=[];return t.nodesBetween(0,n.from,(e,t)=>{if(e.type.name===`note`)return!1;let i=e.attrs.label;return e.type.name===`footnote`&&t<n.from&&typeof i==`string`&&r.push(i),!0}),r}function p4(e){let t=c4(t2(e.document)),n=d4(e.document,f4(e));e.transact(()=>{e.insertInlineContent([{type:`footnote`,props:{label:t}}],{updateSelection:!0}),n!==void 0&&e.insertBlocks([{type:`note`,props:{label:t}}],n.id,n.placement)});let r=u4(e.document,t);r?.id!==void 0&&(e.setTextCursorPosition(r.id,`end`),e.focus())}var m4={bold:`bold`,italic:`italic`,underline:`underline`,strike:`strike`,code:`code`,textColor:`color`,backgroundColor:`background`};function h4(e){let t=[];return e.forEach((n,r)=>{n.steps.forEach((i,a)=>{let o=i.toJSON();if(o.stepType!==`addMark`&&o.stepType!==`removeMark`||o.from===void 0||o.to===void 0||o.mark?.type===void 0)return;let s=n.mapping.slice(a+1);for(let t of e.slice(r+1))s.appendMapping(t.mapping);t.push({from:s.map(o.from,1),to:s.map(o.to,-1),add:o.stepType===`addMark`,type:o.mark.type,attrs:o.mark.attrs??{}})})}),t}function g4(e,t){let n=typeof e.href==`string`?e.href:``,r=V0(e.styles);if(t.type===`link`){let e=t.add?t.attrs.href:``;return{styles:z0(r),href:typeof e==`string`?e:``}}let i=m4[t.type];if(i===void 0)return;let a=Object.fromEntries(Object.entries(r).filter(([e])=>e!==i)),o=a;if(t.add&&(i===`color`||i===`background`)){let e=t.attrs.stringValue;if(typeof e!=`string`)return;e!=="default"&&(o={...a,[i]:e})}else t.add&&(o={...a,[i]:!0});return{styles:z0(o),href:n}}var _4=QC(({editor:e})=>({key:`docFootnotes`,keyboardShortcuts:{"Mod-Alt-f":()=>(p4(e),!0)},prosemirrorPlugins:[new Lr({appendTransaction(e,t,n){let r=h4(e);if(r.length===0)return null;let i=n.tr;for(let e of r)e.from>=e.to||i.doc.nodesBetween(e.from,e.to,(t,n)=>{if(t.type.name!==`footnote`)return!0;let r=g4(t.attrs,e);return r&&(r.styles!==t.attrs.styles||r.href!==t.attrs.href)&&i.setNodeMarkup(n,void 0,{...t.attrs,...r}),!1});return i.docChanged?i:null}})]}))(),v4=[`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`];function y4(e){return{type:`columns`,children:Array.from({length:e},()=>({type:`column`,children:[{type:`paragraph`}]}))}}var b4=[{key:`paragraph`,icon:Fe,aliases:[`text`,`p`,`正文`,`文字`,`段落`],block:{type:`paragraph`}},{key:`heading1`,hint:`#`,icon:Kr,aliases:[`h1`,`title`,`标题`,`一级`],block:{type:`heading`,props:{level:1}}},{key:`heading2`,hint:`##`,icon:qr,aliases:[`h2`,`标题`,`二级`],block:{type:`heading`,props:{level:2}}},{key:`heading3`,hint:`###`,icon:Jr,aliases:[`h3`,`标题`,`三级`],block:{type:`heading`,props:{level:3}}},{key:`bullet`,hint:`-`,icon:yt,aliases:[`ul`,`list`,`bullet`,`列表`,`无序`],block:{type:`bulletListItem`}},{key:`numbered`,hint:`1.`,icon:bt,aliases:[`ol`,`list`,`number`,`列表`,`有序`,`编号`],block:{type:`numberedListItem`}},{key:`check`,hint:`[]`,icon:Qr,aliases:[`todo`,`task`,`checkbox`,`待办`,`任务`,`清单`],block:{type:`checkListItem`}},{key:`toggle`,hint:`>`,icon:Zr,aliases:[`fold`,`collapse`,`折叠`,`展开`],block:{type:`toggleListItem`}},{key:`quote`,hint:`"`,icon:dn,aliases:[`blockquote`,`引用`],block:{type:`quote`}},{key:`callout`,icon:Xr,aliases:[`note`,`tip`,`warning`,`提示`,`注意`,`标注`],block:{type:`callout`}},{key:`card`,icon:ni,aliases:[`box`,`panel`,`卡片`,`面板`],block:{type:`card`,children:[{type:`paragraph`}]}},{key:`stats`,icon:Gr,aliases:[`kpi`,`metric`,`figures`,`numbers`,`scorecard`,`数字`,`指标`],block:{type:`stats`,props:{data:JSON.stringify([{label:``,value:``},{label:``,value:``},{label:``,value:``}])}}},{key:`code`,hint:"```",icon:it,aliases:[`pre`,`代码`],block:{type:`codeBlock`}},{key:`divider`,hint:`---`,icon:Et,aliases:[`hr`,`line`,`rule`,`分隔`,`横线`],block:{type:`divider`}},{key:`table`,icon:gn,aliases:[`grid`,`表格`],block:{type:`table`,content:{type:`tableContent`,rows:[{cells:[[],[],[]]},{cells:[[],[],[]]}]}}},{key:`image`,icon:qn,aliases:[`picture`,`photo`,`img`,`图片`,`照片`],block:{type:`image`}},{key:`chart`,icon:Je,aliases:[`graph`,`plot`,`bar`,`line`,`pie`,`图表`,`柱状图`],make:e=>({type:`chart`,props:{data:M0(q2(e.sample))}})},{key:`equation`,hint:`$$`,icon:hn,aliases:[`math`,`tex`,`latex`,`formula`,`公式`,`数学`],block:{type:`math`,props:{code:String.raw`e^{i\pi} + 1 = 0`}}},{key:`diagram`,icon:oi,aliases:[`mermaid`,`flowchart`,`graph`,`图示`,`流程图`],block:{type:`diagram`,props:{code:`graph LR
|
|
527
|
-
A --> B
|
|
528
|
-
B --> C`}}},{key:`pagebreak`,icon:lt,aliases:[`page`,`break`,`new page`,`分页`,`分页符`],block:{type:`pagebreak`}},{key:`pagebreakLandscape`,icon:at,aliases:[`landscape`,`wide`,`orientation`,`section`,`横向`,`横排`],block:{type:`pagebreak`,props:{orientation:`landscape`}}},{key:`pagebreakPortrait`,icon:ot,aliases:[`portrait`,`orientation`,`section`,`纵向`,`竖排`],block:{type:`pagebreak`,props:{orientation:`portrait`}}},{key:`toc`,icon:$r,aliases:[`contents`,`table of contents`,`toc`,`outline`,`目录`],block:{type:`toc`}},{key:`bibliography`,icon:Yr,aliases:[`references`,`sources`,`citations`,`参考文献`,`文献`],block:{type:`bibliography`}},{key:`footnote`,icon:ze,aliases:[`note`,`source`,`cite`,`reference`,`脚注`,`注释`],run:`footnote`},{key:`columns2`,icon:Ve,aliases:[`columns`,`side`,`layout`,`分栏`,`两栏`,`列`],block:y4(2)},{key:`columns3`,icon:ct,aliases:[`columns`,`side`,`layout`,`分栏`,`三栏`,`列`],block:y4(3)}],x4=[`paragraph`,`heading1`,`heading2`,`heading3`,`bullet`,`numbered`,`check`,`toggle`,`quote`,`callout`];function S4(e){let t=b4.find(t=>t.key===e);return t&&x4.includes(e)?t.block:void 0}function C4(e,t,n=[]){let r=t.trim().toLowerCase(),i=e=>e.title.toLowerCase().includes(r)||e.key.includes(r)||e.aliases.some(e=>e.toLowerCase().includes(r)),a=[...b4.map(({make:t,...n})=>({...n,title:e.blocks[n.key],...t?{block:t(e)}:{}})),...n.map(t=>({key:`component:${t.of}`,title:t.title,icon:ii,aliases:[`component`,`组件`,e.component,t.name],block:{type:`component`,props:{data:A0({type:`component`,of:t.of,props:{}})}}}))];if(r===``)return a;let o=x4.flatMap(t=>{let n=b4.find(e=>e.key===t);return n?.block?[{key:`turn:${t}`,title:`${e.turnInto} ${e.blocks[t]}`,icon:n.icon,aliases:[`turn`,`转换`,`变成`,e.turnInto],update:n.block}]:[]}),s=v4.flatMap(t=>[{key:`color:text:${t}`,title:`${e.colorNames[t]} ${e.text}`,icon:pt,aliases:[t,`color`,`颜色`,e.colorNames[t]],update:{type:``,props:{textColor:t}}},{key:`color:background:${t}`,title:`${e.colorNames[t]} ${e.background}`,icon:pt,aliases:[t,`background`,`背景`,e.colorNames[t]],update:{type:``,props:{backgroundColor:t}}}]),c=[...o,...s].filter(e=>e.aliases.some(e=>e.toLowerCase().startsWith(r))||e.title.toLowerCase().startsWith(r));return[...a.filter(i),...c]}function w4(){let e=ky();return t=>{if(t.run===`footnote`){p4(e);return}if(t.block){bA(e,t.block);return}if(!t.update)return;let n=e.getTextCursorPosition().block,{type:r,...i}=t.update;e.updateBlock(n,{...r===``?{}:{type:r},...i})}}var T4={doc:ti,video:Gn,slides:En,sheet:je,scenery:Un,model:Vn,website:zn},E4=8;function D4(e,t){let n=t.trim().toLowerCase();return e.filter(e=>n===``||e.title.toLowerCase().includes(n)||e.place.toLowerCase().includes(n)).slice(0,E4).map(e=>({key:`link:${e.href}`,title:e.title,hint:e.place,icon:(e.kind!==void 0&&Object.hasOwn(T4,e.kind)?T4[e.kind]:void 0)??ti,aliases:[]}))}function O4({items:e,selectedIndex:t,onItemClick:n,empty:r,testId:i=`doc-slash-menu`}){let a=(0,R.useRef)(null),[o,s]=(0,R.useState)(),[c,l]=(0,R.useState)(t);c!==t&&(l(t),s(void 0));let u=o??t,d=(0,R.useRef)(n);return(0,R.useEffect)(()=>{d.current=n}),(0,R.useEffect)(()=>{if(o===void 0)return;let t=e[o],n=e=>{e.key===`Enter`&&t&&(e.preventDefault(),e.stopImmediatePropagation(),d.current?.(t))};return window.addEventListener(`keydown`,n,!0),()=>{window.removeEventListener(`keydown`,n,!0)}},[o,e]),(0,R.useEffect)(()=>{a.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[t]),(0,z.jsx)(`div`,{ref:a,role:`listbox`,"data-testid":i,className:`doc-menu doc-slash-menu`,children:e.length===0?(0,z.jsx)(`p`,{className:`doc-menu-empty`,children:r}):e.map((e,t)=>{let r=e.icon;return(0,z.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===u,"data-item":e.key,className:`doc-menu-item`,onMouseMove:()=>{o!==t&&s(t)},onMouseDown:e=>{e.preventDefault()},onClick:()=>{n?.(e)},children:[(0,z.jsx)(r,{size:16,"aria-hidden":!0,className:`doc-menu-icon`}),(0,z.jsx)(`span`,{className:`doc-menu-title`,children:e.title}),e.hint!==void 0&&(0,z.jsx)(`span`,{className:`doc-menu-hint`,"aria-hidden":!0,children:e.hint})]},e.key)})})}var k4=[{value:`left`,icon:qe},{value:`center`,icon:Ue},{value:`right`,icon:Ye},{value:`justify`,icon:Le}];function A4({names:e}){let t=ky(),n=Zy(),r=Vy(),i=Fy({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block,n=t.props?.textAlignment;return typeof n==`string`?`${n}:${t.content===void 0?`placed`:`text`}`:void 0}});if(!n||i===void 0)return null;let[a,o]=i.split(`:`),s=k4.filter(({value:e})=>o===`text`||e!==`justify`),c=s.find(e=>e.value===a)?.icon??qe,l=e[a??`left`];return(0,z.jsxs)(n.Generic.Menu.Root,{position:`bottom-start`,portalElement:r,preventFocusOnOpen:!0,children:[(0,z.jsx)(n.Generic.Menu.Trigger,{children:(0,z.jsx)(n.FormattingToolbar.Button,{className:`doc-align-button`,label:l,mainTooltip:l,children:(0,z.jsx)(c,{size:15,"aria-hidden":!0})})}),(0,z.jsx)(n.Generic.Menu.Dropdown,{className:`bn-menu-dropdown doc-align-menu`,children:s.map(({value:r,icon:i})=>(0,z.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,icon:(0,z.jsx)(i,{size:15,"aria-hidden":!0}),checked:a===r,onClick:()=>{let e=t.getSelection()?.blocks??[t.getTextCursorPosition().block];for(let n of e)t.updateBlock(n,{props:{textAlignment:r}})},children:e[r]},r))})]})}function j4({strings:e}){let t=ky(),n=Zy(),r=Vy(),i=Fy({editor:t,selector:({editor:e})=>{let t=e.getActiveStyles();return typeof t.tag==`string`?t.tag:``}});return n?(0,z.jsxs)(n.Generic.Menu.Root,{position:`bottom-start`,portalElement:r,preventFocusOnOpen:!0,children:[(0,z.jsx)(n.Generic.Menu.Trigger,{children:(0,z.jsx)(n.FormattingToolbar.Button,{className:`doc-tag-button`,label:e.tag,mainTooltip:e.tag,isSelected:i!==``,children:(0,z.jsx)(st,{size:15,"aria-hidden":!0})})}),(0,z.jsxs)(n.Generic.Menu.Dropdown,{className:`bn-menu-dropdown doc-tag-menu`,children:[(0,z.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,checked:i===``,onClick:()=>{t.removeStyles({tag:i})},children:e.noTag}),v4.map(r=>(0,z.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,icon:(0,z.jsx)(`span`,{className:`doc-tag doc-tag-swatch`,"data-tag":r}),checked:i===r,onClick:()=>{t.addStyles({tag:r})},children:e.colorNames[r]},r))]})]}):null}function M4(){let e=Zy(),t=$e(),n=(0,R.useRef)(null);return(0,R.useEffect)(()=>{n.current?.closest(`.bn-formatting-toolbar`)?.setAttribute(`data-note-chrome`,``)}),!e||!t?null:(0,z.jsx)(e.FormattingToolbar.Button,{className:`doc-mark-up-button`,label:t.label,mainTooltip:t.hint,onClick:()=>{let e=n.current?.getBoundingClientRect();t.begin(e?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0,!0)},children:(0,z.jsxs)(`span`,{ref:n,"data-testid":`mark-up-selected`,className:`text-ink flex items-center gap-1 px-0.5 text-xs font-medium whitespace-nowrap`,children:[(0,z.jsx)(Ze,{"aria-hidden":!0,className:`size-3.5`}),t.label]})})}function N4({aligns:e,tags:t}){return(0,z.jsxs)(MR,{children:[(0,z.jsx)(bR,{},`type`),(0,z.jsx)($L,{basicTextStyle:`bold`},`bold`),(0,z.jsx)($L,{basicTextStyle:`italic`},`italic`),(0,z.jsx)($L,{basicTextStyle:`underline`},`underline`),(0,z.jsx)($L,{basicTextStyle:`strike`},`strike`),(0,z.jsx)($L,{basicTextStyle:`code`},`code`),(0,z.jsx)(oR,{},`color`),(0,z.jsx)(j4,{strings:t},`tag`),(0,z.jsx)(dR,{},`link`),(0,z.jsx)(A4,{names:e},`align`),(0,z.jsx)(M4,{},`mark-up`)]})}function P4({strings:e,onActions:t}){let n=ky(),r=Zy(),i=EL(uN,{selector:e=>e?.block});return!r||!i?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(r.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{i.id!==void 0&&t(i.id)},children:[(0,z.jsx)(ri,{size:15,"aria-hidden":!0}),e.turnInto,`…`]}),(0,z.jsxs)(r.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{i.id!==void 0&&n.insertBlocks([h2(i)],i.id,`after`)},children:[(0,z.jsx)(dt,{size:15,"aria-hidden":!0}),e.duplicate]})]})}function F4({label:e}){let t=ky(),n=Zy(),r=EL(uN,{selector:e=>e?.block});return!n||!r?null:(0,z.jsxs)(n.Generic.Menu.Item,{className:`bn-menu-item doc-menu-danger`,onClick:()=>{let e=t.getSelection()?.blocks;t.removeBlocks(e?.some(e=>e.id===r.id)?e:[r])},children:[(0,z.jsx)(_n,{size:15,"aria-hidden":!0}),e]})}function I4({strings:e,onActions:t,...n}){return(0,z.jsx)(az,{...n,dragHandleMenu:()=>(0,z.jsxs)(rz,{children:[(0,z.jsx)(P4,{strings:e,onActions:t}),(0,z.jsxs)($R,{children:[(0,z.jsx)(pt,{size:15,"aria-hidden":!0}),e.colors]}),(0,z.jsx)(F4,{label:e.remove})]})})}function L4({actions:e,placeholder:t,empty:n,at:r,onClose:i}){let[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(0),l=(0,R.useRef)(null),u=a.trim().toLowerCase(),d=e.filter(e=>u===``||e.title.toLowerCase().includes(u)||(e.group??``).toLowerCase().includes(u)||e.key.includes(u)),f=Math.min(s,Math.max(0,d.length-1));return(0,R.useEffect)(()=>{l.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[f,a]),(0,z.jsxs)(`div`,{className:`doc-actions`,style:{left:r.x,top:r.y},"data-testid":`doc-actions`,onMouseDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`input`,{autoFocus:!0,value:a,placeholder:t,"aria-label":t,className:`doc-actions-find`,onChange:e=>{o(e.target.value),c(0)},onBlur:i,onKeyDown:e=>{if(e.key===`Escape`&&i(),e.key===`ArrowDown`&&(e.preventDefault(),c(Math.min(f+1,d.length-1))),e.key===`ArrowUp`&&(e.preventDefault(),c(Math.max(f-1,0))),e.key===`Enter`){e.preventDefault();let t=d[f];i(),t?.run()}}}),(0,z.jsx)(`div`,{ref:l,role:`listbox`,className:`doc-menu doc-actions-list`,children:d.length===0?(0,z.jsx)(`p`,{className:`doc-menu-empty`,children:n}):d.map((e,t)=>{let n=e.icon,r=e.group!==void 0&&d[t-1]?.group!==e.group;return(0,z.jsxs)(`div`,{children:[r?(0,z.jsx)(`p`,{className:`doc-menu-group`,children:e.group}):null,(0,z.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===f,"data-item":e.key,className:`doc-menu-item`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{i(),e.run()},children:[(0,z.jsx)(n,{size:16,"aria-hidden":!0,className:`doc-menu-icon`}),(0,z.jsx)(`span`,{className:`doc-menu-title`,children:e.title})]})]},e.key)})})]})}function R4(e){return b4.find(t=>t.key===e)?.icon??Fe}function z4(e,t,n){for(let r of e){if(r.id===t)return{block:r,parent:n};let e=z4(r.children??[],t,r);if(e)return e}}var B4=(e,t)=>e.id===t||(e.children??[]).some(e=>B4(e,t)),V4=e=>({type:`column`,props:{width:1},children:e});function H4(e,t){return e.flatMap(e=>{if(t.has(e))return[];if(!e.children)return[e];let n=H4(e.children,t);if(e.type!==`columns`)return[{...e,children:n}];let r=n.filter(e=>(e.children??[]).length>0);return r.length<2?r.flatMap(e=>e.children??[]):[{...e,children:r}]})}function U4(e,t){let n=z4(e,t);if(n)return n.block.type===`column`?`column`:n.parent===void 0?`block`:void 0}function W4(e,t,n){let r=t.map(t=>z4(e,t)?.block);if(r.length===0||r.some(e=>e===void 0))return;let i=r;if(i.some(e=>e.type===`columns`||e.type===`column`)||i.some(e=>B4(e,n.id)))return;let a=z4(e,n.id);if(!a)return;let o=i.map(e=>({...e})),s=new Set(i),c=(e,t)=>e.flatMap(e=>e===a.block?t(e):e.children&&B4(e,n.id)?[{...e,children:c(e.children,t)}]:[e]),l;if(a.block.type===`column`){if((a.block.children??[]).filter(e=>!s.has(e)).length===0)return;let t=V4(o);l=c(e,e=>n.side===`left`?[t,e]:[e,t])}else{if(a.parent!==void 0)return;let t=V4(o);l=c(e,e=>[{type:`columns`,children:n.side===`left`?[t,V4([e])]:[V4([e]),t]}])}return H4(l,s)}var G4={share:.2,most:96,least:24};function K4(e){let t=e.dragging?.slice;if(!t||t.openStart>0)return[];let n=[];return t.content.forEach(e=>{let t=e.attrs.id;typeof t==`string`&&n.push(t)}),n}function q4(e,t,n,r){let i=t.firstElementChild?.getBoundingClientRect();if(!i)return;let a=Math.min(Math.max(n,i.left+4),i.right-4),o;for(let e of t.ownerDocument.elementsFromPoint(a,r)){if(!t.contains(e))continue;let n=e.closest(`[data-id]`)?.getAttribute(`data-id`);if(n){o=n;break}}for(let n=o===void 0?void 0:e.getBlock(o);n;){if(n.id===void 0)return;let r=e.getParentBlock(n.id),i=n.type===`column`?n:r===void 0||r.type===`column`?r??n:void 0;if(i?.id!==void 0){let e=t.querySelector(i.type===`column`?`[data-doc-col="${CSS.escape(i.id)}"]`:`.bn-block-outer[data-id="${CSS.escape(i.id)}"]`);return e?{id:i.id,box:e.getBoundingClientRect()}:void 0}n=r}}function J4(){let e;return{dropCursor:{color:`var(--allyhub-pencil)`,width:3,hooks:{computeDropPosition:({editor:t,event:n,view:r,defaultPosition:i})=>{e=void 0;let a=t,o=K4(r);if(o.length===0||!a.isEditable)return i;let s=q4(a,r.dom,n.clientX,n.clientY);if(!s)return i;let c=Math.min(G4.most,Math.max(G4.least,s.box.width*G4.share)),l=n.clientX<s.box.left+c?`left`:n.clientX>s.box.right-c?`right`:void 0;if(l===void 0||!U4(a.document,s.id))return i;let u={id:s.id,side:l};if(!W4(a.document,o,u))return i;let d=HA(s.id,r.state.doc);return d?(e=u,{pos:d.posBeforeNode,orientation:l===`left`?`block-vertical-left`:`block-vertical-right`}):i}}},extension:QC(({editor:t})=>({key:`docColumnDrop`,prosemirrorPlugins:[new Lr({appendTransaction(e,t,n){if(!e.some(e=>e.getMeta(`uiEvent`)===`drop`))return null;let r=new Map;t.doc.descendants(e=>(e.type.name===`column`&&r.set(e.attrs.id,KN(e)),!e.isTextblock));let i=[];if(n.doc.descendants((e,t)=>{if(e.type.name!==`columns`)return!e.isTextblock;let n=[];return e.forEach(e=>n.push(e)),n.some(e=>KN(e)&&r.get(e.attrs.id)!==!0)&&i.push(t),!1}),i.length===0)return null;let a=n.tr;for(let e of i.reverse())qN(a,e);return a},props:{handleDrop(n,r,i){let a=e;if(e=void 0,!a)return!1;let o=t,s=K4({dragging:{slice:i}}),c=W4(o.document,s,a);if(!c)return!1;let l=o.document,u=Fn(l,c,e=>JSON.stringify(e));return o.transact(()=>{for(let e of u){let t=l.slice(e.at,e.at+e.remove).flatMap(e=>e.id===void 0?[]:[e.id]);if(t.length>0)o.replaceBlocks(t,e.insert);else if(e.insert.length>0){let t=l[e.at]?.id,n=l.at(-1)?.id;t===void 0?n!==void 0&&o.insertBlocks(e.insert,n,`after`):o.insertBlocks(e.insert,t,`before`)}}}),!0}}})]}))()}}var Y4=/\.(png|jpe?g|gif|webp|avif|svg)$/iu;function X4(e){let t=a(),[n,r]=(0,R.useState)();return(0,R.useEffect)(()=>{if(e===void 0)return;let n=!0;return t[`files/url`]({path:e}).then(t=>{n&&r({path:e,url:t.url})},()=>void 0),()=>{n=!1}},[t,e]),n!==void 0&&n.path===e?n.url:void 0}var Z4=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`)));async function Q4(e,t){let{files:n}=await e[`files/list`]({dir:``}),r=e=>Z4(e)===t;return n.map(e=>e.path).filter(e=>Y4.test(e)).sort((e,t)=>Number(r(t))-Number(r(e))||e.localeCompare(t))}async function $4(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}async function e3(e,t,n){return C2(t,(await e[`files/upload`]({dir:t,name:n.name,data:await $4(n)})).path)}function t3(e){let t=e=>e.slice(e.lastIndexOf(`/`)+1),n=new Map;for(let r of e)n.set(t(r),(n.get(t(r))??0)+1);return new Map(e.map(e=>[e,(n.get(t(e))??0)>1?e:t(e)]))}function n3({path:e,label:t,chosen:n,onChoose:r}){let i=X4(e);return(0,z.jsx)(Jn,{aspect:`wide`,title:(0,z.jsx)(`span`,{className:`block truncate text-xs font-normal`,children:t}),"aria-label":e,"aria-pressed":n,className:`aria-pressed:bg-here`,"data-testid":`doc-cover-picture`,"data-path":e,picture:i===void 0?void 0:(0,z.jsx)(`img`,{src:i,alt:``,loading:`lazy`,draggable:!1}),onClick:r})}function r3(e){return jv.map(t=>({key:t,label:e.cover.names[t],src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(ny(t))}`,file:ry(t),bytes:()=>Promise.resolve(new Blob([ny(t)],{type:`image/svg+xml`}))}))}function i3({cover:e,chosen:t,disabled:n,onChoose:r}){return(0,z.jsx)(`div`,{title:e.label,className:`contents`,children:(0,z.jsx)(Jn,{"aria-label":e.label,"aria-pressed":t,disabled:n,className:`aspect-[3/1] p-1 aria-pressed:bg-here`,"data-testid":`doc-cover-gallery-picture`,"data-name":e.key,picture:(0,z.jsx)(`img`,{src:e.src,alt:``,loading:`lazy`,draggable:!1}),onClick:r})})}function a3({dir:e,current:t,words:n,onPick:r}){let i=a(),[o,s]=(0,R.useState)(),[c,l]=(0,R.useState)(),[u,d]=(0,R.useState)(!1),f=(0,R.useRef)(null);(0,R.useEffect)(()=>{let t=!0;return Q4(i,e).then(e=>{t&&s(e)},()=>{t&&s([])}),()=>{t=!1}},[i,e]);let p=t=>e===``?t:`${e}/${t}`,m=o?.some(t=>Z4(t)===e)??!1,h=c??(m?`project`:`gallery`),g=async t=>{d(!0);try{r(await e3(i,e,t))}catch{}finally{d(!1)}},_=t=>{let n=p(t.file);o?.includes(n)?r(C2(e,n)):(d(!0),t.bytes().then(e=>g(new File([e],t.file,{type:e.type})),()=>{d(!1)}))},v=t3(o??[]);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`doc-cover-picker`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`div`,{role:`tablist`,className:`flex flex-1 gap-1`,children:[`gallery`,`project`].map(e=>(0,z.jsx)(Kn,{role:`tab`,"aria-selected":h===e,"data-testid":`doc-cover-tab-${e}`,onClick:()=>{l(e)},children:n.cover[e]},e))}),(0,z.jsxs)(Kn,{disabled:u,onClick:()=>f.current?.click(),"data-testid":`doc-cover-upload`,children:[(0,z.jsx)(ai,{}),n.cover.upload]}),(0,z.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&g(t)}})]}),h===`gallery`?(0,z.jsx)(`div`,{role:`tabpanel`,className:`-mx-1 grid max-h-80 grid-cols-2 gap-1 overflow-y-auto`,"data-testid":`doc-cover-gallery`,children:r3(n).map(e=>(0,z.jsx)(i3,{cover:e,chosen:t===p(e.file),disabled:u,onChoose:()=>{_(e)}},e.key))}):o===void 0?(0,z.jsx)(`div`,{role:`tabpanel`,className:`h-24`}):o.length===0?(0,z.jsx)(`p`,{role:`tabpanel`,className:`px-1 pb-2 text-sm text-lead`,children:n.cover.none}):(0,z.jsx)(`div`,{role:`tabpanel`,className:`-mx-1 grid max-h-80 grid-cols-3 gap-1 overflow-y-auto`,children:o.map(n=>(0,z.jsx)(n3,{path:n,label:v.get(n)??n,chosen:n===t,onChoose:()=>{r(C2(e,n))}},n))})]})}var o3=`opacity-0 focus-visible:opacity-100 aria-expanded:opacity-100 motion-safe:transition-opacity`;function s3({place:e,look:t,dir:n,words:r,editable:i,onLook:a}){let[o,s]=(0,R.useState)(!1),c=(0,R.useCallback)(e=>{s(!1),e!==t.cover&&a(hy(t,e))},[t,a]),l=t.cover,u=l===void 0||S2.test(l)?void 0:E2(n,l),d=X4(u),f=l===void 0?void 0:S2.test(l)?l:u===void 0?null:d,[p,m]=(0,R.useState)(),[h,g]=(0,R.useState)(),_=h!==void 0&&h.of===l?h.y:void 0,v=(0,R.useCallback)(e=>{g(e===void 0||l===void 0?void 0:{of:l,y:e})},[l]),y=(0,R.useRef)(null),b=(0,R.useRef)(null),x=(0,R.useRef)(void 0),S=_??t.coverY??50,C=(0,R.useCallback)(()=>{x.current=void 0,v(void 0)},[v]),w=(0,R.useCallback)(()=>{if(_!==void 0){let e=gy(t,_);(e.coverY??50)!==(t.coverY??50)&&a(e)}C()},[C,t,_,a]);(0,R.useEffect)(()=>{if(_===void 0)return;let e=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),C())};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[C,_]);let T=()=>{let e=y.current?.getBoundingClientRect(),t=b.current;if(!e||!t||t.naturalWidth===0)return 0;let n=t.naturalHeight*e.width/t.naturalWidth-e.height;return n>.5?100/n:0},E=e=>{_!==void 0&&e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),x.current={y:e.clientY,from:_,pointer:e.pointerId})},D=e=>{let t=x.current;if(t?.pointer!==e.pointerId)return;let n=t.from-(e.clientY-t.y)*T();v(Math.min(100,Math.max(0,n)))},O=e=>{x.current?.pointer===e.pointerId&&(x.current=void 0)},k=e=>{if(_===void 0)return;let t=e.shiftKey?10:1;if(e.key===`ArrowUp`||e.key===`ArrowDown`){e.preventDefault();let n=_+(e.key===`ArrowUp`?t:-t);v(Math.min(100,Math.max(0,n)))}else e.key===`Enter`&&(e.preventDefault(),w())};if(e===`title`)return l===void 0&&i?(0,z.jsx)(`div`,{className:`doc-cover-add`,children:(0,z.jsxs)(tt,{open:o,onOpenChange:s,children:[(0,z.jsx)(rt,{asChild:!0,children:(0,z.jsxs)(Kn,{className:`${o3} group-hover/title:opacity-100`,"data-testid":`doc-cover-add`,children:[(0,z.jsx)(qn,{}),r.cover.add]})}),(0,z.jsx)(Qe,{align:`start`,className:`w-[26rem] p-2`,children:(0,z.jsx)(a3,{dir:n,current:void 0,words:r,onPick:c})})]})}):null;if(l===void 0)return null;let A=f===null||f!==void 0&&p===f;return(0,z.jsxs)(`div`,{ref:y,className:`doc-cover group/cover`,"data-testid":`doc-cover`,"data-missing":A?``:void 0,"data-moving":_===void 0?void 0:``,..._===void 0?{}:{role:`slider`,tabIndex:0,"aria-label":r.cover.drag,"aria-orientation":`vertical`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(S)},onPointerDown:E,onPointerMove:D,onPointerUp:O,onPointerCancel:O,onKeyDown:k,children:[A?(0,z.jsx)(`span`,{className:`doc-cover-path`,children:l}):f!==void 0&&(0,z.jsx)(`img`,{ref:b,src:f,alt:``,draggable:!1,style:{objectPosition:`50% ${String(S)}%`},onError:()=>{m(f)}}),_!==void 0&&(0,z.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-md bg-media/60 px-3 py-1.5 text-xs text-on-media`,children:r.cover.drag}),i&&(0,z.jsx)(`div`,{className:`absolute right-2 bottom-2 flex gap-0.5 rounded-lg border border-rule bg-sheet/95 p-0.5 shadow-float ${_===void 0?`opacity-0 group-hover/cover:opacity-100 group-focus-within/cover:opacity-100 has-[[aria-expanded=true]]:opacity-100 motion-safe:transition-opacity`:``}`,onPointerDown:e=>{e.stopPropagation()},children:_===void 0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(tt,{open:o,onOpenChange:s,children:[(0,z.jsx)(rt,{asChild:!0,children:(0,z.jsxs)(Kn,{"data-testid":`doc-cover-change`,children:[(0,z.jsx)(qn,{}),r.cover.change]})}),(0,z.jsx)(Qe,{align:`end`,className:`w-[26rem] p-2`,children:(0,z.jsx)(a3,{dir:n,current:u,words:r,onPick:c})})]}),!A&&(0,z.jsxs)(Kn,{"data-testid":`doc-cover-reposition`,onClick:()=>{v(t.coverY??50),requestAnimationFrame(()=>y.current?.focus())},children:[(0,z.jsx)(ei,{}),r.cover.reposition]}),(0,z.jsxs)(Kn,{"data-testid":`doc-cover-remove`,onClick:()=>{a(hy(t,void 0))},children:[(0,z.jsx)(_n,{}),r.cover.remove]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Kn,{"data-testid":`doc-cover-save`,onClick:w,children:r.cover.save}),(0,z.jsx)(Kn,{"data-testid":`doc-cover-cancel`,onClick:C,children:r.cover.cancel})]})})]})}var c3=new Dr(`docAgent`),l3=QC(()=>({key:`docAgent`,prosemirrorPlugins:[new Lr({key:c3,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(c3);return n===void 0?t:n}},props:{decorations(e){let t=c3.getState(e);if(!t)return null;let n;return e.doc.descendants((e,r)=>n?!1:e.type.name!==`blockContainer`||e.attrs.id!==t.id||(n=Rr.node(r,r+e.nodeSize,{class:`doc-agent`,"data-agent":t.label,"data-testid":`doc-agent`}),!1)),n?Fr.create(e.doc,[n]):null}}})]}))();function u3(e,t){let n=e._tiptapEditor.view;n.dispatch(n.state.tr.setMeta(c3,t))}var d3=(0,R.createContext)({numbers:new Map,words:new Map});function f3(e){let[t,n]=(0,R.useState)(()=>o4(t2(e.document)));return(0,R.useEffect)(()=>e.onChange(()=>{let t=o4(t2(e.document));n(e=>s4(e,t)?e:t)}),[e]),t}var p3=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;function m3(e,t){let n=u4(e.document,t);if(n?.id!==void 0){try{e.setTextCursorPosition(n.id,`end`),e.focus()}catch{}document.querySelector(`.bn-block-outer[data-id="${CSS.escape(n.id)}"]`)?.scrollIntoView({block:`center`,behavior:p3()?`auto`:`smooth`})}}function h3({label:e,editor:t}){let n=(0,R.useContext)(d3),r=e.toLowerCase(),i=n.words.get(r),a=n.numbers.get(r),o=i===void 0||a===void 0?`[${e}]`:String(a),s=(0,z.jsx)(`button`,{type:`button`,className:`doc-fn-mark`,"data-doc-footnote":e,onMouseDown:e=>{e.preventDefault()},onClick:()=>{m3(t,e)},children:o});return(0,z.jsx)(`sup`,{className:`doc-fn`,contentEditable:!1,children:i===void 0||i===``?s:(0,z.jsxs)(Sn,{children:[(0,z.jsx)(xn,{asChild:!0,children:s}),(0,z.jsx)(bn,{side:`top`,className:`doc-fn-words max-w-72 text-left`,"data-testid":`doc-footnote-words`,children:i})]})})}var g3=GB({type:`footnote`,propSchema:{label:{default:``},styles:{default:``},href:{default:``}},content:`none`},{render:e=>(0,z.jsx)(h3,{label:e.inlineContent.props.label,editor:e.editor})});function _3({label:e}){let t=(0,R.useContext)(d3).numbers.get(e.toLowerCase());return(0,z.jsx)(`span`,{contentEditable:!1,className:`doc-note-number`,"data-unmarked":t===void 0?``:void 0,children:t===void 0?`–`:`${String(t)}.`})}var v3=xB({type:`note`,propSchema:{label:{default:``}},content:`inline`},{render:e=>(0,z.jsxs)(`div`,{className:`doc-note`,"data-doc-note":e.block.props.label,children:[(0,z.jsx)(_3,{label:e.block.props.label}),(0,z.jsx)(`div`,{className:`doc-note-text`,ref:e.contentRef})]})});function y3({orientation:e}){let t=(0,R.useContext)(A2)?.words;return(0,z.jsx)(`div`,{contentEditable:!1,className:`doc-pagebreak`,"data-doc-pagebreak":e,children:(0,z.jsx)(`span`,{children:e===`landscape`?t?.blocks.pagebreakLandscape:e===`portrait`?t?.blocks.pagebreakPortrait:t?.blocks.pagebreak})})}var b3=xB({type:`pagebreak`,propSchema:{orientation:{default:``}},content:`none`},{render:e=>(0,z.jsx)(y3,{orientation:e.block.props.orientation})}),x3=e=>e===`sans`||e===`serif`||e===`mono`||e===`times`?`Ag`:`文`,S3=[`sans`,`serif`,`mono`,`times`,`song`,`hei`,`fangsong`,`kai`],C3=[`letter`,`legal`,`a4`,`a5`,`b5`],w3={a3:`A3`,a4:`A4`,a5:`A5`,b5:`B5`,letter:`Letter`,legal:`Legal`},T3={normal:25.4,narrow:12.7,wide:[25.4,50.8]},E3=[10.5,11,12,14,16],D3=[1.15,1.5,2],O3=e=>Object.entries(zi).find(([,t])=>t===e)?.[0],k3=e=>{if(e===void 0)return``;for(let[t,n]of Object.entries(T3))if(JSON.stringify(n)===JSON.stringify(e))return t};function A3({label:e,value:t,options:n,onValue:r,testId:i}){return(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,z.jsx)(`span`,{className:`text-lead shrink-0`,children:e}),(0,z.jsxs)(In,{value:t??`*`,onValueChange:r,children:[(0,z.jsx)(jn,{size:`sm`,className:`w-40`,"aria-label":e,"data-testid":i,children:(0,z.jsx)(Ln,{})}),(0,z.jsxs)(kn,{children:[t===void 0&&(0,z.jsx)(Bn,{value:`*`,disabled:!0,children:`…`}),n.map(([e,t])=>(0,z.jsx)(Bn,{value:e===``?`-`:e,children:t},e===``?`-`:e))]})]})]})}function j3({look:e,words:t,chinese:n,onLook:r}){let i=e.preset===void 0?{}:Wi(e.preset),a=e.font??i.font??`sans`,o=(t,n)=>{let i=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));r(n===void 0?i:{...i,[t]:n})},s=e=>e===``?`-`:e,c=e=>e===`-`?``:e,l=e.size===void 0?``:typeof e.size==`number`?String(e.size):String(zi[e.size]),u=e=>{let r=O3(e);return n&&r!==void 0?r:t.page.pt(e)},d=t.page,f=e=>{let n=k3(e);return n===``?t.defaultColor:n===void 0?`${(typeof e==`number`?[e]:[...e??[]]).join(` / `)} mm`:d.marginNames[n]};return(0,z.jsxs)(tt,{children:[(0,z.jsx)(rt,{asChild:!0,children:(0,z.jsxs)(Kn,{"data-testid":`doc-style`,children:[(0,z.jsx)(Ur,{}),t.style]})}),(0,z.jsxs)(Qe,{align:`start`,className:`flex max-h-[min(80vh,640px)] w-80 flex-col gap-3 overflow-y-auto p-3`,children:[(0,z.jsx)(`div`,{role:`radiogroup`,"aria-label":t.style,className:`grid grid-cols-4 gap-1.5`,children:S3.map(e=>(0,z.jsxs)(Xe,{variant:`box`,checked:a===e,onClick:()=>{o(`font`,e===(i.font??`sans`)?void 0:e)},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`text-xl leading-tight`,style:{fontFamily:Tf({font:e}).text},children:x3(e)}),(0,z.jsx)(`span`,{className:`text-lead text-xs`,children:t.fonts[e]})]},e))}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(`span`,{className:`text-lead text-xs`,children:t.accent}),(0,z.jsxs)(`div`,{role:`radiogroup`,"aria-label":t.accent,className:`flex flex-wrap gap-1.5`,children:[(0,z.jsx)(vn,{color:`var(--allyhub-ink)`,label:t.defaultColor,checked:e.accent===void 0,onClick:()=>{o(`accent`,void 0)}}),v4.map(n=>(0,z.jsx)(vn,{color:Oa(n)??n,label:t.colorNames[n],checked:e.accent===n,onClick:()=>{o(`accent`,n)}},n))]})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[(0,z.jsx)(A3,{label:d.preset,testId:`doc-preset`,value:s(e.preset??``),options:[[``,d.none],...Vi.map(e=>[e,d.presets[e]])],onValue:e=>{let t=c(e);o(`preset`,Vi.includes(t)?t:void 0)}}),(0,z.jsx)(A3,{label:d.paper,testId:`doc-paper`,value:s(e.paper===void 0?``:typeof e.paper==`string`&&C3.includes(e.paper)?e.paper:void 0),options:[[``,w3[typeof i.paper==`string`?i.paper:qi.paper]],...C3.filter(e=>e!==qi.paper).map(e=>[e,w3[e]])],onValue:e=>{let t=c(e);o(`paper`,C3.includes(t)?t:void 0)}}),(0,z.jsx)(A3,{label:d.orientation,testId:`doc-orientation`,value:s(e.orientation===`landscape`?`landscape`:``),options:[[``,d.portrait],[`landscape`,d.landscape]],onValue:e=>{o(`orientation`,c(e)===`landscape`?`landscape`:void 0)}}),(0,z.jsx)(A3,{label:d.margins,testId:`doc-margins`,value:s(k3(e.margins)),options:[[``,f(i.margins)],[`normal`,d.marginNames.normal],[`narrow`,d.marginNames.narrow],[`wide`,d.marginNames.wide]],onValue:e=>{let t=c(e);o(`margins`,t in T3?T3[t]:void 0)}}),(0,z.jsx)(A3,{label:d.size,testId:`doc-size`,value:s(l===``||E3.includes(Number(l))?l===`11`?``:l:void 0),options:[[``,u(i.size===void 0?11:Ki(i.size))],...E3.filter(e=>e!==11).map(e=>[String(e),u(e)])],onValue:e=>{let t=c(e),r=Number(t),i=O3(r);o(`size`,t===``?void 0:n&&i!==void 0?i:r)}}),(0,z.jsx)(A3,{label:d.lineHeight,testId:`doc-line-height`,value:s(e.lineHeight===void 0||e.lineHeight===(i.lineHeight??qi.lineHeight)?``:D3.includes(e.lineHeight)?String(e.lineHeight):void 0),options:[[``,typeof i.lineHeight==`number`?String(i.lineHeight):i.grid===void 0?String(qi.lineHeight):d.grid],...D3.filter(e=>e!==(typeof i.lineHeight==`number`?i.lineHeight:qi.lineHeight)).map(e=>[String(e),String(e)])],onValue:e=>{let t=c(e);o(`lineHeight`,t===``?void 0:Number(t))}})]}),(0,z.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,z.jsx)(`span`,{children:d.indent}),(0,z.jsx)(yn,{size:`sm`,"data-testid":`doc-indent`,checked:(e.textIndent??i.textIndent??0)>0,onCheckedChange:e=>{let t=(i.textIndent??0)>0;o(`textIndent`,e===t?void 0:e?2:0)}})]}),(0,z.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,z.jsx)(`span`,{children:t.pageNumbers}),(0,z.jsx)(yn,{size:`sm`,"data-testid":`doc-page-numbers`,checked:e.pageNumbers!==!1,onCheckedChange:t=>{r(my(e,t))}})]})]})]})}function M3({className:e,...t}){return(0,z.jsx)(Mn,{role:`status`,"aria-label":`Loading`,className:N(`size-4 animate-spin`,e),...t})}var N3=600;function P3({item:e,stamp:t,words:n,onGo:r}){let i=a(),[o,s]=(0,R.useState)(),[c,l]=(0,R.useState)(!0),[u,d]=(0,R.useState)();(0,R.useEffect)(()=>{let t=!0,n=setTimeout(()=>{l(!0),O0(i,`doc/pages`,{item:e}).then(e=>{t&&(s(e),d(void 0),l(!1))},e=>{t&&(d(e instanceof Error?e.message:String(e)),l(!1))})},N3);return()=>{t=!1,clearTimeout(n)}},[i,e,t]);let f=o?.pages.length??0;return(0,z.jsxs)(`aside`,{className:`doc-pages`,"data-testid":`doc-pages`,"data-printing":c?``:void 0,"aria-label":n.pages,children:[c&&(0,z.jsxs)(`div`,{className:`doc-pages-state`,role:`status`,children:[(0,z.jsx)(M3,{}),n.pagesPrinting]}),u!==void 0&&(0,z.jsx)(`div`,{className:`doc-pages-state`,role:`alert`,children:n.pagesFailed(u)}),o?.pages.map(e=>(0,z.jsxs)(`figure`,{className:`doc-pages-page`,"data-landscape":e.landscape?``:void 0,style:{aspectRatio:`${String(e.width)} / ${String(e.height)}`},children:[(0,z.jsx)(`img`,{src:`data:${e.image.mime};base64,${e.image.data}`,alt:n.pageOf(e.n,f),draggable:!1}),o.blocks.flatMap(t=>t.places.filter(t=>t.page===e.n).map((i,a)=>(0,z.jsx)(`button`,{type:`button`,className:`doc-page-block`,"aria-label":n.pageBlock(e.n),style:{left:`${String(i.left/e.width*100)}%`,top:`${String(i.top/e.height*100)}%`,width:`${String((i.right-i.left)/e.width*100)}%`,height:`${String((i.bottom-i.top)/e.height*100)}%`},onClick:()=>{r(t.n)}},`${String(t.n)}-${String(a)}`))),(0,z.jsx)(`figcaption`,{children:n.pageOf(e.n,f)})]},e.n))]})}var F3=(0,R.createContext)(new Map);function I3(e,t){let n=new Map;for(let[t,r]of Df(e))t.type===`heading`&&n.set(r,t.content.map(e=>e.text).join(``));let r=Ya(e,t);for(let t of _a(e)){let e=qa(t),i=r.get(t);e!==void 0&&i!==void 0&&n.set(e,i.label)}return n}var L3=(e,t)=>e.size===t.size&&[...e].every(([e,n])=>t.get(e)===n);function R3(e,t){let[n,r]=(0,R.useState)(()=>I3(t2(e.document),t));return(0,R.useEffect)(()=>e.onChange(()=>{let n=I3(t2(e.document),t);r(e=>L3(e,n)?e:n)}),[e,t]),n}function z3({target:e}){let t=(0,R.useContext)(F3).get(decodeURIComponent(e));return(0,z.jsx)(`span`,{className:`doc-ref`,contentEditable:!1,"data-doc-ref":e,"data-unknown":t===void 0?``:void 0,children:t??`#${e}`})}var B3=GB({type:`reference`,propSchema:{target:{default:``},styles:{default:``}},content:`none`},{render:e=>(0,z.jsx)(z3,{target:e.inlineContent.props.target})}),V3={items:[],style:`apa`,list:[],numbers:new Map},H3=(0,R.createContext)(V3),U3=(e,t,n)=>{let r=Fi(e,t,n);return{items:t,style:n,list:r,numbers:new Map(r.map(e=>[e.item.id,e.n]))}},W3=(e,t)=>e.items===t.items&&e.style===t.style&&e.list.map(e=>e.text).join(`
|
|
529
|
-
`)===t.list.map(e=>e.text).join(`
|
|
530
|
-
`);function G3(e,t,n){let[r,i]=(0,R.useState)(()=>U3(t2(e.document),t,n));return(0,R.useEffect)(()=>{let r=()=>{let r=U3(t2(e.document),t,n);i(e=>W3(e,r)?e:r)},a=e.onChange(r);return queueMicrotask(r),a},[e,t,n]),r}function K3({cite:e}){let t=(0,R.useContext)(H3);return(0,z.jsx)(`span`,{className:`doc-cite`,contentEditable:!1,"data-doc-cite":e,children:t.items.length===0?`[${e}]`:Ii(e,t.items,t.numbers,t.style)})}var q3=GB({type:`citation`,propSchema:{cite:{default:``},styles:{default:``}},content:`none`},{render:e=>(0,z.jsx)(K3,{cite:e.inlineContent.props.cite})});function J3(){let e=(0,R.useContext)(H3),t=(0,R.useContext)(A2)?.words;return(0,z.jsxs)(`section`,{contentEditable:!1,className:`doc-sources`,"data-doc-sources":e.style,children:[(0,z.jsx)(`span`,{className:`doc-toc-name`,children:t?.blocks.bibliography}),e.list.length===0?(0,z.jsx)(`span`,{className:`doc-toc-empty`,children:t?.sourcesEmpty}):(0,z.jsx)(`ol`,{children:e.list.map(e=>(0,z.jsx)(`li`,{children:e.pieces.map((e,t)=>e.italic?(0,z.jsx)(`i`,{children:e.text},t):e.text)},e.item.id))})]})}var Y3=xB({type:`bibliography`,propSchema:{},content:`none`},{render:()=>(0,z.jsx)(J3,{})});function X3(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e.type===`text`?e.text:e.type===`link`?e.content.map(e=>e.text).join(``):``).join(``):``}function Z3(e){let t=[];for(let n of e){if(n.type===`columns`||n.type===`column`){t.push(...Z3(n.children??[]));continue}let e=n.props?.level;if(n.type!==`heading`||typeof e!=`number`||e>3||n.id===void 0)continue;let r=X3(n.content).trim();r!==``&&t.push({id:n.id,level:e,text:r})}return t}function Q3({entries:e,label:t,scroller:n,onGo:r}){let[i,a]=(0,R.useState)();return(0,R.useEffect)(()=>{let t=n.current;if(!t)return;let r=()=>{let n=t.getBoundingClientRect().top+96,r;for(let i of e){let e=t.querySelector(`.bn-block-outer[data-id="${CSS.escape(i.id)}"]`);if(e){if(e.getBoundingClientRect().top<=n)r=i.id;else break}}a(r??e[0]?.id)};return r(),t.addEventListener(`scroll`,r,{passive:!0}),()=>{t.removeEventListener(`scroll`,r)}},[e,n]),e.length<3?null:(0,z.jsxs)(`nav`,{"aria-label":t,className:`doc-outline`,"data-testid":`doc-outline`,children:[(0,z.jsx)(`p`,{className:`doc-outline-label`,children:t}),e.map(e=>(0,z.jsx)(`button`,{type:`button`,"data-level":e.level,"aria-current":i===e.id?`location`:void 0,className:`doc-outline-item`,onClick:()=>{r(e.id)},children:e.text},e.id))]})}var $3,e6=Promise.resolve(),t6=0,n6=()=>$3??=Wn(()=>import(`./mermaid.core-B8478wZ1.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url);function r6(e,t){let n=e6.then(async()=>{let n=await n6(),r=gi({font:t.font,accent:t.accent});n.initialize({...r,...t.dark?{theme:`dark`,themeVariables:{fontFamily:t.font,fontSize:`14px`}}:{},suppressErrorRendering:!0}),t6+=1;let{svg:i}=await n.render(`doc-diagram-${String(t6)}`,e);return i6(i)});return e6=n.catch(()=>void 0),n}function i6(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(t.nodeName!==`svg`)return e;for(let e of t.querySelectorAll(`.today`))e.remove();let n=(t.getAttribute(`viewBox`)??``).trim().split(/[\s,]+/u).map(Number),[,,r,i]=n;return n.length===4&&r!==void 0&&i!==void 0&&r>0&&i>0&&(t.setAttribute(`width`,String(r)),t.setAttribute(`height`,String(i)),t.style.removeProperty(`max-width`)),new XMLSerializer().serializeToString(t)}function a6(e){let t=(0,R.useMemo)(()=>e.trim()===``?void 0:pf(e),[e]),[n,r]=(0,R.useState)();return t!==void 0&&t.error===void 0&&t.html!==n&&r(t.html),t===void 0?{}:t.error===void 0?{html:t.html}:{html:n??t.html,error:t.error}}var o6=150;function s6(e,t,n,r){let[i,a]=(0,R.useState)({});return(0,R.useEffect)(()=>{if(e.trim()===``)return;let i=!0,o=setTimeout(()=>{r6(e,{font:t,dark:n,accent:r}).then(e=>{i&&a({html:e})},e=>{i&&a(t=>({...t.html===void 0?{}:{html:t.html},error:e instanceof Error?e.message:String(e)}))})},o6);return()=>{i=!1,clearTimeout(o)}},[e,t,n,r]),e.trim()===``?{}:i}function c6({kind:e,code:t,drawn:n,empty:r}){return t.trim()===``?(0,z.jsx)(`span`,{className:`doc-drawn-empty`,children:r}):n.html===void 0?(0,z.jsx)(`pre`,{className:`doc-drawn-code`,children:t}):(0,z.jsx)(`div`,{className:e===`equation`?`doc-math`:`doc-diagram`,dangerouslySetInnerHTML:{__html:n.html}})}function l6({kind:e,code:t,onCode:n}){let r=(0,R.useContext)(A2),i=(0,R.useContext)(W2),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(t);!a&&s!==t&&c(t);let l=a6(e===`equation`?s:``),u=s6(e===`diagram`?s:``,G2(i.page),i.dark,Ef(i.page)),d=e===`equation`?l:u,f=r?.words,p=e===`equation`?f?.blocks.equation:f?.blocks.diagram,m=(e===`equation`?f?.emptyEquation:f?.emptyDiagram)??``,h=r?.readOnly!==!0;return(0,z.jsx)(`figure`,{contentEditable:!1,"data-doc-drawn":e,className:`doc-drawn`,children:(0,z.jsxs)(tt,{open:h&&a,onOpenChange:o,children:[(0,z.jsx)(rt,{asChild:!0,children:(0,z.jsx)(`button`,{type:`button`,className:`doc-drawn-button`,"aria-label":p,disabled:!h,children:(0,z.jsx)(c6,{kind:e,code:s,drawn:d,empty:m})})}),h&&(0,z.jsxs)(Qe,{align:`center`,className:`flex w-[min(36rem,calc(100vw-2rem))] flex-col gap-2 p-2`,children:[(0,z.jsx)(Hr,{value:s,"aria-label":p,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`max-h-[50vh] min-h-20 resize-none font-mono text-xs [font-variant-ligatures:none] md:text-xs`,onChange:e=>{c(e.target.value),n(e.target.value)}}),d.error!==void 0&&(0,z.jsx)(`p`,{role:`alert`,className:`text-problem-text max-h-32 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:d.error})]})]})})}var u6=xB({type:`math`,propSchema:{code:{default:``}},content:`none`},{render:e=>(0,z.jsx)(l6,{kind:`equation`,code:e.block.props.code,onCode:t=>{e.editor.updateBlock(e.block,{props:{code:t}})}})}),d6=xB({type:`diagram`,propSchema:{code:{default:``}},content:`none`},{render:e=>(0,z.jsx)(l6,{kind:`diagram`,code:e.block.props.code,onCode:t=>{e.editor.updateBlock(e.block,{props:{code:t}})}})});function f6({trend:e,placeholder:t,onTrend:n}){let[r,i]=(0,R.useState)(e?.join(`, `)??``),a=()=>{let e=r.split(/[,\s]+/u).filter(e=>e!==``).map(Number).filter(e=>Number.isFinite(e));n(e.length<2?void 0:e)};return(0,z.jsx)(`input`,{className:`doc-stat-trend-field`,value:r,placeholder:t,"aria-label":t,onChange:e=>{i(e.target.value)},onBlur:a,onKeyDown:e=>{e.key===`Enter`&&a()}})}function p6({data:e,onData:t}){let n=(0,R.useContext)(A2),r=n?.words?.stats,i=n?.readOnly!==!0,a=k0(e),o=(e,n)=>{let r=a.flatMap((t,r)=>r===e?n===void 0?[]:[n]:[t]);t(JSON.stringify(r))},s=(e,t,n,a,s)=>i?(0,z.jsx)(`input`,{className:a,style:s,size:n===`delta`?Math.max(3,Array.from(t.delta??r?.delta??``).length):void 0,value:t[n]??``,placeholder:r?.[n],"aria-label":r?.[n],onChange:r=>{let i=r.target.value,a={...t};n===`label`||n===`value`||i!==``?a[n]=i:n===`delta`?delete a.delta:delete a.note,o(e,a)}}):(0,z.jsx)(`span`,{className:a,style:s,children:t[n]});return(0,z.jsxs)(`div`,{className:`doc-stats`,contentEditable:!1,style:{gridTemplateColumns:`repeat(${String(Math.max(1,a.length))}, minmax(0, 1fr))`},children:[a.map((e,t)=>(0,z.jsxs)(`div`,{className:`doc-stat`,children:[s(t,e,`label`,`doc-stat-label`),s(t,e,`value`,`doc-stat-value`),(0,z.jsxs)(`div`,{className:`doc-stat-foot`,children:[s(t,e,`delta`,`doc-stat-delta`,{color:di[sa(e)]}),s(t,e,`note`,`doc-stat-note`)]}),e.trend!==void 0&&(0,z.jsx)(`div`,{className:`doc-stat-trend`,dangerouslySetInnerHTML:{__html:Of(e.trend,di[sa(e)])}}),i&&(0,z.jsx)(f6,{trend:e.trend,placeholder:r?.trend,onTrend:n=>{let r={...e};n===void 0?delete r.trend:r.trend=n,o(t,r)}}),i&&a.length>1&&(0,z.jsx)(Kn,{icon:!0,className:`doc-stat-remove`,"aria-label":r?.remove,title:r?.remove,onClick:()=>{o(t,void 0)},children:(0,z.jsx)(_n,{})})]},t)),i&&(0,z.jsx)(Kn,{icon:!0,className:`doc-stats-add`,"aria-label":r?.add,title:r?.add,onClick:()=>{t(JSON.stringify([...a,{label:``,value:``}]))},children:(0,z.jsx)(Tn,{})})]})}var m6=xB({type:`stats`,propSchema:{data:{default:`[]`}},content:`none`},{render:e=>(0,z.jsx)(p6,{data:e.block.props.data,onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})});function h6({subtitle:e,contentRef:t,onSubtitle:n}){let r=(0,R.useContext)(A2),i=r?.words?.card,a=r?.readOnly!==!0;return(0,z.jsxs)(`div`,{className:`doc-card-head`,children:[(0,z.jsx)(`div`,{className:`doc-card-title`,ref:t}),a?(0,z.jsx)(`input`,{className:`doc-card-subtitle`,contentEditable:!1,value:e,placeholder:i?.subtitle,"aria-label":i?.subtitle,onChange:e=>{n(e.target.value)}}):e!==``&&(0,z.jsx)(`p`,{className:`doc-card-subtitle`,children:e})]})}var g6=xB({type:`card`,propSchema:{subtitle:{default:``}},content:`inline`},{render:e=>(0,z.jsx)(h6,{subtitle:e.block.props.subtitle,contentRef:e.contentRef,onSubtitle:t=>{e.editor.updateBlock(e.block,{props:{subtitle:t}})}})}),_6=KB({type:`tag`,propSchema:`string`},{render:e=>(0,z.jsx)(`span`,{className:`doc-tag`,"data-tag":e.value,ref:e.contentRef})});function v6(e,t){let n=[],r=e=>{for(let i of e){let e=i.props?.level;if(i.type===`heading`&&typeof e==`number`&&e<=t&&i.id!==void 0){let t=(Array.isArray(i.content)?i.content:[]).map(e=>`text`in e&&typeof e.text==`string`?e.text:``).join(``);t.trim()!==``&&n.push({id:i.id,level:e,words:t})}r(i.children??[])}};return r(e),n}function y6({editor:e,levels:t,title:n}){let r=(0,R.useContext)(A2)?.words,[i,a]=(0,R.useState)(()=>v6(e.document,t));(0,R.useEffect)(()=>e.onChange(()=>{a(v6(e.document,t))}),[e,t]);let o=Math.min(...i.map(e=>e.level));return(0,z.jsxs)(`nav`,{contentEditable:!1,className:`doc-toc`,"data-doc-toc":``,children:[(0,z.jsx)(`span`,{className:`doc-toc-name`,children:n===``?r?.blocks.toc:n}),i.length===0?(0,z.jsx)(`span`,{className:`doc-toc-empty`,children:r?.tocEmpty}):(0,z.jsx)(`ol`,{children:i.map(e=>(0,z.jsx)(`li`,{style:{paddingLeft:`${String((e.level-o)*1.25)}em`},children:(0,z.jsx)(Xn,{size:`dense`,onClick:()=>{document.querySelector(`[data-id="${CSS.escape(e.id)}"]`)?.scrollIntoView({behavior:`smooth`,block:`start`})},children:e.words})},e.id))})]})}var b6=xB({type:`toc`,propSchema:{levels:{default:3},title:{default:``},untitled:{default:!1}},content:`none`},{render:e=>(0,z.jsx)(y6,{editor:e.editor,levels:e.block.props.levels,title:e.block.props.title})}),x6=(0,R.createContext)(void 0);function S6(e){let t=(/^<\s*([A-Za-z][\w.]*)/.exec(e.trim())?.[1]??``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function C6({source:e}){let t=(0,R.useContext)(x6);return(0,z.jsxs)(`div`,{contentEditable:!1,"data-doc-embed":``,className:`doc-embed`,children:[(0,z.jsx)(ii,{size:18,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`doc-embed-name`,children:S6(e)}),(0,z.jsx)(`span`,{className:`doc-embed-note`,children:t?.embed})]})}var w6=xB({type:`embed`,propSchema:{source:{default:``}},content:`none`},{render:e=>(0,z.jsx)(C6,{source:e.block.props.source})}),T6=[L0,`ℹ️`,`⚠️`,`❗`,`✅`,`📌`],E6=xB({type:`callout`,propSchema:{icon:{default:L0},textColor:{default:`default`},backgroundColor:{default:`default`}},content:`inline`},{render:e=>(0,z.jsxs)(`div`,{className:`doc-callout`,"data-doc-callout":``,children:[e.block.props.icon===``?null:(0,z.jsx)(`button`,{type:`button`,contentEditable:!1,className:`doc-callout-icon`,"aria-label":e.block.props.icon,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let t=T6.indexOf(e.block.props.icon);e.editor.updateBlock(e.block,{props:{icon:T6[(t+1)%T6.length]??`💡`}})},children:e.block.props.icon}),(0,z.jsx)(`div`,{className:`doc-callout-text`,ref:e.contentRef})]})}),D6=new Set([`audio`,`video`,`file`]),O6=Object.fromEntries(Object.entries(CA).filter(([e])=>!D6.has(e))),k6=kA.create({blockSpecs:{...O6,embed:w6(),callout:E6(),card:g6(),stats:m6(),component:M2(),chart:i4(),math:u6(),diagram:d6(),columns:z2(),column:V2(),note:v3(),pagebreak:b3(),toc:b6(),bibliography:Y3()},inlineContentSpecs:{...DA,footnote:g3,reference:B3,citation:q3},styleSpecs:{...EA,tag:_6}});function A6(e,t){let n=t.blocks,r=e.slash_menu,i=(e,t)=>({[e]:{...r[e],title:t}});return{...e,slash_menu:{...r,...i(`paragraph`,n.paragraph),...i(`heading`,n.heading1),...i(`heading_2`,n.heading2),...i(`heading_3`,n.heading3),...i(`bullet_list`,n.bullet),...i(`numbered_list`,n.numbered),...i(`check_list`,n.check),...i(`toggle_list`,n.toggle),...i(`quote`,n.quote),...i(`code_block`,n.code),...i(`table`,n.table),...i(`image`,n.image),...i(`divider`,n.divider)},placeholders:{...e.placeholders,default:t.placeholder,heading:t.heading,note:t.blocks.footnote}}}function j6(e){let t=e[0];return e.length===1&&t?.type===`paragraph`&&t.content.every(e=>e.text===``)&&t.look===void 0&&(t.children?.length??0)===0}var M6=e=>`doc-toggles:${e}`;function N6(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`boolean`))}var P6=e=>e.type===`toggleListItem`||e.type===`heading`&&e.props?.isToggleable===!0;function*F6(e){for(let t of e)yield t,yield*F6(t.children??[])}function I6(e,t){for(let n of F6(e)){if(!P6(n)||n.id===void 0)continue;let e=t[n.id.slice(1).replace(/-\d+$/,``)];if(e!==void 0)try{window.localStorage.setItem(`toggle-${n.id}`,String(e))}catch{return}}}function L6(e,t){let n={};for(let r of F6(e)){if(!P6(r)||r.id===void 0)continue;let e=t2([r])[0];e&&(n[W0(e)]=t?.querySelector(`.bn-block-outer[data-id="${CSS.escape(r.id)}"] .bn-toggle-button`)?.getAttribute(`aria-expanded`)===`true`)}return n}var R6=30,z6=8,B6=160,V6=3e4,H6=Fz;function U6({words:e,components:t}){let n=w4(),r=ky(),i=(0,R.useCallback)(t=>(0,z.jsx)(O4,{...t,empty:e.nothing}),[e.nothing]);return(0,z.jsx)(H6,{triggerCharacter:`/`,getItems:async n=>{let i=C4(e,n,await t()),a=r.getTextCursorPosition().block.id;return H2(r,a)?i.filter(e=>e.block?.type!==`columns`):i},suggestionMenuComponent:i,onItemClick:e=>{n(e)}})}function W6({links:e,empty:t}){let n=ky(),r=(0,R.useCallback)(e=>(0,z.jsx)(O4,{...e,empty:t,testId:`doc-mention-menu`}),[t]),i=(0,R.useRef)([]);return(0,z.jsx)(H6,{triggerCharacter:`@`,shouldOpen:e=>{let t=e.selection.$from,n=t.parent.textBetween(0,t.parentOffset).replace(/@$/,``);return!/[A-Za-z0-9._-]$/.test(n)},getItems:async t=>(i.current=await e(),D4(i.current,t)),suggestionMenuComponent:r,onItemClick:e=>{let t=i.current.find(t=>`link:${t.href}`===e.key);t&&n.insertInlineContent([{type:`link`,href:t.href,content:t.title},` `])}})}function G6(e){let t=e instanceof Element?e:e?.contextElement;if(!t)return 0;let n=t.getBoundingClientRect().top,r=t.querySelector(`.bn-inline-content`);if(r){let e=document.createRange();e.selectNodeContents(r);let t=e.getClientRects()[0]??r.getBoundingClientRect();return t.top+t.height/2-n-R6/2}let i=(t.querySelector(`.bn-block-content`)??t).getBoundingClientRect();return i.top-n+Math.max(0,Math.min(i.height,54)/2-R6/2)}function K6({path:e,file:t,toggles:o,words:s,context:c,autoFocus:l,className:u,onUnreadable:d}){let f=a(),p=w2(e),[m]=(0,R.useState)(()=>new vy(t.text)),[h]=(0,R.useState)(()=>bf(m.shown())),g=sy(c.locale),[_]=(0,R.useState)(J4),v=jL({schema:k6,dropCursor:_.dropCursor,extensions:[_.extension,_4,l3],sideMenu:{hoverMargin:B6},dictionary:A6(g,s),tables:{headers:!0},...h.body.length>0?{initialContent:(()=>{let e=q0(h.body);return I6(e,o),e})()}:{},uploadFile:e=>e3(f,p,e),resolveFileUrl:async e=>{let t=E2(p,e);return t===void 0?e:(await f[`files/url`]({path:t})).url}},[m]),y=v,b=f3(v),x=(0,R.useRef)(null),S=e=>x.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`)??void 0,C=(e,t)=>{let n=document.elementFromPoint(e,t)?.closest(`.bn-block-outer[data-id]`),r=[...x.current?.querySelectorAll(`.bn-block-outer[data-id]`)??[]],i=n?r.indexOf(n):-1;for(let e=i;e>=0;e--){let t=(r[e]?.querySelector(`[data-content-type="heading"]`))?.textContent.trim()??``;if(t!==``)return`under the heading ${JSON.stringify(t)}`}},w=e=>{let t=e.closest(`.bn-block-outer[data-id]`)?.getAttribute(`data-id`),n=t?v.getBlock(t):void 0;if(n?.type===`image`&&n.props.url!==``)return{name:`the picture ${n.props.url}`,written:n.props.url};if(n?.type===`component`){let e=j0(n.props.data);if(e)return{name:`the component ${xa(e)} (${e.of})`,written:e.of}}};i({hold:()=>Promise.resolve({key:`${e}@${String(t.text.length)}`,what:`The doc ${e}`,source:{path:e}}),locate:n=>{let r=T(n)[0],i=r?C(r.x,r.y):void 0;return Promise.resolve({elements:o2(document,n,e,t.text,w),...i===void 0?{}:{where:i}})},pick:n=>{let r=f2(document,n,e,t.text,w),i=C(n.x,n.y);return Promise.resolve(r&&{...r,...i===void 0?{}:{where:i}})},selected:()=>{let n=document.getSelection(),r=n&&n.rangeCount>0&&!n.isCollapsed?n.getRangeAt(0):void 0,i=r!==void 0&&x.current?.contains(r.commonAncestorContainer)===!0,a=r?.getClientRects()[0],o=a?C(a.x+1,a.y+1):void 0;return Promise.resolve(m2(document,i?r:void 0,e,t.text,w).map(e=>({...e,...o===void 0?{}:{where:o}})))}});let[E,D]=(0,R.useState)(t.state);(0,R.useEffect)(()=>t.onState(D),[t]);let[k,j]=(0,R.useState)(()=>m.page),M=(0,R.useRef)(void 0),N=R3(v,k),P=(0,R.useCallback)(()=>{let e=M.current;e&&py(e,m.page)&&(M.current=void 0)},[m]),ee=(0,R.useCallback)(e=>{M.current=e,j(e),t.edited()},[t]),[F,I]=(0,R.useState)(!1),te=(0,R.useCallback)(()=>{I(!0)},[]),[ne,L]=(0,R.useState)(0);r(`project/changed`,e=>{L(e.revision)});let[re,ie]=(0,R.useState)(),[ae,oe]=(0,R.useState)([]),ce=k.bibliography!==void 0;(0,R.useEffect)(()=>{if(!F&&!ce)return;let t=!0;return O0(f,`doc/data`,{item:e}).then(e=>{t&&(ie(e.data),oe(vi(e.sources??[])))},()=>void 0),()=>{t=!1}},[f,e,F,ce,ne]);let le=G3(v,ae,k.citationStyle??`apa`),{font:ue,accent:de}=k,fe=(0,R.useMemo)(()=>({...ue===void 0?{}:{font:ue},...de===void 0?{}:{accent:de}}),[ue,de]),pe=(0,R.useMemo)(()=>({page:fe,base:p,data:re,wantData:te,dark:c.theme===`dark`}),[fe,p,re,te,c.theme]),[me,he]=(0,R.useState)(()=>Z3(y.document)),[ge,_e]=(0,R.useState)(()=>({block:h.title,value:xf(h.title)})),ve=(0,R.useRef)(ge),ye=(0,R.useRef)(null),be=(0,R.useCallback)((e,t)=>{ve.current={block:e,value:t},_e(ve.current)},[]),xe=(0,R.useCallback)(()=>{let e=t2(y.document),t=j6(e)&&!j6(bf(m.shown()).body);return Cf(ve.current.block,t?[]:e)},[y,m]),Se=(0,R.useCallback)(e=>e<0?void 0:m.lineOf(e+ +!!bf(m.shown()).title),[m]),Ce=(0,R.useCallback)(()=>y.document.map(e=>({id:e.id??``,model:t2([e])[0]})),[y]),[we,Te]=(0,R.useState)(),Ee=(0,R.useCallback)((e,t=!1)=>{let n,{title:r,body:i}=bf(e),a=xf(r),o=ve.current.value;be(r,o.replace(/\s+/g,` `).trim()===a?o:a);let s=Ce().filter(e=>e.model!==void 0),c=j6(s.map(e=>e.model)),l=Fn(c?[]:s.map(e=>e.model),i,ma);y.transact(e=>{e.setMeta(`addToHistory`,!1);for(let e of l){let t=s.slice(e.at,e.at+e.remove).map(e=>e.id),r=J0(e.insert);if(c){let e=s[0];e&&r.length>0&&y.replaceBlocks([e.id],r)}else if(t.length>0){let i=y.replaceBlocks(t,r).insertedBlocks;n??=i[0]?.id??s[e.at+e.remove]?.id}else if(r.length>0){let t=s[e.at],i=s.at(-1)??Ce().at(-1);t?n??=y.insertBlocks(r,t.id,`before`)[0]?.id:i&&(n??=y.insertBlocks(r,i.id,`after`)[0]?.id)}}}),t&&n!==void 0&&Te({id:n,at:Date.now()})},[y,be,Ce]),De=(0,R.useCallback)((e,t)=>{let n=m.incoming(e,xe());m.unreadable?d(e):(n&&Ee(n,t?.kind===`agent`),P(),M.current===void 0&&j(e=>py(e,m.page)?e:m.page))},[xe,m,d,P,Ee]),{agent:Oe,following:ke}=n(),Ae=nt(),je=(()=>{if(Oe?.doing===void 0)return;let e=we&&we.at>=Oe.at-V6,n=Oe.source?.path===t.path;if(e&&n)return we.id;let r=n?Oe.source?.from:void 0,i=r===void 0?void 0:m.indexAtLine(r);if(i!==void 0){let e=+!!bf(m.shown()).title,t=Ce()[Math.max(0,i-e)]?.id;if(t!==void 0&&t!==``)return t}return e?we.id:void 0})(),Me=Oe?Ae(Oe):``;(0,R.useEffect)(()=>{u3(v,je===void 0?null:{id:je,label:Me})},[v,je,Me]),(0,R.useEffect)(()=>{ke&&je!==void 0&&S(je)?.scrollIntoView({block:`center`})},[ke,je]);let Ne=(0,R.useRef)({held:xe,take:De,settleLook:P});(0,R.useLayoutEffect)(()=>{Ne.current={held:xe,take:De,settleLook:P}},[xe,De,P]),(0,R.useLayoutEffect)(()=>(t.attach({save:e=>(m.adopt(e),Ne.current.settleLook(),m.unreadable?void 0:m.textFor(Ne.current.held(),M.current)),take:(e,t,n)=>{m.adopt(t),Ne.current.take(e,n)}}),()=>{if(t.state!==`unsaved`||m.unreadable)return;let e;try{e=Ne.current.held()}catch{return}let n=M.current;t.attach({save:t=>(m.adopt(t),m.unreadable?void 0:m.textFor(e,n)),take:()=>void 0}),t.flush()}),[t,m]);let Pe=(0,R.useRef)(JSON.stringify(o)),Fe=(0,R.useCallback)(()=>{let t=L6(y.document,x.current),n=JSON.stringify(t);n!==Pe.current&&(Pe.current=n,f[`storage/set`]({key:M6(e),value:Object.keys(t).length===0?null:t}).catch(()=>void 0))},[y,f,e]),Ie=(0,R.useCallback)(()=>{he(Z3(y.document)),Fe(),t.edited()},[t,y,Fe]),Le=(0,R.useCallback)(e=>{let t=e.replace(/\n/g,` `);be(Sf(ve.current.block,t),t),Ie()},[Ie,be]);(0,R.useLayoutEffect)(()=>{let e=ye.current;if(!e)return;let t=()=>{e.style.height=`0`,e.style.height=`${String(e.scrollHeight)}px`};t();let n=new ResizeObserver(t);return e.parentElement&&n.observe(e.parentElement),()=>{n.disconnect()}},[ge.value]);let Re=(0,R.useCallback)(e=>{let t=y.document[0];if(t?.id===void 0)return;let n=t.id;e===void 0||e===``&&j6(t2([t]))||(y.insertBlocks([{type:`paragraph`,content:e===``?[]:[{type:`text`,text:e,styles:{}}]}],t.id,`before`),n=y.document[0]?.id??t.id);try{v.setTextCursorPosition(n,`start`)}catch{}v.focus()},[v,y]),ze=(0,R.useCallback)(e=>{let t=ye.current;if(!t)return;let n=ve.current.value.length;e!==void 0&&e!==``&&Le(ve.current.value+e),t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(n,n)})},[Le]),[Be]=(0,R.useState)(l);(0,R.useEffect)(()=>{if(!Be)return;let e=requestAnimationFrame(()=>{ve.current.value.trim()===``?ze():Re()});return()=>{cancelAnimationFrame(e)}},[Be,Re,ze]);let Ve=(0,R.useCallback)(e=>{if(e.nativeEvent.isComposing)return;let t=e.currentTarget;if(e.key===`Enter`){e.preventDefault();let n=t.value.slice(t.selectionEnd);n!==``&&Le(t.value.slice(0,t.selectionStart)),Re(n);return}let n=parseFloat(getComputedStyle(t).lineHeight)||0,r=t.selectionEnd===t.value.length||t.scrollHeight<n*1.5;(e.key===`ArrowDown`&&r||e.key===`Tab`&&!e.shiftKey)&&(e.preventDefault(),Re())},[Le,Re]),He=(0,R.useRef)([]),Ue=(0,R.useCallback)(async()=>{try{He.current=(await On(f,`project/items`,{})).items}catch{}return He.current},[f]);(0,R.useEffect)(()=>{Ue()},[Ue]);let We=(0,R.useCallback)(async()=>D2(e,await Ue()),[Ue,e]),Ge=(0,R.useRef)([]),Ke=(0,R.useCallback)(async()=>{try{let e=O(c.locale);Ge.current=(await On(f,`components/list`,{item:p})).components.map(t=>({of:t.of,name:t.name,title:typeof t.label==`string`?t.label:t.label?.[e]??t.label?.en??t.name}))}catch{}return Ge.current},[f,p,c.locale]);(0,R.useEffect)(()=>{let t=x.current;if(!t)return;let n=e=>{if(e.button!==0)return;let t=e.target?.closest(`.bn-editor a[href]`)?.getAttribute(`href`);return t!=null&&t!==``&&!S2.test(t)?t:void 0},r=e=>{n(e)!==void 0&&(e.preventDefault(),e.stopPropagation())},i=t=>{let r=n(t);if(r===void 0)return;t.preventDefault(),t.stopPropagation();let i=O2(e,r);i!==void 0&&f[`items/open`]({target:{type:`file`,path:i}}).catch(()=>void 0)};return t.addEventListener(`mousedown`,r,!0),t.addEventListener(`mouseup`,r,!0),t.addEventListener(`click`,i,!0),()=>{t.removeEventListener(`mousedown`,r,!0),t.removeEventListener(`mouseup`,r,!0),t.removeEventListener(`click`,i,!0)}},[f,e]),(0,R.useEffect)(()=>{let e=x.current;if(!e)return;let t=e=>{e.target?.closest(`.bn-toggle-button`)&&Fe()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}},[Fe]);let qe=(0,R.useCallback)(()=>(0,z.jsx)(N4,{aligns:s.aligns,tags:s}),[s]),[Je,Ye]=(0,R.useState)(),Xe=(0,R.useCallback)(e=>{let t=x.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`),n=x.current?.closest(`.doc-sheet`);if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();Ye({id:e,at:{x:Math.max(8,r.left-i.left),y:Math.min(r.top-i.top+28,i.height-320)}})},[]);x2(v,x,(0,R.useMemo)(()=>({onActions:Xe,onTitle:ze}),[Xe,ze]));let Ze=(0,R.useMemo)(()=>{let t=Je?.id;if(t===void 0)return[];let n=()=>{let e=y.getSelection()?.blocks??[],n=y.document.find(e=>e.id===t);return e.some(e=>e.id===t)?e:n?[n]:[]};return[...x4.flatMap(e=>{let t=S4(e);return t?[{key:`turn:${e}`,title:s.blocks[e],icon:R4(e),group:s.turnInto,run:()=>{for(let e of n())e.id!==void 0&&y.updateBlock(e.id,t)}}]:[]}),{key:`duplicate`,title:s.duplicate,icon:dt,run:()=>{let e=n(),t=e.at(-1);t?.id!==void 0&&y.insertBlocks(e.map(h2),t.id,`after`)}},{key:`place`,title:s.copyPlace,icon:ht,run:()=>{let n=Se(y.document.findIndex(e=>e.id===t));navigator.clipboard.writeText(n===void 0?e:`${e}:${String(n)}`).catch(()=>void 0)}},{key:`delete`,title:s.remove,icon:_n,run:()=>{y.removeBlocks(n().flatMap(e=>e.id===void 0?[]:[e.id]))}}]},[Je,y,Se,e,s]),Qe=(0,R.useCallback)(e=>(0,z.jsx)(I4,{...e,strings:s,onActions:Xe}),[Xe,s]),$e=(0,R.useMemo)(()=>({useFloatingOptions:{middleware:[A(({elements:e})=>({mainAxis:z6,crossAxis:G6(e.reference)}))]}}),[]),tt=(0,R.useCallback)(e=>{x.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`)?.scrollIntoView({block:`start`,behavior:`smooth`})},[]),[rt,it]=(0,R.useState)(!1),at=(0,R.useCallback)(e=>{let t=Q_(m.source).blocks,n=[..._a(t)][e];if(n===void 0)return;let r=t.find(e=>e===n||[..._a([e])].includes(n)),{title:i,body:a}=bf(ba(t));if(r===void 0)return;if(r===i){x.current?.scrollTo({top:0,behavior:`smooth`}),ye.current?.focus();return}let o=v.document[a.indexOf(r)]?.id;o!==void 0&&tt(o)},[m,v,tt]),ot=ge.block?.type===`heading`?ge.block.look?.align:void 0,st=c.mode!==`edit`,ct=!st,lt=Tf(k),ut=Ef(k),ft={"--doc-text":lt.text,"--doc-heading":lt.heading,"--doc-mono":lt.mono,...ut===void 0?{}:{"--doc-accent":ut}};return(0,z.jsx)(W2.Provider,{value:pe,children:(0,z.jsx)(d3.Provider,{value:b,children:(0,z.jsx)(F3.Provider,{value:N,children:(0,z.jsx)(H3.Provider,{value:le,children:(0,z.jsx)(Cn,{children:(0,z.jsx)(`div`,{className:u,"data-testid":`doc-editor`,"data-state":E,"data-read-only":st?``:void 0,lang:se[O(c.locale)],children:(0,z.jsxs)(`div`,{className:`doc-sheet`,style:ft,"data-font":k.font??`sans`,"data-accent":ut===void 0?void 0:``,children:[(0,z.jsx)(et,{saved:{state:E},start:st?void 0:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(j3,{look:k,words:s,chinese:O(c.locale).startsWith(`zh`),onLook:ee}),(0,z.jsxs)(Kn,{"data-testid":`doc-pages-button`,"aria-pressed":rt,"data-state":rt?`on`:`off`,onClick:()=>{it(e=>!e)},children:[(0,z.jsx)(Wr,{}),s.pages]})]})}),Je!==void 0&&(0,z.jsx)(L4,{actions:Ze,placeholder:s.find,empty:s.nothing,at:Je.at,onClose:()=>{Ye(void 0)}}),(0,z.jsxs)(`div`,{className:`doc-split`,children:[(0,z.jsxs)(`div`,{className:`doc-scroll`,ref:x,children:[(0,z.jsx)(s3,{place:`top`,look:k,dir:p,words:s,editable:ct,onLook:ee}),(0,z.jsxs)(`div`,{className:`doc-body`,children:[(0,z.jsxs)(`div`,{className:`doc-column`,children:[(0,z.jsxs)(`div`,{className:`doc-title-row group/title`,children:[(0,z.jsx)(s3,{place:`title`,look:k,dir:p,words:s,editable:ct,onLook:ee}),(0,z.jsx)(`textarea`,{ref:ye,className:`doc-title`,"data-testid":`doc-title-field`,rows:1,value:ge.value,placeholder:s.untitled,"aria-label":s.title,readOnly:st,style:ot?{textAlign:ot}:void 0,onChange:e=>{Le(e.target.value)},onKeyDown:Ve})]}),(0,z.jsxs)(E0,{editor:v,editable:!st,theme:c.theme,formattingToolbar:!1,slashMenu:!1,sideMenu:!1,onChange:Ie,children:[(0,z.jsx)(UR,{formattingToolbar:qe}),(0,z.jsx)(U6,{words:s,components:Ke}),(0,z.jsx)(W6,{links:We,empty:s.nothingToLink}),(0,z.jsx)(sz,{sideMenu:Qe,floatingUIOptions:$e})]})]}),(0,z.jsx)(Q3,{entries:me,label:s.outline,scroller:x,onGo:tt})]})]}),rt&&ct&&(0,z.jsx)(P3,{item:e,stamp:`${String(ne)}:${E}`,words:s,onGo:at})]})]})})})})})})})}function q6(e){let t=a(),n=o(),r=e.path??n?.item.entry,i=oy.of(n?.locale),[s,c]=(0,R.useState)(),[l,u]=(0,R.useState)(),[d,f]=(0,R.useState)(),[p,m]=(0,R.useState)(0);(0,R.useEffect)(()=>{if(r===void 0)return;let e=!0,n;return Promise.all([De.open(t,r),(e=>t[`storage/get`]({key:e}).then(e=>e.value,()=>null))(M6(r))]).then(([t,i])=>{n=t,e?(c({path:r,file:t,toggles:N6(i)}),f(_y(Q_(t.text))?t.text:void 0),u(void 0)):t.close()},t=>{e&&u(t instanceof Error?t.message:``)}),()=>{e=!1,n?.close()}},[t,r]);let h=s?.file;(0,R.useEffect)(()=>{h&&d!==void 0&&h.attach({save:()=>void 0,take:e=>{_y(Q_(e))?f(e):(f(void 0),m(e=>e+1))}})},[h,d]);let g=`doc-page${e.bare===!0?` doc-bare`:``} ${e.className??``}`,_=se[O(n?.locale)];return l===void 0?!s||!n||s.path!==r?(0,z.jsx)(`div`,{className:g,lang:_,children:(0,z.jsx)(`div`,{className:`doc-sheet`,children:(0,z.jsx)(`p`,{className:`doc-message`,children:i.loading})})}):d===void 0?(0,z.jsx)(x6.Provider,{value:i,children:(0,z.jsx)(A2.Provider,{value:{item:An(r),path:r,locale:O(n.locale),readOnly:n.mode!==`edit`,words:i},children:(0,z.jsx)(K6,{path:r,file:s.file,toggles:s.toggles,words:i,context:n,autoFocus:e.autoFocus??!1,className:g,onUnreadable:f},`${r}:${String(p)}`)})}):(0,z.jsx)(J6,{className:g,text:d,words:i,lang:_}):(0,z.jsx)(`div`,{className:g,lang:_,children:(0,z.jsx)(`div`,{className:`doc-sheet`,children:(0,z.jsx)(`p`,{role:`alert`,className:`doc-message doc-message-problem`,children:l})})})}function J6({className:e,text:t,words:n,lang:r}){let i=Q_(t).problems[0]?.message;return(0,z.jsx)(`div`,{className:e,lang:r,children:(0,z.jsx)(`div`,{className:`doc-sheet`,children:(0,z.jsxs)(`div`,{className:`doc-scroll doc-unreadable`,"data-testid":`doc-unreadable`,children:[(0,z.jsx)(`p`,{className:`doc-message`,children:n.unreadable}),(0,z.jsx)(`p`,{className:`doc-message doc-message-problem`,children:i}),(0,z.jsx)(`pre`,{children:t})]})})})}export{q6 as DocEditor,q6 as default,vy as DocModel,oy as WORDS,sy as blockNoteDictionary,o2 as blocksAt,D2 as docLinks,t2 as fromEditor,i2 as lineOf,O2 as linkTarget,uy as merge3,E2 as projectPath,C2 as relativePath,dy as restoreSource,J0 as toEditor};
|