@shepai/cli 1.194.2-pr584.4f4957c → 1.194.3
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/package.json +1 -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 +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +36 -36
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +34 -34
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +37 -37
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +46 -46
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +46 -46
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +35 -35
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +35 -35
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +34 -34
- 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)/control-center/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/control-center/page/server-reference-manifest.json +34 -34
- package/web/.next/server/app/(dashboard)/control-center/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/control-center/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +37 -37
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +46 -46
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +46 -46
- 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)/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +35 -35
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +35 -35
- 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/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/application/[id]/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/application/[id]/page/server-reference-manifest.json +17 -17
- package/web/.next/server/app/application/[id]/page.js.nft.json +1 -1
- package/web/.next/server/app/application/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/applications/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/applications/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/applications/page.js.nft.json +1 -1
- package/web/.next/server/app/applications/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/features/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/features/page/server-reference-manifest.json +30 -30
- 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/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/projects/[slug]/items/[itemId]/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/projects/[slug]/items/[itemId]/page/server-reference-manifest.json +15 -15
- package/web/.next/server/app/projects/[slug]/items/[itemId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/projects/[slug]/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/projects/[slug]/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/projects/[slug]/pages/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/projects/[slug]/pages/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/projects/[slug]/pages/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/projects/[slug]/settings/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/projects/[slug]/settings/page/server-reference-manifest.json +17 -17
- package/web/.next/server/app/projects/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/projects/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/projects/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/settings/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/skills/page/server-reference-manifest.json +16 -16
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/tools/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/react-loadable-manifest.json +3 -3
- package/web/.next/server/app/version/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__10e976f3._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_99cb41a4.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_99cb41a4.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_3bcbcc2f.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_3bcbcc2f.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_059f6735.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_059f6735.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_control-center_page_actions_86edeb51.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_control-center_page_actions_86edeb51.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_items_[itemId]_work-item-detail-client_tsx_d2e02407._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_items_[itemId]_work-item-detail-client_tsx_d2e02407._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_settings_project-settings-client_tsx_e8b85ddc._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_app_projects_[slug]_settings_project-settings-client_tsx_e8b85ddc._.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/744ca_web_components_features_applications_applications-page-client_tsx_d0db9938._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__012a0e7d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__012a0e7d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0462fa34._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0462fa34._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1973d644._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1a86d5fe._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1a86d5fe._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__ae78a6b9._.js → [root-of-the-server]__252fcd17._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__ae78a6b9._.js.map → [root-of-the-server]__252fcd17._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__30326387._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__30326387._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3438c354._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3438c354._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__361129f0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__361129f0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4adb4a94._.js +3 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4adb4a94._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5c25ef9b._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5c25ef9b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5c5f9704._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5c5f9704._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__638955bc._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__78e1366f._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__78e1366f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__97b6831c._.js +3 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9b16348d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9b16348d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b3bc9689._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b3bc9689._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba8cbee2._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba8cbee2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__b8c0d40a._.js → [root-of-the-server]__c3b6abac._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__b8c0d40a._.js.map → [root-of-the-server]__c3b6abac._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dbde193f._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dbde193f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f6adb460._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f6adb460._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_761e4bd3._.js → _06c1d752._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_761e4bd3._.js.map → _06c1d752._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_588a572a._.js → _0a84dcd8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_588a572a._.js.map → _0a84dcd8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_101de7c3._.js +1 -1
- package/web/.next/server/chunks/ssr/_101de7c3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_12ba4a07._.js +1 -1
- package/web/.next/server/chunks/ssr/_12ba4a07._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_15634d5b._.js +1 -1
- package/web/.next/server/chunks/ssr/_15634d5b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_27c2f774._.js +1 -1
- package/web/.next/server/chunks/ssr/_27c2f774._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_30787024._.js +1 -1
- package/web/.next/server/chunks/ssr/_30787024._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_3bd60fa3._.js +1 -1
- package/web/.next/server/chunks/ssr/_402d53bf._.js +1 -1
- package/web/.next/server/chunks/ssr/_402d53bf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_7e021392._.js → _494c9d59._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_7e021392._.js.map → _494c9d59._.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/_6868b4b1._.js +1 -1
- package/web/.next/server/chunks/ssr/_805ae1aa._.js +1 -1
- package/web/.next/server/chunks/ssr/_805ae1aa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8a700ff4._.js +1 -1
- package/web/.next/server/chunks/ssr/_8a700ff4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8f4f8aa1._.js +1 -1
- package/web/.next/server/chunks/ssr/_8f4f8aa1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_973065c3._.js → _b2c44425._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_973065c3._.js.map → _b2c44425._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_b40a4fc3._.js +1 -1
- package/web/.next/server/chunks/ssr/_b40a4fc3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_c44ec376._.js +1 -1
- package/web/.next/server/chunks/ssr/_c44ec376._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_e32aca20._.js → _c570d4fb._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_e32aca20._.js.map → _c570d4fb._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_cd641c61._.js +1 -1
- package/web/.next/server/chunks/ssr/_cd641c61._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d53224a9._.js +1 -1
- package/web/.next/server/chunks/ssr/_d53224a9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_e6271303._.js +1 -1
- package/web/.next/server/chunks/ssr/_e6271303._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ed8fd56c._.js +1 -1
- package/web/.next/server/chunks/ssr/_ed8fd56c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f602cc9f._.js +1 -1
- package/web/.next/server/chunks/ssr/_f602cc9f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_3f792f30._.js → _fc1ebfd1._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_3f792f30._.js.map → _fc1ebfd1._.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/src_presentation_web_05bba4dc._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_05bba4dc._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{src_presentation_web_929e9a7b._.js → src_presentation_web_0a898c35._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_929e9a7b._.js.map → src_presentation_web_0a898c35._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_43451480._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_43451480._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_4b306bb3._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_4b306bb3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_81dd84ae._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_81dd84ae._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_9a543843._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_9a543843._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_7ab26c98._.js +3 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_adopt-local-directory_ts_75f1f28c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_adopt-local-directory_ts_75f1f28c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_9453ce8b._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-directory_ts_1209d917._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-directory_ts_1209d917._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_features_feature-tree-page-client_tsx_34c5cbbf._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b504e3e2._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b504e3e2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b5838705._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b5838705._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b6b4baa1._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b6b4baa1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{src_presentation_web_70ef7fde._.js → src_presentation_web_bdc7c0dd._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_70ef7fde._.js.map → src_presentation_web_bdc7c0dd._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c3d0de23._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c3d0de23._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_66643378._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_66643378._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.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/chunks/ssr/src_presentation_web_fc29283f._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_fc29283f._.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 +98 -98
- package/web/.next/static/chunks/{ce7b3441e19255e6.js → 03c8ee30ab88f919.js} +1 -1
- package/web/.next/static/chunks/{a564b5b907b54a5f.js → 0cc03015af924e20.js} +1 -1
- package/web/.next/static/chunks/{eb88bae05f0b043b.js → 0cf016ec6f65fa24.js} +1 -1
- package/web/.next/static/chunks/{9f62973ace3dc4af.js → 2c61425fc96ae9f7.js} +1 -1
- package/web/.next/static/chunks/{f2040895572839d9.js → 318759d8e86dfc42.js} +1 -1
- package/web/.next/static/chunks/{733544bb6796c862.js → 331f023572696b0a.js} +1 -1
- package/web/.next/static/chunks/{3977923286c37140.js → 41e289ee887c8517.js} +1 -1
- package/web/.next/static/chunks/{5dc0003cc1241cb9.js → 50bb4ae3adb5eb0e.js} +1 -1
- package/web/.next/static/chunks/{edd8cb6712149e39.js → 6da640312464431a.js} +1 -1
- package/web/.next/static/chunks/{8665bb59c0620008.js → 77966d6d1929c049.js} +1 -1
- package/web/.next/static/chunks/{4826c460d01c6943.js → 8e693bdf4d04fa2c.js} +1 -1
- package/web/.next/static/chunks/{67109f43808725c6.js → 931795a6a581b203.js} +1 -1
- package/web/.next/static/chunks/{c954985ac32f7d87.js → 953e9d92d97dcaf1.js} +2 -2
- package/web/.next/static/chunks/{4b5d061eb5c2aac4.js → 959faf37d8e8d52b.js} +1 -1
- package/web/.next/static/chunks/{b9bb2c40f2b62ef2.js → a42c84a8e2742018.js} +1 -1
- package/web/.next/static/chunks/{3a25d8e6bc3ede3d.js → a95cef864840e759.js} +1 -1
- package/web/.next/static/chunks/{07156bfe6433ad08.js → accd7fa108255573.js} +1 -1
- package/web/.next/static/chunks/{7f2567429fbb01f5.js → aea0f9b5ab3bace4.js} +1 -1
- package/web/.next/static/chunks/{68d5517e0344f2a8.js → b10e586976309bb7.js} +1 -1
- package/web/.next/static/chunks/{e62cd9095e37f064.js → b15f7964eeaaab12.js} +1 -1
- package/web/.next/static/chunks/{150d2879079190e3.js → b207588307f7be12.js} +1 -1
- package/web/.next/static/chunks/{8c997a1b1fbb91bf.js → b77a5bc7f8489137.js} +1 -1
- package/web/.next/static/chunks/{22f47ab138b2d9a9.js → baf694f161ce7342.js} +1 -1
- package/web/.next/static/chunks/{65b5726d39a4d482.js → bec8ec0800020acc.js} +1 -1
- package/web/.next/static/chunks/{389b6724824ff3f6.js → c0bb71cba2d00657.js} +1 -1
- package/web/.next/static/chunks/{33264a24cdc2c4a5.js → c20650058ecf47b9.js} +1 -1
- package/web/.next/static/chunks/{24ec879c40147be1.js → cc3f38aa30b0e5bc.js} +1 -1
- package/web/.next/static/chunks/d3257028b32efe04.js +1 -0
- package/web/.next/static/chunks/{6ade0b141237e333.js → e0a0360221311346.js} +1 -1
- package/web/.next/static/chunks/{fea2481993c12344.js → f18f55bcb03d0992.js} +1 -1
- package/web/.next/static/chunks/{6235f12c6bcbd03b.js → f55c73d6668c343d.js} +1 -1
- package/web/.next/static/chunks/{249d416f38a960ee.js → f8d7451055dafa13.js} +1 -1
- package/web/.next/static/chunks/{e2b81d6dd4f82a2c.js → f96f160b292fa8fe.js} +1 -1
- package/web/.next/static/chunks/{19a5af71926715a0.js → fb08b36e6fb54e54.js} +1 -1
- package/web/.next/static/chunks/0abf3aca0664110e.js +0 -1
- /package/web/.next/static/{v2TqKlCQvmOQONd8Gezvw → edsd2kzyk0v0aunegSWUo}/_buildManifest.js +0 -0
- /package/web/.next/static/{v2TqKlCQvmOQONd8Gezvw → edsd2kzyk0v0aunegSWUo}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{v2TqKlCQvmOQONd8Gezvw → edsd2kzyk0v0aunegSWUo}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,283843,e=>{"use strict";let t=(0,e.i(903645).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",()=>t],283843)},34562,630616,e=>{"use strict";var t=e.i(679606),r=e.i(152155);e.i(541001);var a=e.i(64780),s=e.i(216868),i=e.i(283843),o=e.i(197667),l=e.i(453360),n=e.i(655016),c=e.i(591925),d=e.i(83428),p=e.i(381542),u=e.i(670471),h=e.i(912103),m=e.i(43416),x=e.i(542049),f=e.i(941698),g=e.i(131777),b=e.i(808361);e.i(1650);var j=e.i(511495),w=e.i(845811),v=e.i(735364),C=e.i(698127),y=e.i(48306),k=e.i(141957),N=e.i(81846),D=e.i(390382),T=e.i(951911),S=e.i(102828),F=e.i(930153);e.i(650032);var P=e.i(486254),L=e.i(508893);let z=(0,L.createServerReference)("405f890c86a99e8c688d671eba87b7d1d5bb517c4d",L.callServer,void 0,L.findSourceMapURL,"getViewerPermission");var E=e.i(41413),R=e.i(425235),U=e.i(478521);e.i(13322);var A=e.i(961201),M=e.i(175921),I=e.i(790427),O=e.i(442076);let K=["application","fast","spec"],$={application:{icon:x.LayoutGrid,labelKey:"createDrawer.modeApplication"},fast:{icon:l.Zap,labelKey:"createDrawer.modeFast"},spec:{icon:f.ClipboardList,labelKey:"createDrawer.modeSpec"}},B=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),G={allowPrd:!1,allowPlan:!1,allowMerge:!1};function q({open:e,onClose:i,onSubmit:o,repositoryPath:l,isSubmitting:c=!1,workflowDefaults:d,features:x,repositories:f,initialParentId:C,currentAgentType:D,currentModel:L,initialDescription:R,canPushDirectly:U,initialMode:A}){let M=(0,b.useSoundAction)("create"),{t:I}=(0,a.useTranslation)("web"),q=l&&(!f||0===f.length||f.some(e=>e.path===l))?l:"",J=d?.approvalGates??G,V=d?.push??!1,H=d?.openPr??!1,Q=d?.ciWatchEnabled!==!1,X=d?.enableEvidence??!1,Y=d?.commitEvidence??!1,_=A||(d?.fast===!1?"application":"fast"),[ee,et]=(0,r.useState)(R??"");(0,r.useEffect)(()=>{R&&et(R)},[R]);let[er,ea]=(0,r.useState)([]),[es,ei]=(0,r.useState)({...J}),[eo,el]=(0,r.useState)(V),[en,ec]=(0,r.useState)(H),[ed,ep]=(0,r.useState)(d?.ciWatchEnabled!==!1),[eu,eh]=(0,r.useState)(X),[em,ex]=(0,r.useState)(Y),[ef,eg]=(0,r.useState)(void 0),[eb,ej]=(0,r.useState)(_),ew="fast"===eb,[ev,eC]=(0,r.useState)(!1),[ey,ek]=(0,r.useState)(!1),[eN,eD]=(0,r.useState)(!0),[eT,eS]=(0,r.useState)(!0),[eF,eP]=(0,r.useState)(d?.injectSkills??!1),[eL,ez]=(0,r.useState)(void 0),[eE,eR]=(0,r.useState)(void 0),[eU,eA]=(0,r.useState)(q||void 0),[eM,eI]=(0,r.useState)(f??[]),[eO,eK]=(0,r.useState)(!1),[e$,eB]=(0,r.useState)(null),[eG,eq]=(0,r.useState)(!1),eW=(0,r.useRef)(crypto.randomUUID()),eZ=(0,r.useRef)(0),eJ=(0,r.useRef)(null);(0,r.useEffect)(()=>{d&&(ei({...d.approvalGates}),el(d.push),ec(d.openPr),ep(!1!==d.ciWatchEnabled),eh(d.enableEvidence),ex(d.commitEvidence),A||ej(!1!==d.fast?"fast":"application"),eP(d.injectSkills??!1))},[d,A]),(0,r.useEffect)(()=>{eI(f??[])},[f]),(0,r.useEffect)(()=>{e&&C&&eg(C)},[e,C]);let[eV,eH]=(0,r.useState)(U??!1);(0,r.useEffect)(()=>{eH(U??!1)},[U]);let eQ=(0,r.useRef)(eU);(0,r.useEffect)(()=>{eU&&eU!==eQ.current&&(eQ.current=eU,z(eU).then(e=>eH(e.canPushDirectly)).catch(()=>eH(!1)))},[eU]),(0,r.useEffect)(()=>{eV&&(ek(!1),el(V),ec(H),eD(!0))},[eV,V,H]);let eX=(0,r.useCallback)(()=>{et(""),ea([]),ei({...J}),el(V),ec(H),ep(Q),eh(X),ex(Y),eg(void 0),eA(q||void 0),eI(f??[]),ej(_),eC(!1),ek(!1),eD(!0),eS(!0),ez(void 0),eR(void 0),eB(null),eZ.current=0,eK(!1)},[J,V,H,X,Q,Y,_,q,f]),eY=""!==ee.trim()||er.length>0,{attemptClose:e_}=(0,F.useGuardedDrawerClose)({open:e,isDirty:eY,onClose:i,onReset:eX}),e0=(0,r.useCallback)(async e=>{for(let t of(eB(null),e)){if(t.size>0xa00000)return void eB(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!B.has(e))return void eB(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();ea(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eW.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));ea(t=>t.filter(t=>t.id!==e)),eB(t.error??"Upload failed");return}let s=await a.json();ea(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{ea(t=>t.filter(t=>t.id!==e)),eB("Upload failed")}}},[]),e1=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eZ.current+=1,1===eZ.current&&eK(!0)},[]),e5=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eZ.current-=1,0===eZ.current&&eK(!1)},[]),e4=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),e2=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eZ.current=0,eK(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&e0(t)},[e0]),e3=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),e0(r))},[e0]),e6=(0,r.useCallback)(e=>{if(e.preventDefault(),!ee.trim())return;let t=eU??q;t&&(M.play(),o({description:ee.trim(),attachments:er.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:es.allowPrd??!1,allowPlan:es.allowPlan??!1,allowMerge:es.allowMerge??!1},push:!!ey||eo||en,openPr:!!ey||en,ciWatchEnabled:ed,enableEvidence:eu,commitEvidence:em,fast:ew,forkAndPr:ey,commitSpecs:eN,rebaseBeforeBranch:eT,injectSkills:eF,...ev?{pending:ev}:{},...eL?{agentType:eL}:{},...eE?{model:eE}:{},...ef?{parentId:ef}:{},sessionId:eW.current}),eX())},[ee,er,es,eU,q,o,eo,en,eu,ed,em,ew,ey,eN,eT,eF,ev,eL,eE,ef,M,eX]),e8=(0,r.useCallback)(async()=>{try{let e=await (0,O.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();ea(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eW.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));ea(t=>t.filter(t=>t.id!==e)),eB(t.error??"Upload failed");return}let a=await r.json();ea(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{ea(t=>t.filter(t=>t.id!==e)),eB("Upload failed")}}}catch{}},[]),e9=(0,r.useCallback)(e=>{ea(t=>t.filter(t=>t.id!==e))},[]),e7=(0,r.useCallback)((e,t)=>{ea(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]),te=(0,r.useRef)(null),tt=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),te.current?.requestSubmit())},[]),tr=(0,r.useCallback)(()=>{eq(!0)},[]),ta=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eJ.current?.contains(document.activeElement),t=eJ.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eq(!1)},0)},[]),ts=x&&x.length>0,ti=!q&&!eU,to=!q&&void 0!==f,tl=[{id:"allowPrd",label:I("createDrawer.prd"),description:I("createDrawer.prdDescription")},{id:"allowPlan",label:I("createDrawer.plan"),description:I("createDrawer.planDescription")},{id:"allowMerge",label:I("createDrawer.merge"),description:I("createDrawer.mergeDescription")}];return(0,t.jsx)(j.BaseDrawer,{open:e,onClose:e_,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(w.DrawerTitle,{children:I("createDrawer.title")})]}),c?(0,t.jsx)(w.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(N.Badge,{variant:"secondary",children:I("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:e_,disabled:c,children:I("createDrawer.cancel")}),(0,t.jsx)(v.Button,{type:"submit",form:"create-feature-form",disabled:!ee.trim()||c||ti,children:c?I("createDrawer.creating"):I("createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(S.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:te,id:"create-feature-form",onSubmit:e6,onKeyDown:tt,className:"flex flex-col gap-4",children:[to?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(k.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.repository")}),(0,t.jsx)(Z,{repositories:eM,value:eU,onChange:eA,onAddRepository:e=>{eI(t=>[...t,e]),eA(e.path)},disabled:c})]}):q?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(k.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:f?.find(e=>e.path===q)?.name??q.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":I("createDrawer.fileDropZone"),"data-drag-over":eO?"true":"false",onDragEnter:e1,onDragLeave:e5,onDragOver:e4,onDrop:e2,className:(0,g.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eO&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(k.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:eJ,onFocus:tr,onBlur:ta,className:(0,g.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eG&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:I("createDrawer.featurePlaceholder"),value:ee,onChange:e=>et(e.target.value),onPaste:e3,required:!0,disabled:c,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),er.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:er.map(e=>(0,t.jsx)(P.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>e9(e.id),disabled:c,loading:e.loading,notes:e.notes,onNotesChange:t=>e7(e.id,t)},e.id))}),e$?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:e$}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(E.AgentModelPicker,{initialAgentType:eL??D??"claude-code",initialModel:eE??L??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ez(e),eR(t)},disabled:c,className:"w-55"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:ev,onCheckedChange:eC,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(n.Clock,{className:"h-3.5 w-3.5"}),I("createDrawer.pendingMode")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.pendingModeDescription")})]}),(0,t.jsx)("div",{role:"group","aria-label":I("createDrawer.modeGroupLabel"),className:"border-input flex items-center gap-0.5 rounded-md border p-0.5",children:K.map(e=>{let r=$[e],a=r.icon,s=eb===e;return(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","data-testid":`build-mode-${e}`,"aria-pressed":s,disabled:c,onClick:()=>ej(e),className:(0,g.cn)("flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 text-xs font-medium transition-colors",s?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50"),children:[(0,t.jsx)(a,{className:"h-3.5 w-3.5"}),I(r.labelKey)]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I(`${r.labelKey}Description`)})]},e)})}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:e8,disabled:c,"aria-label":I("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(s.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("chat.attachFiles")})]})]})]})]}),ts&&void 0!==C?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(k.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.parentFeature")}),(0,t.jsx)(W,{features:x,value:ef,onChange:eg,disabled:c})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.approve")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:tl.map(e=>(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:es[e.id]??!1,onCheckedChange:t=>ei(r=>({...r,[e.id]:t})),disabled:c||ew&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(k.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ew&&("allowPrd"===e.id||"allowPlan"===e.id)?I("createDrawer.skippedInFastMode"):e.description})]},e.id))}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=tl.every(e=>es[e.id]),t={};for(let r of tl)t[r.id]=!e;ei(t)},disabled:c,className:(0,g.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",tl.every(e=>es[e.id])&&"text-primary"),children:I("createDrawer.all")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.evidence")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:eu,onCheckedChange:e=>{eh(e),e||ex(!1)},disabled:c}),(0,t.jsx)(k.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.collect")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.collectDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:em,onCheckedChange:ex,disabled:c||!eu||!en&&!ey}),(0,t.jsx)(k.Label,{htmlFor:"commit-evidence",className:(0,g.cn)("cursor-pointer text-xs font-medium",(!eu||!en&&!ey)&&"opacity-50"),children:I("createDrawer.addToPr")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:en||ey?eu?I("createDrawer.addToPrDescription"):I("createDrawer.requiresEvidence"):I("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.skills")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.skillsDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"inject-skills",size:"sm",checked:eF,onCheckedChange:eP,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"inject-skills",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(h.Puzzle,{className:"h-3 w-3"}),I("createDrawer.injectSkills")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.injectSkillsDescription")})]})})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:I("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!ey||eo||en,onCheckedChange:e=>{el(e),!e&&en&&ec(!1)},disabled:c||ey}),(0,t.jsx)(k.Label,{htmlFor:"push",className:(0,g.cn)("cursor-pointer text-xs font-medium",ey&&"opacity-50"),children:I("createDrawer.push")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ey?"Enabled — contributing to upstream":I("createDrawer.pushDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!ey||en,onCheckedChange:e=>{ec(e),e||ex(!1)},disabled:c||ey}),(0,t.jsx)(k.Label,{htmlFor:"open-pr",className:(0,g.cn)("cursor-pointer text-xs font-medium",ey&&"opacity-50"),children:I("createDrawer.pr")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ey?"Enabled — contributing to upstream":I("createDrawer.prDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:ed,onCheckedChange:ep,disabled:c}),(0,t.jsx)(k.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.watch")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"rebase-before-branch",size:"sm",checked:eT,onCheckedChange:eS,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m.RefreshCw,{className:"h-3 w-3"}),I("createDrawer.sync")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.syncDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:eN,onCheckedChange:eD,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(u.FileText,{className:"h-3 w-3"}),I("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.commitSpecsDescription")})]}),!eV&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:ey,onCheckedChange:e=>{ek(e),e&&eD(!1)},disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(p.GitFork,{className:"h-3 w-3"}),I("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.forkAndPrDescription")})]})]})]})]})]})})})})}function W({features:e,value:s,onChange:l,disabled:n}){let{t:c}=(0,a.useTranslation)("web"),[d,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),m=(0,r.useRef)(null),x=e.find(e=>e.id===s),f=u.trim()?e.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())||e.id.toLowerCase().includes(u.toLowerCase())):e,b=(0,r.useCallback)(e=>{l(e),p(!1),h("")},[l]);return(0,r.useEffect)(()=>{d?setTimeout(()=>m.current?.focus(),0):h("")},[d]),(0,t.jsxs)(D.Popover,{open:d,onOpenChange:p,children:[(0,t.jsx)(D.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":d,"aria-label":"Parent Feature",disabled:n,"data-testid":"parent-feature-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",!x&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:x?`${x.name} (${x.id.slice(0,8)})`:c("createDrawer.selectParent")}),(0,t.jsx)(i.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(D.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(C.Input,{ref:m,placeholder:c("createDrawer.searchFeatures"),value:u,onChange:e=>h(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===s,onClick:()=>b(void 0),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===s&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(o.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",void 0!==s&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:c("createDrawer.noParent")})]}),0===f.length&&u?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:c("createDrawer.noFeaturesFound")}):f.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":s===e.id,onClick:()=>b(e.id),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",s===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(o.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",s!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function Z({repositories:e,value:s,onChange:l,onAddRepository:n,disabled:u}){let[h,m]=(0,r.useState)(!1),[x,f]=(0,r.useState)(""),[b,j]=(0,r.useState)(!1),[w,v]=(0,r.useState)(null),[y,k]=(0,r.useState)(!1),T=(0,r.useRef)(null),{reactFileManager:S}=(0,M.useFeatureFlags)(),{t:F}=(0,a.useTranslation)("web"),P=e.find(e=>e.path===s),L=x.trim()?e.filter(e=>e.name.toLowerCase().includes(x.toLowerCase())||e.path.toLowerCase().includes(x.toLowerCase())):e,z=(0,r.useCallback)(e=>{l(e),m(!1),f("")},[l]),E=(0,r.useCallback)(async e=>{let t=await (0,I.addRepository)({path:e});if(t.error){v(t.error),j(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};n?.(e),l(e.path),m(!1),f("")}},[n,l]),O=(0,r.useCallback)(async()=>{if(!b){if(S)return void k(!0);j(!0),v(null);try{let e=await (0,U.pickFolder)();if(!e)return void j(!1);await E(e)}catch{k(!0)}finally{j(!1)}}},[b,S,E]),K=(0,r.useCallback)(async e=>{if(k(!1),e){j(!0),v(null);try{await E(e)}catch(e){v(e instanceof Error?e.message:"Failed to add repository")}finally{j(!1)}}},[E]);return(0,r.useEffect)(()=>{h?setTimeout(()=>T.current?.focus(),0):f("")},[h]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(D.Popover,{open:h,onOpenChange:m,children:[(0,t.jsx)(D.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":h,"aria-label":"Repository",disabled:u,"data-testid":"repository-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",!P&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:P?P.name:"Select repository..."}),(0,t.jsx)(i.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(D.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(C.Input,{ref:T,placeholder:F("createDrawer.searchRepositories"),value:x,onChange:e=>f(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===L.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):L.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":s===e.path,onClick:()=>z(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",s===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(o.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",s!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 truncate",children:[e.name,e.isFork?(0,t.jsxs)(N.Badge,{variant:"outline",className:"h-4 shrink-0 px-1 text-[10px]",children:[(0,t.jsx)(p.GitFork,{className:"mr-0.5 h-2.5 w-2.5"}),"Fork"]}):null]}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(R.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:O,disabled:b,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[b?(0,t.jsx)(d.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(c.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),w?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:w}):null]})})]}),(0,t.jsx)(A.ReactFileManagerDialog,{open:y,onOpenChange:e=>{e||k(!1)},onSelect:K})]})}e.s(["FeatureCreateDrawer",()=>q],630616),e.s([],34562)},731255,e=>{"use strict";var t=e.i(508893);let r=(0,t.createServerReference)("40b261f4a8b7a49d8515c4c6549ec95dcd699e0e9c",t.callServer,void 0,t.findSourceMapURL,"createFeature");e.s(["createFeature",()=>r])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,283843,e=>{"use strict";let t=(0,e.i(903645).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",()=>t],283843)},34562,630616,e=>{"use strict";var t=e.i(679606),r=e.i(152155);e.i(541001);var a=e.i(64780),s=e.i(216868),i=e.i(283843),o=e.i(197667),l=e.i(453360),n=e.i(655016),c=e.i(591925),d=e.i(83428),p=e.i(381542),u=e.i(670471),h=e.i(912103),m=e.i(43416),x=e.i(542049),f=e.i(941698),g=e.i(131777),b=e.i(808361);e.i(1650);var j=e.i(511495),w=e.i(845811),v=e.i(735364),C=e.i(698127),y=e.i(48306),k=e.i(141957),N=e.i(81846),D=e.i(390382),T=e.i(951911),S=e.i(102828),F=e.i(930153);e.i(650032);var P=e.i(486254),L=e.i(508893);let z=(0,L.createServerReference)("407ad4c99d6a5349482771f040857ec05c47c985c9",L.callServer,void 0,L.findSourceMapURL,"getViewerPermission");var E=e.i(41413),R=e.i(425235),U=e.i(478521);e.i(13322);var A=e.i(961201),M=e.i(175921),I=e.i(603691),O=e.i(442076);let K=["application","fast","spec"],$={application:{icon:x.LayoutGrid,labelKey:"createDrawer.modeApplication"},fast:{icon:l.Zap,labelKey:"createDrawer.modeFast"},spec:{icon:f.ClipboardList,labelKey:"createDrawer.modeSpec"}},B=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),G={allowPrd:!1,allowPlan:!1,allowMerge:!1};function q({open:e,onClose:i,onSubmit:o,repositoryPath:l,isSubmitting:c=!1,workflowDefaults:d,features:x,repositories:f,initialParentId:C,currentAgentType:D,currentModel:L,initialDescription:R,canPushDirectly:U,initialMode:A}){let M=(0,b.useSoundAction)("create"),{t:I}=(0,a.useTranslation)("web"),q=l&&(!f||0===f.length||f.some(e=>e.path===l))?l:"",J=d?.approvalGates??G,V=d?.push??!1,H=d?.openPr??!1,Q=d?.ciWatchEnabled!==!1,X=d?.enableEvidence??!1,Y=d?.commitEvidence??!1,_=A||(d?.fast===!1?"application":"fast"),[ee,et]=(0,r.useState)(R??"");(0,r.useEffect)(()=>{R&&et(R)},[R]);let[er,ea]=(0,r.useState)([]),[es,ei]=(0,r.useState)({...J}),[eo,el]=(0,r.useState)(V),[en,ec]=(0,r.useState)(H),[ed,ep]=(0,r.useState)(d?.ciWatchEnabled!==!1),[eu,eh]=(0,r.useState)(X),[em,ex]=(0,r.useState)(Y),[ef,eg]=(0,r.useState)(void 0),[eb,ej]=(0,r.useState)(_),ew="fast"===eb,[ev,eC]=(0,r.useState)(!1),[ey,ek]=(0,r.useState)(!1),[eN,eD]=(0,r.useState)(!0),[eT,eS]=(0,r.useState)(!0),[eF,eP]=(0,r.useState)(d?.injectSkills??!1),[eL,ez]=(0,r.useState)(void 0),[eE,eR]=(0,r.useState)(void 0),[eU,eA]=(0,r.useState)(q||void 0),[eM,eI]=(0,r.useState)(f??[]),[eO,eK]=(0,r.useState)(!1),[e$,eB]=(0,r.useState)(null),[eG,eq]=(0,r.useState)(!1),eW=(0,r.useRef)(crypto.randomUUID()),eZ=(0,r.useRef)(0),eJ=(0,r.useRef)(null);(0,r.useEffect)(()=>{d&&(ei({...d.approvalGates}),el(d.push),ec(d.openPr),ep(!1!==d.ciWatchEnabled),eh(d.enableEvidence),ex(d.commitEvidence),A||ej(!1!==d.fast?"fast":"application"),eP(d.injectSkills??!1))},[d,A]),(0,r.useEffect)(()=>{eI(f??[])},[f]),(0,r.useEffect)(()=>{e&&C&&eg(C)},[e,C]);let[eV,eH]=(0,r.useState)(U??!1);(0,r.useEffect)(()=>{eH(U??!1)},[U]);let eQ=(0,r.useRef)(eU);(0,r.useEffect)(()=>{eU&&eU!==eQ.current&&(eQ.current=eU,z(eU).then(e=>eH(e.canPushDirectly)).catch(()=>eH(!1)))},[eU]),(0,r.useEffect)(()=>{eV&&(ek(!1),el(V),ec(H),eD(!0))},[eV,V,H]);let eX=(0,r.useCallback)(()=>{et(""),ea([]),ei({...J}),el(V),ec(H),ep(Q),eh(X),ex(Y),eg(void 0),eA(q||void 0),eI(f??[]),ej(_),eC(!1),ek(!1),eD(!0),eS(!0),ez(void 0),eR(void 0),eB(null),eZ.current=0,eK(!1)},[J,V,H,X,Q,Y,_,q,f]),eY=""!==ee.trim()||er.length>0,{attemptClose:e_}=(0,F.useGuardedDrawerClose)({open:e,isDirty:eY,onClose:i,onReset:eX}),e0=(0,r.useCallback)(async e=>{for(let t of(eB(null),e)){if(t.size>0xa00000)return void eB(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!B.has(e))return void eB(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();ea(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eW.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));ea(t=>t.filter(t=>t.id!==e)),eB(t.error??"Upload failed");return}let s=await a.json();ea(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{ea(t=>t.filter(t=>t.id!==e)),eB("Upload failed")}}},[]),e1=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eZ.current+=1,1===eZ.current&&eK(!0)},[]),e5=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eZ.current-=1,0===eZ.current&&eK(!1)},[]),e4=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),e3=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eZ.current=0,eK(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&e0(t)},[e0]),e2=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),e0(r))},[e0]),e6=(0,r.useCallback)(e=>{if(e.preventDefault(),!ee.trim())return;let t=eU??q;t&&(M.play(),o({description:ee.trim(),attachments:er.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:es.allowPrd??!1,allowPlan:es.allowPlan??!1,allowMerge:es.allowMerge??!1},push:!!ey||eo||en,openPr:!!ey||en,ciWatchEnabled:ed,enableEvidence:eu,commitEvidence:em,fast:ew,forkAndPr:ey,commitSpecs:eN,rebaseBeforeBranch:eT,injectSkills:eF,...ev?{pending:ev}:{},...eL?{agentType:eL}:{},...eE?{model:eE}:{},...ef?{parentId:ef}:{},sessionId:eW.current}),eX())},[ee,er,es,eU,q,o,eo,en,eu,ed,em,ew,ey,eN,eT,eF,ev,eL,eE,ef,M,eX]),e8=(0,r.useCallback)(async()=>{try{let e=await (0,O.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();ea(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eW.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));ea(t=>t.filter(t=>t.id!==e)),eB(t.error??"Upload failed");return}let a=await r.json();ea(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{ea(t=>t.filter(t=>t.id!==e)),eB("Upload failed")}}}catch{}},[]),e9=(0,r.useCallback)(e=>{ea(t=>t.filter(t=>t.id!==e))},[]),e7=(0,r.useCallback)((e,t)=>{ea(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]),te=(0,r.useRef)(null),tt=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),te.current?.requestSubmit())},[]),tr=(0,r.useCallback)(()=>{eq(!0)},[]),ta=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eJ.current?.contains(document.activeElement),t=eJ.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eq(!1)},0)},[]),ts=x&&x.length>0,ti=!q&&!eU,to=!q&&void 0!==f,tl=[{id:"allowPrd",label:I("createDrawer.prd"),description:I("createDrawer.prdDescription")},{id:"allowPlan",label:I("createDrawer.plan"),description:I("createDrawer.planDescription")},{id:"allowMerge",label:I("createDrawer.merge"),description:I("createDrawer.mergeDescription")}];return(0,t.jsx)(j.BaseDrawer,{open:e,onClose:e_,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(w.DrawerTitle,{children:I("createDrawer.title")})]}),c?(0,t.jsx)(w.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(N.Badge,{variant:"secondary",children:I("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:e_,disabled:c,children:I("createDrawer.cancel")}),(0,t.jsx)(v.Button,{type:"submit",form:"create-feature-form",disabled:!ee.trim()||c||ti,children:c?I("createDrawer.creating"):I("createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(S.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:te,id:"create-feature-form",onSubmit:e6,onKeyDown:tt,className:"flex flex-col gap-4",children:[to?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(k.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.repository")}),(0,t.jsx)(Z,{repositories:eM,value:eU,onChange:eA,onAddRepository:e=>{eI(t=>[...t,e]),eA(e.path)},disabled:c})]}):q?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(k.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:f?.find(e=>e.path===q)?.name??q.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":I("createDrawer.fileDropZone"),"data-drag-over":eO?"true":"false",onDragEnter:e1,onDragLeave:e5,onDragOver:e4,onDrop:e3,className:(0,g.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eO&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(k.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:eJ,onFocus:tr,onBlur:ta,className:(0,g.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eG&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:I("createDrawer.featurePlaceholder"),value:ee,onChange:e=>et(e.target.value),onPaste:e2,required:!0,disabled:c,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),er.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:er.map(e=>(0,t.jsx)(P.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>e9(e.id),disabled:c,loading:e.loading,notes:e.notes,onNotesChange:t=>e7(e.id,t)},e.id))}),e$?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:e$}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(E.AgentModelPicker,{initialAgentType:eL??D??"claude-code",initialModel:eE??L??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ez(e),eR(t)},disabled:c,className:"w-55"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:ev,onCheckedChange:eC,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(n.Clock,{className:"h-3.5 w-3.5"}),I("createDrawer.pendingMode")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.pendingModeDescription")})]}),(0,t.jsx)("div",{role:"group","aria-label":I("createDrawer.modeGroupLabel"),className:"border-input flex items-center gap-0.5 rounded-md border p-0.5",children:K.map(e=>{let r=$[e],a=r.icon,s=eb===e;return(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","data-testid":`build-mode-${e}`,"aria-pressed":s,disabled:c,onClick:()=>ej(e),className:(0,g.cn)("flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 text-xs font-medium transition-colors",s?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50"),children:[(0,t.jsx)(a,{className:"h-3.5 w-3.5"}),I(r.labelKey)]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I(`${r.labelKey}Description`)})]},e)})}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:e8,disabled:c,"aria-label":I("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(s.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("chat.attachFiles")})]})]})]})]}),ts&&void 0!==C?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(k.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:I("createDrawer.parentFeature")}),(0,t.jsx)(W,{features:x,value:ef,onChange:eg,disabled:c})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.approve")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:tl.map(e=>(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:es[e.id]??!1,onCheckedChange:t=>ei(r=>({...r,[e.id]:t})),disabled:c||ew&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(k.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ew&&("allowPrd"===e.id||"allowPlan"===e.id)?I("createDrawer.skippedInFastMode"):e.description})]},e.id))}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=tl.every(e=>es[e.id]),t={};for(let r of tl)t[r.id]=!e;ei(t)},disabled:c,className:(0,g.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",tl.every(e=>es[e.id])&&"text-primary"),children:I("createDrawer.all")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.evidence")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:eu,onCheckedChange:e=>{eh(e),e||ex(!1)},disabled:c}),(0,t.jsx)(k.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.collect")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.collectDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:em,onCheckedChange:ex,disabled:c||!eu||!en&&!ey}),(0,t.jsx)(k.Label,{htmlFor:"commit-evidence",className:(0,g.cn)("cursor-pointer text-xs font-medium",(!eu||!en&&!ey)&&"opacity-50"),children:I("createDrawer.addToPr")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:en||ey?eu?I("createDrawer.addToPrDescription"):I("createDrawer.requiresEvidence"):I("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.skills")})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.skillsDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"inject-skills",size:"sm",checked:eF,onCheckedChange:eP,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"inject-skills",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(h.Puzzle,{className:"h-3 w-3"}),I("createDrawer.injectSkills")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.injectSkillsDescription")})]})})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:I("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!ey||eo||en,onCheckedChange:e=>{el(e),!e&&en&&ec(!1)},disabled:c||ey}),(0,t.jsx)(k.Label,{htmlFor:"push",className:(0,g.cn)("cursor-pointer text-xs font-medium",ey&&"opacity-50"),children:I("createDrawer.push")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ey?"Enabled — contributing to upstream":I("createDrawer.pushDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!ey||en,onCheckedChange:e=>{ec(e),e||ex(!1)},disabled:c||ey}),(0,t.jsx)(k.Label,{htmlFor:"open-pr",className:(0,g.cn)("cursor-pointer text-xs font-medium",ey&&"opacity-50"),children:I("createDrawer.pr")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ey?"Enabled — contributing to upstream":I("createDrawer.prDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:ed,onCheckedChange:ep,disabled:c}),(0,t.jsx)(k.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.watch")})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"rebase-before-branch",size:"sm",checked:eT,onCheckedChange:eS,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m.RefreshCw,{className:"h-3 w-3"}),I("createDrawer.sync")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.syncDescription")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:eN,onCheckedChange:eD,disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(u.FileText,{className:"h-3 w-3"}),I("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.commitSpecsDescription")})]}),!eV&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:ey,onCheckedChange:e=>{ek(e),e&&eD(!1)},disabled:c}),(0,t.jsxs)(k.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(p.GitFork,{className:"h-3 w-3"}),I("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:I("createDrawer.forkAndPrDescription")})]})]})]})]})]})})})})}function W({features:e,value:s,onChange:l,disabled:n}){let{t:c}=(0,a.useTranslation)("web"),[d,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),m=(0,r.useRef)(null),x=e.find(e=>e.id===s),f=u.trim()?e.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())||e.id.toLowerCase().includes(u.toLowerCase())):e,b=(0,r.useCallback)(e=>{l(e),p(!1),h("")},[l]);return(0,r.useEffect)(()=>{d?setTimeout(()=>m.current?.focus(),0):h("")},[d]),(0,t.jsxs)(D.Popover,{open:d,onOpenChange:p,children:[(0,t.jsx)(D.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":d,"aria-label":"Parent Feature",disabled:n,"data-testid":"parent-feature-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",!x&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:x?`${x.name} (${x.id.slice(0,8)})`:c("createDrawer.selectParent")}),(0,t.jsx)(i.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(D.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(C.Input,{ref:m,placeholder:c("createDrawer.searchFeatures"),value:u,onChange:e=>h(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===s,onClick:()=>b(void 0),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===s&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(o.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",void 0!==s&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:c("createDrawer.noParent")})]}),0===f.length&&u?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:c("createDrawer.noFeaturesFound")}):f.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":s===e.id,onClick:()=>b(e.id),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",s===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(o.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",s!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function Z({repositories:e,value:s,onChange:l,onAddRepository:n,disabled:u}){let[h,m]=(0,r.useState)(!1),[x,f]=(0,r.useState)(""),[b,j]=(0,r.useState)(!1),[w,v]=(0,r.useState)(null),[y,k]=(0,r.useState)(!1),T=(0,r.useRef)(null),{reactFileManager:S}=(0,M.useFeatureFlags)(),{t:F}=(0,a.useTranslation)("web"),P=e.find(e=>e.path===s),L=x.trim()?e.filter(e=>e.name.toLowerCase().includes(x.toLowerCase())||e.path.toLowerCase().includes(x.toLowerCase())):e,z=(0,r.useCallback)(e=>{l(e),m(!1),f("")},[l]),E=(0,r.useCallback)(async e=>{let t=await (0,I.addRepository)({path:e});if(t.error){v(t.error),j(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};n?.(e),l(e.path),m(!1),f("")}},[n,l]),O=(0,r.useCallback)(async()=>{if(!b){if(S)return void k(!0);j(!0),v(null);try{let e=await (0,U.pickFolder)();if(!e)return void j(!1);await E(e)}catch{k(!0)}finally{j(!1)}}},[b,S,E]),K=(0,r.useCallback)(async e=>{if(k(!1),e){j(!0),v(null);try{await E(e)}catch(e){v(e instanceof Error?e.message:"Failed to add repository")}finally{j(!1)}}},[E]);return(0,r.useEffect)(()=>{h?setTimeout(()=>T.current?.focus(),0):f("")},[h]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(D.Popover,{open:h,onOpenChange:m,children:[(0,t.jsx)(D.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":h,"aria-label":"Repository",disabled:u,"data-testid":"repository-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",!P&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:P?P.name:"Select repository..."}),(0,t.jsx)(i.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(D.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(C.Input,{ref:T,placeholder:F("createDrawer.searchRepositories"),value:x,onChange:e=>f(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===L.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):L.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":s===e.path,onClick:()=>z(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",s===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(o.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",s!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 truncate",children:[e.name,e.isFork?(0,t.jsxs)(N.Badge,{variant:"outline",className:"h-4 shrink-0 px-1 text-[10px]",children:[(0,t.jsx)(p.GitFork,{className:"mr-0.5 h-2.5 w-2.5"}),"Fork"]}):null]}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(R.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:O,disabled:b,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[b?(0,t.jsx)(d.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(c.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),w?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:w}):null]})})]}),(0,t.jsx)(A.ReactFileManagerDialog,{open:y,onOpenChange:e=>{e||k(!1)},onSelect:K})]})}e.s(["FeatureCreateDrawer",()=>q],630616),e.s([],34562)},433227,e=>{"use strict";var t=e.i(508893);let r=(0,t.createServerReference)("40fae939110775ca3414e04df5d65d3b5787d2991a",t.callServer,void 0,t.findSourceMapURL,"createFeature");e.s(["createFeature",()=>r])}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,670471,e=>{"use strict";var a=e.i(16298);e.s(["FileText",()=>a.default])},267669,e=>{"use strict";let a=(0,e.i(903645).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",()=>a],267669)},276016,e=>{"use strict";let a=(0,e.i(903645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>a],276016)},16298,e=>{"use strict";let a=(0,e.i(903645).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",()=>a])},220596,e=>{"use strict";var a=e.i(679606),t=e.i(152155),s=e.i(116457),l=e.i(3214),i=e.i(670471),r=e.i(267669),c=e.i(903645);let d=(0,c.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),n=(0,c.default)("star-off",[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var o=e.i(276016),p=e.i(131777),u=e.i(735364),h=e.i(698127),x=e.i(508893);let m=(0,x.createServerReference)("
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,670471,e=>{"use strict";var a=e.i(16298);e.s(["FileText",()=>a.default])},267669,e=>{"use strict";let a=(0,e.i(903645).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",()=>a],267669)},276016,e=>{"use strict";let a=(0,e.i(903645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>a],276016)},16298,e=>{"use strict";let a=(0,e.i(903645).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",()=>a])},220596,e=>{"use strict";var a=e.i(679606),t=e.i(152155),s=e.i(116457),l=e.i(3214),i=e.i(670471),r=e.i(267669),c=e.i(903645);let d=(0,c.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),n=(0,c.default)("star-off",[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var o=e.i(276016),p=e.i(131777),u=e.i(735364),h=e.i(698127),x=e.i(508893);let m=(0,x.createServerReference)("4098f49854ddf274331c6adb3bce110da51663e13d",x.callServer,void 0,x.findSourceMapURL,"createPage"),f=(0,x.createServerReference)("6062a27c06ef0c8a5aa587c365bf4e85f1013dc399",x.callServer,void 0,x.findSourceMapURL,"updatePage"),g=(0,x.createServerReference)("40045d70e827d6d8143c1aea76e7e9f15c0f986178",x.callServer,void 0,x.findSourceMapURL,"deletePage"),v=(0,s.default)(()=>e.A(710548).then(e=>e.PageEditor),{loadableGenerated:{modules:[853645]},ssr:!1});function y({projectId:e,pages:s,className:c}){let[x,y]=(0,t.useState)(s),[j,k]=(0,t.useState)(null),[N,b]=(0,t.useState)(!1),[w,C]=(0,t.useState)(""),[P,S]=(0,t.useState)(null),M=x.find(e=>e.id===j),F=x.filter(e=>!e.parentId),T=(0,t.useCallback)(e=>x.filter(a=>a.parentId===e),[x]),R=(0,t.useCallback)(async()=>{let a=w.trim();if(!a)return;let t=await m({projectId:e,title:a});t.page&&(y(e=>[...e,t.page]),k(t.page.id),C(""),b(!1))},[e,w]),L=(0,t.useCallback)(async e=>{if(!j)return;let a=await f(j,{content:e});a.page&&y(e=>e.map(e=>e.id===a.page.id?a.page:e))},[j]),z=(0,t.useCallback)(async(e,a)=>{let t=a.trim();if(!t)return;let s=await f(e,{title:t});s.page&&y(e=>e.map(e=>e.id===s.page.id?s.page:e)),S(null)},[]),B=(0,t.useCallback)(async e=>{(await g(e)).error||(y(a=>a.filter(a=>a.id!==e)),j===e&&k(null))},[j]),U=(0,t.useCallback)(async(e,a)=>{let t=await f(e,{isFavorite:!a});t.page&&y(e=>e.map(e=>e.id===t.page.id?t.page:e))},[]),E=(e,t=0)=>{let s=T(e.id),l=j===e.id,c=P===e.id;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{"data-testid":`page-item-${e.id}`,className:(0,p.cn)("group hover:bg-accent/50 flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 text-xs",l&&"bg-accent"),style:{paddingLeft:`${8+16*t}px`},onClick:()=>k(e.id),children:[s.length>0&&(0,a.jsx)(o.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,a.jsx)(i.FileText,{className:"text-muted-foreground h-3 w-3 shrink-0"}),c?(0,a.jsx)(h.Input,{autoFocus:!0,defaultValue:e.title,className:"h-5 text-xs",onBlur:a=>z(e.id,a.target.value),onKeyDown:a=>{"Enter"===a.key&&z(e.id,a.currentTarget.value),"Escape"===a.key&&S(null)},onClick:e=>e.stopPropagation()}):(0,a.jsx)("span",{className:"flex-1 truncate",onDoubleClick:a=>{a.stopPropagation(),S(e.id)},children:e.title}),(0,a.jsxs)("div",{className:"hidden gap-0.5 group-hover:flex",children:[(0,a.jsx)(u.Button,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:a=>{a.stopPropagation(),U(e.id,e.isFavorite)},title:e.isFavorite?"Unfavorite":"Favorite",children:e.isFavorite?(0,a.jsx)(d,{className:"h-2.5 w-2.5 fill-yellow-400 text-yellow-400"}):(0,a.jsx)(n,{className:"h-2.5 w-2.5"})}),(0,a.jsx)(u.Button,{variant:"ghost",size:"sm",className:"text-destructive h-4 w-4 p-0",onClick:a=>{a.stopPropagation(),B(e.id)},title:"Delete page",children:(0,a.jsx)(r.Trash2,{className:"h-2.5 w-2.5"})})]})]}),s.map(e=>E(e,t+1))]},e.id)};return(0,a.jsxs)("div",{"data-testid":"pages-panel",className:(0,p.cn)("flex h-full gap-0",c),children:[(0,a.jsxs)("div",{className:"flex w-56 shrink-0 flex-col border-r",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium",children:"Pages"}),(0,a.jsx)(u.Button,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>b(!0),"data-testid":"create-page-btn",children:(0,a.jsx)(l.Plus,{className:"h-3 w-3"})})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-1",children:[N?(0,a.jsx)("div",{className:"mb-1 px-2",children:(0,a.jsx)(h.Input,{autoFocus:!0,placeholder:"Page title...",value:w,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&R(),"Escape"===e.key&&(b(!1),C(""))},onBlur:()=>{w.trim()?R():(b(!1),C(""))},className:"h-6 text-xs","data-testid":"new-page-input"})}):null,0!==F.length||N?F.map(e=>E(e)):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,a.jsx)(i.FileText,{className:"mb-2 h-5 w-5 opacity-20"}),(0,a.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No pages yet"})]})]})]}),(0,a.jsx)("div",{className:"flex flex-1 flex-col overflow-hidden",children:M?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"border-b px-4 py-2",children:(0,a.jsx)("h2",{className:"text-sm font-medium",children:M.title})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,a.jsx)(v,{content:M.content??"",onUpdate:L})})]}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(i.FileText,{className:"mx-auto mb-2 h-8 w-8 opacity-20"}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select or create a page"})]})})})]})}e.s(["PagesPanel",()=>y],220596)},710548,e=>{e.v(a=>Promise.all(["static/chunks/c0ec1e62b201bc26.js","static/chunks/f0489081bef94e11.js"].map(a=>e.l(a))).then(()=>a(853645)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,935946,e=>{"use strict";var t=e.i(943698);e.s(["Paperclip",()=>t.default])},267669,e=>{"use strict";let t=(0,e.i(903645).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],267669)},943698,176505,57484,e=>{"use strict";var t=e.i(903645);let a=(0,t.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",()=>a],943698);let s=(0,t.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(["default",()=>s],176505),e.s(["FileIcon",()=>s],57484)},295230,e=>{"use strict";let t=(0,e.i(903645).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])},602287,e=>{"use strict";var t=e.i(679606),a=e.i(152155),s=e.i(90033),i=e.i(860253),l=e.i(131777);let r=s.Dialog.Root,n=s.Dialog.Trigger,d=s.Dialog.Portal,o=s.Dialog.Close,c=a.forwardRef(({className:e,onClick:a,...i},r)=>(0,t.jsx)(s.Dialog.Overlay,{ref:r,className:(0,l.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),a?.(e)},...i}));c.displayName=s.Dialog.Overlay.displayName;let m=a.forwardRef(({className:e,children:a,...r},n)=>(0,t.jsxs)(d,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(s.Dialog.Content,{ref:n,className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...r,children:[a,(0,t.jsxs)(s.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(i.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=s.Dialog.Content.displayName;let u=({className:e,...a})=>(0,t.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-start",e),...a});u.displayName="DialogHeader";let x=({className:e,...a})=>(0,t.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});x.displayName="DialogFooter";let p=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(s.Dialog.Title,{ref:i,className:(0,l.cn)("text-lg leading-none font-semibold tracking-tight",e),...a}));p.displayName=s.Dialog.Title.displayName;let h=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(s.Dialog.Description,{ref:i,className:(0,l.cn)("text-muted-foreground text-sm",e),...a}));h.displayName=s.Dialog.Description.displayName,e.s(["Dialog",()=>r,"DialogClose",()=>o,"DialogContent",()=>m,"DialogDescription",()=>h,"DialogFooter",()=>x,"DialogHeader",()=>u,"DialogTitle",()=>p,"DialogTrigger",()=>n])},723925,301012,e=>{"use strict";let t=(0,e.i(903645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],301012),e.s(["Check",()=>t],723925)},48306,e=>{"use strict";var t=e.i(679606),a=e.i(131777);function s({className:e,...s}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.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),...s})}e.s(["Textarea",()=>s])},215131,e=>{"use strict";let t=(0,e.i(903645).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(["default",()=>t])},958481,e=>{"use strict";var t=e.i(215131);e.s(["AlertTriangle",()=>t.default])},681181,e=>{"use strict";var t=e.i(295230);e.s(["Download",()=>t.default])},976874,e=>{"use strict";let t=(0,e.i(903645).default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);e.s(["Layers",()=>t],976874)},938518,e=>{"use strict";let t=(0,e.i(903645).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],938518)},405682,e=>{"use strict";var t=e.i(679606),a=e.i(152155),s=e.i(602287),i=e.i(735364),l=e.i(698127),r=e.i(141957),n=e.i(48306),d=e.i(547373),o=e.i(508893);let c=(0,o.createServerReference)("40636385d98667911ae36ddd516cdbe565fb9b8e8e",o.callServer,void 0,o.findSourceMapURL,"createWorkItem");function m({open:e,onOpenChange:o,projectId:m,states:u,onCreated:x,parentId:p}){let[h,g]=(0,a.useState)(""),[f,j]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[N,b]=(0,a.useState)("None"),[k,w]=(0,a.useState)(null),[S,D]=(0,a.useState)(!1),I=async()=>{w(null),D(!0);try{let e=await c({projectId:m,title:h,description:f||void 0,stateId:v||void 0,priority:N||void 0,parentId:p??void 0});e.error?w(e.error):e.workItem&&(x(e.workItem),g(""),j(""),y(""),b("None"))}finally{D(!1)}};return(0,t.jsx)(s.Dialog,{open:e,onOpenChange:o,children:(0,t.jsxs)(s.DialogContent,{"data-testid":"create-work-item-dialog",children:[(0,t.jsx)(s.DialogHeader,{children:(0,t.jsx)(s.DialogTitle,{children:p?"Create Sub-item":"Create Work Item"})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{htmlFor:"work-item-title",children:"Title"}),(0,t.jsx)(l.Input,{id:"work-item-title",value:h,onChange:e=>g(e.target.value),placeholder:"What needs to be done?","data-testid":"work-item-title-input"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{htmlFor:"work-item-desc",children:"Description (optional)"}),(0,t.jsx)(n.Textarea,{id:"work-item-desc",value:f,onChange:e=>j(e.target.value),placeholder:"Add more details...",rows:3,"data-testid":"work-item-desc-input"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{children:"State"}),(0,t.jsxs)(d.Select,{value:v,onValueChange:y,children:[(0,t.jsx)(d.SelectTrigger,{"data-testid":"work-item-state-select",children:(0,t.jsx)(d.SelectValue,{placeholder:"Default"})}),(0,t.jsx)(d.SelectContent,{children:u.map(e=>(0,t.jsx)(d.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{children:"Priority"}),(0,t.jsxs)(d.Select,{value:N,onValueChange:b,children:[(0,t.jsx)(d.SelectTrigger,{"data-testid":"work-item-priority-select",children:(0,t.jsx)(d.SelectValue,{placeholder:"None"})}),(0,t.jsxs)(d.SelectContent,{children:[(0,t.jsx)(d.SelectItem,{value:"None",children:"None"}),(0,t.jsx)(d.SelectItem,{value:"Low",children:"Low"}),(0,t.jsx)(d.SelectItem,{value:"Medium",children:"Medium"}),(0,t.jsx)(d.SelectItem,{value:"High",children:"High"}),(0,t.jsx)(d.SelectItem,{value:"Urgent",children:"Urgent"})]})]})]})]}),k?(0,t.jsx)("p",{className:"text-destructive text-xs","data-testid":"create-work-item-error",children:k}):null]}),(0,t.jsxs)(s.DialogFooter,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>o(!1),disabled:S,children:"Cancel"}),(0,t.jsx)(i.Button,{onClick:I,disabled:!h.trim()||S,"data-testid":"create-work-item-submit",children:S?"Creating...":"Create"})]})]})})}e.s(["CreateWorkItemDialog",()=>m],405682)},149809,e=>{"use strict";var t=e.i(679606),a=e.i(152155),s=e.i(711434),i=e.i(938518),l=e.i(131777),r=e.i(735364),n=e.i(81846),d=e.i(903645);let o=(0,d.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var c=e.i(860253),m=e.i(3214),u=e.i(83428),x=e.i(317406),p=e.i(508893);let h=(0,p.createServerReference)("40c29901892151b65546c9268a084f54f971c117c1",p.callServer,void 0,p.findSourceMapURL,"listWorkItemRelations"),g=(0,p.createServerReference)("40e1f77c32877e96a2c1593f7dab6fc0fe764c624a",p.callServer,void 0,p.findSourceMapURL,"deleteWorkItemRelation");var f=e.i(602287),j=e.i(698127),v=e.i(141957),y=e.i(547373);let N=(0,p.createServerReference)("40bc7a5e1840955e7de30640750b60604830911dd7",p.callServer,void 0,p.findSourceMapURL,"createWorkItemRelation"),b=[{value:x.RelationType.Blocking,label:"Blocking"},{value:x.RelationType.RelatesTo,label:"Relates to"},{value:x.RelationType.Duplicate,label:"Duplicate"},{value:x.RelationType.StartsBefore,label:"Starts before"},{value:x.RelationType.FinishesBefore,label:"Finishes before"}];function k({open:e,onOpenChange:s,sourceWorkItemId:i,onCreated:l}){let[n,d]=(0,a.useState)(x.RelationType.RelatesTo),[o,c]=(0,a.useState)(""),[m,u]=(0,a.useState)(null),[p,h]=(0,a.useState)(!1),g=async()=>{if(u(null),!o.trim())return void u("Target work item ID is required");h(!0);try{let e=await N({sourceWorkItemId:i,targetWorkItemId:o.trim(),relationType:n});e.error?u(e.error):e.relation&&(l(e.relation),c(""),d(x.RelationType.RelatesTo))}finally{h(!1)}};return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(f.DialogContent,{"data-testid":"add-relation-dialog",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsx)(f.DialogTitle,{children:"Add Relation"})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.Label,{htmlFor:"relation-type",children:"Relation Type"}),(0,t.jsxs)(y.Select,{value:n,onValueChange:d,children:[(0,t.jsx)(y.SelectTrigger,{"data-testid":"relation-type-select",children:(0,t.jsx)(y.SelectValue,{placeholder:"Select type"})}),(0,t.jsx)(y.SelectContent,{children:b.map(e=>(0,t.jsx)(y.SelectItem,{value:e.value,children:e.label},e.value))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.Label,{htmlFor:"target-work-item",children:"Target Work Item ID"}),(0,t.jsx)(j.Input,{id:"target-work-item",value:o,onChange:e=>c(e.target.value),placeholder:"Enter work item ID or identifier","data-testid":"target-work-item-input"})]}),m?(0,t.jsx)("p",{className:"text-destructive text-xs","data-testid":"add-relation-error",children:m}):null]}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>s(!1),disabled:p,children:"Cancel"}),(0,t.jsx)(r.Button,{onClick:g,disabled:!o.trim()||p,"data-testid":"add-relation-submit",children:p?"Adding...":"Add Relation"})]})]})})}let w={[x.RelationType.Blocking]:"Blocking",[x.RelationType.RelatesTo]:"Relates to",[x.RelationType.Duplicate]:"Duplicate of",[x.RelationType.StartsBefore]:"Starts before",[x.RelationType.FinishesBefore]:"Finishes before"};function S({workItemId:e,workItemsMap:s,projectPrefix:i,initialRelations:d,className:x}){let[p,f]=(0,a.useState)(d??[]),[j,v]=(0,a.useState)(!d),[y,N]=(0,a.useState)(null),[b,S]=(0,a.useState)(!1),[D,I]=(0,a.useState)(null),C=(0,a.useCallback)(async()=>{v(!0),N(null);let t=await h(e);t.error?N(t.error):t.relations&&f(t.relations),v(!1)},[e]);(0,a.useEffect)(()=>{d||C()},[C,d]);let T=async e=>{I(e);let t=await g(e);t.error?N(t.error):f(t=>t.filter(t=>t.id!==e)),I(null)},R=function(e){let t=new Map;for(let a of e){let e=t.get(a.relationType)??[];e.push(a),t.set(a.relationType,e)}return Array.from(t.entries()).map(([e,t])=>({type:e,items:t}))}(p);return(0,t.jsxs)("div",{"data-testid":"work-item-relations-panel",className:(0,l.cn)("space-y-3",x),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Relations"}),p.length>0&&(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:p.length})]}),(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-[10px]",onClick:()=>S(!0),"data-testid":"add-relation-btn",children:[(0,t.jsx)(m.Plus,{className:"mr-0.5 h-3 w-3"}),"Add"]})]}),j?(0,t.jsx)("div",{className:"flex items-center justify-center py-4","data-testid":"relations-loading",children:(0,t.jsx)(u.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"})}):null,y?(0,t.jsx)("p",{className:"text-destructive text-[10px]","data-testid":"relations-error",children:y}):null,!j&&0===p.length&&!y&&(0,t.jsx)("p",{className:"text-muted-foreground py-2 text-center text-[10px]","data-testid":"relations-empty",children:"No relations yet."}),!j&&R.length>0&&(0,t.jsx)("div",{className:"space-y-2","data-testid":"relations-list",children:R.map(({type:a,items:l})=>(0,t.jsxs)("div",{"data-testid":`relation-group-${a}`,children:[(0,t.jsx)("span",{className:"text-muted-foreground mb-1 block text-[10px] font-medium",children:w[a]??a}),(0,t.jsx)("div",{className:"space-y-1",children:l.map(a=>{let l,d,o,m;return(0,t.jsxs)("div",{"data-testid":`relation-item-${a.id}`,className:"hover:bg-accent/50 flex items-center gap-2 rounded px-2 py-1 transition-colors",children:[(0,t.jsx)(n.Badge,{variant:"outline",className:"shrink-0 font-mono text-[10px]",children:(l=a.sourceWorkItemId===e?a.targetWorkItemId:a.sourceWorkItemId,(d=s.get(l))?`${i}-${d.sequenceId}`:l.substring(0,8))}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:(o=a.sourceWorkItemId===e?a.targetWorkItemId:a.sourceWorkItemId,m=s.get(o),m?.title??"Unknown item")}),(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"h-5 w-5 shrink-0 p-0",onClick:()=>T(a.id),disabled:D===a.id,"data-testid":`delete-relation-${a.id}`,children:D===a.id?(0,t.jsx)(u.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(c.X,{className:"h-3 w-3"})})]},a.id)})})]},a))}),(0,t.jsx)(k,{open:b,onOpenChange:S,sourceWorkItemId:e,onCreated:e=>{f(t=>[...t,e]),S(!1)}})]})}var D=e.i(976874),I=e.i(958481),C=e.i(405682);let T={Urgent:"bg-red-500/10 text-red-500",High:"bg-orange-500/10 text-orange-500",Medium:"bg-yellow-500/10 text-yellow-500",Low:"bg-blue-500/10 text-blue-500",None:"bg-muted text-muted-foreground"};function R({workItem:e,allWorkItems:s,states:i,projectPrefix:d,projectId:o,currentDepth:c=0,onSubItemClick:u,className:x}){let[p,h]=(0,a.useState)(!1),[g,f]=(0,a.useState)([]),j=new Map(i.map(e=>[e.id,e])),v=[...s.filter(t=>t.parentId===e.id),...g.filter(e=>!s.some(t=>t.id===e.id))],y=c>=2;return(0,t.jsxs)("div",{"data-testid":"sub-items-section",className:(0,l.cn)("space-y-3",x),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(D.Layers,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sub-items"}),v.length>0&&(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:v.length})]}),!y&&(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-[10px]",onClick:()=>h(!0),"data-testid":"add-sub-item-btn",children:[(0,t.jsx)(m.Plus,{className:"mr-0.5 h-3 w-3"}),"Add"]})]}),y?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded bg-yellow-500/10 px-2 py-1.5","data-testid":"max-depth-warning",children:[(0,t.jsx)(I.AlertTriangle,{className:"h-3 w-3 shrink-0 text-yellow-500"}),(0,t.jsxs)("span",{className:"text-[10px] text-yellow-600 dark:text-yellow-400",children:["Maximum nesting depth reached (",3," levels). Cannot add sub-items here."]})]}):null,0===v.length&&!y&&(0,t.jsx)("p",{className:"text-muted-foreground py-2 text-center text-[10px]","data-testid":"sub-items-empty",children:"No sub-items yet."}),v.length>0&&(0,t.jsx)("div",{className:"divide-y rounded-lg border","data-testid":"sub-items-list",children:v.map(e=>{let a=j.get(e.stateId),s=`${d}-${e.sequenceId}`;return(0,t.jsxs)("div",{"data-testid":`sub-item-${s}`,className:"hover:bg-accent/50 flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors",onClick:()=>u?.(e),role:"button",tabIndex:0,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&u?.(e)},children:[(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 font-mono text-[10px]",children:s}),a?(0,t.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:a.color},title:a.name}):null,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs",children:e.title}),e.priority&&"None"!==e.priority?(0,t.jsx)(n.Badge,{variant:"secondary",className:`shrink-0 text-[10px] ${T[e.priority]??""}`,children:e.priority}):null]},e.id)})}),!y&&(0,t.jsx)(C.CreateWorkItemDialog,{open:p,onOpenChange:h,projectId:o,states:i,onCreated:e=>{f(t=>[...t,e]),h(!1)},parentId:e.id})]})}var M=e.i(935946),B=e.i(267669),L=e.i(681181);let A=(0,d.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var z=e.i(57484);let $=(0,p.createServerReference)("40b45e76c0dfcfccf2bdca106deab7ce262d8c0061",p.callServer,void 0,p.findSourceMapURL,"deleteAttachment");function W({workItemId:e,attachments:s,className:i}){let[n,d]=(0,a.useState)(s),[o,c]=(0,a.useState)(!1),m=(0,a.useRef)(null),u=(0,a.useCallback)(async t=>{if(t&&0!==t.length){c(!0);try{for(let a of Array.from(t)){let t=new FormData;t.append("file",a),t.append("workItemId",e);let s=await fetch("/api/pm-attachments/upload",{method:"POST",body:t});if(s.ok){let t=await s.json(),a={id:t.id,workItemId:e,filename:t.filename,mimeType:t.mimeType,fileSize:t.fileSize,storagePath:"",createdAt:new Date(t.createdAt),updatedAt:new Date(t.createdAt),deletedAt:void 0};d(e=>[...e,a])}}}finally{c(!1),m.current&&(m.current.value="")}}},[e]),x=(0,a.useCallback)(async e=>{(await $(e)).error||d(t=>t.filter(t=>t.id!==e))},[]),p=(0,a.useCallback)(e=>{window.open(`/api/pm-attachments/download?id=${e}`,"_blank")},[]);return(0,t.jsxs)("div",{"data-testid":"attachment-list",className:(0,l.cn)("space-y-3",i),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.Paperclip,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"text-xs font-medium",children:["Attachments ",n.length>0?`(${String(n.length)})`:""]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("input",{ref:m,type:"file",multiple:!0,className:"hidden",onChange:e=>u(e.target.files),"data-testid":"file-input"}),(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 text-xs",onClick:()=>m.current?.click(),disabled:o,"data-testid":"upload-btn",children:[(0,t.jsx)(A,{className:"h-3 w-3"}),o?"Uploading...":"Upload"]})]})]}),0===n.length?(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No attachments"}):(0,t.jsx)("div",{className:"space-y-1",children:n.map(e=>{var a;return(0,t.jsxs)("div",{"data-testid":`attachment-${e.id}`,className:"group hover:bg-accent/50 flex items-center gap-2 rounded-sm px-2 py-1 text-xs",children:[(0,t.jsx)(z.FileIcon,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:e.filename}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:(a=e.fileSize)<1024?`${String(a)} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}),(0,t.jsxs)("div",{className:"hidden gap-0.5 group-hover:flex",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>p(e.id),title:"Download",children:(0,t.jsx)(L.Download,{className:"h-3 w-3"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-destructive h-5 w-5 p-0",onClick:()=>x(e.id),title:"Delete",children:(0,t.jsx)(B.Trash2,{className:"h-3 w-3"})})]})]},e.id)})})]})}var F=e.i(655016);let P=(0,p.createServerReference)("70a1fc040014919375f6f7760f9b2c82c2a10f99d9",p.callServer,void 0,p.findSourceMapURL,"logTimeEntry"),U=(0,p.createServerReference)("401c414577d8f49aa91111cc7e7c512560c9e51f1f",p.callServer,void 0,p.findSourceMapURL,"deleteTimeEntry");function H(e){if(e<60)return`${String(e)}m`;let t=Math.floor(e/60),a=e%60;return a>0?`${String(t)}h ${String(a)}m`:`${String(t)}h`}function V({workItemId:e,timeEntries:s,totalMinutes:i,className:n}){let[d,o]=(0,a.useState)(s),[c,u]=(0,a.useState)(i),[x,p]=(0,a.useState)(!1),[h,g]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[y,N]=(0,a.useState)(""),[b,k]=(0,a.useState)(!1),w=(0,a.useCallback)(async t=>{t.preventDefault();let a=60*(parseInt(h,10)||0)+(parseInt(f,10)||0);if(!(a<=0)){k(!0);try{let t=await P(e,a,y||void 0);t.timeEntry&&(o(e=>[t.timeEntry,...e]),u(e=>e+a),g(""),v(""),N(""),p(!1))}finally{k(!1)}}},[e,h,f,y]),S=(0,a.useCallback)(async(e,t)=>{(await U(e)).error||(o(t=>t.filter(t=>t.id!==e)),u(e=>e-t))},[]);return(0,t.jsxs)("div",{"data-testid":"time-entry-list",className:(0,l.cn)("space-y-3",n),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(F.Clock,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Time Logged"}),c>0?(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",H(c)," total)"]}):null]}),(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 text-xs",onClick:()=>p(!x),"data-testid":"log-time-btn",children:[(0,t.jsx)(m.Plus,{className:"h-3 w-3"}),"Log Time"]})]}),x?(0,t.jsxs)("form",{onSubmit:w,className:"bg-muted/50 space-y-2 rounded-md border p-2","data-testid":"log-time-form",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(j.Input,{type:"number",min:"0",placeholder:"0",value:h,onChange:e=>g(e.target.value),className:"h-7 w-14 text-xs","data-testid":"hours-input"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:"h"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(j.Input,{type:"number",min:"0",max:"59",placeholder:"0",value:f,onChange:e=>v(e.target.value),className:"h-7 w-14 text-xs","data-testid":"minutes-input"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:"m"})]})]}),(0,t.jsx)(j.Input,{placeholder:"Note (optional)",value:y,onChange:e=>N(e.target.value),className:"h-7 text-xs","data-testid":"note-input"}),(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,t.jsx)(r.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>p(!1),children:"Cancel"}),(0,t.jsx)(r.Button,{type:"submit",size:"sm",className:"h-6 text-xs",disabled:b,"data-testid":"save-time-btn",children:b?"Saving...":"Save"})]})]}):null,0===d.length?(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No time logged"}):(0,t.jsx)("div",{className:"space-y-1",children:d.map(e=>{var a;return(0,t.jsxs)("div",{"data-testid":`time-entry-${e.id}`,className:"group hover:bg-accent/50 flex items-center gap-2 rounded-sm px-2 py-1 text-xs",children:[(0,t.jsx)(F.Clock,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"font-medium",children:H(e.durationMinutes)}),e.note?(0,t.jsx)("span",{className:"text-muted-foreground flex-1 truncate",children:e.note}):(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:("string"==typeof(a=e.loggedAt)?new Date(a):a).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),(0,t.jsx)("div",{className:"hidden group-hover:flex",children:(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-destructive h-5 w-5 p-0",onClick:()=>S(e.id,e.durationMinutes),title:"Delete",children:(0,t.jsx)(B.Trash2,{className:"h-3 w-3"})})})]},e.id)})})]})}let E={Urgent:"bg-red-500/10 text-red-500",High:"bg-orange-500/10 text-orange-500",Medium:"bg-yellow-500/10 text-yellow-500",Low:"bg-blue-500/10 text-blue-500",None:"bg-muted text-muted-foreground"};function q({project:e,workItem:d,allWorkItems:o,states:c,relations:m,attachments:u,timeEntries:x,totalMinutes:p,className:h}){let g=(0,s.useRouter)(),f=new Map(c.map(e=>[e.id,e])),j=(0,a.useMemo)(()=>new Map(o.map(e=>[e.id,e])),[o]),v=f.get(d.stateId),y=`${e.identifierPrefix}-${d.sequenceId}`;return(0,t.jsxs)("div",{"data-testid":"work-item-detail",className:(0,l.cn)("space-y-6",h),children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>g.push(`/projects/${e.slug}`),"data-testid":"back-to-project",children:(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:y}),v?(0,t.jsxs)(n.Badge,{variant:"outline",className:"text-[10px]",children:[(0,t.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full",style:{backgroundColor:v.color}}),v.name]}):null,d.priority&&"None"!==d.priority?(0,t.jsx)(n.Badge,{variant:"secondary",className:(0,l.cn)("text-[10px]",E[d.priority]),children:d.priority}):null]}),(0,t.jsx)("h1",{className:"text-lg font-bold tracking-tight",children:d.title}),d.description?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:d.description}):null]}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium uppercase",children:"Start Date"}),(0,t.jsx)("p",{className:"text-xs",children:d.startDate?new Date(d.startDate).toLocaleDateString():"—"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium uppercase",children:"Due Date"}),(0,t.jsx)("p",{className:"text-xs",children:d.dueDate?new Date(d.dueDate).toLocaleDateString():"—"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium uppercase",children:"Estimate"}),(0,t.jsx)("p",{className:"text-xs",children:d.estimateValue??"—"})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(R,{workItem:d,allWorkItems:o,states:c,projectPrefix:e.identifierPrefix,projectId:e.id,onSubItemClick:t=>{g.push(`/projects/${e.slug}/items/${t.id}`)}}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(S,{workItemId:d.id,workItemsMap:j,projectPrefix:e.identifierPrefix,initialRelations:m}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(W,{workItemId:d.id,attachments:u}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(V,{workItemId:d.id,timeEntries:x,totalMinutes:p})]})}e.s(["WorkItemDetailClient",()=>q],149809)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,935946,e=>{"use strict";var t=e.i(943698);e.s(["Paperclip",()=>t.default])},267669,e=>{"use strict";let t=(0,e.i(903645).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],267669)},943698,176505,57484,e=>{"use strict";var t=e.i(903645);let a=(0,t.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",()=>a],943698);let s=(0,t.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(["default",()=>s],176505),e.s(["FileIcon",()=>s],57484)},295230,e=>{"use strict";let t=(0,e.i(903645).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])},602287,e=>{"use strict";var t=e.i(679606),a=e.i(152155),s=e.i(90033),i=e.i(860253),l=e.i(131777);let r=s.Dialog.Root,n=s.Dialog.Trigger,d=s.Dialog.Portal,o=s.Dialog.Close,c=a.forwardRef(({className:e,onClick:a,...i},r)=>(0,t.jsx)(s.Dialog.Overlay,{ref:r,className:(0,l.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),a?.(e)},...i}));c.displayName=s.Dialog.Overlay.displayName;let m=a.forwardRef(({className:e,children:a,...r},n)=>(0,t.jsxs)(d,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(s.Dialog.Content,{ref:n,className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...r,children:[a,(0,t.jsxs)(s.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(i.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=s.Dialog.Content.displayName;let u=({className:e,...a})=>(0,t.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-start",e),...a});u.displayName="DialogHeader";let x=({className:e,...a})=>(0,t.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});x.displayName="DialogFooter";let p=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(s.Dialog.Title,{ref:i,className:(0,l.cn)("text-lg leading-none font-semibold tracking-tight",e),...a}));p.displayName=s.Dialog.Title.displayName;let h=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(s.Dialog.Description,{ref:i,className:(0,l.cn)("text-muted-foreground text-sm",e),...a}));h.displayName=s.Dialog.Description.displayName,e.s(["Dialog",()=>r,"DialogClose",()=>o,"DialogContent",()=>m,"DialogDescription",()=>h,"DialogFooter",()=>x,"DialogHeader",()=>u,"DialogTitle",()=>p,"DialogTrigger",()=>n])},723925,301012,e=>{"use strict";let t=(0,e.i(903645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],301012),e.s(["Check",()=>t],723925)},48306,e=>{"use strict";var t=e.i(679606),a=e.i(131777);function s({className:e,...s}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.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),...s})}e.s(["Textarea",()=>s])},215131,e=>{"use strict";let t=(0,e.i(903645).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(["default",()=>t])},958481,e=>{"use strict";var t=e.i(215131);e.s(["AlertTriangle",()=>t.default])},681181,e=>{"use strict";var t=e.i(295230);e.s(["Download",()=>t.default])},976874,e=>{"use strict";let t=(0,e.i(903645).default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);e.s(["Layers",()=>t],976874)},938518,e=>{"use strict";let t=(0,e.i(903645).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],938518)},405682,e=>{"use strict";var t=e.i(679606),a=e.i(152155),s=e.i(602287),i=e.i(735364),l=e.i(698127),r=e.i(141957),n=e.i(48306),d=e.i(547373),o=e.i(508893);let c=(0,o.createServerReference)("404dbccdd7e086c9f1b5fcef7668b7dd23b2d11e32",o.callServer,void 0,o.findSourceMapURL,"createWorkItem");function m({open:e,onOpenChange:o,projectId:m,states:u,onCreated:x,parentId:p}){let[h,g]=(0,a.useState)(""),[f,j]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[N,b]=(0,a.useState)("None"),[k,w]=(0,a.useState)(null),[S,D]=(0,a.useState)(!1),I=async()=>{w(null),D(!0);try{let e=await c({projectId:m,title:h,description:f||void 0,stateId:v||void 0,priority:N||void 0,parentId:p??void 0});e.error?w(e.error):e.workItem&&(x(e.workItem),g(""),j(""),y(""),b("None"))}finally{D(!1)}};return(0,t.jsx)(s.Dialog,{open:e,onOpenChange:o,children:(0,t.jsxs)(s.DialogContent,{"data-testid":"create-work-item-dialog",children:[(0,t.jsx)(s.DialogHeader,{children:(0,t.jsx)(s.DialogTitle,{children:p?"Create Sub-item":"Create Work Item"})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{htmlFor:"work-item-title",children:"Title"}),(0,t.jsx)(l.Input,{id:"work-item-title",value:h,onChange:e=>g(e.target.value),placeholder:"What needs to be done?","data-testid":"work-item-title-input"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{htmlFor:"work-item-desc",children:"Description (optional)"}),(0,t.jsx)(n.Textarea,{id:"work-item-desc",value:f,onChange:e=>j(e.target.value),placeholder:"Add more details...",rows:3,"data-testid":"work-item-desc-input"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{children:"State"}),(0,t.jsxs)(d.Select,{value:v,onValueChange:y,children:[(0,t.jsx)(d.SelectTrigger,{"data-testid":"work-item-state-select",children:(0,t.jsx)(d.SelectValue,{placeholder:"Default"})}),(0,t.jsx)(d.SelectContent,{children:u.map(e=>(0,t.jsx)(d.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(r.Label,{children:"Priority"}),(0,t.jsxs)(d.Select,{value:N,onValueChange:b,children:[(0,t.jsx)(d.SelectTrigger,{"data-testid":"work-item-priority-select",children:(0,t.jsx)(d.SelectValue,{placeholder:"None"})}),(0,t.jsxs)(d.SelectContent,{children:[(0,t.jsx)(d.SelectItem,{value:"None",children:"None"}),(0,t.jsx)(d.SelectItem,{value:"Low",children:"Low"}),(0,t.jsx)(d.SelectItem,{value:"Medium",children:"Medium"}),(0,t.jsx)(d.SelectItem,{value:"High",children:"High"}),(0,t.jsx)(d.SelectItem,{value:"Urgent",children:"Urgent"})]})]})]})]}),k?(0,t.jsx)("p",{className:"text-destructive text-xs","data-testid":"create-work-item-error",children:k}):null]}),(0,t.jsxs)(s.DialogFooter,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>o(!1),disabled:S,children:"Cancel"}),(0,t.jsx)(i.Button,{onClick:I,disabled:!h.trim()||S,"data-testid":"create-work-item-submit",children:S?"Creating...":"Create"})]})]})})}e.s(["CreateWorkItemDialog",()=>m],405682)},149809,e=>{"use strict";var t=e.i(679606),a=e.i(152155),s=e.i(711434),i=e.i(938518),l=e.i(131777),r=e.i(735364),n=e.i(81846),d=e.i(903645);let o=(0,d.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var c=e.i(860253),m=e.i(3214),u=e.i(83428),x=e.i(317406),p=e.i(508893);let h=(0,p.createServerReference)("40807b5c34623a48bbb479d861f786f3964b9f21fb",p.callServer,void 0,p.findSourceMapURL,"listWorkItemRelations"),g=(0,p.createServerReference)("40325f8c174dc39345d7595e7b3e4e27612e7afbfc",p.callServer,void 0,p.findSourceMapURL,"deleteWorkItemRelation");var f=e.i(602287),j=e.i(698127),v=e.i(141957),y=e.i(547373);let N=(0,p.createServerReference)("40fd30a3448d60c8ad149d54827b7b6c826ba60529",p.callServer,void 0,p.findSourceMapURL,"createWorkItemRelation"),b=[{value:x.RelationType.Blocking,label:"Blocking"},{value:x.RelationType.RelatesTo,label:"Relates to"},{value:x.RelationType.Duplicate,label:"Duplicate"},{value:x.RelationType.StartsBefore,label:"Starts before"},{value:x.RelationType.FinishesBefore,label:"Finishes before"}];function k({open:e,onOpenChange:s,sourceWorkItemId:i,onCreated:l}){let[n,d]=(0,a.useState)(x.RelationType.RelatesTo),[o,c]=(0,a.useState)(""),[m,u]=(0,a.useState)(null),[p,h]=(0,a.useState)(!1),g=async()=>{if(u(null),!o.trim())return void u("Target work item ID is required");h(!0);try{let e=await N({sourceWorkItemId:i,targetWorkItemId:o.trim(),relationType:n});e.error?u(e.error):e.relation&&(l(e.relation),c(""),d(x.RelationType.RelatesTo))}finally{h(!1)}};return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(f.DialogContent,{"data-testid":"add-relation-dialog",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsx)(f.DialogTitle,{children:"Add Relation"})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.Label,{htmlFor:"relation-type",children:"Relation Type"}),(0,t.jsxs)(y.Select,{value:n,onValueChange:d,children:[(0,t.jsx)(y.SelectTrigger,{"data-testid":"relation-type-select",children:(0,t.jsx)(y.SelectValue,{placeholder:"Select type"})}),(0,t.jsx)(y.SelectContent,{children:b.map(e=>(0,t.jsx)(y.SelectItem,{value:e.value,children:e.label},e.value))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.Label,{htmlFor:"target-work-item",children:"Target Work Item ID"}),(0,t.jsx)(j.Input,{id:"target-work-item",value:o,onChange:e=>c(e.target.value),placeholder:"Enter work item ID or identifier","data-testid":"target-work-item-input"})]}),m?(0,t.jsx)("p",{className:"text-destructive text-xs","data-testid":"add-relation-error",children:m}):null]}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>s(!1),disabled:p,children:"Cancel"}),(0,t.jsx)(r.Button,{onClick:g,disabled:!o.trim()||p,"data-testid":"add-relation-submit",children:p?"Adding...":"Add Relation"})]})]})})}let w={[x.RelationType.Blocking]:"Blocking",[x.RelationType.RelatesTo]:"Relates to",[x.RelationType.Duplicate]:"Duplicate of",[x.RelationType.StartsBefore]:"Starts before",[x.RelationType.FinishesBefore]:"Finishes before"};function S({workItemId:e,workItemsMap:s,projectPrefix:i,initialRelations:d,className:x}){let[p,f]=(0,a.useState)(d??[]),[j,v]=(0,a.useState)(!d),[y,N]=(0,a.useState)(null),[b,S]=(0,a.useState)(!1),[D,I]=(0,a.useState)(null),C=(0,a.useCallback)(async()=>{v(!0),N(null);let t=await h(e);t.error?N(t.error):t.relations&&f(t.relations),v(!1)},[e]);(0,a.useEffect)(()=>{d||C()},[C,d]);let T=async e=>{I(e);let t=await g(e);t.error?N(t.error):f(t=>t.filter(t=>t.id!==e)),I(null)},R=function(e){let t=new Map;for(let a of e){let e=t.get(a.relationType)??[];e.push(a),t.set(a.relationType,e)}return Array.from(t.entries()).map(([e,t])=>({type:e,items:t}))}(p);return(0,t.jsxs)("div",{"data-testid":"work-item-relations-panel",className:(0,l.cn)("space-y-3",x),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Relations"}),p.length>0&&(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:p.length})]}),(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-[10px]",onClick:()=>S(!0),"data-testid":"add-relation-btn",children:[(0,t.jsx)(m.Plus,{className:"mr-0.5 h-3 w-3"}),"Add"]})]}),j?(0,t.jsx)("div",{className:"flex items-center justify-center py-4","data-testid":"relations-loading",children:(0,t.jsx)(u.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"})}):null,y?(0,t.jsx)("p",{className:"text-destructive text-[10px]","data-testid":"relations-error",children:y}):null,!j&&0===p.length&&!y&&(0,t.jsx)("p",{className:"text-muted-foreground py-2 text-center text-[10px]","data-testid":"relations-empty",children:"No relations yet."}),!j&&R.length>0&&(0,t.jsx)("div",{className:"space-y-2","data-testid":"relations-list",children:R.map(({type:a,items:l})=>(0,t.jsxs)("div",{"data-testid":`relation-group-${a}`,children:[(0,t.jsx)("span",{className:"text-muted-foreground mb-1 block text-[10px] font-medium",children:w[a]??a}),(0,t.jsx)("div",{className:"space-y-1",children:l.map(a=>{let l,d,o,m;return(0,t.jsxs)("div",{"data-testid":`relation-item-${a.id}`,className:"hover:bg-accent/50 flex items-center gap-2 rounded px-2 py-1 transition-colors",children:[(0,t.jsx)(n.Badge,{variant:"outline",className:"shrink-0 font-mono text-[10px]",children:(l=a.sourceWorkItemId===e?a.targetWorkItemId:a.sourceWorkItemId,(d=s.get(l))?`${i}-${d.sequenceId}`:l.substring(0,8))}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:(o=a.sourceWorkItemId===e?a.targetWorkItemId:a.sourceWorkItemId,m=s.get(o),m?.title??"Unknown item")}),(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"h-5 w-5 shrink-0 p-0",onClick:()=>T(a.id),disabled:D===a.id,"data-testid":`delete-relation-${a.id}`,children:D===a.id?(0,t.jsx)(u.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(c.X,{className:"h-3 w-3"})})]},a.id)})})]},a))}),(0,t.jsx)(k,{open:b,onOpenChange:S,sourceWorkItemId:e,onCreated:e=>{f(t=>[...t,e]),S(!1)}})]})}var D=e.i(976874),I=e.i(958481),C=e.i(405682);let T={Urgent:"bg-red-500/10 text-red-500",High:"bg-orange-500/10 text-orange-500",Medium:"bg-yellow-500/10 text-yellow-500",Low:"bg-blue-500/10 text-blue-500",None:"bg-muted text-muted-foreground"};function R({workItem:e,allWorkItems:s,states:i,projectPrefix:d,projectId:o,currentDepth:c=0,onSubItemClick:u,className:x}){let[p,h]=(0,a.useState)(!1),[g,f]=(0,a.useState)([]),j=new Map(i.map(e=>[e.id,e])),v=[...s.filter(t=>t.parentId===e.id),...g.filter(e=>!s.some(t=>t.id===e.id))],y=c>=2;return(0,t.jsxs)("div",{"data-testid":"sub-items-section",className:(0,l.cn)("space-y-3",x),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(D.Layers,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sub-items"}),v.length>0&&(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:v.length})]}),!y&&(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-[10px]",onClick:()=>h(!0),"data-testid":"add-sub-item-btn",children:[(0,t.jsx)(m.Plus,{className:"mr-0.5 h-3 w-3"}),"Add"]})]}),y?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded bg-yellow-500/10 px-2 py-1.5","data-testid":"max-depth-warning",children:[(0,t.jsx)(I.AlertTriangle,{className:"h-3 w-3 shrink-0 text-yellow-500"}),(0,t.jsxs)("span",{className:"text-[10px] text-yellow-600 dark:text-yellow-400",children:["Maximum nesting depth reached (",3," levels). Cannot add sub-items here."]})]}):null,0===v.length&&!y&&(0,t.jsx)("p",{className:"text-muted-foreground py-2 text-center text-[10px]","data-testid":"sub-items-empty",children:"No sub-items yet."}),v.length>0&&(0,t.jsx)("div",{className:"divide-y rounded-lg border","data-testid":"sub-items-list",children:v.map(e=>{let a=j.get(e.stateId),s=`${d}-${e.sequenceId}`;return(0,t.jsxs)("div",{"data-testid":`sub-item-${s}`,className:"hover:bg-accent/50 flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors",onClick:()=>u?.(e),role:"button",tabIndex:0,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&u?.(e)},children:[(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 font-mono text-[10px]",children:s}),a?(0,t.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:a.color},title:a.name}):null,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs",children:e.title}),e.priority&&"None"!==e.priority?(0,t.jsx)(n.Badge,{variant:"secondary",className:`shrink-0 text-[10px] ${T[e.priority]??""}`,children:e.priority}):null]},e.id)})}),!y&&(0,t.jsx)(C.CreateWorkItemDialog,{open:p,onOpenChange:h,projectId:o,states:i,onCreated:e=>{f(t=>[...t,e]),h(!1)},parentId:e.id})]})}var M=e.i(935946),B=e.i(267669),L=e.i(681181);let A=(0,d.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var z=e.i(57484);let $=(0,p.createServerReference)("40a9884bb7bf3d1f4c772e53e161827d48264a27ec",p.callServer,void 0,p.findSourceMapURL,"deleteAttachment");function W({workItemId:e,attachments:s,className:i}){let[n,d]=(0,a.useState)(s),[o,c]=(0,a.useState)(!1),m=(0,a.useRef)(null),u=(0,a.useCallback)(async t=>{if(t&&0!==t.length){c(!0);try{for(let a of Array.from(t)){let t=new FormData;t.append("file",a),t.append("workItemId",e);let s=await fetch("/api/pm-attachments/upload",{method:"POST",body:t});if(s.ok){let t=await s.json(),a={id:t.id,workItemId:e,filename:t.filename,mimeType:t.mimeType,fileSize:t.fileSize,storagePath:"",createdAt:new Date(t.createdAt),updatedAt:new Date(t.createdAt),deletedAt:void 0};d(e=>[...e,a])}}}finally{c(!1),m.current&&(m.current.value="")}}},[e]),x=(0,a.useCallback)(async e=>{(await $(e)).error||d(t=>t.filter(t=>t.id!==e))},[]),p=(0,a.useCallback)(e=>{window.open(`/api/pm-attachments/download?id=${e}`,"_blank")},[]);return(0,t.jsxs)("div",{"data-testid":"attachment-list",className:(0,l.cn)("space-y-3",i),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.Paperclip,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"text-xs font-medium",children:["Attachments ",n.length>0?`(${String(n.length)})`:""]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("input",{ref:m,type:"file",multiple:!0,className:"hidden",onChange:e=>u(e.target.files),"data-testid":"file-input"}),(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 text-xs",onClick:()=>m.current?.click(),disabled:o,"data-testid":"upload-btn",children:[(0,t.jsx)(A,{className:"h-3 w-3"}),o?"Uploading...":"Upload"]})]})]}),0===n.length?(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No attachments"}):(0,t.jsx)("div",{className:"space-y-1",children:n.map(e=>{var a;return(0,t.jsxs)("div",{"data-testid":`attachment-${e.id}`,className:"group hover:bg-accent/50 flex items-center gap-2 rounded-sm px-2 py-1 text-xs",children:[(0,t.jsx)(z.FileIcon,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:e.filename}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:(a=e.fileSize)<1024?`${String(a)} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}),(0,t.jsxs)("div",{className:"hidden gap-0.5 group-hover:flex",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>p(e.id),title:"Download",children:(0,t.jsx)(L.Download,{className:"h-3 w-3"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-destructive h-5 w-5 p-0",onClick:()=>x(e.id),title:"Delete",children:(0,t.jsx)(B.Trash2,{className:"h-3 w-3"})})]})]},e.id)})})]})}var F=e.i(655016);let P=(0,p.createServerReference)("70572f689e4d6a5358bce13b0e19268347ac3721ca",p.callServer,void 0,p.findSourceMapURL,"logTimeEntry"),U=(0,p.createServerReference)("4097199a2c61a40429a261cbac6bb6b4d3244ebd39",p.callServer,void 0,p.findSourceMapURL,"deleteTimeEntry");function H(e){if(e<60)return`${String(e)}m`;let t=Math.floor(e/60),a=e%60;return a>0?`${String(t)}h ${String(a)}m`:`${String(t)}h`}function V({workItemId:e,timeEntries:s,totalMinutes:i,className:n}){let[d,o]=(0,a.useState)(s),[c,u]=(0,a.useState)(i),[x,p]=(0,a.useState)(!1),[h,g]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[y,N]=(0,a.useState)(""),[b,k]=(0,a.useState)(!1),w=(0,a.useCallback)(async t=>{t.preventDefault();let a=60*(parseInt(h,10)||0)+(parseInt(f,10)||0);if(!(a<=0)){k(!0);try{let t=await P(e,a,y||void 0);t.timeEntry&&(o(e=>[t.timeEntry,...e]),u(e=>e+a),g(""),v(""),N(""),p(!1))}finally{k(!1)}}},[e,h,f,y]),S=(0,a.useCallback)(async(e,t)=>{(await U(e)).error||(o(t=>t.filter(t=>t.id!==e)),u(e=>e-t))},[]);return(0,t.jsxs)("div",{"data-testid":"time-entry-list",className:(0,l.cn)("space-y-3",n),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(F.Clock,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"Time Logged"}),c>0?(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",H(c)," total)"]}):null]}),(0,t.jsxs)(r.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 text-xs",onClick:()=>p(!x),"data-testid":"log-time-btn",children:[(0,t.jsx)(m.Plus,{className:"h-3 w-3"}),"Log Time"]})]}),x?(0,t.jsxs)("form",{onSubmit:w,className:"bg-muted/50 space-y-2 rounded-md border p-2","data-testid":"log-time-form",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(j.Input,{type:"number",min:"0",placeholder:"0",value:h,onChange:e=>g(e.target.value),className:"h-7 w-14 text-xs","data-testid":"hours-input"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:"h"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(j.Input,{type:"number",min:"0",max:"59",placeholder:"0",value:f,onChange:e=>v(e.target.value),className:"h-7 w-14 text-xs","data-testid":"minutes-input"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:"m"})]})]}),(0,t.jsx)(j.Input,{placeholder:"Note (optional)",value:y,onChange:e=>N(e.target.value),className:"h-7 text-xs","data-testid":"note-input"}),(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,t.jsx)(r.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>p(!1),children:"Cancel"}),(0,t.jsx)(r.Button,{type:"submit",size:"sm",className:"h-6 text-xs",disabled:b,"data-testid":"save-time-btn",children:b?"Saving...":"Save"})]})]}):null,0===d.length?(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"No time logged"}):(0,t.jsx)("div",{className:"space-y-1",children:d.map(e=>{var a;return(0,t.jsxs)("div",{"data-testid":`time-entry-${e.id}`,className:"group hover:bg-accent/50 flex items-center gap-2 rounded-sm px-2 py-1 text-xs",children:[(0,t.jsx)(F.Clock,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"font-medium",children:H(e.durationMinutes)}),e.note?(0,t.jsx)("span",{className:"text-muted-foreground flex-1 truncate",children:e.note}):(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:("string"==typeof(a=e.loggedAt)?new Date(a):a).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),(0,t.jsx)("div",{className:"hidden group-hover:flex",children:(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"text-destructive h-5 w-5 p-0",onClick:()=>S(e.id,e.durationMinutes),title:"Delete",children:(0,t.jsx)(B.Trash2,{className:"h-3 w-3"})})})]},e.id)})})]})}let E={Urgent:"bg-red-500/10 text-red-500",High:"bg-orange-500/10 text-orange-500",Medium:"bg-yellow-500/10 text-yellow-500",Low:"bg-blue-500/10 text-blue-500",None:"bg-muted text-muted-foreground"};function q({project:e,workItem:d,allWorkItems:o,states:c,relations:m,attachments:u,timeEntries:x,totalMinutes:p,className:h}){let g=(0,s.useRouter)(),f=new Map(c.map(e=>[e.id,e])),j=(0,a.useMemo)(()=>new Map(o.map(e=>[e.id,e])),[o]),v=f.get(d.stateId),y=`${e.identifierPrefix}-${d.sequenceId}`;return(0,t.jsxs)("div",{"data-testid":"work-item-detail",className:(0,l.cn)("space-y-6",h),children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>g.push(`/projects/${e.slug}`),"data-testid":"back-to-project",children:(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:y}),v?(0,t.jsxs)(n.Badge,{variant:"outline",className:"text-[10px]",children:[(0,t.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full",style:{backgroundColor:v.color}}),v.name]}):null,d.priority&&"None"!==d.priority?(0,t.jsx)(n.Badge,{variant:"secondary",className:(0,l.cn)("text-[10px]",E[d.priority]),children:d.priority}):null]}),(0,t.jsx)("h1",{className:"text-lg font-bold tracking-tight",children:d.title}),d.description?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:d.description}):null]}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium uppercase",children:"Start Date"}),(0,t.jsx)("p",{className:"text-xs",children:d.startDate?new Date(d.startDate).toLocaleDateString():"—"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium uppercase",children:"Due Date"}),(0,t.jsx)("p",{className:"text-xs",children:d.dueDate?new Date(d.dueDate).toLocaleDateString():"—"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium uppercase",children:"Estimate"}),(0,t.jsx)("p",{className:"text-xs",children:d.estimateValue??"—"})]})]}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(R,{workItem:d,allWorkItems:o,states:c,projectPrefix:e.identifierPrefix,projectId:e.id,onSubItemClick:t=>{g.push(`/projects/${e.slug}/items/${t.id}`)}}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(S,{workItemId:d.id,workItemsMap:j,projectPrefix:e.identifierPrefix,initialRelations:m}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(W,{workItemId:d.id,attachments:u}),(0,t.jsx)("hr",{className:"border-border"}),(0,t.jsx)(V,{workItemId:d.id,timeEntries:x,totalMinutes:p})]})}e.s(["WorkItemDetailClient",()=>q],149809)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81846,e=>{"use strict";var t=e.i(679606),r=e.i(294237),a=e.i(131777);let i=(0,r.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function s({className:e,variant:r,...s}){return(0,t.jsx)("div",{className:(0,a.cn)(i({variant:r}),e),...s})}e.s(["Badge",()=>s])},670471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},43416,e=>{"use strict";let t=(0,e.i(903645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],43416)},216868,442076,e=>{"use strict";var t=e.i(943698);async function r(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["PaperclipIcon",()=>t.default],216868),e.s(["pickFiles",()=>r],442076)},951911,e=>{"use strict";var t=e.i(679606),r=e.i(152155),a=e.i(291967),i=e.i(205978),s=e.i(922528),o=e.i(936589),n=e.i(23405),c=e.i(277624),d=e.i(287620),u="Switch",[l,p]=(0,s.createContextScope)(u),[f,h]=l(u),b=r.forwardRef((e,s)=>{let{__scopeSwitch:n,name:c,checked:l,defaultChecked:p,required:h,disabled:b,value:g="on",onCheckedChange:m,form:k,...y}=e,[x,C]=r.useState(null),S=(0,i.useComposedRefs)(s,e=>C(e)),P=r.useRef(!1),R=!x||k||!!x.closest("form"),[j,T]=(0,o.useControllableState)({prop:l,defaultProp:p??!1,onChange:m,caller:u});return(0,t.jsxs)(f,{scope:n,checked:j,disabled:b,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":j,"aria-required":h,"data-state":w(j),"data-disabled":b?"":void 0,disabled:b,value:g,...y,ref:S,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{T(e=>!e),R&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())})}),R&&(0,t.jsx)(v,{control:x,bubbles:!P.current,name:c,value:g,checked:j,required:h,disabled:b,form:k,style:{transform:"translateX(-100%)"}})]})});b.displayName=u;var g="SwitchThumb",m=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...i}=e,s=h(g,a);return(0,t.jsx)(d.Primitive.span,{"data-state":w(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})});m.displayName=g;var v=r.forwardRef(({__scopeSwitch:e,control:a,checked:s,bubbles:o=!0,...d},u)=>{let l=r.useRef(null),p=(0,i.useComposedRefs)(l,u),f=(0,n.usePrevious)(s),h=(0,c.useSize)(a);return r.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==s&&t){let r=new Event("click",{bubbles:o});t.call(e,s),e.dispatchEvent(r)}},[f,s,o]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:p,style:{...d.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function w(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput",e.s(["Root",()=>b,"Switch",()=>b,"SwitchThumb",()=>m,"Thumb",()=>m,"createSwitchScope",()=>p],595291);var k=e.i(595291),k=k,y=e.i(131777);function x({className:e,size:r="default",...a}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,y.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,y.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}e.s(["Switch",()=>x],951911)},915203,e=>{"use strict";var t=e.i(679606),r=e.i(152155),a=e.i(711434),i=e.i(360112),s=e.i(
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81846,e=>{"use strict";var t=e.i(679606),r=e.i(294237),a=e.i(131777);let i=(0,r.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function s({className:e,variant:r,...s}){return(0,t.jsx)("div",{className:(0,a.cn)(i({variant:r}),e),...s})}e.s(["Badge",()=>s])},670471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},43416,e=>{"use strict";let t=(0,e.i(903645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],43416)},216868,442076,e=>{"use strict";var t=e.i(943698);async function r(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["PaperclipIcon",()=>t.default],216868),e.s(["pickFiles",()=>r],442076)},951911,e=>{"use strict";var t=e.i(679606),r=e.i(152155),a=e.i(291967),i=e.i(205978),s=e.i(922528),o=e.i(936589),n=e.i(23405),c=e.i(277624),d=e.i(287620),u="Switch",[l,p]=(0,s.createContextScope)(u),[f,h]=l(u),b=r.forwardRef((e,s)=>{let{__scopeSwitch:n,name:c,checked:l,defaultChecked:p,required:h,disabled:b,value:g="on",onCheckedChange:m,form:k,...y}=e,[x,C]=r.useState(null),S=(0,i.useComposedRefs)(s,e=>C(e)),P=r.useRef(!1),R=!x||k||!!x.closest("form"),[j,T]=(0,o.useControllableState)({prop:l,defaultProp:p??!1,onChange:m,caller:u});return(0,t.jsxs)(f,{scope:n,checked:j,disabled:b,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":j,"aria-required":h,"data-state":w(j),"data-disabled":b?"":void 0,disabled:b,value:g,...y,ref:S,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{T(e=>!e),R&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())})}),R&&(0,t.jsx)(v,{control:x,bubbles:!P.current,name:c,value:g,checked:j,required:h,disabled:b,form:k,style:{transform:"translateX(-100%)"}})]})});b.displayName=u;var g="SwitchThumb",m=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...i}=e,s=h(g,a);return(0,t.jsx)(d.Primitive.span,{"data-state":w(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})});m.displayName=g;var v=r.forwardRef(({__scopeSwitch:e,control:a,checked:s,bubbles:o=!0,...d},u)=>{let l=r.useRef(null),p=(0,i.useComposedRefs)(l,u),f=(0,n.usePrevious)(s),h=(0,c.useSize)(a);return r.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==s&&t){let r=new Event("click",{bubbles:o});t.call(e,s),e.dispatchEvent(r)}},[f,s,o]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:p,style:{...d.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function w(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput",e.s(["Root",()=>b,"Switch",()=>b,"SwitchThumb",()=>m,"Thumb",()=>m,"createSwitchScope",()=>p],595291);var k=e.i(595291),k=k,y=e.i(131777);function x({className:e,size:r="default",...a}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,y.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,y.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}e.s(["Switch",()=>x],951911)},915203,e=>{"use strict";var t=e.i(679606),r=e.i(152155),a=e.i(711434),i=e.i(360112),s=e.i(433227);e.i(34562);var o=e.i(630616);function n({repositoryPath:e,initialParentId:n,initialDescription:c,initialMode:d,features:u,repositories:l,workflowDefaults:p,currentAgentType:f,currentModel:h,canPushDirectly:b}){let g=(0,a.useRouter)(),[m,v]=(0,r.useState)(!1),w=(0,a.usePathname)().startsWith("/create"),k=!m&&w;(0,r.useEffect)(()=>{!w&&m&&v(!1)},[w,m]);let y=(0,r.useCallback)(()=>{g.push("/control-center")},[g]),x=(0,r.useCallback)(e=>{v(!0),g.push("/control-center"),(0,s.createFeature)(e).then(t=>{t.error?i.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{i.toast.error("Failed to create feature"),v(!1)})},[g]);return(0,t.jsx)(o.FeatureCreateDrawer,{open:k,onClose:y,onSubmit:x,repositoryPath:e,features:u,repositories:l,workflowDefaults:p,initialParentId:n,initialDescription:c,initialMode:d,isSubmitting:m,currentAgentType:f,currentModel:h,canPushDirectly:b})}e.s(["CreateDrawerClient",()=>n])}]);
|