@shepai/cli 1.72.2 → 1.72.4

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 (266) hide show
  1. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +5 -0
  2. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  3. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +42 -1
  4. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.d.ts.map +1 -1
  5. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.js +1 -1
  6. package/dist/src/presentation/web/components/common/control-center-drawer/control-center-drawer.stories.d.ts.map +1 -1
  7. package/dist/src/presentation/web/components/common/control-center-drawer/control-center-drawer.stories.js +4 -0
  8. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  9. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +28 -4
  10. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.d.ts +4 -0
  11. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.d.ts.map +1 -1
  12. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts +1 -1
  13. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts.map +1 -1
  14. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +4 -2
  15. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  16. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +6 -5
  17. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +5 -0
  18. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  19. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +24 -0
  20. package/dist/src/presentation/web/components/common/merge-review/merge-review-config.d.ts +4 -0
  21. package/dist/src/presentation/web/components/common/merge-review/merge-review-config.d.ts.map +1 -1
  22. package/dist/src/presentation/web/components/common/merge-review/merge-review.d.ts +1 -1
  23. package/dist/src/presentation/web/components/common/merge-review/merge-review.d.ts.map +1 -1
  24. package/dist/src/presentation/web/components/common/merge-review/merge-review.js +2 -2
  25. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.d.ts +4 -0
  26. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.d.ts.map +1 -1
  27. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.d.ts +1 -1
  28. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.d.ts.map +1 -1
  29. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.js +2 -2
  30. package/dist/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs-config.d.ts +4 -0
  31. package/dist/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs-config.d.ts.map +1 -1
  32. package/dist/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs.d.ts +1 -1
  33. package/dist/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs.d.ts.map +1 -1
  34. package/dist/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs.js +2 -2
  35. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  36. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +11 -7
  37. package/dist/src/presentation/web/components/features/control-center/control-center.stories.d.ts.map +1 -1
  38. package/dist/src/presentation/web/components/features/control-center/control-center.stories.js +2 -1
  39. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
  40. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +7 -5
  41. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +1 -1
  42. package/dist/src/presentation/web/components/ui/alert-dialog.stories.js +1 -1
  43. package/dist/src/presentation/web/hooks/drawer-close-guard.d.ts +24 -0
  44. package/dist/src/presentation/web/hooks/drawer-close-guard.d.ts.map +1 -0
  45. package/dist/src/presentation/web/hooks/drawer-close-guard.js +73 -0
  46. package/dist/tsconfig.build.tsbuildinfo +1 -1
  47. package/package.json +1 -1
  48. package/web/.next/BUILD_ID +1 -1
  49. package/web/.next/build-manifest.json +2 -2
  50. package/web/.next/cache/.previewinfo +1 -1
  51. package/web/.next/cache/.rscinfo +1 -1
  52. package/web/.next/cache/.tsbuildinfo +1 -1
  53. package/web/.next/cache/config.json +3 -3
  54. package/web/.next/fallback-build-manifest.json +2 -2
  55. package/web/.next/prerender-manifest.json +3 -3
  56. package/web/.next/required-server-files.js +1 -1
  57. package/web/.next/required-server-files.json +1 -1
  58. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +14 -14
  59. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +17 -17
  62. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
  65. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +14 -14
  68. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +17 -17
  71. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  72. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -12
  74. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
  77. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  78. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  79. package/web/.next/server/app/_global-error.html +2 -2
  80. package/web/.next/server/app/_global-error.rsc +1 -1
  81. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  82. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  84. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  85. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  86. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  87. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  88. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  89. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  90. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  91. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
  93. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  94. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  95. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  96. package/web/.next/server/app/version/page.js.nft.json +1 -1
  97. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  99. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  100. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_2b7834f6.js +1 -1
  101. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_2b7834f6.js.map +1 -1
  102. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6923c575.js +1 -1
  103. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6923c575.js.map +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__07385073._.js +2 -2
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__07385073._.js.map +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
  107. package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js.map +1 -1
  108. package/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
  109. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  110. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +1 -1
  112. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/[root-of-the-server]__6db85a66._.js +2 -2
  114. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  115. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/[root-of-the-server]__8fcb9132._.js +2 -2
  117. package/web/.next/server/chunks/ssr/_00e6c698._.js +1 -1
  118. package/web/.next/server/chunks/ssr/_00e6c698._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/_07c2a32a._.js +9 -0
  120. package/web/.next/server/chunks/ssr/_07c2a32a._.js.map +1 -0
  121. package/web/.next/server/chunks/ssr/_26129e04._.js +3 -0
  122. package/web/.next/server/chunks/ssr/_26129e04._.js.map +1 -0
  123. package/web/.next/server/chunks/ssr/_37259405._.js +1 -1
  124. package/web/.next/server/chunks/ssr/_37259405._.js.map +1 -1
  125. package/web/.next/server/chunks/ssr/{_3b7ed6be._.js → _6f07b817._.js} +3 -9
  126. package/web/.next/server/chunks/ssr/_6f07b817._.js.map +1 -0
  127. package/web/.next/server/chunks/ssr/_85d0351b._.js +1 -1
  128. package/web/.next/server/chunks/ssr/_85d0351b._.js.map +1 -1
  129. package/web/.next/server/chunks/ssr/_fc3a6895._.js +1 -1
  130. package/web/.next/server/chunks/ssr/_fc3a6895._.js.map +1 -1
  131. package/web/.next/server/chunks/ssr/src_presentation_web_1a32dbcb._.js +2 -2
  132. package/web/.next/server/chunks/ssr/src_presentation_web_1a32dbcb._.js.map +1 -1
  133. package/web/.next/server/chunks/ssr/src_presentation_web_398553b0._.js +1 -1
  134. package/web/.next/server/chunks/ssr/src_presentation_web_398553b0._.js.map +1 -1
  135. package/web/.next/server/chunks/ssr/src_presentation_web_5c87e8e4._.js +1 -1
  136. package/web/.next/server/chunks/ssr/src_presentation_web_5c87e8e4._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f4952172.js +1 -1
  138. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f4952172.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/src_presentation_web_c1bc6240._.js +2 -2
  140. package/web/.next/server/chunks/ssr/src_presentation_web_c1bc6240._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  142. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.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 +20 -20
  148. package/web/.next/standalone/src/presentation/web/.next/BUILD_ID +1 -1
  149. package/web/.next/standalone/src/presentation/web/.next/build-manifest.json +2 -2
  150. package/web/.next/standalone/src/presentation/web/.next/prerender-manifest.json +3 -3
  151. package/web/.next/standalone/src/presentation/web/.next/required-server-files.json +1 -1
  152. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +14 -14
  153. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  154. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  155. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +17 -17
  156. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  157. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  158. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
  159. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  160. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  161. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +14 -14
  162. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  163. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  164. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +17 -17
  165. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  166. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  167. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -12
  168. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  169. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  170. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
  171. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  172. package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  173. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.html +2 -2
  174. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.rsc +1 -1
  175. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  176. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  177. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  178. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  179. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  180. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  181. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  182. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  183. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  184. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page.js.nft.json +1 -1
  185. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  186. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
  187. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page.js.nft.json +1 -1
  188. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  189. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  190. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page.js.nft.json +1 -1
  191. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  192. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  193. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_2b7834f6.js +1 -1
  194. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6923c575.js +1 -1
  195. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__07385073._.js +2 -2
  196. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
  197. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
  198. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  199. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +1 -1
  200. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6db85a66._.js +2 -2
  201. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  202. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__8fcb9132._.js +2 -2
  203. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_00e6c698._.js +1 -1
  204. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_07c2a32a._.js +9 -0
  205. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_26129e04._.js +3 -0
  206. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_37259405._.js +1 -1
  207. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/{_3b7ed6be._.js → _6f07b817._.js} +3 -9
  208. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_85d0351b._.js +1 -1
  209. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_fc3a6895._.js +1 -1
  210. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_1a32dbcb._.js +2 -2
  211. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_398553b0._.js +1 -1
  212. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_5c87e8e4._.js +1 -1
  213. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f4952172.js +1 -1
  214. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_c1bc6240._.js +2 -2
  215. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  216. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  217. package/web/.next/standalone/src/presentation/web/.next/server/pages/500.html +2 -2
  218. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.js +1 -1
  219. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.json +20 -20
  220. package/web/.next/standalone/src/presentation/web/components/common/base-drawer/base-drawer.tsx +1 -0
  221. package/web/.next/standalone/src/presentation/web/components/common/control-center-drawer/control-center-drawer.stories.tsx +8 -0
  222. package/web/.next/standalone/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx +37 -1
  223. package/web/.next/standalone/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.ts +4 -0
  224. package/web/.next/standalone/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.tsx +5 -1
  225. package/web/.next/standalone/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.tsx +32 -0
  226. package/web/.next/standalone/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.tsx +8 -6
  227. package/web/.next/standalone/src/presentation/web/components/common/merge-review/merge-review-config.ts +4 -0
  228. package/web/.next/standalone/src/presentation/web/components/common/merge-review/merge-review.tsx +4 -0
  229. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire-config.ts +4 -0
  230. package/web/.next/standalone/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.tsx +4 -0
  231. package/web/.next/standalone/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs-config.ts +4 -0
  232. package/web/.next/standalone/src/presentation/web/components/common/tech-review-tabs/tech-review-tabs.tsx +4 -0
  233. package/web/.next/standalone/src/presentation/web/components/features/control-center/control-center-inner.tsx +11 -7
  234. package/web/.next/standalone/src/presentation/web/components/features/control-center/control-center.stories.tsx +6 -3
  235. package/web/.next/standalone/src/presentation/web/components/layouts/app-shell/app-shell.tsx +11 -7
  236. package/web/.next/standalone/src/presentation/web/components/layouts/app-sidebar/app-sidebar.tsx +1 -1
  237. package/web/.next/standalone/src/presentation/web/components/ui/alert-dialog.stories.tsx +1 -1
  238. package/web/.next/standalone/src/presentation/web/hooks/drawer-close-guard.tsx +145 -0
  239. package/web/.next/standalone/src/presentation/web/server.js +1 -1
  240. package/web/.next/static/chunks/00adfce42dbbd5ef.js +1 -0
  241. package/web/.next/static/chunks/{47435830535491e8.js → 3c79bca4d3f18f66.js} +1 -1
  242. package/web/.next/static/chunks/{1504cbcaf92b4b2d.js → 498879011ae095f1.js} +4 -10
  243. package/web/.next/static/chunks/{466baf7a55999a1f.js → 8b185ff4023149e8.js} +1 -1
  244. package/web/.next/static/chunks/{d6ef93754d3c4f0a.js → a6a90c6798cbc332.js} +1 -1
  245. package/web/.next/static/chunks/{bc0603840fd6ec75.js → a7d37a627c7869eb.js} +1 -1
  246. package/web/.next/static/chunks/{b7bed3aac7f4d9fe.js → b17ac661ba6821cd.js} +1 -1
  247. package/web/.next/static/chunks/d717b59752363f9b.js +1 -0
  248. package/web/.next/static/chunks/d7cc1029085b27db.js +1 -0
  249. package/web/.next/static/chunks/{56afde0c6e467c43.js → d9a30c62ba67d6da.js} +1 -1
  250. package/web/.next/static/chunks/ef5c9b5ca75f5471.js +7 -0
  251. package/web/.next/trace +1 -1
  252. package/web/.next/trace-build +1 -1
  253. package/web/.next/server/chunks/ssr/_3b7ed6be._.js.map +0 -1
  254. package/web/.next/server/chunks/ssr/_45715073._.js +0 -3
  255. package/web/.next/server/chunks/ssr/_45715073._.js.map +0 -1
  256. package/web/.next/server/chunks/ssr/node_modules__pnpm_11589942._.js +0 -3
  257. package/web/.next/server/chunks/ssr/node_modules__pnpm_11589942._.js.map +0 -1
  258. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_45715073._.js +0 -3
  259. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/node_modules__pnpm_11589942._.js +0 -3
  260. package/web/.next/static/chunks/0b99eb9664d47ca7.js +0 -1
  261. package/web/.next/static/chunks/2b01e3e93da2749c.js +0 -1
  262. package/web/.next/static/chunks/3e46df89d84cae41.js +0 -1
  263. package/web/.next/static/chunks/88167c31c25ee0e9.js +0 -1
  264. /package/web/.next/static/{bBUlt0E8vPNiGspcAgiPD → BKlbRwdm1wGLZiZ1JfGrF}/_buildManifest.js +0 -0
  265. /package/web/.next/static/{bBUlt0E8vPNiGspcAgiPD → BKlbRwdm1wGLZiZ1JfGrF}/_clientMiddlewareManifest.json +0 -0
  266. /package/web/.next/static/{bBUlt0E8vPNiGspcAgiPD → BKlbRwdm1wGLZiZ1JfGrF}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),o=e.i(60112),n=e.i(21023);let s=(0,n.createServerReference)("401b3fc31b96a58f3d1689c3a181a6e32e8082b78a",n.callServer,void 0,n.findSourceMapURL,"createFeature");var i=e.i(91891),i=i,l=e.i(3645);let d=(0,l.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var c=e.i(16298),c=c;let u=(0,l.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),p=(0,l.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var f=e.i(69512),f=f;let m=(0,l.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var h=e.i(1012),h=h,x=e.i(31777),v=e.i(8361);e.i(1650);var g=e.i(11495),b=e.i(45811),j=e.i(35364),w=e.i(98127);function C({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,x.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var y=e.i(87620),k=r.forwardRef((e,r)=>(0,t.jsx)(y.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));k.displayName="Label",e.s(["Label",()=>k,"Root",()=>k],27572);var N=e.i(27572),N=N;let P=(0,e.i(94237).cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(N.Root,{ref:a,className:(0,x.cn)(P(),e),...r}));R.displayName=N.Root.displayName;var h=h;let E=(0,l.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var S=e.i(5978),A=e.i(22528),F=e.i(91967),D=e.i(36589),O=e.i(77624),T=e.i(85995),M="Checkbox",[I,_]=(0,A.createContextScope)(M),[L,B]=I(M);function z(e){let{__scopeCheckbox:a,checked:o,children:n,defaultChecked:s,disabled:i,form:l,name:d,onCheckedChange:c,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,h]=(0,D.useControllableState)({prop:o,defaultProp:s??!1,onChange:c,caller:M}),[x,v]=r.useState(null),[g,b]=r.useState(null),j=r.useRef(!1),w=!x||!!l||!!x.closest("form"),C={checked:m,disabled:i,setChecked:h,control:x,setControl:v,name:d,form:l,value:p,hasConsumerStoppedPropagationRef:j,required:u,defaultChecked:!W(s)&&s,isFormControl:w,bubbleInput:g,setBubbleInput:b};return(0,t.jsx)(L,{scope:a,...C,children:"function"==typeof f?f(C):n})}var H="CheckboxTrigger",$=r.forwardRef(({__scopeCheckbox:e,onKeyDown:a,onClick:o,...n},s)=>{let{control:i,value:l,disabled:d,checked:c,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:x}=B(H,e),v=(0,S.useComposedRefs)(s,p),g=r.useRef(c);return r.useEffect(()=>{let e=i?.form;if(e){let t=()=>f(g.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,f]),(0,t.jsx)(y.Primitive.button,{type:"button",role:"checkbox","aria-checked":W(c)?"mixed":c,"aria-required":u,"data-state":X(c),"data-disabled":d?"":void 0,disabled:d,value:l,...n,ref:v,onKeyDown:(0,F.composeEventHandlers)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,F.composeEventHandlers)(o,e=>{f(e=>!!W(e)||!e),x&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});$.displayName=H;var G=r.forwardRef((e,r)=>{let{__scopeCheckbox:a,name:o,checked:n,defaultChecked:s,required:i,disabled:l,value:d,onCheckedChange:c,form:u,...p}=e;return(0,t.jsx)(z,{__scopeCheckbox:a,checked:n,defaultChecked:s,disabled:l,required:i,onCheckedChange:c,name:o,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)($,{...p,ref:r,__scopeCheckbox:a}),e&&(0,t.jsx)(V,{__scopeCheckbox:a})]})})});G.displayName=M;var U="CheckboxIndicator",K=r.forwardRef((e,r)=>{let{__scopeCheckbox:a,forceMount:o,...n}=e,s=B(U,a);return(0,t.jsx)(T.Presence,{present:o||W(s.checked)||!0===s.checked,children:(0,t.jsx)(y.Primitive.span,{"data-state":X(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:r,style:{pointerEvents:"none",...e.style}})})});K.displayName=U;var q="CheckboxBubbleInput",V=r.forwardRef(({__scopeCheckbox:e,...a},o)=>{let n,{control:s,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:d,required:c,disabled:u,name:p,value:f,form:m,bubbleInput:h,setBubbleInput:x}=B(q,e),v=(0,S.useComposedRefs)(o,x),g=(n=r.useRef({value:l,previous:l}),r.useMemo(()=>(n.current.value!==l&&(n.current.previous=n.current.value,n.current.value=l),n.current.previous),[l])),b=(0,O.useSize)(s);r.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!i.current;if(g!==l&&e){let r=new Event("click",{bubbles:t});h.indeterminate=W(l),e.call(h,!W(l)&&l),h.dispatchEvent(r)}},[h,g,l,i]);let j=r.useRef(!W(l)&&l);return(0,t.jsx)(y.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??j.current,required:c,disabled:u,name:p,value:f,form:m,...a,tabIndex:-1,ref:v,style:{...a.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function W(e){return"indeterminate"===e}function X(e){return W(e)?"indeterminate":e?"checked":"unchecked"}V.displayName=q,e.s(["Checkbox",()=>G,"CheckboxIndicator",()=>K,"Indicator",()=>K,"Root",()=>G,"createCheckboxScope",()=>_,"unstable_BubbleInput",()=>V,"unstable_CheckboxBubbleInput",()=>V,"unstable_CheckboxProvider",()=>z,"unstable_CheckboxTrigger",()=>$,"unstable_Provider",()=>z,"unstable_Trigger",()=>$],57696);var Y=e.i(57696),Y=Y;function Z({className:e,...r}){return(0,t.jsx)(Y.Root,{"data-slot":"checkbox",className:(0,x.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:(0,t.jsx)(Y.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:"indeterminate"===r.checked?(0,t.jsx)(E,{className:"size-3.5"}):(0,t.jsx)(h.default,{className:"size-3.5"})})})}function J({id:e,label:r,description:a,checked:o,onCheckedChange:n,disabled:s}){return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(Z,{id:e,className:"mt-0.75",checked:o,onCheckedChange:e=>n(!0===e),disabled:s}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(R,{htmlFor:e,className:"cursor-pointer text-sm font-medium",children:r}),a?(0,t.jsx)(R,{htmlFor:e,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:a}):null]})]})}function Q({label:e,description:r,parentAriaLabel:a,options:o,value:n,onValueChange:s,disabled:i}){let l=o.filter(e=>n[e.id]).length,d=l===o.length,c=l>0&&!d,u=`${e.toLowerCase().replace(/\s+/g,"-")}-group`;return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(Z,{id:u,className:"mt-0.75",checked:c?"indeterminate":d,onCheckedChange:()=>{let e=l<o.length,t={};for(let r of o)t[r.id]=e;s(t)},disabled:i,"aria-label":a??`${e} select all`}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(R,{htmlFor:u,className:"cursor-pointer text-sm font-medium",children:e}),r?(0,t.jsx)(R,{htmlFor:u,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:r}):null]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 pl-6",children:o.map(e=>(0,t.jsx)(J,{id:e.id,label:e.label,description:e.description,checked:n[e.id]??!1,onCheckedChange:t=>{var r;return r=e.id,void s({...n,[r]:t})},disabled:i},e.id))})]})}var ee=e.i(81846),et=e.i(53532),er=e.i(41687),ea=e.i(56720),eo=e.i(13123),en=e.i(52740),es=e.i(39979),ei=e.i(86874),el=e.i(73772),ed=e.i(13044),ec="Popover",[eu,ep]=(0,A.createContextScope)(ec,[en.createPopperScope]),ef=(0,en.createPopperScope)(),[em,eh]=eu(ec),ex=e=>{let{__scopePopover:a,children:o,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,d=ef(a),c=r.useRef(null),[u,p]=r.useState(!1),[f,m]=(0,D.useControllableState)({prop:n,defaultProp:s??!1,onChange:i,caller:ec});return(0,t.jsx)(en.Root,{...d,children:(0,t.jsx)(em,{scope:a,contentId:(0,eo.useId)(),triggerRef:c,open:f,onOpenChange:m,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:l,children:o})})};ex.displayName=ec;var ev="PopoverAnchor",eg=r.forwardRef((e,a)=>{let{__scopePopover:o,...n}=e,s=eh(ev,o),i=ef(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=s;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(en.Anchor,{...i,...n,ref:a})});eg.displayName=ev;var eb="PopoverTrigger",ej=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,n=eh(eb,a),s=ef(a),i=(0,S.useComposedRefs)(r,n.triggerRef),l=(0,t.jsx)(y.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":eT(n.open),...o,ref:i,onClick:(0,F.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?l:(0,t.jsx)(en.Anchor,{asChild:!0,...s,children:l})});ej.displayName=eb;var ew="PopoverPortal",[eC,ey]=eu(ew,{forceMount:void 0}),ek=e=>{let{__scopePopover:r,forceMount:a,children:o,container:n}=e,s=eh(ew,r);return(0,t.jsx)(eC,{scope:r,forceMount:a,children:(0,t.jsx)(T.Presence,{present:a||s.open,children:(0,t.jsx)(es.Portal,{asChild:!0,container:n,children:o})})})};ek.displayName=ew;var eN="PopoverContent",eP=r.forwardRef((e,r)=>{let a=ey(eN,e.__scopePopover),{forceMount:o=a.forceMount,...n}=e,s=eh(eN,e.__scopePopover);return(0,t.jsx)(T.Presence,{present:o||s.open,children:s.modal?(0,t.jsx)(eE,{...n,ref:r}):(0,t.jsx)(eS,{...n,ref:r})})});eP.displayName=eN;var eR=(0,ei.createSlot)("PopoverContent.RemoveScroll"),eE=r.forwardRef((e,a)=>{let o=eh(eN,e.__scopePopover),n=r.useRef(null),s=(0,S.useComposedRefs)(a,n),i=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,el.hideOthers)(e)},[]),(0,t.jsx)(ed.RemoveScroll,{as:eR,allowPinchZoom:!0,children:(0,t.jsx)(eA,{...e,ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,F.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||o.triggerRef.current?.focus()}),onPointerDownOutside:(0,F.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;i.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,F.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),eS=r.forwardRef((e,a)=>{let o=eh(eN,e.__scopePopover),n=r.useRef(!1),s=r.useRef(!1);return(0,t.jsx)(eA,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||o.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),eA=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:o,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,f=eh(eN,a),m=ef(a);return(0,er.useFocusGuards)(),(0,t.jsx)(ea.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:n,onUnmountAutoFocus:s,children:(0,t.jsx)(et.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,t.jsx)(en.Content,{"data-state":eT(f.open),role:"dialog",id:f.contentId,...m,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eF="PopoverClose",eD=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,n=eh(eF,a);return(0,t.jsx)(y.Primitive.button,{type:"button",...o,ref:r,onClick:(0,F.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});eD.displayName=eF;var eO=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,n=ef(a);return(0,t.jsx)(en.Arrow,{...n,...o,ref:r})});function eT(e){return e?"open":"closed"}eO.displayName="PopoverArrow",e.s(["Anchor",()=>eg,"Arrow",()=>eO,"Close",()=>eD,"Content",()=>eP,"Popover",()=>ex,"PopoverAnchor",()=>eg,"PopoverArrow",()=>eO,"PopoverClose",()=>eD,"PopoverContent",()=>eP,"PopoverPortal",()=>ek,"PopoverTrigger",()=>ej,"Portal",()=>ek,"Root",()=>ex,"Trigger",()=>ej,"createPopoverScope",()=>ep],89920);var eM=e.i(89920),eM=eM;let eI=eM.Root,e_=eM.Trigger;eM.Anchor;let eL=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...o},n)=>(0,t.jsx)(eM.Portal,{children:(0,t.jsx)(eM.Content,{ref:n,align:r,sideOffset:a,className:(0,x.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));async function eB(){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}eL.displayName=eM.Content.displayName;let ez=[{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."}],eH={allowPrd:!1,allowPlan:!1,allowMerge:!1};function e$({open:e,onClose:a,onSubmit:o,repositoryPath:n,isSubmitting:s=!1,workflowDefaults:l,features:d,initialParentId:c}){let u=(0,v.useSoundAction)("create"),p=l?.approvalGates??eH,f=l?.push??!1,m=l?.openPr??!1,[h,x]=(0,r.useState)(""),[y,k]=(0,r.useState)(""),[N,P]=(0,r.useState)([]),[E,S]=(0,r.useState)({...p}),[A,F]=(0,r.useState)(f),[D,O]=(0,r.useState)(m),[T,M]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{l&&(S({...l.approvalGates}),F(l.push),O(l.openPr))},[l]),(0,r.useEffect)(()=>{e&&c&&M(c)},[e,c]);let I=(0,r.useCallback)(()=>{x(""),k(""),P([]),S({...p}),F(f),O(m),M(void 0)},[p,f,m]),_=(0,r.useCallback)(()=>{I(),a()},[a,I]),L=(0,r.useCallback)(e=>{if(e.preventDefault(),!h.trim())return;u.play();let t=y.trim()||void 0;o({name:h.trim(),description:t,attachments:N,repositoryPath:n,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:A||D,openPr:D,...T?{parentId:T}:{}}),I()},[h,y,N,E,n,o,A,D,T,u,I]),B=(0,r.useCallback)(async()=>{try{let e=await eB();e&&P(t=>[...t,...e])}catch{}},[]),z=(0,r.useCallback)(e=>{P(t=>t.filter(t=>t.path!==e))},[]),H=d&&d.length>0;return(0,t.jsx)(g.BaseDrawer,{open:e,onClose:_,size:"md",modal:!1,"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)(b.DrawerTitle,{children:"NEW FEATURE"})]}),(0,t.jsx)(b.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(ee.Badge,{variant:"secondary",children:"Creating..."})})})]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(j.Button,{variant:"outline",onClick:_,disabled:s,children:"Cancel"}),(0,t.jsx)(j.Button,{type:"submit",form:"create-feature-form",disabled:!h.trim()||s,children:s?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsxs)("form",{id:"create-feature-form",onSubmit:L,className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{htmlFor:"feature-name",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"FEATURE NAME"}),(0,t.jsx)(w.Input,{id:"feature-name",placeholder:"e.g. GitHub OAuth Login",value:h,onChange:e=>x(e.target.value),required:!0,disabled:s})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIPTION"}),(0,t.jsx)(C,{id:"feature-description",placeholder:"Describe what this feature does...",value:y,onChange:e=>k(e.target.value),rows:4,disabled:s})]}),H?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(eG,{features:d,value:T,onChange:M,disabled:s})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"APPROVE"}),(0,t.jsx)(Q,{label:"Autonomous Mode",description:"YOLO!",parentAriaLabel:"Auto approve all",options:ez,value:E,onValueChange:S,disabled:s})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(J,{id:"push",label:"Push",description:"Push branch to remote after implementation.",checked:A||D,onCheckedChange:F,disabled:D||s}),(0,t.jsx)(J,{id:"open-pr",label:"Create PR",description:"Open a pull request after pushing.",checked:D,onCheckedChange:O,disabled:s})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(R,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:["ATTACHMENTS",N.length>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60 ml-1.5",children:["(",N.length,")"]})]}),(0,t.jsxs)(j.Button,{type:"button",variant:"outline",size:"xs",onClick:B,disabled:s,children:[(0,t.jsx)(i.default,{className:"size-3"}),"Add Files"]})]}),N.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:N.map(e=>(0,t.jsx)(eU,{file:e,onRemove:()=>z(e.path),disabled:s},e.path))})]})]})})})}function eG({features:e,value:a,onChange:o,disabled:n}){let[s,i]=(0,r.useState)(!1),[l,d]=(0,r.useState)(""),c=(0,r.useRef)(null),u=e.find(e=>e.id===a),p=l.trim()?e.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.id.toLowerCase().includes(l.toLowerCase())):e,f=(0,r.useCallback)(e=>{o(e),i(!1),d("")},[o]);return(0,r.useEffect)(()=>{s?setTimeout(()=>c.current?.focus(),0):d("")},[s]),(0,t.jsxs)(eI,{open:s,onOpenChange:i,children:[(0,t.jsx)(e_,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":s,"aria-label":"Parent Feature",disabled:n,"data-testid":"parent-feature-combobox",className:(0,x.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",!u&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:u?`${u.name} (${u.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(m,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(eL,{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:c,placeholder:"Search features...",value:l,onChange:e=>d(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>f(void 0),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(h.default,{className:(0,x.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===p.length&&l?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):p.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(h.default,{className:(0,x.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function eU({file:e,onRemove:r,disabled:a}){var o,n,s;let i,l=(i=(o=e.name).lastIndexOf("."))>=0?o.slice(i).toLowerCase():"",m=(n=l,eK.has(n)?u:".pdf"===n?c.default:eq.has(n)?p:d),h=".pdf"===(s=l)?"bg-red-50 text-red-600":eK.has(s)?"bg-blue-50 text-blue-600":eq.has(s)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600";return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border p-2",children:[(0,t.jsx)("div",{className:(0,x.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded",h),children:(0,t.jsx)(m,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:function(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}(e.size)})]}),(0,t.jsx)(j.Button,{type:"button",variant:"ghost",size:"icon-xs",onClick:r,disabled:a,"aria-label":`Remove ${e.name}`,children:(0,t.jsx)(f.default,{className:"h-3 w-3"})})]})}let eK=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),eq=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function eV({repositoryPath:e,initialParentId:n,features:i,workflowDefaults:l}){let d=(0,a.useRouter)(),c=(0,v.useSoundAction)("create"),[u,p]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),m=(0,r.useCallback)(()=>{d.push("/")},[d]),h=(0,r.useCallback)(e=>{p(!0),window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{name:e.name,description:e.description,repositoryPath:e.repositoryPath}})),d.push("/"),s(e).then(e=>{if(e.error){o.toast.error(e.error),window.dispatchEvent(new CustomEvent("shep:feature-create-failed"));return}c.play(),d.refresh()}).catch(()=>{o.toast.error("Failed to create feature"),window.dispatchEvent(new CustomEvent("shep:feature-create-failed"))}).finally(()=>{p(!1)})},[d,c]);return(0,t.jsx)(e$,{open:f,onClose:m,onSubmit:h,repositoryPath:e,features:i,workflowDefaults:l,initialParentId:n,isSubmitting:u})}e.s(["CreateDrawerClient",()=>eV],15203)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),o=e.i(60112),n=e.i(21023);let s=(0,n.createServerReference)("40bc058d6afe9ea454d6e5d15a84c8f855fee63f3b",n.callServer,void 0,n.findSourceMapURL,"createFeature");var i=e.i(91891),i=i,l=e.i(3645);let d=(0,l.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var c=e.i(16298),c=c;let u=(0,l.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),p=(0,l.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var f=e.i(69512),f=f;let m=(0,l.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var h=e.i(1012),h=h,x=e.i(31777),v=e.i(8361);e.i(1650);var g=e.i(11495),b=e.i(45811),j=e.i(35364),w=e.i(98127);function C({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,x.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var y=e.i(87620),k=r.forwardRef((e,r)=>(0,t.jsx)(y.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));k.displayName="Label",e.s(["Label",()=>k,"Root",()=>k],27572);var N=e.i(27572),N=N;let P=(0,e.i(94237).cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(N.Root,{ref:a,className:(0,x.cn)(P(),e),...r}));R.displayName=N.Root.displayName;var h=h;let E=(0,l.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var S=e.i(5978),A=e.i(22528),F=e.i(91967),D=e.i(36589),O=e.i(77624),T=e.i(85995),M="Checkbox",[I,_]=(0,A.createContextScope)(M),[L,B]=I(M);function z(e){let{__scopeCheckbox:a,checked:o,children:n,defaultChecked:s,disabled:i,form:l,name:d,onCheckedChange:c,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,h]=(0,D.useControllableState)({prop:o,defaultProp:s??!1,onChange:c,caller:M}),[x,v]=r.useState(null),[g,b]=r.useState(null),j=r.useRef(!1),w=!x||!!l||!!x.closest("form"),C={checked:m,disabled:i,setChecked:h,control:x,setControl:v,name:d,form:l,value:p,hasConsumerStoppedPropagationRef:j,required:u,defaultChecked:!W(s)&&s,isFormControl:w,bubbleInput:g,setBubbleInput:b};return(0,t.jsx)(L,{scope:a,...C,children:"function"==typeof f?f(C):n})}var H="CheckboxTrigger",G=r.forwardRef(({__scopeCheckbox:e,onKeyDown:a,onClick:o,...n},s)=>{let{control:i,value:l,disabled:d,checked:c,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:x}=B(H,e),v=(0,S.useComposedRefs)(s,p),g=r.useRef(c);return r.useEffect(()=>{let e=i?.form;if(e){let t=()=>f(g.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,f]),(0,t.jsx)(y.Primitive.button,{type:"button",role:"checkbox","aria-checked":W(c)?"mixed":c,"aria-required":u,"data-state":X(c),"data-disabled":d?"":void 0,disabled:d,value:l,...n,ref:v,onKeyDown:(0,F.composeEventHandlers)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,F.composeEventHandlers)(o,e=>{f(e=>!!W(e)||!e),x&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});G.displayName=H;var $=r.forwardRef((e,r)=>{let{__scopeCheckbox:a,name:o,checked:n,defaultChecked:s,required:i,disabled:l,value:d,onCheckedChange:c,form:u,...p}=e;return(0,t.jsx)(z,{__scopeCheckbox:a,checked:n,defaultChecked:s,disabled:l,required:i,onCheckedChange:c,name:o,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(G,{...p,ref:r,__scopeCheckbox:a}),e&&(0,t.jsx)(V,{__scopeCheckbox:a})]})})});$.displayName=M;var U="CheckboxIndicator",K=r.forwardRef((e,r)=>{let{__scopeCheckbox:a,forceMount:o,...n}=e,s=B(U,a);return(0,t.jsx)(T.Presence,{present:o||W(s.checked)||!0===s.checked,children:(0,t.jsx)(y.Primitive.span,{"data-state":X(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:r,style:{pointerEvents:"none",...e.style}})})});K.displayName=U;var q="CheckboxBubbleInput",V=r.forwardRef(({__scopeCheckbox:e,...a},o)=>{let n,{control:s,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:d,required:c,disabled:u,name:p,value:f,form:m,bubbleInput:h,setBubbleInput:x}=B(q,e),v=(0,S.useComposedRefs)(o,x),g=(n=r.useRef({value:l,previous:l}),r.useMemo(()=>(n.current.value!==l&&(n.current.previous=n.current.value,n.current.value=l),n.current.previous),[l])),b=(0,O.useSize)(s);r.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!i.current;if(g!==l&&e){let r=new Event("click",{bubbles:t});h.indeterminate=W(l),e.call(h,!W(l)&&l),h.dispatchEvent(r)}},[h,g,l,i]);let j=r.useRef(!W(l)&&l);return(0,t.jsx)(y.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??j.current,required:c,disabled:u,name:p,value:f,form:m,...a,tabIndex:-1,ref:v,style:{...a.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function W(e){return"indeterminate"===e}function X(e){return W(e)?"indeterminate":e?"checked":"unchecked"}V.displayName=q,e.s(["Checkbox",()=>$,"CheckboxIndicator",()=>K,"Indicator",()=>K,"Root",()=>$,"createCheckboxScope",()=>_,"unstable_BubbleInput",()=>V,"unstable_CheckboxBubbleInput",()=>V,"unstable_CheckboxProvider",()=>z,"unstable_CheckboxTrigger",()=>G,"unstable_Provider",()=>z,"unstable_Trigger",()=>G],57696);var Y=e.i(57696),Y=Y;function Z({className:e,...r}){return(0,t.jsx)(Y.Root,{"data-slot":"checkbox",className:(0,x.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:(0,t.jsx)(Y.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:"indeterminate"===r.checked?(0,t.jsx)(E,{className:"size-3.5"}):(0,t.jsx)(h.default,{className:"size-3.5"})})})}function J({id:e,label:r,description:a,checked:o,onCheckedChange:n,disabled:s}){return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(Z,{id:e,className:"mt-0.75",checked:o,onCheckedChange:e=>n(!0===e),disabled:s}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(R,{htmlFor:e,className:"cursor-pointer text-sm font-medium",children:r}),a?(0,t.jsx)(R,{htmlFor:e,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:a}):null]})]})}function Q({label:e,description:r,parentAriaLabel:a,options:o,value:n,onValueChange:s,disabled:i}){let l=o.filter(e=>n[e.id]).length,d=l===o.length,c=l>0&&!d,u=`${e.toLowerCase().replace(/\s+/g,"-")}-group`;return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(Z,{id:u,className:"mt-0.75",checked:c?"indeterminate":d,onCheckedChange:()=>{let e=l<o.length,t={};for(let r of o)t[r.id]=e;s(t)},disabled:i,"aria-label":a??`${e} select all`}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(R,{htmlFor:u,className:"cursor-pointer text-sm font-medium",children:e}),r?(0,t.jsx)(R,{htmlFor:u,className:"text-muted-foreground cursor-pointer text-xs font-normal",children:r}):null]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3 pl-6",children:o.map(e=>(0,t.jsx)(J,{id:e.id,label:e.label,description:e.description,checked:n[e.id]??!1,onCheckedChange:t=>{var r;return r=e.id,void s({...n,[r]:t})},disabled:i},e.id))})]})}var ee=e.i(81846),et=e.i(53532),er=e.i(41687),ea=e.i(56720),eo=e.i(13123),en=e.i(52740),es=e.i(39979),ei=e.i(86874),el=e.i(73772),ed=e.i(13044),ec="Popover",[eu,ep]=(0,A.createContextScope)(ec,[en.createPopperScope]),ef=(0,en.createPopperScope)(),[em,eh]=eu(ec),ex=e=>{let{__scopePopover:a,children:o,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,d=ef(a),c=r.useRef(null),[u,p]=r.useState(!1),[f,m]=(0,D.useControllableState)({prop:n,defaultProp:s??!1,onChange:i,caller:ec});return(0,t.jsx)(en.Root,{...d,children:(0,t.jsx)(em,{scope:a,contentId:(0,eo.useId)(),triggerRef:c,open:f,onOpenChange:m,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:l,children:o})})};ex.displayName=ec;var ev="PopoverAnchor",eg=r.forwardRef((e,a)=>{let{__scopePopover:o,...n}=e,s=eh(ev,o),i=ef(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=s;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(en.Anchor,{...i,...n,ref:a})});eg.displayName=ev;var eb="PopoverTrigger",ej=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,n=eh(eb,a),s=ef(a),i=(0,S.useComposedRefs)(r,n.triggerRef),l=(0,t.jsx)(y.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":eT(n.open),...o,ref:i,onClick:(0,F.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?l:(0,t.jsx)(en.Anchor,{asChild:!0,...s,children:l})});ej.displayName=eb;var ew="PopoverPortal",[eC,ey]=eu(ew,{forceMount:void 0}),ek=e=>{let{__scopePopover:r,forceMount:a,children:o,container:n}=e,s=eh(ew,r);return(0,t.jsx)(eC,{scope:r,forceMount:a,children:(0,t.jsx)(T.Presence,{present:a||s.open,children:(0,t.jsx)(es.Portal,{asChild:!0,container:n,children:o})})})};ek.displayName=ew;var eN="PopoverContent",eP=r.forwardRef((e,r)=>{let a=ey(eN,e.__scopePopover),{forceMount:o=a.forceMount,...n}=e,s=eh(eN,e.__scopePopover);return(0,t.jsx)(T.Presence,{present:o||s.open,children:s.modal?(0,t.jsx)(eE,{...n,ref:r}):(0,t.jsx)(eS,{...n,ref:r})})});eP.displayName=eN;var eR=(0,ei.createSlot)("PopoverContent.RemoveScroll"),eE=r.forwardRef((e,a)=>{let o=eh(eN,e.__scopePopover),n=r.useRef(null),s=(0,S.useComposedRefs)(a,n),i=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,el.hideOthers)(e)},[]),(0,t.jsx)(ed.RemoveScroll,{as:eR,allowPinchZoom:!0,children:(0,t.jsx)(eA,{...e,ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,F.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||o.triggerRef.current?.focus()}),onPointerDownOutside:(0,F.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;i.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,F.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),eS=r.forwardRef((e,a)=>{let o=eh(eN,e.__scopePopover),n=r.useRef(!1),s=r.useRef(!1);return(0,t.jsx)(eA,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||o.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),eA=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:o,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,f=eh(eN,a),m=ef(a);return(0,er.useFocusGuards)(),(0,t.jsx)(ea.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:n,onUnmountAutoFocus:s,children:(0,t.jsx)(et.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,t.jsx)(en.Content,{"data-state":eT(f.open),role:"dialog",id:f.contentId,...m,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eF="PopoverClose",eD=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,n=eh(eF,a);return(0,t.jsx)(y.Primitive.button,{type:"button",...o,ref:r,onClick:(0,F.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});eD.displayName=eF;var eO=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,n=ef(a);return(0,t.jsx)(en.Arrow,{...n,...o,ref:r})});function eT(e){return e?"open":"closed"}eO.displayName="PopoverArrow",e.s(["Anchor",()=>eg,"Arrow",()=>eO,"Close",()=>eD,"Content",()=>eP,"Popover",()=>ex,"PopoverAnchor",()=>eg,"PopoverArrow",()=>eO,"PopoverClose",()=>eD,"PopoverContent",()=>eP,"PopoverPortal",()=>ek,"PopoverTrigger",()=>ej,"Portal",()=>ek,"Root",()=>ex,"Trigger",()=>ej,"createPopoverScope",()=>ep],89920);var eM=e.i(89920),eM=eM;let eI=eM.Root,e_=eM.Trigger;eM.Anchor;let eL=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...o},n)=>(0,t.jsx)(eM.Portal,{children:(0,t.jsx)(eM.Content,{ref:n,align:r,sideOffset:a,className:(0,x.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));eL.displayName=eM.Content.displayName;var eB=e.i(30153);async function ez(){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}let eH=[{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."}],eG={allowPrd:!1,allowPlan:!1,allowMerge:!1};function e$({open:e,onClose:a,onSubmit:o,repositoryPath:n,isSubmitting:s=!1,workflowDefaults:l,features:d,initialParentId:c}){let u=(0,v.useSoundAction)("create"),p=l?.approvalGates??eG,f=l?.push??!1,m=l?.openPr??!1,[h,x]=(0,r.useState)(""),[y,k]=(0,r.useState)(""),[N,P]=(0,r.useState)([]),[E,S]=(0,r.useState)({...p}),[A,F]=(0,r.useState)(f),[D,O]=(0,r.useState)(m),[T,M]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{l&&(S({...l.approvalGates}),F(l.push),O(l.openPr))},[l]),(0,r.useEffect)(()=>{e&&c&&M(c)},[e,c]);let I=(0,r.useCallback)(()=>{x(""),k(""),P([]),S({...p}),F(f),O(m),M(void 0)},[p,f,m]),_=""!==h.trim()||""!==y.trim()||N.length>0,{attemptClose:L}=(0,eB.useGuardedDrawerClose)({open:e,isDirty:_,onClose:a,onReset:I}),B=(0,r.useCallback)(e=>{if(e.preventDefault(),!h.trim())return;u.play();let t=y.trim()||void 0;o({name:h.trim(),description:t,attachments:N,repositoryPath:n,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:A||D,openPr:D,...T?{parentId:T}:{}}),I()},[h,y,N,E,n,o,A,D,T,u,I]),z=(0,r.useCallback)(async()=>{try{let e=await ez();e&&P(t=>[...t,...e])}catch{}},[]),H=(0,r.useCallback)(e=>{P(t=>t.filter(t=>t.path!==e))},[]),G=d&&d.length>0;return(0,t.jsx)(g.BaseDrawer,{open:e,onClose:L,size:"md",modal:!1,"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)(b.DrawerTitle,{children:"NEW FEATURE"})]}),(0,t.jsx)(b.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(ee.Badge,{variant:"secondary",children:"Creating..."})})})]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(j.Button,{variant:"outline",onClick:L,disabled:s,children:"Cancel"}),(0,t.jsx)(j.Button,{type:"submit",form:"create-feature-form",disabled:!h.trim()||s,children:s?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsxs)("form",{id:"create-feature-form",onSubmit:B,className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{htmlFor:"feature-name",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"FEATURE NAME"}),(0,t.jsx)(w.Input,{id:"feature-name",placeholder:"e.g. GitHub OAuth Login",value:h,onChange:e=>x(e.target.value),required:!0,disabled:s})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIPTION"}),(0,t.jsx)(C,{id:"feature-description",placeholder:"Describe what this feature does...",value:y,onChange:e=>k(e.target.value),rows:4,disabled:s})]}),G?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(eU,{features:d,value:T,onChange:M,disabled:s})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"APPROVE"}),(0,t.jsx)(Q,{label:"Autonomous Mode",description:"YOLO!",parentAriaLabel:"Auto approve all",options:eH,value:E,onValueChange:S,disabled:s})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(R,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(J,{id:"push",label:"Push",description:"Push branch to remote after implementation.",checked:A||D,onCheckedChange:F,disabled:D||s}),(0,t.jsx)(J,{id:"open-pr",label:"Create PR",description:"Open a pull request after pushing.",checked:D,onCheckedChange:O,disabled:s})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(R,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:["ATTACHMENTS",N.length>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60 ml-1.5",children:["(",N.length,")"]})]}),(0,t.jsxs)(j.Button,{type:"button",variant:"outline",size:"xs",onClick:z,disabled:s,children:[(0,t.jsx)(i.default,{className:"size-3"}),"Add Files"]})]}),N.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:N.map(e=>(0,t.jsx)(eK,{file:e,onRemove:()=>H(e.path),disabled:s},e.path))})]})]})})})}function eU({features:e,value:a,onChange:o,disabled:n}){let[s,i]=(0,r.useState)(!1),[l,d]=(0,r.useState)(""),c=(0,r.useRef)(null),u=e.find(e=>e.id===a),p=l.trim()?e.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.id.toLowerCase().includes(l.toLowerCase())):e,f=(0,r.useCallback)(e=>{o(e),i(!1),d("")},[o]);return(0,r.useEffect)(()=>{s?setTimeout(()=>c.current?.focus(),0):d("")},[s]),(0,t.jsxs)(eI,{open:s,onOpenChange:i,children:[(0,t.jsx)(e_,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":s,"aria-label":"Parent Feature",disabled:n,"data-testid":"parent-feature-combobox",className:(0,x.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",!u&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:u?`${u.name} (${u.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(m,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(eL,{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:c,placeholder:"Search features...",value:l,onChange:e=>d(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>f(void 0),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(h.default,{className:(0,x.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===p.length&&l?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):p.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(h.default,{className:(0,x.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function eK({file:e,onRemove:r,disabled:a}){var o,n,s;let i,l=(i=(o=e.name).lastIndexOf("."))>=0?o.slice(i).toLowerCase():"",m=(n=l,eq.has(n)?u:".pdf"===n?c.default:eV.has(n)?p:d),h=".pdf"===(s=l)?"bg-red-50 text-red-600":eq.has(s)?"bg-blue-50 text-blue-600":eV.has(s)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600";return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border p-2",children:[(0,t.jsx)("div",{className:(0,x.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded",h),children:(0,t.jsx)(m,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:function(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}(e.size)})]}),(0,t.jsx)(j.Button,{type:"button",variant:"ghost",size:"icon-xs",onClick:r,disabled:a,"aria-label":`Remove ${e.name}`,children:(0,t.jsx)(f.default,{className:"h-3 w-3"})})]})}let eq=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),eV=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function eW({repositoryPath:e,initialParentId:n,features:i,workflowDefaults:l}){let d=(0,a.useRouter)(),c=(0,v.useSoundAction)("create"),[u,p]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),m=(0,r.useCallback)(()=>{d.push("/")},[d]),h=(0,r.useCallback)(e=>{p(!0),window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{name:e.name,description:e.description,repositoryPath:e.repositoryPath}})),d.push("/"),s(e).then(e=>{if(e.error){o.toast.error(e.error),window.dispatchEvent(new CustomEvent("shep:feature-create-failed"));return}c.play(),d.refresh()}).catch(()=>{o.toast.error("Failed to create feature"),window.dispatchEvent(new CustomEvent("shep:feature-create-failed"))}).finally(()=>{p(!1)})},[d,c]);return(0,t.jsx)(e$,{open:f,onClose:m,onSubmit:h,repositoryPath:e,features:i,workflowDefaults:l,initialParentId:n,isSubmitting:u})}e.s(["CreateDrawerClient",()=>eW],15203)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},54277,e=>{"use strict";var t=e.i(30090);e.s(["CircleX",()=>t.default])},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},23925,e=>{"use strict";var t=e.i(1012);e.s(["Check",()=>t.default])},1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t])},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},69512,e=>{"use strict";let t=(0,e.i(3645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",()=>t])},54793,7729,e=>{"use strict";var t=e.i(20314),a=e.i(31777);function r({icon:e,title:r,description:l,action:s,className:o,...i}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",o),...i,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:r}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,s?(0,t.jsx)("div",{className:"mt-2",children:s}):null]})}e.s(["EmptyState",()=>r],7729),e.s([],54793)},81846,e=>{"use strict";var t=e.i(20314),a=e.i(94237),r=e.i(31777);let l=(0,a.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function s({className:e,variant:a,...s}){return(0,t.jsx)("div",{className:(0,r.cn)(l({variant:a}),e),...s})}e.s(["Badge",()=>s])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},2287,60253,e=>{"use strict";var t=e.i(20314),a=e.i(79054),r=e.i(90033),l=e.i(90537);e.s(["X",()=>l.default],60253);var l=l,s=e.i(31777);let o=r.Dialog.Root;r.Dialog.Trigger;let i=r.Dialog.Portal;r.Dialog.Close;let n=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)(r.Dialog.Overlay,{ref:l,className:(0,s.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/80",e),...a}));n.displayName=r.Dialog.Overlay.displayName;let d=a.forwardRef(({className:e,children:a,...o},d)=>(0,t.jsxs)(i,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(r.Dialog.Content,{ref:d,className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...o,children:[a,(0,t.jsxs)(r.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(l.default,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));d.displayName=r.Dialog.Content.displayName;let c=({className:e,...a})=>(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...a});c.displayName="DialogHeader";let u=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)(r.Dialog.Title,{ref:l,className:(0,s.cn)("text-lg leading-none font-semibold tracking-tight",e),...a}));u.displayName=r.Dialog.Title.displayName;let f=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)(r.Dialog.Description,{ref:l,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));f.displayName=r.Dialog.Description.displayName,e.s(["Dialog",()=>o,"DialogContent",()=>d,"DialogDescription",()=>f,"DialogHeader",()=>c,"DialogTitle",()=>u],2287)},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,79153,87360,87533,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 a=e.i(21023);let r=(0,a.createServerReference)("401fa63670356f1aa0e21799293b2de097208c68ce",a.callServer,void 0,a.findSourceMapURL,"openIde");e.s(["openIde",()=>r],79153);let l=(0,a.createServerReference)("400a95c3aed85bf272ca05c281e0d8a88d68a3ff9c",a.callServer,void 0,a.findSourceMapURL,"openShell");e.s(["openShell",()=>l],87360);let s=(0,a.createServerReference)("40ae89f0c5e574c3e773ec5f4203b39d48e2383e86",a.callServer,void 0,a.findSourceMapURL,"openFolder");e.s(["openFolder",()=>s],87533)},76852,e=>{"use strict";var t=e.i(79054),a=e.i(79153),r=e.i(87360),l=e.i(87533);function s(e){let[s,o]=(0,t.useState)(!1),[i,n]=(0,t.useState)(!1),[d,c]=(0,t.useState)(!1),[u,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),y=(0,t.useRef)(null),x=(0,t.useRef)(null),v=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=y.current,t=x.current,a=v.current;return()=>{e&&clearTimeout(e),t&&clearTimeout(t),a&&clearTimeout(a)}},[]);let k=(0,t.useCallback)(async(t,a,r,l,s)=>{if(e&&!s){l.current&&clearTimeout(l.current),a(!0),r(null);try{let a=await t({repositoryPath:e.repositoryPath});if(!a.success){let e=a.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{a(!1)}}},[e]),b=(0,t.useCallback)(async(t,a,r,l,s)=>{if(e&&!s){l.current&&clearTimeout(l.current),a(!0),r(null);try{let a=await t(e.repositoryPath);if(!a.success){let e=a.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{a(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>k(a.openIde,o,f,y,s),[k,s]),openInShell:(0,t.useCallback)(()=>k(r.openShell,n,m,x,i),[k,i]),openFolder:(0,t.useCallback)(()=>b(l.openFolder,c,h,v,d),[b,d]),ideLoading:s,shellLoading:i,folderLoading:d,ideError:u,shellError:p,folderError:g}}e.s(["useRepositoryActions",()=>s])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},54277,e=>{"use strict";var t=e.i(30090);e.s(["CircleX",()=>t.default])},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},23925,e=>{"use strict";var t=e.i(1012);e.s(["Check",()=>t.default])},1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t])},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},69512,e=>{"use strict";let t=(0,e.i(3645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",()=>t])},54793,7729,e=>{"use strict";var t=e.i(20314),a=e.i(31777);function r({icon:e,title:r,description:l,action:s,className:o,...i}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",o),...i,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:r}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,s?(0,t.jsx)("div",{className:"mt-2",children:s}):null]})}e.s(["EmptyState",()=>r],7729),e.s([],54793)},81846,e=>{"use strict";var t=e.i(20314),a=e.i(94237),r=e.i(31777);let l=(0,a.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function s({className:e,variant:a,...s}){return(0,t.jsx)("div",{className:(0,r.cn)(l({variant:a}),e),...s})}e.s(["Badge",()=>s])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},2287,60253,e=>{"use strict";var t=e.i(20314),a=e.i(79054),r=e.i(90033),l=e.i(90537);e.s(["X",()=>l.default],60253);var l=l,s=e.i(31777);let o=r.Dialog.Root;r.Dialog.Trigger;let i=r.Dialog.Portal;r.Dialog.Close;let n=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)(r.Dialog.Overlay,{ref:l,className:(0,s.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/80",e),...a}));n.displayName=r.Dialog.Overlay.displayName;let d=a.forwardRef(({className:e,children:a,...o},d)=>(0,t.jsxs)(i,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(r.Dialog.Content,{ref:d,className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...o,children:[a,(0,t.jsxs)(r.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(l.default,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));d.displayName=r.Dialog.Content.displayName;let c=({className:e,...a})=>(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...a});c.displayName="DialogHeader";let u=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)(r.Dialog.Title,{ref:l,className:(0,s.cn)("text-lg leading-none font-semibold tracking-tight",e),...a}));u.displayName=r.Dialog.Title.displayName;let f=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)(r.Dialog.Description,{ref:l,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));f.displayName=r.Dialog.Description.displayName,e.s(["Dialog",()=>o,"DialogContent",()=>d,"DialogDescription",()=>f,"DialogHeader",()=>c,"DialogTitle",()=>u],2287)},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,87188,58307,70730,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 a=e.i(21023);let r=(0,a.createServerReference)("40d2f0aa2f351085fe0fe577aa9895d894e7d79c38",a.callServer,void 0,a.findSourceMapURL,"openIde");e.s(["openIde",()=>r],87188);let l=(0,a.createServerReference)("40a366e8313632bb466fd502e7af41fbab679b9441",a.callServer,void 0,a.findSourceMapURL,"openShell");e.s(["openShell",()=>l],58307);let s=(0,a.createServerReference)("400ff5f52e562d6380f40bee79816344866b3ab4cb",a.callServer,void 0,a.findSourceMapURL,"openFolder");e.s(["openFolder",()=>s],70730)},76852,e=>{"use strict";var t=e.i(79054),a=e.i(87188),r=e.i(58307),l=e.i(70730);function s(e){let[s,o]=(0,t.useState)(!1),[i,n]=(0,t.useState)(!1),[d,c]=(0,t.useState)(!1),[u,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),y=(0,t.useRef)(null),x=(0,t.useRef)(null),v=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=y.current,t=x.current,a=v.current;return()=>{e&&clearTimeout(e),t&&clearTimeout(t),a&&clearTimeout(a)}},[]);let b=(0,t.useCallback)(async(t,a,r,l,s)=>{if(e&&!s){l.current&&clearTimeout(l.current),a(!0),r(null);try{let a=await t({repositoryPath:e.repositoryPath});if(!a.success){let e=a.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{a(!1)}}},[e]),k=(0,t.useCallback)(async(t,a,r,l,s)=>{if(e&&!s){l.current&&clearTimeout(l.current),a(!0),r(null);try{let a=await t(e.repositoryPath);if(!a.success){let e=a.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{a(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>b(a.openIde,o,f,y,s),[b,s]),openInShell:(0,t.useCallback)(()=>b(r.openShell,n,m,x,i),[b,i]),openFolder:(0,t.useCallback)(()=>k(l.openFolder,c,h,v,d),[k,d]),ideLoading:s,shellLoading:i,folderLoading:d,ideError:u,shellError:p,folderError:g}}e.s(["useRepositoryActions",()=>s])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17840,e=>{"use strict";var t=e.i(79054),r=e.i(31406),n=e.i(60112),o=e.i(53271),i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=i((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,n)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?r(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n},i=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function i(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}return o+"\x01"+i+"\x01"+(void 0===n?"\0":n)}function s(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,t,n,o,s=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var d=i(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,d))return s&&(this._edgeLabels[d]=o),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[d]=s?o:this._defaultEdgeLabelFn(e,t,n);var l=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}var a={v:o,w:i};return n&&(a.name=n),a}(this._isDirected,e,t,n);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[d]=l,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][d]=l,this._out[e][d]=l,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var o=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r),a=this._edgeObjs[o];return a&&(e=a.v,t=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,r){if(e){var n=Object.values(e);return r?n.filter(function(e){return e.v===t&&e.w===r||e.v===r&&e.w===t}):n}}}}),s=n((e,t)=>{t.exports="3.0.2"}),a=n((e,t)=>{t.exports={Graph:i(),version:s()}}),d=n((e,t)=>{var r=i();t.exports={write:function(e){var t,r,n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(function(e){var t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})};return void 0!==e.graph()&&(n.value=structuredClone(e.graph())),n},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=n((e,t)=>{t.exports=function(e,t,n,o){return function(e,t,r,n){var o={},i=!0,s=0,a=e.nodes(),d=function(e){var t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},l=function(){a.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};a.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=a.length,h=1;h<c&&(i=!1,s++,l(),i);h++);if(s===c-1&&(i=!1,l(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),n||r,o||function(t){return e.outEdges(t)})};var r=()=>1}),c=n((e,t)=>{t.exports=function(e){var t,r={},n=[];return e.nodes().forEach(function(o){t=[],function n(o){Object.hasOwn(r,o)||(r[o]=!0,t.push(o),e.successors(o).forEach(n),e.predecessors(o).forEach(n))}(o),t.length&&n.push(t)}),n}}),h=n((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(!Object.hasOwn(r,e=String(e))){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}}}),u=n((e,t)=>{var r=h();t.exports=function(e,t,o,i){return function(e,t,n,o){var i,s,a={},d=new r,l=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),l=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<r.distance&&(r.distance=l,r.predecessor=i,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;a[e]={distance:r},d.add(e,r)});d.size()>0&&(s=a[i=d.removeMin()]).distance!==1/0;)o(i).forEach(l);return a}(e,String(t),o||n,i||function(t){return e.outEdges(t)})};var n=()=>1}),p=n((e,t)=>{var r=u();t.exports=function(e,t,n){return e.nodes().reduce(function(o,i){return o[i]=r(e,i,t,n),o},{})}}),f=n((e,t)=>{t.exports=function(e,t,r){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[r].predecessor&&r!==t)throw Error("Invalid destination vertex");return{weight:e[r].distance,path:function(e,t,r){for(var n=[],o=r;o!==t;)n.push(o),o=e[o].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(n,i)||function i(s){var a=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(i(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(i)}),o}}),m=n((e,t)=>{var r=g();t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),v=n((e,t)=>{t.exports=function(e,t,n){var o,i,s,a,d;return o=e,i=t||r,s=n||function(t){return e.outEdges(t)},a={},(d=o.nodes()).forEach(function(e){a[e]={},a[e][e]={distance:0},d.forEach(function(t){e!==t&&(a[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=i(t);a[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=a[e];d.forEach(function(r){var n=a[r];d.forEach(function(r){var o=n[e],i=t[r],s=n[r],a=o.distance+i.distance;a<s.distance&&(s.distance=a,s.predecessor=i.predecessor)})})}),a};var r=()=>1}),y=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function i(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(i),delete r[s],o.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return o}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),b=n((e,t)=>{var r=y();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),w=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,r,n,o,i,s,a){return Object.hasOwn(o,r)||(o[r]=!0,n||(a=s(a,r)),i(r).forEach(function(r){a=e(t,r,n,o,i,s,a)}),n&&(a=s(a,r))),a}(e,t,"post"===r,s,i,n,o)}),o}}),x=n((e,t)=>{var r=w();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=i(),n=h();t.exports=function(e,t){var o,i=new r,s={},a=new n;function d(e){var r=e.v===o?e.w:e.v,n=a.priority(r);if(void 0!==n){var i=t(e);i<n&&(s[r]=o,a.decrease(r,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){a.add(e,1/0),i.setNode(e)}),a.decrease(e.nodes()[0],0);for(var l=!1;a.size()>0;){if(Object.hasOwn(s,o=a.removeMin()))i.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return i}}),_=n((e,t)=>{var r=u(),n=l();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return r(e,t,o,i);for(var s=!1,a=e.nodes(),d=0;d<a.length;d++){for(var l=i(a[d]),c=0;c<l.length;c++){var h=l[c],u=h.v===a[d]?h.v:h.w,p=u===h.v?h.w:h.v;0>o({v:u,w:p})&&(s=!0)}if(s)return n(e,t,o,i)}return r(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),N=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:u(),dijkstraAll:p(),extractPath:f(),findCycles:m(),floydWarshall:v(),isAcyclic:b(),postorder:E(),preorder:k(),prim:j(),shortestPaths:_(),reduce:w(),tarjan:g(),topsort:y()}}),C=a();t.exports={Graph:C.Graph,json:d(),alg:N(),version:C.version}}),a=i((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),d=i((e,t)=>{var r=s().Graph,n=a();t.exports=function(e,t){var s,a;let l,c,h,u,p;if(1>=e.nodeCount())return[];let f=(s=e,a=t||o,l=new r,c=0,h=0,s.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),s.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=a(e);l.setEdge(e.v,e.w,t+r),h=Math.max(h,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),u=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(h+c+3).map(()=>new n),p=c+1,l.nodes().forEach(e=>{d(u,p,l.node(e))}),{graph:l,buckets:u,zeroIdx:p});return(function(e,t,r){let n=[],o=t[t.length-1],s=t[0],a;for(;e.nodeCount();){for(;a=s.dequeue();)i(e,t,r,a);for(;a=o.dequeue();)i(e,t,r,a);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(a=t[o].dequeue()){n=n.concat(i(e,t,r,a,!0));break}}}return n})(f.graph,f.buckets,f.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let i=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),a=e.node(n.v);o&&i.push({v:n.v,w:n.w}),a.out-=s,d(t,r,a)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),i=n.w,s=e.node(i);s.in-=o,d(t,r,s)}),e.removeNode(n.v),i}function d(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}}),l=i((e,t)=>{var r=s().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=d(n);return r.dummy=t,e.setNode(o,r),o}t.exports={addBorderNode:function(e,t,r,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=o),n(e,"border",i,t)},addDummyNode:n,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t},buildLayerMatrix:function(e){let t=l(i(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,i=e.y,s=t.x-o,a=t.y-i,d=e.width/2,l=e.height/2;if(!s&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(s)*l?(a<0&&(l=-l),r=l*s/a,n=l):(s<0&&(d=-d),r=d,n=d*a/s),{x:o+r,y:i+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:i,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}));e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});let n=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%i!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:d,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let r=function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function i(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var a=0;function d(e){return e+""+ ++a}function l(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),c=i((e,t)=>{var r=d(),n=l().uniqueId;t.exports={run:function(e){var t,o;let i,s,a;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(i=[],s={},a={},(o=e).nodes().forEach(function e(t){Object.hasOwn(a,t)||(a[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?i.push(t):e(t.w)}),delete s[t])}),i)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),h=i((e,t)=>{var r=l();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,i,s=t.v,a=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,h=e.edge(t),u=h.labelRank;if(l!==a+1){for(e.removeEdge(t),i=0,++a;a<l;++i,++a)h.points=[],o={width:0,height:0,edgeLabel:h,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",o,"_d"),a===u&&(o.width=h.width,o.height=h.height,o.dummy="edge-label",o.labelpos=h.labelpos),e.setEdge(s,n,{weight:h.weight},c),0===i&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:h.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}}}),u=i((e,t)=>{var{applyWithChunking:r}=l();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var s=r(Math.min,e.outEdges(o).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),i.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),p=i((e,t)=>{var r=s().Graph,n=u().slack;t.exports=function(e){var t,o,i,s,a=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(a.setNode(d,{});t=a,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(i=>{var s=i.v,a=r===s?i.w:s;t.hasNode(a)||n(o,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),e(a))})}),t.nodeCount()<l;)i=function(e,t){return t.edges().reduce((r,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=n(t,o)),i<r[0]?[i,o]:r},[1/0,null])[1]}(a,e),s=a.hasNode(i.v)?n(e,i):-n(e,i),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(a,e,s);return a}}),f=i((e,t)=>{var r=p(),n=u().slack,o=u().longestPath,i=s().alg.preorder,a=s().alg.postorder,d=l().simplify;function c(e){o(e=d(e));var t,n,i=r(e);for(g(i),h(i,e);t=m(i);)n=v(i,e,t),y(i,e,t,n)}function h(e,t){var r=a(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,i,s;return n=e,o=t,i=r,s=n.node(i).parent,void(n.edge(i,s).cutvalue=f(n,o,i))})}function f(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),s=0;return i||(o=!1,i=t.edge(n,r)),s=i.weight,t.nodeEdges(r).forEach(i=>{var a=i.v===r,d=a?i.w:i.v;if(d!==n){var l,c,h,u=a===o,p=t.edge(i).weight;if(s+=u?p:-p,l=e,c=r,h=d,l.hasEdge(c,h)){var f=e.edge(r,d).cutvalue;s+=u?-f:f}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var s=n,a=t.node(o);return r[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(r,i)||(n=e(t,r,n,i,o))}),a.low=s,a.lim=n++,i?a.parent=i:delete a.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v(e,t,r){var o=r.v,i=r.w;t.hasEdge(o,i)||(o=r.w,i=r.v);var s=e.node(o),a=e.node(i),d=s,l=!1;return s.lim>a.lim&&(d=a,l=!0),t.edges().filter(t=>l===b(e,e.node(t.v),d)&&l!==b(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function y(e,t,r,n){var o,s,a,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),h(e,t),o=e,s=t,a=o.nodes().find(e=>!s.node(e).parent),(d=(d=i(o,a)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=s.edge(e,t),n=!1;r||(r=s.edge(t,e),n=!0),s.node(e).rank=s.node(t).rank+(n?r.minlen:-r.minlen)})}function b(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=h,c.calcCutValue=f,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=y}),g=i((e,t)=>{var r=u().longestPath,n=p(),o=f();t.exports=function(e){var t,s=e.graph().ranker;if(s instanceof Function)return s(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":i(e);case"none":}};var i=r}),m=i((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let i=n;t.children(o).forEach(e),r[o]={low:i,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,i=function(e,t,r,n){let o=[],i=[],s=Math.min(t[r].low,t[n].low),a=Math.max(t[r].lim,t[n].lim),d,l;d=r;do o.push(d=e.parent(d));while(d&&(t[d].low>s||a>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)i.push(d);return{path:o.concat(i.reverse()),lca:l}}(e,o,n.v,n.w),s=i.path,a=i.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==a&&e.node(l).maxRank<r.rank;)d++;l===a&&(c=!1)}if(!c){for(;d<s.length-1&&e.node(l=s[d+1]).minRank<=r.rank;)d++;l=s[d]}e.setParent(t,l),t=e.successors(t)[0]}})}}),v=i((e,t)=>{var r=l();t.exports={run:function(e){var t,n,o;let i=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var i=t.children(r);i&&i.length&&i.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),a=Object.values(s),d=r.applyWithChunking(Math.max,a)-1,l=2*d+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,o,i,s,a,d){let l=t.children(d);if(!l.length){d!==n&&t.setEdge(n,d,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),h=r.addBorderNode(t,"_bb"),u=t.node(d);t.setParent(c,d),u.borderTop=c,t.setParent(h,d),u.borderBottom=h,l.forEach(r=>{e(t,n,o,i,s,a,r);let l=t.node(r),u=l.borderTop?l.borderTop:r,p=l.borderBottom?l.borderBottom:r,f=l.borderTop?i:2*i,g=u!==p?1:s-a[d]+1;t.setEdge(c,u,{weight:f,minlen:g,nestingEdge:!0}),t.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+a[d]})})(e,i,l,c,d,s,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),y=i((e,t)=>{var r=l();function n(e,t,n,o,i,s){let a=i[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);i[t][s]=d,e.setParent(d,o),a&&e.setEdge(a,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),i=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,i,t),n(e,"borderRight","_br",r,i,t)}})}}),b=i((e,t)=>{function r(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>n(e.edge(t)))}function n(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let s=e.graph().rankdir.toLowerCase();("bt"===s||"rl"===s)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(o),Object.hasOwn(r,"y")&&o(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>i(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),r(e))}}}),w=i((e,t)=>{var r=l();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),i=r.applyWithChunking(Math.max,o),s=r.range(i+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),x=i((e,t)=>{var r=l().zipObject;t.exports=function(e,t){let n=0;for(let o=1;o<t.length;++o)n+=function(e,t,n){let o=r(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let d=Array(a).fill(0),l=0;return i.forEach(e=>{let t=e.pos+s;d[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=d[t+1]),t=t-1>>1,d[t]+=e.weight;l+=e.weight*r}),l}(e,t[o-1],t[o]);return n}}),E=i((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),k=i((e,t)=>{var r=l();t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}),j=i((e,t)=>{var r=l();function n(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}t.exports=function(e,t){var o;let i=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=i.lhs,a=i.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,h=0;s.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),h=n(d,a,h),s.forEach(e=>{h+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=n(d,a,h)});let u={vs:d.flat(!0)};return c&&(u.barycenter=l/c,u.weight=c),u}}),_=i((e,t)=>{var r=E(),n=k(),o=j();t.exports=function e(t,i,s,a){var d,l;let c=t.children(i),h=t.node(i),u=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,f={};u&&(c=c.filter(e=>e!==u&&e!==p));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let i=e(t,r.v,s,a);f[r.v]=i,Object.hasOwn(i,"barycenter")&&(n=r,o=i,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+o.barycenter*o.weight)/(n.weight+o.weight),n.weight+=o.weight):(n.barycenter=o.barycenter,n.weight=o.weight))}});let m=n(g,s);d=m,l=f,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,a);if(u&&(v.vs=[u,v.vs,p].flat(!0),t.predecessors(u).length)){let e=t.node(t.predecessors(u)[0]),r=t.node(t.predecessors(p)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+r.order)/(v.weight+2),v.weight+=2}return v}}),N=i((e,t)=>{var r=s().Graph,n=l();t.exports=function(e,t,o,i){i||(i=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),a=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(r=>{let n=e.node(r),i=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(a.setNode(r),a.setParent(r,i||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=a.edge(n,r),i=void 0!==o?o.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+i})}),Object.hasOwn(n,"minRank")&&a.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),a}}),C=i((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let i=e.parent(r),s,a;for(;i;){if((s=e.parent(i))?(a=n[s],n[s]=i):(a=o,o=i),a&&a!==i)return void t.setEdge(a,i);i=s}})}}),O=i((e,t)=>{var r=w(),n=x(),o=_(),i=N(),a=C(),d=s().Graph,c=l();function h(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){return i(e,t,r,n.get(t)||[])})}function u(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,i={}){if("function"==typeof i.customOrder)return void i.customOrder(t,e);let s=c.maxRank(t),l=h(t,c.range(1,s+1),"inEdges"),p=h(t,c.range(s-1,-1,-1),"outEdges"),f=r(t);if(u(t,f),i.disableOptimalOrderHeuristic)return;let g=1/0,m,v=i.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new d;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let i=e.graph().root,s=o(e,i,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),a(e,n,s.vs)})})(e%2?l:p,e%4>=2,v),f=c.buildLayerMatrix(t);let i=n(t,f);i<g?(r=0,m=Object.assign({},f),g=i):i===g&&(m=structuredClone(f))}u(t,m)}}),R=i((e,t)=>{var r=s().Graph,n=l();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,i=0,s=t.length,d=n[n.length-1];return n.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),h=c?e.node(c).order:s;(c||t===d)&&(n.slice(i,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let i=e.node(n),s=i.order;(s<o||h<s)&&!(i.dummy&&e.node(t).dummy)&&a(r,n,t)})}),i=l+1,o=h)}),n}),r}function i(e,t){let r={};function o(t,o,i,s,d){let l;n.range(o,i).forEach(n=>{l=t[n],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>d)&&a(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,i,s=0;return r.forEach((a,d)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(i=e.node(t[0]).order,o(r,s,d,n,i),s=d,n=i)}o(r,s,r.length,i,t.length)}),r}),r}function a(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function d(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function c(e,t,r,n){let o={},i={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=n(e);if(a.length){let n=((a=a.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let l=Math.floor(n),c=Math.ceil(n);l<=c;++l){let n=a[l];i[e]===e&&t<s[n]&&!d(r,e,n)&&(i[n]=e,i[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:i}}function h(e,t,n,o,i){var s,a,d,l,c,h,u;let p,f,g,m={},v=(s=e,a=t,d=n,l=i,p=new r,g=(c=(f=s.graph()).nodesep,h=f.edgesep,u=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),i,s;if(i=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(i+=u?s:-s),s=0,i+=(n.dummy?h:c)/2,i+=(o.dummy?h:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(i+=u?s:-s),s=0,i}),a.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(p.setNode(r),t){var n=d[t],o=p.edge(n,r);p.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),p),y=i?"borderLeft":"borderRight";function b(e,t){let r=v.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return b(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),b(function(t){let r=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==y&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function u(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var i,s;let a=(i=e,s=t,i.node(s).width/2);n=Math.max(r+a,n),o=Math.min(r-a,o)});let i=n-o;return i<t[0]&&(t=[i,r]),t},[1/0,null])[1]}function p(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),i=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let a=r+s,d=e[a];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=i-n.applyWithChunking(Math.max,l)),c&&(e[a]=n.mapValues(d,e=>e+c))})})}function f(e,t){return n.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=n.buildLayerMatrix(e),r=Object.assign(o(e,t),i(e,t)),s={},a;["u","d"].forEach(o=>{a="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(a=a.map(e=>Object.values(e).reverse()));let i=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,a,r,i),l=h(e,a,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),s[o+t]=l})});let d=u(e,s);return p(s,d),f(s,e.graph().align)},findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:d,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:p,findSmallestWidthAlignment:u,balance:f}}),P=i((e,t)=>{var r=l(),n=R().positionX;t.exports=function(e){var t;let o,i,s,a;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),i=t.graph().ranksep,s=t.graph().rankalign,a=0,o.forEach(e=>{let r=e.reduce((e,r)=>{let n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>{let n=t.node(e);"top"===s?n.y=a+n.height/2:"bottom"===s?n.y=a+r-n.height/2:n.y=a+r/2}),a+=r+i}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=i((e,t)=>{var r=c(),n=h(),o=g(),i=l().normalizeRanks,a=m(),d=l().removeEmptyRanks,u=v(),p=y(),f=b(),w=O(),x=P(),E=l(),k=s().Graph;t.exports=function(e,t={}){let s=t.debugTiming?E.time:E.notime;return s("layout",()=>{let l=s(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=D(t.graph()),r.setGraph(Object.assign({},_,S(n,j),E.pick(n,N))),t.nodes().forEach(e=>{let n=S(D(t.node(e)),C);Object.keys(R).forEach(e=>{void 0===n[e]&&(n[e]=R[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=D(t.edge(e));r.setEdge(e,Object.assign({},T,S(n,M),E.pick(n,L)))}),r});return s(" runLayout",()=>{var e,c,h;return e=l,c=s,h=t,void(c(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),c(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),c(" acyclic",()=>r.run(e)),c(" nestingGraph.run",()=>u.run(e)),c(" rank",()=>o(E.asNonCompoundGraph(e))),c(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};E.addDummyNode(t,"edge-proxy",n,"_ep")}})}),c(" removeEmptyRanks",()=>d(e)),c(" nestingGraph.cleanup",()=>u.cleanup(e)),c(" normalizeRanks",()=>i(e)),c(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),c(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),c(" normalize.run",()=>n.run(e)),c(" parentDummyChains",()=>a(e)),c(" addBorderSegments",()=>p(e)),c(" order",()=>w(e,h)),c(" insertSelfEdges",()=>{var t;return t=e,void E.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{E.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),c(" adjustCoordinateSystem",()=>f.adjust(e)),c(" position",()=>x(e)),c(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),o=n.x+n.width/2,i=n.y,s=r.x-o,a=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:i-a},{x:o+5*s/6,y:i-a},{x:o+s,y:i},{x:o+5*s/6,y:i+a},{x:o+2*s/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}),c(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),c(" normalize.undo",()=>n.undo(e)),c(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),c(" undoCoordinateSystem",()=>f.undo(e)),c(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,i=e.graph(),s=i.marginx||0,a=i.marginy||0;function d(e){let i=e.x,s=e.y,a=e.width,d=e.height;t=Math.min(t,i-a/2),r=Math.max(r,i+a/2),n=Math.min(n,s-d/2),o=Math.max(o,s+d/2)}e.nodes().forEach(t=>d(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&d(r)}),t-=s,n-=a,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+s,i.height=o-n+a})(e)),c(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=o,s=n),r.points.unshift(E.intersectRect(n,i)),r.points.push(E.intersectRect(o,s))})}),c(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),c(" acyclic.undo",()=>r.undo(e)))}),s(" updateInputGraph",()=>{var t,r;return t=e,r=l,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),l})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],C=["width","height","rank"],R={width:0,height:0},M=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function S(e,t){return E.mapValues(E.pick(e,t),Number)}function D(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),T=i((e,t)=>{var r=l(),n=s().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),L=i((e,t)=>{t.exports="2.0.4"});let S=i((e,t)=>{t.exports={graphlib:s(),layout:M(),debug:T(),util:{time:l().time,notime:l().notime},version:L()}})(),D={featureNode:{width:288,height:140},repositoryNode:{width:288,height:50},addRepositoryNode:{width:224,height:50}};function A(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:D[e.type??""]??t}function F(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:i=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let a=new S.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:n,ranksep:i,nodesep:s});let d=new Set;for(let e of t)d.add(e.source),d.add(e.target);let l=e.filter(e=>d.has(e.id)),c=e.filter(e=>!d.has(e.id));for(let e of l){let t=A(e,o);a.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)a.hasNode(e.source)&&a.hasNode(e.target)&&a.setEdge(e.source,e.target,{},e.id);S.layout(a);let{targetPosition:h,sourcePosition:u}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),p=[];for(let e of l){let t=a.node(e.id),r=A(e,o);p.push({...e,targetPosition:h,sourcePosition:u,position:{x:t.x-r.width/2,y:t.y-r.height/2}})}if(c.length>0){let e=0,t=1/0;for(let r of p){let n=A(r,o);e=Math.max(e,r.position.y+n.height),t=Math.min(t,r.position.x)}t===1/0&&(t=0);for(let r=0;r<c.length;r++){let n=c[r],i=A(n,o);p.push({...n,targetPosition:h,sourcePosition:u,position:{x:t,y:e+30+r*(i.height+20)}})}}return{nodes:p,edges:[...t]}}var I=e.i(10080),z=e.i(21023);let G=(0,z.createServerReference)("4054f75d1d00abde177f2b0d5131c9bb0c838cf681",z.callServer,void 0,z.findSourceMapURL,"addRepository"),B=(0,z.createServerReference)("4072c48aec362e3ba9f0af1fec500972ad3fcc3183",z.callServer,void 0,z.findSourceMapURL,"deleteRepository");var $=e.i(39443),q=e.i(8361),W=e.i(99045);let V=0;function H(e,i){let s=(0,r.useRouter)(),[a,d]=(0,t.useState)(e),[l,c]=(0,t.useState)(i),h=(0,t.useRef)(i),u=(0,t.useCallback)(e=>{c(t=>{let r="function"==typeof e?e(t):e;return h.current=r,r})},[]),p=(0,q.useSoundAction)("delete"),f=(0,q.useSoundAction)("create"),g=e.map(e=>e.id).sort().join(","),m=i.map(e=>e.id).sort().join(","),v=(0,t.useRef)(new Map),y=e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(",");(0,t.useEffect)(()=>{d(t=>{let r=new Map(t.map(e=>[e.id,e])),n=new Set(e.map(e=>e.id)),o=t.filter(e=>"featureNode"===e.type&&"creating"===e.data.state&&!n.has(e.id));return e.map(e=>{let t=r.get(e.id);if(t)return{...e,position:t.position};if("featureNode"===e.type&&o.length>0){let t=o.shift();return{...e,position:t.position}}return e})})},[g,e]),(0,t.useEffect)(()=>{u(i)},[m,i,u]);let{events:b}=(0,$.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=v.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,o=t.get(r.id);void 0!==o&&o!==e.state&&(b.some(t=>t.featureId===e.featureId&&(0,W.mapEventTypeToState)(t.eventType)===e.state)||("done"===e.state?n.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?n.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>{s.push(`/feature/${e.featureId}`)}}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[y,e,b,s]);let w=(0,t.useRef)(0),x=(0,t.useRef)(void 0);(0,t.useEffect)(()=>()=>clearTimeout(x.current),[]),(0,t.useEffect)(()=>{if(b.length<=w.current)return;let e=b.slice(w.current);for(let t of(w.current=b.length,e)){let e=(0,W.mapEventTypeToState)(t.eventType),r=(0,W.mapPhaseNameToLifecycle)(t.phaseName);d(n=>n.map(n=>{if("featureNode"!==n.type)return n;let o=n.data;return o.featureId!==t.featureId?n:{...n,data:{...o,state:e,...void 0!==r&&{lifecycle:r}}}}))}clearTimeout(x.current),x.current=setTimeout(()=>s.refresh(),3e3)},[b,s]),(0,t.useEffect)(()=>{if(!a.some(e=>{if("featureNode"!==e.type)return!1;let t=e.data;return"running"===t.state||"action-required"===t.state||"creating"===t.state}))return;let e=setInterval(()=>s.refresh(),5e3);return()=>clearInterval(e)},[a,s]);let E=(0,t.useCallback)(e=>{d(t=>(0,o.applyNodeChanges)(e,t))},[]),k=(0,t.useCallback)(e=>{e.source&&e.target&&d(t=>{let r=t.find(t=>t.id===e.source);return r?.type!=="repositoryNode"||u(r=>r.some(r=>{let n=t.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===e.target})?r:[...r,{id:`edge-${e.source}-${e.target}`,source:e.source,target:e.target,style:{strokeDasharray:"5 5"}}]),t})},[u]),j=(0,t.useCallback)((e,t,r)=>{let n=`feature-${Date.now()}-${V++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return d(t=>{let r,i=e?new Set(h.current.filter(t=>t.source===e).map(e=>e.target)):new Set,s=t.filter(e=>i.has(e.id));if(s.length>0){let e=s.map(e=>e.position.y).sort((e,t)=>e-t),t=e[e.length-1],n=e.length>1?e[1]-e[0]:160;r={x:s[0].position.x,y:t+n}}else if(e){let n=t.find(t=>t.id===e);r=n?{x:n.position.x+488,y:n.position.y}:{x:400,y:200}}else{let e=t.length>0?Math.max(...t.map(e=>e.position.y)):0;r={x:400,y:t.length>0?e+160:200}}let a=r.y+140,d=new Set([e,...i]),l=t.filter(e=>d.has(e.id)).reduce((e,t)=>{let r="featureNode"===t.type?140:50;return Math.max(e,t.position.y+r)},0),c=Math.max(0,a-l),u=c>0?t.map(e=>d.has(e.id)||i.has(e.id)?e:e.position.y>=l?{...e,position:{...e.position,y:e.position.y+c}}:e):t;return[...e?u.map(t=>{if(t.id!==e)return t;let n=[...s.map(e=>e.position.y),r.y],o=(Math.min(...n)+Math.max(...n)+140)/2,i="featureNode"===t.type?140:50;return{...t,position:{...t.position,y:o-i/2}}}):u,{id:n,type:"featureNode",position:r,data:o}]}),e&&u(t=>[...t,{id:"dependencyEdge"===r?`dep-${e}-${n}`:`edge-${e}-${n}`,source:e,target:n,...r?{type:r}:{style:{strokeDasharray:"5 5"}}}]),n},[u]),_=(0,t.useCallback)(async e=>{try{let t=await (0,I.deleteFeature)(e);if(t.error)return void n.toast.error(t.error);d(t=>{let r=t.filter(t=>t.id!==e),n=l.filter(t=>t.source!==e&&t.target!==e),o=F(r,n,{direction:"LR",ranksep:200,nodesep:60});return u(o.edges),o.nodes}),p.play(),n.toast.success("Feature deleted successfully"),s.refresh()}catch{n.toast.error("Failed to delete feature")}},[s,l,p,u]),N=(0,t.useCallback)(async e=>{let t=`repo-${e}`;d(e=>e.filter(e=>e.id!==t)),u(e=>e.filter(e=>e.source!==t&&e.target!==t));try{let t=await B(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),s.refresh();return}p.play(),n.toast.success("Repository removed"),s.refresh()}catch{n.toast.error("Failed to remove repository"),s.refresh()}},[s,p,u]),C=(0,t.useCallback)(e=>{d(t=>{let r=F(t,l,{direction:e,ranksep:60,nodesep:20});return u(r.edges),r.nodes})},[l,u]);return{nodes:a,edges:l,onNodesChange:E,handleConnect:k,handleAddRepository:(0,t.useCallback)(e=>{let t=`repo-temp-${Date.now()}`,r=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e,o=0;d(n=>{let i=n.filter(e=>"repositoryNode"===e.type),s=n.find(e=>"addRepositoryNode"===e.type);s&&(o=s.position.y);let a={x:i[0]?.position.x??s?.position.x??50,y:s?s.position.y:0},d=s?s.position.y+50+15:a.y+50+15;return n.map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:d}}:e).concat({id:t,type:"repositoryNode",position:a,data:{name:r,repositoryPath:e,id:t}})}),G({path:e,name:r}).then(e=>{if(e.error){d(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error(e.error);return}let r=e.repository,i=`repo-${r.id}`;d(e=>e.map(e=>e.id===t?{...e,id:i,data:{...e.data,id:r.id,repositoryPath:r.path}}:e)),u(e=>e.map(e=>({...e,source:e.source===t?i:e.source,target:e.target===t?i:e.target,id:e.id.replace(t,i)}))),f.play(),s.refresh()}).catch(()=>{d(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error("Failed to add repository")})},[s,f,u]),handleLayout:C,handleDeleteFeature:_,handleDeleteRepository:N,createFeatureNode:j}}e.s(["useControlCenterState",()=>H],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),i=e.i(3214),s=e.i(35364);e.i(54793);var a=e.i(7729);e.i(47506);var d=e.i(89313),l=e.i(92002),c=e.i(3645);let h=(0,c.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var u=e.i(8986),p=e.i(38573),f=e.i(19933),g=e.i(67669),m=e.i(24042),v=e.i(64970),y=e.i(31777);e.i(81803);var b=e.i(72714),w=e.i(71326),x=e.i(2828);e.i(99348);var E=e.i(17466),k=e.i(8537),j=e.i(63629),_=e.i(76852);function N({data:e}){let[o,s]=(0,n.useState)(!1),a=(0,_.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),d=(0,k.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),c="Booting"===d.status||"Ready"===d.status;return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),s(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(g.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.AlertDialog,{open:o,onOpenChange:s,children:(0,t.jsxs)(w.AlertDialogContent,{size:"sm",children:[(0,t.jsxs)(w.AlertDialogHeader,{children:[(0,t.jsx)(w.AlertDialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.AlertDialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.AlertDialogFooter,{children:[(0,t.jsx)(w.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(w.AlertDialogAction,{variant:"destructive",onClick:()=>e.onDelete?.(e.id),children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-default items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(h,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,y.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in IDE",onClick:a.openInIde,loading:a.ideLoading,error:!!a.ideError,icon:u.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in Shell",onClick:a.openInShell,loading:a.shellLoading,error:!!a.shellError,icon:p.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open Folder",onClick:a.openFolder,loading:a.folderLoading,error:!!a.folderError,icon:f.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open Folder"})]})}),j.featureFlags.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:c?"Stop Dev Server":"Start Dev Server",onClick:c?d.stop:d.deploy,loading:d.deployLoading||d.stopLoading,error:!!d.deployError,icon:c?v.Square:m.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:c?"Stop Dev Server":"Start Dev Server"})]})}),c?(0,t.jsx)(E.DeploymentStatusBadge,{status:d.status,url:d.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:"text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",children:(0,t.jsx)(i.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:l.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}e.i(1650),e.i(45811),e.i(25235),e.i(1354);var C=e.i(1963);function O(e){let[n]=(0,l.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}function R({nodes:e,edges:o,selectedFeatureId:l,onNodesChange:c,onAddFeature:h,onNodeAction:u,onNodeSettings:p,onConnect:f,onNodeClick:g,onPaneClick:m,onRepositoryAdd:v,onRepositoryClick:y,onRepositoryDelete:b,onFeatureDelete:w,onRepositorySelect:x,onCanvasDrag:E,toolbar:k,emptyState:j}){let _=(0,n.useMemo)(()=>({featureNode:d.FeatureNode,repositoryNode:N,addRepositoryNode:C.AddRepositoryNode}),[]),R=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),P=(0,n.useCallback)(t=>{let r=e.find(e=>e.id===t.source);return r?.type!=="repositoryNode"||!o.some(r=>{let n=e.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===t.target})},[e,o]),M=(0,n.useMemo)(()=>e.map(e=>({...e,..."featureNode"===e.type&&{selected:null!=l&&e.data.featureId===l},data:{...e.data,showHandles:o.length>0,..."featureNode"===e.type&&"creating"!==e.data.state?{onAction:u?()=>u(e.id):void 0,onSettings:p?()=>p(e.id):void 0,onDelete:w}:{},..."repositoryNode"===e.type&&{onAdd:v?()=>v(e.id):void 0,onClick:y?()=>y(e.id):void 0,onDelete:b},..."addRepositoryNode"===e.type&&{onSelect:x?e=>x(e):void 0}}})),[e,o.length,l,u,p,w,v,y,b,x]);return 0===e.length?j?(0,t.jsx)("div",{"data-testid":"features-canvas-empty",className:"h-full w-full",children:j}):(0,t.jsx)("div",{"data-testid":"features-canvas-empty",children:(0,t.jsx)(a.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(s.Button,{onClick:h,children:[(0,t.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})})}):(0,t.jsx)("div",{"data-testid":"features-canvas","data-no-drawer-close":!0,className:"pointer-events-auto h-full w-full",children:(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsxs)(r.ReactFlow,{nodes:M,edges:o,nodeTypes:_,edgeTypes:R,isValidConnection:P,onConnect:f,onNodesChange:c,onNodeClick:g,onPaneClick:m,onMoveStart:E,defaultViewport:{x:30,y:30,zoom:.85},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[(0,t.jsx)(r.Background,{}),(0,t.jsx)(r.Controls,{}),k]})})})}let P=(0,c.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var M=e.i(60253);let T="shep:notification-banner-dismissed";function L(){let[e,r]=(0,n.useState)(!1);(0,n.useEffect)(()=>{void 0===globalThis.Notification||"default"!==globalThis.Notification.permission||"true"!==localStorage.getItem(T)&&r(!0)},[]);let o=(0,n.useCallback)(async()=>{if(void 0===globalThis.Notification)return;let e=await globalThis.Notification.requestPermission();("granted"===e||"denied"===e)&&r(!1)},[]),i=(0,n.useCallback)(()=>{localStorage.setItem(T,"true"),r(!1)},[]);return e?(0,t.jsxs)("div",{className:"bg-background absolute bottom-4 left-4 z-50 flex max-w-sm items-center gap-3 rounded-lg border p-3 shadow-lg",children:[(0,t.jsx)(P,{className:"text-muted-foreground size-5 shrink-0"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Enable desktop notifications to stay updated on feature progress."}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(s.Button,{size:"sm",onClick:o,children:"Enable"}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon-xs",onClick:i,"aria-label":"Dismiss notification banner",children:(0,t.jsx)(M.X,{})})]})]}):null}var S=e.i(5147),D=e.i(8361);let A=(0,c.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var F=e.i(33548),I=e.i(23925),z=e.i(83428),G=e.i(78986);let B=["cd ~/my-repo",'shep feat new "create modern, sleek dashboards"'];function $({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[a,d]=(0,n.useState)(!1);async function l(){if(!a){d(!0);try{let t=await (0,G.pickFolder)();t&&e?.(t)}finally{d(!1)}}}let c=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText(B.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]);return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,y.cn)("relative h-full w-full",r),children:[(0,t.jsx)("div",{className:"absolute inset-0 [background-image:radial-gradient(circle,_var(--color-border)_1px,_transparent_1px)] [background-size:24px_24px]"}),(0,t.jsxs)("div",{className:"absolute top-8 left-8 z-10",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-3xl font-light",children:"Control Center"})]}),(0,t.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-6",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(h,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:l,disabled:a,className:"border-muted-foreground/30 hover:border-primary hover:text-primary flex cursor-pointer items-center gap-3 rounded-lg border-2 border-dashed px-8 py-4 transition-colors disabled:cursor-wait disabled:opacity-60",children:[a?(0,t.jsx)(z.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(i.Plus,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a?"Opening...":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-border h-px w-16"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(A,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Or start from the command line"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-16"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-lg bg-zinc-900 px-5 py-4 font-mono text-sm text-zinc-100",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:c,className:"absolute top-3 right-3 cursor-pointer rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200","aria-label":"Copy commands",children:o?(0,t.jsx)(I.Check,{className:"h-4 w-4"}):(0,t.jsx)(F.Copy,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"space-y-1",children:B.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Feature will appear on canvas once created"})]})})]})}var q=e.i(17840);function W({initialNodes:e,initialEdges:r}){let i,s=(0,o.useRouter)(),a=(0,o.usePathname)(),d=(i=(0,o.usePathname)().match(/^\/feature\/(.+)$/),i?.[1]??null),l=(0,D.useSoundAction)("click"),{nodes:c,edges:h,onNodesChange:u,handleConnect:p,handleAddRepository:f,handleDeleteFeature:g,handleDeleteRepository:m,createFeatureNode:v}=(0,q.useControlCenterState)(e,r),{setFeatures:y}=(0,S.useSidebarFeaturesContext)(),b=(0,n.useMemo)(()=>c.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.runtime??""}:${t.startedAt??""}`}).sort().join(","),[c]);(0,n.useEffect)(()=>{y(c.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data,r=(0,S.mapNodeStateToSidebarStatus)(t.state);return r?{featureId:t.featureId,name:t.name,status:r,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime}}:null}).filter(Boolean))},[b,c,y]);let w=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let e=t.data;"creating"!==e.state&&(l.play(),s.push(`/feature/${e.featureId}`))}},[s,l]),x=(0,n.useCallback)(()=>{l.play(),s.push("/create")},[s,l]),E=(0,n.useCallback)(e=>{l.play();let t=c.find(t=>t.id===e),r=t?.data?.repositoryPath;r?s.push(`/create?repo=${encodeURIComponent(r)}`):s.push("/create")},[c,s,l]),k=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=h.find(t=>t.target===e),n=r?c.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;l.play();let i=new URLSearchParams;o&&i.set("repo",o),i.set("parent",t),s.push(`/create?${i.toString()}`)},[c,h,s,l]),j=(0,n.useCallback)(e=>{let t=c.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&s.push(`/repository/${e.id}`)}},[c,s]),_=(0,n.useCallback)(()=>{"/"!==a&&s.push("/")},[s,a]);return((0,n.useEffect)(()=>{let e=e=>{f(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[f]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail,r=c.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);v(r?.id??null,{state:"creating",name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[c,v]),c.some(e=>"repositoryNode"===e.type))?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(R,{nodes:c,edges:h,selectedFeatureId:d,onNodesChange:u,onConnect:p,onAddFeature:x,onNodeAction:k,onNodeClick:w,onPaneClick:_,onRepositoryAdd:E,onRepositoryClick:j,onRepositoryDelete:m,onFeatureDelete:g,onRepositorySelect:f,emptyState:(0,t.jsx)($,{onRepositorySelect:f})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)($,{onRepositorySelect:f})]})}function V({initialNodes:e,initialEdges:n,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(W,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>V],48246)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17840,e=>{"use strict";var t=e.i(79054),r=e.i(31406),n=e.i(60112),o=e.i(53271),i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=i((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,n)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?r(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n},i=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function i(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}return o+"\x01"+i+"\x01"+(void 0===n?"\0":n)}function s(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,t,n,o,s=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var d=i(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,d))return s&&(this._edgeLabels[d]=o),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[d]=s?o:this._defaultEdgeLabelFn(e,t,n);var l=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}var a={v:o,w:i};return n&&(a.name=n),a}(this._isDirected,e,t,n);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[d]=l,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][d]=l,this._out[e][d]=l,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var o=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r),a=this._edgeObjs[o];return a&&(e=a.v,t=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,r){if(e){var n=Object.values(e);return r?n.filter(function(e){return e.v===t&&e.w===r||e.v===r&&e.w===t}):n}}}}),s=n((e,t)=>{t.exports="3.0.2"}),a=n((e,t)=>{t.exports={Graph:i(),version:s()}}),d=n((e,t)=>{var r=i();t.exports={write:function(e){var t,r,n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(function(e){var t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})};return void 0!==e.graph()&&(n.value=structuredClone(e.graph())),n},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=n((e,t)=>{t.exports=function(e,t,n,o){return function(e,t,r,n){var o={},i=!0,s=0,a=e.nodes(),d=function(e){var t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},l=function(){a.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};a.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=a.length,h=1;h<c&&(i=!1,s++,l(),i);h++);if(s===c-1&&(i=!1,l(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),n||r,o||function(t){return e.outEdges(t)})};var r=()=>1}),c=n((e,t)=>{t.exports=function(e){var t,r={},n=[];return e.nodes().forEach(function(o){t=[],function n(o){Object.hasOwn(r,o)||(r[o]=!0,t.push(o),e.successors(o).forEach(n),e.predecessors(o).forEach(n))}(o),t.length&&n.push(t)}),n}}),h=n((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(!Object.hasOwn(r,e=String(e))){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}}}),u=n((e,t)=>{var r=h();t.exports=function(e,t,o,i){return function(e,t,n,o){var i,s,a={},d=new r,l=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),l=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<r.distance&&(r.distance=l,r.predecessor=i,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;a[e]={distance:r},d.add(e,r)});d.size()>0&&(s=a[i=d.removeMin()]).distance!==1/0;)o(i).forEach(l);return a}(e,String(t),o||n,i||function(t){return e.outEdges(t)})};var n=()=>1}),p=n((e,t)=>{var r=u();t.exports=function(e,t,n){return e.nodes().reduce(function(o,i){return o[i]=r(e,i,t,n),o},{})}}),f=n((e,t)=>{t.exports=function(e,t,r){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[r].predecessor&&r!==t)throw Error("Invalid destination vertex");return{weight:e[r].distance,path:function(e,t,r){for(var n=[],o=r;o!==t;)n.push(o),o=e[o].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(n,i)||function i(s){var a=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(i(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(i)}),o}}),m=n((e,t)=>{var r=g();t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),v=n((e,t)=>{t.exports=function(e,t,n){var o,i,s,a,d;return o=e,i=t||r,s=n||function(t){return e.outEdges(t)},a={},(d=o.nodes()).forEach(function(e){a[e]={},a[e][e]={distance:0},d.forEach(function(t){e!==t&&(a[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=i(t);a[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=a[e];d.forEach(function(r){var n=a[r];d.forEach(function(r){var o=n[e],i=t[r],s=n[r],a=o.distance+i.distance;a<s.distance&&(s.distance=a,s.predecessor=i.predecessor)})})}),a};var r=()=>1}),y=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function i(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(i),delete r[s],o.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return o}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),b=n((e,t)=>{var r=y();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),w=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,r,n,o,i,s,a){return Object.hasOwn(o,r)||(o[r]=!0,n||(a=s(a,r)),i(r).forEach(function(r){a=e(t,r,n,o,i,s,a)}),n&&(a=s(a,r))),a}(e,t,"post"===r,s,i,n,o)}),o}}),x=n((e,t)=>{var r=w();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=i(),n=h();t.exports=function(e,t){var o,i=new r,s={},a=new n;function d(e){var r=e.v===o?e.w:e.v,n=a.priority(r);if(void 0!==n){var i=t(e);i<n&&(s[r]=o,a.decrease(r,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){a.add(e,1/0),i.setNode(e)}),a.decrease(e.nodes()[0],0);for(var l=!1;a.size()>0;){if(Object.hasOwn(s,o=a.removeMin()))i.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return i}}),_=n((e,t)=>{var r=u(),n=l();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return r(e,t,o,i);for(var s=!1,a=e.nodes(),d=0;d<a.length;d++){for(var l=i(a[d]),c=0;c<l.length;c++){var h=l[c],u=h.v===a[d]?h.v:h.w,p=u===h.v?h.w:h.v;0>o({v:u,w:p})&&(s=!0)}if(s)return n(e,t,o,i)}return r(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),N=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:u(),dijkstraAll:p(),extractPath:f(),findCycles:m(),floydWarshall:v(),isAcyclic:b(),postorder:E(),preorder:k(),prim:j(),shortestPaths:_(),reduce:w(),tarjan:g(),topsort:y()}}),C=a();t.exports={Graph:C.Graph,json:d(),alg:N(),version:C.version}}),a=i((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),d=i((e,t)=>{var r=s().Graph,n=a();t.exports=function(e,t){var s,a;let l,c,h,u,p;if(1>=e.nodeCount())return[];let f=(s=e,a=t||o,l=new r,c=0,h=0,s.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),s.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=a(e);l.setEdge(e.v,e.w,t+r),h=Math.max(h,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),u=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(h+c+3).map(()=>new n),p=c+1,l.nodes().forEach(e=>{d(u,p,l.node(e))}),{graph:l,buckets:u,zeroIdx:p});return(function(e,t,r){let n=[],o=t[t.length-1],s=t[0],a;for(;e.nodeCount();){for(;a=s.dequeue();)i(e,t,r,a);for(;a=o.dequeue();)i(e,t,r,a);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(a=t[o].dequeue()){n=n.concat(i(e,t,r,a,!0));break}}}return n})(f.graph,f.buckets,f.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let i=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),a=e.node(n.v);o&&i.push({v:n.v,w:n.w}),a.out-=s,d(t,r,a)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),i=n.w,s=e.node(i);s.in-=o,d(t,r,s)}),e.removeNode(n.v),i}function d(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}}),l=i((e,t)=>{var r=s().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=d(n);return r.dummy=t,e.setNode(o,r),o}t.exports={addBorderNode:function(e,t,r,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=o),n(e,"border",i,t)},addDummyNode:n,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t},buildLayerMatrix:function(e){let t=l(i(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,i=e.y,s=t.x-o,a=t.y-i,d=e.width/2,l=e.height/2;if(!s&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(s)*l?(a<0&&(l=-l),r=l*s/a,n=l):(s<0&&(d=-d),r=d,n=d*a/s),{x:o+r,y:i+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:i,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}));e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});let n=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%i!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:d,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let r=function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function i(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var a=0;function d(e){return e+""+ ++a}function l(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),c=i((e,t)=>{var r=d(),n=l().uniqueId;t.exports={run:function(e){var t,o;let i,s,a;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(i=[],s={},a={},(o=e).nodes().forEach(function e(t){Object.hasOwn(a,t)||(a[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?i.push(t):e(t.w)}),delete s[t])}),i)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),h=i((e,t)=>{var r=l();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,i,s=t.v,a=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,h=e.edge(t),u=h.labelRank;if(l!==a+1){for(e.removeEdge(t),i=0,++a;a<l;++i,++a)h.points=[],o={width:0,height:0,edgeLabel:h,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",o,"_d"),a===u&&(o.width=h.width,o.height=h.height,o.dummy="edge-label",o.labelpos=h.labelpos),e.setEdge(s,n,{weight:h.weight},c),0===i&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:h.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}}}),u=i((e,t)=>{var{applyWithChunking:r}=l();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var s=r(Math.min,e.outEdges(o).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),i.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),p=i((e,t)=>{var r=s().Graph,n=u().slack;t.exports=function(e){var t,o,i,s,a=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(a.setNode(d,{});t=a,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(i=>{var s=i.v,a=r===s?i.w:s;t.hasNode(a)||n(o,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),e(a))})}),t.nodeCount()<l;)i=function(e,t){return t.edges().reduce((r,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=n(t,o)),i<r[0]?[i,o]:r},[1/0,null])[1]}(a,e),s=a.hasNode(i.v)?n(e,i):-n(e,i),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(a,e,s);return a}}),f=i((e,t)=>{var r=p(),n=u().slack,o=u().longestPath,i=s().alg.preorder,a=s().alg.postorder,d=l().simplify;function c(e){o(e=d(e));var t,n,i=r(e);for(g(i),h(i,e);t=m(i);)n=v(i,e,t),y(i,e,t,n)}function h(e,t){var r=a(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,i,s;return n=e,o=t,i=r,s=n.node(i).parent,void(n.edge(i,s).cutvalue=f(n,o,i))})}function f(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),s=0;return i||(o=!1,i=t.edge(n,r)),s=i.weight,t.nodeEdges(r).forEach(i=>{var a=i.v===r,d=a?i.w:i.v;if(d!==n){var l,c,h,u=a===o,p=t.edge(i).weight;if(s+=u?p:-p,l=e,c=r,h=d,l.hasEdge(c,h)){var f=e.edge(r,d).cutvalue;s+=u?-f:f}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var s=n,a=t.node(o);return r[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(r,i)||(n=e(t,r,n,i,o))}),a.low=s,a.lim=n++,i?a.parent=i:delete a.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v(e,t,r){var o=r.v,i=r.w;t.hasEdge(o,i)||(o=r.w,i=r.v);var s=e.node(o),a=e.node(i),d=s,l=!1;return s.lim>a.lim&&(d=a,l=!0),t.edges().filter(t=>l===b(e,e.node(t.v),d)&&l!==b(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function y(e,t,r,n){var o,s,a,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),h(e,t),o=e,s=t,a=o.nodes().find(e=>!s.node(e).parent),(d=(d=i(o,a)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=s.edge(e,t),n=!1;r||(r=s.edge(t,e),n=!0),s.node(e).rank=s.node(t).rank+(n?r.minlen:-r.minlen)})}function b(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=h,c.calcCutValue=f,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=y}),g=i((e,t)=>{var r=u().longestPath,n=p(),o=f();t.exports=function(e){var t,s=e.graph().ranker;if(s instanceof Function)return s(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":i(e);case"none":}};var i=r}),m=i((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let i=n;t.children(o).forEach(e),r[o]={low:i,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,i=function(e,t,r,n){let o=[],i=[],s=Math.min(t[r].low,t[n].low),a=Math.max(t[r].lim,t[n].lim),d,l;d=r;do o.push(d=e.parent(d));while(d&&(t[d].low>s||a>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)i.push(d);return{path:o.concat(i.reverse()),lca:l}}(e,o,n.v,n.w),s=i.path,a=i.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==a&&e.node(l).maxRank<r.rank;)d++;l===a&&(c=!1)}if(!c){for(;d<s.length-1&&e.node(l=s[d+1]).minRank<=r.rank;)d++;l=s[d]}e.setParent(t,l),t=e.successors(t)[0]}})}}),v=i((e,t)=>{var r=l();t.exports={run:function(e){var t,n,o;let i=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var i=t.children(r);i&&i.length&&i.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),a=Object.values(s),d=r.applyWithChunking(Math.max,a)-1,l=2*d+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,o,i,s,a,d){let l=t.children(d);if(!l.length){d!==n&&t.setEdge(n,d,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),h=r.addBorderNode(t,"_bb"),u=t.node(d);t.setParent(c,d),u.borderTop=c,t.setParent(h,d),u.borderBottom=h,l.forEach(r=>{e(t,n,o,i,s,a,r);let l=t.node(r),u=l.borderTop?l.borderTop:r,p=l.borderBottom?l.borderBottom:r,f=l.borderTop?i:2*i,g=u!==p?1:s-a[d]+1;t.setEdge(c,u,{weight:f,minlen:g,nestingEdge:!0}),t.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+a[d]})})(e,i,l,c,d,s,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),y=i((e,t)=>{var r=l();function n(e,t,n,o,i,s){let a=i[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);i[t][s]=d,e.setParent(d,o),a&&e.setEdge(a,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),i=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,i,t),n(e,"borderRight","_br",r,i,t)}})}}),b=i((e,t)=>{function r(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>n(e.edge(t)))}function n(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let s=e.graph().rankdir.toLowerCase();("bt"===s||"rl"===s)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(o),Object.hasOwn(r,"y")&&o(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>i(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),r(e))}}}),w=i((e,t)=>{var r=l();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),i=r.applyWithChunking(Math.max,o),s=r.range(i+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),x=i((e,t)=>{var r=l().zipObject;t.exports=function(e,t){let n=0;for(let o=1;o<t.length;++o)n+=function(e,t,n){let o=r(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let d=Array(a).fill(0),l=0;return i.forEach(e=>{let t=e.pos+s;d[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=d[t+1]),t=t-1>>1,d[t]+=e.weight;l+=e.weight*r}),l}(e,t[o-1],t[o]);return n}}),E=i((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),k=i((e,t)=>{var r=l();t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}),j=i((e,t)=>{var r=l();function n(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}t.exports=function(e,t){var o;let i=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=i.lhs,a=i.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,h=0;s.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),h=n(d,a,h),s.forEach(e=>{h+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=n(d,a,h)});let u={vs:d.flat(!0)};return c&&(u.barycenter=l/c,u.weight=c),u}}),_=i((e,t)=>{var r=E(),n=k(),o=j();t.exports=function e(t,i,s,a){var d,l;let c=t.children(i),h=t.node(i),u=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,f={};u&&(c=c.filter(e=>e!==u&&e!==p));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let i=e(t,r.v,s,a);f[r.v]=i,Object.hasOwn(i,"barycenter")&&(n=r,o=i,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+o.barycenter*o.weight)/(n.weight+o.weight),n.weight+=o.weight):(n.barycenter=o.barycenter,n.weight=o.weight))}});let m=n(g,s);d=m,l=f,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,a);if(u&&(v.vs=[u,v.vs,p].flat(!0),t.predecessors(u).length)){let e=t.node(t.predecessors(u)[0]),r=t.node(t.predecessors(p)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+r.order)/(v.weight+2),v.weight+=2}return v}}),N=i((e,t)=>{var r=s().Graph,n=l();t.exports=function(e,t,o,i){i||(i=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),a=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(r=>{let n=e.node(r),i=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(a.setNode(r),a.setParent(r,i||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=a.edge(n,r),i=void 0!==o?o.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+i})}),Object.hasOwn(n,"minRank")&&a.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),a}}),C=i((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let i=e.parent(r),s,a;for(;i;){if((s=e.parent(i))?(a=n[s],n[s]=i):(a=o,o=i),a&&a!==i)return void t.setEdge(a,i);i=s}})}}),O=i((e,t)=>{var r=w(),n=x(),o=_(),i=N(),a=C(),d=s().Graph,c=l();function h(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){return i(e,t,r,n.get(t)||[])})}function u(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,i={}){if("function"==typeof i.customOrder)return void i.customOrder(t,e);let s=c.maxRank(t),l=h(t,c.range(1,s+1),"inEdges"),p=h(t,c.range(s-1,-1,-1),"outEdges"),f=r(t);if(u(t,f),i.disableOptimalOrderHeuristic)return;let g=1/0,m,v=i.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new d;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let i=e.graph().root,s=o(e,i,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),a(e,n,s.vs)})})(e%2?l:p,e%4>=2,v),f=c.buildLayerMatrix(t);let i=n(t,f);i<g?(r=0,m=Object.assign({},f),g=i):i===g&&(m=structuredClone(f))}u(t,m)}}),R=i((e,t)=>{var r=s().Graph,n=l();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,i=0,s=t.length,d=n[n.length-1];return n.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),h=c?e.node(c).order:s;(c||t===d)&&(n.slice(i,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let i=e.node(n),s=i.order;(s<o||h<s)&&!(i.dummy&&e.node(t).dummy)&&a(r,n,t)})}),i=l+1,o=h)}),n}),r}function i(e,t){let r={};function o(t,o,i,s,d){let l;n.range(o,i).forEach(n=>{l=t[n],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>d)&&a(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,i,s=0;return r.forEach((a,d)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(i=e.node(t[0]).order,o(r,s,d,n,i),s=d,n=i)}o(r,s,r.length,i,t.length)}),r}),r}function a(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function d(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function c(e,t,r,n){let o={},i={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=n(e);if(a.length){let n=((a=a.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let l=Math.floor(n),c=Math.ceil(n);l<=c;++l){let n=a[l];i[e]===e&&t<s[n]&&!d(r,e,n)&&(i[n]=e,i[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:i}}function h(e,t,n,o,i){var s,a,d,l,c,h,u;let p,f,g,m={},v=(s=e,a=t,d=n,l=i,p=new r,g=(c=(f=s.graph()).nodesep,h=f.edgesep,u=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),i,s;if(i=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(i+=u?s:-s),s=0,i+=(n.dummy?h:c)/2,i+=(o.dummy?h:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(i+=u?s:-s),s=0,i}),a.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(p.setNode(r),t){var n=d[t],o=p.edge(n,r);p.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),p),y=i?"borderLeft":"borderRight";function b(e,t){let r=v.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return b(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),b(function(t){let r=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==y&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function u(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var i,s;let a=(i=e,s=t,i.node(s).width/2);n=Math.max(r+a,n),o=Math.min(r-a,o)});let i=n-o;return i<t[0]&&(t=[i,r]),t},[1/0,null])[1]}function p(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),i=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let a=r+s,d=e[a];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=i-n.applyWithChunking(Math.max,l)),c&&(e[a]=n.mapValues(d,e=>e+c))})})}function f(e,t){return n.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=n.buildLayerMatrix(e),r=Object.assign(o(e,t),i(e,t)),s={},a;["u","d"].forEach(o=>{a="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(a=a.map(e=>Object.values(e).reverse()));let i=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,a,r,i),l=h(e,a,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),s[o+t]=l})});let d=u(e,s);return p(s,d),f(s,e.graph().align)},findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:d,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:p,findSmallestWidthAlignment:u,balance:f}}),P=i((e,t)=>{var r=l(),n=R().positionX;t.exports=function(e){var t;let o,i,s,a;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),i=t.graph().ranksep,s=t.graph().rankalign,a=0,o.forEach(e=>{let r=e.reduce((e,r)=>{let n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>{let n=t.node(e);"top"===s?n.y=a+n.height/2:"bottom"===s?n.y=a+r-n.height/2:n.y=a+r/2}),a+=r+i}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=i((e,t)=>{var r=c(),n=h(),o=g(),i=l().normalizeRanks,a=m(),d=l().removeEmptyRanks,u=v(),p=y(),f=b(),w=O(),x=P(),E=l(),k=s().Graph;t.exports=function(e,t={}){let s=t.debugTiming?E.time:E.notime;return s("layout",()=>{let l=s(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=D(t.graph()),r.setGraph(Object.assign({},_,S(n,j),E.pick(n,N))),t.nodes().forEach(e=>{let n=S(D(t.node(e)),C);Object.keys(R).forEach(e=>{void 0===n[e]&&(n[e]=R[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=D(t.edge(e));r.setEdge(e,Object.assign({},T,S(n,M),E.pick(n,L)))}),r});return s(" runLayout",()=>{var e,c,h;return e=l,c=s,h=t,void(c(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),c(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),c(" acyclic",()=>r.run(e)),c(" nestingGraph.run",()=>u.run(e)),c(" rank",()=>o(E.asNonCompoundGraph(e))),c(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};E.addDummyNode(t,"edge-proxy",n,"_ep")}})}),c(" removeEmptyRanks",()=>d(e)),c(" nestingGraph.cleanup",()=>u.cleanup(e)),c(" normalizeRanks",()=>i(e)),c(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),c(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),c(" normalize.run",()=>n.run(e)),c(" parentDummyChains",()=>a(e)),c(" addBorderSegments",()=>p(e)),c(" order",()=>w(e,h)),c(" insertSelfEdges",()=>{var t;return t=e,void E.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{E.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),c(" adjustCoordinateSystem",()=>f.adjust(e)),c(" position",()=>x(e)),c(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),o=n.x+n.width/2,i=n.y,s=r.x-o,a=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:i-a},{x:o+5*s/6,y:i-a},{x:o+s,y:i},{x:o+5*s/6,y:i+a},{x:o+2*s/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}),c(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),c(" normalize.undo",()=>n.undo(e)),c(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),c(" undoCoordinateSystem",()=>f.undo(e)),c(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,i=e.graph(),s=i.marginx||0,a=i.marginy||0;function d(e){let i=e.x,s=e.y,a=e.width,d=e.height;t=Math.min(t,i-a/2),r=Math.max(r,i+a/2),n=Math.min(n,s-d/2),o=Math.max(o,s+d/2)}e.nodes().forEach(t=>d(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&d(r)}),t-=s,n-=a,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+s,i.height=o-n+a})(e)),c(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=o,s=n),r.points.unshift(E.intersectRect(n,i)),r.points.push(E.intersectRect(o,s))})}),c(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),c(" acyclic.undo",()=>r.undo(e)))}),s(" updateInputGraph",()=>{var t,r;return t=e,r=l,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),l})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],C=["width","height","rank"],R={width:0,height:0},M=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function S(e,t){return E.mapValues(E.pick(e,t),Number)}function D(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),T=i((e,t)=>{var r=l(),n=s().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),L=i((e,t)=>{t.exports="2.0.4"});let S=i((e,t)=>{t.exports={graphlib:s(),layout:M(),debug:T(),util:{time:l().time,notime:l().notime},version:L()}})(),D={featureNode:{width:288,height:140},repositoryNode:{width:288,height:50},addRepositoryNode:{width:224,height:50}};function A(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:D[e.type??""]??t}function F(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:i=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let a=new S.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:n,ranksep:i,nodesep:s});let d=new Set;for(let e of t)d.add(e.source),d.add(e.target);let l=e.filter(e=>d.has(e.id)),c=e.filter(e=>!d.has(e.id));for(let e of l){let t=A(e,o);a.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)a.hasNode(e.source)&&a.hasNode(e.target)&&a.setEdge(e.source,e.target,{},e.id);S.layout(a);let{targetPosition:h,sourcePosition:u}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),p=[];for(let e of l){let t=a.node(e.id),r=A(e,o);p.push({...e,targetPosition:h,sourcePosition:u,position:{x:t.x-r.width/2,y:t.y-r.height/2}})}if(c.length>0){let e=0,t=1/0;for(let r of p){let n=A(r,o);e=Math.max(e,r.position.y+n.height),t=Math.min(t,r.position.x)}t===1/0&&(t=0);for(let r=0;r<c.length;r++){let n=c[r],i=A(n,o);p.push({...n,targetPosition:h,sourcePosition:u,position:{x:t,y:e+30+r*(i.height+20)}})}}return{nodes:p,edges:[...t]}}var I=e.i(19886),z=e.i(21023);let G=(0,z.createServerReference)("40ab2b158297b58deefdef3b5b2edb693133aef266",z.callServer,void 0,z.findSourceMapURL,"addRepository"),B=(0,z.createServerReference)("4078d71e027636bff51d7c1abcd6587e2c672fea3d",z.callServer,void 0,z.findSourceMapURL,"deleteRepository");var $=e.i(39443),q=e.i(8361),W=e.i(99045);let V=0;function H(e,i){let s=(0,r.useRouter)(),[a,d]=(0,t.useState)(e),[l,c]=(0,t.useState)(i),h=(0,t.useRef)(i),u=(0,t.useCallback)(e=>{c(t=>{let r="function"==typeof e?e(t):e;return h.current=r,r})},[]),p=(0,q.useSoundAction)("delete"),f=(0,q.useSoundAction)("create"),g=e.map(e=>e.id).sort().join(","),m=i.map(e=>e.id).sort().join(","),v=(0,t.useRef)(new Map),y=e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(",");(0,t.useEffect)(()=>{d(t=>{let r=new Map(t.map(e=>[e.id,e])),n=new Set(e.map(e=>e.id)),o=t.filter(e=>"featureNode"===e.type&&"creating"===e.data.state&&!n.has(e.id));return e.map(e=>{let t=r.get(e.id);if(t)return{...e,position:t.position};if("featureNode"===e.type&&o.length>0){let t=o.shift();return{...e,position:t.position}}return e})})},[g,e]),(0,t.useEffect)(()=>{u(i)},[m,i,u]);let{events:b}=(0,$.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=v.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,o=t.get(r.id);void 0!==o&&o!==e.state&&(b.some(t=>t.featureId===e.featureId&&(0,W.mapEventTypeToState)(t.eventType)===e.state)||("done"===e.state?n.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?n.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>{s.push(`/feature/${e.featureId}`)}}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[y,e,b,s]);let w=(0,t.useRef)(0),x=(0,t.useRef)(void 0);(0,t.useEffect)(()=>()=>clearTimeout(x.current),[]),(0,t.useEffect)(()=>{if(b.length<=w.current)return;let e=b.slice(w.current);for(let t of(w.current=b.length,e)){let e=(0,W.mapEventTypeToState)(t.eventType),r=(0,W.mapPhaseNameToLifecycle)(t.phaseName);d(n=>n.map(n=>{if("featureNode"!==n.type)return n;let o=n.data;return o.featureId!==t.featureId?n:{...n,data:{...o,state:e,...void 0!==r&&{lifecycle:r}}}}))}clearTimeout(x.current),x.current=setTimeout(()=>s.refresh(),3e3)},[b,s]),(0,t.useEffect)(()=>{if(!a.some(e=>{if("featureNode"!==e.type)return!1;let t=e.data;return"running"===t.state||"action-required"===t.state||"creating"===t.state}))return;let e=setInterval(()=>s.refresh(),5e3);return()=>clearInterval(e)},[a,s]);let E=(0,t.useCallback)(e=>{d(t=>(0,o.applyNodeChanges)(e,t))},[]),k=(0,t.useCallback)(e=>{e.source&&e.target&&d(t=>{let r=t.find(t=>t.id===e.source);return r?.type!=="repositoryNode"||u(r=>r.some(r=>{let n=t.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===e.target})?r:[...r,{id:`edge-${e.source}-${e.target}`,source:e.source,target:e.target,style:{strokeDasharray:"5 5"}}]),t})},[u]),j=(0,t.useCallback)((e,t,r)=>{let n=`feature-${Date.now()}-${V++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return d(t=>{let r,i=e?new Set(h.current.filter(t=>t.source===e).map(e=>e.target)):new Set,s=t.filter(e=>i.has(e.id));if(s.length>0){let e=s.map(e=>e.position.y).sort((e,t)=>e-t),t=e[e.length-1],n=e.length>1?e[1]-e[0]:160;r={x:s[0].position.x,y:t+n}}else if(e){let n=t.find(t=>t.id===e);r=n?{x:n.position.x+488,y:n.position.y}:{x:400,y:200}}else{let e=t.length>0?Math.max(...t.map(e=>e.position.y)):0;r={x:400,y:t.length>0?e+160:200}}let a=r.y+140,d=new Set([e,...i]),l=t.filter(e=>d.has(e.id)).reduce((e,t)=>{let r="featureNode"===t.type?140:50;return Math.max(e,t.position.y+r)},0),c=Math.max(0,a-l),u=c>0?t.map(e=>d.has(e.id)||i.has(e.id)?e:e.position.y>=l?{...e,position:{...e.position,y:e.position.y+c}}:e):t;return[...e?u.map(t=>{if(t.id!==e)return t;let n=[...s.map(e=>e.position.y),r.y],o=(Math.min(...n)+Math.max(...n)+140)/2,i="featureNode"===t.type?140:50;return{...t,position:{...t.position,y:o-i/2}}}):u,{id:n,type:"featureNode",position:r,data:o}]}),e&&u(t=>[...t,{id:"dependencyEdge"===r?`dep-${e}-${n}`:`edge-${e}-${n}`,source:e,target:n,...r?{type:r}:{style:{strokeDasharray:"5 5"}}}]),n},[u]),_=(0,t.useCallback)(async e=>{try{let t=await (0,I.deleteFeature)(e);if(t.error)return void n.toast.error(t.error);d(t=>{let r=t.filter(t=>t.id!==e),n=l.filter(t=>t.source!==e&&t.target!==e),o=F(r,n,{direction:"LR",ranksep:200,nodesep:60});return u(o.edges),o.nodes}),p.play(),n.toast.success("Feature deleted successfully"),s.refresh()}catch{n.toast.error("Failed to delete feature")}},[s,l,p,u]),N=(0,t.useCallback)(async e=>{let t=`repo-${e}`;d(e=>e.filter(e=>e.id!==t)),u(e=>e.filter(e=>e.source!==t&&e.target!==t));try{let t=await B(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),s.refresh();return}p.play(),n.toast.success("Repository removed"),s.refresh()}catch{n.toast.error("Failed to remove repository"),s.refresh()}},[s,p,u]),C=(0,t.useCallback)(e=>{d(t=>{let r=F(t,l,{direction:e,ranksep:60,nodesep:20});return u(r.edges),r.nodes})},[l,u]);return{nodes:a,edges:l,onNodesChange:E,handleConnect:k,handleAddRepository:(0,t.useCallback)(e=>{let t=`repo-temp-${Date.now()}`,r=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e,o=0;d(n=>{let i=n.filter(e=>"repositoryNode"===e.type),s=n.find(e=>"addRepositoryNode"===e.type);s&&(o=s.position.y);let a={x:i[0]?.position.x??s?.position.x??50,y:s?s.position.y:0},d=s?s.position.y+50+15:a.y+50+15;return n.map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:d}}:e).concat({id:t,type:"repositoryNode",position:a,data:{name:r,repositoryPath:e,id:t}})}),G({path:e,name:r}).then(e=>{if(e.error){d(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error(e.error);return}let r=e.repository,i=`repo-${r.id}`;d(e=>e.map(e=>e.id===t?{...e,id:i,data:{...e.data,id:r.id,repositoryPath:r.path}}:e)),u(e=>e.map(e=>({...e,source:e.source===t?i:e.source,target:e.target===t?i:e.target,id:e.id.replace(t,i)}))),f.play(),s.refresh()}).catch(()=>{d(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error("Failed to add repository")})},[s,f,u]),handleLayout:C,handleDeleteFeature:_,handleDeleteRepository:N,createFeatureNode:j}}e.s(["useControlCenterState",()=>H],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),i=e.i(3214),s=e.i(35364);e.i(54793);var a=e.i(7729);e.i(47506);var d=e.i(89313),l=e.i(92002),c=e.i(3645);let h=(0,c.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var u=e.i(8986),p=e.i(38573),f=e.i(19933),g=e.i(67669),m=e.i(24042),v=e.i(64970),y=e.i(31777);e.i(81803);var b=e.i(72714),w=e.i(71326),x=e.i(2828);e.i(99348);var E=e.i(17466),k=e.i(8537),j=e.i(63629),_=e.i(76852);function N({data:e}){let[o,s]=(0,n.useState)(!1),a=(0,_.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),d=(0,k.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),c="Booting"===d.status||"Ready"===d.status;return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),s(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(g.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.AlertDialog,{open:o,onOpenChange:s,children:(0,t.jsxs)(w.AlertDialogContent,{size:"sm",children:[(0,t.jsxs)(w.AlertDialogHeader,{children:[(0,t.jsx)(w.AlertDialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.AlertDialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.AlertDialogFooter,{children:[(0,t.jsx)(w.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(w.AlertDialogAction,{variant:"destructive",onClick:()=>e.onDelete?.(e.id),children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-default items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(h,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,y.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in IDE",onClick:a.openInIde,loading:a.ideLoading,error:!!a.ideError,icon:u.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in Shell",onClick:a.openInShell,loading:a.shellLoading,error:!!a.shellError,icon:p.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open Folder",onClick:a.openFolder,loading:a.folderLoading,error:!!a.folderError,icon:f.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open Folder"})]})}),j.featureFlags.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:c?"Stop Dev Server":"Start Dev Server",onClick:c?d.stop:d.deploy,loading:d.deployLoading||d.stopLoading,error:!!d.deployError,icon:c?v.Square:m.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:c?"Stop Dev Server":"Start Dev Server"})]})}),c?(0,t.jsx)(E.DeploymentStatusBadge,{status:d.status,url:d.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:"text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",children:(0,t.jsx)(i.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:l.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}e.i(1650),e.i(45811),e.i(25235),e.i(1354);var C=e.i(1963);function O(e){let[n]=(0,l.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}function R({nodes:e,edges:o,selectedFeatureId:l,onNodesChange:c,onAddFeature:h,onNodeAction:u,onNodeSettings:p,onConnect:f,onNodeClick:g,onPaneClick:m,onRepositoryAdd:v,onRepositoryClick:y,onRepositoryDelete:b,onFeatureDelete:w,onRepositorySelect:x,onCanvasDrag:E,toolbar:k,emptyState:j}){let _=(0,n.useMemo)(()=>({featureNode:d.FeatureNode,repositoryNode:N,addRepositoryNode:C.AddRepositoryNode}),[]),R=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),P=(0,n.useCallback)(t=>{let r=e.find(e=>e.id===t.source);return r?.type!=="repositoryNode"||!o.some(r=>{let n=e.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===t.target})},[e,o]),M=(0,n.useMemo)(()=>e.map(e=>({...e,..."featureNode"===e.type&&{selected:null!=l&&e.data.featureId===l},data:{...e.data,showHandles:o.length>0,..."featureNode"===e.type&&"creating"!==e.data.state?{onAction:u?()=>u(e.id):void 0,onSettings:p?()=>p(e.id):void 0,onDelete:w}:{},..."repositoryNode"===e.type&&{onAdd:v?()=>v(e.id):void 0,onClick:y?()=>y(e.id):void 0,onDelete:b},..."addRepositoryNode"===e.type&&{onSelect:x?e=>x(e):void 0}}})),[e,o.length,l,u,p,w,v,y,b,x]);return 0===e.length?j?(0,t.jsx)("div",{"data-testid":"features-canvas-empty",className:"h-full w-full",children:j}):(0,t.jsx)("div",{"data-testid":"features-canvas-empty",children:(0,t.jsx)(a.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(s.Button,{onClick:h,children:[(0,t.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})})}):(0,t.jsx)("div",{"data-testid":"features-canvas","data-no-drawer-close":!0,className:"pointer-events-auto h-full w-full",children:(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsxs)(r.ReactFlow,{nodes:M,edges:o,nodeTypes:_,edgeTypes:R,isValidConnection:P,onConnect:f,onNodesChange:c,onNodeClick:g,onPaneClick:m,onMoveStart:E,defaultViewport:{x:30,y:30,zoom:.85},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[(0,t.jsx)(r.Background,{}),(0,t.jsx)(r.Controls,{}),k]})})})}let P=(0,c.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var M=e.i(60253);let T="shep:notification-banner-dismissed";function L(){let[e,r]=(0,n.useState)(!1);(0,n.useEffect)(()=>{void 0===globalThis.Notification||"default"!==globalThis.Notification.permission||"true"!==localStorage.getItem(T)&&r(!0)},[]);let o=(0,n.useCallback)(async()=>{if(void 0===globalThis.Notification)return;let e=await globalThis.Notification.requestPermission();("granted"===e||"denied"===e)&&r(!1)},[]),i=(0,n.useCallback)(()=>{localStorage.setItem(T,"true"),r(!1)},[]);return e?(0,t.jsxs)("div",{className:"bg-background absolute bottom-4 left-4 z-50 flex max-w-sm items-center gap-3 rounded-lg border p-3 shadow-lg",children:[(0,t.jsx)(P,{className:"text-muted-foreground size-5 shrink-0"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Enable desktop notifications to stay updated on feature progress."}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(s.Button,{size:"sm",onClick:o,children:"Enable"}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon-xs",onClick:i,"aria-label":"Dismiss notification banner",children:(0,t.jsx)(M.X,{})})]})]}):null}var S=e.i(5147),D=e.i(8361),A=e.i(30153);let F=(0,c.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var I=e.i(33548),z=e.i(23925),G=e.i(83428),B=e.i(78986);let $=["cd ~/my-repo",'shep feat new "create modern, sleek dashboards"'];function q({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[a,d]=(0,n.useState)(!1);async function l(){if(!a){d(!0);try{let t=await (0,B.pickFolder)();t&&e?.(t)}finally{d(!1)}}}let c=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText($.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]);return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,y.cn)("relative h-full w-full",r),children:[(0,t.jsx)("div",{className:"absolute inset-0 [background-image:radial-gradient(circle,_var(--color-border)_1px,_transparent_1px)] [background-size:24px_24px]"}),(0,t.jsxs)("div",{className:"absolute top-8 left-8 z-10",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-3xl font-light",children:"Control Center"})]}),(0,t.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-6",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(h,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:l,disabled:a,className:"border-muted-foreground/30 hover:border-primary hover:text-primary flex cursor-pointer items-center gap-3 rounded-lg border-2 border-dashed px-8 py-4 transition-colors disabled:cursor-wait disabled:opacity-60",children:[a?(0,t.jsx)(G.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(i.Plus,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a?"Opening...":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-border h-px w-16"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(F,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Or start from the command line"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-16"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-lg bg-zinc-900 px-5 py-4 font-mono text-sm text-zinc-100",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:c,className:"absolute top-3 right-3 cursor-pointer rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200","aria-label":"Copy commands",children:o?(0,t.jsx)(z.Check,{className:"h-4 w-4"}):(0,t.jsx)(I.Copy,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"space-y-1",children:$.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Feature will appear on canvas once created"})]})})]})}var W=e.i(17840);function V({initialNodes:e,initialEdges:r}){let i,s=(0,o.useRouter)(),a=(0,o.usePathname)(),d=(i=(0,o.usePathname)().match(/^\/feature\/(.+)$/),i?.[1]??null),l=(0,D.useSoundAction)("click"),{guardedNavigate:c}=(0,A.useDrawerCloseGuard)(),{nodes:h,edges:u,onNodesChange:p,handleConnect:f,handleAddRepository:g,handleDeleteFeature:m,handleDeleteRepository:v,createFeatureNode:y}=(0,W.useControlCenterState)(e,r),{setFeatures:b}=(0,S.useSidebarFeaturesContext)(),w=(0,n.useMemo)(()=>h.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.runtime??""}:${t.startedAt??""}`}).sort().join(","),[h]);(0,n.useEffect)(()=>{b(h.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data,r=(0,S.mapNodeStateToSidebarStatus)(t.state);return r?{featureId:t.featureId,name:t.name,status:r,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime}}:null}).filter(Boolean))},[w,h,b]);let x=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let e=t.data;"creating"!==e.state&&c(()=>{l.play(),s.push(`/feature/${e.featureId}`)})}},[s,l,c]),E=(0,n.useCallback)(()=>{l.play(),s.push("/create")},[s,l]),k=(0,n.useCallback)(e=>{l.play();let t=h.find(t=>t.id===e),r=t?.data?.repositoryPath;r?s.push(`/create?repo=${encodeURIComponent(r)}`):s.push("/create")},[h,s,l]),j=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=u.find(t=>t.target===e),n=r?h.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;l.play();let i=new URLSearchParams;o&&i.set("repo",o),i.set("parent",t),s.push(`/create?${i.toString()}`)},[h,u,s,l]),_=(0,n.useCallback)(e=>{let t=h.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&c(()=>s.push(`/repository/${e.id}`))}},[h,s,c]),N=(0,n.useCallback)(()=>{"/"!==a&&c(()=>s.push("/"))},[s,a,c]);return((0,n.useEffect)(()=>{let e=e=>{g(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[g]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail,r=h.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);y(r?.id??null,{state:"creating",name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[h,y]),h.some(e=>"repositoryNode"===e.type))?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(R,{nodes:h,edges:u,selectedFeatureId:d,onNodesChange:p,onConnect:f,onAddFeature:E,onNodeAction:j,onNodeClick:x,onPaneClick:N,onRepositoryAdd:k,onRepositoryClick:_,onRepositoryDelete:v,onFeatureDelete:m,onRepositorySelect:g,emptyState:(0,t.jsx)(q,{onRepositorySelect:g})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(q,{onRepositorySelect:g})]})}function H({initialNodes:e,initialEdges:n,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(V,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>H],48246)}]);