@shepai/cli 1.170.0 → 1.171.0-pr503.31863d2
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/apis/json-schema/AgentType.yaml +1 -0
- package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts +1 -0
- package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.js +59 -2
- package/dist/packages/core/src/domain/generated/output.d.ts +1 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +1 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +3 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.js +23 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.js +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts +63 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.js +494 -0
- package/dist/packages/core/src/infrastructure/services/tool-installer/tools/codex.json +32 -0
- package/dist/packages/core/src/infrastructure/services/tool-installer/tools/copilot.json +32 -0
- package/dist/src/presentation/cli/commands/upgrade.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/upgrade.command.js +68 -3
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/agent-select.prompt.js +5 -0
- package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/check-agent-auth.js +18 -0
- package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-all-agent-models.js +4 -2
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts +1 -1
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.js +2 -0
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.js +1 -0
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts +1 -0
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.js +7 -0
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.js +11 -3
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts +1 -0
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.js +8 -0
- package/dist/translations/ar/cli.json +2 -0
- package/dist/translations/ar/tui.json +4 -0
- package/dist/translations/de/cli.json +2 -0
- package/dist/translations/de/tui.json +4 -0
- package/dist/translations/en/cli.json +2 -0
- package/dist/translations/en/tui.json +4 -0
- package/dist/translations/es/cli.json +2 -0
- package/dist/translations/es/tui.json +4 -0
- package/dist/translations/fr/cli.json +2 -0
- package/dist/translations/fr/tui.json +4 -0
- package/dist/translations/he/cli.json +2 -0
- package/dist/translations/he/tui.json +4 -0
- package/dist/translations/pt/cli.json +2 -0
- package/dist/translations/pt/tui.json +4 -0
- package/dist/translations/ru/cli.json +2 -0
- package/dist/translations/ru/tui.json +4 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/features/page.js.nft.json +1 -1
- package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +13 -13
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
- package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_18886033._.js +1 -1
- package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_deabc145._.js → _27acd26e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_deabc145._.js.map → _27acd26e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_77ae079a._.js → _4136c477._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_77ae079a._.js.map → _4136c477._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0d7dd23b._.js → _b966b198._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0d7dd23b._.js.map → _b966b198._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_df737cce._.js +1 -1
- package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
- package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +50 -50
- package/web/.next/static/chunks/{8e12deeabf6624e9.js → 09a08b7f90098440.js} +1 -1
- package/web/.next/static/chunks/{3d1df5c349d855eb.js → 2b896116f764da03.js} +1 -1
- package/web/.next/static/chunks/{b0a6fce5425f8d3a.js → 3247ba648d634827.js} +3 -3
- package/web/.next/static/chunks/{06a86173379e6c51.js → 411a0c6bde7ad962.js} +1 -1
- package/web/.next/static/chunks/{2b2f3a70ebd6ac1c.js → 50ece6880e22f161.js} +1 -1
- package/web/.next/static/chunks/65ba91a6e2590493.js +1 -0
- package/web/.next/static/chunks/{f9da308b3033c57a.js → 7109913081cd7349.js} +1 -1
- package/web/.next/static/chunks/{c5a0b452afc8fe47.js → 8e557def478b46c0.js} +1 -1
- package/web/.next/static/chunks/{a3802d6f8677cd04.js → a13b403c2902470e.js} +2 -2
- package/web/.next/static/chunks/{ca23a8642f750548.js → cd93c39d2f159a18.js} +2 -2
- package/web/.next/static/chunks/{74e5b5c7950efbc1.js → e84722a779b17648.js} +1 -1
- package/web/.next/static/chunks/{f51250616da82bd2.js → e9b4f53588a0cfab.js} +1 -1
- package/web/.next/static/chunks/{7a6854bb07182777.js → eb060a66a00aeea9.js} +1 -1
- package/web/.next/static/chunks/{16ed73f9880b7d63.js → fa72d334e24bbdc2.js} +1 -1
- package/web/.next/static/chunks/{f29814a72404ea2b.js → ff9eaac63c44d1a6.js} +1 -1
- package/web/public/icons/agents/copilot.svg +12 -0
- package/web/.next/static/chunks/9c6f8f49799efd3a.js +0 -1
- /package/web/.next/static/{0KDwNT3AGQmFGIwjHx99r → uFeGUlh9baBGxVUJHDOXJ}/_buildManifest.js +0 -0
- /package/web/.next/static/{0KDwNT3AGQmFGIwjHx99r → uFeGUlh9baBGxVUJHDOXJ}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{0KDwNT3AGQmFGIwjHx99r → uFeGUlh9baBGxVUJHDOXJ}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,83843,e=>{"use strict";let a=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>a],83843)},36479,e=>{"use strict";var a=e.i(20314),t=e.i(79054),s=e.i(31406),r=e.i(60112),o=e.i(21023);let n=(0,o.createServerReference)("404d622eb7547a026439b80e56c7b1fc60bbea99e7",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("409fa5874f2834de54a3d19a7fdb721076ed0ec6e9",o.callServer,void 0,o.findSourceMapURL,"listBranches");var c=e.i(23925),i=e.i(97667),d=e.i(83843),p=e.i(49228),h=e.i(83428);e.i(1650);var u=e.i(11495),m=e.i(45811),x=e.i(35364),f=e.i(98127),b=e.i(41957),v=e.i(66459),g=e.i(31777);let j=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));j.displayName="Command";let w=t.forwardRef(({className:e,...t},s)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(v.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:s,className:(0,g.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));w.displayName="CommandInput";let N=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));N.displayName="CommandList";let y=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));y.displayName="CommandEmpty";let C=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...t}));C.displayName="CommandGroup";let S=t.forwardRef(({className:e,selected:t,...s},r)=>(0,a.jsx)("button",{ref:r,type:"button","data-selected":t,className:(0,g.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));S.displayName="CommandItem",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-border -mx-1 h-px",e),...t})).displayName="CommandSeparator";var k=e.i(90382);function R({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:v,onRepositoryChange:R,branches:L=[],branchesLoading:B=!1}){let[P,E]=(0,t.useState)(""),[D,T]=(0,t.useState)(!1),[U,A]=(0,t.useState)(""),I=(0,t.useRef)(null),[O,F]=(0,t.useState)(!1),[G,K]=(0,t.useState)(""),M=(0,t.useRef)(null),$=l.find(e=>e.path===v),z=!!v;(0,t.useEffect)(()=>{e||(E(""),A(""),T(!1),F(!1),K(""))},[e]),(0,t.useEffect)(()=>{E(""),A("")},[v]);let W=(0,t.useCallback)(e=>{e.preventDefault();let a=P.trim();a&&v&&!o&&r(a,v)},[P,v,o,r]),q=(0,t.useCallback)(()=>{E(""),A(""),s()},[s]),H=(0,t.useCallback)(e=>{E(e),A(e),T(!1)},[]),J=(0,t.useCallback)(e=>{A(e.target.value),D||T(!0)},[D]),Q=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=U.trim();a&&(E(a),T(!1))}"Escape"===e.key&&(T(!1),A(P))},[U,P]),V=(0,t.useCallback)(e=>{R?.(e),F(!1),K("")},[R]),X=L.filter(e=>e.toLowerCase().includes(U.toLowerCase())),Y=G.trim()?l.filter(e=>e.name.toLowerCase().includes(G.toLowerCase())||e.path.toLowerCase().includes(G.toLowerCase())):l;(0,t.useEffect)(()=>{O?setTimeout(()=>M.current?.focus(),0):K("")},[O]);let Z=!P.trim()||!v||o,_=(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(m.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:q,size:"sm",modal:!1,header:_,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:W,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(k.Popover,{open:O,onOpenChange:F,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":O,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,g.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!$&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:$?$.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(f.Input,{ref:M,placeholder:"Search repositories...",value:G,onChange:e=>K(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===Y.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):Y.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":v===e.path,onClick:()=>V(e.path),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",v===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(i.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",v!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(k.Popover,{open:D,onOpenChange:T,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline",role:"combobox","aria-expanded":D,disabled:o||!z,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:z?B?"Loading branches...":P||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(j,{children:[(0,a.jsx)(w,{ref:I,placeholder:"Search branches...",value:U,onChange:J,onKeyDown:Q,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(N,{children:[!B&&0===X.length&&(0,a.jsx)(y,{children:0===L.length?"No branches found.":U?"No match — press Enter to use this value.":"No branches available."}),B?(0,a.jsx)(y,{children:(0,a.jsx)(h.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,X.length>0&&(0,a.jsx)(C,{children:X.map(e=>(0,a.jsxs)(S,{selected:e===P,onClick:()=>H(e),children:[(0,a.jsx)(c.Check,{className:(0,g.cn)("me-2 h-4 w-4",e===P?"opacity-100":"opacity-0")}),(0,a.jsx)(p.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:z?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{className:"text-destructive text-sm","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Button,{type:"button",variant:"outline",onClick:q,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(x.Button,{type:"submit",disabled:Z,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}function L({repositoryPath:e,repositories:o}){let c=(0,s.useRouter)(),i=(0,s.usePathname)(),[d,p]=(0,t.useState)(!1),[h,u]=(0,t.useState)(),[m,x]=(0,t.useState)([]),[f,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=i.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),x([]),l(v).then(x).catch(()=>x([])).finally(()=>b(!1))):x([])},[j,v]);let N=(0,t.useCallback)(()=>{c.push("/")},[c]),y=(0,t.useCallback)(e=>{g(e)},[]),C=(0,t.useCallback)((e,a)=>{u(void 0),p(!0),c.push("/"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),p(!1)})},[c]);return(0,a.jsx)(R,{open:w,onClose:N,onSubmit:C,isSubmitting:d,error:h,repositories:o,selectedRepositoryPath:v,onRepositoryChange:y,branches:m,branchesLoading:f})}e.s(["AdoptDrawerClient",()=>L],36479)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,83843,e=>{"use strict";let a=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>a],83843)},36479,e=>{"use strict";var a=e.i(20314),t=e.i(79054),s=e.i(31406),r=e.i(60112),o=e.i(21023);let n=(0,o.createServerReference)("40eda74686aedba3b343aa50949b4e0e56d248cffe",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("40e9f9df7bffff1dc295cf8c0124893cee203cc984",o.callServer,void 0,o.findSourceMapURL,"listBranches");var c=e.i(23925),i=e.i(97667),d=e.i(83843),p=e.i(49228),h=e.i(83428);e.i(1650);var u=e.i(11495),m=e.i(45811),f=e.i(35364),x=e.i(98127),b=e.i(41957),v=e.i(66459),g=e.i(31777);let j=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));j.displayName="Command";let w=t.forwardRef(({className:e,...t},s)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(v.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:s,className:(0,g.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));w.displayName="CommandInput";let N=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));N.displayName="CommandList";let y=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));y.displayName="CommandEmpty";let C=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...t}));C.displayName="CommandGroup";let S=t.forwardRef(({className:e,selected:t,...s},r)=>(0,a.jsx)("button",{ref:r,type:"button","data-selected":t,className:(0,g.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));S.displayName="CommandItem",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-border -mx-1 h-px",e),...t})).displayName="CommandSeparator";var k=e.i(90382);function R({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:v,onRepositoryChange:R,branches:L=[],branchesLoading:B=!1}){let[P,E]=(0,t.useState)(""),[D,T]=(0,t.useState)(!1),[U,A]=(0,t.useState)(""),I=(0,t.useRef)(null),[O,F]=(0,t.useState)(!1),[G,K]=(0,t.useState)(""),M=(0,t.useRef)(null),$=l.find(e=>e.path===v),z=!!v;(0,t.useEffect)(()=>{e||(E(""),A(""),T(!1),F(!1),K(""))},[e]),(0,t.useEffect)(()=>{E(""),A("")},[v]);let W=(0,t.useCallback)(e=>{e.preventDefault();let a=P.trim();a&&v&&!o&&r(a,v)},[P,v,o,r]),q=(0,t.useCallback)(()=>{E(""),A(""),s()},[s]),H=(0,t.useCallback)(e=>{E(e),A(e),T(!1)},[]),J=(0,t.useCallback)(e=>{A(e.target.value),D||T(!0)},[D]),Q=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=U.trim();a&&(E(a),T(!1))}"Escape"===e.key&&(T(!1),A(P))},[U,P]),V=(0,t.useCallback)(e=>{R?.(e),F(!1),K("")},[R]),X=L.filter(e=>e.toLowerCase().includes(U.toLowerCase())),Y=G.trim()?l.filter(e=>e.name.toLowerCase().includes(G.toLowerCase())||e.path.toLowerCase().includes(G.toLowerCase())):l;(0,t.useEffect)(()=>{O?setTimeout(()=>M.current?.focus(),0):K("")},[O]);let Z=!P.trim()||!v||o,_=(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(m.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into Shep's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:q,size:"sm",modal:!1,header:_,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:W,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(k.Popover,{open:O,onOpenChange:F,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":O,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,g.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!$&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:$?$.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(x.Input,{ref:M,placeholder:"Search repositories...",value:G,onChange:e=>K(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===Y.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):Y.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":v===e.path,onClick:()=>V(e.path),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",v===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(i.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",v!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(k.Popover,{open:D,onOpenChange:T,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(f.Button,{variant:"outline",role:"combobox","aria-expanded":D,disabled:o||!z,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:z?B?"Loading branches...":P||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(j,{children:[(0,a.jsx)(w,{ref:I,placeholder:"Search branches...",value:U,onChange:J,onKeyDown:Q,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(N,{children:[!B&&0===X.length&&(0,a.jsx)(y,{children:0===L.length?"No branches found.":U?"No match — press Enter to use this value.":"No branches available."}),B?(0,a.jsx)(y,{children:(0,a.jsx)(h.Loader2,{className:"mx-auto h-4 w-4 animate-spin"})}):null,X.length>0&&(0,a.jsx)(C,{children:X.map(e=>(0,a.jsxs)(S,{selected:e===P,onClick:()=>H(e),children:[(0,a.jsx)(c.Check,{className:(0,g.cn)("me-2 h-4 w-4",e===P?"opacity-100":"opacity-0")}),(0,a.jsx)(p.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:z?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{className:"text-destructive text-sm","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(f.Button,{type:"button",variant:"outline",onClick:q,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(f.Button,{type:"submit",disabled:Z,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}function L({repositoryPath:e,repositories:o}){let c=(0,s.useRouter)(),i=(0,s.usePathname)(),[d,p]=(0,t.useState)(!1),[h,u]=(0,t.useState)(),[m,f]=(0,t.useState)([]),[x,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=i.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),f([]),l(v).then(f).catch(()=>f([])).finally(()=>b(!1))):f([])},[j,v]);let N=(0,t.useCallback)(()=>{c.push("/")},[c]),y=(0,t.useCallback)(e=>{g(e)},[]),C=(0,t.useCallback)((e,a)=>{u(void 0),p(!0),c.push("/"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),p(!1)})},[c]);return(0,a.jsx)(R,{open:w,onClose:N,onSubmit:C,isSubmitting:d,error:h,repositories:o,selectedRepositoryPath:v,onRepositoryChange:y,branches:m,branchesLoading:x})}e.s(["AdoptDrawerClient",()=>L],36479)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76852,e=>{"use strict";var t=e.i(79054),r=e.i(
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76852,e=>{"use strict";var t=e.i(79054),r=e.i(37523),a=e.i(95863),l=e.i(40882),c=e.i(21023);let s=(0,c.createServerReference)("400a87dd1ed54597c55ad6a3ce5a8de0dde27352ee",c.callServer,void 0,c.findSourceMapURL,"syncRepository");function i(e){let[c,i]=(0,t.useState)(!1),[u,d]=(0,t.useState)(!1),[n,o]=(0,t.useState)(!1),[p,h]=(0,t.useState)(!1),[y,f]=(0,t.useState)(null),[m,k]=(0,t.useState)(null),[v,x]=(0,t.useState)(null),[S,b]=(0,t.useState)(null),R=(0,t.useRef)(null),M=(0,t.useRef)(null),g=(0,t.useRef)(null),C=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{R.current&&clearTimeout(R.current),M.current&&clearTimeout(M.current),g.current&&clearTimeout(g.current),C.current&&clearTimeout(C.current)},[]);let T=(0,t.useCallback)(async(t,r,a,l,c)=>{if(e&&!c){l.current&&clearTimeout(l.current),r(!0),a(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";a(t),l.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>a(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>T(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),i,f,R,c),[T,c,e]),openInShell:(0,t.useCallback)(()=>T(()=>(0,a.openShell)({repositoryPath:e.repositoryPath}),d,k,M,u),[T,u,e]),openFolder:(0,t.useCallback)(()=>T(()=>(0,l.openFolder)(e.repositoryPath),o,x,g,n),[T,n,e]),syncMain:(0,t.useCallback)(()=>T(()=>s(e.repositoryId??""),h,b,C,p),[T,p,e]),ideLoading:c,shellLoading:u,folderLoading:n,syncLoading:p,ideError:y,shellError:m,folderError:v,syncError:S}}e.s(["useRepositoryActions",()=>i],76852)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},1650,e=>{"use strict";e.i(11495),e.s([])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},37260,e=>{"use strict";let t=(0,e.i(3645).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);e.s(["Archive",()=>t],37260)},8986,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>t],8986)},48923,e=>{"use strict";let t=(0,e.i(3645).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",()=>t],48923)},37523,95863,40882,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("4042a0a327ad089252f8fae1c15d6d94528b5f3e6e",t.callServer,void 0,t.findSourceMapURL,"openIde");e.s(["openIde",()=>r],37523);let a=(0,t.createServerReference)("408c9054d1ff86c4b07399ab51d3eb5305292499eb",t.callServer,void 0,t.findSourceMapURL,"openShell");e.s(["openShell",()=>a],95863);let l=(0,t.createServerReference)("40bc39404fa1f870d89b5dd4038c04d082ee47d6d5",t.callServer,void 0,t.findSourceMapURL,"openFolder");e.s(["openFolder",()=>l],40882)},58481,e=>{"use strict";let t=(0,e.i(3645).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",()=>t],58481)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},10714,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>t])},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],91925)},59976,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("40e0393d6afdd69494c71a916ddc3a08890a987850",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},54793,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({icon:e,title:a,description:l,action:c,className:s,...i}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",s),...i,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:a}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,c?(0,t.jsx)("div",{className:"mt-2",children:c}):null]})}e.s(["EmptyState",()=>a],7729),e.s([],54793)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87292,e=>{"use strict";var t=e.i(20314),a=e.i(79054),s=e.i(31406);e.i(41001);var r=e.i(64780),i=e.i(84840),n=e.i(57638),o=e.i(3645);let l=(0,o.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]),c=(0,o.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),u=(0,o.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),d=(0,o.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),h=(0,o.default)("volume-off",[["path",{d:"M16 9a5 5 0 0 1 .95 2.293",key:"1fgyg8"}],["path",{d:"M19.364 5.636a9 9 0 0 1 1.889 9.96",key:"l3zxae"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11",key:"1gbwow"}],["path",{d:"M9.828 4.172A.686.686 0 0 1 11 4.657v.686",key:"s2je0y"}]]);var m=e.i(53360);let p=(0,o.default)("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var f=e.i(81975),g=e.i(12103),x=e.i(39200);let b=(0,o.default)("table-properties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var y=e.i(35340),v=e.i(24035),w=e.i(8361);function j({icon:e,label:a,href:s,active:r=!1}){let i=(0,w.useSoundAction)("navigate");return(0,t.jsx)(n.SidebarMenuItem,{"data-testid":"sidebar-nav-item",children:(0,t.jsx)(n.SidebarMenuButton,{asChild:!0,isActive:r,tooltip:a,children:(0,t.jsxs)(v.default,{href:s,onClick:()=>i.play(),children:[(0,t.jsx)(e,{}),(0,t.jsx)("span",{children:a})]})})})}var C=e.i(71379),C=C,k=e.i(35364),N=e.i(31777);function S({className:e}){let{toggleSidebar:a,open:s}=(0,n.useSidebar)(),r=(0,w.useSoundAction)("expand"),i=(0,w.useSoundAction)("collapse");return(0,t.jsx)("div",{className:(0,N.cn)("flex",e),children:(0,t.jsx)(k.Button,{"data-testid":"sidebar-collapse-toggle",variant:"ghost",size:"icon",className:"size-7 cursor-pointer group-data-[collapsible=icon]:size-8!",onClick:()=>{s?i.play():r.play(),a()},"aria-label":s?"Collapse sidebar":"Expand sidebar",children:(0,t.jsx)(C.default,{className:"size-4"})})})}function M({className:e,size:a=24,variant:s="default"}){return(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 194 200",width:a,height:a,className:(0,N.cn)("shrink-0","dev"===s&&"text-cyan-400",e),"aria-hidden":"true",children:(0,t.jsx)("g",{transform:"matrix(1, 0, 0, 1, -111, -208)",children:(0,t.jsx)("path",{d:"M 198 406 C196,405 194,403 193,401 C192,399 191,398 186,398 C178,397 174,394 170,387 L 168 381 L 163 381 C156,381 150,377 147,370 C144,364 143,359 146,353 C148,348 148,347 147,347 C145,347 140,343 138,339 C133,329 139,314 149,311 L 152 311 L 149 307 C145,302 145,294 149,290 C151,288 152,287 151,286 C150,283 152,278 155,276 C156,275 159,274 162,273 C165,273 166,273 168,276 C171,278 171,280 172,287 C173,294 174,297 177,304 C180,309 182,314 183,316 C186,327 193,336 199,339 C204,342 211,342 216,340 C222,336 231,324 234,314 C235,312 237,307 239,302 C240,298 242,292 242,289 C243,281 245,278 247,275 C250,273 251,273 255,273 C261,274 264,278 264,282 C264,284 264,286 263,287 C262,287 263,288 265,290 C272,295 272,303 267,309 L 265 312 L 269 314 C276,317 279,323 279,332 C279,339 277,343 272,347 C268,351 268,351 269,354 C272,358 271,366 269,371 C266,376 259,381 254,381 C252,381 251,382 248,386 C242,395 234,400 227,399 C224,398 223,398 221,401 C220,403 217,405 216,406 C211,409 203,409 198,406 ZM 136 271 C123,267 115,262 113,256 C111,251 111,251 113,251 C118,254 124,254 132,252 C136,252 141,251 144,251 C149,251 157,253 162,256 C166,258 166,258 166,264 L 166 269 L 160 270 C149,272 142,272 136,271 ZM 264 271 C263,271 259,270 256,270 L 250 270 L 250 265 C249,259 250,257 259,254 C265,251 272,251 289,252 C297,253 299,253 302,252 C305,250 305,250 305,252 C305,255 301,262 297,264 C289,270 272,273 264,271 ZM 162 249 C160,247 159,245 159,242 C159,236 164,230 169,230 C170,230 171,228 171,225 C171,216 176,210 184,209 C189,209 195,211 195,213 C195,214 196,213 197,212 C201,209 204,208 208,208 C212,208 217,210 219,212 C220,214 220,213 223,211 C226,208 234,208 239,211 C243,214 246,221 246,226 C245,230 245,230 247,230 C253,230 258,238 257,244 C256,249 251,252 245,252 C241,252 237,251 234,248 C232,247 232,247 228,249 C225,251 222,252 220,252 C216,252 212,250 210,247 C209,246 209,246 206,248 C201,252 192,253 185,248 C183,247 183,247 178,249 C172,253 166,253 162,249 ZM 116 249 C112,248 114,247 119,247 C122,247 127,246 130,245 C138,242 146,242 152,245 L 158 248 L 148 247 C142,247 138,247 133,248 C128,250 120,250 116,249 ZM 284 248 C281,247 277,247 270,247 L 260 248 L 263 246 C269,243 276,242 284,245 C289,246 295,247 298,247 C303,247 304,247 303,248 C301,250 289,250 284,248 Z",fill:"currentColor"})})})}var T=e.i(2828);function E({version:e,branch:s,commitHash:i,isDev:n=!1,packageName:o="@shepai/cli",description:l,instancePath:c}){let{t:u}=(0,r.useTranslation)("web"),d=i?.slice(0,7),{latest:h,updateAvailable:m}=function(e){let[t,s]=(0,a.useState)(null),[r,i]=(0,a.useState)(!0);(0,a.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/npm-version");if(!t.ok)return;let a=await t.json();!e&&a.latest&&s(a.latest)}catch{}finally{e||i(!1)}}(),()=>{e=!0}},[]);let n=null!==t&&function(e,t){let a=e=>e.split("-")[0].split(".").map(Number),s=a(e),r=a(t);for(let e=0;e<3;e++){let t=s[e]??0,a=r[e]??0;if(t>a)return 1;if(t<a)return -1}return 0}(t,e)>0;return{latest:t,updateAvailable:n,loading:r}}(e),{status:p,startUpgrade:f}=function(){let[e,t]=(0,a.useState)("idle"),[s,r]=(0,a.useState)(""),[i,n]=(0,a.useState)(),o=(0,a.useRef)(null),l=(0,a.useRef)(!1),c=(0,a.useCallback)(()=>{if("upgrading"===e||"restarting"===e)return;t("upgrading"),r(""),n(void 0),l.current=!1;let a=new AbortController;return o.current=a,fetch("/api/cli-upgrade",{method:"POST",signal:a.signal}).then(async e=>{if(!e.ok||!e.body){t("error"),n(`Server returned ${e.status}`);return}let a=e.body.getReader(),s=new TextDecoder,i="";for(;;){let{done:e,value:o}=await a.read();if(e)break;let c=(i+=s.decode(o,{stream:!0})).split("\n");for(let e of(i=c.pop()??"",c)){if(e.startsWith("event: restarting")){l.current=!0,t("restarting"),function(e,t){let a=Date.now()+3e4,s=()=>{Date.now()>a||fetch("/api/version",{method:"GET",cache:"no-store"}).then(e=>{e.ok?window.location.reload():setTimeout(s,500)}).catch(()=>{setTimeout(s,500)})};setTimeout(s,500)}(0,0);continue}if(!e.startsWith("event: done")&&e.startsWith("data: ")){let a=e.slice(6);try{let e=JSON.parse(a);"upgraded"===e.status?t("upgraded"):"up-to-date"===e.status?t("up-to-date"):"error"===e.status&&(t("error"),n(e.errorMessage))}catch{r(e=>e+a)}}}}}).catch(e=>{l.current||e instanceof DOMException&&"AbortError"===e.name||(t("error"),n(e instanceof Error?e.message:"Upgrade failed"))}),()=>{a.abort()}},[e]);return{status:e,output:s,errorMessage:i,startUpgrade:c}}(),g=n?`${e}-dev`:`v${e}`,x="upgrading"===p,b="restarting"===p,y="upgraded"===p;return(0,t.jsx)(T.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground/80 hover:text-muted-foreground relative cursor-default text-[11px] leading-tight transition-colors","data-testid":"version-label",children:[g,!m||y||b?null:(0,t.jsx)("span",{className:"absolute -top-0.5 -right-1.5 size-1.5 rounded-full bg-emerald-400","data-testid":"update-dot"})]})}),(0,t.jsxs)(T.TooltipContent,{side:"right",className:"max-w-[280px] space-y-1 p-3 text-start",children:[(0,t.jsx)("div",{className:"mb-1.5 text-xs font-semibold",children:o}),l?(0,t.jsx)("div",{className:"text-[10px] leading-snug opacity-70",children:l}):null,(0,t.jsxs)("div",{className:"border-t border-white/10 pt-1.5",children:[(0,t.jsx)(A,{label:u("versionBadge.version"),value:g}),n&&s?(0,t.jsx)(A,{label:u("versionBadge.branch"),value:s}):null,n&&d?(0,t.jsx)(A,{label:u("versionBadge.commit"),value:d,mono:!0}):null,n&&c?(0,t.jsx)(A,{label:u("versionBadge.path"),value:c,mono:!0}):null,h?(0,t.jsx)(A,{label:"Latest",value:`v${h}`,highlight:m}):null]}),b?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("span",{className:"text-[10px] font-medium text-emerald-400","data-testid":"upgrade-restarting",children:"Restarting..."})}):y?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("span",{className:"text-[10px] font-medium text-emerald-400","data-testid":"upgrade-success",children:"Upgraded successfully"})}):"error"===p?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("span",{className:"text-[10px] font-medium text-red-400","data-testid":"upgrade-error",children:"Upgrade failed"})}):m?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("button",{type:"button",onClick:f,disabled:x||b,className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-400 transition-colors hover:text-emerald-300 disabled:opacity-50","data-testid":"upgrade-button",children:x?"Upgrading...":b?"Restarting...":`Upgrade to v${h}`})}):null]})]})})}function A({label:e,value:a,highlight:s,mono:r}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 text-[10px]",children:[(0,t.jsx)("span",{className:"opacity-60",children:e}),(0,t.jsx)("span",{className:[s?"font-medium text-emerald-400":"",r||!s?"font-mono":""].filter(Boolean).join(" "),children:a})]})}function P({startedAt:e}){let[s,r]=(0,a.useState)(()=>Date.now()-e);return(0,a.useEffect)(()=>{let t=setInterval(()=>{(0,a.startTransition)(()=>r(Date.now()-e))},1e3);return()=>clearInterval(t)},[e]),(0,t.jsx)("span",{"data-testid":"elapsed-time",className:"tabular-nums",children:function(e){let t=Math.floor(e/1e3);if(t>=3600){let e=Math.floor(t/3600);return`${e}h`}let a=Math.floor(t/60);return`${String(a).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}(s)})}var D=e.i(51251),L=e.i(83428),O=e.i(34119),q=e.i(94819),I=e.i(54277),Q=e.i(55016);let R={"action-needed":{icon:D.CircleAlert,iconClass:"text-amber-500",bgClass:"bg-amber-500/10",labelKey:"sidebar.statusActionNeeded"},"in-progress":{icon:L.Loader2,iconClass:"text-blue-500 animate-spin",bgClass:"bg-blue-500/10",labelKey:"sidebar.statusInProgress"},pending:{icon:Q.Clock,iconClass:"text-slate-400",bgClass:"bg-slate-400/10",labelKey:"sidebar.statusPending"},blocked:{icon:q.Ban,iconClass:"text-gray-400",bgClass:"bg-gray-400/10",labelKey:"sidebar.statusBlocked"},error:{icon:I.CircleX,iconClass:"text-red-500",bgClass:"bg-red-500/10",labelKey:"sidebar.statusError"},done:{icon:O.CircleCheck,iconClass:"text-emerald-500",bgClass:"bg-emerald-500/10",labelKey:"sidebar.statusDone"}},z=["action-needed","error","blocked","in-progress","pending","done"];var F=e.i(86782),K=e.i(29847);function H({name:e,status:a,startedAt:s,duration:r,agentType:i,modelId:o,onClick:l}){let{icon:c,iconClass:u}=R[a],d=i?(0,F.getAgentTypeIcon)(i):null;return(0,t.jsx)(n.SidebarMenuItem,{"data-testid":"feature-list-item",children:(0,t.jsxs)(n.SidebarMenuButton,{size:"sm",onClick:l,tooltip:e,className:"cursor-pointer",children:[(0,t.jsx)(c,{className:u}),(0,t.jsx)("span",{className:"flex-1 truncate font-medium",children:e}),"in-progress"===a&&null!=s?(0,t.jsx)("span",{"data-testid":"feature-list-item-meta",className:"text-muted-foreground ml-auto text-xs tabular-nums",children:(0,t.jsx)(P,{startedAt:s})}):null,"done"===a&&r?(0,t.jsx)("span",{"data-testid":"feature-list-item-meta",className:"text-muted-foreground ml-auto text-xs tabular-nums",children:r}):null,d?(0,t.jsx)(T.TooltipProvider,{children:(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"ml-auto shrink-0",children:(0,t.jsx)(d,{className:"h-3.5 w-3.5"})})}),(0,t.jsxs)(T.TooltipContent,{side:"right",children:[(0,t.jsx)("span",{className:"font-medium",children:F.agentTypeLabels[i]??i}),o?(0,t.jsxs)("span",{className:"ms-1 opacity-70",children:["· ",(0,K.getModelMeta)(o).displayName||o]}):null]})]})}):null]})})}var B=e.i(73709);let _="shep-animations-enabled",$="shep:animations-toggle",G="no-animations",U="shep-theme";function X({label:e,count:a,children:s}){return(0,t.jsxs)(n.SidebarGroup,{"data-testid":"feature-status-group",className:"px-2 py-1",children:[(0,t.jsxs)(n.SidebarGroupLabel,{className:"text-muted-foreground h-6 px-2 text-[0.65rem] font-semibold tracking-wider uppercase",children:[e,(0,t.jsx)("span",{"aria-label":`${a} items`,className:"bg-sidebar-accent text-sidebar-accent-foreground ms-1.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[0.6rem] font-medium tabular-nums",role:"img",children:a})]}),(0,t.jsx)(n.SidebarGroupContent,{children:(0,t.jsx)(n.SidebarMenu,{className:"gap-0.5",children:s})})]})}var W=e.i(99105),Z=e.i(81542),Y=e.i(3214);function V({repoName:e,featureCount:s,children:r,defaultOpen:i=!0,onAddFeature:n}){let[o,l]=(0,a.useState)(i);return(0,t.jsxs)("div",{"data-testid":"repo-group",className:"group/repo mb-1",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!o),className:(0,N.cn)("text-sidebar-foreground hover:bg-sidebar-accent flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs font-semibold","transition-colors duration-100"),"aria-expanded":o,children:[(0,t.jsx)(W.ChevronDown,{className:(0,N.cn)("text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200",!o&&"-rotate-90")}),(0,t.jsx)(Z.GitFork,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),(0,t.jsx)("span",{"aria-label":`${s} features`,className:"bg-sidebar-accent text-sidebar-accent-foreground ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 text-[0.6rem] font-medium tabular-nums",role:"img",children:s})]}),n?(0,t.jsx)("button",{type:"button","data-testid":"repo-add-feature",onClick:e=>{e.stopPropagation(),n()},className:(0,N.cn)("text-muted-foreground hover:text-sidebar-foreground hover:bg-sidebar-accent shrink-0 rounded-md p-1 opacity-0 transition-all duration-100 group-hover/repo:opacity-100","focus-visible:ring-ring focus-visible:opacity-100 focus-visible:ring-1 focus-visible:outline-none"),"aria-label":`Add feature to ${e}`,children:(0,t.jsx)(Y.Plus,{className:"h-3.5 w-3.5"})}):null]}),o?(0,t.jsx)("div",{className:"pl-2",children:r}):null]})}function J({label:e,className:a}){return(0,t.jsx)(n.SidebarGroup,{"data-testid":"sidebar-section-header",className:(0,N.cn)("px-2 py-1",a),children:(0,t.jsx)("div",{className:"text-sidebar-foreground flex h-7 w-full shrink-0 items-center px-2 text-sm font-medium",children:(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})})})}let ee={version:"unknown",packageName:"@shepai/cli",description:"Autonomous AI Native SDLC Platform",branch:"",commitHash:"",instancePath:"",isDev:!1};function et({features:e,featureFlags:i,onFeatureClick:o,onAddFeature:v}){let{t:C,i18n:k}=(0,r.useTranslation)("web"),N=(0,s.usePathname)(),{state:A}=(0,n.useSidebar)(),P="collapsed"===A,{mounted:D,visible:L}=function(e,t){let[s,r]=(0,a.useState)(!e),[i,n]=(0,a.useState)(!e);return(0,a.useEffect)(()=>{if(!e){r(!0);let e=requestAnimationFrame(()=>n(!0));return()=>cancelAnimationFrame(e)}n(!1);let t=window.setTimeout(()=>r(!1),200);return()=>window.clearTimeout(t)},[e,200]),{mounted:s,visible:i}}(P,0),O=function(){let[e,t]=(0,a.useState)(ee);return(0,a.useEffect)(()=>{let e=!1;return async function(){try{let a=await fetch("/api/version");if(!a.ok)return;let s=await a.json();e||t(s)}catch{}}(),()=>{e=!0}},[]),e}(),{enabled:q,toggle:I}=(0,B.useSoundEnabled)(),{enabled:Q,toggle:F}=function(){let[e,t]=(0,a.useState)(!0);(0,a.useEffect)(()=>{"false"===localStorage.getItem(_)&&(t(!1),document.body.classList.add(G));let e=e=>{let a=e.detail;t(a),document.body.classList.toggle(G,!a)};return window.addEventListener($,e),()=>window.removeEventListener($,e)},[]);let s=(0,a.useCallback)(()=>{let a=!e;localStorage.setItem(_,String(a)),t(a),document.body.classList.toggle(G,!a),window.dispatchEvent(new CustomEvent($,{detail:a}))},[e]);return{enabled:e,toggle:s}}(),{resolvedTheme:K,theme:W,setTheme:Z}=function(){let[e,t]=(0,a.useState)("system"),[s,r]=(0,a.useState)("light"),i=(0,a.useCallback)(()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[]),n=(0,a.useCallback)(e=>"system"===e?i():e,[i]),o=(0,a.useCallback)(e=>{if("u"<typeof document)return;let t=document.documentElement;t.classList.remove("light","dark"),t.classList.add(e),r(e)},[]),l=(0,a.useCallback)(e=>{t(e),"u">typeof localStorage&&localStorage.setItem(U,e),o(n(e))},[n,o]);return(0,a.useEffect)(()=>{let e=localStorage.getItem(U)??"system";t(e),o(n(e))},[n,o]),(0,a.useEffect)(()=>{let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{"system"===e&&o(n("system"))};return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e,n,o]),{theme:e,resolvedTheme:s,setTheme:l}}(),Y=(0,w.useSoundAction)("toggle-on"),et=(0,w.useSoundAction)("toggle-off"),ea=(0,w.useSoundAction)("navigate"),es=(0,a.useMemo)(()=>{let t=new Map;for(let a of e){let e=a.repositoryPath,s=t.get(e);s||(s={repoName:a.repositoryName,features:[]},t.set(e,s)),s.features.push(a)}return Array.from(t.entries()).map(([e,{repoName:t,features:a}])=>({repoPath:e,repoName:t,featureCount:a.length,statusGroups:z.map(e=>({statusKey:e,label:C(R[e].labelKey),items:a.filter(t=>t.status===e)})).filter(e=>e.items.length>0)}))},[e,C]);return(0,t.jsxs)(n.Sidebar,{"data-testid":"app-sidebar","data-no-drawer-close":!0,collapsible:"icon",side:"rtl"===k.dir()?"right":"left",children:[(0,t.jsx)(n.SidebarHeader,{children:(0,t.jsxs)(n.SidebarMenu,{children:[(0,t.jsx)(n.SidebarMenuItem,{children:(0,t.jsxs)("div",{className:"flex h-8 items-center group-data-[collapsible=icon]:justify-center",children:[D?(0,t.jsxs)("div",{className:["flex min-w-0 flex-1 items-center gap-2 overflow-hidden px-2 transition-opacity duration-200 ease-out",L?"opacity-100":"opacity-0"].join(" "),"aria-hidden":!L,children:[(0,t.jsx)(M,{className:"shrink-0",size:20,variant:O.isDev?"dev":"default"}),(0,t.jsx)("span",{className:"truncate text-sm font-semibold tracking-tight",children:"Shep"}),(0,t.jsx)(E,{version:O.version,branch:O.branch||void 0,commitHash:O.commitHash||void 0,isDev:O.isDev,packageName:O.packageName,description:O.description,instancePath:O.instancePath||void 0})]}):null,(0,t.jsx)(S,{className:"shrink-0 transition-all duration-200"})]})}),(0,t.jsx)(j,{icon:l,label:C("navigation.controlCenter"),href:"/",active:"/"===N}),i.inventory?(0,t.jsx)(j,{icon:b,label:C("navigation.inventory"),href:"/features",active:"/features"===N}):null,(0,t.jsx)(j,{icon:f.Wrench,label:C("navigation.tools"),href:"/tools",active:"/tools"===N}),i.skills?(0,t.jsx)(j,{icon:g.Puzzle,label:C("navigation.skills"),href:"/skills",active:"/skills"===N}):null,(0,t.jsx)(j,{icon:x.Settings,label:C("navigation.settings"),href:"/settings",active:"/settings"===N})]})}),(0,t.jsx)(n.SidebarContent,{children:D?(0,t.jsxs)("div",{className:["flex min-h-0 flex-1 flex-col overflow-hidden transition-opacity duration-200 ease-out [&_[data-sidebar=group-label]]:!mt-0 [&_[data-sidebar=group-label]]:!opacity-100 [&_[data-sidebar=group-label]]:!transition-none",L?"opacity-100":"opacity-0"].join(" "),children:[(0,t.jsx)(J,{label:C("sidebar.features")}),(0,t.jsx)(y.ScrollArea,{className:"min-h-0 flex-1",children:es.map(({repoPath:e,repoName:a,featureCount:s,statusGroups:r})=>(0,t.jsx)(V,{repoName:a,featureCount:s,onAddFeature:v?()=>v(e):void 0,children:r.map(({statusKey:e,label:a,items:s})=>(0,t.jsx)(X,{label:a,count:s.length,children:s.map(e=>(0,t.jsx)(H,{name:e.name,status:e.status,startedAt:e.startedAt,duration:e.duration,agentType:e.agentType,modelId:e.modelId,onClick:o?()=>o(e.featureId):void 0},e.featureId))},e))},e))})]}):null}),(0,t.jsx)(n.SidebarFooter,{className:"border-t p-2",children:(0,t.jsx)(n.SidebarMenu,{children:(0,t.jsx)(n.SidebarMenuItem,{children:(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsxs)(T.TooltipProvider,{children:[(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)(n.SidebarMenuButton,{className:"w-auto flex-none",onClick:e=>{let t="system"===W?"dark"===K?"light":"dark":"dark"===W?"light":"dark";"dark"!==("system"===W?K:W)?Y.play():et.play();let a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;"startViewTransition"in document&&!a?(document.documentElement.style.setProperty("--x",`${e.clientX}px`),document.documentElement.style.setProperty("--y",`${e.clientY}px`),document.startViewTransition(()=>{Z(t)})):Z(t)},"aria-label":"dark"===K?C("sidebar.switchToLight"):C("sidebar.switchToDark"),children:[(0,t.jsx)(u,{className:"h-4 w-4 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),(0,t.jsx)(c,{className:"absolute h-4 w-4 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"})]})}),(0,t.jsx)(T.TooltipContent,{side:"top",children:"dark"===K?C("sidebar.switchToLight"):C("sidebar.switchToDark")})]}),!P&&(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(n.SidebarMenuButton,{className:"w-auto flex-none",onClick:()=>{ea.play(),I()},"aria-label":q?C("sidebar.muteSounds"):C("sidebar.unmuteSounds"),children:q?(0,t.jsx)(d,{className:"h-4 w-4"}):(0,t.jsx)(h,{className:"h-4 w-4"})})}),(0,t.jsx)(T.TooltipContent,{side:"top",children:q?C("sidebar.muteSounds"):C("sidebar.unmuteSounds")})]}),!P&&(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(n.SidebarMenuButton,{className:"w-auto flex-none",onClick:()=>{ea.play(),F()},"aria-label":Q?"Disable animations":"Enable animations",children:Q?(0,t.jsx)(m.Zap,{className:"h-4 w-4"}):(0,t.jsx)(p,{className:"h-4 w-4"})})}),(0,t.jsx)(T.TooltipContent,{side:"top",children:Q?"Disable animations":"Enable animations"})]})]})})})})}),(0,t.jsx)(n.SidebarRail,{})]})}e.i(13322);var ea=e.i(61201),es=e.i(48109),er=e.i(60253),ei=e.i(26370);let en=(0,o.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var eo=e.i(87538);let el=(0,o.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var ec=e.i(28112),eu=e.i(57779),ed=e.i(80554),eh=e.i(62639);let em="shep-global-chat";function ep(){try{let e=localStorage.getItem(em);if(!e)return{pos:null,size:null};let t=JSON.parse(e),a=t.size??null;return a&&(a.w<360||a.h<300)&&(a={w:Math.max(360,a.w),h:Math.max(300,a.h)}),{pos:t.pos??null,size:a}}catch{return{pos:null,size:null}}}function ef(){let{t:e}=(0,r.useTranslation)("web"),[s,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1),d=(0,ed.useTurnStatus)("global"),{swapPosition:h}=(0,eh.useFabLayout)(),{state:m}=(0,n.useSidebar)(),[p,f]=(0,a.useState)(()=>ep().pos),[g,x]=(0,a.useState)(()=>ep().size),b=(0,a.useCallback)(e=>{f(t=>"function"==typeof e?e(t):e)},[]),y=(0,a.useCallback)(e=>{x(t=>"function"==typeof e?e(t):e)},[]),v=(0,a.useRef)(null),w=(0,a.useRef)(null),j=(0,a.useRef)(null),C=(0,a.useCallback)(()=>{i(e=>(e||l(!0),!e))},[]),S=(0,a.useRef)({pos:null,size:null}),M=(0,a.useCallback)(()=>{s||(i(!0),l(!0)),u(e=>(e?(b(S.current.pos),y(S.current.size)):S.current={pos:p,size:g},!e))},[s,p,g,b,y]);(0,a.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&("k"===e.key||"K"===e.key)&&(e.preventDefault(),c&&u(!1),C(),requestAnimationFrame(()=>{setTimeout(()=>{let e=v.current?.querySelector("textarea");e?.focus()},100)})),(e.metaKey||e.ctrlKey)&&e.shiftKey&&("m"===e.key||"M"===e.key)&&(e.preventDefault(),M())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[C,M,c]),(0,a.useEffect)(()=>{let e=setTimeout(()=>(function(e,t){try{localStorage.setItem(em,JSON.stringify({pos:e,size:t}))}catch{}})(p,g),300);return()=>clearTimeout(e)},[p,g]);let T=(0,a.useCallback)((e,t,a)=>({x:Math.max(-a+100,Math.min(e,window.innerWidth-100)),y:Math.max(0,Math.min(t,window.innerHeight-48))}),[]),E=(0,a.useCallback)(e=>{e.preventDefault();let t=v.current;if(!t)return;let a=t.getBoundingClientRect(),s=p?.x??a.left,r=p?.y??a.top;w.current={startX:e.clientX,startY:e.clientY,startPosX:s,startPosY:r};let i=g?.w??a.width,n=e=>{if(!w.current)return;let t=e.clientX-w.current.startX,a=e.clientY-w.current.startY;b(T(w.current.startPosX+t,w.current.startPosY+a,i))},o=()=>{w.current=null,document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)},[p,g,b,T]),A=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=v.current;if(!t)return;let a=t.getBoundingClientRect(),s=g?.w??a.width,r=g?.h??a.height,i=e.clientX,n=e.clientY,o=p?.y??a.top;j.current={startX:i,startY:n,startW:s,startH:r},p||b({x:a.left,y:a.top});let l=e=>{if(!j.current)return;let t=e.clientX-i,l=e.clientY-n,c=Math.max(360,s+t),u=Math.max(300,r-l),d=Math.max(0,o+l);y({w:c,h:u}),b(e=>T(e?.x??a.left,d,c))},c=()=>{j.current=null,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",c)},[g,p,b,y,T]),P=(0,a.useCallback)(()=>{i(!1),u(!1)},[]),D=c?{}:p?{position:"fixed",left:p.x,top:p.y,width:g?.w??520,height:g?.h??"70vh"}:{width:g?.w??520,height:g?.h??"70vh"};return(0,t.jsxs)(t.Fragment,{children:[o?(0,t.jsxs)("div",{ref:v,className:(0,N.cn)(c?"bg-background fixed inset-0 z-[60] flex flex-col overflow-hidden dark:bg-neutral-900":(0,N.cn)(!p&&(h?"fixed start-8 bottom-24":"fixed end-8 bottom-24"),"z-[60] flex flex-col overflow-hidden rounded-lg","border-border/60 border dark:border-white/10","bg-background dark:bg-neutral-900","shadow-[0_8px_40px_-8px_rgba(0,0,0,0.2)] dark:shadow-[0_8px_40px_-8px_rgba(0,0,0,0.6)]"),"transition-opacity duration-300 ease-out",s?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"),style:D,children:[c?null:(0,t.jsx)("div",{className:"h-[2px] shrink-0 bg-gradient-to-r from-transparent via-violet-500/50 to-transparent"}),c?null:(0,t.jsx)("div",{onMouseDown:A,className:"absolute end-0 top-0 z-10 h-4 w-4 cursor-ne-resize"}),(0,t.jsxs)("div",{onMouseDown:c?void 0:E,className:(0,N.cn)("relative flex h-11 shrink-0 items-center gap-2.5 border-b border-black/[0.06] px-3.5 dark:border-white/[0.06]",!c&&"cursor-grab active:cursor-grabbing"),children:[(0,t.jsx)("div",{className:"from-foreground/[0.02] to-foreground/[0.02] pointer-events-none absolute inset-0 bg-gradient-to-r via-transparent"}),c?null:(0,t.jsx)(en,{className:"text-foreground/15 relative h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("div",{className:"relative flex h-5 w-5 items-center justify-center",children:(0,t.jsx)(ei.Bot,{className:"text-foreground/50 h-4 w-4"})}),(0,t.jsxs)("div",{className:"relative flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-foreground/90 text-base font-bold tracking-tight",children:"Shep"}),(0,t.jsx)("span",{className:"text-foreground/30 text-xs font-medium tracking-widest uppercase",children:"global"})]}),(0,t.jsxs)("div",{className:"relative ms-auto flex items-center gap-0.5",children:[(0,t.jsx)("button",{type:"button",onClick:M,className:"text-foreground/30 hover:text-foreground/60 rounded-md p-1 transition-colors",title:c?"Restore (⌘⇧M)":"Maximize (⌘⇧M)",children:c?(0,t.jsx)(el,{className:"h-3.5 w-3.5"}):(0,t.jsx)(eo.Maximize2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:P,className:"text-foreground/30 hover:text-foreground/60 rounded-md p-1 transition-colors",title:"Close (⌘⇧K)",children:(0,t.jsx)(er.X,{className:"h-3.5 w-3.5"})})]})]}),(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(ec.ChatTab,{featureId:"global"})}),c?null:(0,t.jsx)("div",{onMouseDown:e=>{e.preventDefault(),e.stopPropagation();let t=v.current;if(!t)return;let a=t.getBoundingClientRect(),s=e.clientX,r=e.clientY,i=g?.w??a.width,n=g?.h??a.height;p||b({x:a.left,y:a.top});let o=e=>{let t=window.innerHeight-(p?.y??a.top);y({w:Math.max(360,i+(e.clientX-s)),h:Math.max(300,Math.min(n+(e.clientY-r),t))})},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l)},className:"absolute end-0 bottom-0 z-10 h-4 w-4 cursor-se-resize"})]}):null,(0,t.jsxs)(eg,{swapPosition:h,sidebarState:m,isMaximized:c,children:[(0,t.jsxs)(k.Button,{size:"icon",onClick:C,className:(0,N.cn)("relative h-14 w-14 rounded-full shadow-lg","transition-all duration-200 hover:scale-105 hover:shadow-xl active:scale-95",s?"bg-violet-600 text-white hover:bg-violet-500":"bg-violet-500 text-white hover:bg-violet-400 dark:bg-violet-500 dark:hover:bg-violet-400",!s&&"processing"===d&&"chat-fab-spinning",!s&&"unread"===d&&"chat-fab-glow-unread",!s&&"awaiting_input"===d&&"chat-fab-glow-awaiting"),children:[(0,t.jsx)(es.MessageSquare,{className:(0,N.cn)("absolute h-7 w-7 stroke-[2.5] transition-all duration-200",s?"scale-0 rotate-90 opacity-0":"scale-100 rotate-0 opacity-100")}),(0,t.jsx)(er.X,{className:(0,N.cn)("absolute h-6 w-6 stroke-[2.5] transition-all duration-200",s?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-90 opacity-0")}),!s&&(0,t.jsx)(eu.ChatDotIndicator,{status:d,className:"end-0 top-0"})]}),(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 translate-y-1 opacity-0 transition-all duration-200 group-hover/fab:translate-y-0 group-hover/fab:opacity-100",children:(0,t.jsxs)("div",{className:"bg-foreground rounded-lg px-3 py-1.5 text-center shadow-lg",children:[(0,t.jsx)("p",{className:"text-background text-xs font-medium whitespace-nowrap",children:e("chat.shepChat")}),(0,t.jsxs)("p",{className:"text-background/50 mt-0.5 flex items-center justify-center gap-1 text-[10px]",children:[(0,t.jsx)("kbd",{className:"bg-background/15 rounded px-1 py-px font-mono",children:"⌘"}),(0,t.jsx)("kbd",{className:"bg-background/15 rounded px-1 py-px font-mono",children:"⇧"}),(0,t.jsx)("kbd",{className:"bg-background/15 rounded px-1 py-px font-mono",children:"K"})]})]})})]})]})}function eg({swapPosition:e,sidebarState:a,isMaximized:s,children:i}){let{i18n:n}=(0,r.useTranslation)("web"),o="rtl"===n.dir();if(!e)return(0,t.jsx)("div",{className:(0,N.cn)("group/fab fixed end-8 bottom-6 z-30",s&&"hidden"),children:i});let l="expanded"===a?"calc(var(--sidebar-width) + 32px)":"calc(var(--sidebar-width-icon) + 32px)";return(0,t.jsx)("div",{className:(0,N.cn)("group/fab fixed bottom-6 z-30",s&&"hidden"),style:o?{right:l,transition:"right 200ms ease-in-out"}:{left:l,transition:"left 200ms ease-in-out"},children:i})}var ex=e.i(78521),eb=e.i(2287),ey=e.i(68304),ev=e.i(98127),ew=e.i(41957);let ej=/^(?:https:\/\/github\.com\/([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+?)(?:\.git)?|git@github\.com:([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+?)(?:\.git)?|([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+))$/;function eC({onSubmit:e,loading:s=!1}){let[r,i]=(0,a.useState)(""),[n,o]=(0,a.useState)("");function l(){let t=r.trim();t?ej.test(t.trim())?(o(""),e(t)):o("Enter a valid GitHub URL (e.g. owner/repo or https://github.com/owner/repo)"):o("Please enter a GitHub URL")}return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(ew.Label,{htmlFor:"github-url-input",children:"GitHub URL"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ev.Input,{id:"github-url-input",placeholder:"owner/repo or https://github.com/owner/repo",value:r,onChange:e=>{i(e.target.value),n&&o("")},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),l())},disabled:s,"aria-invalid":!!n,"aria-describedby":n?"github-url-error":void 0}),(0,t.jsx)(k.Button,{onClick:l,disabled:s||!r.trim(),size:"sm",children:s?(0,t.jsx)(L.Loader2,{className:"h-4 w-4 animate-spin"}):"Import"})]}),n?(0,t.jsx)("p",{id:"github-url-error",className:"text-destructive text-sm",role:"alert",children:n}):null]})}let ek=(0,o.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var eN=e.i(32494),eS=e.i(66459),eM=e.i(79687),eT=e.i(81846),eE=e.i(61238),eA=e.i(47373),eP=e.i(21023);let eD=(0,eP.createServerReference)("404c92b243a09833eab22adcd0602c2b0fed811122",eP.callServer,void 0,eP.findSourceMapURL,"listGitHubRepositories"),eL=(0,eP.createServerReference)("00264e968c59967d6a7b7c8dd63e04bf16fe93406c",eP.callServer,void 0,eP.findSourceMapURL,"listGitHubOrganizations"),eO="__personal__";function eq({onSelect:e,loading:s=!1,fetchRepos:r=eD,fetchOrgs:i=eL}){let[n,o]=(0,a.useState)([]),[l,c]=(0,a.useState)([]),[u,d]=(0,a.useState)(!0),[h,m]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[g,x]=(0,a.useState)(eO),b=(0,a.useRef)(null);(0,a.useEffect)(()=>{!async function(){try{let e=await i();e.orgs&&c(e.orgs)}catch{}}()},[i]);let y=(0,a.useCallback)(async(e,t)=>{d(!0),m("");try{let a={};e&&(a.search=e),t&&t!==eO&&(a.owner=t);let s=await r(Object.keys(a).length>0?a:void 0);s.error?(m(s.error),o([])):o(s.repos??[])}catch{m("Failed to fetch repositories"),o([])}finally{d(!1)}},[r]);return((0,a.useEffect)(()=>{y(p||void 0,g)},[y,g]),h&&!u)?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-center","data-testid":"repo-browser-error",children:[(0,t.jsx)(eM.AlertCircle,{className:"text-destructive h-8 w-8"}),(0,t.jsx)("p",{className:"text-destructive text-sm",children:h})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[l.length>0?(0,t.jsxs)(eA.Select,{value:g,onValueChange:function(e){x(e),f("")},disabled:s,children:[(0,t.jsx)(eA.SelectTrigger,{"aria-label":"Select owner",children:(0,t.jsx)(eA.SelectValue,{placeholder:"Select owner"})}),(0,t.jsxs)(eA.SelectContent,{children:[(0,t.jsx)(eA.SelectItem,{value:eO,children:"My repositories"}),l.map(e=>(0,t.jsx)(eA.SelectItem,{value:e.login,children:e.login},e.login))]})]}):null,(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(eS.Search,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2"}),(0,t.jsx)(ev.Input,{placeholder:"Search repositories...",value:p,onChange:e=>{var t;f(t=e.target.value),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{y(t||void 0,g)},300)},className:"ps-9",disabled:s,"aria-label":"Search repositories"})]}),(0,t.jsx)("div",{className:"max-h-64 overflow-x-hidden overflow-y-auto rounded-md border",role:"listbox","aria-label":"GitHub repositories",children:u?(0,t.jsx)("div",{className:"flex flex-col gap-2 p-3","data-testid":"repo-browser-loading",children:Array.from({length:5}).map((e,a)=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(eE.Skeleton,{className:"h-4 w-48"}),(0,t.jsx)(eE.Skeleton,{className:"h-3 w-72"})]},`skeleton-${String(a)}`))}):0===n.length?(0,t.jsx)("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"repo-browser-empty",children:"No repositories found"}):n.map(a=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":!1,className:"hover:bg-accent flex w-full items-start gap-2 border-b px-3 py-2.5 text-start last:border-b-0 disabled:opacity-50",onClick:()=>e(a.nameWithOwner),disabled:s,children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:a.nameWithOwner}),(0,t.jsx)(eT.Badge,{variant:a.isPrivate?"secondary":"outline",className:"shrink-0 text-xs",children:a.isPrivate?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek,{className:"me-1 h-3 w-3"}),"Private"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eN.Globe,{className:"me-1 h-3 w-3"}),"Public"]})})]}),a.description?(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 truncate text-xs",children:a.description}):null]}),s?(0,t.jsx)(L.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin"}):null]},a.nameWithOwner))})]})}let eI=(0,eP.createServerReference)("4096c790703d3be3a9699ebc780d24629f2b27d02d",eP.callServer,void 0,eP.findSourceMapURL,"importGitHubRepository");function eQ({open:e,onOpenChange:s,onImportComplete:r}){let[i,n]=(0,a.useState)(!1),[o,l]=(0,a.useState)("");async function c(e){n(!0),l("");try{let t=await eI({url:e});t.error?l(t.error):t.repository&&(r(t.repository),s(!1))}catch{l("An unexpected error occurred")}finally{n(!1)}}return(0,t.jsx)(eb.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(eb.DialogContent,{className:"overflow-hidden sm:max-w-lg",children:[(0,t.jsxs)(eb.DialogHeader,{children:[(0,t.jsx)(eb.DialogTitle,{children:"Import from GitHub"}),(0,t.jsx)(eb.DialogDescription,{children:"Clone a GitHub repository and add it to Shep."})]}),(0,t.jsxs)(ey.Tabs,{defaultValue:"url",className:"min-w-0",children:[(0,t.jsxs)(ey.TabsList,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(ey.TabsTrigger,{value:"url",children:"URL"}),(0,t.jsx)(ey.TabsTrigger,{value:"browse",children:"Browse"})]}),(0,t.jsx)(ey.TabsContent,{value:"url",className:"mt-4",children:(0,t.jsx)(eC,{onSubmit:c,loading:i})}),(0,t.jsx)(ey.TabsContent,{value:"browse",className:"mt-4",children:(0,t.jsx)(eq,{onSelect:c,loading:i})})]}),o?(0,t.jsx)("p",{className:"text-destructive text-sm",role:"alert",children:o}):null]})})}var eR=e.i(39443),ez=e.i(30153),eF=e.i(5147),eK=e.i(60112),eH=e.i(17406);let eB={[eH.NotificationSeverity.Success]:"success",[eH.NotificationSeverity.Error]:"error",[eH.NotificationSeverity.Warning]:"warning",[eH.NotificationSeverity.Info]:"info"},e_={[eH.NotificationSeverity.Success]:"notification-success",[eH.NotificationSeverity.Error]:"notification-error",[eH.NotificationSeverity.Warning]:"notification-warning",[eH.NotificationSeverity.Info]:"notification-info"};var e$=e.i(75921);function eG({children:e,sidebarOpen:r}){let i=(0,s.useRouter)(),{guardedNavigate:o}=(0,ez.useDrawerCloseGuard)(),l=(0,e$.useFeatureFlags)();!function(){let e=(0,s.useRouter)(),{events:t}=(0,eR.useAgentEventsContext)(),r=(0,w.useSoundAction)("notification-success"),i=(0,w.useSoundAction)("notification-error"),n=(0,w.useSoundAction)("notification-warning"),o=(0,w.useSoundAction)("notification-info"),l=(0,a.useMemo)(()=>({"notification-success":r,"notification-error":i,"notification-warning":n,"notification-info":o}),[r,i,n,o]),c=(0,a.useRef)(0);(0,a.useEffect)(()=>{if(t.length<=c.current)return;let a=t.slice(c.current);for(let s of(c.current=t.length,a)){if(s.eventType!==eH.NotificationEventType.MergeReviewReady&&s.severity!==eH.NotificationSeverity.Error&&s.severity!==eH.NotificationSeverity.Warning&&s.severity!==eH.NotificationSeverity.Success)continue;!function(e,t){let a=eB[e.severity]??"info",s=e.eventType===eH.NotificationEventType.WaitingApproval||e.eventType===eH.NotificationEventType.MergeReviewReady;eK.toast[a](e.featureName,{description:e.message,...s&&t&&{action:{label:"Review",onClick:()=>{t(`/feature/${e.featureId}`)}}}})}(s,t=>e.push(t));let t=e_[s.severity];l[t]?.play()}},[t,l,e])}();let{features:c}=(0,eF.useSidebarFeaturesContext)(),u=(0,a.useCallback)(e=>{o(()=>i.push(`/feature/${e}`))},[i,o]),d=(0,a.useCallback)(e=>{o(()=>i.push(`/create?repo=${encodeURIComponent(e)}`))},[i,o]),[h,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[g,x]=(0,a.useState)(!1),b=(0,a.useCallback)(async()=>{if(!h){if(l.reactFileManager)return void x(!0);m(!0);try{let e=await (0,ex.pickFolder)();e&&window.dispatchEvent(new CustomEvent("shep:add-repository",{detail:{path:e}}))}catch{x(!0)}finally{m(!1)}}},[h,l.reactFileManager]);(0,a.useEffect)(()=>{let e=()=>{b()};return window.addEventListener("shep:pick-folder",e),()=>window.removeEventListener("shep:pick-folder",e)},[b]),(0,a.useEffect)(()=>{let e=()=>f(!0);return window.addEventListener("shep:open-github-import",e),()=>window.removeEventListener("shep:open-github-import",e)},[]);let y=(0,a.useCallback)(e=>{e&&window.dispatchEvent(new CustomEvent("shep:add-repository",{detail:{path:e}})),x(!1)},[]),v=(0,a.useCallback)(e=>{e.path&&window.dispatchEvent(new CustomEvent("shep:add-repository",{detail:{path:e.path}}))},[]);return(0,t.jsxs)(n.SidebarProvider,{defaultOpen:r??!1,children:[(0,t.jsx)(et,{features:c,featureFlags:l,onFeatureClick:u,onAddFeature:d}),(0,t.jsx)(n.SidebarInset,{children:(0,t.jsxs)("div",{className:"relative h-full",children:[(0,t.jsx)("main",{className:"h-full",children:e}),(0,t.jsx)(ef,{}),l.githubImport?(0,t.jsx)(eQ,{open:p,onOpenChange:f,onImportComplete:v}):null]})}),(0,t.jsx)(ea.ReactFileManagerDialog,{open:g,onOpenChange:e=>{e||x(!1)},onSelect:y})]})}function eU({children:e}){return(0,t.jsx)(ed.TurnStatusesProvider,{children:e})}function eX({children:e,sidebarOpen:a}){let{i18n:s}=(0,r.useTranslation)(),n=s.dir();return(0,t.jsx)(i.Direction.Provider,{dir:n,children:(0,t.jsx)(eR.AgentEventsProvider,{children:(0,t.jsx)(ez.DrawerCloseGuardProvider,{children:(0,t.jsx)(eF.SidebarFeaturesProvider,{children:(0,t.jsx)(eU,{children:(0,t.jsx)(eG,{sidebarOpen:a,children:e})})})})})})}e.s(["AppShell",()=>eX],87292)},25251,e=>{"use strict";var t=e.i(20314),a=e.i(60112);let s=({...e})=>(0,t.jsx)(a.Toaster,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e});e.s(["Toaster",()=>s])},4858,e=>{"use strict";var t=e.i(20314),a=e.i(3),s=e.i(28574),r=e.i(6786),i=e.i(77501),n=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let i=t.queryKey,n=t.queryHash??(0,a.hashQueryKeyByOptions)(i,t),o=this.get(n);return o||(o=new s.Query({client:e,queryKey:i,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,a.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,a.matchQuery)(e,t)):t}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o=e.i(87975),l=i,c=class extends l.Subscribable{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#a=new Map,this.#s=0}#t;#a;#s;build(e,t,a){let s=new o.Mutation({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:a});return this.add(s),s}add(e){this.#t.add(e);let t=u(e);if("string"==typeof t){let a=this.#a.get(t);a?a.push(e):this.#a.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=u(e);if("string"==typeof t){let a=this.#a.get(t);if(a)if(a.length>1){let t=a.indexOf(e);-1!==t&&a.splice(t,1)}else a[0]===e&&this.#a.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let a=this.#a.get(t),s=a?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let a=this.#a.get(t)?.find(t=>t!==e&&t.state.isPaused);return a?.continue()??Promise.resolve()}}clear(){r.notifyManager.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#a.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,a.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,a.matchMutation)(e,t))}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return r.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(a.noop))))}};function u(e){return e.options.scope?.id}var d=e.i(4520),h=e.i(13598);function m(e){return{onFetch:(t,s)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],o=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,u=async()=>{let s=!1,u=(0,a.ensureQueryFn)(t.options,t.fetchOptions),d=async(e,r,i)=>{let n;if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let o=(n={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?"backward":"forward",meta:t.options.meta},(0,a.addConsumeAwareSignal)(n,()=>t.signal,()=>s=!0),n),l=await u(o),{maxPages:c}=t.options,d=i?a.addToStart:a.addToEnd;return{pages:d(e.pages,l,c),pageParams:d(e.pageParams,r,c)}};if(i&&n.length){let e="backward"===i,t={pages:n,pageParams:o},a=(e?function(e,{pages:t,pageParams:a}){return t.length>0?e.getPreviousPageParam?.(t[0],t,a[0],a):void 0}:p)(r,t);l=await d(t,a,e)}else{let t=e??n.length;do{let e=0===c?o[0]??r.initialPageParam:p(r,l);if(c>0&&null==e)break;l=await d(l,e),c++}while(c<t)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=u}}}function p(e,{pages:t,pageParams:a}){let s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,a[s],a):void 0}var f=class{#r;#i;#n;#o;#l;#c;#u;#d;constructor(e={}){this.#r=e.queryCache||new n,this.#i=e.mutationCache||new c,this.#n=e.defaultOptions||{},this.#o=new Map,this.#l=new Map,this.#c=0}mount(){this.#c++,1===this.#c&&(this.#u=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#d=h.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#c--,0===this.#c&&(this.#u?.(),this.#u=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#r.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#r.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#r.get(r.queryHash),n=i?.state.data,o=(0,a.functionalUpdate)(t,n);if(void 0!==o)return this.#r.build(this,r).setData(o,{...s,manual:!0})}setQueriesData(e,t,a){return r.notifyManager.batch(()=>this.#r.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,a)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state}removeQueries(e){let t=this.#r;r.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let a=this.#r;return r.notifyManager.batch(()=>(a.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(r.notifyManager.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(a.noop).catch(a.noop)}invalidateQueries(e,t={}){return r.notifyManager.batch(()=>(this.#r.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(r.notifyManager.batch(()=>this.#r.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(a.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(a.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#r.build(this,t);return s.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(a.noop).catch(a.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(a.noop).catch(a.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.onlineManager.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#i}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set((0,a.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,a.partialMatchKey)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#l.set((0,a.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,a.partialMatchKey)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,a.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===a.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#r.clear(),this.#i.clear()}},g=e.i(34682),x=e.i(79054);function b({children:e}){let[a]=(0,x.useState)(()=>new f({defaultOptions:{queries:{staleTime:1e3,refetchOnWindowFocus:!1}}}));return(0,t.jsx)(g.QueryClientProvider,{client:a,children:e})}e.s(["QueryProvider",()=>b],4858)},10644,e=>{"use strict";let t;var a=e.i(20314),s=e.i(79054);e.i(41001);var r=e.i(14827),i=e.i(99065),n=e.i(83100),o=e.i(37465),l=e.i(51193),c=e.i(55431),u=e.i(60280),d=e.i(40266),h=e.i(50784),m=e.i(28191),p=e.i(71363),f=e.i(53493),g=e.i(22307),x=e.i(44225),b=e.i(62305),y=e.i(51943),v=e.i(88158),w=e.i(39711),j=e.i(32456);let C=((t=i.default.createInstance()).use(n.initReactI18next).init({lng:"en",fallbackLng:"en",defaultNS:"common",ns:["common","web"],resources:{en:{common:o.default,web:l.default},ru:{common:c.default,web:u.default},pt:{common:d.default,web:h.default},es:{common:m.default,web:p.default},ar:{common:f.default,web:g.default},he:{common:x.default,web:b.default},fr:{common:y.default,web:v.default},de:{common:w.default,web:j.default}},interpolation:{escapeValue:!1},react:{useSuspense:!1}}),t),k={ar:{family:"Noto Sans Arabic",cssUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},he:{family:"Noto Sans Hebrew",cssUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"}};function N(e){let t=k[e];if(document.documentElement.classList.remove("font-rtl-arabic","font-rtl-hebrew"),!t)return void document.documentElement.style.removeProperty("--font-rtl");document.documentElement.style.setProperty("--font-rtl",`"${t.family}"`),document.documentElement.classList.add("ar"===e?"font-rtl-arabic":"font-rtl-hebrew");let a=`rtl-font-${e}`;if(!document.getElementById(a)){let e=document.createElement("link");e.id=a,e.rel="stylesheet",e.href=t.cssUrl,document.head.appendChild(e)}}function S({initialLanguage:e,children:t}){return(0,s.useEffect)(()=>{C.language!==e&&C.changeLanguage(e),N(e)},[e]),(0,s.useEffect)(()=>{function e(e){N(e)}return C.on("languageChanged",e),()=>{C.off("languageChanged",e)}},[]),(0,a.jsx)(r.I18nextProvider,{i18n:C,children:t})}e.s(["I18nProvider",()=>S],10644)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87292,e=>{"use strict";var t=e.i(20314),a=e.i(79054),s=e.i(31406);e.i(41001);var r=e.i(64780),i=e.i(84840),n=e.i(57638),o=e.i(3645);let l=(0,o.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]),c=(0,o.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),u=(0,o.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),d=(0,o.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),h=(0,o.default)("volume-off",[["path",{d:"M16 9a5 5 0 0 1 .95 2.293",key:"1fgyg8"}],["path",{d:"M19.364 5.636a9 9 0 0 1 1.889 9.96",key:"l3zxae"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11",key:"1gbwow"}],["path",{d:"M9.828 4.172A.686.686 0 0 1 11 4.657v.686",key:"s2je0y"}]]);var m=e.i(53360);let p=(0,o.default)("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var f=e.i(81975),g=e.i(12103),x=e.i(39200);let b=(0,o.default)("table-properties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var y=e.i(35340),v=e.i(24035),w=e.i(8361);function j({icon:e,label:a,href:s,active:r=!1}){let i=(0,w.useSoundAction)("navigate");return(0,t.jsx)(n.SidebarMenuItem,{"data-testid":"sidebar-nav-item",children:(0,t.jsx)(n.SidebarMenuButton,{asChild:!0,isActive:r,tooltip:a,children:(0,t.jsxs)(v.default,{href:s,onClick:()=>i.play(),children:[(0,t.jsx)(e,{}),(0,t.jsx)("span",{children:a})]})})})}var C=e.i(71379),C=C,k=e.i(35364),N=e.i(31777);function S({className:e}){let{toggleSidebar:a,open:s}=(0,n.useSidebar)(),r=(0,w.useSoundAction)("expand"),i=(0,w.useSoundAction)("collapse");return(0,t.jsx)("div",{className:(0,N.cn)("flex",e),children:(0,t.jsx)(k.Button,{"data-testid":"sidebar-collapse-toggle",variant:"ghost",size:"icon",className:"size-7 cursor-pointer group-data-[collapsible=icon]:size-8!",onClick:()=>{s?i.play():r.play(),a()},"aria-label":s?"Collapse sidebar":"Expand sidebar",children:(0,t.jsx)(C.default,{className:"size-4"})})})}function M({className:e,size:a=24,variant:s="default"}){return(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 194 200",width:a,height:a,className:(0,N.cn)("shrink-0","dev"===s&&"text-cyan-400",e),"aria-hidden":"true",children:(0,t.jsx)("g",{transform:"matrix(1, 0, 0, 1, -111, -208)",children:(0,t.jsx)("path",{d:"M 198 406 C196,405 194,403 193,401 C192,399 191,398 186,398 C178,397 174,394 170,387 L 168 381 L 163 381 C156,381 150,377 147,370 C144,364 143,359 146,353 C148,348 148,347 147,347 C145,347 140,343 138,339 C133,329 139,314 149,311 L 152 311 L 149 307 C145,302 145,294 149,290 C151,288 152,287 151,286 C150,283 152,278 155,276 C156,275 159,274 162,273 C165,273 166,273 168,276 C171,278 171,280 172,287 C173,294 174,297 177,304 C180,309 182,314 183,316 C186,327 193,336 199,339 C204,342 211,342 216,340 C222,336 231,324 234,314 C235,312 237,307 239,302 C240,298 242,292 242,289 C243,281 245,278 247,275 C250,273 251,273 255,273 C261,274 264,278 264,282 C264,284 264,286 263,287 C262,287 263,288 265,290 C272,295 272,303 267,309 L 265 312 L 269 314 C276,317 279,323 279,332 C279,339 277,343 272,347 C268,351 268,351 269,354 C272,358 271,366 269,371 C266,376 259,381 254,381 C252,381 251,382 248,386 C242,395 234,400 227,399 C224,398 223,398 221,401 C220,403 217,405 216,406 C211,409 203,409 198,406 ZM 136 271 C123,267 115,262 113,256 C111,251 111,251 113,251 C118,254 124,254 132,252 C136,252 141,251 144,251 C149,251 157,253 162,256 C166,258 166,258 166,264 L 166 269 L 160 270 C149,272 142,272 136,271 ZM 264 271 C263,271 259,270 256,270 L 250 270 L 250 265 C249,259 250,257 259,254 C265,251 272,251 289,252 C297,253 299,253 302,252 C305,250 305,250 305,252 C305,255 301,262 297,264 C289,270 272,273 264,271 ZM 162 249 C160,247 159,245 159,242 C159,236 164,230 169,230 C170,230 171,228 171,225 C171,216 176,210 184,209 C189,209 195,211 195,213 C195,214 196,213 197,212 C201,209 204,208 208,208 C212,208 217,210 219,212 C220,214 220,213 223,211 C226,208 234,208 239,211 C243,214 246,221 246,226 C245,230 245,230 247,230 C253,230 258,238 257,244 C256,249 251,252 245,252 C241,252 237,251 234,248 C232,247 232,247 228,249 C225,251 222,252 220,252 C216,252 212,250 210,247 C209,246 209,246 206,248 C201,252 192,253 185,248 C183,247 183,247 178,249 C172,253 166,253 162,249 ZM 116 249 C112,248 114,247 119,247 C122,247 127,246 130,245 C138,242 146,242 152,245 L 158 248 L 148 247 C142,247 138,247 133,248 C128,250 120,250 116,249 ZM 284 248 C281,247 277,247 270,247 L 260 248 L 263 246 C269,243 276,242 284,245 C289,246 295,247 298,247 C303,247 304,247 303,248 C301,250 289,250 284,248 Z",fill:"currentColor"})})})}var T=e.i(2828);function E({version:e,branch:s,commitHash:i,isDev:n=!1,packageName:o="@shepai/cli",description:l,instancePath:c}){let{t:u}=(0,r.useTranslation)("web"),d=i?.slice(0,7),{latest:h,updateAvailable:m}=function(e){let[t,s]=(0,a.useState)(null),[r,i]=(0,a.useState)(!0);(0,a.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/npm-version");if(!t.ok)return;let a=await t.json();!e&&a.latest&&s(a.latest)}catch{}finally{e||i(!1)}}(),()=>{e=!0}},[]);let n=null!==t&&function(e,t){let a=e=>e.split("-")[0].split(".").map(Number),s=a(e),r=a(t);for(let e=0;e<3;e++){let t=s[e]??0,a=r[e]??0;if(t>a)return 1;if(t<a)return -1}return 0}(t,e)>0;return{latest:t,updateAvailable:n,loading:r}}(e),{status:p,startUpgrade:f}=function(){let[e,t]=(0,a.useState)("idle"),[s,r]=(0,a.useState)(""),[i,n]=(0,a.useState)(),o=(0,a.useRef)(null),l=(0,a.useRef)(!1),c=(0,a.useCallback)(()=>{if("upgrading"===e||"restarting"===e)return;t("upgrading"),r(""),n(void 0),l.current=!1;let a=new AbortController;return o.current=a,fetch("/api/cli-upgrade",{method:"POST",signal:a.signal}).then(async e=>{if(!e.ok||!e.body){t("error"),n(`Server returned ${e.status}`);return}let a=e.body.getReader(),s=new TextDecoder,i="";for(;;){let{done:e,value:o}=await a.read();if(e)break;let c=(i+=s.decode(o,{stream:!0})).split("\n");for(let e of(i=c.pop()??"",c)){if(e.startsWith("event: restarting")){l.current=!0,t("restarting"),function(e,t){let a=Date.now()+3e4,s=()=>{Date.now()>a||fetch("/api/version",{method:"GET",cache:"no-store"}).then(e=>{e.ok?window.location.reload():setTimeout(s,500)}).catch(()=>{setTimeout(s,500)})};setTimeout(s,500)}(0,0);continue}if(!e.startsWith("event: done")&&e.startsWith("data: ")){let a=e.slice(6);try{let e=JSON.parse(a);"upgraded"===e.status?t("upgraded"):"up-to-date"===e.status?t("up-to-date"):"error"===e.status&&(t("error"),n(e.errorMessage))}catch{r(e=>e+a)}}}}}).catch(e=>{l.current||e instanceof DOMException&&"AbortError"===e.name||(t("error"),n(e instanceof Error?e.message:"Upgrade failed"))}),()=>{a.abort()}},[e]);return{status:e,output:s,errorMessage:i,startUpgrade:c}}(),g=n?`${e}-dev`:`v${e}`,x="upgrading"===p,b="restarting"===p,y="upgraded"===p;return(0,t.jsx)(T.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground/80 hover:text-muted-foreground relative cursor-default text-[11px] leading-tight transition-colors","data-testid":"version-label",children:[g,!m||y||b?null:(0,t.jsx)("span",{className:"absolute -top-0.5 -right-1.5 size-1.5 rounded-full bg-emerald-400","data-testid":"update-dot"})]})}),(0,t.jsxs)(T.TooltipContent,{side:"right",className:"max-w-[280px] space-y-1 p-3 text-start",children:[(0,t.jsx)("div",{className:"mb-1.5 text-xs font-semibold",children:o}),l?(0,t.jsx)("div",{className:"text-[10px] leading-snug opacity-70",children:l}):null,(0,t.jsxs)("div",{className:"border-t border-white/10 pt-1.5",children:[(0,t.jsx)(A,{label:u("versionBadge.version"),value:g}),n&&s?(0,t.jsx)(A,{label:u("versionBadge.branch"),value:s}):null,n&&d?(0,t.jsx)(A,{label:u("versionBadge.commit"),value:d,mono:!0}):null,n&&c?(0,t.jsx)(A,{label:u("versionBadge.path"),value:c,mono:!0}):null,h?(0,t.jsx)(A,{label:"Latest",value:`v${h}`,highlight:m}):null]}),b?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("span",{className:"text-[10px] font-medium text-emerald-400","data-testid":"upgrade-restarting",children:"Restarting..."})}):y?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("span",{className:"text-[10px] font-medium text-emerald-400","data-testid":"upgrade-success",children:"Upgraded successfully"})}):"error"===p?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("span",{className:"text-[10px] font-medium text-red-400","data-testid":"upgrade-error",children:"Upgrade failed"})}):m?(0,t.jsx)("div",{className:"border-t border-white/10 pt-1.5",children:(0,t.jsx)("button",{type:"button",onClick:f,disabled:x||b,className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-400 transition-colors hover:text-emerald-300 disabled:opacity-50","data-testid":"upgrade-button",children:x?"Upgrading...":b?"Restarting...":`Upgrade to v${h}`})}):null]})]})})}function A({label:e,value:a,highlight:s,mono:r}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 text-[10px]",children:[(0,t.jsx)("span",{className:"opacity-60",children:e}),(0,t.jsx)("span",{className:[s?"font-medium text-emerald-400":"",r||!s?"font-mono":""].filter(Boolean).join(" "),children:a})]})}function P({startedAt:e}){let[s,r]=(0,a.useState)(()=>Date.now()-e);return(0,a.useEffect)(()=>{let t=setInterval(()=>{(0,a.startTransition)(()=>r(Date.now()-e))},1e3);return()=>clearInterval(t)},[e]),(0,t.jsx)("span",{"data-testid":"elapsed-time",className:"tabular-nums",children:function(e){let t=Math.floor(e/1e3);if(t>=3600){let e=Math.floor(t/3600);return`${e}h`}let a=Math.floor(t/60);return`${String(a).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}(s)})}var D=e.i(51251),L=e.i(83428),O=e.i(34119),q=e.i(94819),I=e.i(54277),Q=e.i(55016);let R={"action-needed":{icon:D.CircleAlert,iconClass:"text-amber-500",bgClass:"bg-amber-500/10",labelKey:"sidebar.statusActionNeeded"},"in-progress":{icon:L.Loader2,iconClass:"text-blue-500 animate-spin",bgClass:"bg-blue-500/10",labelKey:"sidebar.statusInProgress"},pending:{icon:Q.Clock,iconClass:"text-slate-400",bgClass:"bg-slate-400/10",labelKey:"sidebar.statusPending"},blocked:{icon:q.Ban,iconClass:"text-gray-400",bgClass:"bg-gray-400/10",labelKey:"sidebar.statusBlocked"},error:{icon:I.CircleX,iconClass:"text-red-500",bgClass:"bg-red-500/10",labelKey:"sidebar.statusError"},done:{icon:O.CircleCheck,iconClass:"text-emerald-500",bgClass:"bg-emerald-500/10",labelKey:"sidebar.statusDone"}},z=["action-needed","error","blocked","in-progress","pending","done"];var F=e.i(86782),K=e.i(29847);function H({name:e,status:a,startedAt:s,duration:r,agentType:i,modelId:o,onClick:l}){let{icon:c,iconClass:u}=R[a],d=i?(0,F.getAgentTypeIcon)(i):null;return(0,t.jsx)(n.SidebarMenuItem,{"data-testid":"feature-list-item",children:(0,t.jsxs)(n.SidebarMenuButton,{size:"sm",onClick:l,tooltip:e,className:"cursor-pointer",children:[(0,t.jsx)(c,{className:u}),(0,t.jsx)("span",{className:"flex-1 truncate font-medium",children:e}),"in-progress"===a&&null!=s?(0,t.jsx)("span",{"data-testid":"feature-list-item-meta",className:"text-muted-foreground ml-auto text-xs tabular-nums",children:(0,t.jsx)(P,{startedAt:s})}):null,"done"===a&&r?(0,t.jsx)("span",{"data-testid":"feature-list-item-meta",className:"text-muted-foreground ml-auto text-xs tabular-nums",children:r}):null,d?(0,t.jsx)(T.TooltipProvider,{children:(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"ml-auto shrink-0",children:(0,t.jsx)(d,{className:"h-3.5 w-3.5"})})}),(0,t.jsxs)(T.TooltipContent,{side:"right",children:[(0,t.jsx)("span",{className:"font-medium",children:F.agentTypeLabels[i]??i}),o?(0,t.jsxs)("span",{className:"ms-1 opacity-70",children:["· ",(0,K.getModelMeta)(o).displayName||o]}):null]})]})}):null]})})}var B=e.i(73709);let _="shep-animations-enabled",$="shep:animations-toggle",G="no-animations",U="shep-theme";function X({label:e,count:a,children:s}){return(0,t.jsxs)(n.SidebarGroup,{"data-testid":"feature-status-group",className:"px-2 py-1",children:[(0,t.jsxs)(n.SidebarGroupLabel,{className:"text-muted-foreground h-6 px-2 text-[0.65rem] font-semibold tracking-wider uppercase",children:[e,(0,t.jsx)("span",{"aria-label":`${a} items`,className:"bg-sidebar-accent text-sidebar-accent-foreground ms-1.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[0.6rem] font-medium tabular-nums",role:"img",children:a})]}),(0,t.jsx)(n.SidebarGroupContent,{children:(0,t.jsx)(n.SidebarMenu,{className:"gap-0.5",children:s})})]})}var W=e.i(99105),Z=e.i(81542),Y=e.i(3214);function V({repoName:e,featureCount:s,children:r,defaultOpen:i=!0,onAddFeature:n}){let[o,l]=(0,a.useState)(i);return(0,t.jsxs)("div",{"data-testid":"repo-group",className:"group/repo mb-1",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!o),className:(0,N.cn)("text-sidebar-foreground hover:bg-sidebar-accent flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs font-semibold","transition-colors duration-100"),"aria-expanded":o,children:[(0,t.jsx)(W.ChevronDown,{className:(0,N.cn)("text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200",!o&&"-rotate-90")}),(0,t.jsx)(Z.GitFork,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),(0,t.jsx)("span",{"aria-label":`${s} features`,className:"bg-sidebar-accent text-sidebar-accent-foreground ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 text-[0.6rem] font-medium tabular-nums",role:"img",children:s})]}),n?(0,t.jsx)("button",{type:"button","data-testid":"repo-add-feature",onClick:e=>{e.stopPropagation(),n()},className:(0,N.cn)("text-muted-foreground hover:text-sidebar-foreground hover:bg-sidebar-accent shrink-0 rounded-md p-1 opacity-0 transition-all duration-100 group-hover/repo:opacity-100","focus-visible:ring-ring focus-visible:opacity-100 focus-visible:ring-1 focus-visible:outline-none"),"aria-label":`Add feature to ${e}`,children:(0,t.jsx)(Y.Plus,{className:"h-3.5 w-3.5"})}):null]}),o?(0,t.jsx)("div",{className:"pl-2",children:r}):null]})}function J({label:e,className:a}){return(0,t.jsx)(n.SidebarGroup,{"data-testid":"sidebar-section-header",className:(0,N.cn)("px-2 py-1",a),children:(0,t.jsx)("div",{className:"text-sidebar-foreground flex h-7 w-full shrink-0 items-center px-2 text-sm font-medium",children:(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})})})}let ee={version:"unknown",packageName:"@shepai/cli",description:"Autonomous AI Native SDLC Platform",branch:"",commitHash:"",instancePath:"",isDev:!1};function et({features:e,featureFlags:i,onFeatureClick:o,onAddFeature:v}){let{t:C,i18n:k}=(0,r.useTranslation)("web"),N=(0,s.usePathname)(),{state:A}=(0,n.useSidebar)(),P="collapsed"===A,{mounted:D,visible:L}=function(e,t){let[s,r]=(0,a.useState)(!e),[i,n]=(0,a.useState)(!e);return(0,a.useEffect)(()=>{if(!e){r(!0);let e=requestAnimationFrame(()=>n(!0));return()=>cancelAnimationFrame(e)}n(!1);let t=window.setTimeout(()=>r(!1),200);return()=>window.clearTimeout(t)},[e,200]),{mounted:s,visible:i}}(P,0),O=function(){let[e,t]=(0,a.useState)(ee);return(0,a.useEffect)(()=>{let e=!1;return async function(){try{let a=await fetch("/api/version");if(!a.ok)return;let s=await a.json();e||t(s)}catch{}}(),()=>{e=!0}},[]),e}(),{enabled:q,toggle:I}=(0,B.useSoundEnabled)(),{enabled:Q,toggle:F}=function(){let[e,t]=(0,a.useState)(!0);(0,a.useEffect)(()=>{"false"===localStorage.getItem(_)&&(t(!1),document.body.classList.add(G));let e=e=>{let a=e.detail;t(a),document.body.classList.toggle(G,!a)};return window.addEventListener($,e),()=>window.removeEventListener($,e)},[]);let s=(0,a.useCallback)(()=>{let a=!e;localStorage.setItem(_,String(a)),t(a),document.body.classList.toggle(G,!a),window.dispatchEvent(new CustomEvent($,{detail:a}))},[e]);return{enabled:e,toggle:s}}(),{resolvedTheme:K,theme:W,setTheme:Z}=function(){let[e,t]=(0,a.useState)("system"),[s,r]=(0,a.useState)("light"),i=(0,a.useCallback)(()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[]),n=(0,a.useCallback)(e=>"system"===e?i():e,[i]),o=(0,a.useCallback)(e=>{if("u"<typeof document)return;let t=document.documentElement;t.classList.remove("light","dark"),t.classList.add(e),r(e)},[]),l=(0,a.useCallback)(e=>{t(e),"u">typeof localStorage&&localStorage.setItem(U,e),o(n(e))},[n,o]);return(0,a.useEffect)(()=>{let e=localStorage.getItem(U)??"system";t(e),o(n(e))},[n,o]),(0,a.useEffect)(()=>{let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{"system"===e&&o(n("system"))};return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e,n,o]),{theme:e,resolvedTheme:s,setTheme:l}}(),Y=(0,w.useSoundAction)("toggle-on"),et=(0,w.useSoundAction)("toggle-off"),ea=(0,w.useSoundAction)("navigate"),es=(0,a.useMemo)(()=>{let t=new Map;for(let a of e){let e=a.repositoryPath,s=t.get(e);s||(s={repoName:a.repositoryName,features:[]},t.set(e,s)),s.features.push(a)}return Array.from(t.entries()).map(([e,{repoName:t,features:a}])=>({repoPath:e,repoName:t,featureCount:a.length,statusGroups:z.map(e=>({statusKey:e,label:C(R[e].labelKey),items:a.filter(t=>t.status===e)})).filter(e=>e.items.length>0)}))},[e,C]);return(0,t.jsxs)(n.Sidebar,{"data-testid":"app-sidebar","data-no-drawer-close":!0,collapsible:"icon",side:"rtl"===k.dir()?"right":"left",children:[(0,t.jsx)(n.SidebarHeader,{children:(0,t.jsxs)(n.SidebarMenu,{children:[(0,t.jsx)(n.SidebarMenuItem,{children:(0,t.jsxs)("div",{className:"flex h-8 items-center group-data-[collapsible=icon]:justify-center",children:[D?(0,t.jsxs)("div",{className:["flex min-w-0 flex-1 items-center gap-2 overflow-hidden px-2 transition-opacity duration-200 ease-out",L?"opacity-100":"opacity-0"].join(" "),"aria-hidden":!L,children:[(0,t.jsx)(M,{className:"shrink-0",size:20,variant:O.isDev?"dev":"default"}),(0,t.jsx)("span",{className:"truncate text-sm font-semibold tracking-tight",children:"Shep"}),(0,t.jsx)(E,{version:O.version,branch:O.branch||void 0,commitHash:O.commitHash||void 0,isDev:O.isDev,packageName:O.packageName,description:O.description,instancePath:O.instancePath||void 0})]}):null,(0,t.jsx)(S,{className:"shrink-0 transition-all duration-200"})]})}),(0,t.jsx)(j,{icon:l,label:C("navigation.controlCenter"),href:"/",active:"/"===N}),i.inventory?(0,t.jsx)(j,{icon:b,label:C("navigation.inventory"),href:"/features",active:"/features"===N}):null,(0,t.jsx)(j,{icon:f.Wrench,label:C("navigation.tools"),href:"/tools",active:"/tools"===N}),i.skills?(0,t.jsx)(j,{icon:g.Puzzle,label:C("navigation.skills"),href:"/skills",active:"/skills"===N}):null,(0,t.jsx)(j,{icon:x.Settings,label:C("navigation.settings"),href:"/settings",active:"/settings"===N})]})}),(0,t.jsx)(n.SidebarContent,{children:D?(0,t.jsxs)("div",{className:["flex min-h-0 flex-1 flex-col overflow-hidden transition-opacity duration-200 ease-out [&_[data-sidebar=group-label]]:!mt-0 [&_[data-sidebar=group-label]]:!opacity-100 [&_[data-sidebar=group-label]]:!transition-none",L?"opacity-100":"opacity-0"].join(" "),children:[(0,t.jsx)(J,{label:C("sidebar.features")}),(0,t.jsx)(y.ScrollArea,{className:"min-h-0 flex-1",children:es.map(({repoPath:e,repoName:a,featureCount:s,statusGroups:r})=>(0,t.jsx)(V,{repoName:a,featureCount:s,onAddFeature:v?()=>v(e):void 0,children:r.map(({statusKey:e,label:a,items:s})=>(0,t.jsx)(X,{label:a,count:s.length,children:s.map(e=>(0,t.jsx)(H,{name:e.name,status:e.status,startedAt:e.startedAt,duration:e.duration,agentType:e.agentType,modelId:e.modelId,onClick:o?()=>o(e.featureId):void 0},e.featureId))},e))},e))})]}):null}),(0,t.jsx)(n.SidebarFooter,{className:"border-t p-2",children:(0,t.jsx)(n.SidebarMenu,{children:(0,t.jsx)(n.SidebarMenuItem,{children:(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsxs)(T.TooltipProvider,{children:[(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)(n.SidebarMenuButton,{className:"w-auto flex-none",onClick:e=>{let t="system"===W?"dark"===K?"light":"dark":"dark"===W?"light":"dark";"dark"!==("system"===W?K:W)?Y.play():et.play();let a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;"startViewTransition"in document&&!a?(document.documentElement.style.setProperty("--x",`${e.clientX}px`),document.documentElement.style.setProperty("--y",`${e.clientY}px`),document.startViewTransition(()=>{Z(t)})):Z(t)},"aria-label":"dark"===K?C("sidebar.switchToLight"):C("sidebar.switchToDark"),children:[(0,t.jsx)(u,{className:"h-4 w-4 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),(0,t.jsx)(c,{className:"absolute h-4 w-4 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"})]})}),(0,t.jsx)(T.TooltipContent,{side:"top",children:"dark"===K?C("sidebar.switchToLight"):C("sidebar.switchToDark")})]}),!P&&(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(n.SidebarMenuButton,{className:"w-auto flex-none",onClick:()=>{ea.play(),I()},"aria-label":q?C("sidebar.muteSounds"):C("sidebar.unmuteSounds"),children:q?(0,t.jsx)(d,{className:"h-4 w-4"}):(0,t.jsx)(h,{className:"h-4 w-4"})})}),(0,t.jsx)(T.TooltipContent,{side:"top",children:q?C("sidebar.muteSounds"):C("sidebar.unmuteSounds")})]}),!P&&(0,t.jsxs)(T.Tooltip,{children:[(0,t.jsx)(T.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(n.SidebarMenuButton,{className:"w-auto flex-none",onClick:()=>{ea.play(),F()},"aria-label":Q?"Disable animations":"Enable animations",children:Q?(0,t.jsx)(m.Zap,{className:"h-4 w-4"}):(0,t.jsx)(p,{className:"h-4 w-4"})})}),(0,t.jsx)(T.TooltipContent,{side:"top",children:Q?"Disable animations":"Enable animations"})]})]})})})})}),(0,t.jsx)(n.SidebarRail,{})]})}e.i(13322);var ea=e.i(61201),es=e.i(48109),er=e.i(60253),ei=e.i(26370);let en=(0,o.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var eo=e.i(87538);let el=(0,o.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var ec=e.i(28112),eu=e.i(57779),ed=e.i(80554),eh=e.i(62639);let em="shep-global-chat";function ep(){try{let e=localStorage.getItem(em);if(!e)return{pos:null,size:null};let t=JSON.parse(e),a=t.size??null;return a&&(a.w<360||a.h<300)&&(a={w:Math.max(360,a.w),h:Math.max(300,a.h)}),{pos:t.pos??null,size:a}}catch{return{pos:null,size:null}}}function ef(){let{t:e}=(0,r.useTranslation)("web"),[s,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1),d=(0,ed.useTurnStatus)("global"),{swapPosition:h}=(0,eh.useFabLayout)(),{state:m}=(0,n.useSidebar)(),[p,f]=(0,a.useState)(()=>ep().pos),[g,x]=(0,a.useState)(()=>ep().size),b=(0,a.useCallback)(e=>{f(t=>"function"==typeof e?e(t):e)},[]),y=(0,a.useCallback)(e=>{x(t=>"function"==typeof e?e(t):e)},[]),v=(0,a.useRef)(null),w=(0,a.useRef)(null),j=(0,a.useRef)(null),C=(0,a.useCallback)(()=>{i(e=>(e||l(!0),!e))},[]),S=(0,a.useRef)({pos:null,size:null}),M=(0,a.useCallback)(()=>{s||(i(!0),l(!0)),u(e=>(e?(b(S.current.pos),y(S.current.size)):S.current={pos:p,size:g},!e))},[s,p,g,b,y]);(0,a.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&("k"===e.key||"K"===e.key)&&(e.preventDefault(),c&&u(!1),C(),requestAnimationFrame(()=>{setTimeout(()=>{let e=v.current?.querySelector("textarea");e?.focus()},100)})),(e.metaKey||e.ctrlKey)&&e.shiftKey&&("m"===e.key||"M"===e.key)&&(e.preventDefault(),M())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[C,M,c]),(0,a.useEffect)(()=>{let e=setTimeout(()=>(function(e,t){try{localStorage.setItem(em,JSON.stringify({pos:e,size:t}))}catch{}})(p,g),300);return()=>clearTimeout(e)},[p,g]);let T=(0,a.useCallback)((e,t,a)=>({x:Math.max(-a+100,Math.min(e,window.innerWidth-100)),y:Math.max(0,Math.min(t,window.innerHeight-48))}),[]),E=(0,a.useCallback)(e=>{e.preventDefault();let t=v.current;if(!t)return;let a=t.getBoundingClientRect(),s=p?.x??a.left,r=p?.y??a.top;w.current={startX:e.clientX,startY:e.clientY,startPosX:s,startPosY:r};let i=g?.w??a.width,n=e=>{if(!w.current)return;let t=e.clientX-w.current.startX,a=e.clientY-w.current.startY;b(T(w.current.startPosX+t,w.current.startPosY+a,i))},o=()=>{w.current=null,document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)},[p,g,b,T]),A=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=v.current;if(!t)return;let a=t.getBoundingClientRect(),s=g?.w??a.width,r=g?.h??a.height,i=e.clientX,n=e.clientY,o=p?.y??a.top;j.current={startX:i,startY:n,startW:s,startH:r},p||b({x:a.left,y:a.top});let l=e=>{if(!j.current)return;let t=e.clientX-i,l=e.clientY-n,c=Math.max(360,s+t),u=Math.max(300,r-l),d=Math.max(0,o+l);y({w:c,h:u}),b(e=>T(e?.x??a.left,d,c))},c=()=>{j.current=null,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",c)},[g,p,b,y,T]),P=(0,a.useCallback)(()=>{i(!1),u(!1)},[]),D=c?{}:p?{position:"fixed",left:p.x,top:p.y,width:g?.w??520,height:g?.h??"70vh"}:{width:g?.w??520,height:g?.h??"70vh"};return(0,t.jsxs)(t.Fragment,{children:[o?(0,t.jsxs)("div",{ref:v,className:(0,N.cn)(c?"bg-background fixed inset-0 z-[60] flex flex-col overflow-hidden dark:bg-neutral-900":(0,N.cn)(!p&&(h?"fixed start-8 bottom-24":"fixed end-8 bottom-24"),"z-[60] flex flex-col overflow-hidden rounded-lg","border-border/60 border dark:border-white/10","bg-background dark:bg-neutral-900","shadow-[0_8px_40px_-8px_rgba(0,0,0,0.2)] dark:shadow-[0_8px_40px_-8px_rgba(0,0,0,0.6)]"),"transition-opacity duration-300 ease-out",s?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"),style:D,children:[c?null:(0,t.jsx)("div",{className:"h-[2px] shrink-0 bg-gradient-to-r from-transparent via-violet-500/50 to-transparent"}),c?null:(0,t.jsx)("div",{onMouseDown:A,className:"absolute end-0 top-0 z-10 h-4 w-4 cursor-ne-resize"}),(0,t.jsxs)("div",{onMouseDown:c?void 0:E,className:(0,N.cn)("relative flex h-11 shrink-0 items-center gap-2.5 border-b border-black/[0.06] px-3.5 dark:border-white/[0.06]",!c&&"cursor-grab active:cursor-grabbing"),children:[(0,t.jsx)("div",{className:"from-foreground/[0.02] to-foreground/[0.02] pointer-events-none absolute inset-0 bg-gradient-to-r via-transparent"}),c?null:(0,t.jsx)(en,{className:"text-foreground/15 relative h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("div",{className:"relative flex h-5 w-5 items-center justify-center",children:(0,t.jsx)(ei.Bot,{className:"text-foreground/50 h-4 w-4"})}),(0,t.jsxs)("div",{className:"relative flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-foreground/90 text-base font-bold tracking-tight",children:"Shep"}),(0,t.jsx)("span",{className:"text-foreground/30 text-xs font-medium tracking-widest uppercase",children:"global"})]}),(0,t.jsxs)("div",{className:"relative ms-auto flex items-center gap-0.5",children:[(0,t.jsx)("button",{type:"button",onClick:M,className:"text-foreground/30 hover:text-foreground/60 rounded-md p-1 transition-colors",title:c?"Restore (⌘⇧M)":"Maximize (⌘⇧M)",children:c?(0,t.jsx)(el,{className:"h-3.5 w-3.5"}):(0,t.jsx)(eo.Maximize2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:P,className:"text-foreground/30 hover:text-foreground/60 rounded-md p-1 transition-colors",title:"Close (⌘⇧K)",children:(0,t.jsx)(er.X,{className:"h-3.5 w-3.5"})})]})]}),(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(ec.ChatTab,{featureId:"global"})}),c?null:(0,t.jsx)("div",{onMouseDown:e=>{e.preventDefault(),e.stopPropagation();let t=v.current;if(!t)return;let a=t.getBoundingClientRect(),s=e.clientX,r=e.clientY,i=g?.w??a.width,n=g?.h??a.height;p||b({x:a.left,y:a.top});let o=e=>{let t=window.innerHeight-(p?.y??a.top);y({w:Math.max(360,i+(e.clientX-s)),h:Math.max(300,Math.min(n+(e.clientY-r),t))})},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l)},className:"absolute end-0 bottom-0 z-10 h-4 w-4 cursor-se-resize"})]}):null,(0,t.jsxs)(eg,{swapPosition:h,sidebarState:m,isMaximized:c,children:[(0,t.jsxs)(k.Button,{size:"icon",onClick:C,className:(0,N.cn)("relative h-14 w-14 rounded-full shadow-lg","transition-all duration-200 hover:scale-105 hover:shadow-xl active:scale-95",s?"bg-violet-600 text-white hover:bg-violet-500":"bg-violet-500 text-white hover:bg-violet-400 dark:bg-violet-500 dark:hover:bg-violet-400",!s&&"processing"===d&&"chat-fab-spinning",!s&&"unread"===d&&"chat-fab-glow-unread",!s&&"awaiting_input"===d&&"chat-fab-glow-awaiting"),children:[(0,t.jsx)(es.MessageSquare,{className:(0,N.cn)("absolute h-7 w-7 stroke-[2.5] transition-all duration-200",s?"scale-0 rotate-90 opacity-0":"scale-100 rotate-0 opacity-100")}),(0,t.jsx)(er.X,{className:(0,N.cn)("absolute h-6 w-6 stroke-[2.5] transition-all duration-200",s?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-90 opacity-0")}),!s&&(0,t.jsx)(eu.ChatDotIndicator,{status:d,className:"end-0 top-0"})]}),(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 translate-y-1 opacity-0 transition-all duration-200 group-hover/fab:translate-y-0 group-hover/fab:opacity-100",children:(0,t.jsxs)("div",{className:"bg-foreground rounded-lg px-3 py-1.5 text-center shadow-lg",children:[(0,t.jsx)("p",{className:"text-background text-xs font-medium whitespace-nowrap",children:e("chat.shepChat")}),(0,t.jsxs)("p",{className:"text-background/50 mt-0.5 flex items-center justify-center gap-1 text-[10px]",children:[(0,t.jsx)("kbd",{className:"bg-background/15 rounded px-1 py-px font-mono",children:"⌘"}),(0,t.jsx)("kbd",{className:"bg-background/15 rounded px-1 py-px font-mono",children:"⇧"}),(0,t.jsx)("kbd",{className:"bg-background/15 rounded px-1 py-px font-mono",children:"K"})]})]})})]})]})}function eg({swapPosition:e,sidebarState:a,isMaximized:s,children:i}){let{i18n:n}=(0,r.useTranslation)("web"),o="rtl"===n.dir();if(!e)return(0,t.jsx)("div",{className:(0,N.cn)("group/fab fixed end-8 bottom-6 z-30",s&&"hidden"),children:i});let l="expanded"===a?"calc(var(--sidebar-width) + 32px)":"calc(var(--sidebar-width-icon) + 32px)";return(0,t.jsx)("div",{className:(0,N.cn)("group/fab fixed bottom-6 z-30",s&&"hidden"),style:o?{right:l,transition:"right 200ms ease-in-out"}:{left:l,transition:"left 200ms ease-in-out"},children:i})}var ex=e.i(78521),eb=e.i(2287),ey=e.i(68304),ev=e.i(98127),ew=e.i(41957);let ej=/^(?:https:\/\/github\.com\/([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+?)(?:\.git)?|git@github\.com:([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+?)(?:\.git)?|([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+))$/;function eC({onSubmit:e,loading:s=!1}){let[r,i]=(0,a.useState)(""),[n,o]=(0,a.useState)("");function l(){let t=r.trim();t?ej.test(t.trim())?(o(""),e(t)):o("Enter a valid GitHub URL (e.g. owner/repo or https://github.com/owner/repo)"):o("Please enter a GitHub URL")}return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(ew.Label,{htmlFor:"github-url-input",children:"GitHub URL"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ev.Input,{id:"github-url-input",placeholder:"owner/repo or https://github.com/owner/repo",value:r,onChange:e=>{i(e.target.value),n&&o("")},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),l())},disabled:s,"aria-invalid":!!n,"aria-describedby":n?"github-url-error":void 0}),(0,t.jsx)(k.Button,{onClick:l,disabled:s||!r.trim(),size:"sm",children:s?(0,t.jsx)(L.Loader2,{className:"h-4 w-4 animate-spin"}):"Import"})]}),n?(0,t.jsx)("p",{id:"github-url-error",className:"text-destructive text-sm",role:"alert",children:n}):null]})}let ek=(0,o.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var eN=e.i(32494),eS=e.i(66459),eM=e.i(79687),eT=e.i(81846),eE=e.i(61238),eA=e.i(47373),eP=e.i(21023);let eD=(0,eP.createServerReference)("4094f9ce314b1afc220780b81948c83f41ea837403",eP.callServer,void 0,eP.findSourceMapURL,"listGitHubRepositories"),eL=(0,eP.createServerReference)("008f558c5e860039945dfcf0cc5c7c402053570e73",eP.callServer,void 0,eP.findSourceMapURL,"listGitHubOrganizations"),eO="__personal__";function eq({onSelect:e,loading:s=!1,fetchRepos:r=eD,fetchOrgs:i=eL}){let[n,o]=(0,a.useState)([]),[l,c]=(0,a.useState)([]),[u,d]=(0,a.useState)(!0),[h,m]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[g,x]=(0,a.useState)(eO),b=(0,a.useRef)(null);(0,a.useEffect)(()=>{!async function(){try{let e=await i();e.orgs&&c(e.orgs)}catch{}}()},[i]);let y=(0,a.useCallback)(async(e,t)=>{d(!0),m("");try{let a={};e&&(a.search=e),t&&t!==eO&&(a.owner=t);let s=await r(Object.keys(a).length>0?a:void 0);s.error?(m(s.error),o([])):o(s.repos??[])}catch{m("Failed to fetch repositories"),o([])}finally{d(!1)}},[r]);return((0,a.useEffect)(()=>{y(p||void 0,g)},[y,g]),h&&!u)?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-center","data-testid":"repo-browser-error",children:[(0,t.jsx)(eM.AlertCircle,{className:"text-destructive h-8 w-8"}),(0,t.jsx)("p",{className:"text-destructive text-sm",children:h})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[l.length>0?(0,t.jsxs)(eA.Select,{value:g,onValueChange:function(e){x(e),f("")},disabled:s,children:[(0,t.jsx)(eA.SelectTrigger,{"aria-label":"Select owner",children:(0,t.jsx)(eA.SelectValue,{placeholder:"Select owner"})}),(0,t.jsxs)(eA.SelectContent,{children:[(0,t.jsx)(eA.SelectItem,{value:eO,children:"My repositories"}),l.map(e=>(0,t.jsx)(eA.SelectItem,{value:e.login,children:e.login},e.login))]})]}):null,(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(eS.Search,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2"}),(0,t.jsx)(ev.Input,{placeholder:"Search repositories...",value:p,onChange:e=>{var t;f(t=e.target.value),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{y(t||void 0,g)},300)},className:"ps-9",disabled:s,"aria-label":"Search repositories"})]}),(0,t.jsx)("div",{className:"max-h-64 overflow-x-hidden overflow-y-auto rounded-md border",role:"listbox","aria-label":"GitHub repositories",children:u?(0,t.jsx)("div",{className:"flex flex-col gap-2 p-3","data-testid":"repo-browser-loading",children:Array.from({length:5}).map((e,a)=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(eE.Skeleton,{className:"h-4 w-48"}),(0,t.jsx)(eE.Skeleton,{className:"h-3 w-72"})]},`skeleton-${String(a)}`))}):0===n.length?(0,t.jsx)("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"repo-browser-empty",children:"No repositories found"}):n.map(a=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":!1,className:"hover:bg-accent flex w-full items-start gap-2 border-b px-3 py-2.5 text-start last:border-b-0 disabled:opacity-50",onClick:()=>e(a.nameWithOwner),disabled:s,children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:a.nameWithOwner}),(0,t.jsx)(eT.Badge,{variant:a.isPrivate?"secondary":"outline",className:"shrink-0 text-xs",children:a.isPrivate?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek,{className:"me-1 h-3 w-3"}),"Private"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eN.Globe,{className:"me-1 h-3 w-3"}),"Public"]})})]}),a.description?(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 truncate text-xs",children:a.description}):null]}),s?(0,t.jsx)(L.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin"}):null]},a.nameWithOwner))})]})}let eI=(0,eP.createServerReference)("40adf7d5cceb346821a16c1b63e81d50aaaa207076",eP.callServer,void 0,eP.findSourceMapURL,"importGitHubRepository");function eQ({open:e,onOpenChange:s,onImportComplete:r}){let[i,n]=(0,a.useState)(!1),[o,l]=(0,a.useState)("");async function c(e){n(!0),l("");try{let t=await eI({url:e});t.error?l(t.error):t.repository&&(r(t.repository),s(!1))}catch{l("An unexpected error occurred")}finally{n(!1)}}return(0,t.jsx)(eb.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(eb.DialogContent,{className:"overflow-hidden sm:max-w-lg",children:[(0,t.jsxs)(eb.DialogHeader,{children:[(0,t.jsx)(eb.DialogTitle,{children:"Import from GitHub"}),(0,t.jsx)(eb.DialogDescription,{children:"Clone a GitHub repository and add it to Shep."})]}),(0,t.jsxs)(ey.Tabs,{defaultValue:"url",className:"min-w-0",children:[(0,t.jsxs)(ey.TabsList,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(ey.TabsTrigger,{value:"url",children:"URL"}),(0,t.jsx)(ey.TabsTrigger,{value:"browse",children:"Browse"})]}),(0,t.jsx)(ey.TabsContent,{value:"url",className:"mt-4",children:(0,t.jsx)(eC,{onSubmit:c,loading:i})}),(0,t.jsx)(ey.TabsContent,{value:"browse",className:"mt-4",children:(0,t.jsx)(eq,{onSelect:c,loading:i})})]}),o?(0,t.jsx)("p",{className:"text-destructive text-sm",role:"alert",children:o}):null]})})}var eR=e.i(39443),ez=e.i(30153),eF=e.i(5147),eK=e.i(60112),eH=e.i(17406);let eB={[eH.NotificationSeverity.Success]:"success",[eH.NotificationSeverity.Error]:"error",[eH.NotificationSeverity.Warning]:"warning",[eH.NotificationSeverity.Info]:"info"},e_={[eH.NotificationSeverity.Success]:"notification-success",[eH.NotificationSeverity.Error]:"notification-error",[eH.NotificationSeverity.Warning]:"notification-warning",[eH.NotificationSeverity.Info]:"notification-info"};var e$=e.i(75921);function eG({children:e,sidebarOpen:r}){let i=(0,s.useRouter)(),{guardedNavigate:o}=(0,ez.useDrawerCloseGuard)(),l=(0,e$.useFeatureFlags)();!function(){let e=(0,s.useRouter)(),{events:t}=(0,eR.useAgentEventsContext)(),r=(0,w.useSoundAction)("notification-success"),i=(0,w.useSoundAction)("notification-error"),n=(0,w.useSoundAction)("notification-warning"),o=(0,w.useSoundAction)("notification-info"),l=(0,a.useMemo)(()=>({"notification-success":r,"notification-error":i,"notification-warning":n,"notification-info":o}),[r,i,n,o]),c=(0,a.useRef)(0);(0,a.useEffect)(()=>{if(t.length<=c.current)return;let a=t.slice(c.current);for(let s of(c.current=t.length,a)){if(s.eventType!==eH.NotificationEventType.MergeReviewReady&&s.severity!==eH.NotificationSeverity.Error&&s.severity!==eH.NotificationSeverity.Warning&&s.severity!==eH.NotificationSeverity.Success)continue;!function(e,t){let a=eB[e.severity]??"info",s=e.eventType===eH.NotificationEventType.WaitingApproval||e.eventType===eH.NotificationEventType.MergeReviewReady;eK.toast[a](e.featureName,{description:e.message,...s&&t&&{action:{label:"Review",onClick:()=>{t(`/feature/${e.featureId}`)}}}})}(s,t=>e.push(t));let t=e_[s.severity];l[t]?.play()}},[t,l,e])}();let{features:c}=(0,eF.useSidebarFeaturesContext)(),u=(0,a.useCallback)(e=>{o(()=>i.push(`/feature/${e}`))},[i,o]),d=(0,a.useCallback)(e=>{o(()=>i.push(`/create?repo=${encodeURIComponent(e)}`))},[i,o]),[h,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[g,x]=(0,a.useState)(!1),b=(0,a.useCallback)(async()=>{if(!h){if(l.reactFileManager)return void x(!0);m(!0);try{let e=await (0,ex.pickFolder)();e&&window.dispatchEvent(new CustomEvent("shep:add-repository",{detail:{path:e}}))}catch{x(!0)}finally{m(!1)}}},[h,l.reactFileManager]);(0,a.useEffect)(()=>{let e=()=>{b()};return window.addEventListener("shep:pick-folder",e),()=>window.removeEventListener("shep:pick-folder",e)},[b]),(0,a.useEffect)(()=>{let e=()=>f(!0);return window.addEventListener("shep:open-github-import",e),()=>window.removeEventListener("shep:open-github-import",e)},[]);let y=(0,a.useCallback)(e=>{e&&window.dispatchEvent(new CustomEvent("shep:add-repository",{detail:{path:e}})),x(!1)},[]),v=(0,a.useCallback)(e=>{e.path&&window.dispatchEvent(new CustomEvent("shep:add-repository",{detail:{path:e.path}}))},[]);return(0,t.jsxs)(n.SidebarProvider,{defaultOpen:r??!1,children:[(0,t.jsx)(et,{features:c,featureFlags:l,onFeatureClick:u,onAddFeature:d}),(0,t.jsx)(n.SidebarInset,{children:(0,t.jsxs)("div",{className:"relative h-full",children:[(0,t.jsx)("main",{className:"h-full",children:e}),(0,t.jsx)(ef,{}),l.githubImport?(0,t.jsx)(eQ,{open:p,onOpenChange:f,onImportComplete:v}):null]})}),(0,t.jsx)(ea.ReactFileManagerDialog,{open:g,onOpenChange:e=>{e||x(!1)},onSelect:y})]})}function eU({children:e}){return(0,t.jsx)(ed.TurnStatusesProvider,{children:e})}function eX({children:e,sidebarOpen:a}){let{i18n:s}=(0,r.useTranslation)(),n=s.dir();return(0,t.jsx)(i.Direction.Provider,{dir:n,children:(0,t.jsx)(eR.AgentEventsProvider,{children:(0,t.jsx)(ez.DrawerCloseGuardProvider,{children:(0,t.jsx)(eF.SidebarFeaturesProvider,{children:(0,t.jsx)(eU,{children:(0,t.jsx)(eG,{sidebarOpen:a,children:e})})})})})})}e.s(["AppShell",()=>eX],87292)},25251,e=>{"use strict";var t=e.i(20314),a=e.i(60112);let s=({...e})=>(0,t.jsx)(a.Toaster,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e});e.s(["Toaster",()=>s])},4858,e=>{"use strict";var t=e.i(20314),a=e.i(3),s=e.i(28574),r=e.i(6786),i=e.i(77501),n=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let i=t.queryKey,n=t.queryHash??(0,a.hashQueryKeyByOptions)(i,t),o=this.get(n);return o||(o=new s.Query({client:e,queryKey:i,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,a.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,a.matchQuery)(e,t)):t}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){r.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o=e.i(87975),l=i,c=class extends l.Subscribable{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#a=new Map,this.#s=0}#t;#a;#s;build(e,t,a){let s=new o.Mutation({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:a});return this.add(s),s}add(e){this.#t.add(e);let t=u(e);if("string"==typeof t){let a=this.#a.get(t);a?a.push(e):this.#a.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=u(e);if("string"==typeof t){let a=this.#a.get(t);if(a)if(a.length>1){let t=a.indexOf(e);-1!==t&&a.splice(t,1)}else a[0]===e&&this.#a.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let a=this.#a.get(t),s=a?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let a=this.#a.get(t)?.find(t=>t!==e&&t.state.isPaused);return a?.continue()??Promise.resolve()}}clear(){r.notifyManager.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#a.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,a.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,a.matchMutation)(e,t))}notify(e){r.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return r.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(a.noop))))}};function u(e){return e.options.scope?.id}var d=e.i(4520),h=e.i(13598);function m(e){return{onFetch:(t,s)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],o=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,u=async()=>{let s=!1,u=(0,a.ensureQueryFn)(t.options,t.fetchOptions),d=async(e,r,i)=>{let n;if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let o=(n={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?"backward":"forward",meta:t.options.meta},(0,a.addConsumeAwareSignal)(n,()=>t.signal,()=>s=!0),n),l=await u(o),{maxPages:c}=t.options,d=i?a.addToStart:a.addToEnd;return{pages:d(e.pages,l,c),pageParams:d(e.pageParams,r,c)}};if(i&&n.length){let e="backward"===i,t={pages:n,pageParams:o},a=(e?function(e,{pages:t,pageParams:a}){return t.length>0?e.getPreviousPageParam?.(t[0],t,a[0],a):void 0}:p)(r,t);l=await d(t,a,e)}else{let t=e??n.length;do{let e=0===c?o[0]??r.initialPageParam:p(r,l);if(c>0&&null==e)break;l=await d(l,e),c++}while(c<t)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=u}}}function p(e,{pages:t,pageParams:a}){let s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,a[s],a):void 0}var f=class{#r;#i;#n;#o;#l;#c;#u;#d;constructor(e={}){this.#r=e.queryCache||new n,this.#i=e.mutationCache||new c,this.#n=e.defaultOptions||{},this.#o=new Map,this.#l=new Map,this.#c=0}mount(){this.#c++,1===this.#c&&(this.#u=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#d=h.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#c--,0===this.#c&&(this.#u?.(),this.#u=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#r.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#r.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#r.get(r.queryHash),n=i?.state.data,o=(0,a.functionalUpdate)(t,n);if(void 0!==o)return this.#r.build(this,r).setData(o,{...s,manual:!0})}setQueriesData(e,t,a){return r.notifyManager.batch(()=>this.#r.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,a)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state}removeQueries(e){let t=this.#r;r.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let a=this.#r;return r.notifyManager.batch(()=>(a.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(r.notifyManager.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(a.noop).catch(a.noop)}invalidateQueries(e,t={}){return r.notifyManager.batch(()=>(this.#r.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(r.notifyManager.batch(()=>this.#r.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(a.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(a.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#r.build(this,t);return s.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(a.noop).catch(a.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(a.noop).catch(a.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.onlineManager.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#i}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set((0,a.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,a.partialMatchKey)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#l.set((0,a.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,a.partialMatchKey)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,a.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===a.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#r.clear(),this.#i.clear()}},g=e.i(34682),x=e.i(79054);function b({children:e}){let[a]=(0,x.useState)(()=>new f({defaultOptions:{queries:{staleTime:1e3,refetchOnWindowFocus:!1}}}));return(0,t.jsx)(g.QueryClientProvider,{client:a,children:e})}e.s(["QueryProvider",()=>b],4858)},10644,e=>{"use strict";let t;var a=e.i(20314),s=e.i(79054);e.i(41001);var r=e.i(14827),i=e.i(99065),n=e.i(83100),o=e.i(37465),l=e.i(51193),c=e.i(55431),u=e.i(60280),d=e.i(40266),h=e.i(50784),m=e.i(28191),p=e.i(71363),f=e.i(53493),g=e.i(22307),x=e.i(44225),b=e.i(62305),y=e.i(51943),v=e.i(88158),w=e.i(39711),j=e.i(32456);let C=((t=i.default.createInstance()).use(n.initReactI18next).init({lng:"en",fallbackLng:"en",defaultNS:"common",ns:["common","web"],resources:{en:{common:o.default,web:l.default},ru:{common:c.default,web:u.default},pt:{common:d.default,web:h.default},es:{common:m.default,web:p.default},ar:{common:f.default,web:g.default},he:{common:x.default,web:b.default},fr:{common:y.default,web:v.default},de:{common:w.default,web:j.default}},interpolation:{escapeValue:!1},react:{useSuspense:!1}}),t),k={ar:{family:"Noto Sans Arabic",cssUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},he:{family:"Noto Sans Hebrew",cssUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"}};function N(e){let t=k[e];if(document.documentElement.classList.remove("font-rtl-arabic","font-rtl-hebrew"),!t)return void document.documentElement.style.removeProperty("--font-rtl");document.documentElement.style.setProperty("--font-rtl",`"${t.family}"`),document.documentElement.classList.add("ar"===e?"font-rtl-arabic":"font-rtl-hebrew");let a=`rtl-font-${e}`;if(!document.getElementById(a)){let e=document.createElement("link");e.id=a,e.rel="stylesheet",e.href=t.cssUrl,document.head.appendChild(e)}}function S({initialLanguage:e,children:t}){return(0,s.useEffect)(()=>{C.language!==e&&C.changeLanguage(e),N(e)},[e]),(0,s.useEffect)(()=>{function e(e){N(e)}return C.on("languageChanged",e),()=>{C.off("languageChanged",e)}},[]),(0,a.jsx)(r.I18nextProvider,{i18n:C,children:t})}e.s(["I18nProvider",()=>S],10644)}]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_731_27445)">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M111.688 83.9677C108.245 89.9488 88.2522 104.062 64 104.062C39.7478 104.062 19.7554 89.9488 16.3123 83.9677C16.0605 83.5303 15.9792 83.031 15.9792 82.5263L15.9792 71.8787C15.9792 71.4373 16.0474 70.9986 16.2107 70.5885C17.6996 66.8499 21.599 61.4192 26.6313 59.9621C27.2985 58.2494 28.2867 55.7456 29.2087 53.8974C29.0543 52.4833 29 51.0248 29 49.5512C29 44.2274 30.1285 39.5576 33.5288 36.0801C35.117 34.4559 37.0876 33.21 39.4246 32.2735C45.0217 27.7264 52.992 23.9011 63.9136 23.9011C74.8352 23.9011 82.9783 27.7264 88.5754 32.2735C90.9124 33.21 92.883 34.4559 94.4712 36.0801C97.8715 39.5576 99 44.2274 99 49.5512C99 51.0248 98.9457 52.4833 98.7913 53.8974C99.7133 55.7456 100.701 58.2494 101.369 59.9621C106.401 61.4192 110.3 66.8499 111.789 70.5885C111.953 70.9986 112.021 71.4373 112.021 71.8787L112.021 82.5263C112.021 83.031 111.939 83.5303 111.688 83.9677ZM67.253 48.2606C67.0828 46.9345 67.0018 45.747 66.9995 44.686L66.9995 44.6021C67.0048 41.5242 67.6776 39.5215 68.7524 38.2914C70.1172 36.7295 72.9379 35.5328 78.8829 36.1762C84.9059 36.828 88.2725 38.3229 90.1812 40.2749C92.0291 42.1648 92.9999 44.9922 92.9999 49.5512C92.9999 54.3951 92.3018 57.2568 90.767 58.9977C89.3075 60.6531 86.4335 62 80.1386 62C75.2994 62 72.5326 60.4261 70.7637 58.2493C68.8644 55.912 67.7955 52.4878 67.253 48.2606ZM60.747 48.2606C60.9172 46.9344 60.9982 45.747 61.0005 44.686L61.0005 44.6021C60.9952 41.5242 60.3224 39.5214 59.2476 38.2914C57.8828 36.7295 55.0621 35.5328 49.1171 36.1762C43.0941 36.828 39.7275 38.3229 37.8188 40.2749C35.9709 42.1647 35.0001 44.9922 35.0001 49.5512C35.0001 54.3951 35.6982 57.2568 37.233 58.9977C38.6925 60.6531 41.5665 62 47.8614 62C52.7006 62 55.4674 60.4261 57.2363 58.2493C59.1356 55.9119 60.2045 52.4878 60.747 48.2606ZM64.6889 59.9983C64.4592 59.9995 64.9185 59.9983 64.6889 59.9983C64.4594 59.9983 63.5408 59.9995 63.3111 59.9983C62.8877 60.7075 62.4168 61.3882 61.8926 62.0332C58.8139 65.8219 54.2182 68 47.8613 68C40.9615 68 35.9049 66.564 32.7324 62.9657C32.552 62.7611 32.3906 62.5469 32.3906 62.5469L32 62.9657L32 89.3023C37.7392 92.4213 50.0576 98.0184 64 98.0184C77.9424 98.0184 90.2608 92.4213 96 89.3023L96 62.9657L95.6094 62.5469C95.6094 62.5469 95.4772 62.728 95.2676 62.9657C92.0951 66.564 87.0385 68 80.1387 68C73.7818 68 69.1861 65.8219 66.1074 62.0332C65.5832 61.3882 65.1123 60.7075 64.6889 59.9983Z" fill="white"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M74 73C76.2091 73 78 74.7909 78 77L78 85C78 87.2092 76.2091 89 74 89C71.7909 89 70 87.2092 70 85L70 77C70 74.7909 71.7909 73 74 73Z" fill="white"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M54 73C56.2091 73 58 74.7909 58 77L58 85C58 87.2092 56.2091 89 54 89C51.7909 89 50 87.2092 50 85L50 77C50 74.7909 51.7909 73 54 73Z" fill="white"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="clip0_731_27445">
|
|
9
|
+
<rect width="96" height="96" fill="white" transform="translate(16 16)"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},41413,e=>{"use strict";var t=e.i(20314),s=e.i(79054),r=e.i(23925),i=e.i(11345),n=e.i(76016),a=e.i(62763),o=e.i(1998),l=e.i(86782),u=e.i(29847),c=e.i(35364),h=e.i(90382),d=e.i(31777);function p({initialAgentType:e,initialModel:p,agentType:f,model:m,onAgentModelChange:y,onSave:v,saveError:b,saving:g,disabled:x,className:w,mode:S}){let[j,T]=s.useState(!1),[R,k]=s.useState([]),[C,O]=s.useState(!0),[I,E]=s.useState(f??e),[F,M]=s.useState(m??p),[Q,N]=s.useState(!1),[D,P]=s.useState(null),[U,A]=s.useState(0),[q,L]=s.useState(null);s.useEffect(()=>{(0,a.getAllAgentModels)().then(k).finally(()=>O(!1))},[]),s.useEffect(()=>{E(f??e)},[f,e]),s.useEffect(()=>{M(m??p)},[m,p]);let H=s.useRef(j);s.useEffect(()=>{let e=H.current;if(H.current=j,e&&!j){let e=setTimeout(()=>{A(0),L(null)},150);return()=>clearTimeout(e)}},[j]);let K=async(e,t)=>{if(T(!1),e===I&&t===F)return;if(P(null),"override"===S){E(e),M(t),y?.(e,t);return}let s=v??(async(e,t)=>(0,o.updateAgentAndModel)(e,t||null));N(!0);try{let r=await s(e,t);if(r&&"ok"in r&&!r.ok)return void P(r.error??"Failed to save");E(e),M(t),y?.(e,t)}catch{P("Failed to save")}finally{N(!1)}},z=b??D,B=(0,l.getAgentTypeIcon)(I),_=R.find(e=>e.agentType===I)?.label??I,V=F?(0,u.getModelMeta)(F).displayName||F:null,G=q?R.find(e=>e.agentType===q):null;return(0,t.jsxs)("div",{className:(0,d.cn)("flex flex-col gap-1",w),children:[(0,t.jsxs)(h.Popover,{open:j,onOpenChange:T,children:[(0,t.jsx)(h.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{type:"button",variant:"outline",role:"combobox","aria-expanded":j,disabled:(x??!1)||C||(g??!1)||Q,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(B,{className:"h-4 w-4 shrink-0"}),C?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:_}),V?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:V})]}):null]})]})})}),(0,t.jsx)(h.PopoverContent,{className:"z-[70] w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===U?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),R.map(e=>{let s=(0,l.getAgentTypeIcon)(e.agentType),i=I===e.agentType,a=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,d.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",i&&"bg-accent/50"),onClick:()=>{a?(L(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>A(1))})):K(e.agentType,"")},children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-start",children:e.label}),i&&!a?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,a?(0,t.jsx)(n.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:G?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{A(0),setTimeout(()=>L(null),220)},children:[(0,t.jsx)(i.ChevronLeft,{className:"h-3.5 w-3.5"}),G.label]}),G.models.map(e=>{let s=I===G.agentType&&F===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,d.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-start transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>K(G.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),s?(0,t.jsx)(r.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!z&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:z})]})}e.s(["AgentModelPicker",()=>p])},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},43698,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["default",()=>t])},64764,80436,17087,e=>{"use strict";var t=e.i(15506);e.s(["Loader2Icon",()=>t.default],64764);var s=e.i(95230);e.s(["DownloadIcon",()=>s.default],80436);let r=(0,e.i(3645).default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>r],17087)},48306,e=>{"use strict";var t=e.i(20314),s=e.i(31777);function r({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}e.s(["Textarea",()=>r])},28267,57484,e=>{"use strict";var t=e.i(1693);e.s(["VisuallyHidden",0,t],28267);let s=(0,e.i(3645).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>s],57484)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},50032,86254,e=>{"use strict";var t=e.i(20314),s=e.i(60253),r=e.i(64764),i=e.i(80436),n=e.i(17087),a=e.i(31777),o=e.i(2287),l=e.i(48306),u=e.i(2828),c=e.i(28267),h=e.i(57484),d=e.i(16298),d=d;let p=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var f=e.i(93752),f=f;e.i(35364);let m=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),y=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function v(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function g(e,t){let s=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${s.toString()}`}function x({name:e,size:x,mimeType:w,path:S,onRemove:j,loading:T=!1,disabled:R=!1,notes:k,onNotesChange:C}){let O,I,E=(O=e.lastIndexOf("."))>=0?e.slice(O).toLowerCase():"",F=m.has(E)?p:".pdf"===E?d.default:y.has(E)?f.default:h.FileIcon,M=".pdf"===E?"bg-red-50 text-red-600":m.has(E)?"bg-blue-50 text-blue-600":y.has(E)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",Q=(I=e.lastIndexOf("."))>=0&&b.has(e.slice(I).toLowerCase());if(T)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(r.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(Q){let r=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:g(S,w),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),k?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(n.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(u.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(o.Dialog,{children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(o.DialogTrigger,{asChild:!0,children:r})}),!R&&(0,t.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]}),k?(0,t.jsx)(u.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:k})}):null]}),(0,t.jsxs)(o.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(o.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:g(S,w),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:v(x)})]}),(0,t.jsx)("a",{href:g(S,w),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(i.DownloadIcon,{className:"h-4 w-4"})})]}),C?(0,t.jsx)(l.Textarea,{placeholder:"Add notes about this image…",value:k??"",onChange:e=>C(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):k?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:k}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 ps-2 pe-3",children:[(0,t.jsx)("div",{className:(0,a.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",M),children:(0,t.jsx)(F,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:v(x)}),!R&&(0,t.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]})}e.s(["AttachmentChip",()=>x],86254),e.s([],50032)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},67669,e=>{"use strict";let t=(0,e.i(3645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],67669)},94365,e=>{"use strict";let t=(0,e.i(3645).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],94365)},4520,77501,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t],77501);var s=new class extends t{#e;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>s],4520)},3,68911,e=>{"use strict";e.i(44172);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s=new class{#r=t;#i=!1;setTimeoutProvider(e){this.#r=e}setTimeout(e,t){return this.#r.setTimeout(e,t)}clearTimeout(e){this.#r.clearTimeout(e)}setInterval(e,t){return this.#r.setInterval(e,t)}clearInterval(e){this.#r.clearInterval(e)}};function r(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>r,"timeoutManager",()=>s],68911);var i="u"<typeof window||"Deno"in globalThis;function n(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==p(a,t.options))return!1}else if(!m(t.queryKey,a))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!i||i===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:s,status:r,predicate:i,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(f(t.options.mutationKey)!==f(n))return!1}else if(!m(t.options.mutationKey,n))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function p(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>g(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>m(e[s],t[s]))}var y=Object.prototype.hasOwnProperty;function v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let s in e)if(e[s]!==t[s])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e){if(!x(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!x(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return new Promise(t=>{s.setTimeout(t,e)})}function S(e,t,s){return"function"==typeof s.structuralSharing?s.structuralSharing(e,t):!1!==s.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let i=b(t)&&b(s);if(!i&&!(g(t)&&g(s)))return s;let n=(i?t:Object.keys(t)).length,a=i?s:Object.keys(s),o=a.length,l=i?Array(o):{},u=0;for(let c=0;c<o;c++){let o=i?c:a[c],h=t[o],d=s[o];if(h===d){l[o]=h,(i?c<n:y.call(t,o))&&u++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){l[o]=d;continue}let p=e(h,d,r+1);l[o]=p,p===h&&u++}return n===o&&u===n?t:l}(e,t):t}function j(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r}function T(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var R=Symbol();function k(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==R?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function C(e,t){return"function"==typeof e?e(...t):!!e}function O(e,t,s){let r,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}e.s(["addConsumeAwareSignal",()=>O,"addToEnd",()=>j,"addToStart",()=>T,"ensureQueryFn",()=>k,"functionalUpdate",()=>a,"hashKey",()=>f,"hashQueryKeyByOptions",()=>p,"isServer",()=>i,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>m,"replaceData",()=>S,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>v,"shouldThrowError",()=>C,"skipToken",()=>R,"sleep",()=>w,"timeUntilStale",()=>l],3)},65617,e=>{"use strict";let t;var s=e.i(3),r=(t=()=>s.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",()=>r])},6786,e=>{"use strict";let t,s,r,i,n,a;var o=e.i(68911).systemSetTimeoutZero,l=(t=[],s=0,r=e=>{e()},i=e=>{e()},n=o,{batch:e=>{let a;s++;try{a=e()}finally{let e;--s||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{r(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{s?t.push(e):n(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>l])},13598,20820,e=>{"use strict";var t=e.i(77501),s=new class extends t.Subscribable{#n=!0;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function r(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}e.s(["onlineManager",()=>s],13598),e.i(3),e.s(["pendingThenable",()=>r],20820)},28574,20979,19644,34682,e=>{"use strict";e.i(44172);var t=e.i(3),s=e.i(6786),r=e.i(4520),i=e.i(13598),n=e.i(20820),a=e.i(65617);function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||i.onlineManager.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let s,c=!1,h=0,d=(0,n.pendingThenable)(),p=()=>r.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),m=e=>{"pending"===d.status&&(s?.(),d.resolve(e))},y=e=>{"pending"===d.status&&(s?.(),d.reject(e))},v=()=>new Promise(t=>{s=e=>{("pending"!==d.status||p())&&t(e)},e.onPause?.()}).then(()=>{s=void 0,"pending"===d.status&&e.onContinue?.()}),b=()=>{let s;if("pending"!==d.status)return;let r=0===h?e.initialPromise:void 0;try{s=r??e.fn()}catch(e){s=Promise.reject(e)}Promise.resolve(s).then(m).catch(s=>{if("pending"!==d.status)return;let r=e.retry??3*!a.environmentManager.isServer(),i=e.retryDelay??o,n="function"==typeof i?i(h,s):i,l=!0===r||"number"==typeof r&&h<r||"function"==typeof r&&r(h,s);c||!l?y(s):(h++,e.onFail?.(h,s),(0,t.sleep)(n).then(()=>p()?void 0:v()).then(()=>{c?y(s):b()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let s=new u(t);y(s),e.onCancel?.(s)}},continue:()=>(s?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:f,start:()=>(f()?b():v().then(b),d)}}e.s(["CancelledError",()=>u,"canFetch",()=>l,"createRetryer",()=>c],20979);var h=e.i(68911),d=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>d],19644);var p=class extends d{#o;#l;#u;#c;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=y(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=y(this.options);void 0!==e.data&&(this.setState(m(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,s){let r=(0,t.replaceData)(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){let s=this.#h?.promise;return this.#h?.cancel(e),s?s.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#o}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#m()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,s){let r;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,i.signal)})},a=()=>{let e,r=(0,t.ensureQueryFn)(this.options,s),i=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(r,i,this):r(i)},o=(n(r={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),r);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:s?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),i.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof u){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...f(t.data,this.options),fetchMeta:e.meta??null};case"success":let s={...t,...m(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?s:void 0,s;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),s.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function f(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function y(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>p,"fetchState",()=>f],28574);var v=e.i(79054),b=e.i(20314),g=v.createContext(void 0),x=e=>{let t=v.useContext(g);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},w=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,b.jsx)(g.Provider,{value:e,children:t}));e.s(["QueryClientProvider",()=>w,"useQueryClient",()=>x],34682)},62885,e=>{"use strict";let t;var s=e.i(4520),r=e.i(65617),i=e.i(6786),n=e.i(28574),a=e.i(77501),o=e.i(20820),l=e.i(3),u=e.i(68911),c=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#y=null,this.#v=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#b=void 0;#g=void 0;#x=void 0;#w;#S;#v;#y;#j;#T;#R;#k;#C;#O;#I=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),h(this.#b,this.options)?this.#E():this.updateResult(),this.#F())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#Q(),this.#b.removeObserver(this)}setOptions(e){let t=this.options,s=this.#b;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,l.resolveEnabled)(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),this.#b.setOptions(this.options),t._defaulted&&!(0,l.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let r=this.hasListeners();r&&p(this.#b,s,this.options,t)&&this.#E(),this.updateResult(),r&&(this.#b!==s||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||(0,l.resolveStaleTime)(this.options.staleTime,this.#b)!==(0,l.resolveStaleTime)(t.staleTime,this.#b))&&this.#D();let i=this.#P();r&&(this.#b!==s||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||i!==this.#O)&&this.#U(i)}getOptimisticResult(e){var t,s;let r=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(r,e);return t=this,s=i,(0,l.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#x=i,this.#S=this.options,this.#w=this.#b.state),i}getCurrentResult(){return this.#x}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#I.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),s=this.#c.getQueryCache().build(this.#c,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#E({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#x))}#E(e){this.#N();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.noop)),t}#D(){this.#M();let e=(0,l.resolveStaleTime)(this.options.staleTime,this.#b);if(r.environmentManager.isServer()||this.#x.isStale||!(0,l.isValidTimeout)(e))return;let t=(0,l.timeUntilStale)(this.#x.dataUpdatedAt,e);this.#k=u.timeoutManager.setTimeout(()=>{this.#x.isStale||this.updateResult()},t+1)}#P(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#U(e){this.#Q(),this.#O=e,!r.environmentManager.isServer()&&!1!==(0,l.resolveEnabled)(this.options.enabled,this.#b)&&(0,l.isValidTimeout)(this.#O)&&0!==this.#O&&(this.#C=u.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#E()},this.#O))}#F(){this.#D(),this.#U(this.#P())}#M(){this.#k&&(u.timeoutManager.clearTimeout(this.#k),this.#k=void 0)}#Q(){this.#C&&(u.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let s,r=this.#b,i=this.options,a=this.#x,u=this.#w,c=this.#S,d=e!==r?e.state:this.#g,{state:m}=e,y={...m},v=!1;if(t._optimisticResults){let s=this.hasListeners(),a=!s&&h(e,t),o=s&&p(e,r,t,i);(a||o)&&(y={...y,...(0,n.fetchState)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(y.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:x}=y;s=y.data;let w=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===x){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,w=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#R?.state.data,this.#R):t.placeholderData,void 0!==e&&(x="success",s=(0,l.replaceData)(a?.data,e,t),v=!0)}if(t.select&&void 0!==s&&!w)if(a&&s===u?.data&&t.select===this.#j)s=this.#T;else try{this.#j=t.select,s=t.select(s),s=(0,l.replaceData)(a?.data,s,t),this.#T=s,this.#y=null}catch(e){this.#y=e}this.#y&&(b=this.#y,s=this.#T,g=Date.now(),x="error");let S="fetching"===y.fetchStatus,j="pending"===x,T="error"===x,R=j&&S,k=void 0!==s,C={status:x,fetchStatus:y.fetchStatus,isPending:j,isSuccess:"success"===x,isError:T,isInitialLoading:R,isLoading:R,data:s,dataUpdatedAt:y.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>d.dataUpdateCount||y.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!j,isLoadingError:T&&!k,isPaused:"paused"===y.fetchStatus,isPlaceholderData:v,isRefetchError:T&&k,isStale:f(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,l.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==C.data,s="error"===C.status&&!t,i=e=>{s?e.reject(C.error):t&&e.resolve(C.data)},n=()=>{i(this.#v=C.promise=(0,o.pendingThenable)())},a=this.#v;switch(a.status){case"pending":e.queryHash===r.queryHash&&i(a);break;case"fulfilled":(s||C.data!==a.value)&&n();break;case"rejected":s&&C.error===a.reason||n()}}return C}updateResult(){let e=this.#x,t=this.createResult(this.#b,this.options);if(this.#w=this.#b.state,this.#S=this.options,void 0!==this.#w.data&&(this.#R=this.#b),(0,l.shallowEqualObjects)(t,e))return;this.#x=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#I.size)return!0;let r=new Set(s??this.#I);return this.options.throwOnError&&r.add("error"),Object.keys(this.#x).some(t=>this.#x[t]!==e[t]&&r.has(t))};this.#A({listeners:s()})}#N(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#b)return;let t=this.#b;this.#b=e,this.#g=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#F()}#A(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#x)}),this.#c.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function h(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,s){if(!1!==(0,l.resolveEnabled)(t.enabled,e)&&"static"!==(0,l.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof s?s(e):s;return"always"===r||!1!==r&&f(e,t)}return!1}function p(e,t,s,r){return(e!==t||!1===(0,l.resolveEnabled)(r.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&f(e,s)}function f(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,l.resolveStaleTime)(t.staleTime,e))}e.i(44172);var m=e.i(79054),y=e.i(34682);e.i(20314);var v=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),b=m.createContext(!1);b.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function x(e,t){return function(e,t,s){let n,a=m.useContext(b),o=m.useContext(v),u=(0,y.useQueryClient)(s),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let h=u.getQueryCache().get(c.queryHash);if(c._optimisticResults=a?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}n=h?.state.error&&"function"==typeof c.throwOnError?(0,l.shouldThrowError)(c.throwOnError,[h.state.error,h]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||n)&&!o.isReset()&&(c.retryOnMount=!1),m.useEffect(()=>{o.clearReset()},[o]);let d=!u.getQueryCache().get(c.queryHash),[p]=m.useState(()=>new t(u,c)),f=p.getOptimisticResult(c),x=!a&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=x?p.subscribe(i.notifyManager.batchCalls(e)):l.noop;return p.updateResult(),t},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),m.useEffect(()=>{p.setOptions(c)},[c,p]),c?.suspense&&f.isPending)throw g(c,p,o);if((({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&void 0===e.data||(0,l.shouldThrowError)(s,[e.error,r])))({result:f,errorResetBoundary:o,throwOnError:c.throwOnError,query:h,suspense:c.suspense}))throw f.error;if(u.getDefaultOptions().queries?._experimental_afterQuery?.(c,f),c.experimental_prefetchInRender&&!r.environmentManager.isServer()&&f.isLoading&&f.isFetching&&!a){let e=d?g(c,p,o):h?.promise;e?.catch(l.noop).finally(()=>{p.updateResult()})}return c.notifyOnChangeProps?f:p.trackResult(f)}(e,c,t)}e.s(["useQuery",()=>x],62885)}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|