@provos/ironcurtain 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -19
- package/dist/cli-help.d.ts +12 -0
- package/dist/cli-help.js +21 -0
- package/dist/cli-help.js.map +1 -1
- package/dist/cli.js +14 -6
- package/dist/cli.js.map +1 -1
- package/dist/config/agent-model-guard.d.ts +14 -0
- package/dist/config/agent-model-guard.js +24 -0
- package/dist/config/agent-model-guard.js.map +1 -0
- package/dist/config/config-command.d.ts +33 -1
- package/dist/config/config-command.js +723 -11
- package/dist/config/config-command.js.map +1 -1
- package/dist/config/first-start.js +2 -8
- package/dist/config/first-start.js.map +1 -1
- package/dist/config/model-provider.d.ts +9 -0
- package/dist/config/model-provider.js +13 -0
- package/dist/config/model-provider.js.map +1 -1
- package/dist/config/openrouter-catalog.d.ts +46 -0
- package/dist/config/openrouter-catalog.js +111 -0
- package/dist/config/openrouter-catalog.js.map +1 -0
- package/dist/config/openrouter-models-fallback.d.ts +15 -0
- package/dist/config/openrouter-models-fallback.js +49 -0
- package/dist/config/openrouter-models-fallback.js.map +1 -0
- package/dist/config/paths.d.ts +48 -6
- package/dist/config/paths.js +63 -8
- package/dist/config/paths.js.map +1 -1
- package/dist/config/types.d.ts +8 -0
- package/dist/config/user-config.d.ts +179 -6
- package/dist/config/user-config.js +282 -5
- package/dist/config/user-config.js.map +1 -1
- package/dist/daemon/daemon-command.js +14 -5
- package/dist/daemon/daemon-command.js.map +1 -1
- package/dist/daemon/ironcurtain-daemon.d.ts +18 -0
- package/dist/daemon/ironcurtain-daemon.js +28 -1
- package/dist/daemon/ironcurtain-daemon.js.map +1 -1
- package/dist/daemon-client/daemon-client.d.ts +123 -0
- package/dist/daemon-client/daemon-client.js +324 -0
- package/dist/daemon-client/daemon-client.js.map +1 -0
- package/dist/docker/adapters/claude-code.js +109 -1
- package/dist/docker/adapters/claude-code.js.map +1 -1
- package/dist/docker/adapters/codex.d.ts +18 -0
- package/dist/docker/adapters/codex.js +376 -0
- package/dist/docker/adapters/codex.js.map +1 -0
- package/dist/docker/adapters/goose.js +38 -2
- package/dist/docker/adapters/goose.js.map +1 -1
- package/dist/docker/agent-adapter.d.ts +34 -6
- package/dist/docker/agent-adapter.js +2 -0
- package/dist/docker/agent-adapter.js.map +1 -1
- package/dist/docker/agent-registry.js +5 -0
- package/dist/docker/agent-registry.js.map +1 -1
- package/dist/docker/apple-container-manager.d.ts +49 -0
- package/dist/docker/apple-container-manager.js +486 -0
- package/dist/docker/apple-container-manager.js.map +1 -0
- package/dist/docker/ca.js +9 -2
- package/dist/docker/ca.js.map +1 -1
- package/dist/docker/code-mode-proxy.d.ts +11 -0
- package/dist/docker/code-mode-proxy.js +3 -1
- package/dist/docker/code-mode-proxy.js.map +1 -1
- package/dist/docker/container-lifecycle.d.ts +2 -2
- package/dist/docker/container-lifecycle.js +9 -0
- package/dist/docker/container-lifecycle.js.map +1 -1
- package/dist/docker/container-runtime.d.ts +29 -0
- package/dist/docker/container-runtime.js +76 -0
- package/dist/docker/container-runtime.js.map +1 -0
- package/dist/docker/docker-agent-session.d.ts +31 -0
- package/dist/docker/docker-agent-session.js +97 -7
- package/dist/docker/docker-agent-session.js.map +1 -1
- package/dist/docker/docker-infrastructure.d.ts +232 -15
- package/dist/docker/docker-infrastructure.js +762 -118
- package/dist/docker/docker-infrastructure.js.map +1 -1
- package/dist/docker/docker-manager.d.ts +25 -5
- package/dist/docker/docker-manager.js +388 -21
- package/dist/docker/docker-manager.js.map +1 -1
- package/dist/docker/docker-probe.d.ts +45 -0
- package/dist/docker/docker-probe.js +86 -0
- package/dist/docker/docker-probe.js.map +1 -0
- package/dist/docker/docker-progress-sink.d.ts +1 -1
- package/dist/docker/docker-resource-lifecycle.d.ts +71 -0
- package/dist/docker/docker-resource-lifecycle.js +454 -0
- package/dist/docker/docker-resource-lifecycle.js.map +1 -0
- package/dist/docker/gc-command.d.ts +2 -0
- package/dist/docker/gc-command.js +37 -0
- package/dist/docker/gc-command.js.map +1 -0
- package/dist/docker/mitm-proxy.d.ts +58 -5
- package/dist/docker/mitm-proxy.js +338 -26
- package/dist/docker/mitm-proxy.js.map +1 -1
- package/dist/docker/network-topology.d.ts +88 -0
- package/dist/docker/network-topology.js +167 -0
- package/dist/docker/network-topology.js.map +1 -0
- package/dist/docker/oauth-credentials.d.ts +13 -0
- package/dist/docker/oauth-credentials.js +125 -0
- package/dist/docker/oauth-credentials.js.map +1 -1
- package/dist/docker/openrouter.d.ts +107 -0
- package/dist/docker/openrouter.js +236 -0
- package/dist/docker/openrouter.js.map +1 -0
- package/dist/docker/orientation.js +1 -1
- package/dist/docker/orientation.js.map +1 -1
- package/dist/docker/package-types.d.ts +1 -1
- package/dist/docker/platform.d.ts +3 -1
- package/dist/docker/platform.js +3 -1
- package/dist/docker/platform.js.map +1 -1
- package/dist/docker/provider-config.d.ts +35 -1
- package/dist/docker/provider-config.js +93 -3
- package/dist/docker/provider-config.js.map +1 -1
- package/dist/docker/provision-lock.d.ts +46 -0
- package/dist/docker/provision-lock.js +152 -0
- package/dist/docker/provision-lock.js.map +1 -0
- package/dist/docker/pty-session.d.ts +22 -0
- package/dist/docker/pty-session.js +238 -84
- package/dist/docker/pty-session.js.map +1 -1
- package/dist/docker/pty-types.d.ts +15 -0
- package/dist/docker/pty-types.js +8 -0
- package/dist/docker/pty-types.js.map +1 -1
- package/dist/docker/registry-proxy.d.ts +46 -0
- package/dist/docker/registry-proxy.js +255 -1
- package/dist/docker/registry-proxy.js.map +1 -1
- package/dist/docker/resource-limits.d.ts +14 -5
- package/dist/docker/resource-limits.js +11 -8
- package/dist/docker/resource-limits.js.map +1 -1
- package/dist/docker/sse-extractor.js +55 -5
- package/dist/docker/sse-extractor.js.map +1 -1
- package/dist/docker/stream-delay.d.ts +86 -0
- package/dist/docker/stream-delay.js +218 -0
- package/dist/docker/stream-delay.js.map +1 -0
- package/dist/docker/token-stream-types.d.ts +15 -0
- package/dist/docker/trajectory-capture.d.ts +79 -0
- package/dist/docker/trajectory-capture.js +521 -0
- package/dist/docker/trajectory-capture.js.map +1 -0
- package/dist/docker/trajectory-reassembler.d.ts +286 -0
- package/dist/docker/trajectory-reassembler.js +1010 -0
- package/dist/docker/trajectory-reassembler.js.map +1 -0
- package/dist/docker/trajectory-tap.d.ts +100 -0
- package/dist/docker/trajectory-tap.js +410 -0
- package/dist/docker/trajectory-tap.js.map +1 -0
- package/dist/docker/trajectory-types.d.ts +187 -0
- package/dist/docker/trajectory-types.js +43 -0
- package/dist/docker/trajectory-types.js.map +1 -0
- package/dist/docker/types.d.ts +116 -12
- package/dist/doctor/checks.d.ts +39 -6
- package/dist/doctor/checks.js +129 -25
- package/dist/doctor/checks.js.map +1 -1
- package/dist/doctor/doctor-command.js +39 -9
- package/dist/doctor/doctor-command.js.map +1 -1
- package/dist/doctor/mcp-liveness.d.ts +1 -1
- package/dist/doctor/mcp-liveness.js +12 -4
- package/dist/doctor/mcp-liveness.js.map +1 -1
- package/dist/escalation/escalation-watcher.js +6 -0
- package/dist/escalation/escalation-watcher.js.map +1 -1
- package/dist/{mux → escalation}/trusted-input.d.ts +7 -4
- package/dist/{mux → escalation}/trusted-input.js +8 -5
- package/dist/escalation/trusted-input.js.map +1 -0
- package/dist/hash.js.map +1 -1
- package/dist/index.js +65 -16
- package/dist/index.js.map +1 -1
- package/dist/mux/mux-app.d.ts +9 -0
- package/dist/mux/mux-app.js +18 -16
- package/dist/mux/mux-app.js.map +1 -1
- package/dist/mux/mux-command.js +26 -8
- package/dist/mux/mux-command.js.map +1 -1
- package/dist/mux/mux-input-handler.d.ts +26 -2
- package/dist/mux/mux-input-handler.js +93 -11
- package/dist/mux/mux-input-handler.js.map +1 -1
- package/dist/mux/mux-renderer.d.ts +2 -1
- package/dist/mux/mux-renderer.js +67 -0
- package/dist/mux/mux-renderer.js.map +1 -1
- package/dist/mux/provider-profile-snapshot.d.ts +44 -0
- package/dist/mux/provider-profile-snapshot.js +56 -0
- package/dist/mux/provider-profile-snapshot.js.map +1 -0
- package/dist/mux/types.d.ts +3 -2
- package/dist/mux/types.js +6 -2
- package/dist/mux/types.js.map +1 -1
- package/dist/observe/observe-command.js +112 -125
- package/dist/observe/observe-command.js.map +1 -1
- package/dist/persona/broad-policy-validator.d.ts +95 -0
- package/dist/persona/broad-policy-validator.js +171 -0
- package/dist/persona/broad-policy-validator.js.map +1 -0
- package/dist/persona/compile-persona-policy.d.ts +54 -2
- package/dist/persona/compile-persona-policy.js +29 -4
- package/dist/persona/compile-persona-policy.js.map +1 -1
- package/dist/persona/event-bus-progress-reporter.d.ts +57 -0
- package/dist/persona/event-bus-progress-reporter.js +66 -0
- package/dist/persona/event-bus-progress-reporter.js.map +1 -0
- package/dist/persona/persona-command.js +46 -76
- package/dist/persona/persona-command.js.map +1 -1
- package/dist/persona/persona-compile-orchestrator.d.ts +101 -0
- package/dist/persona/persona-compile-orchestrator.js +504 -0
- package/dist/persona/persona-compile-orchestrator.js.map +1 -0
- package/dist/persona/persona-service.d.ts +137 -0
- package/dist/persona/persona-service.js +263 -0
- package/dist/persona/persona-service.js.map +1 -0
- package/dist/persona/policy-mutation-audit.d.ts +109 -0
- package/dist/persona/policy-mutation-audit.js +179 -0
- package/dist/persona/policy-mutation-audit.js.map +1 -0
- package/dist/persona/rule-delta.d.ts +30 -0
- package/dist/persona/rule-delta.js +82 -0
- package/dist/persona/rule-delta.js.map +1 -0
- package/dist/persona/types.d.ts +12 -0
- package/dist/pipeline/annotate.js +10 -2
- package/dist/pipeline/annotate.js.map +1 -1
- package/dist/pipeline/compile.js +14 -2
- package/dist/pipeline/compile.js.map +1 -1
- package/dist/pipeline/constitution-compiler.js.map +1 -1
- package/dist/pipeline/generate-with-repair.js.map +1 -1
- package/dist/pipeline/pipeline-runner.d.ts +63 -4
- package/dist/pipeline/pipeline-runner.js +159 -50
- package/dist/pipeline/pipeline-runner.js.map +1 -1
- package/dist/pipeline/pipeline-shared.d.ts +32 -3
- package/dist/pipeline/pipeline-shared.js +76 -8
- package/dist/pipeline/pipeline-shared.js.map +1 -1
- package/dist/pipeline/refresh-lists.js +3 -5
- package/dist/pipeline/refresh-lists.js.map +1 -1
- package/dist/pipeline/scenario-schema-validator.js.map +1 -1
- package/dist/{mux → pty}/pty-bridge.d.ts +41 -3
- package/dist/{mux → pty}/pty-bridge.js +71 -18
- package/dist/pty/pty-bridge.js.map +1 -0
- package/dist/pty/resolve-ironcurtain-bin.d.ts +17 -0
- package/dist/pty/resolve-ironcurtain-bin.js +22 -0
- package/dist/pty/resolve-ironcurtain-bin.js.map +1 -0
- package/dist/sandbox/index.d.ts +19 -4
- package/dist/sandbox/index.js +31 -18
- package/dist/sandbox/index.js.map +1 -1
- package/dist/servers/fetch-server.js +2 -0
- package/dist/servers/fetch-server.js.map +1 -1
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +20 -2
- package/dist/session/index.js.map +1 -1
- package/dist/session/preflight.d.ts +20 -35
- package/dist/session/preflight.js +92 -109
- package/dist/session/preflight.js.map +1 -1
- package/dist/session/resource-budget-tracker.js +8 -0
- package/dist/session/resource-budget-tracker.js.map +1 -1
- package/dist/session/session-manager.d.ts +7 -0
- package/dist/session/session-manager.js.map +1 -1
- package/dist/session/types.d.ts +23 -0
- package/dist/signal/bot-command.js +6 -1
- package/dist/signal/bot-command.js.map +1 -1
- package/dist/signal/setup-signal.js +1 -1
- package/dist/signal/setup-signal.js.map +1 -1
- package/dist/signal/signal-bot-daemon.d.ts +1 -0
- package/dist/signal/signal-bot-daemon.js +9 -2
- package/dist/signal/signal-bot-daemon.js.map +1 -1
- package/dist/signal/signal-container.d.ts +3 -3
- package/dist/signal/signal-container.js +2 -2
- package/dist/signal/signal-container.js.map +1 -1
- package/dist/trusted-process/call-circuit-breaker.d.ts +6 -0
- package/dist/trusted-process/call-circuit-breaker.js +22 -3
- package/dist/trusted-process/call-circuit-breaker.js.map +1 -1
- package/dist/trusted-process/container-command.d.ts +35 -0
- package/dist/trusted-process/container-command.js +49 -0
- package/dist/trusted-process/container-command.js.map +1 -0
- package/dist/trusted-process/mcp-error-utils.js +4 -1
- package/dist/trusted-process/mcp-error-utils.js.map +1 -1
- package/dist/trusted-process/mcp-proxy-server.js +37 -3
- package/dist/trusted-process/mcp-proxy-server.js.map +1 -1
- package/dist/trusted-process/policy-engine.js +13 -2
- package/dist/trusted-process/policy-engine.js.map +1 -1
- package/dist/trusted-process/tcp-server-transport.d.ts +19 -1
- package/dist/trusted-process/tcp-server-transport.js +56 -10
- package/dist/trusted-process/tcp-server-transport.js.map +1 -1
- package/dist/trusted-process/tool-call-coordinator.d.ts +22 -8
- package/dist/trusted-process/tool-call-coordinator.js +149 -65
- package/dist/trusted-process/tool-call-coordinator.js.map +1 -1
- package/dist/trusted-process/tool-call-pipeline.d.ts +8 -0
- package/dist/trusted-process/tool-call-pipeline.js +68 -34
- package/dist/trusted-process/tool-call-pipeline.js.map +1 -1
- package/dist/util/atomic-write.d.ts +31 -0
- package/dist/util/atomic-write.js +43 -0
- package/dist/util/atomic-write.js.map +1 -0
- package/dist/utils/preflight-checks.js +1 -3
- package/dist/utils/preflight-checks.js.map +1 -1
- package/dist/utils/stdio-guard.d.ts +1 -0
- package/dist/utils/stdio-guard.js +27 -0
- package/dist/utils/stdio-guard.js.map +1 -0
- package/dist/web-ui/__tests__/config-dispatch.test.d.ts +13 -0
- package/dist/web-ui/__tests__/config-dispatch.test.js +383 -0
- package/dist/web-ui/__tests__/config-dispatch.test.js.map +1 -0
- package/dist/web-ui/__tests__/json-rpc-dispatch.test.js +6 -0
- package/dist/web-ui/__tests__/json-rpc-dispatch.test.js.map +1 -1
- package/dist/web-ui/conn-registry.d.ts +14 -0
- package/dist/web-ui/conn-registry.js +25 -0
- package/dist/web-ui/conn-registry.js.map +1 -0
- package/dist/web-ui/dispatch/config-dispatch.d.ts +15 -0
- package/dist/web-ui/dispatch/config-dispatch.js +277 -0
- package/dist/web-ui/dispatch/config-dispatch.js.map +1 -0
- package/dist/web-ui/dispatch/escalation-dispatch.js +11 -2
- package/dist/web-ui/dispatch/escalation-dispatch.js.map +1 -1
- package/dist/web-ui/dispatch/persona-dispatch.d.ts +46 -2
- package/dist/web-ui/dispatch/persona-dispatch.js +209 -56
- package/dist/web-ui/dispatch/persona-dispatch.js.map +1 -1
- package/dist/web-ui/dispatch/pty-dispatch.d.ts +15 -0
- package/dist/web-ui/dispatch/pty-dispatch.js +66 -0
- package/dist/web-ui/dispatch/pty-dispatch.js.map +1 -0
- package/dist/web-ui/dispatch/session-dispatch.js +89 -6
- package/dist/web-ui/dispatch/session-dispatch.js.map +1 -1
- package/dist/web-ui/dispatch/types.d.ts +35 -0
- package/dist/web-ui/dispatch/types.js +42 -1
- package/dist/web-ui/dispatch/types.js.map +1 -1
- package/dist/web-ui/dispatch/workflow-dispatch.js +116 -5
- package/dist/web-ui/dispatch/workflow-dispatch.js.map +1 -1
- package/dist/web-ui/json-rpc-dispatch.js +4 -1
- package/dist/web-ui/json-rpc-dispatch.js.map +1 -1
- package/dist/web-ui/pty-session-manager.d.ts +234 -0
- package/dist/web-ui/pty-session-manager.js +599 -0
- package/dist/web-ui/pty-session-manager.js.map +1 -0
- package/dist/web-ui/web-event-bus.d.ts +34 -1
- package/dist/web-ui/web-event-bus.js.map +1 -1
- package/dist/web-ui/web-session-transport.js.map +1 -1
- package/dist/web-ui/web-ui-server.d.ts +22 -0
- package/dist/web-ui/web-ui-server.js +41 -0
- package/dist/web-ui/web-ui-server.js.map +1 -1
- package/dist/web-ui/web-ui-types.d.ts +212 -5
- package/dist/web-ui/web-ui-types.js.map +1 -1
- package/dist/web-ui-static/assets/index-CCVI4nEK.css +1 -0
- package/dist/web-ui-static/assets/index-Dm012gvY.js +114 -0
- package/dist/web-ui-static/index.html +2 -2
- package/dist/workflow/cli-shared.d.ts +62 -0
- package/dist/workflow/cli-shared.js +117 -0
- package/dist/workflow/cli-shared.js.map +1 -0
- package/dist/workflow/cli-support.js +0 -2
- package/dist/workflow/cli-support.js.map +1 -1
- package/dist/workflow/container-snapshots.d.ts +29 -0
- package/dist/workflow/container-snapshots.js +137 -0
- package/dist/workflow/container-snapshots.js.map +1 -0
- package/dist/workflow/daemon-gate-commands.d.ts +21 -0
- package/dist/workflow/daemon-gate-commands.js +595 -0
- package/dist/workflow/daemon-gate-commands.js.map +1 -0
- package/dist/workflow/discovery.d.ts +29 -0
- package/dist/workflow/discovery.js +67 -7
- package/dist/workflow/discovery.js.map +1 -1
- package/dist/workflow/lane-template.d.ts +89 -0
- package/dist/workflow/lane-template.js +141 -0
- package/dist/workflow/lane-template.js.map +1 -0
- package/dist/workflow/lint.d.ts +7 -1
- package/dist/workflow/lint.js +186 -3
- package/dist/workflow/lint.js.map +1 -1
- package/dist/workflow/machine-builder.d.ts +90 -2
- package/dist/workflow/machine-builder.js +222 -29
- package/dist/workflow/machine-builder.js.map +1 -1
- package/dist/workflow/message-log.d.ts +15 -1
- package/dist/workflow/message-log.js.map +1 -1
- package/dist/workflow/orchestrator.d.ts +505 -1
- package/dist/workflow/orchestrator.js +1725 -69
- package/dist/workflow/orchestrator.js.map +1 -1
- package/dist/workflow/prompt-builder.js +2 -1
- package/dist/workflow/prompt-builder.js.map +1 -1
- package/dist/workflow/run-state-command.js +1 -1
- package/dist/workflow/run-state-command.js.map +1 -1
- package/dist/workflow/shutdown-signals.d.ts +7 -0
- package/dist/workflow/shutdown-signals.js +40 -0
- package/dist/workflow/shutdown-signals.js.map +1 -0
- package/dist/workflow/status-parser.js +19 -4
- package/dist/workflow/status-parser.js.map +1 -1
- package/dist/workflow/types.d.ts +123 -23
- package/dist/workflow/types.js +2 -0
- package/dist/workflow/types.js.map +1 -1
- package/dist/workflow/validate.d.ts +23 -1
- package/dist/workflow/validate.js +311 -22
- package/dist/workflow/validate.js.map +1 -1
- package/dist/workflow/workflow-command.d.ts +0 -17
- package/dist/workflow/workflow-command.js +118 -94
- package/dist/workflow/workflow-command.js.map +1 -1
- package/dist/workflow/workflow-discovery.d.ts +2 -0
- package/dist/workflow/workflow-discovery.js +22 -1
- package/dist/workflow/workflow-discovery.js.map +1 -1
- package/dist/workflow/workflow-manager.d.ts +34 -0
- package/dist/workflow/workflow-manager.js +52 -1
- package/dist/workflow/workflow-manager.js.map +1 -1
- package/dist/workflow/workflows/design-and-code/README.md +50 -0
- package/dist/workflow/workflows/deterministic-eval-smoke/scripts/format_report.js +29 -0
- package/dist/workflow/workflows/deterministic-eval-smoke/scripts/package.json +5 -0
- package/dist/workflow/workflows/deterministic-eval-smoke/scripts/requirements.txt +1 -0
- package/dist/workflow/workflows/deterministic-eval-smoke/scripts/run_eval.py +41 -0
- package/dist/workflow/workflows/deterministic-eval-smoke/workflow.yaml +57 -0
- package/dist/workflow/workflows/deterministic-verdict-smoke/scripts/classify.py +18 -0
- package/dist/workflow/workflows/deterministic-verdict-smoke/workflow.yaml +51 -0
- package/dist/workflow/workflows/evolve/README.md +66 -0
- package/dist/workflow/workflows/evolve/scripts/LICENSE +201 -0
- package/dist/workflow/workflows/evolve/scripts/README.md +314 -0
- package/dist/workflow/workflows/evolve/scripts/evolve-brief +16 -0
- package/dist/workflow/workflows/evolve/scripts/evolve-cognition +16 -0
- package/dist/workflow/workflows/evolve/scripts/evolve-db +16 -0
- package/dist/workflow/workflows/evolve/scripts/evolve-eval +16 -0
- package/dist/workflow/workflows/evolve/scripts/evolve-files +16 -0
- package/dist/workflow/workflows/evolve/scripts/evolve-summary +16 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/__init__.py +14 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/__init__.py +17 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/base.py +21 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/factory.py +90 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/greedy.py +17 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/island.py +316 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/random.py +18 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/ucb1.py +55 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/best_snapshot.py +62 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/cli.py +752 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/cognition.py +127 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/database.py +218 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/diff.py +57 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/embedding.py +84 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/file_lock.py +45 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/run_state.py +343 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/sampling_config.py +173 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/structures.py +93 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_core/vector_index.py +191 -0
- package/dist/workflow/workflows/evolve/scripts/evolve_result.py +1503 -0
- package/dist/workflow/workflows/evolve/scripts/requirements.txt +2 -0
- package/dist/workflow/workflows/evolve/workflow.yaml +646 -0
- package/dist/workflow/workflows/test-email-summary/workflow.yaml +1 -0
- package/dist/workflow/workflows/vuln-discovery/README.md +54 -0
- package/dist/workflow/workflows/vuln-discovery/skills/harness-design-fuzzing/SKILL.md +6 -1
- package/dist/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md +1 -0
- package/dist/workflow/workflows/vuln-discovery/skills/vulnerability-triage/SKILL.md +4 -0
- package/dist/workflow/workflows/vuln-discovery/workflow.yaml +13 -8
- package/docker/Dockerfile.base +22 -0
- package/docker/Dockerfile.base.arm64 +18 -0
- package/docker/Dockerfile.claude-code +3 -1
- package/docker/Dockerfile.codex +17 -0
- package/docker/Dockerfile.goose +3 -1
- package/docker/entrypoint-claude-code.sh +28 -45
- package/docker/entrypoint-codex.sh +42 -0
- package/docker/entrypoint-goose.sh +5 -24
- package/docker/entrypoint-uid-remap.sh +93 -0
- package/package.json +39 -30
- package/src/workflow/workflows/design-and-code/README.md +50 -0
- package/src/workflow/workflows/deterministic-eval-smoke/scripts/format_report.js +29 -0
- package/src/workflow/workflows/deterministic-eval-smoke/scripts/package.json +5 -0
- package/src/workflow/workflows/deterministic-eval-smoke/scripts/requirements.txt +1 -0
- package/src/workflow/workflows/deterministic-eval-smoke/scripts/run_eval.py +41 -0
- package/src/workflow/workflows/deterministic-eval-smoke/workflow.yaml +57 -0
- package/src/workflow/workflows/deterministic-verdict-smoke/scripts/classify.py +18 -0
- package/src/workflow/workflows/deterministic-verdict-smoke/workflow.yaml +51 -0
- package/src/workflow/workflows/evolve/README.md +66 -0
- package/src/workflow/workflows/evolve/scripts/LICENSE +201 -0
- package/src/workflow/workflows/evolve/scripts/README.md +314 -0
- package/src/workflow/workflows/evolve/scripts/evolve-brief +16 -0
- package/src/workflow/workflows/evolve/scripts/evolve-cognition +16 -0
- package/src/workflow/workflows/evolve/scripts/evolve-db +16 -0
- package/src/workflow/workflows/evolve/scripts/evolve-eval +16 -0
- package/src/workflow/workflows/evolve/scripts/evolve-files +16 -0
- package/src/workflow/workflows/evolve/scripts/evolve-summary +16 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/__init__.py +14 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/__init__.py +17 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/base.py +21 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/factory.py +90 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/greedy.py +17 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/island.py +316 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/random.py +18 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/ucb1.py +55 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/best_snapshot.py +62 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/cli.py +752 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/cognition.py +127 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/database.py +218 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/diff.py +57 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/embedding.py +84 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/file_lock.py +45 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/run_state.py +343 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/sampling_config.py +173 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/structures.py +93 -0
- package/src/workflow/workflows/evolve/scripts/evolve_core/vector_index.py +191 -0
- package/src/workflow/workflows/evolve/scripts/evolve_result.py +1503 -0
- package/src/workflow/workflows/evolve/scripts/requirements.txt +2 -0
- package/src/workflow/workflows/evolve/workflow.yaml +646 -0
- package/src/workflow/workflows/test-email-summary/workflow.yaml +1 -0
- package/src/workflow/workflows/vuln-discovery/README.md +54 -0
- package/src/workflow/workflows/vuln-discovery/skills/harness-design-fuzzing/SKILL.md +6 -1
- package/src/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md +1 -0
- package/src/workflow/workflows/vuln-discovery/skills/vulnerability-triage/SKILL.md +4 -0
- package/src/workflow/workflows/vuln-discovery/workflow.yaml +13 -8
- package/dist/mux/pty-bridge.js.map +0 -1
- package/dist/mux/trusted-input.js.map +0 -1
- package/dist/web-ui-static/assets/index-BFO5z1js.js +0 -76
- package/dist/web-ui-static/assets/index-CCUwrkIL.css +0 -1
- package/packages/web-ui/README.md +0 -113
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e={},t=Symbol(`uninitialized`),n=`http://www.w3.org/1999/xhtml`,r=`http://www.w3.org/2000/svg`,i=`http://www.w3.org/1998/Math/MathML`,a=Array.isArray,o=Array.prototype.indexOf,s=Array.prototype.includes,c=Array.from,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,g=()=>{};function _(e){for(var t=0;t<e.length;t++)e[t]()}function v(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var y=1<<24,b=1024,x=2048,S=4096,C=8192,w=16384,T=32768,ee=1<<25,E=65536,te=1<<19,ne=1<<20,re=1<<25,ie=65536,ae=1<<21,D=1<<22,oe=1<<23,se=Symbol(`$state`),O=Symbol(`legacy props`),ce=Symbol(``),le=Symbol(`attributes`),ue=Symbol(`class`),de=Symbol(`style`),fe=Symbol(`text`),pe=Symbol(`form reset`),me=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},he=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ge(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function _e(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function ve(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function ye(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function be(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function xe(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Se(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ce(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function we(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Te(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function De(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Oe(){console.warn(`https://svelte.dev/e/derived_inert`)}function ke(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ae(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function je(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Me=!1;function Ne(e){Me=e}var Pe;function Fe(t){if(t===null)throw ke(),e;return Pe=t}function Ie(){return Fe(gn(Pe))}function k(t){if(Me){if(gn(Pe)!==null)throw ke(),e;Pe=t}}function A(e=1){if(Me){for(var t=e,n=Pe;t--;)n=gn(n);Pe=n}}function Le(e=!0){for(var t=0,n=Pe;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=gn(n);e&&n.remove(),n=i}}function Re(t){if(!t||t.nodeType!==8)throw ke(),e;return t.data}function ze(e){return e===this.v}function Be(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ve(e){return!Be(e,this.v)}var He=!1,Ue=!1,We=null;function Ge(e){We=e}function Ke(e){return Ye(`getContext`).get(e)}function qe(e){return Ye(`hasContext`).has(e)}function j(e,t=!1,n){We={p:We,i:!1,c:null,e:null,s:e,x:null,r:ar,l:Ue&&!t?{s:null,u:null,$:[]}:null}}function M(e){var t=We,n=t.e;if(n!==null){t.e=null;for(var r of n)Nn(r)}return e!==void 0&&(t.x=e),t.i=!0,We=t.p,e??{}}function Je(){return!Ue||We!==null&&We.l===null}function Ye(e){return We===null&&ge(e),We.c??=new Map(Xe(We)||void 0)}function Xe(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var Ze=[];function Qe(){var e=Ze;Ze=[],_(e)}function $e(e){if(Ze.length===0&&!Pt){var t=Ze;queueMicrotask(()=>{t===Ze&&Qe()})}Ze.push(e)}function et(){for(;Ze.length>0;)Qe()}function tt(e){var t=ar;if(t===null)return nr.f|=oe,e;if(!(t.f&32768)&&!(t.f&4))throw e;nt(e,t)}function nt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var rt=~(x|S|b);function it(e,t){e.f=e.f&rt|t}function at(e){e.f&512||e.deps===null?it(e,b):it(e,S)}function ot(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ie,ot(t.deps))}function st(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ot(e.deps),it(e,b)}var ct=!1,lt=!1;function ut(e){var t=lt;try{return lt=!1,[e(),lt]}finally{lt=t}}function dt(e){let t=0,n=$t(0),r;return()=>{An()&&(B(n),Ln(()=>(t===0&&(r=Dr(()=>e(()=>rn(n)))),t+=1,()=>{$e(()=>{--t,t===0&&(r?.(),r=void 0,rn(n))})})))}}var ft=E|te;function pt(e,t,n,r){new mt(e,t,n,r)}var mt=class{parent;is_pending=!1;transform_error;#e;#t=Me?Pe:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=dt(()=>(this.#m=$t(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=ar;t.b=this,t.f|=128,n(e)},this.parent=ar.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Rn(()=>{if(Me){let e=this.#t;Ie();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},ft),Me&&(this.#e=Pe)}#g(){try{this.#a=Bn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Bn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Bn(()=>e(this.#e)),$e(()=>{var e=this.#c=document.createDocumentFragment(),t=mn();e.append(t),this.#a=this.#x(()=>Bn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,qn(this.#o,()=>{this.#o=null}),this.#b(At))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Bn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Zn(this.#a,e);let t=this.#n.pending;this.#o=Bn(()=>t(this.#e))}else this.#b(At)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){st(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=ar,n=nr,r=We;or(this.#i),ir(this.#i),Ge(this.#i.ctx);try{return Bt.ensure(),e()}catch(e){return tt(e),null}finally{or(t),ir(n),Ge(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&qn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,$e(()=>{this.#d=!1,this.#m&&tn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),B(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;At?.is_fork?(this.#a&&At.skip_effect(this.#a),this.#o&&At.skip_effect(this.#o),this.#s&&At.skip_effect(this.#s),At.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(Wn(this.#a),null),this.#o&&=(Wn(this.#o),null),this.#s&&=(Wn(this.#s),null),Me&&(Fe(this.#t),A(),Fe(Le()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){je();return}r=!0,i&&De(),this.#s!==null&&qn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){nt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Bn(()=>{var t=ar;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return nt(e,this.#i.parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){nt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>nt(e,this.#i&&this.#i.parent)):o(t)})}};function ht(e,t,n,r){let i=Je()?yt:St;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=ar,c=gt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){nt(e,s)}_t()}}var d=vt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>xt(e))).then(u).catch(e=>nt(e,s)).finally(d)}l?l.then(()=>{c(),f(),_t()}):f()}function gt(){var e=ar,t=nr,n=We,r=At;return function(i=!0){or(e),ir(t),Ge(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function _t(e=!0){or(null),ir(null),Ge(null),e&&At?.deactivate()}function vt(){var e=ar,t=e.b,n=At,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function yt(e){var n=2|x;return ar!==null&&(ar.f|=te),{ctx:We,deps:null,effects:null,equals:ze,f:n,fn:e,reactions:null,rv:0,v:t,wv:0,parent:ar,ac:null}}var bt=Symbol(`obsolete`);function xt(e,n,r){let i=ar;i===null&&_e();var a=void 0,o=$t(t),s=!nr,c=new Set;return In(()=>{var t=ar,n=v();a=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==me&&n.reject(e)}).finally(_t)}catch(e){n.reject(e),_t()}var r=At;if(s){if(t.f&32768)var l=vt();if(i.b?.is_rendered())r.async_deriveds.get(t)?.reject(bt);else for(let e of c.values())e.reject(bt);c.add(n),r.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),c.delete(n),t!==bt&&(r.activate(),t?(o.f|=oe,tn(o,t)):(o.f&8388608&&(o.f^=oe),tn(o,e)),r.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),jn(()=>{for(let e of c)e.reject(bt)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function N(e){let t=yt(e);return He||cr(t),t}function St(e){let t=yt(e);return t.equals=Ve,t}function Ct(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Wn(t[n])}}function wt(e){var n,r=ar,i=e.parent;if(!er&&i!==null&&e.v!==t&&i.f&24576)return Oe(),e.v;or(i);try{e.f&=~ie,Ct(e),n=br(e)}finally{or(r)}return n}function Tt(e){var t=wt(e);if(!e.equals(t)&&(e.wv=_r(),(!At?.is_fork||e.deps===null)&&(At===null?e.v=t:(At.capture(e,t,!0),jt?.capture(e,t,!0)),e.deps===null))){it(e,b);return}er||(Mt===null?at(e):(An()||At?.is_fork)&&Mt.set(e,t))}function Et(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(me),t.fn!==null&&(t.teardown=g),t.ac=null,Sr(t,0),Hn(t))}function Dt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Cr(t)}var Ot=null,kt=null,At=null,jt=null,Mt=null,Nt=null,Pt=!1,Ft=!1,It=null,Lt=null,Rt=0,zt=1,Bt=class e{id=zt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){kt===null?Ot=kt=this:(kt.#n=this,this.#t=kt),kt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)it(r,x),t(r);for(r of n.m)it(r,S),t(r)}this.#p.add(e)}#g(){this.#e=!0,Rt++>1e3&&(this.#S(),Ht());for(let e of this.#u)this.#d.delete(e),it(e,x),this.schedule(e);for(let e of this.#d)it(e,S),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=It=[],r=[],i=Lt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Yt(e),this.#h()||this.discard(),t}if(At=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(It=null,Lt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Jt(e,t);i.length>0&&At.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),jt=this,Wt(r),Wt(n),jt=null,this.#s?.resolve();var s=At;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),He&&(this.#x(),At=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=b;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=b:i&4?t.push(r):He&&i&16777224?n.push(r):vr(r)&&(i&16&&this.#d.add(r),Cr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),it(i,x),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),At=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)st(e[t],this.#u,this.#d)}capture(e,n,r=!1){e.v!==t&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[n,r]),Mt?.set(e,n)),this.is_fork||(e.v=n)}activate(){At=this}deactivate(){At=null,Mt=null}flush(){try{Ft=!0,At=this,this.#g()}finally{Rt=0,Nt=null,It=null,Lt=null,Ft=!1,At=null,Mt=null,Zt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(bt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=Ot;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)Gt(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&Kt(e,c,o)&&(e.f&4194320?(it(e,x),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,$e(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=v()).promise}static ensure(){if(At===null){let t=At=new e;!Ft&&!Pt&&$e(()=>{t.#e||t.flush()})}return At}apply(){if(!He||!this.is_fork&&this.#t===null&&this.#n===null){Mt=null;return}Mt=new Map;for(let[e,[t]]of this.current)Mt.set(e,t);for(let t=Ot;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)Mt.has(e)||Mt.set(e,n)}}schedule(e){if(Nt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(It!==null&&t===ar&&(He||(nr===null||!(nr.f&2))&&!ct))return;if(n&96){if(!(n&1024))return;t.f^=b}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?Ot=t:e.#n=t,t===null?kt=e:t.#t=e,this.linked=!1}}};function Vt(e){var t=Pt;Pt=!0;try{var n;for(e&&(At!==null&&!At.is_fork&&At.flush(),n=e());;){if(et(),At===null)return n;At.flush()}}finally{Pt=t}}function Ht(){try{Se()}catch(e){nt(e,Nt)}}var Ut=null;function Wt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&vr(r)&&(Ut=new Set,Cr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Kn(r),Ut?.size>0)){Zt.clear();for(let e of Ut){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Ut.has(n)&&(Ut.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Cr(n)}}Ut.clear()}}Ut=null}}function Gt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Gt(i,t,n,r):e&4194320&&!(e&2048)&&Kt(i,t,r)&&(it(i,x),qt(i))}}function Kt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(s.call(t,r))return!0;if(r.f&2&&Kt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function qt(e){At.schedule(e)}function Jt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),it(e,b);for(var n=e.first;n!==null;)Jt(n,t),n=n.next}}function Yt(e){it(e,b);for(var t=e.first;t!==null;)Yt(t),t=t.next}var Xt=new Set,Zt=new Map,Qt=!1;function $t(e,t){return{f:0,v:e,reactions:null,equals:ze,rv:0,wv:0}}function P(e,t){let n=$t(e,t);return cr(n),n}function en(e,t=!1,n=!0){let r=$t(e);return t||(r.equals=Ve),Ue&&n&&We!==null&&We.l!==null&&(We.l.s??=[]).push(r),r}function F(e,t,n=!1){return nr!==null&&(!rr||nr.f&131072)&&Je()&&nr.f&4325394&&(sr===null||!sr.has(e))&&Ee(),tn(e,n?on(t):t,Lt)}function tn(e,t,n=null){if(!e.equals(t)){Zt.set(e,er?t:e.v);var r=Bt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&wt(t),Mt===null&&at(t)}e.wv=_r(),an(e,x,n),Je()&&ar!==null&&ar.f&1024&&!(ar.f&96)&&(dr===null?fr([e]):dr.push(e)),!r.is_fork&&Xt.size>0&&!Qt&&nn()}return t}function nn(){Qt=!1;for(let e of Xt){e.f&1024&&it(e,S);let t;try{t=vr(e)}catch{t=!0}t&&Cr(e)}Xt.clear()}function rn(e){F(e,e.v+1)}function an(e,t,n){var r=e.reactions;if(r!==null)for(var i=Je(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===ar)){var l=(c&x)===0;if(l&&it(s,t),c&131072)Xt.add(s);else if(c&2){var u=s;Mt?.delete(u),c&65536||(c&512&&(ar===null||!(ar.f&2097152))&&(s.f|=ie),an(u,S,n))}else if(l){var d=s;c&16&&Ut!==null&&Ut.add(d),n===null?qt(d):n.push(d)}}}}function on(e){if(typeof e!=`object`||!e||se in e)return e;let n=m(e);if(n!==f&&n!==p)return e;var r=new Map,i=a(e),o=P(0),s=null,c=hr,l=e=>{if(hr===c)return e();var t=nr,n=hr;ir(null),gr(c);var r=e();return ir(t),gr(n),r};return i&&r.set(`length`,P(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&we();var i=r.get(t);return i===void 0?l(()=>{var e=P(n.value,s);return r.set(t,e),e}):F(i,n.value,!0),!0},deleteProperty(e,n){var i=r.get(n);if(i===void 0){if(n in e){let e=l(()=>P(t,s));r.set(n,e),rn(o)}}else F(i,t),rn(o);return!0},get(n,i,a){if(i===se)return e;var o=r.get(i),c=i in n;if(o===void 0&&(!c||u(n,i)?.writable)&&(o=l(()=>P(on(c?n[i]:t),s)),r.set(i,o)),o!==void 0){var d=B(o);return d===t?void 0:d}return Reflect.get(n,i,a)},getOwnPropertyDescriptor(e,n){var i=Reflect.getOwnPropertyDescriptor(e,n);if(i&&`value`in i){var a=r.get(n);a&&(i.value=B(a))}else if(i===void 0){var o=r.get(n),s=o?.v;if(o!==void 0&&s!==t)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(e,n){if(n===se)return!0;var i=r.get(n),a=i!==void 0&&i.v!==t||Reflect.has(e,n);return(i!==void 0||ar!==null&&(!a||u(e,n)?.writable))&&(i===void 0&&(i=l(()=>P(a?on(e[n]):t,s)),r.set(n,i)),B(i)===t)?!1:a},set(e,n,a,c){var d=r.get(n),f=n in e;if(i&&n===`length`)for(var p=a;p<d.v;p+=1){var m=r.get(p+``);m===void 0?p in e&&(m=l(()=>P(t,s)),r.set(p+``,m)):F(m,t)}if(d===void 0)(!f||u(e,n)?.writable)&&(d=l(()=>P(void 0,s)),F(d,on(a)),r.set(n,d));else{f=d.v!==t;var h=l(()=>on(a));F(d,h)}var g=Reflect.getOwnPropertyDescriptor(e,n);if(g?.set&&g.set.call(c,a),!f){if(i&&typeof n==`string`){var _=r.get(`length`),v=Number(n);Number.isInteger(v)&&v>=_.v&&F(_,v+1)}rn(o)}return!0},ownKeys(e){B(o);var n=Reflect.ownKeys(e).filter(e=>{var n=r.get(e);return n===void 0||n.v!==t});for(var[i,a]of r)a.v!==t&&!(i in e)&&n.push(i);return n},setPrototypeOf(){Te()}})}function sn(e){try{if(typeof e==`object`&&e&&se in e)return e[se]}catch{}return e}function cn(e,t){return Object.is(sn(e),sn(t))}var ln,un,dn,fn;function pn(){if(ln===void 0){ln=window,un=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;dn=u(t,`firstChild`).get,fn=u(t,`nextSibling`).get,h(e)&&(e[ue]=void 0,e[le]=null,e[de]=void 0,e.__e=void 0),h(n)&&(n[fe]=void 0)}}function mn(e=``){return document.createTextNode(e)}function hn(e){return dn.call(e)}function gn(e){return fn.call(e)}function I(e,t){if(!Me)return hn(e);var n=hn(Pe);if(n===null)n=Pe.appendChild(mn());else if(t&&n.nodeType!==3){var r=mn();return n?.before(r),Fe(r),r}return t&&bn(n),Fe(n),n}function L(e,t=!1){if(!Me){var n=hn(e);return n instanceof Comment&&n.data===``?gn(n):n}if(t){if(Pe?.nodeType!==3){var r=mn();return Pe?.before(r),Fe(r),r}bn(Pe)}return Pe}function R(e,t=1,n=!1){let r=Me?Pe:e;for(var i;t--;)i=r,r=gn(r);if(!Me)return r;if(n){if(r?.nodeType!==3){var a=mn();return r===null?i?.after(a):r.before(a),Fe(a),a}bn(r)}return Fe(r),r}function _n(e){e.textContent=``}function vn(){return!He||Ut!==null?!1:(ar.f&T)!==0}function yn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function bn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function xn(e,t){if(t){let t=document.body;e.autofocus=!0,$e(()=>{document.activeElement===t&&e.focus()})}}function Sn(e){Me&&hn(e)!==null&&_n(e)}var Cn=!1;function wn(){Cn||(Cn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[pe]?.()})},{capture:!0}))}function Tn(e){var t=nr,n=ar;ir(null),or(null);try{return e()}finally{ir(t),or(n)}}function En(e,t,n,r=n){e.addEventListener(t,()=>Tn(n));let i=e[pe];i?e[pe]=()=>{i(),r(!0)}:e[pe]=()=>r(!0),wn()}function Dn(e){ar===null&&(nr===null&&xe(e),be()),er&&ye(e)}function On(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function kn(e,t){var n=ar;n!==null&&n.f&8192&&(e|=C);var r={ctx:We,deps:null,nodes:null,f:e|x|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};At?.register_created_effect(r);var i=r;if(e&4)It===null?Bt.ensure().schedule(r):It.push(r);else if(t!==null){try{Cr(r)}catch(e){throw Wn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=E))}if(i!==null&&(i.parent=n,n!==null&&On(i,n),nr!==null&&nr.f&2&&!(e&64))){var a=nr;(a.effects??=[]).push(i)}return r}function An(){return nr!==null&&!rr}function jn(e){let t=kn(8,null);return it(t,b),t.teardown=e,t}function Mn(e){Dn(`$effect`);var t=ar.f;if(!nr&&t&32&&We!==null&&!We.i){var n=We;(n.e??=[]).push(e)}else return Nn(e)}function Nn(e){return kn(4|ne,e)}function Pn(e){Bt.ensure();let t=kn(64|te,e);return(e={})=>new Promise(n=>{e.outro?qn(t,()=>{Wn(t),n(void 0)}):(Wn(t),n(void 0))})}function Fn(e){return kn(4,e)}function In(e){return kn(D|te,e)}function Ln(e,t=0){return kn(8|t,e)}function z(e,t=[],n=[],r=[]){ht(r,t,n,t=>{kn(8,()=>{e(...t.map(B))})})}function Rn(e,t=0){return kn(16|t,e)}function zn(e,t=0){return kn(y|t,e)}function Bn(e){return kn(32|te,e)}function Vn(e){var t=e.teardown;if(t!==null){let e=er,n=nr;tr(!0),ir(null);try{t.call(null)}finally{tr(e),ir(n)}}}function Hn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Tn(()=>{e.abort(me)});var r=n.next;n.f&64?n.parent=null:Wn(n,t),n=r}}function Un(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Wn(t),t=n}}function Wn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Gn(e.nodes.start,e.nodes.end),n=!0),e.f|=ee,Hn(e,t&&!n),Sr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Vn(e),e.f^=ee,e.f|=w;var i=e.parent;i!==null&&i.first!==null&&Kn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Gn(e,t){for(;e!==null;){var n=e===t?null:gn(e);e.remove(),e=n}}function Kn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function qn(e,t,n=!0){var r=[];Jn(e,r,!0);var i=()=>{n&&Wn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Jn(e,t,n){if(!(e.f&8192)){e.f^=C;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Jn(i,t,o?n:!1)}i=a}}}function Yn(e){Xn(e,!0)}function Xn(e,t){if(e.f&8192){e.f^=C,e.f&1024||(it(e,x),Bt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Xn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Zn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:gn(n);t.append(n),n=i}}var Qn=null,$n=!1,er=!1;function tr(e){er=e}var nr=null,rr=!1;function ir(e){nr=e}var ar=null;function or(e){ar=e}var sr=null;function cr(e){nr!==null&&(!He||nr.f&2)&&(sr??=new Set).add(e)}var lr=null,ur=0,dr=null;function fr(e){dr=e}var pr=1,mr=0,hr=mr;function gr(e){hr=e}function _r(){return++pr}function vr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ie),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(vr(a)&&Tt(a),a.wv>e.wv)return!0}t&512&&Mt===null&&it(e,b)}return!1}function yr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!He&&sr!==null&&sr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?yr(a,t,!1):t===a&&(n?it(a,x):a.f&1024&&it(a,S),qt(a))}}function br(e){var t=lr,n=ur,r=dr,i=nr,a=sr,o=We,s=rr,c=hr,l=e.f;lr=null,ur=0,dr=null,nr=l&96?null:e,sr=null,Ge(e.ctx),rr=!1,hr=++mr,e.ac!==null&&(Tn(()=>{e.ac.abort(me)}),e.ac=null);try{e.f|=ae;var u=e.fn,d=u();e.f|=T;var f=e.deps,p=At?.is_fork;if(lr!==null){var m;if(p||Sr(e,ur),f!==null&&ur>0)for(f.length=ur+lr.length,m=0;m<lr.length;m++)f[ur+m]=lr[m];else e.deps=f=lr;if(An()&&e.f&512)for(m=ur;m<f.length;m++)(f[m].reactions??=[]).push(e)}else!p&&f!==null&&ur<f.length&&(Sr(e,ur),f.length=ur);if(Je()&&dr!==null&&!rr&&f!==null&&!(e.f&6146))for(m=0;m<dr.length;m++)yr(dr[m],e);if(i!==null&&i!==e){if(mr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=mr;if(t!==null)for(let e of t)e.rv=mr;dr!==null&&(r===null?r=dr:r.push(...dr))}return e.f&8388608&&(e.f^=oe),d}catch(e){return tt(e)}finally{e.f^=ae,lr=t,ur=n,dr=r,nr=i,sr=a,Ge(o),rr=s,hr=c}}function xr(e,n){let r=n.reactions;if(r!==null){var i=o.call(r,e);if(i!==-1){var a=r.length-1;a===0?r=n.reactions=null:(r[i]=r[a],r.pop())}}if(r===null&&n.f&2&&(lr===null||!s.call(lr,n))){var c=n;c.f&512&&(c.f^=512,c.f&=~ie),c.v!==t&&at(c),Et(c),Sr(c,0)}}function Sr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)xr(e,n[r])}function Cr(e){var t=e.f;if(!(t&16384)){it(e,b);var n=ar,r=$n;ar=e,$n=!0;try{t&16777232?Un(e):Hn(e),Vn(e);var i=br(e);e.teardown=typeof i==`function`?i:null,e.wv=pr}finally{$n=r,ar=n}}}async function wr(){if(He)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Vt()}function B(e){var t=(e.f&2)!=0;if(Qn?.add(e),nr!==null&&!rr&&!(ar!==null&&ar.f&16384)&&(sr===null||!sr.has(e))){var n=nr.deps;if(nr.f&2097152)e.rv<mr&&(e.rv=mr,lr===null&&n!==null&&n[ur]===e?ur++:lr===null?lr=[e]:lr.push(e));else{nr.deps??=[],s.call(nr.deps,e)||nr.deps.push(e);var r=e.reactions;r===null?e.reactions=[nr]:s.call(r,nr)||r.push(nr)}}if(er&&Zt.has(e))return Zt.get(e);if(t){var i=e;if(er){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Er(i))&&(a=wt(i)),Zt.set(i,a),a}var o=(i.f&512)==0&&!rr&&nr!==null&&($n||(nr.f&512)!=0),c=(i.f&T)===0;vr(i)&&(o&&(i.f|=512),Tt(i)),o&&!c&&(Dt(i),Tr(i))}if(Mt?.has(e))return Mt.get(e);if(e.f&8388608)throw e.v;return e.v}function Tr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Dt(t),Tr(t))}function Er(e){if(e.v===t)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Zt.has(t)||t.f&2&&Er(t))return!0;return!1}function Dr(e){var t=rr;try{return rr=!0,e()}finally{rr=t}}function Or(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(se in e)kr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&se in n&&kr(n)}}}function kr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{kr(e[n],t)}catch{}let n=m(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=d(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}var Ar=Symbol(`events`),jr=new Set,Mr=new Set;function Nr(e,t,n,r={}){function i(e){if(r.capture||Rr.call(t,e),!e.cancelBubble)return Tn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?$e(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Pr(e,t,n,r,i){var a={capture:r,passive:i},o=Nr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&jn(()=>{t.removeEventListener(e,o,a)})}function Fr(e,t,n){(t[Ar]??={})[e]=n}function Ir(e){for(var t=0;t<e.length;t++)jr.add(e[t]);for(var n of Mr)n(e)}var Lr=null;function Rr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Lr=e;var o=0,s=Lr===e&&e[Ar];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Ar]=t;return}var u=i.indexOf(t);if(u===-1)return;c<=u&&(o=c)}if(a=i[o]||e.target,a!==t){l(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=nr,f=ar;ir(null),or(null);try{for(var p,m=[];a!==null&&a!==t;){try{var h=a[Ar]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Ar]=t,delete e.currentTarget,ir(d),or(f)}}}var zr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Br(e){return zr?.createHTML(e)??e}function Vr(e){var t=yn(`template`);return t.innerHTML=Br(e.replaceAll(`<!>`,`<!---->`)),t.content}function Hr(e,t){var n=ar;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(Me)return Hr(Pe,null),Pe;i===void 0&&(i=Vr(a?e:`<!>`+e),n||(i=hn(i)));var t=r||un?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=hn(t),s=t.lastChild;Hr(o,s)}else Hr(t,t);return t}}function Ur(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(Me)return Hr(Pe,null),Pe;if(!o){var e=hn(Vr(a));if(i)for(o=document.createDocumentFragment();hn(e);)o.appendChild(hn(e));else o=hn(e)}var t=o.cloneNode(!0);if(i){var n=hn(t),r=t.lastChild;Hr(n,r)}else Hr(t,t);return t}}function H(e,t){return Ur(e,t,`svg`)}function U(e=``){if(!Me){var t=mn(e+``);return Hr(t,t),t}var n=Pe;return n.nodeType===3?bn(n):(n.before(n=mn()),Fe(n)),Hr(n,n),n}function W(){if(Me)return Hr(Pe,null),Pe;var e=document.createDocumentFragment(),t=document.createComment(``),n=mn();return e.append(t,n),Hr(t,n),e}function G(e,t){if(Me){var n=ar;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=Pe),Ie();return}e!==null&&e.before(t)}function Wr(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var Gr=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function Kr(e){return Gr.includes(e)}var qr=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),Jr={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function Yr(e){return e=e.toLowerCase(),Jr[e]??e}[...qr];var Xr=[`touchstart`,`touchmove`];function Zr(e){return Xr.includes(e)}function K(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[fe]??=e.nodeValue)&&(e[fe]=n,e.nodeValue=`${n}`)}function Qr(e,t){return ei(e,t)}var $r=new Map;function ei(t,{target:n,anchor:r,props:i={},events:a,context:o,intro:s=!0,transformError:l}){pn();var u=void 0,d=Pn(()=>{var s=r??n.appendChild(mn());pt(s,{pending:()=>{}},n=>{j({});var r=We;if(o&&(r.c=o),a&&(i.$$events=a),Me&&Hr(n,null),u=t(n,i)||{},Me&&(ar.nodes.end=Pe,Pe===null||Pe.nodeType!==8||Pe.data!==`]`))throw ke(),e;M()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=Zr(r);for(let e of[n,document]){var a=$r.get(e);a===void 0&&(a=new Map,$r.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Rr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(c(jr)),Mr.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=$r.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,Rr),t.delete(e),t.size===0&&$r.delete(r)):t.set(e,i)}Mr.delete(f),s!==r&&s.parentNode?.removeChild(s)}});return ti.set(u,d),u}var ti=new WeakMap,ni=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Yn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Yn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Wn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Zn(r,t),t.append(mn()),this.#n.set(e,{effect:r,fragment:t})}else Wn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),qn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Wn(n.effect),this.#n.delete(e))};ensure(e,t){var n=At,r=vn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=mn();i.append(a),this.#n.set(e,{effect:Bn(()=>t(a)),fragment:i})}else this.#t.set(e,Bn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Me&&(this.anchor=Pe),this.#a(n)}};function ri(e,t,...n){var r=new ni(e);Rn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},E)}function ii(e){We===null&&ge(`onMount`),Ue&&We.l!==null?ai(We).m.push(e):Mn(()=>{let t=Dr(e);if(typeof t==`function`)return t})}function ai(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function q(e,t,n=!1){var r;Me&&(r=Pe,Ie());var i=new ni(e),a=n?E:0;function o(e,t){if(Me){var n=Re(r);if(e!==parseInt(n.substring(1))){var a=Le();Fe(a),i.anchor=a,Ne(!1),i.ensure(e,t),Ne(!0);return}}i.ensure(e,t)}Rn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var oi=Symbol(`NaN`);function si(e,t,n){Me&&Ie();var r=new ni(e),i=!Je();Rn(()=>{var e=t();e!==e&&(e=oi),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function ci(e,t){return t}function li(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];qn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;ui(e,c(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var u=n,d=u.parentNode;_n(d),d.append(u),e.items.clear()}ui(e,t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function ui(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=re,Zn(a,document.createDocumentFragment())):Wn(t[i],n)}}var di;function fi(e,t,n,r,i,o=null){var s=e,l=new Map;if(t&4){var u=e;s=Me?Fe(hn(u)):u.appendChild(mn())}Me&&Ie();var d=null,f=St(()=>{var e=n();return a(e)?e:e==null?[]:c(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,mi(v,p,s,t,r),d!==null&&(p.length===0?d.f&33554432?(d.f^=re,gi(d,null,s)):Yn(d):qn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Rn(()=>{p=B(f);var e=p.length;let a=!1;Me&&Re(s)===`[!`!=(e===0)&&(s=Le(),Fe(s),Ne(!1),a=!0);for(var c=new Set,u=At,v=vn(),y=0;y<e;y+=1){Me&&Pe.nodeType===8&&Pe.data===`]`&&(s=Pe,a=!0,Ne(!1));var b=p[y],x=r(b,y),S=h?null:l.get(x);S?(S.v&&tn(S.v,b),S.i&&tn(S.i,y),v&&u.unskip_effect(S.e)):(S=hi(l,h?s:di??=mn(),b,x,y,i,t,n),h||(S.e.f|=re),l.set(x,S)),c.add(x)}if(e===0&&o&&!d&&(h?d=Bn(()=>o(s)):(d=Bn(()=>o(di??=mn())),d.f|=re)),e>c.size&&ve(``,``,``),Me&&e>0&&Fe(Le()),!h)if(m.set(u,c),v){for(let[e,t]of l)c.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);a&&Ne(!0),B(f)}),flags:t,items:l,pending:m,outrogroups:null,fallback:d};h=!1,Me&&(s=Pe)}function pi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function mi(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,l=pi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),_=s.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),_=s.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Yn(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=re,_===l)gi(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),_i(e,d,_),_i(e,_,y),gi(_,y,n),d=_,p=[],m=[],l=pi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)gi(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);_i(e,S.prev,C.next),_i(e,d,S),_i(e,C,b),l=b,d=C,--v,p=[],m=[]}else u.delete(_),gi(_,l,n),_i(e,_.prev,_.next),_i(e,_,d===null?e.effect.first:d.next),_i(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=pi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=pi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(ui(e,c(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var w=[];if(u!==void 0)for(_ of u)_.f&8192||w.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&w.push(l),l=pi(l.next);var T=w.length;if(T>0){var ee=r&4&&o===0?n:null;if(a){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}li(e,w,ee)}}a&&$e(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function hi(e,t,n,r,i,a,o,s){var c=o&1?o&16?$t(n):en(n,!1,!1):null,l=o&2?$t(i):null;return{v:c,i:l,e:Bn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function gi(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=gn(r);if(a.before(r),r===i)return;r=o}}function _i(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function vi(t,n,a=!1,o=!1,s=!1,c=!1){var l=t,u=``;if(a){var d=t;Me&&(l=Fe(hn(d)))}z(()=>{var t=ar;if(u===(u=n()??``)){Me&&Ie();return}if(a&&!Me){t.nodes=null,d.innerHTML=u,u!==``&&Hr(hn(d),d.lastChild);return}if(t.nodes!==null&&(Gn(t.nodes.start,t.nodes.end),t.nodes=null),u!==``){if(Me){for(var c=Pe.data,f=Ie(),p=f;f!==null&&(f.nodeType!==8||f.data!==``);)p=f,f=gn(f);if(f===null)throw ke(),e;Hr(Pe,p),l=Fe(f);return}var m=yn(o?`svg`:s?`math`:`template`,o?r:s?i:void 0);m.innerHTML=u;var h=o||s?m:m.content;if(Hr(hn(h),h.lastChild),o||s)for(;hn(h);)l.before(hn(h));else l.before(h)}})}function yi(e,t,n){var r;Me&&(r=Pe,Ie());var i=new ni(e);Rn(()=>{var e=t()??null;if(Me&&Re(r)===`[`!=(e!==null)){var a=Le();Fe(a),i.anchor=a,Ne(!1),i.ensure(e,e&&(t=>n(t,e))),Ne(!0);return}i.ensure(e,e&&(t=>n(t,e)))},E)}function bi(e,t,n){Fn(()=>{var r=Dr(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};Ln(()=>{var e=n();Or(e),i&&Be(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function xi(e,t){var n=void 0,r;zn(()=>{n!==(n=t())&&(r&&=(Wn(r),null),n&&(r=Bn(()=>{Fn(()=>n(e))})))})}function Si(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Si(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ci(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Si(e))&&(r&&(r+=` `),r+=t);return r}function wi(e){return typeof e==`object`?Ci(e):e??``}var Ti=[...`
|
|
2
|
+
\r\f\xA0\v`];function Ei(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Ti.includes(r[o-1]))&&(s===r.length||Ti.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Di(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Oi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function ki(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Oi)),i&&c.push(...Object.keys(i).map(Oi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Oi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Di(r)),i&&(n+=Di(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ai(e,t,n,r,i,a){var o=e[ue];if(Me||o!==n||o===void 0){var s=Ei(n,r,a);(!Me||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[ue]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ji(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Mi(e,t,n,r){var i=e[de];if(Me||i!==t){var a=ki(t,r);(!Me||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[de]=t}else r&&(Array.isArray(r)?(ji(e,n?.[0],r[0]),ji(e,n?.[1],r[1],`important`)):ji(e,n,r));return r}function Ni(e,t,n=!1){if(e.multiple){if(t==null)return;if(!a(t))return Ae();for(var r of e.options)r.selected=t.includes(Ii(r));return}for(r of e.options)if(cn(Ii(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Pi(e){var t=new MutationObserver(()=>{Ni(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),jn(()=>{t.disconnect()})}function Fi(e,t,n=t){var r=new WeakSet,i=!0;En(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),Ii);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&Ii(o)}n(a),e.__value=a,At!==null&&r.add(At)}),Fn(()=>{var a=t();if(e===document.activeElement){var o=He?jt:At;if(r.has(o))return}if(Ni(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=Ii(s),n(a))}e.__value=a,i=!1}),Pi(e)}function Ii(e){return`__value`in e?e.__value:e.value}var Li=Symbol(`class`),Ri=Symbol(`style`),zi=Symbol(`is custom element`),Bi=Symbol(`is html`),Vi=he?`link`:`LINK`,Hi=he?`input`:`INPUT`,Ui=he?`option`:`OPTION`,Wi=he?`select`:`SELECT`;function Gi(e){if(Me){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Ji(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Ji(e,`checked`,null),e.checked=r}}};e[pe]=n,$e(n),wn()}}function Ki(e,t){var n=Zi(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function qi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function Ji(e,t,n,r){var i=Zi(e);Me&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Vi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ce]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&$i(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Yi(e,n,r,i,a=!1,o=!1){if(Me&&a&&e.nodeName===Hi){var s=e;(s.type===`checkbox`?`defaultChecked`:`defaultValue`)in r||Gi(s)}var c=Zi(e),l=c[zi],u=!c[Bi];let d=Me&&l;d&&Ne(!1);var f=n||{},p=e.nodeName===Ui;for(var m in n)m in r||(r[m]=null);r.class?r.class=wi(r.class):(i||r[Li])&&(r.class=null),r[Ri]&&(r.style??=null);var h=$i(e);if(e.nodeName===Hi&&`type`in r&&(`value`in r||`__value`in r)){var g=r.type;(g!==f.type||g===void 0&&e.hasAttribute(`type`))&&(f.type=g,Ji(e,`type`,g,o))}for(let a in r){let s=r[a];if(p&&a===`value`&&s==null){e.value=e.__value=``,f[a]=s;continue}if(a===`class`){Ai(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,s,i,n?.[Li],r[Li]),f[a]=s,f[Li]=r[Li];continue}if(a===`style`){Mi(e,s,n?.[Ri],r[Ri]),f[a]=s,f[Ri]=r[Ri];continue}var _=f[a];if(!(s===_&&!(s===void 0&&e.hasAttribute(a)))){f[a]=s;var v=a[0]+a[1];if(v!==`$$`)if(v===`on`){let t={},n=`$$`+a,r=a.slice(2);var y=Kr(r);if(Wr(r)&&(r=r.slice(0,-7),t.capture=!0),!y&&_){if(s!=null)continue;e.removeEventListener(r,f[n],t),f[n]=null}if(y)Fr(r,e,s),Ir([r]);else if(s!=null){function i(e){f[a].call(this,e)}f[n]=Nr(r,e,i,t)}}else if(a===`style`)Ji(e,a,s);else if(a===`autofocus`)xn(e,!!s);else if(!l&&(a===`__value`||a===`value`&&s!=null))e.value=e.__value=s;else if(a===`selected`&&p)qi(e,s);else{var b=a;u||(b=Yr(b));var x=b===`defaultValue`||b===`defaultChecked`;if(s==null&&!l&&!x)if(c[a]=null,b===`value`||b===`checked`){let t=e,r=n===void 0;if(b===`value`){let e=t.defaultValue;t.removeAttribute(b),t.defaultValue=e,t.value=t.__value=r?e:null}else{let e=t.defaultChecked;t.removeAttribute(b),t.defaultChecked=e,t.checked=r?e:!1}}else e.removeAttribute(a);else x||h.includes(b)&&(l||typeof s!=`string`)?(e[b]=s,b in c&&(c[b]=t)):typeof s!=`function`&&Ji(e,b,s,o)}}}return d&&Ne(!0),f}function Xi(e,t,n=[],r=[],i=[],a,o=!1,s=!1){ht(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Wi,l=!1;if(zn(()=>{var u=t(...n.map(B)),d=Yi(e,r,u,a,o,s);l&&c&&`value`in u&&Ni(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||Wn(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&Wn(i[t]),i[t]=Bn(()=>xi(e,()=>f))),d[t]=f}r=d}),c){var u=e;Fn(()=>{Ni(u,r.value,!0),Pi(u)})}l=!0})}function Zi(e){return e[le]??={[zi]:e.nodeName.includes(`-`),[Bi]:e.namespaceURI===n}}var Qi=new Map;function $i(e){var t=e.getAttribute(`is`)||e.nodeName,n=Qi.get(t);if(n)return n;Qi.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=d(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=m(i)}return n}function ea(e,t,n=t){var r=new WeakSet;En(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=na(e)?ra(a):a,n(a),At!==null&&r.add(At),await wr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Me&&e.defaultValue!==e.value||Dr(t)==null&&e.value)&&(n(na(e)?ra(e.value):e.value),At!==null&&r.add(At)),Ln(()=>{var n=t();if(e===document.activeElement){var i=He?jt:At;if(r.has(i))return}na(e)&&n===ra(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function ta(e,t,n=t){En(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(Me&&e.defaultChecked!==e.checked||Dr(t)==null)&&n(e.checked),Ln(()=>{e.checked=!!t()})}function na(e){var t=e.type;return t===`number`||t===`range`}function ra(e){return e===``?null:+e}function ia(e,t){return e===t||e?.[se]===t}function aa(e={},t,n,r){var i=We.r,a=ar;return Fn(()=>{var o,s;return Ln(()=>{o=s,s=r?.()||[],Dr(()=>{ia(n(...s),e)||(t(e,...s),o&&ia(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ia(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var oa={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function sa(e,t,n){return new Proxy({props:e,exclude:t},oa)}function ca(e,t,n,r){var i=!Ue||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=void 0,d=()=>o&&i?(l??=yt(r),B(l)):(c&&(c=!1,s=o?Dr(r):r),s);let f;if(a){var p=se in e||O in e;f=u(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;a?[m,h]=ut(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Ce(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?yt:St)(()=>(v=!1,g()));a&&B(y);var b=ar;return(function(e,t){if(arguments.length>0){let n=t?B(y):i&&a?on(e):e;return F(y,n),v=!0,s!==void 0&&(s=n),e}return er&&v||b.f&16384?y.v:B(y)})}var la={RUNNING:`running`,WAITING_HUMAN:`waiting_human`,COMPLETED:`completed`,FAILED:`failed`,ABORTED:`aborted`,INTERRUPTED:`interrupted`},ua=class extends Error{code;constructor(e,t){super(t),this.name=`RpcError`,this.code=e}},da=12e4,fa=3e4,pa=1e3;function ma(e){let t=null,n=!1,r=!1,i=0,a=``,o=``,s=new Map,c=new Set,l=new Set,u=new Set,d=0;function f(e){n=e;for(let t of l)t(e)}function p(){for(let e of u)e()}async function m(){if(r)return;if(e){let t;try{t=await e(o)}catch{t=`offline`}if(r)return;if(t===`invalid`){r=!0,p();return}if(t===`offline`){h();return}}let n=a.includes(`?`)?`&`:`?`,l=`${a}${n}token=${o}`,u=new WebSocket(l);u.onopen=()=>{i=0,f(!0)},u.onmessage=e=>{try{let t=JSON.parse(e.data);if(`event`in t){let e=t;for(let t of c)t(e.event,e.payload);return}if(`id`in t){let e=t,n=s.get(e.id);if(!n)return;s.delete(e.id),clearTimeout(n.timer),e.ok?n.resolve(e.payload):n.reject(new ua(e.error.code,e.error.message))}}catch{}},u.onclose=()=>{t=null,f(!1);for(let[e,t]of s)clearTimeout(t.timer),t.reject(Error(`Connection closed`)),s.delete(e);r||h()},u.onerror=()=>{},t=u}function h(){if(r)return;i++;let e=Math.min(pa*1.5**i,fa);setTimeout(()=>{r||m()},e)}return{get isConnected(){return n},connect(e,t){a=e,o=t,r=!1,i=0,m()},disconnect(){r=!0,t&&=(t.close(),null),f(!1)},request(e,n){return new Promise((r,i)=>{if(!t||t.readyState!==WebSocket.OPEN){i(Error(`Not connected`));return}let a=`req-${++d}`,o=setTimeout(()=>{s.delete(a),i(Error(`Request timed out`))},da);s.set(a,{resolve:r,reject:i,timer:o});let c={id:a,method:e,params:n??{}};t.send(JSON.stringify(c))})},onEvent(e){return c.add(e),()=>c.delete(e)},onConnectionChange(e){return l.add(e),()=>l.delete(e)},onAuthError(e){return u.add(e),()=>u.delete(e)}}}var ha=new Set([la.COMPLETED,la.FAILED,la.ABORTED]);function ga(e){return ha.has(e)}function _a(e,t=50){let n=0,r;for(let t of e.values())ga(t.phase)&&(n++,(!r||t.startedAt<r.startedAt)&&(r=t));if(n<=t||!r)return new Map(e);let i=new Map(e);return i.delete(r.workflowId),i}function va(e){if(e===void 0)return;let t=Number.parseFloat(e);return Number.isFinite(t)?t:void 0}function ya(e,t){for(let n of e.values())if(n.workflowId===t)return!0;return!1}function ba(e,t){let n=t;switch(e){case`daemon.status`:return{event:e,payload:n};case`session.created`:case`session.updated`:return{event:e,payload:n};case`session.ended`:return{event:e,payload:n};case`session.thinking`:return{event:e,payload:n};case`session.tool_call`:return{event:e,payload:n};case`session.output`:return{event:e,payload:n};case`session.budget_update`:return{event:e,payload:n};case`escalation.created`:return{event:e,payload:n};case`escalation.resolved`:return{event:e,payload:n};case`escalation.expired`:return{event:e,payload:n};case`job.list_changed`:case`job.completed`:case`job.failed`:case`job.started`:return{event:e,payload:n};case`workflow.started`:return{event:e,payload:n};case`workflow.state_entered`:return{event:e,payload:n};case`workflow.agent_started`:return{event:e,payload:n};case`workflow.agent_completed`:return{event:e,payload:n};case`workflow.agent_session_ended`:return{event:e,payload:n};case`workflow.completed`:return{event:e,payload:n};case`workflow.failed`:return{event:e,payload:n};case`workflow.gate_raised`:return{event:e,payload:n};case`workflow.gate_dismissed`:return{event:e,payload:n};case`persona.compile.started`:return{event:e,payload:n};case`persona.compile.progress`:return{event:e,payload:n};case`persona.compile.done`:return{event:e,payload:n};case`persona.compile.failed`:return{event:e,payload:n};case`personas.changed`:return{event:e,payload:{}};case`config.changed`:return{event:e,payload:{}};case`session.pty_output`:return{event:e,payload:n};case`session.pty_replay`:return{event:e,payload:n};default:return}}function xa(e,t,n,r){let i=ba(n,r);return i?wa(e,t,i):!1}function Sa(e,t,n){return e??{operationId:t,name:n,phase:`running`,startedAt:new Date().toISOString(),actor:`unknown`}}function Ca(e,t,n){e.personaCompiles=new Map(e.personaCompiles).set(t,n)}function wa(e,t,n){switch(n.event){case`daemon.status`:return e.daemonStatus=n.payload,!0;case`session.created`:case`session.updated`:{let t=n.payload;return e.sessions=new Map(e.sessions).set(t.label,t),!0}case`session.ended`:{let{label:t}=n.payload,r=new Map(e.sessions);return r.delete(t),e.sessions=r,e.removeOutput(t),e.selectedSessionLabel===t&&(e.selectedSessionLabel=null),!0}case`session.thinking`:{let{label:t}=n.payload,r=e.sessions.get(t);return r&&(e.sessions=new Map(e.sessions).set(t,{...r,status:`processing`})),e.addOutput(t,{kind:`thinking`,text:`Thinking...`,timestamp:new Date().toISOString()}),!0}case`session.tool_call`:{let{label:t,toolName:r,preview:i}=n.payload;return e.addOutput(t,{kind:`tool_call`,text:`${r}: ${i}`,timestamp:new Date().toISOString()}),!0}case`session.output`:{let{label:t,text:r}=n.payload;return e.addOutput(t,{kind:`assistant`,text:r,timestamp:new Date().toISOString()}),!0}case`session.budget_update`:{let{label:t,budget:r}=n.payload,i=e.sessions.get(t);return i&&(e.sessions=new Map(e.sessions).set(t,{...i,budget:r})),!0}case`escalation.created`:{let r=n.payload,i=t.assignDisplayNumber(r.escalationId),a={...r,displayNumber:i};return e.pendingEscalations=new Map(e.pendingEscalations).set(r.escalationId,a),e.addOutput(r.sessionLabel,{kind:`escalation`,text:`Pending escalation: ${r.serverName}/${r.toolName}`,timestamp:r.receivedAt,escalationId:r.escalationId}),!0}case`escalation.resolved`:case`escalation.expired`:{let{escalationId:t}=n.payload,r=e.pendingEscalations.get(t);if(r){let n=new Map(e.pendingEscalations);n.delete(t),e.pendingEscalations=n,e.filterOutput(r.sessionLabel,e=>e.escalationId!==t)}return!0}case`job.list_changed`:case`job.completed`:case`job.failed`:case`job.started`:return t.refreshJobs(),!0;case`workflow.started`:{let{workflowId:t,name:r,taskDescription:i}=n.payload,a={workflowId:t,name:r,phase:la.RUNNING,currentState:`starting...`,startedAt:new Date().toISOString(),taskDescription:i,round:0,maxRounds:0,totalTokens:0};return e.workflows=new Map(e.workflows).set(t,a),!0}case`workflow.state_entered`:{let{workflowId:t,state:r}=n.payload,i=e.workflows.get(t);if(!i)return!0;let a=ya(e.pendingGates,t)?la.WAITING_HUMAN:la.RUNNING,o={...i,currentState:r,phase:a};return e.workflows=new Map(e.workflows).set(t,o),!0}case`workflow.agent_started`:case`workflow.agent_session_ended`:return!0;case`workflow.agent_completed`:{let{workflowId:t,stateId:r,verdict:i,confidence:a}=n.payload,o=e.workflows.get(t);if(!o||i===void 0)return!0;let s={stateId:r,verdict:i,confidence:va(a)};return e.workflows=new Map(e.workflows).set(t,{...o,latestVerdict:s}),!0}case`workflow.completed`:{let{workflowId:t}=n.payload,r=e.workflows.get(t);if(!r)return!0;e.workflows=_a(new Map(e.workflows).set(t,{...r,phase:la.COMPLETED}));let i=new Map(e.pendingGates);for(let[e,n]of i)n.workflowId===t&&i.delete(e);return e.pendingGates=i,!0}case`workflow.failed`:{let{workflowId:t,error:r}=n.payload,i=e.workflows.get(t);return i&&(e.workflows=_a(new Map(e.workflows).set(t,{...i,phase:la.FAILED,error:r}))),!0}case`workflow.gate_raised`:{let{workflowId:t,gate:r}=n.payload;e.pendingGates=new Map(e.pendingGates).set(r.gateId,r);let i=e.workflows.get(t);return i&&(e.workflows=new Map(e.workflows).set(t,{...i,phase:la.WAITING_HUMAN,currentState:r.stateName})),!0}case`workflow.gate_dismissed`:{let{workflowId:t,gateId:r}=n.payload,i=new Map(e.pendingGates);i.delete(r),e.pendingGates=i;let a=e.workflows.get(t);return a&&a.phase===la.WAITING_HUMAN&&!ya(i,t)&&(e.workflows=new Map(e.workflows).set(t,{...a,phase:la.RUNNING})),!0}case`persona.compile.started`:{let{name:t,operationId:r,actor:i}=n.payload;return Ca(e,r,{operationId:r,name:t,phase:`started`,startedAt:new Date().toISOString(),actor:i}),!0}case`persona.compile.progress`:{let{name:t,operationId:r,serverName:i,phase:a,detail:o}=n.payload;return Ca(e,r,{...Sa(e.personaCompiles.get(r),r,t),phase:`running`,serverProgress:{server:i,compilationPhase:a,...o===void 0?{}:{detail:o}}}),!0}case`persona.compile.done`:{let{name:t,operationId:r,result:i}=n.payload;return Ca(e,r,{...Sa(e.personaCompiles.get(r),r,t),phase:`done`,endedAt:new Date().toISOString(),result:i}),!0}case`persona.compile.failed`:{let{name:t,operationId:r,code:i,error:a}=n.payload;return Ca(e,r,{...Sa(e.personaCompiles.get(r),r,t),phase:`failed`,endedAt:new Date().toISOString(),error:{code:i,message:a}}),!0}case`personas.changed`:return t.refreshPersonas(),!0;case`config.changed`:return t.refreshConfig(),!0;case`session.pty_output`:{let{label:e,data:r}=n.payload;return t.getPtySink(e)?.write(r),!0}case`session.pty_replay`:{let{label:e,snapshot:r}=n.payload;return t.getPtySink(e)?.reset(r),!0}default:return!1}}var Ta=2e3,Ea=`ic-theme`,Da=`ic-auth-token`,Oa=new Set([`iron`,`daylight`,`midnight`]);function ka(){let e=localStorage.getItem(Ea);return e&&Oa.has(e)?e:`iron`}function Aa(e){localStorage.setItem(Ea,e),document.documentElement.setAttribute(`data-theme`,e)}var J=new class{#e=P(!1);get connected(){return B(this.#e)}set connected(e){F(this.#e,e,!0)}#t=P(!1);get hasToken(){return B(this.#t)}set hasToken(e){F(this.#t,e,!0)}#n=P(null);get authError(){return B(this.#n)}set authError(e){F(this.#n,e,!0)}#r=P(null);get daemonStatus(){return B(this.#r)}set daemonStatus(e){F(this.#r,e,!0)}#i=P(on(new Map));get sessions(){return B(this.#i)}set sessions(e){F(this.#i,e,!0)}#a=P(null);get selectedSessionLabel(){return B(this.#a)}set selectedSessionLabel(e){F(this.#a,e,!0)}#o=P(on(new Map));get pendingEscalations(){return B(this.#o)}set pendingEscalations(e){F(this.#o,e,!0)}#s=P(0);get escalationDisplayNumber(){return B(this.#s)}set escalationDisplayNumber(e){F(this.#s,e,!0)}#c=P(0);get escalationDismissedAt(){return B(this.#c)}set escalationDismissedAt(e){F(this.#c,e,!0)}#l=P(on([]));get jobs(){return B(this.#l)}set jobs(e){F(this.#l,e,!0)}#u=P(on(new Map));get sessionOutputs(){return B(this.#u)}set sessionOutputs(e){F(this.#u,e,!0)}#d=P(`dashboard`);get currentView(){return B(this.#d)}set currentView(e){F(this.#d,e,!0)}#f=P(on(new Map));get workflows(){return B(this.#f)}set workflows(e){F(this.#f,e,!0)}#p=P(null);get selectedWorkflowId(){return B(this.#p)}set selectedWorkflowId(e){F(this.#p,e,!0)}#m=P(on(new Map));get pendingGates(){return B(this.#m)}set pendingGates(e){F(this.#m,e,!0)}#h=P(on(new Map));get personaCompiles(){return B(this.#h)}set personaCompiles(e){F(this.#h,e,!0)}get selectedSession(){return this.selectedSessionLabel===null?null:this.sessions.get(this.selectedSessionLabel)??null}get escalationCount(){return this.pendingEscalations.size}get activeSessionCount(){return this.sessions.size}addOutput(e,t){let n=this.sessionOutputs.get(e)??[];(t.kind===`tool_call`||t.kind===`assistant`||t.kind===`escalation`)&&(n=n.filter(e=>e.kind!==`thinking`)),n=[...n,t],n.length>Ta&&(n=n.slice(n.length-Ta)),this.sessionOutputs=new Map(this.sessionOutputs).set(e,n)}filterOutput(e,t){let n=this.sessionOutputs.get(e);if(!n)return;let r=n.filter(t);r.length!==n.length&&(this.sessionOutputs=new Map(this.sessionOutputs).set(e,r))}removeOutput(e){let t=new Map(this.sessionOutputs);t.delete(e),this.sessionOutputs=t}getOutput(e){return this.sessionOutputs.get(e)??[]}},ja=on({value:0}),Ma=on({value:0}),Na=on({value:0}),Pa=2*1024*1024,Fa=class{live=null;buffered=[];bufferedBytes=0;write(e){if(this.live){this.live.write(e);return}this.buffered.push({reset:!1,b64:e}),this.bufferedBytes+=e.length,this.capBuffer()}reset(e){if(this.live){this.live.reset(e);return}this.buffered=[{reset:!0,b64:e}],this.bufferedBytes=e.length}capBuffer(){for(;this.bufferedBytes>Pa&&this.buffered.length>1;){let e=this.buffered.shift();e&&(this.bufferedBytes-=e.b64.length)}}connect(e){this.live=e;for(let t of this.buffered)t.reset?e.reset(t.b64):e.write(t.b64);this.buffered=[],this.bufferedBytes=0}disconnect(){this.live=null}},Ia=new Map;function La(e){Ia.has(e)||Ia.set(e,new Fa)}function Ra(e){Ia.delete(e)}function za(e,t){let n=Ia.get(e);n||(n=new Fa,Ia.set(e,n)),n.connect(t)}function Ba(e){Ia.get(e)?.disconnect()}var Va=null;function Ha(){return Va||(Va=ma(Ua),Wa(Va)),Va}async function Ua(e,t=fetch){try{let n=await t(Xa(`/ws/auth?token=${encodeURIComponent(e)}`,{ws:!1}),{method:`GET`,cache:`no-store`});return n.status===200?`ok`:n.status===401?`invalid`:`offline`}catch{return`offline`}}function Wa(e){e.onConnectionChange(t=>{J.connected=t,t&&(J.authError=null,qa(e))}),e.onAuthError(()=>{Ga()}),e.onEvent((t,n)=>{xa(J,{refreshJobs:()=>Ya(e),refreshPersonas:()=>{Ma.value++},refreshConfig:()=>{Na.value++},assignDisplayNumber:e=>++J.escalationDisplayNumber,getPtySink:e=>Ia.get(e)},t,n)})}function Ga(){sessionStorage.removeItem(Da),J.hasToken=!1,J.authError=`invalid_token`}var Ka=!0;async function qa(e){try{let[t,n,r,i,a,o]=await Promise.all([e.request(`status`),e.request(`sessions.list`),e.request(`jobs.list`),e.request(`escalations.list`),e.request(`workflows.list`).catch(()=>[]),e.request(`personas.listCompiles`,{}).catch(()=>({active:[],recent:[],queueDepth:0}))]);J.daemonStatus=t;let s=new Map;for(let e of n)s.set(e.label,e);J.sessions=s,J.jobs=r;let c=new Map;for(let e of a)c.set(e.workflowId,e);J.workflows=c;let l=new Map;for(let e of o.recent)l.set(e.operationId,e);for(let e of o.active)l.set(e.operationId,e);J.personaCompiles=l;let u=new Map,d=a.filter(e=>e.phase===la.WAITING_HUMAN).map(async t=>{try{let n=await e.request(`workflows.get`,{workflowId:t.workflowId});n.gate&&u.set(n.gate.gateId,n.gate)}catch{}});await Promise.all(d);let f=new Map(J.pendingGates);for(let[e,t]of u)f.set(e,t);J.pendingGates=f,ja.value++;let p=new Map;for(let e of i){let t=++J.escalationDisplayNumber;p.set(e.escalationId,{...e,displayNumber:t})}J.pendingEscalations=p;for(let[e,t]of J.sessionOutputs){let n=t.filter(e=>e.kind!==`escalation`||e.escalationId&&p.has(e.escalationId));n.length!==t.length&&(J.sessionOutputs=new Map(J.sessionOutputs).set(e,n))}Ka&&=(J.escalationDismissedAt=J.escalationDisplayNumber,!1)}catch(e){console.error(`Failed to refresh state:`,e)}}var Ja=null;function Ya(e){Ja&&clearTimeout(Ja),Ja=setTimeout(async()=>{Ja=null;try{J.jobs=await e.request(`jobs.list`)}catch{}},300)}function Xa(e,t){let n=window.location.protocol===`https:`;return`${t.ws?n?`wss:`:`ws:`:n?`https:`:`http:`}//${window.location.host}${e}`}function Za(){return Xa(`/ws`,{ws:!0})}async function Qa(){let e=Ha(),t=new URLSearchParams(window.location.search).get(`token`);if(t){sessionStorage.setItem(Da,t);let e=new URL(window.location.href);e.searchParams.delete(`token`),window.history.replaceState({},``,e.toString())}else t=sessionStorage.getItem(Da);t&&await Ho(e,t)}async function $a(e,t,n){let r={escalationId:e,decision:t};t===`approved`&&n!=null&&(r.whitelistSelection=n),await Ha().request(`escalations.resolve`,r)}async function eo(e){let t={};return e?.persona&&(t.persona=e.persona),e?.workspacePath&&(t.workspacePath=e.workspacePath),e?.providerProfileName&&(t.providerProfileName=e.providerProfileName),e?.model&&(t.model=e.model),Ha().request(`sessions.create`,t)}async function to(e){await Ha().request(`sessions.end`,{label:e})}async function no(e){await Ha().request(`sessions.ptyAttach`,{label:e})}async function ro(e){await Ha().request(`sessions.ptyDetach`,{label:e})}async function io(e,t){await Ha().request(`sessions.ptyInput`,{label:e,data:t})}async function ao(e,t,n){await Ha().request(`sessions.ptyResize`,{label:e,cols:t,rows:n})}async function oo(e,t){await Ha().request(`sessions.ptyPrompt`,{label:e,text:t})}async function so(e){await Ha().request(`jobs.run`,{jobId:e})}async function co(e){await Ha().request(`jobs.enable`,{jobId:e})}async function lo(e){await Ha().request(`jobs.disable`,{jobId:e})}async function uo(e){await Ha().request(`jobs.remove`,{jobId:e})}async function fo(e){await Ha().request(`jobs.recompile`,{jobId:e})}async function po(){return Ha().request(`personas.list`)}async function mo(e){let t={name:e.name,description:e.description};return e.servers!==void 0&&(t.servers=e.servers),e.memoryEnabled!==void 0&&(t.memoryEnabled=e.memoryEnabled),e.constitution!==void 0&&(t.constitution=e.constitution),Ha().request(`personas.create`,t)}async function ho(e,t){return Ha().request(`personas.editConstitution`,{name:e,constitution:t})}async function go(e,t){return Ha().request(`personas.setMemory`,{name:e,enabled:t})}async function _o(e,t){return Ha().request(`personas.setBroadPolicyOptIn`,{name:e,enabled:t})}async function vo(e,t){let n={name:e,confirmed:!0};return t?.force&&(n.force=!0),Ha().request(`personas.delete`,n)}async function yo(){return Ha().request(`workflows.listDefinitions`)}async function bo(e){return Ha().request(`workflows.readme`,e)}async function xo(){return Ha().request(`workflows.list`)}async function So(e,t,n){let r={definitionPath:e,taskDescription:t};return n&&(r.workspacePath=n),Ha().request(`workflows.start`,r)}async function Co(e){await Ha().request(`workflows.abort`,{workflowId:e})}async function wo(e,t,n){let r={workflowId:e,event:t};n&&(r.prompt=n),await Ha().request(`workflows.resolveGate`,r)}async function To(){try{let e=await xo(),t=new Map;for(let n of e)t.set(n.workflowId,n);J.workflows=t}catch{}}async function Eo(e){return Ha().request(`workflows.get`,{workflowId:e})}async function Do(){return Ha().request(`workflows.listResumable`)}async function Oo(e){return Ha().request(`workflows.import`,{baseDir:e})}async function ko(e){return Ha().request(`workflows.resume`,{workflowId:e})}async function Ao(e,t){let n={workflowId:e};return t&&(n.path=t),Ha().request(`workflows.fileTree`,n)}async function jo(e,t){return Ha().request(`workflows.fileContent`,{workflowId:e,path:t})}async function Mo(e,t){return Ha().request(`workflows.artifacts`,{workflowId:e,artifactName:t})}async function No(e,t){let n={workflowId:e};return t?.before!==void 0&&(n.before=t.before),t?.limit!==void 0&&(n.limit=t.limit),Ha().request(`workflows.messageLog`,n)}async function Po(e){return Ha().request(`personas.get`,{name:e})}async function Fo(e){return Ha().request(`personas.compileStream`,{name:e})}async function Io(){return Ha().request(`personas.listCompiles`,{})}async function Lo(){let{active:e,recent:t}=await Io(),n=new Map;for(let e of t)n.set(e.operationId,e);for(let t of e)n.set(t.operationId,t);return J.personaCompiles=n,new Set(n.keys())}async function Ro(){return Ha().request(`config.getModelProviders`,{})}async function zo(e){return Ha().request(`config.setModelProviders`,{...e.default===void 0?{}:{default:e.default},profiles:e.profiles})}async function Bo(e=!1){return Ha().request(`config.listOpenrouterModels`,e?{forceRefresh:!0}:{})}async function Vo(e){sessionStorage.setItem(Da,e),await Ho(Ha(),e)}async function Ho(e,t){if(await Ua(t)===`invalid`){Ga();return}J.hasToken=!0,e.connect(Za(),t)}var Uo=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Wo=(e,t)=>({classGroupId:e,validator:t}),Go=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ko=`-`,qo=[],Jo=`arbitrary..`,Yo=e=>{let t=Qo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Zo(e);let n=e.split(Ko);return Xo(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Uo(i,t):t:i||qo}return n[e]||qo}}},Xo=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Xo(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ko):e.slice(t).join(Ko),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Zo=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Jo+r:void 0})(),Qo=e=>{let{theme:t,classGroups:n}=e;return $o(n,t)},$o=(e,t)=>{let n=Go();for(let r in e){let i=e[r];es(i,n,r,t)}return n},es=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ts(i,t,n,r)}},ts=(e,t,n,r)=>{if(typeof e==`string`){ns(e,t,n);return}if(typeof e==`function`){rs(e,t,n,r);return}is(e,t,n,r)},ns=(e,t,n)=>{let r=e===``?t:as(t,e);r.classGroupId=n},rs=(e,t,n,r)=>{if(os(e)){es(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Wo(n,e))},is=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];es(o,as(t,a),n,r)}},as=(e,t)=>{let n=e,r=t.split(Ko),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Go(),n.nextPart.set(t,i)),n=i}return n},os=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ss=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},cs=`!`,ls=`:`,us=[],ds=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),fs=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ls){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(cs)?(c=s.slice(0,-1),l=!0):s.startsWith(cs)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ds(t,l,c,u)};if(t){let e=t+ls,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ds(us,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ps=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ms=e=>({cache:ss(e.cacheSize),parseClassName:fs(e),sortModifiers:ps(e),postfixLookupClassGroupIds:hs(e),...Yo(e)}),hs=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},gs=/\s+/,_s=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(gs),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+cs:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},vs=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ys(n))&&(i&&(i+=` `),i+=r);return i},ys=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ys(e[r]))&&(n&&(n+=` `),n+=t);return n},bs=(e,...t)=>{let n,r,i,a,o=o=>(n=ms(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=_s(e,n);return i(e,a),a};return a=o,(...e)=>a(vs(...e))},xs=[],Ss=e=>{let t=t=>t[e]||xs;return t.isThemeGetter=!0,t},Cs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ws=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ts=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Es=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ds=/\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$/,Os=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ks=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,As=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,js=e=>Ts.test(e),Ms=e=>!!e&&!Number.isNaN(Number(e)),Ns=e=>!!e&&Number.isInteger(Number(e)),Ps=e=>e.endsWith(`%`)&&Ms(e.slice(0,-1)),Fs=e=>Es.test(e),Is=()=>!0,Ls=e=>Ds.test(e)&&!Os.test(e),Rs=()=>!1,zs=e=>ks.test(e),Bs=e=>As.test(e),Vs=e=>!Y(e)&&!X(e),Hs=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Us=e=>ic(e,cc,Rs),Y=e=>Cs.test(e),Ws=e=>ic(e,lc,Ls),Gs=e=>ic(e,uc,Ms),Ks=e=>ic(e,fc,Is),qs=e=>ic(e,dc,Rs),Js=e=>ic(e,oc,Rs),Ys=e=>ic(e,sc,Bs),Xs=e=>ic(e,pc,zs),X=e=>ws.test(e),Zs=e=>ac(e,lc),Qs=e=>ac(e,dc),$s=e=>ac(e,oc),ec=e=>ac(e,cc),tc=e=>ac(e,sc),nc=e=>ac(e,pc,!0),rc=e=>ac(e,fc,!0),ic=(e,t,n)=>{let r=Cs.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ac=(e,t,n=!1)=>{let r=ws.exec(e);return r?r[1]?t(r[1]):n:!1},oc=e=>e===`position`||e===`percentage`,sc=e=>e===`image`||e===`url`,cc=e=>e===`length`||e===`size`||e===`bg-size`,lc=e=>e===`length`,uc=e=>e===`number`,dc=e=>e===`family-name`,fc=e=>e===`number`||e===`weight`,pc=e=>e===`shadow`,mc=bs(()=>{let e=Ss(`color`),t=Ss(`font`),n=Ss(`text`),r=Ss(`font-weight`),i=Ss(`tracking`),a=Ss(`leading`),o=Ss(`breakpoint`),s=Ss(`container`),c=Ss(`spacing`),l=Ss(`radius`),u=Ss(`shadow`),d=Ss(`inset-shadow`),f=Ss(`text-shadow`),p=Ss(`drop-shadow`),m=Ss(`blur`),h=Ss(`perspective`),g=Ss(`aspect`),_=Ss(`ease`),v=Ss(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,Y],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,Y,c],T=()=>[js,`full`,`auto`,...w()],ee=()=>[Ns,`none`,`subgrid`,X,Y],E=()=>[`auto`,{span:[`full`,Ns,X,Y]},Ns,X,Y],te=()=>[Ns,`auto`,X,Y],ne=()=>[`auto`,`min`,`max`,`fr`,X,Y],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],D=()=>[js,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],oe=()=>[js,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],se=()=>[js,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,X,Y],ce=()=>[...b(),$s,Js,{position:[X,Y]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,ec,Us,{size:[X,Y]}],de=()=>[Ps,Zs,Ws],fe=()=>[``,`none`,`full`,l,X,Y],pe=()=>[``,Ms,Zs,Ws],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[Ms,Ps,$s,Js],_e=()=>[``,`none`,m,X,Y],ve=()=>[`none`,Ms,X,Y],ye=()=>[`none`,Ms,X,Y],be=()=>[Ms,X,Y],xe=()=>[js,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Fs],breakpoint:[Fs],color:[Is],container:[Fs],"drop-shadow":[Fs],ease:[`in`,`out`,`in-out`],font:[Vs],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Fs],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Fs],shadow:[Fs],spacing:[`px`,Ms],text:[Fs],"text-shadow":[Fs],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,js,Y,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,Y]}],"container-named":[Hs],columns:[{columns:[Ms,Y,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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`],sr:[`sr-only`,`not-sr-only`],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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ns,`auto`,X,Y]}],basis:[{basis:[js,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Ms,js,`auto`,`initial`,`none`,Y]}],grow:[{grow:[``,Ms,X,Y]}],shrink:[{shrink:[``,Ms,X,Y]}],order:[{order:[Ns,`first`,`last`,`none`,X,Y]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:D()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...D()]}],"min-w":[{"min-w":[s,`screen`,`none`,...D()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...D()]}],h:[{h:[`screen`,`lh`,...D()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...D()]}],"max-h":[{"max-h":[`screen`,`lh`,...D()]}],"font-size":[{text:[`base`,n,Zs,Ws]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,rc,Ks]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ps,Y]}],"font-family":[{font:[Qs,qs,t]}],"font-features":[{"font-features":[Y]}],"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:[i,X,Y]}],"line-clamp":[{"line-clamp":[Ms,`none`,X,Gs]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,X,Y]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,Y]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[Ms,`from-font`,`auto`,X,Ws]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Ms,`auto`,X,Y]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ns,X,Y]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,Y]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,Y]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ns,X,Y],radial:[``,X,Y],conic:[Ns,X,Y]},tc,Ys]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Ms,X,Y]}],"outline-w":[{outline:[``,Ms,Zs,Ws]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,nc,Xs]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,nc,Xs]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Ms,Ws]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,nc,Xs]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Ms,X,Y]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Ms]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[X,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ms]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,Y]}],filter:[{filter:[``,`none`,X,Y]}],blur:[{blur:_e()}],brightness:[{brightness:[Ms,X,Y]}],contrast:[{contrast:[Ms,X,Y]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,nc,Xs]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,Ms,X,Y]}],"hue-rotate":[{"hue-rotate":[Ms,X,Y]}],invert:[{invert:[``,Ms,X,Y]}],saturate:[{saturate:[Ms,X,Y]}],sepia:[{sepia:[``,Ms,X,Y]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,Y]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Ms,X,Y]}],"backdrop-contrast":[{"backdrop-contrast":[Ms,X,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Ms,X,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ms,X,Y]}],"backdrop-invert":[{"backdrop-invert":[``,Ms,X,Y]}],"backdrop-opacity":[{"backdrop-opacity":[Ms,X,Y]}],"backdrop-saturate":[{"backdrop-saturate":[Ms,X,Y]}],"backdrop-sepia":[{"backdrop-sepia":[``,Ms,X,Y]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,Y]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Ms,`initial`,X,Y]}],ease:[{ease:[`linear`,`initial`,_,X,Y]}],delay:[{delay:[Ms,X,Y]}],animate:[{animate:[`none`,v,X,Y]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,Y]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[X,Y,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ns,X,Y]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],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`,X,Y]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,X,Y]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[Ms,Zs,Ws,Gs]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`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`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`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-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`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-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`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`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`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-pbs`,`scroll-pbe`,`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`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function hc(...e){return mc(Ci(e))}function gc(e){switch(e){case`running`:return`default`;case`waiting_human`:return`warning`;case`completed`:return`success`;case`failed`:return`destructive`;case`aborted`:return`secondary`;case`interrupted`:return`warning`;default:return`outline`}}var _c=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),vc=V(`<div><!></div>`);function yc(e,t){j(t,!0);let n=sa(t,_c);var r=vc();Xi(r,e=>({class:e,...n}),[()=>hc(`bg-card border border-border rounded-xl`,t.class)]);var i=I(r),a=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(i,e=>{t.children&&e(a)}),k(r),G(e,r),M()}var bc=V(`<div><!></div>`);function xc(e,t){j(t,!0);var n=bc(),r=I(n),i=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(r,e=>{t.children&&e(i)}),k(n),z(e=>Ai(n,1,e),[()=>wi(hc(`flex items-center justify-between p-4`,t.class))]),G(e,n),M()}var Sc=V(`<span><!></span>`);function Cc(e,t){j(t,!0);var n=Sc(),r=I(n),i=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(r,e=>{t.children&&e(i)}),k(n),z(e=>Ai(n,1,e),[()=>wi(hc(`text-xs font-medium text-muted-foreground uppercase tracking-wider`,t.class))]),G(e,n),M()}var wc=V(`<div><!></div>`);function Tc(e,t){j(t,!0);var n=wc(),r=I(n),i=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(r,e=>{t.children&&e(i)}),k(n),z(e=>Ai(n,1,e),[()=>wi(hc(`p-4 pt-0`,t.class))]),G(e,n),M()}var Ec=new Set([`$$slots`,`$$events`,`$$legacy`,`variant`,`class`,`children`]),Dc=V(`<span><!></span>`);function Oc(e,t){j(t,!0);let n={default:`bg-primary/15 text-primary`,secondary:`bg-secondary text-secondary-foreground`,destructive:`bg-destructive/15 text-destructive`,outline:`border border-border text-foreground`,success:`bg-success/15 text-success`,warning:`bg-warning/15 text-warning`},r=ca(t,`variant`,3,`default`),i=sa(t,Ec);var a=Dc();Xi(a,e=>({class:e,...i}),[()=>hc(`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full`,n[r()],t.class)]);var o=I(a),s=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(o,e=>{t.children&&e(s)}),k(a),G(e,a),M()}var kc=V(`<div><table class="w-full text-sm"><!></table></div>`);function Ac(e,t){j(t,!0);var n=kc(),r=I(n),i=I(r),a=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(i,e=>{t.children&&e(a)}),k(r),k(n),z(e=>Ai(n,1,e),[()=>wi(hc(`bg-card border border-border rounded-xl overflow-x-auto`,t.class))]),G(e,n),M()}var jc=V(`<thead><tr class="border-b border-border bg-muted/30"><!></tr></thead>`);function Mc(e,t){var n=jc(),r=I(n),i=I(r),a=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(i,e=>{t.children&&e(a)}),k(r),k(n),G(e,n)}var Nc=V(`<tbody><!></tbody>`);function Pc(e,t){var n=Nc(),r=I(n),i=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(r,e=>{t.children&&e(i)}),k(n),G(e,n)}var Fc=new Set([`$$slots`,`$$events`,`$$legacy`,`clickable`,`muted`,`class`,`children`,`onclick`,`onkeydown`]),Ic=V(`<tr><!></tr>`);function Lc(e,t){j(t,!0);let n=ca(t,`clickable`,3,!1),r=ca(t,`muted`,3,!1),i=sa(t,Fc);function a(e){n()&&(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.currentTarget.click()),t.onkeydown?.(e)}var o=Ic();Xi(o,e=>({class:e,tabindex:n()?0:void 0,role:n()?`button`:void 0,onclick:t.onclick,onkeydown:a,...i}),[()=>hc(`border-t border-border/50 transition-colors`,n()&&`hover:bg-accent/40 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,!n()&&!r()&&`hover:bg-accent/30`,r()&&`opacity-50`,t.class)]);var s=I(o),c=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(s,e=>{t.children&&e(c)}),k(o),G(e,o),M()}var Rc=V(`<th><!></th>`);function zc(e,t){j(t,!0);let n=ca(t,`align`,3,`left`);var r=Rc(),i=I(r),a=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(i,e=>{t.children&&e(a)}),k(r),z(e=>Ai(r,1,e),[()=>wi(hc(`px-4 py-2.5 text-xs font-medium text-muted-foreground uppercase tracking-wider`,n()===`right`&&`text-right`,n()===`center`&&`text-center`,n()===`left`&&`text-left`,t.class))]),G(e,r),M()}var Bc=V(`<td><!></td>`);function Vc(e,t){j(t,!0);var n=Bc(),r=I(n),i=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(r,e=>{t.children&&e(i)}),k(n),z(e=>Ai(n,1,e),[()=>wi(hc(`px-4 py-2.5`,t.class))]),G(e,n),M()}var Hc=new Set([la.COMPLETED,la.FAILED,la.ABORTED]);function Uc(e){return{name:e.workflowId,phase:`running`,currentState:``,startedAt:new Date().toISOString(),taskDescription:``,round:0,maxRounds:0,totalTokens:0,...e}}function Wc(e){let t=e.phase===`interrupted`?`failed`:e.phase;return Uc({workflowId:e.workflowId,name:e.name,phase:t,currentState:e.lastState,startedAt:e.timestamp,taskDescription:e.taskDescription,round:e.round,maxRounds:e.maxRounds,totalTokens:e.totalTokens,latestVerdict:e.latestVerdict,error:e.error})}function Gc(e){return Uc({workflowId:e,phase:`completed`})}function Kc(e){return{workflowId:e.workflowId,name:e.name,phase:e.phase,currentState:e.currentState,taskDescription:e.taskDescription,round:e.round,maxRounds:e.maxRounds,totalTokens:e.totalTokens,latestVerdict:e.latestVerdict,error:e.error,timestamp:e.startedAt,lastState:e.currentState}}function qc(e){let t=[];for(let n of e)Hc.has(n.phase)&&t.push(Kc(n));return t}function Jc(e,t){let n=new Map;for(let t of e)n.set(t.workflowId,t);for(let e of t)n.set(e.workflowId,e);return[...n.values()].sort((e,t)=>{let n=Date.parse(e.timestamp),r=Date.parse(t.timestamp);return Number.isNaN(n)&&Number.isNaN(r)?0:Number.isNaN(n)?1:Number.isNaN(r)?-1:r-n})}function Yc(e,t=80){return e.length<=t?e:e.slice(0,t)+`…`}function Xc(e){return e.replace(/_/g,` `)}var Zc=new Set([la.WAITING_HUMAN,la.INTERRUPTED,la.ABORTED,la.FAILED]);function Qc(e){return Zc.has(e)}var $c=[{id:`all`,label:`All`},{id:`completed`,label:`Completed`},{id:`failed`,label:`Failed`},{id:`aborted`,label:`Aborted`},{id:`interrupted`,label:`Interrupted`},{id:`waiting_human`,label:`Waiting-human`}];function el(e,t){return t===`all`?[...e]:e.filter(e=>e.phase===t)}function tl(e){let t={all:e.length,completed:0,failed:0,aborted:0,interrupted:0,waiting_human:0};for(let n of e)n.phase in t&&(t[n.phase]+=1);return t}function nl(e){return e===void 0||Number.isNaN(e)?``:`${Math.round(e*100)}%`}function rl(e){if(e===void 0||!Number.isFinite(e)||e<0)return``;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r.toString().padStart(2,`0`)}m`:r>0?`${r}m ${i.toString().padStart(2,`0`)}s`:`${i}s`}function il(e,t=Date.now()){if(!e)return`--`;let n=new Date(e).getTime();if(Number.isNaN(n))return`--`;let r=Math.floor((t-n)/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:new Date(n).toLocaleDateString()}var al=new Set([la.RUNNING,la.WAITING_HUMAN]),ol=new Set([la.FAILED,la.ABORTED,la.INTERRUPTED]),sl=[la.RUNNING,la.WAITING_HUMAN,la.COMPLETED,la.FAILED,la.ABORTED,la.INTERRUPTED];function cl(e,t,n){let r=0,i=0;for(let e of t)e.phase===la.COMPLETED?r+=1:ol.has(e.phase)&&(i+=1);return{active:e.filter(e=>al.has(e.phase)).length,awaitingGate:n,completed:r,issues:i}}function ll(e,t){let n=new Map,r=e=>{n.set(e,(n.get(e)??0)+1)};for(let t of e)al.has(t.phase)&&r(t.phase);for(let e of t)r(e.phase);let i=0;for(let e of sl)i+=n.get(e)??0;return{segments:sl.map(e=>{let t=n.get(e)??0;return{phase:e,count:t,pct:i>0?t/i*100:0}}),total:i}}function ul(e,t){let n=0;for(let t of e)n+=t.totalTokens??0;for(let e of t)n+=e.totalTokens??0;return n}function dl(e){if(!Number.isFinite(e)||e<=0)return`0`;if(e<1e3)return String(Math.round(e));if(e<999500){let t=e/1e3;return`${t<10?t.toFixed(1):Math.round(t)}k`}return`${(e/1e6).toFixed(1)}M`}var fl=Symbol(`phosphor-svelte`);function pl(){return qe(fl)?Ke(fl):{}}var ml=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),hl=H(`<path d="M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"></path>`),gl=H(`<path d="M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z" opacity="0.2"></path><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"></path>`,1),_l=H(`<path d="M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"></path>`),vl=H(`<path d="M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"></path>`),yl=H(`<path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"></path>`),bl=H(`<path d="M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"></path>`),xl=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Sl(e,t){j(t,!0);let n=pl(),r=sa(t,ml),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=xl();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,hl())},m=e=>{var t=gl();A(),G(e,t)},h=e=>{G(e,_l())},g=e=>{G(e,vl())},_=e=>{G(e,yl())},v=e=>{G(e,bl())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Cl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),wl=H(`<path d="M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"></path>`),Tl=H(`<path d="M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z" opacity="0.2"></path><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"></path>`,1),El=H(`<path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"></path>`),Dl=H(`<path d="M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"></path>`),Ol=H(`<path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"></path>`),kl=H(`<path d="M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"></path>`),Al=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function jl(e,t){j(t,!0);let n=pl(),r=sa(t,Cl),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=Al();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,wl())},m=e=>{var t=Tl();A(),G(e,t)},h=e=>{G(e,El())},g=e=>{G(e,Dl())},_=e=>{G(e,Ol())},v=e=>{G(e,kl())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Ml=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Nl=H(`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"></path>`),Pl=H(`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"></path>`,1),Fl=H(`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"></path>`),Il=H(`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z"></path>`),Ll=H(`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"></path>`),Rl=H(`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z"></path>`),zl=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Bl(e,t){j(t,!0);let n=pl(),r=sa(t,Ml),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=zl();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Nl())},m=e=>{var t=Pl();A(),G(e,t)},h=e=>{G(e,Fl())},g=e=>{G(e,Il())},_=e=>{G(e,Ll())},v=e=>{G(e,Rl())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Vl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Hl=H(`<path d="M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"></path>`),Ul=H(`<path d="M96,240l16-80L48,136,160,16,144,96l64,24Z" opacity="0.2"></path><path d="M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"></path>`,1),Wl=H(`<path d="M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"></path>`),Gl=H(`<path d="M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"></path>`),Kl=H(`<path d="M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"></path>`),ql=H(`<path d="M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"></path>`),Jl=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Yl(e,t){j(t,!0);let n=pl(),r=sa(t,Vl),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=Jl();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Hl())},m=e=>{var t=Ul();A(),G(e,t)},h=e=>{G(e,Wl())},g=e=>{G(e,Gl())},_=e=>{G(e,Kl())},v=e=>{G(e,ql())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Xl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Zl=H(`<path d="M208,36H48A20,20,0,0,0,28,56v56c0,54.29,26.32,87.22,48.4,105.29,23.71,19.39,47.44,26,48.44,26.29a12.1,12.1,0,0,0,6.32,0c1-.28,24.73-6.9,48.44-26.29,22.08-18.07,48.4-51,48.4-105.29V56A20,20,0,0,0,208,36Zm-4,76c0,35.71-13.09,64.69-38.91,86.15A126.28,126.28,0,0,1,128,219.38a126.14,126.14,0,0,1-37.09-21.23C65.09,176.69,52,147.71,52,112V60H204ZM79.51,144.49a12,12,0,1,1,17-17L112,143l47.51-47.52a12,12,0,0,1,17,17l-56,56a12,12,0,0,1-17,0Z"></path>`),Ql=H(`<path d="M216,56v56c0,96-88,120-88,120S40,208,40,112V56a8,8,0,0,1,8-8H208A8,8,0,0,1,216,56Z" opacity="0.2"></path><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"></path>`,1),$l=H(`<path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-34.32,69.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"></path>`),eu=H(`<path d="M208,42H48A14,14,0,0,0,34,56v56c0,51.94,25.12,83.4,46.2,100.64,22.73,18.6,45.27,24.89,46.22,25.15a6,6,0,0,0,3.16,0c.95-.26,23.49-6.55,46.22-25.15C196.88,195.4,222,163.94,222,112V56A14,14,0,0,0,208,42Zm2,70c0,37.76-13.94,68.39-41.44,91.06A131.17,131.17,0,0,1,128,225.72a130.94,130.94,0,0,1-40.56-22.66C59.94,180.39,46,149.76,46,112V56a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76Z"></path>`),tu=H(`<path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"></path>`),nu=H(`<path d="M208,44H48A12,12,0,0,0,36,56v56c0,51.16,24.73,82.12,45.47,99.1,22.4,18.32,44.55,24.5,45.48,24.76a4,4,0,0,0,2.1,0c.93-.26,23.08-6.44,45.48-24.76,20.74-17,45.47-47.94,45.47-99.1V56A12,12,0,0,0,208,44Zm4,68c0,38.44-14.23,69.63-42.29,92.71A132.45,132.45,0,0,1,128,227.82a132.23,132.23,0,0,1-41.71-23.11C58.23,181.63,44,150.44,44,112V56a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-41.17-10.83a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17Z"></path>`),ru=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function iu(e,t){j(t,!0);let n=pl(),r=sa(t,Xl),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=ru();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Zl())},m=e=>{var t=Ql();A(),G(e,t)},h=e=>{G(e,$l())},g=e=>{G(e,eu())},_=e=>{G(e,tu())},v=e=>{G(e,nu())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var au=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),ou=H(`<path d="M160,116h48a20,20,0,0,0,20-20V48a20,20,0,0,0-20-20H160a20,20,0,0,0-20,20V60H128a28,28,0,0,0-28,28v28H76v-4A20,20,0,0,0,56,92H24A20,20,0,0,0,4,112v32a20,20,0,0,0,20,20H56a20,20,0,0,0,20-20v-4h24v28a28,28,0,0,0,28,28h12v12a20,20,0,0,0,20,20h48a20,20,0,0,0,20-20V160a20,20,0,0,0-20-20H160a20,20,0,0,0-20,20v12H128a4,4,0,0,1-4-4V88a4,4,0,0,1,4-4h12V96A20,20,0,0,0,160,116ZM52,140H28V116H52Zm112,24h40v40H164Zm0-112h40V92H164Z"></path>`),su=H(`<path d="M64,112v32a8,8,0,0,1-8,8H24a8,8,0,0,1-8-8V112a8,8,0,0,1,8-8H56A8,8,0,0,1,64,112ZM208,40H160a8,8,0,0,0-8,8V96a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V48A8,8,0,0,0,208,40Zm0,112H160a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152Z" opacity="0.2"></path><path d="M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z"></path>`,1),cu=H(`<path d="M144,96V80H128a8,8,0,0,0-8,8v80a8,8,0,0,0,8,8h16V160a16,16,0,0,1,16-16h48a16,16,0,0,1,16,16v48a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V192H128a24,24,0,0,1-24-24V136H72v8a16,16,0,0,1-16,16H24A16,16,0,0,1,8,144V112A16,16,0,0,1,24,96H56a16,16,0,0,1,16,16v8h32V88a24,24,0,0,1,24-24h16V48a16,16,0,0,1,16-16h48a16,16,0,0,1,16,16V96a16,16,0,0,1-16,16H160A16,16,0,0,1,144,96Z"></path>`),lu=H(`<path d="M160,110h48a14,14,0,0,0,14-14V48a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14V66H128a22,22,0,0,0-22,22v34H70V112A14,14,0,0,0,56,98H24a14,14,0,0,0-14,14v32a14,14,0,0,0,14,14H56a14,14,0,0,0,14-14V134h36v34a22,22,0,0,0,22,22h18v18a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V160a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14v18H128a10,10,0,0,1-10-10V88a10,10,0,0,1,10-10h18V96A14,14,0,0,0,160,110ZM58,144a2,2,0,0,1-2,2H24a2,2,0,0,1-2-2V112a2,2,0,0,1,2-2H56a2,2,0,0,1,2,2Zm100,16a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2v48a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Zm0-112a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2V96a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Z"></path>`),uu=H(`<path d="M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z"></path>`),du=H(`<path d="M160,108h48a12,12,0,0,0,12-12V48a12,12,0,0,0-12-12H160a12,12,0,0,0-12,12V68H128a20,20,0,0,0-20,20v36H68V112a12,12,0,0,0-12-12H24a12,12,0,0,0-12,12v32a12,12,0,0,0,12,12H56a12,12,0,0,0,12-12V132h40v36a20,20,0,0,0,20,20h20v20a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V160a12,12,0,0,0-12-12H160a12,12,0,0,0-12,12v20H128a12,12,0,0,1-12-12V88a12,12,0,0,1,12-12h20V96A12,12,0,0,0,160,108ZM60,144a4,4,0,0,1-4,4H24a4,4,0,0,1-4-4V112a4,4,0,0,1,4-4H56a4,4,0,0,1,4,4Zm96,16a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4v48a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4Zm0-112a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V96a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4Z"></path>`),fu=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function pu(e,t){j(t,!0);let n=pl(),r=sa(t,au),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=fu();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,ou())},m=e=>{var t=su();A(),G(e,t)},h=e=>{G(e,cu())},g=e=>{G(e,lu())},_=e=>{G(e,uu())},v=e=>{G(e,du())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var mu=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),hu=H(`<path d="M246.14,113.86l-16-16a20,20,0,0,0-23.06-3.75l-45.2-45.2a20,20,0,0,0-3.74-23.06l-16-16a20,20,0,0,0-28.28,0l-64,64a20,20,0,0,0,0,28.28l16,16a20,20,0,0,0,23,3.79L29.36,181.38a32,32,0,0,0,45.26,45.26L134,167.21a20,20,0,0,0,3.81,22.94l16,16a20,20,0,0,0,28.29,0l64-64a20,20,0,0,0,0-28.29ZM80,98.34,69.64,88,128,29.65,138.34,40ZM57.64,209.67a8,8,0,0,1-11.31-11.32l59.52-59.52,11.31,11.32Zm92.7-60.29-43.72-43.72,39-39,43.72,43.72Zm17.65,37L157.65,176,216,117.66,226.34,128Z"></path>`),gu=H(`<path d="M149.66,45.66l-64,64a8,8,0,0,1-11.32,0l-16-16a8,8,0,0,1,0-11.32l64-64a8,8,0,0,1,11.32,0l16,16A8,8,0,0,1,149.66,45.66Zm88,76.68-16-16a8,8,0,0,0-11.32,0l-64,64a8,8,0,0,0,0,11.32l16,16a8,8,0,0,0,11.32,0l64-64A8,8,0,0,0,237.66,122.34Z" opacity="0.2"></path><path d="M243.32,116.69l-16-16a16,16,0,0,0-20.84-1.53L156.84,49.52a16,16,0,0,0-1.52-20.84l-16-16a16,16,0,0,0-22.63,0l-64,64a16,16,0,0,0,0,22.63l16,16a16,16,0,0,0,20.83,1.52L96.69,124,31.31,189.38A25,25,0,0,0,66.63,224.7L132,159.32l7.17,7.16a16,16,0,0,0,1.52,20.84l16,16a16,16,0,0,0,22.63,0l64-64A16,16,0,0,0,243.32,116.69ZM80,104,64,88l64-64,16,16ZM55.32,213.38a9,9,0,0,1-12.69,0,9,9,0,0,1,0-12.68L108,135.32,120.69,148ZM101,105.66,145.66,61,195,110.34,150.35,155ZM168,192l-16-16,4-4h0l56-56h0l4-4,16,16Z"></path>`,1),_u=H(`<path d="M52.69,99.31a16,16,0,0,1,0-22.63l64-64a16,16,0,0,1,22.63,22.63l-64,64a16,16,0,0,1-22.63,0Zm190.63,17.37a16,16,0,0,0-22.63,0l-64,64a16,16,0,0,0,0,22.63h0a16,16,0,0,0,22.63,0l64-64A16,16,0,0,0,243.32,116.68Zm-35.11-15.8L155.12,47.79a4,4,0,0,0-5.66,0L87.8,109.45a4,4,0,0,0,0,5.66L103,130.34,28.69,204.69a16,16,0,0,0,22.62,22.62L125.66,153l15.23,15.23a4,4,0,0,0,5.66,0l61.66-61.66A4,4,0,0,0,208.21,100.88Z"></path>`),vu=H(`<path d="M241.91,118.1l-16-16a14,14,0,0,0-19.55-.23L154.13,49.64a14,14,0,0,0-.23-19.55l-16-16a14,14,0,0,0-19.8,0l-64,64a14,14,0,0,0,0,19.8l16,16a14,14,0,0,0,19.55.23L99.52,124,32.73,190.79a23,23,0,0,0,32.48,32.49L132,156.49l9.87,9.87a14,14,0,0,0,.23,19.55l16,16a14,14,0,0,0,19.8,0l64-64A14,14,0,0,0,241.91,118.1Zm-91.56,39.76-52.21-52.2,47.52-47.52,52.2,52.2ZM78.59,105.41l-16-16a2,2,0,0,1,0-2.83l64-64a2,2,0,0,1,2.83,0l16,16a2,2,0,0,1,0,2.83l-64,64A2,2,0,0,1,78.59,105.41ZM56.73,214.8a11,11,0,0,1-15.52-15.52L108,132.49,123.52,148Zm176.69-85.38-64,64a2,2,0,0,1-2.83,0l-16-16a2,2,0,0,1,0-2.83l64-64a2,2,0,0,1,2.83,0l16,16A2,2,0,0,1,233.42,129.42Z"></path>`),yu=H(`<path d="M243.32,116.69l-16-16a16,16,0,0,0-20.84-1.53L156.84,49.52a16,16,0,0,0-1.52-20.84l-16-16a16,16,0,0,0-22.63,0l-64,64a16,16,0,0,0,0,22.63l16,16a16,16,0,0,0,20.83,1.52L96.69,124,31.31,189.38A25,25,0,0,0,66.63,224.7L132,159.32l7.17,7.16a16,16,0,0,0,1.52,20.84l16,16a16,16,0,0,0,22.63,0l64-64A16,16,0,0,0,243.32,116.69ZM80,104,64,88l64-64,16,16ZM55.32,213.38a9,9,0,0,1-12.69,0,9,9,0,0,1,0-12.68L108,135.32,120.69,148ZM101,105.66,145.66,61,195,110.34,150.35,155ZM168,192l-16-16,4-4h0l56-56h0l4-4,16,16Z"></path>`),bu=H(`<path d="M240.49,119.52l-16-16a12,12,0,0,0-17,0l-1.17,1.17-55-55,1.18-1.17a12,12,0,0,0,0-17l-16-16a12,12,0,0,0-17,0l-64,64a12,12,0,0,0,0,17l16,16a12,12,0,0,0,17,0l1.17-1.18L102.34,124l-68.2,68.21A21,21,0,0,0,63.8,221.87L132,153.66l12.69,12.69-1.18,1.17a12,12,0,0,0,0,17l16,16a12,12,0,0,0,17,0l64-64a12,12,0,0,0,0-17ZM77.17,106.83l-16-16a4,4,0,0,1,0-5.66l64-64a4,4,0,0,1,5.66,0l16,16a4,4,0,0,1,0,5.65l-64,64A4,4,0,0,1,77.17,106.83Zm-19,109.38A13,13,0,1,1,39.8,197.87L108,129.66,126.34,148ZM95.31,105.66l50.35-50.35,55,55-50.35,50.35Zm139.52,25.17-64,64a4,4,0,0,1-5.66,0l-16-16a4,4,0,0,1,0-5.65l64-64a4,4,0,0,1,5.66,0l16,16a4,4,0,0,1,0,5.66Z"></path>`),xu=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Su(e,t){j(t,!0);let n=pl(),r=sa(t,mu),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=xu();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,hu())},m=e=>{var t=gu();A(),G(e,t)},h=e=>{G(e,_u())},g=e=>{G(e,vu())},_=e=>{G(e,yu())},v=e=>{G(e,bu())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Cu=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),wu=H(`<path d="M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"></path>`),Tu=H(`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"></path>`,1),Eu=H(`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"></path>`),Du=H(`<path d="M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"></path>`),Ou=H(`<path d="M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"></path>`),ku=H(`<path d="M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"></path>`),Au=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function ju(e,t){j(t,!0);let n=pl(),r=sa(t,Cu),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=Au();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,wu())},m=e=>{var t=Tu();A(),G(e,t)},h=e=>{G(e,Eu())},g=e=>{G(e,Du())},_=e=>{G(e,Ou())},v=e=>{G(e,ku())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Mu=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Nu=H(`<path d="M116,132V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0ZM236,91.55v72.9a19.86,19.86,0,0,1-5.86,14.14l-51.55,51.55A19.85,19.85,0,0,1,164.45,236H91.55a19.85,19.85,0,0,1-14.14-5.86L25.86,178.59A19.86,19.86,0,0,1,20,164.45V91.55a19.86,19.86,0,0,1,5.86-14.14L77.41,25.86A19.85,19.85,0,0,1,91.55,20h72.9a19.85,19.85,0,0,1,14.14,5.86l51.55,51.55A19.86,19.86,0,0,1,236,91.55Zm-24,1.66L162.79,44H93.21L44,93.21v69.58L93.21,212h69.58L212,162.79ZM128,156a16,16,0,1,0,16,16A16,16,0,0,0,128,156Z"></path>`),Pu=H(`<path d="M224,91.55v72.9a8,8,0,0,1-2.34,5.66l-51.55,51.55a8,8,0,0,1-5.66,2.34H91.55a8,8,0,0,1-5.66-2.34L34.34,170.11A8,8,0,0,1,32,164.45V91.55a8,8,0,0,1,2.34-5.66L85.89,34.34A8,8,0,0,1,91.55,32h72.9a8,8,0,0,1,5.66,2.34l51.55,51.55A8,8,0,0,1,224,91.55Z" opacity="0.2"></path><path d="M120,136V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0ZM232,91.55v72.9a15.86,15.86,0,0,1-4.69,11.31l-51.55,51.55A15.86,15.86,0,0,1,164.45,232H91.55a15.86,15.86,0,0,1-11.31-4.69L28.69,175.76A15.86,15.86,0,0,1,24,164.45V91.55a15.86,15.86,0,0,1,4.69-11.31L80.24,28.69A15.86,15.86,0,0,1,91.55,24h72.9a15.86,15.86,0,0,1,11.31,4.69l51.55,51.55A15.86,15.86,0,0,1,232,91.55Zm-16,0L164.45,40H91.55L40,91.55v72.9L91.55,216h72.9L216,164.45ZM128,160a12,12,0,1,0,12,12A12,12,0,0,0,128,160Z"></path>`,1),Fu=H(`<path d="M227.31,80.23,175.77,28.69A16.13,16.13,0,0,0,164.45,24H91.55a16.13,16.13,0,0,0-11.32,4.69L28.69,80.23A16.13,16.13,0,0,0,24,91.55v72.9a16.13,16.13,0,0,0,4.69,11.32l51.54,51.54A16.13,16.13,0,0,0,91.55,232h72.9a16.13,16.13,0,0,0,11.32-4.69l51.54-51.54A16.13,16.13,0,0,0,232,164.45V91.55A16.13,16.13,0,0,0,227.31,80.23ZM120,80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"></path>`),Iu=H(`<path d="M122,136V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0ZM230,91.55v72.9a13.92,13.92,0,0,1-4.1,9.9L174.35,225.9a13.92,13.92,0,0,1-9.9,4.1H91.55a13.92,13.92,0,0,1-9.9-4.1L30.1,174.35a13.92,13.92,0,0,1-4.1-9.9V91.55a13.92,13.92,0,0,1,4.1-9.9L81.65,30.1a13.92,13.92,0,0,1,9.9-4.1h72.9a13.92,13.92,0,0,1,9.9,4.1L225.9,81.65A13.92,13.92,0,0,1,230,91.55Zm-12,0a2,2,0,0,0-.59-1.42L165.87,38.59a2,2,0,0,0-1.42-.59H91.55a2,2,0,0,0-1.41.59L38.58,90.13A2,2,0,0,0,38,91.55v72.9a2,2,0,0,0,.59,1.42l51.54,51.54a2,2,0,0,0,1.42.59h72.9a2,2,0,0,0,1.41-.59l51.56-51.54a2,2,0,0,0,.58-1.42ZM128,162a10,10,0,1,0,10,10A10,10,0,0,0,128,162Z"></path>`),Lu=H(`<path d="M120,136V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0ZM232,91.55v72.9a15.86,15.86,0,0,1-4.69,11.31l-51.55,51.55A15.86,15.86,0,0,1,164.45,232H91.55a15.86,15.86,0,0,1-11.31-4.69L28.69,175.76A15.86,15.86,0,0,1,24,164.45V91.55a15.86,15.86,0,0,1,4.69-11.31L80.24,28.69A15.86,15.86,0,0,1,91.55,24h72.9a15.86,15.86,0,0,1,11.31,4.69l51.55,51.55A15.86,15.86,0,0,1,232,91.55Zm-16,0L164.45,40H91.55L40,91.55v72.9L91.55,216h72.9L216,164.45ZM128,160a12,12,0,1,0,12,12A12,12,0,0,0,128,160Z"></path>`),Ru=H(`<path d="M124,136V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0ZM228,91.55v72.9a12,12,0,0,1-3.51,8.49l-51.55,51.55a12,12,0,0,1-8.49,3.51H91.55a12,12,0,0,1-8.49-3.51L31.51,172.94A12,12,0,0,1,28,164.45V91.55a12,12,0,0,1,3.51-8.49L83.06,31.51A12,12,0,0,1,91.55,28h72.9a12,12,0,0,1,8.49,3.51l51.55,51.55A12,12,0,0,1,228,91.55Zm-8,0a4,4,0,0,0-1.17-2.83L167.28,37.17A4.06,4.06,0,0,0,164.45,36H91.55a4.06,4.06,0,0,0-2.83,1.17L37.17,88.72A4,4,0,0,0,36,91.55v72.9a4,4,0,0,0,1.17,2.83l51.55,51.55A4.06,4.06,0,0,0,91.55,220h72.9a4.06,4.06,0,0,0,2.83-1.17l51.55-51.55a4,4,0,0,0,1.17-2.83ZM128,164a8,8,0,1,0,8,8A8,8,0,0,0,128,164Z"></path>`),zu=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Bu(e,t){j(t,!0);let n=pl(),r=sa(t,Mu),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=zu();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Nu())},m=e=>{var t=Pu();A(),G(e,t)},h=e=>{G(e,Fu())},g=e=>{G(e,Iu())},_=e=>{G(e,Lu())},v=e=>{G(e,Ru())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Vu=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Hu=H(`<path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path>`),Uu=H(`<path d="M176,128,96,208V48Z" opacity="0.2"></path><path d="M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"></path>`,1),Wu=H(`<path d="M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"></path>`),Gu=H(`<path d="M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"></path>`),Ku=H(`<path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path>`),qu=H(`<path d="M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"></path>`),Ju=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Yu(e,t){j(t,!0);let n=pl(),r=sa(t,Vu),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=Ju();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Hu())},m=e=>{var t=Uu();A(),G(e,t)},h=e=>{G(e,Wu())},g=e=>{G(e,Gu())},_=e=>{G(e,Ku())},v=e=>{G(e,qu())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Xu=V(`<span class="text-xs font-mono text-muted-foreground"> </span>`),Zu=V(`<div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Sessions</span> <!></div> <div class="text-3xl font-bold font-mono tracking-tight"> </div> <div class="text-[11px] text-muted-foreground mt-1">active</div>`,1),Qu=V(`<div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Escalations</span> <!></div> <div> </div> <div class="text-[11px] text-muted-foreground mt-1">pending</div>`,1),$u=V(`<div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Scheduled</span> <!></div> <div class="text-3xl font-bold font-mono tracking-tight"> </div> <div class="text-[11px] text-muted-foreground mt-1">enabled jobs</div>`,1),ed=V(`<span class="w-2 h-2 rounded-full bg-warning animate-pulse"></span>`),td=V(`<div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Running</span> <!></div> <div class="text-3xl font-bold font-mono tracking-tight"> </div> <div class="text-[11px] text-muted-foreground mt-1">in progress</div>`,1),nd=V(`<div></div>`),rd=V(`<div class="flex items-center gap-1.5"><span></span> <span class="text-[11px] text-muted-foreground capitalize"> </span> <span class="text-[11px] font-mono text-foreground/70"> </span></div>`),id=V(`<div class="border-t border-border px-4 py-3.5 space-y-2.5"><div class="flex items-center justify-between"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Phase distribution</span> <span class="text-[11px] font-mono text-muted-foreground"> </span></div> <div class="flex h-2 w-full overflow-hidden rounded-full bg-muted" data-testid="wf-distribution"></div> <div class="flex flex-wrap gap-x-4 gap-y-1.5"></div></div>`),ad=V(`<div class="grid grid-cols-2 sm:grid-cols-4 gap-px bg-border"><div class="bg-card p-4" data-testid="wf-stat-active"><div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Active</span> <!></div> <div class="text-3xl font-bold font-mono tracking-tight"> </div> <div class="text-[11px] text-muted-foreground mt-1">running / gated</div></div> <div class="bg-card p-4" data-testid="wf-stat-gates"><div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Awaiting</span> <!></div> <div> </div> <div class="text-[11px] text-muted-foreground mt-1">human gates</div></div> <div class="bg-card p-4" data-testid="wf-stat-completed"><div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Completed</span> <!></div> <div class="text-3xl font-bold font-mono tracking-tight"> </div> <div class="text-[11px] text-muted-foreground mt-1">past runs</div></div> <div class="bg-card p-4" data-testid="wf-stat-issues"><div class="flex items-center justify-between mb-3"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Issues</span> <!></div> <div> </div> <div class="text-[11px] text-muted-foreground mt-1">problem runs</div></div></div> <!>`,1),od=V(`<!> <!> <!> <!> <!>`,1),sd=V(`<span class="w-1.5 h-1.5 rounded-full bg-primary animate-pulse"></span>`),cd=V(`<span class="w-1.5 h-1.5 rounded-full bg-warning"></span>`),ld=V(`<!> `,1),ud=V(`<span> </span>`),dd=V(`<!> <!>`,1),fd=V(`<div data-testid="dashboard-active-workflows"><!></div>`),pd=V(`<section class="space-y-3 animate-fade-in" data-testid="workflow-activity"><div class="flex items-center justify-between"><h3 class="text-sm font-semibold uppercase tracking-wider text-muted-foreground">Workflow Activity</h3> <button type="button" data-testid="wf-view-all" class="flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors">View all <!></button></div> <!> <!></section>`),md=V(`<!> <!> <!> <!> <!> <!>`,1),hd=V(`<span class="w-1.5 h-1.5 rounded-full bg-warning animate-pulse"></span>`),gd=V(`<span class="w-1.5 h-1.5 rounded-full bg-success"></span>`),_d=V(`<div class="animate-fade-in"><h3 class="text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-3">Active Sessions</h3> <!></div>`),vd=V(`<!> <!> <!> <!>`,1),yd=V(`<span class="w-1.5 h-1.5 rounded-full bg-warning animate-pulse"></span> running`,1),bd=V(`<div class="animate-fade-in"><h3 class="text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-3">Upcoming Jobs</h3> <!></div>`),xd=V(`<!> <p class="text-muted-foreground">No active sessions or jobs</p> <p class="text-sm text-muted-foreground/70 mt-1">Start a session or configure jobs to see activity here.</p>`,1),Sd=V(`<div class="p-6 space-y-6 animate-fade-in"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold tracking-tight">Dashboard</h2> <!></div> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3"><!> <!> <!> <!></div> <!> <!> <!> <!></div>`);function Cd(e,t){j(t,!0);function n(e){return new Date(e).toLocaleTimeString()}function r(e){return`$${e.toFixed(2)}`}let i=P(on([]));Mn(()=>{ja.value,J.connected&&a()});async function a(){try{F(i,await Do(),!0)}catch{}}let o=N(()=>[...J.workflows.values()]),s=N(()=>B(o).filter(e=>e.phase===`running`||e.phase===`waiting_human`)),c=N(()=>Jc(B(i),qc(B(o)))),l=N(()=>cl(B(o),B(c),J.pendingGates.size)),u=N(()=>ll(B(o),B(c))),d=N(()=>B(u).segments.filter(e=>e.count>0)),f=N(()=>ul(B(o),B(c))),p=N(()=>B(o).length>0||B(c).length>0||J.pendingGates.size>0),m={running:`bg-primary`,waiting_human:`bg-warning/55`,completed:`bg-success`,failed:`bg-destructive`,aborted:`bg-muted-foreground/60`,interrupted:`bg-foreground/40`};function h(){J.selectedWorkflowId=null,J.currentView=`workflows`}function g(e){J.selectedWorkflowId=e,J.currentView=`workflows`}var _=Sd(),v=I(_),y=R(I(v),2),b=e=>{var t=Xu(),n=I(t);k(t),z(e=>K(n,`uptime ${e??``}m`),[()=>Math.floor(J.daemonStatus.uptimeSeconds/60)]),G(e,t)};q(y,e=>{J.daemonStatus&&e(b)}),k(v);var x=R(v,2),S=I(x);yc(S,{"data-testid":`stat-sessions`,class:`group p-4 hover:border-primary/30 transition-colors`,children:(e,t)=>{var n=Zu(),r=L(n);Sl(R(I(r),2),{size:16,class:`text-muted-foreground/50`}),k(r);var i=R(r,2),a=I(i,!0);k(i),A(2),z(()=>K(a,J.activeSessionCount)),G(e,n)},$$slots:{default:!0}});var C=R(S,2);{let e=N(()=>J.escalationCount>0?`border-destructive/20`:``);yc(C,{"data-testid":`stat-escalations`,get class(){return`group p-4 hover:border-destructive/30 transition-colors ${B(e)??``}`},children:(e,t)=>{var n=Qu(),r=L(n),i=R(I(r),2);{let e=N(()=>J.escalationCount>0?`text-destructive`:`text-muted-foreground/50`);jl(i,{size:16,get class(){return B(e)}})}k(r);var a=R(r,2),o=I(a,!0);k(a),A(2),z(()=>{Ai(a,1,`text-3xl font-bold font-mono tracking-tight ${J.escalationCount>0?`text-destructive`:``}`),K(o,J.escalationCount)}),G(e,n)},$$slots:{default:!0}})}var w=R(C,2);yc(w,{"data-testid":`stat-scheduled`,class:`group p-4 hover:border-primary/30 transition-colors`,children:(e,t)=>{var n=$u(),r=L(n);Bl(R(I(r),2),{size:16,class:`text-muted-foreground/50`}),k(r);var i=R(r,2),a=I(i,!0);k(i),A(2),z(()=>K(a,J.daemonStatus?.jobs.enabled??0)),G(e,n)},$$slots:{default:!0}}),yc(R(w,2),{"data-testid":`stat-running`,class:`group p-4 hover:border-warning/30 transition-colors`,children:(e,t)=>{var n=td(),r=L(n),i=R(I(r),2),a=e=>{G(e,ed())},o=e=>{Yl(e,{size:16,class:`text-muted-foreground/50`})};q(i,e=>{(J.daemonStatus?.jobs.running??0)>0?e(a):e(o,-1)}),k(r);var s=R(r,2),c=I(s,!0);k(s),A(2),z(()=>K(c,J.daemonStatus?.jobs.running??0)),G(e,n)},$$slots:{default:!0}}),k(x);var T=R(x,2),ee=e=>{var t=pd(),n=I(t),r=R(I(n),2);Yu(R(I(r)),{size:12,weight:`bold`}),k(r),k(n);var i=R(n,2);yc(i,{class:`overflow-hidden`,children:(e,t)=>{var n=ad(),r=L(n),i=I(r),a=I(i);pu(R(I(a),2),{size:16,class:`text-muted-foreground/50`,weight:`duotone`}),k(a);var o=R(a,2),s=I(o,!0);k(o),A(2),k(i);var c=R(i,2),p=I(c),h=R(I(p),2);{let e=N(()=>B(l).awaitingGate>0?`text-warning`:`text-muted-foreground/50`);Su(h,{size:16,get class(){return B(e)},weight:`duotone`})}k(p);var g=R(p,2),_=I(g,!0);k(g),A(2),k(c);var v=R(c,2),y=I(v);ju(R(I(y),2),{size:16,class:`text-success/60`,weight:`duotone`}),k(y);var b=R(y,2),x=I(b,!0);k(b),A(2),k(v);var S=R(v,2),C=I(S),w=R(I(C),2);{let e=N(()=>B(l).issues>0?`text-destructive`:`text-muted-foreground/50`);Bu(w,{size:16,get class(){return B(e)},weight:`duotone`})}k(C);var T=R(C,2),ee=I(T,!0);k(T),A(2),k(S),k(r);var E=R(r,2),te=e=>{var t=id(),n=I(t),r=R(I(n),2),i=I(r);k(r),k(n);var a=R(n,2);fi(a,21,()=>B(d),e=>e.phase,(e,t)=>{var n=nd();z(e=>{Ai(n,1,`h-full ${m[B(t).phase]??``}`),Mi(n,`width: ${B(t).pct??``}%`),Ji(n,`title`,`${e??``}: ${B(t).count??``}`)},[()=>Xc(B(t).phase)]),G(e,n)}),k(a);var o=R(a,2);fi(o,21,()=>B(d),e=>e.phase,(e,t)=>{var n=rd(),r=I(n),i=R(r,2),a=I(i,!0);k(i);var o=R(i,2),s=I(o,!0);k(o),k(n),z(e=>{Ai(r,1,`w-2 h-2 rounded-full shrink-0 ${m[B(t).phase]??``}`),K(a,e),K(s,B(t).count)},[()=>Xc(B(t).phase)]),G(e,n)}),k(o),k(t),z(e=>K(i,`${B(u).total??``} run${B(u).total===1?``:`s`} · ${e??``} tokens`),[()=>dl(B(f))]),G(e,t)};q(E,e=>{B(u).total>0&&e(te)}),z(()=>{K(s,B(l).active),Ai(g,1,`text-3xl font-bold font-mono tracking-tight ${B(l).awaitingGate>0?`text-warning`:``}`),K(_,B(l).awaitingGate),K(x,B(l).completed),Ai(T,1,`text-3xl font-bold font-mono tracking-tight ${B(l).issues>0?`text-destructive`:``}`),K(ee,B(l).issues)}),G(e,n)},$$slots:{default:!0}});var a=R(i,2),o=e=>{var t=fd();Ac(I(t),{children:(e,t)=>{var n=dd(),r=L(n);Mc(r,{children:(e,t)=>{var n=od(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`Workflow`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Phase`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`State`))},$$slots:{default:!0}});var o=R(a,2);zc(o,{children:(e,t)=>{A(),G(e,U(`Round`))},$$slots:{default:!0}}),zc(R(o,2),{children:(e,t)=>{A(),G(e,U(`Started`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(r,2),{children:(e,t)=>{var n=W();fi(L(n),17,()=>B(s),e=>e.workflowId,(e,t)=>{Lc(e,{clickable:!0,onclick:()=>g(B(t).workflowId),children:(e,n)=>{var r=od(),i=L(r);Vc(i,{class:`font-mono font-medium text-primary text-xs`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).name)),G(e,r)},$$slots:{default:!0}});var a=R(i,2);Vc(a,{children:(e,n)=>{{let n=N(()=>gc(B(t).phase));Oc(e,{get variant(){return B(n)},children:(e,n)=>{var r=ld(),i=L(r),a=e=>{G(e,sd())},o=e=>{G(e,cd())};q(i,e=>{B(t).phase===`running`?e(a):B(t).phase===`waiting_human`&&e(o,1)});var s=R(i);z(e=>K(s,` ${e??``}`),[()=>Xc(B(t).phase)]),G(e,r)},$$slots:{default:!0}})}},$$slots:{default:!0}});var o=R(a,2);Vc(o,{class:`font-mono text-xs text-muted-foreground`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).currentState)),G(e,r)},$$slots:{default:!0}});var s=R(o,2);Vc(s,{class:`font-mono text-muted-foreground tabular-nums`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).maxRounds>0?`${B(t).round}/${B(t).maxRounds}`:`--`)),G(e,r)},$$slots:{default:!0}}),Vc(R(s,2),{class:`text-muted-foreground whitespace-nowrap`,children:(e,n)=>{var r=ud(),i=I(r,!0);k(r),z((e,t)=>{Ji(r,`title`,e),K(i,t)},[()=>new Date(B(t).startedAt).toLocaleString(),()=>il(B(t).startedAt)]),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(a,e=>{B(s).length>0&&e(o)}),k(t),Fr(`click`,r,h),G(e,t)};q(T,e=>{B(p)&&e(ee)});var E=R(T,2),te=e=>{var t=_d();Ac(R(I(t),2),{children:(e,t)=>{var i=dd(),a=L(i);Mc(a,{children:(e,t)=>{var n=md(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`ID`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Source`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`Status`))},$$slots:{default:!0}});var o=R(a,2);zc(o,{children:(e,t)=>{A(),G(e,U(`Turns`))},$$slots:{default:!0}});var s=R(o,2);zc(s,{children:(e,t)=>{A(),G(e,U(`Cost`))},$$slots:{default:!0}}),zc(R(s,2),{children:(e,t)=>{A(),G(e,U(`Started`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(a,2),{children:(e,t)=>{var i=W();fi(L(i),17,()=>[...J.sessions.values()],e=>e.label,(e,t)=>{Lc(e,{clickable:!0,onclick:()=>{J.selectedSessionLabel=B(t).label,J.currentView=`sessions`},children:(e,i)=>{var a=md(),o=L(a);Vc(o,{class:`font-mono font-medium text-primary`,children:(e,n)=>{A();var r=U();z(()=>K(r,`#${B(t).label??``}`)),G(e,r)},$$slots:{default:!0}});var s=R(o,2);Vc(s,{children:(e,n)=>{Oc(e,{variant:`secondary`,class:`font-mono`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).source.kind)),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var c=R(s,2);Vc(c,{children:(e,n)=>{{let n=N(()=>B(t).status===`processing`?`warning`:B(t).status===`ready`?`success`:`secondary`);Oc(e,{get variant(){return B(n)},children:(e,n)=>{var r=ld(),i=L(r),a=e=>{G(e,hd())},o=e=>{G(e,gd())};q(i,e=>{B(t).status===`processing`?e(a):B(t).status===`ready`&&e(o,1)});var s=R(i);z(()=>K(s,` ${B(t).status??``}`)),G(e,r)},$$slots:{default:!0}})}},$$slots:{default:!0}});var l=R(c,2);Vc(l,{class:`font-mono text-muted-foreground`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).turnCount)),G(e,r)},$$slots:{default:!0}});var u=R(l,2);Vc(u,{class:`font-mono`,children:(e,n)=>{A();var i=U();z(e=>K(i,e),[()=>r(B(t).budget.estimatedCostUsd)]),G(e,i)},$$slots:{default:!0}}),Vc(R(u,2),{class:`text-muted-foreground`,children:(e,r)=>{A();var i=U();z(e=>K(i,e),[()=>n(B(t).createdAt)]),G(e,i)},$$slots:{default:!0}}),G(e,a)},$$slots:{default:!0}})}),G(e,i)},$$slots:{default:!0}}),G(e,i)},$$slots:{default:!0}}),k(t),G(e,t)};q(E,e=>{J.sessions.size>0&&e(te)});var ne=R(E,2),re=e=>{var t=bd();Ac(R(I(t),2),{children:(e,t)=>{var n=dd(),r=L(n);Mc(r,{children:(e,t)=>{var n=vd(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`Name`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Schedule`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`Next Run`))},$$slots:{default:!0}}),zc(R(a,2),{children:(e,t)=>{A(),G(e,U(`Status`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(r,2),{children:(e,t)=>{var n=W();fi(L(n),17,()=>J.jobs.filter(e=>e.job.enabled).slice(0,5),e=>e.job.id,(e,t)=>{Lc(e,{children:(e,n)=>{var r=vd(),i=L(r);Vc(i,{class:`font-medium`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).job.name)),G(e,r)},$$slots:{default:!0}});var a=R(i,2);Vc(a,{class:`font-mono text-xs text-muted-foreground`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).job.schedule)),G(e,r)},$$slots:{default:!0}});var o=R(a,2);Vc(o,{class:`text-muted-foreground text-xs`,children:(e,n)=>{A();var r=U();z(e=>K(r,e),[()=>B(t).nextRun?new Date(B(t).nextRun).toLocaleString():`--`]),G(e,r)},$$slots:{default:!0}}),Vc(R(o,2),{children:(e,n)=>{var r=W(),i=L(r),a=e=>{Oc(e,{variant:`warning`,children:(e,t)=>{var n=yd();A(),G(e,n)},$$slots:{default:!0}})},o=e=>{Oc(e,{variant:`success`,children:(e,t)=>{A(),G(e,U(`idle`))},$$slots:{default:!0}})};q(i,e=>{B(t).isRunning?e(a):e(o,-1)}),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(ne,e=>{J.jobs.length>0&&e(re)});var ie=R(ne,2),ae=e=>{yc(e,{class:`p-12 text-center`,children:(e,t)=>{var n=xd();iu(L(n),{size:40,class:`mx-auto text-muted-foreground/30 mb-4`}),A(4),G(e,n)},$$slots:{default:!0}})};q(ie,e=>{J.sessions.size===0&&J.jobs.length===0&&!B(p)&&e(ae)}),k(_),G(e,_),M()}Ir([`click`]);var wd=new Set([`$$slots`,`$$events`,`$$legacy`,`variant`,`size`,`loading`,`class`,`children`,`disabled`]),Td=V(`<span class="w-3 h-3 border-2 border-current/30 border-t-current rounded-full animate-spin"></span>`),Ed=V(`<button><!> <!></button>`);function Dd(e,t){j(t,!0);let n={default:`bg-primary text-primary-foreground hover:brightness-110`,destructive:`bg-destructive text-destructive-foreground hover:brightness-110`,outline:`border border-border bg-transparent hover:bg-accent hover:text-accent-foreground`,ghost:`hover:bg-accent/50 hover:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-accent`,success:`bg-success text-success-foreground hover:brightness-110`},r={default:`px-4 py-2 text-sm`,sm:`px-2.5 py-1 text-xs`,lg:`px-6 py-3 text-base`,icon:`h-8 w-8`},i=ca(t,`variant`,3,`default`),a=ca(t,`size`,3,`default`),o=ca(t,`loading`,3,!1),s=sa(t,wd);var c=Ed();Xi(c,e=>({class:e,disabled:t.disabled||o(),...s}),[()=>hc(`inline-flex items-center justify-center gap-1.5 rounded-md font-medium`,`transition-all active:scale-[0.97]`,`disabled:opacity-50 disabled:pointer-events-none`,n[i()],r[a()],t.class)]);var l=I(c),u=e=>{G(e,Td())};q(l,e=>{o()&&e(u)});var d=R(l,2),f=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(d,e=>{t.children&&e(f)}),k(c),G(e,c),M()}var Od=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`value`]),kd=V(`<input/>`);function Ad(e,t){j(t,!0);let n=ca(t,`value`,15,``),r=sa(t,Od);var i=kd();Xi(i,e=>({class:e,...r}),[()=>hc(`w-full px-3 py-2.5 bg-background border border-border rounded-lg text-sm`,`focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring`,`placeholder:text-muted-foreground/50 transition-all disabled:opacity-50`,t.class)],void 0,void 0,void 0,!0),ea(i,n),G(e,i),M()}var jd=V(`<option> </option>`),Md=V(`<option> <!></option>`),Nd=V(`<span class="mt-1 block text-xs text-muted-foreground">Loading personas...</span>`),Pd=V(`<span class="mt-1 block text-xs text-muted-foreground">No personas available</span>`),Fd=V(`<div class="px-4 py-2 text-xs text-destructive bg-destructive/10 border-b border-border"> </div>`),Id=V(`<div class="w-full text-left px-4 py-3 border-b border-border text-sm bg-accent/20 animate-pulse"><div class="flex items-center justify-between"><span class="font-mono font-medium text-muted-foreground">Starting...</span> <span class="w-3 h-3 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"></span></div> <div class="text-xs text-muted-foreground mt-1">New session</div></div>`),Ld=V(`<button><div class="flex items-center justify-between"><span class="font-mono font-medium"> </span> <span class="text-xs text-muted-foreground"> <!></span></div> <div class="text-xs text-muted-foreground mt-1"> </div> <!></button>`),Rd=V(`<div class="p-4 text-sm text-muted-foreground text-center">No active sessions</div>`),zd=V(`<div data-testid="session-sidebar" class="w-64 border-r border-border bg-sidebar flex flex-col shrink-0 min-h-0"><div class="px-4 py-3 border-b border-border"><h3 class="text-sm font-semibold uppercase tracking-wider text-muted-foreground">Sessions</h3></div> <div class="px-3 py-3 border-b border-border bg-card/40"><form data-testid="session-launch-form" class="space-y-2.5"><div class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">Launch options</div> <label class="block"><span class="text-xs text-muted-foreground">Workspace</span> <!></label> <label class="block"><span class="text-xs text-muted-foreground">Provider profile</span> <select data-testid="launch-provider" class="mt-1 w-full px-2 py-1.5 bg-background border border-border rounded-lg text-xs focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring"><option>Default</option><!></select></label> <label class="block"><span class="text-xs text-muted-foreground">Model</span> <!></label> <label class="block"><span class="text-xs text-muted-foreground">Persona</span> <select data-testid="launch-persona" class="mt-1 w-full px-2 py-1.5 bg-background border border-border rounded-lg text-xs focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring"><option>Default</option><!></select> <!></label> <!></form></div> <!> <div class="flex-1 overflow-auto"><!> <!> <!></div></div>`);function Bd(e,t){j(t,!0);let n=P(on([])),r=P(!1),i=P(``),a=P(``),o=P(``),s=P(``),c=P(on([]));async function l(){F(r,!0);try{F(n,await t.loadPersonasFn(),!0)}catch{F(n,[],!0)}finally{F(r,!1)}}async function u(){if(!t.loadProviderProfilesFn){F(c,[],!0);return}try{F(c,await t.loadProviderProfilesFn(),!0)}catch{F(c,[],!0)}}ii(()=>{l(),u()});function d(){if(t.creating)return;let e=B(i)||void 0,n=B(a).trim(),r=B(s).trim();t.oncreate({...e?{persona:e}:{},...n?{workspacePath:n}:{},...B(o)?{providerProfileName:B(o)}:{},...r?{model:r}:{}})}function f(e){e.preventDefault(),!t.creating&&d()}var p=zd(),m=R(I(p),2),h=I(m),g=R(I(h),2);Ad(R(I(g),2),{"data-testid":`launch-workspace`,placeholder:`/path/to/workspace (optional)`,class:`mt-1 px-2 py-1.5 text-xs`,get disabled(){return t.creating},get value(){return B(a)},set value(e){F(a,e,!0)}}),k(g);var _=R(g,2),v=R(I(_),2),y=I(v);y.value=y.__value=``,fi(R(y),16,()=>B(c),e=>e,(e,t)=>{var n=jd(),r=I(n,!0);k(n);var i={};z(()=>{K(r,t),i!==(i=t)&&(n.value=(n.__value=t)??``)}),G(e,n)}),k(v),k(_);var b=R(_,2);Ad(R(I(b),2),{"data-testid":`launch-model`,placeholder:`Profile default (optional)`,class:`mt-1 px-2 py-1.5 text-xs`,get disabled(){return t.creating},get value(){return B(s)},set value(e){F(s,e,!0)}}),k(b);var x=R(b,2),S=R(I(x),2),C=I(S);C.value=C.__value=``,fi(R(C),17,()=>B(n),e=>e.name,(e,t)=>{var n=Md(),r=I(n,!0),i=R(r),a=e=>{G(e,U(`(not compiled)`))};q(i,e=>{B(t).compiled||e(a)}),k(n);var o={};z(()=>{n.disabled=!B(t).compiled,K(r,B(t).name),o!==(o=B(t).name)&&(n.value=(n.__value=B(t).name)??``)}),G(e,n)}),k(S);var w=R(S,2),T=e=>{G(e,Nd())},ee=e=>{G(e,Pd())};q(w,e=>{B(r)?e(T):B(n).length===0&&e(ee,1)}),k(x),Dd(R(x,2),{"data-testid":`launch-start`,type:`submit`,variant:`default`,size:`sm`,class:`w-full`,get loading(){return t.creating},children:(e,n)=>{A();var r=U();z(()=>K(r,t.creating?`Starting...`:`Start session`)),G(e,r)},$$slots:{default:!0}}),k(h),k(m);var E=R(m,2),te=e=>{var n=Fd(),r=I(n,!0);k(n),z(()=>K(r,t.createError)),G(e,n)};q(E,e=>{t.createError&&e(te)});var ne=R(E,2),re=I(ne),ie=e=>{G(e,Id())};q(re,e=>{t.creating&&e(ie)});var ae=R(re,2);fi(ae,17,()=>[...t.sessions.values()],e=>e.label,(e,n)=>{var r=Ld(),i=I(r),a=I(i),o=I(a);k(a);var s=R(a,2),c=I(s,!0),l=R(c),u=e=>{var t=U();z(()=>K(t,` · ${B(n).persona??``}`)),G(e,t)};q(l,e=>{B(n).persona&&e(u)}),k(s),k(i);var d=R(i,2),f=I(d);k(d);var p=R(d,2),m=e=>{Oc(e,{variant:`destructive`,class:`mt-1`,children:(e,t)=>{A(),G(e,U(`escalation`))},$$slots:{default:!0}})};q(p,e=>{B(n).hasPendingEscalation&&e(m)}),k(r),z(e=>{Ji(r,`data-testid`,`session-item-${B(n).label??``}`),Ai(r,1,`w-full text-left px-4 py-3 border-b border-border text-sm transition-colors
|
|
3
|
+
${t.selectedLabel===B(n).label?`bg-accent`:`hover:bg-accent/30`}`),K(o,`#${B(n).label??``}`),K(c,B(n).source.kind),K(f,`${B(n).turnCount??``} turns · ${e??``}`)},[()=>B(n).budget.estimatedCostUsd.toFixed(2)]),Fr(`click`,r,()=>t.onselect(B(n).label)),G(e,r)});var D=R(ae,2),oe=e=>{G(e,Rd())};q(D,e=>{t.sessions.size===0&&!t.creating&&e(oe)}),k(ne),k(p),z(()=>{v.disabled=t.creating,S.disabled=t.creating}),Pr(`submit`,h,f),Fi(v,()=>B(o),e=>F(o,e)),Fi(S,()=>B(i),e=>F(i,e)),G(e,p),M()}Ir([`click`]);var Vd=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,Ud=(e,t)=>{for(var n in t)Vd(e,n,{get:t[n],enumerable:!0})},Wd=(e,t,n,r)=>{for(var i=r>1?void 0:r?Hd(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Vd(t,n,i),i},Z=(e,t)=>(n,r)=>t(n,r,e),Gd=`Terminal input`,Kd={get:()=>Gd,set:e=>Gd=e},qd=`Too much output to announce, navigate to rows manually to read`,Jd={get:()=>qd,set:e=>qd=e};function Yd(e){return e.replace(/\r?\n/g,`\r`)}function Xd(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function Zd(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Qd(e,t,n,r){e.stopPropagation(),e.clipboardData&&$d(e.clipboardData.getData(`text/plain`),t,n,r)}function $d(e,t,n,r){e=Yd(e),e=Xd(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function ef(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function tf(e,t,n,r,i){ef(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function nf(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function rf(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var af=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},of=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},sf=``,cf=` `,lf=class e{constructor(){this.fg=0,this.bg=0,this.extended=new uf}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},uf=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},df=class e extends lf{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new uf,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?nf(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ff=`di$target`,pf=`di$dependencies`,mf=new Map;function hf(e){return e[pf]||[]}function gf(e){if(mf.has(e))return mf.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);_f(t,e,r)};return t._id=e,mf.set(e,t),t}function _f(e,t,n){t[ff]===t?t[pf].push({id:e,index:n}):(t[pf]=[{id:e,index:n}],t[ff]=t)}var vf=gf(`BufferService`),yf=gf(`CoreMouseService`),bf=gf(`CoreService`),xf=gf(`CharsetService`),Sf=gf(`InstantiationService`),Cf=gf(`LogService`),wf=gf(`OptionsService`),Tf=gf(`OscLinkService`),Ef=gf(`UnicodeService`),Df=gf(`DecorationService`),Of=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new df,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):kf(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Of=Wd([Z(0,vf),Z(1,wf),Z(2,Tf)],Of);function kf(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
|
+
|
|
5
|
+
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Af=gf(`CharSizeService`),jf=gf(`CoreBrowserService`),Mf=gf(`MouseService`),Nf=gf(`RenderService`),Pf=gf(`SelectionService`),Ff=gf(`CharacterJoinerService`),If=gf(`ThemeService`),Lf=gf(`LinkProviderService`),Rf=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Wf.isErrorNoTelemetry(e)?new Wf(e.message+`
|
|
6
|
+
|
|
7
|
+
`+e.stack):Error(e.message+`
|
|
8
|
+
|
|
9
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function zf(e){Vf(e)||Rf.onUnexpectedError(e)}var Bf=`Canceled`;function Vf(e){return e instanceof Hf?!0:e instanceof Error&&e.name===Bf&&e.message===Bf}var Hf=class extends Error{constructor(){super(Bf),this.name=this.message}};function Uf(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var Wf=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},Gf=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function Kf(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?i=n+1:a=n}return i-1}var qf=class e{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate){for(let e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}this._prevFindLastPredicate=t}let n=Kf(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};qf.assertInvariants=!1;function Jf(e,t=0){return e[e.length-(1+t)]}var Yf;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Yf||={});function Xf(e,t){return(n,r)=>t(e(n),e(r))}var Zf=(e,t)=>e-t,Qf=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Yf.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};Qf.empty=new Qf(e=>{});function $f(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}var ep=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function tp(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var np;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(np||={});var rp=!1,ip=null,ap=class e{constructor(){this.livingDisposables=new Map}getDisposableData(t){let n=this.livingDisposables.get(t);return n||(n={parent:null,source:null,isSingleton:!1,value:t,idx:e.idx++},this.livingDisposables.set(t,n)),n}trackDisposable(e){let t=this.getDisposableData(e);t.source||=Error().stack}setParent(e,t){let n=this.getDisposableData(e);n.parent=t}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,t){let n=t.get(e);if(n)return n;let r=e.parent?this.getRootParent(this.getDisposableData(e.parent),t):e;return t.set(e,r),r}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,t])=>t.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(`
|
|
10
|
+
`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new ep;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(`
|
|
11
|
+
`),e)}n.sort(Xf(e=>e.idx,Zf));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;t<e.length;t++){let a=e[t];a=`(shared with ${i.get(e.slice(0,t+1).join(`
|
|
12
|
+
`)).size}/${n.length} leaks) at ${a}`;let o=$f([...i.get(e.slice(0,t).join(`
|
|
13
|
+
`))].map(e=>r(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=`
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ====================
|
|
17
|
+
${s.join(`
|
|
18
|
+
`)}
|
|
19
|
+
============================================================
|
|
20
|
+
|
|
21
|
+
`}return n.length>e&&(a+=`
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
... and ${n.length-e} more leaking disposables
|
|
25
|
+
|
|
26
|
+
`),{leaks:n,details:a}}};ap.idx=0;function op(e){ip=e}if(rp){let e=`__is_disposable_tracked__`;op(new class{trackDisposable(t){let n=Error(`Potentially leaked disposable`).stack;setTimeout(()=>{t[e]||console.log(n)},3e3)}setParent(t,n){if(t&&t!==_p.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==_p.None)try{t[e]=!0}catch{}}markAsSingleton(e){}})}function sp(e){return ip?.trackDisposable(e),e}function cp(e){ip?.markAsDisposed(e)}function lp(e,t){ip?.setParent(e,t)}function up(e,t){if(ip)for(let n of e)ip.setParent(n,t)}function dp(e){return ip?.markAsSingleton(e),e}function fp(e){if(np.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function pp(...e){let t=mp(()=>fp(e));return up(e,t),t}function mp(e){let t=sp({dispose:tp(()=>{cp(t),e()})});return t}var hp=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,sp(this)}dispose(){this._isDisposed||(cp(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{fp(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return lp(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),lp(e,null))}};hp.DISABLE_DISPOSED_WARNING=!1;var gp=hp,_p=class{constructor(){this._store=new gp,sp(this),lp(this._store,this)}dispose(){cp(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};_p.None=Object.freeze({dispose(){}});var vp=class{constructor(){this._isDisposed=!1,sp(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&lp(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,cp(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&lp(e,null),e}},yp=typeof window==`object`?window:globalThis,bp=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};bp.Undefined=new bp(void 0);var xp=bp,Sp=class{constructor(){this._first=xp.Undefined,this._last=xp.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===xp.Undefined}clear(){let e=this._first;for(;e!==xp.Undefined;){let t=e.next;e.prev=xp.Undefined,e.next=xp.Undefined,e=t}this._first=xp.Undefined,this._last=xp.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new xp(e);if(this._first===xp.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==xp.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==xp.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==xp.Undefined&&e.next!==xp.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===xp.Undefined&&e.next===xp.Undefined?(this._first=xp.Undefined,this._last=xp.Undefined):e.next===xp.Undefined?(this._last=this._last.prev,this._last.next=xp.Undefined):e.prev===xp.Undefined&&(this._first=this._first.next,this._first.prev=xp.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==xp.Undefined;)yield e.element,e=e.next}},Cp=globalThis.performance&&typeof globalThis.performance.now==`function`,wp=class e{static create(t){return new e(t)}constructor(e){this._now=Cp&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},Tp=!1,Ep=!1,Dp=!1,Op;(e=>{e.None=()=>_p.None;function t(e){if(Dp){let{onDidAddListener:t}=e,n=Pp.create(),r=0;e.onDidAddListener=()=>{++r===2&&(console.warn(`snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here`),n.print()),t?.()}}}function n(e,t){return f(e,()=>{},0,void 0,!0,void 0,t)}e.defer=n;function r(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(pp(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,n){let r,i={onWillAddFirstListener(){r=e(a.fire,a)},onDidRemoveLastListener(){r?.dispose()}};n||t(i);let a=new Q(i);return n?.add(a),a.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,n,r=100,i=!1,a=!1,o,s){let c,l,u,d=0,f,p={leakWarningThreshold:o,onWillAddFirstListener(){c=e(e=>{d++,l=n(l,e),i&&!u&&(m.fire(l),l=void 0),f=()=>{let e=l;l=void 0,u=void 0,(!i||d>1)&&m.fire(e),d=0},typeof r==`number`?(clearTimeout(u),u=setTimeout(f,r)):u===void 0&&(u=0,queueMicrotask(f))})},onWillRemoveListener(){a&&d>0&&f?.()},onDidRemoveLastListener(){f=void 0,c.dispose()}};s||t(p);let m=new Q(p);return s?.add(m),m.event}e.debounce=f;function p(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=p;function m(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=m;function h(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=h;function g(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new Q({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=g;function _(e,t){return(n,r,i)=>{let a=t(new y);return e(function(e){let t=a.evaluate(e);t!==v&&n.call(r,t)},void 0,i)}}e.chain=_;let v=Symbol(`HaltChainable`);class y{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:v),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:v}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===v)break;return e}}function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Q({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=b;function x(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Q({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=x;function S(e){return new Promise(t=>r(e)(t))}e.toPromise=S;function C(e){let t=new Q;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=C;function w(e,t){return e(e=>t.fire(e))}e.forward=w;function T(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=T;class ee{constructor(e,n){this._observable=e,this._counter=0,this._hasChanged=!1;let r={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};n||t(r),this.emitter=new Q(r),n&&n.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function E(e,t){return new ee(e,t).emitter.event}e.fromObservable=E;function te(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof gp?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=te})(Op||={});var kp=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new wp,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};kp.all=new Set,kp._idPool=0;var Ap=kp,jp=-1,Mp=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new Fp(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};Mp._idPool=1;var Np=Mp,Pp=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
|
|
27
|
+
`).slice(2).join(`
|
|
28
|
+
`))}},Fp=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Ip=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Lp=0,Rp=class{constructor(e){this.value=e,this.id=Lp++}},zp=2,Bp=(e,t)=>{if(e instanceof Rp)t(e);else for(let n=0;n<e.length;n++){let r=e[n];r&&t(r)}},Vp;if(Tp){let e=[];setInterval(()=>{e.length!==0&&(console.warn(`[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:`),console.warn(e.join(`
|
|
29
|
+
`)),e.length=0)},3e3),Vp=new FinalizationRegistry(t=>{typeof t==`string`&&e.push(t)})}var Q=class{constructor(e){this._size=0,this._options=e,this._leakageMon=jp>0||this._options?.leakWarningThreshold?new Np(e?.onListenerError??zf,this._options?.leakWarningThreshold??jp):void 0,this._perfMon=this._options?._profName?new Ap(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Ep){let e=this._listeners;queueMicrotask(()=>{Bp(e,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Ip(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||zf)(n),_p.None}if(this._disposed)return _p.None;t&&(e=e.bind(t));let r=new Rp(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Pp.create(),i=this._leakageMon.check(r.stack,this._size+1)),Ep&&(r.stack=Pp.create()),this._listeners?this._listeners instanceof Rp?(this._deliveryQueue??=new Hp,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=mp(()=>{Vp?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof gp?n.add(a):Array.isArray(n)&&n.push(a),Vp){let e=Error().stack.split(`
|
|
30
|
+
`).slice(2,3).join(`
|
|
31
|
+
`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);Vp.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*zp<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||zf;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Rp)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Hp=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Up=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Q,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Up.INSTANCE=new Up;var Wp=Up;function Gp(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Wp.INSTANCE.onDidChangeZoomLevel;function Kp(e){return Wp.INSTANCE.getZoomFactor(e)}Wp.INSTANCE.onDidChangeFullscreen;var qp=typeof navigator==`object`?navigator.userAgent:``,Jp=qp.indexOf(`Firefox`)>=0,Yp=qp.indexOf(`AppleWebKit`)>=0,Xp=qp.indexOf(`Chrome`)>=0,Zp=!Xp&&qp.indexOf(`Safari`)>=0;qp.indexOf(`Electron/`),qp.indexOf(`Android`);var Qp=!1;if(typeof yp.matchMedia==`function`){let e=yp.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=yp.matchMedia(`(display-mode: fullscreen)`);Qp=e.matches,Gp(yp,e,({matches:e})=>{Qp&&t.matches||(Qp=e)})}function $p(){return Qp}var em=`en`,tm=!1,nm=!1,rm=!1,im=!1,am=!1,om=em,sm,cm=globalThis,lm;typeof cm.vscode<`u`&&typeof cm.vscode.process<`u`?lm=cm.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(lm=process);var um=typeof lm?.versions?.electron==`string`&&lm?.type===`renderer`;if(typeof lm==`object`){tm=lm.platform===`win32`,nm=lm.platform===`darwin`,rm=lm.platform===`linux`,rm&&lm.env.SNAP&&lm.env.SNAP_REVISION,lm.env.CI||lm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,om=em;let e=lm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,om=t.resolvedLanguage||em,t.languagePack?.translationsConfigFile}catch{}im=!0}else typeof navigator==`object`&&!um?(sm=navigator.userAgent,tm=sm.indexOf(`Windows`)>=0,nm=sm.indexOf(`Macintosh`)>=0,(sm.indexOf(`Macintosh`)>=0||sm.indexOf(`iPad`)>=0||sm.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,rm=sm.indexOf(`Linux`)>=0,sm?.indexOf(`Mobi`),am=!0,om=globalThis._VSCODE_NLS_LANGUAGE||em,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var dm=tm,fm=nm,pm=rm,mm=im;am&&typeof cm.importScripts==`function`&&cm.origin;var hm=sm,gm=om,_m;(e=>{function t(){return gm}e.value=t;function n(){return gm.length===2?gm===`en`:gm.length>=3?gm[0]===`e`&&gm[1]===`n`&&gm[2]===`-`:!1}e.isDefaultVariant=n;function r(){return gm===`en`}e.isDefault=r})(_m||={});var vm=typeof cm.postMessage==`function`&&!cm.importScripts;(()=>{if(vm){let e=[];cm.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),cm.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var ym=!!(hm&&hm.indexOf(`Chrome`)>=0);hm&&hm.indexOf(`Firefox`),!ym&&hm&&hm.indexOf(`Safari`),hm&&hm.indexOf(`Edg/`),hm&&hm.indexOf(`Android`);var bm=typeof navigator==`object`?navigator:{};mm||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||bm&&bm.clipboard&&bm.clipboard.writeText,mm||bm&&bm.clipboard&&bm.clipboard.readText,mm||$p()||bm.keyboard,`ontouchstart`in yp||bm.maxTouchPoints,yp.PointerEvent&&(`ontouchstart`in yp||navigator.maxTouchPoints);var xm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Sm=new xm,Cm=new xm,wm=new xm,Tm=Array(230),Em;(e=>{function t(e){return Sm.keyCodeToStr(e)}e.toString=t;function n(e){return Sm.strToKeyCode(e)}e.fromString=n;function r(e){return Cm.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return wm.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Cm.strToKeyCode(e)||wm.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return Sm.keyCodeToStr(e)}e.toElectronAccelerator=o})(Em||={});var Dm=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Om([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Om=class{constructor(e){if(e.length===0)throw Uf(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function km(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return Em.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(Jp)switch(t){case 59:return 85;case 60:if(pm)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(fm)return 57;break}else if(Yp&&(fm&&t===93||!fm&&t===92))return 57;return Tm[t]||0}var Am=fm?256:2048,jm=512,Mm=1024,Nm=fm?2048:256,Pm=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=km(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Am),this.altKey&&(t|=jm),this.shiftKey&&(t|=Mm),this.metaKey&&(t|=Nm),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Dm(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Fm=new WeakMap;function Im(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var Lm=class{static getSameOriginWindowChain(e){let t=Fm.get(e);if(!t){t=[],Fm.set(e,t);let n=e,r;do r=Im(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},Rm=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Lm.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},zm=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(Xp){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)r?this.deltaY=t.wheelDeltaY/(120*i):this.deltaY=t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;t.deltaMode===t.DOM_DELTA_LINE?Jp&&!fm?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)Zp&&dm?this.deltaX=-(t.wheelDeltaX/120):r?this.deltaX=t.wheelDeltaX/(120*i):this.deltaX=t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;t.deltaMode===t.DOM_DELTA_LINE?Jp&&!fm?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*i):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},Bm=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Vm;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Hm?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Op.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Bm})})(Vm||={});var Hm=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Bm:(this._emitter||=new Q,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},Um=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Gf(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Gf(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Wm=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Gf(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=mp(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Gm;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Gm||={});var Km=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Q,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Op.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Km.EMPTY=Km.fromArray([]);function qm(e){return 55296<=e&&e<=56319}function Jm(e){return 56320<=e&&e<=57343}function Ym(e,t){return(e-55296<<10)+(t-56320)+65536}function Xm(e){return Zm(e,0)}function Zm(e,t){switch(typeof e){case`object`:return e===null?Qm(349,t):Array.isArray(e)?th(e,t):nh(e,t);case`string`:return eh(e,t);case`boolean`:return $m(e,t);case`number`:return Qm(e,t);case`undefined`:return Qm(937,t);default:return Qm(617,t)}}function Qm(e,t){return(t<<5)-t+e|0}function $m(e,t){return Qm(e?433:863,t)}function eh(e,t){t=Qm(149417,t);for(let n=0,r=e.length;n<r;n++)t=Qm(e.charCodeAt(n),t);return t}function th(e,t){return t=Qm(104579,t),e.reduce((e,t)=>Zm(t,e),t)}function nh(e,t){return t=Qm(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=eh(n,t),Zm(e[n],t)),t)}function rh(e,t,n=32){let r=n-t,i=~((1<<r)-1);return(e<<t|(i&e)>>>r)>>>0}function ih(e,t=0,n=e.byteLength,r=0){for(let i=0;i<n;i++)e[t+i]=r}function ah(e,t,n=`0`){for(;e.length<t;)e=n+e;return e}function oh(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,`0`)).join(``):ah((e>>>0).toString(16),t/4)}var sh=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(qm(a))if(o+1<t){let t=e.charCodeAt(o+1);Jm(t)?(o++,s=Ym(a,t)):s=65533}else{i=a;break}else Jm(a)&&(s=65533);if(r=this._push(n,r,s),o++,o<t)a=e.charCodeAt(o);else break}this._buffLen=r,this._leftoverHighSurrogate=i}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(n&1984)>>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),oh(this._h0)+oh(this._h1)+oh(this._h2)+oh(this._h3)+oh(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,ih(this._buff,this._buffLen),this._buffLen>56&&(this._step(),ih(this._buff));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,rh(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=rh(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=rh(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}};sh._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:ch,getWindow:lh,getDocument:uh,getWindows:dh,getWindowsCount:fh,getWindowId:ph,getWindowById:mh,hasWindow:hh,onDidRegisterWindow:gh,onWillUnregisterWindow:_h,onDidUnregisterWindow:vh}=function(){let e=new Map,t={window:yp,disposables:new gp};e.set(yp.vscodeWindowId,t);let n=new Q,r=new Q,i=new Q;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return _p.None;let a=new gp,o={window:t,disposables:a.add(new gp)};return e.set(t.vscodeWindowId,o),a.add(mp(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(bh(t,kh.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:yp},getDocument(e){return lh(e).document}}}(),yh=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function bh(e,t,n,r){return new yh(e,t,n,r)}function xh(e,t){return function(n){return t(new Rm(e,n))}}function Sh(e){return function(t){return e(new Pm(t))}}var Ch=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=xh(lh(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=Sh(n)),bh(e,t,i,r)},wh,Th=class extends Wm{constructor(e){super(),this.defaultTarget=e&&lh(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},Eh=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){zf(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(Eh.sort),a.shift().execute();r.set(i,!1)};wh=(t,r,a=0)=>{let o=ph(t),s=new Eh(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var Dh=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};Dh.None=new Dh(0,0);function Oh(e){let t=e.getBoundingClientRect(),n=lh(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Xm(n),a=r.get(i);if(a)a.users+=1;else{let o=new Q,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(mp(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var kh={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:Yp?`webkitAnimationStart`:`animationstart`,ANIMATION_END:Yp?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:Yp?`webkitAnimationIteration`:`animationiteration`},Ah=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function jh(e,t,n,...r){let i=Ah.exec(t);if(!i)throw Error(`Bad use of emmet`);let a=i[1]||`div`,o;return o=e===`http://www.w3.org/1999/xhtml`?document.createElement(a):document.createElementNS(e,a),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g,` `).trim()),n&&Object.entries(n).forEach(([e,t])=>{typeof t>`u`||(/^on\w+$/.test(e)?o[e]=t:e===`selected`?t&&o.setAttribute(e,`true`):o.setAttribute(e,t))}),o.append(...r),o}function Mh(e,t,...n){return jh(`http://www.w3.org/1999/xhtml`,e,t,...n)}Mh.SVG=function(e,t,...n){return jh(`http://www.w3.org/2000/svg`,e,t,...n)};var Nh=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=Ph(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ph(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ph(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ph(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ph(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ph(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ph(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ph(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ph(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ph(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ph(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ph(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ph(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ph(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ph(e){return typeof e==`number`?`${e}px`:e}function Fh(e){return new Nh(e)}var Ih=class{constructor(){this._hooks=new gp,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(mp(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=lh(e)}this._hooks.add(bh(a,kh.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(bh(a,kh.POINTER_UP,e=>this.stopMonitoring(!0)))}};function Lh(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var Rh;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(Rh||={});var zh=class e extends _p{constructor(){super(),this.dispatched=!1,this.targets=new Sp,this.ignoreTargets=new Sp,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Op.runAndSubscribe(gh,({window:e,disposables:t})=>{t.add(bh(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(bh(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(bh(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:yp,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=dp(new e),mp(e.INSTANCE.targets.push(t))):_p.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=dp(new e),mp(e.INSTANCE.ignoreTargets.push(t))):_p.None}static isTouchDevice(){return`ontouchstart`in yp||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(Rh.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-Jf(s.rollingPageX))<30&&Math.abs(s.initialPageY-Jf(s.rollingPageY))<30){let e=this.newGestureEvent(Rh.Tap,s.initialTarget);e.pageX=Jf(s.rollingPageX),e.pageY=Jf(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-Jf(s.rollingPageX))<30&&Math.abs(s.initialPageY-Jf(s.rollingPageY))<30){let e=this.newGestureEvent(Rh.Contextmenu,s.initialTarget);e.pageX=Jf(s.rollingPageX),e.pageY=Jf(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=Jf(s.rollingPageX),n=Jf(s.rollingPageY),i=Jf(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(Rh.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===Rh.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Rh.Change||t.type===Rh.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=wh(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(Rh.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(Rh.Change,i.initialTarget);a.translationX=r.pageX-Jf(i.rollingPageX),a.translationY=r.pageY-Jf(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};zh.SCROLL_FRICTION=-.005,zh.HOLD_DELAY=700,zh.CLEAR_TAP_COUNT_TIME=400,Wd([Lh],zh,`isTouchDevice`,1);var Bh=zh,Vh=class extends _p{onclick(e,t){this._register(bh(e,kh.CLICK,n=>t(new Rm(lh(e),n))))}onmousedown(e,t){this._register(bh(e,kh.MOUSE_DOWN,n=>t(new Rm(lh(e),n))))}onmouseover(e,t){this._register(bh(e,kh.MOUSE_OVER,n=>t(new Rm(lh(e),n))))}onmouseleave(e,t){this._register(bh(e,kh.MOUSE_LEAVE,n=>t(new Rm(lh(e),n))))}onkeydown(e,t){this._register(bh(e,kh.KEY_DOWN,e=>t(new Pm(e))))}onkeyup(e,t){this._register(bh(e,kh.KEY_UP,e=>t(new Pm(e))))}oninput(e,t){this._register(bh(e,kh.INPUT,t))}onblur(e,t){this._register(bh(e,kh.BLUR,t))}onfocus(e,t){this._register(bh(e,kh.FOCUS,t))}onchange(e,t){this._register(bh(e,kh.CHANGE,t))}ignoreGesture(e){return Bh.ignoreTarget(e)}},Hh=11,Uh=class extends Vh{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=Hh+`px`,this.domNode.style.height=Hh+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new Ih),this._register(Ch(this.bgDomNode,kh.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(Ch(this.domNode,kh.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Th),this._pointerdownScheduleRepeatTimer=this._register(new Um)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,lh(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},Wh=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},Gh=class extends _p{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Wh(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new Yh(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=Yh.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},Kh=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function qh(e,t){let n=t-e;return function(t){return e+n*Zh(t)}}function Jh(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Yh=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),Jh(qh(e,r),qh(i,t),.33)}return qh(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new Kh(this.scrollLeft(t),this.scrollTop(t),!1):new Kh(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){return r+=10,new e(t,n,Date.now()-10,r)}};function Xh(e){return e**3}function Zh(e){return 1-Xh(1-e)}var Qh=class extends _p{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Um)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},$h=140,eg=class extends Vh{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Qh(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Ih),this._shouldRender=!0,this.domNode=Fh(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(bh(this.domNode.domNode,kh.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new Uh(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Fh(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(bh(this.slider.domNode,kh.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=Oh(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(dm&&a>$h){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},tg=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize===t?!1:(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize===t?!1:(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition===t?!1:(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},ng=class extends eg{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new tg(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},rg=class extends eg{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new tg(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},ig=500,ag=50,og=!0,sg=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},cg=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(Xp){let t=Kp(lh(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new sg(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};cg.INSTANCE=new cg;var lg=cg,ug=class extends Vh{constructor(e,t,n){super(),this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Q),this.onWillScroll=this._onWillScroll.event,this._options=fg(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new rg(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new ng(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Fh(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Fh(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Fh(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new Um),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=fp(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,fm&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new zm(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=fp(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(bh(this._listenOnDomNode,kh.MOUSE_WHEEL,e=>{this._onMouseWheel(new zm(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=lg.INSTANCE;og&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!fm&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=ag*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=ag*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(og&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),ig)}},dg=class extends ug{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function fg(e){let t={lazyRender:typeof e.lazyRender<`u`?e.lazyRender:!1,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<`u`?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`?e.horizontalHasArrows:!1,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,fm&&(t.className+=` mac`),t}var pg=class extends _p{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new Gh({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>wh(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new dg(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Op.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(mp(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(mp(()=>this._styleElement.remove())),this._register(Op.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
|
|
32
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};pg=Wd([Z(2,vf),Z(3,jf),Z(4,yf),Z(5,If),Z(6,wf),Z(7,Nf)],pg);var mg=class extends _p{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(mp(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};mg=Wd([Z(1,vf),Z(2,jf),Z(3,Df),Z(4,Nf)],mg);var hg=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},gg={full:0,left:0,center:0,right:0},_g={full:0,left:0,center:0,right:0},vg={full:0,left:0,center:0,right:0},yg=class extends _p{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new hg,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(mp(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);_g.full=this._canvas.width,_g.left=e,_g.center=t,_g.right=e,this._refreshDrawHeightConstants(),vg.full=1,vg.left=1,vg.center=1+_g.left,vg.right=1+_g.left+_g.center}_refreshDrawHeightConstants(){gg.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);gg.left=t,gg.center=t,gg.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gg.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gg.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gg.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gg.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(vg[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-gg[e.position||`full`]/2),_g[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+gg[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};yg=Wd([Z(2,vf),Z(3,Df),Z(4,Nf),Z(5,wf),Z(6,If),Z(7,jf)],yg);var $;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
|
|
33
|
+
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var bg;(e=>(e.PAD=``,e.HOP=``,e.BPH=``,e.NBH=``,e.IND=``,e.NEL=`
`,e.SSA=``,e.ESA=``,e.HTS=``,e.HTJ=``,e.VTS=``,e.PLD=``,e.PLU=``,e.RI=``,e.SS2=``,e.SS3=``,e.DCS=``,e.PU1=``,e.PU2=``,e.STS=``,e.CCH=``,e.MW=``,e.SPA=``,e.EPA=``,e.SOS=``,e.SGCI=``,e.SCI=``,e.CSI=``,e.ST=``,e.OSC=``,e.PM=``,e.APC=``))(bg||={});var xg;(e=>e.ST=`${$.ESC}\\`)(xg||={});var Sg=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Sg=Wd([Z(2,vf),Z(3,wf),Z(4,bf),Z(5,Nf)],Sg);var Cg=0,wg=0,Tg=0,Eg=0,Dg={css:`#00000000`,rgba:0},Og;(e=>{function t(e,t,n,r){return r===void 0?`#${Ng(e)}${Ng(t)}${Ng(n)}`:`#${Ng(e)}${Ng(t)}${Ng(n)}${Ng(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(Og||={});var kg;(e=>{function t(e,t){if(Eg=(t.rgba&255)/255,Eg===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return Cg=a+Math.round((n-a)*Eg),wg=o+Math.round((r-o)*Eg),Tg=s+Math.round((i-s)*Eg),{css:Og.toCss(Cg,wg,Tg),rgba:Og.toRgba(Cg,wg,Tg)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=Mg.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return Og.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[Cg,wg,Tg]=Mg.toChannels(t),{css:Og.toCss(Cg,wg,Tg),rgba:t}}e.opaque=i;function a(e,t){return Eg=Math.round(t*255),[Cg,wg,Tg]=Mg.toChannels(e.rgba),{css:Og.toCss(Cg,wg,Tg,Eg),rgba:Og.toRgba(Cg,wg,Tg,Eg)}}e.opacity=a;function o(e,t){return Eg=e.rgba&255,a(e,Eg*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(kg||={});var Ag;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return Cg=parseInt(e.slice(1,2).repeat(2),16),wg=parseInt(e.slice(2,3).repeat(2),16),Tg=parseInt(e.slice(3,4).repeat(2),16),Og.toColor(Cg,wg,Tg);case 5:return Cg=parseInt(e.slice(1,2).repeat(2),16),wg=parseInt(e.slice(2,3).repeat(2),16),Tg=parseInt(e.slice(3,4).repeat(2),16),Eg=parseInt(e.slice(4,5).repeat(2),16),Og.toColor(Cg,wg,Tg,Eg);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Cg=parseInt(r[1]),wg=parseInt(r[2]),Tg=parseInt(r[3]),Eg=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),Og.toColor(Cg,wg,Tg,Eg);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[Cg,wg,Tg,Eg]=t.getImageData(0,0,1,1).data,Eg!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:Og.toRgba(Cg,wg,Tg,Eg),css:e}}e.toColor=r})(Ag||={});var jg;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(jg||={});var Mg;(e=>{function t(e,t){if(Eg=(t&255)/255,Eg===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return Cg=a+Math.round((n-a)*Eg),wg=o+Math.round((r-o)*Eg),Tg=s+Math.round((i-s)*Eg),Og.toRgba(Cg,wg,Tg)}e.blend=t;function n(e,t,n){let a=jg.relativeLuminance(e>>8),o=jg.relativeLuminance(t>>8);if(Pg(a,o)<n){if(o<a){let o=r(e,t,n),s=Pg(a,jg.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>Pg(a,jg.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=Pg(a,jg.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>Pg(a,jg.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=Pg(jg.relativeLuminance2(o,s,c),jg.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=Pg(jg.relativeLuminance2(o,s,c),jg.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=Pg(jg.relativeLuminance2(o,s,c),jg.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=Pg(jg.relativeLuminance2(o,s,c),jg.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(Mg||={});function Ng(e){let t=e.toString(16);return t.length<2?`0`+t:t}function Pg(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Fg=class extends lf{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ig=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new df}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,o=0,s=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||cf.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)Ig._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||cf.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};Ig=Wd([Z(0,vf)],Ig);function Lg(e){return 57508<=e&&e<=57558}function Rg(e){return 9472<=e&&e<=9631}function zg(e){return Lg(e)||Rg(e)}function Bg(){return{css:{canvas:Vg(),cell:Vg()},device:{canvas:Vg(),cell:Vg(),char:{width:0,height:0,left:0,top:0}}}}function Vg(){return{width:0,height:0}}var Hg=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new df,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,w=!1,T=0,ee=0,E=[],te=l!==-1&&u!==-1;for(let ne=0;ne<m;ne++){e.loadCell(ne,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let re=!1,ie=ne>=ee,ae=ne,D=this._workCell;if(f.length>0&&ne===f[0][0]&&ie){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)ie&&=i===this._isCellInSelection(v,t);ie&&=!n||a<r[0]||a>=r[1],ie?(re=!0,D=new Fg(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),ae=r[1]-1,m=D.getWidth()):ee=r[1]}let oe=this._isCellInSelection(ne,t),se=n&&ne===a,O=te&&ne>=l&&ne<=u,ce=!1;this._decorationService.forEachDecorationAtCell(ne,t,void 0,e=>{ce=!0});let le=D.getChars()||cf;if(le===` `&&(D.isUnderline()||D.isOverline())&&(le=`\xA0`),T=m*s-c.get(le,D.isBold(),D.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(oe&&w||!oe&&!w&&D.bg===y)&&(oe&&w&&p.selectionForeground||D.fg===b)&&D.extended.ext===x&&O===S&&T===C&&!se&&!re&&!ce&&ie){D.isInvisible()?_+=cf:_+=le,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=D.bg,b=D.fg,x=D.extended.ext,S=O,C=T,w=oe,re&&a>=ne&&a<=ae&&(a=ne),!this._coreService.isCursorHidden&&se&&this._coreService.isCursorInitialized){if(E.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&E.push(`xterm-cursor-blink`),E.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:E.push(`xterm-cursor-outline`);break;case`block`:E.push(`xterm-cursor-block`);break;case`bar`:E.push(`xterm-cursor-bar`);break;case`underline`:E.push(`xterm-cursor-underline`);break;default:break}}if(D.isBold()&&E.push(`xterm-bold`),D.isItalic()&&E.push(`xterm-italic`),D.isDim()&&E.push(`xterm-dim`),_=D.isInvisible()?cf:D.getChars()||cf,D.isUnderline()&&(E.push(`xterm-underline-${D.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!D.isUnderlineColorDefault()))if(D.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${lf.toColorRGB(D.getUnderlineColor()).join(`,`)})`;else{let e=D.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&D.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}D.isOverline()&&(E.push(`xterm-overline`),_===` `&&(_=`\xA0`)),D.isStrikethrough()&&E.push(`xterm-strikethrough`),O&&(h.style.textDecoration=`underline`);let ue=D.getFgColor(),de=D.getFgColorMode(),fe=D.getBgColor(),pe=D.getBgColorMode(),me=!!D.isInverse();if(me){let e=ue;ue=fe,fe=e;let t=de;de=pe,pe=t}let he,ge,_e=!1;this._decorationService.forEachDecorationAtCell(ne,t,void 0,e=>{e.options.layer!==`top`&&_e||(e.backgroundColorRGB&&(pe=50331648,fe=e.backgroundColorRGB.rgba>>8&16777215,he=e.backgroundColorRGB),e.foregroundColorRGB&&(de=50331648,ue=e.foregroundColorRGB.rgba>>8&16777215,ge=e.foregroundColorRGB),_e=e.options.layer===`top`)}),!_e&&oe&&(he=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,fe=he.rgba>>8&16777215,pe=50331648,_e=!0,p.selectionForeground&&(de=50331648,ue=p.selectionForeground.rgba>>8&16777215,ge=p.selectionForeground)),_e&&E.push(`xterm-decoration-top`);let ve;switch(pe){case 16777216:case 33554432:ve=p.ansi[fe],E.push(`xterm-bg-${fe}`);break;case 50331648:ve=Og.toColor(fe>>16,fe>>8&255,fe&255),this._addStyle(h,`background-color:#${Ug((fe>>>0).toString(16),`0`,6)}`);break;default:me?(ve=p.foreground,E.push(`xterm-bg-257`)):ve=p.background}switch(he||D.isDim()&&(he=kg.multiplyOpacity(ve,.5)),de){case 16777216:case 33554432:D.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(h,ve,p.ansi[ue],D,he,void 0)||E.push(`xterm-fg-${ue}`);break;case 50331648:let e=Og.toColor(ue>>16&255,ue>>8&255,ue&255);this._applyMinimumContrast(h,ve,e,D,he,ge)||this._addStyle(h,`color:#${Ug(ue.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,ve,p.foreground,D,he,ge)||me&&E.push(`xterm-fg-257`)}E.length&&=(h.className=E.join(` `),0),!se&&!re&&!ce&&ie?g++:h.textContent=_,T!==this.defaultSpacing&&(h.style.letterSpacing=`${T}px`),d.push(h),ne=ae}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||zg(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=kg.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};Hg=Wd([Z(1,Ff),Z(2,wf),Z(3,jf),Z(4,bf),Z(5,Df),Z(6,If)],Hg);function Ug(e,t,n){for(;e.length<n;)e=t+e;return e}var Wg=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},Gg=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);if(s>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function Kg(){return new Gg}var qg=`xterm-dom-renderer-owner-`,Jg=`xterm-rows`,Yg=`xterm-fg-`,Xg=`xterm-bg-`,Zg=`xterm-focus`,Qg=`xterm-selection`,$g=1,e_=class extends _p{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=$g++,this._rowElements=[],this._selectionRenderModel=Kg(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(Jg),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(Qg),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=Bg(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(Hg,document),this._element.classList.add(qg+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(mp(()=>{this._element.classList.remove(qg+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Wg(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Jg} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Jg} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Jg} .xterm-dim { color: ${kg.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Jg}.${Zg} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Jg}.${Zg} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Jg}.${Zg} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Jg} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Jg} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Jg} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Jg} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Jg} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Qg} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Qg} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Qg} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${Yg}${n} { color: ${r.css}; }${this._terminalSelector} .${Yg}${n}.xterm-dim { color: ${kg.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${Xg}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${Yg}257 { color: ${kg.opaque(e.background).css}; }${this._terminalSelector} .${Yg}257.xterm-dim { color: ${kg.multiplyOpacity(kg.opaque(e.background),.5).css}; }${this._terminalSelector} .${Xg}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Zg),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Zg),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${qg}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};e_=Wd([Z(7,Sf),Z(8,Af),Z(9,wf),Z(10,vf),Z(11,bf),Z(12,jf),Z(13,If)],e_);var t_=class extends _p{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Q),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new i_(this._optionsService))}catch{this._measureStrategy=this._register(new r_(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t_=Wd([Z(2,wf)],t_);var n_=class extends _p{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},r_=class extends n_{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},i_=class extends n_{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},a_=class extends _p{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new o_(this._window)),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Q),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(Op.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(bh(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(bh(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},o_=class extends _p{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new vp),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(mp(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=bh(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},s_=class extends _p{constructor(){super(),this.linkProviders=[],this._register(mp(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function c_(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function l_(e,t,n,r,i,a,o,s,c){if(!a)return;let l=c_(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var u_=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return l_(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=c_(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};u_=Wd([Z(0,Nf),Z(1,Af)],u_);var d_=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},f_={};Ud(f_,{getSafariVersion:()=>y_,isChromeOS:()=>T_,isFirefox:()=>g_,isIpad:()=>x_,isIphone:()=>S_,isLegacyEdge:()=>__,isLinux:()=>w_,isMac:()=>b_,isNode:()=>p_,isSafari:()=>v_,isWindows:()=>C_});var p_=typeof process<`u`&&`title`in process,m_=p_?`node`:navigator.userAgent,h_=p_?`node`:navigator.platform,g_=m_.includes(`Firefox`),__=m_.includes(`Edge`),v_=/^((?!chrome|android).)*safari/i.test(m_);function y_(){if(!v_)return 0;let e=m_.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var b_=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(h_),x_=h_===`iPad`,S_=h_===`iPhone`,C_=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(h_),w_=h_.indexOf(`Linux`)>=0,T_=/\bCrOS\b/.test(m_),E_=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},D_=class extends E_{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},O_=class extends E_{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},k_=!p_&&`requestIdleCallback`in window?O_:D_,A_=class{constructor(){this._queue=new k_}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},j_=class extends _p{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new vp),this._pausedResizeTask=new A_,this._observerDisposable=this._register(new vp),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Q),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Q),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Q),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d_((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new M_(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(mp(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=mp(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};j_=Wd([Z(2,wf),Z(3,Af),Z(4,bf),Z(5,Df),Z(6,vf),Z(7,jf),Z(8,If)],j_);var M_=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function N_(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return I_(i,a,e,t,n,r)+L_(a,t,n,r)+R_(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,G_(Math.abs(i-e),W_(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return G_(F_(a>t?e:i,n)+(s-1)*n.cols+1+P_(a>t?i:e,n),W_(o,r))}function P_(e,t){return e-1}function F_(e,t){return t.cols-e}function I_(e,t,n,r,i,a){return L_(t,r,i,a).length===0?``:G_(U_(e,t,e,t-B_(t,i),!1,i).length,W_(`D`,a))}function L_(e,t,n,r){let i=e-B_(e,n),a=t-B_(t,n);return G_(Math.abs(i-a)-z_(e,t,n),W_(H_(e,t),r))}function R_(e,t,n,r,i,a){let o;o=L_(t,r,i,a).length>0?r-B_(r,i):t;let s=r,c=V_(e,t,n,r,i,a);return G_(U_(e,o,n,s,c===`C`,i).length,W_(c,a))}function z_(e,t,n){let r=0,i=e-B_(e,n),a=t-B_(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=H_(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function B_(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function V_(e,t,n,r,i,a){let o;return o=L_(n,r,i,a).length>0?r-B_(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function H_(e,t){return e>t?`A`:`B`}function U_(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function W_(e,t){let n=t?`O`:`[`;return $.ESC+n+e}function G_(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var K_=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function q_(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var J_=50,Y_=15,X_=50,Z_=500,Q_=RegExp(`\xA0`,`g`),$_=class extends _p{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new df,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Q),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Q),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new K_(this._bufferService),this._activeSelectionMode=0,this._register(mp(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(Q_,` `)).join(C_?`\r
|
|
34
|
+
`:`
|
|
35
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),w_&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=q_(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=c_(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-J_),J_),t/=J_,t/Math.abs(t)+Math.round(t*(Y_-1)))}shouldForceSelection(e){return b_?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),X_)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(b_&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<Z_&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=N_(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(!(!t&&o.slice(s,c).trim()===``)){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=q_(n,this._bufferService.cols)}};$_=Wd([Z(3,vf),Z(4,bf),Z(5,Mf),Z(6,wf),Z(7,Nf),Z(8,jf)],$_);var ev=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},tv=class{constructor(){this._color=new ev,this._css=new ev}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},nv=Object.freeze((()=>{let e=[Ag.toColor(`#2e3436`),Ag.toColor(`#cc0000`),Ag.toColor(`#4e9a06`),Ag.toColor(`#c4a000`),Ag.toColor(`#3465a4`),Ag.toColor(`#75507b`),Ag.toColor(`#06989a`),Ag.toColor(`#d3d7cf`),Ag.toColor(`#555753`),Ag.toColor(`#ef2929`),Ag.toColor(`#8ae234`),Ag.toColor(`#fce94f`),Ag.toColor(`#729fcf`),Ag.toColor(`#ad7fa8`),Ag.toColor(`#34e2e2`),Ag.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:Og.toCss(r,i,a),rgba:Og.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:Og.toCss(n,n,n),rgba:Og.toRgba(n,n,n)})}return e})()),rv=Ag.toColor(`#ffffff`),iv=Ag.toColor(`#000000`),av=Ag.toColor(`#ffffff`),ov=iv,sv={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},cv=rv,lv=class extends _p{constructor(e){super(),this._optionsService=e,this._contrastCache=new tv,this._halfContrastCache=new tv,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:rv,background:iv,cursor:av,cursorAccent:ov,selectionForeground:void 0,selectionBackgroundTransparent:sv,selectionBackgroundOpaque:kg.blend(iv,sv),selectionInactiveBackgroundTransparent:sv,selectionInactiveBackgroundOpaque:kg.blend(iv,sv),scrollbarSliderBackground:kg.opacity(rv,.2),scrollbarSliderHoverBackground:kg.opacity(rv,.4),scrollbarSliderActiveBackground:kg.opacity(rv,.5),overviewRulerBorder:rv,ansi:nv.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange(`theme`,()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=uv(e.foreground,rv),t.background=uv(e.background,iv),t.cursor=kg.blend(t.background,uv(e.cursor,av)),t.cursorAccent=kg.blend(t.background,uv(e.cursorAccent,ov)),t.selectionBackgroundTransparent=uv(e.selectionBackground,sv),t.selectionBackgroundOpaque=kg.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=uv(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=kg.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?uv(e.selectionForeground,Dg):void 0,t.selectionForeground===Dg&&(t.selectionForeground=void 0),kg.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=kg.opacity(t.selectionBackgroundTransparent,.3)),kg.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=kg.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=uv(e.scrollbarSliderBackground,kg.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=uv(e.scrollbarSliderHoverBackground,kg.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=uv(e.scrollbarSliderActiveBackground,kg.opacity(t.foreground,.5)),t.overviewRulerBorder=uv(e.overviewRulerBorder,cv),t.ansi=nv.slice(),t.ansi[0]=uv(e.black,nv[0]),t.ansi[1]=uv(e.red,nv[1]),t.ansi[2]=uv(e.green,nv[2]),t.ansi[3]=uv(e.yellow,nv[3]),t.ansi[4]=uv(e.blue,nv[4]),t.ansi[5]=uv(e.magenta,nv[5]),t.ansi[6]=uv(e.cyan,nv[6]),t.ansi[7]=uv(e.white,nv[7]),t.ansi[8]=uv(e.brightBlack,nv[8]),t.ansi[9]=uv(e.brightRed,nv[9]),t.ansi[10]=uv(e.brightGreen,nv[10]),t.ansi[11]=uv(e.brightYellow,nv[11]),t.ansi[12]=uv(e.brightBlue,nv[12]),t.ansi[13]=uv(e.brightMagenta,nv[13]),t.ansi[14]=uv(e.brightCyan,nv[14]),t.ansi[15]=uv(e.brightWhite,nv[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=uv(e.extendedAnsi[r],nv[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};lv=Wd([Z(0,wf)],lv);function uv(e,t){if(e!==void 0)try{return Ag.toColor(e)}catch{}return t}var dv=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},fv=class{constructor(){this._services=new dv,this._services.set(Sf,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=hf(e).sort((e,t)=>e.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},pv={trace:0,debug:1,info:2,warn:3,error:4,off:5},mv=`xterm.js: `,hv=class extends _p{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),gv=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=pv[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:mv)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};hv=Wd([Z(0,wf)],hv);var gv,_v=class extends _p{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Q),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Q),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Q),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},vv=3,yv=Object.freeze(new lf),bv=0,xv=2,Sv=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*vv);let r=t||df.fromCharData([0,sf,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*vv+0],n=t&2097151;return[this._data[e*vv+1],t&2097152?this._combined[e]:n?nf(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*vv+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*vv+0]=e|2097152|t[2]<<22):this._data[e*vv+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*vv+0]>>22}hasWidth(e){return this._data[e*vv+0]&12582912}getFg(e){return this._data[e*vv+1]}getBg(e){return this._data[e*vv+2]}hasContent(e){return this._data[e*vv+0]&4194303}getCodePoint(e){let t=this._data[e*vv+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*vv+0]&2097152}getString(e){let t=this._data[e*vv+0];return t&2097152?this._combined[e]:t&2097151?nf(t&2097151):``}isProtected(e){return this._data[e*vv+2]&536870912}loadCell(e,t){return bv=e*vv,t.content=this._data[bv+0],t.fg=this._data[bv+1],t.bg=this._data[bv+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*vv+0]=t.content,this._data[e*vv+1]=t.fg,this._data[e*vv+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*vv+0]=t|n<<22,this._data[e*vv+1]=r.fg,this._data[e*vv+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*vv+0];r&2097152?this._combined[e]+=nf(t):r&2097151?(this._combined[e]=nf(r&2097151)+nf(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*vv+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new df;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new df;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*xv<this._data.buffer.byteLength;let n=e*vv;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*xv<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*xv<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t){for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);return}this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*vv+0]&4194303)return e+(this._data[e*vv+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*vv+0]&4194303||this._data[e*vv+2]&50331648)return e+(this._data[e*vv+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<vv;e++)this._data[(n+i)*vv+e]=a[(t+i)*vv+e];a[(t+i)*vv+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<vv;e++)this._data[(n+i)*vv+e]=a[(t+i)*vv+e];a[(t+i)*vv+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*vv+0],n=e&2097151,a=e&2097152?this._combined[t]:n?nf(n):cf;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function Cv(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=Dv(u,d,t),p=1,m=0;for(;p<u.length;){let e=Dv(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function wv(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}}function Tv(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length}function Ev(e,t,n){let r=[],i=e.map((n,r)=>Dv(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=Dv(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function Dv(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var Ov=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new Q),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),fp(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};Ov._nextId=1;var kv=Ov,Av={},jv=Av.B;Av[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:``,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},Av.A={"#":`£`},Av.B=void 0,Av[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},Av.C=Av[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},Av.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},Av.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},Av.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},Av.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},Av.E=Av[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},Av.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},Av.H=Av[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},Av[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var Mv=4294967295,Nv=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=yv.clone(),this.savedCharset=jv,this.markers=[],this._nullCell=df.fromCharData([0,sf,1,0]),this._whitespaceCell=df.fromCharData([0,cf,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new k_,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new _v(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new uf),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new uf),this._whitespaceCell}getBlankLine(e,t){return new Sv(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Mv?Mv:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=yv);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _v(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(yv),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Sv(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new Sv(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=Cv(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(yv),n);if(r.length>0){let n=wv(this.lines,r);Tv(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(yv),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Sv(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(yv),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=Ev(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(yv,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=Dv(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new kv(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Pv=class extends _p{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Q),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange(`scrollback`,()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,()=>this.setupTabStops()))}reset(){this._normal=new Nv(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Nv(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Fv=2,Iv=1,Lv=class extends _p{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Fv),this.rows=Math.max(e.rawOptions.rows||0,Iv),this.buffers=this._register(new Pv(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Lv=Wd([Z(0,wf)],Lv);var Rv={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:b_,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},zv=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],Bv=class extends _p{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let t={...Rv};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(mp(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in Rv))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in Rv))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=Rv[e],!Vv(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=Rv[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=zv.includes(t)?t:Rv[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={};break}return t}};function Vv(e){return e===`block`||e===`underline`||e===`bar`}function Hv(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&Hv(e[r],t-1);return n}var Uv=Object.freeze({insertMode:!1}),Wv=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Gv=class extends _p{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Q),this.onData=this._onData.event,this._onUserInput=this._register(new Q),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Q),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Hv(Uv),this.decPrivateModes=Hv(Wv)}reset(){this.modes=Hv(Uv),this.decPrivateModes=Hv(Wv)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};Gv=Wd([Z(0,vf),Z(1,Cf),Z(2,wf)],Gv);var Kv={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function qv(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Jv=String.fromCharCode,Yv={DEFAULT:e=>{let t=[qv(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${Jv(t[0])}${Jv(t[1])}${Jv(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${qv(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${qv(e,!0)};${e.x};${e.y}${t}`}},Xv=class extends _p{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Q),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(Kv))this.addProtocol(e,Kv[e]);for(let e of Object.keys(Yv))this.addEncoding(e,Yv[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Xv=Wd([Z(0,vf),Z(1,bf),Z(2,wf)],Xv);var Zv=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Qv=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],$v;function ey(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var ty=class{constructor(){if(this.version=`6`,!$v){$v=new Uint8Array(65536),$v.fill(1),$v[0]=0,$v.fill(0,1,32),$v.fill(0,127,160),$v.fill(2,4352,4448),$v[9001]=2,$v[9002]=2,$v.fill(2,11904,42192),$v[12351]=1,$v.fill(2,44032,55204),$v.fill(2,63744,64256),$v.fill(2,65040,65050),$v.fill(2,65072,65136),$v.fill(2,65280,65377),$v.fill(2,65504,65511);for(let e=0;e<Zv.length;++e)$v.fill(0,Zv[e][0],Zv[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?$v[e]:ey(e,Qv)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=ny.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return ny.createPropertyValue(0,n,r)}},ny=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new Q,this.onChange=this._onChange.event;let e=new ty;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},ry=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function iy(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var ay=2147483647,oy=256,sy=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>oy)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>ay?ay:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>ay?ay:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,ay):e}},cy=[],ly=class{constructor(){this._state=0,this._active=cy,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=cy}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=cy,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||cy,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,rf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=cy,this._id=-1,this._state=0}}},uy=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=rf(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},dy=[],fy=class{constructor(){this._handlers=Object.create(null),this._active=dy,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=dy}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=dy,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||dy,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,rf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=dy,this._ident=0}},py=new sy;py.addParam(0);var my=class{constructor(e){this._handler=e,this._data=``,this._params=py,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():py,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=rf(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=py,this._data=``,this._hitLimit=!1,e));return this._params=py,this._data=``,this._hitLimit=!1,t}},hy=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},gy=160,_y=function(){let e=new hy(4095),t=Array.apply(null,Array(256)).map((e,t)=>t),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(gy,0,2,0),e.add(gy,8,5,8),e.add(gy,6,0,6),e.add(gy,11,0,11),e.add(gy,13,13,13),e}(),vy=class extends _p{constructor(e=_y){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new sy,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(mp(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new ly),this._dcsParser=this._register(new fy),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:gy)],i>>4){case 2:for(let i=n+1;;++i){if(i>=t||(r=e[i])<32||r>126&&r<gy){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<gy){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<gy){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<gy){this._printHandler(e,n,i),n=i-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<gy){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<gy){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},yy=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,by=/^[\da-f]+$/;function xy(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=yy.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),by.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}}function Sy(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function Cy(e,t=16){let[n,r,i]=e;return`rgb:${Sy(n,t)}/${Sy(r,t)}/${Sy(i,t)}`}var wy={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ty=131072,Ey=10;function Dy(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Oy=5e3,ky=0,Ay=class extends _p{constructor(e,t,n,r,i,a,o,s,c=new vy){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new af,this._utf8Decoder=new of,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=yv.clone(),this._eraseAttrDataInternal=yv.clone(),this._onRequestBell=this._register(new Q),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Q),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Q),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Q),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Q),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Q),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Q),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Q),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Q),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new jy(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler($.BEL,()=>this.bell()),this._parser.setExecuteHandler($.LF,()=>this.lineFeed()),this._parser.setExecuteHandler($.VT,()=>this.lineFeed()),this._parser.setExecuteHandler($.FF,()=>this.lineFeed()),this._parser.setExecuteHandler($.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler($.BS,()=>this.backspace()),this._parser.setExecuteHandler($.HT,()=>this.tab()),this._parser.setExecuteHandler($.SO,()=>this.shiftOut()),this._parser.setExecuteHandler($.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(bg.IND,()=>this.index()),this._parser.setExecuteHandler(bg.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(bg.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new uy(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new uy(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new uy(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new uy(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new uy(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new uy(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new uy(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new uy(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new uy(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new uy(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new uy(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new uy(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:`7`},()=>this.saveCursor()),this._parser.registerEscHandler({final:`8`},()=>this.restoreCursor()),this._parser.registerEscHandler({final:`D`},()=>this.index()),this._parser.registerEscHandler({final:`E`},()=>this.nextLine()),this._parser.registerEscHandler({final:`H`},()=>this.tabSet()),this._parser.registerEscHandler({final:`M`},()=>this.reverseIndex()),this._parser.registerEscHandler({final:`=`},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:`>`},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:`c`},()=>this.fullReset()),this._parser.registerEscHandler({final:`n`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`o`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`|`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`}`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`~`},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:`%`,final:`@`},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:`%`,final:`G`},()=>this.selectDefaultCharset());for(let e in Av)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new my((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),Oy))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${Oy} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ty&&(a=this._parseStack.position+Ty)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ty&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ty))),o||this._dirtyRowTracker.clearRange(),e.length>Ty)for(let t=a;t<e.length;t+=Ty){let a=t+Ty<e.length?t+Ty:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=ny.extractWidth(t);let n=ny.extractShouldJoin(t),m=n?ny.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(nf(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof Sv&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>Dy(e.params[0],this._optionsService.rawOptions.windowOptions)?t(e):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new my(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new uy(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(yv));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=ny.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent($.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent($.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent($.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent($.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent($.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,jv),this._charsetService.setgCharset(1,jv),this._charsetService.setgCharset(2,jv),this._charsetService.setgCharset(3,jv);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${$.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=lf.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=yv.fg,e.bg=yv.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=yv.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=yv.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=yv.fg&16777215,r.bg&=-67108864,r.bg|=yv.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${$.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[${e};${t}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[?${e};${t}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=yv.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`;break}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Dy(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${$.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Ey&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Ey&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(My(n))if(r===`?`)t.push({type:0,index:n});else{let e=xy(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=xy(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);My(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,jv),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(wy[e[0]],Av[e[1]]||jv),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=yv.clone(),this._eraseAttrDataInternal=yv.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new df;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=e=>(this._coreService.triggerDataEvent(`${$.ESC}${e}${$.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},jy=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(ky=e,e=t,t=ky),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};jy=Wd([Z(0,vf)],jy);function My(e){return 0<=e&&e<256}var Ny=5e7,Py=12,Fy=50,Iy=class extends _p{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>Ny)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=Py?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=Py)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Fy&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Ly=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Ly=Wd([Z(0,vf)],Ly);var Ry=!1,zy=class extends _p{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new vp),this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onData=this._register(new Q),this.onData=this._onData.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Q),this._instantiationService=new fv,this.optionsService=this._register(new Bv(e)),this._instantiationService.setService(wf,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Lv)),this._instantiationService.setService(vf,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(hv)),this._instantiationService.setService(Cf,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Gv)),this._instantiationService.setService(bf,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Xv)),this._instantiationService.setService(yf,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ny)),this._instantiationService.setService(Ef,this.unicodeService),this._charsetService=this._instantiationService.createInstance(ry),this._instantiationService.setService(xf,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Ly),this._instantiationService.setService(Tf,this._oscLinkService),this._inputHandler=this._register(new Ay(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Op.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Op.forward(this._bufferService.onResize,this._onResize)),this._register(Op.forward(this.coreService.onData,this._onData)),this._register(Op.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Iy((e,t)=>this._inputHandler.parse(e,t))),this._register(Op.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Ry&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),Ry=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Fv),t=Math.max(t,Iv),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(iy.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(iy(this._bufferService),!1))),this._windowsWrappingHeuristics.value=mp(()=>{for(let t of e)t.dispose()})}}},By={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};function Vy(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?t?i.key=$.ESC+`OA`:i.key=$.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?t?i.key=$.ESC+`OD`:i.key=$.ESC+`[D`:e.key===`UIKeyInputRightArrow`?t?i.key=$.ESC+`OC`:i.key=$.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(t?i.key=$.ESC+`OB`:i.key=$.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:$.DEL,e.altKey&&(i.key=$.ESC+i.key);break;case 9:if(e.shiftKey){i.key=$.ESC+`[Z`;break}i.key=$.HT,i.cancel=!0;break;case 13:i.key=e.altKey?$.ESC+$.CR:$.CR,i.cancel=!0;break;case 27:i.key=$.ESC,e.altKey&&(i.key=$.ESC+$.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;a?i.key=$.ESC+`[1;`+(a+1)+`D`:t?i.key=$.ESC+`OD`:i.key=$.ESC+`[D`;break;case 39:if(e.metaKey)break;a?i.key=$.ESC+`[1;`+(a+1)+`C`:t?i.key=$.ESC+`OC`:i.key=$.ESC+`[C`;break;case 38:if(e.metaKey)break;a?i.key=$.ESC+`[1;`+(a+1)+`A`:t?i.key=$.ESC+`OA`:i.key=$.ESC+`[A`;break;case 40:if(e.metaKey)break;a?i.key=$.ESC+`[1;`+(a+1)+`B`:t?i.key=$.ESC+`OB`:i.key=$.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=$.ESC+`[2~`);break;case 46:a?i.key=$.ESC+`[3;`+(a+1)+`~`:i.key=$.ESC+`[3~`;break;case 36:a?i.key=$.ESC+`[1;`+(a+1)+`H`:t?i.key=$.ESC+`OH`:i.key=$.ESC+`[H`;break;case 35:a?i.key=$.ESC+`[1;`+(a+1)+`F`:t?i.key=$.ESC+`OF`:i.key=$.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=$.ESC+`[5;`+(a+1)+`~`:i.key=$.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=$.ESC+`[6;`+(a+1)+`~`:i.key=$.ESC+`[6~`;break;case 112:a?i.key=$.ESC+`[1;`+(a+1)+`P`:i.key=$.ESC+`OP`;break;case 113:a?i.key=$.ESC+`[1;`+(a+1)+`Q`:i.key=$.ESC+`OQ`;break;case 114:a?i.key=$.ESC+`[1;`+(a+1)+`R`:i.key=$.ESC+`OR`;break;case 115:a?i.key=$.ESC+`[1;`+(a+1)+`S`:i.key=$.ESC+`OS`;break;case 116:a?i.key=$.ESC+`[15;`+(a+1)+`~`:i.key=$.ESC+`[15~`;break;case 117:a?i.key=$.ESC+`[17;`+(a+1)+`~`:i.key=$.ESC+`[17~`;break;case 118:a?i.key=$.ESC+`[18;`+(a+1)+`~`:i.key=$.ESC+`[18~`;break;case 119:a?i.key=$.ESC+`[19;`+(a+1)+`~`:i.key=$.ESC+`[19~`;break;case 120:a?i.key=$.ESC+`[20;`+(a+1)+`~`:i.key=$.ESC+`[20~`;break;case 121:a?i.key=$.ESC+`[21;`+(a+1)+`~`:i.key=$.ESC+`[21~`;break;case 122:a?i.key=$.ESC+`[23;`+(a+1)+`~`:i.key=$.ESC+`[23~`;break;case 123:a?i.key=$.ESC+`[24;`+(a+1)+`~`:i.key=$.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=$.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=$.DEL:e.keyCode===219?i.key=$.ESC:e.keyCode===220?i.key=$.FS:e.keyCode===221&&(i.key=$.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=By[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=$.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=$.ESC+n}else if(e.keyCode===32)i.key=$.ESC+(e.ctrlKey?$.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=$.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=$.US),e.key===`@`&&(i.key=$.NUL));break}return i}var Hy=0,Uy=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new k_,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new k_,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Hy=this._search(t),Hy===-1)||this._getKey(this._array[Hy])!==t)return!1;do if(this._array[Hy]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Hy),!0;while(++Hy<this._array.length&&this._getKey(this._array[Hy])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Hy=this._search(e),!(Hy<0||Hy>=this._array.length)&&this._getKey(this._array[Hy])===e))do yield this._array[Hy];while(++Hy<this._array.length&&this._getKey(this._array[Hy])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Hy=this._search(e),!(Hy<0||Hy>=this._array.length)&&this._getKey(this._array[Hy])===e))do t(this._array[Hy]);while(++Hy<this._array.length&&this._getKey(this._array[Hy])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Wy=0,Gy=0,Ky=class extends _p{constructor(){super(),this._decorations=new Uy(e=>e?.marker.line),this._onDecorationRegistered=this._register(new Q),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Q),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(mp(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new qy(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,t=>{Wy=t.options.x??0,Gy=Wy+(t.options.width??1),e>=Wy&&e<Gy&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},qy=class extends gp{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Q),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Q),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Ag.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ag.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Jy=1e3,Yy=class{constructor(e,t=Jy){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Xy=20,Zy=!1,Qy=class extends _p{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Yy(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);Zy?(this._accessibilityContainer.classList.add(`debug`),this._rowContainer.classList.add(`debug`),this._debugRootContainer=i.createElement(`div`),this._debugRootContainer.classList.add(`xterm`),this._debugRootContainer.appendChild(i.createTextNode(`------start a11y------`)),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(i.createTextNode(`------end a11y------`)),this._terminal.element.insertAdjacentElement(`afterend`,this._debugRootContainer)):this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
36
|
+
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(bh(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(mp(()=>{Zy?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Xy+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
37
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Xy+1&&(this._liveRegion.textContent+=Jd.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(!(!a||!o)){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Qy=Wd([Z(1,Sf),Z(2,jf),Z(3,Nf)],Qy);var $y=class extends _p{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Q),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Q),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(mp(()=>{fp(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(bh(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(bh(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(bh(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(bh(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&eb(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,fp(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};$y=Wd([Z(1,Mf),Z(2,Nf),Z(3,vf),Z(4,Lf)],$y);function eb(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var tb=class extends zy{constructor(e={}){super(e),this._linkifier=this._register(new vp),this.browser=f_,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new vp),this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Q),this.onKey=this._onKey.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Q),this.onBell=this._onBell.event,this._onFocus=this._register(new Q),this._onBlur=this._register(new Q),this._onA11yCharEmitter=this._register(new Q),this._onA11yTabEmitter=this._register(new Q),this._onWillOpen=this._register(new Q),this._setup(),this._decorationService=this._instantiationService.createInstance(Ky),this._instantiationService.setService(Df,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(s_),this._instantiationService.setService(Lf,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Of)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(Op.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Op.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Op.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Op.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(mp(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=kg.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${$.ESC}]${n};${Cy(r)}${xg.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=Og.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=Og.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Qy,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(bh(this.element,`copy`,e=>{this.hasSelection()&&Zd(e,this._selectionService)}));let e=e=>Qd(e,this.textarea,this.coreService,this.optionsService);this._register(bh(this.textarea,`paste`,e)),this._register(bh(this.element,`paste`,e)),g_?this._register(bh(this.element,`mousedown`,e=>{e.button===2&&tf(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(bh(this.element,`contextmenu`,e=>{tf(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),w_&&this._register(bh(this.element,`auxclick`,e=>{e.button===1&&ef(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(bh(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(bh(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(bh(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(bh(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(bh(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(bh(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(bh(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(bh(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,Kd.get()),T_||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(a_,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(jf,this._coreBrowserService),this._register(bh(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(bh(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t_,this._document,this._helperContainer),this._instantiationService.setService(Af,this._charSizeService),this._themeService=this._instantiationService.createInstance(lv),this._instantiationService.setService(If,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ig),this._instantiationService.setService(Ff,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(j_,this.rows,this.screenElement)),this._instantiationService.setService(Nf,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(Sg,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(u_),this._instantiationService.setService(Mf,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance($y,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(pg,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance($_,this.element,this.screenElement,r)),this._instantiationService.setService(Pf,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(Op.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(mg,this.screenElement)),this._register(bh(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Qy,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(yg,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(yg,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(bh(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(bh(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=$.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){$d(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=Vy(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===$.ETX||n.key===$.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(nb(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(yv));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent($.ESC+`[I`):this.coreService.triggerDataEvent($.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[6;${r};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function nb(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var rb=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},ib=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new df)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},ab=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new ib(t)}getNullCell(){return new df}},ob=class extends _p{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new ab(this._core.buffers.normal,`normal`),this._alternate=new ab(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},sb=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},cb=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},lb=[`cols`,`rows`],ub=0,db=class extends _p{constructor(e){super(),this._core=this._register(new tb(e)),this._addonManager=this._register(new rb),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(lb.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new sb(this._core),this._parser}get unicode(){return this._checkProposedApi(),new cb(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new ob(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`;break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
38
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Kd.get()},set promptLabel(e){Kd.set(e)},get tooMuchOutput(){return Jd.get()},set tooMuchOutput(e){Jd.set(e)}}}_verifyIntegers(...e){for(ub of e)if(ub===1/0||isNaN(ub)||ub%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(ub of e)if(ub&&(ub===1/0||isNaN(ub)||ub%1!=0||ub<0))throw Error(`This API only accepts positive integers`)}},fb=2,pb=1,mb=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(fb,Math.floor(u/e.css.cell.width)),rows:Math.max(pb,Math.floor(l/e.css.cell.height))}}};function hb(e){let t=new TextEncoder().encode(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode(...t.subarray(e,e+n));return btoa(r)}function gb(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var _b=V(`<div data-testid="pty-terminal" class="flex-1 min-h-0 overflow-hidden bg-black p-2"></div>`);function vb(e,t){j(t,!0);let n,r,i;function a(){i?.fit()}function o(){r?.focus()}ii(()=>{let e=new db({cursorBlink:!0,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,fontSize:13,scrollback:5e3}),a=new mb;e.loadAddon(a),e.open(n),a.fit();let o=e.onData(e=>t.oninput(hb(e)));r=e,i=a,t.onready({write:e=>r?.write(gb(e)),reset:e=>{r&&(r.reset(),r.write(gb(e)))}}),t.onresize(e.cols,e.rows);let s=new ResizeObserver(()=>{a.fit(),t.onresize(e.cols,e.rows)});return s.observe(n),()=>{s.disconnect(),o.dispose(),e.dispose(),r=void 0,i=void 0}});var s={fit:a,focus:o},c=_b();return aa(c,e=>n=e,()=>n),G(e,c),M(s)}var yb=V(`<div class="mt-1 text-xs text-destructive" data-testid="pty-prompt-error"> </div>`),bb=V(`<div class="flex-1 flex flex-col min-h-0 overflow-hidden"><div class="px-6 py-3 border-b border-border flex items-center justify-between bg-card/50"><div class="flex items-center gap-2"><span class="font-mono font-semibold"> </span> <!> <!></div> <div class="flex items-center gap-4"><span class="text-xs text-muted-foreground hidden sm:inline">Resizing affects all viewers</span> <!></div></div> <!> <div class="px-4 py-3 border-t border-border bg-card/50 shrink-0"><form class="flex items-center gap-2"><!> <!></form> <div class="mt-1 text-xs text-muted-foreground">Trusted message — authorizes auto-approval</div> <!></div></div>`),xb=V(`<div class="flex-1 flex items-center justify-center text-muted-foreground"><div class="max-w-sm text-center px-6"><div class="text-sm font-semibold text-foreground mb-1">Unsupported session type</div> <div class="text-sm">Session <span class="font-mono"> </span> is <span class="font-mono"> </span>. The web UI only supports container terminal sessions.</div> <!></div></div>`),Sb=V(`<div class="flex-1 flex items-center justify-center text-muted-foreground"><div class="text-center"><p class="text-lg mb-2">No session selected</p> <p class="text-sm">Select a session from the list or create a new one.</p></div></div>`),Cb=V(`<div class="flex h-full min-h-0 animate-fade-in"><!> <!></div>`);function wb(e,t){j(t,!0);let n=P(void 0),r=P(!1),i=P(``),a=P(null),o=P(``),s=P(``),c=P(!1);async function l(){let e=B(p);if(e===null)return;let t=B(o).trim();if(t){F(c,!0),F(s,``);try{await oo(e,t),F(o,``)}catch(e){F(s,e instanceof Error?e.message:String(e),!0)}finally{F(c,!1)}}}async function u(){let e=await Ro();return Object.keys(e.profiles).filter(e=>e!==`native`)}async function d(e){if(!B(r)){if(!J.daemonStatus){F(i,`Daemon status is not available yet. Wait for the daemon connection to finish, then try again.`);return}if(J.daemonStatus.sessionMode===void 0){F(i,`Web sessions require daemon session-mode support. Upgrade or restart the daemon, then refresh this page.`);return}if(J.daemonStatus.sessionMode!==`container`){F(i,`Web sessions require container mode. Restart the daemon with container mode enabled.`);return}F(r,!0),F(i,``);try{J.selectedSessionLabel=(await eo(e)).label}catch(e){F(i,e instanceof Error?e.message:String(e),!0)}finally{F(r,!1)}}}async function f(){let e=J.selectedSessionLabel;if(e!==null){F(a,e,!0);try{await to(e)}catch(e){console.error(`Failed to end session:`,e)}finally{F(a,null)}}}let p=N(()=>J.selectedSession?.source.kind===`web-pty`?J.selectedSession.label:null);Mn(()=>{let e=B(p);if(e!==null)return La(e),no(e).catch(e=>console.error(`Failed to attach PTY:`,e)),()=>{Ba(e),Ra(e),ro(e).catch(()=>{})}}),Mn(()=>{J.escalationDismissedAt,B(p)!==null&&wr().then(()=>B(n)?.focus())});var m=Cb(),h=I(m);Bd(h,{get sessions(){return J.sessions},get selectedLabel(){return J.selectedSessionLabel},onselect:e=>J.selectedSessionLabel=e,oncreate:d,get creating(){return B(r)},get createError(){return B(i)},get loadPersonasFn(){return po},loadProviderProfilesFn:u});var g=R(h,2),_=e=>{var t=W(),r=L(t),i=e=>{let t=N(()=>J.selectedSession);var r=bb(),i=I(r),u=I(i),d=I(u),p=I(d);k(d);var m=R(d,2),h=e=>{Oc(e,{variant:`default`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).persona)),G(e,r)},$$slots:{default:!0}})};q(m,e=>{B(t).persona&&e(h)}),Oc(R(m,2),{variant:`secondary`,children:(e,t)=>{A(),G(e,U(`terminal`))},$$slots:{default:!0}}),k(u);var g=R(u,2),_=R(I(g),2);{let e=N(()=>B(a)===B(t).label);Dd(_,{variant:`destructive`,size:`sm`,get loading(){return B(e)},onclick:f,children:(e,n)=>{A();var r=U();z(()=>K(r,B(a)===B(t).label?`Ending`:`End`)),G(e,r)},$$slots:{default:!0}})}k(g),k(i);var v=R(i,2);si(v,()=>B(t).label,e=>{aa(vb(e,{onready:e=>{za(B(t).label,e),B(n)?.focus()},oninput:e=>io(B(t).label,e),onresize:(e,n)=>ao(B(t).label,e,n)}),e=>F(n,e,!0),()=>B(n))});var y=R(v,2),b=I(y),x=I(b);{let e=N(()=>B(t).status!==`ready`||B(c));Ad(x,{"data-testid":`pty-prompt-input`,placeholder:`Send a trusted message...`,class:`flex-1 py-1.5`,get disabled(){return B(e)},get value(){return B(o)},set value(e){F(o,e,!0)}})}var S=R(x,2);{let e=N(()=>!B(o).trim()||B(t).status!==`ready`);Dd(S,{type:`submit`,"data-testid":`pty-prompt-send`,size:`sm`,get loading(){return B(c)},get disabled(){return B(e)},children:(e,t)=>{A(),G(e,U(`Send`))},$$slots:{default:!0}})}k(b);var C=R(b,4),w=e=>{var t=yb(),n=I(t,!0);k(t),z(()=>K(n,B(s))),G(e,t)};q(C,e=>{B(s)&&e(w)}),k(y),k(r),z(()=>K(p,`#${B(t).label??``}`)),Pr(`submit`,b,e=>{e.preventDefault(),l()}),G(e,r)},u=e=>{let t=N(()=>J.selectedSession);var n=xb(),r=I(n),i=R(I(r),2),o=R(I(i)),s=I(o);k(o);var c=R(o,2),l=I(c,!0);k(c),A(),k(i);var u=R(i,2);{let e=N(()=>B(a)===B(t).label);Dd(u,{variant:`outline`,size:`sm`,class:`mt-4`,get loading(){return B(e)},onclick:f,children:(e,n)=>{A();var r=U();z(()=>K(r,B(a)===B(t).label?`Ending`:`End session`)),G(e,r)},$$slots:{default:!0}})}k(r),k(n),z(()=>{K(s,`#${B(t).label??``}`),K(l,B(t).source.kind)}),G(e,n)};q(r,e=>{J.selectedSession.source.kind===`web-pty`?e(i):e(u,-1)}),G(e,t)},v=e=>{G(e,Sb())};q(g,e=>{J.selectedSession?e(_):e(v,-1)}),k(m),G(e,m),M()}var Tb=V(`<button>Dismiss</button>`),Eb=V(`<div role="alert"><span class="min-w-0"><!></span> <!></div>`);function Db(e,t){j(t,!0);let n={default:`bg-muted/40 border-border text-foreground`,destructive:`bg-destructive/10 border-destructive/20 text-destructive`},r=ca(t,`variant`,3,`default`),i=ca(t,`dismissible`,3,!1);var a=Eb(),o=I(a),s=I(o),c=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(s,e=>{t.children&&e(c)}),k(o);var l=R(o,2),u=e=>{var n=Tb();z(e=>Ai(n,1,e),[()=>wi(hc(`ml-4 text-xs font-medium shrink-0`,r()===`destructive`?`text-destructive/60 hover:text-destructive`:`text-muted-foreground hover:text-foreground`))]),Fr(`click`,n,function(...e){t.ondismiss?.apply(this,e)}),G(e,n)};q(l,e=>{i()&&t.ondismiss&&e(u)}),k(a),z(e=>Ai(a,1,e),[()=>wi(hc(`rounded-xl border px-4 py-3 text-sm flex items-center justify-between animate-fade-in`,n[r()],t.class))]),G(e,a),M()}Ir([`click`]);var Ob=V(`<span>·</span> <button class="text-primary hover:underline">View Session</button>`,1),kb=V(`<div><div class="text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-1.5">Context</div> <pre class="text-xs font-mono bg-muted/40 rounded-lg px-3 py-2.5 overflow-auto max-h-32 text-foreground/80"> </pre></div>`),Ab=V(`<span class="w-2 h-2 rounded-full bg-primary"></span>`),jb=V(`<button><span><!></span> <span class="text-xs"> </span></button>`),Mb=V(`<div><div class="text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-1.5">Whitelist (optional)</div> <div class="space-y-1.5"></div> <p class="text-[10px] text-muted-foreground/60 mt-1.5">Select a rule to auto-approve similar future requests.</p></div>`),Nb=V(`<div class="px-5 py-4 flex items-start justify-between gap-4"><div class="min-w-0"><div class="flex items-center gap-2"><span class="font-mono font-semibold text-sm"> <span class="text-muted-foreground">/</span> </span></div> <div class="flex items-center gap-2 mt-1 text-xs text-muted-foreground"><!> <span> </span> <span>·</span> <span> </span> <!></div></div> <div class="flex gap-2 shrink-0"><!> <!></div></div> <div class="px-5 pb-4 space-y-3"><div><div class="text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-1.5">Reason</div> <div class="text-sm bg-muted/40 rounded-lg px-3 py-2.5 text-foreground/90"> </div></div> <div><div class="text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-1.5">Arguments</div> <pre class="text-xs font-mono bg-muted/40 rounded-lg px-3 py-2.5 overflow-auto max-h-48 text-foreground/80"> </pre></div> <!> <!></div>`,1);function Pb(e,t){j(t,!0);let n=ca(t,`loading`,3,!1),r=P(void 0);function i(e){F(r,B(r)===e?void 0:e,!0)}function a(){t.onapprove(B(r))}{let o=N(()=>n()?`opacity-50 border-border`:`border-destructive/20 shadow-sm shadow-destructive/5`);yc(e,{get class(){return`overflow-hidden transition-all animate-fade-in
|
|
39
|
+
${B(o)??``}`},children:(e,o)=>{var s=Nb(),c=L(s),l=I(c),u=I(l),d=I(u),f=I(d,!0),p=R(f,2,!0);k(d),k(u);var m=R(u,2),h=I(m);Oc(h,{variant:`secondary`,class:`font-mono`,children:(e,n)=>{A();var r=U();z(()=>K(r,`#${t.escalation.sessionLabel??``}`)),G(e,r)},$$slots:{default:!0}});var g=R(h,2),_=I(g,!0);k(g);var v=R(g,4),y=I(v,!0);k(v);var b=R(v,2),x=e=>{var n=Ob();Fr(`click`,R(L(n),2),()=>t.onviewsession(t.escalation.sessionLabel)),G(e,n)};q(b,e=>{t.onviewsession&&e(x)}),k(m),k(l);var S=R(l,2),C=I(S);Dd(C,{variant:`success`,size:`sm`,get loading(){return n()},onclick:a,children:(e,t)=>{var r=W(),i=L(r),a=e=>{G(e,U(`Approve`))};q(i,e=>{n()||e(a)}),G(e,r)},$$slots:{default:!0}}),Dd(R(C,2),{variant:`destructive`,size:`sm`,get loading(){return n()},get onclick(){return t.ondeny},children:(e,t)=>{var r=W(),i=L(r),a=e=>{G(e,U(`Deny`))};q(i,e=>{n()||e(a)}),G(e,r)},$$slots:{default:!0}}),k(S),k(c);var w=R(c,2),T=I(w),ee=R(I(T),2),E=I(ee,!0);k(ee),k(T);var te=R(T,2),ne=R(I(te),2),re=I(ne,!0);k(ne),k(te);var ie=R(te,2),ae=e=>{var n=kb(),r=R(I(n),2),i=I(r,!0);k(r),k(n),z(e=>K(i,e),[()=>JSON.stringify(t.escalation.context,null,2)]),G(e,n)},D=N(()=>t.escalation.context&&Object.keys(t.escalation.context).length>0);q(ie,e=>{B(D)&&e(ae)});var oe=R(ie,2),se=e=>{var a=Mb(),o=R(I(a),2);fi(o,21,()=>t.escalation.whitelistCandidates,ci,(e,t,a)=>{let o=N(()=>B(r)===a);var s=jb(),c=I(s),l=I(c),u=e=>{G(e,Ab())};q(l,e=>{B(o)&&e(u)}),k(c);var d=R(c,2),f=I(d,!0);k(d),k(s),z(()=>{s.disabled=n(),Ai(s,1,`w-full text-left flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-colors
|
|
40
|
+
${B(o)?`bg-primary/15 border border-primary/40 text-foreground`:`bg-muted/40 border border-transparent hover:bg-muted/60 text-foreground/80`}
|
|
41
|
+
disabled:opacity-50 disabled:cursor-not-allowed`),Ai(c,1,`shrink-0 w-4 h-4 rounded-full border-2 flex items-center justify-center
|
|
42
|
+
${B(o)?`border-primary`:`border-muted-foreground/40`}`),K(f,B(t).description)}),Fr(`click`,s,()=>i(a)),G(e,s)}),k(o),A(2),k(a),G(e,a)};q(oe,e=>{t.escalation.whitelistCandidates&&t.escalation.whitelistCandidates.length>0&&e(se)}),k(w),z((e,n)=>{K(f,t.escalation.serverName),K(p,t.escalation.toolName),K(_,t.escalation.sessionSource.kind),K(y,e),K(E,t.escalation.reason),K(re,n)},[()=>new Date(t.escalation.receivedAt).toLocaleTimeString(),()=>JSON.stringify(t.escalation.arguments,null,2)]),G(e,s)},$$slots:{default:!0}})}M()}Ir([`click`]);var Fb=V(`<!> <p class="text-muted-foreground">No pending escalations</p> <p class="text-sm text-muted-foreground/70 mt-1">Escalations appear here when a tool call requires approval.</p>`,1),Ib=V(`<div class="space-y-3"></div>`),Lb=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold tracking-tight">Escalations</h2> <!></div> <!> <!></div>`);function Rb(e,t){j(t,!0);let n=P(on(new Set)),r=P(``);async function i(e,t,i){F(n,new Set([...B(n),e]),!0),F(r,``);try{await $a(e,t,i)}catch(e){F(r,`Failed to ${t===`approved`?`approve`:`deny`}: ${e instanceof Error?e.message:String(e)}`)}finally{let t=new Set(B(n));t.delete(e),F(n,t,!0)}}var a=Lb(),o=I(a),s=R(I(o),2),c=e=>{Oc(e,{variant:`destructive`,class:`font-mono font-semibold px-2.5 py-1 text-xs`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${J.pendingEscalations.size??``} pending`)),G(e,n)},$$slots:{default:!0}})};q(s,e=>{J.pendingEscalations.size>0&&e(c)}),k(o);var l=R(o,2),u=e=>{Db(e,{variant:`destructive`,dismissible:!0,ondismiss:()=>F(r,``),children:(e,t)=>{A();var n=U();z(()=>K(n,B(r))),G(e,n)},$$slots:{default:!0}})};q(l,e=>{B(r)&&e(u)});var d=R(l,2),f=e=>{yc(e,{class:`p-12 text-center`,children:(e,t)=>{var n=Fb();ju(L(n),{size:40,class:`mx-auto text-muted-foreground/30 mb-4`}),A(4),G(e,n)},$$slots:{default:!0}})},p=e=>{var t=Ib();fi(t,21,()=>[...J.pendingEscalations.values()],e=>e.escalationId,(e,t)=>{{let r=N(()=>B(n).has(B(t).escalationId));Pb(e,{get escalation(){return B(t)},get loading(){return B(r)},onapprove:e=>i(B(t).escalationId,`approved`,e),ondeny:()=>i(B(t).escalationId,`denied`)})}}),k(t),G(e,t)};q(d,e=>{J.pendingEscalations.size===0?e(f):e(p,-1)}),k(a),G(e,a),M()}var zb=V(`<span aria-label="Loading"></span>`);function Bb(e,t){j(t,!0);let n=ca(t,`size`,3,`sm`),r={xs:`w-2 h-2 border-[1.5px]`,sm:`w-3 h-3 border-2`,md:`w-4 h-4 border-2`};var i=zb();z(e=>Ai(i,1,e),[()=>wi(hc(`inline-block rounded-full border-current/30 border-t-current animate-spin`,r[n()],t.class))]),G(e,i),M()}var Vb=V(`<span class="text-xs font-mono text-muted-foreground"> </span>`),Hb=V(`<!> <p class="text-muted-foreground">No jobs configured</p> <p class="text-sm text-muted-foreground/70 mt-1">Add jobs via <code class="font-mono text-xs bg-muted px-1.5 py-0.5 rounded">ironcurtain daemon add-job</code></p>`,1),Ub=V(`<!> <!> <!> <!> <!> <!>`,1),Wb=V(`<div class="font-medium"> </div> <div class="text-[11px] text-muted-foreground font-mono mt-0.5"> </div>`,1),Gb=V(`<code class="text-xs font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded"> </code>`),Kb=V(`<div class="flex items-center gap-1.5"><!> <span class="text-[11px] font-mono text-muted-foreground"> </span></div>`),qb=V(`<span class="text-xs text-muted-foreground/50">--</span>`),Jb=V(`<!> `,1),Yb=V(`<span class="w-1.5 h-1.5 rounded-full bg-warning animate-pulse"></span> running`,1),Xb=V(`<div class="flex gap-1.5 justify-end"><!> <!> <!> <!></div>`),Zb=V(`<!> <!>`,1),Qb=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold tracking-tight">Jobs</h2> <!></div> <!> <!></div>`);function $b(e,t){j(t,!0);let n=P(on(new Map)),r=P(``);async function i(e,t,i){F(n,new Map([...B(n),[e,t]]),!0),F(r,``);try{await i()}catch(n){F(r,`Failed to ${t.toLowerCase()} "${e}": ${n instanceof Error?n.message:String(n)}`)}finally{let t=new Map(B(n));t.delete(e),F(n,t,!0)}}function a(e){i(e,`Run`,()=>so(e))}function o(e){i(e,`Enable`,()=>co(e))}function s(e){i(e,`Disable`,()=>lo(e))}function c(e){confirm(`Remove job "${e}"?`)&&i(e,`Remove`,()=>uo(e))}function l(e){i(e,`Recompile`,()=>fo(e))}var u=Qb(),d=I(u),f=R(I(d),2),p=e=>{var t=Vb(),n=I(t);k(t),z(e=>K(n,`${e??``}/${J.jobs.length??``} enabled`),[()=>J.jobs.filter(e=>e.job.enabled).length]),G(e,t)};q(f,e=>{J.jobs.length>0&&e(p)}),k(d);var m=R(d,2),h=e=>{Db(e,{variant:`destructive`,dismissible:!0,ondismiss:()=>F(r,``),children:(e,t)=>{A();var n=U();z(()=>K(n,B(r))),G(e,n)},$$slots:{default:!0}})};q(m,e=>{B(r)&&e(h)});var g=R(m,2),_=e=>{yc(e,{class:`p-12 text-center`,children:(e,t)=>{var n=Hb();Bl(L(n),{size:40,class:`mx-auto text-muted-foreground/30 mb-4`}),A(4),G(e,n)},$$slots:{default:!0}})},v=e=>{Ac(e,{children:(e,t)=>{var r=Zb(),i=L(r);Mc(i,{children:(e,t)=>{var n=Ub(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`Name`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Schedule`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`Next Run`))},$$slots:{default:!0}});var o=R(a,2);zc(o,{children:(e,t)=>{A(),G(e,U(`Last Run`))},$$slots:{default:!0}});var s=R(o,2);zc(s,{children:(e,t)=>{A(),G(e,U(`Status`))},$$slots:{default:!0}}),zc(R(s,2),{align:`right`,children:(e,t)=>{A(),G(e,U(`Actions`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(i,2),{children:(e,t)=>{var r=W();fi(L(r),17,()=>J.jobs,e=>e.job.id,(e,t)=>{let r=N(()=>B(n).get(B(t).job.id));{let n=N(()=>!!B(r));Lc(e,{get muted(){return B(n)},children:(e,n)=>{var i=Ub(),u=L(i);Vc(u,{children:(e,n)=>{var r=Wb(),i=L(r),a=I(i,!0);k(i);var o=R(i,2),s=I(o,!0);k(o),z(()=>{K(a,B(t).job.name),K(s,B(t).job.id)}),G(e,r)},$$slots:{default:!0}});var d=R(u,2);Vc(d,{children:(e,n)=>{var r=Gb(),i=I(r,!0);k(r),z(()=>K(i,B(t).job.schedule)),G(e,r)},$$slots:{default:!0}});var f=R(d,2);Vc(f,{class:`text-xs text-muted-foreground`,children:(e,n)=>{A();var r=U();z(e=>K(r,e),[()=>B(t).nextRun?new Date(B(t).nextRun).toLocaleString():`--`]),G(e,r)},$$slots:{default:!0}});var p=R(f,2);Vc(p,{children:(e,n)=>{var r=W(),i=L(r),a=e=>{var n=Kb(),r=I(n);{let e=N(()=>B(t).lastRun.outcome.kind===`success`?`success`:B(t).lastRun.outcome.kind===`error`?`destructive`:`warning`);Oc(r,{get variant(){return B(e)},children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).lastRun.outcome.kind)),G(e,r)},$$slots:{default:!0}})}var i=R(r,2),a=I(i);k(i),k(n),z(e=>K(a,`$${e??``}`),[()=>B(t).lastRun.budget.estimatedCostUsd.toFixed(2)]),G(e,n)},o=e=>{G(e,qb())};q(i,e=>{B(t).lastRun?e(a):e(o,-1)}),G(e,r)},$$slots:{default:!0}});var m=R(p,2);Vc(m,{children:(e,n)=>{var i=W(),a=L(i),o=e=>{Oc(e,{variant:`default`,children:(e,t)=>{var n=Jb(),i=L(n);Bb(i,{size:`xs`});var a=R(i);z(()=>K(a,` ${B(r)??``}...`)),G(e,n)},$$slots:{default:!0}})},s=e=>{Oc(e,{variant:`warning`,children:(e,t)=>{var n=Yb();A(),G(e,n)},$$slots:{default:!0}})},c=e=>{Oc(e,{variant:`success`,children:(e,t)=>{A(),G(e,U(`enabled`))},$$slots:{default:!0}})},l=e=>{Oc(e,{variant:`secondary`,children:(e,t)=>{A(),G(e,U(`disabled`))},$$slots:{default:!0}})};q(a,e=>{B(r)?e(o):B(t).isRunning?e(s,1):B(t).job.enabled?e(c,2):e(l,-1)}),G(e,i)},$$slots:{default:!0}}),Vc(R(m,2),{children:(e,n)=>{var i=Xb(),u=I(i);{let e=N(()=>B(t).isRunning||!!B(r));Dd(u,{size:`sm`,onclick:()=>a(B(t).job.id),get disabled(){return B(e)},children:(e,t)=>{A(),G(e,U(`Run`))},$$slots:{default:!0}})}var d=R(u,2),f=e=>{{let n=N(()=>!!B(r));Dd(e,{variant:`secondary`,size:`sm`,onclick:()=>s(B(t).job.id),get disabled(){return B(n)},children:(e,t)=>{A(),G(e,U(`Disable`))},$$slots:{default:!0}})}},p=e=>{{let n=N(()=>!!B(r));Dd(e,{variant:`success`,size:`sm`,onclick:()=>o(B(t).job.id),get disabled(){return B(n)},children:(e,t)=>{A(),G(e,U(`Enable`))},$$slots:{default:!0}})}};q(d,e=>{B(t).job.enabled?e(f):e(p,-1)});var m=R(d,2);{let e=N(()=>!!B(r));Dd(m,{variant:`secondary`,size:`sm`,onclick:()=>l(B(t).job.id),get disabled(){return B(e)},title:`Recompile policy`,children:(e,t)=>{A(),G(e,U(`Recompile`))},$$slots:{default:!0}})}var h=R(m,2);{let e=N(()=>!!B(r));Dd(h,{variant:`ghost`,size:`sm`,class:`text-destructive hover:bg-destructive hover:text-destructive-foreground`,onclick:()=>c(B(t).job.id),get disabled(){return B(e)},children:(e,t)=>{A(),G(e,U(`Remove`))},$$slots:{default:!0}})}k(i),G(e,i)},$$slots:{default:!0}}),G(e,i)},$$slots:{default:!0}})}}),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}})};q(g,e=>{J.jobs.length===0?e(_):e(v,-1)}),k(u),G(e,u),M()}var ex=Object.defineProperty,tx=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nx=(e,t)=>{for(var n in t)ex(e,n,{get:t[n],enumerable:!0})},rx=(e,t,n)=>tx(e,typeof t==`symbol`?t:t+``,n),ix={};nx(ix,{Graph:()=>sx,alg:()=>yx,json:()=>mx,version:()=>px});var ax=Object.defineProperty,ox=(e,t)=>{for(var n in t)ax(e,n,{get:t[n],enumerable:!0})},sx=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e?e.multigraph:!1,this._isCompound=`compound`in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e==`function`?this._defaultNodeLabelFn=e:this._defaultNodeLabelFn=()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return typeof e==`function`?this._defaultEdgeLabelFn=e:this._defaultEdgeLabelFn=()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=ux(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=dx(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,cx(this._preds[a],i),cx(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?fx(this._isDirected,e):ux(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r==`object`?r:{label:r}}hasEdge(e,t,n){return(arguments.length===1?fx(this._isDirected,e):ux(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?fx(this._isDirected,e):ux(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],lx(this._preds[t],e),lx(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function cx(e,t){e[t]?e[t]++:e[t]=1}function lx(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function ux(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function dx(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function fx(e,t){return ux(e,t.v,t.w,t.name)}var px=`4.0.1`,mx={};ox(mx,{read:()=>vx,write:()=>hx});function hx(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:gx(e),edges:_x(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function gx(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function _x(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function vx(e){let t=new sx(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var yx={};ox(yx,{CycleException:()=>Px,bellmanFord:()=>xx,components:()=>Cx,dijkstra:()=>Ex,dijkstraAll:()=>Ox,findCycles:()=>Ax,floydWarshall:()=>Mx,isAcyclic:()=>Ix,postorder:()=>Bx,preorder:()=>Vx,prim:()=>Hx,shortestPaths:()=>Ux,tarjan:()=>kx,topsort:()=>Fx});var bx=()=>1;function xx(e,t,n,r){return Sx(e,String(t),n||bx,r||function(t){return e.outEdges(t)})}function Sx(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w;c({v:n,w:n===t.v?t.w:t.v})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function Cx(e){let t={},n=[],r;function i(n){n in t||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var wx=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Tx=()=>1;function Ex(e,t,n,r){return Dx(e,String(t),n||Tx,r||function(t){return e.outEdges(t)})}function Dx(e,t,n,r){let i={},a=new wx,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t],c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==1/0);)r(o).forEach(c);return i}function Ox(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=Ex(e,i,t,n),r},{})}function kx(e){let t=0,n=[],r={},i=[];function a(o){let s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){e in r?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){let e=[],t;do t=n.pop(),r[t].onStack=!1,e.push(t);while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function Ax(e){return kx(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var jx=()=>1;function Mx(e,t,n){return Nx(e,t||jx,n||function(t){return e.outEdges(t)})}function Nx(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){let t=r[e];i.forEach(function(n){let a=r[n];i.forEach(function(n){let r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}var Px=class extends Error{constructor(...e){super(...e)}};function Fx(e){let t={},n={},r=[];function i(a){if(a in n)throw new Px;a in t||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new Px;return r}function Ix(e){try{Fx(e)}catch(e){if(e instanceof Px)return!1;throw e}return!0}function Lx(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=Rx(e,t,n===`post`,o,a,r,i)}),i}function Rx(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=Rx(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function zx(e,t,n){return Lx(e,t,n,function(e,t){return e.push(t),e},[])}function Bx(e,t){return zx(e,t,`post`)}function Vx(e,t){return zx(e,t,`pre`)}function Hx(e,t){let n=new sx,r={},i=new wx,a;function o(e){let n=e.v===a?e.w:e.v,o=i.priority(n);if(o!==void 0){let s=t(e);s<o&&(r[n]=a,i.decrease(n,s))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(e){i.add(e,1/0),n.setNode(e)}),i.decrease(e.nodes()[0],0);let s=!1;for(;i.size()>0;){if(a=i.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw Error(`Input graph is not connected: `+e);s=!0}e.nodeEdges(a).forEach(o)}return n}function Ux(e,t,n,r){return Wx(e,t,n,r??(t=>e.outEdges(t)??[]))}function Wx(e,t,n,r){if(n===void 0)return Ex(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=r(a[o]);for(let e=0;e<s.length;e++){let t=s[e],r=t.v===a[o]?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return xx(e,t,n,r)}return Ex(e,t,n,r)}function Gx(e,t,n,r){let i=r;for(;e.hasNode(i);)i=sS(r);return n.dummy=t,e.setNode(i,n),i}function Kx(e){let t=new sx().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function qx(e){let t=new sx({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Jx(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Yx(e){let t=cS(nS(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function Xx(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=tS(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Zx(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=tS(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Qx(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Gx(e,`border`,i,t)}function $x(e,t=eS){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var eS=65535;function tS(e,t){return t.length>eS?e(...$x(t).map(t=>e(...t))):e(...t)}function nS(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return tS(Math.max,t)}function rS(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function iS(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function aS(e,t){return t()}var oS=0;function sS(e){return e+(``+ ++oS)}function cS(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function lS(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function uS(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function dS(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var fS=`\0`,pS=`3.0.0`,mS=class{constructor(){rx(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return hS(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&hS(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,gS)),n=n._prev;return`[`+e.join(`, `)+`]`}};function hS(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function gS(e,t){if(e!==`_next`&&e!==`_prev`)return t}var _S=mS,vS=()=>1;function yS(e,t){if(e.nodeCount()<=1)return[];let n=SS(e,t||vS);return bS(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function bS(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)xS(e,t,n,o);for(;o=i.dequeue();)xS(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(xS(e,t,n,o,!0)||[]);break}}}return r}function xS(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,CS(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,CS(t,n,o)}),e.removeNode(r.v),o}function SS(e,t){let n=new sx,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=wS(i+r+3).map(()=>new _S),o=r+1;return n.nodes().forEach(e=>{CS(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function CS(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function wS(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function TS(e){(e.graph().acyclicer===`greedy`?yS(e,t(e)):ES(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,sS(`rev`))});function t(e){return t=>e.edge(t).weight}}function ES(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function DS(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function OS(e){e.graph().dummyChains=[],e.edges().forEach(t=>kS(e,t))}function kS(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Gx(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function AS(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function jS(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=tS(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function MS(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var NS=PS;function PS(e){let t=new sx({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;FS(t,e)<i&&(a=IS(t,e),a);)o=t.hasNode(a.v)?MS(e,a):-MS(e,a),LS(t,e,o);return t}function FS(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!MS(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function IS(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=MS(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function LS(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:RS,postorder:zS}=yx,BS=VS;VS.initLowLimValues=GS,VS.initCutValues=HS,VS.calcCutValue=WS,VS.leaveEdge=qS,VS.enterEdge=JS,VS.exchangeEdges=YS;function VS(e){e=Kx(e),jS(e);let t=NS(e);GS(t),HS(t,e);let n,r;for(;n=qS(t);)r=JS(t,e,n),YS(t,e,n,r)}function HS(e,t){let n=zS(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>US(e,t,n))}function US(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=WS(e,t,n)}function WS(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,ZS(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function GS(e,t){arguments.length<2&&(t=e.nodes()[0]),KS(e,{},1,t)}function KS(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=KS(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function qS(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function JS(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===QS(e,e.node(t.v),s)&&c!==QS(e,e.node(t.w),s)).reduce((e,n)=>MS(t,n)<MS(t,e)?n:e)}function YS(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),GS(e),HS(e,t),XS(e,t)}function XS(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=RS(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function ZS(e,t,n){return e.hasEdge(t,n)}function QS(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var $S=eC;function eC(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:rC(e);break;case`tight-tree`:nC(e);break;case`longest-path`:tC(e);break;case`none`:break;default:rC(e)}}var tC=jS;function nC(e){jS(e),NS(e)}function rC(e){BS(e)}var iC=aC;function aC(e){let t=sC(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=oC(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function oC(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function sC(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(fS).forEach(r),t}function cC(e){let t=Gx(e,`root`,{},`_root`),n=uC(e),r=Object.values(n),i=tS(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=dC(e)+1;e.children(fS).forEach(r=>lC(e,t,a,o,i,n,r)),e.graph().nodeRankFactor=a}function lC(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Qx(e,`_bt`),l=Qx(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{lC(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function uC(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(fS).forEach(e=>n(e,1)),t}function dC(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function fC(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var pC=mC;function mC(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)hC(e,`borderLeft`,`_bl`,n,i,t),hC(e,`borderRight`,`_br`,n,i,t)}}e.children(fS).forEach(t)}function hC(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Gx(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function gC(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&vC(e)}function _C(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&bC(e),(t===`lr`||t===`rl`)&&(SC(e),vC(e))}function vC(e){e.nodes().forEach(t=>yC(e.node(t))),e.edges().forEach(t=>yC(e.edge(t)))}function yC(e){let t=e.width;e.width=e.height,e.height=t}function bC(e){e.nodes().forEach(t=>xC(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(xC),Object.hasOwn(r,`y`)&&xC(r)})}function xC(e){e.y=-e.y}function SC(e){e.nodes().forEach(t=>CC(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(CC),Object.hasOwn(r,`x`)&&CC(r)})}function CC(e){let t=e.x;e.x=e.y,e.y=t}function wC(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),r=n.map(t=>e.node(t).rank),i=cS(tS(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0,i[e.node(n).rank].push(n);let r=e.successors(n);r&&r.forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function TC(e,t){let n=0;for(let r=1;r<t.length;++r)n+=EC(e,t[r-1],t[r]);return n}function EC(e,t,n){let r=dS(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function DC(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function OC(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),kC(Object.values(n).filter(e=>!e.indegree))}function kC(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&AC(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>lS(e,[`vs`,`i`,`barycenter`,`weight`]))}function AC(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function jC(e,t){let n=rS(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(NC(!!t)),c=MC(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=MC(a,i,c)});let l={vs:a.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function MC(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function NC(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function PC(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=DC(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=PC(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&IC(t,i)}});let u=OC(l,n);FC(u,c);let d=jC(u,r);if(o&&s){d.vs=[o,d.vs,s].flat(1);let t=e.predecessors(o);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(s),i=e.node(r[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+n.order+i.order)/(d.weight+2),d.weight+=2}}return d}function FC(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function IC(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function LC(e,t,n,r){r||=e.nodes();let i=RC(e),a=new sx({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function RC(e){let t;for(;e.hasNode(t=sS(`_root`)););return t}function zC(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function BC(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,BC);return}let n=nS(e),r=VC(e,cS(1,n+1),`inEdges`),i=VC(e,cS(n-1,-1,-1),`outEdges`),a=wC(e);if(UC(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){HC(t%2?r:i,t%4>=2,c),a=Yx(e);let l=TC(e,a);l<o?(n=0,s=Object.assign({},a),o=l):l===o&&(s=structuredClone(a))}UC(e,s)}function VC(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return LC(e,t,n,r.get(t)||[])})}function HC(e,t,n){let r=new sx;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=PC(e,i,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),zC(e,r,a.vs)})}function UC(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function WC(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=KC(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&qC(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function GC(e,t){let n={};function r(t,r,i,a,o){cS(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&qC(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function KC(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function qC(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function JC(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function YC(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s&&s.length){let r=s.sort((e,t)=>{let n=o[e],r=o[t];return(n===void 0?0:n)-(r===void 0?0:r)}),c=(r.length-1)/2;for(let s=Math.floor(c),l=Math.ceil(c);s<=l;++s){let c=r[s];if(c===void 0)continue;let l=o[c];if(l!==void 0&&a[e]===e&&t<l&&!JC(n,e,c)){let n=i[c];n!==void 0&&(a[c]=e,a[e]=i[e]=n,t=l)}}}})}),{root:i,align:a}}function XC(e,t,n,r,i=!1){let a={},o=ZC(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function ZC(e,t,n,r){let i=new sx,a=e.graph(),o=nw(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function QC(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=rw(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function $C(e,t){let n=Object.values(t),r=tS(Math.min,n),i=tS(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-tS(Math.min,c);a!==`l`&&(l=i-tS(Math.max,c)),l&&(e[o]=uS(s,e=>e+l))})})}function ew(e,t=void 0){let n=e.ul;return n?uS(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function tw(e){let t=Yx(e),n=Object.assign(WC(e,t),GC(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(i=i.map(e=>Object.values(e).reverse()));let o=YC(e,i,n,t=>(a===`u`?e.predecessors(t):e.successors(t))||[]),s=XC(e,i,o.root,o.align,t===`r`);t===`r`&&(s=uS(s,e=>-e)),r[a+t]=s})}),$C(r,QC(e,r)),ew(r,e.graph().align)}function nw(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),c}}function rw(e,t){return e.node(t).width}function iw(e){e=qx(e),aw(e),Object.entries(tw(e)).forEach(([t,n])=>e.node(t).x=n)}function aw(e){let t=Yx(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);i===`top`?r.y=a+r.height/2:i===`bottom`?r.y=a+n-r.height/2:r.y=a+n/2}),a+=n+r})}function ow(e,t={}){let n=t.debugTiming?iS:aS;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>_w(e));return n(` runLayout`,()=>sw(r,n,t)),n(` updateInputGraph`,()=>cw(e,r)),r})}function sw(e,t,n){t(` makeSpaceForEdgeLabels`,()=>vw(e)),t(` removeSelfEdges`,()=>Dw(e)),t(` acyclic`,()=>TS(e)),t(` nestingGraph.run`,()=>cC(e)),t(` rank`,()=>$S(qx(e))),t(` injectEdgeLabelProxies`,()=>yw(e)),t(` removeEmptyRanks`,()=>Zx(e)),t(` nestingGraph.cleanup`,()=>fC(e)),t(` normalizeRanks`,()=>Xx(e)),t(` assignRankMinMax`,()=>bw(e)),t(` removeEdgeLabelProxies`,()=>xw(e)),t(` normalize.run`,()=>OS(e)),t(` parentDummyChains`,()=>iC(e)),t(` addBorderSegments`,()=>pC(e)),t(` order`,()=>BC(e,n)),t(` insertSelfEdges`,()=>Ow(e)),t(` adjustCoordinateSystem`,()=>gC(e)),t(` position`,()=>iw(e)),t(` positionSelfEdges`,()=>kw(e)),t(` removeBorderNodes`,()=>Ew(e)),t(` normalize.undo`,()=>AS(e)),t(` fixupEdgeLabelCoords`,()=>ww(e)),t(` undoCoordinateSystem`,()=>_C(e)),t(` translateGraph`,()=>Sw(e)),t(` assignNodeIntersects`,()=>Cw(e)),t(` reversePoints`,()=>Tw(e)),t(` acyclic.undo`,()=>DS(e))}function cw(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var lw=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],uw={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},dw=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],fw=[`width`,`height`,`rank`],pw={width:0,height:0},mw=[`minlen`,`weight`,`width`,`height`,`labeloffset`],hw={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},gw=[`labelpos`];function _w(e){let t=new sx({multigraph:!0,compound:!0}),n=jw(e.graph());return t.setGraph(Object.assign({},uw,Aw(n,lw),lS(n,dw))),e.nodes().forEach(n=>{let r=Aw(jw(e.node(n)),fw);Object.keys(pw).forEach(e=>{r[e]===void 0&&(r[e]=pw[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=jw(e.edge(n));t.setEdge(n,Object.assign({},hw,Aw(r,mw),lS(r,gw)))}),t}function vw(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function yw(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Gx(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function bw(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function xw(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Sw(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Cw(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Jx(r,a)),n.points.push(Jx(i,o))})}function ww(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function Tw(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Ew(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Dw(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Ow(e){Yx(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{Gx(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function kw(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=n,i=e.node(r.e.v),a=i.x+i.width/2,o=i.y,s=n.x-a,c=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:o-c},{x:a+5*s/6,y:o-c},{x:a+s,y:o},{x:a+5*s/6,y:o+c},{x:a+2*s/3,y:o+c}],r.label.x=n.x,r.label.y=n.y}})}function Aw(e,t){return uS(lS(e,t),Number)}function jw(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function Mw(e){let t=Yx(e),n=new sx({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var Nw={graphlib:ix,version:pS,layout:ow,debug:Mw,util:{time:iS,notime:aS}},Pw=H(`<text text-anchor="middle" class="fill-muted-foreground/70 text-[11px] svelte-jz1l8o"> </text>`),Fw=H(`<path fill="none" class="stroke-muted-foreground/40 svelte-jz1l8o" marker-end="url(#arrowhead)"></path><!>`,1),Iw=H(`<path fill="none"></path>`),Lw=H(`<text text-anchor="middle" dominant-baseline="middle" class="fill-muted-foreground text-[9px] pointer-events-none svelte-jz1l8o"> </text>`),Rw=H(`<circle r="9" class="fill-primary svelte-jz1l8o"></circle><text text-anchor="middle" dominant-baseline="middle" class="fill-primary-foreground text-[8px] font-bold pointer-events-none svelte-jz1l8o"> </text>`,1),zw=H(`<text text-anchor="middle" dominant-baseline="middle" class="fill-success text-[12px] pointer-events-none svelte-jz1l8o">✓</text>`),Bw=H(`<g><title class="svelte-jz1l8o"> </title><path></path><!><text text-anchor="middle" dominant-baseline="middle" class="fill-foreground text-[11px] font-medium pointer-events-none svelte-jz1l8o"> </text><!><!><!></g>`),Vw=V(`<div><svg class="w-full svelte-jz1l8o" preserveAspectRatio="xMidYMid meet" role="img" aria-label="Workflow state machine graph"><defs class="svelte-jz1l8o"><marker id="arrowhead" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto" class="svelte-jz1l8o"><polygon points="0 0, 8 3, 0 6" class="fill-muted-foreground/60 svelte-jz1l8o"></polygon></marker></defs><!><!></svg></div>`);function Hw(e,t){j(t,!0);let n=ca(t,`currentState`,3,null),r=ca(t,`completedStates`,19,()=>[]),i=ca(t,`failedState`,3,null),a=ca(t,`visitCounts`,19,()=>({})),o=ca(t,`compact`,3,!1),s=P(void 0),c=P(`LR`);Mn(()=>{if(!B(s))return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;F(c,t>=n*1.3?`LR`:`TB`,!0)});return e.observe(B(s)),()=>e.disconnect()});let l=N(()=>new Set(r())),u=N(()=>!t.graph||t.graph.states.length===0?null:m(t.graph,B(c))),d=N(()=>B(u)?.nodes??[]),f=N(()=>B(u)?.edges??[]),p=N(()=>B(u)?.viewBox??`0 0 400 300`);function m(e,t){let n=t===`LR`?40:50,r=t===`LR`?90:70,i=new Nw.graphlib.Graph({multigraph:!0});i.setGraph({rankdir:t,nodesep:n,ranksep:r,marginx:40,marginy:40}),i.setDefaultEdgeLabel(()=>({}));for(let t of e.states)i.setNode(t.id,{width:180,height:56});for(let t=0;t<e.transitions.length;t++){let n=e.transitions[t],r=`${n.from}-${n.to}-${t}`;i.setEdge(n.from,n.to,{},r)}Nw.layout(i);let a=new Map;for(let t of e.states)a.set(t.id,t);let o=[];for(let e of i.nodes()){let t=i.node(e),n=a.get(e);!t||!n||o.push({id:e,x:t.x,y:t.y,width:t.width,height:t.height,node:n})}let s=new Map;for(let t of e.transitions){let e=`${t.from}->${t.to}`,n=s.get(e);n?n.push(t):s.set(e,[t])}let c=new Set,l=[];for(let e of i.edges()){let t=`${e.v}->${e.w}`;if(c.has(t))continue;c.add(t);let n=i.edge(e),r=s.get(t);!n||!r||l.push({from:e.v,to:e.w,points:n.points??[],edges:r})}let u=i.graph(),d=(u.width??400)+80,f=(u.height??300)+80;return{nodes:o,edges:l,viewBox:`0 0 ${Math.ceil(d)} ${Math.ceil(f)}`}}function h(e){return e===i()?`failed`:e===n()?`active`:B(l).has(e)?`completed`:`pending`}function g(e,t){return t===`failed`?`fill-destructive/20 stroke-destructive`:t===`active`&&e.type===`human_gate`?`fill-warning/20 stroke-warning`:t===`active`?`fill-primary/20 stroke-primary`:t===`completed`?`fill-success/15 stroke-success/50`:e.type===`human_gate`?`fill-warning/10 stroke-warning/30`:`fill-muted/50 stroke-border`}function _(e){if(e.length===0)return``;let[t,...n]=e,r=`M ${t.x} ${t.y}`;if(n.length===1)r+=` L ${n[0].x} ${n[0].y}`;else if(n.length>=2){for(let e=0;e<n.length-1;e++){let t=n[e],i=n[e+1],a=(t.x+i.x)/2,o=(t.y+i.y)/2;r+=` Q ${t.x} ${t.y} ${a} ${o}`}let e=n[n.length-1];r+=` L ${e.x} ${e.y}`}return r}function v(e){if(e.length===0)return{x:0,y:0};let t=Math.floor(e.length/2);return{x:e[t].x,y:e[t].y-8}}function y(e,t,n,r,i){let a=e-n/2,o=t-r/2;return`M ${a+i} ${o} h ${n-2*i} a ${i} ${i} 0 0 1 ${i} ${i} v ${r-2*i} a ${i} ${i} 0 0 1 -${i} ${i} h -${n-2*i} a ${i} ${i} 0 0 1 -${i} -${i} v -${r-2*i} a ${i} ${i} 0 0 1 ${i} -${i} Z`}function b(e,t,n,r){return`M ${e} ${t-r/2} L ${e+n/2} ${t} L ${e} ${t+r/2} L ${e-n/2} ${t} Z`}function x(e,t,n,r){let i=n*.2,a=e-n/2,o=t-r/2;return`M ${a+i} ${o} L ${a+n-i} ${o} L ${a+n} ${t} L ${a+n-i} ${o+r} L ${a+i} ${o+r} L ${a} ${t} Z`}function S(e,t,n,r){return y(e,t,n,r,6)}function C(e,t,n,r,i){switch(e.type){case`agent`:return y(t,n,r,i,8);case`human_gate`:return b(t,n,r*1.1,i*1.2);case`deterministic`:return x(t,n,r,i);case`terminal`:return S(t,n,r,i)}}var w=Vw(),T=I(w),ee=R(I(T));fi(ee,17,()=>B(f),e=>e.from+`->`+e.to,(e,t)=>{let n=N(()=>B(t).edges.some(e=>e.guard?.toLowerCase().includes(`reject`)||e.guard?.toLowerCase().includes(`revision`)));var r=Fw(),i=L(r),a=R(i),s=e=>{let n=N(()=>B(t).edges.map(e=>e.label).filter(Boolean));var r=W(),i=L(r),a=e=>{let r=N(()=>v(B(t).points));var i=Pw(),a=I(i,!0);k(i),z(e=>{Ji(i,`x`,B(r).x),Ji(i,`y`,B(r).y),K(a,e)},[()=>B(n).join(` | `)]),G(e,i)};q(i,e=>{B(n).length>0&&e(a)}),G(e,r)};q(a,e=>{o()||e(s)}),z(e=>{Ji(i,`d`,e),Ji(i,`stroke-width`,o()?1:1.5),Ji(i,`stroke-dasharray`,B(n)?`6,4`:`none`)},[()=>_(B(t).points)]),G(e,r)}),fi(R(ee),17,()=>B(d),e=>e.id,(e,t)=>{let n=N(()=>h(B(t).id)),r=N(()=>g(B(t).node,B(n))),i=N(()=>a()[B(t).id]);var s=Bw(),c=I(s),l=I(c,!0);k(c);var u=R(c),d=R(u),f=e=>{var n=Iw();Ji(n,`stroke-width`,.5),z(e=>{Ji(n,`d`,e),Ai(n,0,wi(B(r)),`svelte-jz1l8o`)},[()=>C(B(t).node,B(t).x,B(t).y,B(t).width-6,B(t).height-6)]),G(e,n)};q(d,e=>{B(t).node.type===`terminal`&&B(n)!==`failed`&&e(f)});var p=R(d),m=I(p,!0);k(p);var _=R(p),v=e=>{var n=Lw(),r=I(n,!0);k(n),z(()=>{Ji(n,`x`,B(t).x),Ji(n,`y`,B(t).y+12),K(r,B(t).node.persona)}),G(e,n)};q(_,e=>{B(t).node.persona&&!o()&&e(v)});var y=R(_),b=e=>{var n=Rw(),r=L(n),a=R(r),o=I(a);k(a),z(()=>{Ji(r,`cx`,B(t).x+B(t).width/2-4),Ji(r,`cy`,B(t).y-B(t).height/2+4),Ji(a,`x`,B(t).x+B(t).width/2-4),Ji(a,`y`,B(t).y-B(t).height/2+4),K(o,`${B(i)??``}x`)}),G(e,n)};q(y,e=>{B(i)&&B(i)>1&&!o()&&e(b)});var x=R(y),S=e=>{var n=zw();z(()=>{Ji(n,`x`,B(t).x+B(t).width/2-4),Ji(n,`y`,B(t).y-B(t).height/2+6)}),G(e,n)};q(x,e=>{B(n)===`completed`&&!(B(i)&&B(i)>1&&!o())&&e(S)}),k(s),z(e=>{Ai(s,0,wi(B(n)===`active`?`animate-pulse-slow`:``),`svelte-jz1l8o`),K(l,B(t).node.description||B(t).node.label),Ji(u,`d`,e),Ai(u,0,wi(B(r)),`svelte-jz1l8o`),Ji(u,`stroke-width`,B(n)===`active`?2:1),Ji(p,`x`,B(t).x),Ji(p,`y`,B(t).node.persona&&!o()?B(t).y-4:B(t).y+1),K(m,B(t).node.label)},[()=>C(B(t).node,B(t).x,B(t).y,B(t).width,B(t).height)]),G(e,s)}),k(T),k(w),aa(w,e=>F(s,e),()=>B(s)),z(()=>{Ai(w,1,`w-full ${o()?`max-h-48`:`max-h-[60vh]`} overflow-auto`,`svelte-jz1l8o`),Ji(T,`viewBox`,B(p))}),G(e,w),M()}function Uw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ww=Uw();function Gw(e){Ww=e}var Kw={exec:()=>null};function qw(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Jw.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Jw={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},Yw=/^(?:[ \t]*(?:\n|$))+/,Xw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qw=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$w=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,eT=/(?:[*+-]|\d{1,9}[.)])/,tT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nT=qw(tT).replace(/bull/g,eT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),rT=qw(tT).replace(/bull/g,eT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),iT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,aT=/^[^\n]+/,oT=/(?!\s*\])(?:\\.|[^\[\]\\])+/,sT=qw(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,oT).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cT=qw(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,eT).getRegex(),lT=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,uT=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dT=qw(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,uT).replace(`tag`,lT).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fT=qw(iT).replace(`hr`,Qw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,lT).getRegex(),pT={blockquote:qw(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,fT).getRegex(),code:Xw,def:sT,fences:Zw,heading:$w,hr:Qw,html:dT,lheading:nT,list:cT,newline:Yw,paragraph:fT,table:Kw,text:aT},mT=qw(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Qw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,lT).getRegex(),hT={...pT,lheading:rT,table:mT,paragraph:qw(iT).replace(`hr`,Qw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,mT).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,lT).getRegex()},gT={...pT,html:qw(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,uT).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Kw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:qw(iT).replace(`hr`,Qw).replace(`heading`,` *#{1,6} *[^
|
|
43
|
+
]`).replace(`lheading`,nT).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},_T=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yT=/^( {2,}|\\)\n(?!\s*$)/,bT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xT=/[\p{P}\p{S}]/u,ST=/[\s\p{P}\p{S}]/u,CT=/[^\s\p{P}\p{S}]/u,wT=qw(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ST).getRegex(),TT=/(?!~)[\p{P}\p{S}]/u,ET=/(?!~)[\s\p{P}\p{S}]/u,DT=/(?:[^\s\p{P}\p{S}]|~)/u,OT=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,kT=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,AT=qw(kT,`u`).replace(/punct/g,xT).getRegex(),jT=qw(kT,`u`).replace(/punct/g,TT).getRegex(),MT=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,NT=qw(MT,`gu`).replace(/notPunctSpace/g,CT).replace(/punctSpace/g,ST).replace(/punct/g,xT).getRegex(),PT=qw(MT,`gu`).replace(/notPunctSpace/g,DT).replace(/punctSpace/g,ET).replace(/punct/g,TT).getRegex(),FT=qw(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,CT).replace(/punctSpace/g,ST).replace(/punct/g,xT).getRegex(),IT=qw(/\\(punct)/,`gu`).replace(/punct/g,xT).getRegex(),LT=qw(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),RT=qw(uT).replace(`(?:-->|$)`,`-->`).getRegex(),zT=qw(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,RT).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),BT=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,VT=qw(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,BT).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),HT=qw(/^!?\[(label)\]\[(ref)\]/).replace(`label`,BT).replace(`ref`,oT).getRegex(),UT=qw(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,oT).getRegex(),WT={_backpedal:Kw,anyPunctuation:IT,autolink:LT,blockSkip:OT,br:yT,code:vT,del:Kw,emStrongLDelim:AT,emStrongRDelimAst:NT,emStrongRDelimUnd:FT,escape:_T,link:VT,nolink:UT,punctuation:wT,reflink:HT,reflinkSearch:qw(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,HT).replace(`nolink`,UT).getRegex(),tag:zT,text:bT,url:Kw},GT={...WT,link:qw(/^!?\[(label)\]\((.*?)\)/).replace(`label`,BT).getRegex(),reflink:qw(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,BT).getRegex()},KT={...WT,emStrongRDelimAst:PT,emStrongLDelim:jT,url:qw(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},qT={...KT,br:qw(yT).replace(`{2,}`,`*`).getRegex(),text:qw(KT.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},JT={normal:pT,gfm:hT,pedantic:gT},YT={normal:WT,gfm:KT,breaks:qT,pedantic:GT},XT={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},ZT=e=>XT[e];function QT(e,t){if(t){if(Jw.escapeTest.test(e))return e.replace(Jw.escapeReplace,ZT)}else if(Jw.escapeTestNoEncode.test(e))return e.replace(Jw.escapeReplaceNoEncode,ZT);return e}function $T(e){try{e=encodeURI(e).replace(Jw.percentDecode,`%`)}catch{return null}return e}function eE(e,t){let n=e.replace(Jw.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Jw.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Jw.slashPipe,`|`);return n}function tE(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function nE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function rE(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function iE(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
44
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
45
|
+
`)}var aE=class{options;rules;lexer;constructor(e){this.options=e||Ww}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:tE(e,`
|
|
46
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=iE(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=tE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:tE(t[0],`
|
|
47
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=tE(t[0],`
|
|
48
|
+
`).split(`
|
|
49
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
50
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
51
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
52
|
+
${s}`:s,r=r?`${r}
|
|
53
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
54
|
+
`+e.join(`
|
|
55
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
56
|
+
`+e.join(`
|
|
57
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
58
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
59
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
60
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
61
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
62
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
63
|
+
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
64
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
65
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=eE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
66
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(eE(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
67
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=tE(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=nE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),rE(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return rE(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},oE=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ww,this.options.tokenizer=this.options.tokenizer||new aE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Jw,block:JT.normal,inline:YT.normal};this.options.pedantic?(t.block=JT.pedantic,t.inline=YT.pedantic):this.options.gfm&&(t.block=JT.gfm,this.options.breaks?t.inline=YT.breaks:t.inline=YT.gfm),this.tokenizer.rules=t}static get rules(){return{block:JT,inline:YT}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Jw.carriageReturn,`
|
|
68
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Jw.tabCharGlobal,` `).replace(Jw.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
69
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
70
|
+
`+r.raw,n.text+=`
|
|
71
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
72
|
+
`+r.raw,n.text+=`
|
|
73
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=`
|
|
74
|
+
`+r.raw,a.text+=`
|
|
75
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=`
|
|
76
|
+
`+r.raw,n.text+=`
|
|
77
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},sE=class{options;parser;constructor(e){this.options=e||Ww}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Jw.notSpaceStart)?.[0],i=e.replace(Jw.endingNewline,``)+`
|
|
78
|
+
`;return r?`<pre><code class="language-`+QT(r)+`">`+(n?i:QT(i,!0))+`</code></pre>
|
|
79
|
+
`:`<pre><code>`+(n?i:QT(i,!0))+`</code></pre>
|
|
80
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
81
|
+
${this.parser.parse(e)}</blockquote>
|
|
82
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
83
|
+
`}hr(e){return`<hr>
|
|
84
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
85
|
+
`+r+`</`+i+`>
|
|
86
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+QT(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
87
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
88
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
89
|
+
<thead>
|
|
90
|
+
`+t+`</thead>
|
|
91
|
+
`+r+`</table>
|
|
92
|
+
`}tablerow({text:e}){return`<tr>
|
|
93
|
+
${e}</tr>
|
|
94
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
95
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${QT(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=$T(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+QT(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=$T(e);if(i===null)return QT(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${QT(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:QT(e.text)}},cE=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},lE=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ww,this.options.renderer=this.options.renderer||new sE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cE}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
96
|
+
`+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},uE=class{options;block;constructor(e){this.options=e||Ww}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?oE.lex:oE.lexInline}provideParser(){return this.block?lE.parse:lE.parseInline}},dE=new class{defaults=Uw();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=lE;Renderer=sE;TextRenderer=cE;Lexer=oE;Tokenizer=aE;Hooks=uE;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new sE(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new aE(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new uE;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];uE.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return oE.lex(e,t??this.defaults)}parser(e,t){return lE.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?oE.lex:oE.lexInline,s=i.hooks?i.hooks.provideParser():e?lE.parse:lE.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
97
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+QT(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function fE(e,t){return dE.parse(e,t)}fE.options=fE.setOptions=function(e){return dE.setOptions(e),fE.defaults=dE.defaults,Gw(fE.defaults),fE},fE.getDefaults=Uw,fE.defaults=Ww,fE.use=function(...e){return dE.use(...e),fE.defaults=dE.defaults,Gw(fE.defaults),fE},fE.walkTokens=function(e,t){return dE.walkTokens(e,t)},fE.parseInline=dE.parseInline,fE.Parser=lE,fE.parser=lE.parse,fE.Renderer=sE,fE.TextRenderer=cE,fE.Lexer=oE,fE.lexer=oE.lex,fE.Tokenizer=aE,fE.Hooks=uE,fE.parse=fE,fE.options,fE.setOptions,fE.use,fE.walkTokens,fE.parseInline,lE.parse,oE.lex;function pE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mE(e){if(Array.isArray(e))return e}function hE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function gE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
98
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _E(e,t){return mE(e)||hE(e,t)||vE(e,t)||gE()}function vE(e,t){if(e){if(typeof e==`string`)return pE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pE(e,t):void 0}}var yE=Object.entries,bE=Object.setPrototypeOf,xE=Object.isFrozen,SE=Object.getPrototypeOf,CE=Object.getOwnPropertyDescriptor,wE=Object.freeze,TE=Object.seal,EE=Object.create,DE=typeof Reflect<`u`&&Reflect,OE=DE.apply,kE=DE.construct;wE||=function(e){return e},TE||=function(e){return e},OE||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},kE||=function(e){return new e(...[...arguments].slice(1))};var AE=XE(Array.prototype.forEach),jE=XE(Array.prototype.lastIndexOf),ME=XE(Array.prototype.pop),NE=XE(Array.prototype.push),PE=XE(Array.prototype.splice),FE=Array.isArray,IE=XE(String.prototype.toLowerCase),LE=XE(String.prototype.toString),RE=XE(String.prototype.match),zE=XE(String.prototype.replace),BE=XE(String.prototype.indexOf),VE=XE(String.prototype.trim),HE=XE(Number.prototype.toString),UE=XE(Boolean.prototype.toString),WE=typeof BigInt>`u`?null:XE(BigInt.prototype.toString),GE=typeof Symbol>`u`?null:XE(Symbol.prototype.toString),KE=XE(Object.prototype.hasOwnProperty),qE=XE(Object.prototype.toString),JE=XE(RegExp.prototype.test),YE=ZE(TypeError);function XE(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return OE(e,t,n)}}function ZE(e){return function(){return kE(e,[...arguments])}}function QE(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IE;if(bE&&bE(e,null),!FE(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xE(t)||(t[r]=e),i=e)}e[i]=!0}return e}function $E(e){for(let t=0;t<e.length;t++)KE(e,t)||(e[t]=null);return e}function eD(e){let t=EE(null);for(let r of yE(e)){var n=_E(r,2);let i=n[0],a=n[1];KE(e,i)&&(FE(a)?t[i]=$E(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=eD(a):t[i]=a)}return t}function tD(e){switch(typeof e){case`string`:return e;case`number`:return HE(e);case`boolean`:return UE(e);case`bigint`:return WE?WE(e):`0`;case`symbol`:return GE?GE(e):`Symbol()`;case`undefined`:return qE(e);case`function`:case`object`:{if(e===null)return qE(e);let t=e,n=nD(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:qE(e)}return qE(e)}default:return qE(e)}}function nD(e,t){for(;e!==null;){let n=CE(e,t);if(n){if(n.get)return XE(n.get);if(typeof n.value==`function`)return XE(n.value)}e=SE(e)}function n(){return null}return n}function rD(e){try{return JE(e,``),!0}catch{return!1}}var iD=wE(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),aD=wE(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),oD=wE([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),sD=wE([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),cD=wE(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),lD=wE([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),uD=wE([`#text`]),dD=wE(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),fD=wE(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),pD=wE(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),mD=wE([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),hD=TE(/{{[\w\W]*|^[\w\W]*}}/g),gD=TE(/<%[\w\W]*|^[\w\W]*%>/g),_D=TE(/\${[\w\W]*/g),vD=TE(/^data-[\-\w.\u00B7-\uFFFF]+$/),yD=TE(/^aria-[\-\w]+$/),bD=TE(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xD=TE(/^(?:\w+script|data):/i),SD=TE(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),CD=TE(/^html$/i),wD=TE(/^[a-z][.\w]*(-[.\w]+)+$/i),TD=TE(/<[/\w!]/g),ED=TE(/<[/\w]/g),DD=TE(/<\/no(script|embed|frames)/i),OD=TE(/\/>/i),kD={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},AD=function(){return typeof window>`u`?null:window},jD=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},MD=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ND=function(e,t,n,r){return KE(e,t)&&FE(e[t])?QE(r.base?eD(r.base):{},e[t],r.transform):n};function PD(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:AD(),t=e=>PD(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==kD.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=nD(d,`cloneNode`),p=nD(d,`remove`),m=nD(d,`nextSibling`),h=nD(d,`childNodes`),g=nD(d,`parentNode`),_=nD(d,`shadowRoot`),v=nD(d,`attributes`),y=o&&o.prototype?nD(o.prototype,`nodeType`):null,b=o&&o.prototype?nD(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,ee=function(){if(T>0)throw YE(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},E=function(e){ee(),T++;try{return x.createHTML(e)}finally{T--}},te=function(e){ee(),T++;try{return x.createScriptURL(e)}finally{T--}},ne=function(){return w||=(C=jD(u,i),!0),C},re=n,ie=re.implementation,ae=re.createNodeIterator,D=re.createDocumentFragment,oe=re.getElementsByTagName,se=r.importNode,O=MD();t.isSupported=typeof yE==`function`&&typeof g==`function`&&ie&&ie.createHTMLDocument!==void 0;let ce=hD,le=gD,ue=_D,de=vD,fe=yD,pe=xD,me=SD,he=wD,ge=bD,_e=null,ve=QE({},[...iD,...aD,...oD,...cD,...uD]),ye=null,be=QE({},[...dD,...fD,...pD,...mD]),xe=Object.seal(EE(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Ce=null,we=Object.seal(EE(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Te=!0,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!0,je=!1,Me=!1,Ne=null,Pe=null,Fe=!1,Ie=!1,k=!1,A=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=QE({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=QE({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,j=QE({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),M=`http://www.w3.org/1998/Math/MathML`,Je=`http://www.w3.org/2000/svg`,Ye=`http://www.w3.org/1999/xhtml`,Xe=Ye,Ze=!1,Qe=null,$e=QE({},[M,Je,Ye],LE),et=wE([`mi`,`mo`,`mn`,`ms`,`mtext`]),tt=QE({},et),nt=wE([`annotation-xml`]),rt=QE({},nt),it=QE({},[`title`,`style`,`font`,`a`,`script`]),at=null,ot=[`application/xhtml+xml`,`text/html`],st=null,ct=null,lt=n.createElement(`form`),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ct&&ct===e)return;(!e||typeof e!=`object`)&&(e={}),e=eD(e),at=ot.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,st=at===`application/xhtml+xml`?LE:IE,_e=ND(e,`ALLOWED_TAGS`,ve,{transform:st}),ye=ND(e,`ALLOWED_ATTR`,be,{transform:st}),Qe=ND(e,`ALLOWED_NAMESPACES`,$e,{transform:LE}),qe=ND(e,`ADD_URI_SAFE_ATTR`,j,{transform:st,base:j}),Ge=ND(e,`ADD_DATA_URI_TAGS`,Ke,{transform:st,base:Ke}),Ue=ND(e,`FORBID_CONTENTS`,We,{transform:st}),Se=ND(e,`FORBID_TAGS`,eD({}),{transform:st}),Ce=ND(e,`FORBID_ATTR`,eD({}),{transform:st}),He=KE(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?eD(e.USE_PROFILES):e.USE_PROFILES:!1,Te=e.ALLOW_ARIA_ATTR!==!1,Ee=e.ALLOW_DATA_ATTR!==!1,De=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=e.SAFE_FOR_TEMPLATES||!1,Ae=e.SAFE_FOR_XML!==!1,je=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,k=e.RETURN_DOM_FRAGMENT||!1,A=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,ge=rD(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:bD,Xe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ye,tt=KE(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?eD(e.MATHML_TEXT_INTEGRATION_POINTS):QE({},et),rt=KE(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?eD(e.HTML_INTEGRATION_POINTS):QE({},nt);let t=KE(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?eD(e.CUSTOM_ELEMENT_HANDLING):EE(null);if(xe=EE(null),KE(t,`tagNameCheck`)&&ut(t.tagNameCheck)&&(xe.tagNameCheck=t.tagNameCheck),KE(t,`attributeNameCheck`)&&ut(t.attributeNameCheck)&&(xe.attributeNameCheck=t.attributeNameCheck),KE(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(xe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),TE(xe),ke&&(Ee=!1),k&&(Ie=!0),He&&(_e=QE({},uD),ye=EE(null),He.html===!0&&(QE(_e,iD),QE(ye,dD)),He.svg===!0&&(QE(_e,aD),QE(ye,fD),QE(ye,mD)),He.svgFilters===!0&&(QE(_e,oD),QE(ye,fD),QE(ye,mD)),He.mathMl===!0&&(QE(_e,cD),QE(ye,pD),QE(ye,mD))),we.tagCheck=null,we.attributeCheck=null,KE(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?we.tagCheck=e.ADD_TAGS:FE(e.ADD_TAGS)&&(_e===ve&&(_e=eD(_e)),QE(_e,e.ADD_TAGS,st))),KE(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?we.attributeCheck=e.ADD_ATTR:FE(e.ADD_ATTR)&&(ye===be&&(ye=eD(ye)),QE(ye,e.ADD_ATTR,st))),KE(e,`ADD_URI_SAFE_ATTR`)&&FE(e.ADD_URI_SAFE_ATTR)&&QE(qe,e.ADD_URI_SAFE_ATTR,st),KE(e,`FORBID_CONTENTS`)&&FE(e.FORBID_CONTENTS)&&(Ue===We&&(Ue=eD(Ue)),QE(Ue,e.FORBID_CONTENTS,st)),KE(e,`ADD_FORBID_CONTENTS`)&&FE(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=eD(Ue)),QE(Ue,e.ADD_FORBID_CONTENTS,st)),Be&&(_e[`#text`]=!0),je&&QE(_e,[`html`,`head`,`body`]),_e.table&&(QE(_e,[`tbody`]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw YE(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw YE(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=E(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=ne()),x&&typeof S==`string`&&(S=E(``)));wE&&wE(e),ct=e},ft=QE({},[...aD,...oD,...sD]),pt=QE({},[...cD,...lD]),mt=function(e,t,n){return t.namespaceURI===Ye?e===`svg`:t.namespaceURI===M?e===`svg`&&(n===`annotation-xml`||tt[n]):!!ft[e]},ht=function(e,t,n){return t.namespaceURI===Ye?e===`math`:t.namespaceURI===Je?e===`math`&&rt[n]:!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Je&&!rt[n]||t.namespaceURI===M&&!tt[n]?!1:!pt[e]&&(it[e]||!ft[e])},_t=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Xe,tagName:`template`});let n=IE(e.tagName),r=IE(t.tagName);return Qe[e.namespaceURI]?e.namespaceURI===Je?mt(n,t,r):e.namespaceURI===M?ht(n,t,r):e.namespaceURI===Ye?gt(n,t,r):!!(at===`application/xhtml+xml`&&Qe[e.namespaceURI]):!1},vt=function(e){NE(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw YE(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yt=function(e){let t=h(e);if(t){let e=[];AE(t,t=>{NE(e,t)}),AE(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},bt=function(e,n){try{NE(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{NE(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ie||k)try{vt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},xt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||ye[st(i)]))try{e.removeAttribute(i)}catch{}}},N=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===kD.element&&xt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},St=function(e){let t=null,r=null;if(Fe)e=`<remove></remove>`+e;else{let t=RE(e,/^[\r\n\t ]+/);r=t&&t[0]}at===`application/xhtml+xml`&&Xe===Ye&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?E(e):e;if(Xe===Ye)try{t=new l().parseFromString(i,at)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Xe,`template`,null);try{t.documentElement.innerHTML=Ze?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Xe===Ye?oe.call(t,je?`html`:`body`)[0]:je?t.documentElement:a},Ct=function(e){return ae.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},wt=function(e){return e=zE(e,ce,` `),e=zE(e,le,` `),e=zE(e,ue,` `),e},Tt=function(e){e.normalize();let t=ae.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=wt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&AE(r,e=>{Dt(e.content)&&Tt(e.content)})},Et=function(e){let t=b?b(e):null;return typeof t!=`string`||st(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Dt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===kD.documentFragment}catch{return!1}},Ot=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function kt(e,n,r){e.length!==0&&AE(e,e=>{e.call(t,n,r,ct)})}let At=function(e,t){return!!(Ae&&e.hasChildNodes()&&!Ot(e.firstElementChild)&&JE(TD,e.textContent)&&JE(TD,e.innerHTML)||Ae&&e.namespaceURI===Ye&&t===`style`&&Ot(e.firstElementChild)||e.nodeType===kD.processingInstruction||Ae&&e.nodeType===kD.comment&&JE(ED,e.data))},jt=function(e,t){if(!Se[t]&&Ft(t)&&(xe.tagNameCheck instanceof RegExp&&JE(xe.tagNameCheck,t)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(t)))return!1;if(Be&&!Ue[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Ve?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return vt(e),!0},Mt=function(e){if(kt(O.beforeSanitizeElements,e,null),Et(e))return vt(e),!0;let n=st(b?b(e):e.nodeName);if(kt(O.uponSanitizeElement,e,{tagName:n,allowedTags:_e}),At(e,n))return vt(e),!0;if(Se[n]||!(we.tagCheck instanceof Function&&we.tagCheck(n))&&!_e[n])return jt(e,n);if((y?y(e):e.nodeType)===kD.element&&!_t(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&JE(DD,e.innerHTML))return vt(e),!0;if(ke&&e.nodeType===kD.text){let n=wt(e.textContent);e.textContent!==n&&(NE(t.removed,{element:e.cloneNode()}),e.textContent=n)}return kt(O.afterSanitizeElements,e,null),!1},Nt=function(e,t,r){if(Ce[t]||Le&&(t===`id`||t===`name`)&&(r in n||r in lt))return!1;let i=ye[t]||we.attributeCheck instanceof Function&&we.attributeCheck(t,e);if(!(Ee&&JE(de,t))&&!(Te&&JE(fe,t))){if(!i){if(!(Ft(e)&&(xe.tagNameCheck instanceof RegExp&&JE(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&JE(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t,e))||t===`is`&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&JE(xe.tagNameCheck,r)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))))return!1}else if(!qe[t]&&!JE(ge,zE(r,me,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&BE(r,`data:`)===0&&Ge[e])&&!(De&&!JE(pe,zE(r,me,``)))&&r)return!1}return!0},Pt=QE({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ft=function(e){return!Pt[IE(e)]&&JE(he,e)},It=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return E(r);case`TrustedScriptURL`:return te(r)}return r},Lt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),Et(e)?vt(e):ME(t.removed)}catch{bt(n,e)}},Rt=function(e){kt(O.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||Et(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:ye,forceKeepAttr:void 0},r=t.length,i=st(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=st(o),u=c,d=o===`value`?u:VE(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,kt(O.uponSanitizeAttribute,e,n),d=n.attrValue,Re&&(l===`id`||l===`name`)&&BE(d,ze)!==0&&(bt(o,e),d=ze+d),Ae&&JE(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){bt(o,e);continue}if(l===`attributename`&&RE(d,`href`)){bt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){bt(o,e);continue}if(!Oe&&JE(OD,d)){bt(o,e);continue}if(ke&&(d=wt(d)),!Nt(i,l,d)){bt(o,e);continue}d=It(i,l,s,d),d!==u&&Lt(e,o,s,d)}}kt(O.afterSanitizeAttributes,e,null)},zt=function(e){let t=null,n=Ct(e);for(kt(O.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(kt(O.uponSanitizeShadowNode,t,null),Mt(t),Rt(t),Dt(t.content)&&zt(t.content),(y?y(t):t.nodeType)===kD.element){let e=_(t);Dt(e)&&(Bt(e),zt(e))}kt(O.afterSanitizeShadowDOM,e,null)},Bt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){zt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===kD.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&st(e)===`template`){let e=n.content;Dt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Dt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!Ot(e)&&(e=tD(e),typeof e!=`string`))throw YE(`dirty is not a string, aborting`);if(!t.isSupported)return e;Me?(_e=Ne,ye=Pe):dt(n),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(_e=eD(_e)),O.uponSanitizeAttribute.length>0&&(ye=eD(ye)),t.removed=[];let c=Ve&&typeof e!=`string`&&Ot(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=st(t);if(!_e[e]||Se[e])throw YE(`root node is forbidden and cannot be sanitized in-place`)}if(Et(e))throw YE(`root node is clobbered and cannot be sanitized in-place`);try{Bt(e)}catch(t){throw yt(e),t}}else if(Ot(e))i=St(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===kD.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Bt(a);else{if(!Ie&&!ke&&!je&&e.indexOf(`<`)===-1)return x&&A?E(e):e;if(i=St(e),!i)return Ie?null:A?S:``}i&&Fe&&vt(i.firstChild);let l=Ct(c?e:i);try{for(;o=l.nextNode();)Mt(o),Rt(o),Dt(o.content)&&zt(o.content)}catch(t){throw c&&yt(e),t}if(c)return AE(t.removed,e=>{e.element&&N(e.element)}),ke&&Tt(e),e;if(Ie){if(ke&&Tt(i),k)for(s=D.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(ye.shadowroot||ye.shadowrootmode)&&(s=se.call(r,s,!0)),s}let u=je?i.outerHTML:i.innerHTML;return je&&_e[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&JE(CD,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
99
|
+
`+u),ke&&(u=wt(u)),x&&A?E(u):u},t.setConfig=function(){dt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Me=!0,Ne=_e,Pe=ye},t.clearConfig=function(){ct=null,Me=!1,Ne=null,Pe=null,x=C,S=``},t.isValidAttribute=function(e,t,n){return ct||dt({}),Nt(st(e),st(t),n)},t.addHook=function(e,t){typeof t==`function`&&KE(O,e)&&NE(O[e],t)},t.removeHook=function(e,t){if(KE(O,e)){if(t!==void 0){let n=jE(O[e],t);return n===-1?void 0:PE(O[e],n,1)[0]}return ME(O[e])}},t.removeHooks=function(e){KE(O,e)&&(O[e]=[])},t.removeAllHooks=function(){O=MD()},t}var FD=PD();fE.setOptions({breaks:!0,gfm:!0});function ID(e){let t=fE.parse(e,{async:!1});return FD.sanitize(t)}var LD=V(`<span class="shrink-0 w-4 text-center text-muted-foreground"> </span> <span> </span> <!>`,1),RD=V(`<span class="text-muted-foreground text-[10px] ml-auto"> </span>`),zD=V(`<span class="shrink-0 w-4 text-center text-muted-foreground/50">·</span> <span class="text-foreground/80"> </span> <!>`,1),BD=V(`<ul></ul>`),VD=V(`<li><button class="w-full text-left flex items-center gap-1.5 px-2 py-0.5 rounded hover:bg-accent/50 transition-colors"><!></button> <!></li>`),HD=V(`<div class="flex items-center justify-center py-4"><!></div>`),UD=V(`<p class="text-destructive text-xs px-2 py-1"> </p>`),WD=V(`<p class="text-muted-foreground text-xs px-2 py-1">Empty workspace</p>`),GD=V(`<ul class="space-y-0"></ul>`),KD=V(`<div class="text-sm font-mono"><!></div>`);function qD(e,t){j(t,!0);let n=(e,t=g,r=g)=>{var i=VD(),a=I(i),o=I(a),s=e=>{var n=LD(),r=L(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a);k(a);var s=R(a,2),c=e=>{Bb(e,{size:`xs`})};q(s,e=>{t().loading&&e(c)}),z(e=>{K(i,t().expanded?`▾`:`▸`),Ai(a,1,e),K(o,`${t().name??``}/`)},[()=>wi(v(t().name)?`text-primary`:`text-foreground`)]),G(e,n)},c=e=>{var n=zD(),r=R(L(n),2),i=I(r,!0);k(r);var a=R(r,2),o=e=>{var n=RD(),r=I(n,!0);k(n),z(e=>K(r,e),[()=>y(t().size)]),G(e,n)};q(a,e=>{t().size!=null&&e(o)}),z(()=>K(i,t().name)),G(e,n)};q(o,e=>{t().type===`directory`?e(s):e(c,-1)}),k(a);var l=R(a,2),u=e=>{var i=BD();fi(i,21,()=>t().children,e=>e.path,(e,t)=>{n(e,()=>B(t),()=>r()+1)}),k(i),G(e,i)};q(l,e=>{t().type===`directory`&&t().expanded&&t().children&&e(u)}),k(i),z(()=>Mi(a,`padding-left: ${r()*16+8}px`)),Fr(`click`,a,()=>_(t())),G(e,i)},r=ca(t,`refreshKey`,3,``),i=ca(t,`refreshing`,15,!1),a=P(on([])),o=P(!0),s=P(``),c=0,l,u;Mn(()=>{let e=t.workflowId,n=r();if(e!==l){l=e,u=n,d(e);return}n!==u&&(u=n,f(e))});async function d(e){let n=++c;F(o,!0),F(s,``),i(!1);try{let r=await t.fetchFileTree(e);if(n!==c)return;F(a,r.entries.map(e=>m(e,``)),!0)}catch(e){if(n!==c)return;F(s,e instanceof Error?e.message:String(e),!0)}finally{n===c&&F(o,!1)}}async function f(e){let n=++c;i(!0);try{let r=await t.fetchFileTree(e);if(n!==c)return;let i=await p(e,B(a),r.entries,``,n);if(n!==c)return;F(a,i,!0)}catch{}finally{n===c&&(i(!1),F(o,!1))}}async function p(e,n,r,i,a){let o=new Map(n.map(e=>[e.path,e])),s=[],l=[];for(let n of r){let r=i?`${i}/${n.name}`:n.name,u=o.get(r);if(u&&u.type===n.type){if(u.size=n.size,u.type===`directory`&&u.expanded&&u.children!==null){let n=u;l.push((async()=>{try{let r=await t.fetchFileTree(e,n.path);if(a!==c)return;let i=await p(e,n.children??[],r.entries,n.path,a);if(a!==c)return;n.children=i}catch{}})())}s.push(u)}else s.push(m(n,i))}return await Promise.all(l),s}function m(e,t){let n=t?`${t}/${e.name}`:e.name;return{name:e.name,path:n,type:e.type,size:e.size,expanded:!1,children:null,loading:!1}}async function h(e){if(e.type===`directory`){if(e.expanded){e.expanded=!1;return}if(e.children===null){e.loading=!0;try{e.children=(await t.fetchFileTree(t.workflowId,e.path)).entries.map(t=>m(t,e.path))}catch{e.children=[]}e.loading=!1}e.expanded=!0}}function _(e){e.type===`directory`?h(e):t.onFileSelect(e.path)}function v(e){return e===`.workflow`}function y(e){return e<1024?`${e}B`:e<1048576?`${(e/1024).toFixed(1)}K`:`${(e/1048576).toFixed(1)}M`}var b=KD(),x=I(b),S=e=>{var t=HD();Bb(I(t),{size:`sm`}),k(t),G(e,t)},C=e=>{var t=UD(),n=I(t,!0);k(t),z(()=>K(n,B(s))),G(e,t)},w=e=>{G(e,WD())},T=e=>{var t=GD();fi(t,21,()=>B(a),e=>e.path,(e,t)=>{n(e,()=>B(t),()=>0)}),k(t),G(e,t)};q(x,e=>{B(o)?e(S):B(s)?e(C,1):B(a).length===0?e(w,2):e(T,-1)}),k(b),G(e,b),M()}Ir([`click`]);var JD=V(`<span class="ml-auto flex items-center gap-1 text-[10px] text-muted-foreground shrink-0" title="Reloading file"><!> refreshing</span>`),YD=V(`<div class="flex items-center justify-center py-8"><!></div>`),XD=V(`<div class="p-4 text-sm text-destructive"> </div>`),ZD=V(`<div class="p-4 text-sm text-muted-foreground"> </div>`),QD=V(`<div class="p-4 text-sm text-muted-foreground italic">Binary file -- cannot display</div>`),$D=V(`<pre class="p-3 text-xs leading-relaxed overflow-x-auto"><code> </code></pre>`),eO=V(`<div class="flex flex-col h-full"><div class="flex items-center gap-2 px-3 py-2 border-b border-border bg-muted/30 shrink-0"><span class="text-xs text-muted-foreground font-mono truncate"> </span> <!></div> <div class="flex-1 overflow-auto"><!></div></div>`);function tO(e,t){j(t,!0);let n=ca(t,`refreshKey`,3,``),r=P(null),i=P(!0),a=P(!1),o=P(``),s=0,c,l,u;Mn(()=>{let e=t.workflowId,d=t.path,f=n(),p=e!==c||d!==l;if(!p&&f===u)return;c=e,l=d,u=f;let m=++s;p?(F(i,!0),F(o,``),F(r,null),F(a,!1)):F(a,!0),t.fetchFileContent(e,d).then(e=>{m===s&&(F(r,e,!0),F(o,``),F(i,!1),F(a,!1))}).catch(e=>{m===s&&(p&&(F(o,e instanceof Error?e.message:String(e),!0),F(r,null)),F(i,!1),F(a,!1))})});var d=eO(),f=I(d),p=I(f),m=I(p,!0);k(p);var h=R(p,2),g=e=>{var t=JD();Bb(I(t),{size:`xs`}),A(),k(t),G(e,t)};q(h,e=>{B(a)&&e(g)}),k(f);var _=R(f,2),v=I(_),y=e=>{var t=YD();Bb(I(t),{size:`sm`}),k(t),G(e,t)},b=e=>{var t=XD(),n=I(t,!0);k(t),z(()=>K(n,B(o))),G(e,t)},x=e=>{var t=W(),n=L(t),i=e=>{var t=ZD(),n=I(t,!0);k(t),z(()=>K(n,B(r).error)),G(e,t)},a=e=>{G(e,QD())},o=e=>{var t=$D(),n=I(t),i=I(n,!0);k(n),k(t),z(()=>{Ai(n,1,`language-${B(r).language??`text`??``}`),K(i,B(r).content)}),G(e,t)};q(n,e=>{B(r).error?e(i):B(r).binary?e(a,1):B(r).content!=null&&e(o,2)}),G(e,t)};q(v,e=>{B(i)?e(y):B(o)?e(b,1):B(r)&&e(x,2)}),k(_),k(d),z(()=>{Ji(p,`title`,t.path),K(m,t.path)}),G(e,d),M()}var nO=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),rO=H(`<path d="M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"></path>`),iO=H(`<path d="M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z" opacity="0.2"></path><path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"></path>`,1),aO=H(`<path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"></path>`),oO=H(`<path d="M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"></path>`),sO=H(`<path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"></path>`),cO=H(`<path d="M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"></path>`),lO=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function uO(e,t){j(t,!0);let n=pl(),r=sa(t,nO),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=lO();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,rO())},m=e=>{var t=iO();A(),G(e,t)},h=e=>{G(e,aO())},g=e=>{G(e,oO())},_=e=>{G(e,sO())},v=e=>{G(e,cO())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var dO=V(`<div class="flex items-center justify-center h-full text-sm text-muted-foreground">Select a file to view its contents</div>`),fO=V(`<div class="flex h-full min-h-[300px] border border-border rounded-lg overflow-hidden"><div class="w-64 shrink-0 border-r border-border overflow-y-auto bg-muted/10"><div class="flex items-center justify-between gap-2 px-3 py-2 border-b border-border"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Files</span> <!></div> <!></div> <div class="flex-1 min-w-0 overflow-hidden"><!></div></div>`);function pO(e,t){let n=ca(t,`refreshSignal`,3,``),r=P(null),i=P(0),a=P(!1),o=N(()=>`${n()}#${B(i)}`);function s(e){F(r,e,!0)}function c(){F(i,B(i)+1)}var l=fO(),u=I(l),d=I(u);Dd(R(I(d),2),{variant:`ghost`,size:`icon`,type:`button`,class:`shrink-0 h-6 w-6 text-muted-foreground`,get loading(){return B(a)},title:`Reload files and the open file`,"aria-label":`Refresh files`,onclick:c,children:(e,t)=>{var n=W(),r=L(n),i=e=>{uO(e,{size:14,weight:`bold`})};q(r,e=>{B(a)||e(i)}),G(e,n)},$$slots:{default:!0}}),k(d),qD(R(d,2),{get workflowId(){return t.workflowId},get refreshKey(){return B(o)},onFileSelect:s,get fetchFileTree(){return t.fetchFileTree},get refreshing(){return B(a)},set refreshing(e){F(a,e,!0)}}),k(u);var f=R(u,2),p=I(f),m=e=>{tO(e,{get workflowId(){return t.workflowId},get path(){return B(r)},get refreshKey(){return B(o)},get fetchFileContent(){return t.fetchFileContent}})},h=e=>{G(e,dO())};q(p,e=>{B(r)?e(m):e(h,-1)}),k(f),k(l),G(e,l)}var mO=V(`<p class="text-sm text-muted-foreground mt-0.5"> </p>`),hO=V(`<button>Artifacts <span class="text-xs text-muted-foreground ml-1"> </span></button>`),gO=V(`<button>Files</button>`),_O=V(`<p class="text-sm text-foreground/80"> </p>`),vO=V(`<div><p class="text-xs text-muted-foreground mb-1.5 font-medium uppercase tracking-wider">Artifacts</p> <div class="flex flex-wrap gap-2"></div></div>`),yO=V(`<!> <!>`,1),bO=V(`<button> </button>`),xO=V(`<div class="flex flex-wrap gap-2"></div>`),SO=V(`<div class="flex items-center justify-center py-4"><!></div>`),CO=V(`<p class="text-sm text-destructive">Failed to load artifact.</p>`),wO=V(`<div class="p-3 prose-markdown text-sm"></div>`),TO=V(`<pre class="p-3 text-xs overflow-x-auto"><code> </code></pre>`),EO=V(`<div class="border border-border rounded overflow-hidden"><div class="px-3 py-1.5 bg-muted/30 border-b border-border text-xs font-mono text-muted-foreground"> </div> <!></div>`),DO=V(`<div class="space-y-3"></div>`),OO=V(`<p class="text-sm text-muted-foreground">No files in this artifact.</p>`),kO=V(`<div class="space-y-3"><!> <!></div>`),AO=V(`<div class="h-[400px]"><!></div>`),jO=V(`<div class="space-y-2"><label for="gate-feedback" class="block text-sm font-medium"> </label> <textarea id="gate-feedback" placeholder="Describe what should be changed..." class="w-full rounded-md border border-border bg-background px-3 py-2 text-sm
|
|
100
|
+
placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50
|
|
101
|
+
resize-y"></textarea> <div class="flex gap-2"><!> <!></div></div>`),MO=V(`<div class="border border-destructive/30 bg-destructive/5 rounded-md p-3"><p class="text-sm font-medium text-destructive mb-2">Are you sure you want to abort this workflow? This action cannot be undone.</p> <div class="flex gap-2"><!> <!></div></div>`),NO=V(`<div class="flex flex-wrap gap-2 pt-1"><!> <!> <!> <!></div>`),PO=V(`<div class="border border-warning/30 bg-warning/5 rounded-lg p-5 space-y-4"><div class="flex items-center justify-between"><div><h3 class="text-lg font-semibold"> </h3> <!> <p class="text-sm text-muted-foreground mt-0.5"> </p></div> <!></div> <div class="flex gap-1 border-b border-border"><button>Summary</button> <!> <!></div> <!> <!> <!> <!></div>`);function FO(e,t){j(t,!0);let n=ca(t,`refreshSignal`,3,``),r=P(`summary`),i=P(``),a=P(null),o=P(!1),s=P(!1),c=P(on(new Map)),l=P(on(new Set)),u=P(on(new Set)),d=P(null),f=N(()=>t.gate.presentedArtifacts.length>0&&t.fetchArtifacts!=null),p=N(()=>t.fetchFileTree!=null&&t.fetchFileContent!=null);function m(e){return t.gate.acceptedEvents.includes(e)}async function h(){F(s,!0);try{await t.onResolve(`APPROVE`)}finally{F(s,!1)}}async function g(e){if(B(a)!==e){F(a,e,!0);return}let n=B(i).trim();if(n){F(s,!0);try{await t.onResolve(e,n)}finally{F(s,!1),F(i,``),F(a,null)}}}async function _(){if(!B(o)){F(o,!0);return}F(s,!0);try{await t.onResolve(`ABORT`)}finally{F(s,!1),F(o,!1)}}function v(){F(o,!1)}function y(){F(a,null),F(i,``)}let b=N(()=>B(a)===`REPLAN`?`Replan feedback`:`Revision feedback`),x=N(()=>B(a)===`REPLAN`?`Submit Replan`:`Submit Revision`);function S(){return B(a)?g(B(a)):Promise.resolve()}async function C(e){if(B(c).has(e)||B(u).has(e)||!t.fetchArtifacts)return;let n=new Set(B(l));n.add(e),F(l,n,!0);try{let n=await t.fetchArtifacts(t.workflowId,e);F(c,new Map(B(c)).set(e,n),!0)}catch{let t=new Set(B(u));t.add(e),F(u,t,!0)}let r=new Set(B(l));r.delete(e),F(l,r,!0)}function w(e){F(d,e,!0),C(e)}Mn(()=>{B(r)===`artifacts`&&!B(d)&&t.gate.presentedArtifacts.length>0&&w(t.gate.presentedArtifacts[0])});function T(e){return B(r)===e?`border-primary text-primary font-medium`:`border-transparent text-muted-foreground hover:text-foreground`}function ee(e){return e.endsWith(`.md`)}var E=PO(),te=I(E),ne=I(te),re=I(ne),ie=I(re);k(re);var ae=R(re,2),D=e=>{var n=mO(),r=I(n,!0);k(n),z(()=>K(r,t.stateDescription)),G(e,n)};q(ae,e=>{t.stateDescription&&e(D)});var oe=R(ae,2),se=I(oe,!0);k(oe),k(ne),Oc(R(ne,2),{variant:`warning`,children:(e,t)=>{A(),G(e,U(`Waiting for Review`))},$$slots:{default:!0}}),k(te);var O=R(te,2),ce=I(O),le=R(ce,2),ue=e=>{var n=hO(),i=R(I(n)),a=I(i);k(i),k(n),z(e=>{Ai(n,1,`px-3 py-1.5 text-sm transition-colors border-b-2 -mb-px ${e??``}`),K(a,`(${t.gate.presentedArtifacts.length??``})`)},[()=>T(`artifacts`)]),Fr(`click`,n,()=>F(r,`artifacts`)),G(e,n)};q(le,e=>{B(f)&&e(ue)});var de=R(le,2),fe=e=>{var t=gO();z(e=>Ai(t,1,`px-3 py-1.5 text-sm transition-colors border-b-2 -mb-px ${e??``}`),[()=>T(`files`)]),Fr(`click`,t,()=>F(r,`files`)),G(e,t)};q(de,e=>{B(p)&&e(fe)}),k(O);var pe=R(O,2),me=e=>{var n=yO(),r=L(n),i=e=>{var n=_O(),r=I(n,!0);k(n),z(()=>K(r,t.gate.summary)),G(e,n)};q(r,e=>{t.gate.summary&&e(i)});var a=R(r,2),o=e=>{var n=vO(),r=R(I(n),2);fi(r,20,()=>t.gate.presentedArtifacts,e=>e,(e,t)=>{Oc(e,{variant:`outline`,children:(e,n)=>{A();var r=U();z(()=>K(r,t)),G(e,r)},$$slots:{default:!0}})}),k(r),k(n),G(e,n)};q(a,e=>{t.gate.presentedArtifacts.length>0&&e(o)}),G(e,n)},he=e=>{var n=kO(),r=I(n),i=e=>{var n=xO();fi(n,20,()=>t.gate.presentedArtifacts,e=>e,(e,t)=>{var n=bO(),r=I(n,!0);k(n),z(()=>{Ai(n,1,`px-2 py-1 text-xs rounded border transition-colors
|
|
102
|
+
${B(d)===t?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`}`),K(r,t)}),Fr(`click`,n,()=>w(t)),G(e,n)}),k(n),G(e,n)};q(r,e=>{t.gate.presentedArtifacts.length>1&&e(i)});var a=R(r,2),o=e=>{var t=W(),n=L(t),r=e=>{var t=SO();Bb(I(t),{size:`sm`}),k(t),G(e,t)},i=N(()=>B(l).has(B(d))),a=e=>{G(e,CO())},o=N(()=>B(u).has(B(d))),s=e=>{let t=N(()=>B(c).get(B(d)));var n=W(),r=L(n),i=e=>{var n=DO();fi(n,21,()=>B(t).files,e=>e.path,(e,t)=>{var n=EO(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=e=>{var n=wO();vi(n,()=>ID(B(t).content),!0),k(n),G(e,n)},s=N(()=>ee(B(t).path)),c=e=>{var n=TO(),r=I(n),i=I(r,!0);k(r),k(n),z(()=>K(i,B(t).content)),G(e,n)};q(a,e=>{B(s)?e(o):e(c,-1)}),k(n),z(()=>K(i,B(t).path)),G(e,n)}),k(n),G(e,n)},a=e=>{G(e,OO())};q(r,e=>{B(t)&&B(t).files.length>0?e(i):e(a,-1)}),G(e,n)};q(n,e=>{B(i)?e(r):B(o)?e(a,1):e(s,-1)}),G(e,t)};q(a,e=>{B(d)&&e(o)}),k(n),G(e,n)},ge=e=>{var r=AO();pO(I(r),{get workflowId(){return t.workflowId},get refreshSignal(){return n()},get fetchFileTree(){return t.fetchFileTree},get fetchFileContent(){return t.fetchFileContent}}),k(r),G(e,r)};q(pe,e=>{B(r)===`summary`?e(me):B(r)===`artifacts`?e(he,1):B(r)===`files`&&t.fetchFileTree&&t.fetchFileContent&&e(ge,2)});var _e=R(pe,2),ve=e=>{var t=jO(),n=I(t),r=I(n,!0);k(n);var a=R(n,2);Sn(a),Ji(a,`rows`,3);var o=R(a,2),c=I(o);{let e=N(()=>!B(i).trim()||B(s));Dd(c,{variant:`default`,size:`sm`,onclick:S,get disabled(){return B(e)},get loading(){return B(s)},children:(e,t)=>{A();var n=U();z(()=>K(n,B(x))),G(e,n)},$$slots:{default:!0}})}Dd(R(c,2),{variant:`ghost`,size:`sm`,onclick:y,children:(e,t)=>{A(),G(e,U(`Cancel`))},$$slots:{default:!0}}),k(o),k(t),z(()=>K(r,B(b))),ea(a,()=>B(i),e=>F(i,e)),G(e,t)};q(_e,e=>{B(a)!==null&&e(ve)});var ye=R(_e,2),be=e=>{var t=MO(),n=R(I(t),2),r=I(n);Dd(r,{variant:`destructive`,size:`sm`,onclick:_,get loading(){return B(s)},children:(e,t)=>{A(),G(e,U(`Confirm Abort`))},$$slots:{default:!0}}),Dd(R(r,2),{variant:`ghost`,size:`sm`,onclick:v,children:(e,t)=>{A(),G(e,U(`Cancel`))},$$slots:{default:!0}}),k(n),k(t),G(e,t)};q(ye,e=>{B(o)&&e(be)});var xe=R(ye,2),Se=e=>{var t=NO(),n=I(t),r=e=>{Dd(e,{variant:`success`,onclick:h,get disabled(){return B(s)},get loading(){return B(s)},children:(e,t)=>{A(),G(e,U(`Approve`))},$$slots:{default:!0}})},i=N(()=>m(`APPROVE`));q(n,e=>{B(i)&&e(r)});var a=R(n,2),o=e=>{Dd(e,{variant:`default`,onclick:()=>g(`FORCE_REVISION`),get disabled(){return B(s)},children:(e,t)=>{A(),G(e,U(`Request Revision`))},$$slots:{default:!0}})},c=N(()=>m(`FORCE_REVISION`));q(a,e=>{B(c)&&e(o)});var l=R(a,2),u=e=>{Dd(e,{variant:`outline`,onclick:()=>g(`REPLAN`),get disabled(){return B(s)},children:(e,t)=>{A(),G(e,U(`Replan`))},$$slots:{default:!0}})},d=N(()=>m(`REPLAN`));q(l,e=>{B(d)&&e(u)});var f=R(l,2),p=e=>{Dd(e,{variant:`destructive`,onclick:_,get disabled(){return B(s)},children:(e,t)=>{A(),G(e,U(`Abort Workflow`))},$$slots:{default:!0}})},v=N(()=>m(`ABORT`));q(f,e=>{B(v)&&e(p)}),k(t),G(e,t)};q(xe,e=>{B(a)===null&&!B(o)&&e(Se)}),k(E),z(e=>{K(ie,`Review Required: ${t.gate.stateName??``}`),K(se,t.workflowName),Ai(ce,1,`px-3 py-1.5 text-sm transition-colors border-b-2 -mb-px ${e??``}`)},[()=>T(`summary`)]),Fr(`click`,ce,()=>F(r,`summary`)),G(e,E),M()}Ir([`click`]);var IO=V(`<div data-testid="message-log-empty" class="text-sm text-muted-foreground italic px-2 py-6 text-center">No message-log entries yet.</div>`),LO=V(`<div class="prose-markdown" data-testid="agent-full"></div>`),RO=V(`<div class="truncate" data-testid="agent-preview"><span class="text-[10px] uppercase tracking-wider text-muted-foreground/70 mr-2"> </span> </div>`),zO=V(`· confidence: <span class="font-mono text-foreground/80"> </span>`,1),BO=V(`<div class="mt-1 text-xs text-muted-foreground">verdict: <span class="font-mono text-foreground/80"> </span> <!></div>`),VO=V(`<button type="button" class="w-full text-left text-sm text-foreground/90 hover:text-foreground transition-colors" data-testid="agent-toggle"><!></button> <!>`,1),HO=V(`<div class="text-sm font-mono text-foreground/90"><span class="text-muted-foreground"> </span> <span class="mx-1.5 text-muted-foreground">→</span> <span> </span> <span class="mx-2 text-muted-foreground">/</span> <span class="text-foreground/70"> </span></div>`),UO=V(`<div class="text-sm text-foreground/90"><span class="text-muted-foreground">accepted events:</span> <span class="font-mono text-foreground/80"> </span></div>`),WO=V(`<div class="mt-1 text-xs text-muted-foreground italic"> </div>`),GO=V(`<div class="text-sm text-foreground/90"><span class="text-muted-foreground">resolved with</span> <span class="font-mono text-foreground/80"> </span> <!></div>`),KO=V(`<div class="mt-1 text-xs text-muted-foreground whitespace-pre-wrap"> </div>`),qO=V(`<div class="text-sm text-destructive whitespace-pre-wrap"> </div> <!>`,1),JO=V(`<div class="mt-1 text-xs text-muted-foreground"> </div>`),YO=V(`<div class="text-sm text-destructive"><span class="text-[10px] uppercase tracking-wider mr-2"> </span> <span class="whitespace-pre-wrap"> </span></div> <!>`,1),XO=V(`<div class="text-sm text-warning"><span class="text-[10px] uppercase tracking-wider mr-2"> </span> <span class="font-mono"> </span></div> <div class="mt-1 text-xs text-muted-foreground whitespace-pre-wrap"> </div>`,1),ZO=V(`<div class="flex items-baseline gap-2 text-xs text-muted-foreground mb-1"><!> <span class="font-mono text-foreground/70"> </span> <span class="ml-auto"> </span></div> <!>`,1),QO=V(`<div data-testid="message-log-loading" class="flex items-center justify-center gap-2 text-xs text-muted-foreground py-3"><!> <span>Loading older entries…</span></div>`),$O=V(`<div class="flex justify-center pt-2"><!></div>`),ek=V(`<div data-testid="message-log-timeline" class="space-y-2"><div data-testid="message-log-scroll"><!> <!></div> <!> <!></div>`);function tk(e,t){j(t,!0);let n=ca(t,`loading`,3,!1),r=ca(t,`maxHeight`,3,`60vh`),i={agent_sent:{label:`Agent sent`,badgeVariant:`default`},agent_received:{label:`Agent received`,badgeVariant:`success`},state_transition:{label:`State`,badgeVariant:`outline`},gate_raised:{label:`Gate raised`,badgeVariant:`secondary`},gate_resolved:{label:`Gate resolved`,badgeVariant:`secondary`},error:{label:`Error`,badgeVariant:`destructive`},quota_exhausted:{label:`Quota exhausted`,badgeVariant:`destructive`},agent_retry:{label:`Retry`,badgeVariant:`warning`}},a=new WeakMap,o=0;function s(e){let t=a.get(e);return t===void 0&&(t=o++,a.set(e,t)),e.ts+`:`+e.type+`:`+String(t)}let c=P(on(new Set));function l(e){let t=new Set(B(c));t.has(e)?t.delete(e):t.add(e),F(c,t,!0)}function u(e){return B(c).has(e)}function d(e){if(!e)return``;let t=e.split(`
|
|
103
|
+
`,1)[0]??``;return t.length<=120&&!e.includes(`
|
|
104
|
+
`)?t:(t.length>120?t.slice(0,120):t)+`…`}function f(e,t=Date.now()){let n=Date.parse(e);if(Number.isNaN(n))return e;let r=Math.round((t-n)/1e3);if(r<5)return`just now`;if(r<60)return`${r}s ago`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);if(a<24)return`${a}h ago`;let o=Math.round(a/24);return o<30?`${o}d ago`:new Date(n).toLocaleDateString()}function p(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function m(e){return e.type===`agent_sent`||e.type===`agent_received`}function h(){t.onLoadOlder?.()}var g=ek(),_=I(g),v=I(_),y=e=>{G(e,IO())};q(v,e=>{t.entries.length===0&&!n()&&e(y)}),fi(R(v,2),17,()=>t.entries,e=>s(e),(e,t)=>{let n=N(()=>i[B(t).type]),r=N(()=>s(B(t)));yc(e,{"data-testid":`message-log-entry`,get"data-entry-type"(){return B(t).type},class:`px-3 py-2`,children:(e,i)=>{var a=ZO(),o=L(a),s=I(o);Oc(s,{get variant(){return B(n).badgeVariant},class:`font-mono shrink-0`,children:(e,t)=>{A();var r=U();z(()=>K(r,B(n).label)),G(e,r)},$$slots:{default:!0}});var c=R(s,2),h=I(c,!0);k(c);var g=R(c,2),_=I(g,!0);k(g),k(o);var v=R(o,2),y=e=>{let n=N(()=>u(B(r)));var i=VO(),a=L(i),o=I(a),s=e=>{var n=LO();vi(n,()=>ID(B(t).message),!0),k(n),G(e,n)},c=e=>{var n=RO(),r=I(n),i=I(r,!0);k(r);var a=R(r);k(n),z(e=>{K(i,B(t).role),K(a,` ${e??``}`)},[()=>d(B(t).message)]),G(e,n)};q(o,e=>{B(n)?e(s):e(c,-1)}),k(a);var f=R(a,2),p=e=>{var n=BO(),r=R(I(n)),i=I(r,!0);k(r);var a=R(r,2),o=e=>{var n=zO(),r=R(L(n)),i=I(r,!0);k(r),z(()=>K(i,B(t).confidence)),G(e,n)};q(a,e=>{B(t).confidence&&e(o)}),k(n),z(()=>K(i,B(t).verdict)),G(e,n)};q(f,e=>{B(t).type===`agent_received`&&B(t).verdict&&e(p)}),z(()=>Ji(a,`aria-expanded`,B(n))),Fr(`click`,a,()=>l(B(r))),G(e,i)},b=N(()=>m(B(t))),x=e=>{var n=HO(),r=I(n),i=I(r,!0);k(r);var a=R(r,4),o=I(a,!0);k(a);var s=R(a,4),c=I(s,!0);k(s),k(n),z(()=>{K(i,B(t).from),K(o,B(t).state),K(c,B(t).event)}),G(e,n)},S=e=>{var n=UO(),r=R(I(n),2),i=I(r,!0);k(r),k(n),z(e=>K(i,e),[()=>B(t).acceptedEvents.join(`, `)||`—`]),G(e,n)},C=e=>{var n=GO(),r=R(I(n),2),i=I(r,!0);k(r);var a=R(r,2),o=e=>{var n=WO(),r=I(n,!0);k(n),z(()=>K(r,B(t).prompt)),G(e,n)};q(a,e=>{B(t).prompt&&e(o)}),k(n),z(()=>K(i,B(t).event)),G(e,n)},w=e=>{var n=qO(),r=L(n),i=I(r,!0);k(r);var a=R(r,2),o=e=>{var n=KO(),r=I(n,!0);k(n),z(()=>K(r,B(t).context)),G(e,n)};q(a,e=>{B(t).context&&e(o)}),z(()=>K(i,B(t).error)),G(e,n)},T=e=>{var n=YO(),r=L(n),i=I(r),a=I(i,!0);k(i);var o=R(i,2),s=I(o,!0);k(o),k(r);var c=R(r,2),l=e=>{var n=JO(),r=I(n);k(n),z(e=>K(r,`resets at ${e??``}`),[()=>p(B(t).resetAt)]),G(e,n)};q(c,e=>{B(t).resetAt&&e(l)}),z(()=>{K(a,B(t).role),K(s,B(t).rawMessage)}),G(e,n)},ee=e=>{var n=XO(),r=L(n),i=I(r),a=I(i,!0);k(i);var o=R(i,2),s=I(o,!0);k(o),k(r);var c=R(r,2),l=I(c,!0);k(c),z(()=>{K(a,B(t).role),K(s,B(t).reason),K(l,B(t).details)}),G(e,n)};q(v,e=>{B(b)?e(y):B(t).type===`state_transition`?e(x,1):B(t).type===`gate_raised`?e(S,2):B(t).type===`gate_resolved`?e(C,3):B(t).type===`error`?e(w,4):B(t).type===`quota_exhausted`?e(T,5):B(t).type===`agent_retry`&&e(ee,6)}),z((e,n)=>{K(h,B(t).state),Ji(g,`title`,e),K(_,n)},[()=>p(B(t).ts),()=>f(B(t).ts)]),G(e,a)},$$slots:{default:!0}})}),k(_);var b=R(_,2),x=e=>{var t=QO();Bb(I(t),{size:`sm`}),A(2),k(t),G(e,t)};q(b,e=>{n()&&e(x)});var S=R(b,2),C=e=>{var n=$O(),r=I(n);{let e=N(()=>t.onLoadOlder==null);Dd(r,{"data-testid":`message-log-load-older`,variant:`outline`,size:`sm`,onclick:h,get disabled(){return B(e)},children:(e,t)=>{A(),G(e,U(`Load older`))},$$slots:{default:!0}})}k(n),G(e,n)};q(S,e=>{t.hasMore&&!n()&&e(C)}),k(g),z(()=>{Ai(_,1,wi(r()?`overflow-y-auto space-y-2 pr-1`:`space-y-2`)),Mi(_,r()?`max-height: ${r()}`:void 0)}),G(e,g),M()}Ir([`click`]);var nk=V(`<div class="px-5 py-3 border-b border-border"><h2 class="text-sm font-semibold"> </h2></div>`),rk=V(`<div class="fixed inset-0 z-50 flex items-start justify-center pt-[10vh]"><div class="absolute inset-0 bg-black/60 backdrop-blur-sm animate-fade-in"></div> <div role="dialog" aria-modal="true" tabindex="-1"><!> <!></div></div>`);function ik(e,t){j(t,!0);let n=P(void 0),r=null;function i(){return B(n)?Array.from(B(n).querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])`)):[]}function a(e){if(e.key!==`Tab`)return;let t=i();if(t.length===0){e.preventDefault(),B(n)?.focus();return}let r=t[0],a=t[t.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),a.focus()):document.activeElement===a&&(e.preventDefault(),r.focus())}function o(e){if(e.key===`Escape`){e.stopPropagation(),t.onclose();return}a(e),t.onkeydown?.(e)}function s(){t.onclose()}Mn(()=>{t.open?(r=document.activeElement,requestAnimationFrame(()=>{let e=i();e.length>0?e[0].focus():B(n)?.focus()})):r&&r instanceof HTMLElement&&(r.focus(),r=null)});let c=`modal-title-${Math.random().toString(36).slice(2,8)}`;var l=W(),u=L(l),d=e=>{var r=rk(),i=I(r),a=R(i,2),l=I(a),u=e=>{var n=nk(),r=I(n),i=I(r,!0);k(r),k(n),z(()=>{Ji(r,`id`,c),K(i,t.title)}),G(e,n)};q(l,e=>{t.title&&e(u)});var d=R(l,2),f=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(d,e=>{t.children&&e(f)}),k(a),aa(a,e=>F(n,e),()=>B(n)),k(r),z(e=>{Ji(a,`aria-labelledby`,t.title?c:void 0),Ai(a,1,e)},[()=>wi(hc(`relative z-10 w-full max-w-2xl mx-4 bg-card border border-border rounded-xl shadow-2xl animate-fade-in overflow-hidden`,t.class))]),Fr(`keydown`,r,o),Fr(`click`,i,s),G(e,r)};q(u,e=>{t.open&&e(d)}),G(e,l),M()}Ir([`keydown`,`click`]);var ak=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),ok=H(`<path d="M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z"></path>`),sk=H(`<path d="M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z" opacity="0.2"></path><path d="M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"></path>`,1),ck=H(`<path d="M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z"></path>`),lk=H(`<path d="M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z"></path>`),uk=H(`<path d="M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"></path>`),dk=H(`<path d="M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z"></path>`),fk=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function pk(e,t){j(t,!0);let n=pl(),r=sa(t,ak),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=fk();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,ok())},m=e=>{var t=sk();A(),G(e,t)},h=e=>{G(e,ck())},g=e=>{G(e,lk())},_=e=>{G(e,uk())},v=e=>{G(e,dk())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var mk=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),hk=H(`<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path>`),gk=H(`<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>`,1),_k=H(`<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>`),vk=H(`<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"></path>`),yk=H(`<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>`),bk=H(`<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"></path>`),xk=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Sk(e,t){j(t,!0);let n=pl(),r=sa(t,mk),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=xk();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,hk())},m=e=>{var t=gk();A(),G(e,t)},h=e=>{G(e,_k())},g=e=>{G(e,vk())},_=e=>{G(e,yk())},v=e=>{G(e,bk())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Ck=V(`<div class="flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground"><!> Loading README…</div>`),wk=V(`<div class="py-6 text-sm text-destructive" data-testid="workflow-readme-error"> </div>`),Tk=V(`<article class="prose-markdown text-sm" data-testid="workflow-readme-content"></article>`),Ek=V(`<div class="py-6 text-sm text-muted-foreground">This workflow has no README content.</div>`),Dk=V(`<div class="flex items-center justify-between gap-3 px-5 py-3 border-b border-border"><div class="flex items-center gap-2 min-w-0"><!> <h2 class="text-sm font-semibold truncate"> <span class="text-muted-foreground font-normal">· README</span></h2></div> <button type="button" aria-label="Close README" class="shrink-0 rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"><!></button></div> <div class="max-h-[68vh] overflow-y-auto px-5 py-4" data-testid="workflow-readme-body"><!></div>`,1);function Ok(e,t){j(t,!0);let n=P(!1),r=P(null),i=P(null),a=0;Mn(()=>{let e=t.open;t.title,e&&Dr(()=>{o()})});async function o(){let e=++a;F(n,!0),F(r,null),F(i,null);try{let n=await t.fetchReadme();e===a&&F(i,n,!0)}catch(t){e===a&&F(r,t instanceof Error?t.message:String(t),!0)}finally{e===a&&F(n,!1)}}ik(e,{get open(){return t.open},get onclose(){return t.onclose},class:`max-w-3xl`,children:(e,a)=>{var o=Dk(),s=L(o),c=I(s),l=I(c);pk(l,{size:18,weight:`duotone`,class:`text-primary shrink-0`});var u=R(l,2),d=I(u);A(),k(u),k(c);var f=R(c,2);Sk(I(f),{size:16}),k(f),k(s);var p=R(s,2),m=I(p),h=e=>{var t=Ck();Bb(I(t),{size:`sm`}),A(),k(t),G(e,t)},g=e=>{var t=wk(),n=I(t);k(t),z(()=>K(n,`Could not load README: ${B(r)??``}`)),G(e,t)},_=e=>{var t=Tk();vi(t,()=>ID(B(i)),!0),k(t),G(e,t)},v=N(()=>B(i)!==null&&B(i).trim().length>0),y=e=>{G(e,Ek())};q(m,e=>{B(n)?e(h):B(r)?e(g,1):B(v)?e(_,2):e(y,-1)}),k(p),z(()=>K(d,`${t.title??``} `)),Fr(`click`,f,function(...e){t.onclose?.apply(this,e)}),G(e,o)},$$slots:{default:!0}}),M()}Ir([`click`]);var kk=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Ak=H(`<path d="M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"></path>`),jk=H(`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"></path>`,1),Mk=H(`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"></path>`),Nk=H(`<path d="M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"></path>`),Pk=H(`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"></path>`),Fk=H(`<path d="M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"></path>`),Ik=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Lk(e,t){j(t,!0);let n=pl(),r=sa(t,kk),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=Ik();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Ak())},m=e=>{var t=jk();A(),G(e,t)},h=e=>{G(e,Mk())},g=e=>{G(e,Nk())},_=e=>{G(e,Pk())},v=e=>{G(e,Fk())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var Rk=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),zk=H(`<path d="M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"></path>`),Bk=H(`<path d="M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z" opacity="0.2"></path><path d="M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"></path>`,1),Vk=H(`<path d="M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"></path>`),Hk=H(`<path d="M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"></path>`),Uk=H(`<path d="M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"></path>`),Wk=H(`<path d="M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"></path>`),Gk=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function Kk(e,t){j(t,!0);let n=pl(),r=sa(t,Rk),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=Gk();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,zk())},m=e=>{var t=Bk();A(),G(e,t)},h=e=>{G(e,Vk())},g=e=>{G(e,Hk())},_=e=>{G(e,Uk())},v=e=>{G(e,Wk())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var qk=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),Jk=H(`<path d="M84,108A12,12,0,0,1,96,96h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,108Zm32,28H96a12,12,0,0,0,0,24h20a12,12,0,0,0,0-24ZM228,48V156.69a19.86,19.86,0,0,1-5.86,14.14l-51.31,51.31A19.86,19.86,0,0,1,156.69,228H48a20,20,0,0,1-20-20V48A20,20,0,0,1,48,28H208A20,20,0,0,1,228,48ZM52,204h92V156a12,12,0,0,1,12-12h48V52H52Zm139-36H168v23Z"></path>`),Yk=H(`<path d="M216,160l-56,56V160Z" opacity="0.2"></path><path d="M88,96a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,96Zm8,40h64a8,8,0,0,0,0-16H96a8,8,0,0,0,0,16Zm32,16H96a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM224,48V156.69A15.86,15.86,0,0,1,219.31,168L168,219.31A15.86,15.86,0,0,1,156.69,224H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM48,208H152V160a8,8,0,0,1,8-8h48V48H48Zm120-40v28.7L196.69,168Z"></path>`,1),Xk=H(`<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.92,15.92,0,0,0,168,219.31L219.31,168A15.92,15.92,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM96,88h64a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16Zm32,80H96a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16ZM96,136a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm64,68.69V160h44.7Z"></path>`),Zk=H(`<path d="M90,96a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H96A6,6,0,0,1,90,96Zm6,38h64a6,6,0,0,0,0-12H96a6,6,0,0,0,0,12Zm32,20H96a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12ZM222,48V156.69a13.94,13.94,0,0,1-4.1,9.9L166.59,217.9a13.94,13.94,0,0,1-9.9,4.1H48a14,14,0,0,1-14-14V48A14,14,0,0,1,48,34H208A14,14,0,0,1,222,48ZM48,210H154V160a6,6,0,0,1,6-6h50V48a2,2,0,0,0-2-2H48a2,2,0,0,0-2,2V208A2,2,0,0,0,48,210Zm153.52-44H166v35.52Z"></path>`),Qk=H(`<path d="M88,96a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,96Zm8,40h64a8,8,0,0,0,0-16H96a8,8,0,0,0,0,16Zm32,16H96a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM224,48V156.69A15.86,15.86,0,0,1,219.31,168L168,219.31A15.86,15.86,0,0,1,156.69,224H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM48,208H152V160a8,8,0,0,1,8-8h48V48H48Zm120-40v28.7L196.69,168Z"></path>`),$k=H(`<path d="M92,96a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H96A4,4,0,0,1,92,96Zm4,36h64a4,4,0,0,0,0-8H96a4,4,0,0,0,0,8Zm32,24H96a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8ZM220,48V156.69a11.9,11.9,0,0,1-3.52,8.48l-51.31,51.32a11.93,11.93,0,0,1-8.48,3.51H48a12,12,0,0,1-12-12V48A12,12,0,0,1,48,36H208A12,12,0,0,1,220,48ZM48,212H156V160a4,4,0,0,1,4-4h52V48a4,4,0,0,0-4-4H48a4,4,0,0,0-4,4V208A4,4,0,0,0,48,212Zm158.35-48H164v42.35Z"></path>`),eA=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function tA(e,t){j(t,!0);let n=pl(),r=sa(t,qk),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=eA();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,Jk())},m=e=>{var t=Yk();A(),G(e,t)},h=e=>{G(e,Xk())},g=e=>{G(e,Zk())},_=e=>{G(e,Qk())},v=e=>{G(e,$k())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var nA=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),rA=H(`<path d="M228.75,100.05c-3.52-3.67-7.15-7.46-8.34-10.33-1.06-2.56-1.14-7.83-1.21-12.47-.15-10-.34-22.44-9.18-31.27s-21.27-9-31.27-9.18c-4.64-.07-9.91-.15-12.47-1.21-2.87-1.19-6.66-4.82-10.33-8.34C148.87,20.46,140.05,12,128,12s-20.87,8.46-27.95,15.25c-3.67,3.52-7.46,7.15-10.33,8.34-2.56,1.06-7.83,1.14-12.47,1.21C67.25,37,54.81,37.14,46,46S37,67.25,36.8,77.25c-.07,4.64-.15,9.91-1.21,12.47-1.19,2.87-4.82,6.66-8.34,10.33C20.46,107.13,12,116,12,128S20.46,148.87,27.25,156c3.52,3.67,7.15,7.46,8.34,10.33,1.06,2.56,1.14,7.83,1.21,12.47.15,10,.34,22.44,9.18,31.27s21.27,9,31.27,9.18c4.64.07,9.91.15,12.47,1.21,2.87,1.19,6.66,4.82,10.33,8.34C107.13,235.54,116,244,128,244s20.87-8.46,27.95-15.25c3.67-3.52,7.46-7.15,10.33-8.34,2.56-1.06,7.83-1.14,12.47-1.21,10-.15,22.44-.34,31.27-9.18s9-21.27,9.18-31.27c.07-4.64.15-9.91,1.21-12.47,1.19-2.87,4.82-6.66,8.34-10.33C235.54,148.87,244,140.05,244,128S235.54,107.13,228.75,100.05Zm-17.32,39.29c-4.82,5-10.28,10.72-13.19,17.76-2.82,6.8-2.93,14.16-3,21.29-.08,5.36-.19,12.71-2.15,14.66s-9.3,2.07-14.66,2.15c-7.13.11-14.49.22-21.29,3-7,2.91-12.73,8.37-17.76,13.19C135.78,214.84,130.4,220,128,220s-7.78-5.16-11.34-8.57c-5-4.82-10.72-10.28-17.76-13.19-6.8-2.82-14.16-2.93-21.29-3-5.36-.08-12.71-.19-14.66-2.15s-2.07-9.3-2.15-14.66c-.11-7.13-.22-14.49-3-21.29-2.91-7-8.37-12.73-13.19-17.76C41.16,135.78,36,130.4,36,128s5.16-7.78,8.57-11.34c4.82-5,10.28-10.72,13.19-17.76,2.82-6.8,2.93-14.16,3-21.29C60.88,72.25,61,64.9,63,63s9.3-2.07,14.66-2.15c7.13-.11,14.49-.22,21.29-3,7-2.91,12.73-8.37,17.76-13.19C120.22,41.16,125.6,36,128,36s7.78,5.16,11.34,8.57c5,4.82,10.72,10.28,17.76,13.19,6.8,2.82,14.16,2.93,21.29,3,5.36.08,12.71.19,14.66,2.15s2.07,9.3,2.15,14.66c.11,7.13.22,14.49,3,21.29,2.91,7,8.37,12.73,13.19,17.76,3.41,3.56,8.57,8.94,8.57,11.34S214.84,135.78,211.43,139.34ZM176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51Z"></path>`),iA=H(`<path d="M232,128c0,12.51-17.82,21.95-22.68,33.69-4.68,11.32,1.42,30.65-7.78,39.85s-28.53,3.1-39.85,7.78C150,214.18,140.5,232,128,232s-22-17.82-33.69-22.68c-11.32-4.68-30.65,1.42-39.85-7.78s-3.1-28.53-7.78-39.85C41.82,150,24,140.5,24,128s17.82-22,22.68-33.69C51.36,83,45.26,63.66,54.46,54.46S83,51.36,94.31,46.68C106.05,41.82,115.5,24,128,24S150,41.82,161.69,46.68c11.32,4.68,30.65-1.42,39.85,7.78s3.1,28.53,7.78,39.85C214.18,106.05,232,115.5,232,128Z" opacity="0.2"></path><path d="M225.86,102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28,23.51,138.44,16,128,16s-18.27,7.51-25.18,14.14c-3.94,3.77-8,7.67-11.57,9.14C88,40.64,82.56,40.72,77.31,40.8c-9.76.15-20.82.31-28.51,8S41,67.55,40.8,77.31c-.08,5.25-.16,10.67-1.52,13.94-1.47,3.56-5.37,7.63-9.14,11.57C23.51,109.72,16,117.56,16,128s7.51,18.27,14.14,25.18c3.77,3.94,7.67,8,9.14,11.57,1.36,3.27,1.44,8.69,1.52,13.94.15,9.76.31,20.82,8,28.51s18.75,7.85,28.51,8c5.25.08,10.67.16,13.94,1.52,3.56,1.47,7.63,5.37,11.57,9.14C109.72,232.49,117.56,240,128,240s18.27-7.51,25.18-14.14c3.94-3.77,8-7.67,11.57-9.14,3.27-1.36,8.69-1.44,13.94-1.52,9.76-.15,20.82-.31,28.51-8s7.85-18.75,8-28.51c.08-5.25.16-10.67,1.52-13.94,1.47-3.56,5.37-7.63,9.14-11.57C232.49,146.28,240,138.44,240,128S232.49,109.73,225.86,102.82Zm-11.55,39.29c-4.79,5-9.75,10.17-12.38,16.52-2.52,6.1-2.63,13.07-2.73,19.82-.1,7-.21,14.33-3.32,17.43s-10.39,3.22-17.43,3.32c-6.75.1-13.72.21-19.82,2.73-6.35,2.63-11.52,7.59-16.52,12.38S132,224,128,224s-9.15-4.92-14.11-9.69-10.17-9.75-16.52-12.38c-6.1-2.52-13.07-2.63-19.82-2.73-7-.1-14.33-.21-17.43-3.32s-3.22-10.39-3.32-17.43c-.1-6.75-.21-13.72-2.73-19.82-2.63-6.35-7.59-11.52-12.38-16.52S32,132,32,128s4.92-9.15,9.69-14.11,9.75-10.17,12.38-16.52c2.52-6.1,2.63-13.07,2.73-19.82.1-7,.21-14.33,3.32-17.43S70.51,56.9,77.55,56.8c6.75-.1,13.72-.21,19.82-2.73,6.35-2.63,11.52-7.59,16.52-12.38S124,32,128,32s9.15,4.92,14.11,9.69,10.17,9.75,16.52,12.38c6.1,2.52,13.07,2.63,19.82,2.73,7,.1,14.33.21,17.43,3.32s3.22,10.39,3.32,17.43c.1,6.75.21,13.72,2.73,19.82,2.63,6.35,7.59,11.52,12.38,16.52S224,124,224,128,219.08,137.15,214.31,142.11ZM173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34Z"></path>`,1),aA=H(`<path d="M225.86,102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28,23.51,138.44,16,128,16s-18.27,7.51-25.18,14.14c-3.94,3.77-8,7.67-11.57,9.14C88,40.64,82.56,40.72,77.31,40.8c-9.76.15-20.82.31-28.51,8S41,67.55,40.8,77.31c-.08,5.25-.16,10.67-1.52,13.94-1.47,3.56-5.37,7.63-9.14,11.57C23.51,109.72,16,117.56,16,128s7.51,18.27,14.14,25.18c3.77,3.94,7.67,8,9.14,11.57,1.36,3.27,1.44,8.69,1.52,13.94.15,9.76.31,20.82,8,28.51s18.75,7.85,28.51,8c5.25.08,10.67.16,13.94,1.52,3.56,1.47,7.63,5.37,11.57,9.14C109.72,232.49,117.56,240,128,240s18.27-7.51,25.18-14.14c3.94-3.77,8-7.67,11.57-9.14,3.27-1.36,8.69-1.44,13.94-1.52,9.76-.15,20.82-.31,28.51-8s7.85-18.75,8-28.51c.08-5.25.16-10.67,1.52-13.94,1.47-3.56,5.37-7.63,9.14-11.57C232.49,146.28,240,138.44,240,128S232.49,109.73,225.86,102.82Zm-52.2,6.84-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"></path>`),oA=H(`<path d="M224.42,104.2c-3.9-4.07-7.93-8.27-9.55-12.18-1.5-3.63-1.58-9-1.67-14.68-.14-9.38-.3-20-7.42-27.12S188,42.94,178.66,42.8c-5.68-.09-11-.17-14.68-1.67-3.91-1.62-8.11-5.65-12.18-9.55C145.16,25.22,137.64,18,128,18s-17.16,7.22-23.8,13.58c-4.07,3.9-8.27,7.93-12.18,9.55-3.63,1.5-9,1.58-14.68,1.67-9.38.14-20,.3-27.12,7.42S42.94,68,42.8,77.34c-.09,5.68-.17,11-1.67,14.68-1.62,3.91-5.65,8.11-9.55,12.18C25.22,110.84,18,118.36,18,128s7.22,17.16,13.58,23.8c3.9,4.07,7.93,8.27,9.55,12.18,1.5,3.63,1.58,9,1.67,14.68.14,9.38.3,20,7.42,27.12S68,213.06,77.34,213.2c5.68.09,11,.17,14.68,1.67,3.91,1.62,8.11,5.65,12.18,9.55C110.84,230.78,118.36,238,128,238s17.16-7.22,23.8-13.58c4.07-3.9,8.27-7.93,12.18-9.55,3.63-1.5,9-1.58,14.68-1.67,9.38-.14,20-.3,27.12-7.42s7.28-17.74,7.42-27.12c.09-5.68.17-11,1.67-14.68,1.62-3.91,5.65-8.11,9.55-12.18C230.78,145.16,238,137.64,238,128S230.78,110.84,224.42,104.2Zm-8.66,39.3c-4.67,4.86-9.5,9.9-12,15.9-2.38,5.74-2.48,12.52-2.58,19.08-.11,7.44-.23,15.14-3.9,18.82s-11.38,3.79-18.82,3.9c-6.56.1-13.34.2-19.08,2.58-6,2.48-11,7.31-15.91,12-5.25,5-10.68,10.24-15.49,10.24s-10.24-5.21-15.5-10.24c-4.86-4.67-9.9-9.5-15.9-12-5.74-2.38-12.52-2.48-19.08-2.58-7.44-.11-15.14-.23-18.82-3.9s-3.79-11.38-3.9-18.82c-.1-6.56-.2-13.34-2.58-19.08-2.48-6-7.31-11-12-15.91C35.21,138.24,30,132.81,30,128s5.21-10.24,10.24-15.5c4.67-4.86,9.5-9.9,12-15.9,2.38-5.74,2.48-12.52,2.58-19.08.11-7.44.23-15.14,3.9-18.82s11.38-3.79,18.82-3.9c6.56-.1,13.34-.2,19.08-2.58,6-2.48,11-7.31,15.91-12C117.76,35.21,123.19,30,128,30s10.24,5.21,15.5,10.24c4.86,4.67,9.9,9.5,15.9,12,5.74,2.38,12.52,2.48,19.08,2.58,7.44.11,15.14.23,18.82,3.9s3.79,11.38,3.9,18.82c.1,6.56.2,13.34,2.58,19.08,2.48,6,7.31,11,12,15.91,5,5.25,10.24,10.68,10.24,15.49S220.79,138.24,215.76,143.5ZM172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76Z"></path>`),sA=H(`<path d="M225.86,102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28,23.51,138.44,16,128,16s-18.27,7.51-25.18,14.14c-3.94,3.77-8,7.67-11.57,9.14C88,40.64,82.56,40.72,77.31,40.8c-9.76.15-20.82.31-28.51,8S41,67.55,40.8,77.31c-.08,5.25-.16,10.67-1.52,13.94-1.47,3.56-5.37,7.63-9.14,11.57C23.51,109.72,16,117.56,16,128s7.51,18.27,14.14,25.18c3.77,3.94,7.67,8,9.14,11.57,1.36,3.27,1.44,8.69,1.52,13.94.15,9.76.31,20.82,8,28.51s18.75,7.85,28.51,8c5.25.08,10.67.16,13.94,1.52,3.56,1.47,7.63,5.37,11.57,9.14C109.72,232.49,117.56,240,128,240s18.27-7.51,25.18-14.14c3.94-3.77,8-7.67,11.57-9.14,3.27-1.36,8.69-1.44,13.94-1.52,9.76-.15,20.82-.31,28.51-8s7.85-18.75,8-28.51c.08-5.25.16-10.67,1.52-13.94,1.47-3.56,5.37-7.63,9.14-11.57C232.49,146.28,240,138.44,240,128S232.49,109.73,225.86,102.82Zm-11.55,39.29c-4.79,5-9.75,10.17-12.38,16.52-2.52,6.1-2.63,13.07-2.73,19.82-.1,7-.21,14.33-3.32,17.43s-10.39,3.22-17.43,3.32c-6.75.1-13.72.21-19.82,2.73-6.35,2.63-11.52,7.59-16.52,12.38S132,224,128,224s-9.15-4.92-14.11-9.69-10.17-9.75-16.52-12.38c-6.1-2.52-13.07-2.63-19.82-2.73-7-.1-14.33-.21-17.43-3.32s-3.22-10.39-3.32-17.43c-.1-6.75-.21-13.72-2.73-19.82-2.63-6.35-7.59-11.52-12.38-16.52S32,132,32,128s4.92-9.15,9.69-14.11,9.75-10.17,12.38-16.52c2.52-6.1,2.63-13.07,2.73-19.82.1-7,.21-14.33,3.32-17.43S70.51,56.9,77.55,56.8c6.75-.1,13.72-.21,19.82-2.73,6.35-2.63,11.52-7.59,16.52-12.38S124,32,128,32s9.15,4.92,14.11,9.69,10.17,9.75,16.52,12.38c6.1,2.52,13.07,2.63,19.82,2.73,7,.1,14.33.21,17.43,3.32s3.22,10.39,3.32,17.43c.1,6.75.21,13.72,2.73,19.82,2.63,6.35,7.59,11.52,12.38,16.52S224,124,224,128,219.08,137.15,214.31,142.11ZM173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34Z"></path>`),cA=H(`<path d="M223,105.58c-4-4.2-8.2-8.54-10-12.8-1.65-4-1.73-9.53-1.82-15.41-.14-9-.29-19.19-6.83-25.74s-16.74-6.69-25.74-6.83c-5.88-.09-11.43-.17-15.41-1.82-4.26-1.76-8.6-5.93-12.8-9.95-6.68-6.41-13.59-13-22.42-13s-15.74,6.62-22.42,13c-4.2,4-8.54,8.2-12.8,10-4,1.65-9.53,1.73-15.41,1.82-9,.14-19.19.29-25.74,6.83S44.94,68.37,44.8,77.37c-.09,5.88-.17,11.43-1.82,15.41-1.76,4.26-5.93,8.6-9.95,12.8-6.41,6.68-13,13.59-13,22.42s6.62,15.74,13,22.42c4,4.2,8.2,8.54,10,12.8,1.65,4,1.73,9.53,1.82,15.41.14,9,.29,19.19,6.83,25.74s16.74,6.69,25.74,6.83c5.88.09,11.43.17,15.41,1.82,4.26,1.76,8.6,5.93,12.8,9.95,6.68,6.41,13.59,13,22.42,13s15.74-6.62,22.42-13c4.2-4,8.54-8.2,12.8-10,4-1.65,9.53-1.73,15.41-1.82,9-.14,19.19-.29,25.74-6.83s6.69-16.74,6.83-25.74c.09-5.88.17-11.43,1.82-15.41,1.76-4.26,5.93-8.6,9.95-12.8,6.41-6.68,13-13.59,13-22.42S229.38,112.26,223,105.58Zm-5.78,39.3c-4.54,4.73-9.24,9.63-11.57,15.28-2.23,5.39-2.33,12-2.43,18.35-.12,8.2-.24,16-4.49,20.2s-12,4.37-20.2,4.49c-6.37.1-13,.2-18.35,2.43-5.65,2.33-10.55,7-15.28,11.57C139.09,222.75,133.62,228,128,228s-11.09-5.25-16.88-10.8c-4.73-4.54-9.63-9.24-15.28-11.57-5.39-2.23-12-2.33-18.35-2.43-8.2-.12-15.95-.24-20.2-4.49s-4.37-12-4.49-20.2c-.1-6.37-.2-13-2.43-18.35-2.33-5.65-7-10.55-11.57-15.28C33.25,139.09,28,133.62,28,128s5.25-11.09,10.8-16.88c4.54-4.73,9.24-9.63,11.57-15.28,2.23-5.39,2.33-12,2.43-18.35.12-8.2.24-15.95,4.49-20.2s12-4.37,20.2-4.49c6.37-.1,13-.2,18.35-2.43,5.65-2.33,10.55-7,15.28-11.57C116.91,33.25,122.38,28,128,28s11.09,5.25,16.88,10.8c4.73,4.54,9.63,9.24,15.28,11.57,5.39,2.23,12,2.33,18.35,2.43,8.2.12,16,.24,20.2,4.49s4.37,12,4.49,20.2c.1,6.37.2,13,2.43,18.35,2.33,5.65,7,10.55,11.57,15.28,5.55,5.79,10.8,11.26,10.8,16.88S222.75,139.09,217.2,144.88Zm-46.37-43.71a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17Z"></path>`),lA=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function uA(e,t){j(t,!0);let n=pl(),r=sa(t,nA),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=lA();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,rA())},m=e=>{var t=iA();A(),G(e,t)},h=e=>{G(e,aA())},g=e=>{G(e,oA())},_=e=>{G(e,sA())},v=e=>{G(e,cA())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var dA=V(`<!> README`,1),fA=V(`<div class="flex items-center justify-center py-16"><!></div>`),pA=V(`<p class="text-sm text-muted-foreground mb-2">The daemon could not load this workflow's checkpoint or definition file. The run cannot be displayed or
|
|
105
|
+
resumed until the underlying file is repaired.</p> <pre data-testid="corruption-message" class="text-xs font-mono whitespace-pre-wrap text-destructive bg-destructive/5 border border-destructive/20 rounded p-3 overflow-x-auto"> </pre>`,1),mA=V(`<!> <!>`,1),hA=V(`<pre data-testid="workflow-error-text" class="text-xs font-mono whitespace-pre-wrap text-destructive bg-destructive/5 border border-destructive/20 rounded p-3 overflow-x-auto max-h-80 overflow-y-auto"> </pre>`),gA=V(`<p class="flex items-center gap-1.5 text-xs text-muted-foreground mb-1"><!> Round</p> <p class="text-lg font-semibold tabular-nums"> </p>`,1),_A=V(`<p class="flex items-center gap-1.5 text-xs text-muted-foreground mb-1"><!> Total Tokens</p> <p class="text-lg font-semibold tabular-nums"> </p>`,1),vA=V(`<p class="flex items-center gap-1.5 text-xs text-muted-foreground mb-1"><!> Workspace</p> <p class="text-sm font-mono truncate"> </p>`,1),yA=V(`<p class="flex items-center gap-1.5 text-xs text-muted-foreground mb-1"><!> Description</p> <p class="text-sm truncate"> </p>`,1),bA=V(`<span class="text-muted-foreground font-normal" data-testid="latest-verdict-confidence"> </span>`),xA=V(`<p class="flex items-center gap-1.5 text-xs text-muted-foreground mb-1"><!> Latest verdict</p> <p class="text-sm font-semibold truncate"><span data-testid="latest-verdict-value"> </span> <!></p> <p class="text-xs text-muted-foreground font-mono truncate" data-testid="latest-verdict-state"> </p>`,1),SA=V(`<div class="grid grid-cols-2 sm:grid-cols-4 gap-3"><!> <!> <!> <!> <!></div>`),CA=V(`<button class="flex items-center gap-2 w-full text-left"><span class="text-muted-foreground"> </span> <!></button>`),wA=V(`<div class="h-[400px]"><!></div>`),TA=V(`<button class="text-xs text-primary hover:underline ml-2"> </button>`),EA=V(`<div class="ml-20 mt-1 mb-2 p-3 rounded bg-muted/50 text-sm prose-markdown"></div>`),DA=V(`<div><div class="flex items-center gap-2 text-sm font-mono"><span class="text-muted-foreground text-xs w-16 shrink-0"> </span> <span class="text-foreground/70"> </span> <span class="text-muted-foreground">→</span> <span class="text-foreground"> </span> <!> <span class="text-muted-foreground text-xs ml-auto"> </span> <!></div> <!></div>`),OA=V(`<div class="space-y-1.5"></div>`),kA=V(`<span class="text-xs text-muted-foreground ml-auto"> </span>`),AA=V(`<button type="button" class="flex items-center gap-2 w-full text-left" data-testid="message-log-toggle"><span class="text-muted-foreground"> </span> <!> <!></button>`),jA=V(`<div class="flex items-center justify-center py-8"><!></div>`),MA=V(`<!> <!> <!> <!> <!> <!> <!>`,1),NA=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center gap-3"><!> <h2 class="text-xl font-semibold tracking-tight"> </h2> <!> <!> <span class="text-sm text-muted-foreground ml-auto">State: <span class="font-mono"> </span></span></div> <!> <!> <!></div>`);function PA(e,t){j(t,!0);let n=P(null),r=P(!0),i=P(``),a=P(``),o=P(``),s=P(!1),c=P(!1),l=P(on(new Set)),u=P(!1),d=P(on([])),f=P(!1),p=P(!1),m=P(``),h=P(!1);function g(e){let t=new Set(B(l));t.has(e)?t.delete(e):t.add(e),F(l,t,!0)}let _=0;Mn(()=>{let e=t.workflowId;t.summary.currentState,t.summary.phase,ja.value;let o=++_;o===1&&F(r,!0),F(i,``),F(a,``),Eo(e).then(e=>{o===_&&(F(n,e,!0),F(r,!1),e.gate&&(J.pendingGates=new Map(J.pendingGates).set(e.gate.gateId,e.gate)))}).catch(e=>{o===_&&(e instanceof ua&&e.code===`WORKFLOW_CORRUPTED`?(F(a,e.message,!0),F(i,``)):(F(i,e instanceof Error?e.message:String(e),!0),F(a,``)),F(r,!1))})});let v=N(()=>[t.summary.currentState,t.summary.phase,t.summary.latestVerdict?.stateId??``,t.summary.latestVerdict?.verdict??``,t.summary.latestVerdict?.confidence??``,ja.value].join(`|`));async function y(e){F(f,!0),F(m,``);try{let n=await No(t.workflowId,{limit:200,...e===void 0?{}:{before:e}});F(d,e===void 0?[...n.entries]:[...B(d),...n.entries],!0),F(p,n.hasMore,!0),F(h,!0)}catch(e){F(m,e instanceof Error?e.message:String(e),!0)}finally{F(f,!1)}}function b(){F(u,!B(u)),B(u)&&!B(h)&&!B(f)&&y()}function x(){if(B(f)||!B(p)||B(d).length===0)return;let e=B(d)[B(d).length-1];y(e.ts)}let S=N(()=>!!B(n)&&(B(n).phase===`failed`&&!!B(n).error||B(n).phase===`interrupted`&&!!B(n).error)),C=N(()=>B(n)?.phase===`failed`?`Workflow failed`:`Workflow interrupted`),w=N(()=>B(n)?.latestVerdict);function T(e){if(e!=null&&!Number.isNaN(e))return`${Math.round(e<=1?e*100:e)}%`}let ee=N(()=>B(n)?.transitionHistory?[...new Set(B(n).transitionHistory.map(e=>e.from))]:[]),E=N(()=>t.summary.phase===`failed`?t.summary.currentState:null),te=N(()=>B(n)?.context?.visitCounts??{}),ne=N(()=>t.gate&&B(n)?.stateGraph?B(n).stateGraph.states.find(e=>e.id===t.gate.stateName)?.description:void 0);async function re(e,n){F(o,``);try{await wo(t.workflowId,e,n)}catch(e){F(o,`Failed to resolve gate: ${e instanceof Error?e.message:String(e)}`)}}function ie(e){if(e<1e3)return`${e}ms`;let t=Math.floor(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function ae(e){return new Date(e).toLocaleTimeString()}var D=NA(),oe=I(D),se=I(oe);Dd(se,{variant:`ghost`,size:`sm`,get onclick(){return t.onback},children:(e,t)=>{A(),G(e,U(`← Back`))},$$slots:{default:!0}});var O=R(se,2),ce=I(O,!0);k(O);var le=R(O,2);{let e=N(()=>gc(t.summary.phase));Oc(le,{get variant(){return B(e)},children:(e,n)=>{A();var r=U();z(e=>K(r,e),[()=>Xc(t.summary.phase)]),G(e,r)},$$slots:{default:!0}})}var ue=R(le,2),de=e=>{Dd(e,{variant:`outline`,size:`sm`,type:`button`,"data-testid":`readme-info-button`,title:`View workflow README`,onclick:()=>F(s,!0),children:(e,t)=>{var n=dA();Lk(L(n),{size:15,weight:`duotone`,class:`mr-1`}),A(),G(e,n)},$$slots:{default:!0}})};q(ue,e=>{B(n)?.hasReadme&&e(de)});var fe=R(ue,2),pe=R(I(fe)),me=I(pe,!0);k(pe),k(fe),k(oe);var he=R(oe,2),ge=e=>{Db(e,{variant:`destructive`,dismissible:!0,ondismiss:()=>F(o,``),children:(e,t)=>{A();var n=U();z(()=>K(n,B(o))),G(e,n)},$$slots:{default:!0}})};q(he,e=>{B(o)&&e(ge)});var _e=R(he,2),ve=e=>{var t=fA();Bb(I(t),{size:`md`}),k(t),G(e,t)},ye=e=>{yc(e,{class:`border-destructive/40`,children:(e,t)=>{var n=mA(),r=L(n);xc(r,{children:(e,t)=>{Cc(e,{class:`text-destructive`,children:(e,t)=>{A(),G(e,U(`Workflow checkpoint is corrupted`))},$$slots:{default:!0}})},$$slots:{default:!0}}),Tc(R(r,2),{children:(e,t)=>{var n=pA(),r=R(L(n),2),i=I(r,!0);k(r),z(()=>K(i,B(a))),G(e,n)},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}})},be=e=>{Db(e,{variant:`destructive`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(i))),G(e,n)},$$slots:{default:!0}})},xe=e=>{var r=MA(),i=L(r),a=e=>{FO(e,{get gate(){return t.gate},get workflowId(){return t.workflowId},get workflowName(){return t.summary.name},get stateDescription(){return B(ne)},get refreshSignal(){return B(v)},onResolve:re,get fetchArtifacts(){return Mo},get fetchFileTree(){return Ao},get fetchFileContent(){return jo}})};q(i,e=>{t.gate&&t.summary.phase===`waiting_human`&&e(a)});var o=R(i,2),s=e=>{yc(e,{"data-testid":`workflow-error-callout`,class:`border-destructive/40`,children:(e,t)=>{var r=mA(),i=L(r);xc(i,{children:(e,t)=>{Cc(e,{class:`text-destructive`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(C))),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Tc(R(i,2),{children:(e,t)=>{var r=hA(),i=I(r,!0);k(r),z(()=>K(i,B(n).error)),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}})};q(o,e=>{B(S)&&e(s)});var h=R(o,2);yc(h,{children:(e,r)=>{var i=mA(),a=L(i);xc(a,{children:(e,t)=>{Cc(e,{children:(e,t)=>{A(),G(e,U(`State Machine`))},$$slots:{default:!0}})},$$slots:{default:!0}}),Tc(R(a,2),{children:(e,r)=>{Hw(e,{get graph(){return B(n).stateGraph},get currentState(){return t.summary.currentState},get completedStates(){return B(ee)},get failedState(){return B(E)},get visitCounts(){return B(te)}})},$$slots:{default:!0}}),G(e,i)},$$slots:{default:!0}});var _=R(h,2),y=e=>{var t=SA(),r=I(t);yc(r,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var r=gA(),i=L(r);uO(I(i),{size:14,weight:`duotone`}),A(),k(i);var a=R(i,2),o=I(a);k(a),z(()=>K(o,`${B(n).context.round??``}/${B(n).context.maxRounds??``}`)),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=R(r,2);yc(i,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var r=_A(),i=L(r);Yl(I(i),{size:14,weight:`duotone`}),A(),k(i);var a=R(i,2),o=I(a,!0);k(a),z(e=>K(o,e),[()=>B(n).context.totalTokens.toLocaleString()]),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=R(i,2);yc(a,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var r=vA(),i=L(r);Kk(I(i),{size:14,weight:`duotone`}),A(),k(i);var a=R(i,2),o=I(a,!0);k(a),z(()=>{Ji(a,`title`,B(n).workspacePath),K(o,B(n).workspacePath||`--`)}),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=R(a,2);yc(o,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var r=yA(),i=L(r);tA(I(i),{size:14,weight:`duotone`}),A(),k(i);var a=R(i,2),o=I(a,!0);k(a),z(()=>{Ji(a,`title`,B(n).description),K(o,B(n).description||`--`)}),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var s=R(o,2),c=e=>{let t=N(()=>T(B(w).confidence));yc(e,{"data-testid":`latest-verdict-card`,class:`border-primary/30`,children:(e,n)=>{Tc(e,{children:(e,n)=>{var r=xA(),i=L(r);uA(I(i),{size:14,weight:`duotone`,class:`text-primary`}),A(),k(i);var a=R(i,2),o=I(a),s=I(o,!0);k(o);var c=R(o,2),l=e=>{var n=bA(),r=I(n);k(n),z(()=>K(r,`— ${B(t)??``}`)),G(e,n)};q(c,e=>{B(t)&&e(l)}),k(a);var u=R(a,2),d=I(u,!0);k(u),z(()=>{Ji(a,`title`,B(w).verdict),K(s,B(w).verdict),Ji(u,`title`,`State: ${B(w).stateId}`),K(d,B(w).stateId)}),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};q(s,e=>{B(w)&&e(c)}),k(t),G(e,t)};q(_,e=>{B(n).context&&e(y)});var D=R(_,2);yc(D,{children:(e,n)=>{var r=mA(),i=L(r);xc(i,{children:(e,t)=>{var n=CA(),r=I(n),i=I(r,!0);k(r),Cc(R(r,2),{children:(e,t)=>{A(),G(e,U(`Workspace`))},$$slots:{default:!0}}),k(n),z(()=>K(i,B(c)?`▾`:`▸`)),Fr(`click`,n,()=>F(c,!B(c))),G(e,n)},$$slots:{default:!0}});var a=R(i,2),o=e=>{Tc(e,{children:(e,n)=>{var r=wA();pO(I(r),{get workflowId(){return t.workflowId},get refreshSignal(){return B(v)},get fetchFileTree(){return Ao},get fetchFileContent(){return jo}}),k(r),G(e,r)},$$slots:{default:!0}})};q(a,e=>{B(c)&&e(o)}),G(e,r)},$$slots:{default:!0}});var oe=R(D,2),se=e=>{yc(e,{children:(e,t)=>{var r=mA(),i=L(r);xc(i,{children:(e,t)=>{Cc(e,{children:(e,t)=>{A(),G(e,U(`Transition History`))},$$slots:{default:!0}})},$$slots:{default:!0}}),Tc(R(i,2),{children:(e,t)=>{var r=OA();fi(r,21,()=>B(n).transitionHistory,ci,(e,t,n)=>{var r=DA(),i=I(r),a=I(i),o=I(a,!0);k(a);var s=R(a,2),c=I(s,!0);k(s);var u=R(s,4),d=I(u,!0);k(u);var f=R(u,2),p=e=>{Oc(e,{variant:`outline`,class:`ml-1`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).event)),G(e,r)},$$slots:{default:!0}})};q(f,e=>{B(t).event&&e(p)});var m=R(f,2),h=I(m,!0);k(m);var _=R(m,2),v=e=>{var t=TA(),r=I(t);k(t),z(e=>K(r,`${e??``} message`),[()=>B(l).has(n)?`hide`:`show`]),Fr(`click`,t,()=>g(n)),G(e,t)};q(_,e=>{B(t).agentMessage&&e(v)}),k(i);var y=R(i,2),b=e=>{var n=EA();vi(n,()=>ID(B(t).agentMessage),!0),k(n),G(e,n)},x=N(()=>B(t).agentMessage&&B(l).has(n));q(y,e=>{B(x)&&e(b)}),k(r),z((e,n)=>{K(o,e),K(c,B(t).from),K(d,B(t).to),K(h,n)},[()=>ae(B(t).timestamp),()=>ie(B(t).durationMs)]),G(e,r)}),k(r),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}})};q(oe,e=>{B(n).transitionHistory.length>0&&e(se)}),yc(R(oe,2),{children:(e,t)=>{var n=mA(),r=L(n);xc(r,{children:(e,t)=>{var n=AA(),r=I(n),i=I(r,!0);k(r);var a=R(r,2);Cc(a,{children:(e,t)=>{A(),G(e,U(`Message log`))},$$slots:{default:!0}});var o=R(a,2),s=e=>{var t=kA(),n=I(t);k(t),z(()=>K(n,`${B(d).length??``} entr${B(d).length===1?`y`:`ies`}`)),G(e,t)};q(o,e=>{B(u)&&B(d).length>0&&e(s)}),k(n),z(()=>{Ji(n,`aria-expanded`,B(u)),K(i,B(u)?`▾`:`▸`)}),Fr(`click`,n,b),G(e,n)},$$slots:{default:!0}});var i=R(r,2),a=e=>{Tc(e,{children:(e,t)=>{var n=W(),r=L(n),i=e=>{Db(e,{variant:`destructive`,dismissible:!0,ondismiss:()=>F(m,``),children:(e,t)=>{A();var n=U();z(()=>K(n,B(m))),G(e,n)},$$slots:{default:!0}})},a=e=>{var t=jA();Bb(I(t),{size:`sm`}),k(t),G(e,t)},o=e=>{tk(e,{get entries(){return B(d)},get loading(){return B(f)},get hasMore(){return B(p)},onLoadOlder:x})};q(r,e=>{B(m)?e(i):B(f)&&B(d).length===0?e(a,1):e(o,-1)}),G(e,n)},$$slots:{default:!0}})};q(i,e=>{B(u)&&e(a)}),G(e,n)},$$slots:{default:!0}}),G(e,r)};q(_e,e=>{B(r)?e(ve):B(a)?e(ye,1):B(i)?e(be,2):B(n)&&e(xe,3)}),Ok(R(_e,2),{get open(){return B(s)},onclose:()=>F(s,!1),get title(){return t.summary.name},fetchReadme:async()=>(await bo({workflowId:t.workflowId})).content}),k(D),z(()=>{K(ce,t.summary.name),K(me,t.summary.currentState)}),G(e,D),M()}Ir([`click`]);var FA=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),IA=H(`<path d="M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"></path>`),LA=H(`<path d="M216,40V168H168V88H88V40Z" opacity="0.2"></path><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"></path>`,1),RA=H(`<path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"></path>`),zA=H(`<path d="M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"></path>`),BA=H(`<path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"></path>`),VA=H(`<path d="M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"></path>`),HA=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function UA(e,t){j(t,!0);let n=pl(),r=sa(t,FA),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=HA();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,IA())},m=e=>{var t=LA();A(),G(e,t)},h=e=>{G(e,RA())},g=e=>{G(e,zA())},_=e=>{G(e,BA())},v=e=>{G(e,VA())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var WA=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),GA=H(`<path d="M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"></path>`),KA=H(`<path d="M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z" opacity="0.2"></path><path d="M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"></path>`,1),qA=H(`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"></path>`),JA=H(`<path d="M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"></path>`),YA=H(`<path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"></path>`),XA=H(`<path d="M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"></path>`),ZA=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function QA(e,t){j(t,!0);let n=pl(),r=sa(t,WA),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=ZA();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,GA())},m=e=>{var t=KA();A(),G(e,t)},h=e=>{G(e,qA())},g=e=>{G(e,JA())},_=e=>{G(e,YA())},v=e=>{G(e,XA())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var $A=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),ej=H(`<path d="M156,228a12,12,0,0,1-12,12H112a12,12,0,0,1,0-24h32A12,12,0,0,1,156,228ZM128,116a16,16,0,1,0-16-16A16,16,0,0,0,128,116Zm99.53,40.7-12.36,55.63a19.9,19.9,0,0,1-12.88,14.53A20.16,20.16,0,0,1,195.6,228a19.87,19.87,0,0,1-12.29-4.27L157.17,204H98.83L72.69,223.74A19.87,19.87,0,0,1,60.4,228a20.16,20.16,0,0,1-6.69-1.15,19.9,19.9,0,0,1-12.88-14.53L28.47,156.7a20.1,20.1,0,0,1,4.16-17.14l27.83-33.4A127,127,0,0,1,69.11,69.7c13.27-33.25,37-54.1,46.64-61.52a20,20,0,0,1,24.5,0c9.6,7.42,33.37,28.27,46.64,61.52a127,127,0,0,1,8.65,36.46l27.83,33.4A20.1,20.1,0,0,1,227.53,156.7ZM101.79,180h52.42c19.51-35.7,23-69.78,10.39-101.4C154.4,53,136.2,35.9,128,29.12,119.8,35.9,101.6,53,91.4,78.6,78.78,110.22,82.28,144.3,101.79,180Zm-22.55,8.72a168,168,0,0,1-16.92-47.3l-10,12,10.58,47.64Zm124.43-35.31-10-12a168,168,0,0,1-16.92,47.3l16.33,12.33Z"></path>`),tj=H(`<path d="M94.81,192,65.36,214.24a8,8,0,0,1-12.81-4.51L40.19,154.1a8,8,0,0,1,1.66-6.86l30.31-36.33C71,134.25,76.7,161.43,94.81,192Zm119.34-44.76-30.31-36.33c1.21,23.34-4.54,50.52-22.65,81.09l29.45,22.24a8,8,0,0,0,12.81-4.51l12.36-55.63A8,8,0,0,0,214.15,147.24Z" opacity="0.2"></path><path d="M152,224a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,224ZM128,112a12,12,0,1,0-12-12A12,12,0,0,0,128,112Zm95.62,43.83-12.36,55.63a16,16,0,0,1-25.51,9.11L158.51,200h-61L70.25,220.57a16,16,0,0,1-25.51-9.11L32.38,155.83a16.09,16.09,0,0,1,3.32-13.71l28.56-34.26a123.07,123.07,0,0,1,8.57-36.67c12.9-32.34,36-52.63,45.37-59.85a16,16,0,0,1,19.6,0c9.34,7.22,32.47,27.51,45.37,59.85a123.07,123.07,0,0,1,8.57,36.67l28.56,34.26A16.09,16.09,0,0,1,223.62,155.83ZM99.43,184h57.14c21.12-37.54,25.07-73.48,11.74-106.88C156.55,47.64,134.49,29,128,24c-6.51,5-28.57,23.64-40.33,53.12C74.36,110.52,78.31,146.46,99.43,184Zm-15,5.85Q68.28,160.5,64.83,132.16L48,152.36,60.36,208l.18-.13ZM208,152.36l-16.83-20.2q-3.42,28.28-19.56,57.69l23.85,18,.18.13Z"></path>`,1),nj=H(`<path d="M152,224a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,224Zm71.62-68.17-12.36,55.63a16,16,0,0,1-25.51,9.11L158.51,200h-61L70.25,220.57a16,16,0,0,1-25.51-9.11L32.38,155.83a16.09,16.09,0,0,1,3.32-13.71l28.56-34.26a123.07,123.07,0,0,1,8.57-36.67c12.9-32.34,36-52.63,45.37-59.85a16,16,0,0,1,19.6,0c9.34,7.22,32.47,27.51,45.37,59.85a123.07,123.07,0,0,1,8.57,36.67l28.56,34.26A16.09,16.09,0,0,1,223.62,155.83Zm-139.23,34Q68.28,160.5,64.83,132.16L48,152.36,60.36,208l.18-.13ZM140,100a12,12,0,1,0-12,12A12,12,0,0,0,140,100Zm68,52.36-16.83-20.2q-3.42,28.28-19.56,57.69l23.85,18,.18.13Z"></path>`),rj=H(`<path d="M150,224a6,6,0,0,1-6,6H112a6,6,0,0,1,0-12h32A6,6,0,0,1,150,224ZM128,110a10,10,0,1,0-10-10A10,10,0,0,0,128,110Zm93.67,45.4L209.31,211A14,14,0,0,1,187,219l-27.79-21H96.82L69,219a14,14,0,0,1-22.34-8L34.33,155.4a14.06,14.06,0,0,1,2.91-12l29-34.76a121.28,121.28,0,0,1,8.48-36.71c12.72-31.88,35.52-51.88,44.73-59a14,14,0,0,1,17.16,0c9.21,7.12,32,27.12,44.73,59a121.28,121.28,0,0,1,8.48,36.71l29,34.76A14.06,14.06,0,0,1,221.67,155.4ZM98.26,186h59.48c21.93-38.46,26.12-75.33,12.43-109.62-11.95-30-34.35-48.87-40.93-54a2,2,0,0,0-2.48,0c-6.58,5.09-29,24-40.93,54C72.14,110.67,76.33,147.54,98.26,186ZM87,190.4c-12-21.49-18.9-42.6-20.62-63.19L46.46,151.08a2,2,0,0,0-.42,1.71l12.37,55.64a2,2,0,0,0,3.2,1.13l.13-.11Zm122.57-39.32-19.89-23.87c-1.72,20.59-8.6,41.7-20.62,63.19l25.23,19,.13.11a2,2,0,0,0,3.2-1.13L210,152.79A2,2,0,0,0,209.54,151.08Z"></path>`),ij=H(`<path d="M152,224a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,224ZM128,112a12,12,0,1,0-12-12A12,12,0,0,0,128,112Zm95.62,43.83-12.36,55.63a16,16,0,0,1-25.51,9.11L158.51,200h-61L70.25,220.57a16,16,0,0,1-25.51-9.11L32.38,155.83a16.09,16.09,0,0,1,3.32-13.71l28.56-34.26a123.07,123.07,0,0,1,8.57-36.67c12.9-32.34,36-52.63,45.37-59.85a16,16,0,0,1,19.6,0c9.34,7.22,32.47,27.51,45.37,59.85a123.07,123.07,0,0,1,8.57,36.67l28.56,34.26A16.09,16.09,0,0,1,223.62,155.83ZM99.43,184h57.14c21.12-37.54,25.07-73.48,11.74-106.88C156.55,47.64,134.49,29,128,24c-6.51,5-28.57,23.64-40.33,53.12C74.36,110.52,78.31,146.46,99.43,184Zm-15,5.85Q68.28,160.5,64.83,132.16L48,152.36,60.36,208l.18-.13ZM208,152.36l-16.83-20.2q-3.42,28.28-19.56,57.69l23.85,18,.18.13Z"></path>`),aj=H(`<path d="M148,224a4,4,0,0,1-4,4H112a4,4,0,0,1,0-8h32A4,4,0,0,1,148,224ZM128,108a8,8,0,1,0-8-8A8,8,0,0,0,128,108Zm91.72,47L207.35,210.6a11.9,11.9,0,0,1-7.72,8.71,12.17,12.17,0,0,1-4,.69,11.94,11.94,0,0,1-7.43-2.6L159.85,196H96.15L67.81,217.4a11.94,11.94,0,0,1-7.43,2.6,12.17,12.17,0,0,1-4-.69,11.9,11.9,0,0,1-7.72-8.71L36.28,155a12,12,0,0,1,2.5-10.28l29.35-35.23c3.3-53.33,41.83-86.68,52.52-94.94a12,12,0,0,1,14.7,0c10.69,8.26,49.22,41.61,52.52,94.94l29.35,35.23A12,12,0,0,1,219.72,155ZM97.11,188h61.78C214.07,92.49,145,32.05,130.46,20.84a4,4,0,0,0-4.92,0C111,32.05,41.93,92.49,97.11,188Zm-7.52,2.93C75.12,165.56,68.93,142.52,68,122.06L44.92,149.8a4,4,0,0,0-.83,3.43l12.36,55.63a4,4,0,0,0,6.41,2.26l.09-.07ZM211.08,149.8,188,122.06c-.89,20.46-7.08,43.5-21.55,68.87l26.64,20.12.09.07a4,4,0,0,0,6.41-2.26l12.36-55.63A4,4,0,0,0,211.08,149.8Z"></path>`),oj=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function sj(e,t){j(t,!0);let n=pl(),r=sa(t,$A),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=oj();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,ej())},m=e=>{var t=tj();A(),G(e,t)},h=e=>{G(e,nj())},g=e=>{G(e,rj())},_=e=>{G(e,ij())},v=e=>{G(e,aj())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var cj=V(`<!> Copied`,1),lj=V(`<!> Copy`,1),uj=V(`<button type="button"> </button> <!>`,1),dj=V(`<span class="text-muted-foreground">--</span>`),fj=V(` <!>`,1),pj=V(`<span class="text-muted-foreground text-sm">--</span>`),mj=V(`<div class="sticky top-0 z-10 -mx-6 px-6 py-2 bg-background/95 backdrop-blur" data-testid="action-error-sticky"><!></div>`),hj=V(`<option> </option>`),gj=V(`<optgroup label="Bundled"></optgroup>`),_j=V(`<optgroup label="User"></optgroup>`),vj=V(`<div class="mt-2 flex items-start gap-2 text-xs text-muted-foreground" data-testid="selected-definition-meta"><!> <span class="leading-relaxed"> </span></div>`),yj=V(`<div><label for="custom-path" class="block text-sm text-muted-foreground mb-1">Definition file path</label> <!></div>`),bj=V(`<!> Start Workflow`,1),xj=V(`<div class="space-y-4"><div><label for="def-select" class="block text-sm text-muted-foreground mb-1">Workflow definition</label> <div class="flex items-stretch gap-2"><select id="def-select" class="flex-1 min-w-0 px-3 py-2.5 bg-background border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring transition-all"><option>Select a workflow…</option><!><!><option>Other (custom path)…</option></select> <!></div> <!></div> <!> <div><label for="task-desc" class="block text-sm text-muted-foreground mb-1">Task description</label> <textarea id="task-desc" placeholder="Describe the task in detail…" rows="4" class="w-full px-3 py-2.5 bg-background border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring placeholder:text-muted-foreground/50 transition-all disabled:opacity-50 resize-y min-h-[80px]"></textarea></div> <div><label for="ws-path" class="block text-sm text-muted-foreground mb-1">Workspace path <span class="text-muted-foreground/60">(optional)</span></label> <!></div> <!></div>`),Sj=V(`<!> <!>`,1),Cj=V(`<div class="flex flex-col items-center gap-2 py-10 text-center"><!> <p class="text-sm text-muted-foreground">No active workflows</p> <p class="text-xs text-muted-foreground/70">Start one with the form above.</p></div>`),wj=V(`<!> <!> <!> <!> <!> <!> <!> <!>`,1),Tj=V(`<span class="inline-flex items-center gap-1.5"><!> <!></span>`),Ej=V(`<span> </span>`),Dj=V(`<p class="text-sm text-muted-foreground py-4 text-center"> </p>`),Oj=V(`<div class="flex gap-2 mt-2"><!> <!></div>`),kj=V(`<div class="flex flex-wrap gap-2 mb-4" role="tablist" aria-label="Past runs filter"></div> <!> <div class="mt-4 pt-4 border-t border-border"><button type="button" class="text-sm text-muted-foreground hover:text-foreground flex items-center gap-1 transition-colors"><span>▶</span> Import & Resume from directory</button> <!></div>`,1),Aj=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold tracking-tight">Workflows</h2> <div class="flex gap-2"><!> <!></div></div> <!> <!> <!> <section class="space-y-2" data-testid="active-workflows-section"><h3 class="text-sm font-semibold text-muted-foreground uppercase tracking-wide">Active workflows</h3> <!></section> <section class="space-y-2" data-testid="past-runs-section"><div class="flex items-center justify-between"><h3 class="text-sm font-semibold text-muted-foreground uppercase tracking-wide">Past runs</h3></div> <!></section> <!></div>`);function jj(e,t){j(t,!0);let n=`__custom__`,r=P(on([])),i=P(``),a=P(``),o=P(``),s=P(``),c=P(!1),l=P(``),u=P(!1),d=P(null),f=P(on([])),p=P(null),m=P(!1),h=P(``),_=P(!1),v=P(``),y=P(`all`),b=P(on(new Set));function x(e){let t=new Set(B(b));t.has(e)?t.delete(e):t.add(e),F(b,t,!0)}let S=P(on(new Set)),C=new Map;function w(e,t){let n=new Set(B(S));t?n.add(e):n.delete(e),F(S,n,!0)}async function T(e,t){try{if(!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(t),w(e,!0);let n=C.get(e);n&&clearTimeout(n),C.set(e,setTimeout(()=>{w(e,!1),C.delete(e)},2e3))}catch{}}Mn(()=>()=>{for(let e of C.values())clearTimeout(e);C.clear()});let ee=N(()=>B(i)===n),E=N(()=>B(ee)?B(a).trim():B(i)),te=N(()=>B(r).find(e=>e.path===B(i)));Mn(()=>{To(),ne(),re()});async function ne(){try{F(r,await yo(),!0)}catch{}}async function re(){try{F(f,await Do(),!0)}catch{}}async function ie(){if(!(!B(E)||!B(o).trim())){F(c,!0),F(l,``);try{let e=await So(B(E),B(o).trim(),B(s).trim()||void 0);J.workflows.has(e.workflowId)||(J.workflows=new Map(J.workflows).set(e.workflowId,Uc({workflowId:e.workflowId,currentState:`starting...`}))),F(i,``),F(a,``),F(o,``),F(s,``),await To()}catch(e){F(l,`Failed to start workflow: ${e instanceof Error?e.message:String(e)}`)}finally{F(c,!1)}}}async function ae(e){F(p,e,!0),F(l,``),F(v,``),J.workflows.has(e)||(J.workflows=new Map(J.workflows).set(e,Uc({workflowId:e,currentState:`resuming...`})));try{await ko(e),F(v,`Workflow ${e.slice(0,8)}... resumed`),await Promise.all([To(),re()])}catch(t){let n=new Map(J.workflows);n.delete(e),J.workflows=n,F(l,`Failed to resume workflow: ${t instanceof Error?t.message:String(t)}`)}finally{F(p,null)}}async function D(){if(B(h).trim()){F(_,!0),F(l,``),F(v,``);try{let{workflowId:e}=await Oo(B(h).trim());J.workflows.has(e)||(J.workflows=new Map(J.workflows).set(e,Uc({workflowId:e,currentState:`resuming...`}))),await ko(e),F(v,`Imported and resumed workflow ${e.slice(0,8)}...`),F(h,``),F(m,!1),await Promise.all([To(),re()])}catch(e){F(l,`Failed to import workflow: ${e instanceof Error?e.message:String(e)}`)}finally{F(_,!1)}}}async function oe(e){if(confirm(`Abort this workflow?`)){F(l,``);try{await Co(e),await To()}catch(e){F(l,`Failed to abort workflow: ${e instanceof Error?e.message:String(e)}`)}}}function se(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function O(e){F(d,null),J.selectedWorkflowId=e}function ce(){F(d,new Set(J.pendingGates.keys()),!0),J.selectedWorkflowId=null}let le=N(()=>[...J.workflows.values()]),ue=N(()=>B(le).filter(e=>e.phase===`running`||e.phase===`waiting_human`)),de=N(()=>qc(B(le))),fe=N(()=>Jc(B(f),B(de))),pe=N(()=>el(B(fe),B(y))),me=N(()=>tl(B(fe))),he=N(()=>J.selectedWorkflowId?J.workflows.get(J.selectedWorkflowId)??null:null),ge=N(()=>{if(!J.selectedWorkflowId)return null;if(B(he))return B(he);let e=B(fe).find(e=>e.workflowId===J.selectedWorkflowId);return e?Wc(e):Gc(J.selectedWorkflowId)}),_e=N(()=>{if(J.selectedWorkflowId){for(let e of J.pendingGates.values())if(e.workflowId===J.selectedWorkflowId)return e}});Mn(()=>{if(J.selectedWorkflowId||J.pendingGates.size===0)return;let e=new Set(J.pendingGates.keys());if(!(B(d)&&se(B(d),e))){F(d,null);for(let[,e]of J.pendingGates)if(J.workflows.has(e.workflowId)){J.selectedWorkflowId=e.workflowId;return}}});let ve=N(()=>B(r).filter(e=>e.source===`bundled`)),ye=N(()=>B(r).filter(e=>e.source===`user`));var be=W(),xe=L(be),Se=e=>{PA(e,{get workflowId(){return J.selectedWorkflowId},get summary(){return B(ge)},get gate(){return B(_e)},onback:ce})},Ce=e=>{var t=Aj();{let e=(e,t=g,n=g,r=g)=>{let i=N(()=>B(b).has(t())),a=N(()=>B(S).has(t()));var o=W(),s=L(o),c=e=>{var o=uj(),s=L(o),c=I(s,!0);k(s);var l=R(s,2),u=e=>{{let r=N(()=>`task-copy-${t()}`);Dd(e,{variant:`ghost`,size:`sm`,class:`mt-1 h-6 px-1.5 text-xs text-muted-foreground hover:text-foreground`,"aria-label":`Copy instructions to clipboard`,title:`Copy instructions to clipboard`,get"data-testid"(){return B(r)},onclick:e=>{e.stopPropagation(),e.preventDefault(),T(t(),n())},children:(e,t)=>{var n=W(),r=L(n),i=e=>{var t=cj();QA(L(t),{size:13,weight:`bold`,class:`text-success`}),A(),G(e,t)},o=e=>{var t=lj();UA(L(t),{size:13}),A(),G(e,t)};q(r,e=>{B(a)?e(i):e(o,-1)}),G(e,n)},$$slots:{default:!0}})}};q(l,e=>{B(i)&&e(u)}),z(e=>{Ai(s,1,`text-left text-inherit hover:text-foreground p-0 m-0 bg-transparent border-0 cursor-pointer ${B(i)?`whitespace-normal break-words`:`truncate block max-w-full`}`),Ji(s,`title`,n()),Ji(s,`aria-expanded`,B(i)),Ji(s,`data-testid`,`task-toggle-${t()}`),K(c,e)},[()=>B(i)?n():Yc(n(),r())]),Fr(`click`,s,e=>{e.stopPropagation(),x(t())}),G(e,o)},l=e=>{G(e,dj())};q(s,e=>{n()?e(c):e(l,-1)}),G(e,o)},be=(e,t=g)=>{var n=W(),r=L(n),i=e=>{Oc(e,{variant:`outline`,get title(){return t().verdict},children:(e,n)=>{A();var r=fj(),i=L(r,!0),a=R(i),o=e=>{var n=U();z(e=>K(n,` (${e??``})`),[()=>nl(t().confidence)]),G(e,n)};q(a,e=>{t().confidence!==void 0&&e(o)}),z(e=>K(i,e),[()=>Yc(t().verdict,30)]),G(e,r)},$$slots:{default:!0}})},a=e=>{G(e,pj())};q(r,e=>{t()?e(i):e(a,-1)}),G(e,n)};var r=I(t),d=R(I(r),2),f=I(d),C=e=>{Oc(e,{variant:`warning`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${J.pendingGates.size??``} gate${J.pendingGates.size>1?`s`:``} pending`)),G(e,n)},$$slots:{default:!0}})};q(f,e=>{J.pendingGates.size>0&&e(C)}),Oc(R(f,2),{variant:`outline`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${B(ue).length??``} active`)),G(e,n)},$$slots:{default:!0}}),k(d),k(r);var w=R(r,2),ne=e=>{var t=mj();Db(I(t),{variant:`destructive`,dismissible:!0,ondismiss:()=>F(l,``),children:(e,t)=>{A();var n=U();z(()=>K(n,B(l))),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(w,e=>{B(l)&&e(ne)});var re=R(w,2);yc(re,{children:(e,t)=>{var r=Sj(),l=L(r);xc(l,{children:(e,t)=>{Cc(e,{children:(e,t)=>{A(),G(e,U(`Start Workflow`))},$$slots:{default:!0}})},$$slots:{default:!0}}),Tc(R(l,2),{children:(e,t)=>{var r=xj(),l=I(r),d=R(I(l),2),f=I(d),p=I(f);p.value=p.__value=``;var m=R(p),h=e=>{var t=gj();fi(t,21,()=>B(ve),e=>e.path,(e,t)=>{var n=hj(),r=I(n,!0);k(n);var i={};z(()=>{K(r,B(t).name),i!==(i=B(t).path)&&(n.value=(n.__value=B(t).path)??``)}),G(e,n)}),k(t),G(e,t)};q(m,e=>{B(ve).length>0&&e(h)});var g=R(m),_=e=>{var t=_j();fi(t,21,()=>B(ye),e=>e.path,(e,t)=>{var n=hj(),r=I(n,!0);k(n);var i={};z(()=>{K(r,B(t).name),i!==(i=B(t).path)&&(n.value=(n.__value=B(t).path)??``)}),G(e,n)}),k(t),G(e,t)};q(g,e=>{B(ye).length>0&&e(_)});var v=R(g);v.value=v.__value=n,k(f);var y=R(f,2);{let e=N(()=>B(te)?.hasReadme?`View README`:`No README for this workflow`),t=N(()=>!B(te)?.hasReadme);Dd(y,{variant:`outline`,size:`icon`,type:`button`,class:`shrink-0`,"aria-label":`View workflow README`,get title(){return B(e)},get disabled(){return B(t)},"data-testid":`readme-info-button`,onclick:()=>F(u,!0),children:(e,t)=>{Lk(e,{size:18,weight:`duotone`})},$$slots:{default:!0}})}k(d);var b=R(d,2),x=e=>{var t=vj(),n=I(t);Oc(n,{variant:`outline`,class:`shrink-0 capitalize`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(te).source)),G(e,n)},$$slots:{default:!0}});var r=R(n,2),i=I(r,!0);k(r),k(t),z(()=>K(i,B(te).description)),G(e,t)};q(b,e=>{B(te)&&e(x)}),k(l);var S=R(l,2),C=e=>{var t=yj();Ad(R(I(t),2),{id:`custom-path`,placeholder:`/path/to/workflow.yaml`,get value(){return B(a)},set value(e){F(a,e,!0)}}),k(t),G(e,t)};q(S,e=>{B(ee)&&e(C)});var w=R(S,2),T=R(I(w),2);Sn(T),k(w);var ne=R(w,2);Ad(R(I(ne),2),{id:`ws-path`,placeholder:`/path/to/workspace`,get value(){return B(s)},set value(e){F(s,e,!0)}}),k(ne);var re=R(ne,2);{let e=N(()=>!B(E)||!B(o).trim());Dd(re,{onclick:ie,get loading(){return B(c)},get disabled(){return B(e)},children:(e,t)=>{var n=bj(),r=L(n),i=e=>{sj(e,{size:16,weight:`duotone`,class:`mr-1.5`})};q(r,e=>{B(c)||e(i)}),A(),G(e,n)},$$slots:{default:!0}})}k(r),Fi(f,()=>B(i),e=>F(i,e)),ea(T,()=>B(o),e=>F(o,e)),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}});var se=R(re,2),ce=e=>{Db(e,{variant:`default`,dismissible:!0,ondismiss:()=>F(v,``),children:(e,t)=>{A();var n=U();z(()=>K(n,B(v))),G(e,n)},$$slots:{default:!0}})};q(se,e=>{B(v)&&e(ce)});var le=R(se,2),de=R(I(le),2),fe=e=>{yc(e,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var n=Cj();pu(I(n),{size:28,weight:`duotone`,class:`text-muted-foreground/40`}),A(4),k(n),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})},he=t=>{Ac(t,{children:(t,n)=>{var r=Sj(),i=L(r);Mc(i,{children:(e,t)=>{var n=wj(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`Workflow`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Phase`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`Current State`))},$$slots:{default:!0}});var o=R(a,2);zc(o,{children:(e,t)=>{A(),G(e,U(`Task`))},$$slots:{default:!0}});var s=R(o,2);zc(s,{children:(e,t)=>{A(),G(e,U(`Round`))},$$slots:{default:!0}});var c=R(s,2);zc(c,{children:(e,t)=>{A(),G(e,U(`Verdict`))},$$slots:{default:!0}});var l=R(c,2);zc(l,{children:(e,t)=>{A(),G(e,U(`Started`))},$$slots:{default:!0}}),zc(R(l,2),{class:`text-right`,children:(e,t)=>{A(),G(e,U(`Actions`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(i,2),{children:(t,n)=>{var r=W();fi(L(r),17,()=>B(ue),e=>e.workflowId,(t,n)=>{Lc(t,{clickable:!0,onclick:()=>O(B(n).workflowId),children:(t,r)=>{var i=wj(),a=L(i);Vc(a,{class:`font-medium font-mono text-xs`,children:(e,t)=>{A();var r=U();z(()=>K(r,B(n).name)),G(e,r)},$$slots:{default:!0}});var o=R(a,2);Vc(o,{children:(e,t)=>{var r=Tj(),i=I(r);{let e=N(()=>gc(B(n).phase));Oc(i,{get variant(){return B(e)},children:(e,t)=>{A();var r=U();z(e=>K(r,e),[()=>Xc(B(n).phase)]),G(e,r)},$$slots:{default:!0}})}var a=R(i,2),o=e=>{Oc(e,{variant:`destructive`,class:`cursor-help`,get title(){return B(n).error},children:(e,t)=>{A(),G(e,U(`!`))},$$slots:{default:!0}})};q(a,e=>{B(n).phase===`failed`&&B(n).error&&e(o)}),k(r),G(e,r)},$$slots:{default:!0}});var s=R(o,2);Vc(s,{class:`font-mono text-xs`,children:(e,t)=>{A();var r=U();z(()=>K(r,B(n).currentState)),G(e,r)},$$slots:{default:!0}});var c=R(s,2);Vc(c,{class:`text-sm max-w-[28ch]`,children:(t,r)=>{e(t,()=>B(n).workflowId,()=>B(n).taskDescription,()=>40)},$$slots:{default:!0}});var l=R(c,2);Vc(l,{class:`text-sm tabular-nums`,children:(e,t)=>{A();var r=U();z(()=>K(r,B(n).maxRounds>0?`${B(n).round}/${B(n).maxRounds}`:`--`)),G(e,r)},$$slots:{default:!0}});var u=R(l,2);Vc(u,{children:(e,t)=>{be(e,()=>B(n).latestVerdict)},$$slots:{default:!0}});var d=R(u,2);Vc(d,{class:`text-muted-foreground text-sm whitespace-nowrap`,children:(e,t)=>{var r=Ej(),i=I(r,!0);k(r),z((e,t)=>{Ji(r,`title`,e),K(i,t)},[()=>new Date(B(n).startedAt).toLocaleString(),()=>il(B(n).startedAt)]),G(e,r)},$$slots:{default:!0}}),Vc(R(d,2),{class:`text-right`,children:(e,t)=>{var r=W(),i=L(r),a=e=>{Dd(e,{variant:`destructive`,size:`sm`,onclick:e=>{e.stopPropagation(),oe(B(n).workflowId)},children:(e,t)=>{A(),G(e,U(`Abort`))},$$slots:{default:!0}})},o=e=>{G(e,pj())};q(i,e=>{B(n).phase===`running`||B(n).phase===`waiting_human`?e(a):e(o,-1)}),G(e,r)},$$slots:{default:!0}}),G(t,i)},$$slots:{default:!0}})}),G(t,r)},$$slots:{default:!0}}),G(t,r)},$$slots:{default:!0}})};q(de,e=>{B(ue).length===0?e(fe):e(he,-1)}),k(le);var ge=R(le,2);yc(R(I(ge),2),{children:(t,n)=>{Tc(t,{children:(t,n)=>{var r=kj(),i=L(r);fi(i,21,()=>$c,e=>e.id,(e,t)=>{{let n=N(()=>B(y)===B(t).id?`default`:`outline`),r=N(()=>B(y)===B(t).id),i=N(()=>`past-run-filter-${B(t).id}`);Dd(e,{size:`sm`,get variant(){return B(n)},get"aria-pressed"(){return B(r)},role:`tab`,get"data-testid"(){return B(i)},onclick:()=>F(y,B(t).id,!0),children:(e,n)=>{A();var r=U();z(()=>K(r,`${B(t).label??``} (${B(me)[B(t).id]??``})`)),G(e,r)},$$slots:{default:!0}})}}),k(i);var a=R(i,2),o=e=>{var t=Dj(),n=I(t,!0);k(t),z(e=>K(n,e),[()=>B(y)===`all`?`No past runs found.`:`No ${B(y).replace(`_`,` `)} runs.`]),G(e,t)},s=t=>{Ac(t,{children:(t,n)=>{var r=Sj(),i=L(r);Mc(i,{children:(e,t)=>{var n=wj(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`Phase`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Task`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`Last State`))},$$slots:{default:!0}});var o=R(a,2);zc(o,{children:(e,t)=>{A(),G(e,U(`Round`))},$$slots:{default:!0}});var s=R(o,2);zc(s,{children:(e,t)=>{A(),G(e,U(`Verdict`))},$$slots:{default:!0}});var c=R(s,2);zc(c,{children:(e,t)=>{A(),G(e,U(`Duration`))},$$slots:{default:!0}});var l=R(c,2);zc(l,{children:(e,t)=>{A(),G(e,U(`Timestamp`))},$$slots:{default:!0}}),zc(R(l,2),{class:`text-right`,children:(e,t)=>{A(),G(e,U(`Actions`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(i,2),{children:(t,n)=>{var r=W();fi(L(r),17,()=>B(pe),e=>e.workflowId,(t,n)=>{Lc(t,{children:(t,r)=>{var i=wj(),a=L(i);Vc(a,{children:(e,t)=>{var r=Tj(),i=I(r);{let e=N(()=>gc(B(n).phase));Oc(i,{get variant(){return B(e)},children:(e,t)=>{A();var r=U();z(e=>K(r,e),[()=>Xc(B(n).phase)]),G(e,r)},$$slots:{default:!0}})}var a=R(i,2),o=e=>{Oc(e,{variant:`destructive`,class:`cursor-help`,get title(){return B(n).error},children:(e,t)=>{A(),G(e,U(`!`))},$$slots:{default:!0}})};q(a,e=>{B(n).phase===`failed`&&B(n).error&&e(o)}),k(r),G(e,r)},$$slots:{default:!0}});var o=R(a,2);Vc(o,{class:`text-sm max-w-[36ch]`,children:(t,r)=>{e(t,()=>B(n).workflowId,()=>B(n).taskDescription,()=>80)},$$slots:{default:!0}});var s=R(o,2);Vc(s,{class:`font-mono text-xs`,children:(e,t)=>{A();var r=U();z(()=>K(r,B(n).lastState||`--`)),G(e,r)},$$slots:{default:!0}});var c=R(s,2);Vc(c,{class:`text-sm tabular-nums`,children:(e,t)=>{A();var r=U();z(()=>K(r,B(n).maxRounds>0?`${B(n).round}/${B(n).maxRounds}`:`--`)),G(e,r)},$$slots:{default:!0}});var l=R(c,2);Vc(l,{children:(e,t)=>{be(e,()=>B(n).latestVerdict)},$$slots:{default:!0}});var u=R(l,2);Vc(u,{class:`text-muted-foreground text-sm`,children:(e,t)=>{A();var r=U();z(e=>K(r,e),[()=>rl(B(n).durationMs)||`--`]),G(e,r)},$$slots:{default:!0}});var d=R(u,2);Vc(d,{class:`text-muted-foreground text-sm whitespace-nowrap`,children:(e,t)=>{var r=Ej(),i=I(r,!0);k(r),z((e,t)=>{Ji(r,`title`,e),K(i,t)},[()=>new Date(B(n).timestamp).toLocaleString(),()=>il(B(n).timestamp)]),G(e,r)},$$slots:{default:!0}}),Vc(R(d,2),{class:`text-right space-x-1.5 whitespace-nowrap`,children:(e,t)=>{var r=Sj(),i=L(r);{let e=N(()=>`investigate-${B(n).workflowId}`);Dd(i,{size:`sm`,variant:`outline`,get"data-testid"(){return B(e)},onclick:()=>O(B(n).workflowId),children:(e,t)=>{A(),G(e,U(`Investigate`))},$$slots:{default:!0}})}var a=R(i,2),o=e=>{{let t=N(()=>B(p)===B(n).workflowId),r=N(()=>B(p)!==null),i=N(()=>`resume-${B(n).workflowId}`);Dd(e,{size:`sm`,get loading(){return B(t)},get disabled(){return B(r)},get"data-testid"(){return B(i)},onclick:()=>ae(B(n).workflowId),children:(e,t)=>{A(),G(e,U(`Resume`))},$$slots:{default:!0}})}},s=N(()=>Qc(B(n).phase)),c=e=>{{let t=N(()=>`resume-${B(n).workflowId}`);Dd(e,{size:`sm`,disabled:!0,"aria-disabled":`true`,get"data-testid"(){return B(t)},title:`Workflow has already completed — use Investigate to inspect`,children:(e,t)=>{A(),G(e,U(`Resume`))},$$slots:{default:!0}})}};q(a,e=>{B(s)?e(o):e(c,-1)}),G(e,r)},$$slots:{default:!0}}),G(t,i)},$$slots:{default:!0}})}),G(t,r)},$$slots:{default:!0}}),G(t,r)},$$slots:{default:!0}})};q(a,e=>{B(pe).length===0?e(o):e(s,-1)});var c=R(a,2),l=I(c),u=I(l);let d;A(),k(l);var f=R(l,2),g=e=>{var t=Oj(),n=I(t);Ad(n,{placeholder:`/path/to/workflow-runs/`,class:`flex-1`,get value(){return B(h)},set value(e){F(h,e,!0)}});var r=R(n,2);{let e=N(()=>!B(h).trim());Dd(r,{size:`sm`,get loading(){return B(_)},get disabled(){return B(e)},onclick:D,children:(e,t)=>{A(),G(e,U(`Import & Resume`))},$$slots:{default:!0}})}k(t),G(e,t)};q(f,e=>{B(m)&&e(g)}),k(c),z(()=>d=Ai(u,1,`inline-block transition-transform`,null,d,{"rotate-90":B(m)})),Fr(`click`,l,()=>F(m,!B(m))),G(t,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),k(ge);var _e=R(ge,2);{let e=N(()=>B(te)?.name??`Workflow`);Ok(_e,{get open(){return B(u)},onclose:()=>F(u,!1),get title(){return B(e)},fetchReadme:async()=>(await bo({definitionPath:B(i)})).content})}k(t)}G(e,t)};q(xe,e=>{J.selectedWorkflowId&&B(ge)?e(Se):e(Ce,-1)}),G(e,be),M()}Ir([`click`]);function Mj(e,t){return e===void 0||e===t}var Nj=V(`<!> <!> <!>`,1),Pj=V(`<div class="flex items-center justify-center py-16"><!></div>`),Fj=V(`<p class="text-xs text-muted-foreground">Description</p> <p class="text-sm mt-1"> </p>`,1),Ij=V(`<p class="text-xs text-muted-foreground">Created</p> <p class="text-sm mt-1"> </p>`,1),Lj=V(`<div class="flex flex-wrap gap-1 mt-1"></div>`),Rj=V(`<p class="text-sm mt-1 text-muted-foreground">All servers</p>`),zj=V(`<p class="text-xs text-muted-foreground">Servers</p> <!>`,1),Bj=V(`<span class="block"><span class="font-mono text-xs" data-testid="mutation-error-code"> </span> <span class="block mt-1"> </span></span>`),Vj=V(`<div data-testid="mutation-error"><!></div>`),Hj=V(`<div class="flex flex-col gap-3"><label class="flex items-center gap-3 text-sm"><input type="checkbox" data-testid="memory-toggle"/> <span> </span> <!></label> <label class="flex items-center gap-3 text-sm"><input type="checkbox" data-testid="broad-policy-toggle"/> <span>Allow broad policy <span class="text-xs text-muted-foreground">(wildcard domains/lists, out-of-workspace paths)</span></span> <!></label></div>`),Uj=V(`<span class="text-sm text-muted-foreground" data-testid="compile-progress"> </span>`),Wj=V(`<span class="text-sm text-muted-foreground" data-testid="compile-progress">Starting...</span>`),Gj=V(`<span class="text-sm text-success" data-testid="compile-success"> </span>`),Kj=V(`<p class="text-xs text-warning mt-2" data-testid="rule-delta-domains"> </p>`),qj=V(`<p class="text-xs text-warning mt-1" data-testid="rule-delta-paths"> </p>`),Jj=V(`<div class="mt-3 text-sm" data-testid="rule-delta"><p class="text-xs text-muted-foreground mb-1">Policy changes vs previous compile</p> <div class="flex flex-wrap gap-2"><!> <!> <!></div> <!> <!></div>`),Yj=V(`<div data-testid="compile-interrupted" class="mt-3"><!></div>`),Xj=V(`<span class="block"><span class="font-mono text-xs" data-testid="compile-error-code"> </span> <span class="block mt-1"> </span></span>`),Zj=V(`<div data-testid="compile-error" class="mt-3"><!></div>`),Qj=V(`<div class="flex items-center gap-3 flex-wrap"><!> <!> <!></div> <!> <!> <!>`,1),$j=V(`<span class="text-xs text-warning" data-testid="constitution-dirty">Unsaved changes</span>`),eM=V(`<span class="block"><span class="font-mono text-xs" data-testid="edit-error-code"> </span> <span class="block mt-1"> </span></span>`),tM=V(`<div data-testid="edit-error" class="mt-3"><!></div>`),nM=V(`<textarea rows="12" data-testid="constitution-editor" class="w-full px-3 py-2.5 bg-background border border-border rounded-lg text-sm font-mono
|
|
106
|
+
focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring transition-all" placeholder="# Persona constitution Describe the policy principles in markdown..."></textarea> <div class="flex items-center gap-3 mt-3"><!> <!></div> <!>`,1),rM=V(`<div class="prose-markdown text-sm"></div>`),iM=V(`<p class="text-sm text-muted-foreground">No constitution defined yet.</p>`),aM=V(`<!> <!>`,1),oM=V(`<div class="grid grid-cols-1 sm:grid-cols-3 gap-3"><!> <!> <!></div> <!> <!> <!> <!>`,1),sM=V(`<span class="block"><span class="font-mono text-xs" data-testid="delete-error-code"> </span> <span class="block mt-1"> </span></span>`),cM=V(`<div data-testid="delete-error"><!></div>`),lM=V(`<div class="space-y-4"><p class="text-sm">Delete persona <span class="font-mono"> </span>? <!></p> <label class="flex items-center gap-3 text-sm"><input type="checkbox" data-testid="delete-force"/> <span>Permanently delete (revoke policy)</span></label> <!> <div class="flex items-center justify-end gap-3"><!> <!></div></div>`),uM=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center gap-3 flex-wrap"><!> <h2 class="text-xl font-semibold tracking-tight"> </h2> <!> <span class="flex-1"></span> <!></div> <!></div> <!>`,1),dM=V(`Create one with <code class="text-xs">ironcurtain persona create</code>.`,1),fM=V(`<p class="text-center text-muted-foreground py-8">No personas found. <!></p>`),pM=V(`<p class="text-xs text-destructive mt-1" data-testid="new-persona-name-error"> </p>`),mM=V(`<label class="flex items-center gap-1.5 text-xs"><input type="checkbox"/> <span> </span></label>`),hM=V(`<div class="flex flex-wrap gap-2 mt-2 pl-6"></div>`),gM=V(`<span class="block"><span class="font-mono text-xs" data-testid="new-persona-error-code"> </span> <span class="block mt-1"> </span></span>`),_M=V(`<div data-testid="new-persona-error"><!></div>`),vM=V(`<div class="space-y-4"><div><label class="text-xs text-muted-foreground" for="np-name">Name (lowercase slug)</label> <!> <!></div> <div><label class="text-xs text-muted-foreground" for="np-desc">Description</label> <!></div> <div><p class="text-xs text-muted-foreground mb-1">Servers</p> <label class="flex items-center gap-2 text-sm"><input type="radio" name="np-servers" data-testid="new-persona-all-servers"/> <span>All servers (incl. future)</span></label> <label class="flex items-center gap-2 text-sm mt-1"><input type="radio" name="np-servers" data-testid="new-persona-narrow-servers"/> <span>Narrow to specific servers</span></label> <!></div> <label class="flex items-center gap-3 text-sm"><input type="checkbox" data-testid="new-persona-memory"/> <span>Enable persistent memory</span></label> <div><label class="text-xs text-muted-foreground" for="np-const">Constitution (optional)</label> <textarea id="np-const" rows="6" data-testid="new-persona-constitution" class="w-full px-3 py-2.5 bg-background border border-border rounded-lg text-sm font-mono
|
|
107
|
+
focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-ring transition-all" placeholder="# Principles Leave blank to start with an empty persona."></textarea></div> <!> <div class="flex items-center justify-end gap-3"><!> <!></div></div>`),yM=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center justify-between"><h2 class="text-xl font-semibold tracking-tight">Personas</h2> <div class="flex items-center gap-3"><!> <!></div></div> <!> <!></div> <!>`,1);function bM(e,t){j(t,!0);let n=[`filesystem`,`git`,`github`,`web-search`,`google-workspace`],r=P(on([])),i=P(!0),a=P(``),o=P(null),s=P(null),c=P(!1),l=P(``),u=N(()=>J.daemonStatus?.allowPolicyMutation===!0),d=P(null),f=P(!1),p=P(null),m=P(!1),h=P(null),g=P(on(new Map)),_=N(v);function v(){if(B(d))return J.personaCompiles.get(B(d))??null;if(!B(o))return null;let e=null;for(let t of J.personaCompiles.values())t.name===B(o)&&(t.phase===`started`||t.phase===`running`)&&(!e||t.startedAt>e.startedAt)&&(e=t);return e}let y=N(()=>B(m)||B(_)?.phase===`started`||B(_)?.phase===`running`),b=N(()=>B(_)?.phase===`done`?B(_).result?.ruleDelta??null:null),x={cached:`Cached`,compiling:`Compiling rules`,lists:`Resolving lists`,scenarios:`Generating scenarios`,"repair-scenarios":`Repairing scenarios`,verifying:`Verifying`,"repair-compile":`Repairing compilation`,"repair-verify":`Repairing verification`,done:`Done`};function S(e){let t=e.serverProgress;if(!t)return e.phase===`started`?`Starting...`:`Working...`;let n=x[t.compilationPhase]??t.compilationPhase;return`${t.server}: ${n}${t.detail?` -- ${t.detail}`:``}`}let C=P(``),w=P(!1),T=P(!1),ee=P(!1),E=P(null),te=P(!1),ne=P(!1),re=P(null),ie=P(!1),ae=P(!1),D=P(!1),oe=P(null),se=P(!1),O=P(``),ce=P(``),le=P(!0),ue=P(``),de=P(!1),fe=P(on(new Set)),pe=P(!1),me=P(null);function he(e){let t=e;return{code:typeof t.code==`string`?t.code:`ERROR`,message:t.message??(e instanceof Error?e.message:String(e))}}Mn(()=>{ve()}),Mn(()=>{ja.value,_e()}),Mn(()=>{Ma.value,ge()}),Mn(()=>{let e=B(_);!e||!B(o)||(e.phase===`done`&&B(h)!==e.operationId?(F(h,e.operationId,!0),Mj(B(g).get(e.operationId),B(s)?.constitution??``)&&F(ee,!1),Ce(B(o))):e.phase===`failed`&&B(h)!==e.operationId&&F(h,e.operationId,!0))});async function ge(){if(Ma.value!==0)try{F(r,await po(),!0),B(o)&&F(s,await Po(B(o)),!0)}catch{}}async function _e(){try{let e=await Lo();B(d)&&!e.has(B(d))&&F(f,!0)}catch{}}async function ve(){F(i,!0),F(a,``);try{F(r,await po(),!0)}catch(e){F(a,e instanceof Error?e.message:String(e),!0)}F(i,!1)}async function ye(e){F(o,e,!0),F(c,!0),F(l,``),F(s,null),be(),xe();try{F(s,await Po(e),!0),F(C,B(s).constitution??``,!0),F(w,!1),F(ee,!1)}catch(e){F(l,e instanceof Error?e.message:String(e),!0)}F(c,!1)}function be(){F(d,null),F(f,!1),F(p,null),F(m,!1),F(h,null),F(g,new Map,!0)}function xe(){F(E,null),F(re,null),F(oe,null),F(ie,!1),F(ae,!1)}function Se(){F(o,null),F(s,null),be(),xe()}async function Ce(e){try{F(s,await Po(e),!0),F(r,await po(),!0)}catch{}}async function we(){if(B(o)){F(m,!0),F(p,null),F(f,!1),F(h,null);try{let e=await Fo(B(o));F(d,e.operationId,!0);let t=new Map(B(g));t.set(e.operationId,B(s)?.constitution??``),F(g,t,!0)}catch(e){F(p,he(e),!0)}F(m,!1)}}function Te(){F(w,(B(s)?.constitution??``)!==B(C))}async function Ee(){if(B(o)){F(T,!0),F(E,null);try{let e=await ho(B(o),B(C));B(s)&&F(s,{...B(s),constitution:B(C)},!0),F(w,!1),F(ee,e.stale,!0)}catch(e){F(E,he(e),!0)}F(T,!1)}}async function De(){if(!B(o)||!B(s))return;F(te,!0),F(re,null);let e=!(B(s).memory??!0);try{F(s,await go(B(o),e),!0)}catch(e){F(re,he(e),!0)}F(te,!1)}async function Oe(){if(!B(o)||!B(s))return;F(ne,!0),F(re,null);let e=!(B(s).allowBroadPolicy??!1);try{F(s,await _o(B(o),e),!0)}catch(e){F(re,he(e),!0)}F(ne,!1)}function ke(){F(ie,!0),F(ae,!1),F(oe,null)}async function Ae(){if(B(o)){F(D,!0),F(oe,null);try{await vo(B(o),B(ae)?{force:!0}:void 0),F(ie,!1),Se(),F(r,await po(),!0)}catch(e){F(oe,he(e),!0)}F(D,!1)}}function je(){F(se,!0),F(O,``),F(ce,``),F(le,!0),F(ue,``),F(de,!1),F(fe,new Set,!0),F(me,null)}function Me(e){let t=new Set(B(fe));t.has(e)?t.delete(e):t.add(e),F(fe,t,!0)}async function Ne(){F(pe,!0),F(me,null);try{let e=B(de)?[...B(fe)]:void 0;await mo({name:B(O).trim(),description:B(ce).trim(),servers:e,memoryEnabled:B(le),...B(ue).trim()?{constitution:B(ue)}:{}}),F(se,!1),F(r,await po(),!0),ye(B(O).trim())}catch(e){F(me,he(e),!0)}F(pe,!1)}function Pe(e){switch(e){case`POLICY_MUTATION_FORBIDDEN`:return`Policy compilation is disabled on this daemon. Start the daemon with --allow-policy-mutation to manage personas from the web UI.`;case`COMPILE_IN_PROGRESS`:return`A compile is already running for this persona. Wait for it to finish, then try again.`;case`COMPILE_QUEUE_FULL`:return`The compile queue is full. Please try again shortly.`;case`CREDENTIALS_MISSING`:return`Required model credentials are missing. Configure the provider API key on the daemon host, then retry.`;case`LIST_REQUIRES_MCP`:return`This policy needs live MCP servers to resolve dynamic lists, which are unavailable in this context.`;case`BROAD_POLICY_REJECTED`:return`The compiled policy is broad (wildcard domains/lists or out-of-workspace paths). Enable "Allow broad policy" for this persona, then recompile.`;case`PERSONA_EXISTS`:return`A persona with that name already exists. Choose a different name.`;case`PERSONA_NOT_FOUND`:return`This persona no longer exists.`;case`INVALID_PARAMS`:return`Some fields are invalid. Check the name (lowercase slug) and description.`;default:return`The operation could not be completed.`}}var Fe=W(),Ie=L(Fe),Le=e=>{var t=uM(),n=L(t),r=I(n),i=I(r);Dd(i,{variant:`ghost`,size:`sm`,onclick:Se,children:(e,t)=>{A(),G(e,U(`← Back`))},$$slots:{default:!0}});var a=R(i,2),d=I(a,!0);k(a);var m=R(a,2),h=e=>{var t=Nj(),n=L(t);{let e=N(()=>B(s).hasPolicy?`success`:`secondary`);Oc(n,{get variant(){return B(e)},children:(e,t)=>{A();var n=U();z(()=>K(n,B(s).hasPolicy?`Policy compiled`:`No policy`)),G(e,n)},$$slots:{default:!0}})}var r=R(n,2),i=e=>{Oc(e,{variant:`outline`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${B(s).policyRuleCount??``} rules`)),G(e,n)},$$slots:{default:!0}})};q(r,e=>{B(s).policyRuleCount!=null&&e(i)});var a=R(r,2),o=e=>{Oc(e,{variant:`warning`,"data-testid":`stale-badge`,children:(e,t)=>{A(),G(e,U(`Policy stale — recompile`))},$$slots:{default:!0}})};q(a,e=>{(B(ee)||B(w))&&B(s).hasPolicy&&e(o)}),G(e,t)};q(m,e=>{B(s)&&e(h)});var g=R(m,4),v=e=>{Dd(e,{variant:`destructive`,size:`sm`,onclick:ke,"data-testid":`delete-button`,children:(e,t)=>{A(),G(e,U(`Delete`))},$$slots:{default:!0}})};q(g,e=>{B(u)&&B(s)&&e(v)}),k(r);var x=R(r,2),se=e=>{var t=Pj();Bb(I(t),{size:`md`}),k(t),G(e,t)},O=e=>{Db(e,{variant:`destructive`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(l))),G(e,n)},$$slots:{default:!0}})},ce=e=>{var t=oM(),n=L(t),r=I(n);yc(r,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var n=Fj(),r=R(L(n),2),i=I(r,!0);k(r),z(()=>K(i,B(s).description)),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=R(r,2);yc(i,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var n=Ij(),r=R(L(n),2),i=I(r,!0);k(r),z(e=>K(i,e),[()=>new Date(B(s).createdAt).toLocaleDateString()]),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),yc(R(i,2),{children:(e,t)=>{Tc(e,{children:(e,t)=>{var n=zj(),r=R(L(n),2),i=e=>{var t=Lj();fi(t,20,()=>B(s).servers,e=>e,(e,t)=>{Oc(e,{variant:`outline`,class:`text-xs`,children:(e,n)=>{A();var r=U();z(()=>K(r,t)),G(e,r)},$$slots:{default:!0}})}),k(t),G(e,t)},a=e=>{G(e,Rj())};q(r,e=>{B(s).servers&&B(s).servers.length>0?e(i):e(a,-1)}),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),k(n);var a=R(n,2),o=e=>{var t=Vj();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=Bj(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(re).code),K(o,e)},[()=>Pe(B(re).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(a,e=>{B(re)&&e(o)});var c=R(a,2),l=e=>{yc(e,{children:(e,t)=>{Tc(e,{class:`pt-4`,children:(e,t)=>{var n=Hj(),r=I(n),i=I(r);Gi(i);var a=R(i,2),o=I(a);k(a);var c=R(a,2),l=e=>{Bb(e,{size:`xs`})};q(c,e=>{B(te)&&e(l)}),k(r);var u=R(r,2),d=I(u);Gi(d);var f=R(d,4),p=e=>{Bb(e,{size:`xs`})};q(f,e=>{B(ne)&&e(p)}),k(u),k(n),z(()=>{Ki(i,B(s).memory??!0),i.disabled=B(te),K(o,`Persistent memory ${B(s).memory??!0?`enabled`:`disabled`}`),Ki(d,B(s).allowBroadPolicy??!1),d.disabled=B(ne)}),Fr(`change`,i,De),Fr(`change`,d,Oe),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};q(c,e=>{B(u)&&e(l)});var d=R(c,2),m=e=>{yc(e,{"data-testid":`compile-card`,children:(e,t)=>{Tc(e,{class:`pt-4`,children:(e,t)=>{var n=Qj(),r=L(n),i=I(r);Dd(i,{variant:`default`,onclick:we,get loading(){return B(y)},get disabled(){return B(y)},"data-testid":`compile-button`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(s).hasPolicy?`Recompile Policy`:`Compile Policy`)),G(e,n)},$$slots:{default:!0}});var a=R(i,2),o=e=>{var t=Uj(),n=I(t,!0);k(t),z(e=>K(n,e),[()=>S(B(_))]),G(e,t)},c=e=>{G(e,Wj())};q(a,e=>{B(y)&&B(_)?e(o):B(y)&&e(c,1)});var l=R(a,2),u=e=>{var t=Gj(),n=I(t);k(t),z(()=>K(n,`Compiled successfully (${B(_).result.ruleCount??``} rules)`)),G(e,t)};q(l,e=>{B(_)?.phase===`done`&&B(_).result&&e(u)}),k(r);var d=R(r,2),m=e=>{var t=Jj(),n=R(I(t),2),r=I(n);Oc(r,{variant:`outline`,children:(e,t)=>{A();var n=U();z(()=>K(n,`+${B(b).added??``} added`)),G(e,n)},$$slots:{default:!0}});var i=R(r,2);{let e=N(()=>B(b).loosened>0?`warning`:`outline`);Oc(i,{get variant(){return B(e)},children:(e,t)=>{A();var n=U();z(()=>K(n,`${B(b).loosened??``} loosened`)),G(e,n)},$$slots:{default:!0}})}Oc(R(i,2),{variant:`outline`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${B(b).removed??``} removed`)),G(e,n)},$$slots:{default:!0}}),k(n);var a=R(n,2),o=e=>{var t=Kj(),n=I(t);k(t),z(e=>K(n,`Broadened domains: ${e??``}`),[()=>B(b).broadenedDomains.join(`, `)]),G(e,t)};q(a,e=>{B(b).broadenedDomains.length>0&&e(o)});var s=R(a,2),c=e=>{var t=qj(),n=I(t);k(t),z(e=>K(n,`Out-of-workspace paths: ${e??``}`),[()=>B(b).outOfWorkspacePaths.join(`, `)]),G(e,t)};q(s,e=>{B(b).outOfWorkspacePaths.length>0&&e(c)}),k(t),G(e,t)};q(d,e=>{B(b)&&e(m)});var h=R(d,2),g=e=>{var t=Yj();Db(I(t),{variant:`destructive`,children:(e,t)=>{A(),G(e,U(`Compilation was interrupted (the daemon may have restarted). You can recompile.`))},$$slots:{default:!0}}),k(t),G(e,t)};q(h,e=>{B(f)&&e(g)});var v=R(h,2),x=e=>{var t=Zj();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=Xj(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(p).code),K(o,e)},[()=>Pe(B(p).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)},C=e=>{var t=Zj();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=Xj(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(_).error.code),K(o,e)},[()=>Pe(B(_).error.code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(v,e=>{B(p)?e(x):B(_)?.phase===`failed`&&B(_).error&&e(C,1)}),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};q(d,e=>{B(u)&&e(m)}),yc(R(d,2),{children:(e,t)=>{var n=aM(),r=L(n);xc(r,{children:(e,t)=>{Cc(e,{children:(e,t)=>{A(),G(e,U(`Constitution`))},$$slots:{default:!0}})},$$slots:{default:!0}}),Tc(R(r,2),{children:(e,t)=>{var n=W(),r=L(n),i=e=>{var t=nM(),n=L(t);Sn(n);var r=R(n,2),i=I(r);{let e=N(()=>!B(w)||B(T));Dd(i,{variant:`default`,size:`sm`,onclick:Ee,get loading(){return B(T)},get disabled(){return B(e)},"data-testid":`save-constitution-button`,children:(e,t)=>{A(),G(e,U(`Save constitution`))},$$slots:{default:!0}})}var a=R(i,2),o=e=>{G(e,$j())};q(a,e=>{B(w)&&e(o)}),k(r);var s=R(r,2),c=e=>{var t=tM();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=eM(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(E).code),K(o,e)},[()=>Pe(B(E).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(s,e=>{B(E)&&e(c)}),Fr(`input`,n,Te),ea(n,()=>B(C),e=>F(C,e)),G(e,t)},a=e=>{var t=rM();vi(t,()=>ID(B(s).constitution),!0),k(t),G(e,t)},o=e=>{G(e,iM())};q(r,e=>{B(u)?e(i):B(s).constitution?e(a,1):e(o,-1)}),G(e,n)},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),G(e,t)};q(x,e=>{B(c)?e(se):B(l)?e(O,1):B(s)&&e(ce,2)}),k(n),ik(R(n,2),{get open(){return B(ie)},onclose:()=>F(ie,!1),title:`Delete persona`,children:(e,t)=>{var n=lM(),r=I(n),i=R(I(r)),a=I(i,!0);k(i);var s=R(i,2),c=e=>{G(e,U(`This permanently removes the persona and revokes its compiled policy.`))},l=e=>{G(e,U(`The persona is moved to trash; its policy is left inert and can be restored on disk.`))};q(s,e=>{B(ae)?e(c):e(l,-1)}),k(r);var u=R(r,2),d=I(u);Gi(d),A(2),k(u);var f=R(u,2),p=e=>{var t=cM();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=sM(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(oe).code),K(o,e)},[()=>Pe(B(oe).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(f,e=>{B(oe)&&e(p)});var m=R(f,2),h=I(m);Dd(h,{variant:`outline`,size:`sm`,onclick:()=>F(ie,!1),get disabled(){return B(D)},children:(e,t)=>{A(),G(e,U(`Cancel`))},$$slots:{default:!0}}),Dd(R(h,2),{variant:`destructive`,size:`sm`,onclick:Ae,get loading(){return B(D)},get disabled(){return B(D)},"data-testid":`confirm-delete-button`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(ae)?`Permanently delete`:`Delete`)),G(e,n)},$$slots:{default:!0}}),k(m),k(n),z(()=>K(a,B(o))),ta(d,()=>B(ae),e=>F(ae,e)),G(e,n)},$$slots:{default:!0}}),z(()=>K(d,B(o))),G(e,t)},Re=e=>{var t=yM(),o=L(t),s=I(o),c=R(I(s),2),l=I(c);Oc(l,{variant:`outline`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${B(r).length??``} total`)),G(e,n)},$$slots:{default:!0}});var d=R(l,2),f=e=>{Dd(e,{variant:`default`,size:`sm`,onclick:je,"data-testid":`new-persona-button`,children:(e,t)=>{A(),G(e,U(`New persona`))},$$slots:{default:!0}})};q(d,e=>{B(u)&&e(f)}),k(c),k(s);var p=R(s,2),m=e=>{Db(e,{variant:`destructive`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(a))),G(e,n)},$$slots:{default:!0}})};q(p,e=>{B(a)&&e(m)});var h=R(p,2),g=e=>{var t=Pj();Bb(I(t),{size:`md`}),k(t),G(e,t)},_=e=>{yc(e,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var n=fM(),r=R(I(n)),i=e=>{G(e,U(`Create one with the “New persona” button.`))},a=e=>{var t=dM();A(2),G(e,t)};q(r,e=>{B(u)?e(i):e(a,-1)}),k(n),G(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})},v=e=>{Ac(e,{children:(e,t)=>{var n=aM(),i=L(n);Mc(i,{children:(e,t)=>{var n=Nj(),r=L(n);zc(r,{children:(e,t)=>{A(),G(e,U(`Name`))},$$slots:{default:!0}});var i=R(r,2);zc(i,{children:(e,t)=>{A(),G(e,U(`Description`))},$$slots:{default:!0}}),zc(R(i,2),{children:(e,t)=>{A(),G(e,U(`Policy`))},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}}),Pc(R(i,2),{children:(e,t)=>{var n=W();fi(L(n),17,()=>B(r),e=>e.name,(e,t)=>{Lc(e,{clickable:!0,onclick:()=>ye(B(t).name),children:(e,n)=>{var r=Nj(),i=L(r);Vc(i,{class:`font-medium font-mono text-xs`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).name)),G(e,r)},$$slots:{default:!0}});var a=R(i,2);Vc(a,{class:`text-sm text-muted-foreground max-w-xs truncate`,children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).description)),G(e,r)},$$slots:{default:!0}}),Vc(R(a,2),{children:(e,n)=>{{let n=N(()=>B(t).compiled?`success`:`secondary`);Oc(e,{get variant(){return B(n)},children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).compiled?`Compiled`:`Not compiled`)),G(e,r)},$$slots:{default:!0}})}},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}}),G(e,n)},$$slots:{default:!0}})};q(h,e=>{B(i)?e(g):B(r).length===0?e(_,1):e(v,-1)}),k(o),ik(R(o,2),{get open(){return B(se)},onclose:()=>F(se,!1),title:`New persona`,children:(e,t)=>{var r=vM(),i=I(r),a=R(I(i),2);Ad(a,{id:`np-name`,placeholder:`e.g. researcher`,"data-testid":`new-persona-name`,get value(){return B(O)},set value(e){F(O,e,!0)}});var o=R(a,2),s=e=>{var t=pM(),n=I(t,!0);k(t),z(e=>K(n,e),[()=>Pe(B(me).code)]),G(e,t)};q(o,e=>{(B(me)?.code===`INVALID_PARAMS`||B(me)?.code===`PERSONA_EXISTS`)&&e(s)}),k(i);var c=R(i,2);Ad(R(I(c),2),{id:`np-desc`,placeholder:`What this persona is for`,"data-testid":`new-persona-description`,get value(){return B(ce)},set value(e){F(ce,e,!0)}}),k(c);var l=R(c,2),u=R(I(l),2),d=I(u);Gi(d),A(2),k(u);var f=R(u,2),p=I(f);Gi(p),A(2),k(f);var m=R(f,2),h=e=>{var t=hM();fi(t,20,()=>n,e=>e,(e,t)=>{var n=mM(),r=I(n);Gi(r);var i=R(r,2),a=I(i,!0);k(i),k(n),z(e=>{Ki(r,e),Ji(r,`data-testid`,`new-persona-server-${t}`),K(a,t)},[()=>B(fe).has(t)]),Fr(`change`,r,()=>Me(t)),G(e,n)}),k(t),G(e,t)};q(m,e=>{B(de)&&e(h)}),k(l);var g=R(l,2),_=I(g);Gi(_),A(2),k(g);var v=R(g,2),y=R(I(v),2);Sn(y),k(v);var b=R(v,2),x=e=>{var t=_M();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=gM(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(me).code),K(o,e)},[()=>Pe(B(me).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(b,e=>{B(me)&&B(me).code!==`INVALID_PARAMS`&&B(me).code!==`PERSONA_EXISTS`&&e(x)});var S=R(b,2),C=I(S);Dd(C,{variant:`outline`,size:`sm`,onclick:()=>F(se,!1),get disabled(){return B(pe)},children:(e,t)=>{A(),G(e,U(`Cancel`))},$$slots:{default:!0}});var w=R(C,2);{let e=N(()=>B(pe)||!B(O).trim()||!B(ce).trim());Dd(w,{variant:`default`,size:`sm`,onclick:Ne,get loading(){return B(pe)},get disabled(){return B(e)},"data-testid":`create-persona-button`,children:(e,t)=>{A(),G(e,U(`Create persona`))},$$slots:{default:!0}})}k(S),k(r),z(()=>{Ki(d,!B(de)),Ki(p,B(de))}),Fr(`change`,d,()=>F(de,!1)),Fr(`change`,p,()=>F(de,!0)),ta(_,()=>B(le),e=>F(le,e)),ea(y,()=>B(ue),e=>F(ue,e)),G(e,r)},$$slots:{default:!0}}),G(e,t)};q(Ie,e=>{B(o)?e(Le):e(Re,-1)}),G(e,Fe),M()}Ir([`change`,`input`]);var xM=V(`<span class="absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none"><!></span>`),SM=V(`<p class="mt-1 text-[11px] text-muted-foreground">Couldn't load model list — validation is best-effort.</p>`),CM=V(`<div class="mt-1"><!></div>`),wM=V(`<div class="px-3 py-2 text-sm text-muted-foreground flex items-center gap-2"><!> Loading models…</div>`),TM=V(`<div class="px-3 py-2 text-sm text-muted-foreground"><!></div>`),EM=V(`<li role="option"> </li>`),DM=V(`<ul role="listbox" data-testid="model-combobox-listbox" class="max-h-64 overflow-y-auto py-1"></ul>`),OM=V(`<div class="fixed z-[60] rounded-lg border border-border bg-card shadow-xl overflow-hidden animate-fade-in"><!></div>`),kM=V(`<div class="relative"><input role="combobox" aria-autocomplete="list" autocomplete="off"/> <!></div> <!> <!>`,1);function AM(e,t){j(t,!0);let n=ca(t,`value`,15,``),r=ca(t,`invalid`,3,!1),i=P(void 0),a=P(void 0),o=P(!1),s=P(-1),c=P(on({top:0,left:0,width:0})),l=N(()=>`${t.testid}-listbox`),u=e=>`${t.testid}-option-${e}`,d=N(()=>{let e=n().trim().toLowerCase();return(e.length===0?t.models:t.models.filter(t=>t.toLowerCase().includes(e))).slice(0,50)}),f=N(()=>B(o)&&B(s)>=0?u(B(s)):void 0);function p(){if(!B(i))return;let e=B(i).getBoundingClientRect();F(c,{top:e.bottom+4,left:e.left,width:e.width},!0)}function m(){F(o,!0),p()}function h(){F(o,!1),F(s,-1)}function g(e){n(e),h()}function _(){wr().then(()=>{if(B(s)<0)return;let e=document.getElementById(u(B(s)));e&&typeof e.scrollIntoView==`function`&&e.scrollIntoView({block:`nearest`})})}function v(e){let t=B(d).length;if(t===0){F(s,-1);return}F(s,((B(s)<0?e>0?-1:0:B(s))+e+t)%t),_()}function y(){B(o)||F(o,!0),F(s,-1),p()}function b(e){switch(e.key){case`ArrowDown`:e.preventDefault(),B(o)?v(1):m();return;case`ArrowUp`:e.preventDefault(),B(o)?v(-1):m();return;case`Enter`:if(!B(o))return;e.preventDefault(),B(s)>=0&&B(s)<B(d).length?g(B(d)[B(s)]):h();return;case`Escape`:if(!B(o))return;e.stopPropagation(),h();return;case`Tab`:B(o)&&h();return}}function x(e){return document.body.appendChild(e),{destroy:()=>e.remove()}}Mn(()=>{if(!B(o))return;p();let e=()=>p(),t=e=>{let t=e.target;t&&(B(i)?.contains(t)||B(a)?.contains(t))||h()};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}});var S=kM(),C=L(S),w=I(C);Gi(w),aa(w,e=>F(i,e),()=>B(i));var T=R(w,2),ee=e=>{var t=xM();Bb(I(t),{size:`xs`}),k(t),G(e,t)};q(T,e=>{t.loading&&e(ee)}),k(C);var E=R(C,2),te=e=>{G(e,SM())},ne=e=>{var t=CM();Oc(I(t),{variant:`warning`,"data-testid":`model-combobox-source`,title:`unverified slugs allowed`,children:(e,t)=>{A(),G(e,U(`Partial list (offline)`))},$$slots:{default:!0}}),k(t),G(e,t)};q(E,e=>{t.error?e(te):t.source===`bundled`&&!t.loading&&e(ne,1)});var re=R(E,2),ie=e=>{var r=OM(),i=I(r),o=e=>{var t=wM();Bb(I(t),{size:`xs`}),A(),k(t),G(e,t)},f=e=>{var t=TM(),r=I(t),i=e=>{var t=U();z(e=>K(t,`No matching models — press Enter to use “${e??``}” as-is`),[()=>n().trim()]),G(e,t)},a=N(()=>n().trim().length>0),o=e=>{G(e,U(`No models available`))};q(r,e=>{B(a)?e(i):e(o,-1)}),k(t),G(e,t)},p=e=>{var t=DM();fi(t,22,()=>B(d),e=>e,(e,t,n)=>{var r=EM(),i=I(r,!0);k(r),z((e,a)=>{Ji(r,`id`,e),Ji(r,`aria-selected`,B(n)===B(s)),Ji(r,`data-testid`,`model-combobox-option-${B(n)}`),Ai(r,1,a),K(i,t)},[()=>u(B(n)),()=>wi(hc(`px-3 py-1.5 text-sm cursor-pointer font-mono`,B(n)===B(s)?`bg-primary/15 text-primary`:`text-foreground hover:bg-muted`))]),Fr(`mousedown`,r,e=>e.preventDefault()),Fr(`click`,r,()=>g(t)),G(e,r)}),k(t),z(()=>Ji(t,`id`,B(l))),G(e,t)};q(i,e=>{t.loading?e(o):B(d).length===0?e(f,1):e(p,-1)}),k(r),bi(r,e=>x?.(e)),aa(r,e=>F(a,e),()=>B(a)),z(()=>Mi(r,`top: ${B(c).top??``}px; left: ${B(c).left??``}px; width: ${B(c).width??``}px;`)),G(e,r)};q(re,e=>{B(o)&&e(ie)}),z(e=>{Ji(w,`placeholder`,t.placeholder),Ji(w,`data-testid`,t.testid),Ji(w,`aria-expanded`,B(o)),Ji(w,`aria-controls`,B(o)?B(l):void 0),Ji(w,`aria-activedescendant`,B(f)),Ji(w,`aria-invalid`,r()?!0:void 0),Ai(w,1,e)},[()=>wi(hc(`w-full px-3 py-2.5 bg-background border rounded-lg text-sm transition-all`,`focus:outline-none focus:ring-2 placeholder:text-muted-foreground/50 disabled:opacity-50`,r()?`border-destructive ring-2 ring-destructive/40 focus:ring-destructive/40 focus:border-destructive`:`border-border focus:ring-ring/40 focus:border-ring`,t.loading?`pr-8`:``))]),Fr(`input`,w,y),Pr(`focus`,w,m),Fr(`keydown`,w,b),ea(w,n),G(e,S),M()}Ir([`input`,`keydown`,`mousedown`,`click`]);var jM=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),MM=H(`<path d="M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"></path>`),NM=H(`<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"></path>`,1),PM=H(`<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"></path>`),FM=H(`<path d="M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"></path>`),IM=H(`<path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"></path>`),LM=H(`<path d="M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"></path>`),RM=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function zM(e,t){j(t,!0);let n=pl(),r=sa(t,jM),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=RM();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,MM())},m=e=>{var t=NM();A(),G(e,t)},h=e=>{G(e,PM())},g=e=>{G(e,FM())},_=e=>{G(e,IM())},v=e=>{G(e,LM())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var BM=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),VM=H(`<path d="M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"></path>`),HM=H(`<path d="M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z" opacity="0.2"></path><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"></path>`,1),UM=H(`<path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"></path>`),WM=H(`<path d="M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"></path>`),GM=H(`<path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"></path>`),KM=H(`<path d="M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"></path>`),qM=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function JM(e,t){j(t,!0);let n=pl(),r=sa(t,BM),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=qM();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,VM())},m=e=>{var t=HM();A(),G(e,t)},h=e=>{G(e,UM())},g=e=>{G(e,WM())},_=e=>{G(e,GM())},v=e=>{G(e,KM())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var YM=`native`,XM=[`claude-code`,`goose`,`codex`];function ZM(){return{apiKey:``,modelMap:[],perAgent:{"claude-code":``,goose:``,codex:``},providerOrder:``,providerOnly:``,allowFallbacks:!0,sessionAffinity:!0,usesDefaultMap:!0}}function QM(e){let t=e.providerPreference;return{apiKey:e.apiKey??``,modelMap:(e.modelMap??[]).map(e=>({match:e.match,model:e.model})),perAgent:{"claude-code":e.perAgent?.[`claude-code`]??``,goose:e.perAgent?.goose??``,codex:e.perAgent?.codex??``},providerOrder:(t?.order??[]).join(`, `),providerOnly:(t?.only??[]).join(`, `),allowFallbacks:t?.allowFallbacks??!0,sessionAffinity:e.sessionAffinity??!0,usesDefaultMap:e.modelMap===void 0}}function $M(e,t,n){return e!==t&&n.includes(e)}function eN(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function tN(e){let t={type:`openrouter`};t.apiKey=e.apiKey,e.usesDefaultMap||(t.modelMap=e.modelMap.filter(e=>e.match.trim().length>0&&e.model.trim().length>0).map(e=>({match:e.match.trim(),model:e.model.trim()})));let n={};for(let t of XM){let r=e.perAgent[t].trim();r&&(n[t]=r)}Object.keys(n).length>0&&(t.perAgent=n);let r=eN(e.providerOrder),i=eN(e.providerOnly);return(r.length>0||i.length>0)&&(t.providerPreference={...r.length>0?{order:r}:{},...i.length>0?{only:i}:{},allowFallbacks:e.allowFallbacks}),t.sessionAffinity=e.sessionAffinity,t}function nN(e){return e!==`bundled`}function rN(e){let t=new Set;if(!e)return t;for(let n of e.modelMap??[]){let e=n.model.trim();e.length>0&&t.add(e)}for(let n of XM){let r=(e.perAgent?.[n]??``).trim();r.length>0&&t.add(r)}return t}function iN(e,t,n){let r=[],i=[],a=nN(t.source),o=(e,o)=>{let s=e.trim();s.length!==0&&(t.slugs.has(s)||n.has(s)||(a?r:i).push(o(s)))};e.usesDefaultMap||e.modelMap.forEach((e,t)=>{e.match.trim().length!==0&&o(e.model,e=>({field:`model`,index:t,slug:e}))});for(let t of XM)o(e.perAgent[t],e=>({field:`peragent`,agent:t,slug:e}));return{blocked:r,warnings:i}}function aN(e){return`${e.field===`model`?`Model map row ${(e.index??0)+1}`:`${e.agent} override`}: \`${e.slug}\``}function oN(e){return e.map(e=>`${aN(e)} is not a known OpenRouter model`).join(`; `)}function sN(e){return e.length===0?``:`Saved. The following could not be verified against the offline model list — ${e.map(aN).join(`; `)}.`}var cN=V(`<!> Add profile`,1),lN=V(`<span class="block"><span class="font-mono text-xs" data-testid="settings-error-code"> </span> <span class="block mt-1"> </span></span>`),uN=V(`<div data-testid="settings-error"><!></div>`),dN=V(`<span class="block text-sm"> </span>`),fN=V(`<div data-testid="slug-warning"><!></div>`),pN=V(`<div class="flex items-center justify-center py-16"><!></div>`),mN=V(`<!> <!> <!> <!> <!>`,1),hN=V(`<div class="flex items-center gap-2"><!> <!></div>`),gN=V(`<span class="text-xs text-muted-foreground">built-in</span>`),_N=V(`<!> <!>`,1),vN=V(`Add one with <code class="text-xs">ironcurtain config</code> → Model Providers.`,1),yN=V(`<p class="text-center text-muted-foreground py-8">No OpenRouter profiles yet. <!></p>`),bN=V(`<!> `,1),xN=V(`<div class="flex items-start gap-2 mb-2"><div class="flex-1"><!></div> <span class="text-muted-foreground">→</span> <div class="flex-1"><!></div> <!></div>`),SN=V(`<!> Add rule`,1),CN=V(`<p class="text-[11px] text-muted-foreground mb-1">Custom rules (glob → slug, first match wins)</p> <!> <!> <p class="text-[11px] text-muted-foreground mt-1">No rules means “per-agent only” — the glob map never matches, so only the per-agent overrides below apply.</p>`,1),wN=V(`<div class="flex items-start gap-2"><span class="text-xs font-mono w-24 shrink-0 mt-2.5"> </span> <div class="flex-1"><!></div></div>`),TN=V(`<span class="font-mono text-xs"> </span> <span class="block mt-1"> </span>`,1),EN=V(`<div data-testid="editor-error"><!></div>`),DN=V(`<div class="space-y-4 max-h-[70vh] overflow-y-auto" data-testid="profile-editor"><div><label class="text-xs text-muted-foreground" for="pf-name">Profile name</label> <!></div> <div><label class="text-xs text-muted-foreground" for="pf-key">API key</label> <!> <p class="text-[11px] text-muted-foreground mt-1">Leave the masked value untouched to keep the stored key. Clear the field to remove it. Env <span class="font-mono">OPENROUTER_API_KEY</span> overrides this for every profile.</p></div> <div><div class="flex items-center justify-between mb-1"><p class="text-xs text-muted-foreground">Model map</p> <!></div> <label class="flex items-start gap-2 text-sm mb-2"><input type="checkbox" class="mt-1" data-testid="map-use-default"/> <span>Use IronCurtain’s default model map <span class="block text-[11px] text-muted-foreground">Every Claude model (Sonnet / Opus / Haiku) routes to the default GLM model, and stays in sync if the
|
|
108
|
+
built-in defaults change. Uncheck to define your own glob rules.</span></span></label> <!></div> <div><p class="text-xs text-muted-foreground mb-1">Per-agent model override (wins over the map)</p> <div class="space-y-2"></div></div> <div><p class="text-xs text-muted-foreground mb-1">Provider preference (cache pinning)</p> <div class="space-y-2"><div class="flex items-center gap-2"><span class="text-xs w-16 shrink-0">order</span> <!></div> <div class="flex items-center gap-2"><span class="text-xs w-16 shrink-0">only</span> <!></div> <label class="flex items-center gap-2 text-sm"><input type="checkbox" data-testid="provider-allow-fallbacks"/> <span>Allow fallbacks</span></label></div></div> <label class="flex items-center gap-3 text-sm"><input type="checkbox" data-testid="session-affinity"/> <span>Session affinity (inject session_id for GLM cache affinity)</span></label> <!> <div class="flex items-center justify-end gap-3"><!> <!></div></div>`),ON=V(`<div class="space-y-4"><p class="text-sm">Delete provider profile <span class="font-mono"> </span>? Sessions currently using it fall back to
|
|
109
|
+
the default. If this profile is the default, the default re-points to <span class="font-mono">native</span>.</p> <div class="flex items-center justify-end gap-3"><!> <!></div></div>`),kN=V(`<div class="p-6 space-y-5 animate-fade-in"><div class="flex items-center justify-between flex-wrap gap-3"><h2 class="text-xl font-semibold tracking-tight">Model Providers</h2> <div class="flex items-center gap-3"><!> <!></div></div> <p class="text-sm text-muted-foreground">Route Docker agents through a model-provider profile. <span class="font-mono">native</span> keeps today's canonical
|
|
110
|
+
Anthropic / OpenAI / ChatGPT routing; an <span class="font-mono">openrouter</span> profile routes an agent through
|
|
111
|
+
OpenRouter with a bound model map and key. Pick a default here, or select a profile per session at <span class="font-mono">/new</span> or with <span class="font-mono">--provider-profile</span>.</p> <!> <!> <!> <!></div> <!> <!>`,1);function AN(e,t){j(t,!0);let n=N(()=>J.daemonStatus?.allowPolicyMutation===!0),r=P(!0),i=P(``),a=P(null),o=P(on(YM)),s=P(null),c=P(!1),l=P(null),u=P(on([])),d=P(`bundled`),f=P(!1),p=P(!1),m=P(!1),h=P(on(new Set)),g=P(on(new Set)),_=P(``),v=P(null),y=P(!1);function b(e){let t=e;return{code:typeof t.code==`string`?t.code:`ERROR`,message:t.message??(e instanceof Error?e.message:String(e))}}Mn(()=>{x()}),Mn(()=>{ja.value,Na.value,S()});async function x(){F(r,!0),F(i,``);try{C(await Ro())}catch(e){F(i,e instanceof Error?e.message:String(e),!0)}F(r,!1)}async function S(){if(!(ja.value===0&&Na.value===0)&&!B(s))try{C(await Ro())}catch{}}function C(e){F(a,e,!0),F(o,e.default,!0)}let w=N(()=>B(a)?Object.keys(B(a).profiles).filter(e=>e!==YM):[]),T=N(()=>B(a)?[YM,...B(w)]:[YM]);function ee(e){let t=B(a)?.profiles[e];if(!t||t.type===`native`)return`Native providers (Anthropic / OpenAI / ChatGPT)`;let n=t.modelMap;return`${n===void 0?`default map`:n.length===0?`per-agent only`:n.length===1?`→ ${n[0].model}`:`${n.length} map rules`} · key: ${t.apiKey??`none`}`}async function E(e){let t=e?.force??!1;if(!B(f)&&!(B(m)&&!B(p)&&!t)){F(f,!0),F(p,!1);try{let e=await Bo(t);F(u,[...e.models],!0),F(d,e.source,!0),F(m,!0)}catch{F(p,!0)}F(f,!1)}}function te(){F(l,null),F(h,new Set,!0),F(g,new Set,!0),F(_,``)}function ne(){F(s,{name:``,original:null,profile:ZM()},!0),te(),E()}function re(e){let t=B(a)?.profiles[e];!t||t.type!==`openrouter`||(F(s,{name:e,original:e,profile:QM(t)},!0),te(),E())}function ie(){F(s,null),F(l,null)}function ae(e){if(!e)return;let t=B(a)?.profiles[e];return t&&t.type===`openrouter`?t:void 0}function D(){B(s)&&(B(s).profile.modelMap=[...B(s).profile.modelMap,{match:``,model:``}])}function oe(e){B(s)&&(B(s).profile.modelMap=B(s).profile.modelMap.filter((t,n)=>n!==e))}function se(){B(s)&&!B(s).profile.usesDefaultMap&&B(s).profile.modelMap.length===0&&(B(s).profile.modelMap=[{match:``,model:``}])}function O(e){let t={};for(let n of B(w)){if(n===e.original)continue;let r=B(a)?.profiles[n];r&&r.type===`openrouter`&&(t[n]=r)}return t[e.name.trim()]=tN(e.profile),t}async function ce(){if(!B(s))return;let e=B(s).name.trim();if(!e){F(l,{code:`INVALID_PARAMS`,message:`Profile name is required.`},!0);return}if(e===`native`){F(l,{code:`INVALID_PARAMS`,message:`"native" is a reserved profile name.`},!0);return}if($M(e,B(s).original,B(w))){F(l,{code:`INVALID_PARAMS`,message:`A profile named "${e}" already exists.`},!0);return}let t=rN(ae(B(s).original)),n=iN(B(s).profile,{slugs:new Set(B(u)),source:B(d)},t);if(n.blocked.length>0){F(l,{code:`INVALID_PARAMS`,message:oN(n.blocked)},!0);let e=new Set,t=new Set;for(let r of n.blocked)r.field===`model`&&r.index!==void 0?e.add(r.index):r.field===`peragent`&&r.agent&&t.add(r.agent);F(h,e,!0),F(g,t,!0);return}let r=sN(n.warnings);F(h,new Set,!0),F(g,new Set,!0),F(c,!0),F(l,null);try{let e=O(B(s));C(await zo({default:B(o),profiles:e})),F(s,null),F(_,r,!0)}catch(e){F(l,b(e),!0)}F(c,!1)}function le(e){F(v,e,!0)}async function ue(){if(B(v)){F(y,!0);try{let e={};for(let t of B(w)){if(t===B(v))continue;let n=B(a)?.profiles[t];n&&n.type===`openrouter`&&(e[t]=n)}C(await zo({default:B(o),profiles:e})),F(v,null)}catch(e){F(l,b(e),!0)}F(y,!1)}}async function de(e){if(!(!B(a)||e===B(o))){F(c,!0),F(l,null);try{let t={};for(let e of B(w)){let n=B(a).profiles[e];n&&n.type===`openrouter`&&(t[e]=n)}C(await zo({default:e,profiles:t}))}catch(e){F(l,b(e),!0)}F(c,!1)}}function fe(e){switch(e){case`POLICY_MUTATION_FORBIDDEN`:return`Config mutation is disabled on this daemon. Start the daemon with --allow-policy-mutation to manage provider profiles from the web UI.`;case`INVALID_PARAMS`:return`Some fields are invalid. Check the profile name and the default selection.`;default:return`The operation could not be completed.`}}var pe=kN(),me=L(pe),he=I(me),ge=R(I(he),2),_e=I(ge);Oc(_e,{variant:`outline`,children:(e,t)=>{A();var n=U();z(()=>K(n,`${B(w).length??``} profile${B(w).length===1?``:`s`}`)),G(e,n)},$$slots:{default:!0}});var ve=R(_e,2),ye=e=>{Dd(e,{variant:`default`,size:`sm`,onclick:ne,"data-testid":`add-profile-button`,children:(e,t)=>{var n=cN();zM(L(n),{size:16,class:`mr-1`}),A(),G(e,n)},$$slots:{default:!0}})};q(ve,e=>{B(n)&&e(ye)}),k(ge),k(he);var be=R(he,4),xe=e=>{Db(e,{variant:`destructive`,children:(e,t)=>{A();var n=U();z(()=>K(n,B(i))),G(e,n)},$$slots:{default:!0}})};q(be,e=>{B(i)&&e(xe)});var Se=R(be,2),Ce=e=>{var t=uN();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=lN(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),k(n),z(e=>{K(i,B(l).code),K(o,e)},[()=>fe(B(l).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(Se,e=>{B(l)&&e(Ce)});var we=R(Se,2),Te=e=>{var t=fN();Db(I(t),{variant:`default`,dismissible:!0,ondismiss:()=>F(_,``),children:(e,t)=>{var n=dN(),r=I(n,!0);k(n),z(()=>K(r,B(_))),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(we,e=>{B(_)&&e(Te)});var Ee=R(we,2),De=e=>{var t=pN();Bb(I(t),{size:`md`}),k(t),G(e,t)},Oe=e=>{var t=_N(),r=L(t);Ac(r,{children:(e,t)=>{var r=_N(),i=L(r);Mc(i,{children:(e,t)=>{var r=mN(),i=L(r);zc(i,{children:(e,t)=>{A(),G(e,U(`Profile`))},$$slots:{default:!0}});var a=R(i,2);zc(a,{children:(e,t)=>{A(),G(e,U(`Type`))},$$slots:{default:!0}});var o=R(a,2);zc(o,{children:(e,t)=>{A(),G(e,U(`Summary`))},$$slots:{default:!0}});var s=R(o,2);zc(s,{children:(e,t)=>{A(),G(e,U(`Default`))},$$slots:{default:!0}});var c=R(s,2),l=e=>{zc(e,{children:(e,t)=>{A(),G(e,U(`Actions`))},$$slots:{default:!0}})};q(c,e=>{B(n)&&e(l)}),G(e,r)},$$slots:{default:!0}}),Pc(R(i,2),{children:(e,t)=>{var r=W();fi(L(r),16,()=>B(T),e=>e,(e,t)=>{let r=N(()=>t===YM);{let i=N(()=>`profile-row-${t}`);Lc(e,{get"data-testid"(){return B(i)},children:(e,i)=>{var s=mN(),l=L(s);Vc(l,{class:`font-medium font-mono text-xs`,children:(e,n)=>{A();var r=U();z(()=>K(r,t)),G(e,r)},$$slots:{default:!0}});var u=R(l,2);Vc(u,{children:(e,n)=>{{let n=N(()=>B(r)?`secondary`:`default`);Oc(e,{get variant(){return B(n)},children:(e,n)=>{A();var r=U();z(()=>K(r,B(a).profiles[t]?.type??`native`)),G(e,r)},$$slots:{default:!0}})}},$$slots:{default:!0}});var d=R(u,2);Vc(d,{class:`text-sm text-muted-foreground max-w-xs truncate`,children:(e,n)=>{A();var r=U();z(e=>K(r,e),[()=>ee(t)]),G(e,r)},$$slots:{default:!0}});var f=R(d,2);Vc(f,{children:(e,r)=>{var i=W(),a=L(i),s=e=>{{let n=N(()=>`default-badge-${t}`);Oc(e,{variant:`success`,get"data-testid"(){return B(n)},children:(e,t)=>{A(),G(e,U(`Default`))},$$slots:{default:!0}})}},l=e=>{{let n=N(()=>`set-default-${t}`);Dd(e,{variant:`ghost`,size:`sm`,onclick:()=>de(t),get disabled(){return B(c)},get"data-testid"(){return B(n)},children:(e,t)=>{A(),G(e,U(`Set default`))},$$slots:{default:!0}})}};q(a,e=>{t===B(o)?e(s):B(n)&&e(l,1)}),G(e,i)},$$slots:{default:!0}});var p=R(f,2),m=e=>{Vc(e,{children:(e,n)=>{var i=W(),a=L(i),o=e=>{var n=hN(),r=I(n);{let e=N(()=>`edit-profile-${t}`);Dd(r,{variant:`outline`,size:`sm`,onclick:()=>re(t),get"data-testid"(){return B(e)},children:(e,t)=>{A(),G(e,U(`Edit`))},$$slots:{default:!0}})}var i=R(r,2);{let e=N(()=>`delete-profile-${t}`);Dd(i,{variant:`destructive`,size:`sm`,onclick:()=>le(t),get"data-testid"(){return B(e)},children:(e,t)=>{JM(e,{size:14})},$$slots:{default:!0}})}k(n),G(e,n)},s=e=>{G(e,gN())};q(a,e=>{B(r)?e(s,-1):e(o)}),G(e,i)},$$slots:{default:!0}})};q(p,e=>{B(n)&&e(m)}),G(e,s)},$$slots:{default:!0}})}}),G(e,r)},$$slots:{default:!0}}),G(e,r)},$$slots:{default:!0}});var i=R(r,2),s=e=>{yc(e,{children:(e,t)=>{Tc(e,{children:(e,t)=>{var r=yN(),i=R(I(r)),a=e=>{G(e,U(`Add one with the “Add profile” button.`))},o=e=>{var t=vN();A(2),G(e,t)};q(i,e=>{B(n)?e(a):e(o,-1)}),k(r),G(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};q(i,e=>{B(w).length===0&&e(s)}),G(e,t)};q(Ee,e=>{B(r)?e(De):B(a)&&e(Oe,1)}),k(me);var ke=R(me,2);{let e=N(()=>B(s)!==null),t=N(()=>B(s)?.original?`Edit profile`:`Add profile`);ik(ke,{get open(){return B(e)},onclose:ie,get title(){return B(t)},children:(e,t)=>{var n=W(),r=L(n),i=e=>{var t=DN(),n=I(t);Ad(R(I(n),2),{id:`pf-name`,placeholder:`e.g. glm-5.2`,"data-testid":`profile-name`,get value(){return B(s).name},set value(e){B(s).name=e}}),k(n);var r=R(n,2);Ad(R(I(r),2),{id:`pf-key`,placeholder:`sk-or-v1-...`,"data-testid":`profile-apikey`,get value(){return B(s).profile.apiKey},set value(e){B(s).profile.apiKey=e}}),A(2),k(r);var i=R(r,2),a=I(i);Dd(R(I(a),2),{variant:`ghost`,size:`sm`,onclick:()=>E({force:!0}),get disabled(){return B(f)},"data-testid":`model-refresh`,children:(e,t)=>{var n=bN(),r=L(n);uO(r,{size:13,class:`mr-1`});var i=R(r);z(()=>K(i,` ${B(f)?`Refreshing…`:`Refresh models`}`)),G(e,n)},$$slots:{default:!0}}),k(a);var o=R(a,2),m=I(o);Gi(m),A(2),k(o);var _=R(o,2),v=e=>{var t=CN(),n=R(L(t),2);fi(n,17,()=>B(s).profile.modelMap,ci,(e,t,n)=>{var r=xN(),i=I(r);Ad(I(i),{placeholder:`*sonnet*`,"data-testid":`map-match-${n}`,get value(){return B(s).profile.modelMap[n].match},set value(e){B(s).profile.modelMap[n].match=e}}),k(i);var a=R(i,4),o=I(a);{let e=N(()=>B(h).has(n));AM(o,{get models(){return B(u)},get source(){return B(d)},get loading(){return B(f)},get error(){return B(p)},get invalid(){return B(e)},placeholder:`z-ai/glm-5.2`,testid:`map-model-${n}`,get value(){return B(s).profile.modelMap[n].model},set value(e){B(s).profile.modelMap[n].model=e}})}k(a),Dd(R(a,2),{variant:`ghost`,size:`sm`,onclick:()=>oe(n),"data-testid":`map-remove-${n}`,children:(e,t)=>{JM(e,{size:14})},$$slots:{default:!0}}),k(r),G(e,r)}),Dd(R(n,2),{variant:`outline`,size:`sm`,onclick:D,"data-testid":`map-add`,children:(e,t)=>{var n=SN();zM(L(n),{size:14,class:`mr-1`}),A(),G(e,n)},$$slots:{default:!0}}),A(2),G(e,t)};q(_,e=>{B(s).profile.usesDefaultMap||e(v)}),k(i);var y=R(i,2),b=R(I(y),2);fi(b,20,()=>XM,e=>e,(e,t)=>{var n=wN(),r=I(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a);{let e=N(()=>B(g).has(t)),n=N(()=>`peragent-${t}`);AM(o,{get models(){return B(u)},get source(){return B(d)},get loading(){return B(f)},get error(){return B(p)},get invalid(){return B(e)},placeholder:`(unset)`,get testid(){return B(n)},get value(){return B(s).profile.perAgent[t]},set value(e){B(s).profile.perAgent[t]=e}})}k(a),k(n),z(()=>K(i,t)),G(e,n)}),k(b),k(y);var x=R(y,2),S=R(I(x),2),C=I(S);Ad(R(I(C),2),{placeholder:`z-ai (comma-separated)`,"data-testid":`provider-order`,get value(){return B(s).profile.providerOrder},set value(e){B(s).profile.providerOrder=e}}),k(C);var w=R(C,2);Ad(R(I(w),2),{placeholder:`z-ai (comma-separated)`,"data-testid":`provider-only`,get value(){return B(s).profile.providerOnly},set value(e){B(s).profile.providerOnly=e}}),k(w);var T=R(w,2),ee=I(T);Gi(ee),A(2),k(T),k(S),k(x);var te=R(x,2),ne=I(te);Gi(ne),A(2),k(te);var re=R(te,2),ae=e=>{var t=EN();Db(I(t),{variant:`destructive`,children:(e,t)=>{var n=TN(),r=L(n),i=I(r,!0);k(r);var a=R(r,2),o=I(a,!0);k(a),z(e=>{K(i,B(l).code),K(o,e)},[()=>B(l).code===`INVALID_PARAMS`?B(l).message:fe(B(l).code)]),G(e,n)},$$slots:{default:!0}}),k(t),G(e,t)};q(re,e=>{B(l)&&e(ae)});var O=R(re,2),le=I(O);Dd(le,{variant:`outline`,size:`sm`,onclick:ie,get disabled(){return B(c)},children:(e,t)=>{A(),G(e,U(`Cancel`))},$$slots:{default:!0}});var ue=R(le,2);{let e=N(()=>B(c)||!B(s).name.trim());Dd(ue,{variant:`default`,size:`sm`,onclick:ce,get loading(){return B(c)},get disabled(){return B(e)},"data-testid":`save-profile-button`,children:(e,t)=>{A(),G(e,U(`Save profile`))},$$slots:{default:!0}})}k(O),k(t),Fr(`change`,m,se),ta(m,()=>B(s).profile.usesDefaultMap,e=>B(s).profile.usesDefaultMap=e),ta(ee,()=>B(s).profile.allowFallbacks,e=>B(s).profile.allowFallbacks=e),ta(ne,()=>B(s).profile.sessionAffinity,e=>B(s).profile.sessionAffinity=e),G(e,t)};q(r,e=>{B(s)&&e(i)}),G(e,n)},$$slots:{default:!0}})}var Ae=R(ke,2);{let e=N(()=>B(v)!==null);ik(Ae,{get open(){return B(e)},onclose:()=>F(v,null),title:`Delete profile`,children:(e,t)=>{var n=ON(),r=I(n),i=R(I(r)),a=I(i,!0);k(i),A(3),k(r);var o=R(r,2),s=I(o);Dd(s,{variant:`outline`,size:`sm`,onclick:()=>F(v,null),get disabled(){return B(y)},children:(e,t)=>{A(),G(e,U(`Cancel`))},$$slots:{default:!0}}),Dd(R(s,2),{variant:`destructive`,size:`sm`,onclick:ue,get loading(){return B(y)},get disabled(){return B(y)},"data-testid":`confirm-delete-profile`,children:(e,t)=>{A(),G(e,U(`Delete`))},$$slots:{default:!0}}),k(o),k(n),z(()=>K(a,B(v))),G(e,n)},$$slots:{default:!0}})}G(e,pe),M()}Ir([`change`]);var jN=V(`<div class="fixed inset-0 z-10"></div> <div role="menu"><!></div>`,1),MN=V(`<div><div aria-haspopup="menu"><!></div> <!></div>`);function NN(e,t){j(t,!0);let n={"bottom-left":`left-0 top-full mt-1`,"bottom-right":`right-0 top-full mt-1`,"top-left":`left-0 bottom-full mb-1`,"top-right":`right-0 bottom-full mb-1`},r=ca(t,`open`,15,!1),i=ca(t,`align`,3,`bottom-left`),a=ca(t,`aria-label`,3,`Menu`),o=P(void 0),s=P(void 0);function c(){r(!1),B(o)?.querySelector(`button`)?.focus()}function l(){wr().then(()=>{(B(s)?.querySelector(`[role="menuitem"]`))?.focus()})}Mn(()=>{if(r()){l();let e=e=>{e.key===`Escape`&&(r(!1),B(o)?.querySelector(`button`)?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}});var u=MN(),d=I(u);ri(I(d),()=>t.trigger),k(d),aa(d,e=>F(o,e),()=>B(o));var f=R(d,2),p=e=>{var r=jN(),o=L(r),l=R(o,2),u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)}),k(l),aa(l,e=>F(s,e),()=>B(s)),z(e=>{Ai(l,1,e),Ji(l,`aria-label`,a())},[()=>wi(hc(`absolute z-20 min-w-[12rem] bg-card border border-border rounded-lg shadow-xl overflow-hidden animate-fade-in`,n[i()],t.contentClass))]),Fr(`click`,o,c),G(e,r)};q(f,e=>{r()&&e(p)}),k(u),z(e=>{Ai(u,1,e),Ji(d,`aria-expanded`,r())},[()=>wi(hc(`relative`,t.class))]),G(e,u),M()}Ir([`click`]);var PN=new Set([`$$slots`,`$$events`,`$$legacy`,`active`,`class`,`children`]),FN=V(`<button><!></button>`);function IN(e,t){j(t,!0);let n=ca(t,`active`,3,!1),r=sa(t,PN);var i=FN();Xi(i,e=>({class:e,role:`menuitem`,...r}),[()=>hc(`w-full text-left px-3 py-2 text-sm transition-colors`,n()?`bg-accent text-accent-foreground`:`hover:bg-accent/50 text-foreground`,t.class)]);var a=I(i),o=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(a,e=>{t.children&&e(o)}),k(i),G(e,i),M()}var LN=V(`<button role="tab"> </button>`),RN=V(`<div class="flex border-b border-border overflow-x-auto scroll-snap-x" role="tablist"></div>`),zN=V(`<span><kbd class="px-1 py-0.5 bg-muted rounded text-[10px]">←</kbd><kbd class="px-1 py-0.5 bg-muted rounded text-[10px]">→</kbd> switch</span>`),BN=V(`<!> <div class="max-h-[60vh] overflow-y-auto"><!></div> <div class="px-5 py-2 border-t border-border text-[10px] text-muted-foreground flex items-center gap-4"><span><kbd class="px-1 py-0.5 bg-muted rounded text-[10px]">a</kbd> approve</span> <span><kbd class="px-1 py-0.5 bg-muted rounded text-[10px]">d</kbd> deny</span> <!> <span><kbd class="px-1 py-0.5 bg-muted rounded text-[10px]">Esc</kbd> dismiss</span></div>`,1);function VN(e,t){j(t,!0);let n=P(null),r=P(on(new Set)),i=N(()=>[...t.escalations.values()].sort((e,t)=>e.displayNumber-t.displayNumber));Mn(()=>{B(i).length===0?F(n,null):(B(n)===null||!t.escalations.has(B(n)))&&F(n,B(i)[0].escalationId,!0)});let a=N(()=>B(n)?t.escalations.get(B(n))??null:null);async function o(e,n,i){F(r,new Set([...B(r),e]),!0);try{await t.onresolve(e,n,i)}finally{let t=new Set(B(r));t.delete(e),F(r,t,!0)}}function s(e){let t=e.target;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||(e.key===`ArrowLeft`?(e.preventDefault(),c(-1)):e.key===`ArrowRight`?(e.preventDefault(),c(1)):e.key===`a`&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(e.preventDefault(),B(n)&&!B(r).has(B(n))&&o(B(n),`approved`)):e.key===`d`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),B(n)&&!B(r).has(B(n))&&o(B(n),`denied`)))}function c(e){if(B(i).length<=1)return;let t=(B(i).findIndex(e=>e.escalationId===B(n))+e+B(i).length)%B(i).length;F(n,B(i)[t].escalationId,!0)}ik(e,{get open(){return t.open},get onclose(){return t.onclose},title:`Pending Escalations`,onkeydown:s,children:(e,s)=>{var c=BN(),l=L(c),u=e=>{var t=RN();fi(t,21,()=>B(i),e=>e.escalationId,(e,t)=>{var r=LN(),i=I(r);k(r),z(()=>{Ji(r,`aria-selected`,B(t).escalationId===B(n)),Ai(r,1,`shrink-0 scroll-snap-start px-4 py-2 text-xs font-mono border-b-2 transition-colors
|
|
112
|
+
${B(t).escalationId===B(n)?`border-primary text-primary`:`border-transparent text-muted-foreground hover:text-foreground hover:border-border`}`),K(i,`${B(t).serverName??``}/${B(t).toolName??``}`)}),Fr(`click`,r,()=>F(n,B(t).escalationId,!0)),G(e,r)}),k(t),G(e,t)};q(l,e=>{B(i).length>1&&e(u)});var d=R(l,2),f=I(d),p=e=>{var n=W();si(L(n),()=>B(a).escalationId,e=>{{let n=N(()=>B(r).has(B(a).escalationId));Pb(e,{get escalation(){return B(a)},get loading(){return B(n)},onapprove:e=>o(B(a).escalationId,`approved`,e),ondeny:()=>o(B(a).escalationId,`denied`),onviewsession:e=>{t.onclose(),t.onviewsession(e)}})}}),G(e,n)};q(f,e=>{B(a)&&e(p)}),k(d);var m=R(d,2),h=R(I(m),4),g=e=>{G(e,zN())};q(h,e=>{B(i).length>1&&e(g)}),A(2),k(m),G(e,c)},$$slots:{default:!0}}),M()}Ir([`click`]);var HN=`IronCurtain`,UN=`Secure* Agent Runtime`,WN=`ヲアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン0123456789`,GN=`"Orbitron", sans-serif`,KN=`#B4FFB4`,qN=`#00FF46`,JN=`#007800`,YN=.55,XN=.55,ZN=15,QN=4,$N=4,eP=7,tP=1,nP=2,rP=6,iP=60,aP=1;function oP(e){let t=e|0||1;return{random(){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}}}var sP={random:()=>Math.random()};function cP(e){let t=[],n=[];for(let r of e)r.group===`subtitle`?n.push(r):t.push(r);return{titleCells:t,subtitleCells:n}}function lP(e,t={}){let n=t.rng??(t.seed===void 0?sP:oP(t.seed)),r=t.reducedMotion===!0,i=e,a=`assembly`,o=0,s=0,c=!1,{titleCells:l,subtitleCells:u}=cP(i.lockedCells),d=uP(l,n),f=[],p=[],m=!1,h=0,g=[],_=[],v=[],y=Array(i.cols).fill(0);r&&(a=`ambient`,o=0,d=[],f=dP(i));function b(){return a===`assembly`?.3:a===`hold`?.5:1}function x(){a===`assembly`?C():a===`hold`?ee():E(),a!==`ambient`&&!r&&S(),o++}function S(){te(),ne(),re(b())}function C(){if(m){T();return}let e=!0;for(let t of d)if(!t.locked){if(o<t.startFrame){e=!1;continue}t.headRow++;for(let e=t.chars.length-1;e>0;e--)t.chars[e]=t.chars[e-1];t.chars[0]=de(),t.headRow>=t.targetRow?t.locked=!0:e=!1}if(o>=119){for(let e of d)e.locked=!0,e.headRow=e.targetRow;e=!0}e&&w()}function w(){if(u.length===0){D(`hold`);return}m=!0,h=0,g=[];let e=new Set;for(let t of u)e.add(t.row);_=[...e].sort((e,t)=>e-t)}function T(){h++;let e=Math.min(1,h/15),t=Math.ceil(e*_.length),n=new Set(_.slice(0,t));g=[];for(let e of u)n.has(e.row)&&g.push({col:e.col,row:e.row,alpha:1});h>=15&&D(`hold`)}function ee(){o>=44&&D(`ambient`)}function E(){r||(te(),ne(),re(b()))}function te(){let e=i.rows;for(let t of v){if(!t.alive)continue;t.speedAccum+=t.speed;let n=Math.floor(t.speedAccum);t.speedAccum-=n;for(let e=0;e<n;e++){t.headRow+=1;let e=de();t.chars[t.headIdx]=e,t.headIdx=(t.headIdx+1)%t.chars.length}t.headRow-t.trailLen>=e&&(t.alive=!1)}let t=0;for(let e=0;e<v.length;e++)v[e].alive&&(v[t++]=v[e]);v.length=t}function ne(){for(let e=0;e<y.length;e++)y[e]>0&&y[e]--}function re(e=1){let t=Math.floor(iP*e);if(v.length>=t||i.cols<=0)return;let r=aP*e,a=Math.floor(r),o=r-a,s=a+ +(n.random()<o);for(let e=0;e<s;e++){let e=ie();if(e<0)return;v.push(ae(e)),y[e]=rP}}function ie(){let e=i.cols;for(let t=0;t<6;t++){let t=Math.floor(n.random()*e);if(y[t]===0)return t}return-1}function ae(e){let t=fe($N,eP),r=tP+n.random()*(nP-tP),i=t+1,a=Array(i),o=de();for(let e=0;e<i;e++)a[e]=o;return{col:e,headRow:-1,speed:r,speedAccum:0,trailLen:t,chars:a,headIdx:1%i,alive:!0}}function D(e){e===`hold`?(a=`hold`,o=-1,f=dP(i),d=[],m=!1,g=[]):e===`ambient`&&(a=`ambient`,o=-1)}function oe(){let e=se(),t=ce();return{phase:a,globalAlpha:e,lockedCells:a===`assembly`?O():f,drops:t}}function se(){if(a===`assembly`)return 1;if(a===`ambient`)return XN;let e=Math.min(1,Math.max(0,o/44));return 1+(YN-1)*e}function O(){let e=[];for(let t of d)t.locked&&e.push({col:t.col,row:t.targetRow,alpha:1});if(m)for(let t of g)e.push(t);return e}function ce(){p.length=0;let e=a===`assembly`?`far`:null;for(let t of v)p.push(ue(t,e));if(a===`assembly`)for(let e of d)e.locked||o<e.startFrame||e.headRow<0||p.push(le(e));return p}function le(e){let t=e.headRow,n=[];for(let r=1;r<=QN;r++){let i=t-r;if(i<0)break;n.push({col:e.col,row:i,char:e.chars[r],colorKind:fP(r)})}return{col:e.col,row:t,char:e.chars[0],colorKind:`head`,trail:n}}function ue(e,t=null){let n=Math.floor(e.headRow),r=e.chars.length,i=(e.headIdx-1+r)%r,a=e.chars[i],o=[];for(let i=1;i<=e.trailLen;i++){let a=n-i;if(a<0)break;let s=(e.headIdx-1-i+r*(e.trailLen+2))%r;o.push({col:e.col,row:a,char:e.chars[s],colorKind:t??fP(i)})}return{col:e.col,row:e.headRow,char:a,colorKind:t??`head`,trail:o}}function de(){return WN[Math.floor(n.random()*WN.length)]}function fe(e,t){return e+Math.floor(n.random()*(t-e+1))}return{step(e){if(!c){s=e,c=!0;return}let t=e-s;if(!(t<=0)){if(t>99){x(),s=e;return}for(;e-s>=33;)s+=33,x()}},getFrame(){return oe()},resize(e){let t=e.cellSize!==i.cellSize,r=!pP(i.lockedCells,e.lockedCells),o=t||e.cols!==i.cols||e.rows!==i.rows;i=e;let s=cP(i.lockedCells);if(l=s.titleCells,u=s.subtitleCells,(t||r)&&(a===`assembly`?(d=uP(l,n),f=[],m=!1,g=[]):f=dP(i)),o&&(v=[]),y.length!==i.cols){let e=Array(i.cols).fill(0),t=Math.min(y.length,e.length);for(let n=0;n<t;n++)e[n]=y[n];y=e}},get phase(){return a},get wordmarkReady(){return a!==`assembly`}}}function uP(e,t){let n=[];for(let r of e){let e=[,,,,,];for(let n=0;n<e.length;n++)e[n]=WN[Math.floor(t.random()*WN.length)];n.push({col:r.col,targetRow:r.row,startFrame:Math.floor(t.random()*ZN),headRow:-1-Math.floor(t.random()*5),locked:!1,chars:e})}return n}function dP(e){let t=[];for(let n of e.lockedCells)t.push({col:n.col,row:n.row,alpha:1});return t}function fP(e){return e===0?`head`:e<=2?`near`:`far`}function pP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].col!==t[n].col||e[n].row!==t[n].row||e[n].group!==t[n].group)return!1;return!0}var mP=24,hP=160,gP=128,_P=200,vP=.35,yP=.4,bP=`#009900`;function xP(e,t,n,r=10,i){if(t<_P||n<_P||e.length===0)return null;let a=SP(r,t),o=CP(t,n),s=Math.max(1,Math.floor(t/a)),c=Math.max(1,Math.floor(n/a)),l=i??wP();if(!l)return null;let u=EP(l,e,o,t,n,a,s,c);if(u.lockedCells.length===0)return null;let d=1/0,f=1/0;for(let e of u.lockedCells)e.col<d&&(d=e.col),e.row<f&&(f=e.row);return{cellSize:a,cols:s,rows:c,originX:d*a,originY:f*a,viewportWidth:t,viewportHeight:n,lockedCells:u.lockedCells,wordmarkImage:u.wordmarkCanvas,wordmarkDrawX:u.drawX,wordmarkDrawY:u.drawY}}function SP(e,t){let n=Math.max(5,Math.min(14,Math.floor(t/120)));return Math.max(Math.max(5,Math.min(14,Math.floor(e))),n)}function CP(e,t){let n=e*.08,r=t*.15;return Math.max(mP,Math.min(hP,Math.floor(Math.min(n,r))))}function wP(){if(typeof OffscreenCanvas<`u`)try{return new OffscreenCanvas(1,1).getContext(`2d`)}catch{}return typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null}function TP(e,t,n){let r=e.measureText(t);return{width:Math.ceil(r.width),ascent:Math.ceil(r.actualBoundingBoxAscent??n*.8),descent:Math.ceil(r.actualBoundingBoxDescent??n*.2)}}function EP(e,t,n,r,i,a,o,s){let c=`700 ${n}px ${GN}`;e.font=c;let l=TP(e,t,n);if(l.width<=0||l.ascent+l.descent<=0)return{lockedCells:[],wordmarkCanvas:null,drawX:0,drawY:0};let u=Math.max(12,Math.round(n*vP)),d=`700 ${u}px ${GN}`;e.font=d;let f=TP(e,UN,u),p=l.ascent+l.descent,m=Math.round(n*yP),h=f.ascent+f.descent,g=Math.max(l.width,f.width),_=p+m+h,v=Math.ceil(n*.1),y=g+v*2,b=_+v*2;DP(e,y,b),e.font=c,e.textBaseline=`top`,e.textAlign=`left`,e.clearRect(0,0,y,b);let x=v+Math.floor((g-l.width)/2),S=v;e.fillStyle=`#00E800`,e.fillText(t,x,S);let C=v+Math.floor((g-f.width)/2),w=v+p+m;e.font=d,e.fillStyle=bP,e.fillText(UN,C,w);let T=e.getImageData(0,0,y,b).data,ee=Math.floor((r-g)/2),E=Math.floor(i*.3-_/2),te=ee-v,ne=E-v,re=v+p+m/2,ie=new Uint8Array(o*s),ae=[];for(let e=0;e<b;e++)for(let t=0;t<y;t++){if(T[(e*y+t)*4+3]<=gP)continue;let n=t-v+ee,r=e-v+E,i=Math.floor(n/a),c=Math.floor(r/a);if(i<0||i>=o||c<0||c>=s)continue;let l=c*o+i;if(ie[l])continue;ie[l]=1;let u=e<re?`title`:`subtitle`;ae.push({col:i,row:c,group:u})}return{lockedCells:ae,wordmarkCanvas:e.canvas,drawX:te,drawY:ne}}function DP(e,t,n){let r=e.canvas;`width`in r&&(r.width=t,r.height=n)}var OP=1.3;function kP(e,t,n,r,i,a){let o=a.fontSizeTuning??1.3,s=n.cellSize*o;e.globalAlpha=1,e.fillStyle=`#000000`,e.fillRect(0,0,r,i);let c=`${s}px ${a.fontFamily}`;e.font!==c&&(e.font=c),e.textBaseline=`top`,e.textAlign=`center`,e.globalAlpha=t.globalAlpha;for(let r of t.drops)MP(e,r,n);e.globalAlpha=1}function AP(e,t,n,r,i){e.globalAlpha=1,e.clearRect(0,0,r,i),e.globalAlpha=t.globalAlpha,t.lockedCells.length>0&&jP(e,t,n),e.globalAlpha=1}function jP(e,t,n){let r=n.wordmarkImage;if(!r)return;let i=n.cellSize,a=(`width`in r,r.width),o=(`height`in r,r.height);for(let s of t.lockedCells){let t=s.col*i,c=s.row*i,l=t-n.wordmarkDrawX,u=c-n.wordmarkDrawY;l<0||u<0||l+i>a||u+i>o||e.drawImage(r,l,u,i,i,t,c,i,i)}}function MP(e,t,n){for(let r=t.trail.length-1;r>=0;r--){let i=t.trail[r];e.fillStyle=NP(i.colorKind),e.fillText(i.char,PP(n,i.col),FP(n,i.row))}e.fillStyle=NP(t.colorKind),e.fillText(t.char,PP(n,t.col),FP(n,t.row))}function NP(e){return e===`head`?KN:e===`near`?qN:JN}function PP(e,t){return t*e.cellSize+e.cellSize/2}function FP(e,t){return t*e.cellSize}var IP=V(`<div style="position: relative;"><canvas class="absolute inset-0 block w-full h-full"></canvas> <canvas class="absolute inset-0 block w-full h-full wordmark-glow pointer-events-none svelte-8mgguq"></canvas></div>`);function LP(e,t){j(t,!0);let n=ca(t,`word`,3,HN),r=ca(t,`reducedMotion`,3,!1),i=ca(t,`class`,3,``),a=P(null),o=P(null),s=P(!1);Mn(()=>{if(typeof document>`u`||!document.fonts){F(s,!0);return}let e=!1,t=`700 48px ${GN}`;return document.fonts.load(t).then(()=>{e||F(s,!0)}).catch(()=>{e||F(s,!0)}),()=>{e=!0}}),Mn(()=>{if(!B(a)||!B(o)||!B(s))return;let e=B(a).parentElement,i=e?.parentElement;if(!e||!i)return;let l=B(a).getContext(`2d`),u=B(o).getContext(`2d`);if(!l||!u)return;let d=B(a),f=B(o),p=l,m=u,h=n(),g=r(),_=null,v=null,y=null,b=null,x=!1,S=!1,C=null,w=!1;function T(e,t){let n=xP(h,e,t);if(!n){E(),_=null,v=null,c(d,p,0,0),c(f,m,0,0);return}c(d,p,n.viewportWidth,n.viewportHeight),c(f,m,n.viewportWidth,n.viewportHeight);let r=!_||Math.abs(_.cellSize-n.cellSize)>=1;!v||r?(v=lP(n,{reducedMotion:g}),x=!1,S=!1,C=null):(v.resize(n),S=!1,C=null),_=n,y===null&&(y=requestAnimationFrame(ee))}function ee(e){if(!v||!_){y=null;return}v.step(e);let n=v.getFrame(),r=Math.floor(_.viewportWidth),i=Math.floor(_.viewportHeight);kP(p,n,_,r,i,{fontFamily:`"JetBrains Mono", ui-monospace, monospace`,fontSizeTuning:OP}),v.phase!==C&&(S=!1,C=v.phase),(!S||v.phase!==`ambient`)&&(AP(m,n,_,r,i),v.phase===`ambient`&&(S=!0)),!x&&v.wordmarkReady&&(x=!0,t.onready?.()),y=requestAnimationFrame(ee)}function E(){y!==null&&(cancelAnimationFrame(y),y=null)}let te=i.getBoundingClientRect();T(te.width,te.height);let ne=new ResizeObserver(e=>{w||b!==null||(b=requestAnimationFrame(()=>{if(b=null,w)return;let t=e[0];if(!t)return;let{width:n,height:r}=t.contentRect;T(n,r)}))});return ne.observe(i),()=>{w=!0,E(),b!==null&&(cancelAnimationFrame(b),b=null),ne.disconnect(),v=null,_=null}});function c(e,t,n,r){let i=window.devicePixelRatio||1,a=Math.max(0,Math.floor(n)),o=Math.max(0,Math.floor(r));e.style.width=`${a}px`,e.style.height=`${o}px`,e.width=Math.floor(a*i),e.height=Math.floor(o*i),t.setTransform(i,0,0,i,0,0)}var l=IP(),u=I(l);aa(u,e=>F(a,e),()=>B(a)),aa(R(u,2),e=>F(o,e),()=>B(o)),k(l),z(()=>Ai(l,1,wi(i()),`svelte-8mgguq`)),G(e,l),M()}var RP=null;function zP(e){RP?.();let t=document.title,n=!0,r=setInterval(()=>{document.title=n?e:t,n=!n},1e3);function i(){clearInterval(r),document.title=t,document.removeEventListener(`visibilitychange`,a),RP===i&&(RP=null)}function a(){document.hidden||i()}return document.addEventListener(`visibilitychange`,a),RP=i,i}var BP=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),VP=H(`<path d="M222.14,105.85l-80-80a20,20,0,0,0-28.28,0l-80,80A19.86,19.86,0,0,0,28,120v96a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V164h24v52a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V120A19.86,19.86,0,0,0,222.14,105.85ZM204,204H164V152a12,12,0,0,0-12-12H104a12,12,0,0,0-12,12v52H52V121.65l76-76,76,76Z"></path>`),HP=H(`<path d="M216,120v96H152V152H104v64H40V120a8,8,0,0,1,2.34-5.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,216,120Z" opacity="0.2"></path><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"></path>`,1),UP=H(`<path d="M224,120v96a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V164a4,4,0,0,0-4-4H108a4,4,0,0,0-4,4v52a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V120a16,16,0,0,1,4.69-11.31l80-80a16,16,0,0,1,22.62,0l80,80A16,16,0,0,1,224,120Z"></path>`),WP=H(`<path d="M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z"></path>`),GP=H(`<path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"></path>`),KP=H(`<path d="M216.49,111.51l-80-80a12,12,0,0,0-17,0l-80,80A12,12,0,0,0,36,120v96a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V156h40v60a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V120A12,12,0,0,0,216.49,111.51ZM212,212H156V152a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v60H44V120a4,4,0,0,1,1.17-2.83l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,212,120Z"></path>`),qP=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function JP(e,t){j(t,!0);let n=pl(),r=sa(t,BP),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=qP();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,VP())},m=e=>{var t=HP();A(),G(e,t)},h=e=>{G(e,UP())},g=e=>{G(e,WP())},_=e=>{G(e,GP())},v=e=>{G(e,KP())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var YP=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),XP=H(`<path d="M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"></path>`),ZP=H(`<path d="M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z" opacity="0.2"></path><path d="M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"></path>`,1),QP=H(`<path d="M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"></path>`),$P=H(`<path d="M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"></path>`),eF=H(`<path d="M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"></path>`),tF=H(`<path d="M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"></path>`),nF=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function rF(e,t){j(t,!0);let n=pl(),r=sa(t,YP),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=nF();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,XP())},m=e=>{var t=ZP();A(),G(e,t)},h=e=>{G(e,QP())},g=e=>{G(e,$P())},_=e=>{G(e,eF())},v=e=>{G(e,tF())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var iF=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),aF=H(`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20ZM79.57,196.57a60,60,0,0,1,96.86,0,83.72,83.72,0,0,1-96.86,0ZM100,120a28,28,0,1,1,28,28A28,28,0,0,1,100,120ZM194,179.94a83.48,83.48,0,0,0-29-23.42,52,52,0,1,0-74,0,83.48,83.48,0,0,0-29,23.42,84,84,0,1,1,131.9,0Z"></path>`),oF=H(`<path d="M224,128a95.76,95.76,0,0,1-31.8,71.37A72,72,0,0,0,128,160a40,40,0,1,0-40-40,40,40,0,0,0,40,40,72,72,0,0,0-64.2,39.37h0A96,96,0,1,1,224,128Z" opacity="0.2"></path><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"></path>`,1),sF=H(`<path d="M172,120a44,44,0,1,1-44-44A44.05,44.05,0,0,1,172,120Zm60,8A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88.09,88.09,0,0,0-91.47-87.93C77.43,41.89,39.87,81.12,40,128.25a87.65,87.65,0,0,0,22.24,58.16A79.71,79.71,0,0,1,84,165.1a4,4,0,0,1,4.83.32,59.83,59.83,0,0,0,78.28,0,4,4,0,0,1,4.83-.32,79.71,79.71,0,0,1,21.79,21.31A87.62,87.62,0,0,0,216,128Z"></path>`),cF=H(`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26ZM71.44,198a66,66,0,0,1,113.12,0,89.8,89.8,0,0,1-113.12,0ZM94,120a34,34,0,1,1,34,34A34,34,0,0,1,94,120Zm99.51,69.64a77.53,77.53,0,0,0-40-31.38,46,46,0,1,0-51,0,77.53,77.53,0,0,0-40,31.38,90,90,0,1,1,131,0Z"></path>`),lF=H(`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"></path>`),uF=H(`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28ZM68.87,198.42a68,68,0,0,1,118.26,0,91.8,91.8,0,0,1-118.26,0Zm124.3-5.55a75.61,75.61,0,0,0-44.51-34,44,44,0,1,0-41.32,0,75.61,75.61,0,0,0-44.51,34,92,92,0,1,1,130.34,0ZM128,156a36,36,0,1,1,36-36A36,36,0,0,1,128,156Z"></path>`),dF=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function fF(e,t){j(t,!0);let n=pl(),r=sa(t,iF),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=dF();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,aF())},m=e=>{var t=oF();A(),G(e,t)},h=e=>{G(e,sF())},g=e=>{G(e,cF())},_=e=>{G(e,lF())},v=e=>{G(e,uF())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var pF=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),mF=H(`<path d="M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm113.86-49.57A12,12,0,0,0,236,98.34L208.21,82.49l-.11-31.31a12,12,0,0,0-4.25-9.12,116,116,0,0,0-38-21.41,12,12,0,0,0-9.68.89L128,37.27,99.83,21.53a12,12,0,0,0-9.7-.9,116.06,116.06,0,0,0-38,21.47,12,12,0,0,0-4.24,9.1l-.14,31.34L20,98.35a12,12,0,0,0-5.85,8.11,110.7,110.7,0,0,0,0,43.11A12,12,0,0,0,20,157.66l27.82,15.85.11,31.31a12,12,0,0,0,4.25,9.12,116,116,0,0,0,38,21.41,12,12,0,0,0,9.68-.89L128,218.73l28.14,15.74a12,12,0,0,0,9.7.9,116.06,116.06,0,0,0,38-21.47,12,12,0,0,0,4.24-9.1l.14-31.34,27.81-15.81a12,12,0,0,0,5.85-8.11A110.7,110.7,0,0,0,241.86,106.43Zm-22.63,33.18-26.88,15.28a11.94,11.94,0,0,0-4.55,4.59c-.54,1-1.11,1.93-1.7,2.88a12,12,0,0,0-1.83,6.31L184.13,199a91.83,91.83,0,0,1-21.07,11.87l-27.15-15.19a12,12,0,0,0-5.86-1.53h-.29c-1.14,0-2.3,0-3.44,0a12.08,12.08,0,0,0-6.14,1.51L93,210.82A92.27,92.27,0,0,1,71.88,199l-.11-30.24a12,12,0,0,0-1.83-6.32c-.58-.94-1.16-1.91-1.7-2.88A11.92,11.92,0,0,0,63.7,155L36.8,139.63a86.53,86.53,0,0,1,0-23.24l26.88-15.28a12,12,0,0,0,4.55-4.58c.54-1,1.11-1.94,1.7-2.89a12,12,0,0,0,1.83-6.31L71.87,57A91.83,91.83,0,0,1,92.94,45.17l27.15,15.19a11.92,11.92,0,0,0,6.15,1.52c1.14,0,2.3,0,3.44,0a12.08,12.08,0,0,0,6.14-1.51L163,45.18A92.27,92.27,0,0,1,184.12,57l.11,30.24a12,12,0,0,0,1.83,6.32c.58.94,1.16,1.91,1.7,2.88A11.92,11.92,0,0,0,192.3,101l26.9,15.33A86.53,86.53,0,0,1,219.23,139.61Z"></path>`),hF=H(`<path d="M230.1,108.76,198.25,90.62c-.64-1.16-1.31-2.29-2-3.41l-.12-36A104.61,104.61,0,0,0,162,32L130,49.89c-1.34,0-2.69,0-4,0L94,32A104.58,104.58,0,0,0,59.89,51.25l-.16,36c-.7,1.12-1.37,2.26-2,3.41l-31.84,18.1a99.15,99.15,0,0,0,0,38.46l31.85,18.14c.64,1.16,1.31,2.29,2,3.41l.12,36A104.61,104.61,0,0,0,94,224l32-17.87c1.34,0,2.69,0,4,0L162,224a104.58,104.58,0,0,0,34.08-19.25l.16-36c.7-1.12,1.37-2.26,2-3.41l31.84-18.1A99.15,99.15,0,0,0,230.1,108.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z" opacity="0.2"></path><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.1,8.1,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8,8,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"></path>`,1),gF=H(`<path d="M237.94,107.21a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"></path>`),_F=H(`<path d="M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Zm108-54.4a6,6,0,0,0-2.92-4L202.64,86.22l-.42-.71L202.1,51.2A6,6,0,0,0,200,46.64a110.12,110.12,0,0,0-36.07-20.31,6,6,0,0,0-4.84.45L128.46,43.86h-1L96.91,26.76a6,6,0,0,0-4.86-.44A109.92,109.92,0,0,0,56,46.68a6,6,0,0,0-2.12,4.55l-.16,34.34c-.14.23-.28.47-.41.71L22.91,103.57A6,6,0,0,0,20,107.62a104.81,104.81,0,0,0,0,40.78,6,6,0,0,0,2.92,4l30.42,17.33.42.71.12,34.31A6,6,0,0,0,56,209.36a110.12,110.12,0,0,0,36.07,20.31,6,6,0,0,0,4.84-.45l30.61-17.08h1l30.56,17.1A6.09,6.09,0,0,0,162,230a5.83,5.83,0,0,0,1.93-.32,109.92,109.92,0,0,0,36-20.36,6,6,0,0,0,2.12-4.55l.16-34.34c.14-.23.28-.47.41-.71l30.42-17.29a6,6,0,0,0,2.92-4.05A104.81,104.81,0,0,0,236,107.6Zm-11.25,35.79L195.32,160.1a6.07,6.07,0,0,0-2.28,2.3c-.59,1-1.21,2.11-1.86,3.14a6,6,0,0,0-.91,3.16l-.16,33.21a98.15,98.15,0,0,1-27.52,15.53L133,200.88a6,6,0,0,0-2.93-.77h-.14c-1.24,0-2.5,0-3.74,0a6,6,0,0,0-3.07.76L93.45,217.43a98,98,0,0,1-27.56-15.49l-.12-33.17a6,6,0,0,0-.91-3.16c-.64-1-1.27-2.08-1.86-3.14a6,6,0,0,0-2.27-2.3L31.3,143.4a93,93,0,0,1,0-30.79L60.68,95.9A6.07,6.07,0,0,0,63,93.6c.59-1,1.21-2.11,1.86-3.14a6,6,0,0,0,.91-3.16l.16-33.21A98.15,98.15,0,0,1,93.41,38.56L123,55.12a5.81,5.81,0,0,0,3.07.76c1.24,0,2.5,0,3.74,0a6,6,0,0,0,3.07-.76l29.65-16.56a98,98,0,0,1,27.56,15.49l.12,33.17a6,6,0,0,0,.91,3.16c.64,1,1.27,2.08,1.86,3.14a6,6,0,0,0,2.27,2.3L224.7,112.6A93,93,0,0,1,224.73,143.39Z"></path>`),vF=H(`<path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"></path>`),yF=H(`<path d="M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm106-56a4,4,0,0,0-2-2.7l-30.89-17.6q-.47-.82-1-1.62L200.1,51.2a3.94,3.94,0,0,0-1.42-3,107.8,107.8,0,0,0-35.41-19.94,4,4,0,0,0-3.23.29L129,45.87h-2l-31-17.36a4,4,0,0,0-3.23-.3,108.05,108.05,0,0,0-35.39,20,4,4,0,0,0-1.41,3l-.16,34.9-1,1.62L23.9,105.3A4,4,0,0,0,22,108a102.76,102.76,0,0,0,0,40,4,4,0,0,0,1.95,2.7l30.89,17.6q.47.83,1,1.62l.12,34.87a3.94,3.94,0,0,0,1.42,3,107.8,107.8,0,0,0,35.41,19.94,4,4,0,0,0,3.23-.29L127,210.13h2l31,17.36a4,4,0,0,0,3.23.3,108.05,108.05,0,0,0,35.39-20,4,4,0,0,0,1.41-3l.16-34.9,1-1.62L232.1,150.7a4,4,0,0,0,2-2.71A102.76,102.76,0,0,0,234,108Zm-7.48,36.67L196.3,161.84a4,4,0,0,0-1.51,1.53c-.61,1.09-1.25,2.17-1.91,3.24a3.92,3.92,0,0,0-.61,2.1l-.16,34.15a99.8,99.8,0,0,1-29.7,16.77l-30.4-17a4.06,4.06,0,0,0-2-.51H130c-1.28,0-2.57,0-3.84,0a4.1,4.1,0,0,0-2.05.51l-30.45,17A100.23,100.23,0,0,1,63.89,202.9l-.12-34.12a3.93,3.93,0,0,0-.61-2.11c-.66-1-1.3-2.14-1.91-3.23a4,4,0,0,0-1.51-1.53L29.49,144.68a94.78,94.78,0,0,1,0-33.34L59.7,94.16a4,4,0,0,0,1.51-1.53c.61-1.09,1.25-2.17,1.91-3.23a4,4,0,0,0,.61-2.11l.16-34.15a99.8,99.8,0,0,1,29.7-16.77l30.4,17a4.1,4.1,0,0,0,2.05.51c1.28,0,2.57,0,3.84,0a4,4,0,0,0,2.05-.51l30.45-17A100.23,100.23,0,0,1,192.11,53.1l.12,34.12a3.93,3.93,0,0,0,.61,2.11c.66,1,1.3,2.14,1.91,3.23a4,4,0,0,0,1.51,1.53l30.25,17.23A94.78,94.78,0,0,1,226.54,144.66Z"></path>`),bF=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function xF(e,t){j(t,!0);let n=pl(),r=sa(t,pF),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=bF();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,mF())},m=e=>{var t=hF();A(),G(e,t)},h=e=>{G(e,gF())},g=e=>{G(e,_F())},_=e=>{G(e,vF())},v=e=>{G(e,yF())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}var SF=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),CF=H(`<path d="M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128ZM40,76H216a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24ZM216,180H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"></path>`),wF=H(`<path d="M216,64V192H40V64Z" opacity="0.2"></path><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path>`,1),TF=H(`<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM192,184H64a8,8,0,0,1,0-16H192a8,8,0,0,1,0,16Zm0-48H64a8,8,0,0,1,0-16H192a8,8,0,0,1,0,16Zm0-48H64a8,8,0,0,1,0-16H192a8,8,0,0,1,0,16Z"></path>`),EF=H(`<path d="M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128ZM40,70H216a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12ZM216,186H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"></path>`),DF=H(`<path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path>`),OF=H(`<path d="M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128ZM40,68H216a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8ZM216,188H40a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Z"></path>`),kF=H(`<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>`);function AF(e,t){j(t,!0);let n=pl(),r=sa(t,SF),i=N(()=>t.weight??n.weight??`regular`),a=N(()=>t.color??n.color??`currentColor`),o=N(()=>t.size??n.size??`1em`),s=N(()=>t.mirrored??n.mirrored??!1);function c(e){let{weight:t,color:n,size:r,mirrored:i,...a}=e;return a}var l=kF();Xi(l,(e,t)=>({xmlns:`http://www.w3.org/2000/svg`,role:`img`,width:B(o),height:B(o),fill:B(a),transform:B(s)?`scale(-1, 1)`:void 0,viewBox:`0 0 256 256`,...e,...t}),[()=>c(n),()=>c(r)]);var u=I(l),d=e=>{var n=W();ri(L(n),()=>t.children),G(e,n)};q(u,e=>{t.children&&e(d)});var f=R(u,2),p=e=>{G(e,CF())},m=e=>{var t=wF();A(),G(e,t)},h=e=>{G(e,TF())},g=e=>{G(e,EF())},_=e=>{G(e,DF())},v=e=>{G(e,OF())},y=e=>{var t=U();t.nodeValue=(console.error(`Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".`),``),G(e,t)};q(f,e=>{B(i)===`bold`?e(p):B(i)===`duotone`?e(m,1):B(i)===`fill`?e(h,2):B(i)===`light`?e(g,3):B(i)===`regular`?e(_,4):B(i)===`thin`?e(v,5):e(y,-1)}),k(l),G(e,l),M()}function jF(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t>0?`${t}h ${n}m`:`${n}m`}var MF=V(`<div data-testid="auth-error" role="alert" class="mb-4 rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive">That token was rejected. Copy a fresh one from the daemon's output.</div>`),NF=V(`<div class="relative min-h-screen overflow-hidden bg-black"><!> <div class="relative z-10 flex items-end sm:items-center justify-center min-h-screen p-4 pb-[15vh] sm:pb-4 sm:pt-[20vh]"><div class="w-full max-w-sm animate-fade-in"><div class="bg-card/75 backdrop-blur-md border border-border/50 rounded-xl p-6 shadow-2xl shadow-black/40"><!> <p class="text-sm text-muted-foreground mb-5">Paste the auth token from the daemon output to connect.</p> <form><!> <!></form></div> <div class="flex justify-center gap-1 mt-6 opacity-80"></div></div></div></div>`),PF=V(`<span class="ml-auto text-[10px] font-mono text-muted-foreground"> </span>`),FF=V(`<button><!> <!> <!> <!></button>`),IF=V(`<div class="flex justify-between"><span>Signal</span> <span class="text-success">connected</span></div>`),LF=V(`<div class="px-4 py-3 border-t border-border text-[11px] text-muted-foreground space-y-1.5 font-mono"><div class="flex justify-between"><span>Uptime</span> <span class="text-foreground/70"> </span></div> <div class="flex justify-between"><span>Jobs</span> <span class="text-foreground/70"> </span></div> <!></div>`),RF=V(`<button class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-all"><!> </button>`),zF=V(`<div class="flex items-center justify-between w-full"><div><div class="font-medium"> </div> <div class="text-[11px] text-muted-foreground"> </div></div> <!></div>`),BF=V(`<div class="px-4 py-4 border-b border-border"><div class="flex items-center gap-2.5"><div class="w-7 h-7 rounded-lg bg-primary/15 flex items-center justify-center shrink-0"><!></div> <div><span class="text-sm font-semibold tracking-tight">IronCurtain</span> <div data-testid="connection-status" class="flex items-center gap-1.5 mt-0.5"><span></span> <span class="text-[10px] text-muted-foreground uppercase tracking-wider"> </span></div></div></div></div> <div class="flex-1 py-2 px-2 space-y-0.5"></div> <!> <div class="px-2 py-2 border-t border-border"><!></div>`,1),VF=V(`<div data-testid="drawer-backdrop" class="md:hidden fixed inset-0 z-40 bg-black/50" aria-hidden="true"></div>`),HF=V(`<div class="flex flex-col md:flex-row h-screen theme-transition overflow-hidden"><div class="flex md:hidden items-center justify-between px-4 py-3 bg-sidebar border-b border-border shrink-0"><div class="flex items-center gap-2.5"><div class="w-7 h-7 rounded-lg bg-primary/15 flex items-center justify-center shrink-0"><!></div> <span class="text-sm font-semibold tracking-tight">IronCurtain</span></div> <button aria-label="Open menu" class="p-2 rounded-lg text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-all"><!></button></div> <nav data-testid="sidebar-nav" class="hidden md:flex w-56 bg-sidebar border-r border-border flex-col shrink-0"><!></nav> <!> <div role="dialog" aria-label="Main navigation"><nav class="flex flex-col h-full"><div class="flex justify-end px-2 pt-2"><button aria-label="Close menu" class="p-2 rounded-lg text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-all"><!></button></div> <!></nav></div> <main class="flex-1 min-h-0 overflow-y-auto"><!></main> <!></div>`);function UF(e,t){j(t,!0);let n=P(``),r=P(`iron`),i=P(!1),a=P(!1),o=P(!1),s=null;function c(){F(o,!1)}function l(e){B(o)&&e.key===`Escape`&&F(o,!1)}function u(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}let d=P(on(u())),f=N(()=>B(d)?0:2300);Mn(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=e=>{F(d,e.matches,!0)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}),Mn(()=>{let e=J.escalationDisplayNumber>J.escalationDismissedAt,t=J.pendingEscalations.size,n=J.currentView===`escalations`;t===0?(F(a,!1),s?.(),s=null):e&&!n&&(F(a,!0),document.hidden&&(s?.(),s=zP(`Action Required - Escalation`)))});function p(){J.escalationDismissedAt=J.escalationDisplayNumber,F(a,!1),s?.(),s=null}async function m(e,t,n){try{await $a(e,t,n)}catch(e){throw console.error(`Failed to resolve escalation from modal:`,e),e}J.pendingEscalations.size===0&&F(a,!1)}function h(e){p(),J.currentView=`sessions`,J.selectedSessionLabel=e}ii(()=>{F(r,ka(),!0),document.documentElement.setAttribute(`data-theme`,B(r)),Qa()});function g(e){e.preventDefault();let t=B(n).trim();t&&Vo(t)}function _(e){F(r,e,!0),Aa(e),F(i,!1)}let v=[{id:`iron`,label:`Iron`,desc:`Dark charcoal + amber`},{id:`daylight`,label:`Daylight`,desc:`Warm light + teal`},{id:`midnight`,label:`Midnight`,desc:`Deep navy + blue`}],y=[{id:`dashboard`,label:`Dashboard`,icon:JP},{id:`sessions`,label:`Sessions`,icon:Sl},{id:`escalations`,label:`Escalations`,icon:jl},{id:`jobs`,label:`Jobs`,icon:Bl},{id:`workflows`,label:`Workflows`,icon:pu},{id:`personas`,label:`Personas`,icon:fF},{id:`settings`,label:`Settings`,icon:xF}];var b=W();Pr(`keydown`,ln,l);var x=L(b),S=e=>{var t=NF(),i=I(t);LP(i,{class:`absolute inset-0 z-0`,word:`IronCurtain`,get reducedMotion(){return B(d)}});var a=R(i,2),o=I(a),s=I(o),c=I(s),l=e=>{G(e,MF())};q(c,e=>{J.authError===`invalid_token`&&e(l)});var u=R(c,4),p=I(u);Ad(p,{type:`text`,placeholder:`Auth token...`,class:`font-mono`,get value(){return B(n)},set value(e){F(n,e,!0)}}),Dd(R(p,2),{type:`submit`,class:`w-full mt-3`,children:(e,t)=>{A(),G(e,U(`Connect`))},$$slots:{default:!0}}),k(u),k(s);var m=R(s,2);fi(m,21,()=>v,e=>e.id,(e,t)=>{{let n=N(()=>B(r)===B(t).id?`bg-primary/15 text-primary font-medium`:`text-white/60`);Dd(e,{variant:`ghost`,size:`sm`,onclick:()=>_(B(t).id),get class(){return B(n)},children:(e,n)=>{A();var r=U();z(()=>K(r,B(t).label)),G(e,r)},$$slots:{default:!0}})}}),k(m),k(o),k(a),k(t),z(()=>Mi(o,`animation-delay: ${B(f)??``}ms; animation-fill-mode: both; opacity: 0;`)),Pr(`submit`,u,g),G(e,t)},C=e=>{let t=e=>{var t=BF(),n=L(t),a=I(n),o=I(a);iu(I(o),{size:16,class:`text-primary`,weight:`duotone`}),k(o);var s=R(o,2),l=R(I(s),2),u=I(l),d=R(u,2),f=I(d,!0);k(d),k(l),k(s),k(a),k(n);var p=R(n,2);fi(p,21,()=>y,e=>e.id,(e,t)=>{var n=FF(),r=I(n);yi(r,()=>B(t).icon,(e,t)=>{t(e,{size:16,class:`shrink-0`})});var i=R(r),a=R(i),o=e=>{Oc(e,{variant:`destructive`,class:`ml-auto px-1.5 font-mono font-semibold min-w-[18px] text-center text-[10px] leading-none`,children:(e,t)=>{A();var n=U();z(()=>K(n,J.escalationCount)),G(e,n)},$$slots:{default:!0}})};q(a,e=>{B(t).id===`escalations`&&J.escalationCount>0&&e(o)});var s=R(a,2),l=e=>{Oc(e,{variant:`warning`,class:`ml-auto px-1.5 font-mono font-semibold min-w-[18px] text-center text-[10px] leading-none`,children:(e,t)=>{A();var n=U();z(()=>K(n,J.pendingGates.size)),G(e,n)},$$slots:{default:!0}})};q(s,e=>{B(t).id===`workflows`&&J.pendingGates.size>0&&e(l)});var u=R(s,2),d=e=>{var t=PF(),n=I(t,!0);k(t),z(()=>K(n,J.activeSessionCount)),G(e,t)};q(u,e=>{B(t).id===`sessions`&&J.activeSessionCount>0&&e(d)}),k(n),z(()=>{Ji(n,`aria-current`,J.currentView===B(t).id?`page`:void 0),Ai(n,1,`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all
|
|
113
|
+
${J.currentView===B(t).id?`bg-accent text-accent-foreground font-medium shadow-sm`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`}`),K(i,` ${B(t).label??``} `)}),Fr(`click`,n,()=>{J.currentView=B(t).id,c()}),G(e,n)}),k(p);var m=R(p,2),h=e=>{var t=LF(),n=I(t),r=R(I(n),2),i=I(r,!0);k(r),k(n);var a=R(n,2),o=R(I(a),2),s=I(o);k(o),k(a);var c=R(a,2),l=e=>{G(e,IF())};q(c,e=>{J.daemonStatus.signalConnected&&e(l)}),k(t),z(e=>{K(i,e),K(s,`${J.daemonStatus.jobs.enabled??``}/${J.daemonStatus.jobs.total??``}`)},[()=>jF(J.daemonStatus.uptimeSeconds)]),G(e,t)};q(m,e=>{J.daemonStatus&&e(h)});var g=R(m,2);NN(I(g),{align:`top-left`,contentClass:`w-48`,class:`w-full`,get open(){return B(i)},set open(e){F(i,e,!0)},trigger:e=>{var t=RF(),n=I(t);rF(n,{size:16,class:`shrink-0`});var a=R(n);k(t),z(e=>K(a,` Theme: ${e??``}`),[()=>v.find(e=>e.id===B(r))?.label]),Fr(`click`,t,()=>F(i,!B(i))),G(e,t)},children:(e,t)=>{var n=W();fi(L(n),17,()=>v,e=>e.id,(e,t)=>{{let n=N(()=>B(r)===B(t).id);IN(e,{get active(){return B(n)},onclick:()=>_(B(t).id),class:`py-2.5`,children:(e,n)=>{var i=zF(),a=I(i),o=I(a),s=I(o,!0);k(o);var c=R(o,2),l=I(c,!0);k(c),k(a);var u=R(a,2),d=e=>{QA(e,{size:16,class:`text-primary shrink-0`})};q(u,e=>{B(r)===B(t).id&&e(d)}),k(i),z(()=>{K(s,B(t).label),K(l,B(t).desc)}),G(e,i)},$$slots:{default:!0}})}}),G(e,n)},$$slots:{trigger:!0,default:!0}}),k(g),z(()=>{Ai(u,1,`inline-flex rounded-full h-2 w-2 ${J.connected?`bg-success`:`bg-destructive`}`),K(f,J.connected?`Live`:`Offline`)}),G(e,t)};var n=HF(),s=I(n),l=I(s),u=I(l);iu(I(u),{size:16,class:`text-primary`,weight:`duotone`}),k(u),A(2),k(l);var d=R(l,2);AF(I(d),{size:20}),k(d),k(s);var f=R(s,2);t(I(f)),k(f);var g=R(f,2),b=e=>{var t=VF();Fr(`click`,t,c),G(e,t)};q(g,e=>{B(o)&&e(b)});var x=R(g,2),S=I(x),C=I(S),w=I(C);Sk(I(w),{size:18}),k(w),k(C),t(R(C,2)),k(S),k(x);var T=R(x,2),ee=I(T),E=e=>{Cd(e,{})},te=e=>{wb(e,{})},ne=e=>{Rb(e,{})},re=e=>{$b(e,{})},ie=e=>{jj(e,{})},ae=e=>{bM(e,{})},D=e=>{AN(e,{})};q(ee,e=>{J.currentView===`dashboard`?e(E):J.currentView===`sessions`?e(te,1):J.currentView===`escalations`?e(ne,2):J.currentView===`jobs`?e(re,3):J.currentView===`workflows`?e(ie,4):J.currentView===`personas`?e(ae,5):J.currentView===`settings`&&e(D,6)}),k(T),VN(R(T,2),{get open(){return B(a)},get escalations(){return J.pendingEscalations},onclose:p,onresolve:m,onviewsession:h}),k(n),z(()=>{Ji(d,`aria-expanded`,B(o)),Ai(x,1,`md:hidden fixed inset-y-0 left-0 z-50 w-64 bg-sidebar border-r border-border shadow-xl transition-transform duration-200 ease-out
|
|
114
|
+
${B(o)?`translate-x-0`:`-translate-x-full`}`),Ji(x,`aria-modal`,B(o)?`true`:void 0),Ji(x,`aria-hidden`,B(o)?void 0:`true`)}),Fr(`click`,d,()=>F(o,!B(o))),Fr(`click`,w,c),G(e,n)};q(x,e=>{!J.connected&&!J.hasToken?e(S):e(C,-1)}),G(e,b),M()}Ir([`click`]),Qr(UF,{target:document.getElementById(`app`)});
|