vite-hub 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +178 -26
- package/dist/_internal/agent/eve.d.ts +1 -0
- package/dist/_internal/agent/eve.js +2 -0
- package/dist/_internal/agent/invocations.d.ts +2 -0
- package/dist/_internal/agent/invocations.js +88 -0
- package/dist/_internal/agent/operations.d.ts +1 -0
- package/dist/_internal/agent/operations.js +2 -0
- package/dist/_internal/agent/runtime/invocations-dev.d.ts +1 -0
- package/dist/_internal/agent/runtime/invocations-dev.js +2 -0
- package/dist/_internal/agent/runtime/process.d.ts +1 -0
- package/dist/_internal/agent/runtime/process.js +2 -0
- package/dist/_internal/agent/server/registry.d.ts +1 -0
- package/dist/_internal/agent/server/registry.js +2 -0
- package/dist/_internal/auth/runtime/console.d.ts +1 -0
- package/dist/_internal/auth/runtime/console.js +2 -0
- package/dist/_internal/blob/operations.d.ts +1 -0
- package/dist/_internal/blob/operations.js +2 -0
- package/dist/_internal/comments/operations.d.ts +1 -0
- package/dist/_internal/comments/operations.js +2 -0
- package/dist/_internal/comments/runtime/console.d.ts +1 -0
- package/dist/_internal/comments/runtime/console.js +2 -0
- package/dist/_internal/content/operations.d.ts +1 -0
- package/dist/_internal/content/operations.js +2 -0
- package/dist/_internal/content/runtime/console.d.ts +1 -0
- package/dist/_internal/content/runtime/console.js +2 -0
- package/dist/_internal/database/runtime/state.d.ts +5 -0
- package/dist/_internal/database/runtime/state.js +7 -0
- package/dist/_internal/email/operations.d.ts +1 -0
- package/dist/_internal/email/operations.js +2 -0
- package/dist/_internal/email/runtime/console.d.ts +1 -0
- package/dist/_internal/email/runtime/console.js +2 -0
- package/dist/_internal/kv/operations.d.ts +1 -0
- package/dist/_internal/kv/operations.js +2 -0
- package/dist/_internal/kv/runtime/disabled-upstash.d.ts +2 -3
- package/dist/_internal/kv/runtime/disabled-upstash.js +2 -1
- package/dist/_internal/queue/operations.d.ts +1 -0
- package/dist/_internal/queue/operations.js +2 -0
- package/dist/_internal/rate-limit/operations.d.ts +1 -0
- package/dist/_internal/rate-limit/operations.js +2 -0
- package/dist/_internal/sandbox/task/runtime/state.d.ts +1 -0
- package/dist/_internal/sandbox/task/runtime/state.js +2 -0
- package/dist/_internal/schedule/operations.d.ts +1 -0
- package/dist/_internal/schedule/operations.js +2 -0
- package/dist/_internal/schedule/runtime/kv.d.ts +1 -0
- package/dist/_internal/schedule/runtime/kv.js +2 -0
- package/dist/_internal/task/operations.d.ts +5 -0
- package/dist/_internal/task/operations.js +2 -0
- package/dist/_internal/workflow/operations.d.ts +1 -0
- package/dist/_internal/workflow/operations.js +2 -0
- package/dist/_internal/workflow/runtime/cloudflare-runner.d.ts +1 -0
- package/dist/_internal/workflow/runtime/cloudflare-runner.js +2 -0
- package/dist/_internal/workflow/runtime/cloudflare-vite.d.ts +1 -0
- package/dist/_internal/workflow/runtime/cloudflare-vite.js +2 -0
- package/dist/_internal/workflow/runtime/vercel-vite.d.ts +1 -0
- package/dist/_internal/workflow/runtime/vercel-vite.js +2 -0
- package/dist/_internal/workspace/operations.d.ts +1 -0
- package/dist/_internal/workspace/operations.js +2 -0
- package/dist/access-BhTe9yuV.js +516 -0
- package/dist/access-CBqnsYdj.d.ts +130 -0
- package/dist/agent/capabilities.d.ts +24 -1
- package/dist/agent/capabilities.js +56 -1
- package/dist/agent/invocations/d1.d.ts +1 -0
- package/dist/agent/invocations/d1.js +2 -0
- package/dist/agent/invocations/database.d.ts +2 -0
- package/dist/agent/invocations/database.js +91 -0
- package/dist/agent/invocations/sqlite.d.ts +1 -0
- package/dist/agent/invocations/sqlite.js +2 -0
- package/dist/agent/mcp.d.ts +1 -0
- package/dist/agent/mcp.js +2 -0
- package/dist/agent/observability.d.ts +1 -0
- package/dist/agent/observability.js +2 -0
- package/dist/agent/process-host.d.ts +1 -0
- package/dist/agent/process-host.js +2 -0
- package/dist/agent/runtime/process.d.ts +1 -0
- package/dist/agent/runtime/process.js +2 -0
- package/dist/agent/server/github.d.ts +1 -0
- package/dist/agent/server/github.js +2 -0
- package/dist/agent/vite.d.ts +1 -0
- package/dist/agent/vite.js +2 -0
- package/dist/agent/vue.d.ts +1 -0
- package/dist/agent/vue.js +2 -0
- package/dist/agent-invocations.post-CFKMEy-h.js +432 -0
- package/dist/agent.d.ts +12 -1
- package/dist/agent.js +49 -1
- package/dist/agents-BNmuN4Qa.d.ts +99 -0
- package/dist/agents-CVehuMFA.js +118 -0
- package/dist/auth/console-runtime.d.ts +1 -0
- package/dist/auth/console-runtime.js +2 -0
- package/dist/auth/console.d.ts +1 -0
- package/dist/auth/console.js +2 -0
- package/dist/auth/presets.d.ts +1 -0
- package/dist/auth/presets.js +2 -0
- package/dist/auth/vue.d.ts +1 -0
- package/dist/auth/vue.js +2 -0
- package/dist/auth-BSSM-qh0.js +700 -0
- package/dist/auth-CG8tmgH7.d.ts +106 -0
- package/dist/auth-cloudflare-access-CE8xUzhY.d.ts +50 -0
- package/dist/auth-inline-config--vlclzm3.js +18 -0
- package/dist/auth-inline-config-R6q_4Iwo.d.ts +30 -0
- package/dist/auth-path-B7Ssonj-.js +49 -0
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +346 -7
- package/dist/blob/client.d.ts +1 -0
- package/dist/blob/client.js +2 -0
- package/dist/blob/media.d.ts +1 -0
- package/dist/blob/media.js +2 -0
- package/dist/blob/vue.d.ts +1 -0
- package/dist/blob/vue.js +2 -0
- package/dist/blob-D9v5Djxw.d.ts +7 -0
- package/dist/browser/actions.d.ts +1 -0
- package/dist/browser/actions.js +2 -0
- package/dist/channels/server.d.ts +1 -0
- package/dist/channels/server.js +2 -0
- package/dist/channels.d.ts +1 -0
- package/dist/channels.js +2 -0
- package/dist/cloudflare-env-CIZCKabz.js +70 -0
- package/dist/cloudflare-prerender.mjs +24 -0
- package/dist/cloudflare-types.d.ts +1 -0
- package/dist/comments/anchor.d.ts +1 -0
- package/dist/comments/anchor.js +2 -0
- package/dist/comments/client.d.ts +1 -0
- package/dist/comments/client.js +2 -0
- package/dist/comments/database/postgres.d.ts +1 -0
- package/dist/comments/database/postgres.js +2 -0
- package/dist/comments/database.d.ts +1 -0
- package/dist/comments/database.js +2 -0
- package/dist/comments/realtime.d.ts +1 -0
- package/dist/comments/realtime.js +2 -0
- package/dist/comments/rpc.d.ts +1 -0
- package/dist/comments/rpc.js +2 -0
- package/dist/comments/runtime/auth.d.ts +1 -0
- package/dist/comments/runtime/auth.js +2 -0
- package/dist/comments/runtime.d.ts +1 -0
- package/dist/comments/runtime.js +2 -0
- package/dist/comments/server.d.ts +1 -0
- package/dist/comments/server.js +2 -0
- package/dist/comments-overlay/loader.BcGn0Hsk.js +1 -0
- package/dist/comments-overlay/overlay.D7vmaSrE.js +2 -0
- package/dist/comments.d.ts +1 -0
- package/dist/comments.js +2 -0
- package/dist/connections/agent.d.ts +1 -0
- package/dist/connections/agent.js +2 -0
- package/dist/connections/chatgpt.d.ts +1 -0
- package/dist/connections/chatgpt.js +2 -0
- package/dist/connections/google.d.ts +1 -0
- package/dist/connections/google.js +2 -0
- package/dist/connections/http.d.ts +1 -0
- package/dist/connections/http.js +2 -0
- package/dist/connections/server.d.ts +1 -0
- package/dist/connections/server.js +2 -0
- package/dist/connections.d.ts +1 -0
- package/dist/connections.js +2 -0
- package/dist/console/auth-client.d.ts +8 -0
- package/dist/console/auth-client.js +6 -0
- package/dist/console/auth-cloudflare-access.d.ts +2 -0
- package/dist/console/auth-cloudflare-access.js +116 -0
- package/dist/console/auth-inline.d.ts +6 -0
- package/dist/console/auth-inline.js +107 -0
- package/dist/console/auth.d.ts +2 -0
- package/dist/console/auth.js +2 -0
- package/dist/console/runtime/client/appearance.d.ts +62 -0
- package/dist/console/runtime/client/appearance.js +87 -0
- package/dist/console/runtime/client/auth-management.ts +81 -0
- package/dist/console/runtime/client/blob-media.d.ts +46 -0
- package/dist/console/runtime/client/blob-media.js +257 -0
- package/dist/console/runtime/client/build.d.ts +14 -0
- package/dist/console/runtime/client/build.js +68 -0
- package/dist/console/runtime/client/connections-management.d.ts +68 -0
- package/dist/console/runtime/client/connections-management.js +201 -0
- package/dist/console/runtime/client/documents.d.ts +430 -0
- package/dist/console/runtime/client/documents.js +501 -0
- package/dist/console/runtime/client/editor.d.ts +82 -0
- package/dist/console/runtime/client/editor.js +248 -0
- package/dist/console/runtime/client/env-groups.d.ts +28 -0
- package/dist/console/runtime/client/env-groups.js +39 -0
- package/dist/console/runtime/client/env-management.d.ts +20 -0
- package/dist/console/runtime/client/env-management.js +84 -0
- package/dist/console/runtime/client/env-status.d.ts +6 -0
- package/dist/console/runtime/client/env-status.js +10 -0
- package/dist/console/runtime/client/format.d.ts +32 -0
- package/dist/console/runtime/client/format.js +109 -0
- package/dist/console/runtime/client/invocation-deletion.d.ts +17 -0
- package/dist/console/runtime/client/invocation-deletion.js +25 -0
- package/dist/console/runtime/client/invocation.d.ts +28 -0
- package/dist/console/runtime/client/invocation.js +81 -0
- package/dist/console/runtime/client/live.d.ts +69 -0
- package/dist/console/runtime/client/live.js +165 -0
- package/dist/console/runtime/client/mcp.d.ts +9 -0
- package/dist/console/runtime/client/mcp.js +14 -0
- package/dist/console/runtime/client/media-library.d.ts +207 -0
- package/dist/console/runtime/client/media-library.js +243 -0
- package/dist/console/runtime/client/media-uploads.d.ts +33 -0
- package/dist/console/runtime/client/media-uploads.js +97 -0
- package/dist/console/runtime/client/media.d.ts +73 -0
- package/dist/console/runtime/client/media.js +13 -0
- package/dist/console/runtime/client/operation-view.d.ts +17 -0
- package/dist/console/runtime/client/operation-view.js +85 -0
- package/dist/console/runtime/client/presence.d.ts +102 -0
- package/dist/console/runtime/client/presence.js +269 -0
- package/dist/console/runtime/client/preview.d.ts +78 -0
- package/dist/console/runtime/client/preview.js +115 -0
- package/dist/console/runtime/client/problem.d.ts +19 -0
- package/dist/console/runtime/client/problem.js +59 -0
- package/dist/console/runtime/client/publish.d.ts +12 -0
- package/dist/console/runtime/client/publish.js +18 -0
- package/dist/console/runtime/client/rate-limit.d.ts +36 -0
- package/dist/console/runtime/client/rate-limit.js +96 -0
- package/dist/console/runtime/client/read-only.d.ts +9 -0
- package/dist/console/runtime/client/read-only.js +12 -0
- package/dist/console/runtime/client/request.d.ts +76 -0
- package/dist/console/runtime/client/request.js +471 -0
- package/dist/console/runtime/client/schedule-run.d.ts +13 -0
- package/dist/console/runtime/client/schedule-run.js +47 -0
- package/dist/console/runtime/client/schema-form.d.ts +2 -0
- package/dist/console/runtime/client/schema-form.js +296 -0
- package/dist/console/runtime/client/sections.d.ts +26 -0
- package/dist/console/runtime/client/sections.js +84 -0
- package/dist/console/runtime/client/sign-in.d.ts +21 -0
- package/dist/console/runtime/client/sign-in.js +16 -0
- package/dist/console/runtime/client/time.d.ts +30 -0
- package/dist/console/runtime/client/time.js +106 -0
- package/dist/console/runtime/client/toast.d.ts +39 -0
- package/dist/console/runtime/client/toast.js +35 -0
- package/dist/console/runtime/client/workflow.d.ts +20 -0
- package/dist/console/runtime/client/workflow.js +79 -0
- package/dist/console/runtime/components/console-agent-list.ts +61 -0
- package/dist/console/runtime/components/console-app.vue +1755 -0
- package/dist/console/runtime/components/console-auth-action.vue +239 -0
- package/dist/console/runtime/components/console-auth-activity.vue +166 -0
- package/dist/console/runtime/components/console-auth-chart.vue +102 -0
- package/dist/console/runtime/components/console-auth-detail.vue +406 -0
- package/dist/console/runtime/components/console-auth-event-list.vue +79 -0
- package/dist/console/runtime/components/console-auth-event-setup.vue +39 -0
- package/dist/console/runtime/components/console-auth-overview.vue +107 -0
- package/dist/console/runtime/components/console-auth-user-events.vue +65 -0
- package/dist/console/runtime/components/console-auth.vue +649 -0
- package/dist/console/runtime/components/console-blob-detail.vue +93 -0
- package/dist/console/runtime/components/console-blob.vue +146 -0
- package/dist/console/runtime/components/console-comark-component.vue +108 -0
- package/dist/console/runtime/components/console-connect-agent.vue +59 -0
- package/dist/console/runtime/components/console-connection-state.vue +43 -0
- package/dist/console/runtime/components/console-connection.ts +18 -0
- package/dist/console/runtime/components/console-connections-activity.vue +76 -0
- package/dist/console/runtime/components/console-connections-approvals.vue +169 -0
- package/dist/console/runtime/components/console-connections-details.vue +295 -0
- package/dist/console/runtime/components/console-connections.vue +296 -0
- package/dist/console/runtime/components/console-database-model.ts +264 -0
- package/dist/console/runtime/components/console-database.vue +634 -0
- package/dist/console/runtime/components/console-definitions.vue +506 -0
- package/dist/console/runtime/components/console-document-dashboard.vue +492 -0
- package/dist/console/runtime/components/console-document-diff.vue +43 -0
- package/dist/console/runtime/components/console-document-editor.vue +2605 -0
- package/dist/console/runtime/components/console-document-history.vue +118 -0
- package/dist/console/runtime/components/console-document-list.vue +577 -0
- package/dist/console/runtime/components/console-document-preview.vue +422 -0
- package/dist/console/runtime/components/console-document-settings.vue +108 -0
- package/dist/console/runtime/components/console-documents.vue +480 -0
- package/dist/console/runtime/components/console-env-access.vue +151 -0
- package/dist/console/runtime/components/console-env-activity.vue +89 -0
- package/dist/console/runtime/components/console-env-details.vue +68 -0
- package/dist/console/runtime/components/console-env-managed.vue +203 -0
- package/dist/console/runtime/components/console-env.vue +301 -0
- package/dist/console/runtime/components/console-frame.vue +255 -0
- package/dist/console/runtime/components/console-home.vue +627 -0
- package/dist/console/runtime/components/console-invocation-composer.vue +159 -0
- package/dist/console/runtime/components/console-kv.vue +537 -0
- package/dist/console/runtime/components/console-loading.vue +28 -0
- package/dist/console/runtime/components/console-mark.vue +5 -0
- package/dist/console/runtime/components/console-markdown-editor.vue +705 -0
- package/dist/console/runtime/components/console-media-browser.vue +986 -0
- package/dist/console/runtime/components/console-media-crops.vue +167 -0
- package/dist/console/runtime/components/console-media-detail.vue +282 -0
- package/dist/console/runtime/components/console-media-dialog.vue +74 -0
- package/dist/console/runtime/components/console-media-field.vue +185 -0
- package/dist/console/runtime/components/console-media-focal.vue +137 -0
- package/dist/console/runtime/components/console-media-library.vue +125 -0
- package/dist/console/runtime/components/console-media-move.vue +160 -0
- package/dist/console/runtime/components/console-media-picker.vue +167 -0
- package/dist/console/runtime/components/console-media-uploads.vue +72 -0
- package/dist/console/runtime/components/console-new-chat.ts +27 -0
- package/dist/console/runtime/components/console-operation-view.vue +114 -0
- package/dist/console/runtime/components/console-page-header.vue +50 -0
- package/dist/console/runtime/components/console-page-toolbar.vue +28 -0
- package/dist/console/runtime/components/console-presence-avatars.vue +73 -0
- package/dist/console/runtime/components/console-property-list.vue +36 -0
- package/dist/console/runtime/components/console-property-row.vue +58 -0
- package/dist/console/runtime/components/console-rail.vue +392 -0
- package/dist/console/runtime/components/console-rate-limit.vue +167 -0
- package/dist/console/runtime/components/console-relative-time.vue +74 -0
- package/dist/console/runtime/components/console-schema-field.vue +504 -0
- package/dist/console/runtime/components/console-schema-form.vue +77 -0
- package/dist/console/runtime/components/console-schema-list.vue +158 -0
- package/dist/console/runtime/components/console-search.vue +851 -0
- package/dist/console/runtime/components/console-section-icon.vue +21 -0
- package/dist/console/runtime/components/console-seo-panel.vue +261 -0
- package/dist/console/runtime/components/console-session-actions.vue +160 -0
- package/dist/console/runtime/components/console-session-bootstrap.ts +112 -0
- package/dist/console/runtime/components/console-session-cancel.vue +90 -0
- package/dist/console/runtime/components/console-session-code-language.ts +32 -0
- package/dist/console/runtime/components/console-session-code-preview.vue +94 -0
- package/dist/console/runtime/components/console-session-inspector.vue +763 -0
- package/dist/console/runtime/components/console-session-loading.vue +116 -0
- package/dist/console/runtime/components/console-session-navbar.vue +159 -0
- package/dist/console/runtime/components/console-session-trace-model.ts +414 -0
- package/dist/console/runtime/components/console-session-trace.vue +693 -0
- package/dist/console/runtime/components/console-session.css +1745 -0
- package/dist/console/runtime/components/console-setup-hint.vue +20 -0
- package/dist/console/runtime/components/console-state.vue +165 -0
- package/dist/console/runtime/components/console-status.vue +25 -0
- package/dist/console/runtime/components/console-toaster.vue +66 -0
- package/dist/console/runtime/components/console-usage-chart.vue +208 -0
- package/dist/console/runtime/components/console-usage-model-detail.vue +144 -0
- package/dist/console/runtime/components/console-usage-model.ts +368 -0
- package/dist/console/runtime/components/console-usage-share-bar.vue +48 -0
- package/dist/console/runtime/components/console-usage.vue +879 -0
- package/dist/console/runtime/components/console-value.vue +35 -0
- package/dist/console/runtime/components/console-workflow-actions.vue +183 -0
- package/dist/console/runtime/components/console-workspace-file.ts +12 -0
- package/dist/console/runtime/components/console-workspace-history.vue +77 -0
- package/dist/console/runtime/components/console-wrap.ts +10 -0
- package/dist/console/runtime/components/invocation/agent-capability-inspector.ts +166 -0
- package/dist/console/runtime/components/invocation/agent-invocation-list.ts +276 -0
- package/dist/console/runtime/components/invocation/agent-invocation-timeline.ts +120 -0
- package/dist/console/runtime/components/invocation/agent-invocation.ts +1968 -0
- package/dist/console/runtime/components/invocation/index.ts +8 -0
- package/dist/console/runtime/components/invocation/internal/brand-icons.ts +65 -0
- package/dist/console/runtime/components/invocation/internal/channel-icon.ts +51 -0
- package/dist/console/runtime/components/invocation/internal/invocation-activity.ts +663 -0
- package/dist/console/runtime/components/invocation/internal/invocation-brand.ts +148 -0
- package/dist/console/runtime/components/invocation/internal/invocation-conversation.ts +162 -0
- package/dist/console/runtime/components/invocation/internal/payload-text.ts +29 -0
- package/dist/console/runtime/components/invocation/internal/runtime-type.ts +61 -0
- package/dist/console/runtime/components/invocation/internal/url.ts +8 -0
- package/dist/console/runtime/components/invocation/invocation-display.ts +56 -0
- package/dist/console/runtime/components/invocation/invocation.css +2748 -0
- package/dist/console/runtime/components/invocation/nuxt/AgentInvocation.ts +1 -0
- package/dist/console/runtime/components/invocation/nuxt/AgentInvocationInspector.ts +1 -0
- package/dist/console/runtime/components/invocation/nuxt/AgentInvocationList.ts +1 -0
- package/dist/console/runtime/components/invocation/types.ts +89 -0
- package/dist/console/runtime/console-route.d.ts +16 -0
- package/dist/console/runtime/console-route.js +49 -0
- package/dist/console/runtime/definitions.d.ts +2 -0
- package/dist/console/runtime/definitions.js +294 -0
- package/dist/console/runtime/page/loader.js +22 -0
- package/dist/console/runtime/public/console/assets/console-app-CUTwptGe.css +1 -0
- package/dist/console/runtime/public/console/assets/console-auth-B_XoOPaB.css +1 -0
- package/dist/console/runtime/public/console/assets/console-database-BbZ7J_Mh.css +1 -0
- package/dist/console/runtime/public/console/assets/console-documents-BV1adqXa.css +1 -0
- package/dist/console/runtime/public/console/assets/console-home-DYNL7OZH.css +1 -0
- package/dist/console/runtime/public/console/assets/console-logs-BJxR8DcR.css +1 -0
- package/dist/console/runtime/public/console/assets/console-media-browser-Dqm8kLKS.css +1 -0
- package/dist/console/runtime/public/console/assets/console-search-DnK-eWOO.css +1 -0
- package/dist/console/runtime/public/console/assets/katex-BztabbvB.css +1 -0
- package/dist/console/runtime/public/console/chunks/Alert-A44KLyli.js +111 -0
- package/dist/console/runtime/public/console/chunks/Button-B-5IVAVN.js +1 -0
- package/dist/console/runtime/public/console/chunks/Checkbox-B6MMrqB7.js +1 -0
- package/dist/console/runtime/public/console/chunks/DashboardSidebar-D1tMg0lD.js +1 -0
- package/dist/console/runtime/public/console/chunks/Empty-DSuwpzRi.js +1 -0
- package/dist/console/runtime/public/console/chunks/FormField-C1QuQLPv.js +1 -0
- package/dist/console/runtime/public/console/chunks/Icon-DDNuGxPl.js +1 -0
- package/dist/console/runtime/public/console/chunks/Modal-BCfHPiul.js +1 -0
- package/dist/console/runtime/public/console/chunks/Popover-BIzgqwDJ.js +1 -0
- package/dist/console/runtime/public/console/chunks/RovingFocusItem-BQiInss6.js +1 -0
- package/dist/console/runtime/public/console/chunks/Select-CLtjSqJ4.js +1 -0
- package/dist/console/runtime/public/console/chunks/Slideover-CHzYTMLO.js +1 -0
- package/dist/console/runtime/public/console/chunks/Switch-0VgVgteh.js +1 -0
- package/dist/console/runtime/public/console/chunks/Table-dr_6Rarq.js +4 -0
- package/dist/console/runtime/public/console/chunks/Tabs-BbKlHRNF.js +1 -0
- package/dist/console/runtime/public/console/chunks/Textarea-DEoHK30I.js +1 -0
- package/dist/console/runtime/public/console/chunks/abap-CLvhMVsD.js +1 -0
- package/dist/console/runtime/public/console/chunks/actionscript-3-Cs6JJXT5.js +1 -0
- package/dist/console/runtime/public/console/chunks/ada-X3Y2mlq2.js +1 -0
- package/dist/console/runtime/public/console/chunks/ahk-DwADkxyd.js +1 -0
- package/dist/console/runtime/public/console/chunks/ahk2-_6rzW9BS.js +1 -0
- package/dist/console/runtime/public/console/chunks/andromeeda-BASpqCeJ-vGVdxbeo.js +1 -0
- package/dist/console/runtime/public/console/chunks/andromeeda-vGVdxbeo.js +1 -0
- package/dist/console/runtime/public/console/chunks/angular-html-_r0QlJAV.js +1 -0
- package/dist/console/runtime/public/console/chunks/angular-ts-BdSNcv2x.js +1 -0
- package/dist/console/runtime/public/console/chunks/apache-U0d_L8uA.js +1 -0
- package/dist/console/runtime/public/console/chunks/apex-KFGFyKwG.js +1 -0
- package/dist/console/runtime/public/console/chunks/apl-CD0B-dgl.js +1 -0
- package/dist/console/runtime/public/console/chunks/applescript-CCn79oCD.js +1 -0
- package/dist/console/runtime/public/console/chunks/ara-4CJ0cIlV.js +1 -0
- package/dist/console/runtime/public/console/chunks/asciidoc-SCjQUq34.js +1 -0
- package/dist/console/runtime/public/console/chunks/asm-Cmm7eHzH.js +1 -0
- package/dist/console/runtime/public/console/chunks/astro-BuBCLsVb.js +1 -0
- package/dist/console/runtime/public/console/chunks/aurora-x-CDeNXAV0.js +1 -0
- package/dist/console/runtime/public/console/chunks/aurora-x-DugsLcii-CDeNXAV0.js +1 -0
- package/dist/console/runtime/public/console/chunks/awk-BWXHIvNe.js +1 -0
- package/dist/console/runtime/public/console/chunks/ayu-dark-BT3qdi3o-DluEY0Gj.js +1 -0
- package/dist/console/runtime/public/console/chunks/ayu-dark-DluEY0Gj.js +1 -0
- package/dist/console/runtime/public/console/chunks/ayu-light-BVZyHoh9-C3h-C4tm.js +1 -0
- package/dist/console/runtime/public/console/chunks/ayu-light-C3h-C4tm.js +1 -0
- package/dist/console/runtime/public/console/chunks/ayu-mirage-Bqwy1Gya.js +1 -0
- package/dist/console/runtime/public/console/chunks/ayu-mirage-XFwUVZQZ-Bqwy1Gya.js +1 -0
- package/dist/console/runtime/public/console/chunks/ballerina-B7ZEbQpA.js +1 -0
- package/dist/console/runtime/public/console/chunks/bat-qdxAdBWQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/beancount-C2IN4Vk8.js +1 -0
- package/dist/console/runtime/public/console/chunks/berry-DKpUyyne.js +1 -0
- package/dist/console/runtime/public/console/chunks/bibtex-Ci_nEsc7.js +1 -0
- package/dist/console/runtime/public/console/chunks/bicep-CUHmPFLl.js +1 -0
- package/dist/console/runtime/public/console/chunks/bird2-CYIUgYqB.js +1 -0
- package/dist/console/runtime/public/console/chunks/blade-3tdbLOEu.js +1 -0
- package/dist/console/runtime/public/console/chunks/bsl-_VjlB9mv.js +1 -0
- package/dist/console/runtime/public/console/chunks/c-C1MtNG6h.js +1 -0
- package/dist/console/runtime/public/console/chunks/c3-D0apG41V.js +1 -0
- package/dist/console/runtime/public/console/chunks/cadence-CQ2zXKGN.js +1 -0
- package/dist/console/runtime/public/console/chunks/cairo-DLTphjLi.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-frappe-C9Q5zVZY.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-frappe-D20KODDN-C9Q5zVZY.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-latte-CtsyrtPq.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-latte-eGLVHIUJ-CtsyrtPq.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-macchiato-R8nAf1vR.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-macchiato-bQGch4PY-R8nAf1vR.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-mocha-Bes8-0Mr-DjuaAJKi.js +1 -0
- package/dist/console/runtime/public/console/chunks/catppuccin-mocha-DjuaAJKi.js +1 -0
- package/dist/console/runtime/public/console/chunks/chapel-BzgYECs1.js +1 -0
- package/dist/console/runtime/public/console/chunks/clarity-CtfBBspg.js +1 -0
- package/dist/console/runtime/public/console/chunks/clojure-DqKBuwfJ.js +1 -0
- package/dist/console/runtime/public/console/chunks/cmake-Bj61d0ZC.js +1 -0
- package/dist/console/runtime/public/console/chunks/cobol-DObdkphG.js +1 -0
- package/dist/console/runtime/public/console/chunks/code-view-J4OsgEdh-B89t0LaT.js +2 -0
- package/dist/console/runtime/public/console/chunks/codeowners-C8r90Shi.js +1 -0
- package/dist/console/runtime/public/console/chunks/codeql-oeQT6MSM.js +1 -0
- package/dist/console/runtime/public/console/chunks/coffee-C94_xO1a.js +1 -0
- package/dist/console/runtime/public/console/chunks/common-lisp-Cv5bFMCO.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-app-C50IIheA.js +85 -0
- package/dist/console/runtime/public/console/chunks/console-auth-D4zc7Haw.js +2 -0
- package/dist/console/runtime/public/console/chunks/console-blob-CAJwJy4D.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-channels-DZQwinKY.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-connections-Buk5WGxr.js +6 -0
- package/dist/console/runtime/public/console/chunks/console-database-CKc8H8FN.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-definitions-NriWGCYI.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-documents-BnBRfM_7.js +314 -0
- package/dist/console/runtime/public/console/chunks/console-env-CLmYhbox.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-home-smb5yMSF.js +2 -0
- package/dist/console/runtime/public/console/chunks/console-kv-B1tLQHM9.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-logs-CjxEiek5.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-media-browser-o4BQu9KZ.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-operation-view-CGxpuMSQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-page-header-DDAcJBpl.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-page-toolbar-CvYwaKTR.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-property-list-96rL7wos.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-relative-time-RB6-yiul.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-search-D4EVLUeN.js +5 -0
- package/dist/console/runtime/public/console/chunks/console-setup-hint-8TRzgkby.js +1 -0
- package/dist/console/runtime/public/console/chunks/console-status-DH5NgNAQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/coq-CGaSfhwR.js +1 -0
- package/dist/console/runtime/public/console/chunks/core-CD3So4L1.js +12 -0
- package/dist/console/runtime/public/console/chunks/cpp-DMjdIJj9.js +1 -0
- package/dist/console/runtime/public/console/chunks/crystal-Czr8rWWf.js +1 -0
- package/dist/console/runtime/public/console/chunks/csharp-dmMxLVLW.js +1 -0
- package/dist/console/runtime/public/console/chunks/css-B6l3ejVl.js +1 -0
- package/dist/console/runtime/public/console/chunks/css-BDmUYLyz.js +1 -0
- package/dist/console/runtime/public/console/chunks/csv-Dx-8-gkx.js +1 -0
- package/dist/console/runtime/public/console/chunks/cue-CE9AQfxI.js +1 -0
- package/dist/console/runtime/public/console/chunks/cypher-ClKdZ_lG.js +1 -0
- package/dist/console/runtime/public/console/chunks/d-qD-0Kul2.js +1 -0
- package/dist/console/runtime/public/console/chunks/dark-plus-BGuiqa1B-Cs2F2srj.js +1 -0
- package/dist/console/runtime/public/console/chunks/dark-plus-Cs2F2srj.js +1 -0
- package/dist/console/runtime/public/console/chunks/dart-CHZY9Xhz.js +1 -0
- package/dist/console/runtime/public/console/chunks/dax-BkyTk9wS.js +1 -0
- package/dist/console/runtime/public/console/chunks/defu-DSJ9I3OW.js +1 -0
- package/dist/console/runtime/public/console/chunks/desktop-Dlh5hvp9.js +1 -0
- package/dist/console/runtime/public/console/chunks/diff-woXpYk--.js +1 -0
- package/dist/console/runtime/public/console/chunks/dist-Cfws9tG7.js +1 -0
- package/dist/console/runtime/public/console/chunks/docker-sj3NF4m5.js +1 -0
- package/dist/console/runtime/public/console/chunks/dockerfile-C147k2YT.js +1 -0
- package/dist/console/runtime/public/console/chunks/dotenv-CuH5my32.js +1 -0
- package/dist/console/runtime/public/console/chunks/dracula-0CVA2XY5-BHWKrbxM.js +1 -0
- package/dist/console/runtime/public/console/chunks/dracula-BHWKrbxM.js +1 -0
- package/dist/console/runtime/public/console/chunks/dracula-soft-5eyTD99u.js +1 -0
- package/dist/console/runtime/public/console/chunks/dracula-soft-Dk9bpbVU-5eyTD99u.js +1 -0
- package/dist/console/runtime/public/console/chunks/dream-maker-DW3nJb8Q.js +1 -0
- package/dist/console/runtime/public/console/chunks/edge-D8F7z1FE.js +1 -0
- package/dist/console/runtime/public/console/chunks/elixir-DH2VBix4.js +1 -0
- package/dist/console/runtime/public/console/chunks/elm-D2qVkg3B.js +1 -0
- package/dist/console/runtime/public/console/chunks/emacs-lisp-DR2vtWaj.js +1 -0
- package/dist/console/runtime/public/console/chunks/engine-compile-DS_05kfr.js +141 -0
- package/dist/console/runtime/public/console/chunks/engine-javascript-Dymre4AG.js +1 -0
- package/dist/console/runtime/public/console/chunks/env-management-CNydNlRX.js +1 -0
- package/dist/console/runtime/public/console/chunks/erb-B_-2w0Bg.js +1 -0
- package/dist/console/runtime/public/console/chunks/erlang-Cphh6RMH.js +1 -0
- package/dist/console/runtime/public/console/chunks/everforest-dark-CRjTbhh5-sB-x3p7T.js +1 -0
- package/dist/console/runtime/public/console/chunks/everforest-dark-sB-x3p7T.js +1 -0
- package/dist/console/runtime/public/console/chunks/everforest-light-CEeYFLn8-Df2xbC6M.js +1 -0
- package/dist/console/runtime/public/console/chunks/everforest-light-Df2xbC6M.js +1 -0
- package/dist/console/runtime/public/console/chunks/fennel-DQxkIbk2.js +1 -0
- package/dist/console/runtime/public/console/chunks/field-a8AvhnKh-Da49LBBi.js +1 -0
- package/dist/console/runtime/public/console/chunks/file-tree-2PXztdQ7.js +1266 -0
- package/dist/console/runtime/public/console/chunks/fish-BJitypiv.js +1 -0
- package/dist/console/runtime/public/console/chunks/fluent-C03EYrpw.js +1 -0
- package/dist/console/runtime/public/console/chunks/format-Bm0hCiYP.js +1 -0
- package/dist/console/runtime/public/console/chunks/fortran-fixed-form-DEKoE2YW.js +1 -0
- package/dist/console/runtime/public/console/chunks/fortran-free-form-CYNrtFtB.js +1 -0
- package/dist/console/runtime/public/console/chunks/fsharp-D13ZGOAj.js +1 -0
- package/dist/console/runtime/public/console/chunks/gdresource-xMC7jr7x.js +1 -0
- package/dist/console/runtime/public/console/chunks/gdscript-DYvRD3hg.js +1 -0
- package/dist/console/runtime/public/console/chunks/gdshader-CBce3t8t.js +1 -0
- package/dist/console/runtime/public/console/chunks/genie-CV2tkWYe.js +1 -0
- package/dist/console/runtime/public/console/chunks/gherkin-DExj1W_8.js +1 -0
- package/dist/console/runtime/public/console/chunks/git-commit-BSykSTBG.js +1 -0
- package/dist/console/runtime/public/console/chunks/git-rebase-CNMiHM3o.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-BXgKmOw_-C-LZuMrd.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-C-LZuMrd.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-default-DXG-b-1a.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-default-Dk3Gj2bt.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-default-DzJQXksd-DXG-b-1a.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-dimmed-B1pEmGtS-Bx1FflLF.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-dark-high-contrast-BkHIa6jc-B_tTalzw.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-BKRlUbaB-EUqPIrTm.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-EUqPIrTm.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-default-BU3eYkzs-BXViO-2h.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-default-BXViO-2h.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-default-CC-h3suv.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-high-contrast-B3MumDcI-B68TUdTA.js +1 -0
- package/dist/console/runtime/public/console/chunks/github-light-high-contrast-B68TUdTA.js +1 -0
- package/dist/console/runtime/public/console/chunks/gleam-CSRkHgEL.js +1 -0
- package/dist/console/runtime/public/console/chunks/glimmer-js-CwoxQgjc.js +1 -0
- package/dist/console/runtime/public/console/chunks/glimmer-ts-DpQshMGP.js +1 -0
- package/dist/console/runtime/public/console/chunks/glsl-vvkIs2ij.js +1 -0
- package/dist/console/runtime/public/console/chunks/gn-CAXYAgV-.js +1 -0
- package/dist/console/runtime/public/console/chunks/gnuplot-7GGW24-e.js +1 -0
- package/dist/console/runtime/public/console/chunks/go-rLFTqkRN.js +1 -0
- package/dist/console/runtime/public/console/chunks/graphql-ChhlowTj.js +1 -0
- package/dist/console/runtime/public/console/chunks/groovy-CacY0gHj.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-dark-hard-B0ecF443-C820rvS2.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-dark-medium-BQnpC39k-BPjhmG05.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-dark-soft-DFZUgESr-MrdJrrXF.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-light-hard-CuB_LOJr-BC_s9l72.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-light-medium-idDHgxjs-BAWPOn9u.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/dist/console/runtime/public/console/chunks/gruvbox-light-soft-CfWH49MY-BSMLrYjP.js +1 -0
- package/dist/console/runtime/public/console/chunks/hack--5hWxtov.js +1 -0
- package/dist/console/runtime/public/console/chunks/haml-DOOWKVAn.js +1 -0
- package/dist/console/runtime/public/console/chunks/handlebars-CrRNKWA2.js +1 -0
- package/dist/console/runtime/public/console/chunks/haskell-D8IpX4py.js +1 -0
- package/dist/console/runtime/public/console/chunks/haxe-C8oCnwJJ.js +1 -0
- package/dist/console/runtime/public/console/chunks/hcl-Dh228itO.js +1 -0
- package/dist/console/runtime/public/console/chunks/hjson-CxZEssPk.js +1 -0
- package/dist/console/runtime/public/console/chunks/hlsl-Cvrh5tZx.js +1 -0
- package/dist/console/runtime/public/console/chunks/horizon-CE9ld1lL.js +1 -0
- package/dist/console/runtime/public/console/chunks/horizon-bright-Ba6M8QSV-DSNQnXHK.js +1 -0
- package/dist/console/runtime/public/console/chunks/horizon-bright-DSNQnXHK.js +1 -0
- package/dist/console/runtime/public/console/chunks/horizon-h92C5OlZ-CE9ld1lL.js +1 -0
- package/dist/console/runtime/public/console/chunks/houston-CsvMBhTu.js +1 -0
- package/dist/console/runtime/public/console/chunks/houston-EQnPegWq-CsvMBhTu.js +1 -0
- package/dist/console/runtime/public/console/chunks/html-DrTLqG4V.js +1 -0
- package/dist/console/runtime/public/console/chunks/html-DwfkhSwv.js +1 -0
- package/dist/console/runtime/public/console/chunks/html-derivative-JoBPPO4R.js +1 -0
- package/dist/console/runtime/public/console/chunks/http-DKXz4J4h.js +1 -0
- package/dist/console/runtime/public/console/chunks/hurl-m2MDTJJI.js +1 -0
- package/dist/console/runtime/public/console/chunks/hxml-Dcm88srW.js +1 -0
- package/dist/console/runtime/public/console/chunks/hy-CZbG8q4J.js +1 -0
- package/dist/console/runtime/public/console/chunks/icons-CDKEwnTx.js +1 -0
- package/dist/console/runtime/public/console/chunks/imba-DsUTQ-LC.js +1 -0
- package/dist/console/runtime/public/console/chunks/ini-B5eOa1yu.js +1 -0
- package/dist/console/runtime/public/console/chunks/java-DJ6V61UG.js +1 -0
- package/dist/console/runtime/public/console/chunks/javascript-DOney_iy.js +1 -0
- package/dist/console/runtime/public/console/chunks/javascript-DhBmaPc1.js +1 -0
- package/dist/console/runtime/public/console/chunks/jinja-CywE_Am-.js +1 -0
- package/dist/console/runtime/public/console/chunks/jison-D8DWHhWo.js +1 -0
- package/dist/console/runtime/public/console/chunks/json-B6nR7qG1.js +1 -0
- package/dist/console/runtime/public/console/chunks/json-D0JmQrvp.js +1 -0
- package/dist/console/runtime/public/console/chunks/json5-BR5RXkoi.js +1 -0
- package/dist/console/runtime/public/console/chunks/jsonc-CYpm1nAK.js +1 -0
- package/dist/console/runtime/public/console/chunks/jsonc-D4AqO_oZ.js +1 -0
- package/dist/console/runtime/public/console/chunks/jsonl-CmCQp5Yx.js +1 -0
- package/dist/console/runtime/public/console/chunks/jsonnet-CJTPZ8u_.js +1 -0
- package/dist/console/runtime/public/console/chunks/jssm-DXw9l8Rf.js +1 -0
- package/dist/console/runtime/public/console/chunks/jsx-Dro3SMhn.js +1 -0
- package/dist/console/runtime/public/console/chunks/jsx-_Ptt0Qo0.js +1 -0
- package/dist/console/runtime/public/console/chunks/julia-CruTRp58.js +1 -0
- package/dist/console/runtime/public/console/chunks/just-aBPtXuIr.js +1 -0
- package/dist/console/runtime/public/console/chunks/kanagawa-dragon-Bozd7klA.js +1 -0
- package/dist/console/runtime/public/console/chunks/kanagawa-dragon-DgDvwi3B-Bozd7klA.js +1 -0
- package/dist/console/runtime/public/console/chunks/kanagawa-lotus-BgoQro20-BmuOG9ZW.js +1 -0
- package/dist/console/runtime/public/console/chunks/kanagawa-lotus-BmuOG9ZW.js +1 -0
- package/dist/console/runtime/public/console/chunks/kanagawa-wave-BML5mF2J.js +1 -0
- package/dist/console/runtime/public/console/chunks/kanagawa-wave-DgXEowHs-BML5mF2J.js +1 -0
- package/dist/console/runtime/public/console/chunks/katex-CF6MVAvO.js +257 -0
- package/dist/console/runtime/public/console/chunks/kdl-CsD5j6eV.js +1 -0
- package/dist/console/runtime/public/console/chunks/kotlin-DhhofPvG.js +1 -0
- package/dist/console/runtime/public/console/chunks/kusto-C7mF5XQf.js +1 -0
- package/dist/console/runtime/public/console/chunks/laserwave-C_8bwKvT.js +1 -0
- package/dist/console/runtime/public/console/chunks/laserwave-IxBH_3yW-C_8bwKvT.js +1 -0
- package/dist/console/runtime/public/console/chunks/latex-DV9xWg1U.js +1 -0
- package/dist/console/runtime/public/console/chunks/lean-CewbzKMR.js +1 -0
- package/dist/console/runtime/public/console/chunks/less-DVTAwKKz.js +1 -0
- package/dist/console/runtime/public/console/chunks/light-plus-DVQuIRkW.js +1 -0
- package/dist/console/runtime/public/console/chunks/light-plus-S8JBx6is-DVQuIRkW.js +1 -0
- package/dist/console/runtime/public/console/chunks/liquid-B62JT9qD.js +1 -0
- package/dist/console/runtime/public/console/chunks/llvm-DqHOMS-s.js +1 -0
- package/dist/console/runtime/public/console/chunks/log-BNLmms1o.js +1 -0
- package/dist/console/runtime/public/console/chunks/logo-Cluzi2Zq.js +1 -0
- package/dist/console/runtime/public/console/chunks/lua-939mH6Rk.js +1 -0
- package/dist/console/runtime/public/console/chunks/luau-VGWVLoqX.js +1 -0
- package/dist/console/runtime/public/console/chunks/make-Dixweg8N.js +1 -0
- package/dist/console/runtime/public/console/chunks/make-PPdVpZzp.js +1 -0
- package/dist/console/runtime/public/console/chunks/markdown-BK4fiefF.js +1 -0
- package/dist/console/runtime/public/console/chunks/markdown-BYOwaDjH.js +1 -0
- package/dist/console/runtime/public/console/chunks/marko-BjHTe8yB.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-Bm3Qr25_.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-D1f3HBq--Bm3Qr25_.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-darker-2IIEA8gg.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-darker-ExzYhT0j-2IIEA8gg.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-lighter-D6gH9nnA-uhdI0v04.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-lighter-uhdI0v04.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-ocean-CHQ94UKr.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-ocean-D1w5BPAa-CHQ94UKr.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-palenight-B5W6OYN7.js +1 -0
- package/dist/console/runtime/public/console/chunks/material-theme-palenight-CkqWmVpF-B5W6OYN7.js +1 -0
- package/dist/console/runtime/public/console/chunks/matlab-D7qyCx1q.js +1 -0
- package/dist/console/runtime/public/console/chunks/mdc-Dsg_kn4_.js +1 -0
- package/dist/console/runtime/public/console/chunks/mdx-DQZ5AkYe.js +1 -0
- package/dist/console/runtime/public/console/chunks/mdx-l4Hs_llf.js +1 -0
- package/dist/console/runtime/public/console/chunks/mermaid-BxpfTIzt.js +1 -0
- package/dist/console/runtime/public/console/chunks/min-dark-BSWPekZh.js +1 -0
- package/dist/console/runtime/public/console/chunks/min-dark-npsJH98j-BSWPekZh.js +1 -0
- package/dist/console/runtime/public/console/chunks/min-light-DDpmG2fV.js +1 -0
- package/dist/console/runtime/public/console/chunks/min-light-DUk1XsVt-DDpmG2fV.js +1 -0
- package/dist/console/runtime/public/console/chunks/mipsasm-BMqwQI7S.js +1 -0
- package/dist/console/runtime/public/console/chunks/mojo-fg40_ntQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/monokai-BscAjiQZ.js +1 -0
- package/dist/console/runtime/public/console/chunks/monokai-CfFRWUNl-BscAjiQZ.js +1 -0
- package/dist/console/runtime/public/console/chunks/moonbit-D9W784E_.js +1 -0
- package/dist/console/runtime/public/console/chunks/move-BYnGhZoM.js +1 -0
- package/dist/console/runtime/public/console/chunks/narrat-_X_XdTYD.js +1 -0
- package/dist/console/runtime/public/console/chunks/nextflow-CSgcYZcx.js +1 -0
- package/dist/console/runtime/public/console/chunks/nextflow-groovy-D7IRt6Pp.js +1 -0
- package/dist/console/runtime/public/console/chunks/nginx-H6FvQZhW.js +1 -0
- package/dist/console/runtime/public/console/chunks/night-owl-BS7V-av_-DhmEMT88.js +1 -0
- package/dist/console/runtime/public/console/chunks/night-owl-DhmEMT88.js +1 -0
- package/dist/console/runtime/public/console/chunks/night-owl-light-CZtRawYE-eJ-hLW7d.js +1 -0
- package/dist/console/runtime/public/console/chunks/night-owl-light-eJ-hLW7d.js +1 -0
- package/dist/console/runtime/public/console/chunks/nim-C7z2AtKH.js +1 -0
- package/dist/console/runtime/public/console/chunks/nix-IvuFDN5E.js +1 -0
- package/dist/console/runtime/public/console/chunks/nord-BFh54Nqz-Cb4Vim4T.js +1 -0
- package/dist/console/runtime/public/console/chunks/nord-Cb4Vim4T.js +1 -0
- package/dist/console/runtime/public/console/chunks/nsis-CjNLYCLg.js +1 -0
- package/dist/console/runtime/public/console/chunks/nushell--0fT3PI1.js +1 -0
- package/dist/console/runtime/public/console/chunks/objective-c-D1A_Heim.js +1 -0
- package/dist/console/runtime/public/console/chunks/objective-cpp-BsSzOQcm.js +1 -0
- package/dist/console/runtime/public/console/chunks/ocaml-O90oeIOV.js +1 -0
- package/dist/console/runtime/public/console/chunks/odin-B1RWQWA5.js +1 -0
- package/dist/console/runtime/public/console/chunks/one-dark-pro-C6YyR8OD.js +1 -0
- package/dist/console/runtime/public/console/chunks/one-dark-pro-zDovGosB-C6YyR8OD.js +1 -0
- package/dist/console/runtime/public/console/chunks/one-light-D7Lr4KcI.js +1 -0
- package/dist/console/runtime/public/console/chunks/one-light-gmHK3iK6-D7Lr4KcI.js +1 -0
- package/dist/console/runtime/public/console/chunks/openscad-BUDT5pXO.js +1 -0
- package/dist/console/runtime/public/console/chunks/org-DYUOjVHR.js +1 -0
- package/dist/console/runtime/public/console/chunks/pascal-4ZHwLPI5.js +1 -0
- package/dist/console/runtime/public/console/chunks/patch-diff-CD7Eu2gO.js +1 -0
- package/dist/console/runtime/public/console/chunks/perl-BAFITj1w.js +1 -0
- package/dist/console/runtime/public/console/chunks/php-C1opCiHJ.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-code-view-T7V67hwT-XcPks0Ko.js +168 -0
- package/dist/console/runtime/public/console/chunks/pierre-dark-DDWDl8g6-CpLgRqie.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-dark-protanopia-deuteranopia-C35UMuvO-B35FxJx-.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-dark-soft-Bb-4-biO-kZQmAZld.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-dark-tritanopia-CIJISGWF-CpjhbsIL.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-dark-vibrant-8oZzB3gw-CpQYzh95.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-light-CWhW4NrH-CoaEpmwp.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-light-protanopia-deuteranopia-u0U7N4Hn-0fSaH845.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-light-soft-BCU6fuhO-lWLdNTOI.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-light-tritanopia-3c8Yx3co-CEbqgOJL.js +1 -0
- package/dist/console/runtime/public/console/chunks/pierre-light-vibrant-Cwh332o_-D80Fkn33.js +1 -0
- package/dist/console/runtime/public/console/chunks/pkl-ot-7Btpt.js +1 -0
- package/dist/console/runtime/public/console/chunks/plastic-DQwYfKfQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/plastic-DtdaCjub-DQwYfKfQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/plsql-DGHpHOYJ.js +1 -0
- package/dist/console/runtime/public/console/chunks/po-BiJDBrnU.js +1 -0
- package/dist/console/runtime/public/console/chunks/poimandres-DRFjx7u4.js +1 -0
- package/dist/console/runtime/public/console/chunks/poimandres-Hdda6aHK-DRFjx7u4.js +1 -0
- package/dist/console/runtime/public/console/chunks/polar-C7UOKdEL.js +1 -0
- package/dist/console/runtime/public/console/chunks/postcss-BXeXVLqQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/powerquery-DNMTfnFr.js +1 -0
- package/dist/console/runtime/public/console/chunks/powershell-QtSnmXcu.js +1 -0
- package/dist/console/runtime/public/console/chunks/preload-helper-uBIymjUX.js +1 -0
- package/dist/console/runtime/public/console/chunks/presence-BGvCcBvS.js +1 -0
- package/dist/console/runtime/public/console/chunks/prisma-DMgNhnYS.js +1 -0
- package/dist/console/runtime/public/console/chunks/prolog-iXnhIJG7.js +1 -0
- package/dist/console/runtime/public/console/chunks/proto-DB4EqR-F.js +1 -0
- package/dist/console/runtime/public/console/chunks/pug-ChIfOLQs.js +1 -0
- package/dist/console/runtime/public/console/chunks/puppet-CDv2pdJW.js +1 -0
- package/dist/console/runtime/public/console/chunks/purescript-9MfHhQsQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/python-gzcpVVnB.js +1 -0
- package/dist/console/runtime/public/console/chunks/qml-BAjZcRJm.js +1 -0
- package/dist/console/runtime/public/console/chunks/qmldir-DCQb3MpD.js +1 -0
- package/dist/console/runtime/public/console/chunks/qss-Fe1Jh2GI.js +1 -0
- package/dist/console/runtime/public/console/chunks/r-CnJIyxn2.js +1 -0
- package/dist/console/runtime/public/console/chunks/racket-DcIDlBhZ.js +1 -0
- package/dist/console/runtime/public/console/chunks/raku-B3gFvitq.js +1 -0
- package/dist/console/runtime/public/console/chunks/razor-Bk3VGUqz.js +1 -0
- package/dist/console/runtime/public/console/chunks/rbs-C0MpOrj4.js +1 -0
- package/dist/console/runtime/public/console/chunks/read-only-DJWK7nHC.js +1 -0
- package/dist/console/runtime/public/console/chunks/red-CYlAq2b0.js +1 -0
- package/dist/console/runtime/public/console/chunks/red-VqZFRByZ-CYlAq2b0.js +1 -0
- package/dist/console/runtime/public/console/chunks/reg-CRGYupPL.js +1 -0
- package/dist/console/runtime/public/console/chunks/regexp-CF4aByxb.js +1 -0
- package/dist/console/runtime/public/console/chunks/rel-BtDbiS_P.js +1 -0
- package/dist/console/runtime/public/console/chunks/riscv-Ckw8ddFX.js +1 -0
- package/dist/console/runtime/public/console/chunks/rolldown-runtime-DK3Fl9T5.js +1 -0
- package/dist/console/runtime/public/console/chunks/ron-VUp2lXgN.js +1 -0
- package/dist/console/runtime/public/console/chunks/rose-pine-DiTkEueR-aMsaMD1D.js +1 -0
- package/dist/console/runtime/public/console/chunks/rose-pine-aMsaMD1D.js +1 -0
- package/dist/console/runtime/public/console/chunks/rose-pine-dawn-8PwUyIlP.js +1 -0
- package/dist/console/runtime/public/console/chunks/rose-pine-dawn-tfo5y2X0-8PwUyIlP.js +1 -0
- package/dist/console/runtime/public/console/chunks/rose-pine-moon-C0gON9XN-DO-qXg-I.js +1 -0
- package/dist/console/runtime/public/console/chunks/rose-pine-moon-DO-qXg-I.js +1 -0
- package/dist/console/runtime/public/console/chunks/rosmsg-CAekHB0j.js +1 -0
- package/dist/console/runtime/public/console/chunks/rst-D8R3YvuX.js +1 -0
- package/dist/console/runtime/public/console/chunks/ruby-BDvumEf2.js +1 -0
- package/dist/console/runtime/public/console/chunks/rust-DpiIf5JO.js +1 -0
- package/dist/console/runtime/public/console/chunks/sas-CDxiwfn1.js +1 -0
- package/dist/console/runtime/public/console/chunks/sass-DXrisJhu.js +1 -0
- package/dist/console/runtime/public/console/chunks/scala-BiFt_7mu.js +1 -0
- package/dist/console/runtime/public/console/chunks/scheme-DQCgrYNe.js +1 -0
- package/dist/console/runtime/public/console/chunks/scss-BPiS1nMZ.js +1 -0
- package/dist/console/runtime/public/console/chunks/scss-DuikUNMR.js +1 -0
- package/dist/console/runtime/public/console/chunks/sdbl-bTVj8UrX.js +1 -0
- package/dist/console/runtime/public/console/chunks/sections-aIkyV8J9.js +8 -0
- package/dist/console/runtime/public/console/chunks/shaderlab-TOUzSsQk.js +1 -0
- package/dist/console/runtime/public/console/chunks/shellscript-CgLkv1T0.js +1 -0
- package/dist/console/runtime/public/console/chunks/shellscript-DStN_0YR.js +1 -0
- package/dist/console/runtime/public/console/chunks/shellsession-C_5QA7eC.js +1 -0
- package/dist/console/runtime/public/console/chunks/slack-dark-DnToyrRv.js +1 -0
- package/dist/console/runtime/public/console/chunks/slack-dark-v8P_eXr6-DnToyrRv.js +1 -0
- package/dist/console/runtime/public/console/chunks/slack-ochin-B2OO5cIa.js +1 -0
- package/dist/console/runtime/public/console/chunks/slack-ochin-D8SyEdKz-B2OO5cIa.js +1 -0
- package/dist/console/runtime/public/console/chunks/smalltalk-BHpQb5nM.js +1 -0
- package/dist/console/runtime/public/console/chunks/smithy-Dgaz7aur.js +1 -0
- package/dist/console/runtime/public/console/chunks/snazzy-light-4G7pJPwS.js +1 -0
- package/dist/console/runtime/public/console/chunks/snazzy-light-BtkQkvXb-4G7pJPwS.js +1 -0
- package/dist/console/runtime/public/console/chunks/solarized-dark-B8nAdMfM-b97czJOk.js +1 -0
- package/dist/console/runtime/public/console/chunks/solarized-dark-b97czJOk.js +1 -0
- package/dist/console/runtime/public/console/chunks/solarized-light-B-3F1INj-DFPxpIYQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/solarized-light-DFPxpIYQ.js +1 -0
- package/dist/console/runtime/public/console/chunks/solidity-Bj7E1mRn.js +1 -0
- package/dist/console/runtime/public/console/chunks/soy-Drvj0-hN.js +1 -0
- package/dist/console/runtime/public/console/chunks/sparql-D_iOobhT.js +1 -0
- package/dist/console/runtime/public/console/chunks/splunk-BC2Px7Mm.js +1 -0
- package/dist/console/runtime/public/console/chunks/sql-7uki0mN6.js +1 -0
- package/dist/console/runtime/public/console/chunks/sql-DvnUxQaA.js +1 -0
- package/dist/console/runtime/public/console/chunks/ssh-config-BgfXC-Er.js +1 -0
- package/dist/console/runtime/public/console/chunks/stata-5ekhIp_w.js +1 -0
- package/dist/console/runtime/public/console/chunks/stylus-B6D30XZt.js +1 -0
- package/dist/console/runtime/public/console/chunks/surrealql-BggsF-oc.js +1 -0
- package/dist/console/runtime/public/console/chunks/svelte-BOzpv3zx.js +1 -0
- package/dist/console/runtime/public/console/chunks/swift-CyEgAFGc.js +1 -0
- package/dist/console/runtime/public/console/chunks/synthwave-84-DcsXCF_c-nFMaYfgc.js +1 -0
- package/dist/console/runtime/public/console/chunks/synthwave-84-nFMaYfgc.js +1 -0
- package/dist/console/runtime/public/console/chunks/system-verilog-Dh5ihWbf.js +1 -0
- package/dist/console/runtime/public/console/chunks/systemd-BxMlprV5.js +1 -0
- package/dist/console/runtime/public/console/chunks/talonscript-CohzipZa.js +1 -0
- package/dist/console/runtime/public/console/chunks/tasl-DMoTqEGO.js +1 -0
- package/dist/console/runtime/public/console/chunks/tcl-CZd0xW_V.js +1 -0
- package/dist/console/runtime/public/console/chunks/templ-fdyF5dsr.js +1 -0
- package/dist/console/runtime/public/console/chunks/terraform-DswuEJGm.js +1 -0
- package/dist/console/runtime/public/console/chunks/tex-DHA47n0s.js +1 -0
- package/dist/console/runtime/public/console/chunks/tokyo-night-Bvpqduda-oM2G3aXe.js +1 -0
- package/dist/console/runtime/public/console/chunks/tokyo-night-oM2G3aXe.js +1 -0
- package/dist/console/runtime/public/console/chunks/toml-CcmNWLt0.js +1 -0
- package/dist/console/runtime/public/console/chunks/ts-tags-FylMzM_u.js +1 -0
- package/dist/console/runtime/public/console/chunks/tsv-sltzmVWM.js +1 -0
- package/dist/console/runtime/public/console/chunks/tsx-B8qh6jDH.js +1 -0
- package/dist/console/runtime/public/console/chunks/tsx-Ge9e86uq.js +1 -0
- package/dist/console/runtime/public/console/chunks/turtle-ByJddavk.js +1 -0
- package/dist/console/runtime/public/console/chunks/twig-r9Dsv_Ri.js +1 -0
- package/dist/console/runtime/public/console/chunks/typescript-C2Eu6twH.js +1 -0
- package/dist/console/runtime/public/console/chunks/typescript-CiUCm0l2.js +1 -0
- package/dist/console/runtime/public/console/chunks/typespec-BGhR2SqG.js +1 -0
- package/dist/console/runtime/public/console/chunks/typst-BCkRs6d9.js +1 -0
- package/dist/console/runtime/public/console/chunks/url-uI6JSUZP.js +4 -0
- package/dist/console/runtime/public/console/chunks/useForwardScopeId-mJ8JPuYU.js +1 -0
- package/dist/console/runtime/public/console/chunks/usePortal-BqI7uIRp.js +3 -0
- package/dist/console/runtime/public/console/chunks/v-DBj4K9d_.js +1 -0
- package/dist/console/runtime/public/console/chunks/vala-zf12oZj6.js +1 -0
- package/dist/console/runtime/public/console/chunks/vb-DOwzaHZ0.js +1 -0
- package/dist/console/runtime/public/console/chunks/verilog-B2gwz-sJ.js +1 -0
- package/dist/console/runtime/public/console/chunks/vesper-CfxmMOy3-DdrHHSXu.js +1 -0
- package/dist/console/runtime/public/console/chunks/vesper-DdrHHSXu.js +1 -0
- package/dist/console/runtime/public/console/chunks/vhdl-BroJfC0k.js +1 -0
- package/dist/console/runtime/public/console/chunks/viml-DvXPmvsu.js +1 -0
- package/dist/console/runtime/public/console/chunks/vitesse-black-D9-_1mjV-fwtXNY1n.js +1 -0
- package/dist/console/runtime/public/console/chunks/vitesse-black-fwtXNY1n.js +1 -0
- package/dist/console/runtime/public/console/chunks/vitesse-dark-BZCL-v6S.js +1 -0
- package/dist/console/runtime/public/console/chunks/vitesse-dark-DlSMLlr9-BZCL-v6S.js +1 -0
- package/dist/console/runtime/public/console/chunks/vitesse-light-KRWWWztf-VbXTXTou.js +1 -0
- package/dist/console/runtime/public/console/chunks/vitesse-light-VbXTXTou.js +1 -0
- package/dist/console/runtime/public/console/chunks/vue-Bc1L0ruR.js +3 -0
- package/dist/console/runtime/public/console/chunks/vue-CGPRTtAM.js +1 -0
- package/dist/console/runtime/public/console/chunks/vue-CHGs_ru8.js +1 -0
- package/dist/console/runtime/public/console/chunks/vue-html-CU_0vU6P.js +1 -0
- package/dist/console/runtime/public/console/chunks/vue-vine-BrC7uwb8.js +1 -0
- package/dist/console/runtime/public/console/chunks/vueuse-DCpBt1pZ.js +4 -0
- package/dist/console/runtime/public/console/chunks/vyper-CgoNMtux.js +1 -0
- package/dist/console/runtime/public/console/chunks/wasm-BnjxR4X6.js +1 -0
- package/dist/console/runtime/public/console/chunks/wasm-ByWQv1Qj.js +1 -0
- package/dist/console/runtime/public/console/chunks/wenyan-C8pVoKbM.js +1 -0
- package/dist/console/runtime/public/console/chunks/wgsl-BsKzXJz4.js +1 -0
- package/dist/console/runtime/public/console/chunks/wikitext-ClFFjSW2.js +1 -0
- package/dist/console/runtime/public/console/chunks/wit-DdvCle-K.js +1 -0
- package/dist/console/runtime/public/console/chunks/wolfram-DLL8P-h_.js +1 -0
- package/dist/console/runtime/public/console/chunks/xml-Bx1i6T7B.js +1 -0
- package/dist/console/runtime/public/console/chunks/xsl-DR5M53i7.js +1 -0
- package/dist/console/runtime/public/console/chunks/yaml-CZmR-Icd.js +1 -0
- package/dist/console/runtime/public/console/chunks/yaml-a9wqVlBt.js +1 -0
- package/dist/console/runtime/public/console/chunks/zenscript-BnlCZFoB.js +1 -0
- package/dist/console/runtime/public/console/chunks/zig-CMLA9XwU.js +1 -0
- package/dist/console/runtime/public/console/console-QjK_HKoM.css +2 -0
- package/dist/console/runtime/public/console/console-j0_7kmR5.js +21 -0
- package/dist/console/runtime/public/console/page-tool-Cji0S8q-.js +1 -0
- package/dist/console/runtime/public/skills/index.json +46 -0
- package/dist/console/runtime/public/skills/vitehub/SKILL.md +88 -0
- package/dist/console/runtime/public/skills/vitehub/agents/openai.yaml +4 -0
- package/dist/console/runtime/public/skills/vitehub/references/agent-definitions.md +36 -0
- package/dist/console/runtime/public/skills/vitehub/references/capabilities-authority.md +30 -0
- package/dist/console/runtime/public/skills/vitehub/references/channels-triggers.md +26 -0
- package/dist/console/runtime/public/skills/vitehub/references/framework-composition.md +29 -0
- package/dist/console/runtime/public/skills/vitehub/references/preview-contract.md +36 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/auth.md +16 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/blob.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/browser.md +17 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/cache.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/channels.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/connections.md +16 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/content.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/database.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/email.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/env.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/kv.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/markdown-template.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/queue.md +16 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/rate-limit.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/realtime.md +19 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/sandbox-task.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/sandbox.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/schedule.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/shell.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/source.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/workflow.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/primitives/workspace.md +13 -0
- package/dist/console/runtime/public/skills/vitehub/references/project-patterns.md +19 -0
- package/dist/console/runtime/public/skills/vitehub/references/project-shapes.md +61 -0
- package/dist/console/runtime/public/skills/vitehub/references/proof-recovery.md +29 -0
- package/dist/console/runtime/public/skills/vitehub/references/sandboxes-hosts.md +17 -0
- package/dist/console/runtime/public/skills/vitehub/references/schedules-workflows-invocations.md +28 -0
- package/dist/console/runtime/public/skills/vitehub/references/server-primitives.md +39 -0
- package/dist/console/runtime/public/skills/vitehub/references/workspaces-sources-access.md +26 -0
- package/dist/console/runtime/rpc.d.ts +36 -0
- package/dist/console/runtime/rpc.js +4 -0
- package/dist/console/runtime/sections.d.ts +2 -0
- package/dist/console/runtime/sections.js +351 -0
- package/dist/console/runtime/server/agents.get.d.ts +17 -0
- package/dist/console/runtime/server/agents.get.js +23 -0
- package/dist/console/runtime/server/auth-manage.d.ts +7 -0
- package/dist/console/runtime/server/auth-manage.js +155 -0
- package/dist/console/runtime/server/blob.d.ts +2 -0
- package/dist/console/runtime/server/blob.js +19 -0
- package/dist/console/runtime/server/channel-replay.d.ts +11 -0
- package/dist/console/runtime/server/channel-replay.js +80 -0
- package/dist/console/runtime/server/client.get.d.ts +3 -0
- package/dist/console/runtime/server/client.get.js +11 -0
- package/dist/console/runtime/server/database.d.ts +2 -0
- package/dist/console/runtime/server/database.get.d.ts +70 -0
- package/dist/console/runtime/server/database.get.js +223 -0
- package/dist/console/runtime/server/database.js +18 -0
- package/dist/console/runtime/server/definitions.d.ts +2 -0
- package/dist/console/runtime/server/definitions.get.d.ts +11 -0
- package/dist/console/runtime/server/definitions.get.js +70 -0
- package/dist/console/runtime/server/definitions.js +97 -0
- package/dist/console/runtime/server/documents.d.ts +2 -0
- package/dist/console/runtime/server/documents.js +111 -0
- package/dist/console/runtime/server/env-manage.d.ts +5 -0
- package/dist/console/runtime/server/env-manage.js +10 -0
- package/dist/console/runtime/server/env.d.ts +18 -0
- package/dist/console/runtime/server/env.get.d.ts +9 -0
- package/dist/console/runtime/server/env.get.js +29 -0
- package/dist/console/runtime/server/env.js +42 -0
- package/dist/console/runtime/server/invocation-capabilities.get.d.ts +10 -0
- package/dist/console/runtime/server/invocation-capabilities.get.js +22 -0
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +42 -0
- package/dist/console/runtime/server/invocation-workspace.get.js +243 -0
- package/dist/console/runtime/server/invocation.get.d.ts +47 -0
- package/dist/console/runtime/server/invocation.get.js +153 -0
- package/dist/console/runtime/server/invocations.get.d.ts +8 -0
- package/dist/console/runtime/server/invocations.get.js +227 -0
- package/dist/console/runtime/server/logs.get.d.ts +13 -0
- package/dist/console/runtime/server/logs.get.js +45 -0
- package/dist/console/runtime/server/mcp-authorization-server.d.ts +11 -0
- package/dist/console/runtime/server/mcp-authorization-server.js +71 -0
- package/dist/console/runtime/server/mcp-discovery.d.ts +7 -0
- package/dist/console/runtime/server/mcp-discovery.js +20 -0
- package/dist/console/runtime/server/mcp-metadata.d.ts +11 -0
- package/dist/console/runtime/server/mcp-metadata.js +54 -0
- package/dist/console/runtime/server/mcp.d.ts +16 -0
- package/dist/console/runtime/server/mcp.js +364 -0
- package/dist/console/runtime/server/page-session.d.ts +2 -0
- package/dist/console/runtime/server/page-session.js +5 -0
- package/dist/console/runtime/server/page.get.d.ts +4 -0
- package/dist/console/runtime/server/page.get.js +49 -0
- package/dist/console/runtime/server/rpc.d.ts +22 -0
- package/dist/console/runtime/server/rpc.js +215 -0
- package/dist/console/runtime/server/schedule-run.d.ts +36 -0
- package/dist/console/runtime/server/schedule-run.js +213 -0
- package/dist/console/runtime/server/search.get.d.ts +9 -0
- package/dist/console/runtime/server/search.get.js +103 -0
- package/dist/console/runtime/server/sections.d.ts +4 -0
- package/dist/console/runtime/server/sections.get.d.ts +22 -0
- package/dist/console/runtime/server/sections.get.js +27 -0
- package/dist/console/runtime/server/sections.js +4 -0
- package/dist/console/runtime/server/sign-in.d.ts +5 -0
- package/dist/console/runtime/server/sign-in.js +11 -0
- package/dist/console/runtime/server/status.get.d.ts +13 -0
- package/dist/console/runtime/server/status.get.js +40 -0
- package/dist/console/runtime/server/usage.get.d.ts +7 -0
- package/dist/console/runtime/server/usage.get.js +99 -0
- package/dist/console/server.d.ts +22 -0
- package/dist/console/server.js +34 -0
- package/dist/console/ui.d.ts +201 -0
- package/dist/console/ui.js +3215 -0
- package/dist/console.d.ts +5 -0
- package/dist/console.js +4 -0
- package/dist/content/client.d.ts +1 -0
- package/dist/content/client.js +2 -0
- package/dist/content/database.d.ts +1 -0
- package/dist/content/database.js +2 -0
- package/dist/content/editor.d.ts +1 -0
- package/dist/content/editor.js +2 -0
- package/dist/content/presets/cms.d.ts +2 -0
- package/dist/content/presets/cms.js +2 -0
- package/dist/content/realtime.d.ts +1 -0
- package/dist/content/realtime.js +2 -0
- package/dist/content.d.ts +2 -0
- package/dist/content.js +3 -0
- package/dist/database-DLPk6HVu.d.ts +7 -0
- package/dist/database-hyYo7JVD.d.ts +11 -0
- package/dist/definitions-BJGSpYGa.d.ts +209 -0
- package/dist/definitions-Y0pIwSQm.d.ts +19 -0
- package/dist/diagnostics-YTWM3K3t.js +74 -0
- package/dist/diagnostics-lT85pbVx.d.ts +6 -0
- package/dist/doctor.d.ts +8 -0
- package/dist/doctor.js +417 -0
- package/dist/document-metadata-nXusaMSq.js +6 -0
- package/dist/documents-BRt3-fIu.d.ts +72 -0
- package/dist/env/auth.d.ts +1 -0
- package/dist/env/auth.js +2 -0
- package/dist/env/bridge.d.ts +1 -0
- package/dist/env/bridge.js +2 -0
- package/dist/env/database.d.ts +1 -0
- package/dist/env/database.js +2 -0
- package/dist/env/http.d.ts +1 -0
- package/dist/env/http.js +2 -0
- package/dist/env/provider.d.ts +1 -0
- package/dist/env/provider.js +2 -0
- package/dist/env/seal.d.ts +1 -0
- package/dist/env/seal.js +2 -0
- package/dist/env.d.ts +1 -0
- package/dist/error-diagnostics-n7V-_SPy.js +160 -0
- package/dist/error-diagnostics.ts +162 -0
- package/dist/gateways.d.ts +1 -0
- package/dist/gateways.js +2 -0
- package/dist/h3-v1-request-DDGXJ9E7.js +166 -0
- package/dist/index-CWk5rJOo.d.ts +247 -0
- package/dist/index.d.ts +3 -44
- package/dist/index.js +1 -1
- package/dist/internal-Ca7DYHpa.js +311 -0
- package/dist/internal-VvXn0bX4.d.ts +25 -0
- package/dist/invocations-DkjhdkpT.js +1151 -0
- package/dist/invocations-TvN9ux06.d.ts +47 -0
- package/dist/logs/host.d.ts +6 -0
- package/dist/logs/host.js +16 -0
- package/dist/logs/memory.d.ts +18 -0
- package/dist/logs/memory.js +85 -0
- package/dist/logs/source.d.ts +57 -0
- package/dist/logs/source.js +57 -0
- package/dist/logs.d.ts +4 -0
- package/dist/logs.js +4 -0
- package/dist/loopback-DAr1IFQP.js +43 -0
- package/dist/markdown-template/file.d.ts +1 -0
- package/dist/markdown-template/file.js +2 -0
- package/dist/media-BBybn3NP.js +512 -0
- package/dist/nuxt.d.ts +15 -14
- package/dist/nuxt.js +1156 -25
- package/dist/operation-contributions-BXHKgT_w.d.ts +18 -0
- package/dist/operations-4uDh4zah.js +38 -0
- package/dist/operations-7RHOMAHT.js +455 -0
- package/dist/operations-Bgklf9hM.d.ts +149 -0
- package/dist/operations-CwqEItfA.js +468 -0
- package/dist/operations.d.ts +2 -0
- package/dist/operations.js +2 -0
- package/dist/owned-paths-BnjT0FhU.js +15 -0
- package/dist/package-BsfDnNm8.js +1119 -0
- package/dist/page-tools-B3g4CQ5c.js +402 -0
- package/dist/page-tools-C5dufxVz.d.ts +16 -0
- package/dist/page-tools-shared-D-amu6sx.js +53 -0
- package/dist/presets/babysitter/server.d.ts +1 -0
- package/dist/presets/babysitter/server.js +2 -0
- package/dist/presets/babysitter.d.ts +1 -0
- package/dist/presets/babysitter.js +2 -0
- package/dist/presets/labeller.d.ts +1 -0
- package/dist/presets/labeller.js +2 -0
- package/dist/presets/workspace.d.ts +2 -0
- package/dist/presets/workspace.js +2 -0
- package/dist/project-registry-BT7RcCcQ.js +39 -0
- package/dist/realtime/server.d.ts +1 -0
- package/dist/realtime/server.js +2 -0
- package/dist/realtime/vue.d.ts +1 -0
- package/dist/realtime/vue.js +2 -0
- package/dist/realtime.d.ts +1 -0
- package/dist/realtime.js +2 -0
- package/dist/registry-dSdI2Oa3.js +142 -0
- package/dist/request-BT6g-Fwf.js +326 -0
- package/dist/request-DOvvVgpI.d.ts +52 -0
- package/dist/retention-DBXuVtQL.js +257 -0
- package/dist/rolldown-runtime-8H4AJuhK.js +14 -0
- package/dist/runtime/h3.d.ts +2 -0
- package/dist/runtime/h3.js +2 -0
- package/dist/runtime/node.d.ts +1 -0
- package/dist/runtime/node.js +2 -0
- package/dist/runtime-DPqC3MTX.js +60 -0
- package/dist/sandbox/ssh.d.ts +1 -0
- package/dist/sandbox/ssh.js +2 -0
- package/dist/sandbox/task.d.ts +1 -0
- package/dist/sandbox/task.js +2 -0
- package/dist/scan-module-TmHMoGKw.js +148 -0
- package/dist/schedule/runtime/kv.d.ts +1 -0
- package/dist/schedule/runtime/kv.js +2 -0
- package/dist/schema-form-C-fy3xaU.d.ts +79 -0
- package/dist/secret-DrgWMRms.js +47 -0
- package/dist/sections-BVtKNenQ.js +108 -0
- package/dist/sections-C985LlW2.d.ts +31 -0
- package/dist/sections-Drj-o4_z.d.ts +141 -0
- package/dist/source/client.d.ts +1 -0
- package/dist/source/client.js +2 -0
- package/dist/source/file.d.ts +1 -0
- package/dist/source/file.js +2 -0
- package/dist/source/files.d.ts +1 -0
- package/dist/source/files.js +2 -0
- package/dist/source/github.d.ts +1 -0
- package/dist/source/github.js +2 -0
- package/dist/source/glob.d.ts +1 -0
- package/dist/source/glob.js +2 -0
- package/dist/source/markdown.d.ts +1 -0
- package/dist/source/markdown.js +2 -0
- package/dist/source/mcp.d.ts +1 -0
- package/dist/source/mcp.js +2 -0
- package/dist/source/server.d.ts +1 -0
- package/dist/source/server.js +2 -0
- package/dist/source/vite.d.ts +7 -0
- package/dist/source/vite.js +20 -0
- package/dist/source.d.ts +2 -1
- package/dist/source.js +1 -0
- package/dist/src-CaqWiza-.js +7910 -0
- package/dist/task.d.ts +3 -0
- package/dist/task.js +2 -0
- package/dist/types-BsuwNk3q.js +256 -0
- package/dist/ui/attachment.d.ts +1 -0
- package/dist/ui/attachment.js +2 -0
- package/dist/ui/avatar-stack.d.ts +1 -0
- package/dist/ui/avatar-stack.js +2 -0
- package/dist/ui/bubble.d.ts +1 -0
- package/dist/ui/bubble.js +2 -0
- package/dist/ui/chat-message.d.ts +1 -0
- package/dist/ui/chat-message.js +2 -0
- package/dist/ui/chat-session.d.ts +1 -0
- package/dist/ui/chat-session.js +2 -0
- package/dist/ui/chat.d.ts +1 -0
- package/dist/ui/chat.js +2 -0
- package/dist/ui/code-block.d.ts +1 -0
- package/dist/ui/code-block.js +2 -0
- package/dist/ui/code-view.d.ts +1 -0
- package/dist/ui/code-view.js +2 -0
- package/dist/ui/comments.d.ts +1 -0
- package/dist/ui/comments.js +2 -0
- package/dist/ui/connection-status.d.ts +1 -0
- package/dist/ui/connection-status.js +2 -0
- package/dist/ui/file-diff.d.ts +1 -0
- package/dist/ui/file-diff.js +2 -0
- package/dist/ui/file-tree.d.ts +1 -0
- package/dist/ui/file-tree.js +2 -0
- package/dist/ui/file-view.d.ts +1 -0
- package/dist/ui/file-view.js +2 -0
- package/dist/ui/headless.d.ts +1 -0
- package/dist/ui/headless.js +2 -0
- package/dist/ui/markdown.d.ts +1 -0
- package/dist/ui/markdown.js +2 -0
- package/dist/ui/marker.d.ts +1 -0
- package/dist/ui/marker.js +2 -0
- package/dist/ui/message-parts.d.ts +1 -0
- package/dist/ui/message-parts.js +2 -0
- package/dist/ui/message.d.ts +1 -0
- package/dist/ui/message.js +2 -0
- package/dist/ui/multi-file-diff.d.ts +1 -0
- package/dist/ui/multi-file-diff.js +2 -0
- package/dist/ui/nuxt.d.ts +3 -0
- package/dist/ui/nuxt.js +3 -0
- package/dist/ui/patch-diff.d.ts +1 -0
- package/dist/ui/patch-diff.js +2 -0
- package/dist/ui/prompt-input.d.ts +1 -0
- package/dist/ui/prompt-input.js +2 -0
- package/dist/ui/styles.css +2662 -0
- package/dist/ui/sync-status.d.ts +1 -0
- package/dist/ui/sync-status.js +2 -0
- package/dist/ui/tool-list.d.ts +1 -0
- package/dist/ui/tool-list.js +2 -0
- package/dist/ui/trace-run.d.ts +1 -0
- package/dist/ui/trace-run.js +2 -0
- package/dist/ui/trace.d.ts +1 -0
- package/dist/ui/trace.js +2 -0
- package/dist/ui/unresolved-file.d.ts +1 -0
- package/dist/ui/unresolved-file.js +2 -0
- package/dist/ui/vite.d.ts +3 -0
- package/dist/ui/vite.js +3 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +2 -0
- package/dist/usage-CoQXs5nW.d.ts +22 -0
- package/dist/workspace/blob-database.d.ts +1 -0
- package/dist/workspace/blob-database.js +2 -0
- package/package.json +1356 -139
- package/dist/_internal/sandbox/runtime/state.d.ts +0 -1
- package/dist/_internal/sandbox/runtime/state.js +0 -2
- package/dist/_internal/schedule/runtime/driver.d.ts +0 -1
- package/dist/_internal/schedule/runtime/driver.js +0 -2
- package/dist/agent/harness/local-sandbox.d.ts +0 -1
- package/dist/agent/harness/local-sandbox.js +0 -2
- package/dist/box.d.ts +0 -1
- package/dist/box.js +0 -2
- package/dist/email/drivers/smtp.d.ts +0 -1
- package/dist/email/drivers/smtp.js +0 -2
- package/dist/schedule/runtime/driver.d.ts +0 -1
- package/dist/schedule/runtime/driver.js +0 -2
- package/dist/shell/providers/cloudflare.d.ts +0 -1
- package/dist/shell/providers/cloudflare.js +0 -2
- package/dist/src-o6zB-soj.js +0 -1135
- package/dist/workspace/collections/client.d.ts +0 -1
- package/dist/workspace/collections/client.js +0 -2
- package/dist/workspace/collections.d.ts +0 -1
- package/dist/workspace/collections.js +0 -2
- package/dist/workspace/publish.d.ts +0 -1
- package/dist/workspace/publish.js +0 -2
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./patch-diff-CD7Eu2gO.js","./code-view-J4OsgEdh-B89t0LaT.js","./vueuse-DCpBt1pZ.js","./rolldown-runtime-DK3Fl9T5.js","./preload-helper-uBIymjUX.js","./css-BDmUYLyz.js","./css-B6l3ejVl.js","./dockerfile-C147k2YT.js","./docker-sj3NF4m5.js","./html-DwfkhSwv.js","./html-DrTLqG4V.js","./javascript-DhBmaPc1.js","./javascript-DOney_iy.js","./json-B6nR7qG1.js","./json-D0JmQrvp.js","./jsonc-D4AqO_oZ.js","./jsonc-CYpm1nAK.js","./jsx-_Ptt0Qo0.js","./jsx-Dro3SMhn.js","./make-PPdVpZzp.js","./make-Dixweg8N.js","./markdown-BK4fiefF.js","./markdown-BYOwaDjH.js","./mdx-l4Hs_llf.js","./mdx-DQZ5AkYe.js","./scss-BPiS1nMZ.js","./scss-DuikUNMR.js","./shellscript-DStN_0YR.js","./shellscript-CgLkv1T0.js","./sql-7uki0mN6.js","./sql-DvnUxQaA.js","./tsx-Ge9e86uq.js","./tsx-B8qh6jDH.js","./typescript-C2Eu6twH.js","./typescript-CiUCm0l2.js","./vue-CHGs_ru8.js","./vue-CGPRTtAM.js","./html-derivative-JoBPPO4R.js","./yaml-CZmR-Icd.js","./yaml-a9wqVlBt.js","./core-CD3So4L1.js","./engine-javascript-Dymre4AG.js","./engine-compile-DS_05kfr.js","./github-light-default-CC-h3suv.js","./github-light-default-BXViO-2h.js","./github-dark-default-Dk3Gj2bt.js","./github-dark-default-DXG-b-1a.js","./file-tree-2PXztdQ7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,$t as t,B as n,Bt as r,Dt as i,Et as a,Ft as o,G as s,H as c,It as l,J as u,Lt as d,Mt as f,N as p,Nt as m,Ot as h,Q as g,St as _,T as v,Tt as y,Vt as b,W as x,X as S,Xt as C,Y as w,Yt as T,Z as E,_t as D,an as O,at as k,bt as A,ft as ee,it as j,l as te,ln as ne,lt as M,mt as re,nn as N,nt as P,pt as ie,qt as ae,rn as F,rt as I,sn as L,st as R,tt as z,u as oe,un as B,vt as V,wt as H,xt as se,z as ce}from"./vueuse-DCpBt1pZ.js";import{n as le,r as ue}from"./Icon-DDNuGxPl.js";import{$ as de,B as fe,E as pe,J as me,Q as he,X as ge,Y as _e,d as ve,f as ye,ft as be,m as xe,q as Se,s as Ce}from"./sections-aIkyV8J9.js";import{Fn as we,G as Te,In as Ee,K as De,_n as Oe,at as ke,ct as Ae,et as je,it as Me,lt as Ne,nt as Pe,ot as Fe,q as Ie,rt as Le,st as Re,t as ze,ut as Be,wt as Ve}from"./console-search-D4EVLUeN.js";import{p as He}from"./usePortal-BqI7uIRp.js";import{M as Ue,T as We,_ as Ge,b as Ke,j as qe,n as Je,v as Ye,y as U}from"./Button-B-5IVAVN.js";import{t as Xe}from"./preload-helper-uBIymjUX.js";import{a as Ze,i as Qe,n as $e,o as et,t as tt}from"./url-uI6JSUZP.js";import{t as nt}from"./Alert-A44KLyli.js";import{E as rt}from"./Modal-BCfHPiul.js";import{n as it,t as at}from"./Select-CLtjSqJ4.js";import{a as ot,i as st,n as ct,r as lt,t as ut}from"./Tabs-BbKlHRNF.js";import{t as dt}from"./Slideover-CHzYTMLO.js";import{t as ft}from"./DashboardSidebar-D1tMg0lD.js";import{t as pt}from"./Empty-DSuwpzRi.js";import{t as mt}from"./Popover-BIzgqwDJ.js";import{t as ht}from"./format-Bm0hCiYP.js";import{S as W,_ as gt,d as _t,g as vt,h as yt,m as bt,n as xt,r as St,t as Ct,v as wt,x as Tt,y as Et}from"./dist-Cfws9tG7.js";import{t as Dt}from"./console-page-toolbar-CvYwaKTR.js";var Ot={why:({message:e})=>e===void 0?``:String(e)},kt=be({docsBase:()=>`https://vitehub.dev/docs/reference/diagnostics`,codes:{UI_R0001:Ot,UI_R0002:Ot,UI_R0003:Ot}}),At=j({name:`Attachment`,props:{orientation:{default:`horizontal`,type:String},size:{default:`default`,type:String},state:{default:`done`,type:String}},setup(e,{slots:t}){return()=>R(`div`,{"data-orientation":e.orientation,"data-size":e.size,"data-slot":`attachment`,"data-state":e.state},t.default?.())}}),jt=et(`AttachmentGroup`,`attachment-group`),Mt=j({name:`AttachmentMedia`,props:{variant:{default:`icon`,type:String}},setup(e,{slots:t}){return()=>R(`div`,{"data-slot":`attachment-media`,"data-variant":e.variant},t.default?.())}}),Nt=et(`AttachmentContent`,`attachment-content`),Pt=et(`AttachmentTitle`,`attachment-title`,`span`);et(`AttachmentDescription`,`attachment-description`,`span`);var Ft=et(`AttachmentActions`,`attachment-actions`),It=j({name:`AttachmentAction`,setup(e,{slots:t}){let n=h(`UButton`);return()=>R(n,{color:`neutral`,"data-slot":`attachment-action`,size:`xs`,square:!0,variant:`ghost`},t)}});j({name:`AttachmentTrigger`,props:{as:Ze(`button`)},setup(e,{slots:t}){return()=>R(e.as,{"data-slot":`attachment-trigger`,type:e.as===`button`?`button`:void 0},t.default?.())}});function Lt(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??kt.UI_R0001({message:`Could not read ${e.name}.`})),r.onload=()=>t(String(r.result)),r.readAsDataURL(e)})}async function Rt(e){return{filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:await Lt(e)}}function zt(e,t,n){return n?[...e,...t]:t.slice(-1)}var Bt={error:`Retry prompt`,ready:`Send prompt`,streaming:`Stop response`,submitted:`Stop response`},Vt={error:`i-ph-arrow-clockwise`,ready:`i-ph-arrow-up`,streaming:`i-ph-stop-fill`,submitted:`i-ph-stop-fill`};function Ht(){return typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches&&!matchMedia(`(any-pointer: fine)`).matches}var Ut=j({name:`PromptInput`,inheritAttrs:!1,props:{accept:{type:String},attachments:{default:!0,type:Boolean},files:{default:()=>[],type:Array},filterFiles:{type:Function},modelValue:{default:``,type:String},multiple:{default:!0,type:Boolean},placeholder:{type:String},status:{default:`ready`,type:String},submitLabel:{type:String}},emits:[`error`,`reload`,`submit`,`stop`,`update:files`,`update:modelValue`],setup(e,{attrs:t,emit:n,slots:r}){let i=C(null),a=C(null),o=C(0),s=u(()=>o.value>0),c=u(()=>e.status===`ready`&&!s.value&&(e.modelValue.trim().length>0||e.files.length>0)),l=!1,d=0,f=new Map;D(()=>{l=!0});let p=h(`UButton`),m=h(`UIcon`),g=t=>n(`update:files`,e.files.filter((e,n)=>n!==t)),_=async(t,r)=>{let i=d++;o.value++;try{let n=Array.from(t),a=e.filterFiles?.(n)??n;if(a.length===0)return;r?.();let o=await Promise.all(Array.from(a,Rt));l||f.set(i,o)}catch(e){l||n(`error`,e)}finally{if(o.value--,!l&&o.value===0&&f.size>0){let t=[...f].sort(([e],[t])=>e-t).flatMap(([,e])=>e);f.clear(),n(`update:files`,zt(e.files,t,e.multiple))}}},v=async t=>{let n=t.clipboardData;if(!e.attachments||!n)return;let r=n.getData(`text/plain`).length>0,i=Array.from(n.files).filter(e=>e.type.startsWith(`image/`)||!r);i.length!==0&&await _(i,()=>t.preventDefault())},y=t=>{t.preventDefault(),c.value&&n(`submit`,{files:e.files,text:e.modelValue.trim()})},b=()=>{e.status===`streaming`||e.status===`submitted`?n(`stop`):e.status===`error`?n(`reload`):a.value?.requestSubmit()},x=()=>R(jt,{"data-slot":`prompt-input-attachments`},()=>e.files.map((e,t)=>{let n=e.filename??e.mediaType,r=e.mediaType.startsWith(`image/`);return R(At,{key:`${e.filename}-${t}`,size:`xs`},()=>[R(Mt,{variant:r?`image`:`icon`},()=>r?R(Qe,{alt:n,compact:!0,src:e.url}):R(m,{name:`i-ph-file-light`})),R(Nt,()=>R(Pt,()=>n)),R(Ft,()=>R(It,{"aria-label":`Remove ${e.filename??`attachment`}`,icon:`i-ph-x-light`,onClick:()=>g(t)}))])}));return()=>R(`form`,{...t,"data-slot":`prompt-input`,onSubmit:y,ref:a},[R(`div`,{"data-slot":`prompt-input-group`},[e.files.length>0||r.files?r.files?.({files:e.files,remove:g})??x():null,R(`textarea`,{"aria-label":t[`aria-label`]??`Message`,"data-slot":`prompt-input-textarea`,onInput:e=>n(`update:modelValue`,e.target.value),onKeydown:t=>{t.key!==`Enter`||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||t.isComposing||Ht()||(t.preventDefault(),e.status===`ready`&&a.value?.requestSubmit())},onPaste:v,placeholder:e.placeholder,rows:1,value:e.modelValue}),R(`div`,{"data-slot":`prompt-input-toolbar`},[e.attachments&&R(`input`,{accept:e.accept,"aria-label":`Add attachment`,class:`vh-visually-hidden`,multiple:e.multiple,onChange:async e=>{let t=e.currentTarget;t instanceof HTMLInputElement&&(await _(t.files??[]),t.value=``)},ref:i,tabindex:-1,type:`file`}),r.actions?.()??(e.attachments&&R(p,{"aria-label":`Add attachment`,class:`rounded-full`,color:`neutral`,icon:`i-ph-plus`,onClick:()=>i.value?.click(),size:`sm`,square:!0,type:`button`,variant:`outline`})),r[`footer-leading`]?.(),R(`span`,{"data-slot":`prompt-input-spacer`}),r.submit?.({canSubmit:c.value,preparingFiles:s.value,status:e.status})??R(p,{"aria-label":e.status===`ready`&&e.submitLabel?e.submitLabel:Bt[e.status],class:`rounded-full`,color:`neutral`,disabled:e.status===`ready`&&!c.value,icon:Vt[e.status],loading:e.status===`ready`&&s.value,onClick:b,size:`sm`,square:!0,type:`button`,variant:`solid`})])])])}});function Wt(e){if(Ee(e,`string`))return e;let t=[];try{return JSON.stringify(e,function(e,n){if(Ee(n,`bigint`))return`${n}n`;if(!Ee(n,`object`)||n===null)return n;for(;t.length&&t.at(-1)!==this;)t.pop();return t.includes(n)?`[Circular]`:(t.push(n),n)},2)??String(e)}catch(e){let t;try{let n=e?.message;if(typeof n==`string`)t=n;else if(n!==void 0)try{t=String(n)}catch{}}catch{}if(t===void 0)return`[Unable to display payload]`;try{return`[Unable to display payload: ${t}]`}catch{return`[Unable to display payload]`}}}function Gt(e,t){if(t===void 0)return R(`p`,{class:`vh-agent-tool-list__unavailable`},`${e} not recorded.`);let n=Ee(t,`string`)?JSON.stringify(t):Wt(t),r;try{r=JSON.parse(n)}catch{r=void 0}let i=Ee(r,`object`)&&r!==null&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):void 0,a=i?.properties,o=Ee(a,`object`)&&a!==null&&!Array.isArray(a)?Object.entries(a):[],s=Array.isArray(i?.required)?i.required:[];return R(`section`,{class:`vh-agent-tool-list__schema`},[R(`strong`,e),o.length?R(`table`,{class:`vh-agent-tool-list__properties`},[R(`thead`,[R(`tr`,[R(`th`,`Field`),R(`th`,`Type`),R(`th`,`Description`)])]),R(`tbody`,o.map(([e,t])=>{let n=Ee(t,`object`)&&t!==null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t)):{};return R(`tr`,[R(`td`,[R(`code`,e),s.includes(e)?R(`small`,`Required`):null]),R(`td`,Array.isArray(n.type)?n.type.join(` | `):String(n.type||(n.$ref?`Reference`:`See schema`))),R(`td`,Ee(n.description,`string`)?n.description:`—`)])}))]):null,R(`details`,{open:!o.length},[R(`summary`,`JSON schema`),R(`pre`,n)])])}var Kt=j({name:`ToolList`,emits:{select:e=>!!e},props:{calls:{required:!1,type:Object},tools:{required:!0,type:Array}},setup(e,{emit:t}){let n=k(),r=n?.appContext.components.UIcon,i=e=>r&&e.icon?R(`span`,{"aria-hidden":`true`,class:`vh-agent-tool-list__icon`},[R(r,{name:e.icon})]):null;return()=>R(`div`,{class:`vh-agent-tool-list`},e.tools.map(r=>{let a=e.calls?.[r.name],o=a?`${a} call${a===1?``:`s`}`:void 0,s=e.calls?o&&n?.vnode.props?.onSelect?R(`button`,{"aria-label":`${o}, show the first call`,class:`vh-agent-tool-list__count`,onClick:e=>{e.preventDefault(),e.stopPropagation(),t(`select`,r.name)},title:`Show the first call`,type:`button`},o):R(`span`,{"aria-label":o??`Not used`,class:`vh-agent-tool-list__count`},o??`—`):null,c={"data-used":e.calls?a?`true`:`false`:void 0,key:r.name};return r.description||r.inputSchema!==void 0||r.outputSchema!==void 0?R(`details`,{...c,class:`vh-agent-tool-list__disclosure`},[R(`summary`,[i(r),R(`code`,r.name),R(`small`,r.label||r.description||`Tool contract`),s,R(`svg`,{"aria-hidden":`true`,class:`vh-agent-tool-list__chevron`,fill:`none`,viewBox:`0 0 24 24`},[R(`path`,{d:`m7 10 5 5 5-5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})])]),R(`div`,{class:`vh-agent-tool-list__body`},[r.mcp?R(`p`,[`MCP tool: `,R(`code`,r.mcp.name),` on `,R(`code`,r.mcp.server)]):null,r.description?R(`p`,r.description):null,Gt(`Input schema`,r.inputSchema),Gt(`Output schema`,r.outputSchema)])]):R(`div`,{...c,class:`vh-agent-tool-list__item`},[i(r),R(`code`,r.name),r.label?R(`small`,r.label):null,s])}))}}),qt=typeof document<`u`;function G(e,t=`Assertion failed!`){if(!e)throw console.error(t),Error(t)}function Jt(e,t=document){return qt?t instanceof HTMLElement&&t?.dataset?.panelGroupId===e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null:null}function Yt(e,t=document){return qt&&t.querySelector(`[data-panel-resize-handle-id="${e}"]`)||null}function Xt(e,t,n=document){return qt?Zt(e,n).findIndex(e=>e.getAttribute(`data-panel-resize-handle-id`)===t)??null:null}function Zt(e,t=document){return qt?Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`)):[]}function Qt(e,t,n,r=document){let i=Yt(t,r),a=Zt(e,r),o=i?a.indexOf(i):-1;return[n[o]?.id??null,n[o+1]?.id??null]}function $t(e){return e.type===`keydown`}function en(e){return e.type.startsWith(`mouse`)}function tn(e){return e.type.startsWith(`touch`)}function nn(e){if(en(e))return{x:e.clientX,y:e.clientY};if(tn(e)){let t=e.touches[0];if(t&&t.clientX&&t.clientY)return{x:t.clientX,y:t.clientY}}return{x:1/0,y:1/0}}function rn(e,t){let n=e===`horizontal`,{x:r,y:i}=nn(t);return n?r:i}function an(e,t,n,r,i){let a=n===`horizontal`,o=Yt(t,i);G(o);let s=o.getAttribute(`data-panel-group-id`);G(s);let{initialCursorPosition:c}=r,l=rn(n,e),u=Jt(s,i);G(u);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function on(e,t,n,r,i,a){if($t(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100}return a}return r==null?0:an(e,t,n,r,a)}function sn({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return G(s!=null),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function cn({panelDataArray:e}){let t=Array.from({length:e.length}),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];G(e);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];G(o);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function ln(e,t,n=10){e=Number.parseFloat(e.toFixed(n)),t=Number.parseFloat(t.toFixed(n));let r=e-t;return r===0?0:r>0?1:-1}function K(e,t,n){return ln(e,t,n)===0}function un(e,t,n,r){t.forEach((t,i)=>{let a=e[i];G(a);let{callbacks:o,constraints:s,id:c}=a,{collapsedSize:l=0,collapsible:u,sizeUnit:d}=s,f=t;d===`px`&&r!=null&&(f=t/100*r);let p=n[c];if(p==null||!K(f,p)){n[c]=f;let{onCollapse:e,onExpand:t,onResize:r}=o;r&&r(f,p),u&&(e||t)&&(t&&(p==null||K(p,l))&&!K(f,l)&&t(),e&&(p==null||!K(p,l))&&K(f,l)&&e())}})}function dn(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function fn({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];G(r!=null);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(ln(n,s)<0){if(a){let e=(i+s)/2;n=ln(n,e)<0?i:s}else n=s}return n=Math.min(o,n),n=Number.parseFloat(n.toFixed(10)),n}function pn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function mn({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(K(e,0))return t;let a=[...t],[o,s]=r;G(o!=null),G(s!=null);let c=0;if(i===`keyboard`){{let r=e<0?s:o,i=n[r];if(G(i),i.collapsible){let i=t[r];G(i!=null);let a=n[r];G(a);let{collapsedSize:o=0,minSize:s=0}=a;if(K(i,o)){let t=s-i;ln(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?o:s,i=n[r];G(i);let{collapsible:a}=i;if(a){let i=t[r];G(i!=null);let a=n[r];G(a);let{collapsedSize:o=0,minSize:s=0}=a;if(K(i,s)){let t=i-o;ln(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?s:o,a=0;for(;;){let e=t[i];G(e!=null);let o=fn({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let c=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-c:c}{let r=e<0?o:s;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(c),o=t[r];G(o!=null);let s=o-i,l=fn({panelConstraints:n,panelIndex:r,size:s});if(!K(o,l)&&(c+=o-l,a[r]=l,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(K(c,0))return t;{let r=e<0?s:o,i=t[r];G(i!=null);let l=i+c,u=fn({panelConstraints:n,panelIndex:r,size:l});if(a[r]=u,!K(u,l)){let t=l-u,r=e<0?s:o;for(;r>=0&&r<n.length;){let i=a[r];G(i!=null);let o=i+t,s=fn({panelConstraints:n,panelIndex:r,size:o});if(K(i,s)||(t-=s-i,a[r]=s),K(t,0))break;e>0?r--:r++}}}return K(a.reduce((e,t)=>t+e,0),100)?a:t}function hn(e,t,n){let r=Xt(e,t,n);return r==null?[-1,-1]:[r,r+1]}function gn(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function _n(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Cn(e),b:Cn(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;G(r);let i={a:Sn(xn(n.a)),b:Sn(xn(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var vn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function yn(e){let t=getComputedStyle(wn(e)).display;return t===`flex`||t===`inline-flex`}function bn(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||yn(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||vn.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function xn(e){let t=e.length;for(;t--;){let n=e[t];if(G(n),bn(n))return n}return null}function Sn(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Cn(e){let t=[];for(;e;)t.push(e),e=wn(e);return t}function wn(e){return e.parentNode instanceof DocumentFragment&&e.parentNode?.host||e.parentNode}function Tn(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}var En=Tn()===`coarse`,Dn=[],On=!1,kn=new Map,An=new Map,jn=new Set;function Mn(e,t,n,r,i,a){let{ownerDocument:o}=t,s={direction:n,element:t,hitAreaMargins:r,nonce:i,setResizeHandlerState:a},c=kn.get(o)??0;return kn.set(o,c+1),jn.add(s),Vn(),function(){An.delete(e),jn.delete(s);let t=kn.get(o)??1;kn.set(o,t-1),Vn(),Kn(),t===1&&kn.delete(o)}}function Nn(e){let{target:t}=e,{x:n,y:r}=nn(e);On=!0,Rn({target:t,x:n,y:r}),Vn(),Dn.length>0&&(Hn(`down`,e),e.preventDefault())}function Pn(e){let{x:t,y:n}=nn(e);if(!On){let{target:r}=e;Rn({target:r,x:t,y:n})}Hn(`move`,e),Bn(),Dn.length>0&&e.preventDefault()}function Fn(e){!On&&In(e.relatedTarget)&&(Dn.splice(0),Hn(`move`,e),Bn())}function In(e){return e!==null&&`tagName`in e&&e.tagName===`IFRAME`}function Ln(e){let{target:t}=e,{x:n,y:r}=nn(e);An.clear(),On=!1,Dn.length>0&&e.preventDefault(),Hn(`up`,e),Rn({target:t,x:n,y:r}),Bn(),Vn()}function Rn({target:e,x:t,y:n}){Dn.splice(0);let r=null;e instanceof HTMLElement&&(r=e),jn.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=En?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&_n(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if(gn(e.getBoundingClientRect(),o,!0)){t=!0;break}e=e.parentElement}if(t)return}Dn.push(e)}})}function zn(e,t){An.set(e,t)}function Bn(){let e=!1,t=!1,n;Dn.forEach(r=>{let{direction:i,nonce:a}=r;i.value===`horizontal`?e=!0:t=!0,n=a.value});let r=0;An.forEach(e=>{r|=e}),e&&t?qn(`intersection`,r,n):e?qn(`horizontal`,r,n):t?qn(`vertical`,r,n):Kn()}function Vn(){kn.forEach((e,t)=>{let{body:n}=t;n.removeEventListener(`contextmenu`,Ln),n.removeEventListener(`mousedown`,Nn),n.removeEventListener(`mouseleave`,Pn),n.removeEventListener(`mousemove`,Pn),n.removeEventListener(`mouseout`,Fn),n.removeEventListener(`touchmove`,Pn),n.removeEventListener(`touchstart`,Nn)}),window.removeEventListener(`mouseup`,Ln),window.removeEventListener(`touchcancel`,Ln),window.removeEventListener(`touchend`,Ln),jn.size>0&&(On?(Dn.length>0&&kn.forEach((e,t)=>{let{body:n}=t;e>0&&(n.addEventListener(`contextmenu`,Ln),n.addEventListener(`mouseleave`,Pn),n.addEventListener(`mousemove`,Pn),n.addEventListener(`touchmove`,Pn,{passive:!1}))}),window.addEventListener(`mouseup`,Ln),window.addEventListener(`touchcancel`,Ln),window.addEventListener(`touchend`,Ln)):kn.forEach((e,t)=>{let{body:n}=t;e>0&&(n.addEventListener(`mousedown`,Nn),n.addEventListener(`mousemove`,Pn),n.addEventListener(`mouseout`,Fn),n.addEventListener(`touchmove`,Pn,{passive:!1}),n.addEventListener(`touchstart`,Nn))}))}function Hn(e,t){jn.forEach(n=>{let{setResizeHandlerState:r}=n;r(e,Dn.includes(n),t)})}var Un=null,Wn=null;function Gn(e,t){if(t){let e=!!(t&1),n=!!(t&2),r=!!(t&4),i=!!(t&8);if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function Kn(){Wn!==null&&(document.head.removeChild(Wn),Un=null,Wn=null)}function qn(e,t,n){let r=Gn(e,t);Un!==r&&(Un=r,Wn===null&&(Wn=document.createElement(`style`),n&&(Wn.nonce=n),document.head.appendChild(Wn)),Wn.textContent=`*{cursor: ${r}!important;}`)}function Jn({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e===void 0?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function Yn({sizeUnit:e,groupSizeInPixels:t,value:n}){if(n==null||e===`%`)return n;if(t!=null&&t!==0)return n/t*100}function Xn({panelDataArray:e,groupSizeInPixels:t}){return e.some(e=>(e.constraints.sizeUnit??`%`)===`px`)&&(!t||Number.isNaN(t))?null:e.map(e=>{let n=e.constraints,r=n.sizeUnit??`%`,i=Yn({groupSizeInPixels:t,sizeUnit:r,value:n.collapsedSize}),a=Yn({groupSizeInPixels:t,sizeUnit:r,value:n.defaultSize}),o=Yn({groupSizeInPixels:t,sizeUnit:r,value:n.maxSize}),s=Yn({groupSizeInPixels:t,sizeUnit:r,value:n.minSize});return{...n,collapsedSize:i??n.collapsedSize??0,defaultSize:a,maxSize:o??100,minSize:s??0,sizeUnit:`%`}})}function Zn(e){return e.some(e=>(e.constraints.sizeUnit??`%`)===`px`)}function Qn({layout:e,panelDataArray:t,prevGroupSize:n,nextGroupSize:r}){if(!Zn(t)||n==null||r==null||n===0||r===0||Number.isNaN(n)||Number.isNaN(r))return null;let i=t.reduce((e,t,n)=>((t.constraints.sizeUnit??`%`)===`px`&&e.push(n),e),[]);if(i.length===0)return null;let a=new Set(i),o=e.map(e=>e??0);i.reduce((t,n)=>t+(e[n]??0),0);let s=i.map(t=>(e[t]??0)/100*n/r*100),c=s.reduce((e,t)=>e+t,0),l=e.reduce((e,t,n)=>a.has(n)?e:e+(t??0),0),u=Math.max(0,100-c),d=l>0?u/l:0;i.forEach((e,t)=>{o[e]=s[t]});for(let t=0;t<o.length;t++){if(a.has(t))continue;let n=e[t]??0;o[t]=n*d}let f=o.reduce((e,t)=>e+t,0);if(f>0&&Math.abs(f-100)>1e-9){let e=100/f;for(let t=0;t<o.length;t++)o[t]=(o[t]??0)*e}return o}function $n({layout:e,panelConstraints:t}){let n=[...e];if(n.length===0&&t.length===0)return n;let r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!K(r,100)){console.warn(`WARNING: Invalid layout total size: ${n.map(e=>`${e}%`).join(`, `)}. Layout normalization will be applied.`);for(let e=0;e<t.length;e++){let t=n[e];G(t!=null);let i=100/r*t;n[e]=i}}let i=0;for(let e=0;e<t.length;e++){let r=n[e];G(r!=null);let a=fn({panelConstraints:t,panelIndex:e,size:r});r!==a&&(i+=r-a,n[e]=a)}if(!K(i,0))for(let e=0;e<t.length;e++){let r=n[e];G(r!=null);let a=r+i,o=fn({panelConstraints:t,panelIndex:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,K(i,0)))break}return n}function er({eagerValuesRef:e,groupId:t,layout:n,panelDataArray:r,panelGroupElement:i,setLayout:a,getPanelDataWithPercentConstraints:o}){d(e=>{let r=i.value;if(!r)return;let a=o();if(!a)return;let s=Zt(t,r);for(let e=0;e<a.length-1;e++){let{valueMax:t,valueMin:r,valueNow:i}=sn({layout:n.value,panelsArray:a,pivotIndices:[e,e+1]}),o=s[e];if(o!=null){let n=a[e];G(n),o.setAttribute(`aria-controls`,n.id),o.setAttribute(`aria-valuemax`,`${Math.round(t)}`),o.setAttribute(`aria-valuemin`,`${Math.round(r)}`),o.setAttribute(`aria-valuenow`,i==null?``:`${Math.round(i)}`)}}e(()=>{s.forEach(e=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})})}),d(r=>{let s=i.value;if(!s)return;let c=e.value;G(c);let l=o();if(!l)return;let{panelDataArray:u}=c;G(Jt(t,s)!=null,`No group found for id "${t}"`);let d=Zt(t,s);G(d);let f=d.map(e=>{let r=e.getAttribute(`data-panel-resize-handle-id`);G(r);let[i,o]=Qt(t,r,u,s);if(i==null||o==null)return()=>{};let c=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let o=l.findIndex(e=>e.id===i);if(o>=0){let e=l[o];G(e);let i=n.value[o],{collapsedSize:c=0,collapsible:u,minSize:d=0}=e.constraints;if(i!=null&&u){let e=mn({delta:K(i,c)?d-c:c-i,layout:n.value,panelConstraints:l.map(e=>e.constraints),pivotIndices:hn(t,r,s),trigger:`keyboard`});n.value!==e&&a(e)}}break}}};return e.addEventListener(`keydown`,c),()=>{e.removeEventListener(`keydown`,c)}});r(()=>{f.forEach(e=>e())})})}function tr(e){try{if(typeof localStorage<`u`)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw TypeError(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function nr(e){return`reka:${e}`}function rr(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function ir(e,t){try{let n=nr(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function ar(e,t,n){return(ir(e,n)??{})[rr(t)]??null}function or(e,t,n,r,i){let a=nr(e),o=rr(t),s=ir(e,i)??{},c={};t.forEach((e,t)=>{(e.constraints.sizeUnit??`%`)===`px`&&(c[t]=`px`)}),s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r,...Object.keys(c).length>0&&{sizeUnits:c}};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}var sr=100,cr={getItem:e=>(tr(cr),cr.getItem(e)),setItem:(e,t)=>{tr(cr),cr.setItem(e,t)}},[lr,ur]=We(`PanelGroup`),dr=j({__name:`SplitterGroup`,props:{id:{type:[String,null],required:!1},autoSaveId:{type:[String,null],required:!1,default:null},direction:{type:String,required:!0},keyboardResizeBy:{type:[Number,null],required:!1,default:10},storage:{type:Object,required:!1,default:()=>cr},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`layout`],setup(e,{emit:t}){let n=e,a=t,o={},{direction:s}=N(n),c=rt(n.id,`reka-splitter-group`),f=Oe(),{forwardRef:p,currentElement:m}=He(),h=C(null),g=C(null),_=C(null),v=C([]),y=C({}),b=C(new Map),x=C(0),w=u(()=>({autoSaveId:n.autoSaveId,direction:n.direction,dragState:h.value,id:c,keyboardResizeBy:n.keyboardResizeBy,storage:n.storage})),T=C({layout:v.value,panelDataArray:[],panelDataArrayChanged:!1});function E(){if(g.value!=null)return g.value;let e=m.value;if(e&&e instanceof HTMLElement){let t=e.getBoundingClientRect(),n=s.value===`horizontal`?t.width:t.height;if(!Number.isNaN(n))return g.value=n,n}return null}function D(e){let t=e??E();return Xn({panelDataArray:T.value.panelDataArray,groupSizeInPixels:t})}function k(e){let t=D(e);return t?T.value.panelDataArray.map((e,n)=>({...e,constraints:t[n]})):null}let A=e=>v.value=e;function ee(e){let{panelDataArray:t}=T.value,n=E();return e.map((e,r)=>{let i=t[r];return i&&(i.constraints.sizeUnit??`%`)===`px`&&n!=null?e/100*n:e})}er({eagerValuesRef:T,groupId:c,layout:v,panelDataArray:T.value.panelDataArray,setLayout:A,panelGroupElement:m,getPanelDataWithPercentConstraints:k}),d(e=>{let t=m.value;if(!t||typeof ResizeObserver!=`function`)return;let n=new ResizeObserver(e=>{let t=e[0];if(!t)return;let{height:n,width:r}=t.contentRect,i=s.value===`horizontal`?r:n;Number.isNaN(i)||(g.value=i)});t instanceof HTMLElement&&n.observe(t),e(()=>n.disconnect())}),d(()=>{let{panelDataArray:e}=T.value,{autoSaveId:t}=n;if(t){if(v.value.length===0||v.value.length!==e.length)return;let r=o[t];r||(r=dn(or,sr),o[t]=r);let i=[...e],a=new Map(b.value);r(t,i,a,v.value,n.storage)}});function j(e,t){let{panelDataArray:n}=T.value,r=B(n,e);return Jn({defaultSize:t,dragState:h.value,layout:v.value,panelData:n,panelIndex:r})}function te(e){let{panelDataArray:t}=T.value;t.push(e),t.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),T.value.panelDataArrayChanged=!0}l(()=>T.value.panelDataArrayChanged,()=>{if(T.value.panelDataArrayChanged){T.value.panelDataArrayChanged=!1;let{autoSaveId:e,storage:t}=w.value,{layout:n,panelDataArray:r}=T.value,i=null;if(e){let n=ar(e,r,t);n&&(b.value=new Map(Object.entries(n.expandToSizes)),i=n.layout)}if(i===null){let e=k();if(!e)return;i=cn({panelDataArray:e})}let o=D();if(!o)return;let s=$n({layout:i,panelConstraints:o});_.value=E(),we(n,s)||(A(s),T.value.layout=s,a(`layout`,ee(s)),un(r,s,y.value,E()))}}),l(g,(e,t)=>{if(t==null||e==null)return;let{layout:n,panelDataArray:r}=T.value;if(n.length===0||!Zn(r))return;let i=_.value;if(i!=null&&i>0&&i<50&&e>i*10){T.value.panelDataArrayChanged=!0;return}let o=Qn({layout:n,panelDataArray:r,prevGroupSize:t,nextGroupSize:e});if(!o)return;let s=D(e);if(!s)return;let c=$n({layout:o,panelConstraints:s});pn(n,c)||(A(c),T.value.layout=c,a(`layout`,ee(c)),un(r,c,y.value,E()))});function M(e){return function(t){t.preventDefault();let n=m.value;if(!n)return()=>null;let{direction:r,dragState:i,id:o,keyboardResizeBy:s}=w.value,{layout:c,panelDataArray:l}=T.value,{initialLayout:u}=i??{},d=hn(o,e,n),p=on(t,e,r,i,s,n);if(p===0)return;let h=r===`horizontal`;f.value===`rtl`&&h&&(p=-p);let g=D();if(!g)return;let _=mn({delta:p,layout:u??c,panelConstraints:g,pivotIndices:d,trigger:$t(t)?`keyboard`:`mouse-or-touch`}),v=!pn(c,_);(en(t)||tn(t))&&x.value!==p&&(x.value=p,v?zn(e,0):h?zn(e,p<0?1:2):zn(e,p<0?4:8)),v&&(A(_),T.value.layout=_,a(`layout`,ee(_)),un(l,_,y.value,E()))}}function re(e,t){let{layout:n,panelDataArray:r}=T.value,i=D();if(!i)return;let o=B(r,e),s=e.constraints.sizeUnit??`%`,c=t;if(s===`px`){let e=E();e!=null&&(c=t/e*100)}let{panelSize:l,pivotIndices:u}=V(r,e,n,i);G(l!=null);let d=mn({delta:o===r.length-1?l-c:c-l,layout:n,panelConstraints:i,pivotIndices:u,trigger:`imperative-api`});pn(n,d)||(A(d),T.value.layout=d,a(`layout`,ee(d)),un(r,d,y.value,E()))}function P(e,t){let{layout:n,panelDataArray:r}=T.value,i=B(r,e);r[i]=e,T.value.panelDataArrayChanged=!0;let a=D();if(!a)return;let o=a[i],{panelSize:s}=V(r,e,n,a);if(s===null)return;let c=o?.collapsedSize??0,l=o?.maxSize??100,u=o?.minSize??0;o?.collapsible&&z(e)?s!==c&&re(e,c):s<u?re(e,u):s>l&&re(e,l)}function ie(e,t){let{direction:n}=w.value,{layout:r}=T.value;if(!m.value)return;let i=Yt(e,m.value);G(i);let a=rn(n,t);h.value={dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}}function ae(){h.value=null}function F(e){let{panelDataArray:t}=T.value,n=B(t,e);n>=0&&(t.splice(n,1),delete y.value[e.id],T.value.panelDataArrayChanged=!0)}function I(e){let{layout:t,panelDataArray:n}=T.value;if(e.constraints.collapsible){let r=D();if(!r)return;let{collapsedSize:i=0,panelSize:o,pivotIndices:s}=V(n,e,t,r);if(G(o!=null,`Panel size not found for panel "${e.id}"`),o!==i){let c=e.constraints.sizeUnit??`%`,l=g.value??E(),u=c===`px`&&l?o/100*l:o;b.value.set(e.id,u);let d=mn({delta:B(n,e)===n.length-1?o-i:i-o,layout:t,panelConstraints:r,pivotIndices:s,trigger:`imperative-api`});pn(t,d)||(A(d),T.value.layout=d,a(`layout`,ee(d)),un(n,d,y.value,E()))}}}function L(e){let{layout:t,panelDataArray:n}=T.value;if(e.constraints.collapsible){let r=D();if(!r)return;let{collapsedSize:i=0,panelSize:o=0,minSize:s=0,pivotIndices:c}=V(n,e,t,r);if(ln(o,i)<=0){let i=b.value.get(e.id),l=e.constraints.sizeUnit??`%`,u=g.value??E(),d=l===`px`&&u?i==null?null:i/u*100:i,f=d!=null&&d>=s?d:s,p=mn({delta:B(n,e)===n.length-1?o-f:f-o,layout:t,panelConstraints:r,pivotIndices:c,trigger:`imperative-api`});pn(t,p)||(A(p),T.value.layout=p,a(`layout`,ee(p)),un(n,p,y.value,E()))}}}function R(e){let{layout:t,panelDataArray:n}=T.value,{panelSize:r}=V(n,e,t);if(G(r!=null,`Panel size not found for panel "${e.id}"`),(e.constraints.sizeUnit??`%`)===`px`){let e=E();if(e!=null)return r/100*e}return r}function z(e){let{layout:t,panelDataArray:n}=T.value,r=D(),{collapsedSize:i=0,collapsible:a,panelSize:o}=V(n,e,t,r??void 0);if(!a)return!1;if(o===void 0){let t=B(n,e),i=r?.[t]??e.constraints;return i.defaultSize===i.collapsedSize}return ln(o,i)<=0}function oe(e){let{layout:t,panelDataArray:n}=T.value,{collapsedSize:r=0,collapsible:i,panelSize:a}=V(n,e,t,D()??void 0);return G(a!=null,`Panel size not found for panel "${e.id}"`),!i||ln(a,r)>0}ur({direction:s,dragState:h.value,groupId:c,reevaluatePanelConstraints:P,registerPanel:te,registerResizeHandle:M,resizePanel:re,startDragging:ie,stopDragging:ae,unregisterPanel:F,panelGroupElement:m,collapsePanel:I,expandPanel:L,isPanelCollapsed:z,isPanelExpanded:oe,getPanelSize:R,getPanelStyle:j});function B(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function V(e,t,n,r){let i=B(e,t),a=i===e.length-1?[i-1,i]:[i,i+1],o=(r??D())?.[i],s=n[i];return{...o??t.constraints,panelSize:s,pivotIndices:a}}return(e,t)=>(H(),S(O(Ke),{ref:O(p),as:e.as,"as-child":e.asChild,style:ne({display:`flex`,flexDirection:O(s)===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`}),"data-panel-group":``,"data-orientation":O(s),"data-panel-group-id":O(c)},{default:r(()=>[i(e.$slots,`default`,{layout:v.value})]),_:3},8,[`as`,`as-child`,`style`,`data-orientation`,`data-panel-group-id`]))}}),fr=j({__name:`SplitterPanel`,props:{collapsedSize:{type:Number,required:!1},collapsible:{type:Boolean,required:!1},defaultSize:{type:Number,required:!1},id:{type:String,required:!1},maxSize:{type:Number,required:!1},minSize:{type:Number,required:!1},order:{type:Number,required:!1},sizeUnit:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`collapse`,`expand`,`resize`],setup(e,{expose:t,emit:n}){let a=e,o=n,s=lr();if(s===null)throw Error(`SplitterPanel components must be rendered within a SplitterGroup container`);let{collapsePanel:c,expandPanel:d,getPanelSize:f,getPanelStyle:p,isPanelCollapsed:m,resizePanel:h,groupId:g,reevaluatePanelConstraints:v,registerPanel:y,unregisterPanel:b}=s,x=rt(a.id,`reka-splitter-panel`),C=u(()=>({callbacks:{onCollapse:()=>o(`collapse`),onExpand:()=>o(`expand`),onResize:(...e)=>o(`resize`,...e)},constraints:{collapsedSize:a.collapsedSize&&Number.parseFloat(a.collapsedSize.toFixed(10)),collapsible:a.collapsible,defaultSize:a.defaultSize,maxSize:a.maxSize,minSize:a.minSize,sizeUnit:a.sizeUnit??`%`},id:x,idIsFromProps:a.id!==void 0,order:a.order}));l(()=>C.value.constraints,(e,t)=>{(t.collapsedSize!==e.collapsedSize||t.collapsible!==e.collapsible||t.maxSize!==e.maxSize||t.minSize!==e.minSize||t.sizeUnit!==e.sizeUnit)&&v(C.value,t)},{deep:!0}),se(()=>{y(C.value)}),_(()=>{b(C.value)});let w=u(()=>p(C.value,a.defaultSize)),T=u(()=>m(C.value)),E=u(()=>!T.value);function D(){c(C.value)}function k(){d(C.value)}function A(e){h(C.value,e)}return t({collapse:D,expand:k,getSize(){return f(C.value)},resize:A,isCollapsed:T,isExpanded:E}),(e,t)=>(H(),S(O(Ke),{id:O(x),style:ne(w.value),as:e.as,"as-child":e.asChild,"data-panel":``,"data-panel-collapsible":e.collapsible||void 0,"data-panel-group-id":O(g),"data-panel-id":O(x),"data-panel-size":Number.parseFloat(`${w.value.flexGrow}`).toFixed(1),"data-state":e.collapsible?T.value?`collapsed`:`expanded`:void 0},{default:r(()=>[i(e.$slots,`default`,{isCollapsed:T.value,isExpanded:E.value,expand:k,collapse:D,resize:A})]),_:3},8,[`id`,`style`,`as`,`as-child`,`data-panel-collapsible`,`data-panel-group-id`,`data-panel-id`,`data-panel-size`,`data-state`]))}});function pr({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){d(i=>{let a=r.value;if(e.value||n.value===null||a===null)return;let o=Yt(t,a);if(o==null)return;let s=e=>{if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),n.value?.(e);break;case`F6`:{e.preventDefault();let n=o.getAttribute(`data-panel-group-id`);G(n);let r=Zt(n,a),i=Xt(n,t,a);G(i!==null),r[e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0].focus();break}}};o.addEventListener(`keydown`,s),i(()=>{o.removeEventListener(`keydown`,s)})})}var mr=j({__name:`SplitterResizeHandle`,props:{id:{type:String,required:!1},hitAreaMargins:{type:Object,required:!1},tabindex:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`dragging`],setup(e,{emit:t}){let n=e,a=t,{forwardRef:o,currentElement:s}=He(),{disabled:c}=N(n),u=lr();if(u===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:f,groupId:p,registerResizeHandle:m,startDragging:h,stopDragging:g,panelGroupElement:_}=u,v=rt(n.id,`reka-splitter-resize-handle`),y=C(`inactive`),b=C(!1),x=C(null),{nonce:w}=N(n),T=it(w);return l(c,()=>{qt&&(c.value?x.value=null:x.value=m(v))},{immediate:!0}),d(e=>{if(c.value||x.value===null)return;let t=s.value;t&&(G(t),e(Mn(v,t,f,{coarse:n.hitAreaMargins?.coarse??15,fine:n.hitAreaMargins?.fine??5},T,(e,t,n)=>{if(t)switch(e){case`down`:y.value=`drag`,h(v,n),a(`dragging`,!0);break;case`move`:y.value!==`drag`&&(y.value=`hover`),x.value?.(n);break;case`up`:y.value=`hover`,g(),a(`dragging`,!1)}else y.value=`inactive`})))}),pr({disabled:c,resizeHandler:x,handleId:v,panelGroupElement:_}),(e,t)=>(H(),S(O(Ke),{id:O(v),ref:O(o),style:{touchAction:`none`,userSelect:`none`},as:e.as,"as-child":e.asChild,role:`separator`,"data-resize-handle":``,tabindex:e.tabindex,"data-state":y.value,"data-disabled":O(c)?``:void 0,"data-orientation":O(f),"data-panel-group-id":O(p),"data-resize-handle-active":y.value===`drag`?`pointer`:b.value?`keyboard`:void 0,"data-resize-handle-state":y.value,"data-panel-resize-handle-enabled":!O(c),"data-panel-resize-handle-id":O(v),onBlur:t[0]||=e=>b.value=!1,onFocus:t[1]||=e=>b.value=!1},{default:r(()=>[i(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`tabindex`,`data-state`,`data-disabled`,`data-orientation`,`data-panel-group-id`,`data-resize-handle-active`,`data-resize-handle-state`,`data-panel-resize-handle-enabled`,`data-panel-resize-handle-id`]))}}),hr={slots:{root:``,panel:`flex`,handle:`group relative shrink-0 focus-visible:outline-2 focus-visible:outline-primary data-[panel-resize-handle-enabled=false]:cursor-default`},variants:{orientation:{horizontal:{handle:`w-2 cursor-col-resize`},vertical:{handle:`h-2 cursor-row-resize`}}}},gr={__name:`Splitter`,props:{as:{type:null,required:!1},id:{type:String,required:!1},orientation:{type:null,required:!1,default:`horizontal`},items:{type:Array,required:!1},disabled:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},autoSaveId:{type:[String,null],required:!1},keyboardResizeBy:{type:[Number,null],required:!1},storage:{type:Object,required:!1},hitAreaMargins:{type:Object,required:!1}},emits:[`layout`,`collapse`,`expand`,`resize`,`dragging`],setup(e,{expose:t,emit:n}){let o=e,s=n,c=U(`splitter`,o),l=ue(),d=Ye(v(c,`as`,`id`,`autoSaveId`,`keyboardResizeBy`,`storage`)),f=u(()=>Ge({extend:hr,...l.ui?.splitter||{}})({orientation:c.orientation})),p=C([]);V(()=>{p.value.length=0});function m(e,t){return e.id??(c.id?`${c.id}-panel-${t}`:void 0)}function h(e){return c.id?`${c.id}-handle-${e}`:void 0}function _(e,t){t&&(p.value[e]=t)}return t({panelsRef:p}),(e,t)=>(H(),S(O(dr),ie(O(d),{direction:O(c).orientation,"data-slot":`root`,class:f.value.root({class:[O(c).ui?.root,O(c).class]}),onLayout:t[0]||=e=>s(`layout`,e)}),{default:r(()=>[(H(!0),g(x,null,a(O(c).items,(t,n)=>(H(),g(x,{key:t.id??n},[P(O(fr),{id:m(t,n),ref_for:!0,ref:e=>_(n,e),"default-size":t.defaultSize,"min-size":t.minSize,"max-size":t.maxSize,collapsible:t.collapsible,"collapsed-size":t.collapsedSize,"size-unit":t.sizeUnit,order:t.order,"data-slot":`panel`,class:L(f.value.panel({class:[O(c).ui?.panel,t.ui?.panel,t.class]})),onCollapse:e=>s(`collapse`,n),onExpand:e=>s(`expand`,n),onResize:(e,t)=>s(`resize`,n,e,t)},{default:r(({isCollapsed:r,collapse:a,expand:o,resize:s})=>[i(e.$slots,t.slot||`panel-${n}`,{item:t,index:n,collapsed:r,collapse:a,expand:o,resize:s,ui:f.value})]),_:2},1032,[`id`,`default-size`,`min-size`,`max-size`,`collapsible`,`collapsed-size`,`size-unit`,`order`,`class`,`onCollapse`,`onExpand`,`onResize`]),n<O(c).items.length-1?(H(),S(O(mr),{key:0,id:h(n),disabled:O(c).disabled,"hit-area-margins":O(c).hitAreaMargins,"data-slot":`handle`,class:L(f.value.handle({class:O(c).ui?.handle})),onDragging:e=>s(`dragging`,n,e)},{default:r(()=>[i(e.$slots,`resize-handle`,{index:n,ui:f.value})]),_:2},1032,[`id`,`disabled`,`hit-area-margins`,`class`,`onDragging`])):E(``,!0)],64))),128))]),_:3},16,[`direction`,`class`]))}};function _r(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function vr(e,t=`|`){return e.map(e=>Gr(e)).join(t)}function yr(e,t){return typeof t==`bigint`?t.toString():t}var br=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function xr(e){return new br(e)}function Sr(e){return e==null}function Cr(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function wr(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Tr=Symbol(`evaluating`);function Er(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Tr)return r===void 0&&(r=Tr,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Dr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Or(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function kr(e){return Or(e._zod.def)??e._zod.def.shape}function Ar(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Dr(this,t,e),e},enumerable:!0,configurable:!0})}function jr(e,t,n){t in e?Dr(e,t,n):e[t]=n}function Mr(e,t,n,r){let i=kr(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Ar(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):jr(e,a,r?r(n.value,a):n.value))}}function Nr(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ar(e,n,()=>t[n]):jr(e,n,r.value))}}function Pr(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Fr(e){return JSON.stringify(e)}function Ir(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Lr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Rr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var zr=xr(()=>{if(Pi.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Br(e){if(Rr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Rr(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Vr(e){return Br(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Hr=new Set([`string`,`number`,`symbol`]);function Ur(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Wr(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function q(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Gr(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Kr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var qr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jr={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Yr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Mr(i,e,Xr(e,t)),Wr(e,Pr(n,{shape:i,checks:[]}))}function Xr(e,t){let n=kr(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Zr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Xr(e,t)),a={};return Mr(a,e,Reflect.ownKeys(kr(e)).filter(e=>!i.has(e))),Wr(e,Pr(n,{shape:a,checks:[]}))}function Qr(e,t){if(!Br(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=kr(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Wr(e,Pr(e._zod.def,{shape:$r(e,t)}))}function $r(e,t){let n={};return Mr(n,e,Reflect.ownKeys(kr(e))),Nr(n,t),n}function ei(e,t){if(!Br(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Wr(e,Pr(e._zod.def,{shape:$r(e,t)}))}function ti(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Mr(n,e,Reflect.ownKeys(kr(e))),Mr(n,t,Reflect.ownKeys(kr(t))),Wr(e,Pr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ni(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Xr(t,n)):void 0,o={};return Mr(o,t,Reflect.ownKeys(kr(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Wr(t,Pr(t._zod.def,{shape:o,checks:[]}))}function ri(e,t,n){let r=n?new Set(Xr(t,n)):void 0,i={};return Mr(i,t,Reflect.ownKeys(kr(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Wr(t,Pr(t._zod.def,{shape:i}))}function ii(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ai(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function oi(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function si(e){return typeof e==`string`?e:e?.message}function ci(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function li(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ui(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:si(e.inst?._zod.def?.error?.(e))??si(a?.(e))??si(t?.error?.(e))??si(n.customError?.(e))??si(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var di=/[\uD800-\uDBFF]/;function fi(e){let t=e.length;if(!di.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function pi(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function mi(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function hi(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function gi(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):bi(e,n,r.value)}}function _i(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function vi(e,t,n){return _i(e,t,n,!1)}function yi(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return _i(this,n,r(this))},set(e){_i(this,n,e)}})}return t}function bi(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:_i(this,t,n.bind(this))},set(e){_i(this,t,e)}})}function xi(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Si,Ci=!1,wi={configurable:!0,get(){Ci=!0}};function J(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Si!==e._zod){Si=void 0;return}Si=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,wi);let e=Ci;Ci=!1;try{let r=n(this);return Ci?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Ci||=e,r}catch(n){throw delete this[t],Ci||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Ti(e,t,n,r){let i=xi(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ei=`~constantCatch`;function Di(e){let t=()=>e;return t[Ei]=!0,t}var Oi,ki={value:void 0,enumerable:!1},Ai=`captureStackTrace`in Error?Error:null;function ji(e){let t=Ai;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ai=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Y(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){ki.value=new a(r);try{Object.defineProperty(n,"_zod",ki)}finally{ki.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),gi(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?ji(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Mi=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ni=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Oi=globalThis).__zod_globalConfig??(Oi.__zod_globalConfig={});var Pi=globalThis.__zod_globalConfig;function Fi(e){return e&&Object.assign(Pi,e),Pi}function Ii(){let e=this._zod;return e.message??=JSON.stringify(e.def,yr,2),e.message}function Li(e){this._zod.message=e}var Ri={get:Ii,set:Li,enumerable:!0,configurable:!0},zi={value:void 0,enumerable:!1},Bi=new WeakSet([Object.prototype,Error.prototype]),Vi=(e,t)=>{e.name=`$ZodError`,zi.value=t,Object.defineProperty(e,"issues",zi),zi.value=void 0,Object.defineProperty(e,"message",Ri);let n=Object.getPrototypeOf(e);Bi.has(n)||(Bi.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Hi=Y(`$ZodError`,Vi);Y(`$ZodError`,Vi,void 0,{Parent:Error});function Ui(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Wi(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ui(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Gi(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Ki(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qi=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Mi;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ui(e,o,Fi())));throw Lr(n,a?.callee??t),n}return s.value};return t},Ji=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ui(e,o,Fi())));throw Lr(n,a?.callee??t),n}return s.value};return t},Yi=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Mi;return a.issues.length?Xi(e,a.issues,i):{success:!0,data:a.value}};function Xi(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ui(e,n,Fi()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Zi=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Xi(e,a.issues,i):{success:!0,data:a.value}},Qi=Symbol.for(`zod.compile.invalid`),$i=Symbol.for(`zod.compile.fallback`),ea=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Qi)return!0;if(r.definite===!0&&n===void 0)return!1}return ta(e,t,n)});function ta(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[$i]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Mi;return a.issues.length===0}var na=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ra=e=>{let t=qi(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ki(n,a))};return n},ia=e=>{let t=qi(e),n=(e,r,i,a)=>t(e,r,i,Ki(n,a));return n},aa=e=>{let t=Ji(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ki(n,a))};return n},oa=e=>{let t=Ji(e),n=async(e,r,i,a)=>await t(e,r,i,Ki(n,a));return n},sa=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Yi(e)(t,n,i)},ca=e=>(t,n,r)=>Yi(e)(t,n,r),la=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Zi(e)(t,n,i)},ua=e=>async(t,n,r)=>Zi(e)(t,n,r),da=/^[cC][0-9a-z]{6,}$/,fa=/^[0-9a-z]+$/,pa=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ma=/^[0-9a-vA-V]{20}$/,ha=/^[A-Za-z0-9]{27}$/,ga=/^[a-zA-Z0-9_-]{21}$/;function _a(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var va=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ya=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ba=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,xa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Sa=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Ca(){return new RegExp(Sa,`u`)}var wa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ta=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ea=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Da=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Oa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ka=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Aa=/^https?$/,ja=/^\+[1-9]\d{6,14}$/,Ma=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Na(e){return RegExp(`^${e}$`)}var Pa=Na(Ma);function Fa(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ia(e){return RegExp(`^${Fa(e)}$`)}function La(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Fa({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Fa({precision:e.precision})}`:n;return RegExp(`^${Ma}T(?:${r})$`)}var Ra=/^[\s\S]{0,}$/,za=/^-?\d+$/,Ba=/^-?\d+(?:\.\d+)?$/,Va=/^(?:true|false)$/i,Ha=/^null$/i,Ua=/^[^A-Z]*$/,Wa=/^[^a-z]*$/,Ga=Y(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ka=e=>{let t=e.value;return!Sr(t)&&t.length!==void 0},qa={number:`number`,bigint:`bigint`,object:`date`},Ja=Y(`$ZodCheckLessThan`,(e,t)=>{Ga.init(e,t);let n=qa[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:qa[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ya=Y(`$ZodCheckGreaterThan`,(e,t)=>{Ga.init(e,t);let n=qa[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:qa[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xa=Y(`$ZodCheckMultipleOf`,(e,t)=>{Ga.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):wr(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Za=Y(`$ZodCheckNumberFormat`,(e,t)=>{Ga.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=qr[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Qa=Y(`$ZodCheckMaxLength`,(e,t)=>{var n;Ga.init(e,t),(n=e._zod.def).when??(n.when=Ka),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?fi(r):i)<=t.maximum)return;let a=pi(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$a=Y(`$ZodCheckMinLength`,(e,t)=>{var n;Ga.init(e,t),(n=e._zod.def).when??(n.when=Ka),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?fi(r):i)>=t.minimum)return;let a=pi(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eo=Y(`$ZodCheckLengthEquals`,(e,t)=>{var n;Ga.init(e,t),(n=e._zod.def).when??(n.when=Ka),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?fi(r):i;if(a===t.length)return;let o=pi(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),to=Y(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Ga.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),no=Y(`$ZodCheckRegex`,(e,t)=>{to.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ro=Y(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ua,to.init(e,t)}),io=Y(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Wa,to.init(e,t)}),ao=Y(`$ZodCheckIncludes`,(e,t)=>{Ga.init(e,t);let n=Ur(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),oo=Y(`$ZodCheckStartsWith`,(e,t)=>{Ga.init(e,t);let n=RegExp(`^${Ur(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),so=Y(`$ZodCheckEndsWith`,(e,t)=>{Ga.init(e,t);let n=RegExp(`.*${Ur(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),co=Y(`$ZodCheckOverwrite`,(e,t)=>{Ga.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),lo=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
4
|
+
`)}\n};`)(...Object.values(this.closed))}},uo={major:4,minor:6,patch:7},fo=Y(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uo;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=ii(t),a;for(let o of n){if(o._zod.def.when){if(ai(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Mi;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(li(t.issues,n,e),i||=ii(t,n))});else{if(t.issues.length===n)continue;li(t.issues,n,e),i||=ii(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(ii(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Mi;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Mi;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return vi(this,`~standard`,ho(this))},set"~standard"(e){_i(this,`~standard`,e)}}),po=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ui(e,t,Fi()))}:{value:e.value};async function mo(e,t){let n={async:!0};return po(await e._zod.run({value:t,issues:[]},n),n)}function ho(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return po(r,n)}catch{}return mo(e,t)},vendor:`zod`,version:1}}var go=Y(`$ZodString`,(e,t)=>{fo.init(e,t),e._zod.pattern=t.pattern??Ra,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),_o=Y(`$ZodStringFormat`,(e,t)=>{to.init(e,t),go.init(e,t)}),vo=Y(`$ZodGUID`,(e,t)=>{t.pattern??=ya,_o.init(e,t)}),yo=Y(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ba(e)}else t.pattern??=ba();_o.init(e,t)}),bo=Y(`$ZodEmail`,(e,t)=>{t.pattern??=xa,_o.init(e,t)});function xo(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function So(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?xo(e)||2:Co(e,t)}function Co(e,t){if(!t.normalize&&t.protocol?.source===Aa.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var wo=/[\t\n\r]/g;function To(e){return e.replace(wo,``)}function Eo(e,t){return t.lastIndex=0,t.test(e.hostname)}function Do(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Oo=Y(`$ZodURL`,(e,t)=>{_o.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=So(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=To(r);return}t.hostname&&!Eo(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Do(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:To(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ko=Y(`$ZodEmoji`,(e,t)=>{t.pattern??=Ca(),_o.init(e,t)}),Ao=Y(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?ga:_a(t.length),_o.init(e,t)}),jo=Y(`$ZodCUID`,(e,t)=>{t.pattern??=da,_o.init(e,t)}),Mo=Y(`$ZodCUID2`,(e,t)=>{t.pattern??=fa,_o.init(e,t)}),No=Y(`$ZodULID`,(e,t)=>{t.pattern??=pa,_o.init(e,t)}),Po=Y(`$ZodXID`,(e,t)=>{t.pattern??=ma,_o.init(e,t)}),Fo=Y(`$ZodKSUID`,(e,t)=>{t.pattern??=ha,_o.init(e,t)}),Io=Y(`$ZodISODateTime`,(e,t)=>{t.pattern??=La(t),_o.init(e,t)}),Lo=Y(`$ZodISODate`,(e,t)=>{t.pattern??=Pa,_o.init(e,t)}),Ro=Y(`$ZodISOTime`,(e,t)=>{t.pattern??=Ia(t),_o.init(e,t)}),zo=Y(`$ZodISODuration`,(e,t)=>{t.pattern??=va,_o.init(e,t)}),Bo=Y(`$ZodIPv4`,(e,t)=>{t.pattern??=wa,_o.init(e,t)}),Vo=/^[0-9a-fA-F:.]+$/;function Ho(e){return Vo.test(e)?xo(`http://[${e}]`):!1}var Uo=Y(`$ZodIPv6`,(e,t)=>{t.pattern??=Ta,_o.init(e,t),e._zod.check=n=>{Ho(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Wo=Y(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ea,_o.init(e,t)});function Go(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ho(n)}var Ko=Y(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Da,_o.init(e,t),e._zod.check=n=>{Go(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function qo(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Jo=/^[0-9a-zA-Z+/]*={0,2}$/,Yo=Y(`$ZodBase64`,(e,t)=>{t.pattern??=Jo,_o.init(e,t),e._zod.check=n=>{qo(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Xo=/^[A-Za-z0-9_-]*$/;function Zo(e){if(!Xo.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return qo(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Qo=Y(`$ZodBase64URL`,(e,t)=>{t.pattern??=Xo,_o.init(e,t),e._zod.check=n=>{Zo(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),$o=Y(`$ZodE164`,(e,t)=>{t.pattern??=ja,_o.init(e,t)});function es(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ts=Y(`$ZodJWT`,(e,t)=>{_o.init(e,t),e._zod.check=n=>{es(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ns=Y(`$ZodNumber`,(e,t)=>{fo.init(e,t),e._zod.pattern=Ba,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),rs=Y(`$ZodNumberFormat`,(e,t)=>{Za.init(e,t),ns.init(e,t)}),is=Y(`$ZodBoolean`,(e,t)=>{fo.init(e,t),e._zod.pattern=Va,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),as=Y(`$ZodNull`,(e,t)=>{fo.init(e,t),e._zod.pattern=Ha,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),os=Y(`$ZodAny`,(e,t)=>{fo.init(e,t),e._zod.parse=e=>e}),ss=Y(`$ZodUnknown`,(e,t)=>{fo.init(e,t),e._zod.parse=e=>e}),cs=Y(`$ZodNever`,(e,t)=>{fo.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ls(e,t){let n=ci(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of ci(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,li(n.issues,t,e),n}}return i(n,a)}}var us=e=>Array.isArray(e)?e.length:-1;function ds(e,t,n){e.issues.length&&t.issues.push(...oi(n,e.issues)),t.value[n]=e.value}var fs=Y(`$ZodArray`,(e,t)=>{fo.init(e,t);let n=Pi.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>ds(t,r,e)));else if(ds(c,r,e),s&&c.issues.length!==0&&ii(c))break}return o.length?Promise.all(o).then(()=>r):r},ls(e,us)});function ps(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...oi(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var ms=[];function hs(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ms,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Kr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function gs(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(ii(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ps(e,n,i,t,d,f))):ps(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var _s=Y(`$ZodObject`,(e,t)=>{fo.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=xr(()=>hs(t));J(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Dr(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Rr,o=t.catchall,s,c=Pi.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(ii(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ps(n,t,e,r,a,o))):ps(s,t,e,r,a,o)}return o?gs(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),vs=Y(`$ZodObjectJIT`,(e,t)=>{_s.init(e,t);let n=e._zod.parse,r=xr(()=>hs(t)),i=Pi.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new lo([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
5
|
+
let ${e}_ab = false;
|
|
6
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
7
|
+
const iss = ${e}.issues[i];
|
|
8
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
9
|
+
payload.issues.push(iss);
|
|
10
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
11
|
+
}
|
|
12
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
13
|
+
payload.value = newResult;
|
|
14
|
+
return payload;
|
|
15
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Fr(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
16
|
+
const ${n}_present = ${i};
|
|
17
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
18
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (${e}) {
|
|
22
|
+
newResult[${r}] = ${n}.value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
`)}else f?(o.write(`
|
|
27
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
28
|
+
}
|
|
29
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
30
|
+
if (${n}.value !== undefined || ${i}) {
|
|
31
|
+
newResult[${r}] = ${n}.value;
|
|
32
|
+
}
|
|
33
|
+
`)):o.write(`
|
|
34
|
+
const ${n}_present = ${i};
|
|
35
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
36
|
+
}
|
|
37
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
38
|
+
payload.issues.push({
|
|
39
|
+
code: "invalid_type",
|
|
40
|
+
expected: "nonoptional",
|
|
41
|
+
input: undefined,
|
|
42
|
+
path: [${r}]
|
|
43
|
+
});
|
|
44
|
+
if (ctx && ctx.abortEarly) {
|
|
45
|
+
payload.value = newResult;
|
|
46
|
+
return payload;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (${n}_present) {
|
|
51
|
+
newResult[${r}] = ${n}.value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Rr,c=!Pi.jitless,l=c&&zr.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?gs([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ys(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ii(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ui(e,r,Fi())))}),t)}var bs=Y(`$ZodUnion`,(e,t)=>{fo.init(e,t),J(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),J(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),J(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),J(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Cr(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ys(t,r,e,i)):ys(o,r,e,i)}}),xs=Y(`$ZodIntersection`,(e,t)=>{fo.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Cs(e,t,n)):Cs(e,i,a)}});function Ss(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Br(e)&&Br(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ss(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ss(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Cs(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ss(t.value,n.value);if(!c.valid){if(ii(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ws=Y(`$ZodRecord`,(e,t)=>{fo.init(e,t);let n=Pi.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Br(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ui(e,i,Fi())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...oi(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...oi(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Ba.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>ui(e,i,Fi())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...oi(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...oi(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Ts=Y(`$ZodEnum`,(e,t)=>{fo.init(e,t);let n=_r(t.entries),r=new Set(n);e._zod.values=r,J(e,`pattern`,e=>{let t=_r(e.def.entries).filter(e=>Hr.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ur(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Es=Y(`$ZodLiteral`,(e,t)=>{fo.init(e,t);let n=new Set(t.values);e._zod.values=n,J(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ur(e):e?Ur(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Ds=Y(`$ZodTransform`,(e,t)=>{fo.init(e,t),e._zod.optin=`optional`,Pi.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ni(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Mi;return n.value=i,n}});function Os(e,t){return e.value=t.issues.length?void 0:t.value,e}var ks=Y(`$ZodOptional`,(e,t)=>{fo.init(e,t),J(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,J(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),J(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Cr(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Os(e,t)):Os(e,r)}return t.innerType._zod.run(e,n)}}),As=Y(`$ZodExactOptional`,(e,t)=>{ks.init(e,t),J(e,`values`,e=>e.def.innerType._zod.values),J(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),js=Y(`$ZodNullable`,(e,t)=>{fo.init(e,t),J(e,`optin`,e=>e.def.innerType._zod.optin),J(e,`optout`,e=>e.def.innerType._zod.optout),J(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Cr(t.source)}|null)$`):void 0}),J(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ms=Y(`$ZodDefault`,(e,t)=>{fo.init(e,t),e._zod.optin=`defaulted`,J(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ns(e,t)):Ns(r,t)}});function Ns(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ps=Y(`$ZodPrefault`,(e,t)=>{fo.init(e,t),e._zod.optin=`defaulted`,J(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fs=Y(`$ZodNonOptional`,(e,t)=>{fo.init(e,t),J(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Is(t,e)):Is(i,e)}});function Is(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Ls(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ui(e,r,Fi()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Rs=Y(`$ZodCatch`,(e,t)=>{fo.init(e,t),J(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),J(e,`optout`,e=>e.def.innerType._zod.optout),J(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Ls(e,r,t,n)):Ls(e,r,t,n)}}),zs=Y(`$ZodPipe`,(e,t)=>{fo.init(e,t),J(e,`values`,e=>e.def.in._zod.values),J(e,`optin`,e=>e.def.in._zod.optin),J(e,`optout`,e=>e.def.out._zod.optout),J(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Bs(e,t.in,n)):Bs(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Bs(e,t.out,n)):Bs(r,t.out,n)}});function Bs(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Vs=Y(`$ZodReadonly`,(e,t)=>{fo.init(e,t),J(e,`propValues`,e=>e.def.innerType._zod.propValues),J(e,`values`,e=>e.def.innerType._zod.values),J(e,`optin`,e=>e.def.innerType?._zod?.optin),J(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Hs):Hs(r)}});function Hs(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Us=Y(`$ZodLazy`,(e,t)=>{fo.init(e,t),Er(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),J(e,`pattern`,e=>e.innerType?._zod?.pattern),J(e,`propValues`,e=>e.innerType?._zod?.propValues),J(e,`optin`,e=>e.innerType?._zod?.optin??void 0),J(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ws=Y(`$ZodCustom`,(e,t)=>{Ga.init(e,t),fo.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Gs(t,n,r,e));Gs(i,n,r,e)}});function Gs(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(hi(e))}}var Ks=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},qs=`~memo`,Js=[];function Ys(e){return typeof e==`object`&&!!e}function Xs(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Zs=new WeakMap,Qs=0,$s=1,ec=2;function tc(e,t,n){let r=Zs.get(e);if(r!==void 0)return r?ec:Qs;if(t.has(e))return ec;t.add(e);let i=Qs,a=e=>{if(i!==ec&&e?._zod){let r=tc(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Qs;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?$s:o.value?._zod?tc(o.value,t,n):Qs;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Or(c);s(e?o(e,!0):$s),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?tc(r,t,!1):$s);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),nc(e,i)}function nc(e,t){return t!==$s&&Zs.set(e,t===ec),t}function rc(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ic,ac=[],oc={alloc(e,t,n){let r=ic;if(!r)return n;ic=void 0;let i={value:n,issues:null};return r.set(t.value,i),ac.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&cc(n,e.value))throw new Ks;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=tc(e,new Set,!1);if(i===Qs)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===ec||r?n=!0:r=!0}let l=s.value;if(!Ys(l))return t(s,c);let u=c[qs];u||(u={buckets:new WeakMap,backEdges:void 0},c[qs]=u);let d;i===c?d=a:(d=rc(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Xs(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;ic=d;let p=ac.length,m=t(s,c);ic=void 0;let h=ac.length>p?ac.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Xs(e.issues):Js),e)):(h&&(h.issues=m.issues.length?Xs(m.issues):Js),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function sc(){return oc}function cc(e,t){let n=e[qs]?.backEdges;return n!==void 0&&Ys(t)&&n.has(t)}var lc=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(mi(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Gr(e.values[0])}`:`Invalid option: expected one of ${vr(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${vr(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function uc(){return{localeError:lc()}}var dc,fc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function pc(){return new fc}(dc=globalThis).__zod_globalRegistry??(dc.__zod_globalRegistry=pc());var mc=globalThis.__zod_globalRegistry;function hc(e){return e.checks&&=[...e.checks],e}function gc(e,t){return new e(hc({type:`string`,...q(t)}))}function _c(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...q(t)})}function vc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...q(t)})}function yc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...q(t)})}function bc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...q(t)})}function xc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...q(t)})}function Sc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...q(t)})}function Cc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...q(t)})}function wc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...q(t)})}function Tc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...q(t)})}function Ec(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...q(t)})}function Dc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...q(t)})}function Oc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...q(t)})}function kc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...q(t)})}function Ac(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...q(t)})}function jc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...q(t)})}function Mc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...q(t)})}function Nc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...q(t)})}function Pc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...q(t)})}function Fc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...q(t)})}function Ic(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...q(t)})}function Lc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...q(t)})}function Rc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...q(t)})}function zc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...q(t)})}function Bc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...q(t)})}function Vc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...q(t)})}function Hc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...q(t)})}function Uc(e,t){return new e(hc({type:`number`,checks:[],...q(t)}))}function Wc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...q(t)})}function Gc(e,t){return new e({type:`boolean`,...q(t)})}function Kc(e,t){return new e({type:`null`,...q(t)})}function qc(e){return new e({type:`any`})}function Jc(e){return new e({type:`unknown`})}function Yc(e,t){return new e({type:`never`,...q(t)})}function Xc(e,t){return new Ja({check:`less_than`,...q(t),value:e,inclusive:!1})}function Zc(e,t){return new Ja({check:`less_than`,...q(t),value:e,inclusive:!0})}function Qc(e,t){return new Ya({check:`greater_than`,...q(t),value:e,inclusive:!1})}function $c(e,t){return new Ya({check:`greater_than`,...q(t),value:e,inclusive:!0})}function el(e,t){return new Xa({check:`multiple_of`,...q(t),value:e})}function tl(e,t){return new Qa({check:`max_length`,...q(t),maximum:e})}function nl(e,t){return new $a({check:`min_length`,...q(t),minimum:e})}function rl(e,t){return new eo({check:`length_equals`,...q(t),length:e})}function il(e,t){return new no({check:`string_format`,format:`regex`,...q(t),pattern:e})}function al(e){return new ro({check:`string_format`,format:`lowercase`,...q(e)})}function ol(e){return new io({check:`string_format`,format:`uppercase`,...q(e)})}function sl(e,t){return new ao({check:`string_format`,format:`includes`,...q(t),includes:e})}function cl(e,t){return new oo({check:`string_format`,format:`starts_with`,...q(t),prefix:e})}function ll(e,t){return new so({check:`string_format`,format:`ends_with`,...q(t),suffix:e})}function ul(e){return new co({check:`overwrite`,tx:e})}function dl(e){return ul(t=>t.normalize(e))}function fl(){return ul(e=>e.trim())}function pl(){return ul(e=>e.toLowerCase())}function ml(){return ul(e=>e.toUpperCase())}function hl(){return ul(e=>Ir(e))}function gl(e,t,n){return new e({type:`array`,element:t,...q(n)})}function _l(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...q(n)})}function vl(e,t){let n=yl(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(hi(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(hi(r))}},e(t.value,t)),t);return n}function yl(e,t){let n=new Ga({check:`custom`,...q(t)});return n._zod.check=e,n}function bl(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Dr(e,t,n[t]);return e}function xl(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??mc,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Sl(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Cl(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Cl(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&bl(o.schema,c),t.io===`input`&&Nl(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function wl(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Tl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${wl(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+wl(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
55
|
+
|
|
56
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function El(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;El(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Dl=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ol=[`oneOf`,`anyOf`];function kl(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Al(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Dl.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??kl(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Dr(n,r,e.length===1?e[0]:Al(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=kl(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function jl(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Dl)if(t in e)return;let n=t.filter(e=>Ol.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Al(t);else{let e=n[0],i=Ol.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Al([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,bl(e,r))}function Ml(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):bl(i,s),bl(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())El(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])jl(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}bl(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Dr(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Fl(t,`input`,e.processors),output:Fl(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Nl(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Nl(r.element,n);if(r.type===`set`)return Nl(r.valueType,n);if(r.type===`lazy`)return Nl(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Nl(r.innerType,n);if(r.type===`intersection`)return Nl(r.left,n)||Nl(r.right,n);if(r.type===`record`||r.type===`map`)return Nl(r.keyType,n)||Nl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Nl(r.in,n)||Nl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Nl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Nl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Nl(e,n))return!0;return!!(r.rest&&Nl(r.rest,n))}return!1}var Pl=(e,t={})=>n=>{let r=xl({...n,processors:t});return Cl(e,r),Tl(r,e),Ml(r,e)},Fl=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=xl({...i??{},target:a,io:t,processors:n});return Cl(e,o),Tl(o,e),Ml(o,e)},Il=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ll=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Rl=(e,t)=>{Il(e,`minimum`,t),Ll(e,`maximum`,t)},zl=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Bl=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Vl=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Hl=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ul=(e,t)=>Il(e,`minimum`,t.minimum),Wl=(e,t)=>Ll(e,`maximum`,t.maximum),Gl=e=>(t,n)=>{Hl(t,n.format);let[r,i]=e[n.format];Il(t,`minimum`,r),Ll(t,`maximum`,i)},Kl={greater_than:(e,t)=>Il(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ll(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>zl(e,t.value),number_format:Gl(qr),bigint_format:Gl(Jr),min_length:Ul,max_length:Wl,length_equals:(e,t)=>Rl(e,t.length),min_size:Ul,max_size:Wl,size_equals:(e,t)=>Rl(e,t.size),string_format:(e,t)=>{Hl(e,t.format),t.pattern&&Bl(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Vl(e,t.mime)};function ql(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Kl[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Il(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Il(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ll(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ll(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&zl(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Vl(t,i.mime);for(let e of i.patterns??[])Bl(t,e);return t}var Jl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Yl=new Map([[Jo,Oa],[Xo,ka]]),Xl=e=>Yl.get(e)??e,Zl=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ql(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Jl[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Xl);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ql=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ql(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Sl(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},$l=(e,t,n,r)=>{n.type=`boolean`},eu=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},tu=(e,t,n,r)=>{n.not={}},nu=(e,t,n,r)=>{let i=e._zod.def,a=_r(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ru=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Sl(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Sl(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},iu=(e,t,n,r)=>{Sl(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},au=(e,t,n,r)=>{Sl(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ou=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ql(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Cl(a.element,t,{...r,path:[...r.path,`items`]})};function su(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?su(t.out):t.type===`catch`?su(t.innerType):e._zod.optin}var cu=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Sl(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Dr(i.properties,e,Cl(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?su(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Cl(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},lu=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Cl(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},uu=(e,t,n,r)=>{let i=e._zod.def,a=Cl(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Cl(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function du(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=du(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>du(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Ba:za).source),p):p}var fu=new WeakMap;function pu(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of fu.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=du(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var mu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ql(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Cl(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Dr(i.patternProperties,Xl(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Cl(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=fu.get(t);n||(n=[],fu.set(t,n),t.deferred.push(()=>pu(t))),n.push(e)}i.additionalProperties=Cl(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&su(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},hu=(e,t,n,r)=>{let i=e._zod.def,a=Cl(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},gu=(e,t,n,r)=>{let i=e._zod.def;Cl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},_u=Symbol();function vu(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Sl(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),_u):JSON.parse(o)}var yu=(e,t,n,r)=>{let i=e._zod.def;Cl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=vu(i.defaultValue,e,t,n,r);o!==_u&&(n.default=o)},bu=(e,t,n,r)=>{let i=e._zod.def;Cl(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=vu(i.defaultValue,e,t,n,r);o!==_u&&(n._prefault=o)},xu=(e,t,n,r)=>{let i=e._zod.def;Cl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Sl(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Su=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Cl(o,t,r);let s=t.seen.get(e);s.ref=o},Cu=(e,t,n,r)=>{let i=e._zod.def;Cl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},wu=(e,t,n,r)=>{let i=e._zod.def;Cl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Tu=(e,t,n,r)=>{let i=e._zod.innerType;Cl(i,t,r);let a=t.seen.get(e);a.ref=i},Eu=new WeakSet([Object.prototype,Error.prototype]);function Du(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Ou=Y(`ZodError`,(e,t)=>{Hi.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Eu.has(n)||(Eu.add(n),Du(n,`format`,e=>t=>Gi(e,t)),Du(n,`flatten`,e=>t=>Wi(e,t)),Du(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,yr,2)}),Du(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,yr,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ku=qi(Ou),Au=Ji(Ou),ju=Yi(Ou),Mu=Zi(Ou),Nu=ra(Ou),Pu=ia(Ou),Fu=aa(Ou),Iu=oa(Ou),Lu=sa(Ou),Ru=ca(Ou),zu=la(Ou),Bu=ua(Ou);function Vu(){Pi.localeError||Fi(uc())}function Hu(){Pi.memoizer||Fi({memoizer:sc()})}var Uu=Y(`ZodType`,(e,t)=>(Vu(),fo.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Pr(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Wr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(hf(e,t))},superRefine(e,t){return this.check(gf(e,t))},overwrite(e){return this.check(ul(e))},optional(){return Jd(this)},exactOptional(){return Xd(this)},nullable(){return Qd(this)},nullish(){return Jd(Qd(this))},nonoptional(e){return af(this,e)},array(){return jd(this)},or(e){return Id([this,e])},and(e){return Rd(this,e)},transform(e){return lf(this,Kd(e))},default(e){return ef(this,e)},prefault(e){return nf(this,e)},catch(e){return sf(this,e)},pipe(e){return lf(this,e)},readonly(){return df(this)},describe(e){let t=this.clone();return mc.add(t,{description:e}),t},meta(...e){if(e.length===0)return mc.get(this);let t=this.clone();return mc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return vi(this,`~standard`,{...ho(this),jsonSchema:{input:Fl(this,`input`),output:Fl(this,`output`)}})},set"~standard"(e){_i(this,`~standard`,e)},parse:function e(t,n){return ku(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Au(this,t,n,{callee:e})},safeParse(e,t){return ju(this,e,t)},async safeParseAsync(e,t){return Mu(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){_i(this,`spa`,e)},validate(e,t){return ea(this,e,t)},validateAsync(e,t){return na(this,e,t)},encode:function e(t,n){return Nu(this,t,n,{callee:e})},decode:function e(t,n){return Pu(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Fu(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Iu(this,t,n,{callee:e})},safeEncode(e,t){return Lu(this,e,t)},safeDecode(e,t){return Ru(this,e,t)},async safeEncodeAsync(e,t){return zu(this,e,t)},async safeDecodeAsync(e,t){return Bu(this,e,t)},toJSONSchema(e){return Pl(this,{})(e)},get description(){return mc.get(this)?.description},get _def(){return this._zod.def}}),Wu=Y(`_ZodString`,(e,t)=>{go.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zl(e,t,n,r)},yi({format:e=>ql(e).format??null,minLength:e=>ql(e).minimum??null,maxLength:e=>ql(e).maximum??null},{regex(...e){return this.check(il(...e))},includes(...e){return this.check(sl(...e))},startsWith(...e){return this.check(cl(...e))},endsWith(...e){return this.check(ll(...e))},min(...e){return this.check(nl(...e))},max(...e){return this.check(tl(...e))},length(...e){return this.check(rl(...e))},nonempty(...e){return this.check(nl(1,...e))},lowercase(e){return this.check(al(e))},uppercase(e){return this.check(ol(e))},trim(){return this.check(fl())},normalize(...e){return this.check(dl(...e))},toLowerCase(){return this.check(pl())},toUpperCase(){return this.check(ml())},slugify(){return this.check(hl())}})),Gu=Y(`ZodString`,(e,t)=>{go.init(e,t),Wu.init(e,t)},{email(e){return this.check(_c(Zu,e))},url(e){return this.check(Cc(ed,e))},jwt(e){return this.check(Rc(hd,e))},emoji(e){return this.check(wc(td,e))},guid(e){return this.check(vc(Qu,e))},uuid(e){return this.check(yc($u,e))},uuidv4(e){return this.check(bc($u,e))},uuidv6(e){return this.check(xc($u,e))},uuidv7(e){return this.check(Sc($u,e))},nanoid(e){return this.check(Tc(nd,e))},cuid(e){return this.check(Ec(rd,e))},cuid2(e){return this.check(Dc(id,e))},ulid(e){return this.check(Oc(ad,e))},base64(e){return this.check(Fc(fd,e))},base64url(e){return this.check(Ic(pd,e))},xid(e){return this.check(kc(od,e))},ksuid(e){return this.check(Ac(sd,e))},ipv4(e){return this.check(jc(cd,e))},ipv6(e){return this.check(Mc(ld,e))},cidrv4(e){return this.check(Nc(ud,e))},cidrv6(e){return this.check(Pc(dd,e))},e164(e){return this.check(Lc(md,e))},datetime(e){return this.check(zc(qu,e))},date(e){return this.check(Bc(Ju,e))},time(e){return this.check(Vc(Yu,e))},duration(e){return this.check(Hc(Xu,e))}});function X(e){return gc(Gu,e)}var Ku=Y(`ZodStringFormat`,(e,t)=>{_o.init(e,t),Wu.init(e,t)}),qu=Y(`ZodISODateTime`,(e,t)=>{Io.init(e,t),Ku.init(e,t)}),Ju=Y(`ZodISODate`,(e,t)=>{Lo.init(e,t),Ku.init(e,t)}),Yu=Y(`ZodISOTime`,(e,t)=>{Ro.init(e,t),Ku.init(e,t)}),Xu=Y(`ZodISODuration`,(e,t)=>{zo.init(e,t),Ku.init(e,t)}),Zu=Y(`ZodEmail`,(e,t)=>{bo.init(e,t),Ku.init(e,t)}),Qu=Y(`ZodGUID`,(e,t)=>{vo.init(e,t),Ku.init(e,t)}),$u=Y(`ZodUUID`,(e,t)=>{yo.init(e,t),Ku.init(e,t)}),ed=Y(`ZodURL`,(e,t)=>{Oo.init(e,t),Ku.init(e,t)}),td=Y(`ZodEmoji`,(e,t)=>{ko.init(e,t),Ku.init(e,t)}),nd=Y(`ZodNanoID`,(e,t)=>{Ao.init(e,t),Ku.init(e,t)}),rd=Y(`ZodCUID`,(e,t)=>{jo.init(e,t),Ku.init(e,t)}),id=Y(`ZodCUID2`,(e,t)=>{Mo.init(e,t),Ku.init(e,t)}),ad=Y(`ZodULID`,(e,t)=>{No.init(e,t),Ku.init(e,t)}),od=Y(`ZodXID`,(e,t)=>{Po.init(e,t),Ku.init(e,t)}),sd=Y(`ZodKSUID`,(e,t)=>{Fo.init(e,t),Ku.init(e,t)}),cd=Y(`ZodIPv4`,(e,t)=>{Bo.init(e,t),Ku.init(e,t)}),ld=Y(`ZodIPv6`,(e,t)=>{Uo.init(e,t),Ku.init(e,t)}),ud=Y(`ZodCIDRv4`,(e,t)=>{Wo.init(e,t),Ku.init(e,t)}),dd=Y(`ZodCIDRv6`,(e,t)=>{Ko.init(e,t),Ku.init(e,t)}),fd=Y(`ZodBase64`,(e,t)=>{Yo.init(e,t),Ku.init(e,t)}),pd=Y(`ZodBase64URL`,(e,t)=>{Qo.init(e,t),Ku.init(e,t)}),md=Y(`ZodE164`,(e,t)=>{$o.init(e,t),Ku.init(e,t)}),hd=Y(`ZodJWT`,(e,t)=>{ts.init(e,t),Ku.init(e,t)}),gd=Y(`ZodNumber`,(e,t)=>{ns.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ql(e,t,n,r),e.isFinite=!0},yi({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ql(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ql(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ql(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ql(e).format??null},{gt(e,t){return this.check(Qc(e,t))},gte(e,t){return this.check($c(e,t))},min(e,t){return this.check($c(e,t))},lt(e,t){return this.check(Xc(e,t))},lte(e,t){return this.check(Zc(e,t))},max(e,t){return this.check(Zc(e,t))},int(e){return this.check(yd(e))},safe(e){return this.check(yd(e))},positive(e){return this.check(Qc(0,e))},nonnegative(e){return this.check($c(0,e))},negative(e){return this.check(Xc(0,e))},nonpositive(e){return this.check(Zc(0,e))},multipleOf(e,t){return this.check(el(e,t))},step(e,t){return this.check(el(e,t))},finite(){return this}}));function _d(e){return Uc(gd,e)}var vd=Y(`ZodNumberFormat`,(e,t)=>{rs.init(e,t),gd.init(e,t)});function yd(e){return Wc(vd,e)}var bd=Y(`ZodBoolean`,(e,t)=>{is.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r)});function xd(e){return Gc(bd,e)}var Sd=Y(`ZodNull`,(e,t)=>{as.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eu(e,t,n,r)});function Cd(e){return Kc(Sd,e)}var wd=Y(`ZodAny`,(e,t)=>{os.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Td(){return qc(wd)}var Ed=Y(`ZodUnknown`,(e,t)=>{ss.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Dd(){return Jc(Ed)}var Od=Y(`ZodNever`,(e,t)=>{cs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tu(e,t,n,r)});function kd(e){return Yc(Od,e)}var Ad=Y(`ZodArray`,(e,t)=>{Hu(),fs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ou(e,t,n,r),e.element=t.element},{min(e,t){return this.check(nl(e,t))},nonempty(e){return this.check(nl(1,e))},max(e,t){return this.check(tl(e,t))},length(e,t){return this.check(rl(e,t))},unwrap(){return this.element}});function jd(e,t){return gl(Ad,e,t)}var Md=Y(`ZodObject`,(e,t)=>{Hu(),vs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cu(e,t,n,r),Ti(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Hd(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Pr(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Pr(this._zod.def,{catchall:Dd()}))},loose(){return this.clone(Pr(this._zod.def,{catchall:Dd()}))},strict(){return this.clone(Pr(this._zod.def,{catchall:kd()}))},strip(){return this.clone(Pr(this._zod.def,{catchall:void 0}))},extend(e){return Qr(this,e)},safeExtend(e){return ei(this,e)},merge(e){return ti(this,e)},pick(e){return Yr(this,e)},omit(e){return Zr(this,e)},partial(...e){return ni(qd,this,e[0])},exactPartial(...e){return ni(Yd,this,e[0],`exactPartial`)},required(...e){return ri(rf,this,e[0])}});function Nd(e,t){return new Md({type:`object`,shape:e??{},...q(t)})}function Pd(e,t){return new Md({type:`object`,shape:e,catchall:kd(),...q(t)})}var Fd=Y(`ZodUnion`,(e,t)=>{bs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lu(e,t,n,r),e.options=t.options});function Id(e,t){return new Fd({type:`union`,options:e,...q(t)})}var Ld=Y(`ZodIntersection`,(e,t)=>{xs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uu(e,t,n,r)});function Rd(e,t){return new Ld({type:`intersection`,left:e,right:t})}var zd=Y(`ZodRecord`,(e,t)=>{Hu(),ws.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mu(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Bd(e,t,n){return!t||!t._zod?new zd({type:`record`,keyType:X(),valueType:e,...q(t)}):new zd({type:`record`,keyType:e,valueType:t,...q(n)})}var Vd=Y(`ZodEnum`,(e,t)=>{Ts.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nu(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Vd({...t,checks:[],...q(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Vd({...t,checks:[],...q(r),entries:i})}});function Hd(e,t){return new Vd({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...q(t)})}var Ud=Y(`ZodLiteral`,(e,t)=>{Es.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ru(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Wd(e,t){return new Ud({type:`literal`,values:Array.isArray(e)?e:[e],...q(t)})}var Gd=Y(`ZodTransform`,(e,t)=>{Hu(),Ds.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>au(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ni(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(hi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(hi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Kd(e){return new Gd({type:`transform`,transform:e})}var qd=Y(`ZodOptional`,(e,t)=>{ks.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jd(e){return new qd({type:`optional`,innerType:e})}var Yd=Y(`ZodExactOptional`,(e,t)=>{As.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xd(e){return new Yd({type:`optional`,innerType:e})}var Zd=Y(`ZodNullable`,(e,t)=>{js.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qd(e){return new Zd({type:`nullable`,innerType:e})}var $d=Y(`ZodDefault`,(e,t)=>{Ms.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ef(e,t){return new $d({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vr(t)}})}var tf=Y(`ZodPrefault`,(e,t)=>{Ps.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nf(e,t){return new tf({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vr(t)}})}var rf=Y(`ZodNonOptional`,(e,t)=>{Fs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function af(e,t){return new rf({type:`nonoptional`,innerType:e,...q(t)})}var of=Y(`ZodCatch`,(e,t)=>{Rs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sf(e,t){return new of({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Di(t)})}var cf=Y(`ZodPipe`,(e,t)=>{zs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Su(e,t,n,r),e.in=t.in,e.out=t.out});function lf(e,t){return new cf({type:`pipe`,in:e,out:t})}var uf=Y(`ZodReadonly`,(e,t)=>{Vs.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function df(e){return new uf({type:`readonly`,innerType:e})}var ff=Y(`ZodLazy`,(e,t)=>{Us.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tu(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function pf(e){return new ff({type:`lazy`,getter:e})}var mf=Y(`ZodCustom`,(e,t)=>{Ws.init(e,t),Uu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iu(e,t,n,r)});function hf(e,t={}){return _l(mf,e,t)}function gf(e,t){return vl(e,t)}var _f=Id([X(),_d(),xd(),Cd(),Nd({$state:X()})]);Id([X(),Nd({$state:X()})]),Id([_d(),Nd({$state:X()})]),Id([xd(),Nd({$state:X()})]);function vf(e,t){if(e!=null)return typeof e==`object`&&`$state`in e?xf(t,e.$state):e}function yf(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function bf(e){return(e.startsWith(`/`)?e.slice(1).split(`/`):e.split(`/`)).map(yf)}function xf(e,t){if(!t||t===`/`)return e;let n=bf(t),r=e;for(let e of n){if(r==null)return;if(Array.isArray(r))r=r[parseInt(e,10)];else if(typeof r==`object`)r=r[e];else return}return r}function Sf(e,t){if(typeof e==`string`)return e;if(t!=null)return e.$item===``||e.$item===`/`?t:wf(t,e.$item)}function Cf(e,t){return wf(e,String(t))}function wf(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return e===``||e===`/`?`/${n}`:`${e}/${n}`}function Tf(e,t,n){let r=bf(t);if(r.length===0)return e;let i={...e},a=i;for(let e=0;e<r.length-1;e++){let t=r[e],n=a[t];if(Array.isArray(n))a[t]=[...n];else if(typeof n==`object`&&n)a[t]={...n};else{let n=r[e+1];a[t]=n!==void 0&&/^\d+$/.test(n)?[]:{}}a=a[t]}let o=r[r.length-1];return Array.isArray(a)?o===`-`?a.push(n):a[parseInt(o,10)]=n:a[o]=n,i}function Ef(e={}){let t={...e},n=new Set;function r(){for(let e of n)e()}return{get(e){return xf(t,e)},set(e,n){xf(t,e)!==n&&(t=Tf(t,e,n),r())},update(e){let n=!1,i=t;for(let[t,r]of Object.entries(e))xf(i,t)!==r&&(i=Tf(i,t,r),n=!0);n&&(t=i,r())},getSnapshot(){return t},getServerSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}}}}var Df=20;function Of(e,t=``,n=0,r,i){let a=r??new Set,o=i??{current:!1},s={};for(let[r,i]of Object.entries(e)){let e=`${t}/${r}`;n<Df&&typeof i==`object`&&i&&!Array.isArray(i)&&Object.getPrototypeOf(i)===Object.prototype&&!a.has(i)?(a.add(i),Object.assign(s,Of(i,e,n+1,a,o))):s[e]=i}return s}var kf=Id([_d(),Nd({$state:X()})]),Af={eq:Dd().optional(),neq:Dd().optional(),gt:kf.optional(),gte:kf.optional(),lt:kf.optional(),lte:kf.optional(),not:Wd(!0).optional()},jf=Id([Nd({$state:X(),...Af}),Nd({$item:X(),...Af}),Nd({$index:Wd(!0),...Af})]),Mf=pf(()=>Id([xd(),jf,jd(jf),Nd({$and:jd(Mf)}),Nd({$or:jd(Mf)})])),Nf=Id([Pd({$state:X(),...Af}),Pd({$item:X(),...Af}),Pd({$index:Wd(!0),...Af})]),Pf=pf(()=>Id([xd(),Nf,jd(Nf),Pd({$and:jd(Pf)}),Pd({$or:jd(Pf)})]));function Ff(e,t){return typeof e==`object`&&e&&`$state`in e&&typeof e.$state==`string`?xf(t.stateModel,e.$state):e}function If(e){return`$item`in e}function Lf(e){return`$index`in e}function Rf(e,t){return Lf(e)?t.repeatIndex:If(e)?t.repeatItem===void 0?void 0:e.$item===``?t.repeatItem:xf(t.repeatItem,e.$item):xf(t.stateModel,e.$state)}function zf(e,t){let n=Rf(e,t),r;if(e.eq!==void 0)r=n===Ff(e.eq,t);else if(e.neq!==void 0)r=n!==Ff(e.neq,t);else if(e.gt!==void 0){let i=Ff(e.gt,t);r=typeof n==`number`&&typeof i==`number`&&n>i}else if(e.gte!==void 0){let i=Ff(e.gte,t);r=typeof n==`number`&&typeof i==`number`&&n>=i}else if(e.lt!==void 0){let i=Ff(e.lt,t);r=typeof n==`number`&&typeof i==`number`&&n<i}else if(e.lte!==void 0){let i=Ff(e.lte,t);r=typeof n==`number`&&typeof i==`number`&&n<=i}else r=!!n;return e.not===!0?!r:r}function Bf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`$and`in e}function Vf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`$or`in e}function Hf(e,t){return e===void 0?!0:typeof e==`boolean`?e:Array.isArray(e)?e.every(e=>zf(e,t)):Bf(e)?e.$and.every(e=>Hf(e,t)):Vf(e)?e.$or.some(e=>Hf(e,t)):zf(e,t)}function Uf(e){let t=new Map;for(let n of e)t.set(n.name,n);return t}function Wf(e,t){if(!t||t.size===0)return;let n;for(let[r,i]of t)if(r in e){if(n)throw Error(`Ambiguous directive: object has multiple directive keys ("${n.name}" and "${r}")`);n=i}return n}function Gf(e){return typeof e==`object`&&!!e&&`$state`in e&&typeof e.$state==`string`}function Kf(e){return typeof e==`object`&&!!e&&`$item`in e&&typeof e.$item==`string`}function qf(e){return typeof e==`object`&&!!e&&`$index`in e&&e.$index===!0}function Jf(e){return typeof e==`object`&&!!e&&`$bindState`in e&&typeof e.$bindState==`string`}function Yf(e){return typeof e==`object`&&!!e&&`$bindItem`in e&&typeof e.$bindItem==`string`}function Xf(e){return typeof e==`object`&&!!e&&`$cond`in e&&`$then`in e&&`$else`in e}function Zf(e){return typeof e==`object`&&!!e&&`$computed`in e&&typeof e.$computed==`string`}function Qf(e){return typeof e==`object`&&!!e&&`$template`in e&&typeof e.$template==`string`}var $f=100,ep=new Set;function tp(e,t){if(t.repeatBasePath==null){console.warn(`$bindItem used outside repeat scope: "${e}"`);return}return e===``?t.repeatBasePath:t.repeatBasePath+`/`+e}function np(e,t){if(e==null)return e;if(Gf(e))return xf(t.stateModel,e.$state);if(Kf(e))return t.repeatItem===void 0?void 0:e.$item===``?t.repeatItem:xf(t.repeatItem,e.$item);if(qf(e))return t.repeatIndex;if(Jf(e))return xf(t.stateModel,e.$bindState);if(Yf(e)){let n=tp(e.$bindItem,t);return n===void 0?void 0:xf(t.stateModel,n)}if(Xf(e))return np(Hf(e.$cond,t)?e.$then:e.$else,t);if(Zf(e)){let n=t.functions?.[e.$computed];if(!n){ep.has(e.$computed)||(ep.size<$f&&ep.add(e.$computed),console.warn(`Unknown $computed function: "${e.$computed}"`));return}let r={};if(e.args)for(let[n,i]of Object.entries(e.args))r[n]=np(i,t);return n(r)}if(Qf(e))return e.$template.replace(/\$\{([^}]+)\}/g,(e,n)=>{if(n.startsWith(`/`)){let e=xf(t.stateModel,n);return e==null?``:String(e)}if(t.repeatItem!==void 0){let e=xf(t.repeatItem,n);if(e!=null)return String(e)}let r=xf(t.stateModel,`/`+n);return r==null?``:String(r)});if(Array.isArray(e))return e.map(e=>np(e,t));if(typeof e==`object`){let n=Wf(e,t.directives);if(n)return n.resolve(e,t);let r={};for(let[n,i]of Object.entries(e))r[n]=np(i,t);return r}return e}function rp(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=np(i,t);return n}function ip(e,t){let n;for(let[r,i]of Object.entries(e))if(Jf(i))n||={},n[r]=i.$bindState;else if(Yf(i)){let e=tp(i.$bindItem,t);e!==void 0&&(n||={},n[r]=e)}return n}function ap(e,t){return Kf(e)?tp(e.$item,t):qf(e)?t.repeatIndex:np(e,t)}var op=new Set;function sp(e){for(let t of op){let n=t.onDispatch;if(n)try{n(e)}catch{}}}function cp(e){for(let t of op){let n=t.onSettle;if(n)try{n(e)}catch{}}}var lp=0;function up(){return lp+=1,`${Date.now()}-${lp}`}var dp=0,fp=new Set;function pp(){return dp>0}function mp(e){return fp.add(e),()=>{fp.delete(e)}}var hp=Nd({title:X(),message:X(),confirmLabel:X().optional(),cancelLabel:X().optional(),variant:Hd([`default`,`danger`]).optional()}),gp=Id([Nd({navigate:X()}),Nd({set:Bd(X(),Dd())}),Nd({action:X(),params:Bd(X(),_f).optional()})]),_p=Id([Nd({set:Bd(X(),Dd())}),Nd({action:X(),params:Bd(X(),_f).optional()})]),vp=Nd({action:X(),params:Bd(X(),_f).optional(),confirm:hp.optional(),onSuccess:gp.optional(),onError:_p.optional(),preventDefault:xd().optional()});function yp(e,t){let n={};if(e.params)for(let[r,i]of Object.entries(e.params))n[r]=vf(i,t);let r=e.confirm;return r&&={...r,message:bp(r.message,t),title:bp(r.title,t)},{action:e.action,params:n,confirm:r,onSuccess:e.onSuccess,onError:e.onError}}function bp(e,t){return e.replace(/\$\{([^}]+)\}/g,(e,n)=>{let r=vf({$state:n},t);return String(r??``)})}async function xp(e){let{action:t,handler:n,setState:r,navigate:i,executeAction:a}=e;try{if(await n(t.params),t.onSuccess){if(`navigate`in t.onSuccess&&i)i(t.onSuccess.navigate);else if(`set`in t.onSuccess)for(let[e,n]of Object.entries(t.onSuccess.set))r(e,n);else`action`in t.onSuccess&&a&&await a(t.onSuccess)}}catch(e){if(t.onError){if(`set`in t.onError)for(let[n,i]of Object.entries(t.onError.set))r(n,typeof i==`string`&&i===`$error.message`?e.message:i);else`action`in t.onError&&a&&await a(t.onError)}else throw e}}Nd({checks:jd(Nd({type:X(),args:Bd(X(),_f).optional(),message:X()})).optional(),validateOn:Hd([`change`,`blur`,`submit`]).optional(),enabled:Mf.optional()});var Sp=(e,t)=>e===t?.other,Cp={required:e=>e==null?!1:typeof e==`string`?e.trim().length>0:!Array.isArray(e)||e.length>0,email:e=>typeof e==`string`&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),minLength:(e,t)=>{if(typeof e!=`string`)return!1;let n=t?.min;return typeof n==`number`&&e.length>=n},maxLength:(e,t)=>{if(typeof e!=`string`)return!1;let n=t?.max;return typeof n==`number`&&e.length<=n},pattern:(e,t)=>{if(typeof e!=`string`)return!1;let n=t?.pattern;if(typeof n!=`string`)return!1;try{return new RegExp(n).test(e)}catch{return!1}},min:(e,t)=>{if(typeof e!=`number`)return!1;let n=t?.min;return typeof n==`number`&&e>=n},max:(e,t)=>{if(typeof e!=`number`)return!1;let n=t?.max;return typeof n==`number`&&e<=n},numeric:e=>typeof e==`number`?!isNaN(e):typeof e==`string`&&!isNaN(parseFloat(e)),url:e=>{if(typeof e!=`string`)return!1;try{return new URL(e),!0}catch{return!1}},matches:Sp,equalTo:Sp,lessThan:(e,t)=>{let n=t?.other;if(e==null||n==null||e===``||n===``)return!1;if(typeof e==`number`&&typeof n==`number`||typeof e==`string`&&typeof n==`string`)return e<n;let r=Number(e),i=Number(n);return!isNaN(r)&&!isNaN(i)&&r<i},greaterThan:(e,t)=>{let n=t?.other;if(e==null||n==null||e===``||n===``)return!1;if(typeof e==`number`&&typeof n==`number`||typeof e==`string`&&typeof n==`string`)return e>n;let r=Number(e),i=Number(n);return!isNaN(r)&&!isNaN(i)&&r>i},requiredIf:(e,t)=>t?.field?e==null?!1:typeof e==`string`?e.trim().length>0:!Array.isArray(e)||e.length>0:!0};function wp(e,t){let{value:n,stateModel:r,customFunctions:i}=t,a={};if(e.args)for(let[t,n]of Object.entries(e.args))a[t]=np(n,{stateModel:r});let o=Cp[e.type]??i?.[e.type];if(!o)return console.warn(`Unknown validation function: ${e.type}`),{type:e.type,valid:!0,message:e.message};let s=o(n,a);return{type:e.type,valid:s,message:e.message}}function Tp(e,t){let n=[],r=[];if(e.enabled&&!Hf(e.enabled,{stateModel:t.stateModel}))return{valid:!0,errors:[],checks:[]};if(e.checks)for(let i of e.checks){let e=wp(i,t);n.push(e),e.valid||r.push(e.message)}return{valid:r.length===0,errors:r,checks:n}}var Ep=[`patch`];function Dp(e){return e?.modes?.length?e.modes:Ep}function Op(){return[`PATCH MODE (RFC 6902 JSON Patch):`,`Output one JSON object per line. Each line is a patch operation.`,`- Add: {"op":"add","path":"/elements/new-key","value":{...}}`,`- Replace: {"op":"replace","path":"/elements/existing-key","value":{...}}`,`- Remove: {"op":"remove","path":"/elements/old-key"}`,`Only output patches for what needs to change.`].join(`
|
|
57
|
+
`)}function kp(){return[`MERGE MODE (RFC 7396 JSON Merge Patch):`,`Output a single JSON object on one line with __json_edit set to true.`,`Include only the keys that changed. Unmentioned keys are preserved.`,`Set a key to null to delete it.`,``,`Example (update a title and add an element):`,`{"__json_edit":true,"elements":{"main":{"props":{"title":"New Title"}},"new-el":{"type":"Card","props":{},"children":[]}}}`,``,`Example (delete an element):`,`{"__json_edit":true,"elements":{"old-widget":null}}`].join(`
|
|
58
|
+
`)}function Ap(){return[`DIFF MODE (unified diff):`,"Output a unified diff inside a ```diff code fence.",`The diff applies against the JSON-serialized current spec.`,``,`Example:`,"```diff",`--- a/spec.json`,`+++ b/spec.json`,`@@ -3,1 +3,1 @@`,`- "title": "Login"`,`+ "title": "Welcome Back"`,"```"].join(`
|
|
59
|
+
`)}function jp(){return[`PATCH MODE (RFC 6902 JSON Patch):`,"Output RFC 6902 JSON Patch lines inside a ```yaml-patch code fence.",`Each line is one JSON patch operation.`,``,`Example:`,"```yaml-patch",`{"op":"replace","path":"/elements/main/props/title","value":"New Title"}`,`{"op":"add","path":"/elements/new-el","value":{"type":"Card","props":{},"children":[]}}`,"```"].join(`
|
|
60
|
+
`)}function Mp(){return[`MERGE MODE (RFC 7396 JSON Merge Patch):`,"Output only the changed parts in a ```yaml-edit code fence.",`Uses deep merge semantics: only keys you include are updated. Unmentioned elements and props are preserved.`,`Set a key to null to delete it.`,``,`Example edit (update title, add a new element):`,"```yaml-edit",`elements:`,` main:`,` props:`,` title: Updated Title`,` new-chart:`,` type: Card`,` props: {}`,` children: []`,"```",``,`Example deletion:`,"```yaml-edit",`elements:`,` old-widget: null`,"```"].join(`
|
|
61
|
+
`)}function Np(){return[`DIFF MODE (unified diff):`,"Output a unified diff inside a ```diff code fence.",`The diff applies against the YAML-serialized current spec.`,``,`Example:`,"```diff",`--- a/spec.yaml`,`+++ b/spec.yaml`,`@@ -6,1 +6,1 @@`,`- title: Login`,`+ title: Welcome Back`,"```"].join(`
|
|
62
|
+
`)}function Pp(e){if(e.length===1)return``;let t=[`Choose the best edit strategy for the requested change:`];return e.includes(`patch`)&&t.push(`- PATCH: best for precise, targeted single-field updates`),e.includes(`merge`)&&t.push(`- MERGE: best for structural changes (add/remove elements, reparent children, update multiple props at once)`),e.includes(`diff`)&&t.push(`- DIFF: best for small text-level changes when you can see the exact lines to change`),t.join(`
|
|
63
|
+
`)}function Fp(e,t){let n=Dp(e),r=[];r.push(`EDITING EXISTING SPECS:`),r.push(``);let i=Pp(n);i&&(r.push(i),r.push(``));for(let e of n){if(t===`json`)switch(e){case`patch`:r.push(Op());break;case`merge`:r.push(kp());break;case`diff`:r.push(Ap())}else switch(e){case`patch`:r.push(jp());break;case`merge`:r.push(Mp());break;case`diff`:r.push(Np())}r.push(``)}return r.join(`
|
|
64
|
+
`)}function Ip(){return{string:()=>({kind:`string`}),number:()=>({kind:`number`}),boolean:()=>({kind:`boolean`}),array:e=>({kind:`array`,inner:e}),object:e=>({kind:`object`,inner:e}),record:e=>({kind:`record`,inner:e}),any:()=>({kind:`any`}),zod:()=>({kind:`zod`}),ref:e=>({kind:`ref`,inner:e}),propsOf:e=>({kind:`propsOf`,inner:e}),map:e=>({kind:`map`,inner:e}),optional:()=>({optional:!0})}}function Lp(e,t){return{definition:e(Ip()),promptTemplate:t?.promptTemplate,defaultRules:t?.defaultRules,builtInActions:t?.builtInActions,createCatalog(e){return Rp(this,e)}}}function Rp(e,t){let n=t.components,r=t.actions,i=n?Object.keys(n):[],a=r?Object.keys(r):[],o=zp(e.definition,t);return{schema:e,data:t,componentNames:i,actionNames:a,prompt(e={}){return Up(this,e)},jsonSchema(e={}){return Qp(o,e.strict??!1)},validate(e){let t=o.safeParse(e);return t.success?{success:!0,data:t.data}:{success:!1,error:t.error}},zodSchema(){return o},get _specType(){throw Error(`_specType is only for type inference`)}}}function zp(e,t){return Bp(e.spec,t)}function Bp(e,t){switch(e.kind){case`string`:return X();case`number`:return _d();case`boolean`:return xd();case`any`:return Td();case`array`:return jd(Bp(e.inner,t));case`object`:{let n=e.inner,r={};for(let[e,i]of Object.entries(n)){let n=Bp(i,t);i.optional&&(n=n.optional()),r[e]=n}return Nd(r)}case`record`:{let n=Bp(e.inner,t);return Bd(X(),n)}case`ref`:{let n=e.inner,r=Vp(n,t);return r.length===0?X():r.length===1?Wd(r[0]):Hd(r)}case`propsOf`:{let n=e.inner,r=Hp(n,t);return r.length===0?Bd(X(),Dd()):r.length===1?r[0]:Bd(X(),Dd())}default:return Dd()}}function Vp(e,t){let n=e.split(`.`),r={catalog:t};for(let e of n)if(r&&typeof r==`object`)r=r[e];else return[];return r&&typeof r==`object`?Object.keys(r):[]}function Hp(e,t){let n=e.split(`.`),r={catalog:t};for(let e of n)if(r&&typeof r==`object`)r=r[e];else return[];return r&&typeof r==`object`?Object.values(r).map(e=>e.props).filter(e=>e!==void 0):[]}function Up(e,t){if(e.schema.promptTemplate){let n={catalog:e.data,componentNames:e.componentNames,actionNames:e.actionNames,options:t,formatZodType:Yp};return e.schema.promptTemplate(n)}let{system:n=`You are a UI generator that outputs JSON.`,customRules:r=[],mode:i=`standalone`}=t,a=i===`chat`?(console.warn(`[json-render] mode "chat" is deprecated, use "inline" instead`),`inline`):i===`generate`?(console.warn(`[json-render] mode "generate" is deprecated, use "standalone" instead`),`standalone`):i,o=[];o.push(n),o.push(``),a===`inline`?(o.push(`OUTPUT FORMAT (text + JSONL, RFC 6902 JSON Patch):`),o.push("You respond conversationally. When generating UI, first write a brief explanation (1-3 sentences), then output JSONL patch lines wrapped in a ```spec code fence."),o.push("The JSONL lines use RFC 6902 JSON Patch operations to build a UI tree. Always wrap them in a ```spec fence block:"),o.push(" ```spec"),o.push(` {"op":"add","path":"/root","value":"main"}`),o.push(` {"op":"add","path":"/elements/main","value":{"type":"Card","props":{"title":"Hello"},"children":[]}}`),o.push(" ```"),o.push(`If the user's message does not require a UI (e.g. a greeting or clarifying question), respond with text only — no JSONL.`)):(o.push(`OUTPUT FORMAT (JSONL, RFC 6902 JSON Patch):`),o.push(`Output JSONL (one JSON object per line) using RFC 6902 JSON Patch operations to build a UI tree.`)),o.push(`Each line is a JSON patch operation (add, remove, replace). Start with /root, then stream /elements and /state patches interleaved so the UI fills in progressively as it streams.`),o.push(``),o.push(`Example output (each line is a separate JSON object):`),o.push(``);let s=e.data.components,c=e.schema.definition.spec,l=(c.kind===`object`?c.inner:void 0)?.elements,u=l?.kind===`record`?l.inner:void 0,d=(u?.kind===`object`?u.inner:void 0)?.slots!==void 0,f=e.componentNames,p=f[0]||`Component`,m=f.length>1?f[1]:p,h=s?.[p],g=s?.[m],_=h?Wp(h):{},v=g?Wp(g):{},y=g?.props?qp(g.props):null,b=y?{...v,[y]:{$item:`title`}}:v,x=[JSON.stringify({op:`add`,path:`/root`,value:`main`}),JSON.stringify({op:`add`,path:`/elements/main`,value:{type:p,props:_,children:[`child-1`,`list`]}}),JSON.stringify({op:`add`,path:`/elements/child-1`,value:{type:m,props:v,children:[]}}),JSON.stringify({op:`add`,path:`/elements/list`,value:{type:p,props:_,repeat:{statePath:`/items`,key:`id`},children:[`item`]}}),JSON.stringify({op:`add`,path:`/elements/item`,value:{type:m,props:b,children:[]}}),JSON.stringify({op:`add`,path:`/state/items`,value:[]}),JSON.stringify({op:`add`,path:`/state/items/0`,value:{id:`1`,title:`First Item`}}),JSON.stringify({op:`add`,path:`/state/items/1`,value:{id:`2`,title:`Second Item`}})].join(`
|
|
65
|
+
`);o.push(`${x}
|
|
66
|
+
|
|
67
|
+
Note: state patches appear right after the elements that use them, so the UI fills in as it streams. ONLY use component types from the AVAILABLE COMPONENTS list below.`),o.push(``),o.push(`INITIAL STATE:`),o.push(`Specs include a /state field to seed the state model. Components with { $bindState } or { $bindItem } read from and write to this state, and $state expressions read from it.`),o.push(`CRITICAL: You MUST include state patches whenever your UI displays data via $state, $bindState, $bindItem, $item, or $index expressions, or uses repeat to iterate over arrays. Without state, these references resolve to nothing and repeat lists render zero items.`),o.push(`Output state patches right after the elements that reference them, so the UI fills in progressively as it streams.`),o.push(`Stream state progressively - output one patch per array item instead of one giant blob:`),o.push(` For arrays: {"op":"add","path":"/state/posts/0","value":{"id":"1","title":"First Post",...}} then /state/posts/1, /state/posts/2, etc.`),o.push(` For scalars: {"op":"add","path":"/state/newTodoText","value":""}`),o.push(` Initialize the array first if needed: {"op":"add","path":"/state/posts","value":[]}`),o.push(`When content comes from the state model, use { "$state": "/some/path" } dynamic props to display it instead of hardcoding the same value in both state and props. The state model is the single source of truth.`),o.push(`Include realistic sample data in state. For blogs: 3-4 posts with titles, excerpts, authors, dates. For product lists: 3-5 items with names, prices, descriptions. Never leave arrays empty.`),o.push(``),o.push(`DYNAMIC LISTS (repeat field):`),o.push(`Any element can have a top-level "repeat" field to render its children once per item in a state array: { "repeat": { "statePath": "/arrayPath", "key": "id" } }.`),o.push(`The element itself renders once (as the container), and its children are expanded once per array item. "statePath" is the state array path. "key" is an optional field name on each item for stable React keys.`),o.push(`For nested lists, an inner repeat can read an array from the enclosing item with { "statePath": { "$item": "field" } }. This form is valid only inside another repeat. Use an empty field to repeat over the enclosing item itself.`),o.push(`Example: ${JSON.stringify({type:p,props:_,repeat:{statePath:`/todos`,key:`id`},children:[`todo-item`]})}`),o.push(`Inside children of a repeated element, use { "$item": "field" } to read a field from the current item, and { "$index": true } to get the current array index. For two-way binding to an item field use { "$bindItem": "completed" } on the appropriate prop.`),o.push(`ALWAYS use the repeat field for lists backed by state arrays. NEVER hardcode individual elements for each array item.`),o.push(`IMPORTANT: "repeat" is a top-level field on the element (sibling of type/props/children), NOT inside props.`),o.push(``),o.push(`ARRAY STATE ACTIONS:`),o.push(`Use action "pushState" to append items to arrays. Params: { statePath: "/arrayPath", value: { ...item }, clearStatePath: "/inputPath" }.`),o.push(`Values inside pushState can contain { "$state": "/statePath" } references to read current state (e.g. the text from an input field).`),o.push(`Use "$id" inside a pushState value to auto-generate a unique ID.`),o.push(`Example: on: { "press": { "action": "pushState", "params": { "statePath": "/todos", "value": { "id": "$id", "title": { "$state": "/newTodoText" }, "completed": false }, "clearStatePath": "/newTodoText" } } }`),o.push(`Use action "removeState" to remove items from arrays by index. Params: { statePath: "/arrayPath", index: N }. Inside a repeated element's children, use { "$index": true } for the current item index. Action params support the same expressions as props: { "$item": "field" } resolves to the absolute state path, { "$index": true } resolves to the index number, and { "$state": "/path" } reads a value from state.`),o.push(`For lists where users can add/remove items (todos, carts, etc.), use pushState and removeState instead of hardcoding with setState.`),o.push(``),o.push(`IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.`),o.push(``);let S=s;if(S){o.push(`AVAILABLE COMPONENTS (${e.componentNames.length}):`),o.push(``);for(let[e,t]of Object.entries(S)){let n=t.props?Yp(t.props):`{}`,r=t.slots??[],i=r.filter(e=>e!=="default"),a=r.includes(`default`),s=d?[a?`accepts children`:``,i.length>0?`slots: ${i.join(`, `)}`:``].filter(Boolean).join(`; `):r.length>0?`accepts children`:``,c=s?` [${s}]`:``,l=t.events&&t.events.length>0?` [events: ${t.events.join(`, `)}]`:``,u=t.description?` - ${t.description}`:``;o.push(`- ${e}: ${n}${u}${c}${l}`)}o.push(``)}let C=e.data.actions,w=e.schema.builtInActions??[],T=C&&e.actionNames.length>0,E=w.length>0;if(T||E){o.push(`AVAILABLE ACTIONS:`),o.push(``);for(let e of w)o.push(`- ${e.name}: ${e.description} [built-in]`);if(T)for(let[e,t]of Object.entries(C))o.push(`- ${e}${t.description?`: ${t.description}`:``}`);o.push(``)}o.push("EVENTS (the `on` field):"),o.push("Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),o.push('Each key in `on` is an event name (from the component\'s supported events), and the value is an action binding: `{ "action": "<actionName>", "params": { ... } }`.'),o.push(``),o.push(`Example:`),o.push(` ${JSON.stringify({type:p,props:_,on:{press:{action:`setState`,params:{statePath:`/saved`,value:!0}}},children:[]})}`),o.push(``),o.push(`Action params can use dynamic references to read from state: { "$state": "/statePath" }.`),o.push("IMPORTANT: Do NOT put action/actionParams inside props. Always use the `on` field for event bindings."),o.push(``),o.push(`VISIBILITY CONDITIONS:`),o.push("Elements can have an optional `visible` field to conditionally show/hide based on state. IMPORTANT: `visible` is a top-level field on the element object (sibling of type/props/children), NOT inside props."),o.push(`Correct: ${JSON.stringify({type:p,props:_,visible:{$state:`/activeTab`,eq:`home`},children:[`...`]})}`),o.push('- `{ "$state": "/path" }` - visible when state at path is truthy'),o.push('- `{ "$state": "/path", "not": true }` - visible when state at path is falsy'),o.push('- `{ "$state": "/path", "eq": "value" }` - visible when state equals value'),o.push('- `{ "$state": "/path", "neq": "value" }` - visible when state does not equal value'),o.push('- `{ "$state": "/path", "gt": N }` / `gte` / `lt` / `lte` - numeric comparisons'),o.push(`- Use ONE operator per condition (eq, neq, gt, gte, lt, lte). Do not combine multiple operators.`),o.push('- Any condition can add `"not": true` to invert its result'),o.push("- `[condition, condition]` - all conditions must be true (implicit AND)"),o.push('- `{ "$and": [condition, condition] }` - explicit AND (use when nesting inside $or)'),o.push('- `{ "$or": [condition, condition] }` - at least one must be true (OR)'),o.push("- `true` / `false` - always visible/hidden"),o.push(``),o.push(`Use a component with on.press bound to setState to update state and drive visibility.`),o.push(`Example: A ${p} with on: { "press": { "action": "setState", "params": { "statePath": "/activeTab", "value": "home" } } } sets state, then a container with visible: { "$state": "/activeTab", "eq": "home" } shows only when that tab is active.`),o.push(``),o.push(`For tab patterns where the first/default tab should be visible when no tab is selected yet, use $or to handle both cases: visible: { "$or": [{ "$state": "/activeTab", "eq": "home" }, { "$state": "/activeTab", "not": true }] }. This ensures the first tab is visible both when explicitly selected AND when /activeTab is not yet set.`),o.push(``),o.push(`DYNAMIC PROPS:`),o.push(`Any prop value can be a dynamic expression that resolves based on state. Three forms are supported:`),o.push(``),o.push('1. Read-only state: `{ "$state": "/statePath" }` - resolves to the value at that state path (one-way read).'),o.push(' Example: `"color": { "$state": "/theme/primary" }` reads the color from state.'),o.push(``),o.push('2. Two-way binding: `{ "$bindState": "/statePath" }` - resolves to the value at the state path AND enables write-back. Use on form input props (value, checked, pressed, etc.).'),o.push(' Example: `"value": { "$bindState": "/form/email" }` binds the input value to /form/email.'),o.push(' Inside repeat scopes: `"checked": { "$bindItem": "completed" }` binds to the current item\'s completed field.'),o.push(``),o.push('3. Conditional: `{ "$cond": <condition>, "$then": <value>, "$else": <value> }` - evaluates the condition (same syntax as visibility conditions) and picks the matching value.'),o.push(' Example: `"color": { "$cond": { "$state": "/activeTab", "eq": "home" }, "$then": "#007AFF", "$else": "#8E8E93" }`'),o.push(``),o.push(`Use $bindState for form inputs (text fields, checkboxes, selects, sliders, etc.) and $state for read-only data display. Inside repeat scopes, use $bindItem for form inputs bound to the current item. Use dynamic props instead of duplicating elements with opposing visible conditions when only prop values differ.`),o.push(``),o.push('4. Template: `{ "$template": "Hello, ${/name}!" }` - interpolates references in the string. Absolute paths like `${/path}` resolve against the state model. Bare names like `${field}` resolve against the current repeat item first, then fall back to the state model at `/<field>`.'),o.push(' Example: `"label": { "$template": "Items: ${/cart/count} | Total: ${/cart/total}" }` renders "Items: 3 | Total: 42.00" when /cart/count is 3 and /cart/total is 42.00. Inside a repeat, `{ "$template": "${name} - ${email}" }` reads name and email from each item.'),o.push(``);let D=e.data.functions;if(D&&Object.keys(D).length>0){o.push('5. Computed: `{ "$computed": "<functionName>", "args": { "key": <expression> } }` - calls a registered function with resolved args and returns the result.'),o.push(' Example: `"value": { "$computed": "fullName", "args": { "first": { "$state": "/form/firstName" }, "last": { "$state": "/form/lastName" } } }`'),o.push(` Available functions:`);for(let e of Object.keys(D))o.push(` - ${e}`);o.push(``)}let O=t.directives;if(O&&O.length>0){o.push(`CUSTOM DYNAMIC VALUES:`),o.push(``);for(let e of O){let t=e.description?` (${e.description})`:``;o.push(`- ${e.name}${t}: ${Yp(e.schema)}`)}o.push(``),o.push(`Directives compose: any value field can contain another directive or a $state expression, resolved inside-out.`),o.push(``)}s&&Object.entries(s).some(([,e])=>e.props?Yp(e.props).includes(`checks`):!1)&&(o.push(`VALIDATION:`),o.push("Form components that accept a `checks` prop support client-side validation."),o.push(`Each check is an object: { "type": "<name>", "message": "...", "args": { ... } }`),o.push(``),o.push(`Built-in validation types:`),o.push(` - required — value must be non-empty`),o.push(` - email — valid email format`),o.push(` - minLength — minimum string length (args: { "min": N })`),o.push(` - maxLength — maximum string length (args: { "max": N })`),o.push(` - pattern — match a regex (args: { "pattern": "regex" })`),o.push(` - min — minimum numeric value (args: { "min": N })`),o.push(` - max — maximum numeric value (args: { "max": N })`),o.push(` - numeric — value must be a number`),o.push(` - url — valid URL format`),o.push(` - matches — must equal another field (args: { "other": { "$state": "/path" } })`),o.push(` - equalTo — alias for matches (args: { "other": { "$state": "/path" } })`),o.push(` - lessThan — value must be less than another field (args: { "other": { "$state": "/path" } })`),o.push(` - greaterThan — value must be greater than another field (args: { "other": { "$state": "/path" } })`),o.push(` - requiredIf — required only when another field is truthy (args: { "field": { "$state": "/path" } })`),o.push(``),o.push(`Example:`),o.push(` "checks": [{ "type": "required", "message": "Email is required" }, { "type": "email", "message": "Invalid email" }]`),o.push(``),o.push(`IMPORTANT: When using checks, the component must also have a { $bindState } or { $bindItem } on its value/checked prop for two-way binding.`),o.push(`Always include validation checks on form inputs for a good user experience (e.g. required, email, minLength).`),o.push(``)),(T||E)&&(o.push(`STATE WATCHERS:`),o.push("Elements can have an optional `watch` field to react to state changes and trigger actions. The `watch` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),o.push(`Maps state paths (JSON Pointers) to action bindings. When the value at a watched path changes, the bound actions fire automatically.`),o.push(``),o.push(`Example (cascading select — country changes trigger city loading):`),o.push(` ${JSON.stringify({type:`Select`,props:{value:{$bindState:`/form/country`},options:[`US`,`Canada`,`UK`]},watch:{"/form/country":{action:`loadCities`,params:{country:{$state:`/form/country`}}}},children:[]})}`),o.push(``),o.push("Use `watch` for cascading dependencies where changing one field should trigger side effects (loading data, resetting dependent fields, computing derived values)."),o.push("IMPORTANT: `watch` is a top-level field on the element (sibling of type/props/children), NOT inside props. Watchers only fire when the value changes, not on initial render."),o.push(``));let k=t.editModes;k&&k.length>0&&o.push(Fp({modes:k},`json`)),o.push(`RULES:`);let A=a===`inline`?["When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence",`Write a brief conversational response before any JSONL output`,`First set root: {"op":"add","path":"/root","value":"<root-key>"}`,`Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}`,`Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.`,`ONLY use components listed above`,`Each element value needs: type, props, children (array of child keys)`,`Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')`]:[`Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences`,`First set root: {"op":"add","path":"/root","value":"<root-key>"}`,`Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}`,`Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.`,`ONLY use components listed above`,`Each element value needs: type, props, children (array of child keys)`,`Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')`],ee=e.schema.defaultRules??[];return[...A,...ee,...r].forEach((e,t)=>{o.push(`${t+1}. ${e}`)}),o.join(`
|
|
68
|
+
`)}function Wp(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?Gp(e.props):{}}function Gp(e){if(!e||!e._def)return{};let t=e._def,n=Jp(e);if(n!==`ZodObject`&&n!==`object`)return{};let r=typeof t.shape==`function`?t.shape():t.shape;if(!r)return{};let i={};for(let[e,t]of Object.entries(r)){let n=Jp(t);n!==`ZodOptional`&&n!==`optional`&&n!==`ZodNullable`&&n!==`nullable`&&(i[e]=Kp(t))}return i}function Kp(e){if(!e||!e._def)return`...`;let t=e._def;switch(Jp(e)){case`ZodString`:case`string`:return`example`;case`ZodNumber`:case`number`:return 0;case`ZodBoolean`:case`boolean`:return!0;case`ZodLiteral`:case`literal`:return t.value;case`ZodEnum`:case`enum`:if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries==`object`){let e=Object.values(t.entries);return e.length>0?e[0]:`example`}return`example`;case`ZodOptional`:case`optional`:case`ZodNullable`:case`nullable`:case`ZodDefault`:case`default`:{let e=t.innerType??t.wrapped;return e?Kp(e):null}case`ZodArray`:case`array`:return[];case`ZodObject`:case`object`:return Gp(e);case`ZodUnion`:case`union`:{let e=t.options;return e&&e.length>0?Kp(e[0]):`...`}default:return`...`}}function qp(e){if(!e||!e._def)return null;let t=e._def,n=Jp(e);if(n!==`ZodObject`&&n!==`object`)return null;let r=typeof t.shape==`function`?t.shape():t.shape;if(!r)return null;for(let[e,t]of Object.entries(r)){let n=Jp(t);if(n!==`ZodOptional`&&n!==`optional`&&n!==`ZodNullable`&&n!==`nullable`&&(n===`ZodString`||n===`string`))return e}return null}function Jp(e){if(!e||!e._def)return``;let t=e._def;return t.typeName??t.type??``}function Yp(e){if(!e||!e._def)return`unknown`;let t=e._def;switch(Jp(e)){case`ZodString`:case`string`:return`string`;case`ZodNumber`:case`number`:return`number`;case`ZodBoolean`:case`boolean`:return`boolean`;case`ZodLiteral`:case`literal`:{let e=t.values?.[0]??t.value;return JSON.stringify(e)}case`ZodEnum`:case`enum`:{let e;if(Array.isArray(t.values))e=t.values;else if(t.entries&&typeof t.entries==`object`)e=Object.values(t.entries);else return`enum`;return e.map(e=>`"${e}"`).join(` | `)}case`ZodArray`:case`array`:{let e=typeof t.element==`object`?t.element:typeof t.type==`object`?t.type:void 0;return e?`Array<${Yp(e)}>`:`Array<unknown>`}case`ZodObject`:case`object`:{let e=typeof t.shape==`function`?t.shape():t.shape;return e?`{ ${Object.entries(e).map(([e,t])=>{let n=Jp(t);return`${e}${n===`ZodOptional`||n===`ZodNullable`||n===`optional`||n===`nullable`?`?`:``}: ${Yp(t)}`}).join(`, `)} }`:`object`}case`ZodOptional`:case`optional`:case`ZodNullable`:case`nullable`:{let e=t.innerType??t.wrapped;return e?Yp(e):`unknown`}case`ZodUnion`:case`union`:{let e=t.options;return e?e.map(e=>Yp(e)).join(` | `):`unknown`}case`ZodRecord`:case`record`:{let e=t.keyType??void 0,n=t.valueType??t.element??void 0;return`Record<${e?Yp(e):`string`}, ${n?Yp(n):`unknown`}>`}case`ZodDefault`:case`default`:{let e=t.innerType??t.wrapped;return e?Yp(e):`unknown`}default:return`unknown`}}function Xp(e){return typeof e.type==`string`?e.type:typeof e.typeName==`string`?e.typeName:``}function Zp(e){return e.startsWith(`Zod`)?e.slice(3).toLowerCase():e.toLowerCase()}function Qp(e,t=!1){let n=e._def;switch(Zp(Xp(n))){case`string`:return{type:`string`};case`number`:return{type:`number`};case`boolean`:return{type:`boolean`};case`literal`:{let e=n.values;return{const:e?e[0]:n.value}}case`enum`:{let e=n.entries;return{enum:(e?Object.values(e):n.values)??[]}}case`array`:{let e=n.element??n.type;return{type:`array`,items:e?Qp(e,t):{}}}case`object`:{let e=n.shape,r=typeof e==`function`?e():e;if(!r)return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{type:`object`};let i={},a=[];for(let[e,n]of Object.entries(r)){let r=n._def,o=Zp(Xp(r)),s=o===`optional`||o===`nullable`;t?(a.push(e),i[e]=s?{anyOf:[Qp(n,t),{type:`null`}]}:Qp(n,t)):(i[e]=Qp(n),s||a.push(e))}return{type:`object`,properties:i,required:a.length>0?a:void 0,additionalProperties:!1}}case`record`:{let e=n.valueType;return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{type:`object`,additionalProperties:!e||Qp(e)}}case`optional`:case`nullable`:{let e=n.innerType;return e?Qp(e,t):{}}case`union`:{let e=n.options;return e?{anyOf:e.map(e=>Qp(e,t))}:{}}case`any`:case`unknown`:return t?{type:`object`,properties:{},required:[],additionalProperties:!1}:{};default:return{}}}Nd({root:X().min(1),elements:Bd(X(),Nd({type:X(),props:Bd(X(),Dd()),children:jd(X()).optional(),slots:Bd(X(),jd(X())).optional(),on:Bd(X(),Dd()).optional(),visible:Dd().optional()}).strict()),state:Bd(X(),Dd()).optional()}).strict(),vp.extend({params:Bd(X(),Dd()).optional(),onSuccess:Dd().optional(),onError:Dd().optional()}).strict();var $p=_d().min(0).max(1);Nd({answers:Bd(X(),Nd({type:Wd(`choice`),choice:X()})),providerMetadata:Nd({typesafe:Nd({confidence:Bd(X(),$p)}).optional()}).optional(),usage:Nd({inputTokens:_d().int().nonnegative().optional()}).optional()}),Lp(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref(`catalog.components`),props:e.propsOf(`catalog.components`),children:e.array(e.string()),slots:{...e.record(e.array(e.string())),...e.optional()},visible:{...e.any(),...e.optional()},repeat:{...e.any(),...e.optional()}}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:`setState`,description:`Update a value in the state model at the given statePath. Params: { statePath: string, value: any }`},{name:`pushState`,description:`Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.`},{name:`removeState`,description:`Remove an item from an array in state by index. Params: { statePath: string, index: number }`},{name:`validateForm`,description:`Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }.`}],defaultRules:[`CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.`,`SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.`,`REQUIRED FIELDS: Every element MUST include a "children" array. Leaf elements (text, badges, inputs, images) use an empty array: "children": []. Omitting "children" fails validation.`,`NAMED SLOTS: Use "children" for the default slot. For other slots declared by the component, use a top-level "slots" object that maps each slot name to child element keys, for example {"slots":{"header":["heading"],"footer":["actions"]}}. Never use "slots.default". Every referenced key must exist.`,`CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.`,`CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.`,`When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).`,`When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. For a nested list stored on the enclosing item, use "repeat": { "statePath": { "$item": "comments" }, "key": "id" }. The $item statePath form is valid only inside another repeat. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.`,`Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.`,`For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.`,`Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty.`]});var em=Symbol(`json-render:state`),tm=j({name:`StateProvider`,props:{store:{type:Object,default:void 0},initialState:{type:Object,default:void 0},onStateChange:{type:Function,default:void 0}},setup(e,{slots:n}){let r=!!e.store,i=r?null:Ef(e.initialState??{}),a=e.store??i,o=t(a.getSnapshot()),s=a.subscribe(()=>{o.value=a.getSnapshot()});if(_(s),!r){let t=e.initialState&&Object.keys(e.initialState).length>0?Of(e.initialState):{};l(()=>e.initialState,e=>{if(!e)return;let n=Object.keys(e).length>0?Of(e):{},r=new Set([...Object.keys(t),...Object.keys(n)]),i={};for(let e of r)t[e]!==n[e]&&(i[e]=e in n?n[e]:void 0);t=n,Object.keys(i).length>0&&a.update(i)})}let c=C(e.onStateChange);return l(()=>e.onStateChange,e=>{c.value=e}),y(em,{state:o,get:e=>a.get(e),set:(e,t)=>{let n=a.getSnapshot();a.set(e,t),!r&&a.getSnapshot()!==n&&c.value?.([{path:e,value:t}])},update:e=>{let t=a.getSnapshot();if(a.update(e),!r&&a.getSnapshot()!==t){let n=[];for(let[r,i]of Object.entries(e))xf(t,r)!==i&&n.push({path:r,value:i});n.length>0&&c.value?.(n)}},getSnapshot:()=>a.getSnapshot()}),()=>n.default?.()}});function nm(){let e=M(em);if(!e)throw Error(`useStateStore must be used within a StateProvider`);return e}var rm=Symbol(`json-render:visibility`),im=j({name:`VisibilityProvider`,setup(e,{slots:t}){let{state:n}=nm(),r=u(()=>({stateModel:n.value}));return y(rm,{isVisible:e=>Hf(e,r.value),ctx:r}),()=>t.default?.()}});function am(){let e=M(rm);if(!e)throw Error(`useVisibility must be used within a VisibilityProvider`);return e}var om=Symbol(`json-render:validation`);function sm(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i){if(typeof n==`object`&&n&&typeof i==`object`&&i){let e=n.$state,t=i.$state;if(typeof e==`string`&&e===t)continue}return!1}}return!0}function cm(e,t){if(e===t)return!0;if(e.validateOn!==t.validateOn)return!1;let n=e.checks??[],r=t.checks??[];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t.type!==i.type||t.message!==i.message||!sm(t.args,i.args))return!1}return!0}var lm=j({name:`ValidationProvider`,props:{customFunctions:{type:Object,default:()=>({})}},setup(e,{slots:t}){let{state:n}=nm(),r=C({}),i=C({}),a=(e,t)=>{let n=i.value[e];n&&cm(n,t)||(i.value={...i.value,[e]:t})},o=(t,i)=>{let a=n.value,o=t.split(`/`).filter(Boolean),s=a;for(let e of o)if(typeof s==`object`&&s)s=s[e];else{s=void 0;break}let c=Tp(i,{value:s,stateModel:a,customFunctions:e.customFunctions});return r.value={...r.value,[t]:{touched:r.value[t]?.touched??!0,validated:!0,result:c}},c};return y(om,{get customFunctions(){return e.customFunctions},get fieldStates(){return r.value},validate:o,touch:e=>{r.value={...r.value,[e]:{...r.value[e],touched:!0,validated:r.value[e]?.validated??!1,result:r.value[e]?.result??null}}},clear:e=>{let{[e]:t,...n}=r.value;r.value=n},validateAll:()=>{let e=!0;for(let[t,n]of Object.entries(i.value))o(t,n).valid||(e=!1);return e},registerField:a}),()=>t.default?.()}});function um(){return M(om,null)??null}var dm=0;function fm(){return dm+=1,`${Date.now()}-${dm}`}function pm(e,t){if(e==null)return e;if(e===`$id`)return fm();if(typeof e==`object`&&!Array.isArray(e)){let n=e,r=Object.keys(n);if(r.length===1&&typeof n.$state==`string`)return t(n.$state);if(r.length===1&&`$id`in n)return fm()}if(Array.isArray(e))return e.map(e=>pm(e,t));if(typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=pm(i,t);return n}return e}var mm=Symbol(`json-render:actions`),hm=j({name:`ActionProvider`,props:{handlers:{type:Object,default:()=>({})},navigate:{type:Function,default:void 0}},setup(e,{slots:t}){let{get:n,set:r,getSnapshot:i}=nm(),a=um(),o=C(e.handlers??{}),s=C(new Set),c=C(null);l(()=>e.handlers,e=>{e&&(o.value=e)});let u=(e,t)=>{o.value={...o.value,[e]:t}},d=async t=>{let l=yp(t,i()),u=up(),f=Date.now();sp({id:u,name:l.action,params:l.params,at:f});let p=!0,m;try{if(l.action===`setState`&&l.params){let e=l.params.statePath,t=l.params.value;e&&r(e,t);return}if(l.action===`pushState`&&l.params){let e=l.params.statePath,t=l.params.value;if(e){let i=pm(t,n),a=n(e)??[];r(e,[...a,i]);let o=l.params.clearStatePath;o&&r(o,``)}return}if(l.action===`removeState`&&l.params){let e=l.params.statePath,t=l.params.index;if(e!==void 0&&t!==void 0){let i=n(e)??[];r(e,i.filter((e,n)=>n!==t))}return}if(l.action===`validateForm`){let e=a?.validateAll;if(!e){console.warn(`validateForm action was dispatched but no ValidationProvider is connected. Ensure ValidationProvider is rendered inside the provider tree.`);return}let t=e(),n={};for(let[e,t]of Object.entries(a.fieldStates))t.result&&!t.result.valid&&(n[e]=t.result.errors);let i=l.params?.statePath||`/formValidation`;r(i,{valid:t,errors:n});return}if(l.action===`push`&&l.params){let e=l.params.screen;if(e){let t=n(`/currentScreen`),i=n(`/navStack`)??[];t?r(`/navStack`,[...i,t]):r(`/navStack`,[...i,``]),r(`/currentScreen`,e)}return}if(l.action===`pop`){let e=n(`/navStack`)??[];if(e.length>0){let t=e[e.length-1];r(`/navStack`,e.slice(0,-1)),t?r(`/currentScreen`,t):r(`/currentScreen`,void 0)}return}let t=o.value[l.action];if(!t){console.warn(`No handler registered for action: ${l.action}`);return}if(l.confirm){await new Promise((e,n)=>{c.value={action:l,handler:t,resolve:()=>{c.value=null,e()},reject:()=>{c.value=null,n(Error(`Action cancelled`))}}});let n=new Set(s.value);n.add(l.action),s.value=n;try{await xp({action:l,handler:t,setState:r,navigate:e.navigate,executeAction:async e=>{await d(e)}})}finally{let e=new Set(s.value);e.delete(l.action),s.value=e}return}let i=new Set(s.value);i.add(l.action),s.value=i;try{await xp({action:l,handler:t,setState:r,navigate:e.navigate,executeAction:async e=>{await d(e)}})}finally{let e=new Set(s.value);e.delete(l.action),s.value=e}}catch(e){throw p=!1,m=e,e}finally{let e=Date.now();cp({id:u,name:l.action,ok:p,at:e,durationMs:e-f,error:m})}};return y(mm,{get handlers(){return o.value},get loadingActions(){return s.value},get pendingConfirmation(){return c.value},execute:d,confirm:()=>c.value?.resolve(),cancel:()=>c.value?.reject(),registerHandler:u}),()=>t.default?.()}});function gm(){let e=M(mm);if(!e)throw Error(`useActions must be used within an ActionProvider`);return e}var _m=j({name:`ConfirmDialog`,props:{confirm:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup(e){return()=>{let t=e.confirm.variant===`danger`;return R(`div`,{style:{position:`fixed`,inset:`0`,backgroundColor:`rgba(0, 0, 0, 0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:`50`},onClick:e.onCancel},[R(`div`,{style:{backgroundColor:`white`,borderRadius:`8px`,padding:`24px`,maxWidth:`400px`,width:`100%`,boxShadow:`0 20px 25px -5px rgba(0, 0, 0, 0.1)`},onClick:e=>e.stopPropagation()},[R(`h3`,{style:{margin:`0 0 8px 0`,fontSize:`18px`,fontWeight:`600`}},e.confirm.title),R(`p`,{style:{margin:`0 0 24px 0`,color:`#6b7280`}},e.confirm.message),R(`div`,{style:{display:`flex`,gap:`12px`,justifyContent:`flex-end`}},[R(`button`,{style:{padding:`8px 16px`,borderRadius:`6px`,border:`1px solid #d1d5db`,backgroundColor:`white`,cursor:`pointer`},onClick:e.onCancel},e.confirm.cancelLabel??`Cancel`),R(`button`,{style:{padding:`8px 16px`,borderRadius:`6px`,border:`none`,backgroundColor:t?`#dc2626`:`#3b82f6`,color:`white`,cursor:`pointer`},onClick:e.onConfirm},e.confirm.confirmLabel??`Confirm`)])])])}}}),vm=Symbol(`json-render:repeat-scope`),ym=j({name:`RepeatScopeProvider`,props:{item:{required:!0},index:{type:Number,required:!0},basePath:{type:String,required:!0}},setup(e,{slots:t}){return y(vm,e),()=>t.default?.()}});function bm(){return M(vm,null)??null}var xm=new WeakMap,Sm={},Cm=Symbol(`json-render:functions`),wm=j({name:`FunctionsProvider`,props:{functions:{type:Object,default:void 0}},setup(e,{slots:t}){let n=u(()=>e.functions??Sm);return y(Cm,n),()=>t.default?.()}});function Tm(){return M(Cm,u(()=>Sm))}var Em=Symbol(`json-render:directives`),Dm=j({name:`DirectivesProvider`,props:{directives:{type:Array,default:void 0}},setup(e,{slots:t}){let n=u(()=>e.directives?Uf(e.directives):void 0);return y(Em,n),()=>t.default?.()}});function Om(){return M(Em,u(()=>void 0))}var km=j({name:`ElementErrorBoundary`,props:{elementType:{type:String,required:!0}},setup(e,{slots:t}){let n=C(!1);return A(t=>(console.error(`[json-render] Rendering error in <${e.elementType}>:`,t),n.value=!0,!1)),()=>n.value?null:t.default?.()}});async function Am(e,t,n,r,i){for(let a of e){if(i?.())break;if(!a.params){if(await r(a),i?.())break;continue}let e={...t,stateModel:n()},o={};for(let[t,n]of Object.entries(a.params))o[t]=ap(n,e);if(await r({...a,params:o}),i?.())break}}function jm(){let e=C(pp()),t=mp(()=>{e.value=pp()});return D(t),e}var Mm=j({name:`JsonRenderElement`,props:{element:{type:Object,required:!0},elementKey:{type:String,default:void 0},spec:{type:Object,required:!0},registry:{type:Object,required:!0},loading:{type:Boolean,default:void 0},fallback:{type:Object,default:void 0}},setup(e){let t=jm(),n=bm(),{ctx:r}=am(),{execute:i}=gm(),{getSnapshot:a,state:o}=nm(),s=Tm(),c=Om(),d=u(()=>{let e=n?{...r.value,repeatItem:n.item,repeatIndex:n.index,repeatBasePath:n.basePath}:{...r.value};return e.functions=s.value,e.directives=c.value,e}),f=async t=>{let n=e.element.on?.[t];n&&await Am(Array.isArray(n)?n:[n],d.value,a,i)},p=t=>{let n=e.element.on?.[t];return n?{emit:()=>{f(t)},shouldPreventDefault:(Array.isArray(n)?n:[n]).some(e=>e.preventDefault),bound:!0}:{emit:()=>{},shouldPreventDefault:!1,bound:!1}},m=u(()=>{let t=e.element.watch;if(!t)return;let n={};for(let e of Object.keys(t))n[e]=xf(o.value,e);return n});return l(m,(t,n,r)=>{let o=e.element.watch;if(!o||!t)return;let s=!1;r(()=>{s=!0});let c=Object.keys(o);(async()=>{for(let e of c){if(s)break;if(n&&t[e]===n[e])continue;let r=o[e];r&&await Am(Array.isArray(r)?r:[r],d.value,a,i,()=>s)}})().catch(console.error)},{deep:!0}),()=>{let n=d.value;if(!(e.element.visible===void 0||Hf(e.element.visible,n)))return null;let r=e.element.props,i=ip(r,n),a=rp(r,n),o=a===e.element.props?e.element:{...e.element,props:a},s=e.registry[o.type]??e.fallback;if(!s)return console.warn(`[json-render] No renderer for component type: ${o.type}`),null;let c=xm.get(e.registry)?.[o.type];if(o.slots&&c?.slots){let e=new Set(c.slots);for(let t of Object.keys(o.slots))t==="default"?console.warn(`[json-render] Component "${o.type}" uses slots.default. Use "children" for default slot content.`):e.has(t)||console.warn(`[json-render] Unknown slot "${t}" on component "${o.type}". Available slots: ${c.slots.join(`, `)}`)}let l=(t,n)=>t.map(t=>{let r=e.spec.elements[t];if(!r){if(!e.loading){let e=n?`in slot "${n}" of "${o.type}"`:`as child of "${o.type}"`;console.warn(`[json-render] Missing element "${t}" referenced ${e}. This element will not render.`)}return null}return R(Mm,{key:t,element:r,elementKey:t,spec:e.spec,registry:e.registry,loading:e.loading,fallback:e.fallback})}).filter(e=>e!==null),u=o.repeat?R(Nm,{element:o,spec:e.spec,registry:e.registry,loading:e.loading,fallback:e.fallback}):o.children?l(o.children):void 0,m=o.slots?Object.fromEntries(Object.entries(o.slots).filter(([e])=>e!=="default").map(([e,t])=>[e,()=>l(t,e)])):{},h=R(s,{element:o,emit:f,on:p,bindings:i,loading:e.loading},{default:()=>u,...m}),g=t.value&&e.elementKey?R(`span`,{"data-jr-key":e.elementKey,style:`display:contents`},[h]):h;return R(km,{elementType:o.type},{default:()=>g})}}}),Nm=j({name:`JsonRenderRepeatChildren`,props:{element:{type:Object,required:!0},spec:{type:Object,required:!0},registry:{type:Object,required:!0},loading:{type:Boolean,default:void 0},fallback:{type:Object,default:void 0}},setup(e){let{state:t}=nm(),n=bm();return()=>{let r=e.element.repeat;if(!r?.statePath)return null;let i=Sf(r.statePath,n?.basePath);if(i===void 0)return console.warn(`[json-render/vue] $item in repeat.statePath used outside of a repeat scope`),null;let a=xf(t.value,i);return(Array.isArray(a)?a:[]).map((t,n)=>{let a=r.key&&typeof t==`object`&&t?String(t[r.key]??n):String(n);return R(ym,{key:a,item:t,index:n,basePath:Cf(i,n)},{default:()=>e.element.children?.map(t=>{let n=e.spec.elements[t];return n?R(Mm,{key:t,element:n,elementKey:t,spec:e.spec,registry:e.registry,loading:e.loading,fallback:e.fallback}):(e.loading||console.warn(`[json-render] Missing element "${t}" referenced as child of "${e.element.type}" (repeat). This element will not render.`),null)}).filter(e=>e!==null)??null})})}}}),Pm=j({name:`JsonRenderer`,props:{spec:{type:Object,default:null},registry:{type:Object,required:!0},loading:{type:Boolean,default:void 0},fallback:{type:Object,default:void 0}},setup(e){return()=>{if(!e.spec?.root)return null;let t=e.spec.elements[e.spec.root];return t?R(Mm,{element:t,elementKey:e.spec.root,spec:e.spec,registry:e.registry,loading:e.loading,fallback:e.fallback}):null}}}),Fm=j({name:`ConfirmationDialogManager`,setup(){let{pendingConfirmation:e,confirm:t,cancel:n}=gm();return()=>e?.action.confirm?R(_m,{confirm:e.action.confirm,onConfirm:t,onCancel:n}):null}}),Im=j({name:`JSONUIProvider`,props:{registry:{type:Object,required:!0},store:{type:Object,default:void 0},initialState:{type:Object,default:void 0},handlers:{type:Object,default:void 0},navigate:{type:Function,default:void 0},validationFunctions:{type:Object,default:void 0},functions:{type:Object,default:void 0},directives:{type:Array,default:void 0},onStateChange:{type:Function,default:void 0}},setup(e,{slots:t}){return()=>R(tm,{store:e.store,initialState:e.initialState,onStateChange:e.onStateChange},{default:()=>R(im,null,{default:()=>R(lm,{customFunctions:e.validationFunctions},{default:()=>R(hm,{handlers:e.handlers,navigate:e.navigate},{default:()=>R(wm,{functions:e.functions},{default:()=>R(Dm,{directives:e.directives},{default:()=>[t.default?.(),R(Fm)]})})})})})})}});function Lm(e){if(e==null||Object(e)!==e)return!1;try{return Function.prototype.toString.call(e),!0}catch{return!1}}function Z(e,t){if(t===`undefined`)return e===void 0;if(t===`object`&&e===null)return!0;if(e==null)return!1;let n=Object(e)!==e;if(!n)return t===`function`?Lm(e):t===`object`&&!Lm(e);let r=Object.prototype.toString.call(e);switch(t){case`bigint`:return n&&r===`[object BigInt]`;case`boolean`:return n&&r===`[object Boolean]`;case`function`:return!1;case`number`:return n&&r===`[object Number]`;case`object`:return!1;case`string`:return n&&r===`[object String]`;case`symbol`:return n&&r===`[object Symbol]`}throw he.RUNTIME_R0008({message:`Unsupported runtime type: ${t}`})}function Rm(e){if(e===void 0)return`undefined`;if(e===null)return`object`;if(Lm(e))return`function`;if(Object(e)===e)return`object`;let t=Object.prototype.toString.call(e);return t===`[object BigInt]`?`bigint`:t===`[object Boolean]`?`boolean`:t===`[object Number]`?`number`:t===`[object String]`?`string`:`symbol`}function zm(e){if(Z(e,`string`))return e;let t=[];try{return JSON.stringify(e,function(e,n){if(Z(n,`bigint`))return`${n}n`;if(!Z(n,`object`)||n===null)return n;for(;t.length&&t.at(-1)!==this;)t.pop();return t.includes(n)?`[Circular]`:(t.push(n),n)},2)??String(e)}catch(e){let t;try{let n=e?.message;if(typeof n==`string`)t=n;else if(n!==void 0)try{t=String(n)}catch{}}catch{}if(t===void 0)return`[Unable to display payload]`;try{return`[Unable to display payload: ${t}]`}catch{return`[Unable to display payload]`}}}function Bm(e){return e!==null&&Z(e,`object`)&&!Array.isArray(e)?e:void 0}function Vm(e){let t=Bm(e);if(!Array.isArray(t?.parts))return;let n=t.parts.flatMap(e=>{let t=Bm(e);return Z(t?.text,`string`)?[t.text]:t?.type===`image`&&Z(t.url,`string`)&&/^(https?:\/\/|\/(?!\/))/.test(t.url)?[`\n\n![${Z(t.name,`string`)?t.name.replace(/[\[\]\r\n]/g,``):`Attachment`}](<${t.url.replace(/[<>\r\n]/g,``)}>)\n\n`]:[]});return n.length?n.join(``):void 0}function Hm(e){return e===`assistant`||e===`system`||e===`tool`||e===`user`?e:void 0}function Um(e){for(let t of[`vitehub.activity.progress`,`result.text`,`input.prompt`,`input.messages`,`vitehub.activity.body`,`message.content`,`approval.input`,`approval.reason`,`tool.error`,`error.message`,`tool.output`,`tool.input`,`content`,`body`,`output`,`input`]){let n=e[t];if(n!==void 0&&n!==`undefined`){if(Z(n,`string`)&&n)return n;try{let e=JSON.stringify(n,(e,t)=>Z(t,`bigint`)?`${t}n`:t,2);if(e)return e}catch(e){return e instanceof Error?`[Unable to display payload: ${e.message}]`:`[Unable to display payload]`}}}}function Wm(e){for(let t of[`tool.output`,`tool.input`]){let n=Bm(Bm(e[t])?.item),r=n?.type===`fileChange`||e[`tool.name`]===`File change`||e[`tool.name`]===`Edit`;if(!n||!r||!Array.isArray(n.changes))continue;let i=[],a=n.changes.flatMap(e=>{let t=Bm(e);if(!Z(t?.path,`string`))return[];let n=t.path.split(`/workspace/`).at(-1)||t.path.replace(/^\/+/,``);return i.push(n),!Z(t.diff,`string`)||!t.diff?[]:[`diff --git a/${n} b/${n}\n--- a/${n}\n+++ b/${n}\n${t.diff.endsWith(`
|
|
69
|
+
`)?t.diff:`${t.diff}\n`}`]});if(a.length||i.length)return{patches:a,paths:i}}let t=e[`vitehub.activity.body`];if(e[`vitehub.activity.kind`]===`change`&&Z(t,`string`)&&/^diff --git /m.test(t)){let e=[...t.matchAll(/^diff --git a\/(.+?) b\/.+$/gm)].map(e=>e[1]);return{patches:(t.endsWith(`
|
|
70
|
+
`)?t:`${t}\n`).split(/^(?=diff --git )/m).filter(e=>e.startsWith(`diff --git `)),paths:[...new Set(e)]}}return{patches:[],paths:[]}}function Gm(e,t){let n=t=>{let n=Bm(e[t]);return Bm(n?.item)??n},r=n(`tool.output`),i=n(`tool.input`),a=Q([r,i].map(e=>Array.isArray(e?.commandActions)?Bm(e.commandActions[0]):void 0).find(e=>Q(e??{},`command`)!==void 0)??{},`command`)??Q(i??{},`command`)??Q(r??{},`command`);if(!a)return;let o=t.filter(e=>e.name===`agent.tool.output`).map(e=>e.attributes?.[`tool.output`]).filter(e=>Z(e,`string`)).join(``),s=t.filter(e=>/\.(finish|error)$/.test(e.name)).map(e=>e.attributes?.[`tool.output`]).findLast(e=>Z(e,`string`)),c=Z(r?.aggregatedOutput,`string`)?r.aggregatedOutput:o||(Z(s,`string`)?s:Z(r?.output,`string`)?r.output:Z(i?.aggregatedOutput,`string`)?i.aggregatedOutput:Z(i?.output,`string`)?i.output:void 0);return{command:a,...Z(i?.cwd,`string`)?{cwd:i.cwd}:Z(r?.cwd,`string`)?{cwd:r.cwd}:{},...Z(r?.exitCode,`number`)?{exitCode:r.exitCode}:Z(i?.exitCode,`number`)?{exitCode:i.exitCode}:{},...c===void 0?{}:{output:c}}}function Km(e){let t=[],n=e=>{if(e.includes(`\\`)||e.includes(`//`))return;let n=/^\.agents\/skills\/([^/.][^/]*)\/SKILL\.md$/.exec(e);n?.[1]&&!t.some(t=>t.path===e)&&t.push({name:n[1],path:e})};for(let t of[`tool.output`,`tool.input`]){let r=Bm(e[t]),i=Bm(r?.item)??r;if(i&&Array.isArray(i.commandActions))for(let e of i.commandActions){let t=Bm(e),r=Z(i.cwd,`string`)?i.cwd.replace(/\/+$/,``):void 0;if(t?.type===`read`&&Z(t.path,`string`)){n(r&&t.path.startsWith(`${r}/`)?t.path.slice(r.length+1):t.path.replace(/^\.\//,``));continue}if(t?.type!==`unknown`||!Z(t.command,`string`))continue;let a=t.command.trim().split(/\s+/);if(!(a[0]!==`cat`||a.length<2||a.slice(1).some(e=>e.startsWith(`-`)||/[\\'"`$;&|<>(){}[\]*?!]/.test(e))))for(let e of a.slice(1))n(e.replace(/^\.\//,``))}}return t}function Q(e,...t){for(let n of t){let t=e[n];if(Z(t,`string`)&&t.trim())return t.trim()}}function qm(e){for(let t of[`tool.output`,`tool.input`]){let n=Bm(e[t]),r=Bm(n?.item)??n,i=r&&Q(r,`detail`,`summary`,`output`,`query`,`path`);if(i)return i.split(/\r?\n/).find(Boolean)?.trim()}return Q(e,`tool.detail`,`tool.output.summary`,`vitehub.activity.detail`)}var Jm={apply_patch:`Changed files`,edit_file:`Changed files`,exec_command:`Ran command`,grep_search:`Searched code`,list_dir:`Listed directory`,read_file:`Read file`,run_command:`Ran command`,web_fetch:`Fetched page`,web_search:`Searched the web`,write_file:`Changed files`};function Ym(e){let t=e.replace(/\s+(?:complete|completed)$/i,``).trim(),n=Jm[t.toLocaleLowerCase()];if(n)return n;let r=/^[a-z0-9]+(?:_[a-z0-9]+)+$/i.test(t)?t.replaceAll(`_`,` `):t;return r?r[0].toUpperCase()+r.slice(1):`Activity`}function Xm(e,t,n,r){let i=t?.command??qm(e)??(n.length?`${n[0]}${n.length>1?` +${n.length-1} more`:``}`:void 0);if(i&&Ym(i).toLocaleLowerCase()!==r.toLocaleLowerCase())return i}function Zm(e,t){let n=e.attributes??{};return String(n[`step.id`]??n[`tool.id`]??n[`approval.id`]??n[`model.call.id`]??(n[`message.id`]?`${String(n[`message.id`])}:${String(n[`message.phase`]??`message`)}`:void 0)??(typeof n[`message.content`]==`string`?t:void 0)??`observation:${e.sequence}`)}function Qm(e,t,n){if(n.length)return`change`;if(e.name===`agent.usage.recorded`)return`model`;let r=t[`vitehub.activity.kind`];return Z(r,`string`)&&[`action`,`approval`,`change`,`delivery`,`error`,`message`,`model`,`plan`,`preparation`,`reasoning`,`run`,`system`,`tool`,`activity`].includes(r)?r:t[`channel.effect.kind`]||t[`channel.effect.intent`]||e.name.includes(`.channel.delivery`)?`delivery`:e.name===`vitehub.agent.configured`?`system`:t[`tool.name`]||t[`tool.id`]||e.name.includes(`.tool.`)?`tool`:t[`approval.id`]||e.name.includes(`.approval.`)?`approval`:e.type===`error`||e.name.endsWith(`.error`)?`error`:t[`message.phase`]===`commentary`?`message`:t[`message.phase`]===`reasoning`||e.name.includes(`.reasoning.`)?`reasoning`:e.name.includes(`.model.`)?`model`:t[`message.role`]||t[`message.content`]||t[`input.prompt`]||t[`input.messages`]||t[`result.text`]?`message`:e.name.includes(`.invocation.`)?`run`:`activity`}function $m(e,...t){for(let n of t){let t=e[n];if(Z(t,`number`)&&Number.isFinite(t))return t}}function eh(e){let t=Bm(e);return Z(t?.name,`string`)&&(t.icon===void 0||Z(t.icon,`string`))&&(t.label===void 0||Z(t.label,`string`))}function th(e){let t=new Map,n=Array.isArray(e.configuration?.tools)?e.configuration.tools:[],r=new Map(n.flatMap(e=>eh(e)?[[e.name,e]]:[])),i=e.observationsTruncated===!0||(e.observations?.some(e=>e.attributes?.[`vitehub.trace.truncated`]===!0)??!1),a=(e.observations??[]).some(e=>e.name===`agent.message`||e.name.startsWith(`agent.message.`)),o=0,s,c,l=``;for(let n of e.observations??[]){if(n.name===`agent.title.recorded`)continue;let e=n.attributes??{};if(e[`vitehub.auxiliary.kind`]===`title`||n.name===`agent.stream.error`&&e[`error.recoverable`]===!0)continue;let r=Vm({parts:[{text:e[`message.content`]}]}),i=Hm(e[`message.role`]),u=Vm({parts:[{text:e[`result.text`]}]});if(u&&l.endsWith(u)||a&&!u&&(n.name===`agent.stream.finish`||n.name===`agent.invocation.finish`))continue;r&&(i===void 0||i===`assistant`)&&(l+=r);let d=Array.isArray(e[`input.messages`])?e[`input.messages`]:Array.isArray(e[`input.prompt`])?e[`input.prompt`]:void 0;Array.isArray(d)&&d.forEach((r,i)=>{let a=Bm(r),o=Vm(a)??(Array.isArray(a?.parts)?"```json\n"+zm(a.parts)+"\n```":void 0),s=Hm(a?.role);if(!o||!s)return;let c=`input-message:${n.sequence}:${i}`;t.set(c,[{...n,attributes:{"message.content":o,"message.origin":`invocation-input`,"message.id":a?Q(a,`id`)??c:c,"message.role":s,...e[`vitehub.observation.truncated`]===!0?{"vitehub.observation.truncated":!0}:{}},name:`agent.input.message`,sequence:n.sequence-(d.length-i)/(d.length+1)}])});let f=d===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==`input.messages`&&e!==`input.prompt`));if(d!==void 0&&Object.keys(f).length===0)continue;let p=Q(f,`message.content`)!==void 0&&!f[`message.id`],m=Q(f,`message.phase`)??`message`;p&&(!s||c!==m)?(s=`message:assistant:${o++}`,c=m):p||(s=void 0,c=void 0);let h=Zm(n,s),g=t.get(h),_={...n,attributes:f};g?g.push(_):t.set(h,[_])}let u=new Set,d=-1/0;for(let e of t.values()){let t=Math.max(...e.map(e=>e.sequence));t>d&&e.every(e=>e.name.startsWith(`agent.message`)||e.name===`agent.input.message`)&&(d=t)}for(let e of t.values()){if(Math.max(...e.map(e=>e.sequence))!==d||e.some(e=>e.attributes?.[`vitehub.observation.truncated`]===!0)||!e.every(e=>e.name.startsWith(`agent.message`)&&(e.attributes?.[`message.role`]===void 0||e.attributes[`message.role`]===`assistant`)&&e.attributes?.[`message.phase`]!==`commentary`))continue;let t=e.map(e=>{let t=e.attributes?.[`message.content`];return Z(t,`string`)?t:``}).join(``).trim();if(t){u.add(t);try{let e=Bm(JSON.parse(t)),n=e&&Q(e,`text`);n&&u.add(n)}catch{}}}let f=[...t.entries()].map(([t,n])=>{let i=n.slice().sort((e,t)=>e.sequence-t.sequence),a=i[0],o=Object.assign({},...i.map(e=>e.attributes??{})),s=i.map(e=>e.attributes?.[`message.content`]).filter(e=>Z(e,`string`)).join(``),{patches:c,paths:l}=Wm(o),d=Qm(a,o,l.length?l:c),f=i.some(e=>e.type===`error`||/\.(error|failed)$/.test(e.name))||d===`delivery`&&!!Q(o,`error.message`)||o[`agent.capability.outcome`]===`error`,p=o[`approval.approved`]===!1,m=i.some(e=>/\.(abort|cancelled|completed|decision|error|failed|finish|recorded)$/.test(e.name)),h=Hm(o[`message.role`])??(o[`result.text`]?`assistant`:d===`message`?`user`:void 0),g=Gm(o,i),_=Km(o),v=i.at(-1)?.timestamp,y=e.completedAt??e.failedAt??e.cancelledAt,b=/\.(request|start|started)$/.test(a.name),x=b&&!m&&e.status!==`pending`&&e.status!==`running`?e.status===`failed`?`failed`:`completed`:void 0,S=x?y??v:b&&!m&&e.status===`running`?e.updatedAt:v,C=Date.parse(S??``)-Date.parse(a.timestamp),w=$m(o,`tool.durationMs`)??(Number.isFinite(C)?Math.max(0,C):void 0),T=!b&&S&&w!==void 0?new Date(Date.parse(S)-w).toISOString():void 0,E=d===`tool`?r.get(String(o[`tool.name`]??``)):void 0,D={...E?.icon?{icon:E.icon}:{},...E?.label?{label:E.label}:{}},O={attributes:o,body:c.join(``)||s||Um(o),command:g,...w===void 0?{}:{durationMs:w},...S?{endedAt:S}:{},id:t,kind:d,name:a.name,patches:c,paths:l,sequence:a.sequence,..._.length?{skill:_[0],skills:_}:{},startedAt:T??a.timestamp,...$m(o,`usage.reasoningTokens`,`usage.reasoningOutputTokens`)===void 0?{}:{reasoningTokens:$m(o,`usage.reasoningTokens`,`usage.reasoningOutputTokens`)},...h?{role:h}:{},status:f||p?`failed`:m||!b?`completed`:x??`running`,...Object.keys(D).length?{toolDisplay:D}:{},...i.some(e=>e.attributes?.[`vitehub.observation.truncated`]===!0)&&!(a.name===`agent.invocation.finish`&&u.has(Q(o,`result.text`)??``))?{truncated:!0}:{},...$m(o,`usage.totalTokens`)===void 0?{}:{totalTokens:$m(o,`usage.totalTokens`)}},k=ah(O);return{...O,...Xm(o,g,l,k)?{preview:Xm(o,g,l,k)}:{}}}).sort((e,t)=>e.sequence-t.sequence).filter(e=>!(e.kind===`run`&&/^agent\.invocation\.(?:start|started)$/.test(e.name)));return i&&!f.some(e=>e.name===`vitehub.observation.truncated`)&&f.push({attributes:{},id:`trace-truncated`,kind:`system`,name:`vitehub.observation.truncated`,patches:[],paths:[],sequence:(f.at(-1)?.sequence??-1)+1,status:`completed`}),f}function nh(e){let t=new Map,n=new Set;for(let r of e.observations){let e=r.attributes?.[`tool.name`];if(!Z(e,`string`)||!e)continue;let i=r.attributes?.[`tool.id`];if(Z(i,`string`)&&i){let t=`${e}:${i}`;if(n.has(t))continue;n.add(t)}else if(!r.name.endsWith(`.start`))continue;t.set(e,(t.get(e)??0)+1)}return t}function rh(e){let t=e.flatMap(e=>e.totalTokens===void 0?[]:[e.totalTokens]);return t.length?Math.max(...t):void 0}function ih(e){return e.preview??Q(e.attributes,`vitehub.activity.detail`)}function ah(e){let t=e.attributes[`vitehub.activity.title`];return Z(t,`string`)&&t.trim()?t.trim():e.name===`vitehub.observation.truncated`?`Trace content was truncated`:e.name===`vitehub.agent.configured`?oh(e):e.skill?`Read ${e.skill.name} skill`:e.kind===`preparation`?`Prepared session`:e.kind===`system`?`System configuration`:e.kind===`delivery`?ch(e):e.attributes[`vitehub.action.name`]===`progress-summary.update`?`Updated loading message`:e.attributes[`vitehub.action.name`]===`input.steered`?`Steered active session`:e.kind===`action`?String(e.attributes[`channel.effect.kind`]??e.attributes[`vitehub.action.name`]??`Product action`):e.kind===`plan`?`Updated plan`:e.kind===`change`?Ym(String(e.attributes[`tool.name`]??`Changed files`)):e.kind===`tool`?Ym(String(e.attributes[`tool.title`]??e.toolDisplay?.label??e.attributes[`tool.name`]??`Used a tool`)):e.kind===`approval`?e.attributes[`approval.approved`]===!0?`Approval granted`:e.attributes[`approval.approved`]===!1?`Approval denied`:String(e.attributes[`approval.name`]??`Requested approval`):e.kind===`reasoning`||e.kind===`model`?`Thinking`:e.kind===`run`?e.name.endsWith(`.finish`)?`Finished session`:`Started session`:e.kind===`error`&&e.name.startsWith(`agent.invocation.`)?`Session failed`:Ym(e.name.replace(/\.(start|finish|error|decision|recorded)$/,``).replaceAll(`.`,` `))}function oh(e){let t=Bm(e.attributes[`vitehub.agent.configuration`]);if(!t)return`Agent configured`;let n=Q(Bm(t.agent)??{},`name`)??`Agent`,r=Array.isArray(t.capabilities)?t.capabilities.length:0;return r?`Configured ${n} with ${r} ${r===1?`capability`:`capabilities`}`:`Configured ${n}`}function sh(e){if(e.name!==`vitehub.agent.configured`)return;let t=Bm(e.attributes[`vitehub.agent.configuration`]);if(!t)return;let n=Bm(t.driver),r=Q(Bm(n?.model)??{},`id`)??Q(n??{},`provider`),i=Array.isArray(t.tools)?t.tools.length:0;return[r,i?`${i} ${i===1?`tool`:`tools`}`:void 0].filter(Boolean).join(` · `)||void 0}function ch(e){let t=String(e.attributes[`channel.effect.kind`]??``).trim(),n=t.toLocaleLowerCase(),r=String(e.attributes[`channel.effect.intent`]??``).trim().toLocaleLowerCase(),i=t.includes(`.`)?t:n?Ym(n):`Channel delivery`;if(e.attributes[`channel.effect.supported`]===!1)return`${i} not supported`;if(Q(e.attributes,`channel.effect.skipped`))return`${i} skipped`;if(e.status===`failed`)return`${i} failed`;if(n===`reaction`){let e={completed:`hooray`,failed:`confused`,started:`eyes`};return e[r]?`Reacted with ${e[r]}`:`Reaction sent`}return n===`reply`?`Reply sent`:n===`status`?`Status updated`:n===`title`?`Title updated`:n===`update`?`Message updated`:t.includes(`.`)?t:n?`${Ym(n)} delivered`:`Channel delivery`}function lh(e){if(e.kind!==`delivery`)return;if(e.attributes[`channel.effect.supported`]===!1)return`Not supported`;let t=Q(e.attributes,`channel.effect.skipped`);if(t)return Ym(t);let n=String(e.attributes[`channel.effect.kind`]??``).trim().toLocaleLowerCase(),r=String(e.attributes[`channel.effect.intent`]??``).trim();if(!(!r||n===`reaction`&&[`completed`,`failed`,`started`].includes(r.toLocaleLowerCase())))return Ym(r)}function uh(e){return e?e.replace(RegExp(`\x1B\\[[0-?]*[ -/]*[@-~]`,`g`),``).replaceAll(`\r`,``):``}function dh(e){return e!==null&&Z(e,`object`)&&!Array.isArray(e)?Object.fromEntries(Object.entries(e)):void 0}var fh={Stack:[],Section:[`title`],Text:[`text`],KeyValue:[`label`,`value`],Tools:[`names`,`mcpServer`]};function ph(e,t=0){if(t>20)return!1;if(e===null||Z(e,`string`)||Z(e,`boolean`))return!0;if(Z(e,`number`))return Number.isFinite(e);if(Array.isArray(e))return e.every(e=>ph(e,t+1));let n=dh(e);return n?Object.entries(n).every(([e,n])=>e.startsWith(`$`)?(e===`$state`||e===`$item`)&&Z(n,`string`)&&(n===``||n.startsWith(`/`)):ph(n,t+1)):!1}function mh(e){let t=dh(e),n=dh(t?.elements);if(!t||!Z(t.root,`string`)||!n||!Object.hasOwn(n,t.root)||Object.keys(t).some(e=>e!==`root`&&e!==`elements`)||Object.keys(n).length>128)return;let r={};for(let[e,t]of Object.entries(n)){if([`__proto__`,`prototype`,`constructor`].includes(e))return;let i=dh(t),a=dh(i?.props);if(!i||!a||!Z(i.type,`string`)||!Object.hasOwn(fh,i.type)||Object.keys(i).some(e=>![`type`,`props`,`children`,`repeat`].includes(e)))return;let o=fh[i.type];if(Object.keys(a).some(e=>!o.includes(e))||!ph(a))return;let s=i.children;if(s!==void 0&&(!Array.isArray(s)||!s.every(e=>Z(e,`string`)&&Object.hasOwn(n,e))))return;let c=dh(i.repeat);if(i.repeat!==void 0&&(!c||!Z(c.statePath,`string`)||!c.statePath.startsWith(`/`)||c.key!==void 0&&!Z(c.key,`string`)||Object.keys(c).some(e=>e!==`statePath`&&e!==`key`)))return;r[e]={type:i.type,props:a,...Array.isArray(s)?{children:s.filter(e=>Z(e,`string`))}:{},...c&&Z(c.statePath,`string`)?{repeat:{statePath:c.statePath,...Z(c.key,`string`)?{key:c.key}:{}}}:{}}}let i=512,a=(e,t)=>{if(--i<0||t.size>20||t.has(e))return!1;let n=new Set([...t,e]);return r[e].children?.every(e=>a(e,n))??!0};return a(t.root,new Set)?{root:t.root,elements:r}:void 0}function hh(e){let t=zm(e);try{return dh(JSON.parse(t))}catch{return}}function gh(e){return e==null?`Not recorded`:Z(e,`string`)?e:JSON.stringify(e,null,2)}function _h(e){return j({inheritAttrs:!1,props:{element:{type:Object,required:!0}},setup(t,{slots:n}){return()=>e(t.element.props,n.default?.())}})}var vh=j({name:`AgentCapabilityInspector`,emits:{selectActivity:e=>!!e},props:{invocation:{type:Object,required:!0}},setup(e,{emit:t}){let n=C(),r=u(()=>Object.fromEntries(nh(e.invocation)));function i(n){let r=th(e.invocation).find(e=>e.attributes[`tool.name`]===n);r&&t(`selectActivity`,r.id)}let a=u(()=>e.invocation.configuration?.capabilities??[]),o=u(()=>a.value.find(e=>e.id===n.value)??a.value[0]),s=u(()=>e.invocation.configuration?.tools?.filter(e=>e.capabilityId===o.value?.id)??[]),c=u(()=>mh(o.value?.inspection?.view)),d=u(()=>hh(o.value?.inspection?.state));l(()=>e.invocation.id,()=>{n.value=void 0});let f={Stack:_h((e,t)=>R(`div`,{class:`vh-capability-inspector__stack`},[t])),Section:_h((e,t)=>R(`section`,{class:`vh-capability-inspector__section`},[R(`h3`,gh(e.title)),t])),Text:_h(e=>e.text?R(`p`,gh(e.text)):null),KeyValue:_h(e=>R(`dl`,{class:`vh-capability-inspector__value`},[R(`dt`,gh(e.label)),R(`dd`,gh(e.value))])),Tools:_h(e=>{let t=Array.isArray(e.names)?e.names:void 0,n=s.value.filter(n=>(!Object.hasOwn(e,`names`)||t?.includes(n.name))&&(!Object.hasOwn(e,`mcpServer`)||Z(e.mcpServer,`string`)&&n.mcp?.server===e.mcpServer));return n.length?R(Kt,{calls:r.value,onSelect:i,tools:n}):R(`p`,{class:`vh-capability-inspector__empty`},`No tool contracts recorded.`)})};return()=>R(`div`,{class:`vh-capability-inspector`},[e.invocation.configuration?.truncated?R(`p`,{role:`status`},`Captured configuration was truncated. Some capabilities or contracts may be missing.`):null,a.value.length?R(`nav`,{class:`vh-capability-inspector__navigation`,"aria-label":`Capabilities`},a.value.map(e=>R(`button`,{type:`button`,"aria-pressed":o.value?.id===e.id,onClick:()=>{n.value=e.id}},e.inspection?.label??e.id))):R(`p`,{class:`vh-capability-inspector__empty`},`No capabilities recorded for this Invocation.`),o.value?R(`div`,{class:`vh-capability-inspector__content`,key:`${e.invocation.id}:${o.value.id}`},[R(`h2`,o.value.inspection?.label??o.value.id),o.value.inspection?.truncated?R(`p`,{role:`status`},`Capability inspection was truncated. Some recorded data is missing.`):null,o.value.inspection?.label&&o.value.inspection.label!==o.value.id?R(`code`,o.value.id):null,c.value&&d.value!==void 0?R(Im,{registry:f,initialState:d.value},{default:()=>R(Pm,{spec:c.value,registry:f})}):[o.value.inspection&&(!o.value.inspection.state||o.value.inspection.view)?R(`p`,{class:`vh-capability-inspector__empty`},o.value.inspection.view&&!c.value?`This view is unavailable. Recorded tools and data are shown below.`:`Inspection data was not recorded. Configuration capture may be disabled for this run.`):null,s.value.length?R(Kt,{calls:r.value,onSelect:i,tools:s.value}):null,o.value.inspection?.state?R(`pre`,zm(o.value.inspection.state)):null,o.value.metadata?R(`details`,[R(`summary`,`Configuration`),R(`pre`,zm(o.value.metadata))]):null,!s.value.length&&!o.value.metadata&&!o.value.inspection?R(`p`,`No tools or configuration recorded.`):null]]):null])}}),yh={anthropic:[{d:`M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z`}],aws:[{d:`M6.763 11.212c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 01-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 01-.287-.375 6.18 6.18 0 01-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.39-.384-.59-.894-.59-1.533 0-.678.24-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272-.09.04-.184.075-.28.104a.488.488 0 01-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 01.224-.167 4.577 4.577 0 011.005-.36 4.84 4.84 0 011.246-.151c.95 0 1.644.216 2.091.647.44.43.662 1.085.662 1.963v2.586h.016zm-3.24 1.214c.263 0 .534-.048.822-.144a1.78 1.78 0 00.758-.51 1.27 1.27 0 00.272-.512c.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 00-.735-.136 6.02 6.02 0 00-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 6.726a1.398 1.398 0 01-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 01.32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 01.311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 01-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 01-.303.08h-.687c-.15 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32L12.32 7.747l-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08l-.686.001zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 01-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.32.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 00.415-.758.777.777 0 00-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 01-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .36.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 01.24.2.43.43 0 01.071.263v.375c0 .168-.064.256-.184.256a.83.83 0 01-.303-.096 3.652 3.652 0 00-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.16.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926a2.157 2.157 0 01-.583.703c-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z`},{d:`M.378 15.475c3.384 1.963 7.56 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.44-.2.814.287.383.607-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351zm23.531-.2c.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151l.175-.439c.343-.88.802-2.198.52-2.555-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399z`}],azure:[{d:`M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z`,fillOpacity:`.75`},{d:`M8.295.857c-.477 0-.9.304-1.053.756L.495 21.605a1.11 1.11 0 001.052 1.466h5.43c.477 0 .9-.304 1.053-.755l1.341-3.975-2.318-2.163a.51.51 0 01.347-.882h3L15.271.857H8.295z`,fillOpacity:`.5`},{d:`M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z`}],bedrock:[{d:`M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z`}],cerebras:[{clipRule:`evenodd`,d:`M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z`},{d:`M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z`}],cloudflare:[{d:`M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437`},{d:`M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777`}],cohere:[{clipRule:`evenodd`,d:`M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z`},{clipRule:`evenodd`,d:`M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z`},{d:`M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z`}],deepseek:[{d:`M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z`}],fireworks:[{clipRule:`evenodd`,d:`M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z`}],google:[{d:`M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z`},{d:`M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z`},{d:`M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z`},{d:`M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z`}],groq:[{d:`M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z`}],huggingface:[{d:`M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z`}],meta:[{d:`M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z`}],minimax:[{d:`M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z`}],mistral:[{clipRule:`evenodd`,d:`M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z`}],moonshot:[{d:`M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z`}],nvidia:[{d:`M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z`}],ollama:[{d:`M7.905 1.09c.216.085.411.225.588.41.295.306.544.744.734 1.263.191.522.315 1.1.362 1.68a5.054 5.054 0 012.049-.636l.051-.004c.87-.07 1.73.087 2.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67 1.67 0 01.589-.41c.257-.1.53-.118.796-.042.401.114.745.368 1.016.737.248.337.434.769.561 1.287.23.934.27 2.163.115 3.645l.053.04.026.019c.757.576 1.284 1.397 1.563 2.35.435 1.487.216 3.155-.534 4.088l-.018.021.002.003c.417.762.67 1.567.724 2.4l.002.03c.064 1.065-.2 2.137-.814 3.19l-.007.01.01.024c.472 1.157.62 2.322.438 3.486l-.006.039a.651.651 0 01-.747.536.648.648 0 01-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643 0 01.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644 0 01.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229 4.229 0 00-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653 0 01-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288 3.288 0 00-1.772-.332c-1.245.099-2.343.801-2.67 1.686a.652.652 0 01-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066 1.588a4.07 4.07 0 00-.068 1.886c.112.558.331 1.02.582 1.269l.008.007c.212.207.257.53.109.785-.36.622-.629 1.549-.673 2.44-.05 1.018.186 1.902.719 2.536l.016.019a.643.643 0 01.095.69c-.576 1.236-.753 2.252-.562 3.052a.652.652 0 01-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339 4.339 0 01-.598-1.309l-.005-.019a5.764 5.764 0 01-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352 5.352 0 01.093-2.49c.262-.915.777-1.701 1.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622 1.015-.737.266-.076.54-.059.797.042zm4.116 9.09c.936 0 1.8.313 2.446.855.63.527 1.005 1.235 1.005 1.94 0 .888-.406 1.58-1.133 2.022-.62.375-1.451.557-2.403.557-1.009 0-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845 0-.707.398-1.417 1.056-1.946.668-.537 1.55-.849 2.485-.849zm0 .896a3.07 3.07 0 00-1.916.65c-.461.37-.722.835-.722 1.25 0 .428.21.829.61 1.134.455.347 1.124.548 1.943.548.799 0 1.473-.147 1.932-.426.463-.28.7-.686.7-1.257 0-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662 1.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375 0 01-.376.373.375.375 0 01-.376-.373v-.46l-.271-.218a.347.347 0 01-.052-.49.353.353 0 01.494-.051l.215.172.22-.174a.353.353 0 01.49.051zm-5.04-1.919c.478 0 .867.39.867.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zm8.706 0c.48 0 .868.39.868.871a.87.87 0 01-.868.871.87.87 0 01-.867-.87.87.87 0 01.867-.872zM7.44 2.3l-.003.002a.659.659 0 00-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216 1.631-.124 2.782.43-.128.899-.208 1.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628 0 00-.107-.09L7.44 2.3zm9.174.04l-.002.001a.628.628 0 00-.107.09c-.156.163-.32.45-.453.814-.29.794-.387 1.776-.23 2.572l.058.097.008.014h.03a5.184 5.184 0 011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659 0 00-.285-.239h-.004z`}],openai:[{d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`}],openrouter:[{d:`M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z`}],perplexity:[{d:`M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z`}],qwen:[{d:`M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z`}],replicate:[{d:`M22 10.552v2.26h-7.932V22H11.54V10.552H22zM22 2v2.264H4.528V22H2V2h20zm0 4.276V8.54H9.296V22H6.768V6.276H22z`}],together:[{d:`M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z`},{d:`M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z`},{d:`M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z`}],xai:[{d:`M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z`}],zai:[{d:`M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z`}]},bh={alibaba:{icon:`qwen`,label:`Alibaba`},anthropic:{icon:`anthropic`,label:`Anthropic`},aws:{icon:`aws`,label:`AWS`},azure:{icon:`azure`,label:`Azure`},bedrock:{icon:`bedrock`,label:`Amazon Bedrock`},cerebras:{icon:`cerebras`,label:`Cerebras`},cloudflare:{icon:`cloudflare`,label:`Cloudflare`},codex:{icon:`openai`,label:`Codex`},cohere:{icon:`cohere`,label:`Cohere`},deepseek:{icon:`deepseek`,label:`DeepSeek`},fireworks:{icon:`fireworks`,label:`Fireworks AI`},google:{icon:`google`,label:`Google`},groq:{icon:`groq`,label:`Groq`},huggingface:{icon:`huggingface`,label:`Hugging Face`},meta:{icon:`meta`,label:`Meta`},minimax:{icon:`minimax`,label:`MiniMax`},mistral:{icon:`mistral`,label:`Mistral AI`},moonshot:{icon:`moonshot`,label:`Moonshot AI`},nvidia:{icon:`nvidia`,label:`NVIDIA`},ollama:{icon:`ollama`,label:`Ollama`},openai:{icon:`openai`,label:`OpenAI`},openrouter:{icon:`openrouter`,label:`OpenRouter`},perplexity:{icon:`perplexity`,label:`Perplexity`},qwen:{icon:`qwen`,label:`Qwen`},replicate:{icon:`replicate`,label:`Replicate`},together:{icon:`together`,label:`Together AI`},xai:{icon:`xai`,label:`xAI`},zai:{icon:`zai`,label:`Z.AI`}},xh={"alibaba-cloud":`alibaba`,"amazon-bedrock":`bedrock`,"amazon-web-services":`aws`,amazon:`aws`,"fireworks-ai":`fireworks`,"google-vertex":`google`,"hugging-face":`huggingface`,"microsoft-azure":`azure`,mistralai:`mistral`,"moonshot-ai":`moonshot`,moonshotai:`moonshot`,"together-ai":`together`,togetherai:`together`,vertex:`google`,"vertex-ai":`google`,"x-ai":`xai`,"z-ai":`zai`,zhipu:`zai`},Sh=[[`claude`,`anthropic`],[`codestral`,`mistral`],[`command`,`cohere`],[`deepseek`,`deepseek`],[`devstral`,`mistral`],[`gemini`,`google`],[`gemma`,`google`],[`glm`,`zai`],[`gpt`,`openai`],[`grok`,`xai`],[`kimi`,`moonshot`],[`llama`,`meta`],[`minimax`,`minimax`],[`mistral`,`mistral`],[`qwen`,`qwen`]];function Ch(e){return Object.hasOwn(bh,e)}function wh(e){if(Ch(e))return e;if(Object.hasOwn(xh,e))return xh[e]}function Th(e){return{id:e,...bh[e]}}function Eh(e){let t=e?.trim().toLocaleLowerCase();if(!t)return;let n=wh(t)??wh(t.split(/[.:/]/)[0]??``)??(t.includes(`openrouter`)?`openrouter`:void 0);return n?Th(n):{id:`fallback`,label:t.split(/[._-]/g).filter(Boolean).map(e=>e.length<=3?e.toLocaleUpperCase():`${e[0]?.toLocaleUpperCase()??``}${e.slice(1)}`).join(` `)}}function Dh(e){let t=e?.trim().toLocaleLowerCase();if(!t)return;let n=t.split(`/`),r=n.length>1?wh(n[0]??``):void 0;if(r)return Th(r);let i=n.at(-1)??``,a=Sh.find(([e])=>i.startsWith(e));return a?Th(a[1]):void 0}function Oh(e,t){if(!e)return null;if(e.id===`fallback`)return R(`svg`,{"aria-hidden":`true`,class:`vh-invocation-brand__logo ${t}`,fill:`none`,stroke:`currentColor`,"stroke-width":1.5,viewBox:`0 0 24 24`},[R(`rect`,{height:14,rx:3,width:14,x:5,y:5}),R(`path`,{d:`M9 2v3m6-3v3M9 19v3m6-3v3M2 9h3m-3 6h3m14-6h3m-3 6h3M9 9h6v6H9z`})]);let n=yh[e.icon];return R(`svg`,{"aria-hidden":`true`,class:`vh-invocation-brand__logo ${t}`,"data-brand":e.id,"fill-rule":`evenodd`,viewBox:`0 0 24 24`},n.map(e=>R(`path`,{"clip-rule":e.clipRule,d:e.d,"fill-opacity":e.fillOpacity})))}function kh(e,t){let n=e.annotations?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function Ah(e){return e.title??kh(e,`github.title`)??e.agentName??`Agent Invocation`}function jh(e){let t=kh(e,`github.repository`),n=e.annotations?.[`github.pullRequest`];return t&&(typeof n==`string`||typeof n==`number`)?`${t} · PR #${n}`:kh(e,`triggeredBy`)??e.threadId??e.origin??e.channelId??e.id}function Mh(e){return kh(e,`github.repository`)?.split(`/`).at(-1)??e.configuration?.workspace?.name??e.agentName??`Workspace`}function Nh(e){let t=kh(e,`github.url`);return t&&tt(t)?t:void 0}function Ph(e){if(!Number.isFinite(e)||e<0)return;if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${new Intl.NumberFormat(`en`,{maximumFractionDigits:1}).format(e/1e3)}s`;let t=Math.round(e/1e3);return`${Math.floor(t/60)}m ${t%60}s`}function Fh(e){let t=String(e.attributes[`tool.name`]??``).toLocaleLowerCase();return e.kind===`preparation`||e.kind===`action`||e.kind===`system`||e.kind===`delivery`||e.name.startsWith(`vitehub.`)||t===`materialize_sources`||t.startsWith(`vitehub_`)?`vitehub`:`agent`}function Ih(e,t=th(e)){let n=t.filter(e=>e.kind!==`message`&&Number.isFinite(Date.parse(e.startedAt??``))).sort((e,t)=>Date.parse(e.startedAt??``)-Date.parse(t.startedAt??``)||e.sequence-t.sequence);if(!n.length)return[];let r=Date.parse(e.startedAt??e.createdAt??``),i=n.map(e=>Date.parse(e.startedAt??``)).filter(Number.isFinite),a=Number.isFinite(r)?r:Math.min(...i);return n.map(e=>{let t=Date.parse(e.startedAt??``),n=Number.isFinite(e.durationMs)?e.durationMs??0:0,r=Number.isFinite(t)?Math.max(0,t-a):0,i=[r?`+${Ph(r)}`:`start`,n?Ph(n):void 0].filter(Boolean).join(` · `),o={activity:e,durationMs:n,id:e.id,offsetMs:r,owner:Fh(e),timing:i,title:ah(e)},s=ih(e);return s&&(o.detail=s),o})}var Lh=j({name:`AgentInvocationTimeline`,emits:{selectActivity:e=>!!e},props:{invocation:{required:!0,type:Object}},setup(e,{emit:t,slots:n}){let r=u(()=>Ih(e.invocation));return()=>R(`div`,{class:`vh-invocation-timeline`,"data-slot":`invocation-timeline`},[r.value.length?R(`ol`,{class:`vh-invocation-timeline__rows`},r.value.map(e=>R(`li`,{key:`timeline:${e.id}`},[R(`button`,{class:`vh-invocation-timeline__row`,"data-activity-id":e.id,"data-owner":e.owner,"data-status":e.activity.status,onClick:()=>t(`selectActivity`,e.id),title:e.detail?`${e.title} — ${e.detail}`:e.title,type:`button`},[R(`span`,{"aria-hidden":`true`,class:`vh-invocation-timeline__dot`}),R(`span`,{class:`vh-visually-hidden`},`${e.owner===`vitehub`?`ViteHub`:`Agent`}${e.activity.status===`failed`?`, failed`:``}: `),R(`span`,{class:`vh-invocation-timeline__heading`},[R(`strong`,e.title),e.detail?R(`code`,{class:`vh-invocation-timeline__detail`},e.detail):null]),R(`time`,{class:`vh-invocation-timeline__time`},e.timing)])]))):n.empty?.()??R(`p`,{class:`vh-invocation-timeline__empty`},`No timed steps recorded.`)])}});function Rh(e){let t=zh(e),n=t[Vh(t)]?.id,r=t.filter(e=>e.kind!==`message`||Hh(e)),i=Vh(r),a=r.findLastIndex(e=>e.kind===`message`&&e.role===`user`),o=r.findLastIndex((e,t)=>t>a&&e.kind===`message`&&e.role===`assistant`&&e.attributes[`message.phase`]!==`commentary`),s=r.slice(i+1),c=o>=0?r[o].body?.trim():void 0,l=new Set(qh(s,new Set(c?[c]:[]))),u={deliveredAnswerCount:l.size,promptId:n};if(i<0&&!r.some(Kh))return{...u,kind:`activities`,activities:r};let d=r.slice(0,Math.max(i,0)).filter(Hh),f=r.slice(0,Math.max(i,0)).filter(e=>e.kind!==`message`),p=r[i];if(o>=0&&r.slice(o+1).some(e=>e.kind===`message`&&e.role===`assistant`&&e.attributes[`message.phase`]===`commentary`)){let e=r.slice(i+1,o).filter(e=>!Bh(e,p)),t=r.slice(o);return{...u,kind:`conversation`,history:d,prompt:p,work:Uh([...f,...e,...t.filter(e=>e.kind===`delivery`)]).map(e=>Kh(e)?Jh(e):e),answers:e.filter(e=>l.has(e)).map(Yh),followup:t.flatMap(e=>l.has(e)?[Yh(e)]:e.kind===`delivery`?[]:[e])}}return{...u,kind:`conversation`,history:d,prompt:p,work:Uh([...f,...s.filter((e,t)=>i+1+t!==o&&!Bh(e,p))]).map(e=>Kh(e)?Jh(e):e),answers:[...[...l].map(Yh),...o>=0?[r[o]]:[]].sort((e,t)=>e.sequence-t.sequence),followup:[]}}function zh(e){let t=e.findLastIndex(e=>e.attributes[`message.origin`]===`invocation-input`),n=e[t];if(!n||n.role!==`user`)return e;let r=e.findIndex((e,n)=>n>t&&e.kind===`message`),i=e[r];return!i||i.name!==`agent.input.message`||i.role!==`user`||i.attributes[`input.mode`]===`steer`||i.truncated||n.truncated||i.body?.trim()!==n.body?.trim()?e:e.filter((e,t)=>t!==r)}function Bh(e,t){let n=t&&Q(t.attributes,`message.id`);return!!n&&e!==t&&e.kind===`message`&&e.role===`user`&&e.attributes[`input.mode`]!==`steer`&&Q(e.attributes,`message.id`)===n&&(e.body?.trim()??``)===(t.body?.trim()??``)}function Vh(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n.kind===`message`&&n.role===`user`&&n.name!==`agent.input.message`&&n.attributes[`input.mode`]!==`steer`)return t}let t=e.findLastIndex(e=>e.role===`user`&&e.attributes[`message.origin`]===`invocation-input`);if(t>=0)return t;for(let t=e.length-1;t>=0;--t){let n=e[t];if(n.kind===`message`&&n.role===`user`&&n.attributes[`input.mode`]!==`steer`)return t}return-1}function Hh(e){return e.kind===`message`&&!!e.body?.trim()}function Uh(e){let t=-1;for(let n=e.length-1;n>=0;--n)if(e[n].name===`vitehub.agent.configured`){t=n;break}return t<0?[...e]:e.filter((e,n)=>e.name!==`vitehub.agent.configured`||n===t)}var Wh=new Set([`reply`,`update`]);function Gh(e){let t=e.attributes[`channel.effect.content`];return Z(t,`string`)&&t.trim()?t:void 0}function Kh(e){return e.kind===`delivery`&&e.status===`completed`&&e.attributes[`channel.effect.supported`]!==!1&&!Q(e.attributes,`channel.effect.skipped`)&&Wh.has(Q(e.attributes,`channel.effect.kind`)?.toLocaleLowerCase()??``)&&Gh(e)!==void 0}function qh(e,t){return e.filter(e=>{if(!Kh(e))return!1;let n=Gh(e).trim();return!t.has(n)&&(t.add(n),!0)})}function Jh(e){return{...e,attributes:Object.fromEntries(Object.entries(e.attributes).filter(([e])=>e!==`channel.effect.content`))}}function Yh(e){return{...e,body:Gh(e),id:`${e.id}:answer`,kind:`message`,role:`assistant`}}var Xh=I(()=>Xe(()=>import(`./patch-diff-CD7Eu2gO.js`).then(e=>e.PatchDiff),__vite__mapDeps([0,1,2,3,4]),import.meta.url));function Zh(e){let t={cancelled:`Cancelled`,completed:`Completed`,failed:`Failed`,pending:`Queued`,running:`Working`};return Object.hasOwn(t,e)?t[e]:`Unknown`}function Qh(e){let t=e.replaceAll(/\s+/g,` `).trim();return t.length>96?`${t.slice(0,95)}…`:t}function $h(e){if(!(e===void 0||e<=0))return e<1e3?`${e} tokens`:`${new Intl.NumberFormat(`en`,{maximumFractionDigits:1,notation:`compact`}).format(e)} tokens`}function eg(e,t){if(!e||!t)return;let n=Date.parse(t)-Date.parse(e);if(!Number.isFinite(n)||n<0)return;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60);return i<60?`${i}m ${r%60}s`:`${Math.floor(i/60)}h ${i%60}m`}function tg(e,t){if(!e||!t)return;let n=t.getTime()-Date.parse(e);if(!Number.isFinite(n)||n<0)return;let r=Math.floor(n/1e3),i=Math.floor(r/60)%60,a=Math.floor(r/3600),o=e=>String(e).padStart(2,`0`);return a?`${a}:${o(i)}:${o(r%60)}`:`${i}:${o(r%60)}`}function ng(e){let t=e.driver,n=t?.model;return[t?.kind,n?.provider??t?.provider,n?.id].filter(Boolean).join(` · `)||void 0}function rg(e){return(e.split(`/`).at(-1)??``).split(`-`).filter(Boolean).map(e=>{let t=e.toLocaleLowerCase();return/^(ai|gpt|glm|llm|vlm)$/.test(t)?t.toLocaleUpperCase():/^\d+[a-z]$/i.test(e)?e.toLocaleUpperCase():`${e[0]?.toLocaleUpperCase()??``}${e.slice(1)}`}).join(` `)||`Configured model`}function ig(e){let t=e.workspace;return t?[t.name,t.mode].filter(Boolean).join(` · `):void 0}function ag(e,t){return e?R(s,null,{default:()=>R($e,{class:t,value:e}),fallback:()=>R(`p`,{class:t},e)}):null}function og(e){let t=e.split(/[?#]/,1)[0],n=/^\/workspace\/[^/]+\/(.+)$/.exec(t);if(!n)return;let r=(()=>{try{return decodeURIComponent(n[1])}catch{return n[1]}})();if(!(!r||r.startsWith(`/`)||r.includes(`\\`)||r.split(`/`).some(e=>!e||e===`.`||e===`..`)))return r}function sg(){return R(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},[R(`path`,{d:`M3 6.5h6l2 2h10v9.5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,"stroke-linecap":`round`,"stroke-linejoin":`round`})])}function cg(e,t){let n=(Z(e,`string`)?e:t.replaceAll(/\s+/g,` `)).trim();return n.length>112?`${n.slice(0,111)}…`:n||`Empty payload`}var lg=j({name:`InvocationError`,props:{error:{required:!0,type:Object}},setup(e){let t=f(),n=f(),r=C(!1),i=C(),a;D(()=>{a&&clearTimeout(a)});async function o(){try{if(!(`navigator`in globalThis)||!navigator.clipboard)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(zm(dg(e.error))),i.value=`copied`}catch{i.value=`failed`}a&&clearTimeout(a),a=setTimeout(()=>i.value=void 0,2e3)}return()=>{let a=e.error,s=dg(a),c=a.docs?.startsWith(`https://`)&&tt(a.docs)?a.docs:void 0,l=Object.keys(s).length>1,u=[a.name&&a.name!==`Error`?a.name:void 0,a.code===void 0?void 0:String(a.code),a.status??a.statusCode].filter(e=>e!==void 0&&e!==``).join(` · `);return R(`section`,{class:`vh-invocation-error`,"aria-labelledby":t,"data-slot":`invocation-error`},[R(`header`,{class:`vh-invocation-error__header`},[R(`svg`,{class:`vh-invocation-error__icon`,"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},[R(`circle`,{cx:`12`,cy:`12`,r:`9`}),R(`path`,{d:`m15 9-6 6m0-6 6 6`,"stroke-linecap":`round`})]),R(`h3`,{class:`vh-invocation-error__title`,id:t},`Run failed`),u?R(`code`,{class:`vh-invocation-error__code`,title:u},u):null]),R(`p`,{class:`vh-invocation-error__message`},a.message.replace(/^\[[\w./-]+\]\s*/,``)),a.fix?R(`div`,{class:`vh-invocation-error__fix`},[R(`p`,{class:`vh-invocation-error__label`},`How to fix`),R(`p`,a.fix)]):null,R(`div`,{class:`vh-invocation-error__actions`},[c?R(`a`,{class:`vh-invocation-error__action`,href:c,rel:`noreferrer`,target:`_blank`},[`Read the docs`,R(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},[R(`path`,{d:`M7 17 17 7M8 7h9v9`,"stroke-linecap":`round`,"stroke-linejoin":`round`})])]):null,R(`button`,{class:`vh-invocation-error__action`,type:`button`,onClick:o},[Zg(i.value===`copied`),i.value===`copied`?`Copied`:i.value===`failed`?`Copy failed`:`Copy error`]),l?R(`button`,{"aria-controls":n,"aria-expanded":r.value?`true`:`false`,class:`vh-invocation-error__action`,type:`button`,onClick:()=>r.value=!r.value},[R(`svg`,{class:`vh-invocation-error__chevron`,"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},[R(`path`,{d:`m9 6 6 6-6 6`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]),`Details`]):null,R(`span`,{"aria-live":`polite`,class:`vh-visually-hidden`,role:`status`},i.value===`copied`?`Error copied`:i.value===`failed`?`Could not copy the error`:``)]),l?R(`pre`,{class:`vh-invocation-error__details`,hidden:!r.value,id:n},zm(s)):null])}}});function ug(e){let t=[e.startedAt,e.createdAt].find(e=>e&&Number.isFinite(Date.parse(e)));if(!t)return null;let n=new Date(t);return R(`time`,{class:`vh-invocation-session__timestamp`,datetime:n.toISOString(),title:n.toLocaleString(`en`,{dateStyle:`full`,timeStyle:`long`})},n.toLocaleString(`en`,{dateStyle:`medium`,timeStyle:`short`}))}function dg(e){let t={message:e.message};return e.fix&&(t.fix=e.fix),e.docs&&(t.docs=e.docs),e.sources?.length&&(t.sources=e.sources),e.code!==void 0&&(t.code=e.code),e.requestId&&(t.requestId=e.requestId),e.status!==void 0&&(t.status=e.status),e.statusCode!==void 0&&(t.statusCode=e.statusCode),e.details&&(t.details=e.details),e.cause&&(t.cause=e.cause),e.errors?.length&&(t.errors=e.errors),t}function fg(e){return Z(e,`string`)?JSON.stringify(e):e===null?`null`:Z(e,`object`)?Array.isArray(e)?`Array(${e.length})`:`Object`:String(e)}function pg(e,t,n=`$`,r={rows:[],truncated:!1},i=0){let a=fg(e);if(`${n} ${a}`.toLocaleLowerCase().includes(t)){if(r.rows.length>=500)return r.truncated=!0,r;r.rows.push({path:n,value:a})}if(!Z(e,`object`)||e===null||i>=12)return r;for(let[a,o]of Object.entries(e))if(pg(o,t,Array.isArray(e)?`${n}[${a}]`:`${n}.${a}`,r,i+1),r.truncated)break;return r}function mg(e,t,n=0,r={remaining:500}){if(r.remaining--,r.remaining<0)return R(`li`,{class:`vh-invocation-payload__leaf`},`More fields hidden`);if(n>=12&&Z(e,`object`)&&e!==null)return R(`li`,{class:`vh-invocation-payload__leaf`},[t?R(`code`,{class:`vh-invocation-payload__key`},t):null,R(`code`,{class:`vh-invocation-payload__value`},`Nested content hidden`)]);if(!Z(e,`object`)||e===null)return R(`li`,{class:`vh-invocation-payload__leaf`},[t?R(`code`,{class:`vh-invocation-payload__key`},t):null,R(`code`,{class:`vh-invocation-payload__value`,"data-type":e===null?`null`:Rm(e)},fg(e))]);let i=Object.entries(e),a=[];for(let e=0;e<i.length&&!(r.remaining<=0);e++){if(r.remaining===1){r.remaining--,a.push(R(`li`,{class:`vh-invocation-payload__leaf`},`More fields hidden`));break}let[t,o]=i[e];a.push(mg(o,t,n+1,r))}return R(`li`,{class:`vh-invocation-payload__branch`},[R(`details`,{open:n<1},[R(`summary`,[t?R(`code`,{class:`vh-invocation-payload__key`},t):null,R(`span`,Array.isArray(e)?`Array(${i.length})`:`{${i.length}}`)]),R(`ul`,a)])])}var hg=j({name:`InvocationPayload`,props:{label:{required:!0,type:String},value:{required:!0}},setup(e){let t=C(`tree`),n=C(``),r=C(!1),i=C(!1),a=C(!1),o,s=u(()=>zm(e.value)),c=u(()=>{if(!Z(e.value,`object`)||e.value===null)return e.value;try{return JSON.parse(s.value)}catch{return s.value}}),l=u(()=>Z(c.value,`object`)&&c.value!==null),d=u(()=>n.value?pg(c.value,n.value.toLocaleLowerCase()):{rows:[],truncated:!1}),f=u(()=>{if(!n.value)return s.value;let e=n.value.toLocaleLowerCase();return s.value.split(`
|
|
71
|
+
`).filter(t=>t.toLocaleLowerCase().includes(e)).join(`
|
|
72
|
+
`)});async function p(){if(a.value=!1,!(`navigator`in globalThis)||!navigator.clipboard){a.value=!0;return}try{await navigator.clipboard.writeText(s.value),i.value=!0,o&&clearTimeout(o),o=setTimeout(()=>{i.value=!1},1600)}catch{a.value=!0}}return D(()=>{o&&clearTimeout(o)}),()=>R(`details`,{class:`vh-invocation-event__payload`,onToggle:e=>{r.value=e.currentTarget.open},open:r.value},[R(`summary`,[R(`strong`,e.label),R(`code`,cg(e.value,s.value)),Pg(`vh-invocation-event__disclosure`)]),r.value?R(`div`,{class:`vh-invocation-payload__content`},[R(`div`,{class:`vh-invocation-payload__toolbar`},[l.value?R(`div`,{"aria-label":`${e.label} view`,class:`vh-invocation-payload__modes`,role:`group`},[R(`button`,{"aria-pressed":t.value===`tree`,onClick:()=>{t.value=`tree`},type:`button`},`Tree`),R(`button`,{"aria-pressed":t.value===`raw`,onClick:()=>{t.value=`raw`},type:`button`},`Raw`)]):null,l.value||s.value.length>240?R(`label`,{class:`vh-invocation-payload__search`},[R(`span`,{class:`vh-visually-hidden`},`Search ${e.label}`),R(`input`,{onInput:e=>{n.value=e.target.value},placeholder:`Search payload`,type:`search`,value:n.value})]):null,R(`button`,{class:`vh-invocation-payload__copy`,onClick:()=>void p(),type:`button`},i.value?`Copied`:`Copy`)]),R(`span`,{"aria-live":`polite`,class:`vh-visually-hidden`,role:`status`},a.value?`${e.label} could not be copied`:i.value?`${e.label} copied`:``),n.value&&l.value&&t.value===`tree`?d.value.rows.length?R(`ol`,{class:`vh-invocation-payload__matches`},[...d.value.rows.map(e=>R(`li`,[R(`code`,e.path),R(`code`,e.value)])),d.value.truncated?R(`li`,`More matches hidden. Refine your search.`):null]):R(`p`,{class:`vh-invocation-payload__empty`},`No matching fields`):l.value&&t.value===`tree`?R(`ul`,{class:`vh-invocation-payload__tree`},[mg(c.value)]):f.value?R(`pre`,f.value):R(`p`,{class:`vh-invocation-payload__empty`},`No matching content`)]):null])}}),gg={assistant:`Assistant`,system:`System`,tool:`Tool`,user:`You`};function _g(e,t,n,r,i=!1){let a=e.body??``,o=e.role===`user`&&(a.length>720||a.split(/\r?\n/).length>12),s=t.has(e.id),c=vg(e,r.now,r.mounted,e.id===r.promptId?r.sentAt:void 0),l=r.copiedId===e.id?r.copyStatus:void 0,u=e.attributes[`message.phase`]===`commentary`,d=(e.role===`user`||e.role===`assistant`)&&!(i&&u),f=e.id===r.promptId?r.author:void 0,p=f??gg[e.role??`assistant`];return R(`li`,{class:`vh-invocation-message`,"data-phase":u?`commentary`:void 0,"data-role":e.role,key:e.id},[i&&u?R(`span`,{class:`vh-visually-hidden`},`${p} message`):R(`span`,{class:`vh-invocation-message__role`},p),e.attributes[`input.mode`]===`steer`?R(`small`,{class:`vh-invocation-message__method`},`Steered`):null,R(`div`,{class:`vh-invocation-message__content`,"data-collapsed":o&&!s?`true`:void 0},[ag(a,`vh-invocation-message__body`)]),e.truncated?R(`p`,{class:`vh-invocation-event__notice`},`Some activity details were omitted.`):null,o?R(`button`,{"aria-expanded":String(s),class:`vh-invocation-message__more`,onClick:()=>n(e.id),type:`button`},s?`Show less`:`Read more`):null,d?R(`footer`,{class:`vh-invocation-message__meta`},[f?R(`span`,{class:`vh-invocation-message__author`},f):null,c?R(`time`,{datetime:c.value,title:c.title},c.short):null,R(`button`,{"aria-label":l===`copied`?`Copied`:l===`failed`?`Copy failed`:`Copy message`,class:`vh-invocation-message__copy`,onClick:()=>r.copy(e),title:l===`copied`?`Copied`:l===`failed`?`Copy failed`:`Copy message`,type:`button`},l===`copied`?`Copied`:l===`failed`?`Copy failed`:[yg()]),l?R(`span`,{class:`vh-visually-hidden`,"aria-live":`polite`,role:`status`},l===`copied`?`Message copied`:`Message could not be copied`):null]):null])}function vg(e,t,n,r){let i=r??Q(e.attributes,`channel.sentAt`)??Q(e.attributes,`input.sentAt`)??e.startedAt;if(!i||!Number.isFinite(Date.parse(i)))return;let a=new Date(i);if(!n)return{short:a.toISOString(),title:a.toISOString(),value:i};let o=new Intl.DateTimeFormat(`en`,{hour:`numeric`,minute:`2-digit`}).format(a),s=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),c=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),l=Math.round((s-c)/864e5),u={day:`numeric`,month:`numeric`};return a.getFullYear()!==t.getFullYear()&&(u.year=`numeric`),{short:l<=0?o:l===1?`Yesterday at ${o}`:`${new Intl.DateTimeFormat(`en`,u).format(a)} ${o}`,title:new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`}).format(a),value:i}}function yg(){return R(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},[R(`rect`,{height:`13`,rx:`2`,width:`13`,x:`8`,y:`8`}),R(`path`,{d:`M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3`})])}function bg(e){let t=String(e.attributes[`tool.name`]??``).toLocaleLowerCase();if(e.command)return`command`;if(e.kind===`error`)return`alert`;if(e.kind===`change`)return`change`;if(t.includes(`read`)||t.includes(`image`)||t.includes(`view`))return`eye`;if(t.includes(`search`)||t.includes(`find`))return`search`;if(e.kind===`reasoning`||e.kind===`model`)return`brain`;if(e.kind===`run`)return`activity`;if(e.kind===`approval`)return`approval`;if(e.kind===`delivery`){let t=String(e.attributes[`channel.effect.kind`]??``).toLocaleLowerCase();return t===`reaction`?`eye`:[`reply`,`status`,`update`].includes(t)?`message`:`action`}if(e.kind===`action`)return`check`;if(e.kind===`preparation`){let t=ah(e).toLocaleLowerCase();return t.includes(`pull request`)?`pull-request`:t.includes(`github`)?`github`:t.includes(`workspace`)?`folder`:t.includes(`agent`)?`cpu`:t.includes(`prompt`)?`message`:`check`}return e.kind===`system`?`cpu`:e.kind===`tool`?`tool`:`activity`}var xg={activity:[`M12 12h.01`],alert:[`M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20`,`M12 8v4`,`M12 16h.01`],action:[`M13 2 3 14h9l-1 8 10-12h-9z`],approval:[`M12 3v12`,`m8 11 4 4 4-4`,`M5 21h14`],brain:[`M12 18V5m3 8a4.17 4.17 0 0 1-3-4a4.17 4.17 0 0 1-3 4m8.598-6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,`M17.997 5.125a4 4 0 0 1 2.526 5.77`,`M18 18a4 4 0 0 0 2-7.464`,`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,`M6 18a4 4 0 0 1-2-7.464`,`M6.003 5.125a4 4 0 0 0-2.526 5.77`],change:[`M12 20h9`,`M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z`],check:[`m5 12 4 4L19 6`],command:[`m4 17 6-6-6-6`,`M12 19h8`],cpu:[`M9 9h6v6H9z`,`M9 2v3`,`M15 2v3`,`M9 19v3`,`M15 19v3`,`M2 9h3`,`M2 15h3`,`M19 9h3`,`M19 15h3`,`M5 5h14v14H5z`],eye:[`M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12`,`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6`],folder:[`M3 6.5h6l2 2h10v9.5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`],github:[`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3.28-.36 6.72-1.61 6.72-7A5.4 5.4 0 0 0 19.22 3.77 5.07 5.07 0 0 0 19.13.32S17.95-.04 15 1.8a13.38 13.38 0 0 0-6 0C6.05-.04 4.87.32 4.87.32A5.07 5.07 0 0 0 4.78 3.77a5.4 5.4 0 0 0-1.5 3.78c0 5.42 3.44 6.61 6.72 7A4.8 4.8 0 0 0 9 18v4`,`M9 18c-4.51 2-5-2-7-2`],label:[`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l4.58-4.58a2.426 2.426 0 0 0 0-3.42z`,`M7.5 7.5h.01`],message:[`M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z`],"pull-request":[`M6 9v12`,`M18 15V8a2 2 0 0 0-2-2h-3`,`M6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6`,`M18 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6`],search:[`m21 21-4.35-4.35`,`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16`],tool:[`M14.7 6.3a4 4 0 0 0-5 5L3 18l3 3 6.7-6.7a4 4 0 0 0 5-5l-2.5 2.5-3-3Z`]};function Sg(e){let t=e.toolDisplay?.icon,n=t?k()?.appContext.components.UIcon:void 0;return R(`span`,{class:`vh-invocation-event__icon`,"data-failed":e.status===`failed`?`true`:void 0,"data-icon":n?t:bg(e),"aria-hidden":`true`},[n?R(n,{name:t}):wg(bg(e)),e.status===`failed`?R(`svg`,{class:`vh-invocation-event__failure-icon`,fill:`currentColor`,viewBox:`0 0 24 24`},[R(`path`,{"clip-rule":`evenodd`,d:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1 5h2v7h-2V7Zm0 9h2v2h-2v-2Z`,"fill-rule":`evenodd`,stroke:`none`})]):null])}function Cg(e){return R(`span`,{class:`vh-invocation-event__icon`,"data-icon":e,"aria-hidden":`true`},[wg(e)])}function wg(e){return R(`svg`,{fill:`none`,viewBox:`0 0 24 24`},xg[e].map(e=>R(`path`,{d:e,"stroke-linecap":`round`,"stroke-linejoin":`round`})))}function Tg(e){let t=String(e.attributes[`tool.name`]??``).trim().toLocaleLowerCase();if(t===`image view`||t===`view image`||t===`view_image`){for(let t of[`tool.input`,`tool.output`]){let n=e.attributes[t];if(!Z(n,`object`)||n===null||Array.isArray(n))continue;let r=`item`in n&&Z(n.item,`object`)&&n.item!==null&&!Array.isArray(n.item)?n.item:n;if(`path`in r&&Z(r.path,`string`)&&r.path)return r.path;if(`commandActions`in r&&Array.isArray(r.commandActions)){for(let e of r.commandActions)if(Z(e,`object`)&&e!==null&&!Array.isArray(e)&&`path`in e&&Z(e.path,`string`)&&e.path)return e.path}}return e.preview?.startsWith(`/`)?e.preview:void 0}}function Eg(e,t){let n={path:t};return e.attributes[`tool.input`]!==void 0&&(n.input=e.attributes[`tool.input`]),e.attributes[`tool.output`]!==void 0&&(n.output=e.attributes[`tool.output`]),e.attributes[`tool.error`]!==void 0&&(n.error=e.attributes[`tool.error`]),R(`section`,{class:`vh-invocation-image-details`,"aria-label":`Image view details`},[R(`strong`,`Path`),R(`code`,t),R(`strong`,`Raw details`),R(`pre`,zm(n))])}function Dg(e,t,n,r){let i=e.command,a=Tg(e),o=e.kind===`reasoning`||e.kind===`model`?$h(e.reasoningTokens):void 0,s=a?.split(`/`).filter(Boolean).at(-1)??sh(e)??lh(e)??(e.preview?Qh(e.preview):o),c=e.kind===`tool`&&(e.attributes[`tool.input`]!==void 0||e.attributes[`tool.output`]!==void 0||e.attributes[`tool.error`]!==void 0),l=e.kind===`delivery`?e.attributes[`channel.effect.content`]:void 0,u=Z(l,`string`)&&l.trim()?l:void 0,d=!!u,f=e.kind===`delivery`?Q(e.attributes,`error.message`):void 0,p=!!(f||e.truncated)||!d&&(e.patches.length>0||!!(i||c||e.body||e.truncated)),m=e.skills??(e.skill?[e.skill]:[]),h=m.length===1?`workspace`:e.attributes[`vitehub.inspect.target`]??(e.name===`vitehub.agent.configured`?`agent`:void 0),g=e.skill?.path,_=h===`agent`||h===`workspace`,v=m.length?R(`span`,{class:`vh-invocation-event__title`},m.flatMap((e,n)=>[n?R(`span`,{"aria-hidden":`true`},` · `):null,R(`button`,{class:`vh-invocation-event__title vh-invocation-event__title-link`,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(`workspace`,e.path)},type:`button`},`Read ${e.name} skill`)])):R(`span`,{class:`vh-invocation-event__title`},a?`View image`:ah(e)),y=[e.name===`vitehub.agent.configured`?Fg():e.kind===`delivery`?R(`span`,{class:`vh-invocation-event__icon`,"data-icon":`channel`},[Re(Ig(e))]):Sg(e),v,e.status===`failed`?R(`span`,{class:`vh-visually-hidden`},`Failed`):null,s?R(`code`,{class:`vh-invocation-event__suffix`},s):null,p?Pg(`vh-invocation-event__disclosure`):null],b=_&&!p?R(`button`,{class:`vh-invocation-event__summary`,onClick:()=>t(h,g),type:`button`},y):R(p?`summary`:`div`,{class:`vh-invocation-event__summary`},y);return R(`li`,{class:`vh-invocation-activity`,"data-activity-id":e.id,"data-inspectable":_?`true`:void 0,"data-kind":e.kind,"data-status":e.status,key:e.id},[R(p?`details`:`div`,{class:`vh-invocation-event`,open:p?n.has(e.id):void 0,onToggle:p?t=>r(e.id,t.currentTarget.open):void 0},[b,p?R(`div`,{class:`vh-invocation-event__details`},[f?R(`p`,{class:`vh-invocation-event__failure`},f):null,e.truncated?R(`p`,{class:`vh-invocation-event__notice`},`Some activity details were omitted.`):null,e.patches.length?n.has(e.id)?R(`div`,{class:`vh-invocation-event__diffs`},e.patches.map((e,t)=>R(Xh,{key:t,patch:e}))):null:i?R(`div`,{class:`vh-invocation-command`},[R(`div`,{class:`vh-invocation-command__bar`},[R(`code`,i.command),i.exitCode===void 0?null:R(`span`,{"data-failed":i.exitCode!==0},`exit ${i.exitCode}`)]),i.cwd?R(`div`,{class:`vh-invocation-command__cwd`},i.cwd):null,i.output?R(`pre`,uh(i.output)):null,kg(e.attributes[`tool.error`])]):a?Eg(e,a):c?R(`div`,{class:`vh-invocation-event__payloads`},[Og(`Input`,e.attributes[`tool.input`]),Og(`Output`,e.attributes[`tool.output`]),Og(`Error`,e.attributes[`tool.error`])].filter(Boolean)):e.kind!==`delivery`&&e.body?R(`div`,{class:`vh-invocation-event__body`},[ag(e.body,`vh-invocation-event__markdown`)]):null,_?R(`button`,{class:`vh-invocation-event__inspect`,onClick:()=>t(h,g),type:`button`},`Inspect ${h}`):null]):null]),u?R(`div`,{class:`vh-invocation-delivery__body`},[ag(u,`vh-invocation-event__markdown`)]):null])}function Og(e,t){return t===void 0?null:R(hg,{label:e,value:t})}function kg(e){if(e===void 0)return null;let t;if(typeof e==`string`)t=e;else try{t=Object.prototype.toString.call(e)===`[object String]`?String(e):zm(e)}catch{try{t=zm(e)}catch{t=`[Unable to display payload]`}}return R(`section`,{class:`vh-invocation-event__payload`},[R(`strong`,`Error`),R(`pre`,t)])}function Ag(e){return ih(e)}function jg(e,t){let n=e.attributes[`vitehub.inspect.target`];if(n===`workspace`||n===`agent`)return R(`button`,{"aria-label":n===`workspace`?`Open Workspace`:`Open Invocation details`,class:`vh-invocation-preparation__action`,onClick:()=>t(n),type:`button`},[Cg(n===`workspace`?`folder`:`cpu`)])}function Mg(e,t){let n=e.annotations?.[`github.repository`],r=e.annotations?.[`github.pullRequest`];return!Z(n,`string`)||!Z(r,`number`)&&!Z(r,`string`)?R(`code`,jh(e)):R(`span`,{class:`vh-invocation-preparation__context`},[R(`code`,n),R(`span`,{"aria-hidden":`true`},`·`),t?R(`a`,{href:t,onClick:e=>e.stopPropagation(),rel:`noreferrer`,target:`_blank`},`PR #${r}`):R(`code`,`PR #${r}`)])}function Ng(e,t){let n=Ag(e);if(!n)return;let r=Qh(n);if(!t||!ah(e).toLocaleLowerCase().includes(`pull request`))return R(`code`,r);let i=r.match(/^(.*?)\s*·\s*(PR #\d+)$/);return i?R(`span`,{class:`vh-invocation-preparation__context`},[R(`code`,i[1]),R(`span`,{"aria-hidden":`true`},`·`),R(`a`,{href:t,rel:`noreferrer`,target:`_blank`},i[2])]):R(`code`,r)}function Pg(e){return R(`svg`,{"aria-hidden":`true`,class:e,fill:`none`,viewBox:`0 0 24 24`},[R(`path`,{d:`m6 9 6 6 6-6`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`})])}function Fg(){return R(`svg`,{viewBox:`0 0 20 18`,fill:`currentColor`,"aria-hidden":`true`,class:`vh-invocation-framework-mark`},[R(`path`,{d:`M19.734 8.156 15.576.844A1.66 1.66 0 0 0 14.135 0H5.819C5.226 0 4.677.32 4.38.844L.222 8.156a1.71 1.71 0 0 0 0 1.688l4.158 7.312c.297.523.846.844 1.439.844h8.316c.593 0 1.142-.32 1.438-.844l4.158-7.312c.3-.523.3-1.165.003-1.688Z`})])}function Ig(e){let t=Q(e.attributes,`channel.delivery.provider`)??Q(e.attributes,`channel.provider`)??Q(e.attributes,`channel.id`)??`chat`;return t.toLocaleLowerCase()===`msteams`?`teams`:t}function Lg(e,t,n){let r=Nh(t),i=e.find(e=>e.status===`failed`);return R(`li`,{class:`vh-invocation-preparation`,key:`preparation:${e[0]?.id}`},[R(`details`,{class:`vh-invocation-preparation__details`},[R(`summary`,{class:`vh-invocation-preparation__summary`},[i?Sg(i):Cg(`folder`),R(`strong`,i?`Session preparation failed`:`Prepared workspace`),i?Mg(t,r):null,i?R(`small`,`${e.length} steps`):null,Pg(`vh-invocation-preparation__disclosure`)]),R(`ol`,{class:`vh-invocation-preparation__steps`},e.map(e=>Rg(e,r,n)))])])}function Rg(e,t,n){return R(`li`,{class:`vh-invocation-preparation__step`,"data-activity-id":e.id,"data-kind":`preparation`,"data-status":e.status,key:e.id},[Sg(e),R(`strong`,ah(e)),Ng(e,t),jg(e,n),e.body?R(`p`,{class:`vh-invocation-preparation__body`},e.body):null,e.truncated?R(`p`,{class:`vh-invocation-event__notice`},`Some activity details were omitted.`):null])}function zg(e){if(e)return e.name===`vitehub.agent.configured`?`agent-configuration-lifecycle`:/^agent\.capability\.(?:input|output|configure|prepare|resolve|close)$/.test(e.name)?`agent-capability-lifecycle`:Q(e.attributes,`vitehub.activity.group`)}function Bg(e,t,n,r){let i=[...new Set(e.flatMap(e=>{let t=Q(e.attributes,`agent.capability.id`);return t?[t]:[]}))],a=e.filter(e=>e.status===`failed`).length,o=new Set(e.map(e=>e.name.split(`.`).at(-1))),s=i.length?`${i.length} ${i.length===1?`capability`:`capabilities`}`:`${e.length} ${e.length===1?`event`:`events`}`;return R(`li`,{class:`vh-invocation-capabilities`,key:`capabilities:${e[0]?.id}`},[R(`details`,{class:`vh-invocation-capabilities__details`},[R(`summary`,{class:`vh-invocation-capabilities__summary`},[Cg(`tool`),R(`span`,{class:`vh-invocation-event__title`},a?`Capability activity failed · ${s}`:i.length?[...o].every(e=>e===`close`)?`Closed ${s}`:[...o].every(e=>e===`output`||e===`close`)?`Finalized ${s}`:`Prepared ${s}`:`Capability activity · ${s}`),Pg(`vh-invocation-capabilities__disclosure`)]),R(`ol`,{class:`vh-invocation-capabilities__rows`},e.map(e=>Dg(e,t,n,r)))])])}function Vg(e,t){let n=e[0];return R(`li`,{class:`vh-invocation-capabilities`,"data-activity-id":n.id,"data-kind":n.kind,"data-status":n.status,key:`configuration:${n.id}`},[R(`details`,{class:`vh-invocation-capabilities__details`},[R(`summary`,{class:`vh-invocation-capabilities__summary`},[R(`span`,{"aria-hidden":`true`,class:`vh-invocation-event__icon`},[Fg()]),R(`span`,{class:`vh-invocation-event__title`},ah(n)),sh(n)?R(`code`,{class:`vh-invocation-event__suffix`},sh(n)):null,Pg(`vh-invocation-capabilities__disclosure`)]),R(`ol`,{class:`vh-invocation-capabilities__rows`},e.map(e=>R(`li`,{key:e.id},[e.body?R(`div`,{class:`vh-invocation-event__body`},[ag(e.body,`vh-invocation-event__markdown`)]):null,e.truncated?R(`p`,{class:`vh-invocation-event__notice`},`Some activity details were omitted.`):null,R(`button`,{class:`vh-invocation-event__inspect`,onClick:()=>t(`agent`),type:`button`},`Inspect agent`)])))])])}function Hg(e){let t=e?.replace(/^#/,``);if(!t||!/^[\da-f]{6}$/i.test(t))return{};let n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),i=Number.parseInt(t.slice(4,6),16),a=(n*299+r*587+i*114)/1e3;return{"--vh-invocation-label-bg":`#${t}`,"--vh-invocation-label-fg":a>150?`#1f2328`:`#ffffff`}}function Ug(e){let t=Q(e.attributes,`github.label.name`);if(t)return R(`span`,{class:`vh-invocation-lifecycle__label`,"data-operation":Q(e.attributes,`github.label.operation`),style:Hg(Q(e.attributes,`github.label.color`))},t)}function Wg(e){if(!Q(e.attributes,`github.label.name`))return ah(e);let t=Q(e.attributes,`github.label.operation`)?.toLocaleLowerCase();return e.status===`failed`?t===`add`||t===`added`?`Failed to add label`:t===`remove`||t===`removed`?`Failed to remove label`:`Failed to update label`:t===`add`||t===`added`?`Added label`:t===`remove`||t===`removed`?`Removed label`:`Updated label`}function Gg(e){if(e.status===`failed`)return Sg(e);if(Q(e.attributes,`github.label.name`))return Cg(`label`);let t=Q(e.attributes,`channel.effect.kind`)?.toLocaleLowerCase();if(t===`reaction`){let t=Q(e.attributes,`channel.effect.intent`)?.toLocaleLowerCase(),n=t===`completed`?{label:`hooray`,value:`🎉`}:t===`failed`?{label:`confused`,value:`😕`}:{label:`eyes`,value:`👀`};return R(`span`,{"aria-label":n.label,class:`vh-invocation-lifecycle__emoji`,role:`img`},n.value)}return[`reply`,`status`,`update`].includes(t??``)?Re(Ig(e)):Sg(e)}function Kg(e,t,n){return R(`li`,{class:`vh-invocation-lifecycle`,"data-activity-group":e,key:`activity-group:${e}:${t[0]?.id}`},[R(`ol`,{"aria-label":e,class:`vh-invocation-lifecycle__rows`},t.map(e=>{let t=e.attributes[`vitehub.inspect.target`],r=t===`agent`||t===`workspace`,i=[Gg(e),R(`span`,{class:`vh-invocation-lifecycle__title`},Wg(e)),Ug(e),!Q(e.attributes,`github.label.name`)&&lh(e)?R(`code`,{class:`vh-invocation-lifecycle__detail`},lh(e)):null,e.status===`failed`&&e.body?R(`span`,{class:`vh-invocation-lifecycle__failure`},e.body):null,e.truncated?R(`span`,{class:`vh-invocation-event__notice`},`Some activity details were omitted.`):null];return R(`li`,{"data-activity-id":e.id,"data-kind":e.kind,"data-status":e.status,key:e.id},[r?R(`button`,{class:`vh-invocation-lifecycle__row`,onClick:()=>n(t),type:`button`},i):R(`div`,{class:`vh-invocation-lifecycle__row`},i)])}))])}function qg(e,t){return R(`section`,[R(`h4`,e),t])}function Jg(e,t){return Ih(e).length?qg(`Trace timeline`,R(Lh,{invocation:e,onSelectActivity:t})):null}function Yg(e,t){return t===void 0||t===``?null:R(`div`,[R(`dt`,e),R(`dd`,String(t))])}function Xg(e){return e.length>8?`…${e.slice(-6)}`:`…`}function Zg(e){return R(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},e?[R(`path`,{d:`m5 12 4 4L19 6`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]:[R(`rect`,{height:`13`,rx:`2`,width:`13`,x:`8`,y:`8`}),R(`path`,{d:`M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3`,"stroke-linecap":`round`,"stroke-linejoin":`round`})])}function Qg(e){let t={cancelled:[`M18 6 6 18`,`M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20`],completed:[`m5 12 4 4L19 6`],failed:[`M18 6 6 18`,`m6 6 12 12`],pending:[`M12 8v4l3 2`,`M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20`],running:[`M21 12a9 9 0 1 1-6.219-8.56`]},n=Object.hasOwn(t,e)?t[e]:[`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18`];return R(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 24 24`},n.map(e=>R(`path`,{d:e,"stroke-linecap":`round`,"stroke-linejoin":`round`})))}function $g(e){let t=Z(e,`string`)?e:e.id,n=Z(e,`string`)?/^(?:gh|github):([\w.-]+\/[\w.-]+)(?:\/.*)?$/.exec(e)?.[1]:/^[\w.-]+\/[\w.-]+$/.test(e.repository??``)?e.repository:void 0;return n?{href:`https://github.com/${n}`,icon:Re(`github`),label:t,title:`${t}: ${n}`}:{label:t}}function e_(e){return R(`div`,{class:`vh-invocation-inspector__group`},[R(`div`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,`Sources`),R(`small`,e.length)]),R(`div`,{class:`vh-invocation-inspector__badges`},e.map(e=>{let t=$g(e),n=[t.icon,R(`span`,t.label)];return t.href?R(`a`,{class:`vh-invocation-inspector__badge`,href:t.href,rel:`noreferrer`,target:`_blank`,title:t.title},n):R(`span`,{class:`vh-invocation-inspector__badge`},n)}))])}function t_(e){return R(`div`,{class:`vh-invocation-inspector__group`},[R(`div`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,`Channels`),R(`small`,e.length)]),R(`div`,{class:`vh-invocation-inspector__badges`},e.map(e=>R(`span`,{class:`vh-invocation-inspector__badge`},[Re(e.kind),R(`span`,e.id)])))])}function n_(e){if(e===null||!Z(e,`object`)||Array.isArray(e))return!1;let t=e;return Object.hasOwn(t,`id`)&&Z(t.id,`string`)&&Object.hasOwn(t,`kind`)&&Z(t.kind,`string`)}function r_(e){let t=e.driver?.model,n=t?.id,r=Dh(n),i=Eh(t?.provider??e.driver?.provider),a=e.runtime?.name;return!n&&!i&&(!a||a===`unknown`)?null:R(`div`,{class:`vh-invocation-inspector__group vh-invocation-inspector__group--execution`},[R(`div`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,`Model`)]),R(`div`,{class:`vh-invocation-execution`},[n||i?R(`div`,{class:`vh-invocation-execution__model`},[Oh(r??i??{id:`fallback`,label:`Model`},`vh-invocation-execution__model-icon`),R(`div`,{class:`vh-invocation-execution__details`},[R(`strong`,n?rg(n):i?.label),n&&i?R(`span`,{class:`vh-invocation-execution__provider`},[Oh(i,`vh-invocation-execution__provider-icon`),i.label]):null])]):null,a&&a!==`unknown`?R(`dl`,{class:`vh-invocation-inspector__list vh-invocation-execution__runtime`},[Yg(`Runtime`,a)]):null])])}function i_(e,t,n){let r=[...e].sort((e,n)=>(t.get(n.name)??0)-(t.get(e.name)??0)||e.name.localeCompare(n.name)),i=r.filter(e=>(t.get(e.name)??0)>0).length;return R(`div`,{class:`vh-invocation-inspector__group`},[R(`div`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,`Tools`),R(`small`,`${i} of ${r.length} used`)]),R(Kt,{calls:Object.fromEntries(t),onSelect:n,tools:r})])}function a_(e,t,n){return R(`details`,{class:`vh-invocation-inspector__group vh-invocation-inspector__disclosure`},[R(`summary`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,e),R(`small`,t),Pg(`vh-invocation-inspector__chevron`)]),n])}function o_(e,t,n,r,i){let a=Array.isArray(e.tools)?e.tools:[],o=a.filter(e=>e&&typeof e.name==`string`),s=e.channels!==void 0&&!Array.isArray(e.channels),c=Array.isArray(e.channels)?e.channels:[],l=c.filter(n_);e={...e,channels:l,tools:o,truncated:e.truncated||o.length!==a.length||s||l.length!==c.length};let u=ng(e),d=ig(e),f=[Yg(`Driver`,u),Yg(`Runtime`,e.runtime?.name===`unknown`?void 0:e.runtime?.name),Yg(`Workspace`,d)].filter(e=>e!==null),p=r_(e),m=[p,!p&&f.length?R(`div`,{class:`vh-invocation-inspector__group`},[R(`div`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,`Execution`)]),R(`dl`,{class:`vh-invocation-inspector__list`},f)]):null,n&&e.workspace?.sources?.length?e_(e.workspace.sources):null,e.channels?.length?t_(e.channels):null,r&&e.capabilities?.length?R(`div`,{class:`vh-invocation-inspector__group`},[R(`div`,{class:`vh-invocation-inspector__group-heading`},[R(`strong`,`Capabilities`),R(`small`,e.capabilities.length)]),R(`div`,{class:`vh-invocation-inspector__stack`},e.capabilities.map(n=>{let r=e.tools?.filter(e=>e.capabilityId===n.id)||[];return R(`details`,{class:`vh-invocation-inspector__item-disclosure`,key:n.id},[R(`summary`,[R(`code`,n.id),R(`small`,r.length?`${r.length} tool${r.length===1?``:`s`}`:`Configuration`),Pg(`vh-invocation-inspector__chevron`)]),r.length?R(Kt,{tools:r,calls:Object.fromEntries(nh(t)),onSelect:i}):null,n.metadata?R(`details`,{class:`vh-invocation-inspector__settings`},[R(`summary`,`Configuration`),R(`pre`,zm(n.metadata))]):null,!r.length&&!n.metadata?R(`p`,`No tools or configuration recorded.`):null])}))]):null,e.tools?.some(t=>!r||!e.capabilities?.some(e=>e.id===t.capabilityId))?i_(e.tools.filter(t=>!r||!e.capabilities?.some(e=>e.id===t.capabilityId)),nh(t),i):null,e.instructions?.length?a_(`Instructions`,`${e.instructions.length} block${e.instructions.length===1?``:`s`}`,R(`pre`,{class:`vh-invocation-inspector__instructions`},e.instructions.join(`
|
|
73
|
+
|
|
74
|
+
`))):null].filter(e=>e!==null);return m.length||e.truncated?[qg(`Agent setup`,R(`div`,{class:`vh-invocation-inspector__groups`},[e.truncated?R(`p`,{class:`vh-invocation-inspector__notice`,role:`note`},`Some setup values were shortened when this run was recorded.`):null,...m]))]:[]}function s_(e,t,n,r,i,a,o,s=!1){return e.kind===`message`?_g(e,t,n,i,s):Dg(e,r,a,o)}function c_(e,t,n,r,i,a,o,s,c=!1){let l=[];for(let u=0;u<e.length;){let d=zg(e[u]);if(d){let t=u+1;for(;zg(e[t])===d;)t+=1;l.push(d===`agent-capability-lifecycle`?Bg(e.slice(u,t),i,o,s):d===`agent-configuration-lifecycle`?Vg(e.slice(u,t),i):Kg(d,e.slice(u,t),i)),u=t;continue}if(e[u].kind!==`preparation`){l.push(s_(e[u],n,r,i,a,o,s,c)),u+=1;continue}let f=u+1;for(;e[f]?.kind===`preparation`;)f+=1;l.push(Lg(e.slice(u,f),t,i)),u=f}return l}function l_(e,t,n,r,i,a,o,s,c,l){if(!e.length)return null;let u=t.status===`pending`||t.status===`running`,d=u||r,f=t.completedAt??t.failedAt??t.cancelledAt??t.updatedAt,p=eg(t.startedAt,f),m=u?tg(t.startedAt,s.liveNow):void 0;return R(`li`,{class:`vh-invocation-work`,key:`invocation-work`},[R(`details`,{class:`vh-invocation-work__details`,onToggle:e=>i(e.currentTarget.open),open:d},[R(`summary`,{class:`vh-invocation-work__summary`},[R(`span`,{class:`vh-invocation-work__title`},u?`Working…`:p?`${t.status===`cancelled`?`Cancelled after`:`Worked for`} ${p}`:t.status===`cancelled`?`Cancelled`:`Work details`),m?R(`time`,{class:`vh-invocation-work__elapsed`,datetime:t.startedAt},m):null,Pg(`vh-invocation-work__disclosure`)]),R(`div`,{"aria-hidden":`true`,class:`vh-invocation-work__divider`}),d?R(`ol`,{class:`vh-invocation-work__activities`},c_(e,t,n,a,o,s,c,l,!0)):null])])}function u_(e,t,n,r,i,a,o,s){return e.length?R(`li`,{class:`vh-invocation-history`,key:`invocation-history`},[R(`details`,{class:`vh-invocation-history__details`},[R(`summary`,{class:`vh-invocation-history__summary`},[R(`span`,`${e.length} previous ${e.length===1?`message`:`messages`}`),Pg(`vh-invocation-history__disclosure`)]),R(`ol`,{class:`vh-invocation-history__messages`},c_(e,t,n,r,i,a,o,s))])]):null}function d_(e,t){if(t===void 0)return{};let n=Q(e.annotations??{},`triggeredBy`),r=e.observations.map(e=>e.attributes??{}).find(e=>Q(e,`agent.invoker.label`)||Q(e,`agent.invoker.id`));return{author:n?.trim()?n.trim():Q(r??{},`agent.invoker.label`)??Q(r??{},`agent.invoker.id`),promptId:t,sentAt:Q(e.annotations??{},`channel.sentAt`)}}function f_(e,t,n,r,i,a,o,s,c,l){return e.kind===`activities`?c_(e.activities,t,n,a,o,s,c,l):[u_(e.history,t,n,a,o,s,c,l),e.prompt?s_(e.prompt,n,a,o,s,c,l):null,l_(e.work,t,n,r,i,a,o,s,c,l),...e.answers.map(e=>s_(e,n,a,o,s,c,l)),...c_(e.followup,t,n,a,o,s,c,l)].filter(e=>e!==null)}var p_=j({name:`AgentInvocation`,emits:{inspect:(e,t)=>(e===`agent`||e===`workspace`)&&(t===void 0||Z(t,`string`))},props:{header:{default:!0,type:Boolean},invocation:{required:!0,type:Object},selectedActivityId:{default:void 0,type:String},workspaceInspectable:{default:!0,type:Boolean}},setup(e,{emit:t,slots:n}){let r=u(()=>th(e.invocation).map(t=>{if(e.workspaceInspectable)return t;let n={...t.attributes};return delete n[`vitehub.inspect.target`],{...t,attributes:n,skill:void 0,skills:void 0}})),i=u(()=>Rh(r.value)),a=C(new Set),o=te(),s=oe({scheduler:e=>p(e,6e4)}),c=C(),d,f=C(!1),m=C(new Set),h=C(),g=C(),_,v;function y(e){let t=new Set(a.value);t.has(e)?t.delete(e):t.add(e),a.value=t}function b(e,t){let n=new Set(m.value);t?n.add(e):n.delete(e),m.value=n}function x(n){if(!e.workspaceInspectable||n.defaultPrevented||n.button!==0)return;let r=n.target instanceof Element?n.target.closest(`a[href]`):void 0,i=r?og(r.getAttribute(`href`)||``):void 0;i&&(n.preventDefault(),t(`inspect`,`workspace`,i))}function S(){_&&=(_.removeAttribute(`data-selected`),_.removeAttribute(`tabindex`),void 0)}async function w(t){try{if(!navigator.clipboard)throw Error(`Clipboard unavailable`);let n=Nh(e.invocation),r=[`Invocation ID: ${e.invocation.id}`,`Trace ID: ${e.invocation.traceId}`,e.invocation.agentName?`Agent: ${e.invocation.agentName}`:void 0,n?`URL: ${n}`:void 0].filter(e=>e!==void 0);await navigator.clipboard.writeText(`${t.body??``}\n\n${r.join(`
|
|
75
|
+
`)}`),h.value={id:t.id,status:`copied`}}catch{h.value={id:t.id,status:`failed`}}v&&clearTimeout(v),v=setTimeout(()=>h.value=void 0,2e3)}async function T(e){e&&(f.value=!0,b(e,!0)),await re();let t=[...g.value?.querySelectorAll(`[data-activity-id]`)??[]].find(t=>t.dataset.activityId===e);if(t&&t===_||(S(),!e)||!t)return;let n=t.closest(`details`);for(;n;)n.open=!0,n=n.parentElement?.closest(`details`)??null;t.dataset.selected=`true`,t.tabIndex=-1,t.focus({preventScroll:!0});let r=`matchMedia`in globalThis&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({behavior:r?`auto`:`smooth`,block:`center`}),_=t}return l([()=>e.selectedActivityId,r],([e])=>void T(e),{flush:`post`,immediate:!0}),l(()=>e.invocation.id,()=>{f.value=!1,m.value=new Set,h.value=void 0}),l(()=>e.invocation.status,(e,t)=>{(t===`pending`||t===`running`)&&e!==`pending`&&e!==`running`&&(f.value=!1)}),l([()=>e.invocation.status===`pending`||e.invocation.status===`running`,o],([e,t])=>{d&&clearInterval(d),d=void 0,c.value=e&&t?new Date:void 0,e&&t&&(d=setInterval(()=>c.value=new Date,1e3))},{immediate:!0}),D(()=>{S(),v&&clearTimeout(v),d&&clearInterval(d)}),()=>{let l=d_(e.invocation,i.value.promptId);return R(`article`,{class:[`vh-invocation-session`,{"vh-invocation-session--headerless":!e.header}],"data-status":e.invocation.status,"data-slot":`invocation`,onClick:x,ref:g},[e.header?R(`header`,{class:`vh-invocation-header`},[R(`div`,{class:`vh-invocation-header__breadcrumb`,title:`${Mh(e.invocation)} / ${Ah(e.invocation)}`},[R(`span`,{class:`vh-invocation-header__project-icon`},[sg()]),R(`span`,{class:`vh-invocation-header__project`},Mh(e.invocation)),R(`span`,{"aria-hidden":`true`,class:`vh-invocation-header__separator`},`/`),R(`h2`,n.title?.({invocation:e.invocation})??Ah(e.invocation))]),n.actions?.({invocation:e.invocation})]):null,R(`div`,{class:`vh-invocation-thread`},[R(`div`,{class:`vh-invocation-thread__content`},[ug(e.invocation),R(`div`,{"aria-label":`Session thread`,"aria-relevant":`additions text`,role:`log`},[R(`ol`,{class:`vh-invocation-activities`},f_(i.value,e.invocation,a.value,f.value,e=>f.value=e,y,(e,n)=>n===void 0?t(`inspect`,e):t(`inspect`,e,n),{...l,now:s.value,liveNow:c.value,mounted:o.value,copy:e=>void w(e),copiedId:h.value?.id,copyStatus:h.value?.status},m.value,b))]),r.value.length||e.invocation.error?null:R(`div`,{class:`vh-invocation-empty`,role:`status`},[R(`p`,`Waiting for the first update…`)]),e.invocation.error?R(lg,{error:e.invocation.error}):null,n.footer?.({invocation:e.invocation})])])])}}}),m_=j({name:`AgentInvocationInspector`,emits:{selectActivity:e=>!!e},props:{invocation:{required:!0,type:Object},showStatus:{default:!0,type:Boolean},showCapabilities:{default:!1,type:Boolean},showTimeline:{default:!0,type:Boolean},showSources:{default:!0,type:Boolean},showError:{default:!0,type:Boolean}},setup(e,{emit:t,slots:n}){let r=u(()=>th(e.invocation)),i=u(()=>Rh(r.value)),a=C(),o=C(),s,c=u(()=>({changes:r.value.filter(e=>e.kind===`change`).length,messages:(i.value.kind===`activities`?i.value.activities:[...i.value.history,...i.value.prompt?[i.value.prompt]:[],...i.value.work,...i.value.answers,...i.value.followup]).filter(e=>e.kind===`message`).length,steps:r.value.filter(e=>e.kind!==`message`&&e.name!==`vitehub.observation.truncated`).length,tokens:rh(r.value),toolCalls:[...nh(e.invocation).values()].reduce((e,t)=>e+t,0)}));function l(e){let n=r.value.find(t=>t.attributes[`tool.name`]===e);n&&t(`selectActivity`,n.id)}async function d(e,t){if(t){if(o.value=void 0,await re(),!(`navigator`in globalThis)||!navigator.clipboard){a.value=void 0,o.value=e;return}try{await navigator.clipboard.writeText(t),a.value=e,o.value=void 0,s&&clearTimeout(s),s=setTimeout(()=>{a.value=void 0},1600)}catch{a.value=void 0,o.value=e}}}function f(e,t,n){if(!n)return null;let r=a.value===e;return R(`button`,{"aria-label":r?`${t} copied`:`Copy ${t}`,class:`vh-invocation-inspector__copy`,onClick:()=>void d(e,n),type:`button`},[R(`span`,{class:`vh-invocation-inspector__copy-label`},t),R(`code`,{"aria-hidden":`true`,class:`vh-invocation-inspector__copy-value`},Xg(n)),R(`span`,{class:`vh-invocation-inspector__copy-icon`},[Zg(r)])])}return D(()=>{s&&clearTimeout(s)}),()=>{let r=e.invocation.configuration,i=r?.agent?.name??e.invocation.agentName,s=e.invocation.usage,u=s?.inputTokens!==void 0&&s.outputTokens!==void 0&&(s.totalTokens===void 0||s.inputTokens+s.outputTokens===s.totalTokens)?s:void 0,d=e.invocation.completedAt??e.invocation.failedAt??e.invocation.cancelledAt,p=eg(e.invocation.startedAt,d),m=p??(e.invocation.status===`pending`?`Waiting to start`:e.invocation.status===`running`?`In progress`:`Duration unavailable`);return R(`aside`,{"aria-label":`Session details`,class:`vh-invocation-inspector`,"data-status":e.invocation.status,"data-slot":`invocation-inspector`},[R(`header`,[R(`div`,[R(`p`,Mh(e.invocation)),R(`h3`,`Invocation details`)]),n.actions?.({invocation:e.invocation})]),R(`div`,{class:`vh-invocation-inspector__content`},[R(`span`,{class:`vh-visually-hidden`,role:`status`},a.value?`${a.value===`trace`?`Trace`:`Invocation`} ID copied`:o.value?`${o.value===`trace`?`Trace`:`Invocation`} ID could not be copied`:``),R(`section`,{class:`vh-invocation-inspector__identity`},[e.showStatus?R(`div`,{"aria-atomic":`true`,"aria-live":`polite`,class:`vh-invocation-inspector__status`,role:`status`},[R(`span`,{class:`vh-invocation-inspector__status-icon`},[Qg(e.invocation.status)]),R(`strong`,Zh(e.invocation.status)),R(`small`,m)]):null,R(`div`,{class:`vh-invocation-inspector__title-row`},[R(`h4`,{class:`vh-invocation-inspector__title`},Ah(e.invocation)),n.identityActions?.({invocation:e.invocation})]),jh(e.invocation)===e.invocation.id?null:R(`p`,jh(e.invocation)),i?R(`div`,{class:`vh-invocation-inspector__agent`},[R(`span`,`Agent`),R(`code`,i),r?.agent?.version?R(`small`,`v${r.agent.version}`):null]):null,e.showError&&e.invocation.error?R(lg,{error:e.invocation.error}):null]),qg(`Run summary`,R(`dl`,{class:`vh-invocation-inspector__metrics`},[R(`div`,[R(`dt`,`Messages`),R(`dd`,c.value.messages)]),R(`div`,[R(`dt`,`Steps`),R(`dd`,c.value.steps)]),R(`div`,[R(`dt`,`Tool calls`),R(`dd`,c.value.toolCalls)]),p?R(`div`,[R(`dt`,`Total time`),R(`dd`,p)]):null,c.value.changes?R(`div`,[R(`dt`,`Changes`),R(`dd`,c.value.changes)]):null,Yg(`Tokens`,(e.invocation.usage?.totalTokens??c.value.tokens)===void 0?`Unknown`:new Intl.NumberFormat(`en`).format(e.invocation.usage?.totalTokens??c.value.tokens)),Yg(s?.cost?.estimated===!0?`Estimated cost`:s?.cost?.estimated===!1?`Reported cost`:`Cost`,s?.cost?.display||`Unknown`),...[[`Input`,u?.inputTokens],[`Output`,u?.outputTokens],[`Cached`,u?.cachedInputTokens],[`Cache writes`,u?.cacheWriteTokens],[`Reasoning`,u?.reasoningTokens]].flatMap(([e,t])=>t===void 0?[]:[Yg(e,new Intl.NumberFormat(`en`).format(t))])])),e.showTimeline?Jg(e.invocation,e=>t(`selectActivity`,e)):null,...r?o_(r,e.invocation,e.showSources,e.showCapabilities,l):[],n.metadata?.({invocation:e.invocation}),qg(`Identifiers`,R(`div`,{class:`vh-invocation-inspector__copy-list`},[f(`trace`,`Trace ID`,e.invocation.traceId),f(`invocation`,`Invocation ID`,e.invocation.id)]))])])}}}),h_={docsBase:()=>`https://vitehub.dev/docs/reference/errors-diagnostics#agent-diagnostics`},$={why:({message:e})=>e===void 0?``:String(e)},g_=be({...h_,codes:{AGENT_R0646:$,AGENT_R0647:$,AGENT_R0648:$,AGENT_R0649:$,AGENT_R0650:$,AGENT_R0651:$,AGENT_R0652:$,AGENT_R0653:$,AGENT_R0654:$,AGENT_R0655:$,AGENT_R0656:$,AGENT_R0657:$,AGENT_R0658:$,AGENT_R0659:$,AGENT_R0660:$,AGENT_R0661:$,AGENT_R0662:$,AGENT_R0663:$,AGENT_R0664:$,AGENT_R0665:$,AGENT_R0666:$,AGENT_R0667:$,AGENT_R0668:$}});function __(e,t){let n=Array.from({length:t.length+1},(e,t)=>t);for(let r=0;r<e.length;r++){let i=n[0];n[0]=r+1;for(let a=0;a<t.length;a++){let o=n[a+1];n[a+1]=e[r]===t[a]?i:Math.min(i,n[a],n[a+1])+1,i=o}}return n[t.length]}function v_(e,t,n={}){let r=[],i=t.map(t=>({candidate:t,distance:__(e,t)})).sort((e,t)=>e.distance-t.distance)[0];return i&&i.distance<=Math.max(2,Math.floor(e.length/3))&&r.push(`Did you mean "${i.candidate}"?`),t.length&&r.push(`Discovered agents: ${t.slice(0,10).join(`, `)}${t.length>10?`, ...`:``}.`),n.prefix&&r.push(`Make sure @vite-hub/agent is configured and the agent is discovered.`),`${n.prefix?`[vitehub] `:``}Unknown agent: ${e}.${r.length?` ${r.join(` `)}`:``}`}var y_={...be({...h_,codes:{AGENT_R0907:$,AGENT_R0908:$,AGENT_R0909:$,AGENT_R0910:$,AGENT_R0911:$,AGENT_R0912:$,AGENT_R0913:$,AGENT_R0914:$,AGENT_R0915:$,AGENT_R0916:$,AGENT_R0917:$,AGENT_R0918:$,AGENT_R0919:$,AGENT_R0920:$,AGENT_R0921:$,AGENT_R0922:$,AGENT_R0923:{why:({names:e})=>`[vitehub] A tool transform removed MCP tools and introduced ${e.map(e=>JSON.stringify(e)).join(`, `)} without MCP provenance.`,fix:`Preserve metadata.mcpServer and metadata.originalName when renaming MCP tools. Use context.tools.add() to contribute unrelated tools and a transform to remove MCP tools.`},AGENT_R0905:$,AGENT_R0906:$,AGENT_R0903:$,AGENT_R0904:$,AGENT_R0898:$,AGENT_R0899:$,AGENT_R0900:$,AGENT_R0901:$,AGENT_R0902:$,AGENT_R0889:$,AGENT_R0890:$,AGENT_R0891:$,AGENT_R0893:$,AGENT_R0894:$,AGENT_R0895:$,AGENT_R0896:$,AGENT_R0897:$,AGENT_R0004:$,AGENT_R0005:$,AGENT_R0006:$,AGENT_R0007:$,AGENT_R0008:$,AGENT_R0009:$,AGENT_R0010:$,AGENT_R0011:$,AGENT_R0012:$,AGENT_R0013:$,AGENT_R0014:$,AGENT_R0015:$,AGENT_R0016:$,AGENT_R0017:$,AGENT_R0018:$,AGENT_R0019:$,AGENT_R0020:$,AGENT_R0021:$,AGENT_R0022:$,AGENT_R0023:$,AGENT_R0024:$,AGENT_R0025:$,AGENT_R0026:$,AGENT_R0027:$,AGENT_R0028:$,AGENT_R0029:$,AGENT_R0030:$,AGENT_R0031:$,AGENT_R0032:$,AGENT_R0033:$,AGENT_R0034:$,AGENT_R0035:$,AGENT_R0036:$,AGENT_R0037:$,AGENT_R0038:$,AGENT_R0039:$,AGENT_R0040:$,AGENT_R0041:$,AGENT_R0042:$,AGENT_R0043:$,AGENT_R0044:$,AGENT_R0045:$,AGENT_R0046:$,AGENT_R0047:$,AGENT_R0048:$,AGENT_R0049:$,AGENT_R0050:$,AGENT_R0051:$,AGENT_R0052:$,AGENT_R0053:$,AGENT_R0054:$,AGENT_R0055:$,AGENT_R0056:$,AGENT_R0057:$,AGENT_R0058:$,AGENT_R0059:$,AGENT_R0060:$,AGENT_R0061:$,AGENT_R0062:$,AGENT_R0063:$,AGENT_R0064:$,AGENT_R0065:$,AGENT_R0066:$,AGENT_R0067:$,AGENT_R0068:$,AGENT_R0069:$,AGENT_R0070:$,AGENT_R0071:$,AGENT_R0072:$,AGENT_R0073:$,AGENT_R0074:$,AGENT_R0075:$,AGENT_R0076:$,AGENT_R0077:$,AGENT_R0078:$,AGENT_R0079:$,AGENT_R0080:$,AGENT_R0081:$,AGENT_R0082:$,AGENT_R0083:$,AGENT_R0084:$,AGENT_R0085:$,AGENT_R0086:$,AGENT_R0087:$,AGENT_R0088:$,AGENT_R0089:$,AGENT_R0090:$,AGENT_R0091:$,AGENT_R0092:$,AGENT_R0093:$,AGENT_R0094:$,AGENT_R0095:$,AGENT_R0096:$,AGENT_R0097:$,AGENT_R0098:$,AGENT_R0099:$,AGENT_R0100:$,AGENT_R0101:$,AGENT_R0102:$,AGENT_R0103:$,AGENT_R0104:$,AGENT_R0105:$,AGENT_R0106:$,AGENT_R0107:$,AGENT_R0108:$,AGENT_R0109:$,AGENT_R0110:$,AGENT_R0111:$,AGENT_R0112:$,AGENT_R0113:$,AGENT_R0114:$,AGENT_R0115:$,AGENT_R0116:$,AGENT_R0117:$,AGENT_R0118:$,AGENT_R0119:$,AGENT_R0120:$,AGENT_R0121:$,AGENT_R0122:$,AGENT_R0123:$,AGENT_R0124:$,AGENT_R0125:$,AGENT_R0126:$,AGENT_R0127:$,AGENT_R0128:$,AGENT_R0129:$,AGENT_R0130:$,AGENT_R0131:$,AGENT_R0132:$,AGENT_R0133:$,AGENT_R0134:$,AGENT_R0135:$,AGENT_R0136:$,AGENT_R0137:$,AGENT_R0138:$,AGENT_R0139:$,AGENT_R0140:$,AGENT_R0141:$,AGENT_R0142:$,AGENT_R0143:$,AGENT_R0144:$,AGENT_R0145:$,AGENT_R0146:$,AGENT_R0147:$,AGENT_R0148:$,AGENT_R0149:$,AGENT_R0150:$,AGENT_R0151:$,AGENT_R0152:$,AGENT_R0153:$,AGENT_R0154:$,AGENT_R0155:$,AGENT_R0156:$,AGENT_R0157:$,AGENT_R0158:$,AGENT_R0159:$,AGENT_R0160:$,AGENT_R0161:$,AGENT_R0162:$,AGENT_R0163:$,AGENT_R0164:$,AGENT_R0165:$,AGENT_R0166:$,AGENT_R0167:$,AGENT_R0168:$,AGENT_R0198:$,AGENT_R0199:$,AGENT_R0200:$,AGENT_R0201:$,AGENT_R0202:$,AGENT_R0203:$,AGENT_R0204:$,AGENT_R0205:$,AGENT_R0206:$,AGENT_R0207:$,AGENT_R0208:$,AGENT_R0209:$,AGENT_R0210:$,AGENT_R0211:$,AGENT_R0212:$,AGENT_R0213:$,AGENT_R0214:$,AGENT_R0215:$,AGENT_R0216:$,AGENT_R0217:$,AGENT_R0218:$,AGENT_R0219:$,AGENT_R0220:$,AGENT_R0221:$,AGENT_R0222:$,AGENT_R0223:$,AGENT_R0224:$,AGENT_R0225:$,AGENT_R0229:$,AGENT_R0230:$,AGENT_R0231:$,AGENT_R0232:$,AGENT_R0233:$,AGENT_R0234:$,AGENT_R0235:$,AGENT_R0236:$,AGENT_R0237:$,AGENT_R0238:$,AGENT_R0239:$,AGENT_R0240:$,AGENT_R0241:$,AGENT_R0242:$,AGENT_R0243:$,AGENT_R0244:$,AGENT_R0245:$,AGENT_R0246:$,AGENT_R0247:$,AGENT_R0248:$,AGENT_R0249:$,AGENT_R0250:$,AGENT_R0251:$,AGENT_R0252:$,AGENT_R0253:$,AGENT_R0254:$,AGENT_R0255:$,AGENT_R0256:$,AGENT_R0257:$,AGENT_R0258:$,AGENT_R0259:$,AGENT_R0260:$,AGENT_R0261:$,AGENT_R0262:$,AGENT_R0263:$,AGENT_R0264:$,AGENT_R0265:$,AGENT_R0266:$,AGENT_R0267:$,AGENT_R0268:$,AGENT_R0269:$,AGENT_R0270:$,AGENT_R0271:$,AGENT_R0272:$,AGENT_R0273:$,AGENT_R0274:$,AGENT_R0275:$,AGENT_R0276:$,AGENT_R0277:$,AGENT_R0278:$,AGENT_R0279:$,AGENT_R0280:$,AGENT_R0281:$,AGENT_R0282:$,AGENT_R0283:$,AGENT_R0284:$,AGENT_R0285:$,AGENT_R0286:$,AGENT_R0287:$,AGENT_R0288:$,AGENT_R0289:$,AGENT_R0290:$,AGENT_R0291:$,AGENT_R0292:$,AGENT_R0293:$,AGENT_R0294:$,AGENT_R0295:$,AGENT_R0296:$,AGENT_R0297:$,AGENT_R0298:$,AGENT_R0299:$,AGENT_R0300:$,AGENT_R0301:$,AGENT_R0302:$,AGENT_R0303:$,AGENT_R0304:$,AGENT_R0305:$,AGENT_R0306:$,AGENT_R0307:$,AGENT_R0308:$,AGENT_R0309:$,AGENT_R0310:$,AGENT_R0311:$,AGENT_R0312:$,AGENT_R0313:$,AGENT_R0314:$,AGENT_R0315:$,AGENT_R0316:$,AGENT_R0317:$,AGENT_R0318:$,AGENT_R0319:$,AGENT_R0320:$,AGENT_R0321:$,AGENT_R0322:$,AGENT_R0323:$,AGENT_R0324:$,AGENT_R0325:$,AGENT_R0326:$,AGENT_R0327:$,AGENT_R0328:$,AGENT_R0329:$,AGENT_R0330:$,AGENT_R0331:$,AGENT_R0332:$,AGENT_R0333:$,AGENT_R0334:$,AGENT_R0335:$,AGENT_R0336:$,AGENT_R0337:$,AGENT_R0338:$,AGENT_R0339:$,AGENT_R0340:$,AGENT_R0341:$,AGENT_R0342:$,AGENT_R0343:$,AGENT_R0344:$,AGENT_R0345:$,AGENT_R0346:$,AGENT_R0347:$,AGENT_R0348:$,AGENT_R0349:$,AGENT_R0350:$,AGENT_R0351:$,AGENT_R0352:$,AGENT_R0353:$,AGENT_R0354:$,AGENT_R0355:$,AGENT_R0356:$,AGENT_R0357:$,AGENT_R0358:$,AGENT_R0359:$,AGENT_R0360:$,AGENT_R0361:$,AGENT_R0362:$,AGENT_R0363:$,AGENT_R0364:$,AGENT_R0365:$,AGENT_R0366:$,AGENT_R0367:$,AGENT_R0368:$,AGENT_R0369:$,AGENT_R0370:$,AGENT_R0371:$,AGENT_R0372:$,AGENT_R0373:$,AGENT_R0374:$,AGENT_R0375:$,AGENT_R0376:$,AGENT_R0377:$,AGENT_R0378:$,AGENT_R0379:$,AGENT_R0380:$,AGENT_R0381:$,AGENT_R0382:$,AGENT_R0383:$,AGENT_R0384:$,AGENT_R0385:$,AGENT_R0386:$,AGENT_R0387:$,AGENT_R0388:$,AGENT_R0389:$,AGENT_R0390:$,AGENT_R0391:$,AGENT_R0392:$,AGENT_R0393:$,AGENT_R0394:$,AGENT_R0395:$,AGENT_R0396:$,AGENT_R0397:$,AGENT_R0398:$,AGENT_R0399:$,AGENT_R0400:$,AGENT_R0401:$,AGENT_R0402:$,AGENT_R0403:$,AGENT_R0404:$,AGENT_R0405:$,AGENT_R0406:$,AGENT_R0407:$,AGENT_R0408:$,AGENT_R0409:$,AGENT_R0410:$,AGENT_R0411:$,AGENT_R0412:$,AGENT_R0413:$,AGENT_R0414:$,AGENT_R0415:$,AGENT_R0416:$,AGENT_R0417:$,AGENT_R0418:$,AGENT_R0419:$,AGENT_R0420:$,AGENT_R0421:$,AGENT_R0422:$,AGENT_R0423:$,AGENT_R0424:$,AGENT_R0425:$,AGENT_R0426:$,AGENT_R0427:$,AGENT_R0428:$,AGENT_R0429:$,AGENT_R0430:$,AGENT_R0431:$,AGENT_R0432:$,AGENT_R0433:$,AGENT_R0434:$,AGENT_R0435:$,AGENT_R0436:$,AGENT_R0437:$,AGENT_R0438:$,AGENT_R0439:$,AGENT_R0440:$,AGENT_R0441:$,AGENT_R0442:$,AGENT_R0443:$,AGENT_R0444:$,AGENT_R0445:$,AGENT_R0446:$,AGENT_R0447:$,AGENT_R0448:$,AGENT_R0449:$,AGENT_R0450:$,AGENT_R0451:$,AGENT_R0452:$,AGENT_R0453:$,AGENT_R0454:$,AGENT_R0455:$,AGENT_R0456:$,AGENT_R0457:$,AGENT_R0458:$,AGENT_R0459:$,AGENT_R0460:$,AGENT_R0461:$,AGENT_R0462:$,AGENT_R0463:$,AGENT_R0464:$,AGENT_R0465:$,AGENT_R0466:$,AGENT_R0467:$,AGENT_R0468:$,AGENT_R0469:$,AGENT_R0470:$,AGENT_R0471:$,AGENT_R0472:$,AGENT_R0473:$,AGENT_R0474:$,AGENT_R0475:$,AGENT_R0476:$,AGENT_R0477:$,AGENT_R0478:$,AGENT_R0479:$,AGENT_R0480:$,AGENT_R0481:$,AGENT_R0482:$,AGENT_R0483:$,AGENT_R0484:$,AGENT_R0485:$,AGENT_R0486:$,AGENT_R0487:$,AGENT_R0488:$,AGENT_R0489:$,AGENT_R0490:$,AGENT_R0491:$,AGENT_R0492:$,AGENT_R0493:$,AGENT_R0494:$,AGENT_R0495:$,AGENT_R0496:$,AGENT_R0497:$,AGENT_R0498:$,AGENT_R0499:$,AGENT_R0500:$,AGENT_R0501:$,AGENT_R0502:$,AGENT_R0503:$,AGENT_R0504:$,AGENT_R0505:$,AGENT_R0506:$,AGENT_R0507:$,AGENT_R0508:$,AGENT_R0509:$,AGENT_R0510:$,AGENT_R0511:$,AGENT_R0512:$,AGENT_R0513:$,AGENT_R0514:$,AGENT_R0515:$,AGENT_R0516:$,AGENT_R0517:$,AGENT_R0518:$,AGENT_R0519:$,AGENT_R0520:$,AGENT_R0521:$,AGENT_R0522:$,AGENT_R0523:$,AGENT_R0524:$,AGENT_R0525:$,AGENT_R0526:$,AGENT_R0527:$,AGENT_R0528:$,AGENT_R0529:$,AGENT_R0530:$,AGENT_R0531:$,AGENT_R0532:$,AGENT_R0533:$,AGENT_R0534:$,AGENT_R0535:$,AGENT_R0536:$,AGENT_R0537:$,AGENT_R0538:$,AGENT_R0539:$,AGENT_R0540:$,AGENT_R0541:$,AGENT_R0542:$,AGENT_R0543:$,AGENT_R0544:$,AGENT_R0545:$,AGENT_R0546:$,AGENT_R0547:$,AGENT_R0548:$,AGENT_R0549:$,AGENT_R0550:$,AGENT_R0551:$,AGENT_R0552:$,AGENT_R0553:$,AGENT_R0554:$,AGENT_R0555:$,AGENT_R0556:$,AGENT_R0557:$,AGENT_R0558:$,AGENT_R0559:$,AGENT_R0560:$,AGENT_R0561:$,AGENT_R0562:$,AGENT_R0563:$,AGENT_R0564:$,AGENT_R0565:$,AGENT_R0566:$,AGENT_R0567:$,AGENT_R0568:$,AGENT_R0569:$,AGENT_R0570:$,AGENT_R0571:$,AGENT_R0572:$,AGENT_R0582:$,AGENT_R0583:$,AGENT_R0584:$,AGENT_R0585:$,AGENT_R0586:$,AGENT_R0587:$,AGENT_R0588:$,AGENT_R0589:$,AGENT_R0590:$,AGENT_R0591:$,AGENT_R0592:$,AGENT_R0593:$,AGENT_R0594:$,AGENT_R0595:$,AGENT_R0596:$,AGENT_R0597:$,AGENT_R0598:$,AGENT_R0599:$,AGENT_R0600:$,AGENT_R0601:$,AGENT_R0602:$,AGENT_R0603:$,AGENT_R0604:$,AGENT_R0605:$,AGENT_R0606:$,AGENT_R0607:$,AGENT_R0608:$,AGENT_R0609:$,AGENT_R0610:$,AGENT_R0611:$,AGENT_R0612:$,AGENT_R0613:$,AGENT_R0614:$,AGENT_R0615:$,AGENT_R0616:$,AGENT_R0617:$,AGENT_R0618:$,AGENT_R0619:$,AGENT_R0620:$,AGENT_R0621:$,AGENT_R0622:$,AGENT_R0623:$,AGENT_R0624:$,AGENT_R0625:$,AGENT_R0626:$,AGENT_R0627:$,AGENT_R0628:$,AGENT_R0629:$,AGENT_R0630:$,AGENT_R0631:$,AGENT_R0632:$,AGENT_R0633:$,AGENT_R0634:$,AGENT_R0635:$,AGENT_R0636:$,AGENT_R0637:$,AGENT_R0638:$,AGENT_R0639:$,AGENT_R0640:$,AGENT_R0641:$,AGENT_R0642:$,AGENT_R0643:$,AGENT_R0669:$,AGENT_R0670:$,AGENT_R0671:$,AGENT_R0672:$,AGENT_R0673:$,AGENT_R0674:$,AGENT_R0675:$,AGENT_R0676:$,AGENT_R0677:$,AGENT_R0678:$,AGENT_R0679:$,AGENT_R0680:$,AGENT_R0681:$,AGENT_R0682:$,AGENT_R0683:$,AGENT_R0684:$,AGENT_R0685:$,AGENT_R0686:$,AGENT_R0687:$,AGENT_R0688:$,AGENT_R0689:$,AGENT_R0690:$,AGENT_R0691:$,AGENT_R0692:$,AGENT_R0693:$,AGENT_R0694:$,AGENT_R0695:$,AGENT_R0696:$,AGENT_R0697:$,AGENT_R0698:$,AGENT_R0699:$,AGENT_R0700:$,AGENT_R0701:$,AGENT_R0702:$,AGENT_R0703:$,AGENT_R0704:$,AGENT_R0705:$,AGENT_R0706:$,AGENT_R0707:$,AGENT_R0708:$,AGENT_R0709:$,AGENT_R0710:$,AGENT_R0711:$,AGENT_R0712:$,AGENT_R0713:$,AGENT_R0714:$,AGENT_R0715:$,AGENT_R0716:$,AGENT_R0717:$,AGENT_R0718:$,AGENT_R0719:$,AGENT_R0720:$,AGENT_R0721:$,AGENT_R0722:$,AGENT_R0723:$,AGENT_R0724:$,AGENT_R0725:$,AGENT_R0726:{why:({message:e})=>{let t=String(e??``);try{let e=JSON.parse(t);if(typeof e==`object`&&e&&`error`in e){let t=e.error;if(typeof t==`object`&&t&&`message`in t){let e=t.message;if(typeof e==`string`)return e}}}catch{}return t},fix:({message:e})=>{let t=String(e??``);return/requires a newer version of Codex/i.test(t)?`Upgrade the Codex CLI in the Agent runner and redeploy it, then start a new run.`:/configured model|model .*support/i.test(t)?`Choose a configured model supported by the installed provider, or update the provider runtime, then start a new run.`:/spend.?cap|spend(ing)? limit|budget.*exceed/i.test(t)?`Raise the provider workspace spending limit or wait for its billing reset, then start a new run.`:/rate.?limit|too many requests|quota.*exhaust/i.test(t)?`Wait for the provider quota to reset, then retry. Reduce concurrent runs if this keeps happening.`:/unauthori[sz]ed|authentication|signed out|invalid.api.key/i.test(t)?`Sign in again or update the provider credential, then retry.`:`Check the provider diagnostic details and service status before retrying.`}},AGENT_R0727:$,AGENT_R0728:$,AGENT_R0729:$,AGENT_R0730:$,AGENT_R0731:$,AGENT_R0732:$,AGENT_R0733:$,AGENT_R0734:$,AGENT_R0735:$,AGENT_R0736:$,AGENT_R0737:$,AGENT_R0738:$,AGENT_R0739:$,AGENT_R0740:$,AGENT_R0741:$,AGENT_R0742:$,AGENT_R0743:$,AGENT_R0744:$,AGENT_R0745:$,AGENT_R0746:$,AGENT_R0747:$,AGENT_R0748:$,AGENT_R0749:$,AGENT_R0750:$,AGENT_R0751:$,AGENT_R0752:$,AGENT_R0753:$,AGENT_R0754:$,AGENT_R0755:$,AGENT_R0756:$,AGENT_R0757:$,AGENT_R0758:$,AGENT_R0759:$,AGENT_R0760:$,AGENT_R0761:$,AGENT_R0762:$,AGENT_R0763:$,AGENT_R0764:$,AGENT_R0765:$,AGENT_R0766:$,AGENT_R0767:$,AGENT_R0768:$,AGENT_R0769:$,AGENT_R0770:$,AGENT_R0771:$,AGENT_R0772:$,AGENT_R0773:$,AGENT_R0774:$,AGENT_R0775:$,AGENT_R0776:$,AGENT_R0777:$,AGENT_R0778:$,AGENT_R0779:$,AGENT_R0780:$,AGENT_R0781:$,AGENT_R0782:$,AGENT_R0783:$,AGENT_R0784:$,AGENT_R0785:$,AGENT_R0786:$,AGENT_R0787:$,AGENT_R0788:$,AGENT_R0789:$,AGENT_R0790:$,AGENT_R0791:$,AGENT_R0792:$,AGENT_R0793:$,AGENT_R0794:$,AGENT_R0795:$,AGENT_R0796:$,AGENT_R0797:$,AGENT_R0798:$,AGENT_R0799:$,AGENT_R0800:$,AGENT_R0801:$,AGENT_R0802:$,AGENT_R0803:$,AGENT_R0804:$,AGENT_R0805:$,AGENT_R0806:$,AGENT_R0807:$,AGENT_R0808:$,AGENT_R0809:$,AGENT_R0810:$,AGENT_R0811:$,AGENT_R0812:$,AGENT_R0813:$,AGENT_R0814:$,AGENT_R0815:$,AGENT_R0816:$,AGENT_R0817:$,AGENT_R0818:$,AGENT_R0819:$,AGENT_R0820:$,AGENT_R0821:$,AGENT_R0822:$,AGENT_R0823:$,AGENT_R0824:$,AGENT_R0825:$,AGENT_R0826:$,AGENT_R0827:$,AGENT_R0828:$,AGENT_R0829:$,AGENT_R0830:$,AGENT_R0831:$,AGENT_R0832:$,AGENT_R0833:$,AGENT_R0834:$,AGENT_R0835:$,AGENT_R0836:$,AGENT_R0837:$,AGENT_R0838:$,AGENT_R0839:$,AGENT_R0840:$,AGENT_R0841:$,AGENT_R0842:$,AGENT_R0843:$,AGENT_R0844:$,AGENT_R0845:$,AGENT_R0846:$,AGENT_R0847:$,AGENT_R0848:$,AGENT_R0849:$,AGENT_R0850:$,AGENT_R0851:$,AGENT_R0852:$,AGENT_R0853:$,AGENT_R0854:$,AGENT_R0855:$,AGENT_R0856:$,AGENT_R0857:$,AGENT_R0858:$,AGENT_R0859:$,AGENT_R0860:$,AGENT_R0861:$,AGENT_R0862:$,AGENT_R0863:$,AGENT_R0864:$,AGENT_R0865:$,AGENT_R0866:$,AGENT_R0867:$,AGENT_R0868:$,AGENT_R0869:$,AGENT_R0870:$,AGENT_R0871:$,AGENT_B0002:$,AGENT_B0005:$,AGENT_B0006:$,AGENT_B0007:$,AGENT_B0008:$,AGENT_B0009:$,AGENT_B0010:$,AGENT_B0011:$,AGENT_B0012:$,AGENT_B0013:$,AGENT_B0014:$,AGENT_B0015:$,AGENT_B0016:$,AGENT_B0017:$,AGENT_B0018:$,AGENT_B0022:$,AGENT_B0023:$,AGENT_B0024:$,AGENT_R0872:$,AGENT_R0873:$,AGENT_R0874:$,AGENT_R0875:$,AGENT_R0876:$,AGENT_R0877:$,AGENT_R0878:$,AGENT_R0879:$,AGENT_R0880:$,AGENT_R0881:$,AGENT_R0882:$,AGENT_R0883:$,AGENT_R0884:$,AGENT_R0885:$,AGENT_R0886:$,AGENT_R0887:$,AGENT_R0888:$,AGENT_R0926:$,AGENT_R0927:$,AGENT_R0934:$,AGENT_R0935:$,AGENT_R0936:$,AGENT_R0937:$,AGENT_R0970:$,AGENT_R0971:$,AGENT_R0972:$,AGENT_R0973:$,AGENT_R0974:$,AGENT_R0976:$,AGENT_R0979:$,AGENT_R0981:$,AGENT_R0982:$,AGENT_R0983:$,AGENT_R0924:$,AGENT_R0925:$,AGENT_R0950:$,AGENT_R0951:$,AGENT_R0952:$,AGENT_R0953:$,AGENT_R0954:$,AGENT_R0955:$,AGENT_R0956:$,AGENT_R0957:$,AGENT_R0958:$,AGENT_R0959:$,AGENT_R0960:$,AGENT_R0961:$,AGENT_R0962:$,AGENT_R0963:$,AGENT_R0932:$,AGENT_R0933:$,AGENT_R0929:$,AGENT_R0930:$,AGENT_R0931:$,AGENT_R0938:$,AGENT_R0001:{why:({name:e,available:t})=>v_(e,t,{prefix:!0}),fix:`Use a discovered Agent name. Check the Agent Definition and the ViteHub Agent plugin configuration.`},AGENT_R0002:{why:({name:e})=>`[vitehub] Agent "${e}" did not export a valid default agent.`,fix:`Export the result of defineAgent() as the default export of the Agent Definition.`},AGENT_C0001:{why:`[vitehub] Invalid agent definition.`,fix:`Pass an Agent Definition created with defineAgent().`},AGENT_C0002:{why:`[vitehub] defineCapability() requires a capability definition.`,fix:`Pass an object with a non-empty id to defineCapability().`},AGENT_C0003:{why:`[vitehub] Capability definitions require a non-empty string id.`,fix:`Set the Capability id to a string that starts with a letter.`},AGENT_C0004:{why:({id:e})=>`[vitehub] Capability id "${e}" must be a stable identifier.`,fix:`Start the id with a letter. Use only letters, numbers, hyphens, underscores, and dots.`},AGENT_C0005:{why:({capability:e})=>`[vitehub] Capability "${e}" trigger names must be non-empty strings.`,fix:`Set each trigger name to a non-empty string that starts with a letter.`},AGENT_C0006:{why:({capability:e,name:t})=>`[vitehub] Capability "${e}" trigger "${t}" must be a stable local identifier.`,fix:`Start the trigger name with a letter. Use only letters, numbers, hyphens, and underscores.`},AGENT_C0007:{why:({label:e})=>`[vitehub] ${e} mode must be "read" or "write".`,fix:`Set mode to "read" or "write", or omit it to use "read".`},AGENT_C0008:{why:`[vitehub] defineAgent({ capabilities }) must be an ordered array.`,fix:`Pass an array of Capabilities in execution order.`},AGENT_B0001:{why:`[vitehub] Eve extensions must be compiled by the ViteHub Vite plugin.`,fix:`Load the Agent Definition through a Vite host with the ViteHub Agent plugin installed.`},AGENT_B0020:{why:({root:e})=>`[vitehub] Cannot identify the owning Agent build for ${JSON.stringify(e)} because its environment does not uniquely match a resolved configuration.`,fix:`Use a separate Agent plugin instance per build or preserve the resolved build options in each environment config.`},AGENT_B0019:{why:({files:e})=>`[vitehub] Provider Agent Drivers ("codex" and "claude-code") cannot run in a Cloudflare Worker. Used in ${e.join(`, `)}.`,fix:`Use a { model } or { run } Driver in Worker builds, or deploy Agents that use provider Drivers to a Node.js host.`},AGENT_R0939:{why:`[vitehub] Observability is not configured.`,fix:`Set vitehub({ observability: { service } }) in the Vite config.`},AGENT_R0940:$,AGENT_R0947:{why:({requested:e,actual:t})=>`[vitehub] SQLite journal mode ${e} was requested, but the VFS retained ${t}.`,fix:`Use a local VFS that supports the requested journal mode. Set journalMode to delete for volumes that support rollback journaling only.`},AGENT_R0941:$,AGENT_R0942:$,AGENT_R0943:$,AGENT_R0944:$,AGENT_R0945:$,AGENT_R0946:$,AGENT_R0991:$,AGENT_R0992:$,AGENT_R0993:$,AGENT_R0994:$,AGENT_R0995:$,AGENT_R0996:$,AGENT_R0997:$,AGENT_R0998:$,AGENT_R0999:$,AGENT_R1000:$,AGENT_R1001:$,AGENT_R1002:$,AGENT_R1003:$,AGENT_R1004:$,AGENT_R1005:{why:({trigger:e})=>`[vitehub] Channel trigger "${e}" declares durableState: true, but it ran without the Channel's State.`,fix:`Run the trigger through the Channel's webhook route, its webhook queue or context.dispatch(), and give the Agent a durable state provider.`},AGENT_R1006:$,AGENT_R1007:$,AGENT_R1008:$,AGENT_R1011:$,AGENT_R1012:$,AGENT_R1013:$,AGENT_R1024:{why:`The ChatGPT access token expired during this Invocation.`,fix:`Start a new Invocation to resolve a fresh token. Review completed tool effects before retrying. ViteHub does not replay the interrupted Invocation automatically.`},AGENT_R1015:{why:`The ChatGPT gateway requires ViteHub to own the Codex launch and its credentials.`,fix:`Remove driver.launch, providerSettings.launchArgs, binaryPath, homePath, shadowHomePath and sandbox when using chatgpt(). Install @openai/codex in the app and use a local Codex Driver with Capability tools.`},AGENT_R1016:{why:({problem:e})=>`The ChatGPT Connection cannot provide plan access (${e}).`,fix:({connection:e})=>`Enable Connections, grant this Agent read access, and run vitehub connections connect ${e}. For invalid-user, check OpenAI status before signing in again. No API key fallback is used.`},AGENT_R1017:{why:`The ChatGPT plan usage limit was reached.`,fix:`Check https://chatgpt.com/settings/usage and wait for the limit to reset. ViteHub never switches to API billing.`},AGENT_R1018:{why:`This ChatGPT account is not eligible for plan usage.`,fix:`Check the account's Plus or Pro plan and OpenAI's Sign in with ChatGPT eligibility requirements.`},AGENT_R1019:{why:`The ChatGPT plan endpoint rejected an unsupported capability.`,fix:`Use function tools or web search. Remove hosted MCP, connectors, tool_search, file search, code interpreter, image generation and computer use.`},AGENT_R1020:{why:`ChatGPT plan usage is temporarily unavailable after bounded retries.`,fix:`Retry later and check OpenAI status. Keep the existing grant; do not sign in repeatedly.`},AGENT_R1022:{why:`ChatGPT denied plan access with HTTP 403. Codex did not preserve the provider error code.`,fix:`Check account eligibility, the issued client ID, resource and plan scopes. OpenAI may require app approval. ViteHub does not switch billing or erase the grant.`},AGENT_R1021:{why:`OpenAI rejected the app's ChatGPT plan configuration or request route.`,fix:`Check the issued client ID, resource, plan scopes, POST /v1/responses route and OpenAI app eligibility. Do not retry with an API key.`},AGENT_R1023:{why:`ChatGPT plan inference failed without a provider error code. Codex can discard error codes from failed response streams.`,fix:`Check https://chatgpt.com/settings/usage, OpenAI status, the selected model and Connection scopes. Review completed tool effects before retrying. ViteHub has not switched billing or erased the grant.`},AGENT_R0928:{why:`[vitehub] Provider Agent Drivers are not included in Worker builds. They start local Codex or Claude Code processes, which require a Node.js host.`,fix:`Use a { model } or { run } Driver in Worker builds, or deploy Agents that use provider Drivers to a Node.js host.`},AGENT_C0009:{why:({id:e})=>`[vitehub] Duplicate capability id "${e}" in one agent.`,fix:`Remove the duplicate Capability or give each Capability a unique id.`},AGENT_C0010:{why:({id:e,unsupported:t})=>`[vitehub] Invocation-resolved Capability "${e}" cannot contribute ${t.join(`, `)}. Attach definition-time behavior in a static capabilities array.`,fix:`Move triggers, workspaceSources, and chat access to a static capabilities array.`},AGENT_C0011:{why:`[vitehub] forge() requires valid forge, repositories, output limit and operations for its mode.`,fix:`Use mode write for write operations and policy. Use repository names or owner/* patterns.`},AGENT_C0012:{why:`[vitehub] content() requires { collections?: string[], operations?: Array<"read" | "write" | "publish">, policy?, user?, lease?: "override" }.`,fix:`Name each collection once, enable at least one operation, pass policy as a decision or function and user as a function, and omit lease or set it to "override".`},AGENT_C0013:{why:`[vitehub] operations() requires { include: string[], approve?, user? }.`,fix:`List the operation names to expose, such as ["content.*"], and pass approve as "destructive", "write", "all", "never", a list of names, or a function.`},AGENT_R1014:{why:({message:e})=>e===void 0?``:String(e),fix:"Add the integration that defines the operation, and check the name with `vitehub inspect definitions --kind operation`."},AGENT_R0003:{why:({name:e})=>`[vitehub:agent] Tool "${e}" failed with a retryable policy decision.`,fix:`Retry the tool when its policy permits execution. Do not bypass the policy.`}}}),...g_};function b_(e){if(e==null||Object(e)!==e)return!1;try{return Function.prototype.toString.call(e),!0}catch{return!1}}function x_(e,t){if(t===`undefined`)return e===void 0;if(t===`object`&&e===null)return!0;if(e==null)return!1;let n=Object(e)!==e;if(!n)return t===`function`?b_(e):t===`object`&&!b_(e);let r=Object.prototype.toString.call(e);switch(t){case`bigint`:return n&&r===`[object BigInt]`;case`boolean`:return n&&r===`[object Boolean]`;case`function`:return!1;case`number`:return n&&r===`[object Number]`;case`object`:return!1;case`string`:return n&&r===`[object String]`;case`symbol`:return n&&r===`[object Symbol]`}throw he.RUNTIME_R0008({message:`Unsupported runtime type: ${t}`})}var S_=`/api/invocations`,C_=2,w_=20;function T_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function E_(e){return e===`pending`||e===`running`||e===`completed`||e===`failed`||e===`cancelled`}function D_(e){return e===`approval`||e===`capability`||e===`error`||e===`lifecycle`||e===`policy`||e===`run`}function O_(e){if(!T_(e)||typeof e.id!=`string`||typeof e.createdAt!=`string`||typeof e.cursor!=`string`||!E_(e.status)||typeof e.traceId!=`string`||typeof e.updatedAt!=`string`)throw y_.AGENT_R0609({message:`Invalid Agent Invocation response.`});return{...e,createdAt:e.createdAt,cursor:e.cursor,id:e.id,status:e.status,traceId:e.traceId,updatedAt:e.updatedAt}}function k_(e){if(!T_(e)||!Array.isArray(e.invocations))throw y_.AGENT_R0610({message:`Invalid Agent Invocation list response.`});if(e.cursor!==void 0&&typeof e.cursor!=`string`)throw y_.AGENT_R0611({message:`Invalid Agent Invocation list cursor.`});if(e.remainingStatuses!==void 0&&(!Array.isArray(e.remainingStatuses)||!e.remainingStatuses.every(E_)))throw y_.AGENT_R0612({message:`Invalid Agent Invocation remaining statuses.`});return{...typeof e.cursor==`string`?{cursor:e.cursor}:{},invocations:e.invocations.map(O_),...Array.isArray(e.remainingStatuses)?{remainingStatuses:e.remainingStatuses.filter(E_)}:{}}}function A_(e){if(!T_(e)||!Array.isArray(e.observations))throw y_.AGENT_R0613({message:`Invalid Agent Invocation detail response.`});let t=e.observations.map(e=>{if(!T_(e)||typeof e.name!=`string`||typeof e.sequence!=`number`||typeof e.timestamp!=`string`||!D_(e.type))throw y_.AGENT_R0614({message:`Invalid Agent Invocation observation.`});return{...e,name:e.name,sequence:e.sequence,timestamp:e.timestamp,type:e.type}});if(e.appendObservations!==void 0&&typeof e.appendObservations!=`boolean`)throw y_.AGENT_R0615({message:`Invalid Agent Invocation observation page.`});let n=e.observationCursor;if(n!==void 0&&typeof n!=`string`)throw y_.AGENT_R0616({message:`Invalid Agent Invocation observation cursor.`});let r={invocation:O_(e.invocation),observations:t};return e.appendObservations===!0&&(r.appendObservations=!0),n!==void 0&&(r.observationCursor=n),r}function j_(e){return!!(e&&typeof e==`object`&&`name`in e&&e.name===`AbortError`)}function M_(e,t){if(!t)return e;let n=new URLSearchParams;for(let[e,r]of Object.entries(t)){let t=Array.isArray(r)?r:[r];for(let r of t)r!=null&&n.append(e,String(r))}let r=n.toString();return r?`${e}${e.includes(`?`)?`&`:`?`}${r}`:e}function N_(e,t){return`${e.replace(/\/+$/,``)}/${encodeURIComponent(t)}`}function P_(e){let n=t(null),r=t(!1),i,a=!1,o;function s(){o!==void 0&&clearTimeout(o),o=void 0}function c(){if(s(),a||i)return;let t=e.pollInterval!==void 0&&F(e.pollInterval);t===!1||t===void 0||!Number.isFinite(t)||t<=0||(o=setTimeout(()=>{if(e.canPoll&&!e.canPoll()){c();return}u()},t))}async function u(){if(a)return;e.beforeLoad?.(),s(),i?.abort();let t=new AbortController;i=t,r.value=!0,n.value=null;try{let n=await e.load(t.signal);return i===t?(n===void 0?e.clear():(e.apply(n),e.onSuccess?.()),n):void 0}catch(e){if(i!==t||j_(e))return;n.value=e}finally{i===t&&(i=void 0,r.value=!1,c())}}let d=e.watch?l(e.source,()=>{u()},{deep:!0}):void 0,f=e.pollInterval===void 0?void 0:l(()=>F(e.pollInterval),c);function p(){a||(a=!0,d?.(),f?.(),s(),i?.abort(),i=void 0,r.value=!1)}return ae(p,!0),e.immediate?u():c(),{error:n,isLoading:r,refresh:u,stop:p}}function F_(e){let n=t([]),r=t(),i=t(!1),a=t(null),o=t([]),s=e.request,c=e.baseURL??S_,l,u,d,f=[],p=!1,m=0,h=0,g=!0,_=new Set,v,y=!1;function b(){return JSON.stringify([F(c),e.query?F(e.query):void 0])}let x=P_({apply(e){if(g||n.value.length===0){n.value=e.invocations,r.value=e.cursor,u=e.cursor,d=e.cursor,f=e.remainingStatuses??[],p=!1,o.value=f,g=!1;return}let t=e.departedIds??new Set,i=e.reconciledInvocations??new Map,a=new Set(e.invocations.map(e=>e.id)),s=n.value.filter(e=>!a.has(e.id)&&!t.has(e.id)).map(e=>i.get(e.id)??e);_=new Set(e.pendingDepartureIds??_),n.value=[...e.invocations,...s],e.cursor!==u&&(u=e.cursor,d=e.cursor,f=e.remainingStatuses??[],p=!1),r.value=p?d:e.cursor,o.value=p?f:e.remainingStatuses??[]},clear(){n.value=[],r.value=void 0,o.value=[],_=new Set},beforeLoad(){let e=b();g=v!==e,v=e,g&&(n.value=[],r.value=void 0,u=void 0,d=void 0,f=[],p=!1,h=0,a.value=null),m++,l&&!g&&(a.value=y_.AGENT_R0617({message:`Loading older Agent Invocations was interrupted.`})),l?.abort(),l=void 0,i.value=!1},canPoll:()=>!i.value,immediate:e.immediate!==!1&&(e.request!==void 0||`window`in globalThis),load:async t=>{let r=e.query?F(e.query):void 0,i=k_(await s(M_(F(c),r),{signal:t})),a=new Set(i.invocations.map(e=>e.id)),o=Array.isArray(r?.status)?r.status:[r?.status],l=new Set(o.filter(E_)),u=r?.search?.trim().toLowerCase(),d=x_(r?.triggeredBy,`string`)?r.triggeredBy.trim():void 0,f=e=>!d||x_(e.annotations?.triggeredBy,`string`)&&e.annotations.triggeredBy.trim()===d,p=g?[]:n.value.filter(e=>!a.has(e.id)).map(e=>e.id);if(e.requestSummaries&&l.size===0&&!u&&p.length>0){let n=e.requestSummaries,r=Math.min(p.length,w_),a=Array.from({length:r},(e,t)=>p[(h+t)%p.length]).filter(e=>e!==void 0);h=(h+r)%p.length;let o=k_(await n(M_(F(c),{id:a}),{signal:t})),s=new Map(o.invocations.map(e=>[e.id,e])),l=new Set,u=new Map;for(let e of a){let t=s.get(e);t&&f(t)?u.set(e,t):l.add(e)}return{...i,departedIds:l,reconciledInvocations:u}}if(g||l.size===0&&!u&&!d)return i;let m=new Set(_);for(let e of a)m.delete(e);let v=Math.min(p.length,w_),y=Array.from({length:v},(e,t)=>p[(h+t)%p.length]).filter(e=>e!==void 0);h=p.length===0?0:(h+v)%p.length;let b=[...new Set([...y,...m])].slice(0,w_),x=await Promise.allSettled(b.map(e=>s(N_(F(c),e),{signal:t}).then(A_))),S=new Set,C=new Map;m.clear();for(let[e,t]of x.entries()){let n=b[e];if(!n)continue;if(t.status===`rejected`){m.add(n);continue}let{observations:r,...i}=t.value.invocation;!f(i)||l.size>0&&!l.has(t.value.invocation.status)||u&&!JSON.stringify(i).toLowerCase().includes(u)?S.add(n):C.set(n,i)}return{...i,departedIds:S,pendingDepartureIds:m,reconciledInvocations:C}},onSuccess:e.onSuccess,pollInterval:e.pollInterval,source:()=>[F(c),e.query?F(e.query):void 0],watch:e.watch!==!1});async function S(){if(y||x.isLoading.value)return;let t=d;if(!t)return;l?.abort();let u=new AbortController,h=m;l=u,i.value=!0,x.error.value=null;try{let i=e.query?F(e.query):void 0,g=new Set;for(;t&&!g.has(t);){g.add(t);let e=k_(await s(M_(F(c),{...i,cursor:t}),{signal:u.signal}));if(l!==u||m!==h)return;let _=new Map(e.invocations.map(e=>[e.id,e])),v=new Set(n.value.map(e=>e.id)),y=[..._.values()].filter(e=>!v.has(e.id));if(_.size>0&&(n.value=[...n.value.map(e=>_.get(e.id)??e),...y]),p=!0,d=e.cursor,f=e.remainingStatuses??[],r.value=d,o.value=f,a.value=null,e.cursor&&g.has(e.cursor))throw Error(`[vitehub] Agent Invocation pagination returned a repeated cursor.`);if(y.length>0||!e.cursor||g.size>=C_)return e;t=e.cursor}}catch(e){if(l!==u||j_(e))return;a.value=e}finally{l===u&&(l=void 0,i.value=!1)}}function C(){y||(y=!0,m++,l?.abort(),l=void 0,i.value=!1,x.stop())}return ae(()=>l?.abort(),!0),{cursor:r,invocations:n,isLoadingMore:i,loadMore:S,loadMoreError:a,remainingStatuses:o,...x,stop:C}}function I_(e,n){let r=t(null),i=t([]),a=n.request,o=n.baseURL??S_,s,c,l;return{invocation:r,observations:i,...P_({apply(e){let t=e.appendObservations&&s===l&&r.value?.id===e.invocation.id;r.value=e.invocation,i.value=t?[...i.value,...e.observations]:e.observations,s=l,c=e.observationCursor},clear(){r.value=null,i.value=[],s=void 0,c=void 0,l=void 0},immediate:n.immediate!==!1&&(n.request!==void 0||`window`in globalThis),load(t){let n=F(e);if(n===void 0)return Promise.resolve(void 0);let r=F(o),u=JSON.stringify([r,n]);l=u;let d=s===u&&c!==void 0,f=M_(N_(r,n),{observationCount:d?i.value.length:void 0,observationCursor:d?c:void 0});return a(f,{signal:t}).then(A_)},onSuccess:n.onSuccess,pollInterval:n.pollInterval,source:()=>[F(o),F(e)],watch:n.watch!==!1})}}function L_(e,t){return e&&Object.hasOwn(t,e)?e:Object.keys(t)[0]}function R_(e,t){return e&&Object.hasOwn(t,e)?t[e]:void 0}function z_(e,t){return e&&Object.hasOwn(e,t)?e[t]:void 0}function B_(e){let n=t(!1);return l(e,({errors:e,pending:t})=>{if(n.value&&t)return;let r=e.filter(Boolean);n.value=r.length>1&&r.every(e=>ye(e))},{immediate:!0,flush:`sync`}),T(n)}var V_={class:`text-sm font-medium text-highlighted`},H_={class:`mt-1 text-xs leading-5 text-muted`},U_=j({__name:`console-connection-state`,props:{compact:{type:Boolean},retrying:{type:Boolean}},emits:[`retry`,`openSessions`],setup(e){return(t,n)=>{let r=Je,i=le;return H(),g(`div`,{role:`alert`,class:L([`relative w-full shrink-0`,e.compact?`flex items-center gap-3 border-b border-default px-5 py-3`:`flex h-full min-h-0 flex-col items-center justify-center gap-3 px-6 text-center`])},[e.compact?E(``,!0):(H(),S(r,{key:0,class:`absolute left-3 top-3 md:hidden`,icon:`i-lucide-menu`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`Open sessions`,onClick:n[0]||=e=>t.$emit(`openSessions`)})),P(i,{name:`i-lucide-wifi-off`,class:L([`shrink-0 text-muted`,e.compact?`size-4`:`mb-1 size-5`])},null,8,[`class`]),w(`div`,{class:L(e.compact?`min-w-0 flex-1`:`max-w-xs`)},[w(`h2`,V_,B(e.compact?`Connection lost`:`Unable to connect`),1),w(`p`,H_,B(e.compact?`Showing the last loaded session. Reconnect to get updates.`:`The agent server may be restarting or offline. Try reconnecting in a moment.`),1)],2),P(r,{label:e.retrying?`Reconnecting…`:`Reconnect`,icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`soft`,size:`xs`,disabled:e.retrying,onClick:n[1]||=e=>t.$emit(`retry`)},null,8,[`label`,`disabled`])],2)}}}),W_=yt({id:Et(W(),_t())});function G_(e){let t=0;return l(()=>{let{agent:t,base:n,invokerProfileId:r}=e();return[t,n,r]},()=>{t++},{flush:`sync`}),()=>{let n=t;return{target:{...e()},isCurrent:()=>t===n}}}async function K_({agent:e,base:t,invokerProfileId:n},r){let i={prompt:r.text};n&&(i.invokerProfileId=n);let a=[...r.files??[]];if(a.length>10)throw Error(`Use at most ten images.`);a.length&&(i.files=a.map(e=>({url:e.url,filename:e.filename?.slice(0,255)||`image`})));let o=await xe(`${t}/${encodeURIComponent(me(e))}/invocations`,{body:i,method:`POST`,query:{agentRoute:`encoded`}}),s=Tt(W_,o);if(!s.success)throw de.VITE_HUB_R0102({message:`The Agent invocation response did not include an id.`});return{agent:e,id:s.output.id}}var q_=yt({notEnforcedBy:vt(W()),delivery:vt(wt([`local`,`journal`])),outcome:wt([`requested`,`terminal`]),status:vt(wt([`pending`,`running`,`cancelled`,`completed`,`failed`]))});async function J_(e,t){let n=await xe(`${e}/${encodeURIComponent(t)}`,{body:{action:`cancel`},method:`POST`}),r=Tt(q_,n);if(!r.success)throw de.VITE_HUB_R0102({message:`The invocation cancel response was not valid.`});return r.output}async function Y_(e,t){await xe(`${e}/${encodeURIComponent(t)}`,{body:{action:`delete`},method:`POST`})}var X_={class:`console-invocation-composer shrink-0 bg-default px-3 pb-4 pt-2 sm:px-5 sm:pb-5`},Z_={class:`mx-auto grid w-full max-w-3xl gap-2`},Q_={class:`console-invocation-composer__surface relative min-w-0`},$_={class:`console-invocation-composer__context flex min-w-0 items-center gap-0.5 text-xs text-muted`},ev={class:`flex h-7 min-w-0 items-center gap-1.5 rounded-lg px-2`},tv={class:`truncate`},nv={class:`flex h-7 items-center truncate px-2`},rv={class:`px-3 text-center text-xs text-dimmed`},iv=10485760,av=j({__name:`console-invocation-composer`,props:{agent:{},base:{},profiles:{}},emits:[`started`],setup(e,{emit:t}){let n=e,i=t,a=C(``),o=C([]),s=C(),c=C(!1),d=C(),f=G_(()=>({agent:n.agent,base:n.base,invokerProfileId:d.value})),p=u(()=>n.profiles.map(e=>({label:e.label||e.id,value:e.id})));l(()=>[n.agent,...n.profiles.map(e=>e.id)],()=>{n.profiles.some(e=>e.id===d.value)||(d.value=n.profiles[0]?.id)},{immediate:!0});function m(e){return e instanceof Error?e.message:`The Agent invocation could not be started.`}function h(e){let t=e.filter(e=>[`image/png`,`image/jpeg`,`image/webp`,`image/gif`].includes(e.type));return t.length!==e.length&&(s.value=Error(`Use a PNG, JPEG, WebP, or GIF image. Other files are not supported by this Console input yet.`)),t.some(e=>e.size>iv)&&(s.value=Error(`Images must be at most ${ht(iv)}.`)),t.filter(e=>e.size<=iv)}async function _(e){if(c.value||!e.text.trim()&&!e.files?.length)return;c.value=!0,s.value=void 0;let{target:t,isCurrent:n}=f();try{let r=await K_(t,e);n()&&(a.value=``,o.value=[],i(`started`,r))}catch(e){n()&&(s.value=e)}finally{c.value=!1}}return(t,n)=>{let i=nt,l=le,u=at,f=Je;return H(),g(`div`,X_,[w(`div`,Z_,[s.value instanceof O(Ce)?(H(),S(De,{key:0,compact:``,error:s.value,title:`Could not start Agent`},null,8,[`error`])):s.value?(H(),S(i,{key:1,color:`error`,icon:`i-lucide-circle-alert`,title:`Could not start Agent`,description:m(s.value),variant:`subtle`},null,8,[`description`])):E(``,!0),w(`div`,Q_,[P(O(Ut),{modelValue:a.value,"onUpdate:modelValue":n[2]||=e=>a.value=e,files:o.value,"onUpdate:files":n[3]||=e=>o.value=e,"aria-label":`Test this Agent`,accept:`image/png,image/jpeg,image/webp,image/gif`,onError:n[4]||=e=>s.value=e,class:`console-invocation-composer__prompt`,"filter-files":h,placeholder:`Message ${e.agent}…`,status:c.value?`submitted`:`ready`,onSubmit:_},{"footer-leading":r(()=>[w(`div`,$_,[w(`span`,ev,[P(l,{class:`size-4 shrink-0 opacity-70`,name:`i-lucide-bot`}),w(`span`,tv,B(e.agent),1)]),e.profiles.length>1?(H(),g(x,{key:0},[n[5]||=w(`span`,{class:`mx-0.5 h-4 w-px shrink-0 bg-default`,"aria-hidden":`true`},null,-1),P(u,{modelValue:d.value,"onUpdate:modelValue":n[0]||=e=>d.value=e,"aria-label":`Invoker profile`,items:p.value,size:`xs`,variant:`ghost`,ui:{base:`h-7 rounded-lg px-2 text-xs text-muted hover:text-default`}},null,8,[`modelValue`,`items`])],64)):e.profiles[0]?.label?(H(),g(x,{key:1},[n[6]||=w(`span`,{class:`mx-0.5 h-4 w-px shrink-0 bg-default`,"aria-hidden":`true`},null,-1),w(`span`,nv,B(e.profiles[0].label),1)],64)):E(``,!0)])]),submit:r(({canSubmit:e})=>[P(f,{"aria-label":`Start Agent`,class:`console-invocation-composer__submit size-8 rounded-full disabled:opacity-30`,color:`primary`,icon:`i-lucide-arrow-up`,disabled:!e,loading:c.value,square:``,size:`sm`,type:`button`,onClick:n[1]||=e=>_({text:a.value,files:o.value})},null,8,[`disabled`,`loading`])]),_:1},8,[`modelValue`,`files`,`placeholder`,`status`])]),w(`p`,rv,[n[7]||=w(`span`,{class:`[@media(pointer:coarse)_and_(not_(any-pointer:fine))]:hidden`},`Enter sends · Shift+Enter adds a line · `,-1),z(`Images up to `+B(O(ht)(iv)),1)])])])}}}),ov=[`aria-label`,`role`],sv={class:`session-inspector__header`},cv={class:`session-inspector__tabstrip`},lv={class:`session-inspector__actions`},uv={key:1,class:`grid gap-8 px-5 py-6`},dv={class:`grid gap-3`},fv={class:`grid gap-3`},pv={class:`grid grid-cols-3 gap-2`},mv={class:`grid gap-4`},hv={key:1,class:`px-6 py-10 sm:px-10 lg:px-14`},gv={class:`mx-auto grid w-full max-w-4xl gap-6`},_v={class:`mx-auto grid w-full max-w-3xl gap-4 rounded-3xl bg-elevated/60 p-7`},vv={class:`grid gap-4 px-1`},yv=j({__name:`console-session-loading`,props:{error:{default:void 0},maximizable:{type:Boolean,default:!0},maximized:{type:Boolean,default:!1},surface:{default:`thread`}},emits:[`close`,`retry`,`toggleMaximized`],setup(e,{emit:t}){let n=e,i=t;return(t,o)=>{let s=pe,c=Je,l=Ae;return H(),g(`div`,{"aria-label":n.error?`Session load failed`:`Loading session`,class:`h-full w-full min-w-0 overflow-hidden`,role:n.error?`alert`:`status`},[e.surface===`inspector`?(H(),g(x,{key:0},[w(`header`,sv,[w(`div`,cv,[P(s,{class:`h-6 w-28 rounded-md`}),P(l,{text:`Open inspector view`},{default:r(()=>[P(c,{class:`session-inspector__icon-button`,icon:`i-lucide-plus`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:``,"aria-label":`Open inspector view`})]),_:1})]),w(`div`,lv,[P(l,{text:n.maximized?`Restore split view`:`Maximize details`},{default:r(()=>[P(c,{class:`session-inspector__icon-button`,icon:n.maximized?`i-lucide-minimize-2`:`i-lucide-maximize-2`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!n.maximizable,"aria-label":n.maximized?`Restore split view`:`Maximize details`,onClick:o[0]||=e=>i(`toggleMaximized`)},null,8,[`icon`,`disabled`,`aria-label`])]),_:1},8,[`text`]),P(l,{text:`Close details`},{default:r(()=>[P(c,{class:`session-inspector__icon-button`,icon:`i-lucide-panel-right-close`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`Close details`,onClick:o[1]||=e=>i(`close`)})]),_:1})])]),n.error?(H(),S(De,{key:0,class:`h-[calc(100%-3.25rem)] min-h-0`,title:`Could not load session details`,error:n.error,retry:()=>i(`retry`)},null,8,[`error`,`retry`])):(H(),g(`div`,uv,[w(`section`,dv,[P(s,{class:`h-6 w-28 rounded-md`}),P(s,{class:`h-4 w-3/4 rounded`}),P(s,{class:`h-4 w-32 rounded`})]),w(`section`,fv,[P(s,{class:`h-3 w-24 rounded`}),w(`div`,pv,[(H(),g(x,null,a(3,e=>P(s,{key:e,class:`h-20 rounded-lg`})),64))])]),w(`section`,mv,[P(s,{class:`h-3 w-28 rounded`}),(H(),g(x,null,a(5,e=>w(`div`,{key:e,class:`grid gap-2`},[P(s,{class:L([`h-4 rounded`,e%2==0?`w-2/3`:`w-1/2`])},null,8,[`class`]),P(s,{class:`h-1 w-full rounded-full`})])),64))])]))],64)):(H(),g(`div`,hv,[w(`div`,gv,[P(s,{class:`h-14 rounded-lg`}),w(`div`,_v,[P(s,{class:`h-8 w-44 rounded-md`}),P(s,{class:`mt-2 h-5 w-4/5 rounded`}),P(s,{class:`h-5 w-full rounded`}),P(s,{class:`h-5 w-2/3 rounded`})]),P(s,{class:`h-12 rounded-lg`}),w(`div`,vv,[(H(),g(x,null,a(4,e=>w(`div`,{key:e,class:`grid gap-2`},[P(s,{class:L([`h-4 rounded`,e%2==0?`w-3/5`:`w-4/5`])},null,8,[`class`]),P(s,{class:`h-3 w-1/3 rounded`})])),64))])])]))],8,ov)}}}),bv={key:0,class:`flex min-w-0 items-center gap-2 text-sm`},xv={key:0,class:`hidden max-w-40 shrink-0 truncate font-normal text-muted sm:inline`},Sv={key:1,class:`hidden text-dimmed sm:inline`,"aria-hidden":`true`},Cv={class:`min-w-0 truncate font-medium text-highlighted`},wv={key:1,class:`text-sm font-medium`},Tv={class:`sr-only`,role:`status`,"aria-live":`polite`},Ev=j({__name:`console-session-navbar`,props:{cost:{},detailsOpen:{type:Boolean},externalUrl:{},hasDisplay:{type:Boolean},hasSelection:{type:Boolean},loading:{type:Boolean},refreshable:{type:Boolean},project:{},title:{},tokens:{}},emits:[`openSessions`,`refresh`,`toggleDetails`],setup(e){let t=e,n=u(()=>{if(t.externalUrl){try{let e=new URL(t.externalUrl).hostname.toLowerCase();if(e===`github.com`||e.endsWith(`.github.com`))return{icon:`i-lucide-github`,label:`Open on GitHub`}}catch{}return{icon:`i-lucide-external-link`,label:`Open related page`}}}),a=C(),o,s=u(()=>a.value===`copied`?`Link copied`:a.value===`failed`?`Could not copy link`:`Copy session link`);async function c(){try{if(!navigator.clipboard)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(window.location.href),a.value=`copied`}catch{a.value=`failed`}o&&clearTimeout(o),o=setTimeout(()=>a.value=void 0,2e3)}return D(()=>{o&&clearTimeout(o)}),(t,o)=>{let l=Je,u=Ae,d=Te;return H(),S(d,{class:`vitehub-console__session-navbar`,title:e.title,toggle:!1,ui:{root:`border-0`,title:`min-w-0 flex-1`}},{title:r(()=>[e.hasDisplay?(H(),g(`div`,bv,[e.project?(H(),g(`span`,xv,B(e.project),1)):E(``,!0),e.project?(H(),g(`span`,Sv,`/`)):E(``,!0),w(`strong`,Cv,B(e.title),1)])):(H(),g(`span`,wv,B(e.title),1))]),leading:r(()=>[P(u,{text:`Open sessions`},{default:r(()=>[P(l,{"data-slot":`mobile-session-navigation`,class:`md:hidden`,icon:`i-lucide-menu`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`Open sessions`,onClick:o[0]||=e=>t.$emit(`openSessions`)})]),_:1})]),right:r(()=>[w(`span`,Tv,B(a.value?s.value:``),1),e.hasSelection?(H(),S(u,{key:0,text:s.value},{default:r(()=>[P(l,{icon:a.value===`copied`?`i-lucide-check`:`i-lucide-link`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":s.value,onClick:c},null,8,[`icon`,`aria-label`])]),_:1},8,[`text`])):E(``,!0),e.externalUrl&&n.value?(H(),S(u,{key:1,text:n.value.label},{default:r(()=>[P(l,{to:e.externalUrl,target:`_blank`,icon:n.value.icon,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":n.value.label},null,8,[`to`,`icon`,`aria-label`])]),_:1},8,[`text`])):E(``,!0),i(t.$slots,`actions`),e.refreshable?(H(),S(u,{key:2,text:`Refresh session`},{default:r(()=>[P(l,{icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`ghost`,size:`xs`,loading:e.loading,"aria-label":`Refresh session`,onClick:o[1]||=e=>t.$emit(`refresh`)},null,8,[`loading`])]),_:1})):E(``,!0),P(u,{text:e.hasSelection?`Session details`:`Select a session to inspect`},{default:r(()=>[P(l,{"data-slot":`session-details-toggle`,icon:`i-lucide-panel-right`,color:`neutral`,variant:e.detailsOpen?`soft`:`ghost`,size:`xs`,disabled:!e.hasSelection,"aria-label":`Session details`,"aria-pressed":e.detailsOpen,onClick:o[2]||=e=>t.$emit(`toggleDetails`)},null,8,[`variant`,`disabled`,`aria-pressed`])]),_:1},8,[`text`])]),_:3},8,[`title`])}}});function Dv(){let e=new Set;return{has:t=>e.has(t),exclude:t=>t.filter(t=>!e.has(t.id)),async remove(t,n){e.add(t),n.clearSelection();try{await n.navigate()}finally{n.removeFromList();try{await n.refresh()}finally{n.removeFromList()}}}}}var Ov=[`role`,`title`],kv=j({__name:`console-session-cancel`,props:{apiBase:{},cancelRequested:{type:Boolean},id:{},notEnforcedBy:{},terminal:{type:Boolean}},emits:[`cancelled`],setup(e,{emit:t}){let n=e,i=t,a=C(!1),o=C(),s=C(),c=C(),d=u(()=>{if(n.terminal)return c.value;let e=s.value??(n.cancelRequested?n.notEnforcedBy:void 0);return e?`Cancel requested, not enforced by ${e}`:n.cancelRequested?`Cancellation requested; completion not confirmed`:void 0}),f=u(()=>n.terminal?`Abort stale execution`:n.cancelRequested?`Cancel requested`:`Cancel session`);l(()=>n.id,()=>{o.value=void 0,s.value=void 0,c.value=void 0});async function p(){if(a.value||!n.terminal&&n.cancelRequested)return;let{id:e}=n;a.value=!0,o.value=void 0;try{let t=await J_(n.apiBase,e);if(n.id!==e)return;s.value=t.notEnforcedBy,t.outcome===`terminal`&&(c.value=t.delivery===`local`?t.notEnforcedBy?`Local abort requested, not enforced by ${t.notEnforcedBy}`:`Local abort requested; completion not confirmed`:`Journal is terminal; no local execution received an abort`),i(`cancelled`,e)}catch(t){n.id===e&&(o.value=t instanceof Error&&t.message?t.message:`The session could not be cancelled.`)}finally{a.value=!1}}return(t,n)=>{let i=Je,s=Ae;return H(),g(x,null,[o.value||d.value?(H(),g(`span`,{key:0,"data-slot":`session-cancel-status`,role:o.value?`alert`:`status`,class:L([`max-w-64 truncate text-xs`,o.value?`text-error`:`text-warning`]),title:o.value??d.value},B(o.value??d.value),11,Ov)):E(``,!0),P(s,{text:f.value},{default:r(()=>[P(i,{"data-slot":`session-cancel`,icon:`i-lucide-circle-stop`,color:`neutral`,variant:`ghost`,size:`xs`,loading:a.value,disabled:a.value||!e.terminal&&e.cancelRequested,"aria-label":f.value,onClick:p},null,8,[`loading`,`disabled`,`aria-label`])]),_:1},8,[`text`])],64)}}}),Av=[`title`],jv={class:`grid gap-3`},Mv={class:`flex justify-end gap-1`},Nv=j({__name:`console-session-actions`,props:{agent:{},agentsBase:{},apiBase:{},deletable:{type:Boolean},deleteUnavailableReason:{},id:{},rerun:{}},emits:[`deleted`,`started`],setup(e,{emit:t}){let n=e,i=t,a=C(),o=C(),s=C(!1),c={"invocation-not-terminal":`Rerun is available after the session finishes`,"replay-metadata-unavailable":`Rerun is unavailable: the session has no complete replay metadata`,"input-has-context":`Rerun is unavailable: this session received trusted invocation context`,"input-has-run-metadata":`Rerun is unavailable: this session received runtime run metadata`,"input-has-abort-signal":`Rerun is unavailable: this session received a cancellation signal`,"input-prompt-changed":`Rerun is unavailable: input preparation changed the prompt`,"input-has-dry-run":`Rerun is unavailable: this session ran in dry-run mode`,"input-has-timeout":`Rerun is unavailable: this session received a timeout`,"input-has-invoker":`Rerun is unavailable: this session received a direct invoker identity`,"input-has-options":`Rerun is unavailable: this session received call options`,"input-has-data":`Rerun is unavailable: this session received structured input`,"input-redacted":`Rerun is unavailable: the recorded input or Invoker Profile was redacted`,"input-has-messages":`Rerun is unavailable: this session received messages or attachments`,"input-not-captured":`Rerun is unavailable: the prompt was not recorded`,"input-truncated":`Rerun is unavailable: the recorded prompt is incomplete`,"invoker-profile-unavailable":`Rerun is unavailable: the recorded Invoker Profile is no longer configured`},d=u(()=>n.rerun.available?`Rerun with the same prompt`:Object.hasOwn(c,n.rerun.reason)?c[n.rerun.reason]:`Rerun is unavailable for this session`),f=u(()=>n.deletable?`Delete session`:n.deleteUnavailableReason===`store-delete-unavailable`?`Delete is unavailable: the invocation store does not support deletion`:`Delete is available after the session finishes`);l(()=>n.id,()=>{o.value=void 0,s.value=!1});function p(e,t){return e instanceof Error&&e.message?e.message:t}async function m(){if(a.value||!n.rerun.available)return;let{agent:e,id:t}=n;a.value=`rerun`,o.value=void 0;try{let r=await K_({agent:e,base:n.agentsBase,invokerProfileId:n.rerun.invokerProfileId},{text:n.rerun.prompt});n.id===t&&i(`started`,r)}catch(e){n.id===t&&(o.value=p(e,`The session could not be rerun.`))}finally{a.value=void 0}}async function h(){if(a.value||!n.deletable)return;let{id:e}=n;a.value=`delete`,o.value=void 0;try{await Y_(n.apiBase,e),s.value=!1,i(`deleted`,e)}catch(t){n.id===e&&(o.value=p(t,`The session could not be deleted.`))}finally{a.value=void 0}}return(t,i)=>{let c=Je,l=Ae,u=mt;return H(),g(x,null,[o.value?(H(),g(`span`,{key:0,"data-slot":`session-action-error`,role:`alert`,class:`max-w-56 truncate text-xs text-error`,title:o.value},B(o.value),9,Av)):E(``,!0),P(l,{text:d.value},{default:r(()=>[P(c,{"data-slot":`session-rerun`,icon:`i-lucide-rotate-ccw`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!n.rerun.available||!!a.value,"aria-label":d.value,onClick:m},null,8,[`disabled`,`aria-label`])]),_:1},8,[`text`]),P(u,{open:s.value,"onUpdate:open":i[1]||=e=>s.value=e,content:{align:`end`,collisionPadding:12},ui:{content:`w-64 max-w-[calc(100vw-1.5rem)] p-3`}},{content:r(()=>[w(`div`,jv,[i[2]||=w(`p`,{class:`text-sm`},`Delete this session and its usage record?`,-1),w(`div`,Mv,[P(c,{color:`neutral`,label:`Cancel`,size:`xs`,variant:`ghost`,onClick:i[0]||=e=>s.value=!1}),P(c,{"data-slot":`session-delete-confirm`,color:`error`,label:`Delete`,size:`xs`,variant:`soft`,disabled:!!a.value,onClick:h},null,8,[`disabled`])])])]),default:r(()=>[P(l,{text:f.value},{default:r(()=>[P(c,{"data-slot":`session-delete`,icon:`i-lucide-trash-2`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!e.deletable||!!a.value,"aria-label":f.value},null,8,[`disabled`,`aria-label`])]),_:1},8,[`text`])]),_:1},8,[`open`])],64)}}});function Pv(e){let t=e.split(`/`).at(-1)?.toLowerCase()||``;if(t===`dockerfile`)return`dockerfile`;if(t===`makefile`)return`make`;if(t===`.gitignore`||t===`.npmrc`)return`shellscript`;let n=t.split(`.`).at(-1)||``,r={cjs:`javascript`,css:`css`,html:`html`,js:`javascript`,json:`json`,jsonc:`jsonc`,jsx:`jsx`,md:`markdown`,mdx:`mdx`,mjs:`javascript`,mts:`typescript`,scss:`scss`,sh:`shellscript`,sql:`sql`,ts:`typescript`,tsx:`tsx`,vue:`vue`,yaml:`yaml`,yml:`yaml`};return Object.hasOwn(r,n)?r[n]:`text`}var Fv=[`data-wrap`],Iv={key:0,class:`session-inspector__state`},Lv={key:1,class:`session-code-preview__plain`},Rv=[`innerHTML`],zv=j({__name:`console-session-code-preview`,props:{content:{},path:{},wrap:{type:Boolean}},setup(e){let t={css:()=>Xe(()=>import(`./css-BDmUYLyz.js`),__vite__mapDeps([5,6,3]),import.meta.url),dockerfile:()=>Xe(()=>import(`./dockerfile-C147k2YT.js`),__vite__mapDeps([7,8,3]),import.meta.url),html:()=>Xe(()=>import(`./html-DwfkhSwv.js`),__vite__mapDeps([9,10,3,11,6]),import.meta.url),javascript:()=>Xe(()=>import(`./javascript-DOney_iy.js`),__vite__mapDeps([12,11,3]),import.meta.url),json:()=>Xe(()=>import(`./json-B6nR7qG1.js`),__vite__mapDeps([13,14,3]),import.meta.url),jsonc:()=>Xe(()=>import(`./jsonc-D4AqO_oZ.js`),__vite__mapDeps([15,16]),import.meta.url),jsx:()=>Xe(()=>import(`./jsx-_Ptt0Qo0.js`),__vite__mapDeps([17,18,3]),import.meta.url),make:()=>Xe(()=>import(`./make-PPdVpZzp.js`),__vite__mapDeps([19,20]),import.meta.url),markdown:()=>Xe(()=>import(`./markdown-BK4fiefF.js`),__vite__mapDeps([21,22]),import.meta.url),mdx:()=>Xe(()=>import(`./mdx-l4Hs_llf.js`),__vite__mapDeps([23,24]),import.meta.url),scss:()=>Xe(()=>import(`./scss-BPiS1nMZ.js`),__vite__mapDeps([25,26,3,6]),import.meta.url),shellscript:()=>Xe(()=>import(`./shellscript-DStN_0YR.js`),__vite__mapDeps([27,28,3]),import.meta.url),sql:()=>Xe(()=>import(`./sql-7uki0mN6.js`),__vite__mapDeps([29,30,3]),import.meta.url),tsx:()=>Xe(()=>import(`./tsx-Ge9e86uq.js`),__vite__mapDeps([31,32,3]),import.meta.url),typescript:()=>Xe(()=>import(`./typescript-C2Eu6twH.js`),__vite__mapDeps([33,34,3]),import.meta.url),vue:()=>Xe(()=>import(`./vue-CHGs_ru8.js`),__vite__mapDeps([35,36,11,3,6,10,14,34,37]),import.meta.url),yaml:()=>Xe(()=>import(`./yaml-CZmR-Icd.js`),__vite__mapDeps([38,39,3]),import.meta.url)},n;function r(){return n??=Promise.all([Xe(()=>import(`./core-CD3So4L1.js`).then(e=>e.t),__vite__mapDeps([40,3]),import.meta.url),Xe(()=>import(`./engine-javascript-Dymre4AG.js`),__vite__mapDeps([41,42]),import.meta.url),Xe(()=>import(`./github-light-default-CC-h3suv.js`),__vite__mapDeps([43,44]),import.meta.url),Xe(()=>import(`./github-dark-default-Dk3Gj2bt.js`),__vite__mapDeps([45,46]),import.meta.url)]).then(([{createHighlighterCore:e},{createJavaScriptRegexEngine:t},n,r])=>e({engine:t(),langs:[],themes:[n.default,r.default]})),n}let i=e,o=C(``),s=C(!1),c=C(!1),d=0,f=u(()=>Pv(i.path)),p=u(()=>i.content.split(`
|
|
76
|
+
`));return l(()=>[i.content,i.path],async([e])=>{let n=++d;s.value=!0,o.value=``,c.value=!1;try{let i=f.value,a=t[i];if(!a)throw Error(`No syntax highlighter is registered for ${i}.`);let s=await r();s.getLoadedLanguages().includes(i)||await s.loadLanguage((await a()).default);let c=s.codeToHtml(e,{defaultColor:!1,lang:i,themes:{dark:`github-dark-default`,light:`github-light-default`}});n===d&&(o.value=c)}catch(e){console.error(`[vitehub] Workspace syntax highlighting failed.`,e),n===d&&(c.value=!0)}finally{n===d&&(s.value=!1)}},{immediate:!0}),(t,n)=>{let r=le;return H(),g(`div`,{class:`session-code-preview`,"data-wrap":e.wrap},[s.value&&!o.value?(H(),g(`div`,Iv,[P(r,{name:`i-lucide-loader-circle`,class:`animate-spin`}),n[0]||=z(`Highlighting file… `,-1)])):c.value?(H(),g(`pre`,Lv,[w(`code`,null,[(H(!0),g(x,null,a(p.value,(e,t)=>(H(),g(`span`,{key:t,class:`line`},[w(`span`,null,B(e||``),1)]))),128))])])):(H(),g(`div`,{key:2,class:`session-code-preview__html`,innerHTML:o.value},null,8,Rv))],8,Fv)}}}),Bv=C(!0);try{Bv.value=globalThis.localStorage?.getItem(`vitehub.console.wordWrap`)!==`false`}catch{}l(Bv,e=>{try{globalThis.localStorage?.setItem(`vitehub.console.wordWrap`,String(e))}catch{}});function Vv(){return Bv}var Hv=[`finish`,`completed`,`error`,`failed`,`abort`,`cancel`,`cancelled`],Uv=Et(bt(),St(e=>Number.isFinite(e))),Wv=W();function Gv(e){return e.endsWith(`.start`)||e.endsWith(`.started`)}function Kv(e){let t=e.attributes??{};for(let e of[`step.id`,`tool.id`,`gen_ai.tool.call.id`,`approval.id`,`model.call.id`,`agent.run.id`,`agent.invocation.id`]){let n=Tt(Wv,t[e]);if(n.success&&n.output)return n.output}return e.name.startsWith(`agent.invocation.`)&&(Gv(e.name)||ny(e.name))?`agent.invocation`:`${e.name}:${e.sequence}`}function qv(e,t,n){let r=e===`execute_tool`?t[`tool.durationMs`]:t[`invocation.durationMs`],i=Tt(Uv,r);return i.success?i.output:n}function Jv(e,t,n){return Math.max(t,e+n)}function Yv(e,t){return Math.min(e,...t)}function Xv(e,t){return e===`tool_approval`&&t[`approval.approved`]===!1}function Zv(e){return e===`agent.task.failed`||e===`agent.task.cancelled`}function Qv(e){return e.endsWith(`.error`)||e.endsWith(`.failed`)||Zv(e)}function $v(e){return!e.startsWith(`agent.invocation.`)&&(e.endsWith(`.abort`)||e.endsWith(`.cancel`)||e.endsWith(`.cancelled`))}function ey(e){let t=e.attributes??{};return[`step.id`,`tool.id`,`gen_ai.tool.call.id`,`approval.id`,`model.call.id`].some(e=>{let n=Tt(Wv,t[e]);return n.success&&n.output.length>0})&&(e.name.endsWith(`.finish`)||e.name.endsWith(`.completed`)||e.name===`agent.approval.decision`)}function ty(e){return e.startsWith(`agent.tool.`)&&!Gv(e)}function ny(e){return Hv.some(t=>e.endsWith(`.${t}`))}function ry(e){return Hv.map(t=>e.replace(/\.(?:start|started)$/,`.${t}`))}function iy(e){return e===`completed`?[`agent.invocation.finish`,`agent.invocation.completed`]:e===`failed`?[`agent.invocation.error`,`agent.invocation.failed`]:e===`cancelled`?[`agent.invocation.abort`,`agent.invocation.cancel`,`agent.invocation.cancelled`,`agent.invocation.error`,`agent.invocation.failed`]:ry(`agent.invocation.start`)}function ay(e){return e===`failed`?`failed`:e===`cancelled`?`cancelled`:e===`completed`?`completed`:`running`}function oy(e,t){return e===`cancelled`?t.cancelledAt??t.updatedAt:e===`completed`?t.completedAt??t.updatedAt:e===`failed`?t.failedAt??t.updatedAt:t.updatedAt}function sy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=r.get(n);return i||(i={head:0,lifecycles:[]},r.set(n,i)),i}function cy(e,t){e.observations.push(t)}function ly(e,t,n){let r=new WeakMap,i=e=>{let t=r.get(e);if(t!==void 0)return t;let n=Kv(e);return r.set(e,n),n},a=e.map(e=>({finish:void 0,observations:[],start:e,terminalNames:n(e)})),o=new Map,s=new Map,c=0;for(let e of t){for(;c<a.length;){let t=a[c];if(t.start.sequence>e.sequence)break;let n=Gv(t.start.name)?o:s,r=i(t.start);for(let e of new Set(t.terminalNames))sy(n,r,e).lifecycles.push(t);c+=1}let t=i(e),n=o.get(t)?.get(e.name);if(n)for(;n.head<n.lifecycles.length;){let t=n.lifecycles[n.head++];if(!t.finish){t.finish=e;break}}let r=s.get(t)?.get(e.name);if(r)for(;r.head<r.lifecycles.length;){let t=r.lifecycles[r.head++];t.finish||=e}}let l=new Map,u=new WeakMap;for(let e of a){let t=l.get(e.start.sequence)??[];if(t.push(e),l.set(e.start.sequence,t),!e.finish)continue;let n=u.get(e.finish)??[];n.push(e),u.set(e.finish,n)}let d=new Map,f=e=>{if(!e.finish||e.finish.sequence<=e.start.sequence)return;let t=i(e.start),n=d.get(t)??new Set;n.add(e),d.set(t,n)},p=e=>{let t=i(e.start),n=d.get(t);n?.delete(e),n?.size===0&&d.delete(t)};for(let e of t){let t=i(e),n=l.get(e.sequence)??[],r=u.get(e)??[];if(Gv(e.name)){for(let r of n)i(r.start)===t&&(cy(r,e),f(r));continue}if(r.length>0){for(let t of r)cy(t,e);for(let e of r)p(e);continue}if(!ny(e.name)){for(let n of d.get(t)??[])cy(n,e);for(let r of n)i(r.start)===t&&(cy(r,e),f(r))}}return a}function uy(e,t){let n=new Set,r=new Set;for(let i of e){let e=Kv(i);if(Gv(i.name)){n.delete(e);continue}if(ey(i)){if(t.has(i.sequence)){n.add(e);continue}n.has(e)||(n.add(e),r.add(i.sequence))}}return r}var dy={class:`session-trace__waterfall`},fy={class:`session-trace__search`},py={class:`session-trace__table-scroll`},my={class:`session-trace__table`},hy={class:`session-trace__table-head`},gy={class:`session-trace__axis`},_y={class:`session-trace__rows`},vy=[`data-selected`,`data-status`,`onClick`],yy={key:0},by={class:`session-trace__timeline`},xy=[`data-wide`],Sy={key:0,class:`session-trace__empty`},Cy=[`data-wrap`],wy={class:`session-trace__detail-head`},Ty=[`data-status`],Ey={class:`session-trace__summary`},Dy={class:`session-trace__field-search`},Oy={class:`session-trace__fields`},ky={key:0,class:`session-trace__empty`},Ay=j({__name:`console-session-trace`,props:{invocation:{}},emits:[`focusActivity`],setup(e,{emit:t}){let n=Vv(),i=e,o=t,s=C(``),c=C(``),d=C(),f=C(!1),p=u(()=>A(i.invocation)),m=u(()=>Yv(ue(i.invocation.startedAt||i.invocation.createdAt),p.value.map(e=>e.startMs))),h=u(()=>Math.max(ue(i.invocation.completedAt||i.invocation.failedAt||i.invocation.cancelledAt||i.invocation.updatedAt),...p.value.map(e=>Jv(e.startMs,e.endMs,e.durationMs)))),_=u(()=>Math.max(1,h.value-m.value)),v=u(()=>{let e=s.value.trim().toLowerCase();return e?p.value.filter(t=>oe(t).includes(e)):p.value}),y=u(()=>p.value.find(e=>e.id===d.value)??p.value[0]),b=u(()=>[{id:`waterfall`,slot:`waterfall`,defaultSize:y.value?65:100,minSize:25,class:`h-full min-h-0 min-w-0 overflow-hidden`},...y.value?[{id:`detail`,slot:`detail`,defaultSize:35,minSize:20,class:`h-full min-h-0 min-w-0 overflow-hidden`}]:[]]),T=u(()=>y.value?{...y.value.attributes,"span.id":y.value.id,"trace.id":i.invocation.traceId,"span.operation":y.value.operation,"span.status":y.value.status,"span.start_time":new Date(y.value.startMs).toISOString(),"span.end_time":new Date(Jv(y.value.startMs,y.value.endMs,y.value.durationMs)).toISOString(),"span.duration_ms":y.value.durationMs,"span.events":y.value.eventNames}:{}),D=u(()=>{let e=c.value.trim().toLowerCase();return Object.entries(T.value).filter(([t,n])=>!e||`${t} ${ve(n)}`.toLowerCase().includes(e))}),k=u(()=>[0,.25,.5,.75,1].map(e=>({label:fe(_.value*e),position:e})));l(p,e=>{e.some(e=>e.id===d.value)||(d.value=e[0]?.id)},{immediate:!0}),l(d,()=>{c.value=``,f.value=!1});function A(e){let t=[...e.observations].sort((e,t)=>e.sequence-t.sequence),n=ly(ee(t),t,t=>te(t,e)),r=n.map(({start:t,finish:n,observations:r})=>j(t,n,r,e)),i=new Set(n.flatMap(({finish:e})=>e?[e.sequence]:[])),a=uy(t,i);for(let n of t){let t=Qv(n.name),o=$v(n.name),s=a.has(n.sequence),c=s&&ty(n.name),l=ty(n.name)&&o,u=ty(n.name)&&(t||l)&&ny(n.name);if(!t&&!s&&!o)continue;let d=re(n);if(i.has(n.sequence))continue;let f=ue(n.timestamp),p=n.attributes?.[`error.recoverable`]===!0&&e.status===`completed`,m=c||u?`execute_tool`:Zv(n.name)?`run_task`:s||o?ie(n,n.attributes??{}):`error`,h=Xv(m,n.attributes??{}),g=ae(m,n.attributes??{},e),_=c||u?Math.max(0,qv(m,n.attributes??{},0)):0;r.push({activityId:N(n),attributes:{...n.attributes},depth:1,durationMs:_,endMs:f,eventNames:[n.name],icon:s?L(m):o?`i-lucide-ban`:p?`i-lucide-circle-check`:`i-lucide-circle-alert`,id:`${d}:${s?`terminal`:`error`}:${n.sequence}`,name:g?`${m} ${g}`:p&&n.name===`agent.stream.error`?`Stream recovered`:ge(n.name),operation:p?`recovery`:m,sequence:n.sequence,startMs:f-_,status:h?`failed`:s?`completed`:o?`cancelled`:p?`recovered`:`failed`})}return r.some(e=>e.operation===`invoke_agent`)||r.unshift(M(e,t)),r.sort((e,t)=>e.depth-t.depth||e.startMs-t.startMs||e.sequence-t.sequence)}function ee(e){let t=[],n=new Map;for(let r of e){let e=re(r);if(r.name.startsWith(`agent.tool.`)&&Gv(r.name)){let i=n.get(e);if(i===void 0)n.set(e,t.push(r)-1);else{let e=t[i];t[i]={...e,attributes:{...e.attributes,...r.attributes}}}continue}ty(r.name)&&ny(r.name)&&n.delete(e),(Gv(r.name)||r.name===`agent.approval.request`)&&t.push(r)}return t}function j(e,t,n,r){let i=re(e),a=Object.assign({},...n.map(e=>e.attributes??{})),o=ue(e.timestamp),s=ie(e,a),c=ue((s===`invoke_agent`?oy(r.status,r):void 0)||t?.timestamp||r.updatedAt),l=ae(s,a,r),u=F(t,a,r,s),d=Math.max(0,qv(s,a,c-o)),f=Jv(o,c,d);return{activityId:N(e),attributes:a,depth:s===`invoke_agent`?0:1,description:I(a),durationMs:d,endMs:f,eventNames:n.map(e=>e.name),icon:L(s),id:`${i}:${e.sequence}`,name:l?`${s} ${l}`:s,operation:s,sequence:e.sequence,startMs:o,status:u}}function te(e,t){return e.name.startsWith(`agent.invocation.`)&&Gv(e.name)?iy(t.status):e.name===`agent.task.started`?[`agent.task.completed`,`agent.task.failed`,`agent.task.cancelled`]:e.name===`agent.approval.request`?[`agent.approval.decision`]:ry(e.name)}function M(e,t){let n=t.find(e=>e.name===`agent.invocation.start`),r=t.find(e=>e.name===`agent.invocation.finish`),i=ue(n?.timestamp||e.startedAt||e.createdAt),a=ue(oy(e.status,e)||r?.timestamp||e.updatedAt);return{activityId:n?N(n):e.id,attributes:{...n?.attributes,...r?.attributes},depth:0,durationMs:Math.max(0,ce(r?.attributes?.[`invocation.durationMs`])??a-i),endMs:a,eventNames:[n?.name,r?.name].filter(e=>!!e),icon:`i-lucide-bot`,id:se(n,`agent.invocation.id`)||e.id,name:`invoke_agent ${e.agentName||`agent`}`,operation:`invoke_agent`,sequence:n?.sequence??0,startMs:i,status:ay(e.status)}}function re(e){return Kv(e)}function N(e){let t=e.attributes??{},n=t[`message.id`];return String(t[`step.id`]??t[`tool.id`]??t[`approval.id`]??t[`model.call.id`]??(n?`${String(n)}:${String(t[`message.phase`]??`message`)}`:`observation:${e.sequence}`))}function ie(e,t){let n=t[`gen_ai.operation.name`];return typeof n==`string`&&n?n:e.name.startsWith(`agent.invocation.`)?`invoke_agent`:e.name.startsWith(`agent.tool.`)?`execute_tool`:e.name.startsWith(`agent.approval.`)?`tool_approval`:e.name.startsWith(`agent.task.`)?`run_task`:e.name.replace(/\.(start|started|finish|completed)$/,``)}function ae(e,t,n){if(e===`invoke_agent`)return n.agentName||`agent`;let r=e===`execute_tool`?[`gen_ai.tool.name`,`tool.name`]:e===`tool_approval`?[`approval.name`]:[`gen_ai.request.model`,`model.id`,`agent.name`];for(let e of r){let n=t[e];if(typeof n==`string`&&n)return n}}function F(e,t,n,r){if(Xv(r,t))return`failed`;if(r===`invoke_agent`)return ay(n.status);if(e?.name.endsWith(`.error`)||e?.name.endsWith(`.failed`))return`failed`;if(e?.name.endsWith(`.abort`)||e?.name.endsWith(`.cancel`)||e?.name.endsWith(`.cancelled`))return`cancelled`;if(!e)return`running`;let i=V(t[`tool.output`]),a=ce((V(i?.item)??i)?.exitCode);return a!==void 0&&a!==0||typeof t[`error.message`]==`string`?`failed`:`completed`}function I(e){let t=V(e[`tool.input`]),n=(V(t?.item)??t)?.command;if(typeof n==`string`)return _e(n,90);let r=e[`tool.path`];return typeof r==`string`?r:void 0}function L(e){return e===`invoke_agent`?`i-lucide-bot`:e===`chat`?`i-lucide-message-square-more`:e===`execute_tool`?`i-lucide-wrench`:e===`tool_approval`?`i-lucide-shield-check`:`i-lucide-layers-3`}function R(e){let t=Math.max(0,Math.min(100,(e.startMs-m.value)/_.value*100)),n=Math.max(0,Math.min(100-t,e.durationMs/_.value*100));return{left:`${t}%`,width:`max(3px, ${n}%)`}}function oe(e){return`${e.name} ${e.description||``} ${e.eventNames.join(` `)} ${ve(e.attributes)}`.toLowerCase()}function V(e){return e instanceof Object&&!Array.isArray(e)?Object.fromEntries(Object.entries(e)):void 0}function se(e,t){let n=e?.attributes?.[t];return typeof n==`string`?n:void 0}function ce(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function ue(e){let t=e instanceof Date?e.valueOf():Date.parse(e||``);return Number.isFinite(t)?t:Date.now()}function de(e){return e<1?`<1ms`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${me(e/1e3,e<1e4?2:1)}s`:pe(e)}function fe(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${me(e/1e3,1)}s`:pe(e)}function pe(e){let t=Math.round(e/1e3),n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function me(e,t){return e.toFixed(t).replace(/\.?0+$/,``)}function he(e){return e.replace(/^sha256_/,``).slice(0,16)}function ge(e){return e.replaceAll(`.`,` `).replaceAll(`_`,` `)}function _e(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1)}…`}function ve(e){try{return JSON.stringify(e)}catch{return String(e)}}function ye(e){if(typeof e==`string`)return JSON.stringify(e);if(e===void 0)return`undefined`;try{return JSON.stringify(e,null,2)}catch{return String(e)}}async function be(){let e=JSON.stringify(T.value,null,2);try{await navigator.clipboard.writeText(e)}catch{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove()}f.value=!0,window.setTimeout(()=>{f.value=!1},1500)}return(t,i)=>{let l=Be,u=le,p=Je,m=gr;return H(),S(m,{id:`session-trace-layout`,"auto-save-id":`vitehub-session-trace-layout`,items:b.value,orientation:`vertical`,ui:{handle:`h-1`},class:`session-trace`},{waterfall:r(()=>[w(`div`,dy,[w(`div`,fy,[P(l,{modelValue:s.value,"onUpdate:modelValue":i[0]||=e=>s.value=e,icon:`i-lucide-search`,placeholder:`Search spans`,size:`sm`,variant:`outline`,ui:{base:`w-full`}},null,8,[`modelValue`]),w(`span`,null,B(v.value.length)+` spans`,1)]),w(`div`,py,[w(`div`,my,[w(`div`,hy,[i[3]||=w(`strong`,null,`Name`,-1),w(`div`,gy,[(H(!0),g(x,null,a(k.value,e=>(H(),g(`span`,{key:e.position,style:ne({left:`${e.position*100}%`})},B(e.label),5))),128))])]),w(`div`,_y,[(H(!0),g(x,null,a(v.value,e=>(H(),g(`button`,{key:e.id,type:`button`,class:`session-trace__row`,"data-selected":y.value?.id===e.id,"data-status":e.status,onClick:t=>{d.value=e.id,o(`focusActivity`,e.activityId)}},[w(`span`,{class:`session-trace__name`,style:ne({paddingInlineStart:`${.75+e.depth*1.65}rem`})},[P(u,{name:e.icon},null,8,[`name`]),w(`span`,null,[w(`strong`,null,B(e.name),1),e.description?(H(),g(`small`,yy,B(e.description),1)):E(``,!0)])],4),w(`span`,by,[(H(!0),g(x,null,a(k.value,e=>(H(),g(`i`,{key:e.position,style:ne({left:`${e.position*100}%`})},null,4))),128)),w(`span`,{class:`session-trace__bar`,"data-wide":e.durationMs/_.value>.16,style:ne(R(e))},[w(`span`,null,B(de(e.durationMs)),1)],12,xy)])],8,vy))),128)),v.value.length===0?(H(),g(`div`,Sy,` No spans match this search. `)):E(``,!0)])])])])]),"resize-handle":r(()=>[...i[4]||=[w(`span`,{class:`pointer-events-none absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-(--ui-border) transition-colors group-hover:bg-primary group-focus-visible:bg-primary`},null,-1)]]),detail:r(()=>[y.value?(H(),g(`aside`,{key:0,class:`session-trace__detail`,"data-wrap":O(n)},[w(`header`,wy,[w(`strong`,null,[w(`i`,{"data-status":y.value.status},null,8,Ty),z(`Span `+B(he(y.value.id)),1)]),P(p,{icon:`i-lucide-wrap-text`,label:`Wrap`,color:`neutral`,variant:O(n)?`soft`:`ghost`,size:`xs`,"aria-label":`Wrap lines`,"aria-pressed":O(n),onClick:i[1]||=e=>n.value=!O(n)},null,8,[`variant`,`aria-pressed`]),w(`button`,{type:`button`,onClick:be},[P(u,{name:f.value?`i-lucide-check`:`i-lucide-copy`},null,8,[`name`]),z(B(f.value?`Copied`:`Copy attributes`),1)])]),w(`section`,Ey,[w(`span`,null,B(y.value.operation.replaceAll(`_`,` `))+` · `+B(y.value.status),1),w(`h3`,null,[P(u,{name:y.value.icon},null,8,[`name`]),z(B(y.value.name),1)]),w(`dl`,null,[w(`div`,null,[i[5]||=w(`dt`,null,`Duration`,-1),w(`dd`,null,B(de(y.value.durationMs)),1)]),w(`div`,null,[i[6]||=w(`dt`,null,`Trace ID`,-1),w(`dd`,null,[w(`code`,null,B(he(e.invocation.traceId)),1)])]),w(`div`,null,[i[7]||=w(`dt`,null,`Span ID`,-1),w(`dd`,null,[w(`code`,null,B(he(y.value.id)),1)])])])]),w(`div`,Dy,[P(l,{modelValue:c.value,"onUpdate:modelValue":i[2]||=e=>c.value=e,icon:`i-lucide-search`,placeholder:`Search fields…`,size:`sm`,variant:`outline`},null,8,[`modelValue`])]),w(`div`,Oy,[(H(!0),g(x,null,a(D.value,([e,t])=>(H(),g(`section`,{key:e},[w(`span`,null,B(e),1),w(`pre`,null,B(ye(t)),1)]))),128)),D.value.length===0?(H(),g(`div`,ky,` No fields match this search. `)):E(``,!0)])],8,Cy)):E(``,!0)]),_:1},8,[`items`])}}});function jy(e,t,n){return e.path===t&&(!n||e.revision===n.revision)}var My={class:`session-inspector`},Ny={class:`session-inspector__header`},Py=[`data-active`],Fy={class:`truncate`},Iy=[`aria-label`,`onClick`],Ly={class:`session-inspector__actions`},Ry={key:0,class:`session-inspector__empty border-0`},zy={class:`session-inspector__surface-launcher`},By=[`onClick`],Vy={key:4,class:`session-inspector__diff`},Hy={class:`session-inspector__diff-toolbar`},Uy={class:`session-inspector__eyebrow`},Wy={key:0,class:`session-inspector__diff-turns`,"aria-label":`Diff turns`},Gy=[`onClick`],Ky={key:2,class:`session-inspector__diff-list`},qy={class:`session-inspector__diff-select`},Jy=[`value`],Yy={key:5,class:`session-inspector__workspace`},Xy={class:`session-inspector__breadcrumbs`},Zy={class:`session-inspector__repository`},Qy=[`data-current`],$y={class:`session-inspector__workspace-actions`},eb={key:0,class:`session-inspector__state`},tb=[`data-tree-open`],nb={class:`session-inspector__file`},rb={key:0,class:`session-inspector__snapshot`},ib={class:`session-inspector__eyebrow`},ab={key:0},ob={key:0},sb={key:1,class:`session-inspector__state`},cb={key:2,class:`session-inspector__state text-error`},lb={key:4,class:`session-inspector__state`},ub={key:3,class:`session-inspector__file-status`},db=[`title`],fb={key:1},pb={key:2},mb={key:0},hb=j({__name:`console-session-inspector`,props:ee({invocation:{},maximized:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!0},workspaceBase:{}},{tab:{default:`details`},tabModifiers:{},activeSurface:{default:``},activeSurfaceModifiers:{},openViews:{default:()=>[]},openViewsModifiers:{},openPaths:{default:()=>[]},openPathsModifiers:{},selectedPath:{},selectedPathModifiers:{}}),emits:ee([`close`,`focusActivity`,`toggleMaximized`],[`update:tab`,`update:activeSurface`,`update:openViews`,`update:openPaths`,`update:selectedPath`]),setup(e,{emit:t}){let i=I(()=>Xe(()=>import(`./file-tree-2PXztdQ7.js`).then(e=>e.FileTree),__vite__mapDeps([47,2,3]),import.meta.url)),o=I(()=>Xe(()=>import(`./patch-diff-CD7Eu2gO.js`).then(e=>e.PatchDiff),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),s=e,d=t,f=m(e,`tab`),p=m(e,`activeSurface`),h=m(e,`openViews`),_=m(e,`openPaths`),v=m(e,`selectedPath`),y=C(),T=C(),k=C(!1),A=C(),ee=C(),j=C(!1),te={details:{description:`Review the run, runtime, and identifiers.`,icon:`i-lucide-circle-dot`,label:`Invocation`},capabilities:{description:`Inspect capabilities, servers, and tool contracts.`,icon:`i-lucide-blocks`,label:`Capabilities`},trace:{description:`Follow spans, timings, and recorded attributes.`,icon:`i-lucide-list-tree`,label:`Trace`},workspace:{description:`Browse the mounted Agent workspace.`,icon:`i-lucide-folder-tree`,label:`Workspace`},diff:{description:`Review code changes from this run or its pull request.`,icon:`i-lucide-git-compare-arrows`,label:`Diff`}},ne=u(()=>[`details`,`capabilities`,`trace`,...s.workspaceBase?[`workspace`]:[],...M.value.length?[`diff`]:[]]),M=u(()=>th(s.invocation).filter(e=>e.patches.length).map(e=>({id:e.id,patches:e.patches,sequence:e.sequence}))),N=C([]),ie=C(`all`),ae=u(()=>M.value.length>0&&N.value.length===M.value.length);function F(){N.value=ae.value?[]:M.value.map((e,t)=>t)}l(()=>s.invocation.id,()=>{N.value=[],ie.value=`all`}),l(M,(e,t)=>{if(!t||e.length!==t.length||e.some((e,n)=>e.id!==t[n]?.id)){N.value=[],ie.value=`all`;return}N.value=N.value.filter(t=>t<e.length),ie.value!==`all`&&ie.value>=e.length&&(ie.value=`all`)});let R=C(!0),oe=Vv(),V=C(),se=C(),ue,fe,pe;D(()=>{ue?.abort(),pe?.abort()});let me=u(()=>y.value?[`current`,`live`].includes(y.value.revision)?`${y.value.repository} · Live workspace`:`${y.value.repository}@${y.value.revision.slice(0,7)}`:`Agent Workspace`),he=u(()=>s.invocation.configuration?.workspace?.sources?.map(e=>e instanceof Object?e.id:e).join(` · `)),ge=u(()=>v.value?.split(`/`)??[]),_e=u(()=>[...h.value.filter(e=>ne.value.includes(e)).map(e=>({icon:te[e].icon,kind:`view`,label:te[e].label,value:`view:${e}`,view:e})),..._.value.map(e=>({icon:`i-lucide-file-code-2`,kind:`file`,label:Me(e),path:e,value:`file:${e}`}))]),ve=u(()=>_e.value.some(e=>String(e.value)===p.value)),ye=u(()=>ne.value.map(e=>({icon:te[e].icon,label:te[e].label,onSelect:()=>Ce(e)}))),be=u(()=>({density:`compact`,onSelectionChange(e){let t=e.findLast(e=>y.value?.paths.includes(e));t&&(v.value=t)},search:!0,unsafeCSS:`
|
|
77
|
+
[data-file-tree-search-container] {
|
|
78
|
+
padding-top: var(--trees-item-row-gap);
|
|
79
|
+
}
|
|
80
|
+
[data-file-tree-search-input] {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
width: 100%;
|
|
84
|
+
}
|
|
85
|
+
`}));l([()=>s.invocation.id,()=>s.workspaceBase],()=>{ue?.abort(),ue=void 0,fe=void 0,k.value=!1,pe?.abort(),pe=void 0,y.value=void 0,T.value=void 0,A.value=void 0,ee.value=void 0,j.value=!1,s.workspaceBase||(h.value=h.value.filter(e=>e!==`workspace`),_.value=[],v.value=void 0,f.value===`workspace`&&(f.value=`details`),(p.value===`view:workspace`||p.value.startsWith(`file:`))&&(p.value=`view:details`)),v.value?Fe(v.value):f.value===`workspace`&&Ne()},{immediate:!0}),l(f,e=>{p.value&&(h.value.includes(e)||(h.value=[...h.value,e]),e===`workspace`&&!v.value&&!y.value&&!k.value&&Ne())}),l(v,e=>{e&&(_.value.includes(e)||(_.value=[..._.value,e]),f.value=`workspace`,p.value=`file:${e}`,Fe(e))}),l(_e,e=>{if(e.some(e=>String(e.value)===p.value))return;let t=e.at(-1)?.value;t===void 0?(p.value=``,v.value=void 0):Oe(t)},{flush:`post`}),l(p,async()=>{await re();let e=V.value?.querySelector(`.session-inspector__tabs`),t=e?.querySelector(`[data-state="active"]`);if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.left<n.left?e.scrollLeft-=n.left-r.left:r.right>n.right&&(e.scrollLeft+=r.right-n.right)});async function Se(){await re(),V.value?.querySelector(`[role="tab"][data-state="active"]`)?.focus()}function Ce(e){(e!==`workspace`||s.workspaceBase)&&(h.value.includes(e)||(h.value=[...h.value,e]),f.value=e,p.value=`view:${e}`,e===`workspace`&&(pe?.abort(),v.value=void 0,A.value=void 0,ee.value=void 0,j.value=!1,!y.value&&!k.value&&Ne()))}function we(e){f.value=`workspace`,v.value=e,p.value=`file:${e}`}async function Te(){let e=s.invocation.id;Ce(`workspace`),y.value||await Ne(),s.invocation.id===e&&y.value?.paths.includes(`AGENTS.md`)&&we(`AGENTS.md`)}function Ee(e){let t=_.value.indexOf(e);if(t===-1)return;let n=p.value===`file:${e}`;if(_.value=_.value.filter(t=>t!==e),v.value!==e)return;if(!n){v.value=void 0,pe?.abort(),A.value=void 0,ee.value=void 0;return}let r=_.value[t]??_.value[t-1];v.value=r;let i=_e.value.at(-1)?.value;p.value=r?`file:${r}`:h.value.includes(`workspace`)?`view:workspace`:i===void 0?``:String(i),r||(pe?.abort(),A.value=void 0,ee.value=void 0)}function Oe(e){let t=String(e);if(t.startsWith(`file:`))we(t.slice(5));else if(t.startsWith(`view:`)){let e=t.slice(5);(e===`details`||e===`trace`||e===`workspace`||e===`capabilities`||e===`diff`)&&Ce(e)}}function ke(e){let t=_e.value.length===1,n=e.value===void 0?``:String(e.value),r=_e.value.findIndex(e=>String(e.value)===n),i=p.value===n||e.kind===`view`&&e.view===f.value&&!v.value||e.kind===`file`&&e.path===v.value;if(e.kind===`file`&&e.path){Ee(e.path),t&&d(`close`);return}if(e.kind===`view`&&e.view&&(h.value=h.value.filter(t=>t!==e.view)),!i)return;let a=_e.value[r]??_e.value[r-1];a?.value?Oe(a.value):(p.value=``,v.value=void 0),t&&d(`close`)}function Me(e){return e.split(`/`).at(-1)||e}async function Ne(){if(fe)return fe;let e=Pe();fe=e;try{await e}finally{fe===e&&(fe=void 0)}}async function Pe(){if(!s.workspaceBase)return;ue?.abort();let e=new AbortController;ue=e,k.value=!0,T.value=void 0;try{let t=Le(await Ie(`${s.workspaceBase}/${encodeURIComponent(s.invocation.id)}/workspace`,e.signal));if(ue!==e)return;y.value=t,v.value&&Fe(v.value)}catch(t){e.signal.aborted||(T.value=t)}finally{ue===e&&(ue=void 0,k.value=!1)}}async function Fe(e){if(!s.workspaceBase)return;pe?.abort();let t=new AbortController;pe=t,j.value=!0,ee.value=void 0,A.value=void 0;try{let n=Re(await Ie(`${s.workspaceBase}/${encodeURIComponent(s.invocation.id)}/workspace?path=${encodeURIComponent(e)}`,t.signal));if(!jy(n,e,y.value))throw de.VITE_HUB_R0107({message:`The host returned a Workspace file for a different path or revision.`});if(pe!==t||v.value!==e)return;A.value=n}catch(e){!t.signal.aborted&&pe===t&&(ee.value=He(e))}finally{pe===t&&(pe=void 0,j.value=!1)}}async function Ie(e,t){return xe(e,{signal:t})}function Le(e){let t=ze(e),n=t?.paths,r=Array.isArray(n)?n.map(Be):void 0,i=t!==void 0&&`pullRequest`in t,a=Ve(t?.pullRequest),o=Be(t?.repository),s=Be(t?.revision);if(!r||r.some(e=>e===void 0)||i&&(a===void 0||!Number.isInteger(a))||!o||!s)throw de.VITE_HUB_R0108({message:`The host returned an invalid Workspace descriptor.`});let c={paths:r.filter(e=>e!==void 0),repository:o,revision:s};return a!==void 0&&(c.pullRequest=a),c}function Re(e){let t=ze(e),n=Be(t?.content),r=Be(t?.path),i=Be(t?.revision),a=Ve(t?.size),o=Be(ze(t?.provenance)?.source);if(n===void 0||!r||!i||a===void 0)throw de.VITE_HUB_R0109({message:`The host returned an invalid Workspace file.`});let s={content:n,path:r,revision:i,size:a};return o&&(s.provenance={source:o}),s}function ze(e){return e instanceof Object&&!Array.isArray(e)?Object.fromEntries(Object.entries(e)):void 0}function Be(e){return typeof e==`string`?e:void 0}function Ve(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function He(e){return e instanceof Error?e.message:`This session data is unavailable.`}return(t,l)=>{let u=le,m=Je,h=je,_=Ae,C=pt;return H(),g(`aside`,My,[w(`header`,Ny,[w(`div`,{ref_key:`tabstrip`,ref:V,class:`session-inspector__tabstrip`},[_e.value.length?(H(),S(O(ot),{key:0,"model-value":p.value,class:`session-inspector__tabs`,orientation:`horizontal`,"onUpdate:modelValue":Oe},{default:r(()=>[P(O(st),{"data-slot":`list`},{default:r(()=>[(H(!0),g(x,null,a(_e.value,e=>(H(),g(`div`,{key:String(e.value),class:`session-inspector__tab`,"data-active":p.value===String(e.value)},[P(O(lt),{value:String(e.value),"data-slot":`trigger`,class:`group/tab h-6 max-w-36 shrink-0 grow-0 cursor-pointer justify-start gap-0.5 rounded-md px-1.5 py-0 text-xs`},{default:r(()=>[P(u,{name:e.icon,class:`session-inspector__surface-icon`,"aria-hidden":`true`},null,8,[`name`]),w(`span`,Fy,B(e.label),1)]),_:2},1032,[`value`]),w(`button`,{type:`button`,class:`session-inspector__tab-close`,"aria-label":`Close ${e.label}`,onClick:c(t=>{ke(e),Se()},[`stop`])},[P(u,{name:`i-lucide-x`,class:`session-inspector__surface-close`,"aria-hidden":`true`})],8,Iy)],8,Py))),128))]),_:1})]),_:1},8,[`model-value`])):E(``,!0),P(h,{items:ye.value,content:{align:`start`,side:`bottom`,sideOffset:6},size:`sm`,ui:{content:`session-inspector__launcher-menu w-44 rounded-lg p-1 shadow-[0_16px_40px_-18px_rgb(0_0_0/35%)] ring-1 ring-default`,viewport:`gap-0`,item:`session-inspector__launcher-item min-h-7 gap-2 rounded-sm px-2 py-1`,itemLeadingIcon:`size-4 shrink-0 text-muted`,itemWrapper:`min-w-0 flex-1`,itemLabel:`truncate text-sm`,itemTrailing:`ms-auto`,itemTrailingKbds:`ms-auto`}},{default:r(()=>[P(m,{class:`session-inspector__icon-button`,icon:`i-lucide-plus`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`Open tab`})]),_:1},8,[`items`])],512),w(`div`,Ly,[s.maximizable?(H(),S(_,{key:0,text:s.maximized?`Restore panel size`:`Maximize panel`},{default:r(()=>[P(m,{class:`session-inspector__icon-button`,"data-slot":`session-inspector-maximize`,icon:s.maximized?`i-lucide-minimize-2`:`i-lucide-maximize-2`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":s.maximized?`Restore panel size`:`Maximize panel`,"aria-pressed":s.maximized,onClick:l[0]||=e=>d(`toggleMaximized`)},null,8,[`icon`,`aria-label`,`aria-pressed`])]),_:1},8,[`text`])):E(``,!0),P(_,{text:`Toggle right panel`},{default:r(()=>[P(m,{class:`session-inspector__icon-button`,icon:`i-lucide-panel-right`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`Toggle right panel`,"aria-pressed":`true`,onClick:l[1]||=e=>d(`close`)})]),_:1})])]),ve.value?f.value===`capabilities`?(H(),S(O(vh),{key:1,invocation:e.invocation,onSelectActivity:l[2]||=e=>d(`focusActivity`,e)},null,8,[`invocation`])):f.value===`details`?(H(),S(O(m_),{key:2,invocation:e.invocation,"show-error":!1,"show-sources":!y.value||!!T.value,"show-status":!1,"show-timeline":!1,class:`session-inspector__details`,onSelectActivity:l[3]||=e=>d(`focusActivity`,e)},{identityActions:r(()=>[s.workspaceBase?(H(),g(`button`,{key:0,class:`session-inspector__instructions-link`,type:`button`,onClick:Te},[P(u,{name:`i-lucide-file-text`}),l[10]||=z(`Instructions `,-1)])):E(``,!0)]),_:1},8,[`invocation`,`show-sources`])):f.value===`trace`?(H(),S(Ay,{key:3,invocation:e.invocation,onFocusActivity:l[4]||=e=>d(`focusActivity`,e)},null,8,[`invocation`])):f.value===`diff`?(H(),g(`div`,Vy,[w(`div`,Hy,[w(`div`,null,[l[11]||=w(`strong`,null,`Code changes`,-1),w(`span`,Uy,B(M.value.length)+` turn`+B(M.value.length===1?``:`s`),1)]),P(m,{size:`xs`,color:`neutral`,variant:`outline`,disabled:!M.value.length,onClick:F},{default:r(()=>[z(B(ae.value?`Clear selection`:`Select all`),1)]),_:1},8,[`disabled`])]),M.value.length>1?(H(),g(`nav`,Wy,[w(`button`,{type:`button`,class:L({"is-active":ie.value===`all`}),onClick:l[5]||=e=>ie.value=`all`},`All changes`,2),(H(!0),g(x,null,a(M.value,(e,t)=>(H(),g(`button`,{key:t,type:`button`,class:L({"is-active":ie.value===t}),onClick:e=>ie.value=t},`Turn `+B(t+1),11,Gy))),128))])):E(``,!0),M.value.length?(H(),g(`div`,Ky,[(H(!0),g(x,null,a(M.value,(e,t)=>b((H(),g(`section`,{key:e.id,class:`session-inspector__diff-turn`},[w(`label`,qy,[b(w(`input`,{"onUpdate:modelValue":l[6]||=e=>N.value=e,type:`checkbox`,value:t},null,8,Jy),[[ce,N.value]]),w(`span`,null,`Turn `+B(t+1),1)]),(H(!0),g(x,null,a(e.patches,(e,t)=>(H(),S(O(o),{key:t,patch:e,class:`session-inspector__patch`},null,8,[`patch`]))),128))])),[[n,ie.value===`all`||ie.value===t]])),128))])):(H(),S(C,{key:1,icon:`i-lucide-git-compare-arrows`,title:`No code changes`,description:`Changes made during this run will appear here.`}))])):(H(),g(`div`,Yy,[w(`div`,Xy,[w(`span`,Zy,B(y.value?.repository||`Workspace`),1),(H(!0),g(x,null,a(ge.value,(e,t)=>(H(),g(x,{key:`${e}-${t}`},[P(u,{name:`i-lucide-chevron-right`}),w(`span`,{"data-current":t===ge.value.length-1},B(e),9,Qy)],64))),128)),w(`div`,$y,[P(_,{text:O(oe)?`Disable line wrap`:`Enable line wrap`},{default:r(()=>[P(m,{icon:`i-lucide-wrap-text`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":O(oe)?`Disable line wrap`:`Enable line wrap`,"aria-pressed":O(oe),onClick:l[7]||=e=>oe.value=!O(oe)},null,8,[`aria-label`,`aria-pressed`])]),_:1},8,[`text`]),P(_,{text:`Reload Workspace`},{default:r(()=>[P(m,{icon:`i-lucide-rotate-cw`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`Reload Workspace`,onClick:Ne})]),_:1}),y.value?(H(),S(_,{key:0,text:R.value?`Hide file tree`:`Show file tree`},{default:r(()=>[P(m,{icon:`i-lucide-folder-tree`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":R.value?`Hide file tree`:`Show file tree`,"aria-pressed":R.value,onClick:l[8]||=e=>R.value=!R.value},null,8,[`aria-label`,`aria-pressed`])]),_:1},8,[`text`])):E(``,!0)])]),k.value&&!v.value?(H(),g(`div`,eb,[P(u,{name:`i-lucide-loader-circle`,class:`animate-spin`}),l[12]||=z(`Loading Workspace… `,-1)])):T.value&&!v.value?(H(),S(De,{key:1,error:T.value,title:`Workspace unavailable`,retry:Ne},null,8,[`error`])):y.value||v.value?(H(),g(`div`,{key:2,class:`session-inspector__workspace-body`,"data-tree-open":R.value&&!!y.value},[w(`div`,nb,[!v.value&&y.value?(H(),g(`div`,rb,[P(u,{name:`i-lucide-folder-git-2`}),w(`span`,ib,B([`current`,`live`].includes(y.value.revision)?`Live workspace`:`Immutable snapshot`),1),w(`strong`,null,B(me.value),1),w(`small`,null,[z(B(y.value.paths.length)+` files`,1),y.value.pullRequest===void 0?E(``,!0):(H(),g(`span`,ab,` · PR #`+B(y.value.pullRequest),1))]),he.value?(H(),g(`small`,ob,`Recorded sources · `+B(he.value),1)):E(``,!0)])):E(``,!0),j.value?(H(),g(`div`,sb,[P(u,{name:`i-lucide-loader-circle`,class:`animate-spin`}),l[13]||=z(`Loading file… `,-1)])):ee.value?(H(),g(`div`,cb,[P(u,{name:`i-lucide-file-warning`}),z(B(ee.value),1)])):v.value&&A.value?(H(),S(zv,{key:3,content:A.value.content,path:A.value.path,wrap:O(oe)},null,8,[`content`,`path`,`wrap`])):v.value?(H(),g(`div`,lb,[P(u,{name:`i-lucide-mouse-pointer-2`}),l[14]||=z(`Select a file to preview it. `,-1)])):E(``,!0)]),R.value&&y.value?(H(),g(`aside`,{key:0,ref_key:`filesPanel`,ref:se,class:`session-inspector__files`},[P(O(i),{class:`session-inspector__tree`,paths:y.value.paths,options:be.value},null,8,[`paths`,`options`])],512)):E(``,!0)],8,tb)):E(``,!0),y.value||A.value?(H(),g(`footer`,ub,[y.value?(H(),g(`span`,{key:0,title:y.value.revision===`current`?`Files currently mounted on this host; not a snapshot of this run.`:y.value.revision},B(y.value.revision===`current`?`Current mounted files`:y.value.revision),9,db)):A.value?(H(),g(`span`,fb,B(A.value.revision===`current`?`Current mounted file`:A.value.revision),1)):E(``,!0),A.value?.provenance?(H(),g(`span`,pb,`From `+B(A.value.provenance.source),1)):E(``,!0),w(`span`,null,[y.value?(H(),g(x,{key:0},[z(B(y.value.paths.length)+` files`,1),A.value?(H(),g(`span`,mb,` · `)):E(``,!0)],64)):E(``,!0),A.value?(H(),g(x,{key:1},[z(B(O(ht)(A.value.size)),1)],64)):E(``,!0)])])):E(``,!0)])):(H(),g(`div`,Ry,[l[9]||=w(`div`,{class:`session-inspector__empty-copy`},[w(`strong`,null,`Open a tab`),w(`span`,null,`Choose what to inspect in this Agent Invocation.`)],-1),w(`div`,zy,[(H(!0),g(x,null,a(ne.value,e=>(H(),g(`button`,{key:e,type:`button`,onClick:t=>{Ce(e),Se()}},[w(`span`,null,[P(u,{name:te[e].icon},null,8,[`name`]),z(B(te[e].label),1)]),w(`small`,null,B(te[e].description),1)],8,By))),128))])]))])}}}),gb=e=>`color-mix(in oklab, var(--ui-text-highlighted) ${e}%, var(--ui-bg))`,_b={cacheRead:gb(28),cacheWrite:gb(76),input:gb(50),output:gb(100)};function vb(e){return Number(e.costUsd)||0}function yb(e,t){return t===`cost`?vb(e):e.totalTokens}function bb(e,t){let n=t===`cost`?`tokens`:`cost`;return e.toSorted((e,r)=>yb(r,t)-yb(e,t)||yb(r,n)-yb(e,n)||e.model.localeCompare(r.model))}function xb(e,t,n){if(n===`tokens`)return t.totalTokens<=0||!e.totalTokensAvailable&&e.totalTokens===0?null:e.totalTokens/t.totalTokens;let r=vb(t);return!t.costAvailable||e.pricedInvocations===0||r<=0?null:vb(e)/r}function Sb(e){return e.totalTokensAvailable&&e.inputTokens+e.outputTokens!==e.totalTokens?{complete:!1,segments:[]}:{complete:e.inputTokensAvailable&&e.outputTokensAvailable&&e.cachedInputTokensAvailable&&e.cacheWriteTokensAvailable,segments:[{color:_b.input,key:`input`,label:`Input`,value:Math.max(0,e.inputTokens-e.cachedInputTokens-e.cacheWriteTokens)},{color:_b.cacheRead,key:`cacheRead`,label:`Cache read`,value:e.cachedInputTokens},{color:_b.cacheWrite,key:`cacheWrite`,label:`Cache write`,value:e.cacheWriteTokens},{color:_b.output,key:`output`,label:`Output`,value:e.outputTokens}]}}function Cb(e){return!e.inputTokensAvailable||!e.cachedInputTokensAvailable||e.totalTokensAvailable&&e.inputTokens+e.outputTokens!==e.totalTokens?null:e.inputTokens>0?e.cachedInputTokens/e.inputTokens:null}function wb(e){return!e.costAvailable||!e.totalTokensAvailable||e.pricedInvocations===0||e.totalTokens<=0?null:vb(e)/e.totalTokens*1e6}function Tb(e){if(e===null)return`—`;let t=e*100;return t>0&&t<.1?`<0.1%`:`${t.toFixed(1)}%`}function Eb(e){return new Intl.NumberFormat(`en`,{maximumFractionDigits:1,notation:e>=1e4?`compact`:`standard`}).format(e)}function Db(e,t=!1){let n=Number(e)||0;if(n>0&&n<.01&&/^0\.\d+$/.test(e))return`${t?`~`:``}$${e}`;let r=new Intl.NumberFormat(`en`,{currency:`USD`,maximumFractionDigits:2,minimumFractionDigits:2,style:`currency`}).format(n);return t?`~${r}`:r}function Ob(e,t){if(!t&&e===0)return`Unavailable`;let n=Eb(e);return t?n:`${n} recorded`}function kb(e,t,n){if(!n&&(Number(e)||0)===0)return`Unavailable`;let r=Db(e,t);return n?r:`${r} recorded`}function Ab(e,t){return new Intl.DateTimeFormat(`en`,t===`hour`?{day:`numeric`,hour:`numeric`,month:`short`,timeZone:`UTC`}:{day:`numeric`,month:`short`,timeZone:`UTC`}).format(new Date(e))}function jb(e,t){return t===`cost`?kb(e.costUsd,e.costEstimated,e.costAvailable):Ob(e.totalTokens,e.totalTokensAvailable)}function Mb(e,t,n,r){return{display:jb(t,n),evidence:Fb(t,n),period:Ab(e,r),start:e,value:yb(t,n)}}function Nb(e,t,n,r){return e.map(e=>Mb(e.start,e.models.find(e=>e.model===t)??{costAvailable:e.costAvailable,costEstimated:!1,costUsd:`0`,totalTokens:0,totalTokensAvailable:e.totalTokensAvailable},n,r))}function Pb(e,t=4){if(!(e>0)||!Number.isFinite(e))return[0];let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r,a=(i<=1?1:i<=2?2:i<=5?5:10)*r,o=Math.max(0,-Math.floor(Math.log10(a)));return Array.from({length:Math.ceil(e/a-1e-9)+1},(e,t)=>Number((t*a).toFixed(o)))}function Fb(e,t){return(t===`cost`?e.costAvailable:e.totalTokensAvailable)?`complete`:yb(e,t)>0?`partial`:`unavailable`}function Ib(e){return e.some(e=>e.value>0)?`data`:e.some(e=>e.evidence===`unavailable`)?`unavailable`:`zero`}function Lb(e,t){let n=[`${t.from} to ${t.to} UTC, ${e.length} ${e.length===1?`period`:`periods`}.`],r=e.reduce((e,t)=>t.value>(e?.value??0)?t:e,void 0);r&&n.push(`Peak ${r.display} on ${r.period}.`);let i=e.filter(e=>e.evidence===`unavailable`).length,a=e.filter(e=>e.evidence===`partial`).length;return i&&n.push(`${i} ${i===1?`period has`:`periods have`} no evidence.`),a&&n.push(`${a} ${a===1?`period has`:`periods have`} partial evidence.`),n.join(` `)}function Rb(e,t){let n={day:`numeric`,hour:`numeric`,minute:`2-digit`,month:`short`};return t&&(n.timeZone=t),new Intl.DateTimeFormat(`en`,n).format(new Date(e))}function zb(e,t){let n={dateStyle:`full`,timeStyle:`long`};return t&&(n.timeZone=t),new Intl.DateTimeFormat(`en`,n).format(new Date(e))}var Bb={key:0,class:`relative h-40 pb-6 pl-14`},Vb={class:`absolute top-0 bottom-6 left-0 w-12 text-right text-xs tabular-nums text-muted`,"aria-hidden":`true`},Hb=[`viewBox`],Ub=[`y1`,`y2`],Wb=[`d`,`fill`],Gb=[`d`],Kb=[`cx`,`cy`],qb=[`cx`,`cy`],Jb={class:`block text-muted`},Yb={class:`block font-medium tabular-nums text-highlighted`},Xb={class:`absolute top-full left-0 mt-2 text-xs text-muted`,"aria-hidden":`true`},Zb={class:`absolute top-full right-0 mt-2 text-xs text-muted`,"aria-hidden":`true`},Qb=[`data-state`],$b={class:`text-xs text-muted`},ex={key:2,class:`group mt-3 text-xs`,"data-slot":`usage-chart-data`},tx={class:`inline-flex cursor-pointer items-center gap-1 rounded-sm text-muted select-none hover:text-highlighted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},nx={class:`mt-2 max-h-64 overflow-y-auto rounded-md border border-default`},rx={class:`w-full text-xs`},ix={class:`sr-only`},ax={class:`sticky top-0 bg-default text-left text-muted`},ox={class:`px-3 py-2 text-right font-medium`,scope:`col`},sx={class:`px-3 py-1.5 text-left font-normal`,scope:`row`},cx=1e3,lx=220,ux=j({__name:`console-usage-chart`,props:{empty:{},format:{type:Function},from:{},points:{},title:{},to:{},unavailable:{},valueLabel:{}},setup(e){let t=e,n=f(),r=`usage-area-${n}`,o=`usage-chart-title-${n}`,s=`usage-chart-description-${n}`,c=u(()=>Ib(t.points)),l=u(()=>Lb(t.points,t)),d=u(()=>Pb(Math.max(0,...t.points.map(e=>e.value)))),p=u(()=>d.value.at(-1)??0);function m(e){return p.value===0?lx:lx-e/p.value*lx}function h(e){return`${p.value===0?100:100-e/p.value*100}%`}let _=u(()=>t.points.map((e,n)=>({...e,x:t.points.length===1?cx/2:n/(t.points.length-1)*cx,y:m(e.value)}))),v=u(()=>{let e=[],t=[];for(let n of _.value)n.evidence===`unavailable`?(t.length&&e.push(t),t=[]):t.push(n);return t.length&&e.push(t),e.map(e=>{let t=e.map((e,t)=>`${t?`L`:`M`}${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `);return{area:`${t} L${e.at(-1).x.toFixed(2)},${lx} L${e[0].x.toFixed(2)},${lx} Z`,line:t,single:e.length===1?e[0]:void 0}})}),y=u(()=>_.value.filter(e=>e.evidence===`partial`)),b=C(),S=u(()=>b.value===void 0?void 0:_.value[b.value]);function T(e){let t=e.currentTarget;if(!(t instanceof HTMLElement)||!_.value.length)return;let n=t.getBoundingClientRect(),r=Math.min(1,Math.max(0,(e.clientX-n.left)/n.width));b.value=Math.round(r*(_.value.length-1))}return(t,n)=>{let u=le;return H(),g(`div`,null,[c.value===`data`?(H(),g(`div`,Bb,[w(`div`,Vb,[(H(!0),g(x,null,a(d.value,t=>(H(),g(`span`,{key:t,class:`absolute right-0 -translate-y-1/2`,style:ne({top:h(t)})},B(e.format(t)),5))),128))]),w(`div`,{class:`relative h-full border-b border-default`,onPointermove:T,onPointerleave:n[0]||=e=>b.value=void 0},[(H(),g(`svg`,{class:`absolute inset-0 size-full overflow-visible`,viewBox:`0 0 ${cx} ${lx}`,preserveAspectRatio:`none`,role:`img`,"aria-labelledby":o,"aria-describedby":s,"data-slot":`usage-chart`},[w(`title`,{id:o},B(e.title),1),w(`desc`,{id:s},B(l.value),1),w(`defs`,null,[w(`linearGradient`,{id:r,x1:`0`,y1:`0`,x2:`0`,y2:`1`},[...n[1]||=[w(`stop`,{offset:`0%`,"stop-color":`currentColor`,"stop-opacity":`0.22`},null,-1),w(`stop`,{offset:`100%`,"stop-color":`currentColor`,"stop-opacity":`0.02`},null,-1)]])]),(H(!0),g(x,null,a(d.value,e=>(H(),g(`line`,{key:`grid-${e}`,x1:`0`,y1:m(e),x2:cx,y2:m(e),"vector-effect":`non-scaling-stroke`,class:`stroke-default`,"stroke-width":`1`,"stroke-dasharray":`3 4`},null,8,Ub))),128)),(H(!0),g(x,null,a(v.value,(e,t)=>(H(),g(x,{key:t},[w(`path`,{d:e.area,fill:`url(#${r})`,class:`text-primary`},null,8,Wb),w(`path`,{d:e.line,fill:`none`,class:`stroke-primary`,"stroke-width":`2`,"vector-effect":`non-scaling-stroke`},null,8,Gb),e.single?(H(),g(`circle`,{key:0,cx:e.single.x,cy:e.single.y,r:`3`,class:`fill-primary`,"vector-effect":`non-scaling-stroke`},null,8,Kb)):E(``,!0)],64))),128)),(H(!0),g(x,null,a(y.value,e=>(H(),g(`circle`,{key:`partial-${e.start}`,cx:e.x,cy:e.y,r:`4`,class:`fill-warning stroke-default`,"stroke-width":`2`,"vector-effect":`non-scaling-stroke`},null,8,qb))),128))],8,Hb)),S.value?(H(),g(`div`,{key:0,class:`pointer-events-none absolute inset-y-0 w-px bg-(--ui-border-accented)`,style:ne({left:`${S.value.x/cx*100}%`}),"aria-hidden":`true`},[w(`div`,{class:L([`absolute top-0 w-max max-w-48 rounded-md border border-default bg-default px-2 py-1 text-xs shadow-sm`,S.value.x>cx/2?`right-2`:`left-2`])},[w(`span`,Jb,B(S.value.period),1),w(`span`,Yb,B(S.value.display),1)],2)],4)):E(``,!0),w(`span`,Xb,B(e.from),1),w(`span`,Zb,B(e.to)+` UTC`,1)],32)])):(H(),g(`div`,{key:1,class:`grid h-40 place-content-center justify-items-center gap-2 rounded-md border border-dashed border-default px-4 text-center`,"data-state":c.value,"data-slot":`usage-chart-empty`},[w(`p`,{class:L([`text-sm font-medium`,c.value===`unavailable`?`text-highlighted`:`text-muted`])},B(c.value===`unavailable`?e.unavailable:e.empty),3),w(`p`,$b,B(e.from)+` to `+B(e.to)+` UTC`,1),c.value===`unavailable`?i(t.$slots,`unavailable`,{},void 0,void 0,0):E(``,!0)],8,Qb)),e.points.length?(H(),g(`details`,ex,[w(`summary`,tx,[P(u,{name:`i-lucide-chevron-right`,class:`size-3.5 transition-transform group-open:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`}),n[2]||=z(` Show data table `,-1)]),w(`div`,nx,[w(`table`,rx,[w(`caption`,ix,B(e.title)+`, `+B(e.from)+` to `+B(e.to)+` UTC`,1),w(`thead`,ax,[w(`tr`,null,[n[3]||=w(`th`,{class:`px-3 py-2 font-medium`,scope:`col`},`Period (UTC)`,-1),w(`th`,ox,B(e.valueLabel),1)])]),w(`tbody`,null,[(H(!0),g(x,null,a(e.points,e=>(H(),g(`tr`,{key:e.start,class:`border-t border-default`},[w(`th`,sx,B(e.period),1),w(`td`,{class:L([`px-3 py-1.5 text-right tabular-nums`,e.evidence===`complete`?`text-highlighted`:`text-muted`])},B(e.display),3)]))),128))])])])])):E(``,!0)])}}}),dx={key:0,class:`flex min-w-0 flex-col gap-2.5`,"data-slot":`usage-share-bar`},fx={class:`flex items-baseline justify-between gap-3`},px={class:`text-sm font-semibold`},mx=[`aria-label`],hx={class:`flex flex-wrap gap-x-4 gap-y-1 text-xs`},gx={class:`text-muted`},_x={class:`tabular-nums`},vx={key:0,class:`text-xs text-muted`},yx=j({__name:`console-usage-share-bar`,props:{format:{type:Function},label:{},note:{},segments:{}},setup(e){let t=e,n=u(()=>t.segments.filter(e=>e.value>0)),o=u(()=>n.value.reduce((e,t)=>e+t.value,0)),s=u(()=>`${t.label}: ${n.value.map(e=>`${e.label} ${t.format(e.value)}`).join(`, `)}`);function c(e){return`${e.label} · ${t.format(e.value)} · ${Tb(e.value/o.value)}`}return(t,l)=>{let u=Ae;return o.value>0?(H(),g(`div`,dx,[w(`div`,fx,[w(`h3`,px,B(e.label),1),i(t.$slots,`aside`)]),w(`div`,{role:`img`,"aria-label":s.value,class:`flex h-2 gap-0.5`},[(H(!0),g(x,null,a(n.value,e=>(H(),S(u,{key:e.key,text:c(e)},{default:r(()=>[w(`div`,{class:`h-full min-w-1 rounded-xs first:rounded-l-full last:rounded-r-full`,style:ne({flex:`${e.value} 1 0`,backgroundColor:e.color})},null,4)]),_:2},1032,[`text`]))),128))],8,mx),w(`div`,hx,[(H(!0),g(x,null,a(n.value,t=>(H(),g(`span`,{key:t.key,class:`flex items-center gap-1.5`},[w(`span`,{"aria-hidden":`true`,class:`size-2 rounded-xs`,style:ne({backgroundColor:t.color})},null,4),w(`span`,gx,B(t.label),1),w(`span`,_x,B(e.format(t.value)),1)]))),128))]),e.note?(H(),g(`p`,vx,B(e.note),1)):E(``,!0)])):E(``,!0)}}}),bx={class:`flex flex-col gap-7`,"data-slot":`usage-model-detail`},xx={class:`text-xs text-muted`},Sx={class:`grid grid-cols-2 gap-x-6 gap-y-4`},Cx={class:`text-xs text-muted`},wx={class:`mt-1 text-lg font-semibold tabular-nums`},Tx={class:`flex flex-col gap-2`},Ex={class:`flex items-baseline justify-between gap-3`},Dx={class:`text-sm font-semibold`},Ox={class:`text-xs text-muted`},kx={key:0,class:`flex items-start gap-2 text-xs text-muted`},Ax=j({__name:`console-usage-model-detail`,props:{buckets:{},costSupported:{type:Boolean},from:{},metric:{},model:{},resolution:{},to:{},totals:{}},setup(e){let t=e,n=u(()=>t.costSupported&&t.model.pricedInvocations>0),r=u(()=>n.value?t.metric:`tokens`),i=u(()=>xb(t.model,t.totals,r.value)),o=u(()=>Sb(t.model)),s=u(()=>wb(t.model)),c=u(()=>Cb(t.model)),l=u(()=>[t.costSupported?{label:`Cost`,value:kb(t.model.costUsd,t.model.costEstimated,t.model.costAvailable)}:void 0,{label:`Tokens`,value:Ob(t.model.totalTokens,t.model.totalTokensAvailable)},{label:`Sessions`,value:Ob(t.model.invocations,t.model.invocationsAvailable)},t.costSupported&&t.model.averageCostUsd!==void 0?{label:`Average per priced session`,value:Db(t.model.averageCostUsd,t.model.costEstimated)}:void 0,s.value===null?void 0:{label:`Per 1M tokens`,value:Db(s.value.toFixed(2),t.model.costEstimated)},c.value===null?void 0:{label:`Cache hit`,value:Tb(c.value)},t.model.reasoningTokens>0||t.model.reasoningTokensAvailable?{label:`Reasoning tokens`,value:Ob(t.model.reasoningTokens,t.model.reasoningTokensAvailable)}:void 0].filter(e=>e!==void 0)),d=u(()=>Nb(t.buckets,t.model.model,r.value,t.resolution)),f=u(()=>`${t.resolution===`hour`?`Hourly`:`Daily`} ${r.value===`cost`?`cost`:`tokens`}`);function p(e){return r.value===`cost`?Db(String(e)):Eb(e)}return(t,s)=>{let c=le;return H(),g(`div`,bx,[w(`p`,xx,[i.value===null?(H(),g(x,{key:1},[z(B(r.value===`cost`?`Cost`:`Token`)+` share unavailable`,1)],64)):(H(),g(x,{key:0},[z(B(O(Tb)(i.value))+` of recorded `+B(r.value===`cost`?`cost`:`tokens`),1)],64)),z(` · `+B(O(Ab)(e.from,e.resolution))+` to `+B(O(Ab)(e.to,e.resolution))+` UTC `,1)]),w(`dl`,Sx,[(H(!0),g(x,null,a(l.value,e=>(H(),g(`div`,{key:e.label,class:`min-w-0`},[w(`dt`,Cx,B(e.label),1),w(`dd`,wx,B(e.value),1)]))),128))]),w(`section`,Tx,[w(`div`,Ex,[w(`h3`,Dx,B(f.value),1),w(`span`,Ox,B(e.resolution===`hour`?`UTC hours`:`UTC days`),1)]),P(ux,{class:`mt-2`,points:d.value,format:p,title:`${e.model.model} ${f.value.toLowerCase()}`,"value-label":r.value===`cost`?`Cost`:`Tokens`,empty:`No recorded ${r.value} for this model`,unavailable:r.value===`cost`?`Cost is unavailable for this model`:`Token usage is unavailable for this model`,from:O(Ab)(e.from,e.resolution),to:O(Ab)(e.to,e.resolution)},null,8,[`points`,`title`,`value-label`,`empty`,`unavailable`,`from`,`to`])]),P(yx,{label:`Tokens by type`,segments:o.value.segments,format:O(Eb),note:o.value.complete?void 0:`Recorded evidence only. Some sessions did not report every token type. Input can include their cache tokens.`},null,8,[`segments`,`format`,`note`]),e.costSupported&&!n.value?(H(),g(`p`,kx,[P(c,{name:`i-lucide-info`,class:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),s[0]||=z(` No session recorded a cost for this model. Its cost is unavailable, not zero. `,-1)])):E(``,!0)])}}}),jx=[`aria-busy`],Mx={key:1,class:`flex items-start gap-2 text-xs text-muted`,role:`status`},Nx={class:`text-xs text-muted`},Px={class:`mt-1 flex items-baseline gap-1.5 tabular-nums`},Fx={class:`text-lg font-semibold text-highlighted`},Ix={key:0,class:`text-xs text-muted`},Lx={key:3,class:`py-5 text-sm text-muted`,role:`status`},Rx={key:1,class:`mt-3 flex flex-col gap-8`},zx={class:`flex flex-col gap-4`},Bx={class:`flex flex-wrap items-start justify-between gap-3`},Vx={class:`text-sm font-semibold`},Hx={class:`mt-0.5 text-xs text-muted`},Ux={key:0,class:`ms-2 inline-flex items-center gap-1.5 text-default`},Wx={class:`flex gap-1`,role:`group`,"aria-label":`Usage metric`},Gx={key:0,"aria-label":`Usage mix`,class:`flex flex-col gap-2`},Kx={class:`text-xs text-muted`},qx={class:`text-highlighted tabular-nums`},Jx={key:0,class:`text-xs text-muted`},Yx={key:1,"aria-labelledby":`usage-token-types-heading`,class:`flex flex-col gap-3`},Xx={class:`grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-5`},Zx={class:`text-xs text-muted`},Qx={class:`mt-1 font-semibold tabular-nums`},$x={key:0,class:`mt-0.5 text-xs text-muted`},eS={class:`flex flex-col gap-3`},tS={class:`flex items-center justify-between gap-3`},nS={class:`flex gap-1`,role:`group`,"aria-label":`Usage breakdown`},rS={class:`overflow-x-auto rounded-md border border-default`},iS={key:0,class:`w-full min-w-xl text-xs`,"data-slot":`usage-model-breakdown`},aS={class:`bg-elevated/30 text-left text-muted`},oS={key:0,class:`h-9 px-3 text-right font-medium`,scope:`col`},sS={class:`py-2.5 pr-2 pl-3 text-muted tabular-nums`},cS={class:`py-2.5 pr-3`},lS=[`aria-label`,`onClick`],uS={"aria-hidden":`true`,class:`mt-1.5 h-0.5 max-w-48`},dS={class:`px-3 py-2.5 text-right tabular-nums text-muted`},fS={class:`px-3 py-2.5 text-right tabular-nums text-muted`},pS={class:`px-3 py-2.5 text-right tabular-nums`},mS={key:1,class:`w-full min-w-xl text-xs`},hS={class:`bg-elevated/30 text-left text-muted`},gS={class:`h-9 px-3 font-medium`,scope:`col`},_S={key:0,class:`h-9 px-3 text-right font-medium`,scope:`col`},vS={class:`px-3 py-2.5 font-medium`},yS={class:`px-3 py-2.5 text-right tabular-nums text-muted`},bS={key:0,class:`px-3 py-2.5 text-right tabular-nums`},xS={class:`px-3 py-2.5 text-right tabular-nums`},SS={key:2,class:`flex flex-col gap-3`},CS={class:`mt-0.5 text-xs text-muted`},wS={class:`overflow-x-auto rounded-md border border-default`},TS={class:`w-full min-w-lg text-xs`},ES={class:`px-3 py-2.5`},DS={class:`font-medium text-highlighted`},OS={class:`text-muted`},kS={class:`px-3 py-2.5 text-right tabular-nums text-muted`},AS={class:`px-3 py-2.5 text-right tabular-nums`},jS={class:`px-3 py-2.5 text-right tabular-nums`},MS={key:3,class:`flex flex-col gap-3`},NS={class:`overflow-x-auto rounded-md border border-default`},PS={class:`w-full min-w-xl text-xs`},FS={class:`px-3 py-2.5`},IS=[`title`],LS={class:`mt-0.5 text-muted`},RS=[`datetime`,`title`],zS={class:`px-3 py-2.5`},BS={class:`mt-0.5 text-muted`},VS={class:`px-3 py-2.5 text-muted capitalize`},HS={class:`px-3 py-2.5 text-right tabular-nums`},US={class:`px-3 py-2.5 text-right tabular-nums`},WS={key:0,"aria-labelledby":`session-history-heading`},GS={class:`mb-3 flex items-baseline justify-between gap-3`},KS={key:0,class:`overflow-x-auto rounded-md border border-default`},qS={class:`w-full min-w-[42rem] table-fixed text-xs`,"data-slot":`session-history`},JS={class:`bg-elevated/30 text-left text-muted`},YS={key:0,class:`h-9 px-3 text-right font-medium`,scope:`col`},XS={class:`px-3 py-2.5 align-top`},ZS=[`title`],QS={class:`px-3 py-2.5 align-top`},$S=[`title`],eC=[`title`],tC={class:`px-3 py-2.5 align-top text-muted`},nC=[`datetime`,`title`],rC={class:`px-3 py-2.5 align-top`},iC={key:1,class:`py-6 text-sm text-muted`,role:`status`},aC={key:3,class:`mt-3 flex items-center justify-between gap-3 text-xs text-muted`},oC={class:`flex gap-1`},sC={"aria-labelledby":`usage-accounts-heading`},cC={key:0,class:`flex items-start gap-2 p-3 text-sm`,role:`status`},lC={key:1,class:`grid gap-3 lg:grid-cols-2`},uC={class:`flex items-center justify-between gap-3`},dC={class:`text-sm font-medium`},fC={class:`text-xs text-muted`},pC={key:0,class:`text-xs text-muted`},mC={key:1,class:`text-xs text-muted`},hC={key:2,class:`text-xs text-muted`},gC={class:`flex flex-wrap gap-3 text-xs text-muted`},_C={key:0},vC=[`datetime`,`title`],yC={class:`flex justify-between gap-3 text-xs`},bC={class:`tabular-nums`},xC=[`value`,`aria-label`],SC={key:0,class:`text-xs text-muted`},CC=[`datetime`,`title`],wC={key:3,class:`text-xs text-muted`},TC=j({__name:`console-usage`,props:{base:{}},emits:[`open-sessions`],setup(t,{emit:n}){let i={cacheWriteTokens:bt(),cacheWriteTokensAvailable:xt(),cachedInputTokens:bt(),cachedInputTokensAvailable:xt(),costAvailable:xt(),costEstimated:xt(),costUsd:W(),averageCostUsd:vt(W()),pricedInvocations:bt(),inputTokens:bt(),inputTokensAvailable:xt(),invocations:bt(),invocationsAvailable:xt(),outputTokens:bt(),outputTokensAvailable:xt(),reasoningTokens:bt(),reasoningTokensAvailable:xt(),totalTokens:bt(),totalTokensAvailable:xt()},s=yt(i),c=yt({...i,model:W()}),d=yt({...i,models:Ct(c),start:W()}),f=yt({id:W(),agent:W(),status:W(),at:W(),usage:vt(yt({model:vt(W()),totalTokens:vt(bt()),cost:vt(yt({usd:W(),estimated:xt(),source:W()}))}))}),p=yt({id:W(),agent:W(),title:vt(W()),status:wt([`completed`,`failed`,`cancelled`]),at:W(),models:Ct(W()),partial:xt(),totals:s}),m=yt({agents:Ct(yt({agent:W(),provider:vt(W()),account:vt(yt({id:W(),kind:wt([`credential`,`account`])})),readiness:wt([`ready`,`unavailable`,`unknown`,`unsupported`]),checkedAt:W(),stale:xt(),reason:vt(W()),modelCompatibility:vt(yt({status:wt([`ready`,`unavailable`,`unknown`,`unsupported`]),reason:vt(W())})),workspaceCapacity:vt(yt({status:wt([`ready`,`unavailable`,`unknown`,`unsupported`]),reason:vt(W())})),installed:vt(xt()),authenticated:vt(xt()),usageLimits:vt(yt({checkedAt:W(),windows:Ct(yt({id:W(),label:W(),usedPercent:bt(),resetsAt:vt(W())})),unavailable:vt(yt({reason:W()}))}))}))}),_=yt({available:xt(),costSupported:xt(),agents:Ct(yt({...i,agent:W()})),sessions:Ct(p),sessionCount:bt(),runs:Ct(f),expensive:Ct(f),cursor:vt(W()),buckets:Ct(d),costAvailable:xt(),from:W(),generatedAt:W(),models:Ct(c),partial:xt(),resolution:wt([`day`,`hour`]),to:W(),totals:s}),v=qe(),y=Ue(),b=t,T=n;function k(e,t){y.replace({query:{...v.query,[e]:t||void 0}})}let A=u({get:()=>{let e=Tt(wt([`24h`,`7d`,`30d`,`90d`]),v.query.window);return e.success?e.output:`30d`},set:e=>k(`window`,e)}),ee=u({get:()=>{let e=Tt(wt([`overview`,`sessions`,`accounts`]),v.query.section);return e.success?e.output:`overview`},set:e=>k(`section`,e===`overview`?``:e)}),j=u({get:()=>{let e=Tt(wt([`cost`,`tokens`]),v.query.metric),t=e.success?e.output:we.value?`cost`:`tokens`;return t===`cost`&&!we.value?`tokens`:t},set:e=>k(`metric`,e)}),te=u({get:()=>{let e=Tt(wt([`model`,`time`]),v.query.breakdown);return e.success?e.output:`model`},set:e=>k(`breakdown`,e===`model`?``:e)}),M=[{label:`Overview`,value:`overview`,slot:`overview`},{label:`Sessions`,value:`sessions`,slot:`sessions`},{label:`Accounts`,value:`accounts`,slot:`accounts`}],N=C(),ae=C(!0),F=C(),I=u(()=>String(v.query.agent||``)),R=u({get:()=>I.value?`agent:${I.value}`:`all`,set:e=>k(`agent`,e.startsWith(`agent:`)?e.slice(6):``)}),oe=u({get:()=>{let e=Tt(wt([`completed`,`failed`,`cancelled`]),v.query.status);return e.success?e.output:`all`},set:e=>k(`status`,e===`all`?``:e)}),V=u(()=>String(v.query.search||``).trim()),se=u(()=>!!(I.value||V.value||oe.value!==`all`)),ce=u(()=>se.value?{"data-usage-empty":`no-match`,icon:`i-lucide-search-x`,title:`No sessions match these filters`,description:`No session from the last ${Fe.find(e=>e.value===A.value)?.label??`period`} matches the search, Agent, and status filters.`,actions:[{label:`Clear filters`,icon:`i-lucide-x`,color:`neutral`,variant:`outline`,onClick:ue}]}:{icon:`i-lucide-inbox`,title:`No sessions in this period`,description:`Finished Agent sessions appear here with their token and cost evidence.`});function ue(){clearTimeout(fe),de.value=``;let{agent:e,search:t,status:n,...r}=v.query;y.replace({query:r})}let de=C(V.value),fe;l(V,e=>{de.value=e}),l(de,e=>{clearTimeout(fe),e.trim()!==V.value&&(fe=setTimeout(()=>k(`search`,e.trim()),250))});let pe=[{label:`All statuses`,value:`all`},{label:`Completed`,value:`completed`},{label:`Failed`,value:`failed`},{label:`Cancelled`,value:`cancelled`}],he={completed:`i-lucide-check`,failed:`i-lucide-x`,cancelled:`i-lucide-ban`},ge={completed:`Completed`,failed:`Failed`,cancelled:`Cancelled`},ve=C([]),ye=u(()=>{let e=new Map;for(let t of ve.value){let n=t.account?`${t.provider}:${t.account.id}`:`agent:${t.agent}`,r=e.get(n),i=!r||t.readiness===`unavailable`||t.readiness===r.readiness&&t.checkedAt>r.checkedAt?t:r;e.set(n,{...i,agents:[...r?.agents||[],t.agent]})}return[...e.values()].filter(e=>!I.value||e.agents.includes(I.value))}),be=C(),Se=C(),Ce=C([]),we=u(()=>N.value?.costSupported===!0),Ee=u(()=>{let e=N.value;if(!e)return[];let t=[{label:`Sessions`,text:`${e.sessionCount.toLocaleString(`en`)}${e.totals.invocationsAvailable?``:` recorded`}`},{label:`Tokens`,text:Ob(e.totals.totalTokens,e.totals.totalTokensAvailable)}];return we.value&&t.push({label:`Cost`,text:kb(e.totals.costUsd,e.totals.costEstimated,e.totals.costAvailable)},{label:`Average per priced session`,text:e.totals.averageCostUsd===void 0?`Unavailable`:Db(e.totals.averageCostUsd,e.totals.costEstimated)}),t.map(({label:e,text:t})=>({label:e,note:t.endsWith(` recorded`)?`recorded`:void 0,value:t.replace(/ recorded$/,``)}))}),Oe=u(()=>[{label:`All agents`,value:`all`},...[...new Set([...ve.value.map(e=>e.agent),...N.value?.agents.map(e=>e.agent)??[]])].filter(Boolean).sort().map(e=>({label:e,value:`agent:${e}`}))]);function ke(e){try{return{name:_e(v.name,`vitehub-console-invocation`),params:{agent:me(e.agent),invocation:e.id}}}catch{return}}let Ae=o(`historyHeading`);async function je(e){await e,!F.value&&(await re(),Ae.value?.scrollIntoView({block:`start`}),Ae.value?.focus({preventScroll:!0}))}function Me(){!ae.value&&N.value?.cursor&&je(ft({cursor:N.value.cursor,previous:[...Ce.value,Se.value]}))}function Ne(){!ae.value&&Ce.value.length&&je(ft({cursor:Ce.value.at(-1),previous:Ce.value.slice(0,-1)}))}let Pe,Fe=[{label:`24 hours`,value:`24h`},{label:`7 days`,value:`7d`},{label:`30 days`,value:`30d`},{label:`90 days`,value:`90d`}],Ie=u(()=>[...we.value?[{label:`Cost`,value:`cost`}]:[],{label:`Tokens`,value:`tokens`}]),Le=u(()=>[{label:`Model`,value:`model`},{label:N.value?.resolution===`hour`?`Hour`:`Day`,value:`time`}]),Re=u(()=>(N.value?.buckets??[]).map(e=>Mb(e.start,e,j.value,N.value?.resolution??`day`))),ze=u(()=>Re.value.some(e=>e.evidence===`partial`)),He=u(()=>`${N.value?.resolution===`hour`?`Hourly`:`Daily`} ${j.value===`cost`?`cost`:`tokens`}`),We=u(()=>!!(N.value&&(N.value.totals.totalTokensAvailable||N.value.totals.totalTokens>0))),Ge=u(()=>(N.value?.buckets??[]).filter(e=>e.invocations>0||e.totalTokens>0||(Number(e.costUsd)||0)>0).toReversed()),Ke=u(()=>bb(N.value?.models??[],j.value)),Ye=u(()=>Math.max(0,...Ke.value.map(e=>yb(e,j.value)))),U=u(()=>{let e=N.value?.totals;return e?[{label:`Input`,note:`Including cache`,value:e.inputTokens,available:e.inputTokensAvailable},{label:`Cached input`,value:e.cachedInputTokens,available:e.cachedInputTokensAvailable},{label:`Cache writes`,value:e.cacheWriteTokens,available:e.cacheWriteTokensAvailable},{label:`Output`,value:e.outputTokens,available:e.outputTokensAvailable},{label:`Reasoning`,note:`Included in output`,value:e.reasoningTokens,available:e.reasoningTokensAvailable}]:[]}),Xe=u(()=>[...(N.value?.agents??[]).map(e=>({...e,key:`agent:${e.agent}`,kind:`Agent`,label:e.agent})),...(N.value?.models??[]).map(e=>({...e,key:`model:${e.model}`,kind:`Model`,label:e.model}))]),Ze=u(()=>N.value?Sb(N.value.totals):void 0),Qe=u(()=>N.value?Cb(N.value.totals):null),$e=C(),et=u(()=>N.value?.models.find(e=>e.model===$e.value)),tt=u({get:()=>et.value!==void 0,set:e=>{e||($e.value=void 0)}});function nt(e){return N.value?Tb(xb(e,N.value.totals,j.value)):`—`}function rt(e){let t=yb(e,j.value);return t>0&&Ye.value>0?`max(0.5rem, ${t/Ye.value*100}%)`:`0`}function it(e){return j.value===`cost`?Db(String(e)):Eb(e)}function ot(e){return e instanceof Error?e.message:e?`Usage could not be loaded.`:void 0}async function st(){return ft({cursor:Se.value,previous:Ce.value})}async function lt(){return ft({cursor:void 0,previous:[]})}async function ft(e){Pe?.abort();let t=new AbortController;Pe=t,ae.value=!0,F.value=void 0;try{let n=gt(_,await xe(b.base,{query:{window:A.value,...I.value?{agent:I.value}:{},...oe.value===`all`?{}:{status:oe.value},...V.value?{search:V.value}:{},...e.cursor?{cursor:e.cursor}:{}},signal:t.signal}));if(Pe!==t)return;N.value=n,Se.value=e.cursor,Ce.value=e.previous,F.value=void 0}catch(e){if(e instanceof Object&&`name`in e&&e.name===`AbortError`)return;Pe===t&&(F.value=e)}finally{Pe===t&&(Pe=void 0,ae.value=!1)}}async function mt(){try{let e=gt(m,await xe(b.base.replace(/\/usage$/,`/status`)));ve.value=e.agents,be.value=void 0}catch(e){be.value=ot(e)}}return l([()=>b.base,A,I,oe,V],()=>{Se.value=void 0,Ce.value=[],N.value=void 0,st()},{immediate:!0}),l(()=>b.base,()=>{mt()},{immediate:!0}),D(()=>{Pe?.abort(),clearTimeout(fe)}),(t,n)=>{let i=Je,o=at,s=Te,c=Be,l=le,u=pt,d=h(`RouterLink`),f=ct,p=ut,m=dt,_=Ve;return H(),S(_,{id:`console-usage`,ui:{body:`min-h-0 overflow-y-auto p-0 sm:p-0 gap-0 sm:gap-0`}},{header:r(()=>[P(s,{title:`Usage`,toggle:!1,ui:{root:`border-b border-default`}},{right:r(()=>[P(i,{class:`md:hidden`,"aria-label":`Open agent sessions`,color:`neutral`,icon:`i-lucide-list`,label:`Sessions`,size:`sm`,variant:`ghost`,onClick:n[0]||=e=>T(`open-sessions`)}),P(o,{modelValue:A.value,"onUpdate:modelValue":n[1]||=e=>A.value=e,"aria-label":`Usage period`,class:`w-28`,size:`sm`,"value-key":`value`,items:Fe},null,8,[`modelValue`]),P(i,{"aria-label":`Refresh usage`,color:`neutral`,icon:`i-lucide-refresh-cw`,size:`sm`,variant:`ghost`,disabled:ae.value,onClick:n[2]||=e=>{lt(),mt()}},null,8,[`disabled`])]),_:1}),P(Dt,{role:`search`,"aria-label":`Session history filters`,width:`6xl`},{default:r(()=>[P(c,{modelValue:de.value,"onUpdate:modelValue":n[3]||=e=>de.value=e,type:`search`,icon:`i-lucide-search`,placeholder:`Search sessions`,"aria-label":`Search session history`,class:`min-w-40 flex-1 sm:max-w-72`,size:`sm`},null,8,[`modelValue`]),P(o,{modelValue:R.value,"onUpdate:modelValue":n[4]||=e=>R.value=e,items:Oe.value,"value-key":`value`,"aria-label":`Agent`,size:`sm`,class:`w-40 max-w-full`},null,8,[`modelValue`,`items`]),P(o,{modelValue:oe.value,"onUpdate:modelValue":n[5]||=e=>oe.value=e,items:pe,"value-key":`value`,"aria-label":`Session status`,size:`sm`,class:`w-36`},null,8,[`modelValue`]),se.value?(H(),S(i,{key:0,label:`Clear`,color:`neutral`,variant:`ghost`,size:`sm`,onClick:ue})):E(``,!0)]),_:1})]),body:r(()=>[w(`main`,{class:`mx-auto flex w-full max-w-6xl flex-col gap-6 px-4 py-6 sm:px-6`,"aria-busy":ae.value},[F.value?(H(),S(De,{key:0,compact:``,error:F.value,title:`Could not load session history`,retry:st},null,8,[`error`])):E(``,!0),N.value?.partial?(H(),g(`p`,Mx,[P(l,{name:`i-lucide-info`,class:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),n[9]||=z(` Some usage is unavailable. Recorded totals include only the evidence received. `,-1)])):E(``,!0),N.value?(H(),g(`dl`,{key:2,class:L([`grid grid-cols-2 gap-px overflow-hidden rounded-md border border-default bg-(--ui-border)`,we.value?`sm:grid-cols-4`:`sm:grid-cols-2`]),"aria-label":`Session history totals`},[(H(!0),g(x,null,a(Ee.value,e=>(H(),g(`div`,{key:e.label,class:`bg-default px-4 py-3`},[w(`dt`,Nx,B(e.label),1),w(`dd`,Px,[w(`span`,Fx,B(e.value),1),e.note?(H(),g(`span`,Ix,B(e.note),1)):E(``,!0)])]))),128))],2)):ae.value?(H(),g(`p`,Lx,`Loading session history…`)):E(``,!0),P(p,{modelValue:ee.value,"onUpdate:modelValue":n[7]||=e=>ee.value=e,items:M,"aria-label":`Usage sections`,color:`neutral`,size:`sm`,ui:{root:`items-stretch gap-3`,list:`w-fit gap-1 bg-transparent p-0`,indicator:`hidden`,trigger:`rounded-md px-2.5 data-[state=inactive]:text-muted data-[state=inactive]:hover:text-highlighted data-[state=active]:bg-elevated data-[state=active]:text-highlighted`}},{overview:r(()=>[N.value&&!N.value.available&&N.value.totals.invocationsAvailable?(H(),S(u,ie({key:0},ce.value,{variant:`naked`}),null,16)):E(``,!0),N.value?.available?(H(),g(`div`,Rx,[w(`section`,zx,[w(`div`,Bx,[w(`div`,null,[w(`h2`,Vx,B(He.value),1),w(`p`,Hx,[z(B(O(Ab)(N.value.from,N.value.resolution))+` to `+B(O(Ab)(N.value.to,N.value.resolution))+` UTC `,1),ze.value?(H(),g(`span`,Ux,[...n[10]||=[w(`span`,{class:`size-1.5 rounded-full bg-warning`,"aria-hidden":`true`},null,-1),z(` Partial points `,-1)]])):E(``,!0)])]),w(`div`,Wx,[(H(!0),g(x,null,a(Ie.value,e=>(H(),S(i,{key:e.value,label:e.label,color:`neutral`,size:`xs`,variant:j.value===e.value?`soft`:`ghost`,"aria-pressed":j.value===e.value,onClick:t=>j.value=e.value},null,8,[`label`,`variant`,`aria-pressed`,`onClick`]))),128))])]),P(ux,{points:Re.value,format:it,title:He.value,"value-label":j.value===`cost`?`Cost`:`Tokens`,empty:`No recorded ${j.value} for this period`,unavailable:j.value===`cost`?`Cost is unavailable for this period`:`Token usage is unavailable for this period`,from:O(Ab)(N.value.from,N.value.resolution),to:O(Ab)(N.value.to,N.value.resolution)},{unavailable:r(()=>[j.value===`cost`&&We.value?(H(),S(i,{key:0,label:`Show tokens`,color:`neutral`,variant:`outline`,size:`xs`,onClick:n[6]||=e=>j.value=`tokens`})):E(``,!0)]),_:1},8,[`points`,`title`,`value-label`,`empty`,`unavailable`,`from`,`to`])]),Ze.value?.segments.length&&N.value.totals.totalTokens>0?(H(),g(`section`,Gx,[P(yx,{label:`Tokens by type`,segments:Ze.value.segments,format:O(Eb),note:Ze.value.complete?void 0:`Recorded evidence only. Some sessions did not report every token type. Input can include their cache tokens.`},e({_:2},[Qe.value===null?void 0:{name:`aside`,fn:r(()=>[w(`span`,Kx,[n[11]||=z(`Cache hit `,-1),w(`span`,qx,B(O(Tb)(Qe.value)),1)])]),key:`0`}]),1032,[`segments`,`format`,`note`]),N.value.totals.reasoningTokens>0?(H(),g(`p`,Jx,` Output includes `+B(O(Ob)(N.value.totals.reasoningTokens,N.value.totals.reasoningTokensAvailable))+` reasoning tokens. `,1)):E(``,!0)])):(H(),g(`section`,Yx,[n[12]||=w(`h2`,{id:`usage-token-types-heading`,class:`text-sm font-semibold`},`Tokens by type`,-1),w(`dl`,Xx,[(H(!0),g(x,null,a(U.value,e=>(H(),g(`div`,{key:e.label},[w(`dt`,Zx,B(e.label),1),w(`dd`,Qx,B(O(Ob)(e.value,e.available)),1),e.note?(H(),g(`dd`,$x,B(e.note),1)):E(``,!0)]))),128))])])),w(`section`,eS,[w(`div`,tS,[n[13]||=w(`h2`,{class:`text-sm font-semibold`},`Breakdown`,-1),w(`div`,nS,[(H(!0),g(x,null,a(Le.value,e=>(H(),S(i,{key:e.value,label:e.label,color:`neutral`,size:`xs`,variant:te.value===e.value?`soft`:`ghost`,"aria-pressed":te.value===e.value,onClick:t=>te.value=e.value},null,8,[`label`,`variant`,`aria-pressed`,`onClick`]))),128))])]),w(`div`,rS,[te.value===`model`&&N.value.models.length?(H(),g(`table`,iS,[w(`thead`,aS,[w(`tr`,null,[n[14]||=w(`th`,{class:`h-9 w-10 pr-2 pl-3 font-medium`,scope:`col`},`#`,-1),n[15]||=w(`th`,{class:`h-9 pr-3 font-medium`,scope:`col`},`Model`,-1),n[16]||=w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Sessions`,-1),we.value?(H(),g(`th`,oS,`Cost`)):E(``,!0),n[17]||=w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Share`,-1),n[18]||=w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Tokens`,-1)])]),w(`tbody`,null,[(H(!0),g(x,null,a(Ke.value,(e,t)=>(H(),g(`tr`,{key:e.model,class:`relative border-t border-default transition-colors hover:bg-elevated/50 has-focus-visible:bg-elevated/50`},[w(`td`,sS,B(t+1),1),w(`td`,cS,[w(`button`,{type:`button`,class:`text-left font-medium text-highlighted outline-none after:absolute after:inset-0`,"aria-label":`${e.model} usage details`,onClick:t=>$e.value=e.model},B(e.model),9,lS),w(`div`,uS,[w(`div`,{class:`h-full rounded-full bg-primary`,style:ne({width:rt(e)})},null,4)])]),w(`td`,dS,B(O(Ob)(e.invocations,e.invocationsAvailable)),1),we.value?(H(),g(`td`,{key:0,class:L([`px-3 py-2.5 text-right tabular-nums`,e.pricedInvocations?``:`text-muted`])},B(O(kb)(e.costUsd,e.costEstimated,e.costAvailable)),3)):E(``,!0),w(`td`,fS,B(nt(e)),1),w(`td`,pS,B(O(Ob)(e.totalTokens,e.totalTokensAvailable)),1)]))),128))])])):te.value===`time`&&N.value.buckets.length?(H(),g(`table`,mS,[w(`thead`,hS,[w(`tr`,null,[w(`th`,gS,B(N.value.resolution===`hour`?`Hour (UTC)`:`Day (UTC)`),1),n[19]||=w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Sessions`,-1),we.value?(H(),g(`th`,_S,`Cost`)):E(``,!0),n[20]||=w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Tokens`,-1)])]),w(`tbody`,null,[(H(!0),g(x,null,a(Ge.value,e=>(H(),g(`tr`,{key:e.start,class:`border-t border-default`},[w(`td`,vS,B(O(Ab)(e.start,N.value.resolution)),1),w(`td`,yS,B(O(Ob)(e.invocations,e.invocationsAvailable)),1),we.value?(H(),g(`td`,bS,B(O(kb)(e.costUsd,e.costEstimated,e.costAvailable)),1)):E(``,!0),w(`td`,xS,B(O(Ob)(e.totalTokens,e.totalTokensAvailable)),1)]))),128))])])):E(``,!0)])]),we.value&&N.value.totals.pricedInvocations?(H(),g(`section`,SS,[w(`div`,null,[n[21]||=w(`h2`,{class:`text-sm font-semibold`},`Average cost per session`,-1),w(`p`,CS,B(N.value.totals.pricedInvocations)+` of `+B(N.value.totals.invocations)+` sessions have cost evidence. Averages use priced sessions. ~ indicates estimated cost. `,1)]),w(`div`,wS,[w(`table`,TS,[n[23]||=w(`thead`,{class:`bg-elevated/30 text-left text-muted`},[w(`tr`,null,[w(`th`,{class:`h-9 px-3 font-medium`,scope:`col`},`Agent or model`),w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Priced sessions`),w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Average`),w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Recorded cost`)])],-1),w(`tbody`,null,[(H(!0),g(x,null,a(Xe.value,e=>(H(),g(`tr`,{key:e.key,class:`border-t border-default`},[w(`td`,ES,[w(`span`,DS,B(e.label),1),n[22]||=z(),w(`span`,OS,B(e.kind),1)]),w(`td`,kS,B(e.pricedInvocations)+` / `+B(e.invocations),1),w(`td`,AS,B(e.averageCostUsd===void 0?`Unavailable`:O(Db)(e.averageCostUsd,e.costEstimated)),1),w(`td`,jS,B(e.pricedInvocations?O(Db)(e.costUsd,e.costEstimated):`Unavailable`),1)]))),128))])])])])):E(``,!0),we.value&&N.value.expensive.length?(H(),g(`section`,MS,[n[25]||=w(`div`,{class:`flex items-baseline justify-between gap-3`},[w(`h2`,{class:`text-sm font-semibold`},`Most expensive sessions`),w(`span`,{class:`text-xs text-muted`},`Top 10 with cost evidence`)],-1),w(`div`,NS,[w(`table`,PS,[n[24]||=w(`thead`,{class:`bg-elevated/30 text-left text-muted`},[w(`tr`,null,[w(`th`,{class:`h-9 px-3 font-medium`,scope:`col`},`Session`),w(`th`,{class:`h-9 px-3 font-medium`,scope:`col`},`Agent / model`),w(`th`,{class:`h-9 px-3 font-medium`,scope:`col`},`Status`),w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Tokens`),w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Cost`)])],-1),w(`tbody`,null,[(H(!0),g(x,null,a(N.value.expensive,e=>(H(),g(`tr`,{key:e.id,class:`border-t border-default`},[w(`td`,FS,[ke(e)?(H(),S(d,{key:0,to:ke(e),class:`font-medium text-highlighted underline-offset-4 hover:underline`,title:e.id},{default:r(()=>[z(B(e.id.length>24?`${e.id.slice(0,20)}…`:e.id),1)]),_:2},1032,[`to`,`title`])):(H(),g(`span`,{key:1,class:`font-medium`,title:e.id},B(e.id.length>24?`${e.id.slice(0,20)}…`:e.id),9,IS)),w(`p`,LS,[w(`time`,{datetime:e.at,title:O(zb)(e.at)},B(O(Rb)(e.at)),9,RS)])]),w(`td`,zS,[z(B(e.agent)+` `,1),w(`p`,BS,B(e.usage?.model||`Model unavailable`),1)]),w(`td`,VS,B(e.status),1),w(`td`,HS,B(e.usage?.totalTokens===void 0?`Unavailable`:O(Eb)(e.usage.totalTokens)),1),w(`td`,US,B(e.usage?.cost?O(Db)(e.usage.cost.usd,e.usage.cost.estimated):`Unavailable`),1)]))),128))])])])])):E(``,!0)])):E(``,!0)]),sessions:r(()=>[N.value?(H(),g(`section`,WS,[w(`div`,GS,[w(`h2`,{id:`session-history-heading`,ref_key:`historyHeading`,ref:Ae,class:`scroll-mt-4 text-sm font-semibold outline-none`,tabindex:`-1`},`Session history`,512),n[26]||=w(`span`,{class:`text-xs text-muted`},`Newest first`,-1)]),N.value.sessions.length?(H(),g(`div`,KS,[w(`table`,qS,[w(`thead`,JS,[w(`tr`,null,[n[27]||=w(`th`,{class:`h-9 w-[34%] px-3 font-medium`,scope:`col`},`Session`,-1),n[28]||=w(`th`,{class:`h-9 w-[19%] px-3 font-medium`,scope:`col`},`Agent / model`,-1),n[29]||=w(`th`,{class:`h-9 w-[15%] px-3 font-medium`,scope:`col`},`Last activity`,-1),n[30]||=w(`th`,{class:`h-9 w-[13%] px-3 font-medium`,scope:`col`},`Status`,-1),n[31]||=w(`th`,{class:`h-9 px-3 text-right font-medium`,scope:`col`},`Tokens`,-1),we.value?(H(),g(`th`,YS,`Cost`)):E(``,!0)])]),w(`tbody`,null,[(H(!0),g(x,null,a(N.value.sessions,e=>(H(),g(`tr`,{key:e.id,class:`border-t border-default hover:bg-elevated/40`},[w(`td`,XS,[ke(e)?(H(),S(d,{key:0,to:ke(e),class:`block truncate font-medium text-highlighted underline-offset-4 hover:underline focus-visible:underline`,title:e.title||e.id},{default:r(()=>[z(B(e.title||e.id),1)]),_:2},1032,[`to`,`title`])):(H(),g(`span`,{key:1,class:`block truncate`,title:e.title||e.id},B(e.title||e.id),9,ZS))]),w(`td`,QS,[w(`span`,{class:`block truncate`,title:e.agent},B(e.agent||`Unknown agent`),9,$S),w(`span`,{class:`block truncate text-xs text-muted`,title:e.models.join(`, `)},B(e.models.length?e.models.join(`, `):`Model unavailable`),9,eC)]),w(`td`,tC,[w(`time`,{datetime:e.at,title:O(zb)(e.at)},B(O(Rb)(e.at)),9,nC)]),w(`td`,rC,[w(`span`,{class:L([`inline-flex items-center gap-1.5 text-xs`,e.status===`failed`?`text-default`:`text-muted`])},[P(l,{name:he[e.status],class:L([`size-3.5 shrink-0`,e.status===`failed`?`text-error`:``]),"aria-hidden":`true`},null,8,[`name`,`class`]),z(B(ge[e.status]),1)],2)]),w(`td`,{class:L([`px-3 py-2.5 text-right align-top tabular-nums`,e.totals.totalTokensAvailable?`text-highlighted`:`text-muted`])},B(O(Ob)(e.totals.totalTokens,e.totals.totalTokensAvailable)),3),we.value?(H(),g(`td`,{key:0,class:L([`px-3 py-2.5 text-right align-top font-medium tabular-nums`,e.totals.costAvailable?`text-highlighted`:`text-muted`])},B(O(kb)(e.totals.costUsd,e.totals.costEstimated,e.totals.costAvailable)),3)):E(``,!0)]))),128))])])])):E(``,!0),!N.value.sessions.length&&!N.value.totals.invocationsAvailable?(H(),g(`p`,iC,`Session history is still loading…`)):N.value.sessions.length?E(``,!0):(H(),S(u,ie({key:2},ce.value,{variant:`naked`}),null,16)),N.value.sessions.length||Ce.value.length?(H(),g(`div`,aC,[w(`span`,null,B(N.value.sessions.length?`${Ce.value.length*50+1}–${Ce.value.length*50+N.value.sessions.length} of ${N.value.sessionCount}`:`${N.value.sessionCount} sessions`)+B(N.value.totals.invocationsAvailable?``:` recorded`),1),w(`div`,oC,[P(i,{label:`Previous`,"aria-label":`Previous history page`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!Ce.value.length||ae.value,onClick:Ne},null,8,[`disabled`]),P(i,{label:`Next`,"aria-label":`Next history page`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!N.value.cursor||ae.value,onClick:Me},null,8,[`disabled`])])])):E(``,!0)])):E(``,!0)]),accounts:r(()=>[w(`section`,sC,[n[34]||=w(`h2`,{id:`usage-accounts-heading`,class:`text-sm font-semibold`},`Provider accounts`,-1),n[35]||=w(`p`,{class:`mt-0.5 mb-3 text-xs text-muted`},`Provider limits apply to the shared account or credential. Recorded session tokens and API cost estimates are shown separately.`,-1),be.value?(H(),g(`p`,cC,[P(l,{name:`i-lucide-triangle-alert`,class:`mt-0.5 size-4 shrink-0 text-warning`,"aria-hidden":`true`}),z(` `+B(be.value),1)])):(H(),g(`div`,lC,[(H(!0),g(x,null,a(ye.value,e=>(H(),g(`article`,{key:e.account?.id||e.agent,class:`space-y-3 rounded-md border border-default p-4`},[w(`div`,uC,[w(`div`,null,[w(`h3`,dC,B(e.provider||`Provider`)+` · `+B(e.account?`Shared credential`:`Identity unavailable`),1),w(`p`,fC,B(e.agents.join(`, `)),1)]),P(f,{color:e.readiness===`ready`&&!e.stale?`success`:e.readiness===`unavailable`?`error`:`neutral`,variant:`subtle`},{default:r(()=>[z(B(e.stale?`Stale`:e.readiness),1)]),_:2},1032,[`color`])]),e.reason?(H(),g(`p`,pC,B(e.reason),1)):E(``,!0),e.modelCompatibility?(H(),g(`p`,mC,` Model compatibility: `+B(e.modelCompatibility.reason||e.modelCompatibility.status),1)):E(``,!0),e.workspaceCapacity?(H(),g(`p`,hC,` Workspace capacity: `+B(e.workspaceCapacity.reason||e.workspaceCapacity.status),1)):E(``,!0),w(`div`,gC,[e.authenticated===void 0?E(``,!0):(H(),g(`span`,_C,`Account: `+B(e.authenticated?`Signed in`:`Signed out`),1)),w(`span`,null,[n[32]||=z(`Checked `,-1),w(`time`,{datetime:e.checkedAt,title:O(zb)(e.checkedAt)},B(O(Rb)(e.checkedAt)),9,vC)])]),(H(!0),g(x,null,a(e.usageLimits?.windows??[],e=>(H(),g(`div`,{key:e.id,class:`space-y-1.5`},[w(`div`,yC,[w(`span`,null,B(e.label),1),w(`span`,bC,B(e.usedPercent.toFixed(0))+`% used`,1)]),w(`progress`,{class:`h-1.5 w-full accent-primary`,value:Math.min(100,Math.max(0,e.usedPercent)),max:`100`,"aria-label":e.label},null,8,xC),e.resetsAt?(H(),g(`p`,SC,[n[33]||=z(` Resets `,-1),w(`time`,{datetime:e.resetsAt,title:O(zb)(e.resetsAt)},B(O(Rb)(e.resetsAt)),9,CC)])):E(``,!0)]))),128)),e.usageLimits?.unavailable?(H(),g(`p`,wC,` Subscription usage `+B(e.usageLimits.unavailable.reason===`unsupported`?`is not reported by this provider`:`could not be checked`)+`. `,1)):E(``,!0)]))),128))]))])]),_:1},8,[`modelValue`]),P(m,{open:tt.value,"onUpdate:open":n[8]||=e=>tt.value=e,title:et.value?.model||`Model`,description:`Model usage in this period`,ui:{description:`sr-only`}},{body:r(()=>[N.value&&et.value?(H(),S(Ax,{key:0,model:et.value,totals:N.value.totals,buckets:N.value.buckets,metric:j.value,"cost-supported":we.value,resolution:N.value.resolution,from:N.value.from,to:N.value.to},null,8,[`model`,`totals`,`buckets`,`metric`,`cost-supported`,`resolution`,`from`,`to`])):E(``,!0)]),_:1},8,[`open`,`title`])],8,jx)]),_:1})}}});async function EC(e){let t=e.refresh();await e.navigate(),await t}function DC(e,t){return!!(e&&e.agent===t.agent&&e.invocation===t.invocation)}function OC(e){return e.preserve||!e.routeChanged||!e.selectedCapabilityId.value&&!e.selectedTriggeredBy?.value?!1:(e.selectedCapabilityId.value=void 0,e.selectedTriggeredBy&&(e.selectedTriggeredBy.value=void 0),e.scheduleRefresh(),!0)}function kC(e){let t,n=!1;function r(n,r=!1){n!==e.selectedAgentName.value&&(r&&(t=n),e.selectedAgentName.value=n)}return l(e.selectedAgentName,r=>{if(r&&t===r){t=void 0,n=!0,e.isLoading.value||(n=!1,e.scheduleRefresh());return}e.scheduleRefresh()}),l(e.isLoading,t=>{!t&&n&&(n=!1,e.scheduleRefresh())}),l(e.firstInvocation,t=>{!e.isUsageRoute.value&&e.initialBootstrapPending.value&&!e.selectedAgentName.value&&t&&(e.initialBootstrapPending.value=!1,t.agentName&&r(t.agentName,!0))}),l([e.agentNames,e.initialBootstrapPending,e.isUsageRoute],([t,n,i])=>{i||n||e.selectedAgentName.value||!t.length||r(t[0])}),{selectAgentName:r}}var AC={class:`vitehub-console__panel-title mx-2 min-w-0 flex-1`},jC={class:`flex h-10 items-center gap-2 border-b border-default ps-3 pe-1.5`},MC={key:0,class:`grid gap-1 p-2`,"aria-label":`Loading session filters`,role:`status`},NC={key:1,class:`p-2`},PC={key:2,class:`px-3 py-4 text-xs text-muted`},FC={key:0,class:`px-2 pb-3`},IC={key:1,class:`vitehub-console__agents shrink-0 px-1.5 pb-2`},LC={class:`m-0`},RC=[`aria-expanded`],zC={class:`vitehub-console__section-count`},BC={id:`vitehub-console-agent-list`,class:`grid max-h-48 gap-px overflow-y-auto`,"aria-label":`Agents`},VC=[`aria-current`,`title`,`onClick`],HC={class:`min-w-0 flex-1 truncate`},UC={key:0},WC={key:2,class:`vitehub-console__section-label vitehub-console__sessions-label m-0 shrink-0`},GC=[`title`],KC={key:1,class:`vitehub-console__section-count`},qC={key:3,class:`px-2`},JC={key:4,class:`grid gap-1 px-2`,"aria-label":`Loading sessions`,role:`status`},YC={class:`grid grid-cols-[1rem_minmax(0,1fr)] gap-x-2 gap-y-2 rounded-md px-2 py-2.5`},XC={class:`grid min-w-0 gap-2`},ZC={class:`flex items-center justify-between gap-3`},QC={key:0,class:`flex justify-center px-2 py-3`},$C={class:`flex h-full min-h-0 w-full flex-col overflow-hidden`,"aria-live":`polite`},ew={key:1,class:`min-h-0 w-full flex-1 overflow-hidden`},tw={key:0,class:`h-full min-h-0 overflow-hidden`},nw={class:`flex h-full min-h-0 w-full flex-col overflow-hidden`},rw={key:0,class:`m-3 shrink-0`},iw={key:2,class:`flex h-full min-h-0 flex-col overflow-hidden`},aw={key:2,class:`min-h-0 flex-1`},ow={key:5,class:`flex min-h-0 flex-1 flex-col`},sw={key:0,class:`m-3 shrink-0`},cw=j({__name:`console-app`,props:{agentsBase:{},apiBase:{},capabilitiesBase:{},definitionsBase:{},kvBase:{},hostBase:{},searchBase:{},sectionsBase:{},usageBase:{}},setup(t){let i=qe(),o=Ue(),s=t,c=Se(i.params.agent),d=C(),f=C(c?.trim()?c:void 0),p=C(),m=C(),h=C(),_=C(!1),v=C([]),y=C([]),T=C(!1),k=C(),A=C(!f.value),ee=C([]),j=C([]),te=u(()=>[...ee.value,...j.value]),ne=C(!0),M=C(),N=C({}),ae=C(Date.now()),F=C(i.query.sessions===`open`),I=C(!1),L=C(!1),R=C(`details`),z=C(``),oe=C([]),V=C([]),ce=C(),ue=C(),de=C(),he=C(!1),be=C(document.visibilityState!==`hidden`),Ce=C(!1),we,Te,Ee,Oe,je,Re=0,Be=!1,He,We=u(()=>be.value&&i.name!==_e(i.name,`vitehub-console-usage`)),Ge=u(()=>We.value?5e3:!1),Ke=u(()=>i.name===_e(i.name,`vitehub-console-usage`));async function Ye(){let e=ge(i.query,f.value);if(e){await o.push({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(e)},query:{sessions:`open`}}),F.value=!0;return}await o.push({name:_e(i.name,`vitehub-console-agents`),query:{sessions:`open`}}),F.value=!0}let U=F_({baseURL:s.apiBase,immediate:be.value&&!Ke.value,pollInterval:Ge,request:xe,requestSummaries:xe,watch:!1,query:u(()=>{let e={limit:50};return f.value&&(e.agent=f.value),m.value&&(e.capability=m.value),h.value&&(e.triggeredBy=h.value),e})}),Xe=u(()=>U.invocations.value.find(e=>e.id===d.value)),{selectAgentName:Ze}=kC({agentNames:te,firstInvocation:u(()=>U.invocations.value[0]),initialBootstrapPending:A,isUsageRoute:Ke,isLoading:U.isLoading,scheduleRefresh:ln,selectedAgentName:f}),Qe=C(),$e=C(),et=u(()=>!d.value&&!ct.value&&(ne.value||U.isLoading.value)),tt=u(()=>{if(!We.value||!d.value)return!1;if($e.value)return ye($e.value)?3e3:!1;let e=Qe.value,t=e?.id===d.value?e.status:void 0;return t===`completed`||t===`failed`||t===`cancelled`?!1:3e3}),nt=I_(d,{baseURL:s.apiBase,immediate:be.value,pollInterval:tt,request:xe});l(()=>nt.error.value,e=>{$e.value=e},{flush:`sync`,immediate:!0});let rt=B_(()=>({errors:[M.value,U.error.value,nt.error.value],pending:Ce.value||ne.value||U.isLoading.value||nt.isLoading.value})),it=u(()=>[M.value,U.error.value].find(e=>ve(e))),at=u(()=>it.value??(!rt.value&&M.value&&U.error.value?M.value:void 0)),ot=u(()=>U.invocations.value.map(e=>({agent:e.agentName,channel:e.channelId?e.origin||e.channelId:void 0,context:[Vt(e),jh(e)].filter(e=>!!e).join(` · `)||void 0,id:e.id,project:Mh(e)===e.agentName?void 0:Mh(e),provider:Lt(e.annotations?.[`agent.model.provider`])||(e.id===d.value?St.value?.configuration?.driver?.model?.provider||St.value?.configuration?.driver?.provider:void 0),startedAt:e.startedAt,status:e.status,title:Ah(e),updatedAt:e.updatedAt||e.startedAt||e.createdAt}))),st=u(()=>ee.value.length>1),ct=u(()=>R_(f.value,N.value)),lt=u(()=>L_(f.value,N.value)),ut=C(Pe()),ht=C(!1),W=u(()=>ke(ee.value,f.value,ht.value)),gt=u(()=>lt.value?[{description:`Start a session with ${lt.value}`,icon:`i-lucide-square-pen`,label:`New chat`,onSelect:()=>void Yt()}]:[]),_t=u(()=>Number(!!m.value)+Number(!!h.value)),vt=u(()=>[{id:`capability`,label:`Used capability`,items:v.value.map(e=>({id:`capability:${e}`,kind:`capability`,label:Rt(e),value:e}))},{id:`triggeredBy`,label:`Triggered by`,items:y.value.map(e=>({id:`triggeredBy:${e}`,kind:`triggeredBy`,label:e,value:e}))}].filter(e=>e.items.length)),yt=u(()=>vt.value.flatMap(e=>e.items).filter(e=>e.value===(e.kind===`capability`?m.value:h.value))),bt=u(()=>{let e=i.params.invocation;return Array.isArray(e)?e[0]:e}),xt=u(()=>Se(i.params.agent)),St=u(()=>{let e=nt.invocation.value;if(!e||e.id!==d.value||f.value&&e.agentName!==f.value)return;let t=Wt(It(e)?.configuration)??Gt(nt.observations.value),n={...e,observations:nt.observations.value};if(t){let e=nt.observations.value.findLast(e=>e.name===`vitehub.agent.configured`);n.configuration={...t,truncated:e?.attributes?.[`vitehub.agent.configurationTruncated`]===!0}}return n}),Ct=u(()=>St.value??Xe.value),wt=u(()=>Ct.value?.status===`pending`||Ct.value?.status===`running`),Tt=u(()=>{let e=St.value,t=It(It(nt.invocation.value)?.actions);if(!e?.agentName||!t)return;let n=It(t.rerun),r=Lt(n?.prompt),i=Lt(n?.invokerProfileId);return{agent:e.agentName,deletable:It(t.delete)?.available===!0,deleteUnavailableReason:Lt(It(t.delete)?.reason),id:e.id,rerun:n?.available===!0&&r?{available:!0,prompt:r,...i?{invokerProfileId:i}:{}}:{available:!1,reason:Lt(n?.reason)??`unavailable`}}}),Et=u(()=>{let e=St.value,t=It(It(nt.invocation.value)?.actions);if(!e||It(t?.cancel)?.available!==!0)return;let n=It(e),r=Lt(n?.cancelNotEnforcedBy),i={cancelRequested:!!Lt(n?.cancelRequestedAt),id:e.id,terminal:e.status!==`pending`&&e.status!==`running`};return r&&(i.notEnforcedBy=r),i}),Dt=u(()=>Vt(Ct.value)),Ot=u(()=>Ht(Ct.value)),kt=u(()=>Ct.value?Ah(Ct.value):f.value||`ViteHub Console`),At=u(()=>Ct.value?Ct.value.agentName||f.value||``:f.value||``),jt=u(()=>Ct.value?Nh(Ct.value):void 0),Mt=[{id:`thread`,slot:`thread`,minSize:360,defaultSize:720,sizeUnit:`px`,class:`h-full min-h-0 min-w-0 overflow-hidden`},{id:`details`,slot:`details`,minSize:360,maxSize:1080,defaultSize:440,sizeUnit:`px`,class:`h-full min-h-0 min-w-0 overflow-hidden`}];function Nt(e){de.value=void 0,he.value||(I.value=!1),re(()=>{de.value=e})}function Pt(){I.value=!1,L.value=!1}l([I,L],()=>{let e=document.activeElement,t=e instanceof HTMLElement?e.closest(`.vitehub-console__session-panel`):null;if(!he.value||!(e instanceof HTMLElement)||!t)return;let n=e.dataset.slot;re(()=>{if(document.activeElement&&document.activeElement!==document.body)return;let e=I.value&&n?t.querySelector(`[data-slot="${CSS.escape(n)}"]`):null,r=I.value&&n!==`session-details-toggle`?t.querySelector(`.session-inspector [role='tab'][data-state='active']`):null,i=e??r??t.querySelector(`[data-slot='session-details-toggle']`);i instanceof HTMLElement&&i.focus()})});async function Ft(){je?.abort();let e=new AbortController;je=e,T.value=!0;try{let t=It(await xe(s.capabilitiesBase,{query:f.value?{agent:f.value}:void 0,signal:e.signal})),n=Array.isArray(t?.capabilities)?t.capabilities.map(Lt).filter(e=>!!e?.trim()):[],r=Array.isArray(t?.triggeredBy)?t.triggeredBy.map(Lt).filter(e=>!!e?.trim()):[];je===e&&(v.value=[...new Set(n.map(e=>e.trim()))].sort(),y.value=[...new Set(r.map(e=>e.trim()))].sort((e,t)=>e.localeCompare(t)),k.value=void 0,m.value&&!v.value.includes(m.value)&&(m.value=void 0,ln()),h.value&&!y.value.includes(h.value)&&(h.value=void 0,ln()))}catch(t){if(t instanceof Object&&`name`in t&&t.name===`AbortError`)return;je===e&&(k.value=t)}finally{je===e&&(je=void 0,T.value=!1)}}function It(e){return e instanceof Object&&!Array.isArray(e)?Object.fromEntries(Object.entries(e)):void 0}function Lt(e){return typeof e==`string`?e:void 0}function Rt(e){return(e.match(/(?:^|_)s([a-z][a-z0-9-]*)$/i)?.[1]||e.split(/[/:]/).at(-1)||e).replace(/^@/,``).replace(/[_-]+/g,` `).replace(/\b(api|github|mcp|ui)\b/gi,e=>e.toLowerCase()===`github`?`GitHub`:e.toUpperCase()).replace(/(^|\s)\p{Ll}/gu,e=>e.toUpperCase())}function zt(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function Bt(e){return It(It(e)?.usage)}function Vt(e){return Lt(It(Bt(e)?.cost)?.display)}function Ht(e){let t=zt(Bt(e)?.totalTokens);return t===void 0?void 0:Ut(t)}function Ut(e){return new Intl.NumberFormat(`en`,{maximumFractionDigits:1,notation:e>=1e4?`compact`:`standard`}).format(e)}function Wt(e){let t=It(e);if(t)return t}function Gt(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.name!==`vitehub.agent.configured`)continue;let r=It(n.attributes?.[`vitehub.agent.configuration`]);if(r)return Wt(r)}}async function Kt(e){let t=e.agent?.trim()||f.value;t&&(F.value=!1,p.value=void 0,cn(t),await o.push({name:_e(i.name,`vitehub-console-invocation`),params:{agent:me(t),invocation:e.id}}))}async function qt(e){await Kt(e),ln()}let G=Dv();async function Jt(e){let t=f.value,n=d.value===e||bt.value===e;await G.remove(e,{clearSelection(){n&&(d.value=void 0,Pt())},async navigate(){n&&t&&await o.replace({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(t)}})},removeFromList(){U.invocations.value=G.exclude(U.invocations.value)},refresh:()=>U.refresh().catch(()=>void 0)})}async function Yt(){let e=lt.value;e&&(F.value=!1,p.value=e,cn(e),d.value=void 0,Pt(),await o.push({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(e)}}),await re(),document.querySelector(`textarea[aria-label="Test this Agent"]`)?.focus())}async function Xt(e){e!==f.value&&(p.value=void 0,cn(e),d.value=void 0,m.value=void 0,h.value=void 0,await o.push({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(e)}}))}async function Zt(){p.value=void 0,d.value=void 0,Pt();let e={agent:f.value,invocation:void 0};He=e;try{await EC({navigate:()=>f.value?o.replace({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(f.value)}}):Promise.resolve(),refresh:()=>U.refresh()})}finally{He===e&&(He=void 0)}}function Qt(e){m.value!==e&&(m.value=e,Zt())}function $t(e){h.value!==e&&(h.value=e,Zt())}function en(e){let t=Array.isArray(e)?e:[e],n=new Set(yt.value.map(e=>e.id)),r=t.find(e=>!n.has(e.id));if(r?.kind===`capability`)return Qt(r.value);if(r?.kind===`triggeredBy`)return $t(r.value);m.value&&!t.some(e=>e.kind===`capability`)&&Qt(void 0),h.value&&!t.some(e=>e.kind===`triggeredBy`)&&$t(void 0)}function tn(){ut.value=!ut.value,Le(ut.value)}function nn(){_t.value&&(m.value=void 0,h.value=void 0,Zt())}function rn(){!U.cursor.value||U.isLoadingMore.value||U.loadMoreError.value||U.loadMore()}l(()=>[ot.value.length,U.cursor.value,U.isLoading.value,U.isLoadingMore.value],([e,t,n,r])=>{!e&&t&&!n&&!r&&rn()});function an(){Te&&clearTimeout(Te),Te=void 0}function on(){an(),be.value&&(Te=setTimeout(()=>{Te=void 0,be.value&&M.value&&sn()},5e3))}async function sn(){an(),Oe?.abort();let e=new AbortController;Oe=e,ne.value=!0;try{let t=It(await xe(s.agentsBase,{signal:e.signal})),n=Me(t);if(Oe===e){ee.value=n.agents,j.value=n.historicalAgents;let e=It(t?.invocation);N.value=Object.fromEntries(ee.value.flatMap(t=>{let n=It(z_(e,t));return n?[[t,{profiles:Array.isArray(n.profiles)?n.profiles.flatMap(e=>{let t=It(e),n=Lt(t?.id)?.trim();if(!n)return[];let r=Lt(t?.label)?.trim(),i={id:n};return r&&(i.label=r),[i]}):[]}]]:[]})),M.value=void 0}}catch(t){if(t instanceof Object&&`name`in t&&t.name===`AbortError`)return;Oe===e&&(M.value=t,ye(t)&&on())}finally{Oe===e&&(Oe=void 0,ne.value=!1)}}function cn(e,t=!1){Ze(e,t)}function ln(){Be||(Be=!0,re(()=>{Be=!1,be.value&&!Ke.value&&U.refresh()}))}async function K(){Re++,Ce.value=!0;try{let e=sn();await Promise.all([e,Ke.value?Promise.resolve():U.refresh(),d.value?nt.refresh():Promise.resolve()])}finally{Re--,Ce.value=Re>0}}function un(e,t){let n=e===`agent`?`details`:`workspace`;R.value=n,oe.value.includes(n)||(oe.value=[...oe.value,n]),n===`workspace`&&t?(V.value.includes(t)||(V.value=[...V.value,t]),ce.value=t,z.value=`file:${t}`):(ce.value=void 0,z.value=`view:${n}`),I.value=!0}function dn(e){he.value=e?.matches??Ee?.matches??!1}function fn(){we&&clearInterval(we),we=void 0,be.value&&(ae.value=Date.now(),we=setInterval(()=>{ae.value=Date.now()},6e4))}function pn(){let e=be.value;be.value=document.visibilityState!==`hidden`,fn(),be.value||an(),!e&&be.value&&K()}return l([bt,xt,()=>U.invocations.value.find(e=>!G.has(e.id)),f,Ke],async([e,t,n,r,a],s)=>{if(e&&G.has(e)){d.value=void 0;return}if(a){p.value=void 0,A.value=!1,d.value=void 0;return}e&&(p.value=void 0);let c=!s||e!==s[0]||t!==s[1],l=c&&(t===r||DC(He,{agent:t,invocation:e}));c&&(He=void 0);let u=OC({preserve:l,routeChanged:c,scheduleRefresh:ln,selectedCapabilityId:m,selectedTriggeredBy:h})?void 0:n;if((e||t)&&(A.value=!1),!t&&!r){if(!u)return;if(!u.agentName){A.value=!1;return}d.value=u.id;try{await o.replace({name:_e(i.name,`vitehub-console-invocation`),params:{agent:me(u.agentName),invocation:u.id}})}finally{A.value=!1}return}if(!e&&t&&t===p.value){d.value=void 0;return}let f=!t||t===r;d.value=e||(f?u?.id:void 0),!e&&u?.id&&r&&f&&await o.replace({name:_e(i.name,`vitehub-console-invocation`),params:{agent:me(r),invocation:u.id}})},{immediate:!0}),l([xt,te,Ke,A],async([e,t,n,r])=>{if(n||!t.length||!e&&r)return;let a=f.value,s=e&&t.includes(e)?e:a&&t.includes(a)?a:t[0];cn(s),e!==s&&await o.replace({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(s)}})},{immediate:!0}),l([()=>U.isLoading.value,()=>U.error.value],([e,t])=>{A.value&&!e&&(t||U.invocations.value.length===0)&&(A.value=!1)}),l([f,()=>nt.invocation.value,Ke],async([e,t,n])=>{!n&&e&&t&&t.id===d.value&&t.agentName!==e&&(d.value=void 0,await o.replace({name:_e(i.name,`vitehub-console-agent`),params:{agent:me(e)}}))}),l(d,()=>{de.value=void 0,Qe.value=void 0;let e=d.value?`${s.hostBase}/api/invocations/${d.value}`:void 0;e!==ue.value&&(ue.value=e,ce.value=void 0,V.value=[])}),l([()=>nt.invocation.value?.id,()=>nt.invocation.value?.status],([e,t])=>{Qe.value=e&&t?{id:e,status:t}:void 0}),l(Ke,e=>{fe(e?`usage`:`agents`),e||(f.value||(A.value=!0),!U.isLoading.value&&U.invocations.value.length===0&&ln())},{immediate:!0}),l(f,()=>{(_.value||m.value||h.value)&&Ft()},{immediate:!0}),l(_,e=>{e&&Ft()}),be.value&&sn(),se(()=>{Ee=window.matchMedia(`(min-width: 981px)`),dn(),Ee.addEventListener(`change`,dn),document.addEventListener(`visibilitychange`,pn),pn()}),D(()=>{Oe?.abort(),je?.abort(),an(),we&&clearInterval(we),Ee?.removeEventListener(`change`,dn),document.removeEventListener(`visibilitychange`,pn)}),(i,o)=>{let s=Je,c=Ae,l=pe,u=Ne,p=mt,m=le,h=pt,v=ft,y=gr,C=dt,D=Ve;return H(),S(Ie,{active:Ke.value?`usage`:`agents`,"sections-base":t.sectionsBase},{default:r(()=>[Ke.value?E(``,!0):(H(),S(v,{key:0,id:`agent-sessions`,class:`vitehub-console__sessions`,open:F.value,"onUpdate:open":o[3]||=e=>F.value=e,"default-size":16,"min-size":13,"max-size":26,menu:{title:`Agent sessions`,description:`Browse read-only Agent Invocations.`},ui:{root:`md:flex`,header:`p-0`,body:`gap-0 overflow-hidden p-0`,content:`md:hidden w-[calc(100vw-0.75rem)] max-w-none`,overlay:`md:hidden`},resizable:``},{header:r(()=>[w(`div`,AC,[o[32]||=w(`span`,{class:`min-w-0 flex-1 truncate`},`Agents`,-1),lt.value?(H(),S(c,{key:0,text:`New chat`},{default:r(()=>[P(s,{"aria-label":`New chat`,color:`neutral`,icon:`i-lucide-square-pen`,size:`xs`,square:``,variant:`ghost`,onClick:Yt})]),_:1})):E(``,!0),at.value?E(``,!0):(H(),S(p,{key:1,open:_.value,"onUpdate:open":o[0]||=e=>_.value=e,content:{align:`end`,collisionPadding:12},ui:{content:`w-72 max-w-[calc(100vw-1.5rem)] overflow-hidden p-0`}},{content:r(()=>[w(`div`,jC,[o[31]||=w(`p`,{class:`min-w-0 flex-1 truncate text-sm font-medium text-highlighted`},`Filter sessions`,-1),_t.value?(H(),S(s,{key:0,color:`neutral`,label:`Clear`,size:`xs`,variant:`ghost`,onClick:nn})):E(``,!0)]),T.value?(H(),g(`div`,MC,[(H(),g(x,null,a(4,e=>P(l,{key:e,class:`h-7 rounded-md`})),64))])):k.value?(H(),g(`div`,NC,[P(De,{compact:``,error:k.value,title:`Could not load session filters`,retry:Ft},null,8,[`error`])])):vt.value.length?(H(),S(u,{key:3,by:`id`,close:!1,groups:vt.value,"model-value":yt.value,multiple:``,placeholder:`Filter values…`,"selected-icon":`i-lucide-check`,size:`sm`,ui:{input:`[&>input]:h-9 [&>input]:text-sm`,content:`max-h-72`,group:`p-1`,label:`px-2 pb-1 pt-2 text-xs font-medium text-muted`,item:`px-2 py-1.5 text-[13px] before:rounded-md data-highlighted:not-data-disabled:before:bg-elevated`,itemLabelBase:`text-default`,itemTrailingIcon:`size-3.5 text-highlighted`,empty:`px-3 py-4 text-start text-xs`},"onUpdate:modelValue":en},null,8,[`groups`,`model-value`])):(H(),g(`p`,PC,` No filter values recorded yet. Sessions record their Capabilities and who triggered them. `))]),default:r(()=>[P(s,{"aria-label":`Filter sessions`,color:_t.value?`primary`:`neutral`,icon:`i-lucide-funnel`,size:`xs`,square:``,variant:_t.value?`soft`:`ghost`},null,8,[`color`,`variant`])]),_:1},8,[`open`]))])]),default:r(()=>[at.value?E(``,!0):(H(),g(x,{key:0},[!O(rt)&&M.value?(H(),g(`div`,FC,[P(De,{compact:``,error:M.value,title:`Could not load Agents`,retry:sn},null,8,[`error`])])):E(``,!0),st.value?(H(),g(`section`,IC,[w(`h2`,LC,[w(`button`,{type:`button`,class:`vitehub-console__section-label`,"aria-controls":`vitehub-console-agent-list`,"aria-expanded":ut.value,onClick:tn},[o[33]||=w(`span`,null,`Agents`,-1),w(`span`,zC,B(ee.value.length),1),P(m,{name:`i-lucide-chevron-right`,class:`vitehub-console__section-chevron size-3 shrink-0`})],8,RC)]),b(w(`ul`,BC,[(H(!0),g(x,null,a(W.value.visible,e=>(H(),g(`li`,{key:e},[w(`button`,{type:`button`,class:`vitehub-console__agent-row`,"aria-current":e===f.value?`true`:void 0,title:e,onClick:t=>Xt(e)},[o[34]||=w(`span`,{class:`vitehub-console__agent-dot`,"aria-hidden":`true`},null,-1),w(`span`,HC,B(e),1)],8,VC)]))),128)),W.value.hidden?(H(),g(`li`,UC,[w(`button`,{type:`button`,class:`vitehub-console__agent-row vitehub-console__agent-more`,onClick:o[1]||=e=>ht.value=!0},[o[35]||=w(`span`,{class:`vitehub-console__agent-dot invisible`,"aria-hidden":`true`},null,-1),w(`span`,null,`Show `+B(W.value.hidden)+` more`,1)])])):E(``,!0)],512),[[n,ut.value]])])):E(``,!0),!O(rt)||ot.value.length?(H(),g(`h2`,WC,[o[36]||=w(`span`,null,`Sessions`,-1),f.value?(H(),g(`span`,{key:0,class:`vitehub-console__sessions-agent`,title:f.value},B(f.value),9,GC)):E(``,!0),_t.value?(H(),g(`span`,KC,B(_t.value===1?`1 filter`:`${_t.value} filters`),1)):E(``,!0)])):E(``,!0),!O(rt)&&O(U).error.value||O(U).loadMoreError.value?(H(),g(`div`,qC,[P(De,{compact:``,error:!O(rt)&&O(U).error.value||O(U).loadMoreError.value,title:`Could not load sessions`,retry:!O(rt)&&O(U).error.value?O(U).refresh:void 0},null,8,[`error`,`retry`]),O(U).cursor.value&&O(U).loadMoreError.value?(H(),S(s,{key:0,class:`mt-2`,color:`neutral`,label:`Retry loading older sessions`,size:`sm`,variant:`soft`,loading:O(U).isLoadingMore.value,onClick:O(U).loadMore},null,8,[`loading`,`onClick`])):E(``,!0)])):E(``,!0),!O(rt)&&(ne.value||O(U).isLoading.value||O(U).cursor.value&&!O(U).loadMoreError.value)&&!ot.value.length?(H(),g(`div`,JC,[w(`div`,YC,[P(l,{class:`mt-0.5 size-4 rounded`}),w(`div`,XC,[w(`div`,ZC,[P(l,{class:`h-3 w-16 rounded`}),P(l,{class:`h-3 w-14 rounded`})]),P(l,{class:`h-4 w-full rounded`}),P(l,{class:`h-3 w-2/3 rounded`})])])])):E(``,!0),(!O(U).isLoading.value||ot.value.length)&&(!O(U).error.value||ot.value.length)&&(!O(U).cursor.value||ot.value.length)?(H(),S(O(Fe),{key:5,class:`vitehub-console__session-list min-h-0 flex-1 px-1.5 pb-3`,"continuation-key":O(U).cursor.value,"has-more":!!O(U).cursor.value,items:ot.value,loading:O(U).isLoading.value||O(U).isLoadingMore.value,"group-by":`recency`,now:ae.value,"selected-id":d.value,onEndReached:rn,onSelect:o[2]||=e=>Kt(e)},{loading:r(()=>[...o[37]||=[]]),footer:r(()=>[O(U).cursor.value&&ot.value.length?(H(),g(`div`,QC,[P(s,{color:`neutral`,label:`Load older sessions`,size:`xs`,variant:`soft`,loading:O(U).isLoadingMore.value,onClick:rn},null,8,[`loading`])])):E(``,!0)]),empty:r(()=>[_t.value?(H(),S(h,{key:0,class:`px-4`,icon:`i-lucide-message-square-more`,title:`No matching sessions`,actions:[{label:`Clear filters`,onClick:nn}]},null,8,[`actions`])):(H(),S(De,{key:1,section:`agents`,icon:`i-lucide-message-square-more`,title:`No sessions yet`,description:`Invoke an Agent from your app or from this Console. Its session appears here.`}))]),_:1},8,[`continuation-key`,`has-more`,`items`,`loading`,`now`,`selected-id`])):E(``,!0)],64))]),_:1},8,[`open`])),P(ze,{actions:gt.value,"agent-names":ee.value,"historical-agent-names":j.value,"agents-base":t.agentsBase,"definitions-base":t.definitionsBase,"kv-base":t.kvBase,"search-base":t.searchBase,"sections-base":t.sectionsBase},null,8,[`actions`,`agent-names`,`historical-agent-names`,`agents-base`,`definitions-base`,`kv-base`,`search-base`,`sections-base`]),Ke.value?(H(),S(TC,{key:1,base:t.usageBase,onOpenSessions:Ye},null,8,[`base`])):(H(),S(D,{key:2,id:`chat-session`,class:`vitehub-console__session-panel`,ui:{body:`min-h-0 overflow-hidden p-0 gap-0`}},{body:r(()=>[w(`div`,$C,[O(rt)?(H(),S(U_,{key:0,compact:!!St.value,retrying:Ce.value,onRetry:K,onOpenSessions:o[4]||=e=>F.value=!0},null,8,[`compact`,`retrying`])):E(``,!0),!O(rt)||St.value?(H(),g(`div`,ew,[he.value&&I.value&&L.value&&d.value?(H(),g(`div`,tw,[St.value?(H(),S(hb,{key:0,"workspace-base":`${t.hostBase}/api/_vitehub/console/invocations`,invocation:St.value,maximized:!0,tab:R.value,"onUpdate:tab":o[5]||=e=>R.value=e,"active-surface":z.value,"onUpdate:activeSurface":o[6]||=e=>z.value=e,"open-views":oe.value,"onUpdate:openViews":o[7]||=e=>oe.value=e,"open-paths":V.value,"onUpdate:openPaths":o[8]||=e=>V.value=e,"selected-path":ce.value,"onUpdate:selectedPath":o[9]||=e=>ce.value=e,class:`h-full`,onClose:Pt,onFocusActivity:Nt,onToggleMaximized:o[10]||=e=>L.value=!1},null,8,[`workspace-base`,`invocation`,`tab`,`active-surface`,`open-views`,`open-paths`,`selected-path`])):O(nt).isLoading.value?(H(),S(yv,{key:1,class:`h-full min-h-0`,maximized:!0,surface:`inspector`,onClose:Pt,onToggleMaximized:o[11]||=e=>L.value=!1})):(H(),S(yv,{key:2,class:`h-full min-h-0`,error:O(nt).error.value,maximized:!0,surface:`inspector`,onClose:Pt,onRetry:K,onToggleMaximized:o[12]||=e=>L.value=!1},null,8,[`error`]))])):he.value&&I.value&&d.value?(H(),S(y,{key:1,id:`agent-session-layout`,"auto-save-id":`vitehub-agent-session-layout-v2`,items:Mt,class:`h-full min-h-0 overflow-hidden`},{thread:r(()=>[w(`div`,nw,[P(Ev,{cost:Dt.value,"details-open":I.value,"external-url":jt.value,"has-display":!!Ct.value,"has-selection":!!d.value,loading:Ce.value,refreshable:wt.value,project:st.value?At.value:``,title:kt.value,tokens:Ot.value,onOpenSessions:o[13]||=e=>F.value=!0,onRefresh:K,onToggleDetails:o[14]||=e=>I.value=!I.value},e({_:2},[Tt.value||Et.value?{name:`actions`,fn:r(()=>[Tt.value?(H(),S(Nv,ie({key:0},Tt.value,{"agents-base":t.agentsBase,"api-base":t.apiBase,onDeleted:Jt,onStarted:qt}),null,16,[`agents-base`,`api-base`])):E(``,!0),Et.value?(H(),S(kv,ie({key:1},Et.value,{"api-base":t.apiBase,onCancelled:K}),null,16,[`api-base`])):E(``,!0)]),key:`0`}:void 0]),1032,[`cost`,`details-open`,`external-url`,`has-display`,`has-selection`,`loading`,`refreshable`,`project`,`title`,`tokens`]),!O(rt)&&St.value&&O(nt).error.value?(H(),g(`div`,rw,[P(De,{compact:``,error:O(nt).error.value,title:`Could not refresh this session`,retry:K},null,8,[`error`])])):E(``,!0),(O(nt).isLoading.value||et.value)&&!St.value?(H(),S(yv,{key:1,class:`min-h-0 flex-1`})):O(nt).error.value&&!St.value?(H(),S(De,{key:2,error:O(nt).error.value,title:`Could not load this session`,retry:K},null,8,[`error`])):St.value?(H(),S(O(p_),{key:3,header:!1,invocation:St.value,"selected-activity-id":de.value,"workspace-inspectable":!0,class:`min-h-0 flex-1`,onInspect:un},null,8,[`invocation`,`selected-activity-id`])):E(``,!0)])]),details:r(()=>[St.value?(H(),S(hb,{key:0,"workspace-base":`${t.hostBase}/api/_vitehub/console/invocations`,invocation:St.value,tab:R.value,"onUpdate:tab":o[15]||=e=>R.value=e,"active-surface":z.value,"onUpdate:activeSurface":o[16]||=e=>z.value=e,"open-views":oe.value,"onUpdate:openViews":o[17]||=e=>oe.value=e,"open-paths":V.value,"onUpdate:openPaths":o[18]||=e=>V.value=e,"selected-path":ce.value,"onUpdate:selectedPath":o[19]||=e=>ce.value=e,class:`h-full`,onClose:Pt,onFocusActivity:Nt,onToggleMaximized:o[20]||=e=>L.value=!0},null,8,[`workspace-base`,`invocation`,`tab`,`active-surface`,`open-views`,`open-paths`,`selected-path`])):O(nt).isLoading.value||et.value?(H(),S(yv,{key:1,class:`h-full min-h-0`,maximizable:!!d.value,surface:`inspector`,onClose:Pt,onToggleMaximized:o[21]||=e=>L.value=!0},null,8,[`maximizable`])):(H(),S(yv,{key:2,class:`h-full min-h-0`,error:O(nt).error.value,surface:`inspector`,onClose:Pt,onRetry:K,onToggleMaximized:o[22]||=e=>L.value=!0},null,8,[`error`]))]),"resize-handle":r(()=>[...o[38]||=[w(`span`,{class:`pointer-events-none absolute inset-y-0 start-1/2 w-px -translate-x-1/2 bg-(--ui-border) transition-colors group-hover:bg-primary group-focus-visible:bg-primary`},null,-1)]]),_:1})):(H(),g(`div`,iw,[P(Ev,{cost:Dt.value,"details-open":I.value,"external-url":jt.value,"has-display":!!Ct.value,"has-selection":!!d.value,loading:Ce.value,refreshable:wt.value,project:st.value?At.value:``,title:kt.value,tokens:Ot.value,onOpenSessions:o[23]||=e=>F.value=!0,onRefresh:K,onToggleDetails:o[24]||=e=>I.value=!I.value},e({_:2},[Tt.value||Et.value?{name:`actions`,fn:r(()=>[Tt.value?(H(),S(Nv,ie({key:0},Tt.value,{"agents-base":t.agentsBase,"api-base":t.apiBase,onDeleted:Jt,onStarted:qt}),null,16,[`agents-base`,`api-base`])):E(``,!0),Et.value?(H(),S(kv,ie({key:1},Et.value,{"api-base":t.apiBase,onCancelled:K}),null,16,[`api-base`])):E(``,!0)]),key:`0`}:void 0]),1032,[`cost`,`details-open`,`external-url`,`has-display`,`has-selection`,`loading`,`refreshable`,`project`,`title`,`tokens`]),et.value?(H(),S(yv,{key:0,class:`min-h-0 flex-1`})):!d.value&&at.value?(H(),S(De,{key:1,error:at.value,title:it.value?`Sign in to see Agent sessions`:`Could not load Agents or sessions`,retry:K},null,8,[`error`,`title`])):d.value?O(nt).error.value&&!St.value?(H(),S(De,{key:3,error:O(nt).error.value,title:`Could not load this session`,retry:K},null,8,[`error`])):O(nt).isLoading.value&&!St.value?(H(),S(yv,{key:4,class:`min-h-0 flex-1`})):St.value?(H(),g(`div`,ow,[!O(rt)&&O(nt).error.value?(H(),g(`div`,sw,[P(De,{compact:``,error:O(nt).error.value,title:`Could not refresh this session`,retry:K},null,8,[`error`])])):E(``,!0),P(O(p_),{header:!1,invocation:St.value,"selected-activity-id":de.value,"workspace-inspectable":!0,class:`min-h-0 flex-1`,onInspect:un},null,8,[`invocation`,`selected-activity-id`])])):E(``,!0):(H(),g(`div`,aw)),f.value&&ct.value&&!d.value&&!at.value?(H(),S(av,{key:6,agent:f.value,base:t.agentsBase,profiles:ct.value.profiles,onStarted:qt},null,8,[`agent`,`base`,`profiles`])):E(``,!0),!he.value&&St.value?(H(),S(C,{key:7,open:I.value,"onUpdate:open":o[30]||=e=>I.value=e,side:`right`,title:`Session details`,ui:{content:`w-full max-w-sm p-0`}},{content:r(()=>[P(hb,{"workspace-base":`${t.hostBase}/api/_vitehub/console/invocations`,invocation:St.value,maximizable:!1,tab:R.value,"onUpdate:tab":o[25]||=e=>R.value=e,"active-surface":z.value,"onUpdate:activeSurface":o[26]||=e=>z.value=e,"open-views":oe.value,"onUpdate:openViews":o[27]||=e=>oe.value=e,"open-paths":V.value,"onUpdate:openPaths":o[28]||=e=>V.value=e,"selected-path":ce.value,"onUpdate:selectedPath":o[29]||=e=>ce.value=e,class:`h-full`,onClose:Pt,onFocusActivity:Nt},null,8,[`workspace-base`,`invocation`,`tab`,`active-surface`,`open-views`,`open-paths`,`selected-path`])]),_:1},8,[`open`])):E(``,!0)]))])):E(``,!0)])]),_:1}))]),_:1},8,[`active`,`sections-base`])}}});export{cw as default};
|