@qqbrowser/qbot-dsh 0.0.10 → 0.0.12
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/lib/bin.js +1 -1
- package/lib/{dump-config-BD79jvHi.js → dump-config-xQTUTTDD.js} +1 -1
- package/lib/{plugin-B3Ecl7VN.js → plugin-DNAeLZbb.js} +1 -1
- package/lib/profile-boot-BkordgJK.js +1 -0
- package/node_modules/@deepseek-ai/cordis/package.json +1 -1
- package/node_modules/@deepseek-ai/cordis-plugin-hmr/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/cordis-plugin-hmr/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-agent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-instructions/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-presets/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +12 -12
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +4 -4
- package/node_modules/@deepseek-ai/dsh-base/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-bash-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-brand/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-connection/lib/client.js +6 -6
- package/node_modules/@deepseek-ai/dsh-client-connection/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-hmr/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-runtime/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-runtime/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-schema-form/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/index.js +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-web/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-web-react/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-web-react/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-code-runtime/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-code-runtime-worker-thread/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-code-runtime-worker-thread/lib/worker.cjs +4 -2
- package/node_modules/@deepseek-ai/dsh-code-runtime-worker-thread/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-commands/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-content-review/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +7 -7
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-local/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-headless/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-apiproxy/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-host-apiproxy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/lib/worker.cjs +9 -7
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-invariants/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/lib/invariant.js +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-output-retention/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-persona/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-pwsh-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-qb-auth/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-qb-auth/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/runner.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types-D2_FQYSK.js +1 -0
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-scope/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session/lib/invariant.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-reference/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title-llm/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-settings/lib/invariant.js +1 -1
- package/node_modules/@deepseek-ai/dsh-settings/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-settings-file/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-shell/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-skill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-spill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-spill-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-spill-policy/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-domain/lib/invariant.js +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-terminal-bash/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-time-context/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-time-context/lib/invariant.js +1 -1
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-token-meter/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ralph/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/lib/index.js +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent-report/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-workflow/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tools/lib/index.js +26 -26
- package/node_modules/@deepseek-ai/dsh-tools/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-web/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{index-Dqw48FrP.js → index-BQQQ5Qt-.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/cpp-DddhVWhK.js +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{php-D-uCvoST.js → php-9bx0az3O.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{ruby-DEItuUFs.js → ruby-HDLHRjSL.js} +1 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/swift-C2oV4EkX.js +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{vendor-Cjbwl5VI.js → vendor-CeMKrCZm.js} +24 -24
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/LICENSE +21 -0
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/lib/invariant.js +1 -0
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +1 -0
- package/node_modules/@deepseek-ai/dsh-web-search-dsh/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-web-search-dsh/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow-worker-thread/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-workflow-worker-thread/lib/worker.cjs +3 -4
- package/node_modules/@deepseek-ai/dsh-workflow-worker-thread/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-workspace/lib/invariant.js +1 -1
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +1 -1
- package/node_modules/@deepseek-ai/node-addon-landlock-run/package.json +1 -1
- package/package.json +1 -1
- package/lib/profile-boot-_PCyp_wB.js +0 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types-BjBvdldw.js +0 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/cpp-DIPi6g--.js +0 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/swift-D82vCrfD.js +0 -1
- /package/lib/{profile-boot-B71dQloK.js → profile-boot-DDo03lXi.js} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var Sa=Object.defineProperty;var a=($e,yt)=>Sa($e,"name",{value:yt,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-trajectory",factory:a($e=>{var yt={exports:{}},Lt=yt.exports;Object.defineProperty(Lt,Symbol.toStringTag,{value:"Module"});var Ps=Object.create,xn=Object.defineProperty,Os=Object.getOwnPropertyDescriptor,As=Object.getOwnPropertyNames,Ls=Object.getPrototypeOf,$s=Object.prototype.hasOwnProperty,zs=a((e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=As(t),i=0,l=r.length,u;i<l;i++)u=r[i],!$s.call(e,u)&&u!==n&&xn(e,u,{get:(p=>t[p]).bind(null,u),enumerable:!(s=Os(t,u))||s.enumerable});return e},"__copyProps"),Ws=a((e,t,n)=>(n=e!=null?Ps(Ls(e)):{},zs(t||!e||!e.__esModule?xn(n,"default",{value:e,enumerable:!0}):n,e)),"__toESM");let je=$e("@deepseek-ai/dsh-client-runtime/client"),o=$e("react/jsx-runtime"),y=$e("react");y=Ws(y,1);let Hs=$e("react-dom"),ee=$e("@deepseek-ai/dsh-client-ui-primitives");function Fs(){return(0,je.createSnapshotStore)(!1,{persist:{name:"dsh.trajectory.duration"}})}a(Fs,"createTrajectoryDurationStore");const $t="trajectory",Xs={"view.trajectory":"轨迹","toolbar.aria":"轨迹工具栏","toolbar.duration":"Duration","toolbar.useActualDuration":"Use actual duration","toolbar.useEqualWidth":"Use equal-width operations","toolbar.actualTime":"实际时间","toolbar.turns":"Turns","toolbar.expandTurns":"Expand turns","toolbar.collapseTurns":"Collapse turns","toolbar.calls":"Calls","toolbar.expandCalls":"Expand calls","toolbar.collapseCalls":"Collapse calls","toolbar.search":"搜索轨迹","toolbar.searchPlaceholder":"搜索"},Ys={"view.trajectory":"Trajectory","toolbar.aria":"Trajectory toolbar","toolbar.duration":"Duration","toolbar.useActualDuration":"Use actual duration","toolbar.useEqualWidth":"Use equal-width operations","toolbar.actualTime":"Actual time","toolbar.turns":"Turns","toolbar.expandTurns":"Expand turns","toolbar.collapseTurns":"Collapse turns","toolbar.calls":"Calls","toolbar.expandCalls":"Expand calls","toolbar.collapseCalls":"Collapse calls","toolbar.search":"Search trajectory","toolbar.searchPlaceholder":"Search"};function ze(e,t,n){return{key:e.key,kind:e.kind,id:e.id,target:"trajectory",anchorSeq:t,location:e.start?.location??{kind:"unresolved"},data:n}}a(ze,"trajectoryNode");function bt(e,t,n,s,r){return{turn:e,step:t,startSeq:n,startTime:s,started:r,sawChunk:!1,blocks:[],firstVisibleSeq:void 0,firstVisibleTime:void 0,firstTokenTime:void 0,final:void 0,usage:void 0,retry:void 0,stepEnd:void 0}}a(bt,"initialState");function zt(e){return e.filter(t=>t!==void 0)}a(zt,"compactBlocks");function Js(e){return e.some(t=>t.kind==="tool-call"?!1:t.kind==="text"||t.kind==="reasoning"?t.text.trim()!=="":!0)}a(Js,"hasVisibleContent");function Us(e){return e.some(t=>t.kind==="text"||t.kind==="reasoning"?t.text.trim()!=="":!0)}a(Us,"hasInterruptionEvidence");function Qs(e,t){return{inputTokens:(e?.inputTokens??0)+t.inputTokens,outputTokens:(e?.outputTokens??0)+t.outputTokens,...e?.cacheReadTokens===void 0&&t.cacheReadTokens===void 0?{}:{cacheReadTokens:(e?.cacheReadTokens??0)+(t.cacheReadTokens??0)},...e?.cacheWriteTokens===void 0&&t.cacheWriteTokens===void 0?{}:{cacheWriteTokens:(e?.cacheWriteTokens??0)+(t.cacheWriteTokens??0)},...e?.reasoningTokens===void 0&&t.reasoningTokens===void 0?{}:{reasoningTokens:(e?.reasoningTokens??0)+(t.reasoningTokens??0)}}}a(Qs,"addUsage$1");function yn(e,t){if(t.event.type!=="assistant/chunk")return e;const n=t.event.data.chunk;if(n.type==="usage")return{...e,sawChunk:!0,usage:Qs(e.usage,n.usage)};const s=[...e.blocks];switch(n.type){case"block-start":s[n.index]=(0,je.emptyAssistantBlock)(n.blockType);break;case"text-delta":{const i=s[n.index];s[n.index]={kind:"text",text:(i?.kind==="text"?i.text:"")+n.text};break}case"reasoning-delta":{const i=s[n.index];s[n.index]={kind:"reasoning",text:(i?.kind==="reasoning"?i.text:"")+n.text};break}case"tool-call-delta":{const i=s[n.index],l=i?.kind==="tool-call"?i:{kind:"tool-call",callId:"",name:"",argsRaw:""};s[n.index]={kind:"tool-call",callId:l.callId||String(n.id),name:n.name??l.name,argsRaw:l.argsRaw+n.argumentsDelta};break}case"block-end":s[n.index]=(0,je.toAssistantBlock)(n.block);break;default:return{...e,sawChunk:!0}}const r=Js(zt(s));return{...e,sawChunk:!0,blocks:s,...r&&e.firstVisibleSeq===void 0?{firstVisibleSeq:t.event.seq,firstVisibleTime:t.event.time}:{},...(0,je.isTokenDelta)(n)&&e.firstTokenTime===void 0?{firstTokenTime:t.event.time}:{}}}a(yn,"updateChunk");function bn(e){if(e.state?.stepEnd?.event.type==="step/end")return e.state.stepEnd.event;const t=e.start?.location??e.matches.at(-1)?.location;if(t?.kind==="step"&&t.step.status==="closed")return t.step.end;if((t?.kind==="step"||t?.kind==="turn")&&t.turn.status==="closed")return t.turn.end}a(bn,"closedBoundary");function Ks(e){let t;for(const n of e.matches){const s=n.event;s.type==="assistant/chunk"?(t??=bt(s.data.turn,s.data.step,s.seq,s.time,!1),t=yn(t,n)):s.type==="assistant/message"?(t??=bt(s.data.turn,s.data.step,s.seq,s.time,!1),t={...t,blocks:(0,je.toAssistantBlocks)(s.data.message.content),final:n,usage:t.usage??s.data.usage}):s.type==="step/end"&&t!==void 0&&(t={...t,stepEnd:n})}return t}a(Ks,"fallbackState$1");function Zs(e,t){const n=e.final;if(n?.event.type==="assistant/message"){const i=n.event;return{kind:"assistant",seq:i.seq,messageId:i.data.message.id,time:i.time,turn:e.turn,step:e.step,blocks:(0,je.toAssistantBlocks)(i.data.message.content),usage:i.data.usage,provenance:{provider:i.data.message.source.provider,model:i.data.message.source.model},timing:{stepStartTime:e.started?e.startTime:null,firstTokenTime:e.firstTokenTime??null,completedTime:i.time}}}const s=bn(t),r=zt(e.blocks);if(!(s===void 0||!Us(r)))return{kind:"assistant",seq:s.seq-.9,time:s.time,turn:e.turn,step:e.step,blocks:r,interrupted:!0}}a(Zs,"finalNode");function er(e,t,n){if(!e.started)return;const s=t!==void 0&&t.interrupted!==!0?"complete":e.retry!==void 0||n!==void 0?"error":"running";return{purpose:"assistant",startSeq:e.startSeq,turn:e.turn,step:e.step,startedAt:e.startTime,completedAt:t?.time??n?.time??null,status:s,...e.retry===void 0?{}:{error:e.retry.message,retry:e.retry.retry,...e.retry.maxRetries===void 0?{}:{maxRetries:e.retry.maxRetries},retryDelayMs:e.retry.delayMs},...t===void 0||t.interrupted===!0?{}:{resultSeq:t.seq,...t.provenance===void 0?{}:{provenance:t.provenance}},...e.usage===void 0?{}:{usage:e.usage}}}a(er,"assistantRequest");const tr={kind:"trajectory-assistant-step",target:"trajectory",match:a(e=>e.type==="step/start"?{id:`${e.data.turn}:${e.data.step}`,role:"start"}:e.type==="assistant/chunk"||e.type==="assistant/message"||e.type==="llm/retry"||e.type==="step/end"?{id:`${e.data.turn}:${e.data.step}`,role:"update"}:null,"match"),start:a((e,t)=>{if(t.event.type!=="step/start")throw new Error("trajectory-assistant-step start requires step/start");return bt(t.event.data.turn,t.event.data.step,t.event.seq,t.event.time,!0)},"start"),update:a((e,t)=>{if(t.event.type==="assistant/chunk")return yn(e.state,t);if(t.event.type==="assistant/message")return{...e.state,blocks:(0,je.toAssistantBlocks)(t.event.data.message.content),final:t,usage:e.state.usage??t.event.data.usage};if(t.event.type==="step/end")return{...e.state,stepEnd:t};if(t.event.type!=="llm/retry")return e.state;const n=t.event.data;return{...bt(e.state.turn,e.state.step,e.state.startSeq,e.state.startTime,!0),firstTokenTime:e.state.firstTokenTime,usage:e.state.usage,retry:{message:(0,je.displayFailureMessage)(n.failure),retry:n.retry,...n.mode==="normal"?{maxRetries:n.maxRetries}:{},delayMs:n.delayMs}}},"update"),publication:a(e=>{if(e.event.type==="step/start")return"none";if(e.event.type!=="assistant/chunk")return"immediate";const t=e.event.data.chunk.type;return t==="usage"||t==="finish"?"none":"animation-frame"},"publication"),buildViewNode:a(e=>{const t=e.state??Ks(e);if(t===void 0)return null;const n=Zs(t,e),s=bn(e),r=n===void 0&&s===void 0&&t.sawChunk?{turn:t.turn,step:t.step,blocks:zt(t.blocks)}:null,i=er(t,n,s);return n===void 0&&r===null&&i===void 0?null:ze(e,t.startSeq,{kind:"assistant",...n===void 0?{}:{node:n},partial:r,...i===void 0?{}:{request:i}})},"buildViewNode")},nr={kind:"trajectory-turn-end",target:"trajectory",match:a(e=>e.type==="turn/end"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t)=>{if(t.event.type!=="turn/end")throw new Error("trajectory-turn-end start requires turn/end");const n=t.event.data.reason;return{turn:t.event.data.turn,seq:t.event.seq,time:t.event.time,...n.kind==="error"?{error:(0,je.displayFailureMessage)(n.error)}:{}}},"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:ze(e,e.state.seq,{kind:"turn-end",turn:e.state.turn,time:e.state.time,...e.state.error===void 0?{}:{error:e.state.error}}),"buildViewNode")};function sr(e){e.conversationEvents.register(tr),e.conversationEvents.register(nr)}a(sr,"registerTrajectoryAssistantDefinition");function wn(e){if(e.type!=="user/message")return;const t=e.data.source;return t.kind==="plugin"&&t.plugin==="compact"&&typeof t.compactionId=="string"&&t.compactionId!==""?t.compactionId:void 0}a(wn,"checkpointId");function rr(e){if(e.type!=="compaction/start"&&e.type!=="compaction/summary"&&e.type!=="compaction/end")return;const t=e.data.compactionId;return typeof t=="string"&&t!==""?t:void 0}a(rr,"eventCompactionId");function or(e){const t=e.start.event;if(t.type!=="compaction/start")return;const n=e.summary?.event,s=e.end?.event,r=e.checkpoint?.event;return{purpose:"compaction",startSeq:t.seq,turn:t.data.turn,step:0,startedAt:t.time,completedAt:s?.type==="compaction/end"?s.time:null,status:s?.type!=="compaction/end"?"running":s.data.error===void 0?"complete":"error",...s?.type==="compaction/end"&&s.data.error!==void 0?{error:s.data.error}:{},...n?.type!=="compaction/summary"?{}:{resultSeq:n.seq,summary:n.data.summary,...n.data.rawOutput===void 0?{}:{rawOutput:n.data.rawOutput},provenance:{provider:n.data.provider,model:n.data.model},requestConfig:{provider:n.data.provider,model:n.data.model,purpose:"compaction",...n.data.maxTokens===void 0?{}:{maxTokens:n.data.maxTokens}},...n.data.usage===void 0?{}:{usage:n.data.usage}},...r?.type==="user/message"?{replacementSeq:r.seq}:{}}}a(or,"requestFromState");const ir={kind:"trajectory-compaction",target:"trajectory",match:a(e=>{const t=rr(e);if(t!==void 0)return{id:t,role:e.type==="compaction/start"?"start":"update"};const n=wn(e);return n===void 0?null:{id:n,role:"update"}},"match"),start:a((e,t)=>{if(t.event.type!=="compaction/start")throw new Error("trajectory-compaction start requires compaction/start");return{start:t}},"start"),update:a((e,t)=>t.event.type==="compaction/summary"?{...e.state,summary:t}:t.event.type==="compaction/end"?{...e.state,end:t}:wn(t.event)===void 0?e.state:{...e.state,checkpoint:t},"update"),buildViewNode:a(e=>{if(e.state===void 0)return null;const t=or(e.state);return t===void 0?null:ze(e,t.startSeq,{kind:"compaction",request:t})},"buildViewNode")},ar={kind:"trajectory-session-end",target:"trajectory",match:a(e=>e.type==="session/end-seed"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t)=>({seq:t.event.seq,time:t.event.time}),"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:ze(e,e.state.seq,{kind:"session-end",seq:e.state.seq,time:e.state.time}),"buildViewNode")};function lr(e){e.conversationEvents.register(ir),e.conversationEvents.register(ar)}a(lr,"registerTrajectoryCompactionDefinitions");function cr(e,t){const n=[...e?.state.pending??[]],s=new Set(e?.state.claimed??[]),r=n.splice(t.start,t.removedCount??0,...t.inserted);for(const i of t.inserted)s.delete(i.id);if(t.outcome!=="canceled")for(const i of r)s.add(i.id);return{pending:n,claimed:s}}a(cr,"applySplice");const dr={kind:"trajectory-inbox-next-step",match:a(e=>e.type==="agent/inbox/spliced"&&e.data.target==="next-step"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t,n)=>{if(t.event.type!=="agent/inbox/spliced")throw new Error("trajectory-inbox-next-step start requires agent/inbox/spliced");return cr(n.previous("trajectory-inbox-next-step"),t.event.data)},"start"),update:a(e=>e.state,"update"),publication:a(()=>"none","publication")},ur={kind:"trajectory-input-message",target:"trajectory",match:a(e=>e.type==="user/message"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t,n)=>{if(t.event.type!=="user/message")throw new Error("trajectory-input-message start requires user/message");const s=t.event;return s.data.source.kind!=="user"?{kind:"context",seq:s.seq,time:s.time,content:s.data.content,source:s.data.source,provenance:(0,je.contextProvenance)(s.data.source),form:(0,je.contextForm)(s.data.source)}:n.previous("trajectory-inbox-next-step")?.state.claimed.has(String(s.data.id))===!0?{kind:"steering",messageId:s.data.id,seq:s.seq,time:s.time,content:s.data.content,source:s.data.source}:{kind:"user",seq:s.seq,time:s.time,content:s.data.content,source:s.data.source}},"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:ze(e,e.state.seq,{kind:"node",node:e.state}),"buildViewNode")};function pr(e){e.conversationEvents.register(dr),e.conversationEvents.register(ur)}a(pr,"registerTrajectoryMessageDefinitions");function hr(e){if(e.event.type!=="request/header")throw new Error("trajectory-request-header start requires request/header");const t=e.event.data.header,n=t.tools;return{config:t.config,system:t.system??"",tools:Array.isArray(n)?n:[]}}a(hr,"requestPrompt");function fr(e,t,n){if(n.event.type!=="request/header"||e===void 0&&n.event.data.reason!=="initial")return;const s=e!==void 0&&e.system!==t.system,r=e!==void 0&&JSON.stringify(e.tools)!==JSON.stringify(t.tools);if(!(e!==void 0&&!s&&!r))return{seq:n.event.seq,time:n.event.time,kind:e===void 0?"initial":s&&r?"system-and-tools":s?"system":"tools",...e===void 0?{}:{previous:e}}}a(fr,"promptChange");const mr={kind:"trajectory-request-header",target:"trajectory",match:a(e=>e.type==="request/header"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t,n)=>{const s=hr(t),r=n.previous("trajectory-request-header")?.state.prompt,i=fr(r,s,t);return{seq:t.event.seq,time:t.event.time,prompt:s,location:t.location,...i===void 0?{}:{change:i}}},"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:ze(e,e.state.seq,{kind:"request-header",header:e.state}),"buildViewNode")};function gr(e){e.conversationEvents.register(mr)}a(gr,"registerTrajectoryRequestHeaderDefinition");const Wt=[],Vn={eventNodes:Wt,eventLocations:new Map,requests:Wt,callSchemas:new Map,partial:null,runningCalls:Wt};function _n(e,t){return`${e}\0${t}`}a(_n,"stepKey");function vr(e){const t=e.location;return t.kind==="step"?_n(t.turn.turn,t.step.step):void 0}a(vr,"headerStepKey");function xr(e,t,n){return t.get(_n(e.turn,e.step))??(n!==void 0&&n.seq<e.startSeq?n:void 0)}a(xr,"headerFor");function yr(e,t,n){return t===void 0?e:{...e,prompt:t.prompt,requestConfig:t.prompt.config,...n&&t.change!==void 0?{promptChange:t.change}:{}}}a(yr,"applyHeader");function br(e,t){return t===void 0?e:{...e,requestConfig:t.config}}a(br,"withRequestConfig");function Nn(e,t,n){const s="kind"in e?e.call?.name:e.name,r=s===void 0?void 0:t.get(s);r!==void 0&&n.set(e.callId,r);for(const i of e.subCalls)Nn(i,t,n)}a(Nn,"captureSchemas");function wr(e){return new Map(e.map(t=>[t.name,t]))}a(wr,"indexTools");function Vr(e,t){let n=0;const s=[];for(const r of t){for(;n<e.length;){const u=e[n];if(u===void 0||u.startSeq>=r.seq)break;u.purpose==="compaction"&&u.status==="running"&&s.push(n),n++}let i=s.pop();for(;i!==void 0&&e[i]?.status!=="running";)i=s.pop();if(i===void 0)continue;const l=e[i];l?.purpose==="compaction"&&(e[i]={...l,completedAt:r.time,status:"error",error:"Compaction was interrupted before completion."})}}a(Vr,"interruptCompactions");function _r(e,t){const n=new Map;for(const[s,r]of e.entries())r.purpose==="assistant"&&n.set(r.turn,s);for(const s of t){if(s.error===void 0)continue;const r=n.get(s.turn);if(r===void 0)continue;const i=e[r];i?.purpose==="assistant"&&(e[r]={...i,completedAt:i.completedAt??s.time,status:"error",error:s.error})}}a(_r,"applyTurnErrors");var Nr=class{static{a(this,"TrajectorySnapshotBuilder")}nodes=new Map;positions=new Map;contributions=[];empty=Vn;replace(e){this.nodes.clear();for(const t of e.nodes)this.nodes.set(t.key,t);return this.rebuildContributions(),this.snapshot()}apply(e){let t=!1;for(const n of e.upserts){const s=this.nodes.get(n.key);if(this.nodes.set(n.key,n),s===void 0||s.anchorSeq!==n.anchorSeq){t=!0;continue}const r=this.positions.get(n.key);r===void 0?t=!0:this.contributions[r]=n}return t&&this.rebuildContributions(),this.snapshot()}snapshot(){const e=new Map;for(const b of this.contributions){if(b.data.kind!=="request-header")continue;const v=vr(b.data.header);v!==void 0&&e.set(v,b.data.header)}const t=[],n=new Map,s=[],r=[],i=[],l=new Map,u=new Set;let p,f=new Map,m=null;const h=[];for(const b of this.contributions){const v=b.data;if(v.kind==="request-header"){p=v.header,f=wr(v.header.prompt.tools);continue}if(v.kind==="node"){t.push(v.node),n.set(v.node.seq,b.location);continue}if(v.kind==="assistant"){const T=v.request===void 0?void 0:xr(v.request,e,p);if(v.node!==void 0&&t.push(br(v.node,T?.prompt)),v.partial!==null&&(m=v.partial),v.request!==void 0){const k=T?.change!==void 0&&!u.has(T.seq);s.push(yr(v.request,T,k)),k&&u.add(T.seq)}continue}if(v.kind==="tool"){"kind"in v.root?t.push(v.root):h.push(v.root),p!==void 0&&p.seq<b.anchorSeq&&Nn(v.root,f,l);continue}if(v.kind==="compaction"){s.push(v.request);continue}if(v.kind==="session-end"){r.push({seq:v.seq,time:v.time});continue}i.push({turn:v.turn,time:v.time,...v.error===void 0?{}:{error:v.error}})}return s.sort((b,v)=>b.startSeq-v.startSeq),Vr(s,r),_r(s,i),t.sort((b,v)=>b.seq-v.seq),{eventNodes:t,eventLocations:n,requests:s,callSchemas:l,partial:m,runningCalls:h}}rebuildContributions(){this.contributions=[...this.nodes.values()].sort((e,t)=>e.anchorSeq-t.anchorSeq||e.key.localeCompare(t.key)),this.positions.clear();for(const[e,t]of this.contributions.entries())this.positions.set(t.key,e)}};const kr={target:"trajectory",create:a(()=>new Nr,"create")};function Sr(e){e.conversationViews.register(kr)}a(Sr,"registerTrajectoryConversationView");const kn=256;function Tr(e){if(e.event.type!=="tool/call")throw new Error("trajectory-tool-call start requires tool/call");return{callId:String(e.event.data.callId),name:e.event.data.name,argsRaw:e.event.data.arguments,turn:e.event.data.turn,step:e.event.data.step,time:e.event.time,callView:e.view?.for==="call"?e.view.view:null,subCalls:[]}}a(Tr,"rootCall");function Sn(e,t){if(e.event.type!=="tool/result")return;const n=e.event.data.message.content[0];return{kind:"tool-result",seq:e.event.seq,time:e.event.time,callId:String(e.event.data.message.source.callId),call:t===void 0?null:{name:t.name,argsRaw:t.argsRaw},callTime:t?.time??null,content:n.content,isError:n.isError===!0,...e.event.data.error===void 0?{}:{error:e.event.data.error},meta:e.event.data.meta,callView:t?.callView??null,resultView:e.view?.for==="result"?e.view.view:null,subCalls:[]}}a(Sn,"rootResult");function Br(e){return e.location.kind==="step"||e.location.kind==="turn"?e.location.turn.turn:0}a(Br,"locationTurn");function jr(e){return e.location.kind==="step"?e.location.step.step:0}a(jr,"locationStep");function Gr(e,t){return{callId:t.subCallId,name:t.name,argsRaw:JSON.stringify(t.arguments),turn:Br(e),step:jr(e),time:e.event.time,callView:null,subCalls:[]}}a(Gr,"childCall");function Cr(e,t,n){return{kind:"tool-result",seq:e.event.seq,time:e.event.time,callId:t.subCallId,call:{name:t.name,argsRaw:JSON.stringify(t.arguments)},callTime:n===void 0||"kind"in n?null:n.time,content:t.content??[],isError:t.isError===!0,callView:null,resultView:null,subCalls:[]}}a(Cr,"childResult");function Ir(e,t,n){if(t===n||e.parents.has(n))return!1;let s=t,r=0;const i=new Set;for(;s!==void 0;){if(s===n||i.has(s))return!1;i.add(s),r++,s=e.parents.get(s)}const l=[{callId:n,depth:1}],u=new Set;let p=0;for(const f of l){if(u.has(f.callId))return!1;u.add(f.callId),p=Math.max(p,f.depth);for(const m of e.children.get(f.callId)??[])l.push({callId:m,depth:f.depth+1})}return r+p<=kn}a(Ir,"acceptsEdge");function Tn(e,t){const n=t.event;if(n.type!=="tool/code-dispatch-start"&&n.type!=="tool/code-dispatch")return e;const s=n.data,r=String(s.parentCallId),i=String(s.subCallId),l=e.children.get(r)??[],u=l.indexOf(i);if(u<0&&!Ir(e,r,i)||n.type==="tool/code-dispatch-start"&&u>=0)return e;const p=new Map(e.calls);if(p.set(i,n.type==="tool/code-dispatch-start"?Gr(t,s):Cr(t,s,p.get(i))),u>=0)return{...e,calls:p};const f=new Map(e.children);f.set(r,[...l,i]);const m=new Map(e.parents);return m.set(i,r),{...e,calls:p,children:f,parents:m}}a(Tn,"updateDispatch");function Rr(e){const t=e.start?.location;if(t?.kind==="step"&&t.step.status==="closed")return t.step.end;if((t?.kind==="step"||t?.kind==="turn")&&t.turn.status==="closed")return t.turn.end}a(Rr,"interruption");function Bn(e,t,n,s=new Set,r=1){const i=e.calls.get(t);if(i===void 0)return;if(s.has(t)||r>kn)return{...i,subCalls:[]};const l=new Set(s);l.add(t);const u=(e.children.get(t)??[]).flatMap(p=>{const f=Bn(e,p,n,l,r+1);return f===void 0?[]:[f]});return"kind"in i||n===void 0?{...i,subCalls:u}:{kind:"tool-result",seq:n.seq-.8,time:n.time,callId:i.callId,call:{name:i.name,argsRaw:i.argsRaw},callTime:i.time,content:[],isError:!0,error:{name:"Interrupted",code:"interrupted"},callView:i.callView,resultView:null,subCalls:u}}a(Bn,"projectCall");function Mr(e){const t=e.matches.find(r=>r.event.type==="tool/result"),n=t===void 0?void 0:Sn(t);if(n===void 0)return;let s={rootId:n.callId,calls:new Map([[n.callId,n]]),children:new Map,parents:new Map};for(const r of e.matches)s=Tn(s,r);return s}a(Mr,"fallbackState");const Er={kind:"trajectory-tool-call",target:"trajectory",match:a(e=>{if(e.type==="tool/call")return{id:String(e.data.callId),role:"start"};if(e.type==="tool/result")return{id:String(e.data.message.source.callId),role:"update"};if(e.type==="tool/code-dispatch-start"||e.type==="tool/code-dispatch"){const t=e.data.rootCallId;return typeof t=="string"&&t!==""?{id:t,role:"update"}:null}return null},"match"),start:a((e,t)=>{const n=Tr(t);return{rootId:n.callId,calls:new Map([[n.callId,n]]),children:new Map,parents:new Map}},"start"),update:a((e,t)=>{if(t.event.type!=="tool/result")return Tn(e.state,t);const n=e.state.calls.get(e.state.rootId),s=Sn(t,n!==void 0&&!("kind"in n)?n:void 0);if(s===void 0)return e.state;const r=new Map(e.state.calls);return r.set(e.state.rootId,s),{...e.state,calls:r}},"update"),buildViewNode:a(e=>{const t=e.state??Mr(e);if(t===void 0)return null;const n=Bn(t,t.rootId,Rr(e));return n===void 0?null:ze(e,e.start?.event.seq??("kind"in n?n.seq:e.matches[0]?.event.seq??0),{kind:"tool",root:n})},"buildViewNode")};function Dr(e){e.conversationEvents.register(Er)}a(Dr,"registerTrajectoryToolDefinition");function qr(e,t,n){const s=new Array(e);return new Proxy(s,{get(r,i,l){if(typeof i=="string"){const u=i.charCodeAt(0);if(u>=48&&u<=57){const p=+i;if(Number.isInteger(p)&&p>=0&&p<e){let f=r[p];if(!f){const m=t[p*2];f=r[p]={index:p,key:n(p),start:m,size:t[p*2+1],end:m+t[p*2+1],lane:0}}return f}}if(i==="length")return e}return Reflect.get(r,i,l)}})}a(qr,"createLazyMeasurementsView");function Ze(e,t,n){let s=n.initialDeps??[],r,i=!0;function l(){const u=e();return(u.length!==s.length||u.some((p,f)=>s[f]!==p))&&(s=u,r=t(...u),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(r),i=!1),r}return a(l,"memoizedFunction"),l.updateDeps=u=>{s=u},l}a(Ze,"memo$1");function jn(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}a(jn,"notUndefined");const Pr=a((e,t)=>Math.abs(e-t)<1.01,"approxEqual"),Or=a((e,t,n)=>{let s;return function(...r){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,r),n)}},"debounce");let lt;const Ht=a(()=>{if(lt!==void 0)return lt;if(typeof navigator>"u")return lt=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return lt=!0;const e=navigator.maxTouchPoints;return lt=navigator.platform==="MacIntel"&&e!==void 0&&e>0},"isIOSWebKit"),Gn=a(e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},"getRect"),Ar=a(e=>e,"defaultKeyExtractor"),Lr=a(e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(n);for(let r=0;r<n;r++)s[r]=t+r;return s},"defaultRangeExtractor"),$r=a((e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const r=a(l=>{const{width:u,height:p}=l;t({width:Math.round(u),height:Math.round(p)})},"handler");if(r(Gn(n)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const u=a(()=>{const p=l[0];if(p?.borderBoxSize){const f=p.borderBoxSize[0];if(f){r({width:f.inlineSize,height:f.blockSize});return}}r(Gn(n))},"run");e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},"observeElementRect"),wt={passive:!0},zr=typeof window>"u"?!0:"onscrollend"in window,Wr=a((e,t,n)=>{const s=e.scrollElement;if(!s)return;const r=e.targetWindow;if(!r)return;const i=e.options.useScrollendEvent&&zr;let l=0;const u=i?null:Or(r,()=>t(l,!1),e.options.isScrollingResetDelay),p=a(h=>()=>{l=n(s),u?.(),t(l,h)},"createHandler"),f=p(!0),m=p(!1);return s.addEventListener("scroll",f,wt),i&&s.addEventListener("scrollend",m,wt),()=>{s.removeEventListener("scroll",f),i&&s.removeEventListener("scrollend",m)}},"observeOffset"),Hr=a((e,t)=>Wr(e,t,n=>{const{horizontal:s,isRtl:r}=e.options;return s?n.scrollLeft*(r&&-1||1):n.scrollTop}),"observeElementOffset"),Fr=a((e,t,n)=>{if(n.options.useCachedMeasurements){const s=n.indexFromElement(e),r=n.options.getItemKey(s);return n.itemSizeCache.get(r)??n.options.estimateSize(s)}if(t?.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const s=n.indexFromElement(e),r=n.options.getItemKey(s),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},"measureElement"),Xr=a((e,{adjustments:t=0,behavior:n},s)=>{var r,i;(i=(r=s.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[s.options.horizontal?"left":"top"]:e+t,behavior:n})},"scrollWithAdjustments");var Yr=class{static{a(this,"Virtualizer")}constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,n,s;return((s=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:s.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=a(()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(r=>{const i=a(()=>{const l=r.target,u=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);for(const[p,f]of this.elementsCache)if(f===l){this.elementsCache.delete(p);break}return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(l,r,this))},"run");this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})})),"get");return{disconnect:a(()=>{var s;(s=n())==null||s.disconnect(),t=null},"disconnect"),observe:a(s=>{var r;return(r=n())==null?void 0:r.observe(s,{box:"border-box"})},"observe"),unobserve:a(s=>{var r;return(r=n())==null?void 0:r.unobserve(s)},"unobserve")}})(),this.range=null,this.setOptions=t=>{var n,s;const r={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ar,rangeExtractor:Lr,onChange:a(()=>{},"onChange"),measureElement:Fr,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in t){const b=t[h];b!==void 0&&(r[h]=b)}const i=this.options;let l=null,u=null,p=!1;if(i!==void 0&&i.enabled&&r.enabled&&r.anchorTo==="end"&&this.scrollElement!==null){const h=i.count,b=r.count,v=this.getMeasurements(),T=h>0?((n=v[0])==null?void 0:n.key)??i.getItemKey(0):null,k=h>0?((s=v[h-1])==null?void 0:s.key)??i.getItemKey(h-1):null;if(b!==h||h>0&&b>0&&(r.getItemKey(0)!==T||r.getItemKey(b-1)!==k)){p=!0;const S=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??v[0]:null;S&&(l=[S.key,this.getScrollOffset()-S.start]);const w=r.followOnAppend===!0?"auto":r.followOnAppend||null;w&&b>h&&this.isAtEnd(i.scrollEndThreshold)&&(h===0||r.getItemKey(b-1)!==k)&&(u=w)}}this.options=r,p&&(this.pendingMin=0,this.itemSizeCacheVersion++);let f=!1,m=0;if(l&&this.scrollOffset!==null){const[h,b]=l,v=this.getMeasurements(),{count:T,getItemKey:k}=this.options;let S=0;for(;S<T&&k(S)!==h;)S++;if(S<T){const w=v[S];if(w){const B=Math.max(0,w.start+b);B!==this.scrollOffset&&(m=B-this.scrollOffset,this.scrollOffset=B,f=!0)}}}(f||u)&&(this.pendingScrollAnchor=[f?l[0]:null,f?l[1]:0,u,m])},this.notify=t=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,t)},this.maybeNotify=Ze(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:a(()=>this.options.debug,"debug"),initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}if(this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{if(i&&this._intendedScrollOffset===null&&r===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(r-this._intendedScrollOffset)<1.5&&(r=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const l=this.getScrollOffset();this.scrollDirection=i?l===r?this.scrollDirection:l<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const r=this.scrollElement,i=a(()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},"onTouchStart"),l=a(()=>{this._iosTouching=!1,!(!Ht()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))},"onTouchEnd");r.addEventListener("touchstart",i,wt),r.addEventListener("touchend",l,wt),this.unsubs.push(()=>{r.removeEventListener("touchstart",i),r.removeEventListener("touchend",l),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[r,i,l,u]=s;r!==null&&!l&&(Ht()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l&&this.scrollToEnd({behavior:l})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),n=this.getMaxScrollOffset();if(t<0||t>n)return;if(this._iosDeferredAdjustment<0&&t>=n-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ze(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,n,s,r,i,l,u,p)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:t,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:i,lanes:l,laneAssignmentMode:u,gap:p}),{key:!1}),this.getMeasurements=Ze(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:i,lanes:l,laneAssignmentMode:u,gap:p},f)=>{const m=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const S of this.laneAssignments.keys())S>=t&&this.laneAssignments.delete(S);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(S=>{this.itemSizeCache.set(S.key,S.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),l===1){const S=t*2;let w=this._flatMeasurements;if(!w||w.length<S){const I=new Float64Array(S);w&&h>0&&I.set(w.subarray(0,h*2)),w=I,this._flatMeasurements=w}let B;if(h===0)B=n+s;else{const I=h-1;B=w[I*2]+w[I*2+1]+p}for(let I=h;I<t;I++){const q=r(I),se=m.get(q),E=typeof se=="number"?se:this.options.estimateSize(I);w[I*2]=B,w[I*2+1]=E,B+=E+p}const C=qr(t,w,r);return this.measurementsCache=C,C}const b=this.measurementsCache.slice(0,h),v=new Array(l).fill(void 0),T=new Float64Array(l);let k=0;for(let S=0;S<h;S++){const w=b[S];w&&(v[w.lane]===void 0&&k++,v[w.lane]=S,T[w.lane]=w.end)}for(let S=h;S<t;S++){const w=r(S),B=this.laneAssignments.get(S);let C,I;const q=u==="estimate"||m.has(w);if(B!==void 0&&this.options.lanes>1){C=B;const g=v[C],x=g!==void 0?b[g]:void 0;I=x?x.end+p:n+s}else if(k===l){let g=0,x=T[0],P=v[0];for(let N=1;N<l;N++){const R=T[N];(R<x||R===x&&v[N]<P)&&(g=N,x=R,P=v[N])}C=g,I=x+p,q&&this.laneAssignments.set(S,C)}else C=S%this.options.lanes,I=n+s,q&&this.laneAssignments.set(S,C);const se=m.get(w),E=typeof se=="number"?se:this.options.estimateSize(S),fe=I+E;b[S]={index:S,start:I,size:E,end:fe,key:w,lane:C},v[C]===void 0&&k++,v[C]=S,T[C]=fe}return this.measurementsCache=b,b},{key:!1,debug:a(()=>this.options.debug,"debug")}),this.calculateRange=Ze(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,s,r)=>t.length===0||n===0?(this.range=null,null):(this.range=Ur(t,n,s,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:a(()=>this.options.debug,"debug")}),this.getVirtualIndexes=Ze(()=>{let t=null,n=null;const s=this.calculateRange();return s&&(t=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,s,r,i)=>r===null||i===null?[]:t({startIndex:r,endIndex:i,overscan:n,count:s}),{key:!1,debug:a(()=>this.options.debug,"debug")}),this.indexFromElement=t=>{const n=this.options.indexAttribute,s=t.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(s!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-r),l=Math.min(this.options.count-1,s+r);return t>=i&&t<=l}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,l)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(l))});return}const n=this.indexFromElement(t),s=this.options.getItemKey(n),r=this.elementsCache.get(s);r!==t&&(r&&this.observer.unobserve(r),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var s,r;if(t<0||t>=this.options.count)return;let i,l,u;const p=this._flatMeasurements;if(this.options.lanes===1&&p!==null)u=this.options.getItemKey(t),l=p[t*2],i=p[t*2+1];else{const h=this.measurementsCache[t];if(!h)return;u=h.key,l=h.start,i=h.size}const f=this.itemSizeCache.get(u)??i,m=n-f;if(m!==0){const h=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=h?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,T=this.itemSizeCache.has(u)?l+f<=v&&this.scrollDirection!=="backward":l<v,k=((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:l,size:i,end:l+i,lane:0},m,this):T);(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,n),this.itemSizeCacheVersion++;let S=!1;h?S=this.applyScrollAdjustment(this.getTotalSize()-b):k&&(S=this.applyScrollAdjustment(m)),this.notify(S)}},this.getVirtualItems=Ze(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const s=[];for(let r=0,i=t.length;r<i;r++){const l=n[t[r]];s.push(l)}return s},{key:!1,debug:a(()=>this.options.debug,"debug")}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length===0)return;const s=this._flatMeasurements,r=this.options.lanes===1&&s!=null;return jn(n[Cn(0,n.length-1,r?i=>s[i*2]:i=>jn(n[i]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,n,s=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),i=this.getScrollOffset();n==="auto"&&(n=t>=i+r?"end":"start"),n==="center"?t+=(s-r)/2:n==="end"&&(t-=r);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[t];if(!i)return;if(n==="auto")if(i.end>=r+s-this.options.scrollPaddingEnd)n="end";else if(i.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const l=n==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,n,i.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const r=this.getOffsetForAlignment(t,n),i=this.now();this.scrollState={index:null,align:n,behavior:s,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const r=this.getOffsetForIndex(t,n);if(!r)return;const[i,l]=r,u=this.now();this.scrollState={index:t,align:l,behavior:s,startedAt:u,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const s=this.getScrollOffset()+t,r=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const r=n.length-1,i=this._flatMeasurements;i!=null?s=i[r*2]+i[r*2+1]:s=((t=n[r])==null?void 0:t.end)??0}else{const r=Array(this.options.lanes).fill(null);let i=n.length-1;for(;i>=0&&r.some(l=>l===null);){const l=n[i];r[l.lane]===null&&(r[l.lane]=l.end),i--}s=Math.max(...r.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const n=this.getMeasurements();for(const s of n)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:n,behavior:s})=>{this._intendedScrollOffset=t+(n??0),this.options.scrollToFn(t,{behavior:s,adjustments:n},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e===0?!1:Ht()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,n=1,s=t!==this.scrollState.lastTargetOffset;if(!s&&Pr(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const r=this.getSize()||600,i=Math.abs(t-this.getScrollOffset()),l=this.scrollState.behavior==="smooth"&&i>r;this.scrollState.lastTargetOffset=t,l||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:l?"smooth":"auto"})}this.scheduleScrollReconcile()}};const Cn=a((e,t,n,s)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<s)e=r+1;else if(i>s)t=r-1;else return r}return e>0?e-1:0},"findNearestBinarySearch");function Jr(e,t,n){let s=0;for(;s<=t;){const r=(s+t)/2|0,i=e[r*2];if(i<n)s=r+1;else if(i>n)t=r-1;else return r}return s>0?s-1:0}a(Jr,"findNearestBinarySearchFlat");function Ur(e,t,n,s,r){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&r!==null){const f=Jr(r,i,n);let m=f;const h=n+t;for(;m<i&&r[m*2]+r[m*2+1]<h;)m++;return{startIndex:f,endIndex:m}}let u=Cn(0,i,a(f=>e[f].start,"getStart"),n),p=u;if(s===1)for(;p<i&&e[p].end<n+t;)p++;else if(s>1){const f=Array(s).fill(0);for(;p<i&&f.some(h=>h<n+t);){const h=e[p];f[h.lane]=h.end,p++}const m=Array(s).fill(n+t);for(;u>=0&&m.some(h=>h>=n);){const h=e[u];m[h.lane]=h.start,u--}u=Math.max(0,u-u%s),p=Math.min(i,p+(s-1-p%s))}return{startIndex:u,endIndex:p}}a(Ur,"calculateRangeImpl");const Ft=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Qr({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...s}){const r=y.useReducer(m=>m+1,0)[1],i=y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const l=a(m=>{const h=i.current;if(!h.enabled||!h.container)return;const b=m.getTotalSize();if(b!==h.lastSize){h.lastSize=b;const v=m.options.horizontal?"width":"height";h.container.style[v]=`${b}px`}},"applyContainerSize"),u=a(m=>{const h=i.current;if(!h.enabled||!h.container)return;l(m);const b=!!m.options.horizontal,v=h.mode==="transform",T=b?"left":"top",k=m.options.scrollMargin,S=m.getVirtualItems();for(const w of S){const B=w.start-k,C=m.elementsCache.get(w.key);C&&h.lastPositions.get(C)!==B&&(h.lastPositions.set(C,B),v?C.style.transform=b?`translate3d(${B}px, 0, 0)`:`translate3d(0, ${B}px, 0)`:C.style[T]=`${B}px`)}},"applyDirectStyles"),p={...s,onChange:a((m,h)=>{var b;const v=i.current;let T=!0;if(v.enabled){u(m);const k=m.range,S=v.prevRange;T=!S||S.isScrolling!==m.isScrolling||S.startIndex!==k?.startIndex||S.endIndex!==k?.endIndex,T&&(v.prevRange=k?{startIndex:k.startIndex,endIndex:k.endIndex,isScrolling:m.isScrolling}:null)}T&&(e&&h?(0,Hs.flushSync)(r):r()),(b=s.onChange)==null||b.call(s,m,h)},"onChange")},[f]=y.useState(()=>{const m=new Yr(p);return Object.assign(m,{containerRef:a(h=>{const b=i.current;if(b.container=h,b.lastSize=null,h&&b.enabled){const v=m.getTotalSize();b.lastSize=v;const T=m.options.horizontal?"width":"height";h.style[T]=`${v}px`}},"containerRef")})});return f.setOptions(p),Ft(()=>f._didMount(),[]),Ft(()=>(l(f),f._willUpdate())),Ft(()=>{u(f)}),f}a(Qr,"useVirtualizerBase");function Kr(e){return Qr({observeElementRect:$r,observeElementOffset:Hr,scrollToFn:Xr,...e})}a(Kr,"useVirtualizer");var Ee=class{static{a(this,"Diff")}diff(e,t,n={}){let s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);const r=this.castInput(e,n),i=this.castInput(t,n),l=this.removeEmpty(this.tokenize(r,n)),u=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(l,u,n,s)}diffWithOptionsObj(e,t,n,s){var r;const i=a(w=>{if(w=this.postProcess(w,n),s){setTimeout(function(){s(w)},0);return}else return w},"done"),l=t.length,u=e.length;let p=1,f=l+u;n.maxEditLength!=null&&(f=Math.min(f,n.maxEditLength));const m=(r=n.timeout)!==null&&r!==void 0?r:1/0,h=Date.now()+m,b=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(b[0],t,e,0,n);if(b[0].oldPos+1>=u&&v+1>=l)return i(this.buildValues(b[0].lastComponent,t,e));let T=-1/0,k=1/0;const S=a(()=>{for(let w=Math.max(T,-p);w<=Math.min(k,p);w+=2){let B;const C=b[w-1],I=b[w+1];C&&(b[w-1]=void 0);let q=!1;if(I){const E=I.oldPos-w;q=I&&0<=E&&E<l}const se=C&&C.oldPos+1<u;if(!q&&!se){b[w]=void 0;continue}if(!se||q&&C.oldPos<I.oldPos?B=this.addToPath(I,!0,!1,0,n):B=this.addToPath(C,!1,!0,1,n),v=this.extractCommon(B,t,e,w,n),B.oldPos+1>=u&&v+1>=l)return i(this.buildValues(B.lastComponent,t,e))||!0;b[w]=B,B.oldPos+1>=u&&(k=Math.min(k,w-1)),v+1>=l&&(T=Math.max(T,w+1))}p++},"execEditLength");if(s)a((function w(){setTimeout(function(){if(p>f||Date.now()>h)return s(void 0);S()||w()},0)}),"exec")();else for(;p<=f&&Date.now()<=h;){const w=S();if(w)return w}}addToPath(e,t,n,s,r){const i=e.lastComponent;return i&&!r.oneChangePerToken&&i.added===t&&i.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}}extractCommon(e,t,n,s,r){const i=t.length,l=n.length;let u=e.oldPos,p=u-s,f=0;for(;p+1<i&&u+1<l&&this.equals(n[u+1],t[p+1],r);)p++,u++,f++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return f&&!r.oneChangePerToken&&(e.lastComponent={count:f,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,p}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){const s=[];let r;for(;e;)s.push(e),r=e.previousComponent,delete e.previousComponent,e=r;s.reverse();const i=s.length;let l=0,u=0,p=0;for(;l<i;l++){const f=s[l];if(f.removed)f.value=this.join(n.slice(p,p+f.count)),p+=f.count;else{if(!f.added&&this.useLongestToken){let m=t.slice(u,u+f.count);m=m.map(function(h,b){const v=n[p+b];return v.length>h.length?v:h}),f.value=this.join(m)}else f.value=this.join(t.slice(u,u+f.count));u+=f.count,f.added||(p+=f.count)}}return s}},Zr=class extends Ee{static{a(this,"CharacterDiff")}};new Zr;function In(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}a(In,"longestCommonPrefix");function Rn(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}a(Rn,"longestCommonSuffix");function Xt(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}a(Xt,"replacePrefix");function Yt(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}a(Yt,"replaceSuffix");function ct(e,t){return Xt(e,t,"")}a(ct,"removePrefix");function Vt(e,t){return Yt(e,t,"")}a(Vt,"removeSuffix");function Mn(e,t){return t.slice(0,eo(e,t))}a(Mn,"maximumOverlap");function eo(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let s=t.length;e.length<t.length&&(s=e.length);const r=Array(s);let i=0;r[0]=0;for(let l=1;l<s;l++){for(t[l]==t[i]?r[l]=r[i]:r[l]=i;i>0&&t[l]!=t[i];)i=r[i];t[l]==t[i]&&i++}i=0;for(let l=n;l<e.length;l++){for(;i>0&&e[l]!=t[i];)i=r[i];e[l]==t[i]&&i++}return i}a(eo,"overlapCount");function En(e,t){const n=[];for(const s of Array.from(t.segment(e))){const r=s.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(r)?n[n.length-1]+=r:n.push(r)}return n}a(En,"segment");function Jt(e,t){if(t)return dt(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}a(Jt,"trailingWs");function et(e,t){if(t)return dt(e,t)[0];const n=e.match(/^\s*/);return n?n[0]:""}a(et,"leadingWs");function dt(e,t){if(!t)return[et(e),Jt(e)];if(t.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');const n=En(e,t),s=n[0],r=n[n.length-1];return[/\s/.test(s)?s:"",/\s/.test(r)?r:""]}a(dt,"leadingAndTrailingWs");const _t="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",to=new RegExp(`[${_t}]+|\\s+|[^${_t}]`,"ug");var no=class extends Ee{static{a(this,"WordDiff")}equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){const i=t.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=En(e,i)}else n=e.match(to)||[];const s=[];let r=null;return n.forEach(i=>{/\s/.test(i)?r==null?s.push(i):s.push(s.pop()+i):r!=null&&/\s/.test(r)?s[s.length-1]==r?s.push(s.pop()+i):s.push(r+i):s.push(i),r=i}),s}join(e){return e.map((t,n)=>n==0?t:t.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,s=null,r=null;return e.forEach(i=>{i.added?s=i:i.removed?r=i:((s||r)&&Dn(n,r,s,i,t.intlSegmenter),n=i,s=null,r=null)}),(s||r)&&Dn(n,r,s,null,t.intlSegmenter),e}};new no;function Dn(e,t,n,s,r){if(t&&n){const[i,l]=dt(t.value,r),[u,p]=dt(n.value,r);if(e){const f=In(i,u);e.value=Yt(e.value,u,f),t.value=ct(t.value,f),n.value=ct(n.value,f)}if(s){const f=Rn(l,p);s.value=Xt(s.value,p,f),t.value=Vt(t.value,f),n.value=Vt(n.value,f)}}else if(n){if(e){const i=et(n.value,r);n.value=n.value.substring(i.length)}if(s){const i=et(s.value,r);s.value=s.value.substring(i.length)}}else if(e&&s){const i=et(s.value,r),[l,u]=dt(t.value,r),p=In(i,l);t.value=ct(t.value,p);const f=Rn(ct(i,p),u);t.value=Vt(t.value,f),s.value=Xt(s.value,i,f),e.value=Yt(e.value,i,i.slice(0,i.length-f.length))}else if(s){const i=et(s.value,r),l=Mn(Jt(t.value,r),i);t.value=Vt(t.value,l)}else if(e){const i=Mn(Jt(e.value,r),et(t.value,r));t.value=ct(t.value,i)}}a(Dn,"dedupeWhitespaceInChangeObjects");var so=class extends Ee{static{a(this,"WordsWithSpaceDiff")}tokenize(e){const t=new RegExp(`(\\r?\\n)|[${_t}]+|[^\\S\\n\\r]+|[^${_t}]`,"ug");return e.match(t)||[]}};new so;var ro=class extends Ee{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Pn}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
1
|
+
var Sa=Object.defineProperty;var a=(Le,wt)=>Sa(Le,"name",{value:wt,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-trajectory",factory:a(Le=>{var wt={exports:{}},zt=wt.exports;Object.defineProperty(zt,Symbol.toStringTag,{value:"Module"});var Os=Object.create,yn=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Ls=Object.getOwnPropertyNames,$s=Object.getPrototypeOf,bn=Object.prototype.hasOwnProperty,zs=a((e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=Ls(t),i=0,l=r.length,u;i<l;i++)u=r[i],!bn.call(e,u)&&u!==n&&yn(e,u,{get:(p=>t[p]).bind(null,u),enumerable:!(s=As(t,u))||s.enumerable});return e},"__copyProps"),Ws=a((e,t,n)=>(n=e!=null?Os($s(e)):{},zs(t||!e||!e.__esModule||!bn.call(e,"default")?yn(n,"default",{value:e,enumerable:!0}):n,e)),"__toESM");let je=Le("@deepseek-ai/dsh-client-runtime/client"),o=Le("react/jsx-runtime"),b=Le("react");b=Ws(b,1);let Hs=Le("react-dom"),K=Le("@deepseek-ai/dsh-client-ui-primitives");function Fs(){return(0,je.createSnapshotStore)(!1,{persist:{name:"dsh.trajectory.duration"}})}a(Fs,"createTrajectoryDurationStore");const Wt="trajectory",Xs={"view.trajectory":"轨迹","toolbar.aria":"轨迹工具栏","toolbar.duration":"Duration","toolbar.useActualDuration":"Use actual duration","toolbar.useEqualWidth":"Use equal-width operations","toolbar.actualTime":"实际时间","toolbar.turns":"Turns","toolbar.expandTurns":"Expand turns","toolbar.collapseTurns":"Collapse turns","toolbar.calls":"Calls","toolbar.expandCalls":"Expand calls","toolbar.collapseCalls":"Collapse calls","toolbar.search":"搜索轨迹","toolbar.searchPlaceholder":"搜索"},Ys={"view.trajectory":"Trajectory","toolbar.aria":"Trajectory toolbar","toolbar.duration":"Duration","toolbar.useActualDuration":"Use actual duration","toolbar.useEqualWidth":"Use equal-width operations","toolbar.actualTime":"Actual time","toolbar.turns":"Turns","toolbar.expandTurns":"Expand turns","toolbar.collapseTurns":"Collapse turns","toolbar.calls":"Calls","toolbar.expandCalls":"Expand calls","toolbar.collapseCalls":"Collapse calls","toolbar.search":"Search trajectory","toolbar.searchPlaceholder":"Search"};function $e(e,t,n){return{key:e.key,kind:e.kind,id:e.id,target:"trajectory",anchorSeq:t,location:e.start?.location??{kind:"unresolved"},data:n}}a($e,"trajectoryNode");function Vt(e,t,n,s,r){return{turn:e,step:t,startSeq:n,startTime:s,started:r,sawChunk:!1,blocks:[],firstVisibleSeq:void 0,firstVisibleTime:void 0,firstTokenTime:void 0,final:void 0,usage:void 0,retry:void 0,stepEnd:void 0}}a(Vt,"initialState");function Ht(e){return e.filter(t=>t!==void 0)}a(Ht,"compactBlocks");function Js(e){return e.some(t=>t.kind==="tool-call"?!1:t.kind==="text"||t.kind==="reasoning"?t.text.trim()!=="":!0)}a(Js,"hasVisibleContent");function Us(e){return e.some(t=>t.kind==="text"||t.kind==="reasoning"?t.text.trim()!=="":!0)}a(Us,"hasInterruptionEvidence");function Qs(e,t){return{inputTokens:(e?.inputTokens??0)+t.inputTokens,outputTokens:(e?.outputTokens??0)+t.outputTokens,...e?.cacheReadTokens===void 0&&t.cacheReadTokens===void 0?{}:{cacheReadTokens:(e?.cacheReadTokens??0)+(t.cacheReadTokens??0)},...e?.cacheWriteTokens===void 0&&t.cacheWriteTokens===void 0?{}:{cacheWriteTokens:(e?.cacheWriteTokens??0)+(t.cacheWriteTokens??0)},...e?.reasoningTokens===void 0&&t.reasoningTokens===void 0?{}:{reasoningTokens:(e?.reasoningTokens??0)+(t.reasoningTokens??0)}}}a(Qs,"addUsage$1");function wn(e,t){if(t.event.type!=="assistant/chunk")return e;const n=t.event.data.chunk;if(n.type==="usage")return{...e,sawChunk:!0,usage:Qs(e.usage,n.usage)};const s=[...e.blocks];switch(n.type){case"block-start":s[n.index]=(0,je.emptyAssistantBlock)(n.blockType);break;case"text-delta":{const i=s[n.index];s[n.index]={kind:"text",text:(i?.kind==="text"?i.text:"")+n.text};break}case"reasoning-delta":{const i=s[n.index];s[n.index]={kind:"reasoning",text:(i?.kind==="reasoning"?i.text:"")+n.text};break}case"tool-call-delta":{const i=s[n.index],l=i?.kind==="tool-call"?i:{kind:"tool-call",callId:"",name:"",argsRaw:""};s[n.index]={kind:"tool-call",callId:l.callId||String(n.id),name:n.name??l.name,argsRaw:l.argsRaw+n.argumentsDelta};break}case"block-end":s[n.index]=(0,je.toAssistantBlock)(n.block);break;default:return{...e,sawChunk:!0}}const r=Js(Ht(s));return{...e,sawChunk:!0,blocks:s,...r&&e.firstVisibleSeq===void 0?{firstVisibleSeq:t.event.seq,firstVisibleTime:t.event.time}:{},...(0,je.isTokenDelta)(n)&&e.firstTokenTime===void 0?{firstTokenTime:t.event.time}:{}}}a(wn,"updateChunk");function Vn(e){if(e.state?.stepEnd?.event.type==="step/end")return e.state.stepEnd.event;const t=e.start?.location??e.matches.at(-1)?.location;if(t?.kind==="step"&&t.step.status==="closed")return t.step.end;if((t?.kind==="step"||t?.kind==="turn")&&t.turn.status==="closed")return t.turn.end}a(Vn,"closedBoundary");function Ks(e){let t;for(const n of e.matches){const s=n.event;s.type==="assistant/chunk"?(t??=Vt(s.data.turn,s.data.step,s.seq,s.time,!1),t=wn(t,n)):s.type==="assistant/message"?(t??=Vt(s.data.turn,s.data.step,s.seq,s.time,!1),t={...t,blocks:(0,je.toAssistantBlocks)(s.data.message.content),final:n,usage:t.usage??s.data.usage}):s.type==="step/end"&&t!==void 0&&(t={...t,stepEnd:n})}return t}a(Ks,"fallbackState$1");function Zs(e,t){const n=e.final;if(n?.event.type==="assistant/message"){const i=n.event;return{kind:"assistant",seq:i.seq,messageId:i.data.message.id,time:i.time,turn:e.turn,step:e.step,blocks:(0,je.toAssistantBlocks)(i.data.message.content),usage:i.data.usage,provenance:{provider:i.data.message.source.provider,model:i.data.message.source.model},timing:{stepStartTime:e.started?e.startTime:null,firstTokenTime:e.firstTokenTime??null,completedTime:i.time}}}const s=Vn(t),r=Ht(e.blocks);if(!(s===void 0||!Us(r)))return{kind:"assistant",seq:s.seq-.9,time:s.time,turn:e.turn,step:e.step,blocks:r,interrupted:!0}}a(Zs,"finalNode");function er(e,t,n){if(!e.started)return;const s=t!==void 0&&t.interrupted!==!0?"complete":e.retry!==void 0||n!==void 0?"error":"running";return{purpose:"assistant",startSeq:e.startSeq,turn:e.turn,step:e.step,startedAt:e.startTime,completedAt:t?.time??n?.time??null,status:s,...e.retry===void 0?{}:{error:e.retry.message,retry:e.retry.retry,...e.retry.maxRetries===void 0?{}:{maxRetries:e.retry.maxRetries},retryDelayMs:e.retry.delayMs},...t===void 0||t.interrupted===!0?{}:{resultSeq:t.seq,...t.provenance===void 0?{}:{provenance:t.provenance}},...e.usage===void 0?{}:{usage:e.usage}}}a(er,"assistantRequest");const tr={kind:"trajectory-assistant-step",target:"trajectory",match:a(e=>e.type==="step/start"?{id:`${e.data.turn}:${e.data.step}`,role:"start"}:e.type==="assistant/chunk"||e.type==="assistant/message"||e.type==="llm/retry"||e.type==="step/end"?{id:`${e.data.turn}:${e.data.step}`,role:"update"}:null,"match"),start:a((e,t)=>{if(t.event.type!=="step/start")throw new Error("trajectory-assistant-step start requires step/start");return Vt(t.event.data.turn,t.event.data.step,t.event.seq,t.event.time,!0)},"start"),update:a((e,t)=>{if(t.event.type==="assistant/chunk")return wn(e.state,t);if(t.event.type==="assistant/message")return{...e.state,blocks:(0,je.toAssistantBlocks)(t.event.data.message.content),final:t,usage:e.state.usage??t.event.data.usage};if(t.event.type==="step/end")return{...e.state,stepEnd:t};if(t.event.type!=="llm/retry")return e.state;const n=t.event.data;return{...Vt(e.state.turn,e.state.step,e.state.startSeq,e.state.startTime,!0),firstTokenTime:e.state.firstTokenTime,usage:e.state.usage,retry:{message:(0,je.displayFailureMessage)(n.failure),retry:n.retry,...n.mode==="normal"?{maxRetries:n.maxRetries}:{},delayMs:n.delayMs}}},"update"),publication:a(e=>{if(e.event.type==="step/start")return"none";if(e.event.type!=="assistant/chunk")return"immediate";const t=e.event.data.chunk.type;return t==="usage"||t==="finish"?"none":"animation-frame"},"publication"),buildViewNode:a(e=>{const t=e.state??Ks(e);if(t===void 0)return null;const n=Zs(t,e),s=Vn(e),r=n===void 0&&s===void 0&&t.sawChunk?{turn:t.turn,step:t.step,blocks:Ht(t.blocks)}:null,i=er(t,n,s);return n===void 0&&r===null&&i===void 0?null:$e(e,t.startSeq,{kind:"assistant",...n===void 0?{}:{node:n},partial:r,...i===void 0?{}:{request:i}})},"buildViewNode")},nr={kind:"trajectory-turn-end",target:"trajectory",match:a(e=>e.type==="turn/end"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t)=>{if(t.event.type!=="turn/end")throw new Error("trajectory-turn-end start requires turn/end");const n=t.event.data.reason;return{turn:t.event.data.turn,seq:t.event.seq,time:t.event.time,...n.kind==="error"?{error:(0,je.displayFailureMessage)(n.error)}:{}}},"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:$e(e,e.state.seq,{kind:"turn-end",turn:e.state.turn,time:e.state.time,...e.state.error===void 0?{}:{error:e.state.error}}),"buildViewNode")};function sr(e){e.conversationEvents.register(tr),e.conversationEvents.register(nr)}a(sr,"registerTrajectoryAssistantDefinition");function _n(e){if(e.type!=="user/message")return;const t=e.data.source;return t.kind==="plugin"&&t.plugin==="compact"&&typeof t.compactionId=="string"&&t.compactionId!==""?t.compactionId:void 0}a(_n,"checkpointId");function rr(e){if(e.type!=="compaction/start"&&e.type!=="compaction/summary"&&e.type!=="compaction/end")return;const t=e.data.compactionId;return typeof t=="string"&&t!==""?t:void 0}a(rr,"eventCompactionId");function or(e){const t=e.start.event;if(t.type!=="compaction/start")return;const n=e.summary?.event,s=e.end?.event,r=e.checkpoint?.event;return{purpose:"compaction",startSeq:t.seq,turn:t.data.turn,step:0,startedAt:t.time,completedAt:s?.type==="compaction/end"?s.time:null,status:s?.type!=="compaction/end"?"running":s.data.error===void 0?"complete":"error",...s?.type==="compaction/end"&&s.data.error!==void 0?{error:s.data.error}:{},...n?.type!=="compaction/summary"?{}:{resultSeq:n.seq,summary:n.data.summary,...n.data.rawOutput===void 0?{}:{rawOutput:n.data.rawOutput},provenance:{provider:n.data.provider,model:n.data.model},requestConfig:{provider:n.data.provider,model:n.data.model,purpose:"compaction",...n.data.maxTokens===void 0?{}:{maxTokens:n.data.maxTokens}},...n.data.usage===void 0?{}:{usage:n.data.usage}},...r?.type==="user/message"?{replacementSeq:r.seq}:{}}}a(or,"requestFromState");const ir={kind:"trajectory-compaction",target:"trajectory",match:a(e=>{const t=rr(e);if(t!==void 0)return{id:t,role:e.type==="compaction/start"?"start":"update"};const n=_n(e);return n===void 0?null:{id:n,role:"update"}},"match"),start:a((e,t)=>{if(t.event.type!=="compaction/start")throw new Error("trajectory-compaction start requires compaction/start");return{start:t}},"start"),update:a((e,t)=>t.event.type==="compaction/summary"?{...e.state,summary:t}:t.event.type==="compaction/end"?{...e.state,end:t}:_n(t.event)===void 0?e.state:{...e.state,checkpoint:t},"update"),buildViewNode:a(e=>{if(e.state===void 0)return null;const t=or(e.state);return t===void 0?null:$e(e,t.startSeq,{kind:"compaction",request:t})},"buildViewNode")},ar={kind:"trajectory-session-end",target:"trajectory",match:a(e=>e.type==="session/end-seed"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t)=>({seq:t.event.seq,time:t.event.time}),"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:$e(e,e.state.seq,{kind:"session-end",seq:e.state.seq,time:e.state.time}),"buildViewNode")};function lr(e){e.conversationEvents.register(ir),e.conversationEvents.register(ar)}a(lr,"registerTrajectoryCompactionDefinitions");function cr(e,t){const n=[...e?.state.pending??[]],s=new Set(e?.state.claimed??[]),r=n.splice(t.start,t.removedCount??0,...t.inserted);for(const i of t.inserted)s.delete(i.id);if(t.outcome!=="canceled")for(const i of r)s.add(i.id);return{pending:n,claimed:s}}a(cr,"applySplice");const dr={kind:"trajectory-inbox-next-step",match:a(e=>e.type==="agent/inbox/spliced"&&e.data.target==="next-step"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t,n)=>{if(t.event.type!=="agent/inbox/spliced")throw new Error("trajectory-inbox-next-step start requires agent/inbox/spliced");return cr(n.previous("trajectory-inbox-next-step"),t.event.data)},"start"),update:a(e=>e.state,"update"),publication:a(()=>"none","publication")},ur={kind:"trajectory-input-message",target:"trajectory",match:a(e=>e.type==="user/message"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t,n)=>{if(t.event.type!=="user/message")throw new Error("trajectory-input-message start requires user/message");const s=t.event;return s.data.source.kind!=="user"?{kind:"context",seq:s.seq,time:s.time,content:s.data.content,source:s.data.source,provenance:(0,je.contextProvenance)(s.data.source),form:(0,je.contextForm)(s.data.source)}:n.previous("trajectory-inbox-next-step")?.state.claimed.has(String(s.data.id))===!0?{kind:"steering",messageId:s.data.id,seq:s.seq,time:s.time,content:s.data.content,source:s.data.source}:{kind:"user",seq:s.seq,time:s.time,content:s.data.content,source:s.data.source}},"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:$e(e,e.state.seq,{kind:"node",node:e.state}),"buildViewNode")};function pr(e){e.conversationEvents.register(dr),e.conversationEvents.register(ur)}a(pr,"registerTrajectoryMessageDefinitions");function hr(e){if(e.event.type!=="request/header")throw new Error("trajectory-request-header start requires request/header");const t=e.event.data.header,n=t.tools;return{config:t.config,system:t.system??"",tools:Array.isArray(n)?n:[]}}a(hr,"requestPrompt");function fr(e,t,n){if(n.event.type!=="request/header"||e===void 0&&n.event.data.reason!=="initial")return;const s=e!==void 0&&e.system!==t.system,r=e!==void 0&&JSON.stringify(e.tools)!==JSON.stringify(t.tools);if(!(e!==void 0&&!s&&!r))return{seq:n.event.seq,time:n.event.time,kind:e===void 0?"initial":s&&r?"system-and-tools":s?"system":"tools",...e===void 0?{}:{previous:e}}}a(fr,"promptChange");const mr={kind:"trajectory-request-header",target:"trajectory",match:a(e=>e.type==="request/header"?{id:String(e.seq),role:"start"}:null,"match"),start:a((e,t,n)=>{const s=hr(t),r=n.previous("trajectory-request-header")?.state.prompt,i=fr(r,s,t);return{seq:t.event.seq,time:t.event.time,prompt:s,location:t.location,...i===void 0?{}:{change:i}}},"start"),update:a(e=>e.state,"update"),buildViewNode:a(e=>e.state===void 0?null:$e(e,e.state.seq,{kind:"request-header",header:e.state}),"buildViewNode")};function gr(e){e.conversationEvents.register(mr)}a(gr,"registerTrajectoryRequestHeaderDefinition");const Ft=[],Nn={eventNodes:Ft,eventLocations:new Map,requests:Ft,callSchemas:new Map,partial:null,runningCalls:Ft};function kn(e,t){return`${e}\0${t}`}a(kn,"stepKey");function vr(e){const t=e.location;return t.kind==="step"?kn(t.turn.turn,t.step.step):void 0}a(vr,"headerStepKey");function xr(e,t,n){return t.get(kn(e.turn,e.step))??(n!==void 0&&n.seq<e.startSeq?n:void 0)}a(xr,"headerFor");function yr(e,t,n){return t===void 0?e:{...e,prompt:t.prompt,requestConfig:t.prompt.config,...n&&t.change!==void 0?{promptChange:t.change}:{}}}a(yr,"applyHeader");function br(e,t){return t===void 0?e:{...e,requestConfig:t.config}}a(br,"withRequestConfig");function Sn(e,t,n){const s="kind"in e?e.call?.name:e.name,r=s===void 0?void 0:t.get(s);r!==void 0&&n.set(e.callId,r);for(const i of e.subCalls)Sn(i,t,n)}a(Sn,"captureSchemas");function wr(e){return new Map(e.map(t=>[t.name,t]))}a(wr,"indexTools");function Vr(e,t){let n=0;const s=[];for(const r of t){for(;n<e.length;){const u=e[n];if(u===void 0||u.startSeq>=r.seq)break;u.purpose==="compaction"&&u.status==="running"&&s.push(n),n++}let i=s.pop();for(;i!==void 0&&e[i]?.status!=="running";)i=s.pop();if(i===void 0)continue;const l=e[i];l?.purpose==="compaction"&&(e[i]={...l,completedAt:r.time,status:"error",error:"Compaction was interrupted before completion."})}}a(Vr,"interruptCompactions");function _r(e,t){const n=new Map;for(const[s,r]of e.entries())r.purpose==="assistant"&&n.set(r.turn,s);for(const s of t){if(s.error===void 0)continue;const r=n.get(s.turn);if(r===void 0)continue;const i=e[r];i?.purpose==="assistant"&&(e[r]={...i,completedAt:i.completedAt??s.time,status:"error",error:s.error})}}a(_r,"applyTurnErrors");var Nr=class{static{a(this,"TrajectorySnapshotBuilder")}nodes=new Map;positions=new Map;contributions=[];empty=Nn;replace(e){this.nodes.clear();for(const t of e.nodes)this.nodes.set(t.key,t);return this.rebuildContributions(),this.snapshot()}apply(e){let t=!1;for(const n of e.upserts){const s=this.nodes.get(n.key);if(this.nodes.set(n.key,n),s===void 0||s.anchorSeq!==n.anchorSeq){t=!0;continue}const r=this.positions.get(n.key);r===void 0?t=!0:this.contributions[r]=n}return t&&this.rebuildContributions(),this.snapshot()}snapshot(){const e=new Map;for(const x of this.contributions){if(x.data.kind!=="request-header")continue;const v=vr(x.data.header);v!==void 0&&e.set(v,x.data.header)}const t=[],n=new Map,s=[],r=[],i=[],l=new Map,u=new Set;let p,f=new Map,m=null;const h=[];for(const x of this.contributions){const v=x.data;if(v.kind==="request-header"){p=v.header,f=wr(v.header.prompt.tools);continue}if(v.kind==="node"){t.push(v.node),n.set(v.node.seq,x.location);continue}if(v.kind==="assistant"){const T=v.request===void 0?void 0:xr(v.request,e,p);if(v.node!==void 0&&t.push(br(v.node,T?.prompt)),v.partial!==null&&(m=v.partial),v.request!==void 0){const k=T?.change!==void 0&&!u.has(T.seq);s.push(yr(v.request,T,k)),k&&u.add(T.seq)}continue}if(v.kind==="tool"){"kind"in v.root?t.push(v.root):h.push(v.root),p!==void 0&&p.seq<x.anchorSeq&&Sn(v.root,f,l);continue}if(v.kind==="compaction"){s.push(v.request);continue}if(v.kind==="session-end"){r.push({seq:v.seq,time:v.time});continue}i.push({turn:v.turn,time:v.time,...v.error===void 0?{}:{error:v.error}})}return s.sort((x,v)=>x.startSeq-v.startSeq),Vr(s,r),_r(s,i),t.sort((x,v)=>x.seq-v.seq),{eventNodes:t,eventLocations:n,requests:s,callSchemas:l,partial:m,runningCalls:h}}rebuildContributions(){this.contributions=[...this.nodes.values()].sort((e,t)=>e.anchorSeq-t.anchorSeq||e.key.localeCompare(t.key)),this.positions.clear();for(const[e,t]of this.contributions.entries())this.positions.set(t.key,e)}};const kr={target:"trajectory",create:a(()=>new Nr,"create")};function Sr(e){e.conversationViews.register(kr)}a(Sr,"registerTrajectoryConversationView");const Tn=256;function Tr(e){if(e.event.type!=="tool/call")throw new Error("trajectory-tool-call start requires tool/call");return{callId:String(e.event.data.callId),name:e.event.data.name,argsRaw:e.event.data.arguments,turn:e.event.data.turn,step:e.event.data.step,time:e.event.time,callView:e.view?.for==="call"?e.view.view:null,subCalls:[]}}a(Tr,"rootCall");function Bn(e,t){if(e.event.type!=="tool/result")return;const n=e.event.data.message.content[0];return{kind:"tool-result",seq:e.event.seq,time:e.event.time,callId:String(e.event.data.message.source.callId),call:t===void 0?null:{name:t.name,argsRaw:t.argsRaw},callTime:t?.time??null,content:n.content,isError:n.isError===!0,...e.event.data.error===void 0?{}:{error:e.event.data.error},meta:e.event.data.meta,callView:t?.callView??null,resultView:e.view?.for==="result"?e.view.view:null,subCalls:[]}}a(Bn,"rootResult");function Br(e){return e.location.kind==="step"||e.location.kind==="turn"?e.location.turn.turn:0}a(Br,"locationTurn");function jr(e){return e.location.kind==="step"?e.location.step.step:0}a(jr,"locationStep");function Gr(e,t){return{callId:t.subCallId,name:t.name,argsRaw:JSON.stringify(t.arguments),turn:Br(e),step:jr(e),time:e.event.time,callView:null,subCalls:[]}}a(Gr,"childCall");function Cr(e,t,n){return{kind:"tool-result",seq:e.event.seq,time:e.event.time,callId:t.subCallId,call:{name:t.name,argsRaw:JSON.stringify(t.arguments)},callTime:n===void 0||"kind"in n?null:n.time,content:t.content??[],isError:t.isError===!0,callView:null,resultView:null,subCalls:[]}}a(Cr,"childResult");function Ir(e,t,n){if(t===n||e.parents.has(n))return!1;let s=t,r=0;const i=new Set;for(;s!==void 0;){if(s===n||i.has(s))return!1;i.add(s),r++,s=e.parents.get(s)}const l=[{callId:n,depth:1}],u=new Set;let p=0;for(const f of l){if(u.has(f.callId))return!1;u.add(f.callId),p=Math.max(p,f.depth);for(const m of e.children.get(f.callId)??[])l.push({callId:m,depth:f.depth+1})}return r+p<=Tn}a(Ir,"acceptsEdge");function jn(e,t){const n=t.event;if(n.type!=="tool/code-dispatch-start"&&n.type!=="tool/code-dispatch")return e;const s=n.data,r=String(s.parentCallId),i=String(s.subCallId),l=e.children.get(r)??[],u=l.indexOf(i);if(u<0&&!Ir(e,r,i)||n.type==="tool/code-dispatch-start"&&u>=0)return e;const p=new Map(e.calls);if(p.set(i,n.type==="tool/code-dispatch-start"?Gr(t,s):Cr(t,s,p.get(i))),u>=0)return{...e,calls:p};const f=new Map(e.children);f.set(r,[...l,i]);const m=new Map(e.parents);return m.set(i,r),{...e,calls:p,children:f,parents:m}}a(jn,"updateDispatch");function Rr(e){const t=e.start?.location;if(t?.kind==="step"&&t.step.status==="closed")return t.step.end;if((t?.kind==="step"||t?.kind==="turn")&&t.turn.status==="closed")return t.turn.end}a(Rr,"interruption");function Gn(e,t,n,s=new Set,r=1){const i=e.calls.get(t);if(i===void 0)return;if(s.has(t)||r>Tn)return{...i,subCalls:[]};const l=new Set(s);l.add(t);const u=(e.children.get(t)??[]).flatMap(p=>{const f=Gn(e,p,n,l,r+1);return f===void 0?[]:[f]});return"kind"in i||n===void 0?{...i,subCalls:u}:{kind:"tool-result",seq:n.seq-.8,time:n.time,callId:i.callId,call:{name:i.name,argsRaw:i.argsRaw},callTime:i.time,content:[],isError:!0,error:{name:"Interrupted",code:"interrupted"},callView:i.callView,resultView:null,subCalls:u}}a(Gn,"projectCall");function Mr(e){const t=e.matches.find(r=>r.event.type==="tool/result"),n=t===void 0?void 0:Bn(t);if(n===void 0)return;let s={rootId:n.callId,calls:new Map([[n.callId,n]]),children:new Map,parents:new Map};for(const r of e.matches)s=jn(s,r);return s}a(Mr,"fallbackState");const Er={kind:"trajectory-tool-call",target:"trajectory",match:a(e=>{if(e.type==="tool/call")return{id:String(e.data.callId),role:"start"};if(e.type==="tool/result")return{id:String(e.data.message.source.callId),role:"update"};if(e.type==="tool/code-dispatch-start"||e.type==="tool/code-dispatch"){const t=e.data.rootCallId;return typeof t=="string"&&t!==""?{id:t,role:"update"}:null}return null},"match"),start:a((e,t)=>{const n=Tr(t);return{rootId:n.callId,calls:new Map([[n.callId,n]]),children:new Map,parents:new Map}},"start"),update:a((e,t)=>{if(t.event.type!=="tool/result")return jn(e.state,t);const n=e.state.calls.get(e.state.rootId),s=Bn(t,n!==void 0&&!("kind"in n)?n:void 0);if(s===void 0)return e.state;const r=new Map(e.state.calls);return r.set(e.state.rootId,s),{...e.state,calls:r}},"update"),buildViewNode:a(e=>{const t=e.state??Mr(e);if(t===void 0)return null;const n=Gn(t,t.rootId,Rr(e));return n===void 0?null:$e(e,e.start?.event.seq??("kind"in n?n.seq:e.matches[0]?.event.seq??0),{kind:"tool",root:n})},"buildViewNode")};function Dr(e){e.conversationEvents.register(Er)}a(Dr,"registerTrajectoryToolDefinition");function Pr(e,t,n){const s=new Array(e);return new Proxy(s,{get(r,i,l){if(typeof i=="string"){const u=i.charCodeAt(0);if(u>=48&&u<=57){const p=+i;if(Number.isInteger(p)&&p>=0&&p<e){let f=r[p];if(!f){const m=t[p*2];f=r[p]={index:p,key:n(p),start:m,size:t[p*2+1],end:m+t[p*2+1],lane:0}}return f}}if(i==="length")return e}return Reflect.get(r,i,l)}})}a(Pr,"createLazyMeasurementsView");function Qe(e,t,n){let s=n.initialDeps??[],r,i=!0;function l(){const u=e();return(u.length!==s.length||u.some((p,f)=>s[f]!==p))&&(s=u,r=t(...u),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(r),i=!1),r}return a(l,"memoizedFunction"),l.updateDeps=u=>{s=u},l}a(Qe,"memo$1");function Cn(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}a(Cn,"notUndefined");const qr=a((e,t)=>Math.abs(e-t)<1.01,"approxEqual"),Or=a((e,t,n)=>{let s;return function(...r){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,r),n)}},"debounce");let lt;const Xt=a(()=>{if(lt!==void 0)return lt;if(typeof navigator>"u")return lt=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return lt=!0;const e=navigator.maxTouchPoints;return lt=navigator.platform==="MacIntel"&&e!==void 0&&e>0},"isIOSWebKit"),In=a(e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},"getRect"),Ar=a(e=>e,"defaultKeyExtractor"),Lr=a(e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(n);for(let r=0;r<n;r++)s[r]=t+r;return s},"defaultRangeExtractor"),$r=a((e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const r=a(l=>{const{width:u,height:p}=l;t({width:Math.round(u),height:Math.round(p)})},"handler");if(r(In(n)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const u=a(()=>{const p=l[0];if(p?.borderBoxSize){const f=p.borderBoxSize[0];if(f){r({width:f.inlineSize,height:f.blockSize});return}}r(In(n))},"run");e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},"observeElementRect"),_t={passive:!0},zr=typeof window>"u"?!0:"onscrollend"in window,Wr=a((e,t,n)=>{const s=e.scrollElement;if(!s)return;const r=e.targetWindow;if(!r)return;const i=e.options.useScrollendEvent&&zr;let l=0;const u=i?null:Or(r,()=>t(l,!1),e.options.isScrollingResetDelay),p=a(h=>()=>{l=n(s),u?.(),t(l,h)},"createHandler"),f=p(!0),m=p(!1);return s.addEventListener("scroll",f,_t),i&&s.addEventListener("scrollend",m,_t),()=>{s.removeEventListener("scroll",f),i&&s.removeEventListener("scrollend",m)}},"observeOffset"),Hr=a((e,t)=>Wr(e,t,n=>{const{horizontal:s,isRtl:r}=e.options;return s?n.scrollLeft*(r&&-1||1):n.scrollTop}),"observeElementOffset"),Fr=a((e,t,n)=>{if(n.options.useCachedMeasurements){const s=n.indexFromElement(e),r=n.options.getItemKey(s);return n.itemSizeCache.get(r)??n.options.estimateSize(s)}if(t?.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const s=n.indexFromElement(e),r=n.options.getItemKey(s),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},"measureElement"),Xr=a((e,{adjustments:t=0,behavior:n},s)=>{var r,i;(i=(r=s.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[s.options.horizontal?"left":"top"]:e+t,behavior:n})},"scrollWithAdjustments");var Yr=class{static{a(this,"Virtualizer")}constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,n,s;return((s=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:s.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=a(()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(r=>{const i=a(()=>{const l=r.target,u=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);for(const[p,f]of this.elementsCache)if(f===l){this.elementsCache.delete(p);break}return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(l,r,this))},"run");this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})})),"get");return{disconnect:a(()=>{var s;(s=n())==null||s.disconnect(),t=null},"disconnect"),observe:a(s=>{var r;return(r=n())==null?void 0:r.observe(s,{box:"border-box"})},"observe"),unobserve:a(s=>{var r;return(r=n())==null?void 0:r.unobserve(s)},"unobserve")}})(),this.range=null,this.setOptions=t=>{var n,s;const r={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ar,rangeExtractor:Lr,onChange:a(()=>{},"onChange"),measureElement:Fr,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in t){const x=t[h];x!==void 0&&(r[h]=x)}const i=this.options;let l=null,u=null,p=!1;if(i!==void 0&&i.enabled&&r.enabled&&r.anchorTo==="end"&&this.scrollElement!==null){const h=i.count,x=r.count,v=this.getMeasurements(),T=h>0?((n=v[0])==null?void 0:n.key)??i.getItemKey(0):null,k=h>0?((s=v[h-1])==null?void 0:s.key)??i.getItemKey(h-1):null;if(x!==h||h>0&&x>0&&(r.getItemKey(0)!==T||r.getItemKey(x-1)!==k)){p=!0;const S=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??v[0]:null;S&&(l=[S.key,this.getScrollOffset()-S.start]);const w=r.followOnAppend===!0?"auto":r.followOnAppend||null;w&&x>h&&this.isAtEnd(i.scrollEndThreshold)&&(h===0||r.getItemKey(x-1)!==k)&&(u=w)}}this.options=r,p&&(this.pendingMin=0,this.itemSizeCacheVersion++);let f=!1,m=0;if(l&&this.scrollOffset!==null){const[h,x]=l,v=this.getMeasurements(),{count:T,getItemKey:k}=this.options;let S=0;for(;S<T&&k(S)!==h;)S++;if(S<T){const w=v[S];if(w){const B=Math.max(0,w.start+x);B!==this.scrollOffset&&(m=B-this.scrollOffset,this.scrollOffset=B,f=!0)}}}(f||u)&&(this.pendingScrollAnchor=[f?l[0]:null,f?l[1]:0,u,m])},this.notify=t=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,t)},this.maybeNotify=Qe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:a(()=>this.options.debug,"debug"),initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}if(this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{if(i&&this._intendedScrollOffset===null&&r===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(r-this._intendedScrollOffset)<1.5&&(r=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const l=this.getScrollOffset();this.scrollDirection=i?l===r?this.scrollDirection:l<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const r=this.scrollElement,i=a(()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},"onTouchStart"),l=a(()=>{this._iosTouching=!1,!(!Xt()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))},"onTouchEnd");r.addEventListener("touchstart",i,_t),r.addEventListener("touchend",l,_t),this.unsubs.push(()=>{r.removeEventListener("touchstart",i),r.removeEventListener("touchend",l),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[r,i,l,u]=s;r!==null&&!l&&(Xt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l&&this.scrollToEnd({behavior:l})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),n=this.getMaxScrollOffset();if(t<0||t>n)return;if(this._iosDeferredAdjustment<0&&t>=n-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Qe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,n,s,r,i,l,u,p)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:t,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:i,lanes:l,laneAssignmentMode:u,gap:p}),{key:!1}),this.getMeasurements=Qe(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:i,lanes:l,laneAssignmentMode:u,gap:p},f)=>{const m=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const S of this.laneAssignments.keys())S>=t&&this.laneAssignments.delete(S);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(S=>{this.itemSizeCache.set(S.key,S.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),l===1){const S=t*2;let w=this._flatMeasurements;if(!w||w.length<S){const I=new Float64Array(S);w&&h>0&&I.set(w.subarray(0,h*2)),w=I,this._flatMeasurements=w}let B;if(h===0)B=n+s;else{const I=h-1;B=w[I*2]+w[I*2+1]+p}for(let I=h;I<t;I++){const D=r(I),ee=m.get(D),E=typeof ee=="number"?ee:this.options.estimateSize(I);w[I*2]=B,w[I*2+1]=E,B+=E+p}const C=Pr(t,w,r);return this.measurementsCache=C,C}const x=this.measurementsCache.slice(0,h),v=new Array(l).fill(void 0),T=new Float64Array(l);let k=0;for(let S=0;S<h;S++){const w=x[S];w&&(v[w.lane]===void 0&&k++,v[w.lane]=S,T[w.lane]=w.end)}for(let S=h;S<t;S++){const w=r(S),B=this.laneAssignments.get(S);let C,I;const D=u==="estimate"||m.has(w);if(B!==void 0&&this.options.lanes>1){C=B;const g=v[C],y=g!==void 0?x[g]:void 0;I=y?y.end+p:n+s}else if(k===l){let g=0,y=T[0],P=v[0];for(let N=1;N<l;N++){const R=T[N];(R<y||R===y&&v[N]<P)&&(g=N,y=R,P=v[N])}C=g,I=y+p,D&&this.laneAssignments.set(S,C)}else C=S%this.options.lanes,I=n+s,D&&this.laneAssignments.set(S,C);const ee=m.get(w),E=typeof ee=="number"?ee:this.options.estimateSize(S),xe=I+E;x[S]={index:S,start:I,size:E,end:xe,key:w,lane:C},v[C]===void 0&&k++,v[C]=S,T[C]=xe}return this.measurementsCache=x,x},{key:!1,debug:a(()=>this.options.debug,"debug")}),this.calculateRange=Qe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,s,r)=>t.length===0||n===0?(this.range=null,null):(this.range=Ur(t,n,s,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:a(()=>this.options.debug,"debug")}),this.getVirtualIndexes=Qe(()=>{let t=null,n=null;const s=this.calculateRange();return s&&(t=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,s,r,i)=>r===null||i===null?[]:t({startIndex:r,endIndex:i,overscan:n,count:s}),{key:!1,debug:a(()=>this.options.debug,"debug")}),this.indexFromElement=t=>{const n=this.options.indexAttribute,s=t.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(s!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-r),l=Math.min(this.options.count-1,s+r);return t>=i&&t<=l}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,l)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(l))});return}const n=this.indexFromElement(t),s=this.options.getItemKey(n),r=this.elementsCache.get(s);r!==t&&(r&&this.observer.unobserve(r),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var s,r;if(t<0||t>=this.options.count)return;let i,l,u;const p=this._flatMeasurements;if(this.options.lanes===1&&p!==null)u=this.options.getItemKey(t),l=p[t*2],i=p[t*2+1];else{const h=this.measurementsCache[t];if(!h)return;u=h.key,l=h.start,i=h.size}const f=this.itemSizeCache.get(u)??i,m=n-f;if(m!==0){const h=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=h?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,T=this.itemSizeCache.has(u)?l+f<=v&&this.scrollDirection!=="backward":l<v,k=((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:l,size:i,end:l+i,lane:0},m,this):T);(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,n),this.itemSizeCacheVersion++;let S=!1;h?S=this.applyScrollAdjustment(this.getTotalSize()-x):k&&(S=this.applyScrollAdjustment(m)),this.notify(S)}},this.getVirtualItems=Qe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const s=[];for(let r=0,i=t.length;r<i;r++){const l=n[t[r]];s.push(l)}return s},{key:!1,debug:a(()=>this.options.debug,"debug")}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length===0)return;const s=this._flatMeasurements,r=this.options.lanes===1&&s!=null;return Cn(n[Rn(0,n.length-1,r?i=>s[i*2]:i=>Cn(n[i]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,n,s=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),i=this.getScrollOffset();n==="auto"&&(n=t>=i+r?"end":"start"),n==="center"?t+=(s-r)/2:n==="end"&&(t-=r);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[t];if(!i)return;if(n==="auto")if(i.end>=r+s-this.options.scrollPaddingEnd)n="end";else if(i.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const l=n==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,n,i.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const r=this.getOffsetForAlignment(t,n),i=this.now();this.scrollState={index:null,align:n,behavior:s,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const r=this.getOffsetForIndex(t,n);if(!r)return;const[i,l]=r,u=this.now();this.scrollState={index:t,align:l,behavior:s,startedAt:u,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const s=this.getScrollOffset()+t,r=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const r=n.length-1,i=this._flatMeasurements;i!=null?s=i[r*2]+i[r*2+1]:s=((t=n[r])==null?void 0:t.end)??0}else{const r=Array(this.options.lanes).fill(null);let i=n.length-1;for(;i>=0&&r.some(l=>l===null);){const l=n[i];r[l.lane]===null&&(r[l.lane]=l.end),i--}s=Math.max(...r.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const n=this.getMeasurements();for(const s of n)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:n,behavior:s})=>{this._intendedScrollOffset=t+(n??0),this.options.scrollToFn(t,{behavior:s,adjustments:n},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e===0?!1:Xt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,n=1,s=t!==this.scrollState.lastTargetOffset;if(!s&&qr(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const r=this.getSize()||600,i=Math.abs(t-this.getScrollOffset()),l=this.scrollState.behavior==="smooth"&&i>r;this.scrollState.lastTargetOffset=t,l||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:l?"smooth":"auto"})}this.scheduleScrollReconcile()}};const Rn=a((e,t,n,s)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<s)e=r+1;else if(i>s)t=r-1;else return r}return e>0?e-1:0},"findNearestBinarySearch");function Jr(e,t,n){let s=0;for(;s<=t;){const r=(s+t)/2|0,i=e[r*2];if(i<n)s=r+1;else if(i>n)t=r-1;else return r}return s>0?s-1:0}a(Jr,"findNearestBinarySearchFlat");function Ur(e,t,n,s,r){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&r!==null){const f=Jr(r,i,n);let m=f;const h=n+t;for(;m<i&&r[m*2]+r[m*2+1]<h;)m++;return{startIndex:f,endIndex:m}}let u=Rn(0,i,a(f=>e[f].start,"getStart"),n),p=u;if(s===1)for(;p<i&&e[p].end<n+t;)p++;else if(s>1){const f=Array(s).fill(0);for(;p<i&&f.some(h=>h<n+t);){const h=e[p];f[h.lane]=h.end,p++}const m=Array(s).fill(n+t);for(;u>=0&&m.some(h=>h>=n);){const h=e[u];m[h.lane]=h.start,u--}u=Math.max(0,u-u%s),p=Math.min(i,p+(s-1-p%s))}return{startIndex:u,endIndex:p}}a(Ur,"calculateRangeImpl");const Yt=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Qr({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...s}){const r=b.useReducer(m=>m+1,0)[1],i=b.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const l=a(m=>{const h=i.current;if(!h.enabled||!h.container)return;const x=m.getTotalSize();if(x!==h.lastSize){h.lastSize=x;const v=m.options.horizontal?"width":"height";h.container.style[v]=`${x}px`}},"applyContainerSize"),u=a(m=>{const h=i.current;if(!h.enabled||!h.container)return;l(m);const x=!!m.options.horizontal,v=h.mode==="transform",T=x?"left":"top",k=m.options.scrollMargin,S=m.getVirtualItems();for(const w of S){const B=w.start-k,C=m.elementsCache.get(w.key);C&&h.lastPositions.get(C)!==B&&(h.lastPositions.set(C,B),v?C.style.transform=x?`translate3d(${B}px, 0, 0)`:`translate3d(0, ${B}px, 0)`:C.style[T]=`${B}px`)}},"applyDirectStyles"),p={...s,onChange:a((m,h)=>{var x;const v=i.current;let T=!0;if(v.enabled){u(m);const k=m.range,S=v.prevRange;T=!S||S.isScrolling!==m.isScrolling||S.startIndex!==k?.startIndex||S.endIndex!==k?.endIndex,T&&(v.prevRange=k?{startIndex:k.startIndex,endIndex:k.endIndex,isScrolling:m.isScrolling}:null)}T&&(e&&h?(0,Hs.flushSync)(r):r()),(x=s.onChange)==null||x.call(s,m,h)},"onChange")},[f]=b.useState(()=>{const m=new Yr(p);return Object.assign(m,{containerRef:a(h=>{const x=i.current;if(x.container=h,x.lastSize=null,h&&x.enabled){const v=m.getTotalSize();x.lastSize=v;const T=m.options.horizontal?"width":"height";h.style[T]=`${v}px`}},"containerRef")})});return f.setOptions(p),Yt(()=>f._didMount(),[]),Yt(()=>(l(f),f._willUpdate())),Yt(()=>{u(f)}),f}a(Qr,"useVirtualizerBase");function Kr(e){return Qr({observeElementRect:$r,observeElementOffset:Hr,scrollToFn:Xr,...e})}a(Kr,"useVirtualizer");var De=class{static{a(this,"Diff")}diff(e,t,n={}){let s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);const r=this.castInput(e,n),i=this.castInput(t,n),l=this.removeEmpty(this.tokenize(r,n)),u=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(l,u,n,s)}diffWithOptionsObj(e,t,n,s){var r;const i=a(w=>{if(w=this.postProcess(w,n),s){setTimeout(function(){s(w)},0);return}else return w},"done"),l=t.length,u=e.length;let p=1,f=l+u;n.maxEditLength!=null&&(f=Math.min(f,n.maxEditLength));const m=(r=n.timeout)!==null&&r!==void 0?r:1/0,h=Date.now()+m,x=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(x[0],t,e,0,n);if(x[0].oldPos+1>=u&&v+1>=l)return i(this.buildValues(x[0].lastComponent,t,e));let T=-1/0,k=1/0;const S=a(()=>{for(let w=Math.max(T,-p);w<=Math.min(k,p);w+=2){let B;const C=x[w-1],I=x[w+1];C&&(x[w-1]=void 0);let D=!1;if(I){const E=I.oldPos-w;D=I&&0<=E&&E<l}const ee=C&&C.oldPos+1<u;if(!D&&!ee){x[w]=void 0;continue}if(!ee||D&&C.oldPos<I.oldPos?B=this.addToPath(I,!0,!1,0,n):B=this.addToPath(C,!1,!0,1,n),v=this.extractCommon(B,t,e,w,n),B.oldPos+1>=u&&v+1>=l)return i(this.buildValues(B.lastComponent,t,e))||!0;x[w]=B,B.oldPos+1>=u&&(k=Math.min(k,w-1)),v+1>=l&&(T=Math.max(T,w+1))}p++},"execEditLength");if(s)a((function w(){setTimeout(function(){if(p>f||Date.now()>h)return s(void 0);S()||w()},0)}),"exec")();else for(;p<=f&&Date.now()<=h;){const w=S();if(w)return w}}addToPath(e,t,n,s,r){const i=e.lastComponent;return i&&!r.oneChangePerToken&&i.added===t&&i.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}}extractCommon(e,t,n,s,r){const i=t.length,l=n.length;let u=e.oldPos,p=u-s,f=0;for(;p+1<i&&u+1<l&&this.equals(n[u+1],t[p+1],r);)p++,u++,f++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return f&&!r.oneChangePerToken&&(e.lastComponent={count:f,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,p}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){const s=[];let r;for(;e;)s.push(e),r=e.previousComponent,delete e.previousComponent,e=r;s.reverse();const i=s.length;let l=0,u=0,p=0;for(;l<i;l++){const f=s[l];if(f.removed)f.value=this.join(n.slice(p,p+f.count)),p+=f.count;else{if(!f.added&&this.useLongestToken){let m=t.slice(u,u+f.count);m=m.map(function(h,x){const v=n[p+x];return v.length>h.length?v:h}),f.value=this.join(m)}else f.value=this.join(t.slice(u,u+f.count));u+=f.count,f.added||(p+=f.count)}}return s}},Zr=class extends De{static{a(this,"CharacterDiff")}};new Zr;function Mn(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}a(Mn,"longestCommonPrefix");function En(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}a(En,"longestCommonSuffix");function Jt(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}a(Jt,"replacePrefix");function Ut(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}a(Ut,"replaceSuffix");function ct(e,t){return Jt(e,t,"")}a(ct,"removePrefix");function Nt(e,t){return Ut(e,t,"")}a(Nt,"removeSuffix");function Dn(e,t){return t.slice(0,eo(e,t))}a(Dn,"maximumOverlap");function eo(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let s=t.length;e.length<t.length&&(s=e.length);const r=Array(s);let i=0;r[0]=0;for(let l=1;l<s;l++){for(t[l]==t[i]?r[l]=r[i]:r[l]=i;i>0&&t[l]!=t[i];)i=r[i];t[l]==t[i]&&i++}i=0;for(let l=n;l<e.length;l++){for(;i>0&&e[l]!=t[i];)i=r[i];e[l]==t[i]&&i++}return i}a(eo,"overlapCount");function Pn(e,t){const n=[];for(const s of Array.from(t.segment(e))){const r=s.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(r)?n[n.length-1]+=r:n.push(r)}return n}a(Pn,"segment");function Qt(e,t){if(t)return dt(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}a(Qt,"trailingWs");function Ke(e,t){if(t)return dt(e,t)[0];const n=e.match(/^\s*/);return n?n[0]:""}a(Ke,"leadingWs");function dt(e,t){if(!t)return[Ke(e),Qt(e)];if(t.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');const n=Pn(e,t),s=n[0],r=n[n.length-1];return[/\s/.test(s)?s:"",/\s/.test(r)?r:""]}a(dt,"leadingAndTrailingWs");const kt="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",to=new RegExp(`[${kt}]+|\\s+|[^${kt}]`,"ug");var no=class extends De{static{a(this,"WordDiff")}equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){const i=t.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Pn(e,i)}else n=e.match(to)||[];const s=[];let r=null;return n.forEach(i=>{/\s/.test(i)?r==null?s.push(i):s.push(s.pop()+i):r!=null&&/\s/.test(r)?s[s.length-1]==r?s.push(s.pop()+i):s.push(r+i):s.push(i),r=i}),s}join(e){return e.map((t,n)=>n==0?t:t.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,s=null,r=null;return e.forEach(i=>{i.added?s=i:i.removed?r=i:((s||r)&&qn(n,r,s,i,t.intlSegmenter),n=i,s=null,r=null)}),(s||r)&&qn(n,r,s,null,t.intlSegmenter),e}};new no;function qn(e,t,n,s,r){if(t&&n){const[i,l]=dt(t.value,r),[u,p]=dt(n.value,r);if(e){const f=Mn(i,u);e.value=Ut(e.value,u,f),t.value=ct(t.value,f),n.value=ct(n.value,f)}if(s){const f=En(l,p);s.value=Jt(s.value,p,f),t.value=Nt(t.value,f),n.value=Nt(n.value,f)}}else if(n){if(e){const i=Ke(n.value,r);n.value=n.value.substring(i.length)}if(s){const i=Ke(s.value,r);s.value=s.value.substring(i.length)}}else if(e&&s){const i=Ke(s.value,r),[l,u]=dt(t.value,r),p=Mn(i,l);t.value=ct(t.value,p);const f=En(ct(i,p),u);t.value=Nt(t.value,f),s.value=Jt(s.value,i,f),e.value=Ut(e.value,i,i.slice(0,i.length-f.length))}else if(s){const i=Ke(s.value,r),l=Dn(Qt(t.value,r),i);t.value=Nt(t.value,l)}else if(e){const i=Dn(Qt(e.value,r),Ke(t.value,r));t.value=ct(t.value,i)}}a(qn,"dedupeWhitespaceInChangeObjects");var so=class extends De{static{a(this,"WordsWithSpaceDiff")}tokenize(e){const t=new RegExp(`(\\r?\\n)|[${kt}]+|[^\\S\\n\\r]+|[^${kt}]`,"ug");return e.match(t)||[]}};new so;var ro=class extends De{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=An}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
2
2
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
3
3
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
4
4
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
5
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};const oo=new ro;function
|
|
6
|
-
`));const n=[],s=e.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(let r=0;r<s.length;r++){const i=s[r];r%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}a(
|
|
7
|
-
`)?B.lines[C]=B.lines[C].slice(0,-1):(B.lines.splice(C+1,0,"\"),C++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:i,hunks:
|
|
5
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};const oo=new ro;function On(e,t,n){return oo.diff(e,t,n)}a(On,"diffLines");function An(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
6
|
+
`));const n=[],s=e.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(let r=0;r<s.length;r++){const i=s[r];r%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}a(An,"tokenize");function io(e){return e=="."||e=="!"||e=="?"}a(io,"isSentenceEndPunct");var ao=class extends De{static{a(this,"SentenceDiff")}tokenize(e){var t;const n=[];let s=0;for(let r=0;r<e.length;r++){if(r==e.length-1){n.push(e.slice(s));break}if(io(e[r])&&e[r+1].match(/\s/)){for(n.push(e.slice(s,r+1)),r=s=r+1;!((t=e[r+1])===null||t===void 0)&&t.match(/\s/);)r++;n.push(e.slice(s,r+1)),s=r+1}}return n}};new ao;var lo=class extends De{static{a(this,"CssDiff")}tokenize(e){return e.split(/([{}:;,]|\s+)/)}};new lo;var co=class extends De{static{a(this,"JsonDiff")}constructor(){super(...arguments),this.tokenize=An}get useLongestToken(){return!0}castInput(e,t){const{undefinedReplacement:n,stringifyReplacer:s=a((r,i)=>typeof i>"u"?n:i,"stringifyReplacer")}=t;return typeof e=="string"?e:JSON.stringify(Kt(e,null,null,s),null," ")}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),n)}};new co;function Kt(e,t,n,s,r){t=t||[],n=n||[],s&&(e=s(r===void 0?"":r,e));let i;for(i=0;i<t.length;i+=1)if(t[i]===e)return n[i];let l;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),l=new Array(e.length),n.push(l),i=0;i<e.length;i+=1)l[i]=Kt(e[i],t,n,s,String(i));return t.pop(),n.pop(),l}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){t.push(e),l={},n.push(l);const u=[];let p;for(p in e)Object.prototype.hasOwnProperty.call(e,p)&&u.push(p);for(u.sort(),i=0;i<u.length;i+=1)p=u[i],l[p]=Kt(e[p],t,n,s,p);t.pop(),n.pop()}else l=e;return l}a(Kt,"canonicalize");var uo=class extends De{static{a(this,"ArrayDiff")}tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};new uo;function po(e,t,n,s,r,i,l){let u;l?typeof l=="function"?u={callback:l}:u=l:u={},typeof u.context>"u"&&(u.context=4);const p=u.context;if(u.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(u.callback){const{callback:m}=u;On(n,s,Object.assign(Object.assign({},u),{callback:a(h=>{const x=f(h);m(x)},"callback")}))}else return f(On(n,s,u));function f(m){if(!m)return;m.push({value:"",lines:[]});function h(B){return B.map(function(C){return" "+C})}a(h,"contextLines");const x=[];let v=0,T=0,k=[],S=1,w=1;for(let B=0;B<m.length;B++){const C=m[B],I=C.lines||ho(C.value);if(C.lines=I,C.added||C.removed){if(!v){const D=m[B-1];v=S,T=w,D&&(k=p>0?h(D.lines.slice(-p)):[],v-=k.length,T-=k.length)}for(const D of I)k.push((C.added?"+":"-")+D);C.added?w+=I.length:S+=I.length}else{if(v)if(I.length<=p*2&&B<m.length-2)for(const D of h(I))k.push(D);else{const D=Math.min(I.length,p);for(const E of h(I.slice(0,D)))k.push(E);const ee={oldStart:v,oldLines:S-v+D,newStart:T,newLines:w-T+D,lines:k};x.push(ee),v=0,T=0,k=[]}S+=I.length,w+=I.length}}for(const B of x)for(let C=0;C<B.lines.length;C++)B.lines[C].endsWith(`
|
|
7
|
+
`)?B.lines[C]=B.lines[C].slice(0,-1):(B.lines.splice(C+1,0,"\"),C++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:i,hunks:x}}a(f,"diffLinesResultToPatch")}a(po,"structuredPatch");function ho(e){const t=e.endsWith(`
|
|
8
8
|
`),n=e.split(`
|
|
9
9
|
`).map(s=>s+`
|
|
10
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}a(ho,"splitLines");function he(e){return e.recordId!==void 0?e.recordId:e.callId!==void 0?`${e.kind}\0call\0${e.callId}`:e.sourceSeq!==void 0?`${e.kind}\0seq\0${e.sourceSeq}`:`${e.kind}\0index\0${e.index}`}a(he,"trajectoryRecordId");function On(e){return e===null||!Number.isFinite(e)?"—":`${String(Math.round(e)).replace(/\B(?=(\d{3})+(?!\d))/g,",")} ms`}a(On,"formatDurationMillis");function tt(e){return On(e===null?null:e*1e3)}a(tt,"formatElapsedSeconds");const fo=30,mo=20,go=9;function Nt(e){const t=encodeURIComponent(he(e.cell));return e.collapsedSummaryKind===void 0?t:`${t}\0summary\0${e.collapsedSummaryKind}`}a(Nt,"trajectoryVirtualRecordKey");function vo(e){const t=[];let n=[];for(const[s,r]of e.entries()){const i={logicalIndex:s,record:r};if(r.cell.requestOnly===!0){n.push(i);continue}const l=[...n,i];n=[],t.push({entries:l,height:r.collapsedSummaryKind===void 0?fo:mo,key:Nt(r)})}return n.length>0&&t.push({entries:n,height:go,key:n.map(s=>Nt(s.record)).join("|")}),t}a(vo,"groupTrajectoryVirtualRows");const xo=2048,yo=512;function ut(e){const t=e.slice(0,xo),n=(0,ee.extractMarkdownPlainText)(t).replace(/\s+/g," ").trim(),s=n.slice(0,yo).trimEnd();return t.length<e.length||s.length<n.length?`${s}…`:s}a(ut,"trajectoryPreviewText");const bo='.BVVeNG_split{--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);background:var(--dsw-alias-bg-layer-1);flex:1;width:100%;min-height:0;display:flex;position:relative;overflow:hidden;container-type:inline-size}.BVVeNG_tablePane{min-width:0;padding-bottom:var(--dsh-trajectory-bottom-clearance,0px);flex:1;position:relative;overflow:hidden auto;container:BVVeNG_trajectory-table/inline-size}.BVVeNG_historyLoading{z-index:5;pointer-events:none;height:0;position:sticky;top:0;overflow:visible}.BVVeNG_historyLoadingBar{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);width:100%;height:30px;color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);justify-content:center;align-items:center;gap:6px;display:flex}.BVVeNG_historyLoadingSpinner{box-sizing:border-box;border:1.5px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-state-business-primary);border-radius:50%;width:10px;height:10px;animation:.7s linear infinite BVVeNG_history-loading-spin}.BVVeNG_table tbody .BVVeNG_historyLoadRow td{height:30px;padding:0}.BVVeNG_table tbody .BVVeNG_historyLoadRow+tr[data-turn-start=true] td:before{content:none}.BVVeNG_historyLoadButton{background:var(--dsw-alias-bg-layer-1);width:100%;height:29px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:var(--dsw-font-xxs-12);border:0;justify-content:center;align-items:center;gap:6px;display:flex}.BVVeNG_historyLoadButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.BVVeNG_historyLoadButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.BVVeNG_historyLoadButton:disabled{cursor:default}.BVVeNG_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.BVVeNG_table:not([data-scroll-ready=true]){visibility:hidden}@keyframes BVVeNG_history-loading-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.BVVeNG_historyLoadingSpinner{animation:none}}.BVVeNG_table{--trajectory-turn-accent:color-mix(in srgb, var(--dsw-static-blue-500) 22%, var(--dsw-alias-bg-layer-1));border-spacing:0;table-layout:fixed;width:100%;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);font:var(--dsw-font-xxs-12)}.BVVeNG_eventColumn{width:122px}.BVVeNG_contentColumn{width:auto}.BVVeNG_table th{z-index:3;box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);height:30px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-specific-sidebar-fill);font:var(--dsw-font-xxs-12);text-align:left;text-overflow:ellipsis;user-select:none;white-space:nowrap;padding:0 8px;font-weight:500;position:sticky;top:0;overflow:hidden}.BVVeNG_eventHeader{text-align:right!important;padding-right:4px!important}.BVVeNG_table td{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l1);text-overflow:ellipsis;white-space:nowrap;height:30px;padding:0 8px;overflow:hidden}.BVVeNG_table tbody .BVVeNG_virtualSpacer{pointer-events:none}.BVVeNG_table tbody .BVVeNG_virtualSpacer td{height:var(--trajectory-virtual-spacer-height);border:0;padding:0}.BVVeNG_table tbody tr:not([data-collapsed-summary]):not([data-virtual-spacer]):not([data-history-load]){cursor:default;transition:background-color .12s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out);outline:none}.BVVeNG_table tbody tr[data-timeline-focus=outside]{opacity:.24}.BVVeNG_table tbody tr:not([data-collapsed-summary]):not([data-virtual-spacer]):not([data-history-load]):not([data-selected=true]):hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_table tbody tr[data-request-only=true]:hover{background:0 0}.BVVeNG_table tbody tr[data-request-only=true] td{border-bottom:0;height:0;padding-top:0;padding-bottom:0}.BVVeNG_table tbody tr[data-terminal-request-boundary=true] td{height:9px}.BVVeNG_table tbody tr[data-request-only=true] .BVVeNG_turnRail{top:-15px;bottom:0}.BVVeNG_table tbody tr:not([data-collapsed-summary]):focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-state-business-primary)}.BVVeNG_table tbody tr[data-selected=true]{background:var(--dsw-alias-interactive-bg-active)}.BVVeNG_requestBoundaryControl{--request-boundary-base-left:12px;z-index:6;top:-8px;left:calc(var(--request-boundary-base-left) + var(--request-boundary-offset,0px));cursor:pointer;background:0 0;border:0;width:16px;height:16px;padding:0;position:absolute}.BVVeNG_requestBoundaryControl:before{background:var(--dsw-alias-label-caption);width:5px;height:5px;box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-1), 0 0 0 3px transparent;content:"";transition:background .12s var(--ds-ease-in-out), box-shadow .12s var(--ds-ease-in-out);border-radius:50%;position:absolute;top:5.5px;left:5.5px}.BVVeNG_requestBoundaryControl:after{border:1px solid var(--dsw-alias-border-l1);width:max-content;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);content:attr(data-label);font:9px/12px var(--ds-font-family-code);opacity:0;pointer-events:none;transition:opacity .12s var(--ds-ease-in-out), transform .12s var(--ds-ease-in-out);user-select:none;white-space:nowrap;border-radius:2px;padding:0 4px;position:absolute;top:2px;left:17px;transform:translate(-2px);box-shadow:0 2px 6px #0000001f}.BVVeNG_requestBoundaryControl:hover:before,.BVVeNG_requestBoundaryControl:focus-visible:before{background:var(--dsw-alias-brand-primary-new-colorprimary-new-color)}.BVVeNG_requestBoundaryControlActive:before,.BVVeNG_requestBoundaryControlActive:hover:before,.BVVeNG_requestBoundaryControlActive:focus-visible:before{background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 18%, var(--dsw-alias-bg-layer-1));box-shadow:0 0 0 1.5px var(--dsw-alias-brand-primary-new-colorprimary-new-color)}.BVVeNG_requestBoundaryControl[data-request-status=error]:before,.BVVeNG_requestBoundaryControl[data-request-status=error]:hover:before,.BVVeNG_requestBoundaryControl[data-request-status=error]:focus-visible:before{background:var(--dsw-alias-state-error-primary)}.BVVeNG_requestBoundaryControl:hover:after,.BVVeNG_requestBoundaryControl:focus-visible:after{opacity:1;transform:translate(0)}.BVVeNG_requestBoundaryControl:focus-visible{outline:none}.BVVeNG_table tbody tr:has(.BVVeNG_requestBoundaryControl:hover):not([data-selected=true]){background:0 0}.BVVeNG_event{position:relative}.BVVeNG_turnRail,.BVVeNG_selectionRail{background:var(--dsw-alias-brand-primary-new-colorprimary-new-color);pointer-events:none;position:absolute;left:0}.BVVeNG_turnRail{z-index:4;background:var(--trajectory-turn-accent);width:2px;top:-1px;bottom:-1px}.BVVeNG_table tbody tr[data-turn-end=true] .BVVeNG_turnRail{bottom:0}.BVVeNG_selectionRail{z-index:5;width:3px;top:0;bottom:0}.BVVeNG_table tbody tr[data-error=true] .BVVeNG_turnRail{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 22%, var(--dsw-alias-bg-layer-1))}.BVVeNG_table tbody tr[data-error=true] .BVVeNG_selectionRail{background:var(--dsw-alias-state-error-primary)}.BVVeNG_table tbody tr[data-turn-start=true] td{position:relative;overflow:visible}.BVVeNG_table tbody tr[data-turn-start=true]:not(:first-child) td:before{z-index:1;background:var(--dsw-alias-border-l1);content:"";pointer-events:none;height:2px;position:absolute;top:0;left:0;right:0;transform:translateY(-50%)}.BVVeNG_event{padding-left:36px!important;padding-right:4px!important;overflow:visible!important}.BVVeNG_turnLabel{z-index:3;box-sizing:border-box;width:max-content;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-module-platform);font:8px/10px var(--ds-font-family-code);font-variant-numeric:tabular-nums;user-select:none;white-space:nowrap;border-radius:0 0 2px;flex:none;align-items:center;padding:1px 5px;display:inline-grid;position:absolute;top:0;left:0}.BVVeNG_turnLabelFull,.BVVeNG_turnLabelCompact{opacity:1;white-space:nowrap;grid-area:1/1;max-width:64px;overflow:hidden}.BVVeNG_turnLabelCompact{opacity:0;max-width:0}.BVVeNG_turnLabelActive{color:color-mix(in srgb, var(--dsw-static-blue-500) 55%, var(--dsw-alias-label-tertiary));background:var(--trajectory-turn-accent)}.BVVeNG_eventInner{justify-content:flex-start;align-items:center;min-width:0;height:100%;display:flex}.BVVeNG_kindSlot{flex:none;justify-content:flex-end;align-items:flex-end;width:76px;display:flex}.BVVeNG_kindSlot [role=tooltip]{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary)}.BVVeNG_content{color:var(--dsw-alias-label-primary);padding-left:4px!important}.BVVeNG_kindTag{box-sizing:border-box;letter-spacing:.035em;user-select:none;border:1px solid #0000;border-radius:4px;flex:none;align-items:center;height:19px;padding:0 5px;font-size:10px;font-weight:650;line-height:16px;display:inline-flex}.BVVeNG_kindTagIcon{opacity:0;flex:none;justify-content:center;align-items:center;width:0;height:13px;display:inline-flex;overflow:hidden;transform:scale(.8)}.BVVeNG_kindTagLabel{opacity:1;white-space:nowrap;max-width:72px;display:inline-block;overflow:hidden}.BVVeNG_table .BVVeNG_kindSlot .BVVeNG_message{justify-content:center;width:100%}@container BVVeNG_trajectory-table (width<=620px){.BVVeNG_eventColumn{width:50px}.BVVeNG_event{padding-left:28px!important;padding-right:3px!important}.BVVeNG_requestBoundaryControl{--request-boundary-base-left:6px}.BVVeNG_kindSlot{width:19px}.BVVeNG_kindTag,.BVVeNG_table .BVVeNG_kindSlot .BVVeNG_message{justify-content:center;width:19px;padding-left:0;padding-right:0}.BVVeNG_kindTagIcon{opacity:1;width:13px;transform:scale(1)}.BVVeNG_kindTagLabel,.BVVeNG_turnLabelFull{opacity:0;max-width:0}.BVVeNG_turnLabelCompact{opacity:1;max-width:64px}}@media (prefers-reduced-motion:no-preference){.BVVeNG_eventColumn,.BVVeNG_event,.BVVeNG_requestBoundaryControl,.BVVeNG_kindSlot,.BVVeNG_kindTag,.BVVeNG_kindTagIcon,.BVVeNG_kindTagLabel,.BVVeNG_turnLabelFull,.BVVeNG_turnLabelCompact{transition-duration:.18s;transition-timing-function:var(--ds-ease-in-out)}.BVVeNG_eventColumn,.BVVeNG_kindSlot{transition-property:width}.BVVeNG_event{transition-property:padding-right,padding-left}.BVVeNG_requestBoundaryControl{transition-property:left}.BVVeNG_kindTag{transition-property:padding-right,padding-left}.BVVeNG_kindTagIcon{transition-property:width,opacity,transform}.BVVeNG_kindTagLabel,.BVVeNG_turnLabelFull,.BVVeNG_turnLabelCompact{transition-property:max-width,opacity}}.BVVeNG_user{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-state-business-tertiary)}.BVVeNG_systemNeutral{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform)}.BVVeNG_contextGreen{color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 68%, var(--dsw-alias-label-secondary));background:var(--dsw-alias-state-success-tertiary)}.BVVeNG_compacted{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform)}.BVVeNG_compactedSummary{font:var(--dsw-font-xs-13);margin-top:12px;padding:0 0 14px}.BVVeNG_promptDiffSections{flex-direction:column;gap:14px;max-height:100%;padding:10px 14px 14px;display:flex;overflow:auto}.BVVeNG_promptDiffSection{min-width:0}.BVVeNG_promptDiffTitle{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-strong-13);user-select:none;margin:0 0 6px}.BVVeNG_promptDiff{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);font:11px/17px var(--ds-font-family-code);white-space:pre;margin:0;overflow:auto}.BVVeNG_promptDiff span{min-width:max-content;padding:0 6px;display:block}.BVVeNG_promptDiffLinemeta{color:var(--dsw-alias-label-caption);background:var(--dsw-alias-bg-module-platform);user-select:none}.BVVeNG_promptDiffLinecontext{color:var(--dsw-alias-label-secondary)}.BVVeNG_promptDiffLineadded{color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 72%, var(--dsw-alias-label-primary));background:var(--dsw-alias-state-success-tertiary)}.BVVeNG_promptDiffLineremoved{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, var(--dsw-alias-bg-layer-1))}.BVVeNG_assistantVioletBright{color:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 60%, var(--dsw-alias-state-error-secondary));background:color-mix(in srgb, color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 55%, var(--dsw-alias-state-error-secondary)) 15%, var(--dsw-alias-bg-layer-1))}.BVVeNG_toolAmber{color:var(--dsw-alias-state-warn-label);background:var(--dsw-alias-state-warn-tertiary)}.BVVeNG_subtoolAmber{color:color-mix(in srgb, var(--dsw-alias-state-warn-label) 62%, var(--dsw-alias-label-tertiary));background:color-mix(in srgb, var(--dsw-alias-state-warn-tertiary) 58%, var(--dsw-alias-bg-layer-1))}.BVVeNG_contentText{text-overflow:ellipsis;white-space:nowrap;min-width:0;display:block;overflow:hidden}.BVVeNG_toolCallOnly{color:var(--dsw-alias-label-tertiary)}.BVVeNG_table tbody tr[data-collapsed-summary=turn] td,.BVVeNG_table tbody tr[data-collapsed-summary=assistant] td{height:20px}.BVVeNG_table tbody tr[data-collapsed-summary]{cursor:pointer;transition:background-color .12s var(--ds-ease-in-out);outline:none}.BVVeNG_table tbody tr[data-collapsed-summary]:hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_table tbody tr[data-collapsed-summary]:focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-state-business-primary)}.BVVeNG_collapsedTurnContent{min-width:0;color:var(--dsw-alias-label-secondary);align-items:center;font-size:12px;line-height:16px;display:flex}.BVVeNG_collapsedTurnEllipsis{color:var(--dsw-alias-label-tertiary);user-select:none;flex:none;margin-right:6px;font-weight:600}.BVVeNG_collapsedTurnText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.BVVeNG_resultPreview{grid-template-columns:clamp(180px, var(--trajectory-tool-request-width,calc(36cqw - 56px)), 480px) minmax(0, 1fr);align-items:center;gap:8px;min-width:0;display:grid}.BVVeNG_resultRequest,.BVVeNG_inlineResultText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.BVVeNG_toolCallNameTypeface{color:var(--dsw-alias-label-primary);font:400 12px/18px Menlo,Consolas,Liberation Mono,PingFang SC,Microsoft YaHei}.BVVeNG_toolCallPayload{color:var(--dsw-alias-label-secondary);font:400 12px/18px var(--ds-font-family-code);margin-left:7px}.BVVeNG_table tbody tr[data-kind=tool] .BVVeNG_contentText,.BVVeNG_table tbody tr[data-kind=subtool] .BVVeNG_contentText,.BVVeNG_table tbody tr[data-kind=tool] .BVVeNG_resultPreview,.BVVeNG_table tbody tr[data-kind=subtool] .BVVeNG_resultPreview{font-family:var(--ds-font-family-code);font-size:12px}.BVVeNG_table tbody tr[data-kind=subtool] .BVVeNG_content{padding-left:26px}.BVVeNG_inlineResult{min-width:0;color:var(--dsw-alias-label-secondary);align-items:center;display:flex}.BVVeNG_noOutputText{color:var(--dsw-alias-label-caption)}.BVVeNG_arrow{color:var(--dsw-alias-label-caption);flex:none;margin-right:8px}.BVVeNG_error,.BVVeNG_overview dd.BVVeNG_error,.BVVeNG_details .BVVeNG_errorPayload{color:var(--dsw-alias-state-error-primary)}.BVVeNG_details .BVVeNG_errorPayload .BVVeNG_resultBlockText{color:inherit}.BVVeNG_details .BVVeNG_jsonPayload.BVVeNG_errorPayload,.BVVeNG_details .BVVeNG_jsonPreview.BVVeNG_errorPayload{--json-tree-property:var(--dsw-alias-state-error-primary);--json-tree-string:var(--dsw-alias-state-error-primary);--json-tree-number:var(--dsw-alias-state-error-primary);--json-tree-keyword:var(--dsw-alias-state-error-primary);--json-tree-punctuation:var(--dsw-alias-state-error-primary);--json-tree-icon:var(--dsw-alias-state-error-primary)}.BVVeNG_details{border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);flex-direction:column;flex:none;width:clamp(320px,38%,440px);min-width:0;max-width:calc(100% - 280px);min-height:0;display:flex;position:relative}.BVVeNG_detailsResizeHandle{z-index:6;cursor:col-resize;touch-action:none;user-select:none;background:0 0;border:0;width:8px;padding:0;position:absolute;top:0;bottom:0;left:-4px}.BVVeNG_detailsResizeHandle:focus-visible{outline:none}.BVVeNG_detailsHeader{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;justify-content:space-between;align-items:center;height:42px;padding:0 8px 0 12px;display:flex}.BVVeNG_detailsTitle{min-width:0;color:var(--dsw-alias-label-primary);align-items:center;gap:8px;display:flex}.BVVeNG_requestDetailsDot{background:var(--dsw-alias-label-secondary);border-radius:50%;flex:none;width:5px;height:5px}.BVVeNG_requestDetailsName{font:500 12px/16px var(--ds-font-family-code);flex:none}.BVVeNG_detailsLocation{min-width:0;color:var(--dsw-alias-label-tertiary);font:11px/16px var(--ds-font-family-code);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.BVVeNG_close{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;font-size:18px;line-height:18px;display:inline-flex}.BVVeNG_close:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_detailTabs{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);overscroll-behavior-x:contain;scrollbar-width:none;white-space:nowrap;flex:none;gap:1px;width:100%;min-width:0;max-width:100%;height:34px;padding:0 8px;display:flex;overflow:auto hidden}.BVVeNG_detailTabs::-webkit-scrollbar{display:none}.BVVeNG_detailTab{color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xs-13);background:0 0;border:0;flex:none;padding:0 9px;position:relative}.BVVeNG_detailTab:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_detailTabActive{color:var(--dsw-alias-state-business-primary)}.BVVeNG_detailTabActive:after{background:var(--dsw-alias-state-business-primary);content:"";border-radius:1px 1px 0 0;height:2px;position:absolute;bottom:0;left:9px;right:9px}.BVVeNG_close:focus-visible,.BVVeNG_detailTab:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.BVVeNG_detailBody{min-height:0;padding-bottom:var(--dsh-trajectory-bottom-clearance,0px);scrollbar-gutter:stable;flex:1;overflow:hidden auto}.BVVeNG_detailBodySummary{box-sizing:border-box;padding-bottom:calc(12px + var(--dsh-trajectory-bottom-clearance,0px));flex-direction:column;display:flex;overflow:hidden}.BVVeNG_detailBodySummary>.BVVeNG_overview{overscroll-behavior:contain;flex:0 auto;min-height:0;overflow:auto}.BVVeNG_detailBodySummary>.BVVeNG_compactedSummary{flex:1;min-height:0;overflow:auto}.BVVeNG_summaryScrollRegion{--dsh-scrollbar-thumb:transparent;--dsh-scrollbar-thumb-hover:transparent}.BVVeNG_summaryScrollRegion:hover,.BVVeNG_summaryScrollRegion:focus-within{--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}.BVVeNG_compactedSummary .BVVeNG_markdownPayload{padding-right:18px}.BVVeNG_overview{font:var(--dsw-font-xs-13);margin:0;padding:8px 0}.BVVeNG_overviewParentLinks{gap:14px;display:flex}.BVVeNG_overviewHierarchyNavLink{all:unset;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;opacity:1;align-items:center;gap:1px;display:inline-flex}.BVVeNG_overviewHierarchyNavLink:hover{color:var(--dsw-alias-label-primary)}.BVVeNG_overviewHierarchyJumpIconTight{color:var(--dsw-alias-label-caption);flex:none}.BVVeNG_overviewHierarchyNavLink:hover .BVVeNG_overviewHierarchyJumpIconTight,.BVVeNG_overviewHierarchyNavLink:focus-visible .BVVeNG_overviewHierarchyJumpIconTight{color:var(--dsw-alias-label-primary)}.BVVeNG_overviewHierarchyNavLink:focus-visible{color:var(--dsw-alias-label-primary);outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_overview>div{grid-template-columns:94px minmax(0,1fr);align-items:center;min-height:22px;padding:0 14px;display:grid}.BVVeNG_overview>.BVVeNG_requestTokenDetail dt{padding-left:12px}.BVVeNG_usagePanel{padding:4px 0 10px}.BVVeNG_usageGroup+.BVVeNG_usageGroup{margin-top:8px}.BVVeNG_usageHeading{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-strong-13);user-select:none;margin:0;padding:4px 14px 1px}.BVVeNG_usageGroup .BVVeNG_overview{padding:0}.BVVeNG_overview dt{color:var(--dsw-alias-label-tertiary)}.BVVeNG_overview dd{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.BVVeNG_timestampToggle{all:unset;color:inherit;cursor:pointer;font:inherit;user-select:text}.BVVeNG_timestampToggle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_overviewSections{border-top:0;flex-direction:column;flex:1;min-height:min-content;display:flex;overflow:hidden}.BVVeNG_overviewSection{flex-direction:column;flex:1 1 0;min-height:28px;max-height:max-content;display:flex;overflow:hidden}.BVVeNG_overviewSection+.BVVeNG_overviewSection{padding-top:8px}.BVVeNG_overviewHeading{box-sizing:border-box;width:100%;height:28px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);font:var(--dsw-font-xs-strong-13);user-select:none;flex:none;align-items:flex-end;margin:0;padding:0 0 3px 14px;display:flex}.BVVeNG_overviewTitle{width:max-content;height:auto;color:inherit;cursor:pointer;font:inherit;user-select:none;background:0 0;border:0;flex:none;align-items:center;gap:3px;padding:0;line-height:1;display:inline-flex}.BVVeNG_overviewTitleIcon{color:var(--dsw-alias-label-caption);flex:none}.BVVeNG_overviewTitle:hover .BVVeNG_overviewTitleIcon{color:var(--dsw-alias-label-primary)}.BVVeNG_overviewTitle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_overviewTitle:focus-visible .BVVeNG_overviewTitleIcon{color:var(--dsw-alias-state-business-primary)}.BVVeNG_overviewPreview{overscroll-behavior:contain;background:var(--dsw-alias-bg-layer-1);flex:1;min-height:0;overflow:auto}.BVVeNG_overviewPreview>:last-child{margin-bottom:0;padding-bottom:0}.BVVeNG_overviewPreview .BVVeNG_jsonPreview>:first-child,.BVVeNG_overviewPreview .BVVeNG_schemaTree>:first-child{padding-bottom:0}.BVVeNG_overviewPreview .BVVeNG_schemaTree{margin-bottom:0}.BVVeNG_overviewPreview .BVVeNG_overview{padding:2px 0 0}.BVVeNG_overviewPreview .BVVeNG_overview>div{min-height:22px}.BVVeNG_markdownPreview,.BVVeNG_markdownPayload{color:var(--dsw-alias-label-primary)}.BVVeNG_markdownPreview>div,.BVVeNG_markdownPayload>div{font:var(--dsw-font-xs-13);gap:8px}.BVVeNG_markdownPreview>div h1,.BVVeNG_markdownPayload>div h1{font:600 16px/22px var(--dsw-font-family)}.BVVeNG_markdownPreview>div h2,.BVVeNG_markdownPayload>div h2{font:600 15px/22px var(--dsw-font-family)}.BVVeNG_markdownPreview>div :where(h3,h4,h5,h6),.BVVeNG_markdownPayload>div :where(h3,h4,h5,h6){font:600 14px/20px var(--dsw-font-family)}.BVVeNG_markdownPreview>div :not(pre)>code,.BVVeNG_markdownPayload>div :not(pre)>code{font:12px/18px var(--ds-font-family-code)}.BVVeNG_markdownPreview>div table,.BVVeNG_markdownPayload>div table{font:var(--dsw-font-xs-13)}.BVVeNG_markdownPreview>div>:first-child{margin-top:0}.BVVeNG_markdownPreview>div>:last-child{margin-bottom:0}.BVVeNG_markdownPreview>div :where(h1,h2,h3){margin:12px 0 6px}.BVVeNG_markdownPreview>div :where(h4,h5,h6){margin:10px 0 5px}.BVVeNG_markdownPreview>div :where(p,ul,ol){margin:8px 0}.BVVeNG_markdownPreview>div li:not(:first-child){margin-top:3px}.BVVeNG_markdownPreview>div blockquote{margin-top:8px}.BVVeNG_markdownPreview>div hr{margin:14px 0}.BVVeNG_markdownPreview>div>.md-code-block{margin:10px 0}.BVVeNG_assistantContent .BVVeNG_markdownPayload,.BVVeNG_assistantContent .BVVeNG_payload{min-height:0}.BVVeNG_thinkingQuote{border-left:2px solid var(--dsw-alias-markdown-citation);color:var(--dsw-alias-label-secondary);background:0 0;margin:6px 14px 0 12px;padding-left:6px}.BVVeNG_thinkingQuoteOnlyPreview{margin-bottom:8px}.BVVeNG_detailBody>.BVVeNG_assistantContentRendered .BVVeNG_thinkingQuote{margin-top:14px}.BVVeNG_thinkingToggle{width:max-content;height:18px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:600 12px/18px var(--dsw-font-family);user-select:none;background:0 0;border:0;align-items:center;gap:2px;padding:0;display:flex}.BVVeNG_thinkingChevron{transition:transform .12s var(--ds-ease-in-out);flex:none}.BVVeNG_thinkingToggle[aria-expanded=true] .BVVeNG_thinkingChevron{transform:rotate(90deg)}.BVVeNG_thinkingToggle:hover{color:var(--dsw-alias-label-secondary)}.BVVeNG_thinkingToggle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_thinkingQuote .BVVeNG_markdownPreview,.BVVeNG_thinkingQuote .BVVeNG_markdownPayload,.BVVeNG_thinkingQuote .BVVeNG_payload{min-height:0;color:var(--dsw-alias-label-secondary);background:0 0;padding:2px 0}.BVVeNG_assistantOutput{background:var(--dsw-alias-bg-layer-1)}.BVVeNG_markdownPreview{padding:6px 14px 8px}.BVVeNG_markdownPayload{min-height:100%;padding:14px}.BVVeNG_jsonPayload{min-height:100%}.BVVeNG_jsonPreview{min-height:0}.BVVeNG_schema{background:var(--dsw-alias-bg-layer-1);min-height:100%}.BVVeNG_schemaPreview{min-height:0}.BVVeNG_schemaIntro{padding:12px 14px 6px}.BVVeNG_schemaPreview .BVVeNG_schemaIntro{padding-top:6px}.BVVeNG_schemaName{color:var(--dsw-alias-label-primary);font:600 12px/18px var(--ds-font-family-code);margin:0}.BVVeNG_schemaDescription{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);white-space:pre-wrap;margin:2px 0 0}.BVVeNG_schemaParameters{min-width:0}.BVVeNG_schemaParametersTitle{color:var(--dsw-alias-label-tertiary);font:600 11px/16px var(--dsw-font-family);user-select:none;margin:0;padding:4px 14px 2px}.BVVeNG_schemaTree{margin:0 6px 8px 0}.BVVeNG_payload{box-sizing:border-box;overflow-wrap:anywhere;min-height:100%;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-markdown-code-block);font:12px/19px var(--ds-font-family-code);tab-size:2;white-space:pre-wrap;margin:0;padding:14px}.BVVeNG_payloadPreview{min-height:0;padding:6px 14px 8px}.BVVeNG_sourceBlocks{box-sizing:border-box;min-height:100%;padding:12px 14px}.BVVeNG_sourceBlock+.BVVeNG_sourceBlock{margin-top:14px}.BVVeNG_sourceBlockHeader,.BVVeNG_sourceBlockJumpTarget{user-select:none;align-items:center;gap:3px;width:max-content;margin-bottom:3px;display:flex}.BVVeNG_sourceBlockJumpTarget{all:unset;cursor:pointer;user-select:none;align-items:center;gap:3px;width:max-content;margin-bottom:3px;display:flex}.BVVeNG_sourceBlockLabel{color:var(--dsw-alias-label-tertiary);font:11px/16px var(--ds-font-family-code)}.BVVeNG_sourceBlockJumpIcon{color:var(--dsw-alias-label-caption);flex:none}.BVVeNG_sourceBlockJumpTarget:hover .BVVeNG_sourceBlockJumpIcon{color:var(--dsw-alias-label-primary)}.BVVeNG_sourceBlockJumpTarget:focus-visible{outline:none}.BVVeNG_sourceBlockJumpTarget:focus-visible .BVVeNG_sourceBlockJumpIcon{color:var(--dsw-alias-state-business-primary)}.BVVeNG_sourceBlockContent{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font:12px/19px var(--ds-font-family-code);tab-size:2;white-space:pre-wrap;background:0 0;margin:0}.BVVeNG_panelImageLink{cursor:zoom-in;border-radius:4px;width:auto;max-width:100%;display:block;overflow:hidden}.BVVeNG_panelImageLinkPreview{max-height:140px}.BVVeNG_panelImage{border-radius:inherit;background:var(--dsw-alias-bg-base);object-fit:contain;width:auto;max-width:100%;height:auto;max-height:320px;margin:0;display:block}.BVVeNG_panelImageLinkPreview .BVVeNG_panelImage{max-height:140px}.BVVeNG_messageImages{flex-direction:column;gap:8px;margin:8px 14px 14px;display:flex}.BVVeNG_messageImagesPreview{gap:6px;margin:6px 14px 8px}.BVVeNG_assistantToolCalls{box-sizing:border-box;max-width:100%;color:var(--dsw-alias-label-secondary);font:11px/17px var(--ds-font-family-code);margin:2px 14px 12px;padding:0;list-style:none}.BVVeNG_assistantToolCallsPreview{margin-top:2px;margin-bottom:8px}.BVVeNG_assistantToolCalls li{min-width:0}.BVVeNG_assistantToolCallButton{all:unset;box-sizing:border-box;cursor:pointer;border-radius:3px;align-items:center;width:calc(100% + 4px);min-width:0;height:19px;margin-left:-4px;padding:0 4px;display:flex}.BVVeNG_assistantToolCallButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_assistantToolCallButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.BVVeNG_assistantToolCallIcon{color:var(--dsw-alias-label-caption);flex:none;margin-right:5px}.BVVeNG_assistantToolCallButton:hover .BVVeNG_assistantToolCallIcon,.BVVeNG_assistantToolCallButton:focus-visible .BVVeNG_assistantToolCallIcon{color:var(--dsw-alias-label-secondary)}.BVVeNG_assistantToolCallText{white-space:nowrap;flex:1;min-width:0;display:flex;overflow:hidden}.BVVeNG_assistantToolCallName{color:var(--dsw-alias-label-secondary);flex:none;margin-right:5px;font-weight:500}.BVVeNG_assistantToolCallArgs{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.BVVeNG_systemPrompt{box-sizing:border-box}.BVVeNG_toolCatalog{min-height:100%;padding:8px 0 16px}.BVVeNG_toolCatalogItem{border-bottom:1px solid var(--dsw-alias-border-l1)}.BVVeNG_toolCatalogSummary{box-sizing:border-box;cursor:pointer;user-select:none;grid-template-columns:12px 12px max-content minmax(0,1fr);align-items:center;gap:5px;min-height:30px;padding:4px 12px;list-style:none;display:grid}.BVVeNG_toolCatalogSummary::-webkit-details-marker{display:none}.BVVeNG_toolCatalogSummary:hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_toolCatalogSummary:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.BVVeNG_toolCatalogChevron,.BVVeNG_toolCatalogIcon{color:var(--dsw-alias-label-caption)}.BVVeNG_toolCatalogChevron{transition:transform .1s var(--ds-ease-in-out)}.BVVeNG_toolCatalogItem[open] .BVVeNG_toolCatalogChevron{transform:rotate(90deg)}.BVVeNG_toolCatalogName{color:var(--dsw-alias-label-primary);font:500 12px/18px var(--ds-font-family-code)}.BVVeNG_toolCatalogDescription{min-width:0;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.BVVeNG_toolCatalogDefinition{background:var(--dsw-alias-bg-base);padding:0 0 8px 29px}.BVVeNG_toolCatalogFullDescription{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);white-space:pre-wrap;margin:0;padding:7px 14px 4px 0}.BVVeNG_toolCatalogTree{margin-left:-14px;margin-right:6px}.BVVeNG_resultBlocks{box-sizing:border-box;flex-direction:column;gap:10px;min-height:100%;padding:14px;display:flex}.BVVeNG_resultBlocksPreview{gap:6px;min-height:0;padding:6px 14px 8px}.BVVeNG_resultBlockText{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font:12px/19px var(--ds-font-family-code);tab-size:2;white-space:pre-wrap;background:0 0;margin:0}.BVVeNG_overviewPreview .BVVeNG_noPayload{padding:6px 14px 8px}.BVVeNG_noPayload{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);margin:0;padding:18px 14px}@media (width<=760px){.BVVeNG_details{z-index:5;border-left-color:var(--dsw-alias-border-l3);width:min(92%,420px);max-width:92%;position:absolute;top:0;bottom:0;right:0;box-shadow:-12px 0 32px #00000024}}',An="@deepseek-ai/dsh-client-ui-trajectory/TrajectoryTable.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(An)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=An,e.textContent=bo,document.head.appendChild(e)}var c={contentText:"BVVeNG_contentText",detailTab:"BVVeNG_detailTab",promptDiffLineadded:"BVVeNG_promptDiffLineadded",toolCatalogFullDescription:"BVVeNG_toolCatalogFullDescription",messageImages:"BVVeNG_messageImages",eventInner:"BVVeNG_eventInner",schemaDescription:"BVVeNG_schemaDescription",toolCallNameTypeface:"BVVeNG_toolCallNameTypeface",toolAmber:"BVVeNG_toolAmber",eventHeader:"BVVeNG_eventHeader",promptDiffSection:"BVVeNG_promptDiffSection",requestDetailsName:"BVVeNG_requestDetailsName",split:"BVVeNG_split",schemaName:"BVVeNG_schemaName",overviewHierarchyNavLink:"BVVeNG_overviewHierarchyNavLink",kindTagLabel:"BVVeNG_kindTagLabel",requestTokenDetail:"BVVeNG_requestTokenDetail",assistantOutput:"BVVeNG_assistantOutput",resultBlocksPreview:"BVVeNG_resultBlocksPreview",sourceBlockHeader:"BVVeNG_sourceBlockHeader",panelImageLink:"BVVeNG_panelImageLink",promptDiffLineremoved:"BVVeNG_promptDiffLineremoved",jsonPayload:"BVVeNG_jsonPayload",toolCatalogChevron:"BVVeNG_toolCatalogChevron",detailsHeader:"BVVeNG_detailsHeader",assistantToolCallName:"BVVeNG_assistantToolCallName",toolCatalogItem:"BVVeNG_toolCatalogItem",schemaParametersTitle:"BVVeNG_schemaParametersTitle",resultRequest:"BVVeNG_resultRequest",compacted:"BVVeNG_compacted",historyLoadButton:"BVVeNG_historyLoadButton",collapsedTurnEllipsis:"BVVeNG_collapsedTurnEllipsis",historyLoading:"BVVeNG_historyLoading",user:"BVVeNG_user",promptDiffLinemeta:"BVVeNG_promptDiffLinemeta",detailsTitle:"BVVeNG_detailsTitle",contextGreen:"BVVeNG_contextGreen",turnLabel:"BVVeNG_turnLabel",messageImagesPreview:"BVVeNG_messageImagesPreview",resultBlocks:"BVVeNG_resultBlocks",usagePanel:"BVVeNG_usagePanel",overviewTitle:"BVVeNG_overviewTitle",sourceBlock:"BVVeNG_sourceBlock",jsonPreview:"BVVeNG_jsonPreview",historyLoadingBar:"BVVeNG_historyLoadingBar",markdownPreview:"BVVeNG_markdownPreview",payloadPreview:"BVVeNG_payloadPreview",errorPayload:"BVVeNG_errorPayload",assistantToolCallText:"BVVeNG_assistantToolCallText",payload:"BVVeNG_payload",kindSlot:"BVVeNG_kindSlot",inlineResultText:"BVVeNG_inlineResultText",thinkingToggle:"BVVeNG_thinkingToggle",sourceBlockLabel:"BVVeNG_sourceBlockLabel",overviewSections:"BVVeNG_overviewSections",contentColumn:"BVVeNG_contentColumn",thinkingChevron:"BVVeNG_thinkingChevron",toolCatalogDefinition:"BVVeNG_toolCatalogDefinition",promptDiff:"BVVeNG_promptDiff",sourceBlockJumpTarget:"BVVeNG_sourceBlockJumpTarget",toolCatalog:"BVVeNG_toolCatalog",summaryScrollRegion:"BVVeNG_summaryScrollRegion",panelImage:"BVVeNG_panelImage",requestBoundaryControlActive:"BVVeNG_requestBoundaryControlActive",event:"BVVeNG_event",detailTabActive:"BVVeNG_detailTabActive",compactedSummary:"BVVeNG_compactedSummary",overviewSection:"BVVeNG_overviewSection",assistantToolCalls:"BVVeNG_assistantToolCalls",sourceBlockContent:"BVVeNG_sourceBlockContent",assistantContentRendered:"BVVeNG_assistantContentRendered",arrow:"BVVeNG_arrow",assistantContent:"BVVeNG_assistantContent",timestampToggle:"BVVeNG_timestampToggle",collapsedTurnContent:"BVVeNG_collapsedTurnContent",schema:"BVVeNG_schema",systemNeutral:"BVVeNG_systemNeutral",table:"BVVeNG_table",panelImageLinkPreview:"BVVeNG_panelImageLinkPreview",assistantToolCallIcon:"BVVeNG_assistantToolCallIcon",historyLoadingSpinner:"BVVeNG_historyLoadingSpinner",turnLabelActive:"BVVeNG_turnLabelActive",sourceBlocks:"BVVeNG_sourceBlocks",overviewParentLinks:"BVVeNG_overviewParentLinks",toolCatalogName:"BVVeNG_toolCatalogName",overviewTitleIcon:"BVVeNG_overviewTitleIcon",assistantVioletBright:"BVVeNG_assistantVioletBright",noPayload:"BVVeNG_noPayload",collapsedTurnText:"BVVeNG_collapsedTurnText",visuallyHidden:"BVVeNG_visuallyHidden",inlineResult:"BVVeNG_inlineResult",detailBody:"BVVeNG_detailBody",noOutputText:"BVVeNG_noOutputText",overview:"BVVeNG_overview",historyLoadRow:"BVVeNG_historyLoadRow",markdownPayload:"BVVeNG_markdownPayload",selectionRail:"BVVeNG_selectionRail",detailBodySummary:"BVVeNG_detailBodySummary",turnLabelFull:"BVVeNG_turnLabelFull",turnRail:"BVVeNG_turnRail",resultPreview:"BVVeNG_resultPreview",detailsResizeHandle:"BVVeNG_detailsResizeHandle",assistantToolCallArgs:"BVVeNG_assistantToolCallArgs",sourceBlockJumpIcon:"BVVeNG_sourceBlockJumpIcon",overviewHeading:"BVVeNG_overviewHeading","trajectory-table":"BVVeNG_trajectory-table",usageGroup:"BVVeNG_usageGroup",overviewHierarchyJumpIconTight:"BVVeNG_overviewHierarchyJumpIconTight",schemaPreview:"BVVeNG_schemaPreview",promptDiffSections:"BVVeNG_promptDiffSections",details:"BVVeNG_details",message:"BVVeNG_message",subtoolAmber:"BVVeNG_subtoolAmber",kindTag:"BVVeNG_kindTag",assistantToolCallButton:"BVVeNG_assistantToolCallButton",systemPrompt:"BVVeNG_systemPrompt",close:"BVVeNG_close",schemaTree:"BVVeNG_schemaTree",toolCatalogSummary:"BVVeNG_toolCatalogSummary",virtualSpacer:"BVVeNG_virtualSpacer",requestDetailsDot:"BVVeNG_requestDetailsDot",promptDiffTitle:"BVVeNG_promptDiffTitle",requestBoundaryControl:"BVVeNG_requestBoundaryControl",content:"BVVeNG_content",usageHeading:"BVVeNG_usageHeading",kindTagIcon:"BVVeNG_kindTagIcon","history-loading-spin":"BVVeNG_history-loading-spin",tablePane:"BVVeNG_tablePane",detailsLocation:"BVVeNG_detailsLocation",turnLabelCompact:"BVVeNG_turnLabelCompact",promptDiffLinecontext:"BVVeNG_promptDiffLinecontext",toolCallOnly:"BVVeNG_toolCallOnly",resultBlockText:"BVVeNG_resultBlockText",eventColumn:"BVVeNG_eventColumn",toolCallPayload:"BVVeNG_toolCallPayload",thinkingQuote:"BVVeNG_thinkingQuote",assistantToolCallsPreview:"BVVeNG_assistantToolCallsPreview",toolCatalogIcon:"BVVeNG_toolCatalogIcon",schemaParameters:"BVVeNG_schemaParameters",toolCatalogTree:"BVVeNG_toolCatalogTree",detailTabs:"BVVeNG_detailTabs",schemaIntro:"BVVeNG_schemaIntro",overviewPreview:"BVVeNG_overviewPreview",toolCatalogDescription:"BVVeNG_toolCatalogDescription",thinkingQuoteOnlyPreview:"BVVeNG_thinkingQuoteOnlyPreview",error:"BVVeNG_error"};const Ln=2,wo=48,Vo=30,_o=100,No=12,ko=600,kt={system:"SYSTEM",user:"USER",context:"CONTEXT",compacted:"COMPACTED",message:"ASSISTANT",tool:"TOOL",subtool:"SUBTOOL"};function $n(){return(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","data-role-icon":"wrench","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M14 3.3a3.8 3.8 0 0 1-4.8 4.8l-5.1 5.1a1.6 1.6 0 1 1-2.3-2.3l5.1-5.1A3.8 3.8 0 0 1 11.7 1l-2.3 2.3 2.3 2.3L14 3.3Z"})})}a($n,"ToolWrenchIcon");function So(){return(0,o.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","data-role-icon":"information","aria-hidden":"true",children:[(0,o.jsx)("circle",{cx:"8",cy:"8",r:"6.7"}),(0,o.jsx)("circle",{cx:"8",cy:"5.5",r:".85",fill:"currentColor",stroke:"none"}),(0,o.jsx)("path",{d:"M8 7.75v3.4",strokeWidth:"1.8"})]})}a(So,"InformationIcon");function To(){return(0,o.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","data-role-icon":"compacted","aria-hidden":"true",children:[(0,o.jsx)("path",{d:"m2.5 2.5 3.75 3.75M3 6.25h3.25V3"}),(0,o.jsx)("path",{d:"m13.5 2.5-3.75 3.75M13 6.25H9.75V3"}),(0,o.jsx)("path",{d:"m2.5 13.5 3.75-3.75M3 9.75h3.25V13"}),(0,o.jsx)("path",{d:"m13.5 13.5-3.75-3.75M13 9.75H9.75V13"})]})}a(To,"CompactedIcon");const Bo={system:(0,o.jsx)(ee.IconSettingsOutline16,{size:13}),user:(0,o.jsx)(ee.IconUserOutline16,{size:13}),context:(0,o.jsx)(So,{}),compacted:(0,o.jsx)(To,{}),message:(0,o.jsx)(ee.IconSparkle16,{size:13}),tool:(0,o.jsx)($n,{}),subtool:(0,o.jsx)($n,{})};function jo(e){const t=(0,y.useRef)({rows:[],structure:[]});if(t.current.rows===e)return t.current.structure;const n=t.current.structure.length===e.length&&e.every((s,r)=>{const i=t.current.structure[r];return i?.key===s.key&&i.height===s.height})?t.current.structure:e.map(s=>({key:s.key,height:s.height}));return t.current={rows:e,structure:n},n}a(jo,"useStableVirtualRowStructure");const zn=320,Go=720,Co=280,Io=16,St=.58,Ro=180,Mo=480,Eo=.36,Do=56,Wn=[{id:"system-prompt",label:"System Prompt"},{id:"tools",label:"Tools"}],qo=[{id:"diff",label:"Diff"},...Wn],Po=[{id:"overview",label:"Summary"},{id:"options",label:"Options"},{id:"usage",label:"Usage"},{id:"timing",label:"Timing"}];function Hn(e,t){const n=Math.max(zn,Math.min(Go,t-Co));return Math.round(Math.min(Math.max(e,zn),n))}a(Hn,"clampDetailsWidth");function Fn(e){return Math.min(Math.max(e*Eo-Do,Ro),Mo)}a(Fn,"defaultToolRequestWidth");function Tt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?2:1)} s`}a(Tt,"formatDurationMs");function Oo(e){if(e===null||!Number.isFinite(e))return"Not available";const t=new Date(e),n=a(i=>String(i).padStart(2,"0"),"two"),s=a(i=>String(i).padStart(3,"0"),"three"),r=`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${s(t.getMilliseconds())}`;return`${`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`} ${r}`}a(Oo,"formatStartedAt");function Ao(e){const t=window.getSelection();return t!==null&&!t.isCollapsed&&t.rangeCount>0&&t.getRangeAt(0).intersectsNode(e)}a(Ao,"clickSelectsText");function Bt({timestamp:e}){const[t,n]=(0,y.useState)(!1);return e===null||!Number.isFinite(e)?(0,o.jsx)("dd",{children:"Not available"}):(0,o.jsx)("dd",{children:(0,o.jsx)("button",{type:"button",className:c.timestampToggle,title:t?"Show local time":"Show Unix timestamp",onClick:a(s=>{Ao(s.currentTarget)||n(r=>!r)},"onClick"),children:t?(e/1e3).toFixed(3):Oo(e)})})}a(Bt,"StartedAtValue");function Lo(e){return e.timingRecorded?e.stepStartTime===null?"Step start unavailable":e.completedTime===null?"Pending":Tt(Math.max(0,e.completedTime-e.stepStartTime)):"Not recorded"}a(Lo,"totalTime");function $o(e){return e.timingRecorded?e.stepStartTime===null?"Step start unavailable":e.firstTokenTime===null?"First token unavailable":Tt(Math.max(0,e.firstTokenTime-e.stepStartTime)):"Not recorded"}a($o,"ttft");function zo(e){return!e.timingRecorded||e.firstTokenTime===null?"First token unavailable":e.completedTime===null?"Pending":Tt(Math.max(0,e.completedTime-e.firstTokenTime))}a(zo,"generationTime");function Wo(e){if(!e.usageProvided)return"Usage unavailable";if(e.outputTokens===null)return"Output tokens unavailable";if(!e.timingRecorded||e.firstTokenTime===null)return"First token unavailable";if(e.completedTime===null)return"Pending";const t=(e.completedTime-e.firstTokenTime)/1e3;return t<=0?"Duration too short":`${(e.outputTokens/t).toFixed(1)} tok/s`}a(Wo,"throughput");function Ho({metrics:e}){return(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Bt,{timestamp:e.stepStartTime})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Total duration"}),(0,o.jsx)("dd",{children:Lo(e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"TTFT"}),(0,o.jsx)("dd",{children:$o(e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Generation"}),(0,o.jsx)("dd",{children:zo(e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Throughput"}),(0,o.jsx)("dd",{children:Wo(e)})]})]})}a(Ho,"AssistantTimingPanel");function Xn(e){return e.flatMap((t,n)=>{let s=!0;const r=t.groups.flatMap(l=>l.cells.map((u,p)=>{const f=s&&u.requestOnly!==!0&&u.kind!=="system"&&(u.kind!=="compacted"||t.turn===null);return f&&(s=!1),{turn:t.turn,section:n,group:l.title,groupStart:p===0,turnStart:f,cell:u,turnEnd:!1}})),i=r.at(-1);return i!==void 0&&(i.turnEnd=!0),r})}a(Xn,"flattenRecords");function Fo(e,t){const n=e.filter(r=>r.cell.requestOnly!==!0&&t.has(r.cell.index)).map(r=>({...r,groupStart:!1,turnStart:!1,turnEnd:!1})),s=new Set;for(const[r,i]of n.entries()){const l=n[r-1],u=n[r+1];i.groupStart=l===void 0||l.section!==i.section||l.group!==i.group,i.turnStart=!s.has(i.section)&&i.cell.kind!=="system"&&(i.cell.kind!=="compacted"||i.turn===null),i.turnStart&&s.add(i.section),i.turnEnd=u===void 0||u.section!==i.section}return n}a(Fo,"filterRecords");function Qt(e){if(!e.startsWith("Step "))return;const t=Number(e.slice(5));return Number.isInteger(t)&&t>0?t:void 0}a(Qt,"requestStep");function We(e,t){return`${e}\0${t}`}a(We,"requestKey");function Xo(e){const t=new Map;for(const n of e){const s=We(n.turn,n.group);if(!t.has(s)){if(Qt(n.group)===void 0){n.groupStart&&t.set(s,n.cell.index);continue}n.cell.kind==="user"||n.cell.kind==="context"||t.set(s,n.cell.index)}}return t}a(Xo,"indexRequestBoundaries");function He(e){return e===null?"Between turns":`Turn ${e}`}a(He,"sectionLabel");function Yo(e,t,n){const s=new Map;for(const l of t??[])s.set(We(l.turn,l.group),l.number);let r=Math.max(0,...s.values())+1;const i=e.filter(l=>n.get(We(l.turn,l.group))===l.cell.index&&Qt(l.group)!==void 0).sort((l,u)=>l.cell.index-u.cell.index);for(const l of i){const u=We(l.turn,l.group);s.has(u)||s.set(u,r++)}return s}a(Yo,"indexRequestNumbers");function Jo(e){const t=new Map;let n=0;for(const s of e){if(s.cell.requestOnly===!0){t.set(s.cell.index,n++);continue}n>0&&s.groupStart&&Qt(s.group)!==void 0&&t.set(s.cell.index,n),n=0}return t}a(Jo,"indexRequestBoundaryRuns");function Uo(e){const t=new Set(e.map(s=>s.group).filter(s=>s.startsWith("Step "))).size,n=e.filter(s=>s.cell.kind==="tool"||s.cell.kind==="subtool").length;return[`${t} ${t===1?"step":"steps"}`,`${n} tool ${n===1?"call":"calls"}`].join(" · ")}a(Uo,"summarizeTurn");function Qo(e,t){const n=new Map;for(const s of e){if(s.turn===null)continue;const r=n.get(s.turn)??[];r.push(s),n.set(s.turn,r)}return e.flatMap(s=>{if(s.turn===null||!t.has(s.turn))return[s];const r=n.get(s.turn)??[s];if(s.cell.requestOnly===!0||s.cell.kind==="system")return[s];const i=r.filter(l=>l.cell.requestOnly!==!0&&l.cell.kind!=="system");return i.length<=1?[s]:s.cell.index!==i[0]?.cell.index?[]:[{...s,turnEnd:!1},{...s,groupStart:!1,turnStart:!1,turnEnd:!0,collapsedSummary:Uo(i.slice(1)),collapsedSummaryKind:"turn"}]})}a(Qo,"collapseTurnRecords");function Ko(e,t){const n=e.findIndex(r=>r.cell.index===t);if(n===-1||e[n]?.cell.kind!=="message")return[];const s=[];for(let r=n+1;r<e.length;r++){const i=e[r];if(i===void 0||i.cell.kind!=="tool"&&i.cell.kind!=="subtool")break;s.push(i)}return s}a(Ko,"assistantToolCalls");function Zo(e){const t=[...new Set(e.map(r=>{const i=r.cell.text.indexOf(" · ");return i===-1?r.cell.text:r.cell.text.slice(0,i)}).filter(r=>r!==""))],n=e.length,s=`${n} tool ${n===1?"call":"calls"}`;return t.length>0?`${s} · ${t.join(", ")}`:s}a(Zo,"summarizeAssistantTools");function ei(e,t){const n=[];for(let s=0;s<e.length;s++){const r=e[s];if(r===void 0||(n.push(r),r.cell.kind!=="message"||!t.has(he(r.cell))))continue;const i=[];for(let u=s+1;u<e.length;u++){const p=e[u];if(p===void 0||p.collapsedSummary!==void 0||p.cell.kind!=="tool"&&p.cell.kind!=="subtool")break;i.push(p)}if(i.length===0)continue;const l=i.at(-1);n[n.length-1]={...r,turnEnd:!1},n.push({...r,groupStart:!1,turnStart:!1,turnEnd:l?.turnEnd??!1,collapsedSummary:Zo(i),collapsedSummaryKind:"assistant"}),s+=i.length}return n}a(ei,"collapseAssistantRecords");function Kt(e){return e.cell.isError?"error":e.cell.kind==="compacted"&&e.cell.timeSeconds===null||(e.cell.kind==="tool"||e.cell.kind==="subtool")&&e.cell.outputDetail===void 0?"running":"complete"}a(Kt,"stateOf");function Zt(e){return e==="error"?"Failed":e==="running"?"Pending":"Completed"}a(Zt,"statusLabel");function ti({cell:e}){const t=e.output!==void 0&&e.think!==void 0?Math.max(0,e.output-e.think):void 0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Tokens"}),(0,o.jsx)("dd",{children:e.output===void 0?"—":`${e.output} tok`})]}),e.think!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Reasoning"}),(0,o.jsxs)("dd",{children:[e.think," tok"]})]}),t!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Content"}),(0,o.jsxs)("dd",{children:[t," tok"]})]})]})}a(ti,"TokenRows");function ni(e){if(!(e.input===void 0&&e.cacheRead===void 0&&e.cacheWrite===void 0))return(e.input??0)+(e.cacheRead??0)+(e.cacheWrite??0)}a(ni,"inputTotal");function en({usage:e}){if(e===void 0)return(0,o.jsx)("p",{className:c.noPayload,children:"Usage not reported"});const t=ni(e),n=e.output!==void 0&&e.reasoning!==void 0?e.output-e.reasoning:void 0;return(0,o.jsxs)("dl",{className:c.overview,children:[t!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Input"}),(0,o.jsxs)("dd",{children:[t," tok"]})]}),e.cacheRead!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Cached"}),(0,o.jsxs)("dd",{children:[e.cacheRead," tok"]})]}),e.cacheWrite!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Cache created"}),(0,o.jsxs)("dd",{children:[e.cacheWrite," tok"]})]}),e.input!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Other"}),(0,o.jsxs)("dd",{children:[e.input," tok"]})]}),e.output!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Output"}),(0,o.jsxs)("dd",{children:[e.output," tok"]})]}),e.reasoning!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Reasoning"}),(0,o.jsxs)("dd",{children:[e.reasoning," tok"]})]}),n!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Content"}),(0,o.jsxs)("dd",{children:[n," tok"]})]})]})}a(en,"UsageRows");function si({usage:e,cumulative:t}){return(0,o.jsxs)("div",{className:c.usagePanel,children:[(0,o.jsxs)("section",{className:c.usageGroup,children:[(0,o.jsx)("h4",{className:c.usageHeading,children:"This request"}),(0,o.jsx)(en,{usage:e})]}),(0,o.jsxs)("section",{className:c.usageGroup,children:[(0,o.jsx)("h4",{className:c.usageHeading,children:"Session cumulative"}),(0,o.jsx)(en,{usage:t})]})]})}a(si,"RequestUsagePanel");function Yn({options:e,preview:t=!1}){return e===void 0?(0,o.jsx)("p",{className:c.noPayload,children:"Options not recorded"}):(0,o.jsx)(ee.JsonTree,{data:e,label:"Request options JSON",className:t?c.jsonPreview:c.jsonPayload})}a(Yn,"RequestOptions");function ri(e){if(typeof e!="object"||e===null||Array.isArray(e))return"Unknown";const t=e,n=t.kind;if(n==="user")return"User";if(n==="plugin"){const s=t.plugin;return typeof s=="string"&&s!==""?`Plugin · ${s}`:"Plugin"}if(n==="goal"){const s=t.round;return typeof s=="number"&&s>0?`Goal · Round ${s}`:"Goal"}return typeof n!="string"||n===""?"Unknown":`${n[0]?.toUpperCase()??""}${n.slice(1)}`}a(ri,"messageSourceLabel");function oi({record:e}){const t=e.cell.messageSource;return t===void 0?(0,o.jsx)("p",{className:c.noPayload,children:"Source not recorded"}):(0,o.jsx)(ee.JsonTree,{data:typeof t=="object"&&t!==null?t:{value:t},label:"Message source JSON",className:c.jsonPayload})}a(oi,"MessageSource");function Jn(e){return e.cell.kind==="user"||e.cell.kind==="context"||e.cell.kind==="message"}a(Jn,"isMarkdownRecord");function ii(e,t){if(t.cell.kind!=="tool"&&t.cell.kind!=="subtool")return{};const n=e.findIndex(l=>l.cell.index===t.cell.index);if(n===-1)return{};let s;if(t.cell.kind==="subtool")for(let l=n-1;l>=0;l--){const u=e[l];if(u===void 0||u.turn!==t.turn||u.group!==t.group)break;if(u.cell.kind==="tool"){s=u;break}}const r=s?.cell.callId??t.cell.callId;let i;return r!==void 0&&(i=e.find(l=>l.turn===t.turn&&l.cell.kind==="message"&&l.cell.sourceBlocks?.some(u=>u.callId===r)===!0)),{...i===void 0?{}:{message:i},...s===void 0?{}:{tool:s}}}a(ii,"parentRecords");function ai(e){if(e.cell.kind==="user"||e.cell.kind==="context")return e.cell.inputDetail;if(e.cell.kind==="message"||e.cell.kind==="compacted")return e.cell.outputDetail}a(ai,"markdownSource");function Un(e){return e.cell.kind==="system"?e.cell.previousPromptDetail===void 0?Wn:qo:e.cell.kind==="compacted"?[{id:"overview",label:"Summary"},{id:"raw",label:"Raw Output"}]:Jn(e)?[{id:"overview",label:"Summary"},{id:"rendered",label:"Preview"},{id:"raw",label:"Raw"},...e.cell.messageSource===void 0?[]:[{id:"source",label:"Source"}]]:[{id:"overview",label:"Summary"},...e.cell.inputDetail?[{id:"input",label:"Payload"}]:[],...e.cell.outputDetail?[{id:"output",label:"Result"}]:[],{id:"schema",label:"Schema"},{id:"timing",label:"Timing"}]}a(Un,"detailTabs");function li(e){if(tn(e))return"";if(e.previewMarkdown!==void 0){const n=ut(e.previewMarkdown);return e.text===""?n:n===""?e.text:`${e.text} · ${n}`}if(e.text!=="")return e.text;const t=e.kind==="user"||e.kind==="context"?e.inputDetail:e.kind==="message"?e.outputDetail??e.thinkingDetail:void 0;return t===void 0?"":ut(t)}a(li,"recordDisplayText");function ci(e){return e.resultPreviewMarkdown===void 0?e.result:ut(e.resultPreviewMarkdown)}a(ci,"recordResultText");function di(e,t){if(e!=="tool"&&e!=="subtool")return;const n=t.indexOf(" · ");return n===-1?{name:t}:{name:t.slice(0,n),args:t.slice(n+3)}}a(di,"toolCallTextParts");function tn(e){return e.kind==="message"&&!e.outputDetail&&!e.thinkingDetail&&e.text==="Tool call only"}a(tn,"isToolCallOnly");function ui({cell:e,children:t}){const n=(0,y.useMemo)(()=>li(e),[e.kind,e.text,e.previewMarkdown,e.inputDetail,e.outputDetail,e.thinkingDetail]),s=(0,y.useMemo)(()=>ci(e),[e.result,e.resultPreviewMarkdown]),r=tn(e),i=di(e.kind,n);return t({displayText:n,listDisplayText:r?"(tool call only)":i===void 0?n:[i.name,i.args].filter(Boolean).join(" "),resultText:s,toolCallOnly:r,toolCallText:i})}a(ui,"RecordPresentation");function pi({displayText:e,toolCallOnly:t,toolCallText:n}){return t?(0,o.jsx)("span",{className:c.toolCallOnly,children:"(tool call only)"}):n===void 0?e||"—":(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:c.toolCallNameTypeface,children:n.name||"—"}),n.args!==void 0&&(0,o.jsx)("span",{className:c.toolCallPayload,children:n.args})]})}a(pi,"RecordListText");function pt({text:e,rendered:t,preview:n}){return t?(0,o.jsx)("div",{className:n?c.markdownPreview:c.markdownPayload,children:(0,o.jsx)(ee.MarkdownText,{text:e})}):(0,o.jsx)("pre",{className:`${c.payload} ${n?c.payloadPreview:""}`,children:e})}a(pt,"MarkdownFragment");function hi({blocks:e,onOpenCall:t}){return(0,o.jsx)("div",{className:c.sourceBlocks,children:e.map((n,s)=>(0,o.jsxs)("section",{className:c.sourceBlock,children:[n.callId!==void 0?(0,o.jsxs)("button",{type:"button",className:c.sourceBlockJumpTarget,"aria-label":`Open Block #${s+1} tool call summary`,title:"Open tool call summary",onClick:a(()=>{n.callId!==void 0&&t(n.callId)},"onClick"),children:[(0,o.jsx)("span",{className:c.sourceBlockLabel,children:`Block #${s+1} ${n.type}`}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.sourceBlockJumpIcon,size:12})]}):(0,o.jsx)("div",{className:c.sourceBlockHeader,children:(0,o.jsx)("span",{className:c.sourceBlockLabel,children:`Block #${s+1} ${n.type}`})}),n.imageSrc!==void 0?(0,o.jsx)(nn,{block:n}):(0,o.jsx)("pre",{className:c.sourceBlockContent,children:n.content})]},s))})}a(hi,"SourceBlocks");function nn({block:e,preview:t=!1}){return e.imageSrc===void 0?null:(0,o.jsx)("a",{className:t?`${c.panelImageLink} ${c.panelImageLinkPreview}`:c.panelImageLink,href:e.imageSrc,target:"_blank",rel:"noopener noreferrer",title:"Open image",children:(0,o.jsx)("img",{className:c.panelImage,src:e.imageSrc,alt:e.imageAlt??""})})}a(nn,"PanelImage");function Qn({blocks:e,preview:t}){const n=e?.filter(s=>s.imageSrc!==void 0)??[];return n.length===0?null:(0,o.jsx)("div",{className:t?`${c.messageImages} ${c.messageImagesPreview}`:c.messageImages,children:n.map((s,r)=>(0,o.jsx)(nn,{block:s,preview:t},r))})}a(Qn,"MessageImages");function Kn({blocks:e,preview:t,onOpenCall:n}){const s=e?.filter(r=>r.type==="tool-call")??[];return s.length===0?null:(0,o.jsx)("ul",{className:t?`${c.assistantToolCalls} ${c.assistantToolCallsPreview}`:c.assistantToolCalls,children:s.map((r,i)=>(0,o.jsx)("li",{children:(0,o.jsxs)("button",{type:"button",className:c.assistantToolCallButton,title:"Open tool call summary",onClick:a(()=>{r.callId!==void 0&&n(r.callId)},"onClick"),children:[(0,o.jsx)("svg",{className:c.assistantToolCallIcon,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,o.jsxs)("span",{className:c.assistantToolCallText,children:[(0,o.jsx)("span",{className:c.assistantToolCallName,children:r.toolName??"tool-call"}),r.content!==""&&(0,o.jsx)("span",{className:c.assistantToolCallArgs,children:r.content})]})]})},r.callId??i))})}a(Kn,"AssistantToolCalls");function fi(){return(0,o.jsx)("svg",{className:c.toolCatalogIcon,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}a(fi,"ToolGlyph");function mi({tools:e}){return e.length===0?(0,o.jsx)("p",{className:c.noPayload,children:"No tools in this request"}):(0,o.jsx)("div",{className:c.toolCatalog,children:e.map((t,n)=>(0,o.jsxs)("details",{className:c.toolCatalogItem,children:[(0,o.jsxs)("summary",{className:c.toolCatalogSummary,children:[(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.toolCatalogChevron,size:12}),(0,o.jsx)(fi,{}),(0,o.jsx)("span",{className:c.toolCatalogName,children:t.name}),(0,o.jsx)("span",{className:c.toolCatalogDescription,children:t.description})]}),(0,o.jsxs)("div",{className:c.toolCatalogDefinition,children:[t.description!==""&&(0,o.jsx)("p",{className:c.toolCatalogFullDescription,children:t.description}),(0,o.jsx)(ee.JsonTree,{data:t.parameters,label:`${t.name} parameters JSON`,className:c.toolCatalogTree})]})]},`${t.name}:${n}`))})}a(mi,"ToolCatalog");function gi(e,t){return po("","",e,t,void 0,void 0,{context:3}).hunks.flatMap((n,s)=>[...s===0?[]:[{kind:"meta",text:""}],{kind:"meta",text:`@@ -${n.oldStart},${n.oldLines} +${n.newStart},${n.newLines} @@`},...n.lines.flatMap(r=>r.startsWith("\\")?[]:r.startsWith("+")?[{kind:"added",text:r}]:r.startsWith("-")?[{kind:"removed",text:r}]:[{kind:"context",text:r}])])}a(gi,"promptDiffLines");function Zn({title:e,before:t,after:n}){const s=gi(t,n);return s.length===0?null:(0,o.jsxs)("section",{className:c.promptDiffSection,children:[(0,o.jsx)("h3",{className:c.promptDiffTitle,children:e}),(0,o.jsx)("pre",{className:c.promptDiff,children:s.map((r,i)=>(0,o.jsxs)("span",{className:c[`promptDiffLine${r.kind}`],children:[r.text||" ",`
|
|
11
|
-
`]},i))})]})}a(
|
|
10
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}a(ho,"splitLines");function me(e){return e.recordId!==void 0?e.recordId:e.callId!==void 0?`${e.kind}\0call\0${e.callId}`:e.sourceSeq!==void 0?`${e.kind}\0seq\0${e.sourceSeq}`:`${e.kind}\0index\0${e.index}`}a(me,"trajectoryRecordId");function Ln(e){return e===null||!Number.isFinite(e)?"—":`${String(Math.round(e)).replace(/\B(?=(\d{3})+(?!\d))/g,",")} ms`}a(Ln,"formatDurationMillis");function Ze(e){return Ln(e===null?null:e*1e3)}a(Ze,"formatElapsedSeconds");const fo=30,mo=20,go=9;function St(e){const t=encodeURIComponent(me(e.cell));return e.collapsedSummaryKind===void 0?t:`${t}\0summary\0${e.collapsedSummaryKind}`}a(St,"trajectoryVirtualRecordKey");function vo(e){const t=[];let n=[];for(const[s,r]of e.entries()){const i={logicalIndex:s,record:r};if(r.cell.requestOnly===!0){n.push(i);continue}const l=[...n,i];n=[],t.push({entries:l,height:r.collapsedSummaryKind===void 0?fo:mo,key:St(r)})}return n.length>0&&t.push({entries:n,height:go,key:n.map(s=>St(s.record)).join("|")}),t}a(vo,"groupTrajectoryVirtualRows");const xo=2048,yo=512;function ut(e){const t=e.slice(0,xo),n=(0,K.extractMarkdownPlainText)(t).replace(/\s+/g," ").trim(),s=n.slice(0,yo).trimEnd();return t.length<e.length||s.length<n.length?`${s}…`:s}a(ut,"trajectoryPreviewText");const bo='.BVVeNG_split{--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);background:var(--dsw-alias-bg-layer-1);flex:1;width:100%;min-height:0;display:flex;position:relative;overflow:hidden;container-type:inline-size}.BVVeNG_tablePane{min-width:0;padding-bottom:var(--dsh-trajectory-bottom-clearance,0px);flex:1;position:relative;overflow:hidden auto;container:BVVeNG_trajectory-table/inline-size}.BVVeNG_historyLoading{z-index:5;pointer-events:none;height:0;position:sticky;top:0;overflow:visible}.BVVeNG_historyLoadingBar{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);width:100%;height:30px;color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xxs-12);justify-content:center;align-items:center;gap:6px;display:flex}.BVVeNG_historyLoadingSpinner{box-sizing:border-box;border:1.5px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-state-business-primary);border-radius:50%;width:10px;height:10px;animation:.7s linear infinite BVVeNG_history-loading-spin}.BVVeNG_table tbody .BVVeNG_historyLoadRow td{height:30px;padding:0}.BVVeNG_table tbody .BVVeNG_historyLoadRow+tr[data-turn-start=true] td:before{content:none}.BVVeNG_historyLoadButton{background:var(--dsw-alias-bg-layer-1);width:100%;height:29px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:var(--dsw-font-xxs-12);border:0;justify-content:center;align-items:center;gap:6px;display:flex}.BVVeNG_historyLoadButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.BVVeNG_historyLoadButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.BVVeNG_historyLoadButton:disabled{cursor:default}.BVVeNG_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.BVVeNG_table:not([data-scroll-ready=true]){visibility:hidden}@keyframes BVVeNG_history-loading-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.BVVeNG_historyLoadingSpinner{animation:none}}.BVVeNG_table{--trajectory-turn-accent:color-mix(in srgb, var(--dsw-static-blue-500) 22%, var(--dsw-alias-bg-layer-1));border-spacing:0;table-layout:fixed;width:100%;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);font:var(--dsw-font-xxs-12)}.BVVeNG_eventColumn{width:122px}.BVVeNG_contentColumn{width:auto}.BVVeNG_table th{z-index:3;box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);height:30px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-specific-sidebar-fill);font:var(--dsw-font-xxs-12);text-align:left;text-overflow:ellipsis;user-select:none;white-space:nowrap;padding:0 8px;font-weight:500;position:sticky;top:0;overflow:hidden}.BVVeNG_eventHeader{text-align:right!important;padding-right:4px!important}.BVVeNG_table td{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l1);text-overflow:ellipsis;white-space:nowrap;height:30px;padding:0 8px;overflow:hidden}.BVVeNG_table tbody .BVVeNG_virtualSpacer{pointer-events:none}.BVVeNG_table tbody .BVVeNG_virtualSpacer td{height:var(--trajectory-virtual-spacer-height);border:0;padding:0}.BVVeNG_table tbody tr:not([data-collapsed-summary]):not([data-virtual-spacer]):not([data-history-load]){cursor:default;transition:background-color .12s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out);outline:none}.BVVeNG_table tbody tr[data-timeline-focus=outside]{opacity:.24}.BVVeNG_table tbody tr:not([data-collapsed-summary]):not([data-virtual-spacer]):not([data-history-load]):not([data-selected=true]):hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_table tbody tr[data-request-only=true]:hover{background:0 0}.BVVeNG_table tbody tr[data-request-only=true] td{border-bottom:0;height:0;padding-top:0;padding-bottom:0}.BVVeNG_table tbody tr[data-terminal-request-boundary=true] td{height:9px}.BVVeNG_table tbody tr[data-request-only=true] .BVVeNG_turnRail{top:-15px;bottom:0}.BVVeNG_table tbody tr:not([data-collapsed-summary]):focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-state-business-primary)}.BVVeNG_table tbody tr[data-selected=true]{background:var(--dsw-alias-interactive-bg-active)}.BVVeNG_requestBoundaryControl{--request-boundary-base-left:12px;z-index:6;top:-8px;left:calc(var(--request-boundary-base-left) + var(--request-boundary-offset,0px));cursor:pointer;background:0 0;border:0;width:16px;height:16px;padding:0;position:absolute}.BVVeNG_requestBoundaryControl:before{background:var(--dsw-alias-label-caption);width:5px;height:5px;box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-1), 0 0 0 3px transparent;content:"";transition:background .12s var(--ds-ease-in-out), box-shadow .12s var(--ds-ease-in-out);border-radius:50%;position:absolute;top:5.5px;left:5.5px}.BVVeNG_requestBoundaryControl:after{border:1px solid var(--dsw-alias-border-l1);width:max-content;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);content:attr(data-label);font:9px/12px var(--ds-font-family-code);opacity:0;pointer-events:none;transition:opacity .12s var(--ds-ease-in-out), transform .12s var(--ds-ease-in-out);user-select:none;white-space:nowrap;border-radius:2px;padding:0 4px;position:absolute;top:2px;left:17px;transform:translate(-2px);box-shadow:0 2px 6px #0000001f}.BVVeNG_requestBoundaryControl:hover:before,.BVVeNG_requestBoundaryControl:focus-visible:before{background:var(--dsw-alias-brand-primary-new-colorprimary-new-color)}.BVVeNG_requestBoundaryControlActive:before,.BVVeNG_requestBoundaryControlActive:hover:before,.BVVeNG_requestBoundaryControlActive:focus-visible:before{background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 18%, var(--dsw-alias-bg-layer-1));box-shadow:0 0 0 1.5px var(--dsw-alias-brand-primary-new-colorprimary-new-color)}.BVVeNG_requestBoundaryControl[data-request-status=error]:before,.BVVeNG_requestBoundaryControl[data-request-status=error]:hover:before,.BVVeNG_requestBoundaryControl[data-request-status=error]:focus-visible:before{background:var(--dsw-alias-state-error-primary)}.BVVeNG_requestBoundaryControl:hover:after,.BVVeNG_requestBoundaryControl:focus-visible:after{opacity:1;transform:translate(0)}.BVVeNG_requestBoundaryControl:focus-visible{outline:none}.BVVeNG_table tbody tr:has(.BVVeNG_requestBoundaryControl:hover):not([data-selected=true]){background:0 0}.BVVeNG_event{position:relative}.BVVeNG_turnRail,.BVVeNG_selectionRail{background:var(--dsw-alias-brand-primary-new-colorprimary-new-color);pointer-events:none;position:absolute;left:0}.BVVeNG_turnRail{z-index:4;background:var(--trajectory-turn-accent);width:2px;top:-1px;bottom:-1px}.BVVeNG_table tbody tr[data-turn-end=true] .BVVeNG_turnRail{bottom:0}.BVVeNG_selectionRail{z-index:5;width:3px;top:0;bottom:0}.BVVeNG_table tbody tr[data-error=true] .BVVeNG_turnRail{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 22%, var(--dsw-alias-bg-layer-1))}.BVVeNG_table tbody tr[data-error=true] .BVVeNG_selectionRail{background:var(--dsw-alias-state-error-primary)}.BVVeNG_table tbody tr[data-turn-start=true] td{position:relative;overflow:visible}.BVVeNG_table tbody tr[data-turn-start=true]:not(:first-child) td:before{z-index:1;background:var(--dsw-alias-border-l1);content:"";pointer-events:none;height:2px;position:absolute;top:0;left:0;right:0;transform:translateY(-50%)}.BVVeNG_event{padding-left:36px!important;padding-right:4px!important;overflow:visible!important}.BVVeNG_turnLabel{z-index:3;box-sizing:border-box;width:max-content;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-module-platform);font:8px/10px var(--ds-font-family-code);font-variant-numeric:tabular-nums;user-select:none;white-space:nowrap;border-radius:0 0 2px;flex:none;align-items:center;padding:1px 5px;display:inline-grid;position:absolute;top:0;left:0}.BVVeNG_turnLabelFull,.BVVeNG_turnLabelCompact{opacity:1;white-space:nowrap;grid-area:1/1;max-width:64px;overflow:hidden}.BVVeNG_turnLabelCompact{opacity:0;max-width:0}.BVVeNG_turnLabelActive{color:color-mix(in srgb, var(--dsw-static-blue-500) 55%, var(--dsw-alias-label-tertiary));background:var(--trajectory-turn-accent)}.BVVeNG_eventInner{justify-content:flex-start;align-items:center;min-width:0;height:100%;display:flex}.BVVeNG_kindSlot{flex:none;justify-content:flex-end;align-items:flex-end;width:76px;display:flex}.BVVeNG_kindSlot [role=tooltip]{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary)}.BVVeNG_content{color:var(--dsw-alias-label-primary);padding-left:4px!important}.BVVeNG_kindTag{box-sizing:border-box;letter-spacing:.035em;user-select:none;border:1px solid #0000;border-radius:4px;flex:none;align-items:center;height:19px;padding:0 5px;font-size:10px;font-weight:650;line-height:16px;display:inline-flex}.BVVeNG_kindTagIcon{opacity:0;flex:none;justify-content:center;align-items:center;width:0;height:13px;display:inline-flex;overflow:hidden;transform:scale(.8)}.BVVeNG_kindTagLabel{opacity:1;white-space:nowrap;max-width:72px;display:inline-block;overflow:hidden}.BVVeNG_table .BVVeNG_kindSlot .BVVeNG_message{justify-content:center;width:100%}@container BVVeNG_trajectory-table (width<=620px){.BVVeNG_eventColumn{width:50px}.BVVeNG_event{padding-left:28px!important;padding-right:3px!important}.BVVeNG_requestBoundaryControl{--request-boundary-base-left:6px}.BVVeNG_kindSlot{width:19px}.BVVeNG_kindTag,.BVVeNG_table .BVVeNG_kindSlot .BVVeNG_message{justify-content:center;width:19px;padding-left:0;padding-right:0}.BVVeNG_kindTagIcon{opacity:1;width:13px;transform:scale(1)}.BVVeNG_kindTagLabel,.BVVeNG_turnLabelFull{opacity:0;max-width:0}.BVVeNG_turnLabelCompact{opacity:1;max-width:64px}}@media (prefers-reduced-motion:no-preference){.BVVeNG_eventColumn,.BVVeNG_event,.BVVeNG_requestBoundaryControl,.BVVeNG_kindSlot,.BVVeNG_kindTag,.BVVeNG_kindTagIcon,.BVVeNG_kindTagLabel,.BVVeNG_turnLabelFull,.BVVeNG_turnLabelCompact{transition-duration:.18s;transition-timing-function:var(--ds-ease-in-out)}.BVVeNG_eventColumn,.BVVeNG_kindSlot{transition-property:width}.BVVeNG_event{transition-property:padding-right,padding-left}.BVVeNG_requestBoundaryControl{transition-property:left}.BVVeNG_kindTag{transition-property:padding-right,padding-left}.BVVeNG_kindTagIcon{transition-property:width,opacity,transform}.BVVeNG_kindTagLabel,.BVVeNG_turnLabelFull,.BVVeNG_turnLabelCompact{transition-property:max-width,opacity}}.BVVeNG_user{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-state-business-tertiary)}.BVVeNG_systemNeutral{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform)}.BVVeNG_contextGreen{color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 68%, var(--dsw-alias-label-secondary));background:var(--dsw-alias-state-success-tertiary)}.BVVeNG_compacted{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform)}.BVVeNG_compactedSummary{font:var(--dsw-font-xs-13);margin-top:12px;padding:0 0 14px}.BVVeNG_promptDiffSections{flex-direction:column;gap:14px;max-height:100%;padding:10px 14px 14px;display:flex;overflow:auto}.BVVeNG_promptDiffSection{min-width:0}.BVVeNG_promptDiffTitle{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-strong-13);user-select:none;margin:0 0 6px}.BVVeNG_promptDiff{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);font:11px/17px var(--ds-font-family-code);white-space:pre;margin:0;overflow:auto}.BVVeNG_promptDiff span{min-width:max-content;padding:0 6px;display:block}.BVVeNG_promptDiffLinemeta{color:var(--dsw-alias-label-caption);background:var(--dsw-alias-bg-module-platform);user-select:none}.BVVeNG_promptDiffLinecontext{color:var(--dsw-alias-label-secondary)}.BVVeNG_promptDiffLineadded{color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 72%, var(--dsw-alias-label-primary));background:var(--dsw-alias-state-success-tertiary)}.BVVeNG_promptDiffLineremoved{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, var(--dsw-alias-bg-layer-1))}.BVVeNG_assistantVioletBright{color:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 60%, var(--dsw-alias-state-error-secondary));background:color-mix(in srgb, color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 55%, var(--dsw-alias-state-error-secondary)) 15%, var(--dsw-alias-bg-layer-1))}.BVVeNG_toolAmber{color:var(--dsw-alias-state-warn-label);background:var(--dsw-alias-state-warn-tertiary)}.BVVeNG_subtoolAmber{color:color-mix(in srgb, var(--dsw-alias-state-warn-label) 62%, var(--dsw-alias-label-tertiary));background:color-mix(in srgb, var(--dsw-alias-state-warn-tertiary) 58%, var(--dsw-alias-bg-layer-1))}.BVVeNG_contentText{text-overflow:ellipsis;white-space:nowrap;min-width:0;display:block;overflow:hidden}.BVVeNG_toolCallOnly{color:var(--dsw-alias-label-tertiary)}.BVVeNG_table tbody tr[data-collapsed-summary=turn] td,.BVVeNG_table tbody tr[data-collapsed-summary=assistant] td{height:20px}.BVVeNG_table tbody tr[data-collapsed-summary]{cursor:pointer;transition:background-color .12s var(--ds-ease-in-out);outline:none}.BVVeNG_table tbody tr[data-collapsed-summary]:hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_table tbody tr[data-collapsed-summary]:focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-state-business-primary)}.BVVeNG_collapsedTurnContent{min-width:0;color:var(--dsw-alias-label-secondary);align-items:center;font-size:12px;line-height:16px;display:flex}.BVVeNG_collapsedTurnEllipsis{color:var(--dsw-alias-label-tertiary);user-select:none;flex:none;margin-right:6px;font-weight:600}.BVVeNG_collapsedTurnText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.BVVeNG_resultPreview{grid-template-columns:clamp(180px, var(--trajectory-tool-request-width,calc(36cqw - 56px)), 480px) minmax(0, 1fr);align-items:center;gap:8px;min-width:0;display:grid}.BVVeNG_resultRequest,.BVVeNG_inlineResultText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.BVVeNG_toolCallNameTypeface{color:var(--dsw-alias-label-primary);font:400 12px/18px Menlo,Consolas,Liberation Mono,PingFang SC,Microsoft YaHei}.BVVeNG_toolCallPayload{color:var(--dsw-alias-label-secondary);font:400 12px/18px var(--ds-font-family-code);margin-left:7px}.BVVeNG_table tbody tr[data-kind=tool] .BVVeNG_contentText,.BVVeNG_table tbody tr[data-kind=subtool] .BVVeNG_contentText,.BVVeNG_table tbody tr[data-kind=tool] .BVVeNG_resultPreview,.BVVeNG_table tbody tr[data-kind=subtool] .BVVeNG_resultPreview{font-family:var(--ds-font-family-code);font-size:12px}.BVVeNG_table tbody tr[data-kind=subtool] .BVVeNG_content{padding-left:26px}.BVVeNG_inlineResult{min-width:0;color:var(--dsw-alias-label-secondary);align-items:center;display:flex}.BVVeNG_noOutputText{color:var(--dsw-alias-label-caption)}.BVVeNG_arrow{color:var(--dsw-alias-label-caption);flex:none;margin-right:8px}.BVVeNG_error,.BVVeNG_overview dd.BVVeNG_error,.BVVeNG_details .BVVeNG_errorPayload{color:var(--dsw-alias-state-error-primary)}.BVVeNG_details .BVVeNG_errorPayload .BVVeNG_resultBlockText{color:inherit}.BVVeNG_details .BVVeNG_jsonPayload.BVVeNG_errorPayload,.BVVeNG_details .BVVeNG_jsonPreview.BVVeNG_errorPayload{--json-tree-property:var(--dsw-alias-state-error-primary);--json-tree-string:var(--dsw-alias-state-error-primary);--json-tree-number:var(--dsw-alias-state-error-primary);--json-tree-keyword:var(--dsw-alias-state-error-primary);--json-tree-punctuation:var(--dsw-alias-state-error-primary);--json-tree-icon:var(--dsw-alias-state-error-primary)}.BVVeNG_details{border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);flex-direction:column;flex:none;width:clamp(320px,38%,440px);min-width:0;max-width:calc(100% - 280px);min-height:0;display:flex;position:relative}.BVVeNG_detailsResizeHandle{z-index:6;cursor:col-resize;touch-action:none;user-select:none;background:0 0;border:0;width:8px;padding:0;position:absolute;top:0;bottom:0;left:-4px}.BVVeNG_detailsResizeHandle:focus-visible{outline:none}.BVVeNG_detailsHeader{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;justify-content:space-between;align-items:center;height:42px;padding:0 8px 0 12px;display:flex}.BVVeNG_detailsTitle{min-width:0;color:var(--dsw-alias-label-primary);align-items:center;gap:8px;display:flex}.BVVeNG_requestDetailsDot{background:var(--dsw-alias-label-secondary);border-radius:50%;flex:none;width:5px;height:5px}.BVVeNG_requestDetailsName{font:500 12px/16px var(--ds-font-family-code);flex:none}.BVVeNG_detailsLocation{min-width:0;color:var(--dsw-alias-label-tertiary);font:11px/16px var(--ds-font-family-code);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.BVVeNG_close{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;font-size:18px;line-height:18px;display:inline-flex}.BVVeNG_close:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_detailTabs{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);overscroll-behavior-x:contain;scrollbar-width:none;white-space:nowrap;flex:none;gap:1px;width:100%;min-width:0;max-width:100%;height:34px;padding:0 8px;display:flex;overflow:auto hidden}.BVVeNG_detailTabs::-webkit-scrollbar{display:none}.BVVeNG_detailTab{color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xs-13);background:0 0;border:0;flex:none;padding:0 9px;position:relative}.BVVeNG_detailTab:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_detailTabActive{color:var(--dsw-alias-state-business-primary)}.BVVeNG_detailTabActive:after{background:var(--dsw-alias-state-business-primary);content:"";border-radius:1px 1px 0 0;height:2px;position:absolute;bottom:0;left:9px;right:9px}.BVVeNG_close:focus-visible,.BVVeNG_detailTab:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.BVVeNG_detailBody{min-height:0;padding-bottom:var(--dsh-trajectory-bottom-clearance,0px);scrollbar-gutter:stable;flex:1;overflow:hidden auto}.BVVeNG_detailBodySummary{box-sizing:border-box;padding-bottom:calc(12px + var(--dsh-trajectory-bottom-clearance,0px));flex-direction:column;display:flex;overflow:hidden}.BVVeNG_detailBodySummary>.BVVeNG_overview{overscroll-behavior:contain;flex:0 auto;min-height:0;overflow:auto}.BVVeNG_detailBodySummary>.BVVeNG_compactedSummary{flex:1;min-height:0;overflow:auto}.BVVeNG_summaryScrollRegion{--dsh-scrollbar-thumb:transparent;--dsh-scrollbar-thumb-hover:transparent}.BVVeNG_summaryScrollRegion:hover,.BVVeNG_summaryScrollRegion:focus-within{--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}.BVVeNG_compactedSummary .BVVeNG_markdownPayload{padding-right:18px}.BVVeNG_overview{font:var(--dsw-font-xs-13);margin:0;padding:8px 0}.BVVeNG_overviewParentLinks{gap:14px;display:flex}.BVVeNG_overviewHierarchyNavLink{all:unset;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;opacity:1;align-items:center;gap:1px;display:inline-flex}.BVVeNG_overviewHierarchyNavLink:hover{color:var(--dsw-alias-label-primary)}.BVVeNG_overviewHierarchyJumpIconTight{color:var(--dsw-alias-label-caption);flex:none}.BVVeNG_overviewHierarchyNavLink:hover .BVVeNG_overviewHierarchyJumpIconTight,.BVVeNG_overviewHierarchyNavLink:focus-visible .BVVeNG_overviewHierarchyJumpIconTight{color:var(--dsw-alias-label-primary)}.BVVeNG_overviewHierarchyNavLink:focus-visible{color:var(--dsw-alias-label-primary);outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_overview>div{grid-template-columns:94px minmax(0,1fr);align-items:center;min-height:22px;padding:0 14px;display:grid}.BVVeNG_overview>.BVVeNG_requestTokenDetail dt{padding-left:12px}.BVVeNG_usagePanel{padding:4px 0 10px}.BVVeNG_usageGroup+.BVVeNG_usageGroup{margin-top:8px}.BVVeNG_usageHeading{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-strong-13);user-select:none;margin:0;padding:4px 14px 1px}.BVVeNG_usageGroup .BVVeNG_overview{padding:0}.BVVeNG_overview dt{color:var(--dsw-alias-label-tertiary)}.BVVeNG_overview dd{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.BVVeNG_timestampToggle{all:unset;color:inherit;cursor:pointer;font:inherit;user-select:text}.BVVeNG_timestampToggle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_overviewSections{border-top:0;flex-direction:column;flex:1;min-height:min-content;display:flex;overflow:hidden}.BVVeNG_overviewSection{flex-direction:column;flex:1 1 0;min-height:28px;max-height:max-content;display:flex;overflow:hidden}.BVVeNG_overviewSection+.BVVeNG_overviewSection{padding-top:8px}.BVVeNG_overviewHeading{box-sizing:border-box;width:100%;height:28px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);font:var(--dsw-font-xs-strong-13);user-select:none;flex:none;align-items:flex-end;margin:0;padding:0 0 3px 14px;display:flex}.BVVeNG_overviewTitle{width:max-content;height:auto;color:inherit;cursor:pointer;font:inherit;user-select:none;background:0 0;border:0;flex:none;align-items:center;gap:3px;padding:0;line-height:1;display:inline-flex}.BVVeNG_overviewTitleIcon{color:var(--dsw-alias-label-caption);flex:none}.BVVeNG_overviewTitle:hover .BVVeNG_overviewTitleIcon{color:var(--dsw-alias-label-primary)}.BVVeNG_overviewTitle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_overviewTitle:focus-visible .BVVeNG_overviewTitleIcon{color:var(--dsw-alias-state-business-primary)}.BVVeNG_overviewPreview{overscroll-behavior:contain;background:var(--dsw-alias-bg-layer-1);flex:1;min-height:0;overflow:auto}.BVVeNG_overviewPreview>:last-child{margin-bottom:0;padding-bottom:0}.BVVeNG_overviewPreview .BVVeNG_jsonPreview>:first-child,.BVVeNG_overviewPreview .BVVeNG_schemaTree>:first-child{padding-bottom:0}.BVVeNG_overviewPreview .BVVeNG_schemaTree{margin-bottom:0}.BVVeNG_overviewPreview .BVVeNG_overview{padding:2px 0 0}.BVVeNG_overviewPreview .BVVeNG_overview>div{min-height:22px}.BVVeNG_markdownPreview,.BVVeNG_markdownPayload{color:var(--dsw-alias-label-primary)}.BVVeNG_markdownPreview>div,.BVVeNG_markdownPayload>div{font:var(--dsw-font-xs-13);gap:8px}.BVVeNG_markdownPreview>div h1,.BVVeNG_markdownPayload>div h1{font:600 16px/22px var(--dsw-font-family)}.BVVeNG_markdownPreview>div h2,.BVVeNG_markdownPayload>div h2{font:600 15px/22px var(--dsw-font-family)}.BVVeNG_markdownPreview>div :where(h3,h4,h5,h6),.BVVeNG_markdownPayload>div :where(h3,h4,h5,h6){font:600 14px/20px var(--dsw-font-family)}.BVVeNG_markdownPreview>div :not(pre)>code,.BVVeNG_markdownPayload>div :not(pre)>code{font:12px/18px var(--ds-font-family-code)}.BVVeNG_markdownPreview>div table,.BVVeNG_markdownPayload>div table{font:var(--dsw-font-xs-13)}.BVVeNG_markdownPreview>div>:first-child{margin-top:0}.BVVeNG_markdownPreview>div>:last-child{margin-bottom:0}.BVVeNG_markdownPreview>div :where(h1,h2,h3){margin:12px 0 6px}.BVVeNG_markdownPreview>div :where(h4,h5,h6){margin:10px 0 5px}.BVVeNG_markdownPreview>div :where(p,ul,ol){margin:8px 0}.BVVeNG_markdownPreview>div li:not(:first-child){margin-top:3px}.BVVeNG_markdownPreview>div blockquote{margin-top:8px}.BVVeNG_markdownPreview>div hr{margin:14px 0}.BVVeNG_markdownPreview>div>.md-code-block{margin:10px 0}.BVVeNG_assistantContent .BVVeNG_markdownPayload,.BVVeNG_assistantContent .BVVeNG_payload{min-height:0}.BVVeNG_thinkingQuote{border-left:2px solid var(--dsw-alias-markdown-citation);color:var(--dsw-alias-label-secondary);background:0 0;margin:6px 14px 0 12px;padding-left:6px}.BVVeNG_thinkingQuoteOnlyPreview{margin-bottom:8px}.BVVeNG_detailBody>.BVVeNG_assistantContentRendered .BVVeNG_thinkingQuote{margin-top:14px}.BVVeNG_thinkingToggle{width:max-content;height:18px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:600 12px/18px var(--dsw-font-family);user-select:none;background:0 0;border:0;align-items:center;gap:2px;padding:0;display:flex}.BVVeNG_thinkingChevron{transition:transform .12s var(--ds-ease-in-out);flex:none}.BVVeNG_thinkingToggle[aria-expanded=true] .BVVeNG_thinkingChevron{transform:rotate(90deg)}.BVVeNG_thinkingToggle:hover{color:var(--dsw-alias-label-secondary)}.BVVeNG_thinkingToggle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.BVVeNG_thinkingQuote .BVVeNG_markdownPreview,.BVVeNG_thinkingQuote .BVVeNG_markdownPayload,.BVVeNG_thinkingQuote .BVVeNG_payload{min-height:0;color:var(--dsw-alias-label-secondary);background:0 0;padding:2px 0}.BVVeNG_assistantOutput{background:var(--dsw-alias-bg-layer-1)}.BVVeNG_markdownPreview{padding:6px 14px 8px}.BVVeNG_markdownPayload{min-height:100%;padding:14px}.BVVeNG_jsonPayload{min-height:100%}.BVVeNG_jsonPreview{min-height:0}.BVVeNG_schema{background:var(--dsw-alias-bg-layer-1);min-height:100%}.BVVeNG_schemaPreview{min-height:0}.BVVeNG_schemaIntro{padding:12px 14px 6px}.BVVeNG_schemaPreview .BVVeNG_schemaIntro{padding-top:6px}.BVVeNG_schemaName{color:var(--dsw-alias-label-primary);font:600 12px/18px var(--ds-font-family-code);margin:0}.BVVeNG_schemaDescription{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);white-space:pre-wrap;margin:2px 0 0}.BVVeNG_schemaParameters{min-width:0}.BVVeNG_schemaParametersTitle{color:var(--dsw-alias-label-tertiary);font:600 11px/16px var(--dsw-font-family);user-select:none;margin:0;padding:4px 14px 2px}.BVVeNG_schemaTree{margin:0 6px 8px 0}.BVVeNG_payload{box-sizing:border-box;overflow-wrap:anywhere;min-height:100%;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-markdown-code-block);font:12px/19px var(--ds-font-family-code);tab-size:2;white-space:pre-wrap;margin:0;padding:14px}.BVVeNG_payloadPreview{min-height:0;padding:6px 14px 8px}.BVVeNG_sourceBlocks{box-sizing:border-box;min-height:100%;padding:12px 14px}.BVVeNG_sourceBlock+.BVVeNG_sourceBlock{margin-top:14px}.BVVeNG_sourceBlockHeader,.BVVeNG_sourceBlockJumpTarget{user-select:none;align-items:center;gap:3px;width:max-content;margin-bottom:3px;display:flex}.BVVeNG_sourceBlockJumpTarget{all:unset;cursor:pointer;user-select:none;align-items:center;gap:3px;width:max-content;margin-bottom:3px;display:flex}.BVVeNG_sourceBlockLabel{color:var(--dsw-alias-label-tertiary);font:11px/16px var(--ds-font-family-code)}.BVVeNG_sourceBlockJumpIcon{color:var(--dsw-alias-label-caption);flex:none}.BVVeNG_sourceBlockJumpTarget:hover .BVVeNG_sourceBlockJumpIcon{color:var(--dsw-alias-label-primary)}.BVVeNG_sourceBlockJumpTarget:focus-visible{outline:none}.BVVeNG_sourceBlockJumpTarget:focus-visible .BVVeNG_sourceBlockJumpIcon{color:var(--dsw-alias-state-business-primary)}.BVVeNG_sourceBlockContent{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font:12px/19px var(--ds-font-family-code);tab-size:2;white-space:pre-wrap;background:0 0;margin:0}.BVVeNG_panelImageLink{cursor:zoom-in;border-radius:4px;width:auto;max-width:100%;display:block;overflow:hidden}.BVVeNG_panelImageLinkPreview{max-height:140px}.BVVeNG_panelImage{border-radius:inherit;background:var(--dsw-alias-bg-base);object-fit:contain;width:auto;max-width:100%;height:auto;max-height:320px;margin:0;display:block}.BVVeNG_panelImageLinkPreview .BVVeNG_panelImage{max-height:140px}.BVVeNG_messageImages{flex-direction:column;gap:8px;margin:8px 14px 14px;display:flex}.BVVeNG_messageImagesPreview{gap:6px;margin:6px 14px 8px}.BVVeNG_assistantToolCalls{box-sizing:border-box;max-width:100%;color:var(--dsw-alias-label-secondary);font:11px/17px var(--ds-font-family-code);margin:2px 14px 12px;padding:0;list-style:none}.BVVeNG_assistantToolCallsPreview{margin-top:2px;margin-bottom:8px}.BVVeNG_assistantToolCalls li{min-width:0}.BVVeNG_assistantToolCallButton{all:unset;box-sizing:border-box;cursor:pointer;border-radius:3px;align-items:center;width:calc(100% + 4px);min-width:0;height:19px;margin-left:-4px;padding:0 4px;display:flex}.BVVeNG_assistantToolCallButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_assistantToolCallButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.BVVeNG_assistantToolCallIcon{color:var(--dsw-alias-label-caption);flex:none;margin-right:5px}.BVVeNG_assistantToolCallButton:hover .BVVeNG_assistantToolCallIcon,.BVVeNG_assistantToolCallButton:focus-visible .BVVeNG_assistantToolCallIcon{color:var(--dsw-alias-label-secondary)}.BVVeNG_assistantToolCallText{white-space:nowrap;flex:1;min-width:0;display:flex;overflow:hidden}.BVVeNG_assistantToolCallName{color:var(--dsw-alias-label-secondary);flex:none;margin-right:5px;font-weight:500}.BVVeNG_assistantToolCallArgs{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.BVVeNG_systemPrompt{box-sizing:border-box}.BVVeNG_toolCatalog{min-height:100%;padding:8px 0 16px}.BVVeNG_toolCatalogItem{border-bottom:1px solid var(--dsw-alias-border-l1)}.BVVeNG_toolCatalogSummary{box-sizing:border-box;cursor:pointer;user-select:none;grid-template-columns:12px 12px max-content minmax(0,1fr);align-items:center;gap:5px;min-height:30px;padding:4px 12px;list-style:none;display:grid}.BVVeNG_toolCatalogSummary::-webkit-details-marker{display:none}.BVVeNG_toolCatalogSummary:hover{background:var(--dsw-alias-interactive-bg-hover)}.BVVeNG_toolCatalogSummary:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.BVVeNG_toolCatalogChevron,.BVVeNG_toolCatalogIcon{color:var(--dsw-alias-label-caption)}.BVVeNG_toolCatalogChevron{transition:transform .1s var(--ds-ease-in-out)}.BVVeNG_toolCatalogItem[open] .BVVeNG_toolCatalogChevron{transform:rotate(90deg)}.BVVeNG_toolCatalogName{color:var(--dsw-alias-label-primary);font:500 12px/18px var(--ds-font-family-code)}.BVVeNG_toolCatalogDescription{min-width:0;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.BVVeNG_toolCatalogDefinition{background:var(--dsw-alias-bg-base);padding:0 0 8px 29px}.BVVeNG_toolCatalogFullDescription{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);white-space:pre-wrap;margin:0;padding:7px 14px 4px 0}.BVVeNG_toolCatalogTree{margin-left:-14px;margin-right:6px}.BVVeNG_resultBlocks{box-sizing:border-box;flex-direction:column;gap:10px;min-height:100%;padding:14px;display:flex}.BVVeNG_resultBlocksPreview{gap:6px;min-height:0;padding:6px 14px 8px}.BVVeNG_resultBlockText{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font:12px/19px var(--ds-font-family-code);tab-size:2;white-space:pre-wrap;background:0 0;margin:0}.BVVeNG_overviewPreview .BVVeNG_noPayload{padding:6px 14px 8px}.BVVeNG_noPayload{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);margin:0;padding:18px 14px}@media (width<=760px){.BVVeNG_details{z-index:5;border-left-color:var(--dsw-alias-border-l3);width:min(92%,420px);max-width:92%;position:absolute;top:0;bottom:0;right:0;box-shadow:-12px 0 32px #00000024}}',$n="@deepseek-ai/dsh-client-ui-trajectory/TrajectoryTable.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify($n)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=$n,e.textContent=bo,document.head.appendChild(e)}var c={"trajectory-table":"BVVeNG_trajectory-table",messageImages:"BVVeNG_messageImages",toolCallPayload:"BVVeNG_toolCallPayload",toolCatalogDescription:"BVVeNG_toolCatalogDescription",jsonPreview:"BVVeNG_jsonPreview",kindTagIcon:"BVVeNG_kindTagIcon",timestampToggle:"BVVeNG_timestampToggle",thinkingToggle:"BVVeNG_thinkingToggle",schemaParameters:"BVVeNG_schemaParameters",tablePane:"BVVeNG_tablePane",overviewTitle:"BVVeNG_overviewTitle",overviewTitleIcon:"BVVeNG_overviewTitleIcon",panelImageLinkPreview:"BVVeNG_panelImageLinkPreview",turnLabelCompact:"BVVeNG_turnLabelCompact",promptDiff:"BVVeNG_promptDiff",schemaName:"BVVeNG_schemaName",assistantOutput:"BVVeNG_assistantOutput",collapsedTurnEllipsis:"BVVeNG_collapsedTurnEllipsis",detailsHeader:"BVVeNG_detailsHeader",detailTab:"BVVeNG_detailTab",historyLoadRow:"BVVeNG_historyLoadRow",sourceBlockLabel:"BVVeNG_sourceBlockLabel",requestDetailsDot:"BVVeNG_requestDetailsDot",collapsedTurnText:"BVVeNG_collapsedTurnText",messageImagesPreview:"BVVeNG_messageImagesPreview",toolCatalogDefinition:"BVVeNG_toolCatalogDefinition",resultPreview:"BVVeNG_resultPreview",detailBodySummary:"BVVeNG_detailBodySummary",sourceBlockContent:"BVVeNG_sourceBlockContent",assistantToolCallArgs:"BVVeNG_assistantToolCallArgs",sourceBlocks:"BVVeNG_sourceBlocks",table:"BVVeNG_table",overview:"BVVeNG_overview",promptDiffSections:"BVVeNG_promptDiffSections",user:"BVVeNG_user",overviewHierarchyJumpIconTight:"BVVeNG_overviewHierarchyJumpIconTight",systemNeutral:"BVVeNG_systemNeutral",turnRail:"BVVeNG_turnRail",eventInner:"BVVeNG_eventInner",schemaIntro:"BVVeNG_schemaIntro",resultBlocks:"BVVeNG_resultBlocks",toolCatalogChevron:"BVVeNG_toolCatalogChevron",assistantContent:"BVVeNG_assistantContent",schemaDescription:"BVVeNG_schemaDescription",schemaParametersTitle:"BVVeNG_schemaParametersTitle",requestBoundaryControlActive:"BVVeNG_requestBoundaryControlActive",sourceBlockHeader:"BVVeNG_sourceBlockHeader",overviewSections:"BVVeNG_overviewSections",markdownPayload:"BVVeNG_markdownPayload",historyLoadButton:"BVVeNG_historyLoadButton",detailBody:"BVVeNG_detailBody",sourceBlockJumpTarget:"BVVeNG_sourceBlockJumpTarget",overviewHeading:"BVVeNG_overviewHeading",kindTag:"BVVeNG_kindTag",panelImage:"BVVeNG_panelImage",assistantToolCallIcon:"BVVeNG_assistantToolCallIcon",systemPrompt:"BVVeNG_systemPrompt",toolCatalogFullDescription:"BVVeNG_toolCatalogFullDescription",inlineResult:"BVVeNG_inlineResult",schemaPreview:"BVVeNG_schemaPreview",overviewHierarchyNavLink:"BVVeNG_overviewHierarchyNavLink",usagePanel:"BVVeNG_usagePanel",assistantToolCallText:"BVVeNG_assistantToolCallText",toolAmber:"BVVeNG_toolAmber",promptDiffSection:"BVVeNG_promptDiffSection",turnLabelFull:"BVVeNG_turnLabelFull",thinkingChevron:"BVVeNG_thinkingChevron",thinkingQuoteOnlyPreview:"BVVeNG_thinkingQuoteOnlyPreview",assistantContentRendered:"BVVeNG_assistantContentRendered",assistantToolCalls:"BVVeNG_assistantToolCalls",close:"BVVeNG_close",toolCatalogItem:"BVVeNG_toolCatalogItem",overviewParentLinks:"BVVeNG_overviewParentLinks","history-loading-spin":"BVVeNG_history-loading-spin",kindSlot:"BVVeNG_kindSlot",message:"BVVeNG_message",sourceBlock:"BVVeNG_sourceBlock",historyLoading:"BVVeNG_historyLoading",inlineResultText:"BVVeNG_inlineResultText",assistantToolCallName:"BVVeNG_assistantToolCallName",overviewSection:"BVVeNG_overviewSection",promptDiffLinemeta:"BVVeNG_promptDiffLinemeta",contentText:"BVVeNG_contentText",panelImageLink:"BVVeNG_panelImageLink",arrow:"BVVeNG_arrow",usageHeading:"BVVeNG_usageHeading",toolCallOnly:"BVVeNG_toolCallOnly",errorPayload:"BVVeNG_errorPayload",detailsLocation:"BVVeNG_detailsLocation",eventColumn:"BVVeNG_eventColumn",markdownPreview:"BVVeNG_markdownPreview",thinkingQuote:"BVVeNG_thinkingQuote",compacted:"BVVeNG_compacted",split:"BVVeNG_split",error:"BVVeNG_error",assistantToolCallsPreview:"BVVeNG_assistantToolCallsPreview",detailTabActive:"BVVeNG_detailTabActive",toolCatalogSummary:"BVVeNG_toolCatalogSummary",resultBlockText:"BVVeNG_resultBlockText",promptDiffLinecontext:"BVVeNG_promptDiffLinecontext",event:"BVVeNG_event",kindTagLabel:"BVVeNG_kindTagLabel",visuallyHidden:"BVVeNG_visuallyHidden",toolCatalogTree:"BVVeNG_toolCatalogTree",jsonPayload:"BVVeNG_jsonPayload",promptDiffLineremoved:"BVVeNG_promptDiffLineremoved",turnLabelActive:"BVVeNG_turnLabelActive",summaryScrollRegion:"BVVeNG_summaryScrollRegion",promptDiffTitle:"BVVeNG_promptDiffTitle",noOutputText:"BVVeNG_noOutputText",content:"BVVeNG_content",toolCatalogIcon:"BVVeNG_toolCatalogIcon",compactedSummary:"BVVeNG_compactedSummary",subtoolAmber:"BVVeNG_subtoolAmber",details:"BVVeNG_details",requestTokenDetail:"BVVeNG_requestTokenDetail",toolCatalogName:"BVVeNG_toolCatalogName",contentColumn:"BVVeNG_contentColumn",assistantVioletBright:"BVVeNG_assistantVioletBright",detailsTitle:"BVVeNG_detailsTitle",virtualSpacer:"BVVeNG_virtualSpacer",eventHeader:"BVVeNG_eventHeader",contextGreen:"BVVeNG_contextGreen",overviewPreview:"BVVeNG_overviewPreview",resultBlocksPreview:"BVVeNG_resultBlocksPreview",detailsResizeHandle:"BVVeNG_detailsResizeHandle",selectionRail:"BVVeNG_selectionRail",collapsedTurnContent:"BVVeNG_collapsedTurnContent",toolCallNameTypeface:"BVVeNG_toolCallNameTypeface",promptDiffLineadded:"BVVeNG_promptDiffLineadded",historyLoadingSpinner:"BVVeNG_historyLoadingSpinner",resultRequest:"BVVeNG_resultRequest",requestDetailsName:"BVVeNG_requestDetailsName",payloadPreview:"BVVeNG_payloadPreview",toolCatalog:"BVVeNG_toolCatalog",noPayload:"BVVeNG_noPayload",detailTabs:"BVVeNG_detailTabs",usageGroup:"BVVeNG_usageGroup",historyLoadingBar:"BVVeNG_historyLoadingBar",assistantToolCallButton:"BVVeNG_assistantToolCallButton",requestBoundaryControl:"BVVeNG_requestBoundaryControl",payload:"BVVeNG_payload",schemaTree:"BVVeNG_schemaTree",schema:"BVVeNG_schema",turnLabel:"BVVeNG_turnLabel",sourceBlockJumpIcon:"BVVeNG_sourceBlockJumpIcon"};const zn=2,wo=48,Vo=30,_o=100,No=12,ko=600,Tt={system:"SYSTEM",user:"USER",context:"CONTEXT",compacted:"COMPACTED",message:"ASSISTANT",tool:"TOOL",subtool:"SUBTOOL"};function Wn(){return(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","data-role-icon":"wrench","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M14 3.3a3.8 3.8 0 0 1-4.8 4.8l-5.1 5.1a1.6 1.6 0 1 1-2.3-2.3l5.1-5.1A3.8 3.8 0 0 1 11.7 1l-2.3 2.3 2.3 2.3L14 3.3Z"})})}a(Wn,"ToolWrenchIcon");function So(){return(0,o.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","data-role-icon":"information","aria-hidden":"true",children:[(0,o.jsx)("circle",{cx:"8",cy:"8",r:"6.7"}),(0,o.jsx)("circle",{cx:"8",cy:"5.5",r:".85",fill:"currentColor",stroke:"none"}),(0,o.jsx)("path",{d:"M8 7.75v3.4",strokeWidth:"1.8"})]})}a(So,"InformationIcon");function To(){return(0,o.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","data-role-icon":"compacted","aria-hidden":"true",children:[(0,o.jsx)("path",{d:"m2.5 2.5 3.75 3.75M3 6.25h3.25V3"}),(0,o.jsx)("path",{d:"m13.5 2.5-3.75 3.75M13 6.25H9.75V3"}),(0,o.jsx)("path",{d:"m2.5 13.5 3.75-3.75M3 9.75h3.25V13"}),(0,o.jsx)("path",{d:"m13.5 13.5-3.75-3.75M13 9.75H9.75V13"})]})}a(To,"CompactedIcon");const Bo={system:(0,o.jsx)(K.IconSettingsOutline16,{size:13}),user:(0,o.jsx)(K.IconUserOutline16,{size:13}),context:(0,o.jsx)(So,{}),compacted:(0,o.jsx)(To,{}),message:(0,o.jsx)(K.IconSparkle16,{size:13}),tool:(0,o.jsx)(Wn,{}),subtool:(0,o.jsx)(Wn,{})};function jo(e){const t=(0,b.useRef)({rows:[],structure:[]});if(t.current.rows===e)return t.current.structure;const n=t.current.structure.length===e.length&&e.every((s,r)=>{const i=t.current.structure[r];return i?.key===s.key&&i.height===s.height})?t.current.structure:e.map(s=>({key:s.key,height:s.height}));return t.current={rows:e,structure:n},n}a(jo,"useStableVirtualRowStructure");const Hn=320,Go=720,Co=280,Io=16,Bt=.58,Ro=180,Mo=480,Eo=.36,Do=56,Fn=[{id:"system-prompt",label:"System Prompt"},{id:"tools",label:"Tools"}],Po=[{id:"diff",label:"Diff"},...Fn],qo=[{id:"overview",label:"Summary"},{id:"options",label:"Options"},{id:"usage",label:"Usage"},{id:"timing",label:"Timing"}];function Xn(e,t){const n=Math.max(Hn,Math.min(Go,t-Co));return Math.round(Math.min(Math.max(e,Hn),n))}a(Xn,"clampDetailsWidth");function Yn(e){return Math.min(Math.max(e*Eo-Do,Ro),Mo)}a(Yn,"defaultToolRequestWidth");function jt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?2:1)} s`}a(jt,"formatDurationMs");function Oo(e){if(e===null||!Number.isFinite(e))return"Not available";const t=new Date(e),n=a(i=>String(i).padStart(2,"0"),"two"),s=a(i=>String(i).padStart(3,"0"),"three"),r=`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${s(t.getMilliseconds())}`;return`${`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`} ${r}`}a(Oo,"formatStartedAt");function Ao(e){const t=window.getSelection();return t!==null&&!t.isCollapsed&&t.rangeCount>0&&t.getRangeAt(0).intersectsNode(e)}a(Ao,"clickSelectsText");function Gt({timestamp:e}){const[t,n]=(0,b.useState)(!1);return e===null||!Number.isFinite(e)?(0,o.jsx)("dd",{children:"Not available"}):(0,o.jsx)("dd",{children:(0,o.jsx)("button",{type:"button",className:c.timestampToggle,title:t?"Show local time":"Show Unix timestamp",onClick:a(s=>{Ao(s.currentTarget)||n(r=>!r)},"onClick"),children:t?(e/1e3).toFixed(3):Oo(e)})})}a(Gt,"StartedAtValue");function Lo(e){return e.timingRecorded?e.stepStartTime===null?"Step start unavailable":e.completedTime===null?"Pending":jt(Math.max(0,e.completedTime-e.stepStartTime)):"Not recorded"}a(Lo,"totalTime");function $o(e){return e.timingRecorded?e.stepStartTime===null?"Step start unavailable":e.firstTokenTime===null?"First token unavailable":jt(Math.max(0,e.firstTokenTime-e.stepStartTime)):"Not recorded"}a($o,"ttft");function zo(e){return!e.timingRecorded||e.firstTokenTime===null?"First token unavailable":e.completedTime===null?"Pending":jt(Math.max(0,e.completedTime-e.firstTokenTime))}a(zo,"generationTime");function Wo(e){if(!e.usageProvided)return"Usage unavailable";if(e.outputTokens===null)return"Output tokens unavailable";if(!e.timingRecorded||e.firstTokenTime===null)return"First token unavailable";if(e.completedTime===null)return"Pending";const t=(e.completedTime-e.firstTokenTime)/1e3;return t<=0?"Duration too short":`${(e.outputTokens/t).toFixed(1)} tok/s`}a(Wo,"throughput");function Ho({metrics:e}){return(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Gt,{timestamp:e.stepStartTime})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Total duration"}),(0,o.jsx)("dd",{children:Lo(e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"TTFT"}),(0,o.jsx)("dd",{children:$o(e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Generation"}),(0,o.jsx)("dd",{children:zo(e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Throughput"}),(0,o.jsx)("dd",{children:Wo(e)})]})]})}a(Ho,"AssistantTimingPanel");function Jn(e){return e.flatMap((t,n)=>{let s=!0;const r=t.groups.flatMap(l=>l.cells.map((u,p)=>{const f=s&&u.requestOnly!==!0&&u.kind!=="system"&&(u.kind!=="compacted"||t.turn===null);return f&&(s=!1),{turn:t.turn,section:n,group:l.title,groupStart:p===0,turnStart:f,cell:u,turnEnd:!1}})),i=r.at(-1);return i!==void 0&&(i.turnEnd=!0),r})}a(Jn,"flattenRecords");function Fo(e,t){const n=e.filter(r=>r.cell.requestOnly!==!0&&t.has(r.cell.index)).map(r=>({...r,groupStart:!1,turnStart:!1,turnEnd:!1})),s=new Set;for(const[r,i]of n.entries()){const l=n[r-1],u=n[r+1];i.groupStart=l===void 0||l.section!==i.section||l.group!==i.group,i.turnStart=!s.has(i.section)&&i.cell.kind!=="system"&&(i.cell.kind!=="compacted"||i.turn===null),i.turnStart&&s.add(i.section),i.turnEnd=u===void 0||u.section!==i.section}return n}a(Fo,"filterRecords");function Zt(e){if(!e.startsWith("Step "))return;const t=Number(e.slice(5));return Number.isInteger(t)&&t>0?t:void 0}a(Zt,"requestStep");function ze(e,t){return`${e}\0${t}`}a(ze,"requestKey");function Xo(e){const t=new Map;for(const n of e){const s=ze(n.turn,n.group);if(!t.has(s)){if(Zt(n.group)===void 0){n.groupStart&&t.set(s,n.cell.index);continue}n.cell.kind==="user"||n.cell.kind==="context"||t.set(s,n.cell.index)}}return t}a(Xo,"indexRequestBoundaries");function We(e){return e===null?"Between turns":`Turn ${e}`}a(We,"sectionLabel");function Yo(e,t,n){const s=new Map;for(const l of t??[])s.set(ze(l.turn,l.group),l.number);let r=Math.max(0,...s.values())+1;const i=e.filter(l=>n.get(ze(l.turn,l.group))===l.cell.index&&Zt(l.group)!==void 0).sort((l,u)=>l.cell.index-u.cell.index);for(const l of i){const u=ze(l.turn,l.group);s.has(u)||s.set(u,r++)}return s}a(Yo,"indexRequestNumbers");function Jo(e){const t=new Map;let n=0;for(const s of e){if(s.cell.requestOnly===!0){t.set(s.cell.index,n++);continue}n>0&&s.groupStart&&Zt(s.group)!==void 0&&t.set(s.cell.index,n),n=0}return t}a(Jo,"indexRequestBoundaryRuns");function Uo(e){const t=new Set(e.map(s=>s.group).filter(s=>s.startsWith("Step "))).size,n=e.filter(s=>s.cell.kind==="tool"||s.cell.kind==="subtool").length;return[`${t} ${t===1?"step":"steps"}`,`${n} tool ${n===1?"call":"calls"}`].join(" · ")}a(Uo,"summarizeTurn");function Qo(e,t){const n=new Map;for(const s of e){if(s.turn===null)continue;const r=n.get(s.turn)??[];r.push(s),n.set(s.turn,r)}return e.flatMap(s=>{if(s.turn===null||!t.has(s.turn))return[s];const r=n.get(s.turn)??[s];if(s.cell.requestOnly===!0||s.cell.kind==="system")return[s];const i=r.filter(l=>l.cell.requestOnly!==!0&&l.cell.kind!=="system");return i.length<=1?[s]:s.cell.index!==i[0]?.cell.index?[]:[{...s,turnEnd:!1},{...s,groupStart:!1,turnStart:!1,turnEnd:!0,collapsedSummary:Uo(i.slice(1)),collapsedSummaryKind:"turn"}]})}a(Qo,"collapseTurnRecords");function Ko(e,t){const n=e.findIndex(r=>r.cell.index===t);if(n===-1||e[n]?.cell.kind!=="message")return[];const s=[];for(let r=n+1;r<e.length;r++){const i=e[r];if(i===void 0||i.cell.kind!=="tool"&&i.cell.kind!=="subtool")break;s.push(i)}return s}a(Ko,"assistantToolCalls");function Zo(e){const t=[...new Set(e.map(r=>{const i=r.cell.text.indexOf(" · ");return i===-1?r.cell.text:r.cell.text.slice(0,i)}).filter(r=>r!==""))],n=e.length,s=`${n} tool ${n===1?"call":"calls"}`;return t.length>0?`${s} · ${t.join(", ")}`:s}a(Zo,"summarizeAssistantTools");function ei(e,t){const n=[];for(let s=0;s<e.length;s++){const r=e[s];if(r===void 0||(n.push(r),r.cell.kind!=="message"||!t.has(me(r.cell))))continue;const i=[];for(let u=s+1;u<e.length;u++){const p=e[u];if(p===void 0||p.collapsedSummary!==void 0||p.cell.kind!=="tool"&&p.cell.kind!=="subtool")break;i.push(p)}if(i.length===0)continue;const l=i.at(-1);n[n.length-1]={...r,turnEnd:!1},n.push({...r,groupStart:!1,turnStart:!1,turnEnd:l?.turnEnd??!1,collapsedSummary:Zo(i),collapsedSummaryKind:"assistant"}),s+=i.length}return n}a(ei,"collapseAssistantRecords");function en(e){return e.cell.isError?"error":e.cell.kind==="compacted"&&e.cell.timeSeconds===null||(e.cell.kind==="tool"||e.cell.kind==="subtool")&&e.cell.outputDetail===void 0?"running":"complete"}a(en,"stateOf");function tn(e){return e==="error"?"Failed":e==="running"?"Pending":"Completed"}a(tn,"statusLabel");function ti({cell:e}){const t=e.output!==void 0&&e.think!==void 0?Math.max(0,e.output-e.think):void 0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Tokens"}),(0,o.jsx)("dd",{children:e.output===void 0?"—":`${e.output} tok`})]}),e.think!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Reasoning"}),(0,o.jsxs)("dd",{children:[e.think," tok"]})]}),t!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Content"}),(0,o.jsxs)("dd",{children:[t," tok"]})]})]})}a(ti,"TokenRows");function ni(e){if(!(e.input===void 0&&e.cacheRead===void 0&&e.cacheWrite===void 0))return(e.input??0)+(e.cacheRead??0)+(e.cacheWrite??0)}a(ni,"inputTotal");function nn({usage:e}){if(e===void 0)return(0,o.jsx)("p",{className:c.noPayload,children:"Usage not reported"});const t=ni(e),n=e.output!==void 0&&e.reasoning!==void 0?e.output-e.reasoning:void 0;return(0,o.jsxs)("dl",{className:c.overview,children:[t!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Input"}),(0,o.jsxs)("dd",{children:[t," tok"]})]}),e.cacheRead!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Cached"}),(0,o.jsxs)("dd",{children:[e.cacheRead," tok"]})]}),e.cacheWrite!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Cache created"}),(0,o.jsxs)("dd",{children:[e.cacheWrite," tok"]})]}),e.input!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Other"}),(0,o.jsxs)("dd",{children:[e.input," tok"]})]}),e.output!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Output"}),(0,o.jsxs)("dd",{children:[e.output," tok"]})]}),e.reasoning!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Reasoning"}),(0,o.jsxs)("dd",{children:[e.reasoning," tok"]})]}),n!==void 0&&(0,o.jsxs)("div",{className:c.requestTokenDetail,children:[(0,o.jsx)("dt",{children:"Content"}),(0,o.jsxs)("dd",{children:[n," tok"]})]})]})}a(nn,"UsageRows");function si({usage:e,cumulative:t}){return(0,o.jsxs)("div",{className:c.usagePanel,children:[(0,o.jsxs)("section",{className:c.usageGroup,children:[(0,o.jsx)("h4",{className:c.usageHeading,children:"This request"}),(0,o.jsx)(nn,{usage:e})]}),(0,o.jsxs)("section",{className:c.usageGroup,children:[(0,o.jsx)("h4",{className:c.usageHeading,children:"Session cumulative"}),(0,o.jsx)(nn,{usage:t})]})]})}a(si,"RequestUsagePanel");function Un({options:e,preview:t=!1}){return e===void 0?(0,o.jsx)("p",{className:c.noPayload,children:"Options not recorded"}):(0,o.jsx)(K.JsonTree,{data:e,label:"Request options JSON",className:t?c.jsonPreview:c.jsonPayload})}a(Un,"RequestOptions");function ri(e){if(typeof e!="object"||e===null||Array.isArray(e))return"Unknown";const t=e,n=t.kind;if(n==="user")return"User";if(n==="plugin"){const s=t.plugin;return typeof s=="string"&&s!==""?`Plugin · ${s}`:"Plugin"}if(n==="goal"){const s=t.round;return typeof s=="number"&&s>0?`Goal · Round ${s}`:"Goal"}return typeof n!="string"||n===""?"Unknown":`${n[0]?.toUpperCase()??""}${n.slice(1)}`}a(ri,"messageSourceLabel");function oi({record:e}){const t=e.cell.messageSource;return t===void 0?(0,o.jsx)("p",{className:c.noPayload,children:"Source not recorded"}):(0,o.jsx)(K.JsonTree,{data:typeof t=="object"&&t!==null?t:{value:t},label:"Message source JSON",className:c.jsonPayload})}a(oi,"MessageSource");function Qn(e){return e.cell.kind==="user"||e.cell.kind==="context"||e.cell.kind==="message"}a(Qn,"isMarkdownRecord");function ii(e,t){if(t.cell.kind!=="tool"&&t.cell.kind!=="subtool")return{};const n=e.findIndex(l=>l.cell.index===t.cell.index);if(n===-1)return{};let s;if(t.cell.kind==="subtool")for(let l=n-1;l>=0;l--){const u=e[l];if(u===void 0||u.turn!==t.turn||u.group!==t.group)break;if(u.cell.kind==="tool"){s=u;break}}const r=s?.cell.callId??t.cell.callId;let i;return r!==void 0&&(i=e.find(l=>l.turn===t.turn&&l.cell.kind==="message"&&l.cell.sourceBlocks?.some(u=>u.callId===r)===!0)),{...i===void 0?{}:{message:i},...s===void 0?{}:{tool:s}}}a(ii,"parentRecords");function ai(e){if(e.cell.kind==="user"||e.cell.kind==="context")return e.cell.inputDetail;if(e.cell.kind==="message"||e.cell.kind==="compacted")return e.cell.outputDetail}a(ai,"markdownSource");function Kn(e){return e.cell.kind==="system"?e.cell.previousPromptDetail===void 0?Fn:Po:e.cell.kind==="compacted"?[{id:"overview",label:"Summary"},{id:"raw",label:"Raw Output"}]:Qn(e)?[{id:"overview",label:"Summary"},{id:"rendered",label:"Preview"},{id:"raw",label:"Raw"},...e.cell.messageSource===void 0?[]:[{id:"source",label:"Source"}]]:[{id:"overview",label:"Summary"},...e.cell.inputDetail?[{id:"input",label:"Payload"}]:[],...e.cell.outputDetail?[{id:"output",label:"Result"}]:[],{id:"schema",label:"Schema"},{id:"timing",label:"Timing"}]}a(Kn,"detailTabs");function li(e){if(sn(e))return"";if(e.previewMarkdown!==void 0){const n=ut(e.previewMarkdown);return e.text===""?n:n===""?e.text:`${e.text} · ${n}`}if(e.text!=="")return e.text;const t=e.kind==="user"||e.kind==="context"?e.inputDetail:e.kind==="message"?e.outputDetail??e.thinkingDetail:void 0;return t===void 0?"":ut(t)}a(li,"recordDisplayText");function ci(e){return e.resultPreviewMarkdown===void 0?e.result:ut(e.resultPreviewMarkdown)}a(ci,"recordResultText");function di(e,t){if(e!=="tool"&&e!=="subtool")return;const n=t.indexOf(" · ");return n===-1?{name:t}:{name:t.slice(0,n),args:t.slice(n+3)}}a(di,"toolCallTextParts");function sn(e){return e.kind==="message"&&!e.outputDetail&&!e.thinkingDetail&&e.text==="Tool call only"}a(sn,"isToolCallOnly");function ui({cell:e,children:t}){const n=(0,b.useMemo)(()=>li(e),[e.kind,e.text,e.previewMarkdown,e.inputDetail,e.outputDetail,e.thinkingDetail]),s=(0,b.useMemo)(()=>ci(e),[e.result,e.resultPreviewMarkdown]),r=sn(e),i=di(e.kind,n);return t({displayText:n,listDisplayText:r?"(tool call only)":i===void 0?n:[i.name,i.args].filter(Boolean).join(" "),resultText:s,toolCallOnly:r,toolCallText:i})}a(ui,"RecordPresentation");function pi({displayText:e,toolCallOnly:t,toolCallText:n}){return t?(0,o.jsx)("span",{className:c.toolCallOnly,children:"(tool call only)"}):n===void 0?e||"—":(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:c.toolCallNameTypeface,children:n.name||"—"}),n.args!==void 0&&(0,o.jsx)("span",{className:c.toolCallPayload,children:n.args})]})}a(pi,"RecordListText");function pt({text:e,rendered:t,preview:n}){return t?(0,o.jsx)("div",{className:n?c.markdownPreview:c.markdownPayload,children:(0,o.jsx)(K.MarkdownText,{text:e})}):(0,o.jsx)("pre",{className:`${c.payload} ${n?c.payloadPreview:""}`,children:e})}a(pt,"MarkdownFragment");function hi({blocks:e,onOpenCall:t}){return(0,o.jsx)("div",{className:c.sourceBlocks,children:e.map((n,s)=>(0,o.jsxs)("section",{className:c.sourceBlock,children:[n.callId!==void 0?(0,o.jsxs)("button",{type:"button",className:c.sourceBlockJumpTarget,"aria-label":`Open Block #${s+1} tool call summary`,title:"Open tool call summary",onClick:a(()=>{n.callId!==void 0&&t(n.callId)},"onClick"),children:[(0,o.jsx)("span",{className:c.sourceBlockLabel,children:`Block #${s+1} ${n.type}`}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.sourceBlockJumpIcon,size:12})]}):(0,o.jsx)("div",{className:c.sourceBlockHeader,children:(0,o.jsx)("span",{className:c.sourceBlockLabel,children:`Block #${s+1} ${n.type}`})}),n.imageSrc!==void 0?(0,o.jsx)(rn,{block:n}):(0,o.jsx)("pre",{className:c.sourceBlockContent,children:n.content})]},s))})}a(hi,"SourceBlocks");function rn({block:e,preview:t=!1}){return e.imageSrc===void 0?null:(0,o.jsx)("a",{className:t?`${c.panelImageLink} ${c.panelImageLinkPreview}`:c.panelImageLink,href:e.imageSrc,target:"_blank",rel:"noopener noreferrer",title:"Open image",children:(0,o.jsx)("img",{className:c.panelImage,src:e.imageSrc,alt:e.imageAlt??""})})}a(rn,"PanelImage");function Zn({blocks:e,preview:t}){const n=e?.filter(s=>s.imageSrc!==void 0)??[];return n.length===0?null:(0,o.jsx)("div",{className:t?`${c.messageImages} ${c.messageImagesPreview}`:c.messageImages,children:n.map((s,r)=>(0,o.jsx)(rn,{block:s,preview:t},r))})}a(Zn,"MessageImages");function es({blocks:e,preview:t,onOpenCall:n}){const s=e?.filter(r=>r.type==="tool-call")??[];return s.length===0?null:(0,o.jsx)("ul",{className:t?`${c.assistantToolCalls} ${c.assistantToolCallsPreview}`:c.assistantToolCalls,children:s.map((r,i)=>(0,o.jsx)("li",{children:(0,o.jsxs)("button",{type:"button",className:c.assistantToolCallButton,title:"Open tool call summary",onClick:a(()=>{r.callId!==void 0&&n(r.callId)},"onClick"),children:[(0,o.jsx)("svg",{className:c.assistantToolCallIcon,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,o.jsxs)("span",{className:c.assistantToolCallText,children:[(0,o.jsx)("span",{className:c.assistantToolCallName,children:r.toolName??"tool-call"}),r.content!==""&&(0,o.jsx)("span",{className:c.assistantToolCallArgs,children:r.content})]})]})},r.callId??i))})}a(es,"AssistantToolCalls");function fi(){return(0,o.jsx)("svg",{className:c.toolCatalogIcon,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}a(fi,"ToolGlyph");function mi({tools:e}){return e.length===0?(0,o.jsx)("p",{className:c.noPayload,children:"No tools in this request"}):(0,o.jsx)("div",{className:c.toolCatalog,children:e.map((t,n)=>(0,o.jsxs)("details",{className:c.toolCatalogItem,children:[(0,o.jsxs)("summary",{className:c.toolCatalogSummary,children:[(0,o.jsx)(K.IconChevronRightOutline14,{className:c.toolCatalogChevron,size:12}),(0,o.jsx)(fi,{}),(0,o.jsx)("span",{className:c.toolCatalogName,children:t.name}),(0,o.jsx)("span",{className:c.toolCatalogDescription,children:t.description})]}),(0,o.jsxs)("div",{className:c.toolCatalogDefinition,children:[t.description!==""&&(0,o.jsx)("p",{className:c.toolCatalogFullDescription,children:t.description}),(0,o.jsx)(K.JsonTree,{data:t.parameters,label:`${t.name} parameters JSON`,className:c.toolCatalogTree})]})]},`${t.name}:${n}`))})}a(mi,"ToolCatalog");function gi(e,t){return po("","",e,t,void 0,void 0,{context:3}).hunks.flatMap((n,s)=>[...s===0?[]:[{kind:"meta",text:""}],{kind:"meta",text:`@@ -${n.oldStart},${n.oldLines} +${n.newStart},${n.newLines} @@`},...n.lines.flatMap(r=>r.startsWith("\\")?[]:r.startsWith("+")?[{kind:"added",text:r}]:r.startsWith("-")?[{kind:"removed",text:r}]:[{kind:"context",text:r}])])}a(gi,"promptDiffLines");function ts({title:e,before:t,after:n}){const s=gi(t,n);return s.length===0?null:(0,o.jsxs)("section",{className:c.promptDiffSection,children:[(0,o.jsx)("h3",{className:c.promptDiffTitle,children:e}),(0,o.jsx)("pre",{className:c.promptDiff,children:s.map((r,i)=>(0,o.jsxs)("span",{className:c[`promptDiffLine${r.kind}`],children:[r.text||" ",`
|
|
11
|
+
`]},i))})]})}a(ts,"PromptDiffSection");function vi({before:e,after:t}){const n=JSON.stringify(e.tools,null,2),s=JSON.stringify(t.tools,null,2);return(0,o.jsxs)("div",{className:c.promptDiffSections,children:[e.system!==t.system&&(0,o.jsx)(ts,{title:"System Prompt",before:e.system,after:t.system}),n!==s&&(0,o.jsx)(ts,{title:"Tools",before:n,after:s})]})}a(vi,"SystemPromptDiff");function xi({blocks:e,error:t,preview:n}){return(0,o.jsx)("div",{className:[c.resultBlocks,n?c.resultBlocksPreview:void 0,t?c.errorPayload:void 0].filter(s=>s!==void 0).join(" "),children:e.map((s,r)=>s.imageSrc!==void 0?(0,o.jsx)(rn,{block:s,preview:n},r):s.content!==""?(0,o.jsx)("pre",{className:c.resultBlockText,children:s.content},r):null)})}a(xi,"ToolOutputBlocks");function Ct({record:e,rendered:t,preview:n=!1,thinkingExpanded:s,onThinkingExpandedChange:r,onOpenCall:i}){if(!t&&e.cell.sourceBlocks&&e.cell.sourceBlocks.length>0)return(0,o.jsx)(hi,{blocks:e.cell.sourceBlocks,onOpenCall:i});if(e.cell.thinkingDetail){if(!t){const f=[e.cell.thinkingDetail,e.cell.outputDetail].filter(m=>m!==void 0&&m!=="").join(`
|
|
12
12
|
|
|
13
|
-
`),rendered:!1,preview:n});const l=ai(e),u=e.cell.sourceBlocks?.some(f=>f.imageSrc!==void 0)===!0,p=e.cell.kind==="message"&&e.cell.sourceBlocks?.some(f=>f.type==="tool-call")===!0;if(!l&&!u&&!p){const f=tn(e.cell)?"Tool call only":e.cell.text||"No content";return(0,o.jsx)("p",{className:c.noPayload,children:f})}return!t||!u&&!p?(0,o.jsx)(pt,{text:l??"",rendered:t,preview:n}):(0,o.jsxs)("div",{children:[l&&(0,o.jsx)(pt,{text:l,rendered:!0,preview:n}),e.cell.kind==="message"&&(0,o.jsx)(Kn,{blocks:e.cell.sourceBlocks,preview:n,onOpenCall:i}),(0,o.jsx)(Qn,{blocks:e.cell.sourceBlocks,preview:n})]})}a(jt,"MarkdownRecordContent");function Gt({record:e}){return e.cell.kind==="message"&&e.cell.assistantMetrics!==void 0?(0,o.jsx)(Ho,{metrics:e.cell.assistantMetrics}):(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Bt,{timestamp:e.cell.startedAt??null})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:tt(e.cell.timeSeconds)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Timing source"}),(0,o.jsx)("dd",{children:e.cell.timeSeconds===null?"Not available":"Session timestamps"})]})]})}a(Gt,"RecordTiming");function es({assistant:e,anchor:t,request:n}){if(e!==void 0)return(0,o.jsx)(Gt,{record:e});if(n?.startedAt!==void 0){const s=n.completedAt===null||n.completedAt===void 0?null:Math.max(0,(n.completedAt-n.startedAt)/1e3);return(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Bt,{timestamp:n.startedAt})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:tt(s)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Timing source"}),(0,o.jsx)("dd",{children:s===null?"Session timestamps (running)":"Session timestamps"})]})]})}return(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Bt,{timestamp:t?.cell.startedAt??null})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:tt(null)})]})]})}a(es,"RequestTiming");function Ct({record:e,direction:t,preview:n=!1}){const s=t==="input"?e.cell.inputDetail:e.cell.outputDetail,r=t==="input"?"No payload captured":"No result captured";if(!s)return(0,o.jsx)("p",{className:c.noPayload,children:r});const i=t==="output"&&e.cell.isError===!0,l=n?c.jsonPreview:c.jsonPayload,u=i?`${l} ${c.errorPayload}`:l,p=bi(s);return t==="output"&&e.cell.outputBlocks?.length===1&&e.cell.outputBlocks[0]?.type==="text"&&p!==void 0?(0,o.jsx)(ee.JsonTree,{data:p,label:"Result JSON",className:u}):t==="output"&&e.cell.outputBlocks?.some(f=>f.imageSrc!==void 0||f.content!=="")===!0?(0,o.jsx)(xi,{blocks:e.cell.outputBlocks,error:i,preview:n}):t==="input"&&(e.cell.kind==="user"||e.cell.kind==="context")||t==="output"&&e.cell.kind==="message"?(0,o.jsx)("div",{className:[n?c.markdownPreview:c.markdownPayload,i?c.errorPayload:void 0].filter(f=>f!==void 0).join(" "),children:(0,o.jsx)(ee.MarkdownText,{text:s})}):p!==void 0?(0,o.jsx)(ee.JsonTree,{data:p,label:`${t==="input"?"Payload":"Result"} JSON`,className:u}):(0,o.jsx)("pre",{className:[c.payload,n?c.payloadPreview:void 0,i?c.errorPayload:void 0,s==="No output"?c.noOutputText:void 0].filter(f=>f!==void 0).join(" "),children:s})}a(Ct,"RecordPayload");function ts({record:e,preview:t=!1}){if(!e.cell.schemaDetail)return(0,o.jsx)("p",{className:c.noPayload,children:"Schema unavailable"});const n=yi(e.cell.schemaDetail);return n!==void 0?(0,o.jsxs)("div",{className:t?`${c.schema} ${c.schemaPreview}`:c.schema,children:[(0,o.jsxs)("header",{className:c.schemaIntro,children:[(0,o.jsx)("h3",{className:c.schemaName,children:n.name}),(0,o.jsx)("p",{className:c.schemaDescription,children:n.description})]}),(0,o.jsxs)("section",{className:c.schemaParameters,children:[(0,o.jsx)("h4",{className:c.schemaParametersTitle,children:"Parameters"}),(0,o.jsx)(ee.JsonTree,{data:n.parameters,label:`${n.name} parameters JSON`,className:c.schemaTree})]})]}):(0,o.jsx)("pre",{className:`${c.payload} ${t?c.payloadPreview:""}`,children:e.cell.schemaDetail})}a(ts,"RecordSchema");function yi(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return;const n=t;return typeof n.name!="string"||typeof n.description!="string"||typeof n.parameters!="object"||n.parameters===null||Array.isArray(n.parameters)?void 0:{name:n.name,description:n.description,parameters:n.parameters}}catch{return}}a(yi,"parseToolSchema");function bi(e){try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:void 0}catch{return}}a(bi,"parseJsonContainer");function Me({label:e,onOpen:t,children:n}){return(0,o.jsxs)("section",{className:c.overviewSection,children:[(0,o.jsx)("h3",{className:c.overviewHeading,children:(0,o.jsxs)("button",{type:"button",className:c.overviewTitle,onClick:t,children:[(0,o.jsx)("span",{children:e}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.overviewTitleIcon,size:12})]})}),(0,o.jsx)("div",{className:`${c.overviewPreview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:n})]})}a(Me,"OverviewSection");function wi({requestNumbers:e,turns:t,streamingCells:n=[],timelineFocusIndexes:s=null,searchMatchIndexes:r=null,onSelectedIndexChange:i,onRecordSelect:l,recordSelection:u=null,recordFocus:p=null,historyLoading:f=!1,olderHistoryLoading:m=!1,historyStartSeq:h,hasOlderRecords:b=!1,onLoadOlder:v,onClearSelection:T,collapsedTurns:k,onToggleTurn:S,collapsedAssistants:w,onToggleAssistant:B,inspectCallId:C=null,onInspectApplied:I}){const[q,se]=(0,y.useState)(null),[E,fe]=(0,y.useState)(null),[g,x]=(0,y.useState)("overview"),[P,N]=(0,y.useState)(!1),[R,oe]=(0,y.useState)(null),[le,z]=(0,y.useState)(null),F=(0,y.useRef)(null),Xe=(0,y.useRef)(null),Ye=(0,y.useRef)(null),ge=(0,y.useRef)(new Set(["overview"])),De=(0,y.useRef)(null),pe=(0,y.useRef)(null),ye=(0,y.useRef)(!1),Je=(0,y.useRef)(!1),[Ge,Re]=(0,y.useState)(!1),ve=(0,y.useRef)(null),qe=(0,y.useRef)(!1),[ke,Pe]=(0,y.useState)(!1),Ce=(0,y.useRef)(null),A=(0,y.useMemo)(()=>Xn(t),[t]),V=(0,y.useMemo)(()=>new Map(n.map(d=>[d.index,d])),[n]),M=(0,y.useCallback)(d=>{const G=V.get(d.cell.index);return G===void 0?d:{...d,cell:G}},[V]),O=(0,y.useMemo)(()=>q===null?void 0:A.find(d=>he(d.cell)===q),[A,q]),_=O===void 0?void 0:M(O),Q=_?.cell.index??null;(0,y.useEffect)(()=>{i?.(Q)},[i,Q]);const Y=(0,y.useMemo)(()=>Xo(A),[A]),de=(0,y.useMemo)(()=>Yo(A,e,Y),[A,Y,e]),K=(0,y.useMemo)(()=>{if(r!==null)return Fo(A,r);const d=k.size===0?A:Qo(A,k);return w.size===0?d:ei(d,w)},[A,w,k,r]),W=(0,y.useMemo)(()=>vo(K),[K]),we=jo(W),te=b||K.length>_o,Ve=b?Vo:0,Oe=(0,y.useCallback)(d=>we[d]?.height??30,[we]),Mt=(0,y.useCallback)(d=>we[d]?.key??d,[we]),fn=(0,y.useCallback)(()=>pe.current,[]),Ie=Kr({count:te?we.length:0,enabled:te,estimateSize:Oe,getItemKey:Mt,getScrollElement:fn,initialRect:{width:0,height:ko},anchorTo:"end",overscan:No,scrollMargin:Ve,scrollEndThreshold:Ln}),st=(0,y.useMemo)(()=>{const d=new Map;for(const[G,$]of W.entries())for(const U of $.entries)U.record.collapsedSummary===void 0&&d.set(he(U.record.cell),G);return d},[W]),rt=te?Ie.getVirtualItems():[],ft=Math.max(0,(rt[0]?.start??0)-Ve),j=rt.length===0?0:Math.max(0,Ie.getTotalSize()+Ve-(rt.at(-1)?.end??0)),ae=te?rt.flatMap(d=>{const G=W[d.index];return G===void 0?[]:G.entries.map(($,U)=>({record:M($.record),position:$.logicalIndex,terminalRequestBoundary:$.record.cell.requestOnly===!0&&G.entries.at(-1)?.record.cell.requestOnly===!0&&U===G.entries.length-1}))}):K.map((d,G)=>({record:M(d),position:G,terminalRequestBoundary:d.cell.requestOnly===!0&&G===K.length-1})),J=(0,y.useMemo)(()=>Jo(K),[K]),ce=_?.cell.kind==="system"?_.cell.promptDetail:void 0,be=_?.cell.kind==="system"?_.cell.previousPromptDetail:void 0,D=ce!==void 0,ue=_===void 0?void 0:Kt(_),Se=(0,y.useMemo)(()=>E===null?[]:A.filter(d=>d.turn===E.turn&&d.group===E.group),[A,E]).map(M),H=Se.find(d=>d.cell.kind==="message"),ie=H??Se[0],Ue=E===null?void 0:de.get(We(E.turn,E.group)),X=E===null?void 0:e?.find(d=>E.seq===void 0?d.turn===E.turn&&d.group===E.group:d.seq===E.seq),Qe=E===null?void 0:X?.status??(H?.cell.assistantMetrics?.completedTime===null||H===void 0&&Se.some(d=>Kt(d)==="running")?"running":"complete"),Et=Se.filter(d=>d.cell.kind==="tool").length,mt=Se.filter(d=>d.cell.kind==="subtool").length,gt=X?.resultSeq===void 0?H:A.find(d=>d.cell.sourceSeq===X.resultSeq),Ss=gt===void 0?void 0:M(gt),mn=X?.usage??(H===void 0?void 0:{...H.cell.input===void 0?{}:{input:H.cell.input},...H.cell.cacheRead===void 0?{}:{cacheRead:H.cell.cacheRead},...H.cell.cacheWrite===void 0?{}:{cacheWrite:H.cell.cacheWrite},...H.cell.output===void 0?{}:{output:H.cell.output},...H.cell.think===void 0?{}:{reasoning:H.cell.think}}),ga=X?.cumulativeUsage??mn,Dt=X?.requestConfig,Ts=E===null?_?.turn:E.turn,va=E===null?_?.section:Se[0]?.section,xa=E!==null?Po.filter(d=>d.id!=="options"||Dt!==void 0):_===void 0?[]:Un(_),qt=_===void 0?{}:ii(A,_),Bs=qt.message,js=qt.tool,Pt=_?.cell.kind==="message"?de.get(We(_.turn,_.group)):void 0,Gs=Pt===void 0?void 0:e?.find(d=>d.number===Pt),ot=_!==void 0&&Pt!==void 0?{turn:_.turn,group:_.group,...Gs?.seq===void 0?{}:{seq:Gs.seq}}:void 0,ya=ot!==void 0||qt.message!==void 0||qt.tool!==void 0,ba=le===null?void 0:{"--trajectory-tool-request-width":`calc(58cqw - ${le}px)`},Te=a(d=>{ge.current.delete(d),ge.current.add(d),x(d)},"activateTab"),Cs=a(()=>{se(null),fe(null)},"clearInspectorSelection"),wa=a(()=>{Cs(),T?.()},"clearAllSelections"),Ot=(0,y.useCallback)(d=>{const G=A.find(ne=>ne.cell.index===d);if(l?.(d),fe(null),se(G===void 0?null:he(G.cell)),G===void 0)return;const $=Un(G),U=new Set($.map(ne=>ne.id));x([...ge.current].reverse().find(ne=>U.has(ne))??$[0]?.id??"overview")},[A,l]);(0,y.useEffect)(()=>{if(u===null||Xe.current===u)return;Xe.current=u,Ot(u.index);const d=A.find(G=>G.cell.index===u.index);ve.current=d===void 0?null:he(d.cell)},[A,u,Ot]),(0,y.useEffect)(()=>{if(p===null||Ye.current===p)return;Ye.current=p;const d=A.find(G=>G.cell.index===p.index);ve.current=d===void 0?null:he(d.cell)},[A,p]);const gn=a((d,G="overview")=>{se(null),fe(d),Te(G)},"selectRequest"),it=a(d=>{const G=A.findIndex($=>$.cell.index===d.cell.index);if(d.turn!==null&&k.has(d.turn)&&S(d.turn),d.cell.kind==="tool"||d.cell.kind==="subtool")for(let $=G-1;$>=0;$--){const U=A[$];if(U===void 0||U.turn!==d.turn)break;if(U.cell.kind!=="message")continue;const ne=he(U.cell);w.has(ne)&&B(ne);break}fe(null),se(he(d.cell)),Te("overview")},"openRecordSummary"),At=a(d=>{const G=A.find($=>$.cell.callId===d);G!==void 0&&it(G)},"openCallSummary"),Is=(0,y.useRef)(it);Is.current=it,(0,y.useEffect)(()=>{if(C===null)return;const d=Xn(t).find(G=>G.cell.callId===C);d!==void 0&&(Is.current(d),ve.current=he(d.cell),I?.())},[C,t,I]),(0,y.useEffect)(()=>{const d=ve.current;if(d===null)return;const G=K.findIndex(ne=>he(ne.cell)===d&&ne.collapsedSummary===void 0);if(G===-1)return;if(te){const ne=st.get(d);if(ne===void 0)return;ve.current=null,ye.current=!1,Ie.scrollToIndex(ne,{behavior:"smooth",align:"center"});return}ve.current=null,ye.current=!1;const $=K[G]?.cell.index,U=$===void 0?null:De.current?.querySelector(`tr[data-record-index="${$}"]`);U!=null&&typeof U.scrollIntoView=="function"&&U.scrollIntoView({behavior:"smooth",block:"center"})},[K,Ie,st,te]),(0,y.useEffect)(()=>{if(s===null||s.size===0)return;const d=K.flatMap((Z,re)=>Z.collapsedSummary===void 0&&Z.cell.requestOnly!==!0&&s.has(Z.cell.index)?[re]:[]),G=d.at(0),$=d.at(-1);if(G===void 0||$===void 0)return;if(!te){const Z=De.current;if(Z===null)return;const re=[...Z.querySelectorAll('tr[data-timeline-focus="inside"]')],Ae=re.at(0),xt=re.at(-1);if(Ae===void 0||xt===void 0)return;const Be=xt.getBoundingClientRect().bottom-Ae.getBoundingClientRect().top,Le=Be>Z.clientHeight?Ae:re[Math.floor((re.length-1)/2)];Le!==void 0&&typeof Le.scrollIntoView=="function"&&(ye.current=!1,Le.scrollIntoView({behavior:"smooth",block:Be>Z.clientHeight?"start":"center"}));return}const U=[...new Set(d.flatMap(Z=>{const re=K[Z];if(re===void 0)return[];const Ae=st.get(he(re.cell));return Ae===void 0?[]:[Ae]}))].sort((Z,re)=>Z-re),ne=U.at(0),_e=U.at(-1);if(ne===void 0||_e===void 0)return;const Ke=pe.current?.clientHeight??0,at=W.slice(ne,_e+1).reduce((Z,re)=>Z+re.height,0);ye.current=!1,Ie.scrollToIndex(at>Ke?ne:U[Math.floor((U.length-1)/2)]??ne,{behavior:"smooth",align:at>Ke?"start":"center"})},[W,K,Ie,s,st,te]);const Rs=(0,y.useCallback)((d,G)=>{!b||v===void 0||qe.current||m||G&&d.scrollTop>wo||(qe.current=!0,Pe(!0),Ce.current={historyStartSeq:h,scrollHeight:d.scrollHeight,scrollTop:d.scrollTop},v().then($=>{$||(Ce.current=null)}).finally(()=>{qe.current=!1,Pe(!1)}))},[b,h,m,v]);(0,y.useLayoutEffect)(()=>{const d=pe.current;if(d===null)return;const G=Ce.current;if(G!==null&&G.historyStartSeq!==h){te||(d.scrollTop=G.scrollTop+d.scrollHeight-G.scrollHeight),Ce.current=null,ye.current=!1;return}if(!Je.current){if(f)return;Je.current=!0,ye.current=!0,te?Ie.scrollToEnd({behavior:"auto"}):d.scrollTop=d.scrollHeight,Re(!0);return}ye.current&&(te?Ie.scrollToEnd({behavior:"auto"}):d.scrollTop=d.scrollHeight)},[f,h,Ie,we,te]);const vt=m||ke,Va=f||!Ge,Ms=b?1:0;return(0,o.jsxs)("div",{ref:De,className:c.split,style:ba,children:[(0,o.jsxs)("div",{ref:pe,className:c.tablePane,"data-trajectory-scroll":"",onScroll:a(d=>{const G=d.currentTarget;ye.current=G.scrollHeight-G.clientHeight-G.scrollTop<=Ln,Rs(G,!0)},"onScroll"),onClick:a(d=>{d.target===d.currentTarget&&wa()},"onClick"),children:[Va&&(0,o.jsx)("div",{className:c.historyLoading,role:"status","aria-live":"polite",children:(0,o.jsxs)("span",{className:c.historyLoadingBar,children:[(0,o.jsx)("span",{className:c.historyLoadingSpinner,"aria-hidden":"true"}),"Loading trajectory…"]})}),(0,o.jsxs)("table",{className:c.table,"data-scroll-ready":Ge||void 0,"aria-rowcount":K.length+Ms,children:[(0,o.jsxs)("colgroup",{children:[(0,o.jsx)("col",{className:c.eventColumn}),(0,o.jsx)("col",{className:c.contentColumn})]}),(0,o.jsxs)("tbody",{children:[b&&(0,o.jsx)("tr",{className:c.historyLoadRow,"data-history-load":"","aria-rowindex":1,children:(0,o.jsx)("td",{colSpan:2,children:(0,o.jsxs)("button",{type:"button",className:c.historyLoadButton,disabled:vt||v===void 0,"aria-label":vt?"Loading earlier history…":"Load earlier history",onClick:a(()=>{const d=pe.current;d!==null&&Rs(d,!1)},"onClick"),children:[vt&&(0,o.jsx)("span",{className:c.historyLoadingSpinner,"aria-hidden":"true"}),(0,o.jsx)("span",{"aria-hidden":"true",children:vt?"Loading earlier history…":"Load earlier history"}),(0,o.jsx)("span",{className:c.visuallyHidden,role:"status","aria-live":"polite",children:vt?"Loading earlier history…":""})]})})}),ft>0&&(0,o.jsx)("tr",{className:c.virtualSpacer,"data-virtual-spacer":"top","aria-hidden":"true",children:(0,o.jsx)("td",{colSpan:2,style:{"--trajectory-virtual-spacer-height":`${ft}px`}})}),ae.map(({record:d,position:G,terminalRequestBoundary:$})=>(0,o.jsx)(ui,{cell:d.cell,children:a(({displayText:U,listDisplayText:ne,resultText:_e,toolCallOnly:Ke,toolCallText:at})=>{const Z=d.collapsedSummary!==void 0,re=d.cell.requestOnly===!0,Ae=d.cell.kind==="system"&&d.cell.index===A[0]?.cell.index,xt=We(d.turn,d.group),Be=Y.get(xt)===d.cell.index&&!Z&&(d.turn===null||!k.has(d.turn))?de.get(xt):void 0,Le=Be===void 0?void 0:e?.find(Ne=>Ne.number===Be),_a=Le?.status??(d.cell.isError===!0?"error":void 0),Es=J.get(d.cell.index)??0,Na={"--request-boundary-offset":`${Es*8}px`},Ds=Be===void 0?void 0:`Request #${Be}${Le?.purpose==="compaction"?" · Compaction":""}`,qs=Be!==void 0&&E?.turn===d.turn&&E.group===d.group,ka=d.turn===null?va===d.section:Ts===d.turn;return(0,o.jsxs)("tr",{tabIndex:re?-1:0,"aria-rowindex":G+1+Ms,"aria-label":Z?`Collapsed ${d.collapsedSummaryKind} summary, ${d.collapsedSummary}`:re?`Request ${Be??""}, compaction`:`${Be===void 0?"":`Request ${Be}, `}${kt[d.cell.kind]}, ${ne||"no content"}`,"aria-selected":!Z&&!re&&Q===d.cell.index,"data-kind":d.cell.kind,"data-trajectory-row-key":Nt(d),"data-virtual-position":te?G:void 0,"data-record-index":!Z&&!re?d.cell.index:void 0,"data-request-only":re||void 0,"data-terminal-request-boundary":$||void 0,"data-group-start":d.groupStart||void 0,"data-turn-start":d.turnStart||void 0,"data-error":d.cell.isError||void 0,"data-running":Kt(d)==="running"||void 0,"data-turn-end":d.turnEnd||void 0,"data-collapsed-summary":d.collapsedSummaryKind,"data-selected":!Z&&Q===d.cell.index||void 0,"data-timeline-focus":Z||s===null?void 0:s.has(d.cell.index)?"inside":"outside",onClick:re?void 0:Z?()=>{d.collapsedSummaryKind==="turn"&&d.turn!==null?S(d.turn):B(he(d.cell))}:()=>{Ot(d.cell.index)},onDoubleClick:a(Ne=>{if(!(Z||re)){if(d.turn!==null&&k.has(d.turn)){Ne.preventDefault(),S(d.turn);return}if(d.cell.kind==="message"&&Ko(A,d.cell.index).length>0){Ne.preventDefault(),B(he(d.cell));return}d.turnStart&&d.turn!==null&&(A.filter(vn=>vn.turn===d.turn&&vn.cell.requestOnly!==!0&&vn.cell.kind!=="system").length<=1||(Ne.preventDefault(),S(d.turn)))}},"onDoubleClick"),onKeyDown:a(Ne=>{if(!re&&!(Ne.key!=="Enter"&&Ne.key!==" ")){if(Ne.preventDefault(),Z){d.collapsedSummaryKind==="turn"&&d.turn!==null?S(d.turn):B(he(d.cell));return}Ot(d.cell.index)}},"onKeyDown"),children:[(0,o.jsxs)("td",{className:c.event,children:[Be!==void 0&&(0,o.jsx)("button",{type:"button",className:qs?`${c.requestBoundaryControl} ${c.requestBoundaryControlActive}`:c.requestBoundaryControl,"aria-label":Ds,"aria-pressed":qs,"data-label":Ds,"data-request-run-index":Es,"data-request-status":_a,style:Na,onClick:a(Ne=>{Ne.stopPropagation(),gn({turn:d.turn,group:d.group,...Le?.seq===void 0?{}:{seq:Le.seq}})},"onClick"),onDoubleClick:a(Ne=>{Ne.stopPropagation()},"onDoubleClick")}),d.turn!==null&&Ts===d.turn&&!Ae&&(0,o.jsx)("span",{className:c.turnRail,"aria-hidden":"true"}),!Z&&Q===d.cell.index&&(0,o.jsx)("span",{className:c.selectionRail,"aria-hidden":"true"}),!Z&&!re&&d.turnStart&&(0,o.jsx)("span",{className:ka?`${c.turnLabel} ${c.turnLabelActive}`:c.turnLabel,"aria-label":He(d.turn),children:d.turn===null?He(d.turn):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:c.turnLabelFull,"aria-hidden":"true",children:He(d.turn)}),(0,o.jsxs)("span",{className:c.turnLabelCompact,"aria-hidden":"true",children:["#",d.turn]})]})}),(0,o.jsx)("div",{className:c.eventInner,children:!Z&&!re&&(0,o.jsx)("span",{className:c.kindSlot,children:(0,o.jsxs)("span",{className:`${c.kindTag} ${d.cell.kind==="system"?c.systemNeutral:d.cell.kind==="context"?c.contextGreen:d.cell.kind==="compacted"?c.compacted:d.cell.kind==="tool"?c.toolAmber:d.cell.kind==="message"?c.assistantVioletBright:d.cell.kind==="subtool"?c.subtoolAmber:c[d.cell.kind]}`,"data-role-kind":d.cell.kind,children:[(0,o.jsx)(ee.Tooltip,{label:kt[d.cell.kind],side:"right",children:(0,o.jsx)("span",{className:c.kindTagIcon,"aria-hidden":"true",children:Bo[d.cell.kind]})}),(0,o.jsx)("span",{className:c.kindTagLabel,children:kt[d.cell.kind]})]})})})]}),(0,o.jsx)("td",{className:c.content,children:re?null:d.collapsedSummary!==void 0?(0,o.jsxs)("span",{className:c.collapsedTurnContent,title:d.collapsedSummary,children:[(0,o.jsx)("span",{className:c.collapsedTurnEllipsis,children:"…"}),(0,o.jsx)("span",{className:c.collapsedTurnText,children:d.collapsedSummary})]}):(0,o.jsxs)("span",{className:_e===void 0?c.contentText:c.resultPreview,title:_e===void 0?ne:`${ne} → ${_e}`,children:[(0,o.jsx)("span",{className:_e===void 0?void 0:c.resultRequest,children:(0,o.jsx)(pi,{displayText:U,toolCallOnly:Ke,toolCallText:at})}),_e!==void 0&&(0,o.jsxs)("span",{className:d.cell.isError?`${c.inlineResult} ${c.error}`:c.inlineResult,children:[(0,o.jsx)("span",{className:c.arrow,children:"→"}),(0,o.jsx)("span",{className:_e==="No output"?`${c.inlineResultText} ${c.noOutputText}`:c.inlineResultText,children:_e})]})]})})]})},"children")},Nt(d))),j>0&&(0,o.jsx)("tr",{className:c.virtualSpacer,"data-virtual-spacer":"bottom","aria-hidden":"true",children:(0,o.jsx)("td",{colSpan:2,style:{"--trajectory-virtual-spacer-height":`${j}px`}})})]})]})]}),(E!==null||D||_!==void 0&&ue!==void 0)&&(0,o.jsxs)("aside",{className:c.details,"aria-label":"Event details",style:R===null?void 0:{width:R},children:[(0,o.jsx)("div",{className:c.detailsResizeHandle,role:"separator","aria-label":"Resize event details","aria-controls":"trajectory-detail-panel","aria-orientation":"vertical",tabIndex:0,title:"Drag to resize. Double-click to reset.",onDoubleClick:a(()=>{oe(null),z(null)},"onDoubleClick"),onPointerDown:a(d=>{if(d.button!==0)return;const G=d.currentTarget.parentElement;if(G===null)return;const $=G.parentElement;if($===null)return;const U=$.getBoundingClientRect().width;F.current={pointerId:d.pointerId,startX:d.clientX,startWidth:G.getBoundingClientRect().width,splitWidth:U,startToolRequestOffset:le??U*St-Fn(U)},d.currentTarget.setPointerCapture(d.pointerId),d.preventDefault()},"onPointerDown"),onPointerMove:a(d=>{const G=F.current;if(G===null||G.pointerId!==d.pointerId)return;const $=Hn(G.startWidth+G.startX-d.clientX,G.splitWidth);oe($),z(G.startToolRequestOffset+($-G.startWidth)*St)},"onPointerMove"),onPointerUp:a(d=>{F.current?.pointerId===d.pointerId&&(F.current=null,d.currentTarget.releasePointerCapture(d.pointerId))},"onPointerUp"),onPointerCancel:a(()=>{F.current=null},"onPointerCancel"),onKeyDown:a(d=>{if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight")return;const G=d.currentTarget.parentElement;if(G===null)return;const $=G.parentElement;if($===null)return;const U=d.key==="ArrowLeft"?1:-1,ne=G.getBoundingClientRect().width,_e=$.getBoundingClientRect().width,Ke=Hn(ne+U*Io,_e),at=le??_e*St-Fn(_e);oe(Ke),z(at+(Ke-ne)*St),d.preventDefault()},"onKeyDown")}),(0,o.jsxs)("div",{className:c.detailsHeader,children:[(0,o.jsx)("div",{className:c.detailsTitle,children:E!==null?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:c.requestDetailsDot,"aria-hidden":"true"}),(0,o.jsxs)("span",{className:c.requestDetailsName,children:["Request #",Ue??"—"]}),(0,o.jsx)("span",{className:c.detailsLocation,children:X?.purpose==="compaction"?`Compaction · ${He(E.turn)}`:He(E.turn)})]}):D?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:`${c.kindTag} ${c.systemNeutral}`,children:"SYSTEM"}),(0,o.jsx)("span",{className:c.detailsLocation,children:_?.cell.text})]}):_!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:`${c.kindTag} ${_.cell.kind==="context"?c.contextGreen:_.cell.kind==="compacted"?c.compacted:_.cell.kind==="tool"?c.toolAmber:_.cell.kind==="message"?c.assistantVioletBright:_.cell.kind==="subtool"?c.subtoolAmber:c[_.cell.kind]}`,children:kt[_.cell.kind]}),(0,o.jsx)("span",{className:c.detailsLocation,children:_.cell.kind==="compacted"?He(_.turn):`${He(_.turn)} · ${_.group}`})]})}),(0,o.jsx)("button",{type:"button",className:c.close,"aria-label":"Close details",onClick:Cs,children:(0,o.jsx)("span",{"aria-hidden":"true",children:"×"})})]}),(0,o.jsx)("div",{className:c.detailTabs,role:"tablist","aria-label":"Event details",children:xa.map(d=>(0,o.jsx)("button",{id:`trajectory-detail-${d.id}`,type:"button",role:"tab","aria-controls":"trajectory-detail-panel","aria-selected":g===d.id,className:g===d.id?`${c.detailTab} ${c.detailTabActive}`:c.detailTab,onClick:a(()=>{Te(d.id)},"onClick"),children:d.label},d.id))}),(0,o.jsxs)("div",{id:"trajectory-detail-panel",className:g==="overview"?`${c.detailBody} ${c.detailBodySummary}`:c.detailBody,role:"tabpanel","aria-labelledby":`trajectory-detail-${g}`,children:[E!==null&&Qe!==void 0&&g==="overview"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("dl",{className:`${c.overview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Status"}),(0,o.jsx)("dd",{className:Qe==="error"?c.error:void 0,children:Zt(Qe)})]}),X?.purpose==="compaction"&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Purpose"}),(0,o.jsx)("dd",{children:"Compaction"})]}),(X?.provider??X?.requestConfig?.provider)!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Provider"}),(0,o.jsx)("dd",{children:X?.provider??X?.requestConfig?.provider})]}),(X?.model??X?.requestConfig?.model)!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Model"}),(0,o.jsx)("dd",{children:X?.model??X?.requestConfig?.model})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Tool calls"}),(0,o.jsx)("dd",{children:Et})]}),mt>0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Subtool calls"}),(0,o.jsx)("dd",{children:mt})]}),X?.error!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Error"}),(0,o.jsx)("dd",{className:c.error,children:X.error})]}),X?.retry!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Retry"}),(0,o.jsxs)("dd",{children:["Scheduled ",X.retry,X.maxRetries===void 0?"":` of ${X.maxRetries}`]})]}),X?.retryDelayMs!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Retry delay"}),(0,o.jsx)("dd",{children:Tt(X.retryDelayMs)})]}),Ss!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Result"}),(0,o.jsx)("dd",{className:c.overviewParentLinks,children:(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{it(Ss)},"onClick"),children:[(0,o.jsx)("span",{children:X?.purpose==="compaction"?"Compacted":"Assistant Message"}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]})})]})]}),(0,o.jsxs)("div",{className:c.overviewSections,children:[Dt!==void 0&&(0,o.jsx)(Me,{label:"Options",onOpen:a(()=>{Te("options")},"onOpen"),children:(0,o.jsx)(Yn,{options:Dt,preview:!0})}),(0,o.jsx)(Me,{label:"Usage",onOpen:a(()=>{Te("usage")},"onOpen"),children:(0,o.jsx)(en,{usage:mn})}),(0,o.jsx)(Me,{label:"Timing",onOpen:a(()=>{Te("timing")},"onOpen"),children:(0,o.jsx)(es,{assistant:H,anchor:ie,request:X})})]})]}),E!==null&&g==="options"&&(0,o.jsx)(Yn,{options:Dt}),E!==null&&g==="usage"&&(0,o.jsx)(si,{usage:mn,cumulative:ga}),E!==null&&g==="timing"&&(0,o.jsx)(es,{assistant:H,anchor:ie,request:X}),D&&be!==void 0&&g==="diff"&&(0,o.jsx)(vi,{before:be,after:ce}),D&&g==="system-prompt"&&(ce.system===""?(0,o.jsx)("p",{className:c.noPayload,children:"No system prompt in this request"}):(0,o.jsx)("div",{className:`${c.markdownPayload} ${c.systemPrompt}`,children:(0,o.jsx)(ee.MarkdownText,{text:ce.system})})),D&&g==="tools"&&(0,o.jsx)(mi,{tools:ce.tools}),!D&&_?.cell.kind==="compacted"&&ue!==void 0&&g==="overview"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("dl",{className:`${c.overview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Status"}),(0,o.jsx)("dd",{className:ue==="error"?c.error:void 0,children:Zt(ue)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:tt(_.cell.timeSeconds)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Tokens"}),(0,o.jsx)("dd",{children:"—"})]})]}),_.cell.outputDetail!==void 0&&(0,o.jsx)("div",{className:`${c.compactedSummary} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:(0,o.jsx)(jt,{record:_,rendered:!0,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:At})})]}),!D&&_!==void 0&&_.cell.kind!=="compacted"&&ue!==void 0&&g==="overview"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("dl",{className:`${c.overview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:[_.cell.messageSource!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Source"}),(0,o.jsx)("dd",{className:c.overviewParentLinks,children:(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{Te("source")},"onClick"),children:[(0,o.jsx)("span",{children:ri(_.cell.messageSource)}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]})})]}),ya&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:ot!==void 0?"Source":"Hierarchy"}),(0,o.jsxs)("dd",{className:c.overviewParentLinks,children:[ot!==void 0&&(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{gn(ot)},"onClick"),children:[(0,o.jsxs)("span",{children:["Request #",Pt??"—"]}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]}),Bs!==void 0&&(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{it(Bs)},"onClick"),children:[(0,o.jsx)("span",{children:"Assistant Message"}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]}),js!==void 0&&(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{it(js)},"onClick"),children:[(0,o.jsx)("span",{children:"Tool Call"}),(0,o.jsx)(ee.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Status"}),(0,o.jsx)("dd",{className:ue==="error"?c.error:void 0,children:Zt(ue)})]}),_.cell.kind==="message"&&(0,o.jsx)(ti,{cell:_.cell}),(_.cell.kind==="user"||_.cell.kind==="context")&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:tt(_.cell.timeSeconds)})]})]}),(0,o.jsxs)("div",{className:c.overviewSections,children:[Jn(_)?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(Me,{label:"Preview",onOpen:a(()=>{Te("rendered")},"onOpen"),children:(0,o.jsx)(jt,{record:_,rendered:!0,preview:!0,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:At})})}):(0,o.jsxs)(o.Fragment,{children:[_.cell.inputDetail&&(0,o.jsx)(Me,{label:"Payload",onOpen:a(()=>{Te("input")},"onOpen"),children:(0,o.jsx)(Ct,{record:_,direction:"input",preview:!0})}),_.cell.outputDetail&&(0,o.jsx)(Me,{label:"Result",onOpen:a(()=>{Te("output")},"onOpen"),children:(0,o.jsx)(Ct,{record:_,direction:"output",preview:!0})}),(0,o.jsx)(Me,{label:"Schema",onOpen:a(()=>{Te("schema")},"onOpen"),children:(0,o.jsx)(ts,{record:_,preview:!0})})]}),ot!==void 0&&(0,o.jsx)(Me,{label:"Request Timing",onOpen:a(()=>{gn(ot,"timing")},"onOpen"),children:(0,o.jsx)(Gt,{record:_})}),(_.cell.kind==="tool"||_.cell.kind==="subtool")&&(0,o.jsx)(Me,{label:"Timing",onOpen:a(()=>{Te("timing")},"onOpen"),children:(0,o.jsx)(Gt,{record:_})})]})]}),!D&&_!==void 0&&g==="rendered"&&(0,o.jsx)(jt,{record:_,rendered:!0,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:At}),!D&&_!==void 0&&g==="raw"&&(0,o.jsx)(jt,{record:_,rendered:!1,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:At}),!D&&_!==void 0&&g==="source"&&(0,o.jsx)(oi,{record:_}),!D&&_!==void 0&&g==="input"&&(0,o.jsx)(Ct,{record:_,direction:"input"}),!D&&_!==void 0&&g==="output"&&(0,o.jsx)(Ct,{record:_,direction:"output"}),!D&&_!==void 0&&g==="schema"&&(0,o.jsx)(ts,{record:_}),!D&&_!==void 0&&g==="timing"&&(0,o.jsx)(Gt,{record:_})]})]})]})}a(wi,"TrajectoryTable");const Vi="._eSgDW_root{z-index:4;box-sizing:border-box;width:100%;height:var(--dsh-trajectory-toolbar-height);border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);position:sticky;top:0}._eSgDW_inner{box-sizing:border-box;align-items:center;gap:8px;width:100%;height:100%;padding:0 6px;display:flex}._eSgDW_actions{flex:none;align-items:center;gap:2px;display:flex}._eSgDW_toggle{height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xxs-12);background:0 0;border:0;border-radius:3px;flex:none;align-items:center;gap:4px;padding:0 7px;display:inline-flex}._eSgDW_toggle:hover,._eSgDW_toggle[aria-pressed=true]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}._eSgDW_toggle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:1px}._eSgDW_toggleIcon{stroke:currentColor;stroke-width:1.25px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:12px;height:12px}._eSgDW_control{box-sizing:border-box;width:88px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xxs-12);background:0 0;border:0;border-radius:0;flex:none;justify-content:center;align-items:center;gap:4px;padding:0 5px;display:inline-flex}._eSgDW_control[hidden]{display:none}._eSgDW_control:hover:not(:disabled),._eSgDW_control[aria-checked=true],._eSgDW_control[aria-pressed=true]{color:var(--dsw-alias-label-primary)}._eSgDW_control:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:1px}._eSgDW_control:disabled{color:var(--dsw-alias-label-dimmed);cursor:not-allowed}._eSgDW_controlTrack{background:var(--dsw-alias-border-l2);width:20px;height:10px;transition:background-color .12s var(--ds-ease-in-out);border-radius:5px;flex:none;display:inline-block;position:relative}._eSgDW_controlThumb{background:var(--dsw-alias-bg-layer-1);width:6px;height:6px;transition:transform .12s var(--ds-ease-in-out);border-radius:50%;position:absolute;top:2px;left:2px}._eSgDW_controlTrack[data-on=true]{background:var(--dsw-alias-state-business-primary)}._eSgDW_controlTrack[data-on=true] ._eSgDW_controlThumb{transform:translate(10px)}._eSgDW_action{height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xxs-12);background:0 0;border:0;border-radius:3px;flex:none;align-items:center;gap:4px;padding:0 5px;display:inline-flex}._eSgDW_action:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}._eSgDW_action:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:1px}._eSgDW_actionIcon{color:var(--dsw-alias-label-tertiary);font:14px/14px var(--ds-font-family-code)}._eSgDW_search{border:1px solid var(--dsw-alias-border-l2);min-width:84px;height:22px;color:var(--dsw-alias-label-caption);background:var(--dsw-alias-bg-layer-2);border-radius:4px;flex:0 164px;align-items:center;gap:4px;margin-left:auto;padding:0 6px;display:flex}._eSgDW_search:hover{border-color:var(--dsw-alias-label-caption)}._eSgDW_search:focus-within{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-1)}._eSgDW_searchIcon{flex:none}._eSgDW_searchInput{width:100%;min-width:0;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xxs-12);background:0 0;border:0;outline:0;padding:0}._eSgDW_searchInput::placeholder{color:var(--dsw-alias-label-caption)}._eSgDW_searchInput::-webkit-search-cancel-button{cursor:pointer;width:12px;height:12px}",ns="@deepseek-ai/dsh-client-ui-trajectory/TrajectoryToolbar.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(ns)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=ns,e.textContent=Vi,document.head.appendChild(e)}var xe={root:"_eSgDW_root",toggleIcon:"_eSgDW_toggleIcon",control:"_eSgDW_control",action:"_eSgDW_action",searchInput:"_eSgDW_searchInput",actions:"_eSgDW_actions",toggle:"_eSgDW_toggle",searchIcon:"_eSgDW_searchIcon",actionIcon:"_eSgDW_actionIcon",search:"_eSgDW_search",inner:"_eSgDW_inner",controlThumb:"_eSgDW_controlThumb",controlTrack:"_eSgDW_controlTrack"};function _i({actualDuration:e,onActualDurationChange:t,actualTime:n,onActualTimeChange:s,allTurnsCollapsed:r,onToggleAllTurns:i,allAssistantsCollapsed:l,onToggleAllAssistants:u,searchQuery:p,onSearchQueryChange:f,t:m}){return(0,o.jsx)("div",{className:xe.root,role:"toolbar","aria-label":m("toolbar.aria"),children:(0,o.jsxs)("div",{className:xe.inner,children:[(0,o.jsxs)("div",{className:xe.actions,children:[(0,o.jsxs)("button",{type:"button",className:xe.toggle,"aria-label":m("toolbar.useActualDuration"),"aria-pressed":e,title:m(e?"toolbar.useEqualWidth":"toolbar.useActualDuration"),onClick:a(()=>{t(!e)},"onClick"),children:[(0,o.jsxs)("svg",{className:xe.toggleIcon,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("circle",{cx:"8",cy:"8",r:"5.25"}),(0,o.jsx)("path",{d:"M8 4.75V8l2.25 1.5"})]}),m("toolbar.duration")]}),(0,o.jsxs)("button",{type:"button",className:xe.control,role:"switch","aria-checked":n,hidden:!0,onClick:a(()=>{s(!n)},"onClick"),children:[(0,o.jsx)("span",{children:m("toolbar.actualTime")}),(0,o.jsx)("span",{className:xe.controlTrack,"data-on":n||void 0,"aria-hidden":"true",children:(0,o.jsx)("span",{className:xe.controlThumb})})]}),(0,o.jsxs)("button",{type:"button",className:xe.action,"aria-label":m(r?"toolbar.expandTurns":"toolbar.collapseTurns"),"aria-pressed":r,title:m(r?"toolbar.expandTurns":"toolbar.collapseTurns"),onClick:i,children:[(0,o.jsx)("span",{className:xe.actionIcon,"aria-hidden":"true",children:r?"⊞":"⊟"}),m("toolbar.turns")]}),(0,o.jsxs)("button",{type:"button",className:xe.action,"aria-label":m(l?"toolbar.expandCalls":"toolbar.collapseCalls"),"aria-pressed":l,title:m(l?"toolbar.expandCalls":"toolbar.collapseCalls"),onClick:u,children:[(0,o.jsx)("span",{className:xe.actionIcon,"aria-hidden":"true",children:l?"⊞":"⊟"}),m("toolbar.calls")]})]}),(0,o.jsxs)("div",{className:xe.search,children:[(0,o.jsx)(ee.IconSearchOutline16,{size:11,className:xe.searchIcon}),(0,o.jsx)("input",{type:"search",className:xe.searchInput,"aria-label":m("toolbar.search"),placeholder:m("toolbar.searchPlaceholder"),value:p,onChange:a(h=>{f(h.currentTarget.value)},"onChange")})]})]})})}a(_i,"TrajectoryToolbar");function sn(e){return On(e)}a(sn,"formatTimelineOffset");function ss(e){return e==="tool"||e==="subtool"?2:e==="message"||e==="compacted"?1:0}a(ss,"laneFor");function rs(e){return e!=null&&Number.isFinite(e)}a(rs,"finite");function Ni(e){if(!rs(e.startedAt))return null;const t=rs(e.timeSeconds)?Math.max(0,e.timeSeconds*1e3):0;return{start:e.startedAt,end:e.startedAt+t}}a(Ni,"cellRange");function os(e,t="sequence"){if(t!=="sequence")return ki(e,t==="duration"||t==="actual",t==="duration");const n=[],s=[];for(const r of e){const i=r.groups.flatMap(l=>l.cells.filter(u=>u.requestOnly!==!0));i.length!==0&&(r.turn!==null&&s.push({turn:r.turn,time:n.length}),n.push(...i.map((l,u)=>({start:n.length+u,end:n.length+u+1,index:l.index,isError:l.isError===!0,kind:l.kind,label:l.text,lane:ss(l.kind)}))))}return n.length===0?null:{start:0,end:n.length,spans:n,turnBoundaries:s}}a(os,"deriveTrajectoryTimeline");function ki(e,t,n){const s=e.flatMap(m=>{const h=m.groups.flatMap(b=>b.cells.flatMap(v=>{if(v.requestOnly===!0)return[];const T=Ni(v);return T===null?[]:[{...T,index:v.index,isError:v.isError===!0,kind:v.kind,label:v.text,lane:ss(v.kind)}]}));return h.length===0?[]:[{turn:m.turn,rawSpans:h}]}),r=s.flatMap(m=>m.rawSpans);if(r.length===0)return null;const i=new Map;let l=0,u=null;for(const m of[...r].sort((h,b)=>h.start-b.start||h.end-b.end))n&&u!==null&&m.start>u&&(l+=m.start-u),i.set(m,l),u=u===null?m.end:Math.max(u,m.end);const p=[],f=[];for(const m of s){const h=m.rawSpans.map(b=>{const v=i.get(b)??0;return{...b,start:b.start-v,end:(t?b.end:b.start)-v}});p.push(...h),m.turn!==null&&f.push({turn:m.turn,time:Math.min(...h.map(b=>b.start))})}return{start:Math.min(...p.map(m=>m.start)),end:Math.max(...p.map(m=>m.end)),spans:p,turnBoundaries:f}}a(ki,"deriveTimedTimeline");function Si(e,t,n="sequence"){const s=os(e,n);return new Set(s?.spans.filter(r=>r.start<=t.end&&r.end>=t.start).map(r=>r.index))}a(Si,"trajectoryTimelineFocusIndexes");const Ti='.XGVSYG_root{z-index:1;isolation:isolate;border-bottom:1px solid var(--dsw-alias-border-l2);user-select:none;flex:none;position:relative}.XGVSYG_root [role=tooltip]{font:var(--dsw-font-xxxs-11)}.XGVSYG_plot{background:var(--dsw-alias-bg-layer-2);grid-template-columns:44px minmax(0,1fr);height:50px;display:grid;overflow:hidden}.XGVSYG_labels{border-right:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-caption);font:var(--dsw-font-xs-13);font-size:10px;line-height:1;position:relative}.XGVSYG_labels span{text-align:right;justify-content:flex-end;align-items:center;height:8px;display:flex;position:absolute;right:3px}.XGVSYG_labels span:first-child{top:7px}.XGVSYG_labels span:nth-child(2){top:21px}.XGVSYG_labels span:nth-child(3){top:35px}.XGVSYG_track{cursor:crosshair;touch-action:none;position:relative;overflow:hidden}.XGVSYG_track[data-panning=true]{cursor:grabbing}.XGVSYG_earlierHistory{z-index:5;appearance:none;box-sizing:border-box;background:linear-gradient(to right, var(--dsw-alias-bg-layer-2) 0, var(--dsw-alias-bg-layer-2) 38%, transparent 100%);width:28px;color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);opacity:.72;cursor:pointer;border:0;outline:none;justify-content:flex-start;align-items:center;padding-left:3px;line-height:1;display:flex;position:absolute;top:0;bottom:0;left:0}.XGVSYG_earlierHistory:hover{opacity:1}.XGVSYG_earlierHistory[aria-disabled=true]{cursor:default}.XGVSYG_earlierHistory:focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2)}.XGVSYG_empty{color:var(--dsw-alias-label-caption);font:var(--dsw-font-xs-13);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.XGVSYG_track:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.XGVSYG_lanes{z-index:2;top:7px;bottom:7px;left:var(--trajectory-domain-left);width:var(--trajectory-domain-width);position:absolute}.XGVSYG_turnBoundaries{z-index:3;top:0;bottom:0;left:var(--trajectory-domain-left);width:var(--trajectory-domain-width);pointer-events:none;position:absolute}@media (prefers-reduced-motion:no-preference){.XGVSYG_lanes[data-animate-viewport=true],.XGVSYG_turnBoundaries[data-animate-viewport=true]{transition:left .18s ease-out}}.XGVSYG_turnBoundary{top:0;bottom:0;left:var(--trajectory-turn-left);background:var(--dsw-alias-border-l2);width:1px;position:absolute}.XGVSYG_span{top:calc(var(--trajectory-span-lane) * 14px);left:calc(var(--trajectory-span-left) + var(--trajectory-span-gap));width:max(2px, calc(var(--trajectory-span-width) - var(--trajectory-span-gap) - var(--trajectory-span-gap)));background:var(--dsw-alias-label-secondary);opacity:.78;border-radius:1px;min-width:2px;height:8px;position:absolute}.XGVSYG_span[data-timeline-span=user]{background:var(--dsw-alias-state-business-primary)}.XGVSYG_span[data-timeline-span=context]{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 68%, var(--dsw-alias-label-secondary))}.XGVSYG_span[data-timeline-span=message]{--trajectory-assistant-decoding-color:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 60%, var(--dsw-alias-state-error-secondary));--trajectory-assistant-ttft-color:color-mix(in srgb, var(--trajectory-assistant-decoding-color) 54%, var(--dsw-alias-bg-layer-2));background:var(--trajectory-assistant-decoding-color);opacity:1}.XGVSYG_span[data-timeline-span=message][data-assistant-timing=true]{background:linear-gradient(to right, var(--trajectory-assistant-ttft-color) 0, var(--trajectory-assistant-ttft-color) var(--trajectory-assistant-ttft), var(--trajectory-assistant-decoding-color) var(--trajectory-assistant-ttft), var(--trajectory-assistant-decoding-color) 100%)}.XGVSYG_span[data-timeline-span=tool],.XGVSYG_span[data-timeline-span=subtool]{background:var(--dsw-alias-state-warn-label);opacity:1}.XGVSYG_span[data-error=true]{background:var(--dsw-alias-state-error-primary)}.XGVSYG_span[data-equal-duration=true]{width:8px;min-width:8px}.XGVSYG_span[data-selected=false]{opacity:.2}.XGVSYG_span[data-hovered=true]:not([data-current=true]){z-index:1;opacity:1;box-shadow:0 0 0 1px var(--dsw-alias-bg-layer-2), 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 80%, transparent)}.XGVSYG_span[data-current=true]{z-index:1;opacity:1;box-shadow:0 0 0 1px var(--dsw-alias-bg-layer-2), 0 0 0 2px var(--dsw-alias-state-business-primary)}.XGVSYG_span[data-search-match=false]{opacity:.14}.XGVSYG_selection{z-index:1;top:0;bottom:0;left:var(--trajectory-selection-left);width:var(--trajectory-selection-width);background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);min-width:1px;box-shadow:-100vw 0 0 100vw color-mix(in srgb, var(--dsw-alias-bg-layer-1) 58%, transparent), 100vw 0 0 100vw color-mix(in srgb, var(--dsw-alias-bg-layer-1) 58%, transparent);pointer-events:none;position:absolute}.XGVSYG_selectionEdges{z-index:4;top:0;bottom:0;left:var(--trajectory-selection-left);width:var(--trajectory-selection-width);pointer-events:none;min-width:1px;position:absolute}.XGVSYG_hoverLine{z-index:4;top:0;bottom:0;left:clamp(0px, calc(var(--trajectory-hover-left) - 1px), calc(100% - 2px));background:var(--dsw-alias-state-business-primary);pointer-events:none;width:2px;position:absolute}.XGVSYG_selectionEdges:before,.XGVSYG_selectionEdges:after{background:var(--dsw-alias-state-business-primary);content:"";width:3px;position:absolute;top:0;bottom:0}.XGVSYG_selectionEdges:before{left:0}.XGVSYG_selectionEdges:after{right:0}.XGVSYG_selectionEdges[data-dragging=true]:before,.XGVSYG_selectionEdges[data-dragging=true]:after{width:2px}.XGVSYG_selection[data-dragging=true]{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, transparent)}',is="@deepseek-ai/dsh-client-ui-trajectory/TrajectoryTimeline.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(is)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=is,e.textContent=Ti,document.head.appendChild(e)}var me={hoverLine:"XGVSYG_hoverLine",selection:"XGVSYG_selection",plot:"XGVSYG_plot",earlierHistory:"XGVSYG_earlierHistory",selectionEdges:"XGVSYG_selectionEdges",labels:"XGVSYG_labels",turnBoundaries:"XGVSYG_turnBoundaries",root:"XGVSYG_root",empty:"XGVSYG_empty",lanes:"XGVSYG_lanes",turnBoundary:"XGVSYG_turnBoundary",track:"XGVSYG_track",span:"XGVSYG_span"};const rn=3,Bi=4,ji=.08,Gi=.025,Ci=32,as=500;function Ii(e){const t=e?.stepStartTime,n=e?.firstTokenTime,s=e?.completedTime;return e?.timingRecorded!==!0||typeof t!="number"||typeof n!="number"||typeof s!="number"||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(s)||n<t||s<n?{}:{ttftMs:n-t,decodingMs:s-n}}a(Ii,"assistantTimingDetail");function Ri(e){const t=e.timeSeconds===null||!Number.isFinite(e.timeSeconds)?void 0:Math.max(0,e.timeSeconds*1e3),n=e.startedAt===null||!Number.isFinite(e.startedAt)?void 0:e.startedAt;return{...t===void 0?{}:{durationMs:t},...n===void 0?{}:{startedAt:n},...Ii(e.assistantMetrics)}}a(Ri,"timelineRecordDetail");function Mi(e){switch(e){case"system":return"SYSTEM";case"user":return"USER";case"context":return"CONTEXT";case"compacted":return"COMPACTED";case"message":return"ASSISTANT";case"tool":return"TOOL";case"subtool":return"SUBTOOL"}}a(Mi,"timelineKindLabel");function on(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}a(on,"formatRecordedTime");function Ei(e,t){const n=Mi(e);if(t===void 0)return n;const s=t.durationMs===void 0?null:`Total ${sn(t.durationMs)}`;return[n,t.startedAt===void 0?null:t.durationMs===void 0?`Started ${on(t.startedAt)}`:`${on(t.startedAt)} → ${on(t.startedAt+t.durationMs)}`,[s,t.ttftMs===void 0||t.decodingMs===void 0?null:`TTFT ${sn(t.ttftMs)} · Decoding ${sn(t.decodingMs)}`].filter(r=>r!==null).join(" · ")].filter(r=>r!==null&&r!=="").join(`
|
|
14
|
-
`)}a(Ei,"timelineTooltipLabel");function an(e,t){return e<=t?{start:e,end:t}:{start:t,end:e}}a(an,"orderedRange");function ln(e){return Math.min(1,Math.max(0,e))}a(ln,"clampFraction");function Di(e,t,n,s){const r=Math.min(s-n,Math.max(0,t)),i=Math.min(Math.max(e-r/2,n),s-r);return{start:i,end:i+r}}a(Di,"centeredRange");function ls(e,t,n,s,r){const i=an(Math.min(r,Math.max(s,e.start)),Math.min(r,Math.max(s,e.end)));return{start:(i.start-t)/n,end:(i.end-t)/n}}a(ls,"rangeFraction");function cs(){return(0,o.jsxs)("div",{className:me.labels,"aria-hidden":"true",children:[(0,o.jsx)("span",{children:"Input"}),(0,o.jsx)("span",{children:"Model"}),(0,o.jsx)("span",{children:"Tools"})]})}a(cs,"LaneLabels");function ds({loading:e,onHover:t,onLoad:n}){return(0,o.jsx)(ee.Tooltip,{label:e?"Loading earlier history…":"Click to load earlier history",side:"right",delayMs:as,children:(0,o.jsx)("button",{type:"button",className:me.earlierHistory,"data-earlier-history":!0,"data-loading":e||void 0,"aria-label":e?"Loading earlier history":"Load earlier history","aria-disabled":e||n===void 0,onClick:n,onPointerEnter:a(s=>{s.stopPropagation(),t()},"onPointerEnter"),onPointerMove:a(s=>{s.stopPropagation()},"onPointerMove"),onPointerDown:a(s=>{s.stopPropagation()},"onPointerDown"),children:"…"})})}a(ds,"EarlierHistoryBoundary");const qi=(0,y.memo)(a(function({turns:t,mode:n,range:s,hasEarlierRecords:r=!1,onLoadEarlier:i,selectedIndex:l=null,searchMatchIndexes:u=null,onRangeChange:p,onRecordSelect:f,onRecordFocus:m}){const h=(0,y.useMemo)(()=>os(t,n),[n,t]),b=(0,y.useMemo)(()=>new Map(t.flatMap(V=>V.groups.flatMap(M=>M.cells.map(O=>[O.index,Ri(O)])))),[t]),v=(0,y.useRef)(null),T=(0,y.useRef)(null),k=(0,y.useRef)(null),S=(0,y.useRef)(null),[w,B]=(0,y.useState)(null),[C,I]=(0,y.useState)(null),[q,se]=(0,y.useState)(!1),[E,fe]=(0,y.useState)(!1),[g,x]=(0,y.useState)(null),[P,N]=(0,y.useState)(!1);(0,y.useEffect)(()=>{h!==null&&s!==null&&(s.end<h.start||s.start>h.end)&&p(null)},[h,p,s]),(0,y.useEffect)(()=>{h!==null&&(N(!1),x(V=>V!==null&&(V.end<h.start||V.start>h.end)?null:V))},[h]),(0,y.useEffect)(()=>{if(h===null||l===null)return;const V=h.spans.find(M=>M.index===l);V!==void 0&&(N(!0),x(M=>{if(M===null||V.end>M.start&&V.start<M.end)return M;const O=Math.max(1,M.end-M.start),_=V.end<=M.start?V.start:V.end-O,Q=Math.min(Math.max(_,h.start),Math.max(h.start,h.end-O));return Q===M.start?M:{start:Q,end:Q+O}}))},[h,l]);const R=Math.max(1,(h?.end??0)-(h?.start??0)),oe=Math.min(R,Math.max(1,(g?.end??0)-(g?.start??0))),le=h===null||g===null?h?.start??0:Math.min(Math.max(g.start,h.start),h.end-oe),z=g===null?R:oe,F=g===null?h?.start??0:le,Xe=r&&h!==null&&F===h.start,Ye=i===void 0||q?void 0:()=>{se(!0),i().finally(()=>{se(!1)})},ge=h===null?void 0:{"--trajectory-domain-left":`${-(F-h.start)/z*100}%`,"--trajectory-domain-width":`${R/z*100}%`},De=h===null||s===null?null:ls(s,F,z,h.start,h.end),pe=(h===null||w===null?null:ls(w,F,z,h.start,h.end))??De,ye=w??s;if((0,y.useEffect)(()=>{const V=k.current;if(V===null)return;const M=a(O=>{O.preventDefault();const _=S.current;if(_===null||h===null)return;N(!1);const Q=_.getBoundingClientRect(),Y=ln((O.clientX-Q.left)/Math.max(1,Q.width)),de=Math.min(R,Math.max(Math.min(n==="sequence"?Bi:20,R),z*Math.exp(O.deltaY*.0015)));if(de>=R*.999){x(null);return}const K=F+Y*z,W=Math.min(Math.max(K-Y*de,h.start),h.end-de);x({start:W,end:W+de})},"onWheel");return V.addEventListener("wheel",M,{passive:!1}),()=>{V.removeEventListener("wheel",M)}},[z,F,R,n,h]),h===null)return(0,o.jsx)("section",{ref:k,className:me.root,"aria-label":"Trajectory timeline",children:(0,o.jsxs)("div",{className:me.plot,children:[(0,o.jsx)(cs,{}),(0,o.jsxs)("div",{className:me.track,children:[(0,o.jsx)("span",{className:me.empty,children:"No timing data"}),r&&(0,o.jsx)(ds,{loading:q,onHover:a(()=>{I(null)},"onHover"),onLoad:Ye})]})]})});const Je=Math.min(z,R/h.spans.length),Ge=a(V=>{const M=V.currentTarget.getBoundingClientRect();return ln((V.clientX-M.left)/Math.max(1,M.width))},"fractionAt"),Re=a(V=>{const M=(V.target instanceof HTMLElement?V.target:null)?.closest("[data-timeline-record-index]")?.dataset.timelineRecordIndex;if(M===void 0)return null;const O=Number(M);return Number.isFinite(O)?O:null},"recordIndexAt"),ve=a(V=>{p(V)},"commit"),qe=a(V=>{if(V.button===2){T.current={anchorClientX:V.clientX,anchorStart:F,moved:!1,pannable:g!==null,pointerId:V.pointerId},g!==null&&N(!1),fe(!0),typeof V.currentTarget.setPointerCapture=="function"&&V.currentTarget.setPointerCapture(V.pointerId);return}if(V.button!==0)return;const M=Ge(V),O=F+M*z,_=Re(V);I({fraction:M,recordIndex:_}),v.current={pointerId:V.pointerId,anchorTime:O,anchorClientX:V.clientX,recordIndex:_},typeof V.currentTarget.setPointerCapture=="function"&&V.currentTarget.setPointerCapture(V.pointerId),B({start:O,end:O})},"onPointerDown"),ke=a(V=>{const M=V.currentTarget.getBoundingClientRect(),O=Ge(V);I({fraction:O,recordIndex:Re(V)});const _=T.current;if(_!==null&&_.pointerId===V.pointerId){if(Math.abs(V.clientX-_.anchorClientX)>=rn&&(_.moved=!0),!_.pannable)return;const K=(V.clientX-_.anchorClientX)/Math.max(1,M.width),W=Math.min(Math.max(_.anchorStart-K*z,h.start),h.end-z);x({start:W,end:W+z});return}const Q=v.current;if(Q===null||Q.pointerId!==V.pointerId)return;let Y=F;if(g!==null){const K=V.clientX-M.left,W=Math.min(Ci,Math.max(1,M.width*ji)),we=K<W?-1:K>M.width-W?1:0;if(we!==0){const te=ln((we<0?W-K:K-(M.width-W))/W),Ve=F+we*z*Gi*Math.max(.2,te);Y=Math.min(Math.max(Ve,h.start),h.end-z),Y!==F&&(N(!1),x({start:Y,end:Y+z}))}}const de=Y+O*z;B(an(Q.anchorTime,de))},"onPointerMove"),Pe=a(V=>{const M=T.current;if(M!==null&&M.pointerId===V.pointerId){const W=M.moved||Math.abs(V.clientX-M.anchorClientX)>=rn;T.current=null,fe(!1),W||p(null);return}const O=v.current;if(O===null||O.pointerId!==V.pointerId)return;const _=Ge(V),Q=F+_*z,Y=an(O.anchorTime,Q);I({fraction:_,recordIndex:Re(V)}),v.current=null,B(null);const de=Math.abs(V.clientX-O.anchorClientX)<rn,K=de&&O.recordIndex!==null?h.spans.find(W=>W.index===O.recordIndex):void 0;if(K!==void 0){p(null),f?.(K.index);return}if(ve(Y.end-Y.start<Je?Di(de?Y.start:(Y.start+Y.end)/2,Je,h.start,h.end):Y),de){const W=Y.start,we=h.spans.reduce((te,Ve)=>{const Oe=W<te.start?te.start-W:W>te.end?W-te.end:0;return(W<Ve.start?Ve.start-W:W>Ve.end?W-Ve.end:0)<Oe?Ve:te});m?.(we.index)}},"onPointerEnd"),Ce=a(V=>{V.key!=="Escape"||s===null||(V.preventDefault(),p(null))},"onKeyDown"),A=a(()=>{v.current=null,T.current=null,B(null),I(null),fe(!1)},"onPointerCancel");return(0,o.jsx)("section",{ref:k,className:me.root,"aria-label":"Trajectory timeline",children:(0,o.jsxs)("div",{className:me.plot,children:[(0,o.jsx)(cs,{}),(0,o.jsxs)("div",{ref:S,className:me.track,"data-panning":E||void 0,"aria-label":"Timeline overview; drag horizontally to focus events",tabIndex:0,onKeyDown:Ce,onPointerDown:qe,onPointerMove:ke,onPointerUp:Pe,onPointerCancel:A,onPointerLeave:a(()=>{v.current===null&&T.current===null&&I(null)},"onPointerLeave"),onDoubleClick:a(V=>{V.preventDefault(),p(null)},"onDoubleClick"),onContextMenu:a(V=>{V.preventDefault()},"onContextMenu"),children:[Xe&&(0,o.jsx)(ds,{loading:q,onHover:a(()=>{I(null)},"onHover"),onLoad:Ye}),C!==null&&C.recordIndex===null&&w===null&&(0,o.jsx)("div",{className:me.hoverLine,"data-timeline-hover-line":!0,"aria-hidden":"true",style:{"--trajectory-hover-left":`${C.fraction*100}%`}}),pe!==null&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:me.selection,"data-dragging":w===null?void 0:"true","aria-hidden":"true",style:{"--trajectory-selection-left":`${pe.start*100}%`,"--trajectory-selection-width":`${(pe.end-pe.start)*100}%`}}),(0,o.jsx)("div",{className:me.selectionEdges,"data-dragging":w===null?void 0:"true","aria-hidden":"true",style:{"--trajectory-selection-left":`${pe.start*100}%`,"--trajectory-selection-width":`${(pe.end-pe.start)*100}%`}})]}),(0,o.jsx)("div",{className:me.turnBoundaries,"data-animate-viewport":P||void 0,"aria-hidden":"true",style:ge,children:h.turnBoundaries.filter(V=>V.time>h.start&&V.time>=F&&V.time<=F+z).map(V=>(0,o.jsx)("span",{className:me.turnBoundary,"data-turn":V.turn,style:{"--trajectory-turn-left":`${(V.time-h.start)/R*100}%`}},V.turn))}),(0,o.jsx)("div",{className:me.lanes,"data-animate-viewport":P||void 0,"data-timeline-domain":!0,style:ge,children:h.spans.filter(V=>V.index===l||V.end>=F&&V.start<=F+z).map(V=>{const M=(V.start-h.start)/R,O=(V.end-V.start)/R*100,_=b.get(V.index),Q=_?.ttftMs,Y=_?.decodingMs,de=Q===void 0||Y===void 0||Q+Y<=0?null:Q/(Q+Y);return(0,o.jsx)(ee.Tooltip,{label:a(()=>Ei(V.kind,_),"label"),side:"bottom",delayMs:as,children:(0,o.jsx)("span",{"aria-hidden":"true",className:me.span,"data-timeline-span":V.kind,"data-timeline-record-index":V.index,"data-assistant-timing":de===null?void 0:"true","data-error":V.isError||void 0,"data-equal-duration":n==="time"||void 0,"data-current":V.index===l||void 0,"data-hovered":C?.recordIndex===V.index||void 0,"data-search-match":u===null?void 0:u.has(V.index)?"true":"false","data-selected":ye===null?void 0:V.start<=ye.end&&V.end>=ye.start?"true":"false",style:{"--trajectory-span-left":`${M*100}%`,"--trajectory-span-width":`${O}%`,"--trajectory-span-gap":`min(${O*.08}%, 1px)`,"--trajectory-span-lane":V.lane,...de===null?{}:{"--trajectory-assistant-ttft":`${de*100}%`}}})},V.index)})})]})]})})},"TrajectoryTimeline"));function us(e){return e.kind==="system"&&e.change.kind==="initial"?Number.NEGATIVE_INFINITY:e.seq}a(us,"layoutEntryOrder");function cn(e){const t=_s(e.content);return{text:"",...t===void 0?{}:{previewMarkdown:t},sourceSeq:e.seq,messageSource:e.source,inputDetail:Vs(e.content),sourceBlocks:e.content.map(n=>Fe(n)),timeSeconds:0,startedAt:L(e.time)}}a(cn,"inputCellDetail");function ps(e){const{nodes:t,eventLocations:n,partial:s,runningCalls:r,requests:i=[],callSchemas:l}=e,u=Yi(t),p=new Map(u);for(const g of r)p.set(g.callId,g);const f=Ji(t),m=Hi(t),h=new Map;for(const g of u.values()){const x=L(g.callTime);x!==null&&h.set(g.callId,x)}for(const g of r){const x=L(g.time);x!==null&&h.set(g.callId,x)}const b=new Map,v=[];let T=0,k=null,S=null;const w=a(g=>{let x=b.get(g);return x===void 0&&(x={groups:[]},b.set(g,x)),x},"bucket"),B=a((g,x)=>{const P=w(g).groups,N=P.at(-1);if(N?.title==="Message"){N.laid.push(x);return}P.push({title:"Message",laid:[x]})},"pushMessage"),C=a((g,x,P)=>{if(P.length===0)return;const N=w(g).groups,R=`Step ${x}`,oe=N.find(le=>le.title===R);if(oe!==void 0){oe.laid.push(...P);return}N.push({title:R,laid:[...P]})},"pushStep"),I=a((g,x,P)=>{if(P.length===0)return;const N=w(g).groups,R=`Step ${x}`,oe=N.find(z=>z.title===R);if(oe===void 0){N.push({title:R,laid:[...P]});return}const le=oe.laid.findIndex(z=>z.cell.requestOnly===!0);le===-1?oe.laid.push(...P):oe.laid.splice(le,0,...P)},"pushStepInput"),q=new Set;for(const g of t)g.kind==="assistant"&&g.step>0&&q.add(`${g.turn}\0${g.step}`);s!==null&&s.step>0&&q.add(`${s.turn}\0${s.step}`);for(const g of r)g.step>0&&q.add(`${g.turn}\0${g.step}`);const se=[...t.map((g,x)=>({kind:"node",seq:g.seq,node:g,nodeIndex:x})),...i.filter(g=>g.purpose==="compaction").map(g=>({kind:"compaction",seq:g.startSeq,request:g})),...i.flatMap(g=>g.purpose!=="assistant"||g.promptChange===void 0||g.prompt===void 0?[]:[{kind:"system",seq:g.promptChange.seq,request:g,change:g.promptChange}]),...i.filter(g=>g.purpose==="assistant").filter(g=>!q.has(`${g.turn}\0${g.step}`)).map(g=>({kind:"request",seq:g.startSeq,request:g}))].sort((g,x)=>us(g)-us(x));for(const g of se){if(g.kind==="request"){const{request:N}=g;C(N.turn,N.step,[{absTime:L(N.startedAt),cell:{index:++T,kind:"message",text:"",sourceSeq:N.startSeq,requestOnly:!0,timeSeconds:N.completedAt===null?null:nt(N.completedAt,N.startedAt),startedAt:L(N.startedAt),...N.status==="error"?{isError:!0}:{}}}]),k=L(N.completedAt)??L(N.startedAt)??k;continue}if(g.kind==="system"){const{change:N,request:R}=g;B(N.kind==="initial"?Xi(t,s):Fi(t,N.seq,s),{absTime:L(N.time),cell:{index:++T,kind:"system",text:Li(N),sourceSeq:N.seq,...R.prompt===void 0?{}:{promptDetail:R.prompt},...N.previous===void 0?{}:{previousPromptDetail:N.previous},timeSeconds:0,startedAt:L(N.time)}}),k=L(N.time)??k;continue}if(g.kind==="compaction"){const N=g.request,R=N.rawOutput??N.summary,oe=R===void 0?"":Qi(R),le={index:++T,kind:"compacted",text:N.status==="running"?"Compacting context…":N.status==="error"?N.error??"Compaction failed":N.summary===void 0?"Context compacted":"",...N.status==="complete"&&N.summary!==void 0?Ki(N.summary):{},sourceSeq:N.startSeq,...N.summary===void 0?{}:{outputDetail:Vs(N.summary),outputBlocks:N.summary.map(F=>Fe(F))},...oe===""?{}:{thinkingDetail:oe},...R===void 0?{}:{sourceBlocks:R.map(F=>Fe(F))},...N.status==="error"?{isError:!0}:{},timeSeconds:N.completedAt===null?null:nt(N.completedAt,N.startedAt),startedAt:L(N.startedAt)};ys(le,N.usage);const z={groups:[{title:`Compaction ${N.startSeq}`,laid:[{absTime:L(N.startedAt),cell:le}]}]};N.turn===null?v.push(z):w(N.turn).groups.push(...z.groups),k=L(N.completedAt)??L(N.startedAt)??k;continue}const{node:x,nodeIndex:P}=g;if(x.kind==="user"){B(xs(m[P],s,S),{absTime:L(x.time),cell:{index:++T,kind:"user",...cn(x),opensTurn:!0}}),k=L(x.time)??k;continue}if(x.kind==="steering"){const N=Wi(m[P],s,S,n?.get(x.seq)),R={absTime:L(x.time),cell:{index:++T,kind:"user",...cn(x)}};N.step===void 0?B(N.turn,R):I(N.turn,N.step,[R]),k=L(x.time)??k;continue}if(x.kind==="assistant"){const N=bs(vs(x,T+1,k,u,h,p));if(x.step>0)C(x.turn,x.step,N);else for(const oe of N)B(x.turn,oe);const R=N[N.length-1];R!==void 0&&(T=R.cell.index),k=L(x.time)??k,S=x.turn;continue}if(x.kind==="context"){B(xs(m[P],s,S),{absTime:L(x.time),cell:{index:++T,kind:"context",...cn(x)}}),k=L(x.time)??k;continue}if(x.kind==="compaction"){k=L(x.time)??k;continue}if(x.kind==="tool-result"){if(!f.has(x.callId)){const N=x.call?.name,R=un(x),oe=[{absTime:L(x.callTime??x.time),...N!==void 0?{toolName:N}:{},callId:x.callId,subCalls:x.subCalls,cell:{index:++T,kind:"tool",sourceSeq:x.seq,...x.call!==null?ht(x.call.name,x.call.argsRaw):ws(R),...x.call!==null?{inputDetail:x.call.argsRaw}:{},outputDetail:pn(x),outputBlocks:x.content.map(le=>Fe(le)),...R,callId:x.callId,isError:x.isError,timeSeconds:nt(x.time,x.callTime),startedAt:L(x.callTime)}}];for(const le of Rt(x.subCalls,T))oe.push(le),T=le.cell.index;C(0,1,oe)}k=L(x.time)??k}}if(s!==null){const g=bs(vs({kind:"assistant",seq:Number.MAX_SAFE_INTEGER,time:0,turn:s.turn,step:s.step,blocks:s.blocks},T+1,k,u,h,p,{streaming:!0}));if(s.step>0)C(s.turn,s.step,g);else for(const P of g)B(s.turn,P);const x=g[g.length-1];x!==void 0&&(T=x.cell.index)}const E=Ui(b);for(const g of r){if(E.has(g.callId))continue;const x=[{absTime:null,toolName:g.name,callId:g.callId,subCalls:g.subCalls,cell:{index:++T,kind:"tool",...ht(g.name,g.argsRaw),inputDetail:g.argsRaw,callId:g.callId,timeSeconds:null,startedAt:L(g.time)}}];for(const P of Rt(g.subCalls,T))x.push(P),T=P.cell.index;if(g.step>0)C(g.turn,g.step,x);else for(const P of x)B(g.turn,P)}const fe=b.get(0);if(fe!==void 0){b.delete(0);const g=a(()=>({groups:[]}),"emptyTurn"),x=b.get(1)??g();x.groups=[...fe.groups,...x.groups],b.set(1,x)}for(const g of[...b.values(),...v])for(const x of g.groups)for(const P of x.laid)Pi(P,l);return[...[...b.entries()].map(([g,x])=>fs(g,x)),...v.map(g=>fs(null,g))].sort((g,x)=>ms(g)-ms(x))}a(ps,"deriveTrajectoryLayout");function hs(e,t,n){if(t===null)return e;const s=ps({nodes:[],partial:t,runningCalls:[]}).at(0);if(s===void 0)return e;const r={...s,groups:s.groups.map(f=>({...f,cells:f.cells.map(m=>({...m,index:m.index+n}))}))},i=e.findIndex(f=>f.turn===r.turn);if(i===-1)return[...e,r];const l=e[i];if(l===void 0)return e;const u=[...l.groups];for(const f of r.groups){const m=u.findIndex(v=>v.title===f.title);if(m===-1){u.push(f);continue}const h=u[m];if(h===void 0)continue;const b=new Set(f.cells.flatMap(v=>v.callId===void 0?[]:[v.callId]));u[m]={...f,cells:[...h.cells.filter(v=>v.requestOnly!==!0&&(v.callId===void 0||!b.has(v.callId))),...f.cells]}}const p=[...e];return p[i]={...l,groups:u},p}a(hs,"appendTrajectoryPartialLayout");function Pi(e,t){if(e.callId===void 0||t===void 0)return;const n=t.get(e.callId);n!==void 0&&(e.cell.schemaDetail=JSON.stringify(n,null,2))}a(Pi,"attachToolSchema");function fs(e,t){return{turn:e,groups:t.groups.map(({title:n,laid:s})=>{const r=Oi(s);return{title:n,...r!==void 0?{description:r}:{},cells:s.map(i=>i.cell)}})}}a(fs,"toTurnModel");function ms(e){return Math.min(...e.groups.flatMap(t=>t.cells.map(n=>n.index)),Number.POSITIVE_INFINITY)}a(ms,"firstCellIndex");function Oi(e){const t=[],n=[];for(const r of e)r.absTime===null||!Number.isFinite(r.absTime)||(n.push(r.absTime),r.cell.kind==="tool"&&r.cell.timeSeconds!==null&&Number.isFinite(r.cell.timeSeconds)&&n.push(r.absTime+r.cell.timeSeconds*1e3));if(n.length>=2){const r=gs((Math.max(...n)-Math.min(...n))/1e3);r!==void 0&&t.push(r)}else if(n.length===1){const r=e.find(l=>l.absTime===n[0])?.cell.timeSeconds,i=r!=null?gs(r):void 0;i!==void 0&&t.push(i)}const s=new Map;for(const r of e)r.toolName===void 0||r.cell.kind!=="tool"||s.set(r.toolName,(s.get(r.toolName)??0)+1);for(const[r,i]of s)t.push(i>1?`${r}×${i}`:r);return t.length===0?void 0:t.join(" ")}a(Oi,"groupDescription");function gs(e){if(Number.isFinite(e))return tt(e)}a(gs,"formatGroupDuration");function nt(e,t){return t===null||!Number.isFinite(e)||!Number.isFinite(t)?null:Math.max(0,(e-t)/1e3)}a(nt,"durationSeconds");function L(e){return typeof e=="number"&&Number.isFinite(e)?e:null}a(L,"finiteTime");function vs(e,t,n,s,r,i,l){if(l?.streaming===!0&&e.blocks.length===0)return[];const u=[];let p=t-1;const f=e.usage,m=l?.streaming===!0,h=L(e.timing?.stepStartTime),b=m?null:nt(e.time,h??n),v=m?null:L(e.time),T=e.blocks.filter(w=>w.kind==="text"&&(!m||w.text!=="")).map(w=>w.kind==="text"?w.text:"").join(`
|
|
13
|
+
`);return(0,o.jsx)(pt,{text:f,rendered:!1,preview:n})}return(0,o.jsxs)("div",{className:`${c.assistantContent} ${c.assistantContentRendered}`,children:[(0,o.jsxs)("div",{className:n&&!e.cell.outputDetail?`${c.thinkingQuote} ${c.thinkingQuoteOnlyPreview}`:c.thinkingQuote,children:[(0,o.jsxs)("button",{type:"button",className:c.thinkingToggle,"aria-expanded":s,onClick:a(()=>{r(!s)},"onClick"),children:["Thinking",(0,o.jsx)(K.IconChevronRightOutline14,{className:c.thinkingChevron,size:12})]}),s&&(0,o.jsx)(pt,{text:e.cell.thinkingDetail,rendered:t,preview:n})]}),e.cell.outputDetail&&(0,o.jsx)("div",{className:c.assistantOutput,children:(0,o.jsx)(pt,{text:e.cell.outputDetail,rendered:t,preview:n})}),(0,o.jsx)(es,{blocks:e.cell.sourceBlocks,preview:n,onOpenCall:i}),(0,o.jsx)(Zn,{blocks:e.cell.sourceBlocks,preview:n})]})}const l=ai(e),u=e.cell.sourceBlocks?.some(f=>f.imageSrc!==void 0)===!0,p=e.cell.kind==="message"&&e.cell.sourceBlocks?.some(f=>f.type==="tool-call")===!0;if(!l&&!u&&!p){const f=sn(e.cell)?"Tool call only":e.cell.text||"No content";return(0,o.jsx)("p",{className:c.noPayload,children:f})}return!t||!u&&!p?(0,o.jsx)(pt,{text:l??"",rendered:t,preview:n}):(0,o.jsxs)("div",{children:[l&&(0,o.jsx)(pt,{text:l,rendered:!0,preview:n}),e.cell.kind==="message"&&(0,o.jsx)(es,{blocks:e.cell.sourceBlocks,preview:n,onOpenCall:i}),(0,o.jsx)(Zn,{blocks:e.cell.sourceBlocks,preview:n})]})}a(Ct,"MarkdownRecordContent");function It({record:e}){return e.cell.kind==="message"&&e.cell.assistantMetrics!==void 0?(0,o.jsx)(Ho,{metrics:e.cell.assistantMetrics}):(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Gt,{timestamp:e.cell.startedAt??null})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:Ze(e.cell.timeSeconds)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Timing source"}),(0,o.jsx)("dd",{children:e.cell.timeSeconds===null?"Not available":"Session timestamps"})]})]})}a(It,"RecordTiming");function ns({assistant:e,anchor:t,request:n}){if(e!==void 0)return(0,o.jsx)(It,{record:e});if(n?.startedAt!==void 0){const s=n.completedAt===null||n.completedAt===void 0?null:Math.max(0,(n.completedAt-n.startedAt)/1e3);return(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Gt,{timestamp:n.startedAt})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:Ze(s)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Timing source"}),(0,o.jsx)("dd",{children:s===null?"Session timestamps (running)":"Session timestamps"})]})]})}return(0,o.jsxs)("dl",{className:c.overview,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Started"}),(0,o.jsx)(Gt,{timestamp:t?.cell.startedAt??null})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:Ze(null)})]})]})}a(ns,"RequestTiming");function Rt({record:e,direction:t,preview:n=!1}){const s=t==="input"?e.cell.inputDetail:e.cell.outputDetail,r=t==="input"?"No payload captured":"No result captured";if(!s)return(0,o.jsx)("p",{className:c.noPayload,children:r});const i=t==="output"&&e.cell.isError===!0,l=n?c.jsonPreview:c.jsonPayload,u=i?`${l} ${c.errorPayload}`:l,p=bi(s);return t==="output"&&e.cell.outputBlocks?.length===1&&e.cell.outputBlocks[0]?.type==="text"&&p!==void 0?(0,o.jsx)(K.JsonTree,{data:p,label:"Result JSON",className:u}):t==="output"&&e.cell.outputBlocks?.some(f=>f.imageSrc!==void 0||f.content!=="")===!0?(0,o.jsx)(xi,{blocks:e.cell.outputBlocks,error:i,preview:n}):t==="input"&&(e.cell.kind==="user"||e.cell.kind==="context")||t==="output"&&e.cell.kind==="message"?(0,o.jsx)("div",{className:[n?c.markdownPreview:c.markdownPayload,i?c.errorPayload:void 0].filter(f=>f!==void 0).join(" "),children:(0,o.jsx)(K.MarkdownText,{text:s})}):p!==void 0?(0,o.jsx)(K.JsonTree,{data:p,label:`${t==="input"?"Payload":"Result"} JSON`,className:u}):(0,o.jsx)("pre",{className:[c.payload,n?c.payloadPreview:void 0,i?c.errorPayload:void 0,s==="No output"?c.noOutputText:void 0].filter(f=>f!==void 0).join(" "),children:s})}a(Rt,"RecordPayload");function ss({record:e,preview:t=!1}){if(!e.cell.schemaDetail)return(0,o.jsx)("p",{className:c.noPayload,children:"Schema unavailable"});const n=yi(e.cell.schemaDetail);return n!==void 0?(0,o.jsxs)("div",{className:t?`${c.schema} ${c.schemaPreview}`:c.schema,children:[(0,o.jsxs)("header",{className:c.schemaIntro,children:[(0,o.jsx)("h3",{className:c.schemaName,children:n.name}),(0,o.jsx)("p",{className:c.schemaDescription,children:n.description})]}),(0,o.jsxs)("section",{className:c.schemaParameters,children:[(0,o.jsx)("h4",{className:c.schemaParametersTitle,children:"Parameters"}),(0,o.jsx)(K.JsonTree,{data:n.parameters,label:`${n.name} parameters JSON`,className:c.schemaTree})]})]}):(0,o.jsx)("pre",{className:`${c.payload} ${t?c.payloadPreview:""}`,children:e.cell.schemaDetail})}a(ss,"RecordSchema");function yi(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return;const n=t;return typeof n.name!="string"||typeof n.description!="string"||typeof n.parameters!="object"||n.parameters===null||Array.isArray(n.parameters)?void 0:{name:n.name,description:n.description,parameters:n.parameters}}catch{return}}a(yi,"parseToolSchema");function bi(e){try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:void 0}catch{return}}a(bi,"parseJsonContainer");function Ee({label:e,onOpen:t,children:n}){return(0,o.jsxs)("section",{className:c.overviewSection,children:[(0,o.jsx)("h3",{className:c.overviewHeading,children:(0,o.jsxs)("button",{type:"button",className:c.overviewTitle,onClick:t,children:[(0,o.jsx)("span",{children:e}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.overviewTitleIcon,size:12})]})}),(0,o.jsx)("div",{className:`${c.overviewPreview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:n})]})}a(Ee,"OverviewSection");function wi({requestNumbers:e,turns:t,streamingCells:n=[],timelineFocusIndexes:s=null,searchMatchIndexes:r=null,onSelectedIndexChange:i,onRecordSelect:l,recordSelection:u=null,recordFocus:p=null,historyLoading:f=!1,olderHistoryLoading:m=!1,historyStartSeq:h,hasOlderRecords:x=!1,onLoadOlder:v,onClearSelection:T,collapsedTurns:k,onToggleTurn:S,collapsedAssistants:w,onToggleAssistant:B,inspectCallId:C=null,onInspectApplied:I}){const[D,ee]=(0,b.useState)(null),[E,xe]=(0,b.useState)(null),[g,y]=(0,b.useState)("overview"),[P,N]=(0,b.useState)(!1),[R,se]=(0,b.useState)(null),[de,$]=(0,b.useState)(null),F=(0,b.useRef)(null),Fe=(0,b.useRef)(null),Xe=(0,b.useRef)(null),be=(0,b.useRef)(new Set(["overview"])),Pe=(0,b.useRef)(null),pe=(0,b.useRef)(null),Ne=(0,b.useRef)(!1),Ye=(0,b.useRef)(!1),[Ge,Ie]=(0,b.useState)(!1),we=(0,b.useRef)(null),Je=(0,b.useRef)(!1),[tt,ke]=(0,b.useState)(!1),Re=(0,b.useRef)(null),z=(0,b.useMemo)(()=>Jn(t),[t]),V=(0,b.useMemo)(()=>new Map(n.map(d=>[d.index,d])),[n]),M=(0,b.useCallback)(d=>{const G=V.get(d.cell.index);return G===void 0?d:{...d,cell:G}},[V]),q=(0,b.useMemo)(()=>D===null?void 0:z.find(d=>me(d.cell)===D),[z,D]),_=q===void 0?void 0:M(q),Z=_?.cell.index??null;(0,b.useEffect)(()=>{i?.(Z)},[i,Z]);const X=(0,b.useMemo)(()=>Xo(z),[z]),re=(0,b.useMemo)(()=>Yo(z,e,X),[z,X,e]),J=(0,b.useMemo)(()=>{if(r!==null)return Fo(z,r);const d=k.size===0?z:Qo(z,k);return w.size===0?d:ei(d,w)},[z,w,k,r]),le=(0,b.useMemo)(()=>vo(J),[J]),te=jo(le),he=x||J.length>_o,Ve=x?Vo:0,Me=(0,b.useCallback)(d=>te[d]?.height??30,[te]),qe=(0,b.useCallback)(d=>te[d]?.key??d,[te]),Dt=(0,b.useCallback)(()=>pe.current,[]),Ce=Kr({count:he?te.length:0,enabled:he,estimateSize:Me,getItemKey:qe,getScrollElement:Dt,initialRect:{width:0,height:ko},anchorTo:"end",overscan:No,scrollMargin:Ve,scrollEndThreshold:zn}),nt=(0,b.useMemo)(()=>{const d=new Map;for(const[G,L]of le.entries())for(const Y of L.entries)Y.record.collapsedSummary===void 0&&d.set(me(Y.record.cell),G);return d},[le]),st=he?Ce.getVirtualItems():[],Pt=Math.max(0,(st[0]?.start??0)-Ve),ft=st.length===0?0:Math.max(0,Ce.getTotalSize()+Ve-(st.at(-1)?.end??0)),j=he?st.flatMap(d=>{const G=le[d.index];return G===void 0?[]:G.entries.map((L,Y)=>({record:M(L.record),position:L.logicalIndex,terminalRequestBoundary:L.record.cell.requestOnly===!0&&G.entries.at(-1)?.record.cell.requestOnly===!0&&Y===G.entries.length-1}))}):J.map((d,G)=>({record:M(d),position:G,terminalRequestBoundary:d.cell.requestOnly===!0&&G===J.length-1})),oe=(0,b.useMemo)(()=>Jo(J),[J]),W=_?.cell.kind==="system"?_.cell.promptDetail:void 0,ge=_?.cell.kind==="system"?_.cell.previousPromptDetail:void 0,U=W!==void 0,O=_===void 0?void 0:en(_),fe=(0,b.useMemo)(()=>E===null?[]:z.filter(d=>d.turn===E.turn&&d.group===E.group),[z,E]).map(M),ie=fe.find(d=>d.cell.kind==="message"),ve=ie??fe[0],ae=E===null?void 0:re.get(ze(E.turn,E.group)),H=E===null?void 0:e?.find(d=>E.seq===void 0?d.turn===E.turn&&d.group===E.group:d.seq===E.seq),rt=E===null?void 0:H?.status??(ie?.cell.assistantMetrics?.completedTime===null||ie===void 0&&fe.some(d=>en(d)==="running")?"running":"complete"),mt=fe.filter(d=>d.cell.kind==="tool").length,gt=fe.filter(d=>d.cell.kind==="subtool").length,vt=H?.resultSeq===void 0?ie:z.find(d=>d.cell.sourceSeq===H.resultSeq),xt=vt===void 0?void 0:M(vt),gn=H?.usage??(ie===void 0?void 0:{...ie.cell.input===void 0?{}:{input:ie.cell.input},...ie.cell.cacheRead===void 0?{}:{cacheRead:ie.cell.cacheRead},...ie.cell.cacheWrite===void 0?{}:{cacheWrite:ie.cell.cacheWrite},...ie.cell.output===void 0?{}:{output:ie.cell.output},...ie.cell.think===void 0?{}:{reasoning:ie.cell.think}}),ga=H?.cumulativeUsage??gn,qt=H?.requestConfig,Bs=E===null?_?.turn:E.turn,va=E===null?_?.section:fe[0]?.section,xa=E!==null?qo.filter(d=>d.id!=="options"||qt!==void 0):_===void 0?[]:Kn(_),Ot=_===void 0?{}:ii(z,_),js=Ot.message,Gs=Ot.tool,At=_?.cell.kind==="message"?re.get(ze(_.turn,_.group)):void 0,Cs=At===void 0?void 0:e?.find(d=>d.number===At),ot=_!==void 0&&At!==void 0?{turn:_.turn,group:_.group,...Cs?.seq===void 0?{}:{seq:Cs.seq}}:void 0,ya=ot!==void 0||Ot.message!==void 0||Ot.tool!==void 0,ba=de===null?void 0:{"--trajectory-tool-request-width":`calc(58cqw - ${de}px)`},Te=a(d=>{be.current.delete(d),be.current.add(d),y(d)},"activateTab"),Is=a(()=>{ee(null),xe(null)},"clearInspectorSelection"),wa=a(()=>{Is(),T?.()},"clearAllSelections"),Lt=(0,b.useCallback)(d=>{const G=z.find(ue=>ue.cell.index===d);if(l?.(d),xe(null),ee(G===void 0?null:me(G.cell)),G===void 0)return;const L=Kn(G),Y=new Set(L.map(ue=>ue.id)),ce=[...be.current].reverse().find(ue=>Y.has(ue));y(ce??L[0]?.id??"overview")},[z,l]);(0,b.useEffect)(()=>{if(u===null||Fe.current===u)return;Fe.current=u,Lt(u.index);const d=z.find(G=>G.cell.index===u.index);we.current=d===void 0?null:me(d.cell)},[z,u,Lt]),(0,b.useEffect)(()=>{if(p===null||Xe.current===p)return;Xe.current=p;const d=z.find(G=>G.cell.index===p.index);we.current=d===void 0?null:me(d.cell)},[z,p]);const vn=a((d,G="overview")=>{ee(null),xe(d),Te(G)},"selectRequest"),it=a(d=>{const G=z.findIndex(L=>L.cell.index===d.cell.index);if(d.turn!==null&&k.has(d.turn)&&S(d.turn),d.cell.kind==="tool"||d.cell.kind==="subtool")for(let L=G-1;L>=0;L--){const Y=z[L];if(Y===void 0||Y.turn!==d.turn)break;if(Y.cell.kind!=="message")continue;const ce=me(Y.cell);w.has(ce)&&B(ce);break}xe(null),ee(me(d.cell)),Te("overview")},"openRecordSummary"),$t=a(d=>{const G=z.find(L=>L.cell.callId===d);G!==void 0&&it(G)},"openCallSummary"),Rs=(0,b.useRef)(it);Rs.current=it,(0,b.useEffect)(()=>{if(C===null)return;const d=Jn(t).find(G=>G.cell.callId===C);d!==void 0&&(Rs.current(d),we.current=me(d.cell),I?.())},[C,t,I]),(0,b.useEffect)(()=>{const d=we.current;if(d===null)return;const G=J.findIndex(ce=>me(ce.cell)===d&&ce.collapsedSummary===void 0);if(G===-1)return;if(he){const ce=nt.get(d);if(ce===void 0)return;we.current=null,Ne.current=!1,Ce.scrollToIndex(ce,{behavior:"smooth",align:"center"});return}we.current=null,Ne.current=!1;const L=J[G]?.cell.index,Y=L===void 0?null:Pe.current?.querySelector(`tr[data-record-index="${L}"]`);Y!=null&&typeof Y.scrollIntoView=="function"&&Y.scrollIntoView({behavior:"smooth",block:"center"})},[J,Ce,nt,he]),(0,b.useEffect)(()=>{if(s===null||s.size===0)return;const d=J.flatMap((Q,ne)=>Q.collapsedSummary===void 0&&Q.cell.requestOnly!==!0&&s.has(Q.cell.index)?[ne]:[]),G=d.at(0),L=d.at(-1);if(G===void 0||L===void 0)return;if(!he){const Q=Pe.current;if(Q===null)return;const ne=[...Q.querySelectorAll('tr[data-timeline-focus="inside"]')],Oe=ne.at(0),bt=ne.at(-1);if(Oe===void 0||bt===void 0)return;const Be=bt.getBoundingClientRect().bottom-Oe.getBoundingClientRect().top,Ae=Be>Q.clientHeight?Oe:ne[Math.floor((ne.length-1)/2)];Ae!==void 0&&typeof Ae.scrollIntoView=="function"&&(Ne.current=!1,Ae.scrollIntoView({behavior:"smooth",block:Be>Q.clientHeight?"start":"center"}));return}const Y=[...new Set(d.flatMap(Q=>{const ne=J[Q];if(ne===void 0)return[];const Oe=nt.get(me(ne.cell));return Oe===void 0?[]:[Oe]}))].sort((Q,ne)=>Q-ne),ce=Y.at(0),ue=Y.at(-1);if(ce===void 0||ue===void 0)return;const Ue=pe.current?.clientHeight??0,at=le.slice(ce,ue+1).reduce((Q,ne)=>Q+ne.height,0);Ne.current=!1,Ce.scrollToIndex(at>Ue?ce:Y[Math.floor((Y.length-1)/2)]??ce,{behavior:"smooth",align:at>Ue?"start":"center"})},[le,J,Ce,s,nt,he]);const Ms=(0,b.useCallback)((d,G)=>{!x||v===void 0||Je.current||m||G&&d.scrollTop>wo||(Je.current=!0,ke(!0),Re.current={historyStartSeq:h,scrollHeight:d.scrollHeight,scrollTop:d.scrollTop},v().then(L=>{L||(Re.current=null)}).finally(()=>{Je.current=!1,ke(!1)}))},[x,h,m,v]);(0,b.useLayoutEffect)(()=>{const d=pe.current;if(d===null)return;const G=Re.current;if(G!==null&&G.historyStartSeq!==h){he||(d.scrollTop=G.scrollTop+d.scrollHeight-G.scrollHeight),Re.current=null,Ne.current=!1;return}if(!Ye.current){if(f)return;Ye.current=!0,Ne.current=!0,he?Ce.scrollToEnd({behavior:"auto"}):d.scrollTop=d.scrollHeight,Ie(!0);return}Ne.current&&(he?Ce.scrollToEnd({behavior:"auto"}):d.scrollTop=d.scrollHeight)},[f,h,Ce,te,he]);const yt=m||tt,Va=f||!Ge,Es=x?1:0;return(0,o.jsxs)("div",{ref:Pe,className:c.split,style:ba,children:[(0,o.jsxs)("div",{ref:pe,className:c.tablePane,"data-trajectory-scroll":"",onScroll:a(d=>{const G=d.currentTarget;Ne.current=G.scrollHeight-G.clientHeight-G.scrollTop<=zn,Ms(G,!0)},"onScroll"),onClick:a(d=>{d.target===d.currentTarget&&wa()},"onClick"),children:[Va&&(0,o.jsx)("div",{className:c.historyLoading,role:"status","aria-live":"polite",children:(0,o.jsxs)("span",{className:c.historyLoadingBar,children:[(0,o.jsx)("span",{className:c.historyLoadingSpinner,"aria-hidden":"true"}),"Loading trajectory…"]})}),(0,o.jsxs)("table",{className:c.table,"data-scroll-ready":Ge||void 0,"aria-rowcount":J.length+Es,children:[(0,o.jsxs)("colgroup",{children:[(0,o.jsx)("col",{className:c.eventColumn}),(0,o.jsx)("col",{className:c.contentColumn})]}),(0,o.jsxs)("tbody",{children:[x&&(0,o.jsx)("tr",{className:c.historyLoadRow,"data-history-load":"","aria-rowindex":1,children:(0,o.jsx)("td",{colSpan:2,children:(0,o.jsxs)("button",{type:"button",className:c.historyLoadButton,disabled:yt||v===void 0,"aria-label":yt?"Loading earlier history…":"Load earlier history",onClick:a(()=>{const d=pe.current;d!==null&&Ms(d,!1)},"onClick"),children:[yt&&(0,o.jsx)("span",{className:c.historyLoadingSpinner,"aria-hidden":"true"}),(0,o.jsx)("span",{"aria-hidden":"true",children:yt?"Loading earlier history…":"Load earlier history"}),(0,o.jsx)("span",{className:c.visuallyHidden,role:"status","aria-live":"polite",children:yt?"Loading earlier history…":""})]})})}),Pt>0&&(0,o.jsx)("tr",{className:c.virtualSpacer,"data-virtual-spacer":"top","aria-hidden":"true",children:(0,o.jsx)("td",{colSpan:2,style:{"--trajectory-virtual-spacer-height":`${Pt}px`}})}),j.map(({record:d,position:G,terminalRequestBoundary:L})=>(0,o.jsx)(ui,{cell:d.cell,children:a(({displayText:Y,listDisplayText:ce,resultText:ue,toolCallOnly:Ue,toolCallText:at})=>{const Q=d.collapsedSummary!==void 0,ne=d.cell.requestOnly===!0,Oe=d.cell.kind==="system"&&d.cell.index===z[0]?.cell.index,bt=ze(d.turn,d.group),Be=X.get(bt)===d.cell.index&&!Q&&(d.turn===null||!k.has(d.turn))?re.get(bt):void 0,Ae=Be===void 0?void 0:e?.find(Se=>Se.number===Be),_a=Ae?.status??(d.cell.isError===!0?"error":void 0),Ds=oe.get(d.cell.index)??0,Na={"--request-boundary-offset":`${Ds*8}px`},Ps=Be===void 0?void 0:`Request #${Be}${Ae?.purpose==="compaction"?" · Compaction":""}`,qs=Be!==void 0&&E?.turn===d.turn&&E.group===d.group,ka=d.turn===null?va===d.section:Bs===d.turn;return(0,o.jsxs)("tr",{tabIndex:ne?-1:0,"aria-rowindex":G+1+Es,"aria-label":Q?`Collapsed ${d.collapsedSummaryKind} summary, ${d.collapsedSummary}`:ne?`Request ${Be??""}, compaction`:`${Be===void 0?"":`Request ${Be}, `}${Tt[d.cell.kind]}, ${ce||"no content"}`,"aria-selected":!Q&&!ne&&Z===d.cell.index,"data-kind":d.cell.kind,"data-trajectory-row-key":St(d),"data-virtual-position":he?G:void 0,"data-record-index":!Q&&!ne?d.cell.index:void 0,"data-request-only":ne||void 0,"data-terminal-request-boundary":L||void 0,"data-group-start":d.groupStart||void 0,"data-turn-start":d.turnStart||void 0,"data-error":d.cell.isError||void 0,"data-running":en(d)==="running"||void 0,"data-turn-end":d.turnEnd||void 0,"data-collapsed-summary":d.collapsedSummaryKind,"data-selected":!Q&&Z===d.cell.index||void 0,"data-timeline-focus":Q||s===null?void 0:s.has(d.cell.index)?"inside":"outside",onClick:ne?void 0:Q?()=>{d.collapsedSummaryKind==="turn"&&d.turn!==null?S(d.turn):B(me(d.cell))}:()=>{Lt(d.cell.index)},onDoubleClick:a(Se=>{if(!(Q||ne)){if(d.turn!==null&&k.has(d.turn)){Se.preventDefault(),S(d.turn);return}if(d.cell.kind==="message"&&Ko(z,d.cell.index).length>0){Se.preventDefault(),B(me(d.cell));return}d.turnStart&&d.turn!==null&&(z.filter(xn=>xn.turn===d.turn&&xn.cell.requestOnly!==!0&&xn.cell.kind!=="system").length<=1||(Se.preventDefault(),S(d.turn)))}},"onDoubleClick"),onKeyDown:a(Se=>{if(!ne&&!(Se.key!=="Enter"&&Se.key!==" ")){if(Se.preventDefault(),Q){d.collapsedSummaryKind==="turn"&&d.turn!==null?S(d.turn):B(me(d.cell));return}Lt(d.cell.index)}},"onKeyDown"),children:[(0,o.jsxs)("td",{className:c.event,children:[Be!==void 0&&(0,o.jsx)("button",{type:"button",className:qs?`${c.requestBoundaryControl} ${c.requestBoundaryControlActive}`:c.requestBoundaryControl,"aria-label":Ps,"aria-pressed":qs,"data-label":Ps,"data-request-run-index":Ds,"data-request-status":_a,style:Na,onClick:a(Se=>{Se.stopPropagation(),vn({turn:d.turn,group:d.group,...Ae?.seq===void 0?{}:{seq:Ae.seq}})},"onClick"),onDoubleClick:a(Se=>{Se.stopPropagation()},"onDoubleClick")}),d.turn!==null&&Bs===d.turn&&!Oe&&(0,o.jsx)("span",{className:c.turnRail,"aria-hidden":"true"}),!Q&&Z===d.cell.index&&(0,o.jsx)("span",{className:c.selectionRail,"aria-hidden":"true"}),!Q&&!ne&&d.turnStart&&(0,o.jsx)("span",{className:ka?`${c.turnLabel} ${c.turnLabelActive}`:c.turnLabel,"aria-label":We(d.turn),children:d.turn===null?We(d.turn):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:c.turnLabelFull,"aria-hidden":"true",children:We(d.turn)}),(0,o.jsxs)("span",{className:c.turnLabelCompact,"aria-hidden":"true",children:["#",d.turn]})]})}),(0,o.jsx)("div",{className:c.eventInner,children:!Q&&!ne&&(0,o.jsx)("span",{className:c.kindSlot,children:(0,o.jsxs)("span",{className:`${c.kindTag} ${d.cell.kind==="system"?c.systemNeutral:d.cell.kind==="context"?c.contextGreen:d.cell.kind==="compacted"?c.compacted:d.cell.kind==="tool"?c.toolAmber:d.cell.kind==="message"?c.assistantVioletBright:d.cell.kind==="subtool"?c.subtoolAmber:c[d.cell.kind]}`,"data-role-kind":d.cell.kind,children:[(0,o.jsx)(K.Tooltip,{label:Tt[d.cell.kind],side:"right",children:(0,o.jsx)("span",{className:c.kindTagIcon,"aria-hidden":"true",children:Bo[d.cell.kind]})}),(0,o.jsx)("span",{className:c.kindTagLabel,children:Tt[d.cell.kind]})]})})})]}),(0,o.jsx)("td",{className:c.content,children:ne?null:d.collapsedSummary!==void 0?(0,o.jsxs)("span",{className:c.collapsedTurnContent,title:d.collapsedSummary,children:[(0,o.jsx)("span",{className:c.collapsedTurnEllipsis,children:"…"}),(0,o.jsx)("span",{className:c.collapsedTurnText,children:d.collapsedSummary})]}):(0,o.jsxs)("span",{className:ue===void 0?c.contentText:c.resultPreview,title:ue===void 0?ce:`${ce} → ${ue}`,children:[(0,o.jsx)("span",{className:ue===void 0?void 0:c.resultRequest,children:(0,o.jsx)(pi,{displayText:Y,toolCallOnly:Ue,toolCallText:at})}),ue!==void 0&&(0,o.jsxs)("span",{className:d.cell.isError?`${c.inlineResult} ${c.error}`:c.inlineResult,children:[(0,o.jsx)("span",{className:c.arrow,children:"→"}),(0,o.jsx)("span",{className:ue==="No output"?`${c.inlineResultText} ${c.noOutputText}`:c.inlineResultText,children:ue})]})]})})]})},"children")},St(d))),ft>0&&(0,o.jsx)("tr",{className:c.virtualSpacer,"data-virtual-spacer":"bottom","aria-hidden":"true",children:(0,o.jsx)("td",{colSpan:2,style:{"--trajectory-virtual-spacer-height":`${ft}px`}})})]})]})]}),(E!==null||U||_!==void 0&&O!==void 0)&&(0,o.jsxs)("aside",{className:c.details,"aria-label":"Event details",style:R===null?void 0:{width:R},children:[(0,o.jsx)("div",{className:c.detailsResizeHandle,role:"separator","aria-label":"Resize event details","aria-controls":"trajectory-detail-panel","aria-orientation":"vertical",tabIndex:0,title:"Drag to resize. Double-click to reset.",onDoubleClick:a(()=>{se(null),$(null)},"onDoubleClick"),onPointerDown:a(d=>{if(d.button!==0)return;const G=d.currentTarget.parentElement;if(G===null)return;const L=G.parentElement;if(L===null)return;const Y=L.getBoundingClientRect().width;F.current={pointerId:d.pointerId,startX:d.clientX,startWidth:G.getBoundingClientRect().width,splitWidth:Y,startToolRequestOffset:de??Y*Bt-Yn(Y)},d.currentTarget.setPointerCapture(d.pointerId),d.preventDefault()},"onPointerDown"),onPointerMove:a(d=>{const G=F.current;if(G===null||G.pointerId!==d.pointerId)return;const L=Xn(G.startWidth+G.startX-d.clientX,G.splitWidth);se(L),$(G.startToolRequestOffset+(L-G.startWidth)*Bt)},"onPointerMove"),onPointerUp:a(d=>{F.current?.pointerId===d.pointerId&&(F.current=null,d.currentTarget.releasePointerCapture(d.pointerId))},"onPointerUp"),onPointerCancel:a(()=>{F.current=null},"onPointerCancel"),onKeyDown:a(d=>{if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight")return;const G=d.currentTarget.parentElement;if(G===null)return;const L=G.parentElement;if(L===null)return;const Y=d.key==="ArrowLeft"?1:-1,ce=G.getBoundingClientRect().width,ue=L.getBoundingClientRect().width,Ue=Xn(ce+Y*Io,ue),at=de??ue*Bt-Yn(ue);se(Ue),$(at+(Ue-ce)*Bt),d.preventDefault()},"onKeyDown")}),(0,o.jsxs)("div",{className:c.detailsHeader,children:[(0,o.jsx)("div",{className:c.detailsTitle,children:E!==null?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:c.requestDetailsDot,"aria-hidden":"true"}),(0,o.jsxs)("span",{className:c.requestDetailsName,children:["Request #",ae??"—"]}),(0,o.jsx)("span",{className:c.detailsLocation,children:H?.purpose==="compaction"?`Compaction · ${We(E.turn)}`:We(E.turn)})]}):U?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:`${c.kindTag} ${c.systemNeutral}`,children:"SYSTEM"}),(0,o.jsx)("span",{className:c.detailsLocation,children:_?.cell.text})]}):_!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:`${c.kindTag} ${_.cell.kind==="context"?c.contextGreen:_.cell.kind==="compacted"?c.compacted:_.cell.kind==="tool"?c.toolAmber:_.cell.kind==="message"?c.assistantVioletBright:_.cell.kind==="subtool"?c.subtoolAmber:c[_.cell.kind]}`,children:Tt[_.cell.kind]}),(0,o.jsx)("span",{className:c.detailsLocation,children:_.cell.kind==="compacted"?We(_.turn):`${We(_.turn)} · ${_.group}`})]})}),(0,o.jsx)("button",{type:"button",className:c.close,"aria-label":"Close details",onClick:Is,children:(0,o.jsx)("span",{"aria-hidden":"true",children:"×"})})]}),(0,o.jsx)("div",{className:c.detailTabs,role:"tablist","aria-label":"Event details",children:xa.map(d=>(0,o.jsx)("button",{id:`trajectory-detail-${d.id}`,type:"button",role:"tab","aria-controls":"trajectory-detail-panel","aria-selected":g===d.id,className:g===d.id?`${c.detailTab} ${c.detailTabActive}`:c.detailTab,onClick:a(()=>{Te(d.id)},"onClick"),children:d.label},d.id))}),(0,o.jsxs)("div",{id:"trajectory-detail-panel",className:g==="overview"?`${c.detailBody} ${c.detailBodySummary}`:c.detailBody,role:"tabpanel","aria-labelledby":`trajectory-detail-${g}`,children:[E!==null&&rt!==void 0&&g==="overview"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("dl",{className:`${c.overview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Status"}),(0,o.jsx)("dd",{className:rt==="error"?c.error:void 0,children:tn(rt)})]}),H?.purpose==="compaction"&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Purpose"}),(0,o.jsx)("dd",{children:"Compaction"})]}),(H?.provider??H?.requestConfig?.provider)!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Provider"}),(0,o.jsx)("dd",{children:H?.provider??H?.requestConfig?.provider})]}),(H?.model??H?.requestConfig?.model)!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Model"}),(0,o.jsx)("dd",{children:H?.model??H?.requestConfig?.model})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Tool calls"}),(0,o.jsx)("dd",{children:mt})]}),gt>0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Subtool calls"}),(0,o.jsx)("dd",{children:gt})]}),H?.error!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Error"}),(0,o.jsx)("dd",{className:c.error,children:H.error})]}),H?.retry!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Retry"}),(0,o.jsxs)("dd",{children:["Scheduled ",H.retry,H.maxRetries===void 0?"":` of ${H.maxRetries}`]})]}),H?.retryDelayMs!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Retry delay"}),(0,o.jsx)("dd",{children:jt(H.retryDelayMs)})]}),xt!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Result"}),(0,o.jsx)("dd",{className:c.overviewParentLinks,children:(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{it(xt)},"onClick"),children:[(0,o.jsx)("span",{children:H?.purpose==="compaction"?"Compacted":"Assistant Message"}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]})})]})]}),(0,o.jsxs)("div",{className:c.overviewSections,children:[qt!==void 0&&(0,o.jsx)(Ee,{label:"Options",onOpen:a(()=>{Te("options")},"onOpen"),children:(0,o.jsx)(Un,{options:qt,preview:!0})}),(0,o.jsx)(Ee,{label:"Usage",onOpen:a(()=>{Te("usage")},"onOpen"),children:(0,o.jsx)(nn,{usage:gn})}),(0,o.jsx)(Ee,{label:"Timing",onOpen:a(()=>{Te("timing")},"onOpen"),children:(0,o.jsx)(ns,{assistant:ie,anchor:ve,request:H})})]})]}),E!==null&&g==="options"&&(0,o.jsx)(Un,{options:qt}),E!==null&&g==="usage"&&(0,o.jsx)(si,{usage:gn,cumulative:ga}),E!==null&&g==="timing"&&(0,o.jsx)(ns,{assistant:ie,anchor:ve,request:H}),U&&ge!==void 0&&g==="diff"&&(0,o.jsx)(vi,{before:ge,after:W}),U&&g==="system-prompt"&&(W.system===""?(0,o.jsx)("p",{className:c.noPayload,children:"No system prompt in this request"}):(0,o.jsx)("div",{className:`${c.markdownPayload} ${c.systemPrompt}`,children:(0,o.jsx)(K.MarkdownText,{text:W.system})})),U&&g==="tools"&&(0,o.jsx)(mi,{tools:W.tools}),!U&&_?.cell.kind==="compacted"&&O!==void 0&&g==="overview"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("dl",{className:`${c.overview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Status"}),(0,o.jsx)("dd",{className:O==="error"?c.error:void 0,children:tn(O)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:Ze(_.cell.timeSeconds)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Tokens"}),(0,o.jsx)("dd",{children:"—"})]})]}),_.cell.outputDetail!==void 0&&(0,o.jsx)("div",{className:`${c.compactedSummary} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:(0,o.jsx)(Ct,{record:_,rendered:!0,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:$t})})]}),!U&&_!==void 0&&_.cell.kind!=="compacted"&&O!==void 0&&g==="overview"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("dl",{className:`${c.overview} ${c.summaryScrollRegion}`,"data-summary-scroll-region":"",children:[_.cell.messageSource!==void 0&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Source"}),(0,o.jsx)("dd",{className:c.overviewParentLinks,children:(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{Te("source")},"onClick"),children:[(0,o.jsx)("span",{children:ri(_.cell.messageSource)}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]})})]}),ya&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:ot!==void 0?"Source":"Hierarchy"}),(0,o.jsxs)("dd",{className:c.overviewParentLinks,children:[ot!==void 0&&(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{vn(ot)},"onClick"),children:[(0,o.jsxs)("span",{children:["Request #",At??"—"]}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]}),js!==void 0&&(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{it(js)},"onClick"),children:[(0,o.jsx)("span",{children:"Assistant Message"}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]}),Gs!==void 0&&(0,o.jsxs)("button",{type:"button",className:c.overviewHierarchyNavLink,onClick:a(()=>{it(Gs)},"onClick"),children:[(0,o.jsx)("span",{children:"Tool Call"}),(0,o.jsx)(K.IconChevronRightOutline14,{className:c.overviewHierarchyJumpIconTight,size:11})]})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Status"}),(0,o.jsx)("dd",{className:O==="error"?c.error:void 0,children:tn(O)})]}),_.cell.kind==="message"&&(0,o.jsx)(ti,{cell:_.cell}),(_.cell.kind==="user"||_.cell.kind==="context")&&(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:"Duration"}),(0,o.jsx)("dd",{children:Ze(_.cell.timeSeconds)})]})]}),(0,o.jsxs)("div",{className:c.overviewSections,children:[Qn(_)?(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(Ee,{label:"Preview",onOpen:a(()=>{Te("rendered")},"onOpen"),children:(0,o.jsx)(Ct,{record:_,rendered:!0,preview:!0,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:$t})})}):(0,o.jsxs)(o.Fragment,{children:[_.cell.inputDetail&&(0,o.jsx)(Ee,{label:"Payload",onOpen:a(()=>{Te("input")},"onOpen"),children:(0,o.jsx)(Rt,{record:_,direction:"input",preview:!0})}),_.cell.outputDetail&&(0,o.jsx)(Ee,{label:"Result",onOpen:a(()=>{Te("output")},"onOpen"),children:(0,o.jsx)(Rt,{record:_,direction:"output",preview:!0})}),(0,o.jsx)(Ee,{label:"Schema",onOpen:a(()=>{Te("schema")},"onOpen"),children:(0,o.jsx)(ss,{record:_,preview:!0})})]}),ot!==void 0&&(0,o.jsx)(Ee,{label:"Request Timing",onOpen:a(()=>{vn(ot,"timing")},"onOpen"),children:(0,o.jsx)(It,{record:_})}),(_.cell.kind==="tool"||_.cell.kind==="subtool")&&(0,o.jsx)(Ee,{label:"Timing",onOpen:a(()=>{Te("timing")},"onOpen"),children:(0,o.jsx)(It,{record:_})})]})]}),!U&&_!==void 0&&g==="rendered"&&(0,o.jsx)(Ct,{record:_,rendered:!0,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:$t}),!U&&_!==void 0&&g==="raw"&&(0,o.jsx)(Ct,{record:_,rendered:!1,thinkingExpanded:P,onThinkingExpandedChange:N,onOpenCall:$t}),!U&&_!==void 0&&g==="source"&&(0,o.jsx)(oi,{record:_}),!U&&_!==void 0&&g==="input"&&(0,o.jsx)(Rt,{record:_,direction:"input"}),!U&&_!==void 0&&g==="output"&&(0,o.jsx)(Rt,{record:_,direction:"output"}),!U&&_!==void 0&&g==="schema"&&(0,o.jsx)(ss,{record:_}),!U&&_!==void 0&&g==="timing"&&(0,o.jsx)(It,{record:_})]})]})]})}a(wi,"TrajectoryTable");const Vi="._eSgDW_root{z-index:4;box-sizing:border-box;width:100%;height:var(--dsh-trajectory-toolbar-height);border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);position:sticky;top:0}._eSgDW_inner{box-sizing:border-box;align-items:center;gap:8px;width:100%;height:100%;padding:0 6px;display:flex}._eSgDW_actions{flex:none;align-items:center;gap:2px;display:flex}._eSgDW_toggle{height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xxs-12);background:0 0;border:0;border-radius:3px;flex:none;align-items:center;gap:4px;padding:0 7px;display:inline-flex}._eSgDW_toggle:hover,._eSgDW_toggle[aria-pressed=true]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}._eSgDW_toggle:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:1px}._eSgDW_toggleIcon{stroke:currentColor;stroke-width:1.25px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:12px;height:12px}._eSgDW_control{box-sizing:border-box;width:88px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xxs-12);background:0 0;border:0;border-radius:0;flex:none;justify-content:center;align-items:center;gap:4px;padding:0 5px;display:inline-flex}._eSgDW_control[hidden]{display:none}._eSgDW_control:hover:not(:disabled),._eSgDW_control[aria-checked=true],._eSgDW_control[aria-pressed=true]{color:var(--dsw-alias-label-primary)}._eSgDW_control:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:1px}._eSgDW_control:disabled{color:var(--dsw-alias-label-dimmed);cursor:not-allowed}._eSgDW_controlTrack{background:var(--dsw-alias-border-l2);width:20px;height:10px;transition:background-color .12s var(--ds-ease-in-out);border-radius:5px;flex:none;display:inline-block;position:relative}._eSgDW_controlThumb{background:var(--dsw-alias-bg-layer-1);width:6px;height:6px;transition:transform .12s var(--ds-ease-in-out);border-radius:50%;position:absolute;top:2px;left:2px}._eSgDW_controlTrack[data-on=true]{background:var(--dsw-alias-state-business-primary)}._eSgDW_controlTrack[data-on=true] ._eSgDW_controlThumb{transform:translate(10px)}._eSgDW_action{height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;font:var(--dsw-font-xxs-12);background:0 0;border:0;border-radius:3px;flex:none;align-items:center;gap:4px;padding:0 5px;display:inline-flex}._eSgDW_action:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}._eSgDW_action:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:1px}._eSgDW_actionIcon{color:var(--dsw-alias-label-tertiary);font:14px/14px var(--ds-font-family-code)}._eSgDW_search{border:1px solid var(--dsw-alias-border-l2);min-width:84px;height:22px;color:var(--dsw-alias-label-caption);background:var(--dsw-alias-bg-layer-2);border-radius:4px;flex:0 164px;align-items:center;gap:4px;margin-left:auto;padding:0 6px;display:flex}._eSgDW_search:hover{border-color:var(--dsw-alias-label-caption)}._eSgDW_search:focus-within{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-1)}._eSgDW_searchIcon{flex:none}._eSgDW_searchInput{width:100%;min-width:0;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xxs-12);background:0 0;border:0;outline:0;padding:0}._eSgDW_searchInput::placeholder{color:var(--dsw-alias-label-caption)}._eSgDW_searchInput::-webkit-search-cancel-button{cursor:pointer;width:12px;height:12px}",rs="@deepseek-ai/dsh-client-ui-trajectory/TrajectoryToolbar.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(rs)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=rs,e.textContent=Vi,document.head.appendChild(e)}var _e={actions:"_eSgDW_actions",controlThumb:"_eSgDW_controlThumb",actionIcon:"_eSgDW_actionIcon",control:"_eSgDW_control",root:"_eSgDW_root",search:"_eSgDW_search",toggle:"_eSgDW_toggle",action:"_eSgDW_action",searchIcon:"_eSgDW_searchIcon",searchInput:"_eSgDW_searchInput",controlTrack:"_eSgDW_controlTrack",inner:"_eSgDW_inner",toggleIcon:"_eSgDW_toggleIcon"};function _i({actualDuration:e,onActualDurationChange:t,actualTime:n,onActualTimeChange:s,allTurnsCollapsed:r,onToggleAllTurns:i,allAssistantsCollapsed:l,onToggleAllAssistants:u,searchQuery:p,onSearchQueryChange:f,t:m}){return(0,o.jsx)("div",{className:_e.root,role:"toolbar","aria-label":m("toolbar.aria"),children:(0,o.jsxs)("div",{className:_e.inner,children:[(0,o.jsxs)("div",{className:_e.actions,children:[(0,o.jsxs)("button",{type:"button",className:_e.toggle,"aria-label":m("toolbar.useActualDuration"),"aria-pressed":e,title:m(e?"toolbar.useEqualWidth":"toolbar.useActualDuration"),onClick:a(()=>{t(!e)},"onClick"),children:[(0,o.jsxs)("svg",{className:_e.toggleIcon,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("circle",{cx:"8",cy:"8",r:"5.25"}),(0,o.jsx)("path",{d:"M8 4.75V8l2.25 1.5"})]}),m("toolbar.duration")]}),(0,o.jsxs)("button",{type:"button",className:_e.control,role:"switch","aria-checked":n,hidden:!0,onClick:a(()=>{s(!n)},"onClick"),children:[(0,o.jsx)("span",{children:m("toolbar.actualTime")}),(0,o.jsx)("span",{className:_e.controlTrack,"data-on":n||void 0,"aria-hidden":"true",children:(0,o.jsx)("span",{className:_e.controlThumb})})]}),(0,o.jsxs)("button",{type:"button",className:_e.action,"aria-label":m(r?"toolbar.expandTurns":"toolbar.collapseTurns"),"aria-pressed":r,title:m(r?"toolbar.expandTurns":"toolbar.collapseTurns"),onClick:i,children:[(0,o.jsx)("span",{className:_e.actionIcon,"aria-hidden":"true",children:r?"⊞":"⊟"}),m("toolbar.turns")]}),(0,o.jsxs)("button",{type:"button",className:_e.action,"aria-label":m(l?"toolbar.expandCalls":"toolbar.collapseCalls"),"aria-pressed":l,title:m(l?"toolbar.expandCalls":"toolbar.collapseCalls"),onClick:u,children:[(0,o.jsx)("span",{className:_e.actionIcon,"aria-hidden":"true",children:l?"⊞":"⊟"}),m("toolbar.calls")]})]}),(0,o.jsxs)("div",{className:_e.search,children:[(0,o.jsx)(K.IconSearchOutline16,{size:11,className:_e.searchIcon}),(0,o.jsx)("input",{type:"search",className:_e.searchInput,"aria-label":m("toolbar.search"),placeholder:m("toolbar.searchPlaceholder"),value:p,onChange:a(h=>{f(h.currentTarget.value)},"onChange")})]})]})})}a(_i,"TrajectoryToolbar");function on(e){return Ln(e)}a(on,"formatTimelineOffset");function os(e){return e==="tool"||e==="subtool"?2:e==="message"||e==="compacted"?1:0}a(os,"laneFor");function is(e){return e!=null&&Number.isFinite(e)}a(is,"finite");function Ni(e){if(!is(e.startedAt))return null;const t=is(e.timeSeconds)?Math.max(0,e.timeSeconds*1e3):0;return{start:e.startedAt,end:e.startedAt+t}}a(Ni,"cellRange");function as(e,t="sequence"){if(t!=="sequence")return ki(e,t==="duration"||t==="actual",t==="duration");const n=[],s=[];for(const r of e){const i=r.groups.flatMap(l=>l.cells.filter(u=>u.requestOnly!==!0));i.length!==0&&(r.turn!==null&&s.push({turn:r.turn,time:n.length}),n.push(...i.map((l,u)=>({start:n.length+u,end:n.length+u+1,index:l.index,isError:l.isError===!0,kind:l.kind,label:l.text,lane:os(l.kind)}))))}return n.length===0?null:{start:0,end:n.length,spans:n,turnBoundaries:s}}a(as,"deriveTrajectoryTimeline");function ki(e,t,n){const s=e.flatMap(m=>{const h=m.groups.flatMap(x=>x.cells.flatMap(v=>{if(v.requestOnly===!0)return[];const T=Ni(v);return T===null?[]:[{...T,index:v.index,isError:v.isError===!0,kind:v.kind,label:v.text,lane:os(v.kind)}]}));return h.length===0?[]:[{turn:m.turn,rawSpans:h}]}),r=s.flatMap(m=>m.rawSpans);if(r.length===0)return null;const i=new Map;let l=0,u=null;for(const m of[...r].sort((h,x)=>h.start-x.start||h.end-x.end))n&&u!==null&&m.start>u&&(l+=m.start-u),i.set(m,l),u=u===null?m.end:Math.max(u,m.end);const p=[],f=[];for(const m of s){const h=m.rawSpans.map(x=>{const v=i.get(x)??0;return{...x,start:x.start-v,end:(t?x.end:x.start)-v}});p.push(...h),m.turn!==null&&f.push({turn:m.turn,time:Math.min(...h.map(x=>x.start))})}return{start:Math.min(...p.map(m=>m.start)),end:Math.max(...p.map(m=>m.end)),spans:p,turnBoundaries:f}}a(ki,"deriveTimedTimeline");function Si(e,t,n="sequence"){const s=as(e,n);return new Set(s?.spans.filter(r=>r.start<=t.end&&r.end>=t.start).map(r=>r.index))}a(Si,"trajectoryTimelineFocusIndexes");const Ti='.XGVSYG_root{z-index:1;isolation:isolate;border-bottom:1px solid var(--dsw-alias-border-l2);user-select:none;flex:none;position:relative}.XGVSYG_root [role=tooltip]{font:var(--dsw-font-xxxs-11)}.XGVSYG_plot{background:var(--dsw-alias-bg-layer-2);grid-template-columns:44px minmax(0,1fr);height:50px;display:grid;overflow:hidden}.XGVSYG_labels{border-right:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-caption);font:var(--dsw-font-xs-13);font-size:10px;line-height:1;position:relative}.XGVSYG_labels span{text-align:right;justify-content:flex-end;align-items:center;height:8px;display:flex;position:absolute;right:3px}.XGVSYG_labels span:first-child{top:7px}.XGVSYG_labels span:nth-child(2){top:21px}.XGVSYG_labels span:nth-child(3){top:35px}.XGVSYG_track{cursor:crosshair;touch-action:none;position:relative;overflow:hidden}.XGVSYG_track[data-panning=true]{cursor:grabbing}.XGVSYG_earlierHistory{z-index:5;appearance:none;box-sizing:border-box;background:linear-gradient(to right, var(--dsw-alias-bg-layer-2) 0, var(--dsw-alias-bg-layer-2) 38%, transparent 100%);width:28px;color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);opacity:.72;cursor:pointer;border:0;outline:none;justify-content:flex-start;align-items:center;padding-left:3px;line-height:1;display:flex;position:absolute;top:0;bottom:0;left:0}.XGVSYG_earlierHistory:hover{opacity:1}.XGVSYG_earlierHistory[aria-disabled=true]{cursor:default}.XGVSYG_earlierHistory:focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2)}.XGVSYG_empty{color:var(--dsw-alias-label-caption);font:var(--dsw-font-xs-13);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.XGVSYG_track:focus-visible{outline:1px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.XGVSYG_lanes{z-index:2;top:7px;bottom:7px;left:var(--trajectory-domain-left);width:var(--trajectory-domain-width);position:absolute}.XGVSYG_turnBoundaries{z-index:3;top:0;bottom:0;left:var(--trajectory-domain-left);width:var(--trajectory-domain-width);pointer-events:none;position:absolute}@media (prefers-reduced-motion:no-preference){.XGVSYG_lanes[data-animate-viewport=true],.XGVSYG_turnBoundaries[data-animate-viewport=true]{transition:left .18s ease-out}}.XGVSYG_turnBoundary{top:0;bottom:0;left:var(--trajectory-turn-left);background:var(--dsw-alias-border-l2);width:1px;position:absolute}.XGVSYG_span{top:calc(var(--trajectory-span-lane) * 14px);left:calc(var(--trajectory-span-left) + var(--trajectory-span-gap));width:max(2px, calc(var(--trajectory-span-width) - var(--trajectory-span-gap) - var(--trajectory-span-gap)));background:var(--dsw-alias-label-secondary);opacity:.78;border-radius:1px;min-width:2px;height:8px;position:absolute}.XGVSYG_span[data-timeline-span=user]{background:var(--dsw-alias-state-business-primary)}.XGVSYG_span[data-timeline-span=context]{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 68%, var(--dsw-alias-label-secondary))}.XGVSYG_span[data-timeline-span=message]{--trajectory-assistant-decoding-color:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 60%, var(--dsw-alias-state-error-secondary));--trajectory-assistant-ttft-color:color-mix(in srgb, var(--trajectory-assistant-decoding-color) 54%, var(--dsw-alias-bg-layer-2));background:var(--trajectory-assistant-decoding-color);opacity:1}.XGVSYG_span[data-timeline-span=message][data-assistant-timing=true]{background:linear-gradient(to right, var(--trajectory-assistant-ttft-color) 0, var(--trajectory-assistant-ttft-color) var(--trajectory-assistant-ttft), var(--trajectory-assistant-decoding-color) var(--trajectory-assistant-ttft), var(--trajectory-assistant-decoding-color) 100%)}.XGVSYG_span[data-timeline-span=tool],.XGVSYG_span[data-timeline-span=subtool]{background:var(--dsw-alias-state-warn-label);opacity:1}.XGVSYG_span[data-error=true]{background:var(--dsw-alias-state-error-primary)}.XGVSYG_span[data-equal-duration=true]{width:8px;min-width:8px}.XGVSYG_span[data-selected=false]{opacity:.2}.XGVSYG_span[data-hovered=true]:not([data-current=true]){z-index:1;opacity:1;box-shadow:0 0 0 1px var(--dsw-alias-bg-layer-2), 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 80%, transparent)}.XGVSYG_span[data-current=true]{z-index:1;opacity:1;box-shadow:0 0 0 1px var(--dsw-alias-bg-layer-2), 0 0 0 2px var(--dsw-alias-state-business-primary)}.XGVSYG_span[data-search-match=false]{opacity:.14}.XGVSYG_selection{z-index:1;top:0;bottom:0;left:var(--trajectory-selection-left);width:var(--trajectory-selection-width);background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);min-width:1px;box-shadow:-100vw 0 0 100vw color-mix(in srgb, var(--dsw-alias-bg-layer-1) 58%, transparent), 100vw 0 0 100vw color-mix(in srgb, var(--dsw-alias-bg-layer-1) 58%, transparent);pointer-events:none;position:absolute}.XGVSYG_selectionEdges{z-index:4;top:0;bottom:0;left:var(--trajectory-selection-left);width:var(--trajectory-selection-width);pointer-events:none;min-width:1px;position:absolute}.XGVSYG_hoverLine{z-index:4;top:0;bottom:0;left:clamp(0px, calc(var(--trajectory-hover-left) - 1px), calc(100% - 2px));background:var(--dsw-alias-state-business-primary);pointer-events:none;width:2px;position:absolute}.XGVSYG_selectionEdges:before,.XGVSYG_selectionEdges:after{background:var(--dsw-alias-state-business-primary);content:"";width:3px;position:absolute;top:0;bottom:0}.XGVSYG_selectionEdges:before{left:0}.XGVSYG_selectionEdges:after{right:0}.XGVSYG_selectionEdges[data-dragging=true]:before,.XGVSYG_selectionEdges[data-dragging=true]:after{width:2px}.XGVSYG_selection[data-dragging=true]{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, transparent)}',ls="@deepseek-ai/dsh-client-ui-trajectory/TrajectoryTimeline.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(ls)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=ls,e.textContent=Ti,document.head.appendChild(e)}var ye={selection:"XGVSYG_selection",span:"XGVSYG_span",selectionEdges:"XGVSYG_selectionEdges",earlierHistory:"XGVSYG_earlierHistory",track:"XGVSYG_track",empty:"XGVSYG_empty",root:"XGVSYG_root",labels:"XGVSYG_labels",plot:"XGVSYG_plot",turnBoundary:"XGVSYG_turnBoundary",hoverLine:"XGVSYG_hoverLine",lanes:"XGVSYG_lanes",turnBoundaries:"XGVSYG_turnBoundaries"};const an=3,Bi=4,ji=.08,Gi=.025,Ci=32,cs=500;function Ii(e){const t=e?.stepStartTime,n=e?.firstTokenTime,s=e?.completedTime;return e?.timingRecorded!==!0||typeof t!="number"||typeof n!="number"||typeof s!="number"||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(s)||n<t||s<n?{}:{ttftMs:n-t,decodingMs:s-n}}a(Ii,"assistantTimingDetail");function Ri(e){const t=e.timeSeconds===null||!Number.isFinite(e.timeSeconds)?void 0:Math.max(0,e.timeSeconds*1e3),n=e.startedAt===null||!Number.isFinite(e.startedAt)?void 0:e.startedAt;return{...t===void 0?{}:{durationMs:t},...n===void 0?{}:{startedAt:n},...Ii(e.assistantMetrics)}}a(Ri,"timelineRecordDetail");function Mi(e){switch(e){case"system":return"SYSTEM";case"user":return"USER";case"context":return"CONTEXT";case"compacted":return"COMPACTED";case"message":return"ASSISTANT";case"tool":return"TOOL";case"subtool":return"SUBTOOL"}}a(Mi,"timelineKindLabel");function ln(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}a(ln,"formatRecordedTime");function Ei(e,t){const n=Mi(e);if(t===void 0)return n;const s=t.durationMs===void 0?null:`Total ${on(t.durationMs)}`;return[n,t.startedAt===void 0?null:t.durationMs===void 0?`Started ${ln(t.startedAt)}`:`${ln(t.startedAt)} → ${ln(t.startedAt+t.durationMs)}`,[s,t.ttftMs===void 0||t.decodingMs===void 0?null:`TTFT ${on(t.ttftMs)} · Decoding ${on(t.decodingMs)}`].filter(r=>r!==null).join(" · ")].filter(r=>r!==null&&r!=="").join(`
|
|
14
|
+
`)}a(Ei,"timelineTooltipLabel");function cn(e,t){return e<=t?{start:e,end:t}:{start:t,end:e}}a(cn,"orderedRange");function dn(e){return Math.min(1,Math.max(0,e))}a(dn,"clampFraction");function Di(e,t,n,s){const r=Math.min(s-n,Math.max(0,t)),i=Math.min(Math.max(e-r/2,n),s-r);return{start:i,end:i+r}}a(Di,"centeredRange");function ds(e,t,n,s,r){const i=cn(Math.min(r,Math.max(s,e.start)),Math.min(r,Math.max(s,e.end)));return{start:(i.start-t)/n,end:(i.end-t)/n}}a(ds,"rangeFraction");function us(){return(0,o.jsxs)("div",{className:ye.labels,"aria-hidden":"true",children:[(0,o.jsx)("span",{children:"Input"}),(0,o.jsx)("span",{children:"Model"}),(0,o.jsx)("span",{children:"Tools"})]})}a(us,"LaneLabels");function ps({loading:e,onHover:t,onLoad:n}){return(0,o.jsx)(K.Tooltip,{label:e?"Loading earlier history…":"Click to load earlier history",side:"right",delayMs:cs,children:(0,o.jsx)("button",{type:"button",className:ye.earlierHistory,"data-earlier-history":!0,"data-loading":e||void 0,"aria-label":e?"Loading earlier history":"Load earlier history","aria-disabled":e||n===void 0,onClick:n,onPointerEnter:a(s=>{s.stopPropagation(),t()},"onPointerEnter"),onPointerMove:a(s=>{s.stopPropagation()},"onPointerMove"),onPointerDown:a(s=>{s.stopPropagation()},"onPointerDown"),children:"…"})})}a(ps,"EarlierHistoryBoundary");const Pi=(0,b.memo)(a(function({turns:t,mode:n,range:s,hasEarlierRecords:r=!1,onLoadEarlier:i,selectedIndex:l=null,searchMatchIndexes:u=null,onRangeChange:p,onRecordSelect:f,onRecordFocus:m}){const h=(0,b.useMemo)(()=>as(t,n),[n,t]),x=(0,b.useMemo)(()=>new Map(t.flatMap(V=>V.groups.flatMap(M=>M.cells.map(q=>[q.index,Ri(q)])))),[t]),v=(0,b.useRef)(null),T=(0,b.useRef)(null),k=(0,b.useRef)(null),S=(0,b.useRef)(null),[w,B]=(0,b.useState)(null),[C,I]=(0,b.useState)(null),[D,ee]=(0,b.useState)(!1),[E,xe]=(0,b.useState)(!1),[g,y]=(0,b.useState)(null),[P,N]=(0,b.useState)(!1);(0,b.useEffect)(()=>{h!==null&&s!==null&&(s.end<h.start||s.start>h.end)&&p(null)},[h,p,s]),(0,b.useEffect)(()=>{h!==null&&(N(!1),y(V=>V!==null&&(V.end<h.start||V.start>h.end)?null:V))},[h]),(0,b.useEffect)(()=>{if(h===null||l===null)return;const V=h.spans.find(M=>M.index===l);V!==void 0&&(N(!0),y(M=>{if(M===null||V.end>M.start&&V.start<M.end)return M;const q=Math.max(1,M.end-M.start),_=V.end<=M.start?V.start:V.end-q,Z=Math.min(Math.max(_,h.start),Math.max(h.start,h.end-q));return Z===M.start?M:{start:Z,end:Z+q}}))},[h,l]);const R=Math.max(1,(h?.end??0)-(h?.start??0)),se=Math.min(R,Math.max(1,(g?.end??0)-(g?.start??0))),de=h===null||g===null?h?.start??0:Math.min(Math.max(g.start,h.start),h.end-se),$=g===null?R:se,F=g===null?h?.start??0:de,Fe=r&&h!==null&&F===h.start,Xe=i===void 0||D?void 0:()=>{ee(!0),i().finally(()=>{ee(!1)})},be=h===null?void 0:{"--trajectory-domain-left":`${-(F-h.start)/$*100}%`,"--trajectory-domain-width":`${R/$*100}%`},Pe=h===null||s===null?null:ds(s,F,$,h.start,h.end),pe=(h===null||w===null?null:ds(w,F,$,h.start,h.end))??Pe,Ne=w??s;if((0,b.useEffect)(()=>{const V=k.current;if(V===null)return;const M=a(q=>{q.preventDefault();const _=S.current;if(_===null||h===null)return;N(!1);const Z=_.getBoundingClientRect(),X=dn((q.clientX-Z.left)/Math.max(1,Z.width)),re=Math.min(R,Math.max(Math.min(n==="sequence"?Bi:20,R),$*Math.exp(q.deltaY*.0015)));if(re>=R*.999){y(null);return}const J=F+X*$,le=Math.min(Math.max(J-X*re,h.start),h.end-re);y({start:le,end:le+re})},"onWheel");return V.addEventListener("wheel",M,{passive:!1}),()=>{V.removeEventListener("wheel",M)}},[$,F,R,n,h]),h===null)return(0,o.jsx)("section",{ref:k,className:ye.root,"aria-label":"Trajectory timeline",children:(0,o.jsxs)("div",{className:ye.plot,children:[(0,o.jsx)(us,{}),(0,o.jsxs)("div",{className:ye.track,children:[(0,o.jsx)("span",{className:ye.empty,children:"No timing data"}),r&&(0,o.jsx)(ps,{loading:D,onHover:a(()=>{I(null)},"onHover"),onLoad:Xe})]})]})});const Ye=Math.min($,R/h.spans.length),Ge=a(V=>{const M=V.currentTarget.getBoundingClientRect();return dn((V.clientX-M.left)/Math.max(1,M.width))},"fractionAt"),Ie=a(V=>{const M=(V.target instanceof HTMLElement?V.target:null)?.closest("[data-timeline-record-index]")?.dataset.timelineRecordIndex;if(M===void 0)return null;const q=Number(M);return Number.isFinite(q)?q:null},"recordIndexAt"),we=a(V=>{p(V)},"commit"),Je=a(V=>{if(V.button===2){T.current={anchorClientX:V.clientX,anchorStart:F,moved:!1,pannable:g!==null,pointerId:V.pointerId},g!==null&&N(!1),xe(!0),typeof V.currentTarget.setPointerCapture=="function"&&V.currentTarget.setPointerCapture(V.pointerId);return}if(V.button!==0)return;const M=Ge(V),q=F+M*$,_=Ie(V);I({fraction:M,recordIndex:_}),v.current={pointerId:V.pointerId,anchorTime:q,anchorClientX:V.clientX,recordIndex:_},typeof V.currentTarget.setPointerCapture=="function"&&V.currentTarget.setPointerCapture(V.pointerId),B({start:q,end:q})},"onPointerDown"),tt=a(V=>{const M=V.currentTarget.getBoundingClientRect(),q=Ge(V);I({fraction:q,recordIndex:Ie(V)});const _=T.current;if(_!==null&&_.pointerId===V.pointerId){if(Math.abs(V.clientX-_.anchorClientX)>=an&&(_.moved=!0),!_.pannable)return;const J=(V.clientX-_.anchorClientX)/Math.max(1,M.width),le=Math.min(Math.max(_.anchorStart-J*$,h.start),h.end-$);y({start:le,end:le+$});return}const Z=v.current;if(Z===null||Z.pointerId!==V.pointerId)return;let X=F;if(g!==null){const J=V.clientX-M.left,le=Math.min(Ci,Math.max(1,M.width*ji)),te=J<le?-1:J>M.width-le?1:0;if(te!==0){const he=dn((te<0?le-J:J-(M.width-le))/le),Ve=F+te*$*Gi*Math.max(.2,he);X=Math.min(Math.max(Ve,h.start),h.end-$),X!==F&&(N(!1),y({start:X,end:X+$}))}}const re=X+q*$;B(cn(Z.anchorTime,re))},"onPointerMove"),ke=a(V=>{const M=T.current;if(M!==null&&M.pointerId===V.pointerId){const te=M.moved||Math.abs(V.clientX-M.anchorClientX)>=an;T.current=null,xe(!1),te||p(null);return}const q=v.current;if(q===null||q.pointerId!==V.pointerId)return;const _=Ge(V),Z=F+_*$,X=cn(q.anchorTime,Z);I({fraction:_,recordIndex:Ie(V)}),v.current=null,B(null);const re=Math.abs(V.clientX-q.anchorClientX)<an,J=re&&q.recordIndex!==null?h.spans.find(te=>te.index===q.recordIndex):void 0;if(J!==void 0){p(null),f?.(J.index);return}const le=X.end-X.start<Ye?Di(re?X.start:(X.start+X.end)/2,Ye,h.start,h.end):X;if(we(le),re){const te=X.start,he=h.spans.reduce((Ve,Me)=>{const qe=te<Ve.start?Ve.start-te:te>Ve.end?te-Ve.end:0;return(te<Me.start?Me.start-te:te>Me.end?te-Me.end:0)<qe?Me:Ve});m?.(he.index)}},"onPointerEnd"),Re=a(V=>{V.key!=="Escape"||s===null||(V.preventDefault(),p(null))},"onKeyDown"),z=a(()=>{v.current=null,T.current=null,B(null),I(null),xe(!1)},"onPointerCancel");return(0,o.jsx)("section",{ref:k,className:ye.root,"aria-label":"Trajectory timeline",children:(0,o.jsxs)("div",{className:ye.plot,children:[(0,o.jsx)(us,{}),(0,o.jsxs)("div",{ref:S,className:ye.track,"data-panning":E||void 0,"aria-label":"Timeline overview; drag horizontally to focus events",tabIndex:0,onKeyDown:Re,onPointerDown:Je,onPointerMove:tt,onPointerUp:ke,onPointerCancel:z,onPointerLeave:a(()=>{v.current===null&&T.current===null&&I(null)},"onPointerLeave"),onDoubleClick:a(V=>{V.preventDefault(),p(null)},"onDoubleClick"),onContextMenu:a(V=>{V.preventDefault()},"onContextMenu"),children:[Fe&&(0,o.jsx)(ps,{loading:D,onHover:a(()=>{I(null)},"onHover"),onLoad:Xe}),C!==null&&C.recordIndex===null&&w===null&&(0,o.jsx)("div",{className:ye.hoverLine,"data-timeline-hover-line":!0,"aria-hidden":"true",style:{"--trajectory-hover-left":`${C.fraction*100}%`}}),pe!==null&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:ye.selection,"data-dragging":w===null?void 0:"true","aria-hidden":"true",style:{"--trajectory-selection-left":`${pe.start*100}%`,"--trajectory-selection-width":`${(pe.end-pe.start)*100}%`}}),(0,o.jsx)("div",{className:ye.selectionEdges,"data-dragging":w===null?void 0:"true","aria-hidden":"true",style:{"--trajectory-selection-left":`${pe.start*100}%`,"--trajectory-selection-width":`${(pe.end-pe.start)*100}%`}})]}),(0,o.jsx)("div",{className:ye.turnBoundaries,"data-animate-viewport":P||void 0,"aria-hidden":"true",style:be,children:h.turnBoundaries.filter(V=>V.time>h.start&&V.time>=F&&V.time<=F+$).map(V=>(0,o.jsx)("span",{className:ye.turnBoundary,"data-turn":V.turn,style:{"--trajectory-turn-left":`${(V.time-h.start)/R*100}%`}},V.turn))}),(0,o.jsx)("div",{className:ye.lanes,"data-animate-viewport":P||void 0,"data-timeline-domain":!0,style:be,children:h.spans.filter(V=>V.index===l||V.end>=F&&V.start<=F+$).map(V=>{const M=(V.start-h.start)/R,q=(V.end-V.start)/R*100,_=x.get(V.index),Z=_?.ttftMs,X=_?.decodingMs,re=Z===void 0||X===void 0||Z+X<=0?null:Z/(Z+X);return(0,o.jsx)(K.Tooltip,{label:a(()=>Ei(V.kind,_),"label"),side:"bottom",delayMs:cs,children:(0,o.jsx)("span",{"aria-hidden":"true",className:ye.span,"data-timeline-span":V.kind,"data-timeline-record-index":V.index,"data-assistant-timing":re===null?void 0:"true","data-error":V.isError||void 0,"data-equal-duration":n==="time"||void 0,"data-current":V.index===l||void 0,"data-hovered":C?.recordIndex===V.index||void 0,"data-search-match":u===null?void 0:u.has(V.index)?"true":"false","data-selected":Ne===null?void 0:V.start<=Ne.end&&V.end>=Ne.start?"true":"false",style:{"--trajectory-span-left":`${M*100}%`,"--trajectory-span-width":`${q}%`,"--trajectory-span-gap":`min(${q*.08}%, 1px)`,"--trajectory-span-lane":V.lane,...re===null?{}:{"--trajectory-assistant-ttft":`${re*100}%`}}})},V.index)})})]})]})})},"TrajectoryTimeline"));function hs(e){return e.kind==="system"&&e.change.kind==="initial"?Number.NEGATIVE_INFINITY:e.seq}a(hs,"layoutEntryOrder");function un(e){const t=ks(e.content);return{text:"",...t===void 0?{}:{previewMarkdown:t},sourceSeq:e.seq,messageSource:e.source,inputDetail:Ns(e.content),sourceBlocks:e.content.map(n=>He(n)),timeSeconds:0,startedAt:A(e.time)}}a(un,"inputCellDetail");function fs(e){const{nodes:t,eventLocations:n,partial:s,runningCalls:r,requests:i=[],callSchemas:l}=e,u=Yi(t),p=new Map(u);for(const g of r)p.set(g.callId,g);const f=Ji(t),m=Hi(t),h=new Map;for(const g of u.values()){const y=A(g.callTime);y!==null&&h.set(g.callId,y)}for(const g of r){const y=A(g.time);y!==null&&h.set(g.callId,y)}const x=new Map,v=[];let T=0,k=null,S=null;const w=a(g=>{let y=x.get(g);return y===void 0&&(y={groups:[]},x.set(g,y)),y},"bucket"),B=a((g,y)=>{const P=w(g).groups,N=P.at(-1);if(N?.title==="Message"){N.laid.push(y);return}P.push({title:"Message",laid:[y]})},"pushMessage"),C=a((g,y,P)=>{if(P.length===0)return;const N=w(g).groups,R=`Step ${y}`,se=N.find(de=>de.title===R);if(se!==void 0){se.laid.push(...P);return}N.push({title:R,laid:[...P]})},"pushStep"),I=a((g,y,P)=>{if(P.length===0)return;const N=w(g).groups,R=`Step ${y}`,se=N.find($=>$.title===R);if(se===void 0){N.push({title:R,laid:[...P]});return}const de=se.laid.findIndex($=>$.cell.requestOnly===!0);de===-1?se.laid.push(...P):se.laid.splice(de,0,...P)},"pushStepInput"),D=new Set;for(const g of t)g.kind==="assistant"&&g.step>0&&D.add(`${g.turn}\0${g.step}`);s!==null&&s.step>0&&D.add(`${s.turn}\0${s.step}`);for(const g of r)g.step>0&&D.add(`${g.turn}\0${g.step}`);const ee=[...t.map((g,y)=>({kind:"node",seq:g.seq,node:g,nodeIndex:y})),...i.filter(g=>g.purpose==="compaction").map(g=>({kind:"compaction",seq:g.startSeq,request:g})),...i.flatMap(g=>g.purpose!=="assistant"||g.promptChange===void 0||g.prompt===void 0?[]:[{kind:"system",seq:g.promptChange.seq,request:g,change:g.promptChange}]),...i.filter(g=>g.purpose==="assistant").filter(g=>!D.has(`${g.turn}\0${g.step}`)).map(g=>({kind:"request",seq:g.startSeq,request:g}))].sort((g,y)=>hs(g)-hs(y));for(const g of ee){if(g.kind==="request"){const{request:N}=g;C(N.turn,N.step,[{absTime:A(N.startedAt),cell:{index:++T,kind:"message",text:"",sourceSeq:N.startSeq,requestOnly:!0,timeSeconds:N.completedAt===null?null:et(N.completedAt,N.startedAt),startedAt:A(N.startedAt),...N.status==="error"?{isError:!0}:{}}}]),k=A(N.completedAt)??A(N.startedAt)??k;continue}if(g.kind==="system"){const{change:N,request:R}=g;B(N.kind==="initial"?Xi(t,s):Fi(t,N.seq,s),{absTime:A(N.time),cell:{index:++T,kind:"system",text:Li(N),sourceSeq:N.seq,...R.prompt===void 0?{}:{promptDetail:R.prompt},...N.previous===void 0?{}:{previousPromptDetail:N.previous},timeSeconds:0,startedAt:A(N.time)}}),k=A(N.time)??k;continue}if(g.kind==="compaction"){const N=g.request,R=N.rawOutput??N.summary,se=R===void 0?"":Qi(R),de={index:++T,kind:"compacted",text:N.status==="running"?"Compacting context…":N.status==="error"?N.error??"Compaction failed":N.summary===void 0?"Context compacted":"",...N.status==="complete"&&N.summary!==void 0?Ki(N.summary):{},sourceSeq:N.startSeq,...N.summary===void 0?{}:{outputDetail:Ns(N.summary),outputBlocks:N.summary.map(F=>He(F))},...se===""?{}:{thinkingDetail:se},...R===void 0?{}:{sourceBlocks:R.map(F=>He(F))},...N.status==="error"?{isError:!0}:{},timeSeconds:N.completedAt===null?null:et(N.completedAt,N.startedAt),startedAt:A(N.startedAt)};ws(de,N.usage);const $={groups:[{title:`Compaction ${N.startSeq}`,laid:[{absTime:A(N.startedAt),cell:de}]}]};N.turn===null?v.push($):w(N.turn).groups.push(...$.groups),k=A(N.completedAt)??A(N.startedAt)??k;continue}const{node:y,nodeIndex:P}=g;if(y.kind==="user"){B(bs(m[P],s,S),{absTime:A(y.time),cell:{index:++T,kind:"user",...un(y),opensTurn:!0}}),k=A(y.time)??k;continue}if(y.kind==="steering"){const N=Wi(m[P],s,S,n?.get(y.seq)),R={absTime:A(y.time),cell:{index:++T,kind:"user",...un(y)}};N.step===void 0?B(N.turn,R):I(N.turn,N.step,[R]),k=A(y.time)??k;continue}if(y.kind==="assistant"){const N=Vs(ys(y,T+1,k,u,h,p));if(y.step>0)C(y.turn,y.step,N);else for(const se of N)B(y.turn,se);const R=N[N.length-1];R!==void 0&&(T=R.cell.index),k=A(y.time)??k,S=y.turn;continue}if(y.kind==="context"){B(bs(m[P],s,S),{absTime:A(y.time),cell:{index:++T,kind:"context",...un(y)}}),k=A(y.time)??k;continue}if(y.kind==="compaction"){k=A(y.time)??k;continue}if(y.kind==="tool-result"){if(!f.has(y.callId)){const N=y.call?.name,R=hn(y),se=[{absTime:A(y.callTime??y.time),...N!==void 0?{toolName:N}:{},callId:y.callId,subCalls:y.subCalls,cell:{index:++T,kind:"tool",sourceSeq:y.seq,...y.call!==null?ht(y.call.name,y.call.argsRaw):_s(R),...y.call!==null?{inputDetail:y.call.argsRaw}:{},outputDetail:fn(y),outputBlocks:y.content.map(de=>He(de)),...R,callId:y.callId,isError:y.isError,timeSeconds:et(y.time,y.callTime),startedAt:A(y.callTime)}}];for(const de of Et(y.subCalls,T))se.push(de),T=de.cell.index;C(0,1,se)}k=A(y.time)??k}}if(s!==null){const g=Vs(ys({kind:"assistant",seq:Number.MAX_SAFE_INTEGER,time:0,turn:s.turn,step:s.step,blocks:s.blocks},T+1,k,u,h,p,{streaming:!0}));if(s.step>0)C(s.turn,s.step,g);else for(const P of g)B(s.turn,P);const y=g[g.length-1];y!==void 0&&(T=y.cell.index)}const E=Ui(x);for(const g of r){if(E.has(g.callId))continue;const y=[{absTime:null,toolName:g.name,callId:g.callId,subCalls:g.subCalls,cell:{index:++T,kind:"tool",...ht(g.name,g.argsRaw),inputDetail:g.argsRaw,callId:g.callId,timeSeconds:null,startedAt:A(g.time)}}];for(const P of Et(g.subCalls,T))y.push(P),T=P.cell.index;if(g.step>0)C(g.turn,g.step,y);else for(const P of y)B(g.turn,P)}const xe=x.get(0);if(xe!==void 0){x.delete(0);const g=a(()=>({groups:[]}),"emptyTurn"),y=x.get(1)??g();y.groups=[...xe.groups,...y.groups],x.set(1,y)}for(const g of[...x.values(),...v])for(const y of g.groups)for(const P of y.laid)qi(P,l);return[...[...x.entries()].map(([g,y])=>gs(g,y)),...v.map(g=>gs(null,g))].sort((g,y)=>vs(g)-vs(y))}a(fs,"deriveTrajectoryLayout");function ms(e,t,n){if(t===null)return e;const s=fs({nodes:[],partial:t,runningCalls:[]}).at(0);if(s===void 0)return e;const r={...s,groups:s.groups.map(f=>({...f,cells:f.cells.map(m=>({...m,index:m.index+n}))}))},i=e.findIndex(f=>f.turn===r.turn);if(i===-1)return[...e,r];const l=e[i];if(l===void 0)return e;const u=[...l.groups];for(const f of r.groups){const m=u.findIndex(v=>v.title===f.title);if(m===-1){u.push(f);continue}const h=u[m];if(h===void 0)continue;const x=new Set(f.cells.flatMap(v=>v.callId===void 0?[]:[v.callId]));u[m]={...f,cells:[...h.cells.filter(v=>v.requestOnly!==!0&&(v.callId===void 0||!x.has(v.callId))),...f.cells]}}const p=[...e];return p[i]={...l,groups:u},p}a(ms,"appendTrajectoryPartialLayout");function qi(e,t){if(e.callId===void 0||t===void 0)return;const n=t.get(e.callId);n!==void 0&&(e.cell.schemaDetail=JSON.stringify(n,null,2))}a(qi,"attachToolSchema");function gs(e,t){return{turn:e,groups:t.groups.map(({title:n,laid:s})=>{const r=Oi(s);return{title:n,...r!==void 0?{description:r}:{},cells:s.map(i=>i.cell)}})}}a(gs,"toTurnModel");function vs(e){return Math.min(...e.groups.flatMap(t=>t.cells.map(n=>n.index)),Number.POSITIVE_INFINITY)}a(vs,"firstCellIndex");function Oi(e){const t=[],n=[];for(const r of e)r.absTime===null||!Number.isFinite(r.absTime)||(n.push(r.absTime),r.cell.kind==="tool"&&r.cell.timeSeconds!==null&&Number.isFinite(r.cell.timeSeconds)&&n.push(r.absTime+r.cell.timeSeconds*1e3));if(n.length>=2){const r=xs((Math.max(...n)-Math.min(...n))/1e3);r!==void 0&&t.push(r)}else if(n.length===1){const r=e.find(l=>l.absTime===n[0])?.cell.timeSeconds,i=r!=null?xs(r):void 0;i!==void 0&&t.push(i)}const s=new Map;for(const r of e)r.toolName===void 0||r.cell.kind!=="tool"||s.set(r.toolName,(s.get(r.toolName)??0)+1);for(const[r,i]of s)t.push(i>1?`${r}×${i}`:r);return t.length===0?void 0:t.join(" ")}a(Oi,"groupDescription");function xs(e){if(Number.isFinite(e))return Ze(e)}a(xs,"formatGroupDuration");function et(e,t){return t===null||!Number.isFinite(e)||!Number.isFinite(t)?null:Math.max(0,(e-t)/1e3)}a(et,"durationSeconds");function A(e){return typeof e=="number"&&Number.isFinite(e)?e:null}a(A,"finiteTime");function ys(e,t,n,s,r,i,l){if(l?.streaming===!0&&e.blocks.length===0)return[];const u=[];let p=t-1;const f=e.usage,m=l?.streaming===!0,h=A(e.timing?.stepStartTime),x=m?null:et(e.time,h??n),v=m?null:A(e.time),T=e.blocks.filter(w=>w.kind==="text"&&(!m||w.text!=="")).map(w=>w.kind==="text"?w.text:"").join(`
|
|
15
15
|
|
|
16
16
|
`),k=e.blocks.filter(w=>w.kind==="reasoning"&&(!m||w.text!=="")).map(w=>w.kind==="reasoning"?w.text:"").join(`
|
|
17
17
|
|
|
18
|
-
`),S={index:++p,recordId:`assistant\0${e.turn}\0${e.step}`,kind:"message",sourceSeq:e.seq,text:T!==""||k!==""?"":Ai(e.blocks),...T!==""?{previewMarkdown:T}:k!==""?{previewMarkdown:k}:{},...T!==""?{outputDetail:T}:{},...k!==""?{thinkingDetail:k}:{},sourceBlocks:e.blocks.map(w=>$i(w)),timeSeconds:
|
|
19
|
-
`);return t!==""?t:e.content.length===0||e.content.every(n=>n.type==="text"&&(typeof n.text!="string"||n.text===""))?"No output":JSON.stringify(e.content,null,2)}a(
|
|
20
|
-
`)}a(
|
|
21
|
-
`)}a(Qi,"detailReasoning");function
|
|
22
|
-
`).toLocaleLowerCase()};this.entries.set(l,f),t.add(l)}for(const n of this.entries.keys())t.has(n)||this.entries.delete(n);return!0}search(e){const t=e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);if(t.length===0)return null;const n=new Set;for(const[s,r]of this.entries)t.every(i=>r.text.includes(i))&&n.add(s);return n}};const ra=".Zg-NJW_root{--dsh-trajectory-toolbar-height:32px;box-sizing:border-box;width:100%;height:100%;min-height:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);flex-direction:column;display:flex;overflow:hidden}.Zg-NJW_ledger{z-index:0;isolation:isolate;--dsh-trajectory-bottom-clearance:calc(var(--dsh-composer-height,152px) + 16px);flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}",
|
|
18
|
+
`),S={index:++p,recordId:`assistant\0${e.turn}\0${e.step}`,kind:"message",sourceSeq:e.seq,text:T!==""||k!==""?"":Ai(e.blocks),...T!==""?{previewMarkdown:T}:k!==""?{previewMarkdown:k}:{},...T!==""?{outputDetail:T}:{},...k!==""?{thinkingDetail:k}:{},sourceBlocks:e.blocks.map(w=>$i(w)),timeSeconds:x,startedAt:h};ws(S,f),S.assistantMetrics={timingRecorded:e.timing!==void 0,stepStartTime:e.timing?.stepStartTime??null,firstTokenTime:e.timing?.firstTokenTime??null,completedTime:m?null:A(e.time),usageProvided:f!==void 0,outputTokens:Number.isFinite(f?.outputTokens)?f?.outputTokens??null:null},u.push({absTime:v,cell:S});for(const w of e.blocks){if(w.kind!=="tool-call")continue;const B=s.get(w.callId),C=m||B===void 0?null:et(B.time,B.callTime),I=A(r.get(w.callId)),D=i.get(w.callId),ee=B===void 0?void 0:hn(B);u.push({absTime:I,toolName:w.name,callId:w.callId,...D===void 0?{}:{subCalls:D.subCalls},cell:{index:++p,kind:"tool",...ht(w.name,w.argsRaw),inputDetail:w.argsRaw,callId:w.callId,...B!==void 0?{outputDetail:fn(B),outputBlocks:B.content.map(E=>He(E)),...ee,isError:B.isError}:{},timeSeconds:C,startedAt:I}})}return u}a(ys,"expandAssistant");function Ai(e){const t=new Map;for(const n of e)n.kind==="tool-call"&&t.set(n.name,(t.get(n.name)??0)+1);return t.size>0?"Tool call only":""}a(Ai,"summarizeAssistantActivity");function Li(e){return e.kind==="initial"?"Initial System Prompt":e.kind==="system"?"System Prompt Updated":e.kind==="tools"?"Tools Updated":"System Prompt and Tools Updated"}a(Li,"promptChangeLabel");function $i(e){switch(e.kind){case"text":return{type:"text",content:e.text};case"reasoning":return{type:"thinking",content:e.text};case"tool-call":return{type:"tool-call",content:e.argsRaw,callId:e.callId,toolName:e.name};case"image":return{type:"image",content:pn(e.attachment)};case"other":return He(e.block)}}a($i,"assistantSourceBlock");function He(e){if(typeof e!="object"||e===null)return{type:"unknown",content:pn(e)};const t=e,n=typeof t.type=="string"?t.type:"unknown";if(typeof t.text=="string")return{type:n==="reasoning"?"thinking":n,content:t.text};const s=zi(t),r=typeof t.alt=="string"?t.alt:void 0;return{type:n,content:s===void 0?pn(e):"",...s!==void 0?{imageSrc:s}:{},...r!==void 0?{imageAlt:r}:{}}}a(He,"sourceBlock");function zi(e){if(typeof e.type!="string"||!e.type.toLowerCase().includes("image"))return;for(const n of[e.url,e.image_url])if(typeof n=="string")return Mt(n);if(typeof e.data=="string"){const n=[e.mimeType,e.mediaType,e.media_type].find(s=>typeof s=="string")??"image/png";return Mt(e.data.startsWith("data:")?e.data:`data:${n};base64,${e.data}`)}if(typeof e.source!="object"||e.source===null)return;const t=e.source;if(typeof t.url=="string")return Mt(t.url);if(typeof t.data=="string")return Mt(`data:${typeof t.media_type=="string"?t.media_type:"image/png"};base64,${t.data}`)}a(zi,"sourceImage");function Mt(e){if(e.startsWith("data:image/")||e.startsWith("blob:"))return e;try{const t=new URL(e).protocol;return t==="http:"||t==="https:"?e:void 0}catch{return}}a(Mt,"safeImageSource");function pn(e){return JSON.stringify(e,null,2)||String(e)}a(pn,"stringifySourceValue");function bs(e,t,n){return e!==void 0?e.turn:t!==null?t.turn:n!==null?n+1:1}a(bs,"enclosingUserTurn");function Wi(e,t,n,s){if(s?.kind==="step")return{turn:s.turn.turn,step:s.step.step};const r=s?.kind==="turn"?s.turn.turn:void 0;return e!==void 0&&(r===void 0||e.turn===r)?{turn:e.turn,...e.step>0?{step:e.step}:{}}:t!==null&&(r===void 0||t.turn===r)?{turn:t.turn,...t.step>0?{step:t.step}:{}}:r!==void 0?{turn:r}:{turn:n??1}}a(Wi,"steeringPlacement");function Hi(e){const t=new Array(e.length);let n;for(let s=e.length-1;s>=0;s--){t[s]=n;const r=e[s];r?.kind==="assistant"&&(n=r)}return t}a(Hi,"indexFollowingAssistants");function Fi(e,t,n){const s=e.find(r=>r.seq>t&&r.kind==="assistant"&&r.step>0);return s?.kind==="assistant"?s.turn:n?.turn??1}a(Fi,"enclosingPromptTurn");function Xi(e,t){const n=e.flatMap(s=>s.kind==="assistant"&&s.turn>0?[s.turn]:[]);return t!==null&&t.turn>0&&n.push(t.turn),n.length===0?1:Math.min(...n)}a(Xi,"firstVisibleTurn");function ws(e,t){t!==void 0&&(t.inputTokens!==void 0&&(e.input=t.inputTokens),t.cacheReadTokens!==void 0&&(e.cacheRead=t.cacheReadTokens),t.cacheWriteTokens!==void 0&&(e.cacheWrite=t.cacheWriteTokens),t.outputTokens!==void 0&&(e.output=t.outputTokens),t.reasoningTokens!==void 0&&(e.think=t.reasoningTokens))}a(ws,"attachUsage");function Yi(e){const t=new Map;for(const n of e)n.kind==="tool-result"&&t.set(n.callId,n);return t}a(Yi,"indexResults");function Ji(e){const t=new Set;for(const n of e)if(n.kind==="assistant")for(const s of n.blocks)s.kind==="tool-call"&&t.add(s.callId);return t}a(Ji,"indexAssistantCallIds");function Ui(e){const t=new Set;for(const n of e.values())for(const s of n.groups)for(const r of s.laid)r.callId!==void 0&&t.add(r.callId);return t}a(Ui,"collectCallIds");function Vs(e){if(!e.some(s=>s.subCalls!==void 0&&s.subCalls.length>0))return e;const t=[];let n=e[0]!==void 0?e[0].cell.index-1:0;for(const s of e){t.push({...s,cell:{...s.cell,index:++n}});for(const r of Et(s.subCalls,n))t.push(r),n=r.cell.index}return t}a(Vs,"withSubCalls");function Et(e,t){if(e===void 0||e.length===0)return[];const n=[];let s=t;for(const r of e){const i="kind"in r,l=i?hn(r):void 0,u={absTime:A(i?r.callTime??r.time:r.time),toolName:i?r.call?.name??r.callId:r.name,callId:r.callId,cell:{index:++s,kind:"subtool",callId:r.callId,...i?r.call!==null?ht(r.call.name,r.call.argsRaw):_s(l):ht(r.name,r.argsRaw),...i?r.call!==null?{inputDetail:r.call.argsRaw}:{}:{inputDetail:r.argsRaw},...i?{outputDetail:fn(r),outputBlocks:r.content.map(p=>He(p)),...l,isError:r.isError}:{},timeSeconds:i?et(r.time,r.callTime):null,startedAt:A(i?r.callTime:r.time)}};n.push(u);for(const p of Et(r.subCalls,s))n.push(p),s=p.cell.index}return n}a(Et,"expandSubCalls");function ht(e,t){return{text:e,...t===""?{}:{previewMarkdown:t}}}a(ht,"summarizeCall");function hn(e){if(e.isError)return{result:e.error?.code??"error"};for(const t of e.content)if(t.type==="text"&&typeof t.text=="string"&&t.text!=="")return{result:"",resultPreviewMarkdown:t.text};return{result:"No output"}}a(hn,"summarizeResult");function _s(e){return{text:e?.result??"",...e?.resultPreviewMarkdown===void 0?{}:{previewMarkdown:e.resultPreviewMarkdown}}}a(_s,"resultAsText");function fn(e){if(e.isError)return e.error===void 0?"error":`${e.error.name}: ${e.error.code}`;const t=e.content.filter(n=>n.type==="text"&&typeof n.text=="string").map(n=>n.type==="text"?n.text:"").join(`
|
|
19
|
+
`);return t!==""?t:e.content.length===0||e.content.every(n=>n.type==="text"&&(typeof n.text!="string"||n.text===""))?"No output":JSON.stringify(e.content,null,2)}a(fn,"detailResult");function Ns(e){return e.filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text??"").join(`
|
|
20
|
+
`)}a(Ns,"detailContent");function Qi(e){return e.filter(t=>t.type==="reasoning"&&typeof t.text=="string").map(t=>t.text??"").join(`
|
|
21
|
+
`)}a(Qi,"detailReasoning");function ks(e){for(const t of e)if(t.type==="text"&&typeof t.text=="string")return t.text}a(ks,"previewContent");function Ki(e){const t=ks(e);return t===void 0?{}:{previewMarkdown:t}}a(Ki,"previewContentProperty");function mn(e){if(e===void 0)return"";try{return JSON.stringify(e)}catch{return""}}a(mn,"searchableJson");function Zi(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}a(Zi,"sameSources");function ea(e){if(e.previewMarkdown===void 0)return"";const t=ut(e.previewMarkdown);return e.text===""?t:t===""?e.text:`${e.text} · ${t}`}a(ea,"markdownPreview");function ta(e){return e.resultPreviewMarkdown===void 0?e.result??"":ut(e.resultPreviewMarkdown)}a(ta,"resultPreview");function na(e,t,n){const s=[...n.sourceBlocks??[],...n.outputBlocks??[]];return[e===null?"between turns":`turn ${e}`,t,n.kind,n.kind==="message"?"assistant":"",n.text,n.previewMarkdown??"",n.inputDetail??"",n.outputDetail??"",n.thinkingDetail??"",n.schemaDetail??"",n.result??"",n.resultPreviewMarkdown??"",n.callId??"",...s.flatMap(r=>[r.type,r.content,r.callId??"",r.toolName??"",r.imageAlt??""]),mn(n.messageSource),mn(n.promptDetail),mn(n.previousPromptDetail)]}a(na,"recordSources");var sa=class{static{a(this,"TrajectorySearchIndex")}entries=new Map;layouts;update(e){if(this.layouts===e)return!1;this.layouts=e;const t=new Set;for(const n of e)for(const s of n)for(const r of s.groups)for(const i of r.cells){if(i.requestOnly===!0)continue;const l=me(i),u=na(s.turn,r.title,i),p=this.entries.get(l),f=p!==void 0&&Zi(p.sources,u)?p:{sources:u,text:[...u,ea(i),ta(i)].join(`
|
|
22
|
+
`).toLocaleLowerCase()};this.entries.set(l,f),t.add(l)}for(const n of this.entries.keys())t.has(n)||this.entries.delete(n);return!0}search(e){const t=e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);if(t.length===0)return null;const n=new Set;for(const[s,r]of this.entries)t.every(i=>r.text.includes(i))&&n.add(s);return n}};const ra=".Zg-NJW_root{--dsh-trajectory-toolbar-height:32px;box-sizing:border-box;width:100%;height:100%;min-height:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);flex-direction:column;display:flex;overflow:hidden}.Zg-NJW_ledger{z-index:0;isolation:isolate;--dsh-trajectory-bottom-clearance:calc(var(--dsh-composer-height,152px) + 16px);flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}",Ss="@deepseek-ai/dsh-client-ui-trajectory/views.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(Ss)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-trajectory",e.dataset.pluginCss=Ss,e.textContent=ra,document.head.appendChild(e)}var Ts={ledger:"Zg-NJW_ledger",root:"Zg-NJW_root"};const oa=new Set,ia=new Set,aa=3e3;function la(e){let t=0;for(const n of e)for(const s of n.groups)for(const r of s.cells)t=Math.max(t,r.index);return t}a(la,"lastCellIndex");function ca(e){switch(e.kind){case"text":return{kind:"text",text:""};case"reasoning":return{kind:"reasoning",text:""};case"image":return e;case"tool-call":return{kind:"tool-call",callId:e.callId,name:e.name,argsRaw:""};case"other":return{kind:"other",block:null}}}a(ca,"timelineBlock");function da(e){return e===null?"":e.blocks.map(t=>t.kind==="tool-call"?`${t.kind}:${t.callId}:${t.name}`:t.kind).join("\0")}a(da,"partialStructureSignature");function ua(e){const t=e;if(t!==void 0)return{...t.inputTokens===void 0?{}:{input:t.inputTokens},...t.cacheReadTokens===void 0?{}:{cacheRead:t.cacheReadTokens},...t.cacheWriteTokens===void 0?{}:{cacheWrite:t.cacheWriteTokens},...t.outputTokens===void 0?{}:{output:t.outputTokens},...t.reasoningTokens===void 0?{}:{reasoning:t.reasoningTokens}}}a(ua,"requestUsage");function pa(e,t){return t===void 0?e:{...e?.input===void 0&&t.input===void 0?{}:{input:(e?.input??0)+(t.input??0)},...e?.cacheRead===void 0&&t.cacheRead===void 0?{}:{cacheRead:(e?.cacheRead??0)+(t.cacheRead??0)},...e?.cacheWrite===void 0&&t.cacheWrite===void 0?{}:{cacheWrite:(e?.cacheWrite??0)+(t.cacheWrite??0)},...e?.output===void 0&&t.output===void 0?{}:{output:(e?.output??0)+(t.output??0)},...e?.reasoning===void 0&&t.reasoning===void 0?{}:{reasoning:(e?.reasoning??0)+(t.reasoning??0)}}}a(pa,"addUsage");function ha({useSession:e,useDuration:t,loadOlder:n,setActualDuration:s,inspect:r,onInspectDone:i,t:l}){const[u,p]=(0,b.useState)(oa),[f,m]=(0,b.useState)(ia),[h,x]=(0,b.useState)(null),v=t(j=>j),[T,k]=(0,b.useState)(!1),[S,w]=(0,b.useState)(""),[B]=(0,b.useState)(()=>new sa),[C,I]=(0,b.useState)(0),D=(0,b.useRef)(null),ee=(0,b.useRef)(!1),[E,xe]=(0,b.useState)(null),[g,y]=(0,b.useState)(null),[P,N]=(0,b.useState)(null),R=e(j=>j.views.get("trajectory")??Nn),se=e(j=>j.openState==="loading"),de=e(j=>j.loadingOlder),$=e(j=>j.hasMore),F=R.eventNodes,Fe=R.eventLocations,Xe=F[0]?.seq??0,be=R.partial,Pe=R.runningCalls,pe=R.requests,Ne=R.callSchemas,Ye=(0,b.useMemo)(()=>{const j=new Map;for(const O of F)O.kind!=="assistant"||O.step<=0||j.set(`${O.turn}\0${O.step}`,O);const oe=new Map(pe.filter(O=>O.purpose==="assistant").map(O=>[`${O.turn}\0${O.step}`,O])),W=[...pe.map(O=>({seq:O.startSeq,request:O,node:O.purpose==="assistant"?j.get(`${O.turn}\0${O.step}`):void 0})),...[...j.entries()].flatMap(([O,fe])=>oe.has(O)?[]:[{seq:fe.seq,request:void 0,node:fe}])].sort((O,fe)=>O.seq-fe.seq),ge=[];let U;for(const[O,fe]of W.entries()){const ie=ua(fe.request?.usage??fe.node?.usage);if(U=pa(U,ie),fe.request?.purpose!=="compaction"){const ae=fe.request,H=fe.node,rt=ae?.turn??H?.turn,mt=ae?.step??H?.step;if(rt===void 0||mt===void 0)continue;const gt=ae?.provenance?.provider??H?.provenance?.provider,vt=ae?.provenance?.model??H?.provenance?.model,xt=ae?.requestConfig??H?.requestConfig;ge.push({seq:fe.seq,turn:rt,step:mt,group:`Step ${mt}`,number:O+1,...ae?.status===void 0?{}:{status:ae.status},...ae?.startedAt===void 0?{}:{startedAt:ae.startedAt},...ae?.completedAt===void 0?{}:{completedAt:ae.completedAt},...ae?.error===void 0?{}:{error:ae.error},...ae?.resultSeq===void 0?{}:{resultSeq:ae.resultSeq},...ae?.retry===void 0?{}:{retry:ae.retry},...ae?.maxRetries===void 0?{}:{maxRetries:ae.maxRetries},...ae?.retryDelayMs===void 0?{}:{retryDelayMs:ae.retryDelayMs},...gt===void 0?{}:{provider:gt},...vt===void 0?{}:{model:vt},...xt===void 0?{}:{requestConfig:xt},...ie===void 0?{}:{usage:ie},...U===void 0?{}:{cumulativeUsage:U}});continue}const ve=fe.request;ge.push({seq:ve.startSeq,turn:ve.turn,step:0,group:`Compaction ${ve.startSeq}`,number:O+1,purpose:"compaction",status:ve.status,startedAt:ve.startedAt,completedAt:ve.completedAt,...ve.error===void 0?{}:{error:ve.error},resultSeq:ve.startSeq,...ve.provenance?.provider===void 0?{}:{provider:ve.provenance.provider},...ve.provenance?.model===void 0?{}:{model:ve.provenance.model},...ve.requestConfig===void 0?{}:{requestConfig:ve.requestConfig},...ie===void 0?{}:{usage:ie},...U===void 0?{}:{cumulativeUsage:U}})}return ge},[F,pe]),Ge=be?.turn??null,Ie=be?.step??null,we=(0,b.useMemo)(()=>{const j=fs({nodes:F,eventLocations:Fe,partial:Ge===null||Ie===null?null:{turn:Ge,step:Ie,blocks:[]},runningCalls:Pe,requests:pe,callSchemas:Ne});return{turns:j,lastIndex:la(j)}},[F,Fe,Ge,Ie,Pe,pe,Ne]),Je=da(be),tt=(0,b.useMemo)(()=>be===null?null:{turn:be.turn,step:be.step,blocks:be.blocks.map(j=>ca(j))},[Ie,Ge,Je]),ke=(0,b.useMemo)(()=>ms(we.turns,tt,we.lastIndex),[we,tt]),Re=v?T?"actual":"duration":T?"time":"sequence",z=(0,b.useMemo)(()=>ms([],be,we.lastIndex),[we.lastIndex,be]),V=(0,b.useMemo)(()=>[we.turns,z],[we,z]),M=(0,b.useRef)(V);M.current=V,(0,b.useEffect)(()=>{if(!ee.current){ee.current=!0,B.update(V)&&I(j=>j+1);return}D.current===null&&(D.current=setTimeout(()=>{D.current=null,B.update(M.current)&&I(j=>j+1)},aa))},[B,V]),(0,b.useEffect)(()=>()=>{D.current!==null&&clearTimeout(D.current)},[]);const q=(0,b.useMemo)(()=>z.flatMap(j=>j.groups.flatMap(oe=>oe.cells)),[z]),_=(0,b.useMemo)(()=>B.search(S),[B,C,S]),Z=(0,b.useMemo)(()=>{if(_===null)return null;const j=new Set;for(const oe of V)for(const W of oe)for(const ge of W.groups)for(const U of ge.cells)_.has(me(U))&&j.add(U.index);return j},[V,_]),X=h,re=(0,b.useMemo)(()=>X===null?null:Si(ke,X,Re),[Re,X,ke]),J=(0,b.useCallback)(j=>{re!==null&&!re.has(j)&&x(null)},[re]),le=(0,b.useCallback)(j=>{x(j)},[]),te=(0,b.useCallback)(j=>{x(null),y({index:j}),xe(j)},[]),he=(0,b.useCallback)(j=>{N({index:j})},[]),Ve=(0,b.useMemo)(()=>ke.filter(j=>j.turn!==null&&j.groups.reduce((oe,W)=>oe+W.cells.filter(ge=>ge.requestOnly!==!0&&ge.kind!=="system").length,0)>1).flatMap(j=>j.turn===null?[]:[j.turn]),[ke]),Me=Ve.length>0&&Ve.every(j=>u.has(j)),qe=(0,b.useMemo)(()=>{const j=[];for(const oe of ke){const W=oe.groups.flatMap(ge=>ge.cells);for(let ge=0;ge<W.length;ge++){const U=W[ge];if(U?.kind!=="message")continue;const O=W[ge+1];(O?.kind==="tool"||O?.kind==="subtool")&&j.push(me(U))}}return j},[ke]),Dt=qe.length>0&&qe.every(j=>f.has(j)),Ce=a(j=>{p(oe=>{const W=new Set(oe);return W.has(j)?W.delete(j):W.add(j),W})},"toggleTurn"),nt=a(()=>{p(j=>{const oe=new Set(j);if(Me)for(const W of Ve)oe.delete(W);else for(const W of Ve)oe.add(W);return oe})},"toggleAllTurns"),st=a(j=>{m(oe=>{const W=new Set(oe);return W.has(j)?W.delete(j):W.add(j),W})},"toggleAssistant"),Pt=a(()=>{m(j=>{const oe=new Set(j);if(Dt)for(const W of qe)oe.delete(W);else for(const W of qe)oe.add(W);return oe})},"toggleAllAssistants"),ft=(0,b.useCallback)(()=>n(),[n]);return(0,o.jsxs)("div",{className:Ts.root,"data-conversation-composer-overlay":"",children:[(0,o.jsx)(_i,{actualDuration:v,onActualDurationChange:a(j=>{s(j),x(null)},"onActualDurationChange"),actualTime:T,onActualTimeChange:a(j=>{k(j),x(null)},"onActualTimeChange"),allTurnsCollapsed:Me,onToggleAllTurns:nt,allAssistantsCollapsed:Dt,onToggleAllAssistants:Pt,searchQuery:S,onSearchQueryChange:w,t:l}),(0,o.jsx)(Pi,{turns:ke,mode:Re,range:X,hasEarlierRecords:$,onLoadEarlier:ft,selectedIndex:E,searchMatchIndexes:Z,onRangeChange:le,onRecordSelect:te,onRecordFocus:he}),(0,o.jsx)("div",{className:Ts.ledger,children:(0,o.jsx)(wi,{requestNumbers:Ye,turns:ke,streamingCells:q,timelineFocusIndexes:re,searchMatchIndexes:Z,onSelectedIndexChange:xe,onRecordSelect:J,recordSelection:g,recordFocus:P,historyLoading:se,olderHistoryLoading:de,historyStartSeq:Xe,hasOlderRecords:$,onLoadOlder:ft,onClearSelection:a(()=>{x(null)},"onClearSelection"),collapsedTurns:u,onToggleTurn:Ce,collapsedAssistants:f,onToggleAssistant:st,inspectCallId:r?.callId??null,onInspectApplied:i})})]})}a(ha,"TrajectoryView");const fa=["slots","conversationEvents","conversationViews","sessions","locale"];function ma(e){e.effect(()=>e.locale.register(Wt,{zh:Xs,en:Ys}),"ui-trajectory: dictionaries");const t=e.locale.bind(Wt),n=Fs();pr(e),gr(e),sr(e),Dr(e),lr(e),Sr(e),e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"trajectory",order:10,locale:Wt,label:a(()=>t("view.trajectory"),"label"),inject:a(s=>{const r=e.sessions.binding(s)?.session;if(r===void 0)throw new Error(`ui-trajectory: session "${s}" is unavailable`);return{hooks:{duration:n},loadOlder:a(async()=>{const i=r.getSnapshot().views.get("trajectory");return await r.loadOlder(),r.getSnapshot().views.get("trajectory")!==i},"loadOlder"),setActualDuration:a(i=>{n.set(i)},"setActualDuration")}},"inject")},ha))}return a(ma,"apply"),zt.apply=ma,zt.inject=fa,wt.exports},"factory")});
|