@shepai/cli 1.155.0-pr484.1619afe → 1.155.0-pr486.e53674d

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.
Files changed (164) hide show
  1. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.d.ts.map +1 -1
  2. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.js +1 -3
  3. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/claude-code.json +4 -3
  4. package/dist/tsconfig.build.tsbuildinfo +1 -1
  5. package/package.json +1 -1
  6. package/web/.next/BUILD_ID +1 -1
  7. package/web/.next/build-manifest.json +2 -2
  8. package/web/.next/fallback-build-manifest.json +2 -2
  9. package/web/.next/prerender-manifest.json +3 -3
  10. package/web/.next/required-server-files.js +1 -1
  11. package/web/.next/required-server-files.json +1 -1
  12. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
  13. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  14. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  15. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +26 -26
  16. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  17. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +29 -29
  19. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  20. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  21. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  22. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  27. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +26 -26
  28. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  29. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  30. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  31. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  32. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  33. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +26 -26
  34. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  35. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  36. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +29 -29
  37. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  38. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  40. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
  43. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
  46. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +26 -26
  49. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  52. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/_global-error.html +2 -2
  55. package/web/.next/server/app/_global-error.rsc +1 -1
  56. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  57. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  58. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  59. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  60. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  61. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +5 -5
  62. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  63. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  65. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  66. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/skills/page/server-reference-manifest.json +10 -10
  68. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  69. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/tools/page/server-reference-manifest.json +10 -10
  71. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  72. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/version/page/server-reference-manifest.json +5 -5
  74. package/web/.next/server/app/version/page.js.nft.json +1 -1
  75. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  77. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  78. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  79. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  80. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  81. package/web/.next/server/chunks/ssr/[root-of-the-server]__17ed7ed1._.js +1 -1
  82. package/web/.next/server/chunks/ssr/[root-of-the-server]__17ed7ed1._.js.map +1 -1
  83. package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.js +2 -2
  84. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  85. package/web/.next/server/chunks/ssr/[root-of-the-server]__42bf1807._.js +1 -1
  86. package/web/.next/server/chunks/ssr/[root-of-the-server]__42bf1807._.js.map +1 -1
  87. package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js +1 -1
  88. package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js.map +1 -1
  89. package/web/.next/server/chunks/ssr/[root-of-the-server]__5edfc56b._.js +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js +1 -1
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js.map +1 -1
  92. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js.map +1 -1
  95. package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js.map +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js.map +1 -1
  99. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  100. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  102. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/_3a0b989f._.js +2 -2
  104. package/web/.next/server/chunks/ssr/_3a0b989f._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/_41633e32._.js +3 -0
  106. package/web/.next/server/chunks/ssr/{_08f3fd21._.js.map → _41633e32._.js.map} +1 -1
  107. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  108. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/{_d957c7f8._.js → _59d0f988._.js} +2 -2
  110. package/web/.next/server/chunks/ssr/{_d957c7f8._.js.map → _59d0f988._.js.map} +1 -1
  111. package/web/.next/server/chunks/ssr/_5f69c13f._.js +1 -1
  112. package/web/.next/server/chunks/ssr/_5f69c13f._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/_7c5b97c6._.js +1 -1
  114. package/web/.next/server/chunks/ssr/_7c5b97c6._.js.map +1 -1
  115. package/web/.next/server/chunks/ssr/{_4601ff05._.js → _813095ef._.js} +2 -2
  116. package/web/.next/server/chunks/ssr/{_4601ff05._.js.map → _813095ef._.js.map} +1 -1
  117. package/web/.next/server/chunks/ssr/_82c57f10._.js +1 -1
  118. package/web/.next/server/chunks/ssr/_82c57f10._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/_9495d50b._.js +1 -1
  120. package/web/.next/server/chunks/ssr/_9495d50b._.js.map +1 -1
  121. package/web/.next/server/chunks/ssr/_a0e3f7e4._.js +1 -1
  122. package/web/.next/server/chunks/ssr/_a0e3f7e4._.js.map +1 -1
  123. package/web/.next/server/chunks/ssr/_ac4a3873._.js +1 -1
  124. package/web/.next/server/chunks/ssr/_ca0aa7f0._.js +1 -1
  125. package/web/.next/server/chunks/ssr/_ca0aa7f0._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/_cb5a021e._.js +1 -1
  127. package/web/.next/server/chunks/ssr/_cb5a021e._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/_d86175ae._.js +1 -1
  129. package/web/.next/server/chunks/ssr/_d86175ae._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/_d8bedf13._.js +1 -1
  131. package/web/.next/server/chunks/ssr/_d8bedf13._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/_fa7efce3._.js +2 -2
  133. package/web/.next/server/chunks/ssr/_fa7efce3._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  135. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js +1 -1
  137. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js +1 -1
  139. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  141. package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.js +1 -1
  142. package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.js.map +1 -1
  143. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  144. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  145. package/web/.next/server/pages/500.html +2 -2
  146. package/web/.next/server/server-reference-manifest.js +1 -1
  147. package/web/.next/server/server-reference-manifest.json +45 -45
  148. package/web/.next/static/chunks/{190cb2b91443b7a2.js → 125b250c28113507.js} +1 -1
  149. package/web/.next/static/chunks/{6bef26d1ebd38687.js → 2817c3b9d560aaeb.js} +1 -1
  150. package/web/.next/static/chunks/{e3339b33db2768bd.js → 42e9d0c76e624005.js} +1 -1
  151. package/web/.next/static/chunks/{04cb9cede104b5f8.js → 6e6cd6218f76e404.js} +2 -2
  152. package/web/.next/static/chunks/{232221de97ee02ee.js → 7a1a68bdc20f0428.js} +1 -1
  153. package/web/.next/static/chunks/{c3a9b33826b0e541.js → 902c670cb337840c.js} +1 -1
  154. package/web/.next/static/chunks/{7bdd3f51e4993fb6.js → a676d236e8214de3.js} +2 -2
  155. package/web/.next/static/chunks/{639776981e3c0300.js → a7c1cddd7d406fb8.js} +1 -1
  156. package/web/.next/static/chunks/{5ea1d031a4327efd.js → b3be394b3cc24151.js} +1 -1
  157. package/web/.next/static/chunks/b4080e40597d7f8e.js +1 -0
  158. package/web/.next/static/chunks/{9207c052206225b2.js → da980f1c277bafcb.js} +2 -2
  159. package/web/.next/static/chunks/{e1b6fd86f641261d.js → ea823175bb410162.js} +1 -1
  160. package/web/.next/server/chunks/ssr/_08f3fd21._.js +0 -3
  161. package/web/.next/static/chunks/b224651a2324c8f7.js +0 -1
  162. /package/web/.next/static/{SnRLSukTe4qbiJHXHhXVW → _5yY0q7bqEA7bwlEo729P}/_buildManifest.js +0 -0
  163. /package/web/.next/static/{SnRLSukTe4qbiJHXHhXVW → _5yY0q7bqEA7bwlEo729P}/_clientMiddlewareManifest.json +0 -0
  164. /package/web/.next/static/{SnRLSukTe4qbiJHXHhXVW → _5yY0q7bqEA7bwlEo729P}/_ssgManifest.js +0 -0
