@shepai/cli 1.124.0 → 1.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/presentation/web/components/features/settings/notification-settings-section.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/notification-settings-section.js +4 -8
- package/dist/src/presentation/web/components/features/settings/notification-settings-section.stories.js +3 -3
- package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.js +12 -37
- package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.js +2 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- 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/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +28 -28
- 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]/page/server-reference-manifest.json +20 -20
- 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)/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__14664e9b._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56ecbe40._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56ecbe40._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__68c2d48e._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__68c2d48e._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7cbda1ea._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7cbda1ea._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_f84c16ab._.js → _772be40b._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_f84c16ab._.js.map → _772be40b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_0e506641._.js → _918887c5._.js} +2 -2
- package/web/.next/server/chunks/ssr/_918887c5._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_1bb131c4._.js → _d4b20e29._.js} +2 -2
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_d8b3f91f._.js +3 -0
- package/web/.next/server/chunks/ssr/_d8b3f91f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_e9703421._.js +1 -1
- package/web/.next/server/chunks/ssr/_e9703421._.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/src_presentation_web_5f039db1._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_d2912c21._.js +3 -0
- package/web/.next/server/chunks/ssr/{src_presentation_web_164fa933._.js.map → src_presentation_web_d2912c21._.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 +34 -34
- package/web/.next/static/chunks/0158bd913a9f8332.css +1 -0
- package/web/.next/static/chunks/01ba448cf76c6014.js +1 -0
- package/web/.next/static/chunks/{74fa59dbd04fdfcb.js → 03efd55a6de64460.js} +2 -2
- package/web/.next/static/chunks/{9db7f24ddea15a4c.js → 0eb9cffdddfd0bb6.js} +1 -1
- package/web/.next/static/chunks/225092aaa7291166.js +1 -0
- package/web/.next/static/chunks/37ada233462bcaec.js +11 -0
- package/web/.next/static/chunks/{ad076c0b68dd9971.js → 3b6956717a7c4e16.js} +1 -1
- package/web/.next/static/chunks/609a74a7c7084d18.js +1 -0
- package/web/.next/static/chunks/88639a2a92364951.js +1 -0
- package/web/.next/static/chunks/{76c038a9d55ca717.js → 93e492830319fe32.js} +1 -1
- package/web/.next/static/chunks/{9d7e0bb6dc2f88ae.js → 9ff2ffa85c1a522d.js} +1 -1
- package/web/.next/static/chunks/{0dc102ef519487f5.js → ab42606b8d9a837b.js} +1 -1
- package/web/.next/static/chunks/b70dd4985a814b27.js +1 -0
- package/web/.next/static/chunks/{303a1217006489b9.js → cab346230cafc536.js} +1 -1
- package/web/.next/static/chunks/{5b7726ff31c25338.js → ee1b7156e3985766.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4993a47c._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4993a47c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0e506641._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_1bb131c4._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_b89059c0._.js +0 -3
- package/web/.next/server/chunks/ssr/_b89059c0._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_164fa933._.js +0 -3
- package/web/.next/static/chunks/10fc8c2e5ff44bb2.js +0 -1
- package/web/.next/static/chunks/3925626b99dcd57a.css +0 -1
- package/web/.next/static/chunks/ac7251026c1e2cdf.js +0 -1
- package/web/.next/static/chunks/d72044b2826292fe.js +0 -1
- package/web/.next/static/chunks/e2ef95d904c360f3.js +0 -1
- package/web/.next/static/chunks/eaeabda870a35a9a.js +0 -11
- /package/web/.next/static/{Ap_0BUaFHzD8WxrlWsbMg → kV-WQWxVkAheI2w3nsEIN}/_buildManifest.js +0 -0
- /package/web/.next/static/{Ap_0BUaFHzD8WxrlWsbMg → kV-WQWxVkAheI2w3nsEIN}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{Ap_0BUaFHzD8WxrlWsbMg → kV-WQWxVkAheI2w3nsEIN}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let r=(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(["PaperclipIcon",()=>r],16868);var a=e.i(20314),s=e.i(31777);function o({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>o],48306);var i=e.i(60253),n=e.i(15506),n=n,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let p=(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"}]]);var u=e.i(16298),u=u;let h=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:t,mimeType:r,path:o,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",P=x.has(N)?h:".pdf"===N?u.default:f.has(N)?m.default:p,T=".pdf"===N?"bg-red-50 text-red-600":x.has(N)?"bg-blue-50 text-blue-600":f.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&b.has(e.slice(k).toLowerCase());return w?(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,a.jsx)(n.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,a.jsxs)(d.Dialog,{children:[(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)(d.DialogTrigger,{asChild:!0,children:(0,a.jsx)("img",{src:v(o,r),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,a.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,a.jsx)(c.Root,{children:(0,a.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,a.jsx)("div",{className:"relative bg-black/90",children:(0,a.jsx)("img",{src:v(o,r),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,a.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,a.jsx)("a",{href:v(o,r),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,a.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,a.jsx)("div",{className:(0,s.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,a.jsx)(P,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){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(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(T,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":q(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=T;var R="PopoverPortal",[A,E]=v(R,{forceMount:void 0}),F=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};F.displayName=R;var D="PopoverContent",O=r.forwardRef((e,r)=>{let a=E(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(L,{...o,ref:r})})});O.displayName=D;var I=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(M,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(M,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),M=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":q(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function q(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>F,"PopoverTrigger",()=>S,"Portal",()=>F,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var H=e.i(89920),H=H,G=e.i(31777);let _=H.Root,K=H.Trigger;H.Anchor;let W=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(H.Portal,{children:(0,t.jsx)(H.Content,{ref:o,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));W.displayName=H.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>W,"PopoverTrigger",()=>K],90382)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:T,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":v(T),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.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)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.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")})})}e.s(["Switch",()=>y],51911)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(23925),s=e.i(11345),o=e.i(76016),i=e.i(64958),n=e.i(31899),l=e.i(86782),d=e.i(29847),c=e.i(35364),p=e.i(90382),u=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:m,disabled:x,className:f,mode:g}){let[b,v]=r.useState(!1),[j,w]=r.useState([]),[y,C]=r.useState(!0),[k,N]=r.useState(e),[P,T]=r.useState(h),[S,R]=r.useState(null),[A,E]=r.useState(0),[F,D]=r.useState(null);r.useEffect(()=>{(0,i.getAllAgentModels)().then(w).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!b){let e=setTimeout(()=>{E(0),D(null)},150);return()=>clearTimeout(e)}},[b]);let O=async(e,t)=>{if(v(!1),e!==k||t!==P){if("override"===g){N(e),T(t),m?.(e,t);return}N(e),T(t),m?.(e,t),R(null);try{let r=await (0,n.updateAgentAndModel)(e,t||null);r.ok||(N(k),T(P),m?.(k,P),R(r.error??"Failed to save"))}catch{N(k),T(P),m?.(k,P),R("Failed to save")}}},I=(0,l.getAgentTypeIcon)(k),z=j.find(e=>e.agentType===k)?.label??k,L=P?(0,d.getModelMeta)(P).displayName||P:null,M=F?j.find(e=>e.agentType===F):null;return(0,t.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-1",f),children:[(0,t.jsxs)(p.Popover,{open:b,onOpenChange:v,children:[(0,t.jsx)(p.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",role:"combobox","aria-expanded":b,disabled:(x??!1)||y,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(I,{className:"h-4 w-4 shrink-0"}),y?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:L})]}):null]})]})})}),(0,t.jsx)(p.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===A?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),j.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),s=k===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>{i?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>E(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),s&&!i?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(o.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{E(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(s.ChevronLeft,{className:"h-3.5 w-3.5"}),M.label]}),M.models.map(e=>{let r=k===M.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(M.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!S&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}e.s(["AgentModelPicker",()=>h])},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("402c6eebcee9191f10700c4a1b10e4c085abc4e1b5",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868);let l=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428),m=e.i(31777),x=e.i(8361);e.i(1650);var f=e.i(11495),g=e.i(45811),b=e.i(35364),v=e.i(98127),j=e.i(48306),w=e.i(41957),y=e.i(81846),C=e.i(90382),k=e.i(51911),N=e.i(2828),P=e.i(30153);e.i(50032);var T=e.i(86254),S=e.i(41413),R=e.i(25235),A=e.i(78521),E=e.i(83095),F=e.i(42076);let D=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"]),O=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],I={allowPrd:!1,allowPlan:!1,allowMerge:!1};function z({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:v,currentModel:C,initialDescription:R}){let A=(0,x.useSoundAction)("create"),E=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",z=l?.approvalGates??I,U=l?.push??!1,B=l?.openPr??!1,$=l?.ciWatchEnabled!==!1,q=l?.enableEvidence??!1,H=l?.commitEvidence??!1,[G,_]=(0,r.useState)(R??"");(0,r.useEffect)(()=>{R&&_(R)},[R]);let[K,W]=(0,r.useState)([]),[V,X]=(0,r.useState)({...z}),[Y,Z]=(0,r.useState)(U),[J,Q]=(0,r.useState)(B),[ee,et]=(0,r.useState)(l?.ciWatchEnabled!==!1),[er,ea]=(0,r.useState)(q),[es,eo]=(0,r.useState)(H),[ei,en]=(0,r.useState)(void 0),[el,ed]=(0,r.useState)(!1),[ec,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(void 0),[em,ex]=(0,r.useState)(void 0),[ef,eg]=(0,r.useState)(E||void 0),[eb,ev]=(0,r.useState)(u??[]),[ej,ew]=(0,r.useState)(!1),[ey,eC]=(0,r.useState)(null),[ek,eN]=(0,r.useState)(!1),eP=(0,r.useRef)(crypto.randomUUID()),eT=(0,r.useRef)(0),eS=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(X({...l.approvalGates}),Z(l.push),Q(l.openPr),et(!1!==l.ciWatchEnabled),ea(l.enableEvidence),eo(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{ev(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&en(h)},[e,h]);let eR=(0,r.useCallback)(()=>{_(""),W([]),X({...z}),Z(U),Q(B),et($),ea(q),eo(H),en(void 0),eg(E||void 0),ev(u??[]),ed(!1),ep(!1),eh(void 0),ex(void 0),eC(null),eT.current=0,ew(!1)},[z,U,B,q,$,H,E,u]),eA=""!==G.trim()||K.length>0,{attemptClose:eE}=(0,P.useGuardedDrawerClose)({open:e,isDirty:eA,onClose:a,onReset:eR}),eF=(0,r.useCallback)(async e=>{for(let t of(eC(null),e)){if(t.size>0xa00000)return void eC(`"${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&&!D.has(e))return void eC(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();W(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",eP.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let s=await a.json();W(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{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current+=1,1===eT.current&&ew(!0)},[]),eO=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current-=1,0===eT.current&&ew(!1)},[]),eI=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),ez=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current=0,ew(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eF(t)},[eF]),eL=(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(),eF(r))},[eF]),eM=(0,r.useCallback)(e=>{if(e.preventDefault(),!G.trim())return;let t=ef??E;t&&(A.play(),s({description:G.trim(),attachments:K.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:V.allowPrd??!1,allowPlan:V.allowPlan??!1,allowMerge:V.allowMerge??!1},push:Y||J,openPr:J,ciWatchEnabled:ee,enableEvidence:er,commitEvidence:es,fast:el,...ec?{pending:ec}:{},...eu?{agentType:eu}:{},...em?{model:em}:{},...ei?{parentId:ei}:{},sessionId:eP.current}),eR())},[G,K,V,ef,E,s,Y,J,er,ee,es,el,ec,eu,em,ei,A,eR]),eU=(0,r.useCallback)(async()=>{try{let e=await (0,F.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();W(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:eP.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let a=await r.json();W(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{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}}catch{}},[]),eB=(0,r.useCallback)(e=>{W(t=>t.filter(t=>t.id!==e))},[]),e$=(0,r.useRef)(null),eq=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e$.current?.requestSubmit())},[]),eH=(0,r.useCallback)(()=>{eN(!0)},[]),eG=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eS.current?.contains(document.activeElement),t=eS.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eN(!1)},0)},[]),e_=d&&d.length>0,eK=!E&&!ef,eW=!E&&void 0!==u;return(0,t.jsx)(f.BaseDrawer,{open:e,onClose:eE,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)(g.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(g.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(y.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(b.Button,{variant:"outline",onClick:eE,disabled:i,children:"Cancel"}),(0,t.jsx)(b.Button,{type:"submit",form:"create-feature-form",disabled:!G.trim()||i||eK,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(N.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e$,id:"create-feature-form",onSubmit:eM,onKeyDown:eq,className:"flex flex-col gap-4",children:[eW?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(M,{repositories:eb,value:ef,onChange:eg,onAddRepository:e=>{ev(t=>[...t,e]),eg(e.path)},disabled:i})]}):E?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===E)?.name??E.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ej?"true":"false",onDragEnter:eD,onDragLeave:eO,onDragOver:eI,onDrop:ez,className:(0,m.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ej&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(w.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eS,onFocus:eH,onBlur:eG,className:(0,m.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",ek&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(j.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:G,onChange:e=>_(e.target.value),onPaste:eL,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),K.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:K.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eB(e.id),disabled:i,loading:e.loading},e.id))}),ey?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:ey}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(S.AgentModelPicker,{initialAgentType:eu??v??"claude-code",initialModel:em??C??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{eh(e),ex(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"pending-mode",checked:ec,onCheckedChange:ep,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"fast-mode",checked:el,onCheckedChange:ed,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eU,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e_&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(w.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(L,{features:d,value:ei,onChange:en,disabled:i})]}):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)(N.Tooltip,{children:[(0,t.jsx)(N.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:"APPROVE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:O.map(e=>(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:`approve-${e.id}`,size:"sm",checked:V[e.id]??!1,onCheckedChange:t=>X(r=>({...r,[e.id]:t})),disabled:i||el&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(w.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:el&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=O.every(e=>V[e.id]),t={};for(let r of O)t[r.id]=!e;X(t)},disabled:i,className:(0,m.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",O.every(e=>V[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.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:"EVIDENCE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"enable-evidence",size:"sm",checked:er,onCheckedChange:e=>{ea(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"commit-evidence",size:"sm",checked:es,onCheckedChange:eo,disabled:i||!er||!J}),(0,t.jsx)(w.Label,{htmlFor:"commit-evidence",className:(0,m.cn)("cursor-pointer text-xs font-medium",(!er||!J)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:J?er?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"push",size:"sm",checked:Y||J,onCheckedChange:e=>{Z(e),!e&&J&&Q(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"open-pr",size:"sm",checked:J,onCheckedChange:e=>{Q(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"ci-watch",size:"sm",checked:ee,onCheckedChange:et,disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]})]})]})]})]})})})})}function L({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),x=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,f=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(C.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,m.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",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.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)(v.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(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===a,onClick:()=>f(void 0),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===x.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):x.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",a!==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 M({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,x]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),[b,j]=(0,r.useState)(null),w=(0,r.useRef)(null),y=e.find(e=>e.path===a),k=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,N=(0,r.useCallback)(e=>{s(e),c(!1),x("")},[s]),P=(0,r.useCallback)(async()=>{if(!f){g(!0),j(null);try{let e=await (0,A.pickFolder)();if(!e)return void g(!1);let t=await (0,E.addRepository)({path:e});if(t.error){j(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),x("")}}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[f,o,s]);return(0,r.useEffect)(()=>{n?setTimeout(()=>w.current?.focus(),0):x("")},[n]),(0,t.jsxs)(C.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,m.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",!y&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:y?y.name:"Select repository..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.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)(v.Input,{ref:w,placeholder:"Search repositories...",value:p,onChange:e=>x(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===k.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):k.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>N(e.path),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(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:P,disabled:f,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:[f?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]})}function U({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u}){let h=(0,a.useRouter)(),[m,x]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),g=!m&&f;(0,r.useEffect)(()=>{!f&&m&&x(!1)},[f,m]);let b=(0,r.useCallback)(()=>{h.push("/")},[h]),v=(0,r.useCallback)(e=>{x(!0),h.push("/"),i(e).then(t=>{t.error?s.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(()=>{s.toast.error("Failed to create feature"),x(!1)})},[h]);return(0,t.jsx)(z,{open:g,onClose:b,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:m,currentAgentType:p,currentModel:u})}e.s(["CreateDrawerClient",()=>U],15203)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let r=(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(["PaperclipIcon",()=>r],16868);var a=e.i(20314),s=e.i(31777);function o({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>o],48306);var i=e.i(60253),n=e.i(15506),n=n,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let p=(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"}]]);var u=e.i(16298),u=u;let h=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:t,mimeType:r,path:o,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",P=x.has(N)?h:".pdf"===N?u.default:f.has(N)?m.default:p,T=".pdf"===N?"bg-red-50 text-red-600":x.has(N)?"bg-blue-50 text-blue-600":f.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&b.has(e.slice(k).toLowerCase());return w?(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,a.jsx)(n.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,a.jsxs)(d.Dialog,{children:[(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)(d.DialogTrigger,{asChild:!0,children:(0,a.jsx)("img",{src:v(o,r),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,a.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,a.jsx)(c.Root,{children:(0,a.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,a.jsx)("div",{className:"relative bg-black/90",children:(0,a.jsx)("img",{src:v(o,r),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,a.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,a.jsx)("a",{href:v(o,r),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,a.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,a.jsx)("div",{className:(0,s.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,a.jsx)(P,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){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(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(T,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":q(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=T;var R="PopoverPortal",[A,E]=v(R,{forceMount:void 0}),F=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};F.displayName=R;var D="PopoverContent",O=r.forwardRef((e,r)=>{let a=E(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(L,{...o,ref:r})})});O.displayName=D;var I=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(M,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(M,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),M=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":q(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function q(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>F,"PopoverTrigger",()=>S,"Portal",()=>F,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var H=e.i(89920),H=H,G=e.i(31777);let _=H.Root,K=H.Trigger;H.Anchor;let W=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(H.Portal,{children:(0,t.jsx)(H.Content,{ref:o,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));W.displayName=H.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>W,"PopoverTrigger",()=>K],90382)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:T,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":v(T),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.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)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.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")})})}e.s(["Switch",()=>y],51911)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(23925),s=e.i(11345),o=e.i(76016),i=e.i(64923),n=e.i(35298),l=e.i(86782),d=e.i(29847),c=e.i(35364),p=e.i(90382),u=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:m,disabled:x,className:f,mode:g}){let[b,v]=r.useState(!1),[j,w]=r.useState([]),[y,C]=r.useState(!0),[k,N]=r.useState(e),[P,T]=r.useState(h),[S,R]=r.useState(null),[A,E]=r.useState(0),[F,D]=r.useState(null);r.useEffect(()=>{(0,i.getAllAgentModels)().then(w).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!b){let e=setTimeout(()=>{E(0),D(null)},150);return()=>clearTimeout(e)}},[b]);let O=async(e,t)=>{if(v(!1),e!==k||t!==P){if("override"===g){N(e),T(t),m?.(e,t);return}N(e),T(t),m?.(e,t),R(null);try{let r=await (0,n.updateAgentAndModel)(e,t||null);r.ok||(N(k),T(P),m?.(k,P),R(r.error??"Failed to save"))}catch{N(k),T(P),m?.(k,P),R("Failed to save")}}},I=(0,l.getAgentTypeIcon)(k),z=j.find(e=>e.agentType===k)?.label??k,L=P?(0,d.getModelMeta)(P).displayName||P:null,M=F?j.find(e=>e.agentType===F):null;return(0,t.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-1",f),children:[(0,t.jsxs)(p.Popover,{open:b,onOpenChange:v,children:[(0,t.jsx)(p.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",role:"combobox","aria-expanded":b,disabled:(x??!1)||y,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(I,{className:"h-4 w-4 shrink-0"}),y?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:L})]}):null]})]})})}),(0,t.jsx)(p.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===A?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),j.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),s=k===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>{i?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>E(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),s&&!i?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(o.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{E(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(s.ChevronLeft,{className:"h-3.5 w-3.5"}),M.label]}),M.models.map(e=>{let r=k===M.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(M.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!S&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}e.s(["AgentModelPicker",()=>h])},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("40d89ed4a611edca81abc66e2f5a10210d5dc24fcc",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868);let l=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428),m=e.i(31777),x=e.i(8361);e.i(1650);var f=e.i(11495),g=e.i(45811),b=e.i(35364),v=e.i(98127),j=e.i(48306),w=e.i(41957),y=e.i(81846),C=e.i(90382),k=e.i(51911),N=e.i(2828),P=e.i(30153);e.i(50032);var T=e.i(86254),S=e.i(41413),R=e.i(25235),A=e.i(78521),E=e.i(17733),F=e.i(42076);let D=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"]),O=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],I={allowPrd:!1,allowPlan:!1,allowMerge:!1};function z({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:v,currentModel:C,initialDescription:R}){let A=(0,x.useSoundAction)("create"),E=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",z=l?.approvalGates??I,U=l?.push??!1,B=l?.openPr??!1,$=l?.ciWatchEnabled!==!1,q=l?.enableEvidence??!1,H=l?.commitEvidence??!1,[G,_]=(0,r.useState)(R??"");(0,r.useEffect)(()=>{R&&_(R)},[R]);let[K,W]=(0,r.useState)([]),[V,X]=(0,r.useState)({...z}),[Y,Z]=(0,r.useState)(U),[J,Q]=(0,r.useState)(B),[ee,et]=(0,r.useState)(l?.ciWatchEnabled!==!1),[er,ea]=(0,r.useState)(q),[es,eo]=(0,r.useState)(H),[ei,en]=(0,r.useState)(void 0),[el,ed]=(0,r.useState)(!1),[ec,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(void 0),[em,ex]=(0,r.useState)(void 0),[ef,eg]=(0,r.useState)(E||void 0),[eb,ev]=(0,r.useState)(u??[]),[ej,ew]=(0,r.useState)(!1),[ey,eC]=(0,r.useState)(null),[ek,eN]=(0,r.useState)(!1),eP=(0,r.useRef)(crypto.randomUUID()),eT=(0,r.useRef)(0),eS=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(X({...l.approvalGates}),Z(l.push),Q(l.openPr),et(!1!==l.ciWatchEnabled),ea(l.enableEvidence),eo(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{ev(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&en(h)},[e,h]);let eR=(0,r.useCallback)(()=>{_(""),W([]),X({...z}),Z(U),Q(B),et($),ea(q),eo(H),en(void 0),eg(E||void 0),ev(u??[]),ed(!1),ep(!1),eh(void 0),ex(void 0),eC(null),eT.current=0,ew(!1)},[z,U,B,q,$,H,E,u]),eA=""!==G.trim()||K.length>0,{attemptClose:eE}=(0,P.useGuardedDrawerClose)({open:e,isDirty:eA,onClose:a,onReset:eR}),eF=(0,r.useCallback)(async e=>{for(let t of(eC(null),e)){if(t.size>0xa00000)return void eC(`"${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&&!D.has(e))return void eC(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();W(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",eP.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let s=await a.json();W(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{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}},[]),eD=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current+=1,1===eT.current&&ew(!0)},[]),eO=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current-=1,0===eT.current&&ew(!1)},[]),eI=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),ez=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eT.current=0,ew(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eF(t)},[eF]),eL=(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(),eF(r))},[eF]),eM=(0,r.useCallback)(e=>{if(e.preventDefault(),!G.trim())return;let t=ef??E;t&&(A.play(),s({description:G.trim(),attachments:K.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:V.allowPrd??!1,allowPlan:V.allowPlan??!1,allowMerge:V.allowMerge??!1},push:Y||J,openPr:J,ciWatchEnabled:ee,enableEvidence:er,commitEvidence:es,fast:el,...ec?{pending:ec}:{},...eu?{agentType:eu}:{},...em?{model:em}:{},...ei?{parentId:ei}:{},sessionId:eP.current}),eR())},[G,K,V,ef,E,s,Y,J,er,ee,es,el,ec,eu,em,ei,A,eR]),eU=(0,r.useCallback)(async()=>{try{let e=await (0,F.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();W(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:eP.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));W(t=>t.filter(t=>t.id!==e)),eC(t.error??"Upload failed");return}let a=await r.json();W(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{W(t=>t.filter(t=>t.id!==e)),eC("Upload failed")}}}catch{}},[]),eB=(0,r.useCallback)(e=>{W(t=>t.filter(t=>t.id!==e))},[]),e$=(0,r.useRef)(null),eq=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e$.current?.requestSubmit())},[]),eH=(0,r.useCallback)(()=>{eN(!0)},[]),eG=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eS.current?.contains(document.activeElement),t=eS.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eN(!1)},0)},[]),e_=d&&d.length>0,eK=!E&&!ef,eW=!E&&void 0!==u;return(0,t.jsx)(f.BaseDrawer,{open:e,onClose:eE,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)(g.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(g.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(y.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(b.Button,{variant:"outline",onClick:eE,disabled:i,children:"Cancel"}),(0,t.jsx)(b.Button,{type:"submit",form:"create-feature-form",disabled:!G.trim()||i||eK,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(N.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e$,id:"create-feature-form",onSubmit:eM,onKeyDown:eq,className:"flex flex-col gap-4",children:[eW?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(M,{repositories:eb,value:ef,onChange:eg,onAddRepository:e=>{ev(t=>[...t,e]),eg(e.path)},disabled:i})]}):E?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(w.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===E)?.name??E.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ej?"true":"false",onDragEnter:eD,onDragLeave:eO,onDragOver:eI,onDrop:ez,className:(0,m.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ej&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(w.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eS,onFocus:eH,onBlur:eG,className:(0,m.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",ek&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(j.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:G,onChange:e=>_(e.target.value),onPaste:eL,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),K.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:K.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eB(e.id),disabled:i,loading:e.loading},e.id))}),ey?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:ey}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(S.AgentModelPicker,{initialAgentType:eu??v??"claude-code",initialModel:em??C??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{eh(e),ex(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"pending-mode",checked:ec,onCheckedChange:ep,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(k.Switch,{id:"fast-mode",checked:el,onCheckedChange:ed,disabled:i}),(0,t.jsxs)(w.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eU,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e_&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(w.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(L,{features:d,value:ei,onChange:en,disabled:i})]}):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)(N.Tooltip,{children:[(0,t.jsx)(N.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:"APPROVE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:O.map(e=>(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:`approve-${e.id}`,size:"sm",checked:V[e.id]??!1,onCheckedChange:t=>X(r=>({...r,[e.id]:t})),disabled:i||el&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(w.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:el&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=O.every(e=>V[e.id]),t={};for(let r of O)t[r.id]=!e;X(t)},disabled:i,className:(0,m.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",O.every(e=>V[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.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:"EVIDENCE"})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"enable-evidence",size:"sm",checked:er,onCheckedChange:e=>{ea(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"commit-evidence",size:"sm",checked:es,onCheckedChange:eo,disabled:i||!er||!J}),(0,t.jsx)(w.Label,{htmlFor:"commit-evidence",className:(0,m.cn)("cursor-pointer text-xs font-medium",(!er||!J)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:J?er?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"push",size:"sm",checked:Y||J,onCheckedChange:e=>{Z(e),!e&&J&&Q(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"open-pr",size:"sm",checked:J,onCheckedChange:e=>{Q(e),e||eo(!1)},disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]}),(0,t.jsxs)(N.Tooltip,{children:[(0,t.jsx)(N.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(k.Switch,{id:"ci-watch",size:"sm",checked:ee,onCheckedChange:et,disabled:i}),(0,t.jsx)(w.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(N.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]})]})]})]})]})})})})}function L({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),x=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,f=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(C.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,m.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",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.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)(v.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(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===a,onClick:()=>f(void 0),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===x.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):x.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",a!==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 M({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,x]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),[b,j]=(0,r.useState)(null),w=(0,r.useRef)(null),y=e.find(e=>e.path===a),k=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,N=(0,r.useCallback)(e=>{s(e),c(!1),x("")},[s]),P=(0,r.useCallback)(async()=>{if(!f){g(!0),j(null);try{let e=await (0,A.pickFolder)();if(!e)return void g(!1);let t=await (0,E.addRepository)({path:e});if(t.error){j(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),x("")}}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[f,o,s]);return(0,r.useEffect)(()=>{n?setTimeout(()=>w.current?.focus(),0):x("")},[n]),(0,t.jsxs)(C.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(C.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,m.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",!y&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:y?y.name:"Select repository..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(C.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)(v.Input,{ref:w,placeholder:"Search repositories...",value:p,onChange:e=>x(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===k.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):k.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>N(e.path),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(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:P,disabled:f,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:[f?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]})}function U({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u}){let h=(0,a.useRouter)(),[m,x]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),g=!m&&f;(0,r.useEffect)(()=>{!f&&m&&x(!1)},[f,m]);let b=(0,r.useCallback)(()=>{h.push("/")},[h]),v=(0,r.useCallback)(e=>{x(!0),h.push("/"),i(e).then(t=>{t.error?s.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(()=>{s.toast.error("Failed to create feature"),x(!1)})},[h]);return(0,t.jsx)(z,{open:g,onClose:b,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:m,currentAgentType:p,currentModel:u})}e.s(["CreateDrawerClient",()=>U],15203)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58860,44229,e=>{"use strict";let t=(0,e.i(3645).default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);e.s(["Timer",()=>t],58860);var r=e.i(93752);e.s(["Code",()=>r.default],44229)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));c.displayName=i.Root.displayName,e.s(["Label",()=>c],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[c,d]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",f=(0,o.createSlot)(p),h=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=d(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(f,{ref:a,children:o})});h.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),c=(0,s.useComposedRefs)(r,l),u=d(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:c,children:n})});return g.displayName=m,[{Provider:u,Slot:h,ItemSlot:g},function(r){let s=d(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=c(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=c(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<d;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},64923,35298,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00e3a915fe3a467f43581dcc3ed28b6c860ee0ef43",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],64923);let s=(0,t.createServerReference)("60f988eedc025ce6e8ae5e09c797e998dc6807ba6c",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],35298)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,i.createContextScope)(d),[f,h]=u(d),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:h,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,C]=r.useState(null),R=(0,o.useComposedRefs)(i,e=>C(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(f,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":h,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:R,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:h,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=h(v,s);return(0,t.jsx)(c.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...c},d)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,d),f=(0,a.usePrevious)(i),h=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[f,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:p,style:{...c.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.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),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.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")})})}e.s(["Switch",()=>w],51911)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),f=e.i(87620),h=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[d.createPopperScope]),b=(0,d.createPopperScope)(),[w,C]=y(g),R=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[f,h]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:f,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:l,children:o})})};R.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=C(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=C(A,i),l=b(i),c=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(f.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:c,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,T]=y(S,{forceMount:void 0}),O=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=C(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};O.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=T(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=C(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(q,{...i,ref:r})})});E.displayName=z;var F=(0,h.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=C(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),c=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,s)=>{let o=C(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(I,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...v}=e,x=C(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(L,o);return(0,t.jsx)(f.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(d.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>R,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>O,"PopoverTrigger",()=>N,"Portal",()=>O,"Root",()=>R,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let G=U.Root,X=U.Trigger;U.Anchor;let $=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));$.displayName=U.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>$,"PopoverTrigger",()=>X],90382)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(23925),o=e.i(11345),i=e.i(76016),n=e.i(64923),a=e.i(35298),l=e.i(86782),c=e.i(29847),d=e.i(35364),u=e.i(90382),p=e.i(31777);function f({initialAgentType:e,initialModel:f,onAgentModelChange:h,disabled:m,className:v,mode:x}){let[g,y]=r.useState(!1),[k,b]=r.useState([]),[w,C]=r.useState(!0),[R,j]=r.useState(e),[P,A]=r.useState(f),[N,S]=r.useState(null),[M,T]=r.useState(0),[O,z]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(b).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!g){let e=setTimeout(()=>{T(0),z(null)},150);return()=>clearTimeout(e)}},[g]);let E=async(e,t)=>{if(y(!1),e!==R||t!==P){if("override"===x){j(e),A(t),h?.(e,t);return}j(e),A(t),h?.(e,t),S(null);try{let r=await (0,a.updateAgentAndModel)(e,t||null);r.ok||(j(R),A(P),h?.(R,P),S(r.error??"Failed to save"))}catch{j(R),A(P),h?.(R,P),S("Failed to save")}}},F=(0,l.getAgentTypeIcon)(R),D=k.find(e=>e.agentType===R)?.label??R,q=P?(0,c.getModelMeta)(P).displayName||P:null,I=O?k.find(e=>e.agentType===O):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",v),children:[(0,t.jsxs)(u.Popover,{open:g,onOpenChange:y,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",role:"combobox","aria-expanded":g,disabled:(m??!1)||w,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),w?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:q})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===M?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=R===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>T(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(i.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{T(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),I.label]}),I.models.map(e=>{let r=R===I.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(I.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!N&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:N})]})}e.s(["AgentModelPicker",()=>f])}]);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25235,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(87620),n="horizontal",a=["horizontal","vertical"],i=r.forwardRef((e,r)=>{var i;let{decorative:l,orientation:s=n,...u}=e,c=(i=s,a.includes(i))?s:n;return(0,t.jsx)(o.Primitive.div,{"data-orientation":c,...l?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...u,ref:r})});i.displayName="Separator",e.s(["Root",()=>i,"Separator",()=>i],47402);var l=e.i(47402),l=l,s=e.i(31777);function u({className:e,orientation:r="horizontal",decorative:o=!0,...n}){return(0,t.jsx)(l.Root,{"data-slot":"separator",decorative:o,orientation:r,className:(0,s.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}e.s(["Separator",()=>u],25235)},90537,e=>{"use strict";let t=(0,e.i(3645).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},48249,e=>{"use strict";var t=e.i(90537);e.s(["XIcon",()=>t.default])},567,e=>{"use strict";var t=e.i(79054),r=e.i(91967),o=e.i(5978),n=e.i(22528),a=e.i(13123),i=e.i(36589),l=e.i(53532),s=e.i(56720),u=e.i(39979),c=e.i(85995),d=e.i(87620),p=e.i(41687),f=e.i(13044),g=e.i(73772),m=e.i(86874),v=e.i(20314),x="Dialog",[h,y]=(0,n.createContextScope)(x),[C,b]=h(x),w=e=>{let{__scopeDialog:r,children:o,open:n,defaultOpen:l,onOpenChange:s,modal:u=!0}=e,c=t.useRef(null),d=t.useRef(null),[p,f]=(0,i.useControllableState)({prop:n,defaultProp:l??!1,onChange:s,caller:x});return(0,v.jsx)(C,{scope:r,triggerRef:c,contentRef:d,contentId:(0,a.useId)(),titleId:(0,a.useId)(),descriptionId:(0,a.useId)(),open:p,onOpenChange:f,onOpenToggle:t.useCallback(()=>f(e=>!e),[f]),modal:u,children:o})};w.displayName=x;var D="DialogTrigger",j=t.forwardRef((e,t)=>{let{__scopeDialog:n,...a}=e,i=b(D,n),l=(0,o.useComposedRefs)(t,i.triggerRef);return(0,v.jsx)(d.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":U(i.open),...a,ref:l,onClick:(0,r.composeEventHandlers)(e.onClick,i.onOpenToggle)})});j.displayName=D;var R="DialogPortal",[T,A]=h(R,{forceMount:void 0}),E=e=>{let{__scopeDialog:r,forceMount:o,children:n,container:a}=e,i=b(R,r);return(0,v.jsx)(T,{scope:r,forceMount:o,children:t.Children.map(n,e=>(0,v.jsx)(c.Presence,{present:o||i.open,children:(0,v.jsx)(u.Portal,{asChild:!0,container:a,children:e})}))})};E.displayName=R;var P="DialogOverlay",k=t.forwardRef((e,t)=>{let r=A(P,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,a=b(P,e.__scopeDialog);return a.modal?(0,v.jsx)(c.Presence,{present:o||a.open,children:(0,v.jsx)(_,{...n,ref:t})}):null});k.displayName=P;var N=(0,m.createSlot)("DialogOverlay.RemoveScroll"),_=t.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=b(P,r);return(0,v.jsx)(f.RemoveScroll,{as:N,allowPinchZoom:!0,shards:[n.contentRef],children:(0,v.jsx)(d.Primitive.div,{"data-state":U(n.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),O="DialogContent",I=t.forwardRef((e,t)=>{let r=A(O,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,a=b(O,e.__scopeDialog);return(0,v.jsx)(c.Presence,{present:o||a.open,children:a.modal?(0,v.jsx)(S,{...n,ref:t}):(0,v.jsx)(F,{...n,ref:t})})});I.displayName=O;var S=t.forwardRef((e,n)=>{let a=b(O,e.__scopeDialog),i=t.useRef(null),l=(0,o.useComposedRefs)(n,a.contentRef,i);return t.useEffect(()=>{let e=i.current;if(e)return(0,g.hideOthers)(e)},[]),(0,v.jsx)(z,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),F=t.forwardRef((e,r)=>{let o=b(O,e.__scopeDialog),n=t.useRef(!1),a=t.useRef(!1);return(0,v.jsx)(z,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||o.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),z=t.forwardRef((e,r)=>{let{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:u,...c}=e,d=b(O,n),f=t.useRef(null),g=(0,o.useComposedRefs)(r,f);return(0,p.useFocusGuards)(),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:u,children:(0,v.jsx)(l.DismissableLayer,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":U(d.open),...c,ref:g,onDismiss:()=>d.onOpenChange(!1)})}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Y,{titleId:d.titleId}),(0,v.jsx)(q,{contentRef:f,descriptionId:d.descriptionId})]})]})}),L="DialogTitle",M=t.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=b(L,r);return(0,v.jsx)(d.Primitive.h2,{id:n.titleId,...o,ref:t})});M.displayName=L;var H="DialogDescription",B=t.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=b(H,r);return(0,v.jsx)(d.Primitive.p,{id:n.descriptionId,...o,ref:t})});B.displayName=H;var $="DialogClose",G=t.forwardRef((e,t)=>{let{__scopeDialog:o,...n}=e,a=b($,o);return(0,v.jsx)(d.Primitive.button,{type:"button",...n,ref:t,onClick:(0,r.composeEventHandlers)(e.onClick,()=>a.onOpenChange(!1))})});function U(e){return e?"open":"closed"}G.displayName=$;var W="DialogTitleWarning",[X,K]=(0,n.createContext)(W,{contentName:O,titleName:L,docsSlug:"dialog"}),Y=({titleId:e})=>{let r=K(W),o=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return t.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},q=({contentRef:e,descriptionId:r})=>{let o=K("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${o.contentName}}.`;return t.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");r&&t&&(document.getElementById(r)||console.warn(n))},[n,e,r]),null};e.s(["Close",()=>G,"Content",()=>I,"Description",()=>B,"Dialog",()=>w,"DialogClose",()=>G,"DialogContent",()=>I,"DialogDescription",()=>B,"DialogOverlay",()=>k,"DialogPortal",()=>E,"DialogTitle",()=>M,"DialogTrigger",()=>j,"Overlay",()=>k,"Portal",()=>E,"Root",()=>w,"Title",()=>M,"Trigger",()=>j,"WarningProvider",()=>X,"createDialogScope",()=>y])},90033,e=>{"use strict";var t=e.i(567);e.s(["Dialog",0,t])},2828,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(91967),n=e.i(5978),a=e.i(22528),i=e.i(53532),l=e.i(13123),s=e.i(52740),u=e.i(39979),c=e.i(85995),d=e.i(87620),p=e.i(86874),f=e.i(36589),g=e.i(1693),[m,v]=(0,a.createContextScope)("Tooltip",[s.createPopperScope]),x=(0,s.createPopperScope)(),h="TooltipProvider",y="tooltip.open",[C,b]=m(h),w=e=>{let{__scopeTooltip:o,delayDuration:n=700,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:l}=e,s=r.useRef(!0),u=r.useRef(!1),c=r.useRef(0);return r.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,t.jsx)(C,{scope:o,isOpenDelayedRef:s,delayDuration:n,onOpen:r.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:r.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,a)},[a]),isPointerInTransitRef:u,onPointerInTransitChange:r.useCallback(e=>{u.current=e},[]),disableHoverableContent:i,children:l})};w.displayName=h;var D="Tooltip",[j,R]=m(D),T=e=>{let{__scopeTooltip:o,children:n,open:a,defaultOpen:i,onOpenChange:u,disableHoverableContent:c,delayDuration:d}=e,p=b(D,e.__scopeTooltip),g=x(o),[m,v]=r.useState(null),h=(0,l.useId)(),C=r.useRef(0),w=c??p.disableHoverableContent,R=d??p.delayDuration,T=r.useRef(!1),[A,E]=(0,f.useControllableState)({prop:a,defaultProp:i??!1,onChange:e=>{e?(p.onOpen(),document.dispatchEvent(new CustomEvent(y))):p.onClose(),u?.(e)},caller:D}),P=r.useMemo(()=>A?T.current?"delayed-open":"instant-open":"closed",[A]),k=r.useCallback(()=>{window.clearTimeout(C.current),C.current=0,T.current=!1,E(!0)},[E]),N=r.useCallback(()=>{window.clearTimeout(C.current),C.current=0,E(!1)},[E]),_=r.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{T.current=!0,E(!0),C.current=0},R)},[R,E]);return r.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]),(0,t.jsx)(s.Root,{...g,children:(0,t.jsx)(j,{scope:o,contentId:h,open:A,stateAttribute:P,trigger:m,onTriggerChange:v,onTriggerEnter:r.useCallback(()=>{p.isOpenDelayedRef.current?_():k()},[p.isOpenDelayedRef,_,k]),onTriggerLeave:r.useCallback(()=>{w?N():(window.clearTimeout(C.current),C.current=0)},[N,w]),onOpen:k,onClose:N,disableHoverableContent:w,children:n})})};T.displayName=D;var A="TooltipTrigger",E=r.forwardRef((e,a)=>{let{__scopeTooltip:i,...l}=e,u=R(A,i),c=b(A,i),p=x(i),f=r.useRef(null),g=(0,n.useComposedRefs)(a,f,u.onTriggerChange),m=r.useRef(!1),v=r.useRef(!1),h=r.useCallback(()=>m.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),(0,t.jsx)(s.Anchor,{asChild:!0,...p,children:(0,t.jsx)(d.Primitive.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...l,ref:g,onPointerMove:(0,o.composeEventHandlers)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(v.current||c.isPointerInTransitRef.current||(u.onTriggerEnter(),v.current=!0))}),onPointerLeave:(0,o.composeEventHandlers)(e.onPointerLeave,()=>{u.onTriggerLeave(),v.current=!1}),onPointerDown:(0,o.composeEventHandlers)(e.onPointerDown,()=>{u.open&&u.onClose(),m.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:(0,o.composeEventHandlers)(e.onFocus,()=>{m.current||u.onOpen()}),onBlur:(0,o.composeEventHandlers)(e.onBlur,u.onClose),onClick:(0,o.composeEventHandlers)(e.onClick,u.onClose)})})});E.displayName=A;var P="TooltipPortal",[k,N]=m(P,{forceMount:void 0}),_=e=>{let{__scopeTooltip:r,forceMount:o,children:n,container:a}=e,i=R(P,r);return(0,t.jsx)(k,{scope:r,forceMount:o,children:(0,t.jsx)(c.Presence,{present:o||i.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:a,children:n})})})};_.displayName=P;var O="TooltipContent",I=r.forwardRef((e,r)=>{let o=N(O,e.__scopeTooltip),{forceMount:n=o.forceMount,side:a="top",...i}=e,l=R(O,e.__scopeTooltip);return(0,t.jsx)(c.Presence,{present:n||l.open,children:l.disableHoverableContent?(0,t.jsx)(M,{side:a,...i,ref:r}):(0,t.jsx)(S,{side:a,...i,ref:r})})}),S=r.forwardRef((e,o)=>{let a=R(O,e.__scopeTooltip),i=b(O,e.__scopeTooltip),l=r.useRef(null),s=(0,n.useComposedRefs)(o,l),[u,c]=r.useState(null),{trigger:d,onClose:p}=a,f=l.current,{onPointerInTransitChange:g}=i,m=r.useCallback(()=>{c(null),g(!1)},[g]),v=r.useCallback((e,t)=>{let r,o=e.currentTarget,n={x:e.clientX,y:e.clientY},a=function(e,t){let r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),n=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,o,n,a)){case a:return"left";case n:return"right";case r:return"top";case o:return"bottom";default:throw Error("unreachable")}}(n,o.getBoundingClientRect());c(((r=[...function(e,t,r=5){let o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return o}(n,a),...function(e){let{top:t,right:r,bottom:o,left:n}=e;return[{x:n,y:t},{x:r,y:t},{x:r,y:o},{x:n,y:o}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let o=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(o.y-r.y)>=(e.y-r.y)*(o.x-r.x))t.pop();else break}t.push(o)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let o=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x))r.pop();else break}r.push(o)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(r))),g(!0)},[g]);return r.useEffect(()=>()=>m(),[m]),r.useEffect(()=>{if(d&&f){let e=e=>v(e,f),t=e=>v(e,d);return d.addEventListener("pointerleave",e),f.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),f.removeEventListener("pointerleave",t)}}},[d,f,v,m]),r.useEffect(()=>{if(u){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},o=d?.contains(t)||f?.contains(t),n=!function(e,t){let{x:r,y:o}=e,n=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let i=t[e],l=t[a],s=i.x,u=i.y,c=l.x,d=l.y;u>o!=d>o&&r<(c-s)*(o-u)/(d-u)+s&&(n=!n)}return n}(r,u);o?m():n&&(m(),p())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,f,u,p,m]),(0,t.jsx)(M,{...e,ref:s})}),[F,z]=m(D,{isInside:!1}),L=(0,p.createSlottable)("TooltipContent"),M=r.forwardRef((e,o)=>{let{__scopeTooltip:n,children:a,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,p=R(O,n),f=x(n),{onClose:m}=p;return r.useEffect(()=>(document.addEventListener(y,m),()=>document.removeEventListener(y,m)),[m]),r.useEffect(()=>{if(p.trigger){let e=e=>{let t=e.target;t?.contains(p.trigger)&&m()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[p.trigger,m]),(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:(0,t.jsxs)(s.Content,{"data-state":p.stateAttribute,...f,...d,ref:o,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,t.jsx)(L,{children:a}),(0,t.jsx)(F,{scope:n,isInside:!0,children:(0,t.jsx)(g.Root,{id:p.contentId,role:"tooltip",children:l||a})})]})})});I.displayName=O;var H="TooltipArrow",B=r.forwardRef((e,r)=>{let{__scopeTooltip:o,...n}=e,a=x(o);return z(H,o).isInside?null:(0,t.jsx)(s.Arrow,{...a,...n,ref:r})});B.displayName=H,e.s(["Arrow",()=>B,"Content",()=>I,"Portal",()=>_,"Provider",()=>w,"Root",()=>T,"Tooltip",()=>T,"TooltipArrow",()=>B,"TooltipContent",()=>I,"TooltipPortal",()=>_,"TooltipProvider",()=>w,"TooltipTrigger",()=>E,"Trigger",()=>E,"createTooltipScope",()=>v],30643);var $=e.i(30643),$=$,G=e.i(31777);function U({delayDuration:e=0,...r}){return(0,t.jsx)($.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function W({...e}){return(0,t.jsx)($.Root,{"data-slot":"tooltip",...e})}function X({...e}){return(0,t.jsx)($.Trigger,{"data-slot":"tooltip-trigger",...e})}function K({className:e,sideOffset:r=0,children:o,...n}){return(0,t.jsx)($.Portal,{children:(0,t.jsxs)($.Content,{"data-slot":"tooltip-content",sideOffset:r,className:(0,G.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[o,(0,t.jsx)($.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}e.s(["Tooltip",()=>W,"TooltipContent",()=>K,"TooltipProvider",()=>U,"TooltipTrigger",()=>X],2828)},51251,14748,e=>{"use strict";let t=(0,e.i(3645).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t],14748),e.s(["CircleAlert",()=>t],51251)},83428,15506,e=>{"use strict";let t=(0,e.i(3645).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",()=>t],15506),e.s(["Loader2",()=>t],83428)},60253,e=>{"use strict";var t=e.i(90537);e.s(["X",()=>t.default])},8361,73709,18354,e=>{"use strict";var t=e.i(44172),r=e.i(79054);let o="shep-sound-enabled",n="shep:sound-toggle";function a(){let[e,t]=(0,r.useState)(!0);(0,r.useEffect)(()=>{"false"===localStorage.getItem(o)&&t(!1);let e=e=>{t(e.detail)};return window.addEventListener(n,e),()=>window.removeEventListener(n,e)},[]);let a=(0,r.useCallback)(()=>{let r=!e;localStorage.setItem(o,String(r)),t(r),window.dispatchEvent(new CustomEvent(n,{detail:r}))},[e]);return{enabled:e,toggle:a}}e.s(["useSoundEnabled",()=>a],73709);let i=new Map,l={navigate:{sound:"tap_01",volume:.2},"menu-item":{sound:"tap_01",volume:.2},select:{sound:"select",volume:.3},"toggle-on":{sound:"toggle_on",volume:.3},"toggle-off":{sound:"toggle_off",volume:.3},click:{sound:"tap_01",volume:.3},cancel:{sound:"transition_down",volume:.3},expand:{sound:"swipe",volume:.3},collapse:{sound:"swipe",volume:.3},"menu-open":{sound:"select",volume:.3},copy:{sound:"select",volume:.3},"drawer-open":{sound:"transition_up",volume:.4},"drawer-close":{sound:"transition_down",volume:.4},submit:{sound:"button",volume:.4},approve:{sound:"celebration",volume:.5},reject:{sound:"caution",volume:.5},create:{sound:"transition_up",volume:.5},delete:{sound:"transition_down",volume:.5},"notification-success":{sound:"celebration",volume:.5},"notification-error":{sound:"caution",volume:.5},"notification-warning":{sound:"notification",volume:.5},"notification-info":{sound:"button",volume:.5}};function s(e){let{sound:t,volume:o}=l[e];return function(e,t={}){let{volume:o=1,loop:n=!1}=t,{enabled:l}=a(),s=(0,r.useRef)(null),u=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let t,r=((t=i.get(e))||((t=new Audio(`/sounds/${e}.wav`)).preload="auto",i.set(e,t)),t);return r.loop=n,r.volume=Math.max(0,Math.min(1,o)),r.addEventListener("ended",()=>{u.current=!1}),s.current=r,()=>{r.pause(),s.current=null,u.current=!1}},[e,n,o]),{play:(0,r.useCallback)(()=>{if(!l)return;let e=s.current;e&&(e.currentTime=0,e.play()?.catch(e=>{}),u.current=!0)},[l,e]),stop:(0,r.useCallback)(()=>{let e=s.current;e&&(e.pause(),e.currentTime=0,u.current=!1)},[]),isPlaying:u.current}}(t,{volume:o})}e.s(["useSoundAction",()=>s],8361);let u=!!t.default.env.NEXT_PUBLIC_DEBUG,c=()=>void 0;function d(e){return{info:u?(...t)=>console.info(e,...t):c,debug:u?(...t)=>console.debug(e,...t):c,warn:(...t)=>console.warn(e,...t),error:(...t)=>console.error(e,...t)}}e.s(["createLogger",()=>d],18354)},75921,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let o=(0,r.createContext)({skills:!1,envDeploy:!0,debug:!1});function n({children:e,flags:r}){return(0,t.jsx)(o.Provider,{value:r,children:e})}function a(){return(0,r.useContext)(o)}e.s(["FeatureFlagsProvider",()=>n,"useFeatureFlags",()=>a])},31406,(e,t,r)=>{t.exports=e.r(67013)},55016,e=>{"use strict";let t=(0,e.i(3645).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",()=>t],55016)},71326,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(22528),n=e.i(5978),a=e.i(567),i=e.i(91967),l=e.i(86874),s="AlertDialog",[u,c]=(0,o.createContextScope)(s,[a.createDialogScope]),d=(0,a.createDialogScope)(),p=e=>{let{__scopeAlertDialog:r,...o}=e,n=d(r);return(0,t.jsx)(a.Root,{...n,...o,modal:!0})};p.displayName=s;var f=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,i=d(o);return(0,t.jsx)(a.Trigger,{...i,...n,ref:r})});f.displayName="AlertDialogTrigger";var g=e=>{let{__scopeAlertDialog:r,...o}=e,n=d(r);return(0,t.jsx)(a.Portal,{...n,...o})};g.displayName="AlertDialogPortal";var m=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,i=d(o);return(0,t.jsx)(a.Overlay,{...i,...n,ref:r})});m.displayName="AlertDialogOverlay";var v="AlertDialogContent",[x,h]=u(v),y=(0,l.createSlottable)("AlertDialogContent"),C=r.forwardRef((e,o)=>{let{__scopeAlertDialog:l,children:s,...u}=e,c=d(l),p=r.useRef(null),f=(0,n.useComposedRefs)(o,p),g=r.useRef(null);return(0,t.jsx)(a.WarningProvider,{contentName:v,titleName:b,docsSlug:"alert-dialog",children:(0,t.jsx)(x,{scope:l,cancelRef:g,children:(0,t.jsxs)(a.Content,{role:"alertdialog",...c,...u,ref:f,onOpenAutoFocus:(0,i.composeEventHandlers)(u.onOpenAutoFocus,e=>{e.preventDefault(),g.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(y,{children:s}),(0,t.jsx)(E,{contentRef:p})]})})})});C.displayName=v;var b="AlertDialogTitle",w=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,i=d(o);return(0,t.jsx)(a.Title,{...i,...n,ref:r})});w.displayName=b;var D="AlertDialogDescription",j=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,i=d(o);return(0,t.jsx)(a.Description,{...i,...n,ref:r})});j.displayName=D;var R=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,i=d(o);return(0,t.jsx)(a.Close,{...i,...n,ref:r})});R.displayName="AlertDialogAction";var T="AlertDialogCancel",A=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...i}=e,{cancelRef:l}=h(T,o),s=d(o),u=(0,n.useComposedRefs)(r,l);return(0,t.jsx)(a.Close,{...s,...i,ref:u})});A.displayName=T;var E=({contentRef:e})=>{let t=`\`${v}\` requires a description for the component to be accessible for screen reader users.
|
|
6
|
+
|
|
7
|
+
You can add a description to the \`${v}\` by passing a \`${D}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
8
|
+
|
|
9
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${v}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
10
|
+
|
|
11
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return r.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null};e.s(["Action",()=>R,"AlertDialog",()=>p,"AlertDialogAction",()=>R,"AlertDialogCancel",()=>A,"AlertDialogContent",()=>C,"AlertDialogDescription",()=>j,"AlertDialogOverlay",()=>m,"AlertDialogPortal",()=>g,"AlertDialogTitle",()=>w,"AlertDialogTrigger",()=>f,"Cancel",()=>A,"Content",()=>C,"Description",()=>j,"Overlay",()=>m,"Portal",()=>g,"Root",()=>p,"Title",()=>w,"Trigger",()=>f,"createAlertDialogScope",()=>c],28883);var P=e.i(28883),P=P,k=e.i(31777),N=e.i(35364);function _({...e}){return(0,t.jsx)(P.Root,{"data-slot":"alert-dialog",...e})}function O({...e}){return(0,t.jsx)(P.Portal,{"data-slot":"alert-dialog-portal",...e})}function I({className:e,onClick:r,...o}){return(0,t.jsx)(P.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,k.cn)("fixed inset-0 z-50 bg-black/50",e),onClick:e=>{e.stopPropagation(),r?.(e)},...o})}function S({className:e,size:r="default",...o}){return(0,t.jsxs)(O,{children:[(0,t.jsx)(I,{}),(0,t.jsx)(P.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,k.cn)("bg-background group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...o})]})}function F({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,k.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...r})}function z({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,k.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...r})}function L({className:e,...r}){return(0,t.jsx)(P.Title,{"data-slot":"alert-dialog-title",className:(0,k.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...r})}function M({className:e,...r}){return(0,t.jsx)(P.Description,{"data-slot":"alert-dialog-description",className:(0,k.cn)("text-muted-foreground text-sm",e),...r})}function H({className:e,variant:r="default",size:o="default",...n}){return(0,t.jsx)(N.Button,{variant:r,size:o,asChild:!0,children:(0,t.jsx)(P.Action,{"data-slot":"alert-dialog-action",className:(0,k.cn)(e),...n})})}function B({className:e,variant:r="outline",size:o="default",...n}){return(0,t.jsx)(N.Button,{variant:r,size:o,asChild:!0,children:(0,t.jsx)(P.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,k.cn)(e),...n})})}e.s(["AlertDialog",()=>_,"AlertDialogAction",()=>H,"AlertDialogCancel",()=>B,"AlertDialogContent",()=>S,"AlertDialogDescription",()=>M,"AlertDialogFooter",()=>z,"AlertDialogHeader",()=>F,"AlertDialogTitle",()=>L],71326)},30153,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(71326);let n=(0,r.createContext)(null);function a({children:e}){let a=(0,r.useRef)(null),i=(0,r.useRef)(null),[l,s]=(0,r.useState)(!1),u=(0,r.useCallback)(e=>{a.current=e},[]),c=(0,r.useCallback)(e=>{if(a.current?.isDirty){i.current=e,s(!0);return}e()},[]),d=(0,r.useCallback)(()=>{s(!1),a.current?.onReset(),a.current=null,i.current?.(),i.current=null},[]),p=(0,r.useCallback)(()=>{s(!1),i.current=null},[]),f=(0,r.useCallback)(()=>a.current?.isDirty??!1,[]);return(0,t.jsxs)(n,{value:{setGuard:u,guardedNavigate:c,getIsDirty:f},children:[e,(0,t.jsx)(o.AlertDialog,{open:l,children:(0,t.jsxs)(o.AlertDialogContent,{children:[(0,t.jsxs)(o.AlertDialogHeader,{children:[(0,t.jsx)(o.AlertDialogTitle,{children:"Discard unsaved changes?"}),(0,t.jsx)(o.AlertDialogDescription,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),(0,t.jsxs)(o.AlertDialogFooter,{children:[(0,t.jsx)(o.AlertDialogAction,{variant:"destructive",onClick:d,children:"Discard"}),(0,t.jsx)(o.AlertDialogCancel,{onClick:p,children:"Keep editing"})]})]})})]})}function i(){let e=(0,r.useContext)(n);if(!e)throw Error("useDrawerCloseGuard must be used within DrawerCloseGuardProvider");return e}function l({open:e,isDirty:t,onClose:o,onReset:n}){let{setGuard:a,guardedNavigate:l}=i();return(0,r.useEffect)(()=>(e?a({isDirty:t,onReset:n}):a(null),()=>a(null)),[e,t,n,a]),{attemptClose:(0,r.useCallback)(()=>{l(()=>{n(),o()})},[l,o,n])}}e.s(["DrawerCloseGuardProvider",()=>a,"useDrawerCloseGuard",()=>i,"useGuardedDrawerClose",()=>l])}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},53360,e=>{"use strict";let t=(0,e.i(3645).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],53360)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},81846,e=>{"use strict";var t=e.i(20314),r=e.i(94237),s=e.i(31777);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 l({className:e,variant:r,...l}){return(0,t.jsx)("div",{className:(0,s.cn)(i({variant:r}),e),...l})}e.s(["Badge",()=>l])},1650,e=>{"use strict";e.i(11495),e.s([])},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],19933)},8986,13526,87092,64414,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>t],8986);var r=e.i(21023);let s=(0,r.createServerReference)("408650cfef71246260ca078a892eaa9fa89a3c4612",r.callServer,void 0,r.findSourceMapURL,"openIde");e.s(["openIde",()=>s],13526);let i=(0,r.createServerReference)("4021ce8dbc137e3abf9c1e3c1a73d5752e3be0014c",r.callServer,void 0,r.findSourceMapURL,"openShell");e.s(["openShell",()=>i],87092);let l=(0,r.createServerReference)("400588ea7bfe6e878624e1ce4d8d0f4ded424e99ff",r.callServer,void 0,r.findSourceMapURL,"openFolder");e.s(["openFolder",()=>l],64414)},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),s=e.i(87342),i=e.i(5978),l=e.i(22528),n=e.i(13123),o=e.i(87620),a=e.i(29297),u=e.i(36589),c=e.i(66033),d=e.i(20314),f="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[y,v,m]=(0,s.createCollection)(p),[x,g]=(0,l.createContextScope)(p,[m]),[k,R]=x(p),b=t.forwardRef((e,t)=>(0,d.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(w,{...e,ref:t})})}));b.displayName=p;var w=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:l,orientation:n,loop:y=!1,dir:m,currentTabStopId:x,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:R,onEntryFocus:b,preventScrollOnEntryFocus:w=!1,...S}=e,A=t.useRef(null),M=(0,i.useComposedRefs)(s,A),I=(0,c.useDirection)(m),[F,T]=(0,u.useControllableState)({prop:x,defaultProp:g??null,onChange:R,caller:p}),[j,z]=t.useState(!1),E=(0,a.useCallbackRef)(b),P=v(l),L=t.useRef(!1),[D,O]=t.useState(0);return t.useEffect(()=>{let e=A.current;if(e)return e.addEventListener(f,E),()=>e.removeEventListener(f,E)},[E]),(0,d.jsx)(k,{scope:l,orientation:n,dir:I,loop:y,currentTabStopId:F,onItemFocus:t.useCallback(e=>T(e),[T]),onItemShiftTab:t.useCallback(()=>z(!0),[]),onFocusableItemAdd:t.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>O(e=>e-1),[]),children:(0,d.jsx)(o.Primitive.div,{tabIndex:j||0===D?-1:0,"data-orientation":n,...S,ref:M,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(f,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);C([e.find(e=>e.active),e.find(e=>e.id===F),...e].filter(Boolean).map(e=>e.ref.current),w)}}L.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>z(!1))})})}),S="RovingFocusGroupItem",A=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:i,focusable:l=!0,active:a=!1,tabStopId:u,children:c,...f}=e,h=(0,n.useId)(),p=u||h,m=R(S,i),x=m.currentTabStopId===p,g=v(i),{onFocusableItemAdd:k,onFocusableItemRemove:b,currentTabStopId:w}=m;return t.useEffect(()=>{if(l)return k(),()=>b()},[l,k,b]),(0,d.jsx)(y.ItemSlot,{scope:i,id:p,focusable:l,active:a,children:(0,d.jsx)(o.Primitive.span,{tabIndex:x?0:-1,"data-orientation":m.orientation,...f,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{l?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var s;let i=(s=e.key,"rtl"!==r?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return M[i]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,s;"prev"===t&&i.reverse();let l=i.indexOf(e.currentTarget);i=m.loop?(r=i,s=l+1,r.map((e,t)=>r[(s+t)%r.length])):i.slice(l+1)}setTimeout(()=>C(i))}}),children:"function"==typeof c?c({isCurrentTabStop:x,hasTabStop:null!=w}):c})})});A.displayName=S;var M={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C(e,t=!1){let r=document.activeElement;for(let s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>A,"Root",()=>b,"createRovingFocusGroupScope",()=>g])},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),i=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label",e.s(["Label",()=>i,"Root",()=>i],27572);var l=e.i(27572),l=l,n=e.i(94237),o=e.i(31777);let a=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(l.Root,{ref:s,className:(0,o.cn)(a(),e),...r}));u.displayName=l.Root.displayName,e.s(["Label",()=>u],41957)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),i=e.i(86874),l=e.i(20314);function n(e){let n=e+"CollectionProvider",[o,a]=(0,r.createContextScope)(n),[u,c]=o(n,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:s}=e,i=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,l.jsx)(u,{scope:r,itemMap:n,collectionRef:i,children:s})};d.displayName=n;let f=e+"CollectionSlot",h=(0,i.createSlot)(f),p=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,n=c(f,r),o=(0,s.useComposedRefs)(t,n.collectionRef);return(0,l.jsx)(h,{ref:o,children:i})});p.displayName=f;let y=e+"CollectionItemSlot",v="data-radix-collection-item",m=(0,i.createSlot)(y),x=t.default.forwardRef((e,r)=>{let{scope:i,children:n,...o}=e,a=t.default.useRef(null),u=(0,s.useComposedRefs)(r,a),d=c(y,i);return t.default.useEffect(()=>(d.itemMap.set(a,{ref:a,...o}),()=>void d.itemMap.delete(a))),(0,l.jsx)(m,{...{[v]:""},ref:u,children:n})});return x.displayName=y,[{Provider:d,Slot:p,ItemSlot:x},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},a]}var o=new WeakMap;function a(e,t){var r,s;let i,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,s=t,i=r.length,(n=(l=u(s))>=0?l:i+l)<0||n>=i?-1:n);return -1===o?void 0:e[o]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],o.set(this,!0)}set(e,t){return o.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,i=this.has(t),l=this.#e.length,n=u(e),o=n>=0?n:l+n,a=o<0||o>=l?-1:o;if(a===this.size||i&&a===this.size-1||-1===a)return this.set(t,r),this;let c=this.size+ +!i;n<0&&o++;let d=[...this.#e],f=!1;for(let e=o;e<c;e++)if(o===e){let l=d[e];d[e]===t&&(l=d[e+1]),i&&this.delete(t),s=this.get(l),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=a(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=a(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return a(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},54793,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function s({icon:e,title:s,description:i,action:l,className:n,...o}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",n),...o,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),i?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:i}):null,l?(0,t.jsx)("div",{className:"mt-2",children:l}):null]})}e.s(["EmptyState",()=>s],7729),e.s([],54793)},64958,31899,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00455b171fd7ccabc56e57ed7a5c68444a1cfd66a2",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],64958);let s=(0,t.createServerReference)("605ecbde7dd00ad406a43c24e8c27ffe541197a961",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],31899)},83095,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("403efbed2f4429cd3188122115f3bc07f940095818",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},76852,e=>{"use strict";var t=e.i(79054),r=e.i(13526),s=e.i(87092),i=e.i(64414);function l(e){let[l,n]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),[u,c]=(0,t.useState)(!1),[d,f]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[y,v]=(0,t.useState)(null),m=(0,t.useRef)(null),x=(0,t.useRef)(null),g=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{m.current&&clearTimeout(m.current),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current)},[]);let k=(0,t.useCallback)(async(t,r,s,i,l)=>{if(e&&!l){i.current&&clearTimeout(i.current),r(!0),s(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";s(t),i.current=setTimeout(()=>s(null),5e3)}}catch(e){s(e instanceof Error?e.message:"An unexpected error occurred"),i.current=setTimeout(()=>s(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>k(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),n,f,m,l),[k,l,e]),openInShell:(0,t.useCallback)(()=>k(()=>(0,s.openShell)({repositoryPath:e.repositoryPath}),a,p,x,o),[k,o,e]),openFolder:(0,t.useCallback)(()=>k(()=>(0,i.openFolder)(e.repositoryPath),c,v,g,u),[k,u,e]),ideLoading:l,shellLoading:o,folderLoading:u,ideError:d,shellError:h,folderError:y}}e.s(["useRepositoryActions",()=>l])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},53360,e=>{"use strict";let t=(0,e.i(3645).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],53360)},97667,e=>{"use strict";var t=e.i(1012);e.s(["CheckIcon",()=>t.default])},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},81846,e=>{"use strict";var t=e.i(20314),r=e.i(94237),s=e.i(31777);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 l({className:e,variant:r,...l}){return(0,t.jsx)("div",{className:(0,s.cn)(i({variant:r}),e),...l})}e.s(["Badge",()=>l])},1650,e=>{"use strict";e.i(11495),e.s([])},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],19933)},8986,57458,14232,71080,e=>{"use strict";let t=(0,e.i(3645).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>t],8986);var r=e.i(21023);let s=(0,r.createServerReference)("4083185d779fee93cfe16f54d3e58b315995e139e8",r.callServer,void 0,r.findSourceMapURL,"openIde");e.s(["openIde",()=>s],57458);let i=(0,r.createServerReference)("40ba62f61241d9ff1a470558313f6e090aa32c5645",r.callServer,void 0,r.findSourceMapURL,"openShell");e.s(["openShell",()=>i],14232);let l=(0,r.createServerReference)("40ba9c26c909d8f4cbc867cb52efc880563cba6bf4",r.callServer,void 0,r.findSourceMapURL,"openFolder");e.s(["openFolder",()=>l],71080)},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),s=e.i(87342),i=e.i(5978),l=e.i(22528),n=e.i(13123),o=e.i(87620),a=e.i(29297),u=e.i(36589),c=e.i(66033),f=e.i(20314),d="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[y,v,m]=(0,s.createCollection)(p),[x,g]=(0,l.createContextScope)(p,[m]),[k,R]=x(p),b=t.forwardRef((e,t)=>(0,f.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(w,{...e,ref:t})})}));b.displayName=p;var w=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:l,orientation:n,loop:y=!1,dir:m,currentTabStopId:x,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:R,onEntryFocus:b,preventScrollOnEntryFocus:w=!1,...S}=e,A=t.useRef(null),M=(0,i.useComposedRefs)(s,A),I=(0,c.useDirection)(m),[F,T]=(0,u.useControllableState)({prop:x,defaultProp:g??null,onChange:R,caller:p}),[j,z]=t.useState(!1),E=(0,a.useCallbackRef)(b),P=v(l),L=t.useRef(!1),[D,O]=t.useState(0);return t.useEffect(()=>{let e=A.current;if(e)return e.addEventListener(d,E),()=>e.removeEventListener(d,E)},[E]),(0,f.jsx)(k,{scope:l,orientation:n,dir:I,loop:y,currentTabStopId:F,onItemFocus:t.useCallback(e=>T(e),[T]),onItemShiftTab:t.useCallback(()=>z(!0),[]),onFocusableItemAdd:t.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>O(e=>e-1),[]),children:(0,f.jsx)(o.Primitive.div,{tabIndex:j||0===D?-1:0,"data-orientation":n,...S,ref:M,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(d,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);C([e.find(e=>e.active),e.find(e=>e.id===F),...e].filter(Boolean).map(e=>e.ref.current),w)}}L.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>z(!1))})})}),S="RovingFocusGroupItem",A=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:i,focusable:l=!0,active:a=!1,tabStopId:u,children:c,...d}=e,h=(0,n.useId)(),p=u||h,m=R(S,i),x=m.currentTabStopId===p,g=v(i),{onFocusableItemAdd:k,onFocusableItemRemove:b,currentTabStopId:w}=m;return t.useEffect(()=>{if(l)return k(),()=>b()},[l,k,b]),(0,f.jsx)(y.ItemSlot,{scope:i,id:p,focusable:l,active:a,children:(0,f.jsx)(o.Primitive.span,{tabIndex:x?0:-1,"data-orientation":m.orientation,...d,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{l?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var s;let i=(s=e.key,"rtl"!==r?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return M[i]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,s;"prev"===t&&i.reverse();let l=i.indexOf(e.currentTarget);i=m.loop?(r=i,s=l+1,r.map((e,t)=>r[(s+t)%r.length])):i.slice(l+1)}setTimeout(()=>C(i))}}),children:"function"==typeof c?c({isCurrentTabStop:x,hasTabStop:null!=w}):c})})});A.displayName=S;var M={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C(e,t=!1){let r=document.activeElement;for(let s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>A,"Root",()=>b,"createRovingFocusGroupScope",()=>g])},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var r=e.i(80986);e.s(["CheckCircle2",()=>r.default],35e3)},10714,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],10714);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),i=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label",e.s(["Label",()=>i,"Root",()=>i],27572);var l=e.i(27572),l=l,n=e.i(94237),o=e.i(31777);let a=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(l.Root,{ref:s,className:(0,o.cn)(a(),e),...r}));u.displayName=l.Root.displayName,e.s(["Label",()=>u],41957)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),i=e.i(86874),l=e.i(20314);function n(e){let n=e+"CollectionProvider",[o,a]=(0,r.createContextScope)(n),[u,c]=o(n,{collectionRef:{current:null},itemMap:new Map}),f=e=>{let{scope:r,children:s}=e,i=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,l.jsx)(u,{scope:r,itemMap:n,collectionRef:i,children:s})};f.displayName=n;let d=e+"CollectionSlot",h=(0,i.createSlot)(d),p=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,n=c(d,r),o=(0,s.useComposedRefs)(t,n.collectionRef);return(0,l.jsx)(h,{ref:o,children:i})});p.displayName=d;let y=e+"CollectionItemSlot",v="data-radix-collection-item",m=(0,i.createSlot)(y),x=t.default.forwardRef((e,r)=>{let{scope:i,children:n,...o}=e,a=t.default.useRef(null),u=(0,s.useComposedRefs)(r,a),f=c(y,i);return t.default.useEffect(()=>(f.itemMap.set(a,{ref:a,...o}),()=>void f.itemMap.delete(a))),(0,l.jsx)(m,{...{[v]:""},ref:u,children:n})});return x.displayName=y,[{Provider:f,Slot:p,ItemSlot:x},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},a]}var o=new WeakMap;function a(e,t){var r,s;let i,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,s=t,i=r.length,(n=(l=u(s))>=0?l:i+l)<0||n>=i?-1:n);return -1===o?void 0:e[o]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],o.set(this,!0)}set(e,t){return o.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,i=this.has(t),l=this.#e.length,n=u(e),o=n>=0?n:l+n,a=o<0||o>=l?-1:o;if(a===this.size||i&&a===this.size-1||-1===a)return this.set(t,r),this;let c=this.size+ +!i;n<0&&o++;let f=[...this.#e],d=!1;for(let e=o;e<c;e++)if(o===e){let l=f[e];f[e]===t&&(l=f[e+1]),i&&this.delete(t),s=this.get(l),this.set(t,r)}else{d||f[e-1]!==t||(d=!0);let r=f[d?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=a(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=a(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return a(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},20163,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function s({icon:e,title:s,description:i,action:l,className:n,...o}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",n),...o,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),i?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:i}):null,l?(0,t.jsx)("div",{className:"mt-2",children:l}):null]})}e.s(["EmptyState",()=>s],7729),e.s([],20163)},64923,35298,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00e3a915fe3a467f43581dcc3ed28b6c860ee0ef43",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],64923);let s=(0,t.createServerReference)("60f988eedc025ce6e8ae5e09c797e998dc6807ba6c",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],35298)},17733,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("40b0a4c466d7f1f88d1fca54239c2bd83e47e00f10",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},76852,e=>{"use strict";var t=e.i(79054),r=e.i(57458),s=e.i(14232),i=e.i(71080);function l(e){let[l,n]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),[u,c]=(0,t.useState)(!1),[f,d]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[y,v]=(0,t.useState)(null),m=(0,t.useRef)(null),x=(0,t.useRef)(null),g=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{m.current&&clearTimeout(m.current),x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current)},[]);let k=(0,t.useCallback)(async(t,r,s,i,l)=>{if(e&&!l){i.current&&clearTimeout(i.current),r(!0),s(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";s(t),i.current=setTimeout(()=>s(null),5e3)}}catch(e){s(e instanceof Error?e.message:"An unexpected error occurred"),i.current=setTimeout(()=>s(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>k(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),n,d,m,l),[k,l,e]),openInShell:(0,t.useCallback)(()=>k(()=>(0,s.openShell)({repositoryPath:e.repositoryPath}),a,p,x,o),[k,o,e]),openFolder:(0,t.useCallback)(()=>k(()=>(0,i.openFolder)(e.repositoryPath),c,v,g,u),[k,u,e]),ideLoading:l,shellLoading:o,folderLoading:u,ideError:f,shellError:h,folderError:y}}e.s(["useRepositoryActions",()=>l])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},54277,e=>{"use strict";var t=e.i(30090);e.s(["CircleX",()=>t.default])},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},80764,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(79054);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=i(e,n)),t&&(o.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},10942,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],10942);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n=(0,e.i(18354).createLogger)("[SSE]");function o(e,t,r,n){if("u"<typeof EventSource)return()=>{};let o=null,i=!1,u=1e3,a=null,l=null;return!function s(){i||(o=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),o.onopen=()=>{n("connected"),l=setTimeout(()=>{l=null,u=1e3},5e3)},o.onerror=()=>{o?.close(),o=null,n("disconnected"),null!==l&&(clearTimeout(l),l=null);let e=u;u=Math.min(2*e,3e4),a=setTimeout(()=>{a=null,s()},e)},o.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>{let t=[...e,n];return t.length>500?t.slice(-250):t}),r(n)}))}(),()=>{i=!0,null!==a&&(clearTimeout(a),a=null),null!==l&&(clearTimeout(l),l=null),o&&(o.close(),o=null)}}let i=(0,r.createContext)(null);function u({children:e,runId:u}){let{events:a,lastEvent:l,connectionStatus:s}=function(e){let[t,i]=(0,r.useState)([]),[u,a]=(0,r.useState)(null),[l,s]=(0,r.useState)("disconnected"),c=e?.runId,f=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;n.debug("event received:",e.eventType,e),i(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),a(e)}else"status"===t.type&&s(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return o(c,i,a,s);let t=!1,r={current:void 0};function n(e){t||(f.current=e,e.postMessage({type:"subscribe",runId:c}),s("connecting"))}function u(){if(t)return;let e=navigator.serviceWorker.controller;e&&(f.current=e,e.postMessage({type:"subscribe",runId:c}),s("connecting"))}return navigator.serviceWorker.addEventListener("message",d),navigator.serviceWorker.addEventListener("controllerchange",u),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let u=e.active??e.installing??e.waiting;if(!u){r.current=o(c,i,a,s);return}if("activated"===u.state)n(u);else{let e=()=>{"activated"===u.state&&(u.removeEventListener("statechange",e),n(u))};u.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=o(c,i,a,s))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",d),navigator.serviceWorker.removeEventListener("controllerchange",u),f.current?.postMessage({type:"unsubscribe"}),f.current=null,r.current?.()}},[c,d]),{events:t,lastEvent:u,connectionStatus:l}}({runId:u}),c=(0,r.useMemo)(()=>({events:a,lastEvent:l,connectionStatus:s}),[a,l,s]);return(0,t.jsx)(i.Provider,{value:c,children:e})}function a(){let e=(0,r.useContext)(i);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>u,"useAgentEventsContext",()=>a],39443)},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00b9e4dd162ae83bcb504d1945964384ec5c9d0c59",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function n(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>n],78521)},91925,e=>{"use strict";let t=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],91925)},5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let n={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null};function o(e){return n[e]}let i=(0,r.createContext)(null);function u({children:e}){let[n,o]=(0,r.useState)([]),[u,a]=(0,r.useState)(!1),l=(0,r.useMemo)(()=>({features:n,setFeatures:o,hasRepositories:u,setHasRepositories:a}),[n,u]);return(0,t.jsx)(i.Provider,{value:l,children:e})}function a(){let e=(0,r.useContext)(i);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>u,"mapNodeStateToSidebarStatus",()=>o,"useSidebarFeaturesContext",()=>a])},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium 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),...o})}e.s(["Input",()=>n])},12103,e=>{"use strict";let t=(0,e.i(3645).default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);e.s(["Puzzle",()=>t],12103)},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return a}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function u(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,u(e));else t.set(r,u(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return a},formatWithValidation:function(){return s},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066)._(e.r(76314)),u=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",a=e.hash||"",l=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||u.test(n))&&!1!==s?(s="//"+(s||""),o&&"/"!==o[0]&&(o="/"+o)):s||(s=""),a&&"#"!==a[0]&&(a="#"+a),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${o}${c}${a}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return a(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return E},MissingStaticPage:function(){return P},NormalizeError:function(){return m},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return v},WEB_VITALS:function(){return i},execOnce:function(){return u},getDisplayName:function(){return f},getLocationOrigin:function(){return s},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return S}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function u(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let a=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>a.test(e);function s(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=s();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,v=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class m extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class P extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class E extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function S(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(58464),o=e.r(53626);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066),u=e.r(20314),a=i._(e.r(79054)),l=e.r(95889),s=e.r(18152),c=e.r(80764),f=e.r(58464),d=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),g=e.r(95555);function v(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function y(t){var r;let n,o,i,[l,y]=(0,a.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,a.useRef)(null),{href:P,as:E,children:S,prefetch:x=null,passHref:k,replace:C,shallow:O,scroll:_,onClick:j,onMouseEnter:w,onTouchStart:M,legacyBehavior:T=!1,onNavigate:L,ref:R,unstable_dynamicOnHover:N,...A}=t;n=S,T&&("string"==typeof n||"number"==typeof n)&&(n=(0,u.jsx)("a",{children:n}));let U=a.default.useContext(s.AppRouterContext),I=!1!==x,F=!1!==x?null===(r=x)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:$,as:z}=a.default.useMemo(()=>{let e=v(P);return{href:e,as:E?v(E):e}},[P,E]);if(T){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=a.default.Children.only(n)}let B=T?o&&"object"==typeof o&&o.ref:R,D=a.default.useCallback(e=>(null!==U&&(b.current=(0,p.mountLinkInstance)(e,$,U,F,I,y)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,$,U,F,y]),W={ref:(0,c.useMergedRef)(D,B),onClick(t){T||"function"!=typeof j||j(t),T&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,i,u,l){if("u">typeof window){let s,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((s=t.currentTarget.getAttribute("target"))&&"_self"!==s||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(81574);a.default.startTransition(()=>{f(n||r,i?"replace":"push",u??!0,o.current)})}}(t,$,z,b,C,_,L)},onMouseEnter(e){T||"function"!=typeof w||w(e),T&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===N)},onTouchStart:function(e){T||"function"!=typeof M||M(e),T&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===N)}};return(0,f.isAbsoluteUrl)(z)?W.href=z:T&&!k&&("a"!==o.type||"href"in o.props)||(W.href=(0,d.addBasePath)(z)),i=T?a.default.cloneElement(o,W):(0,u.jsx)("a",{...A,...W,children:n}),(0,u.jsx)(m.Provider,{value:l,children:i})}e.r(38670);let m=(0,a.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,a.useContext)(m);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]);
|