@@ -4,4 +4,4 @@ You can add a description to the \`${b}\` by passing a \`${C}\` component as a c
4
4
 
5
5
  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 \`${b}\`. 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.
6
6
 
7
- 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",()=>k,"AlertDialog",()=>f,"AlertDialogAction",()=>k,"AlertDialogCancel",()=>P,"AlertDialogContent",()=>y,"AlertDialogDescription",()=>S,"AlertDialogOverlay",()=>h,"AlertDialogPortal",()=>g,"AlertDialogTitle",()=>j,"AlertDialogTrigger",()=>p,"Cancel",()=>P,"Content",()=>y,"Description",()=>S,"Overlay",()=>h,"Portal",()=>g,"Root",()=>f,"Title",()=>j,"Trigger",()=>p,"createAlertDialogScope",()=>u],28883);var A=e.i(28883),A=A,E=e.i(31777),_=e.i(35364);function O({...e}){return(0,t.jsx)(A.Root,{"data-slot":"alert-dialog",...e})}function T({...e}){return(0,t.jsx)(A.Portal,{"data-slot":"alert-dialog-portal",...e})}function R({className:e,onClick:r,...a}){return(0,t.jsx)(A.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,E.cn)("fixed inset-0 z-50 bg-black/50",e),onClick:e=>{e.stopPropagation(),r?.(e)},...a})}function M({className:e,size:r="default",...a}){return(0,t.jsxs)(T,{children:[(0,t.jsx)(R,{}),(0,t.jsx)(A.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,E.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),...a})]})}function L({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,E.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,E.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 F({className:e,...r}){return(0,t.jsx)(A.Title,{"data-slot":"alert-dialog-title",className:(0,E.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 I({className:e,...r}){return(0,t.jsx)(A.Description,{"data-slot":"alert-dialog-description",className:(0,E.cn)("text-muted-foreground text-sm",e),...r})}function $({className:e,variant:r="default",size:a="default",...n}){return(0,t.jsx)(_.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(A.Action,{"data-slot":"alert-dialog-action",className:(0,E.cn)(e),...n})})}function U({className:e,variant:r="outline",size:a="default",...n}){return(0,t.jsx)(_.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(A.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,E.cn)(e),...n})})}e.s(["AlertDialog",()=>O,"AlertDialogAction",()=>$,"AlertDialogCancel",()=>U,"AlertDialogContent",()=>M,"AlertDialogDescription",()=>I,"AlertDialogFooter",()=>z,"AlertDialogHeader",()=>L,"AlertDialogTitle",()=>F],71326)},30153,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(71326);let n=(0,r.createContext)(null);function i({children:e}){let i=(0,r.useRef)(null),o=(0,r.useRef)(null),[l,s]=(0,r.useState)(!1),d=(0,r.useCallback)(e=>{i.current=e},[]),u=(0,r.useCallback)(e=>{if(i.current?.isDirty){o.current=e,s(!0);return}e()},[]),c=(0,r.useCallback)(()=>{s(!1),i.current?.onReset(),i.current=null,o.current?.(),o.current=null},[]),f=(0,r.useCallback)(()=>{s(!1),o.current=null},[]),p=(0,r.useCallback)(()=>i.current?.isDirty??!1,[]);return(0,t.jsxs)(n,{value:{setGuard:d,guardedNavigate:u,getIsDirty:p},children:[e,(0,t.jsx)(a.AlertDialog,{open:l,children:(0,t.jsxs)(a.AlertDialogContent,{children:[(0,t.jsxs)(a.AlertDialogHeader,{children:[(0,t.jsx)(a.AlertDialogTitle,{children:"Discard unsaved changes?"}),(0,t.jsx)(a.AlertDialogDescription,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),(0,t.jsxs)(a.AlertDialogFooter,{children:[(0,t.jsx)(a.AlertDialogAction,{variant:"destructive",onClick:c,children:"Discard"}),(0,t.jsx)(a.AlertDialogCancel,{onClick:f,children:"Keep editing"})]})]})})]})}function o(){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:a,onReset:n}){let{setGuard:i,guardedNavigate:l}=o();return(0,r.useEffect)(()=>(e?i({isDirty:t,onReset:n}):i(null),()=>i(null)),[e,t,n,i]),{attemptClose:(0,r.useCallback)(()=>{l(()=>{n(),a()})},[l,a,n])}}e.s(["DrawerCloseGuardProvider",()=>i,"useDrawerCloseGuard",()=>o,"useGuardedDrawerClose",()=>l])},48109,e=>{"use strict";let t=(0,e.i(3645).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",()=>t],48109)},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])},54277,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],30090),e.s(["CircleX",()=>t],54277)},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},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)},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({className:e,type:a,...n}){return(0,t.jsx)("input",{type:a,"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),...n})}e.s(["Input",()=>a])},66459,e=>{"use strict";let t=(0,e.i(3645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},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 a={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return l}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});function i(e){let t={};for(let[r,a]of e.entries()){let e=t[r];void 0===e?t[r]=a:Array.isArray(e)?e.push(a):t[r]=[e,a]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,o(e));else t.set(r,o(a));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,a]of r.entries())e.append(t,a)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return s}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let i=e.r(44066)._(e.r(76314)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,a=e.protocol||"",n=e.pathname||"",l=e.hash||"",s=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||o.test(a))&&!1!==d?(d="//"+(d||""),n&&"/"!==n[0]&&(n="/"+n)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),n=n.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${a}${d}${n}${u}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={DecodeError:function(){return m},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return y},NormalizeError:function(){return v},PageNotFoundError:function(){return x},SP:function(){return h},ST:function(){return b},WEB_VITALS:function(){return i},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return d},getURL:function(){return u},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return j}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...a)=>(r||(r=!0,t=e(...a)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>l.test(e);function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=d();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(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 g(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(r&&f(r))return a;if(!a)throw Object.defineProperty(Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return a}let h="u">typeof performance,b=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class v extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(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 a=e.r(58464),n=e.r(53626);function i(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.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 a}});let a=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return m},useLinkStatus:function(){return x}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let i=e.r(44066),o=e.r(20314),l=i._(e.r(79054)),s=e.r(95889),d=e.r(18152),u=e.r(80764),c=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),g=e.r(51380),h=e.r(95555);function b(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function m(t){var r;let a,n,i,[s,m]=(0,l.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,l.useRef)(null),{href:y,as:w,children:j,prefetch:C=null,passHref:S,replace:k,shallow:D,scroll:P,onClick:N,onMouseEnter:A,onTouchStart:E,legacyBehavior:_=!1,onNavigate:O,ref:T,unstable_dynamicOnHover:R,...M}=t;a=j,_&&("string"==typeof a||"number"==typeof a)&&(a=(0,o.jsx)("a",{children:a}));let L=l.default.useContext(d.AppRouterContext),z=!1!==C,F=!1!==C?null===(r=C)||"auto"===r?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:I,as:$}=l.default.useMemo(()=>{let e=b(y);return{href:e,as:w?b(w):e}},[y,w]);if(_){if(a?.$$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});n=l.default.Children.only(a)}let U=_?n&&"object"==typeof n&&n.ref:T,B=l.default.useCallback(e=>(null!==L&&(x.current=(0,p.mountLinkInstance)(e,I,L,F,z,m)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[z,I,L,F,m]),W={ref:(0,u.useMergedRef)(B,U),onClick(t){_||"function"!=typeof N||N(t),_&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!L||t.defaultPrevented||function(t,r,a,n,i,o,s){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:c}=e.r(81574);l.default.startTransition(()=>{c(a||r,i?"replace":"push",o??!0,n.current)})}}(t,I,$,x,k,P,O)},onMouseEnter(e){_||"function"!=typeof A||A(e),_&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),L&&z&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)},onTouchStart:function(e){_||"function"!=typeof E||E(e),_&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),L&&z&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)}};return(0,c.isAbsoluteUrl)($)?W.href=$:_&&!S&&("a"!==n.type||"href"in n.props)||(W.href=(0,f.addBasePath)($)),i=_?l.default.cloneElement(n,W):(0,o.jsx)("a",{...M,...W,children:a}),(0,o.jsx)(v.Provider,{value:s,children:i})}e.r(38670);let v=(0,l.createContext)(p.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(v);("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)},83241,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let a=e.r(9328);function n({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},90891,(e,t,r)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return a}})},31218,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return s}});let a=e.r(20314),n=e.r(26036),i=e.r(58988),o=e.r(90891),l=e.r(22193);function s({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;r.push(...e)}}if(0===r.length)return null;let s=(0,l.getDeploymentIdQueryOrEmptyString)();return(0,a.jsx)(a.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,o.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,n.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},84929,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return d}});let a=e.r(20314),n=e.r(79054),i=e.r(83241),o=e.r(31218);function l(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},d=function(e){let t={...s,...e},r=(0,n.lazy)(()=>t.loader().then(l)),d=t.loading;function u(e){let l=d?(0,a.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,u=s?n.Suspense:n.Fragment,c=t.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(o.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(r,{...e})]}):(0,a.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(r,{...e})});return(0,a.jsx)(u,{...s?{fallback:l}:{},children:c})}return u.displayName="LoadableComponent",u}},47901,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let a=e.r(81258)._(e.r(84929));function n(e,t){let r={};"function"==typeof e&&(r.loader=e);let n={...r,...t};return(0,a.default)({...n,modules:n.loadableGenerated?.modules})}("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)},13322,61201,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(47901),n=e.i(83428),i=e.i(60112),o=e.i(2287),l=e.i(35364);let s=(0,a.default)(()=>e.A(89305).then(e=>e.FileManager),{loadableGenerated:{modules:[15567]},ssr:!1,loading:()=>(0,t.jsx)(d,{})});function d(){return(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,t.jsx)(n.Loader2,{className:"text-muted-foreground h-8 w-8 animate-spin"})})}async function u(e){let t=new URLSearchParams;e&&t.set("path",e);let r=await fetch(`/api/directory/list?${t.toString()}`);if(!r.ok)throw Error((await r.json().catch(()=>({error:"Failed to load directory"}))).error??"Failed to load directory");return r.json()}function c({open:e,onOpenChange:a,onSelect:n,initialPath:d}){let[c,f]=(0,r.useState)([]),[p,g]=(0,r.useState)(""),[h,b]=(0,r.useState)(!1),[m,v]=(0,r.useState)(null),x=(0,r.useRef)(!1),y=(0,r.useCallback)(async e=>{b(!0),v(null);try{let t=await u(e);f(t.entries),g(t.currentPath)}catch(t){let e=t instanceof Error?t.message:"Failed to load directory";i.toast.error(e)}finally{b(!1)}},[]);(0,r.useEffect)(()=>{e&&!x.current&&(x.current=!0,y(d)),e||(x.current=!1)},[e,d,y]);let w=(0,r.useCallback)(e=>{let t=e.absolutePath;e.isDirectory&&t&&y(t)},[y]),j=(0,r.useCallback)(e=>{1===e.length&&e[0].isDirectory?v(e[0].absolutePath??null):v(null)},[]);function C(){n(null),a(!1)}return(0,t.jsx)(o.Dialog,{open:e,onOpenChange:e=>{e||C()},children:(0,t.jsxs)(o.DialogContent,{className:"flex h-[95dvh] max-w-[95vw] flex-col",onCloseAutoFocus:e=>e.preventDefault(),children:[(0,t.jsxs)(o.DialogHeader,{children:[(0,t.jsx)(o.DialogTitle,{children:"Select Folder"}),(0,t.jsx)(o.DialogDescription,{className:"truncate font-mono text-xs",children:p||"Loading..."})]}),(0,t.jsx)("div",{className:"shep-file-manager min-h-0 flex-1 overflow-hidden rounded-md border",children:(0,t.jsx)(s,{files:c.map(e=>({name:e.name,isDirectory:!0,path:`/${e.name}`,absolutePath:e.path,updatedAt:e.updatedAt})),isLoading:h,height:"100%",width:"100%",layout:"list",enableFilePreview:!1,permissions:{upload:!1,delete:!1,create:!1,download:!1,copy:!1,move:!1,rename:!1},onFileOpen:w,onSelectionChange:j,onRefresh:()=>y(p)},p)}),(0,t.jsxs)(o.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:C,children:"Cancel"}),(0,t.jsx)(l.Button,{variant:"secondary",onClick:function(){p&&(n(p),a(!1))},disabled:!p,children:"Select Current Folder"}),(0,t.jsx)(l.Button,{onClick:function(){m&&(n(m),a(!1))},disabled:!m,children:"Select Folder"})]})]})})}e.s(["ReactFileManagerDialog",()=>c],61201),e.s([],13322)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00cc36d1a0cf8ba43cd62eb294be7b82ce25e82a92",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function a(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>a],78521)},57638,71379,61238,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(94237);let n=(0,e.i(3645).default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);e.s(["default",()=>n],71379);var i=e.i(5240),o=e.i(31777);e.i(35364),e.i(98127),e.i(25235);var l=e.i(48249),s=e.i(90033);function d({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})}function u({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function c({className:e,...r}){return(0,t.jsx)(s.Dialog.Overlay,{"data-slot":"sheet-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function f({className:e,children:r,side:a="right",showCloseButton:n=!0,...i}){return(0,t.jsxs)(u,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(s.Dialog.Content,{"data-slot":"sheet-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===a&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===a&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===a&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===a&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...i,children:[r,n?(0,t.jsxs)(s.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,t.jsx)(l.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})]})}function p({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,o.cn)("flex flex-col gap-1.5 p-4",e),...r})}function g({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,o.cn)("text-foreground font-semibold",e),...r})}function h({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,o.cn)("text-muted-foreground text-sm",e),...r})}function b({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,o.cn)("bg-accent animate-pulse rounded-md",e),...r})}e.s(["Skeleton",()=>b],61238);var m=e.i(2828);let v="shep-sidebar-open",x=r.createContext(null);function y(){let e=r.useContext(x);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function w({defaultOpen:e=!0,open:a,onOpenChange:n,className:i,style:l,children:s,...d}){let u=function(){let[e,t]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),r=()=>{t(window.innerWidth<768)};return e.addEventListener("change",r),t(window.innerWidth<768),()=>e.removeEventListener("change",r)},[]),!!e}(),[c,f]=r.useState(!1),[p,g]=r.useState(!1),[h,b]=r.useState(e),y=a??h,w=r.useCallback(e=>{let t="function"==typeof e?e(y):e;n?n(t):b(t);try{localStorage.setItem(v,String(t)),document.cookie=`${v}=${t}; path=/; max-age=31536000; SameSite=Lax`}catch{}},[n,y]),j=r.useCallback(()=>(g(!0),u?f(e=>!e):w(e=>!e)),[u,w,f]);r.useEffect(()=>{try{if(!document.cookie.includes(v)){let e=localStorage.getItem(v);null!=e&&(document.cookie=`${v}=${e}; path=/; max-age=31536000; SameSite=Lax`)}}catch{}},[]),r.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),j())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j]);let C=y?"expanded":"collapsed",S=r.useMemo(()=>({state:C,open:y,setOpen:w,isMobile:u,openMobile:c,setOpenMobile:f,toggleSidebar:j,animated:p}),[C,y,w,u,c,f,j,p]);return(0,t.jsx)(x.Provider,{value:S,children:(0,t.jsx)(m.TooltipProvider,{delayDuration:0,children:(0,t.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...l},className:(0,o.cn)("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...d,children:s})})})}function j({side:e="left",variant:r="sidebar",collapsible:a="offcanvas",className:n,children:i,...l}){let{isMobile:s,state:u,openMobile:c,setOpenMobile:b,animated:m}=y();return"none"===a?(0,t.jsx)("div",{"data-slot":"sidebar",className:(0,o.cn)("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...l,children:i}):s?(0,t.jsx)(d,{open:c,onOpenChange:b,...l,children:(0,t.jsxs)(f,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,t.jsxs)(p,{className:"sr-only",children:[(0,t.jsx)(g,{children:"Sidebar"}),(0,t.jsx)(h,{children:"Displays the mobile sidebar."})]}),(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,t.jsxs)("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":"collapsed"===u?a:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[(0,t.jsx)("div",{"data-slot":"sidebar-gap",className:(0,o.cn)("relative w-(--sidebar-width) bg-transparent",m&&"transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===r||"inset"===r?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,t.jsx)("div",{"data-slot":"sidebar-container",className:(0,o.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex",m&&"transition-[left,right,width] duration-200 ease-linear","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===r||"inset"===r?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...l,children:(0,t.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function C({className:e,...r}){let{toggleSidebar:a}=y();return(0,t.jsx)("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:(0,o.cn)("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...r})}function S({className:e,...r}){return(0,t.jsx)("main",{"data-slot":"sidebar-inset",className:(0,o.cn)("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...r})}function k({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,o.cn)("flex flex-col gap-2 p-2",e),...r})}function D({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,o.cn)("flex flex-col gap-2 p-2",e),...r})}function P({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,o.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function N({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:(0,o.cn)("relative flex w-full min-w-0 flex-col p-2",e),...r})}function A({className:e,asChild:r=!1,...a}){let n=r?i.Slot.Root:"div";return(0,t.jsx)(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:(0,o.cn)("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function E({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:(0,o.cn)("w-full text-sm",e),...r})}function _({className:e,...r}){return(0,t.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,o.cn)("flex w-full min-w-0 flex-col gap-1",e),...r})}function O({className:e,...r}){return(0,t.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,o.cn)("group/menu-item relative",e),...r})}let T=(0,a.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function R({asChild:e=!1,isActive:r=!1,variant:a="default",size:n="default",tooltip:l,className:s,...d}){let u=e?i.Slot.Root:"button",{isMobile:c,state:f}=y(),p=(0,t.jsx)(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":r,className:(0,o.cn)(T({variant:a,size:n}),s),...d});return l?("string"==typeof l&&(l={children:l}),(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{asChild:!0,children:p}),(0,t.jsx)(m.TooltipContent,{side:"right",align:"center",hidden:"collapsed"!==f||c,...l})]})):p}e.s(["Sidebar",()=>j,"SidebarContent",()=>P,"SidebarFooter",()=>D,"SidebarGroup",()=>N,"SidebarGroupContent",()=>E,"SidebarGroupLabel",()=>A,"SidebarHeader",()=>k,"SidebarInset",()=>S,"SidebarMenu",()=>_,"SidebarMenuButton",()=>R,"SidebarMenuItem",()=>O,"SidebarProvider",()=>w,"SidebarRail",()=>C,"useSidebar",()=>y],57638)},5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let a={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null,archived:null};function n(e){return a[e]}let i=(0,r.createContext)(null);function o({children:e}){let[a,n]=(0,r.useState)([]),[o,l]=(0,r.useState)(!1),s=(0,r.useMemo)(()=>({features:a,setFeatures:n,hasRepositories:o,setHasRepositories:l}),[a,o]);return(0,t.jsx)(i.Provider,{value:s,children:e})}function l(){let e=(0,r.useContext)(i);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>o,"mapNodeStateToSidebarStatus",()=>n,"useSidebarFeaturesContext",()=>l])},89305,e=>{e.v(t=>Promise.all(["static/chunks/6d7b999c99d6d175.js"].map(t=>e.l(t))).then(()=>t(15567)))}]);
7
+ 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",()=>k,"AlertDialog",()=>f,"AlertDialogAction",()=>k,"AlertDialogCancel",()=>P,"AlertDialogContent",()=>y,"AlertDialogDescription",()=>S,"AlertDialogOverlay",()=>h,"AlertDialogPortal",()=>g,"AlertDialogTitle",()=>j,"AlertDialogTrigger",()=>p,"Cancel",()=>P,"Content",()=>y,"Description",()=>S,"Overlay",()=>h,"Portal",()=>g,"Root",()=>f,"Title",()=>j,"Trigger",()=>p,"createAlertDialogScope",()=>u],28883);var A=e.i(28883),A=A,E=e.i(31777),_=e.i(35364);function O({...e}){return(0,t.jsx)(A.Root,{"data-slot":"alert-dialog",...e})}function T({...e}){return(0,t.jsx)(A.Portal,{"data-slot":"alert-dialog-portal",...e})}function R({className:e,onClick:r,...a}){return(0,t.jsx)(A.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,E.cn)("fixed inset-0 z-50 bg-black/50",e),onClick:e=>{e.stopPropagation(),r?.(e)},...a})}function M({className:e,size:r="default",...a}){return(0,t.jsxs)(T,{children:[(0,t.jsx)(R,{}),(0,t.jsx)(A.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,E.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),...a})]})}function L({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,E.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,E.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 F({className:e,...r}){return(0,t.jsx)(A.Title,{"data-slot":"alert-dialog-title",className:(0,E.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 I({className:e,...r}){return(0,t.jsx)(A.Description,{"data-slot":"alert-dialog-description",className:(0,E.cn)("text-muted-foreground text-sm",e),...r})}function $({className:e,variant:r="default",size:a="default",...n}){return(0,t.jsx)(_.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(A.Action,{"data-slot":"alert-dialog-action",className:(0,E.cn)(e),...n})})}function U({className:e,variant:r="outline",size:a="default",...n}){return(0,t.jsx)(_.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(A.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,E.cn)(e),...n})})}e.s(["AlertDialog",()=>O,"AlertDialogAction",()=>$,"AlertDialogCancel",()=>U,"AlertDialogContent",()=>M,"AlertDialogDescription",()=>I,"AlertDialogFooter",()=>z,"AlertDialogHeader",()=>L,"AlertDialogTitle",()=>F],71326)},30153,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(71326);let n=(0,r.createContext)(null);function i({children:e}){let i=(0,r.useRef)(null),o=(0,r.useRef)(null),[l,s]=(0,r.useState)(!1),d=(0,r.useCallback)(e=>{i.current=e},[]),u=(0,r.useCallback)(e=>{if(i.current?.isDirty){o.current=e,s(!0);return}e()},[]),c=(0,r.useCallback)(()=>{s(!1),i.current?.onReset(),i.current=null,o.current?.(),o.current=null},[]),f=(0,r.useCallback)(()=>{s(!1),o.current=null},[]),p=(0,r.useCallback)(()=>i.current?.isDirty??!1,[]);return(0,t.jsxs)(n,{value:{setGuard:d,guardedNavigate:u,getIsDirty:p},children:[e,(0,t.jsx)(a.AlertDialog,{open:l,children:(0,t.jsxs)(a.AlertDialogContent,{children:[(0,t.jsxs)(a.AlertDialogHeader,{children:[(0,t.jsx)(a.AlertDialogTitle,{children:"Discard unsaved changes?"}),(0,t.jsx)(a.AlertDialogDescription,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),(0,t.jsxs)(a.AlertDialogFooter,{children:[(0,t.jsx)(a.AlertDialogAction,{variant:"destructive",onClick:c,children:"Discard"}),(0,t.jsx)(a.AlertDialogCancel,{onClick:f,children:"Keep editing"})]})]})})]})}function o(){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:a,onReset:n}){let{setGuard:i,guardedNavigate:l}=o();return(0,r.useEffect)(()=>(e?i({isDirty:t,onReset:n}):i(null),()=>i(null)),[e,t,n,i]),{attemptClose:(0,r.useCallback)(()=>{l(()=>{n(),a()})},[l,a,n])}}e.s(["DrawerCloseGuardProvider",()=>i,"useDrawerCloseGuard",()=>o,"useGuardedDrawerClose",()=>l])},48109,e=>{"use strict";let t=(0,e.i(3645).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",()=>t],48109)},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])},54277,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],30090),e.s(["CircleX",()=>t],54277)},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},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)},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({className:e,type:a,...n}){return(0,t.jsx)("input",{type:a,"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),...n})}e.s(["Input",()=>a])},66459,e=>{"use strict";let t=(0,e.i(3645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},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 a={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return l}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});function i(e){let t={};for(let[r,a]of e.entries()){let e=t[r];void 0===e?t[r]=a:Array.isArray(e)?e.push(a):t[r]=[e,a]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,o(e));else t.set(r,o(a));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,a]of r.entries())e.append(t,a)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return s}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let i=e.r(44066)._(e.r(76314)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,a=e.protocol||"",n=e.pathname||"",l=e.hash||"",s=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||o.test(a))&&!1!==d?(d="//"+(d||""),n&&"/"!==n[0]&&(n="/"+n)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),n=n.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${a}${d}${n}${u}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={DecodeError:function(){return m},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return y},NormalizeError:function(){return v},PageNotFoundError:function(){return x},SP:function(){return h},ST:function(){return b},WEB_VITALS:function(){return i},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return d},getURL:function(){return u},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return j}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...a)=>(r||(r=!0,t=e(...a)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>l.test(e);function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=d();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(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 g(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(r&&f(r))return a;if(!a)throw Object.defineProperty(Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return a}let h="u">typeof performance,b=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class v extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(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 a=e.r(58464),n=e.r(53626);function i(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.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 a}});let a=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return m},useLinkStatus:function(){return x}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let i=e.r(44066),o=e.r(20314),l=i._(e.r(79054)),s=e.r(95889),d=e.r(18152),u=e.r(80764),c=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),g=e.r(51380),h=e.r(95555);function b(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function m(t){var r;let a,n,i,[s,m]=(0,l.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,l.useRef)(null),{href:y,as:w,children:j,prefetch:C=null,passHref:S,replace:k,shallow:D,scroll:P,onClick:N,onMouseEnter:A,onTouchStart:E,legacyBehavior:_=!1,onNavigate:O,ref:T,unstable_dynamicOnHover:R,...M}=t;a=j,_&&("string"==typeof a||"number"==typeof a)&&(a=(0,o.jsx)("a",{children:a}));let L=l.default.useContext(d.AppRouterContext),z=!1!==C,F=!1!==C?null===(r=C)||"auto"===r?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:I,as:$}=l.default.useMemo(()=>{let e=b(y);return{href:e,as:w?b(w):e}},[y,w]);if(_){if(a?.$$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});n=l.default.Children.only(a)}let U=_?n&&"object"==typeof n&&n.ref:T,B=l.default.useCallback(e=>(null!==L&&(x.current=(0,p.mountLinkInstance)(e,I,L,F,z,m)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[z,I,L,F,m]),W={ref:(0,u.useMergedRef)(B,U),onClick(t){_||"function"!=typeof N||N(t),_&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!L||t.defaultPrevented||function(t,r,a,n,i,o,s){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:c}=e.r(81574);l.default.startTransition(()=>{c(a||r,i?"replace":"push",o??!0,n.current)})}}(t,I,$,x,k,P,O)},onMouseEnter(e){_||"function"!=typeof A||A(e),_&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),L&&z&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)},onTouchStart:function(e){_||"function"!=typeof E||E(e),_&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),L&&z&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)}};return(0,c.isAbsoluteUrl)($)?W.href=$:_&&!S&&("a"!==n.type||"href"in n.props)||(W.href=(0,f.addBasePath)($)),i=_?l.default.cloneElement(n,W):(0,o.jsx)("a",{...M,...W,children:a}),(0,o.jsx)(v.Provider,{value:s,children:i})}e.r(38670);let v=(0,l.createContext)(p.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(v);("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)},83241,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let a=e.r(9328);function n({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},90891,(e,t,r)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return a}})},31218,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return s}});let a=e.r(20314),n=e.r(26036),i=e.r(58988),o=e.r(90891),l=e.r(22193);function s({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;r.push(...e)}}if(0===r.length)return null;let s=(0,l.getDeploymentIdQueryOrEmptyString)();return(0,a.jsx)(a.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,o.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,n.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},84929,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return d}});let a=e.r(20314),n=e.r(79054),i=e.r(83241),o=e.r(31218);function l(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},d=function(e){let t={...s,...e},r=(0,n.lazy)(()=>t.loader().then(l)),d=t.loading;function u(e){let l=d?(0,a.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,u=s?n.Suspense:n.Fragment,c=t.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(o.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(r,{...e})]}):(0,a.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(r,{...e})});return(0,a.jsx)(u,{...s?{fallback:l}:{},children:c})}return u.displayName="LoadableComponent",u}},47901,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let a=e.r(81258)._(e.r(84929));function n(e,t){let r={};"function"==typeof e&&(r.loader=e);let n={...r,...t};return(0,a.default)({...n,modules:n.loadableGenerated?.modules})}("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)},13322,61201,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(47901),n=e.i(83428),i=e.i(60112),o=e.i(2287),l=e.i(35364);let s=(0,a.default)(()=>e.A(89305).then(e=>e.FileManager),{loadableGenerated:{modules:[15567]},ssr:!1,loading:()=>(0,t.jsx)(d,{})});function d(){return(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,t.jsx)(n.Loader2,{className:"text-muted-foreground h-8 w-8 animate-spin"})})}async function u(e){let t=new URLSearchParams;e&&t.set("path",e);let r=await fetch(`/api/directory/list?${t.toString()}`);if(!r.ok)throw Error((await r.json().catch(()=>({error:"Failed to load directory"}))).error??"Failed to load directory");return r.json()}function c({open:e,onOpenChange:a,onSelect:n,initialPath:d}){let[c,f]=(0,r.useState)([]),[p,g]=(0,r.useState)(""),[h,b]=(0,r.useState)(!1),[m,v]=(0,r.useState)(null),x=(0,r.useRef)(!1),y=(0,r.useCallback)(async e=>{b(!0),v(null);try{let t=await u(e);f(t.entries),g(t.currentPath)}catch(t){let e=t instanceof Error?t.message:"Failed to load directory";i.toast.error(e)}finally{b(!1)}},[]);(0,r.useEffect)(()=>{e&&!x.current&&(x.current=!0,y(d)),e||(x.current=!1)},[e,d,y]);let w=(0,r.useCallback)(e=>{let t=e.absolutePath;e.isDirectory&&t&&y(t)},[y]),j=(0,r.useCallback)(e=>{1===e.length&&e[0].isDirectory?v(e[0].absolutePath??null):v(null)},[]);function C(){n(null),a(!1)}return(0,t.jsx)(o.Dialog,{open:e,onOpenChange:e=>{e||C()},children:(0,t.jsxs)(o.DialogContent,{className:"flex h-[95dvh] max-w-[95vw] flex-col",onCloseAutoFocus:e=>e.preventDefault(),children:[(0,t.jsxs)(o.DialogHeader,{children:[(0,t.jsx)(o.DialogTitle,{children:"Select Folder"}),(0,t.jsx)(o.DialogDescription,{className:"truncate font-mono text-xs",children:p||"Loading..."})]}),(0,t.jsx)("div",{className:"shep-file-manager min-h-0 flex-1 overflow-hidden rounded-md border",children:(0,t.jsx)(s,{files:c.map(e=>({name:e.name,isDirectory:!0,path:`/${e.name}`,absolutePath:e.path,updatedAt:e.updatedAt})),isLoading:h,height:"100%",width:"100%",layout:"list",enableFilePreview:!1,permissions:{upload:!1,delete:!1,create:!1,download:!1,copy:!1,move:!1,rename:!1},onFileOpen:w,onSelectionChange:j,onRefresh:()=>y(p)},p)}),(0,t.jsxs)(o.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:C,children:"Cancel"}),(0,t.jsx)(l.Button,{variant:"secondary",onClick:function(){p&&(n(p),a(!1))},disabled:!p,children:"Select Current Folder"}),(0,t.jsx)(l.Button,{onClick:function(){m&&(n(m),a(!1))},disabled:!m,children:"Select Folder"})]})]})})}e.s(["ReactFileManagerDialog",()=>c],61201),e.s([],13322)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00691f054f9c25adaf533f263da1cba714d65b2461",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function a(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>a],78521)},57638,71379,61238,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(94237);let n=(0,e.i(3645).default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);e.s(["default",()=>n],71379);var i=e.i(5240),o=e.i(31777);e.i(35364),e.i(98127),e.i(25235);var l=e.i(48249),s=e.i(90033);function d({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})}function u({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function c({className:e,...r}){return(0,t.jsx)(s.Dialog.Overlay,{"data-slot":"sheet-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function f({className:e,children:r,side:a="right",showCloseButton:n=!0,...i}){return(0,t.jsxs)(u,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(s.Dialog.Content,{"data-slot":"sheet-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===a&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===a&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===a&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===a&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...i,children:[r,n?(0,t.jsxs)(s.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,t.jsx)(l.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})]})}function p({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,o.cn)("flex flex-col gap-1.5 p-4",e),...r})}function g({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,o.cn)("text-foreground font-semibold",e),...r})}function h({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,o.cn)("text-muted-foreground text-sm",e),...r})}function b({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,o.cn)("bg-accent animate-pulse rounded-md",e),...r})}e.s(["Skeleton",()=>b],61238);var m=e.i(2828);let v="shep-sidebar-open",x=r.createContext(null);function y(){let e=r.useContext(x);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function w({defaultOpen:e=!0,open:a,onOpenChange:n,className:i,style:l,children:s,...d}){let u=function(){let[e,t]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),r=()=>{t(window.innerWidth<768)};return e.addEventListener("change",r),t(window.innerWidth<768),()=>e.removeEventListener("change",r)},[]),!!e}(),[c,f]=r.useState(!1),[p,g]=r.useState(!1),[h,b]=r.useState(e),y=a??h,w=r.useCallback(e=>{let t="function"==typeof e?e(y):e;n?n(t):b(t);try{localStorage.setItem(v,String(t)),document.cookie=`${v}=${t}; path=/; max-age=31536000; SameSite=Lax`}catch{}},[n,y]),j=r.useCallback(()=>(g(!0),u?f(e=>!e):w(e=>!e)),[u,w,f]);r.useEffect(()=>{try{if(!document.cookie.includes(v)){let e=localStorage.getItem(v);null!=e&&(document.cookie=`${v}=${e}; path=/; max-age=31536000; SameSite=Lax`)}}catch{}},[]),r.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),j())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j]);let C=y?"expanded":"collapsed",S=r.useMemo(()=>({state:C,open:y,setOpen:w,isMobile:u,openMobile:c,setOpenMobile:f,toggleSidebar:j,animated:p}),[C,y,w,u,c,f,j,p]);return(0,t.jsx)(x.Provider,{value:S,children:(0,t.jsx)(m.TooltipProvider,{delayDuration:0,children:(0,t.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...l},className:(0,o.cn)("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...d,children:s})})})}function j({side:e="left",variant:r="sidebar",collapsible:a="offcanvas",className:n,children:i,...l}){let{isMobile:s,state:u,openMobile:c,setOpenMobile:b,animated:m}=y();return"none"===a?(0,t.jsx)("div",{"data-slot":"sidebar",className:(0,o.cn)("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...l,children:i}):s?(0,t.jsx)(d,{open:c,onOpenChange:b,...l,children:(0,t.jsxs)(f,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,t.jsxs)(p,{className:"sr-only",children:[(0,t.jsx)(g,{children:"Sidebar"}),(0,t.jsx)(h,{children:"Displays the mobile sidebar."})]}),(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,t.jsxs)("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":"collapsed"===u?a:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[(0,t.jsx)("div",{"data-slot":"sidebar-gap",className:(0,o.cn)("relative w-(--sidebar-width) bg-transparent",m&&"transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===r||"inset"===r?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,t.jsx)("div",{"data-slot":"sidebar-container",className:(0,o.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex",m&&"transition-[left,right,width] duration-200 ease-linear","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===r||"inset"===r?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...l,children:(0,t.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function C({className:e,...r}){let{toggleSidebar:a}=y();return(0,t.jsx)("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:(0,o.cn)("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...r})}function S({className:e,...r}){return(0,t.jsx)("main",{"data-slot":"sidebar-inset",className:(0,o.cn)("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...r})}function k({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,o.cn)("flex flex-col gap-2 p-2",e),...r})}function D({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,o.cn)("flex flex-col gap-2 p-2",e),...r})}function P({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,o.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function N({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:(0,o.cn)("relative flex w-full min-w-0 flex-col p-2",e),...r})}function A({className:e,asChild:r=!1,...a}){let n=r?i.Slot.Root:"div";return(0,t.jsx)(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:(0,o.cn)("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function E({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:(0,o.cn)("w-full text-sm",e),...r})}function _({className:e,...r}){return(0,t.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,o.cn)("flex w-full min-w-0 flex-col gap-1",e),...r})}function O({className:e,...r}){return(0,t.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,o.cn)("group/menu-item relative",e),...r})}let T=(0,a.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function R({asChild:e=!1,isActive:r=!1,variant:a="default",size:n="default",tooltip:l,className:s,...d}){let u=e?i.Slot.Root:"button",{isMobile:c,state:f}=y(),p=(0,t.jsx)(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":r,className:(0,o.cn)(T({variant:a,size:n}),s),...d});return l?("string"==typeof l&&(l={children:l}),(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{asChild:!0,children:p}),(0,t.jsx)(m.TooltipContent,{side:"right",align:"center",hidden:"collapsed"!==f||c,...l})]})):p}e.s(["Sidebar",()=>j,"SidebarContent",()=>P,"SidebarFooter",()=>D,"SidebarGroup",()=>N,"SidebarGroupContent",()=>E,"SidebarGroupLabel",()=>A,"SidebarHeader",()=>k,"SidebarInset",()=>S,"SidebarMenu",()=>_,"SidebarMenuButton",()=>R,"SidebarMenuItem",()=>O,"SidebarProvider",()=>w,"SidebarRail",()=>C,"useSidebar",()=>y],57638)},5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let a={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null,archived:null};function n(e){return a[e]}let i=(0,r.createContext)(null);function o({children:e}){let[a,n]=(0,r.useState)([]),[o,l]=(0,r.useState)(!1),s=(0,r.useMemo)(()=>({features:a,setFeatures:n,hasRepositories:o,setHasRepositories:l}),[a,o]);return(0,t.jsx)(i.Provider,{value:s,children:e})}function l(){let e=(0,r.useContext)(i);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>o,"mapNodeStateToSidebarStatus",()=>n,"useSidebarFeaturesContext",()=>l])},89305,e=>{e.v(t=>Promise.all(["static/chunks/6d7b999c99d6d175.js"].map(t=>e.l(t))).then(()=>t(15567)))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16868,e=>{"use strict";var t=e.i(43698);e.s(["PaperclipIcon",()=>t.default])},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},42076,e=>{"use strict";async function t(){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(["pickFiles",()=>t])},83843,e=>{"use strict";let t=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>t],83843)},51911,e=>{"use strict";var t=e.i(20314),a=e.i(79054),r=e.i(91967),s=e.i(5978),i=e.i(22528),o=e.i(36589),l=e.i(23405),n=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,i.createContextScope)(c),[h,m]=p(c),x=a.forwardRef((e,i)=>{let{__scopeSwitch:l,name:n,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:v,...w}=e,[y,C]=a.useState(null),k=(0,s.useComposedRefs)(i,e=>C(e)),N=a.useRef(!1),T=!y||v||!!y.closest("form"),[S,P]=(0,o.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:l,checked:S,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":S,"aria-required":m,"data-state":j(S),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,r.composeEventHandlers)(e.onClick,e=>{P(e=>!e),T&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),T&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:n,value:f,checked:S,required:m,disabled:x,form:v,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=a.forwardRef((e,a)=>{let{__scopeSwitch:r,...s}=e,i=m(f,r);return(0,t.jsx)(d.Primitive.span,{"data-state":j(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:a})});g.displayName=f;var b=a.forwardRef(({__scopeSwitch:e,control:r,checked:i,bubbles:o=!0,...d},c)=>{let p=a.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,l.usePrevious)(i),m=(0,n.useSize)(r);return a.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let a=new Event("click",{bubbles:o});t.call(e,i),e.dispatchEvent(a)}},[h,i,o]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function j(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var v=e.i(95291),v=v,w=e.i(31777);function y({className:e,size:a="default",...r}){return(0,t.jsx)(v.Root,{"data-slot":"switch","data-size":a,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),...r,children:(0,t.jsx)(v.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)},15203,e=>{"use strict";var t=e.i(20314),a=e.i(79054),r=e.i(31406),s=e.i(60112),i=e.i(21023);let o=(0,i.createServerReference)("40bab8abf74803d661a3c0846954ef9cad4a8bd05b",i.callServer,void 0,i.findSourceMapURL,"createFeature");var l=e.i(16868),n=e.i(83843),d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428);let m=(0,e.i(3645).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var x=e.i(70471),f=e.i(31777),g=e.i(8361);e.i(1650);var b=e.i(11495),j=e.i(45811),v=e.i(35364),w=e.i(98127),y=e.i(48306),C=e.i(41957),k=e.i(81846),N=e.i(90382),T=e.i(51911),S=e.i(2828),P=e.i(30153);e.i(50032);var R=e.i(86254);let E=(0,i.createServerReference)("40a0a807ed8323488722cb7e4848edc37d94169e2b",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var F=e.i(41413),D=e.i(25235),z=e.i(78521);e.i(13322);var L=e.i(61201),A=e.i(75921),I=e.i(87828),O=e.i(42076);let U=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"]),M=[{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."}],q={allowPrd:!1,allowPlan:!1,allowMerge:!1};function B({open:e,onClose:r,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:n,features:d,repositories:u,initialParentId:h,currentAgentType:w,currentModel:N,initialDescription:D,canPushDirectly:z}){let L=(0,g.useSoundAction)("create"),A=i&&(!u||0===u.length||u.some(e=>e.path===i))?i:"",I=n?.approvalGates??q,B=n?.push??!1,G=n?.openPr??!1,K=n?.ciWatchEnabled!==!1,H=n?.enableEvidence??!1,V=n?.commitEvidence??!1,[Y,J]=(0,a.useState)(D??"");(0,a.useEffect)(()=>{D&&J(D)},[D]);let[X,Z]=(0,a.useState)([]),[Q,_]=(0,a.useState)({...I}),[ee,et]=(0,a.useState)(B),[ea,er]=(0,a.useState)(G),[es,ei]=(0,a.useState)(n?.ciWatchEnabled!==!1),[eo,el]=(0,a.useState)(H),[en,ed]=(0,a.useState)(V),[ec,ep]=(0,a.useState)(void 0),[eu,eh]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!1),[ef,eg]=(0,a.useState)(!1),[eb,ej]=(0,a.useState)(!0),[ev,ew]=(0,a.useState)(void 0),[ey,eC]=(0,a.useState)(void 0),[ek,eN]=(0,a.useState)(A||void 0),[eT,eS]=(0,a.useState)(u??[]),[eP,eR]=(0,a.useState)(!1),[eE,eF]=(0,a.useState)(null),[eD,ez]=(0,a.useState)(!1),eL=(0,a.useRef)(crypto.randomUUID()),eA=(0,a.useRef)(0),eI=(0,a.useRef)(null);(0,a.useEffect)(()=>{n&&(_({...n.approvalGates}),et(n.push),er(n.openPr),ei(!1!==n.ciWatchEnabled),el(n.enableEvidence),ed(n.commitEvidence))},[n]),(0,a.useEffect)(()=>{eS(u??[])},[u]),(0,a.useEffect)(()=>{e&&h&&ep(h)},[e,h]);let[eO,eU]=(0,a.useState)(z??!1);(0,a.useEffect)(()=>{eU(z??!1)},[z]);let eM=(0,a.useRef)(ek);(0,a.useEffect)(()=>{ek&&ek!==eM.current&&(eM.current=ek,E(ek).then(e=>eU(e.canPushDirectly)).catch(()=>eU(!1)))},[ek]),(0,a.useEffect)(()=>{eO&&(eg(!1),et(B),er(G),ej(!0))},[eO,B,G]);let eq=(0,a.useCallback)(()=>{J(""),Z([]),_({...I}),et(B),er(G),ei(K),el(H),ed(V),ep(void 0),eN(A||void 0),eS(u??[]),eh(!1),ex(!1),eg(!1),ej(!0),ew(void 0),eC(void 0),eF(null),eA.current=0,eR(!1)},[I,B,G,H,K,V,A,u]),eB=""!==Y.trim()||X.length>0,{attemptClose:e$}=(0,P.useGuardedDrawerClose)({open:e,isDirty:eB,onClose:r,onReset:eq}),eW=(0,a.useCallback)(async e=>{for(let t of(eF(null),e)){if(t.size>0xa00000)return void eF(`"${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&&!U.has(e))return void eF(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();Z(a=>[...a,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let a=new FormData;a.append("file",t),a.append("sessionId",eL.current);let r=await fetch("/api/attachments/upload",{method:"POST",body:a});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));Z(t=>t.filter(t=>t.id!==e)),eF(t.error??"Upload failed");return}let s=await r.json();Z(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{Z(t=>t.filter(t=>t.id!==e)),eF("Upload failed")}}},[]),eG=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eA.current+=1,1===eA.current&&eR(!0)},[]),eK=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eA.current-=1,0===eA.current&&eR(!1)},[]),eH=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eV=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eA.current=0,eR(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eW(t)},[eW]),eY=(0,a.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let a=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&a.push(t)}a.length>0&&(e.preventDefault(),eW(a))},[eW]),eJ=(0,a.useCallback)(e=>{if(e.preventDefault(),!Y.trim())return;let t=ek??A;t&&(L.play(),s({description:Y.trim(),attachments:X.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:Q.allowPrd??!1,allowPlan:Q.allowPlan??!1,allowMerge:Q.allowMerge??!1},push:!!ef||ee||ea,openPr:!!ef||ea,ciWatchEnabled:es,enableEvidence:eo,commitEvidence:en,fast:eu,forkAndPr:ef,commitSpecs:eb,...em?{pending:em}:{},...ev?{agentType:ev}:{},...ey?{model:ey}:{},...ec?{parentId:ec}:{},sessionId:eL.current}),eq())},[Y,X,Q,ek,A,s,ee,ea,eo,es,en,eu,ef,eb,em,ev,ey,ec,L,eq]),eX=(0,a.useCallback)(async()=>{try{let e=await (0,O.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();Z(a=>[...a,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let a=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eL.current})});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));Z(t=>t.filter(t=>t.id!==e)),eF(t.error??"Upload failed");return}let r=await a.json();Z(t=>t.some(t=>t.id!==e&&t.path===r.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...r,id:e,loading:!1}:t))}catch{Z(t=>t.filter(t=>t.id!==e)),eF("Upload failed")}}}catch{}},[]),eZ=(0,a.useCallback)(e=>{Z(t=>t.filter(t=>t.id!==e))},[]),eQ=(0,a.useCallback)((e,t)=>{Z(a=>a.map(a=>a.id===e?{...a,notes:t}:a))},[]),e_=(0,a.useRef)(null),e0=(0,a.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e_.current?.requestSubmit())},[]),e1=(0,a.useCallback)(()=>{ez(!0)},[]),e5=(0,a.useCallback)(()=>{setTimeout(()=>{let e=eI.current?.contains(document.activeElement),t=eI.current?.querySelector('[aria-expanded="true"]')!==null;e||t||ez(!1)},0)},[]),e2=d&&d.length>0,e3=!A&&!ek,e4=!A&&void 0!==u;return(0,t.jsx)(b.BaseDrawer,{open:e,onClose:e$,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(j.DrawerTitle,{children:"NEW FEATURE"})]}),o?(0,t.jsx)(j.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(k.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:e$,disabled:o,children:"Cancel"}),(0,t.jsx)(v.Button,{type:"submit",form:"create-feature-form",disabled:!Y.trim()||o||e3,children:o?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(S.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e_,id:"create-feature-form",onSubmit:eJ,onKeyDown:e0,className:"flex flex-col gap-4",children:[e4?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(W,{repositories:eT,value:ek,onChange:eN,onAddRepository:e=>{eS(t=>[...t,e]),eN(e.path)},disabled:o})]}):A?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(C.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===A)?.name??A.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":eP?"true":"false",onDragEnter:eG,onDragLeave:eK,onDragOver:eH,onDrop:eV,className:(0,f.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eP&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(C.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eI,onFocus:e1,onBlur:e5,className:(0,f.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eD&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:Y,onChange:e=>J(e.target.value),onPaste:eY,required:!0,disabled:o,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),X.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:X.map(e=>(0,t.jsx)(R.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eZ(e.id),disabled:o,loading:e.loading,notes:e.notes,onNotesChange:t=>eQ(e.id,t)},e.id))}),eE?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eE}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(F.AgentModelPicker,{initialAgentType:ev??w??"claude-code",initialModel:ey??N??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ew(e),eC(t)},disabled:o,className:"w-55"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:em,onCheckedChange:ex,disabled:o}),(0,t.jsxs)(C.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)(S.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"fast-mode",checked:eu,onCheckedChange:eh,disabled:o}),(0,t.jsxs)(C.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)(S.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eX,disabled:o,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(l.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e2&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(C.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)($,{features:d,value:ec,onChange:ep,disabled:o})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(e=>(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:Q[e.id]??!1,onCheckedChange:t=>_(a=>({...a,[e.id]:t})),disabled:o||eu&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(C.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:eu&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=M.every(e=>Q[e.id]),t={};for(let a of M)t[a.id]=!e;_(t)},disabled:o,className:(0,f.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",M.every(e=>Q[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(S.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)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(S.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)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:eo,onCheckedChange:e=>{el(e),e||ed(!1)},disabled:o}),(0,t.jsx)(C.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:en,onCheckedChange:ed,disabled:o||!eo||!ea&&!ef}),(0,t.jsx)(C.Label,{htmlFor:"commit-evidence",className:(0,f.cn)("cursor-pointer text-xs font-medium",(!eo||!ea&&!ef)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ea||ef?eo?"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-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!ef||ee||ea,onCheckedChange:e=>{et(e),!e&&ea&&er(!1)},disabled:o||ef}),(0,t.jsx)(C.Label,{htmlFor:"push",className:(0,f.cn)("cursor-pointer text-xs font-medium",ef&&"opacity-50"),children:"Push"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ef?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!ef||ea,onCheckedChange:e=>{er(e),e||ed(!1)},disabled:o||ef}),(0,t.jsx)(C.Label,{htmlFor:"open-pr",className:(0,f.cn)("cursor-pointer text-xs font-medium",ef&&"opacity-50"),children:"PR"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ef?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:es,onCheckedChange:ei,disabled:o}),(0,t.jsx)(C.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:eb,onCheckedChange:ej,disabled:o}),(0,t.jsxs)(C.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(x.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),!eO&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:ef,onCheckedChange:e=>{eg(e),e&&ej(!1)},disabled:o}),(0,t.jsxs)(C.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function $({features:e,value:r,onChange:s,disabled:i}){let[o,l]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),u=(0,a.useRef)(null),h=e.find(e=>e.id===r),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,a.useCallback)(e=>{s(e),l(!1),p("")},[s]);return(0,a.useEffect)(()=>{o?setTimeout(()=>u.current?.focus(),0):p("")},[o]),(0,t.jsxs)(N.Popover,{open:o,onOpenChange:l,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":o,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,f.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)(n.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.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)(w.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===r,onClick:()=>x(void 0),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===r&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",void 0!==r&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.id,onClick:()=>x(e.id),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",r===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",r!==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 W({repositories:e,value:r,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,a.useState)(!1),[p,m]=(0,a.useState)(""),[x,g]=(0,a.useState)(!1),[b,j]=(0,a.useState)(null),[v,y]=(0,a.useState)(!1),C=(0,a.useRef)(null),{reactFileManager:k}=(0,A.useFeatureFlags)(),T=e.find(e=>e.path===r),S=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,P=(0,a.useCallback)(e=>{s(e),c(!1),m("")},[s]),R=(0,a.useCallback)(async e=>{let t=await (0,I.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};i?.(e),s(e.path),c(!1),m("")}},[i,s]),E=(0,a.useCallback)(async()=>{if(!x){if(k)return void y(!0);g(!0),j(null);try{let e=await (0,z.pickFolder)();if(!e)return void g(!1);await R(e)}catch{y(!0)}finally{g(!1)}}},[x,k,R]),F=(0,a.useCallback)(async e=>{if(y(!1),e){g(!0),j(null);try{await R(e)}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[R]);return(0,a.useEffect)(()=>{l?setTimeout(()=>C.current?.focus(),0):m("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(N.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository",disabled:o,"data-testid":"repository-combobox",className:(0,f.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",!T&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:T?T.name:"Select repository..."}),(0,t.jsx)(n.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.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)(w.Input,{ref:C,placeholder:"Search repositories...",value:p,onChange:e=>m(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===S.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):S.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.path,onClick:()=>P(e.path),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",r===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",r!==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)(D.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:E,disabled:x,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:[x?(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]})})]}),(0,t.jsx)(L.ReactFileManagerDialog,{open:v,onOpenChange:e=>{e||y(!1)},onSelect:F})]})}function G({repositoryPath:e,initialParentId:i,initialDescription:l,features:n,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,r.useRouter)(),[x,f]=(0,a.useState)(!1),g=(0,r.usePathname)().startsWith("/create"),b=!x&&g;(0,a.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,a.useCallback)(()=>{m.push("/")},[m]),v=(0,a.useCallback)(e=>{f(!0),m.push("/"),o(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"),f(!1)})},[m]);return(0,t.jsx)(B,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:n,repositories:d,workflowDefaults:c,initialParentId:i,initialDescription:l,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}e.s(["CreateDrawerClient",()=>G],15203)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16868,e=>{"use strict";var t=e.i(43698);e.s(["PaperclipIcon",()=>t.default])},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},42076,e=>{"use strict";async function t(){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(["pickFiles",()=>t])},83843,e=>{"use strict";let t=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>t],83843)},51911,e=>{"use strict";var t=e.i(20314),a=e.i(79054),r=e.i(91967),s=e.i(5978),i=e.i(22528),o=e.i(36589),l=e.i(23405),n=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,i.createContextScope)(c),[h,m]=p(c),x=a.forwardRef((e,i)=>{let{__scopeSwitch:l,name:n,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:v,...w}=e,[y,C]=a.useState(null),k=(0,s.useComposedRefs)(i,e=>C(e)),N=a.useRef(!1),T=!y||v||!!y.closest("form"),[S,P]=(0,o.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:l,checked:S,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":S,"aria-required":m,"data-state":j(S),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,r.composeEventHandlers)(e.onClick,e=>{P(e=>!e),T&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),T&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:n,value:f,checked:S,required:m,disabled:x,form:v,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=a.forwardRef((e,a)=>{let{__scopeSwitch:r,...s}=e,i=m(f,r);return(0,t.jsx)(d.Primitive.span,{"data-state":j(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:a})});g.displayName=f;var b=a.forwardRef(({__scopeSwitch:e,control:r,checked:i,bubbles:o=!0,...d},c)=>{let p=a.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,l.usePrevious)(i),m=(0,n.useSize)(r);return a.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let a=new Event("click",{bubbles:o});t.call(e,i),e.dispatchEvent(a)}},[h,i,o]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function j(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var v=e.i(95291),v=v,w=e.i(31777);function y({className:e,size:a="default",...r}){return(0,t.jsx)(v.Root,{"data-slot":"switch","data-size":a,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),...r,children:(0,t.jsx)(v.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)},15203,e=>{"use strict";var t=e.i(20314),a=e.i(79054),r=e.i(31406),s=e.i(60112),i=e.i(21023);let o=(0,i.createServerReference)("40f0a407b3e01924a5eaeb9fba767be80f4b49ee78",i.callServer,void 0,i.findSourceMapURL,"createFeature");var l=e.i(16868),n=e.i(83843),d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428);let m=(0,e.i(3645).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var x=e.i(70471),f=e.i(31777),g=e.i(8361);e.i(1650);var b=e.i(11495),j=e.i(45811),v=e.i(35364),w=e.i(98127),y=e.i(48306),C=e.i(41957),k=e.i(81846),N=e.i(90382),T=e.i(51911),S=e.i(2828),P=e.i(30153);e.i(50032);var R=e.i(86254);let E=(0,i.createServerReference)("40e9ec516fdf6c900fe222e3a6fd4d75b55d238cc3",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var F=e.i(41413),D=e.i(25235),z=e.i(78521);e.i(13322);var L=e.i(61201),A=e.i(75921),I=e.i(60452),O=e.i(42076);let U=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"]),M=[{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."}],q={allowPrd:!1,allowPlan:!1,allowMerge:!1};function B({open:e,onClose:r,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:n,features:d,repositories:u,initialParentId:h,currentAgentType:w,currentModel:N,initialDescription:D,canPushDirectly:z}){let L=(0,g.useSoundAction)("create"),A=i&&(!u||0===u.length||u.some(e=>e.path===i))?i:"",I=n?.approvalGates??q,B=n?.push??!1,G=n?.openPr??!1,K=n?.ciWatchEnabled!==!1,H=n?.enableEvidence??!1,V=n?.commitEvidence??!1,[Y,J]=(0,a.useState)(D??"");(0,a.useEffect)(()=>{D&&J(D)},[D]);let[X,Z]=(0,a.useState)([]),[Q,_]=(0,a.useState)({...I}),[ee,et]=(0,a.useState)(B),[ea,er]=(0,a.useState)(G),[es,ei]=(0,a.useState)(n?.ciWatchEnabled!==!1),[eo,el]=(0,a.useState)(H),[en,ed]=(0,a.useState)(V),[ec,ep]=(0,a.useState)(void 0),[eu,eh]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!1),[ef,eg]=(0,a.useState)(!1),[eb,ej]=(0,a.useState)(!0),[ev,ew]=(0,a.useState)(void 0),[ey,eC]=(0,a.useState)(void 0),[ek,eN]=(0,a.useState)(A||void 0),[eT,eS]=(0,a.useState)(u??[]),[eP,eR]=(0,a.useState)(!1),[eE,eF]=(0,a.useState)(null),[eD,ez]=(0,a.useState)(!1),eL=(0,a.useRef)(crypto.randomUUID()),eA=(0,a.useRef)(0),eI=(0,a.useRef)(null);(0,a.useEffect)(()=>{n&&(_({...n.approvalGates}),et(n.push),er(n.openPr),ei(!1!==n.ciWatchEnabled),el(n.enableEvidence),ed(n.commitEvidence))},[n]),(0,a.useEffect)(()=>{eS(u??[])},[u]),(0,a.useEffect)(()=>{e&&h&&ep(h)},[e,h]);let[eO,eU]=(0,a.useState)(z??!1);(0,a.useEffect)(()=>{eU(z??!1)},[z]);let eM=(0,a.useRef)(ek);(0,a.useEffect)(()=>{ek&&ek!==eM.current&&(eM.current=ek,E(ek).then(e=>eU(e.canPushDirectly)).catch(()=>eU(!1)))},[ek]),(0,a.useEffect)(()=>{eO&&(eg(!1),et(B),er(G),ej(!0))},[eO,B,G]);let eq=(0,a.useCallback)(()=>{J(""),Z([]),_({...I}),et(B),er(G),ei(K),el(H),ed(V),ep(void 0),eN(A||void 0),eS(u??[]),eh(!1),ex(!1),eg(!1),ej(!0),ew(void 0),eC(void 0),eF(null),eA.current=0,eR(!1)},[I,B,G,H,K,V,A,u]),eB=""!==Y.trim()||X.length>0,{attemptClose:e$}=(0,P.useGuardedDrawerClose)({open:e,isDirty:eB,onClose:r,onReset:eq}),eW=(0,a.useCallback)(async e=>{for(let t of(eF(null),e)){if(t.size>0xa00000)return void eF(`"${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&&!U.has(e))return void eF(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();Z(a=>[...a,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let a=new FormData;a.append("file",t),a.append("sessionId",eL.current);let r=await fetch("/api/attachments/upload",{method:"POST",body:a});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));Z(t=>t.filter(t=>t.id!==e)),eF(t.error??"Upload failed");return}let s=await r.json();Z(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{Z(t=>t.filter(t=>t.id!==e)),eF("Upload failed")}}},[]),eG=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eA.current+=1,1===eA.current&&eR(!0)},[]),eK=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eA.current-=1,0===eA.current&&eR(!1)},[]),eH=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eV=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eA.current=0,eR(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eW(t)},[eW]),eY=(0,a.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let a=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&a.push(t)}a.length>0&&(e.preventDefault(),eW(a))},[eW]),eJ=(0,a.useCallback)(e=>{if(e.preventDefault(),!Y.trim())return;let t=ek??A;t&&(L.play(),s({description:Y.trim(),attachments:X.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:Q.allowPrd??!1,allowPlan:Q.allowPlan??!1,allowMerge:Q.allowMerge??!1},push:!!ef||ee||ea,openPr:!!ef||ea,ciWatchEnabled:es,enableEvidence:eo,commitEvidence:en,fast:eu,forkAndPr:ef,commitSpecs:eb,...em?{pending:em}:{},...ev?{agentType:ev}:{},...ey?{model:ey}:{},...ec?{parentId:ec}:{},sessionId:eL.current}),eq())},[Y,X,Q,ek,A,s,ee,ea,eo,es,en,eu,ef,eb,em,ev,ey,ec,L,eq]),eX=(0,a.useCallback)(async()=>{try{let e=await (0,O.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();Z(a=>[...a,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let a=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eL.current})});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));Z(t=>t.filter(t=>t.id!==e)),eF(t.error??"Upload failed");return}let r=await a.json();Z(t=>t.some(t=>t.id!==e&&t.path===r.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...r,id:e,loading:!1}:t))}catch{Z(t=>t.filter(t=>t.id!==e)),eF("Upload failed")}}}catch{}},[]),eZ=(0,a.useCallback)(e=>{Z(t=>t.filter(t=>t.id!==e))},[]),eQ=(0,a.useCallback)((e,t)=>{Z(a=>a.map(a=>a.id===e?{...a,notes:t}:a))},[]),e_=(0,a.useRef)(null),e0=(0,a.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e_.current?.requestSubmit())},[]),e1=(0,a.useCallback)(()=>{ez(!0)},[]),e5=(0,a.useCallback)(()=>{setTimeout(()=>{let e=eI.current?.contains(document.activeElement),t=eI.current?.querySelector('[aria-expanded="true"]')!==null;e||t||ez(!1)},0)},[]),e2=d&&d.length>0,e3=!A&&!ek,e4=!A&&void 0!==u;return(0,t.jsx)(b.BaseDrawer,{open:e,onClose:e$,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(j.DrawerTitle,{children:"NEW FEATURE"})]}),o?(0,t.jsx)(j.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(k.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:e$,disabled:o,children:"Cancel"}),(0,t.jsx)(v.Button,{type:"submit",form:"create-feature-form",disabled:!Y.trim()||o||e3,children:o?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(S.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e_,id:"create-feature-form",onSubmit:eJ,onKeyDown:e0,className:"flex flex-col gap-4",children:[e4?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(W,{repositories:eT,value:ek,onChange:eN,onAddRepository:e=>{eS(t=>[...t,e]),eN(e.path)},disabled:o})]}):A?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(C.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===A)?.name??A.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":eP?"true":"false",onDragEnter:eG,onDragLeave:eK,onDragOver:eH,onDrop:eV,className:(0,f.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eP&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(C.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eI,onFocus:e1,onBlur:e5,className:(0,f.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eD&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:Y,onChange:e=>J(e.target.value),onPaste:eY,required:!0,disabled:o,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),X.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:X.map(e=>(0,t.jsx)(R.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eZ(e.id),disabled:o,loading:e.loading,notes:e.notes,onNotesChange:t=>eQ(e.id,t)},e.id))}),eE?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eE}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(F.AgentModelPicker,{initialAgentType:ev??w??"claude-code",initialModel:ey??N??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ew(e),eC(t)},disabled:o,className:"w-55"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:em,onCheckedChange:ex,disabled:o}),(0,t.jsxs)(C.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)(S.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"fast-mode",checked:eu,onCheckedChange:eh,disabled:o}),(0,t.jsxs)(C.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)(S.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eX,disabled:o,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(l.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),e2&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(C.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)($,{features:d,value:ec,onChange:ep,disabled:o})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:M.map(e=>(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:Q[e.id]??!1,onCheckedChange:t=>_(a=>({...a,[e.id]:t})),disabled:o||eu&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(C.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:eu&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=M.every(e=>Q[e.id]),t={};for(let a of M)t[a.id]=!e;_(t)},disabled:o,className:(0,f.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",M.every(e=>Q[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(S.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)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(S.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)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:eo,onCheckedChange:e=>{el(e),e||ed(!1)},disabled:o}),(0,t.jsx)(C.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:en,onCheckedChange:ed,disabled:o||!eo||!ea&&!ef}),(0,t.jsx)(C.Label,{htmlFor:"commit-evidence",className:(0,f.cn)("cursor-pointer text-xs font-medium",(!eo||!ea&&!ef)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ea||ef?eo?"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-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!ef||ee||ea,onCheckedChange:e=>{et(e),!e&&ea&&er(!1)},disabled:o||ef}),(0,t.jsx)(C.Label,{htmlFor:"push",className:(0,f.cn)("cursor-pointer text-xs font-medium",ef&&"opacity-50"),children:"Push"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ef?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!ef||ea,onCheckedChange:e=>{er(e),e||ed(!1)},disabled:o||ef}),(0,t.jsx)(C.Label,{htmlFor:"open-pr",className:(0,f.cn)("cursor-pointer text-xs font-medium",ef&&"opacity-50"),children:"PR"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ef?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:es,onCheckedChange:ei,disabled:o}),(0,t.jsx)(C.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:eb,onCheckedChange:ej,disabled:o}),(0,t.jsxs)(C.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(x.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),!eO&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:ef,onCheckedChange:e=>{eg(e),e&&ej(!1)},disabled:o}),(0,t.jsxs)(C.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function $({features:e,value:r,onChange:s,disabled:i}){let[o,l]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),u=(0,a.useRef)(null),h=e.find(e=>e.id===r),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,a.useCallback)(e=>{s(e),l(!1),p("")},[s]);return(0,a.useEffect)(()=>{o?setTimeout(()=>u.current?.focus(),0):p("")},[o]),(0,t.jsxs)(N.Popover,{open:o,onOpenChange:l,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":o,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,f.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)(n.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.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)(w.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===r,onClick:()=>x(void 0),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===r&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",void 0!==r&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.id,onClick:()=>x(e.id),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",r===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",r!==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 W({repositories:e,value:r,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,a.useState)(!1),[p,m]=(0,a.useState)(""),[x,g]=(0,a.useState)(!1),[b,j]=(0,a.useState)(null),[v,y]=(0,a.useState)(!1),C=(0,a.useRef)(null),{reactFileManager:k}=(0,A.useFeatureFlags)(),T=e.find(e=>e.path===r),S=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,P=(0,a.useCallback)(e=>{s(e),c(!1),m("")},[s]),R=(0,a.useCallback)(async e=>{let t=await (0,I.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};i?.(e),s(e.path),c(!1),m("")}},[i,s]),E=(0,a.useCallback)(async()=>{if(!x){if(k)return void y(!0);g(!0),j(null);try{let e=await (0,z.pickFolder)();if(!e)return void g(!1);await R(e)}catch{y(!0)}finally{g(!1)}}},[x,k,R]),F=(0,a.useCallback)(async e=>{if(y(!1),e){g(!0),j(null);try{await R(e)}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[R]);return(0,a.useEffect)(()=>{l?setTimeout(()=>C.current?.focus(),0):m("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(N.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository",disabled:o,"data-testid":"repository-combobox",className:(0,f.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",!T&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:T?T.name:"Select repository..."}),(0,t.jsx)(n.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.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)(w.Input,{ref:C,placeholder:"Search repositories...",value:p,onChange:e=>m(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===S.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):S.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.path,onClick:()=>P(e.path),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",r===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",r!==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)(D.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:E,disabled:x,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:[x?(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]})})]}),(0,t.jsx)(L.ReactFileManagerDialog,{open:v,onOpenChange:e=>{e||y(!1)},onSelect:F})]})}function G({repositoryPath:e,initialParentId:i,initialDescription:l,features:n,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,r.useRouter)(),[x,f]=(0,a.useState)(!1),g=(0,r.usePathname)().startsWith("/create"),b=!x&&g;(0,a.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,a.useCallback)(()=>{m.push("/")},[m]),v=(0,a.useCallback)(e=>{f(!0),m.push("/"),o(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"),f(!1)})},[m]);return(0,t.jsx)(B,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:n,repositories:d,workflowDefaults:c,initialParentId:i,initialDescription:l,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}e.s(["CreateDrawerClient",()=>G],15203)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76852,e=>{"use strict";var t=e.i(79054),r=e.i(6564),a=e.i(39275),l=e.i(26988),c=e.i(21023);let s=(0,c.createServerReference)("40cff3606219016f24bef4d21359b742dee6c5aa68",c.callServer,void 0,c.findSourceMapURL,"syncRepository");function u(e){let[c,u]=(0,t.useState)(!1),[i,n]=(0,t.useState)(!1),[d,o]=(0,t.useState)(!1),[p,f]=(0,t.useState)(!1),[h,y]=(0,t.useState)(null),[m,v]=(0,t.useState)(null),[k,S]=(0,t.useState)(null),[x,b]=(0,t.useState)(null),R=(0,t.useRef)(null),M=(0,t.useRef)(null),g=(0,t.useRef)(null),C=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{R.current&&clearTimeout(R.current),M.current&&clearTimeout(M.current),g.current&&clearTimeout(g.current),C.current&&clearTimeout(C.current)},[]);let T=(0,t.useCallback)(async(t,r,a,l,c)=>{if(e&&!c){l.current&&clearTimeout(l.current),r(!0),a(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";a(t),l.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>a(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>T(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),u,y,R,c),[T,c,e]),openInShell:(0,t.useCallback)(()=>T(()=>(0,a.openShell)({repositoryPath:e.repositoryPath}),n,v,M,i),[T,i,e]),openFolder:(0,t.useCallback)(()=>T(()=>(0,l.openFolder)(e.repositoryPath),o,S,g,d),[T,d,e]),syncMain:(0,t.useCallback)(()=>T(()=>s(e.repositoryId??""),f,b,C,p),[T,p,e]),ideLoading:c,shellLoading:i,folderLoading:d,syncLoading:p,ideError:h,shellError:m,folderError:k,syncError:x}}e.s(["useRepositoryActions",()=>u],76852)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},1650,e=>{"use strict";e.i(11495),e.s([])},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,6564,39275,26988,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 a=(0,r.createServerReference)("4065daa4edfafe9fc8c07f75fefe357d2f8701653e",r.callServer,void 0,r.findSourceMapURL,"openIde");e.s(["openIde",()=>a],6564);let l=(0,r.createServerReference)("40b6e62477e96bc1fd2ebb7d3157e48f3f2266298a",r.callServer,void 0,r.findSourceMapURL,"openShell");e.s(["openShell",()=>l],39275);let c=(0,r.createServerReference)("40865682d29550a7e439c0ea91c2d82c0c6717b4a3",r.callServer,void 0,r.findSourceMapURL,"openFolder");e.s(["openFolder",()=>c],26988)},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])},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])},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)},10714,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>t])},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)},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)},54793,7729,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({icon:e,title:a,description:l,action:c,className:s,...u}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",s),...u,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:a}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,c?(0,t.jsx)("div",{className:"mt-2",children:c}):null]})}e.s(["EmptyState",()=>a],7729),e.s([],54793)},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)},60452,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("40a09ffc06dbb951db11c053380b28d8311978d4e1",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])}]);