@shepai/cli 1.163.0 → 1.164.0-pr514.db33061

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 (311) hide show
  1. package/README.md +12 -0
  2. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.d.ts +3 -1
  3. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.d.ts.map +1 -1
  4. package/dist/packages/core/src/application/ports/output/repositories/interactive-session-repository.interface.d.ts +19 -0
  5. package/dist/packages/core/src/application/ports/output/repositories/interactive-session-repository.interface.d.ts.map +1 -1
  6. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.d.ts +7 -1
  7. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.d.ts.map +1 -1
  8. package/dist/packages/core/src/application/use-cases/interactive/send-interactive-message.use-case.d.ts +2 -0
  9. package/dist/packages/core/src/application/use-cases/interactive/send-interactive-message.use-case.d.ts.map +1 -1
  10. package/dist/packages/core/src/application/use-cases/interactive/send-interactive-message.use-case.js +1 -1
  11. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/051-add-session-usage-tracking.d.ts +18 -0
  12. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/051-add-session-usage-tracking.d.ts.map +1 -0
  13. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/051-add-session-usage-tracking.js +32 -0
  14. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-session.repository.d.ts +12 -0
  15. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-session.repository.d.ts.map +1 -1
  16. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-session.repository.js +31 -0
  17. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts +38 -7
  18. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts.map +1 -1
  19. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.js +152 -45
  20. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts +17 -1
  21. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts.map +1 -1
  22. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.js +131 -47
  23. package/dist/src/presentation/web/app/actions/get-git-log.d.ts +44 -0
  24. package/dist/src/presentation/web/app/actions/get-git-log.d.ts.map +1 -0
  25. package/dist/src/presentation/web/app/actions/get-git-log.js +125 -0
  26. package/dist/src/presentation/web/app/actions/open-folder.d.ts.map +1 -1
  27. package/dist/src/presentation/web/app/actions/open-folder.js +5 -2
  28. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.d.ts.map +1 -1
  29. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.js +3 -1
  30. package/dist/src/presentation/web/components/assistant-ui/thread.js +8 -1
  31. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.js +1 -1
  32. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  33. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +46 -15
  34. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts.map +1 -1
  35. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +77 -5
  36. package/dist/src/presentation/web/components/common/control-center-drawer/use-drawer-sync.d.ts.map +1 -1
  37. package/dist/src/presentation/web/components/common/control-center-drawer/use-drawer-sync.js +11 -0
  38. package/dist/src/presentation/web/components/common/deployment-status-badge/deployment-status-badge.d.ts.map +1 -1
  39. package/dist/src/presentation/web/components/common/deployment-status-badge/deployment-status-badge.js +10 -9
  40. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +5 -1
  41. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  42. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +24 -13
  43. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  44. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +56 -81
  45. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.d.ts.map +1 -1
  46. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.js +11 -6
  47. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  48. package/dist/src/presentation/web/components/features/chat/ChatTab.d.ts.map +1 -1
  49. package/dist/src/presentation/web/components/features/chat/ChatTab.js +13 -7
  50. package/dist/src/presentation/web/components/features/chat/useChatRuntime.d.ts +16 -0
  51. package/dist/src/presentation/web/components/features/chat/useChatRuntime.d.ts.map +1 -1
  52. package/dist/src/presentation/web/components/features/chat/useChatRuntime.js +98 -7
  53. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.d.ts.map +1 -1
  54. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.js +1 -1
  55. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
  56. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +7 -2
  57. package/dist/src/presentation/web/hooks/use-animations-enabled.d.ts +6 -0
  58. package/dist/src/presentation/web/hooks/use-animations-enabled.d.ts.map +1 -0
  59. package/dist/src/presentation/web/hooks/use-animations-enabled.js +30 -0
  60. package/dist/tsconfig.build.tsbuildinfo +1 -1
  61. package/package.json +2 -2
  62. package/web/.next/BUILD_ID +1 -1
  63. package/web/.next/build-manifest.json +2 -2
  64. package/web/.next/fallback-build-manifest.json +2 -2
  65. package/web/.next/prerender-manifest.json +3 -3
  66. package/web/.next/required-server-files.js +3 -3
  67. package/web/.next/required-server-files.json +3 -3
  68. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  69. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  70. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  71. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  72. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  73. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  75. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  76. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  78. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  79. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  81. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  82. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  83. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +69 -54
  84. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
  85. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  86. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +69 -54
  88. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  89. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  90. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  91. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  92. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  93. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  94. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  95. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  96. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  97. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  98. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  99. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  100. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  101. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  102. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  103. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  104. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  105. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  106. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +69 -54
  107. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
  108. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  109. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  110. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +69 -54
  111. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  112. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  113. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  114. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  115. package/web/.next/server/app/_global-error.html +2 -2
  116. package/web/.next/server/app/_global-error.rsc +1 -1
  117. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  118. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  119. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  120. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  121. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  122. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  123. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  124. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  125. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  126. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  127. package/web/.next/server/app/api/graph-data/route.js +1 -1
  128. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  129. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  130. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  131. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  132. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  133. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  134. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  135. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  136. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  137. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  138. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  139. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  140. package/web/.next/server/app/version/page.js.nft.json +1 -1
  141. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  142. package/web/.next/server/chunks/[root-of-the-server]__2b71641f._.js +1 -1
  143. package/web/.next/server/chunks/[root-of-the-server]__2b71641f._.js.map +1 -1
  144. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  145. package/web/.next/server/chunks/{[root-of-the-server]__beda892a._.js → [root-of-the-server]__c78383b1._.js} +2 -2
  146. package/web/.next/server/chunks/{[root-of-the-server]__beda892a._.js.map → [root-of-the-server]__c78383b1._.js.map} +1 -1
  147. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_ceb2fa1e._.js +1 -1
  148. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  149. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +3 -3
  151. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/{7f428_lucide-react_dist_esm_icons_4b319ae6._.js → 7f428_lucide-react_dist_esm_icons_281e0ef8._.js} +2 -2
  153. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_281e0ef8._.js.map +1 -0
  154. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_a593f310._.js +3 -0
  155. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_a593f310._.js.map +1 -0
  156. package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js +2 -2
  157. package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js.map +1 -1
  158. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  159. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  160. package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js +1 -1
  161. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  162. package/web/.next/server/chunks/ssr/[root-of-the-server]__563e4faf._.js +1 -1
  163. package/web/.next/server/chunks/ssr/[root-of-the-server]__563e4faf._.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/[root-of-the-server]__7528eb6f._.js +1 -1
  165. package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js +2 -2
  166. package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/[root-of-the-server]__821a11c1._.js +1 -1
  168. package/web/.next/server/chunks/ssr/[root-of-the-server]__821a11c1._.js.map +1 -1
  169. package/web/.next/server/chunks/ssr/[root-of-the-server]__86ff0bc5._.js +7 -0
  170. package/web/.next/server/chunks/ssr/[root-of-the-server]__86ff0bc5._.js.map +1 -0
  171. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
  172. package/web/.next/server/chunks/ssr/[root-of-the-server]__98740ee4._.js +1 -1
  173. package/web/.next/server/chunks/ssr/[root-of-the-server]__98740ee4._.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  175. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  176. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba9f9e11._.js +1 -1
  177. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba9f9e11._.js.map +1 -1
  178. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js +1 -1
  179. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/[root-of-the-server]__e0be67c7._.js +3 -0
  181. package/web/.next/server/chunks/ssr/[root-of-the-server]__e0be67c7._.js.map +1 -0
  182. package/web/.next/server/chunks/ssr/{_8b57edb8._.js → _0020fddd._.js} +2 -2
  183. package/web/.next/server/chunks/ssr/_0020fddd._.js.map +1 -0
  184. package/web/.next/server/chunks/ssr/_02e01240._.js +4 -0
  185. package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -0
  186. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  187. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  188. package/web/.next/server/chunks/ssr/_0727935d._.js +1 -1
  189. package/web/.next/server/chunks/ssr/_0727935d._.js.map +1 -1
  190. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  191. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  192. package/web/.next/server/chunks/ssr/_18886033._.js +4 -0
  193. package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -0
  194. package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
  195. package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
  196. package/web/.next/server/chunks/ssr/_4d49a312._.js +3 -0
  197. package/web/.next/server/chunks/ssr/_4d49a312._.js.map +1 -0
  198. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  199. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  200. package/web/.next/server/chunks/ssr/_7a6f6a76._.js +3 -0
  201. package/web/.next/server/chunks/ssr/_7a6f6a76._.js.map +1 -0
  202. package/web/.next/server/chunks/ssr/{_def82237._.js → _8276397a._.js} +2 -2
  203. package/web/.next/server/chunks/ssr/{_def82237._.js.map → _8276397a._.js.map} +1 -1
  204. package/web/.next/server/chunks/ssr/_9215e9ec._.js +3 -0
  205. package/web/.next/server/chunks/ssr/_9215e9ec._.js.map +1 -0
  206. package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
  207. package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
  208. package/web/.next/server/chunks/ssr/_ad09f271._.js +4 -0
  209. package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -0
  210. package/web/.next/server/chunks/ssr/_b7a43c05._.js +3 -0
  211. package/web/.next/server/chunks/ssr/_b7a43c05._.js.map +1 -0
  212. package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
  213. package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/_c45aee16._.js +3 -0
  215. package/web/.next/server/chunks/ssr/_c45aee16._.js.map +1 -0
  216. package/web/.next/server/chunks/ssr/{_ce97386b._.js → _cc654b75._.js} +3 -3
  217. package/web/.next/server/chunks/ssr/_cc654b75._.js.map +1 -0
  218. package/web/.next/server/chunks/ssr/_ea9e1556._.js +4 -0
  219. package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -0
  220. package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
  221. package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
  223. package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
  225. package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
  226. package/web/.next/server/chunks/ssr/{_b881a389._.js → _fdc356bf._.js} +2 -2
  227. package/web/.next/server/chunks/ssr/_fdc356bf._.js.map +1 -0
  228. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  229. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  230. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +3 -0
  231. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -0
  232. package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js +3 -0
  233. package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js.map +1 -0
  234. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  235. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -1
  236. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  237. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  238. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  239. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  240. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js +1 -1
  241. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js.map +1 -1
  242. package/web/.next/server/pages/500.html +2 -2
  243. package/web/.next/server/server-reference-manifest.js +1 -1
  244. package/web/.next/server/server-reference-manifest.json +190 -154
  245. package/web/.next/static/chunks/16eea21868510afd.js +5 -0
  246. package/web/.next/static/chunks/1ad664f7081cf4c0.js +1 -0
  247. package/web/.next/static/chunks/{0613d3829ce90fe9.js → 4788a37d8c608e30.js} +1 -1
  248. package/web/.next/static/chunks/4f7d9c08a205bc4e.js +1 -0
  249. package/web/.next/static/chunks/5d8c83c576ec1a7b.js +1 -0
  250. package/web/.next/static/chunks/779b5c49587b074e.js +1 -0
  251. package/web/.next/static/chunks/7cec51e9bd7d1f4f.js +1 -0
  252. package/web/.next/static/chunks/{780f688b8568331d.js → 7d40e79e524c8d18.js} +2 -2
  253. package/web/.next/static/chunks/{5f40b5c4f859b573.js → 8094762f5cda4934.js} +1 -1
  254. package/web/.next/static/chunks/9162bb869b3543e2.js +7 -0
  255. package/web/.next/static/chunks/940bca62e44f3e90.js +5 -0
  256. package/web/.next/static/chunks/966eb2688300b7f5.js +1 -0
  257. package/web/.next/static/chunks/971e52f3f386ccfd.js +1 -0
  258. package/web/.next/static/chunks/a760d5829014058d.js +1 -0
  259. package/web/.next/static/chunks/b63e6727c84f30e2.js +1 -0
  260. package/web/.next/static/chunks/d6a1a06ee3c12489.js +1 -0
  261. package/web/.next/static/chunks/dedf6ca63c5468fa.js +5 -0
  262. package/web/.next/static/chunks/e77d053610055e0c.js +1 -0
  263. package/web/.next/static/chunks/{0d9e3aa7e10cf6e6.js → ee9fe376b60c3cab.js} +2 -2
  264. package/web/.next/static/chunks/eeadf13c0ea6cbe0.css +1 -0
  265. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_4b319ae6._.js.map +0 -1
  266. package/web/.next/server/chunks/ssr/[root-of-the-server]__e5ceba65._.js +0 -3
  267. package/web/.next/server/chunks/ssr/[root-of-the-server]__e5ceba65._.js.map +0 -1
  268. package/web/.next/server/chunks/ssr/[root-of-the-server]__e91ffd5e._.js +0 -7
  269. package/web/.next/server/chunks/ssr/[root-of-the-server]__e91ffd5e._.js.map +0 -1
  270. package/web/.next/server/chunks/ssr/_075fae20._.js +0 -4
  271. package/web/.next/server/chunks/ssr/_075fae20._.js.map +0 -1
  272. package/web/.next/server/chunks/ssr/_125c55af._.js +0 -4
  273. package/web/.next/server/chunks/ssr/_125c55af._.js.map +0 -1
  274. package/web/.next/server/chunks/ssr/_391e499a._.js +0 -3
  275. package/web/.next/server/chunks/ssr/_391e499a._.js.map +0 -1
  276. package/web/.next/server/chunks/ssr/_573caadf._.js +0 -3
  277. package/web/.next/server/chunks/ssr/_573caadf._.js.map +0 -1
  278. package/web/.next/server/chunks/ssr/_628621c7._.js +0 -4
  279. package/web/.next/server/chunks/ssr/_628621c7._.js.map +0 -1
  280. package/web/.next/server/chunks/ssr/_68996e5b._.js +0 -3
  281. package/web/.next/server/chunks/ssr/_68996e5b._.js.map +0 -1
  282. package/web/.next/server/chunks/ssr/_8b57edb8._.js.map +0 -1
  283. package/web/.next/server/chunks/ssr/_9412b27f._.js +0 -4
  284. package/web/.next/server/chunks/ssr/_9412b27f._.js.map +0 -1
  285. package/web/.next/server/chunks/ssr/_ac4a3873._.js +0 -3
  286. package/web/.next/server/chunks/ssr/_ac4a3873._.js.map +0 -1
  287. package/web/.next/server/chunks/ssr/_b881a389._.js.map +0 -1
  288. package/web/.next/server/chunks/ssr/_ce97386b._.js.map +0 -1
  289. package/web/.next/server/chunks/ssr/_cfbd1d7e._.js +0 -3
  290. package/web/.next/server/chunks/ssr/_cfbd1d7e._.js.map +0 -1
  291. package/web/.next/server/chunks/ssr/node_modules__pnpm_8ec2c790._.js +0 -3
  292. package/web/.next/server/chunks/ssr/node_modules__pnpm_8ec2c790._.js.map +0 -1
  293. package/web/.next/static/chunks/0a79dfbb8486b66e.js +0 -5
  294. package/web/.next/static/chunks/14d9d9181bb4e337.js +0 -1
  295. package/web/.next/static/chunks/4581eaf51543601d.js +0 -1
  296. package/web/.next/static/chunks/47477ed4c5871747.js +0 -1
  297. package/web/.next/static/chunks/74db65fa7bfb80bd.js +0 -1
  298. package/web/.next/static/chunks/8b64414cdb4a4dc7.js +0 -1
  299. package/web/.next/static/chunks/bf55fb50a69f7350.js +0 -5
  300. package/web/.next/static/chunks/c04ada25ace6f30c.js +0 -1
  301. package/web/.next/static/chunks/c3a67566f78b5bc3.js +0 -1
  302. package/web/.next/static/chunks/ca8752df0e809c1b.js +0 -7
  303. package/web/.next/static/chunks/d2cbeefbc8967b16.js +0 -1
  304. package/web/.next/static/chunks/d39ae882d080aa52.js +0 -1
  305. package/web/.next/static/chunks/d6e702c209c413ce.js +0 -5
  306. package/web/.next/static/chunks/dbfbd9d9ee5eb2d0.js +0 -1
  307. package/web/.next/static/chunks/dc39dd4276779dec.js +0 -1
  308. package/web/.next/static/chunks/e779296e738a812b.css +0 -1
  309. /package/web/.next/static/{qfCnoWSr4qmt2_dT28B-O → lQkUWQQS5aR4vq6WUZ2yr}/_buildManifest.js +0 -0
  310. /package/web/.next/static/{qfCnoWSr4qmt2_dT28B-O → lQkUWQQS5aR4vq6WUZ2yr}/_clientMiddlewareManifest.json +0 -0
  311. /package/web/.next/static/{qfCnoWSr4qmt2_dT28B-O → lQkUWQQS5aR4vq6WUZ2yr}/_ssgManifest.js +0 -0
@@ -1,7 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},34119,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],34119);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},57779,80554,e=>{"use strict";var t=e.i(20314);function r({status:e,className:r=""}){return"idle"===e?null:(0,t.jsx)("span",{className:`absolute -top-0.5 -right-0.5 block rounded-full ${"processing"===e?"h-2.5 w-2.5 animate-pulse bg-blue-500":"h-2 w-2 bg-green-500"} ${r}`})}e.s(["ChatDotIndicator",()=>r],57779);var a=e.i(79054),n=e.i(62885);let o=(0,a.createContext)({getStatus:()=>"idle"});function l({children:e}){let r=function(){let{data:e}=(0,n.useQuery)({queryKey:["turn-statuses"],queryFn:async()=>{let e=await fetch("/api/interactive/chat/turn-statuses");return e.ok?e.json():{}},refetchInterval:5e3});return e??{}}(),l=(0,a.useMemo)(()=>({getStatus:e=>r[e]??"idle"}),[r]);return(0,t.jsx)(o.Provider,{value:l,children:e})}function i(e){return(0,a.useContext)(o).getStatus(e)}e.s(["TurnStatusesProvider",()=>l,"useTurnStatus",()=>i],80554)},79687,e=>{"use strict";var t=e.i(14748);e.s(["AlertCircle",()=>t.default])},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let a=(0,e.i(18354).createLogger)("[SSE]");function n(e,t,r,a){if("u"<typeof EventSource)return()=>{};let n=null,o=!1,l=1e3,i=null,s=null;return!function d(){o||(n=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),a("connecting"),n.onopen=()=>{a("connected"),s=setTimeout(()=>{s=null,l=1e3},5e3)},n.onerror=()=>{n?.close(),n=null,a("disconnected"),null!==s&&(clearTimeout(s),s=null);let e=l;l=Math.min(2*e,3e4),i=setTimeout(()=>{i=null,d()},e)},n.addEventListener("notification",e=>{let a=JSON.parse(e.data);t(e=>{let t=[...e,a];return t.length>500?t.slice(-250):t}),r(a)}))}(),()=>{o=!0,null!==i&&(clearTimeout(i),i=null),null!==s&&(clearTimeout(s),s=null),n&&(n.close(),n=null)}}let o=(0,r.createContext)(null);function l({children:e,runId:l}){let{events:i,lastEvent:s,connectionStatus:d}=function(e){let[t,o]=(0,r.useState)([]),[l,i]=(0,r.useState)(null),[s,d]=(0,r.useState)("disconnected"),c=e?.runId,u=(0,r.useRef)(null),f=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;a.debug("event received:",e.eventType,e),o(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),i(e)}else"status"===t.type&&d(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return n(c,o,i,d);let t=!1,r={current:void 0};function a(e){t||(u.current=e,e.postMessage({type:"subscribe",runId:c}),d("connecting"))}function l(){if(t)return;let e=navigator.serviceWorker.controller;e&&(u.current=e,e.postMessage({type:"subscribe",runId:c}),d("connecting"))}return navigator.serviceWorker.addEventListener("message",f),navigator.serviceWorker.addEventListener("controllerchange",l),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let l=e.active??e.installing??e.waiting;if(!l){r.current=n(c,o,i,d);return}if("activated"===l.state)a(l);else{let e=()=>{"activated"===l.state&&(l.removeEventListener("statechange",e),a(l))};l.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=n(c,o,i,d))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",f),navigator.serviceWorker.removeEventListener("controllerchange",l),u.current?.postMessage({type:"unsubscribe"}),u.current=null,r.current?.()}},[c,f]),{events:t,lastEvent:l,connectionStatus:s}}({runId:l}),c=(0,r.useMemo)(()=>({events:i,lastEvent:s,connectionStatus:d}),[i,s,d]);return(0,t.jsx)(o.Provider,{value:c,children:e})}function i(){let e=(0,r.useContext)(o);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>l,"useAgentEventsContext",()=>i],39443)},55016,e=>{"use strict";let t=(0,e.i(3645).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",()=>t],55016)},71326,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(22528),n=e.i(5978),o=e.i(567),l=e.i(91967),i=e.i(86874),s="AlertDialog",[d,c]=(0,a.createContextScope)(s,[o.createDialogScope]),u=(0,o.createDialogScope)(),f=e=>{let{__scopeAlertDialog:r,...a}=e,n=u(r);return(0,t.jsx)(o.Root,{...n,...a,modal:!0})};f.displayName=s;var p=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,l=u(a);return(0,t.jsx)(o.Trigger,{...l,...n,ref:r})});p.displayName="AlertDialogTrigger";var m=e=>{let{__scopeAlertDialog:r,...a}=e,n=u(r);return(0,t.jsx)(o.Portal,{...n,...a})};m.displayName="AlertDialogPortal";var g=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,l=u(a);return(0,t.jsx)(o.Overlay,{...l,...n,ref:r})});g.displayName="AlertDialogOverlay";var h="AlertDialogContent",[v,b]=d(h),x=(0,i.createSlottable)("AlertDialogContent"),y=r.forwardRef((e,a)=>{let{__scopeAlertDialog:i,children:s,...d}=e,c=u(i),f=r.useRef(null),p=(0,n.useComposedRefs)(a,f),m=r.useRef(null);return(0,t.jsx)(o.WarningProvider,{contentName:h,titleName:w,docsSlug:"alert-dialog",children:(0,t.jsx)(v,{scope:i,cancelRef:m,children:(0,t.jsxs)(o.Content,{role:"alertdialog",...c,...d,ref:p,onOpenAutoFocus:(0,l.composeEventHandlers)(d.onOpenAutoFocus,e=>{e.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(x,{children:s}),(0,t.jsx)(N,{contentRef:f})]})})})});y.displayName=h;var w="AlertDialogTitle",S=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,l=u(a);return(0,t.jsx)(o.Title,{...l,...n,ref:r})});S.displayName=w;var j="AlertDialogDescription",C=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,l=u(a);return(0,t.jsx)(o.Description,{...l,...n,ref:r})});C.displayName=j;var P=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,l=u(a);return(0,t.jsx)(o.Close,{...l,...n,ref:r})});P.displayName="AlertDialogAction";var k="AlertDialogCancel",D=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...l}=e,{cancelRef:i}=b(k,a),s=u(a),d=(0,n.useComposedRefs)(r,i);return(0,t.jsx)(o.Close,{...s,...l,ref:d})});D.displayName=k;var N=({contentRef:e})=>{let t=`\`${h}\` requires a description for the component to be accessible for screen reader users.
2
-
3
- You can add a description to the \`${h}\` by passing a \`${j}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
-
5
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${h}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
6
-
7
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return r.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null};e.s(["Action",()=>P,"AlertDialog",()=>f,"AlertDialogAction",()=>P,"AlertDialogCancel",()=>D,"AlertDialogContent",()=>y,"AlertDialogDescription",()=>C,"AlertDialogOverlay",()=>g,"AlertDialogPortal",()=>m,"AlertDialogTitle",()=>S,"AlertDialogTrigger",()=>p,"Cancel",()=>D,"Content",()=>y,"Description",()=>C,"Overlay",()=>g,"Portal",()=>m,"Root",()=>f,"Title",()=>S,"Trigger",()=>p,"createAlertDialogScope",()=>c],28883);var E=e.i(28883),E=E,R=e.i(31777),T=e.i(35364);function A({...e}){return(0,t.jsx)(E.Root,{"data-slot":"alert-dialog",...e})}function I({...e}){return(0,t.jsx)(E.Portal,{"data-slot":"alert-dialog-portal",...e})}function L({className:e,onClick:r,...a}){return(0,t.jsx)(E.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,R.cn)("fixed inset-0 z-50 bg-black/50",e),onClick:e=>{e.stopPropagation(),r?.(e)},...a})}function _({className:e,size:r="default",...a}){return(0,t.jsxs)(I,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(E.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,R.cn)("bg-background group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...a})]})}function M({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,R.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...r})}function O({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,R.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...r})}function F({className:e,...r}){return(0,t.jsx)(E.Title,{"data-slot":"alert-dialog-title",className:(0,R.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...r})}function z({className:e,...r}){return(0,t.jsx)(E.Description,{"data-slot":"alert-dialog-description",className:(0,R.cn)("text-muted-foreground text-sm",e),...r})}function H({className:e,variant:r="default",size:a="default",...n}){return(0,t.jsx)(T.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(E.Action,{"data-slot":"alert-dialog-action",className:(0,R.cn)(e),...n})})}function B({className:e,variant:r="outline",size:a="default",...n}){return(0,t.jsx)(T.Button,{variant:r,size:a,asChild:!0,children:(0,t.jsx)(E.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,R.cn)(e),...n})})}e.s(["AlertDialog",()=>A,"AlertDialogAction",()=>H,"AlertDialogCancel",()=>B,"AlertDialogContent",()=>_,"AlertDialogDescription",()=>z,"AlertDialogFooter",()=>O,"AlertDialogHeader",()=>M,"AlertDialogTitle",()=>F],71326)},30153,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(71326);let n=(0,r.createContext)(null);function o({children:e}){let o=(0,r.useRef)(null),l=(0,r.useRef)(null),[i,s]=(0,r.useState)(!1),d=(0,r.useCallback)(e=>{o.current=e},[]),c=(0,r.useCallback)(e=>{if(o.current?.isDirty){l.current=e,s(!0);return}e()},[]),u=(0,r.useCallback)(()=>{s(!1),o.current?.onReset(),o.current=null,l.current?.(),l.current=null},[]),f=(0,r.useCallback)(()=>{s(!1),l.current=null},[]),p=(0,r.useCallback)(()=>o.current?.isDirty??!1,[]);return(0,t.jsxs)(n,{value:{setGuard:d,guardedNavigate:c,getIsDirty:p},children:[e,(0,t.jsx)(a.AlertDialog,{open:i,children:(0,t.jsxs)(a.AlertDialogContent,{children:[(0,t.jsxs)(a.AlertDialogHeader,{children:[(0,t.jsx)(a.AlertDialogTitle,{children:"Discard unsaved changes?"}),(0,t.jsx)(a.AlertDialogDescription,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),(0,t.jsxs)(a.AlertDialogFooter,{children:[(0,t.jsx)(a.AlertDialogAction,{variant:"destructive",onClick:u,children:"Discard"}),(0,t.jsx)(a.AlertDialogCancel,{onClick:f,children:"Keep editing"})]})]})})]})}function l(){let e=(0,r.useContext)(n);if(!e)throw Error("useDrawerCloseGuard must be used within DrawerCloseGuardProvider");return e}function i({open:e,isDirty:t,onClose:a,onReset:n}){let{setGuard:o,guardedNavigate:i}=l();return(0,r.useEffect)(()=>(e?o({isDirty:t,onReset:n}):o(null),()=>o(null)),[e,t,n,o]),{attemptClose:(0,r.useCallback)(()=>{i(()=>{n(),a()})},[i,a,n])}}e.s(["DrawerCloseGuardProvider",()=>o,"useDrawerCloseGuard",()=>l,"useGuardedDrawerClose",()=>i])},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},54277,30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t],30090),e.s(["CircleX",()=>t],54277)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},48109,e=>{"use strict";let t=(0,e.i(3645).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",()=>t],48109)},32494,e=>{"use strict";let t=(0,e.i(3645).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",()=>t],32494)},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({className:e,type:a,...n}){return(0,t.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}e.s(["Input",()=>a])},66459,e=>{"use strict";let t=(0,e.i(3645).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>t],66459)},12103,e=>{"use strict";let t=(0,e.i(3645).default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);e.s(["Puzzle",()=>t],12103)},83241,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let a=e.r(9328);function n({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},90891,(e,t,r)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return a}})},31218,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return s}});let a=e.r(20314),n=e.r(26036),o=e.r(58988),l=e.r(90891),i=e.r(22193);function s({moduleIds:e}){if("u">typeof window)return null;let t=o.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;r.push(...e)}}if(0===r.length)return null;let s=(0,i.getDeploymentIdQueryOrEmptyString)();return(0,a.jsx)(a.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,n.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},84929,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return d}});let a=e.r(20314),n=e.r(79054),o=e.r(83241),l=e.r(31218);function i(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},d=function(e){let t={...s,...e},r=(0,n.lazy)(()=>t.loader().then(i)),d=t.loading;function c(e){let i=d?(0,a.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,c=s?n.Suspense:n.Fragment,u=t.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(r,{...e})]}):(0,a.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(r,{...e})});return(0,a.jsx)(c,{...s?{fallback:i}:{},children:u})}return c.displayName="LoadableComponent",c}},47901,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let a=e.r(81258)._(e.r(84929));function n(e,t){let r={};"function"==typeof e&&(r.loader=e);let n={...r,...t};return(0,a.default)({...n,modules:n.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},13322,61201,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(47901),n=e.i(83428),o=e.i(60112),l=e.i(2287),i=e.i(35364);let s=(0,a.default)(()=>e.A(89305).then(e=>e.FileManager),{loadableGenerated:{modules:[15567]},ssr:!1,loading:()=>(0,t.jsx)(d,{})});function d(){return(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,t.jsx)(n.Loader2,{className:"text-muted-foreground h-8 w-8 animate-spin"})})}async function c(e){let t=new URLSearchParams;e&&t.set("path",e);let r=await fetch(`/api/directory/list?${t.toString()}`);if(!r.ok)throw Error((await r.json().catch(()=>({error:"Failed to load directory"}))).error??"Failed to load directory");return r.json()}function u({open:e,onOpenChange:a,onSelect:n,initialPath:d}){let[u,f]=(0,r.useState)([]),[p,m]=(0,r.useState)(""),[g,h]=(0,r.useState)(!1),[v,b]=(0,r.useState)(null),x=(0,r.useRef)(!1),y=(0,r.useCallback)(async e=>{h(!0),b(null);try{let t=await c(e);f(t.entries),m(t.currentPath)}catch(t){let e=t instanceof Error?t.message:"Failed to load directory";o.toast.error(e)}finally{h(!1)}},[]);(0,r.useEffect)(()=>{e&&!x.current&&(x.current=!0,y(d)),e||(x.current=!1)},[e,d,y]);let w=(0,r.useCallback)(e=>{let t=e.absolutePath;e.isDirectory&&t&&y(t)},[y]),S=(0,r.useCallback)(e=>{1===e.length&&e[0].isDirectory?b(e[0].absolutePath??null):b(null)},[]);function j(){n(null),a(!1)}return(0,t.jsx)(l.Dialog,{open:e,onOpenChange:e=>{e||j()},children:(0,t.jsxs)(l.DialogContent,{className:"flex h-[95dvh] max-w-[95vw] flex-col",onCloseAutoFocus:e=>e.preventDefault(),children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{children:"Select Folder"}),(0,t.jsx)(l.DialogDescription,{className:"truncate font-mono text-xs",children:p||"Loading..."})]}),(0,t.jsx)("div",{className:"shep-file-manager min-h-0 flex-1 overflow-hidden rounded-md border",children:(0,t.jsx)(s,{files:u.map(e=>({name:e.name,isDirectory:!0,path:`/${e.name}`,absolutePath:e.path,updatedAt:e.updatedAt})),isLoading:g,height:"100%",width:"100%",layout:"list",enableFilePreview:!1,permissions:{upload:!1,delete:!1,create:!1,download:!1,copy:!1,move:!1,rename:!1},onFileOpen:w,onSelectionChange:S,onRefresh:()=>y(p)},p)}),(0,t.jsxs)(l.DialogFooter,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:j,children:"Cancel"}),(0,t.jsx)(i.Button,{variant:"secondary",onClick:function(){p&&(n(p),a(!1))},disabled:!p,children:"Select Current Folder"}),(0,t.jsx)(i.Button,{onClick:function(){v&&(n(v),a(!1))},disabled:!v,children:"Select Folder"})]})]})})}e.s(["ReactFileManagerDialog",()=>u],61201),e.s([],13322)},78521,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00f8b076860c6fa8e7577d121e23c4f3fd79323418",t.callServer,void 0,t.findSourceMapURL,"pickFolder");async function a(){let e=await r();if(e.error)throw Error(e.error);return e.path}e.s(["pickFolder",()=>a],78521)},81542,e=>{"use strict";let t=(0,e.i(3645).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);e.s(["GitFork",()=>t],81542)},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={assign:function(){return s},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return i}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});function o(e){let t={};for(let[r,a]of e.entries()){let e=t[r];void 0===e?t[r]=a:Array.isArray(e)?e.push(a):t[r]=[e,a]}return t}function l(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,l(e));else t.set(r,l(a));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,a]of r.entries())e.append(t,a)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={formatUrl:function(){return i},formatWithValidation:function(){return d},urlObjectKeys:function(){return s}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let o=e.r(44066)._(e.r(76314)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,a=e.protocol||"",n=e.pathname||"",i=e.hash||"",s=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),s&&"object"==typeof s&&(s=String(o.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||l.test(a))&&!1!==d?(d="//"+(d||""),n&&"/"!==n[0]&&(n="/"+n)):d||(d=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),n=n.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${a}${d}${n}${c}${i}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return i(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return y},NormalizeError:function(){return b},PageNotFoundError:function(){return x},SP:function(){return g},ST:function(){return h},WEB_VITALS:function(){return o},execOnce:function(){return l},getDisplayName:function(){return u},getLocationOrigin:function(){return d},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return S}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function l(e){let t,r=!1;return(...a)=>(r||(r=!0,t=e(...a)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>i.test(e);function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=d();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(r&&f(r))return a;if(!a)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return a}let g="u">typeof performance,h=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class b extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function S(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let a=e.r(58464),n=e.r(53626);function o(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return v},useLinkStatus:function(){return x}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let o=e.r(44066),l=e.r(20314),i=o._(e.r(79054)),s=e.r(95889),d=e.r(18152),c=e.r(80764),u=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),m=e.r(51380),g=e.r(95555);function h(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let a,n,o,[s,v]=(0,i.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,i.useRef)(null),{href:y,as:w,children:S,prefetch:j=null,passHref:C,replace:P,shallow:k,scroll:D,onClick:N,onMouseEnter:E,onTouchStart:R,legacyBehavior:T=!1,onNavigate:A,ref:I,unstable_dynamicOnHover:L,..._}=t;a=S,T&&("string"==typeof a||"number"==typeof a)&&(a=(0,l.jsx)("a",{children:a}));let M=i.default.useContext(d.AppRouterContext),O=!1!==j,F=!1!==j?null===(r=j)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:z,as:H}=i.default.useMemo(()=>{let e=h(y);return{href:e,as:w?h(w):e}},[y,w]);if(T){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});n=i.default.Children.only(a)}let B=T?n&&"object"==typeof n&&n.ref:I,U=i.default.useCallback(e=>(null!==M&&(x.current=(0,p.mountLinkInstance)(e,z,M,F,O,v)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[O,z,M,F,v]),$={ref:(0,c.useMergedRef)(U,B),onClick(t){T||"function"!=typeof N||N(t),T&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!M||t.defaultPrevented||function(t,r,a,n,o,l,s){if("u">typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(81574);i.default.startTransition(()=>{u(a||r,o?"replace":"push",l??!0,n.current)})}}(t,z,H,x,P,D,A)},onMouseEnter(e){T||"function"!=typeof E||E(e),T&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),M&&O&&(0,p.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){T||"function"!=typeof R||R(e),T&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),M&&O&&(0,p.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,u.isAbsoluteUrl)(H)?$.href=H:T&&!C&&("a"!==n.type||"href"in n.props)||($.href=(0,f.addBasePath)(H)),o=T?i.default.cloneElement(n,$):(0,l.jsx)("a",{..._,...$,children:a}),(0,l.jsx)(b.Provider,{value:s,children:o})}e.r(38670);let b=(0,i.createContext)(p.IDLE_LINK_STATUS),x=()=>(0,i.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},84840,e=>{"use strict";var t=e.i(66033);e.s(["Direction",0,t])},5812,71379,e=>{"use strict";let t=(0,e.i(3645).default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);e.s(["default",()=>t],71379),e.s(["PanelLeftIcon",()=>t],5812)},57638,61238,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(94237);e.i(5812);var n=e.i(84840),o=e.i(5240),l=e.i(31777);e.i(35364),e.i(98127),e.i(25235);var i=e.i(48249),s=e.i(90033);function d({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})}function c({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function u({className:e,...r}){return(0,t.jsx)(s.Dialog.Overlay,{"data-slot":"sheet-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function f({className:e,children:r,side:a="right",showCloseButton:n=!0,...o}){return(0,t.jsxs)(c,{children:[(0,t.jsx)(u,{}),(0,t.jsxs)(s.Dialog.Content,{"data-slot":"sheet-content",className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===a&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 end-0 h-full w-3/4 border-s sm:max-w-sm","left"===a&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 start-0 h-full w-3/4 border-e sm:max-w-sm","top"===a&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===a&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[r,n?(0,t.jsxs)(s.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,t.jsx)(i.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})]})}function p({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,l.cn)("flex flex-col gap-1.5 p-4",e),...r})}function m({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,l.cn)("text-foreground font-semibold",e),...r})}function g({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,l.cn)("text-muted-foreground text-sm",e),...r})}function h({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,l.cn)("bg-accent animate-pulse rounded-md",e),...r})}e.s(["Skeleton",()=>h],61238);var v=e.i(2828);let b="shep-sidebar-open",x=r.createContext(null);function y(){let e=r.useContext(x);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function w({defaultOpen:e=!0,open:a,onOpenChange:n,className:o,style:i,children:s,...d}){let c=function(){let[e,t]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),r=()=>{t(window.innerWidth<768)};return e.addEventListener("change",r),t(window.innerWidth<768),()=>e.removeEventListener("change",r)},[]),!!e}(),[u,f]=r.useState(!1),[p,m]=r.useState(!1),[g,h]=r.useState(e),y=a??g,w=r.useCallback(e=>{let t="function"==typeof e?e(y):e;n?n(t):h(t);try{localStorage.setItem(b,String(t)),document.cookie=`${b}=${t}; path=/; max-age=31536000; SameSite=Lax`}catch{}},[n,y]),S=r.useCallback(()=>(m(!0),c?f(e=>!e):w(e=>!e)),[c,w,f]);r.useEffect(()=>{try{if(!document.cookie.includes(b)){let e=localStorage.getItem(b);null!=e&&(document.cookie=`${b}=${e}; path=/; max-age=31536000; SameSite=Lax`)}}catch{}},[]),r.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),S())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[S]);let j=y?"expanded":"collapsed",C=r.useMemo(()=>({state:j,open:y,setOpen:w,isMobile:c,openMobile:u,setOpenMobile:f,toggleSidebar:S,animated:p}),[j,y,w,c,u,f,S,p]);return(0,t.jsx)(x.Provider,{value:C,children:(0,t.jsx)(v.TooltipProvider,{delayDuration:0,children:(0,t.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...i},className:(0,l.cn)("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...d,children:s})})})}function S({side:e="left",variant:r="sidebar",collapsible:a="offcanvas",className:n,children:o,...i}){let{isMobile:s,state:c,openMobile:u,setOpenMobile:h,animated:v}=y();return"none"===a?(0,t.jsx)("div",{"data-slot":"sidebar",className:(0,l.cn)("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...i,children:o}):s?(0,t.jsx)(d,{open:u,onOpenChange:h,...i,children:(0,t.jsxs)(f,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:e,children:[(0,t.jsxs)(p,{className:"sr-only",children:[(0,t.jsx)(m,{children:"Sidebar"}),(0,t.jsx)(g,{children:"Displays the mobile sidebar."})]}),(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:o})]})}):(0,t.jsxs)("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":"collapsed"===c?a:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[(0,t.jsx)("div",{"data-slot":"sidebar-gap",className:(0,l.cn)("relative w-(--sidebar-width) bg-transparent",v&&"transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","floating"===r||"inset"===r?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,t.jsx)("div",{"data-slot":"sidebar-container",className:(0,l.cn)("fixed inset-y-0 start-0 z-10 hidden h-svh w-(--sidebar-width) md:flex",v&&"transition-[inset-inline-start,width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:start-[calc(var(--sidebar-width)*-1)]","floating"===r||"inset"===r?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"border-e group-data-[collapsible=icon]:w-(--sidebar-width-icon)",n),...i,children:(0,t.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function j({className:e,...r}){let{toggleSidebar:a}=y();return(0,t.jsx)("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:(0,l.cn)("hover:after:bg-sidebar-border absolute inset-y-0 -end-4 z-20 hidden w-4 transition-all ease-linear after:absolute after:inset-y-0 after:start-1/2 after:w-0.5 sm:flex","cursor-w-resize rtl:cursor-e-resize","in-data-[state=collapsed]:cursor-e-resize rtl:in-data-[state=collapsed]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:start-full","in-data-[collapsible=offcanvas]:-end-2",e),...r})}function C({className:e,...r}){return(0,t.jsx)("main",{"data-slot":"sidebar-inset",className:(0,l.cn)("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",e),...r})}function P({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,l.cn)("flex flex-col gap-2 p-2",e),...r})}function k({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,l.cn)("flex flex-col gap-2 p-2",e),...r})}function D({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,l.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function N({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:(0,l.cn)("relative flex w-full min-w-0 flex-col p-2",e),...r})}function E({className:e,asChild:r=!1,...a}){let n=r?o.Slot.Root:"div";return(0,t.jsx)(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:(0,l.cn)("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function R({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:(0,l.cn)("w-full text-sm",e),...r})}function T({className:e,...r}){return(0,t.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,l.cn)("flex w-full min-w-0 flex-col gap-1",e),...r})}function A({className:e,...r}){return(0,t.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,l.cn)("group/menu-item relative",e),...r})}let I=(0,a.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-start text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function L({asChild:e=!1,isActive:r=!1,variant:a="default",size:i="default",tooltip:s,className:d,...c}){let u=e?o.Slot.Root:"button",{isMobile:f,state:p}=y(),m=n.Direction.useDirection(),g=(0,t.jsx)(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":r,className:(0,l.cn)(I({variant:a,size:i}),d),...c});return s?("string"==typeof s&&(s={children:s}),(0,t.jsxs)(v.Tooltip,{children:[(0,t.jsx)(v.TooltipTrigger,{asChild:!0,children:g}),(0,t.jsx)(v.TooltipContent,{side:"rtl"===m?"left":"right",align:"center",hidden:"collapsed"!==p||f,...s})]})):g}e.s(["Sidebar",()=>S,"SidebarContent",()=>D,"SidebarFooter",()=>k,"SidebarGroup",()=>N,"SidebarGroupContent",()=>R,"SidebarGroupLabel",()=>E,"SidebarHeader",()=>P,"SidebarInset",()=>C,"SidebarMenu",()=>T,"SidebarMenuButton",()=>L,"SidebarMenuItem",()=>A,"SidebarProvider",()=>w,"SidebarRail",()=>j,"useSidebar",()=>y],57638)},62639,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let a=(0,r.createContext)({swapPosition:!1});function n({children:e,layout:r}){return(0,t.jsx)(a.Provider,{value:r,children:e})}function o(){return(0,r.useContext)(a)}e.s(["FabLayoutProvider",()=>n,"useFabLayout",()=>o])},5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let a={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"blocked",pending:"pending",error:"error",creating:null,deleting:null,archived:null};function n(e){return a[e]}let o=(0,r.createContext)(null);function l({children:e}){let[a,n]=(0,r.useState)([]),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)(()=>({features:a,setFeatures:n,hasRepositories:l,setHasRepositories:i}),[a,l]);return(0,t.jsx)(o.Provider,{value:s,children:e})}function i(){let e=(0,r.useContext)(o);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>l,"mapNodeStateToSidebarStatus",()=>n,"useSidebarFeaturesContext",()=>i])},47373,27069,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(26036);function n(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>n],27069);var o=e.i(91967),l=e.i(87342),i=e.i(5978),s=e.i(22528),d=e.i(66033),c=e.i(53532),u=e.i(41687),f=e.i(56720),p=e.i(13123),m=e.i(52740),g=e.i(39979),h=e.i(87620),v=e.i(86874),b=e.i(29297),x=e.i(36589),y=e.i(5192),w=e.i(23405),S=e.i(1693),j=e.i(73772),C=e.i(13044),P=[" ","Enter","ArrowUp","ArrowDown"],k=[" ","Enter"],D="Select",[N,E,R]=(0,l.createCollection)(D),[T,A]=(0,s.createContextScope)(D,[R,m.createPopperScope]),I=(0,m.createPopperScope)(),[L,_]=T(D),[M,O]=T(D),F=e=>{let{__scopeSelect:a,children:n,open:o,defaultOpen:l,onOpenChange:i,value:s,defaultValue:c,onValueChange:u,dir:f,name:g,autoComplete:h,disabled:v,required:b,form:y}=e,w=I(a),[S,j]=r.useState(null),[C,P]=r.useState(null),[k,E]=r.useState(!1),R=(0,d.useDirection)(f),[T,A]=(0,x.useControllableState)({prop:o,defaultProp:l??!1,onChange:i,caller:D}),[_,O]=(0,x.useControllableState)({prop:s,defaultProp:c,onChange:u,caller:D}),F=r.useRef(null),z=!S||y||!!S.closest("form"),[H,B]=r.useState(new Set),U=Array.from(H).map(e=>e.props.value).join(";");return(0,t.jsx)(m.Root,{...w,children:(0,t.jsxs)(L,{required:b,scope:a,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:P,valueNodeHasChildren:k,onValueNodeHasChildrenChange:E,contentId:(0,p.useId)(),value:_,onValueChange:O,open:T,onOpenChange:A,dir:R,triggerPointerDownPosRef:F,disabled:v,children:[(0,t.jsx)(N.Provider,{scope:a,children:(0,t.jsx)(M,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{B(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{B(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:n})}),z?(0,t.jsxs)(eP,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:h,value:_,onChange:e=>O(e.target.value),disabled:v,form:y,children:[void 0===_?(0,t.jsx)("option",{value:""}):null,Array.from(H)]},U):null]})})};F.displayName=D;var z="SelectTrigger",H=r.forwardRef((e,a)=>{let{__scopeSelect:n,disabled:l=!1,...s}=e,d=I(n),c=_(z,n),u=c.disabled||l,f=(0,i.useComposedRefs)(a,c.onTriggerChange),p=E(n),g=r.useRef("touch"),[v,b,x]=eD(e=>{let t=p().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),a=eN(t,e,r);void 0!==a&&c.onValueChange(a.value)}),y=e=>{u||(c.onOpenChange(!0),x()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(m.Anchor,{asChild:!0,...d,children:(0,t.jsx)(h.Primitive.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":ek(c.value)?"":void 0,...s,ref:f,onClick:(0,o.composeEventHandlers)(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==g.current&&y(e)}),onPointerDown:(0,o.composeEventHandlers)(s.onPointerDown,e=>{g.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(y(e),e.preventDefault())}),onKeyDown:(0,o.composeEventHandlers)(s.onKeyDown,e=>{let t=""!==v.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||b(e.key),(!t||" "!==e.key)&&P.includes(e.key)&&(y(),e.preventDefault())})})})});H.displayName=z;var B="SelectValue",U=r.forwardRef((e,r)=>{let{__scopeSelect:a,className:n,style:o,children:l,placeholder:s="",...d}=e,c=_(B,a),{onValueNodeHasChildrenChange:u}=c,f=void 0!==l,p=(0,i.useComposedRefs)(r,c.onValueNodeChange);return(0,y.useLayoutEffect)(()=>{u(f)},[u,f]),(0,t.jsx)(h.Primitive.span,{...d,ref:p,style:{pointerEvents:"none"},children:ek(c.value)?(0,t.jsx)(t.Fragment,{children:s}):l})});U.displayName=B;var $=r.forwardRef((e,r)=>{let{__scopeSelect:a,children:n,...o}=e;return(0,t.jsx)(h.Primitive.span,{"aria-hidden":!0,...o,ref:r,children:n||"▼"})});$.displayName="SelectIcon";var V=e=>(0,t.jsx)(g.Portal,{asChild:!0,...e});V.displayName="SelectPortal";var K="SelectContent",W=r.forwardRef((e,n)=>{let o=_(K,e.__scopeSelect),[l,i]=r.useState();return((0,y.useLayoutEffect)(()=>{i(new DocumentFragment)},[]),o.open)?(0,t.jsx)(Y,{...e,ref:n}):l?a.createPortal((0,t.jsx)(G,{scope:e.__scopeSelect,children:(0,t.jsx)(N.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});W.displayName=K;var[G,q]=T(K),X=(0,v.createSlot)("SelectContent.RemoveScroll"),Y=r.forwardRef((e,a)=>{let{__scopeSelect:n,position:l="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:d,onPointerDownOutside:p,side:m,sideOffset:g,align:h,alignOffset:v,arrowPadding:b,collisionBoundary:x,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:P,...k}=e,D=_(K,n),[N,R]=r.useState(null),[T,A]=r.useState(null),I=(0,i.useComposedRefs)(a,e=>R(e)),[L,M]=r.useState(null),[O,F]=r.useState(null),z=E(n),[H,B]=r.useState(!1),U=r.useRef(!1);r.useEffect(()=>{if(N)return(0,j.hideOthers)(N)},[N]),(0,u.useFocusGuards)();let $=r.useCallback(e=>{let[t,...r]=z().map(e=>e.ref.current),[a]=r.slice(-1),n=document.activeElement;for(let r of e)if(r===n||(r?.scrollIntoView({block:"nearest"}),r===t&&T&&(T.scrollTop=0),r===a&&T&&(T.scrollTop=T.scrollHeight),r?.focus(),document.activeElement!==n))return},[z,T]),V=r.useCallback(()=>$([L,N]),[$,L,N]);r.useEffect(()=>{H&&V()},[H,V]);let{onOpenChange:W,triggerPointerDownPosRef:q}=D;r.useEffect(()=>{if(N){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(q.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():N.contains(r.target)||W(!1),document.removeEventListener("pointermove",t),q.current=null};return null!==q.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[N,W,q]),r.useEffect(()=>{let e=()=>W(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[W]);let[Y,Z]=eD(e=>{let t=z().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),a=eN(t,e,r);a&&setTimeout(()=>a.ref.current.focus())}),ee=r.useCallback((e,t,r)=>{let a=!U.current&&!r;(void 0!==D.value&&D.value===t||a)&&(M(e),a&&(U.current=!0))},[D.value]),et=r.useCallback(()=>N?.focus(),[N]),er=r.useCallback((e,t,r)=>{let a=!U.current&&!r;(void 0!==D.value&&D.value===t||a)&&F(e)},[D.value]),ea="popper"===l?J:Q,en=ea===J?{side:m,sideOffset:g,align:h,alignOffset:v,arrowPadding:b,collisionBoundary:x,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:P}:{};return(0,t.jsx)(G,{scope:n,content:N,viewport:T,onViewportChange:A,itemRefCallback:ee,selectedItem:L,onItemLeave:et,itemTextRefCallback:er,focusSelectedItem:V,selectedItemText:O,position:l,isPositioned:H,searchRef:Y,children:(0,t.jsx)(C.RemoveScroll,{as:X,allowPinchZoom:!0,children:(0,t.jsx)(f.FocusScope,{asChild:!0,trapped:D.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,o.composeEventHandlers)(s,e=>{D.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(c.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>D.onOpenChange(!1),children:(0,t.jsx)(ea,{role:"listbox",id:D.contentId,"data-state":D.open?"open":"closed",dir:D.dir,onContextMenu:e=>e.preventDefault(),...k,...en,onPlaced:()=>B(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:(0,o.composeEventHandlers)(k.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=z().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,a=t.indexOf(r);t=t.slice(a+1)}setTimeout(()=>$(t)),e.preventDefault()}})})})})})})});Y.displayName="SelectContentImpl";var Q=r.forwardRef((e,a)=>{let{__scopeSelect:o,onPlaced:l,...s}=e,d=_(K,o),c=q(K,o),[u,f]=r.useState(null),[p,m]=r.useState(null),g=(0,i.useComposedRefs)(a,e=>m(e)),v=E(o),b=r.useRef(!1),x=r.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:j,focusSelectedItem:C}=c,P=r.useCallback(()=>{if(d.trigger&&d.valueNode&&u&&p&&w&&S&&j){let e=d.trigger.getBoundingClientRect(),t=p.getBoundingClientRect(),r=d.valueNode.getBoundingClientRect(),a=j.getBoundingClientRect();if("rtl"!==d.dir){let o=a.left-t.left,l=r.left-o,i=e.left-l,s=e.width+i,d=Math.max(s,t.width),c=n(l,[10,Math.max(10,window.innerWidth-10-d)]);u.style.minWidth=s+"px",u.style.left=c+"px"}else{let o=t.right-a.right,l=window.innerWidth-r.right-o,i=window.innerWidth-e.right-l,s=e.width+i,d=Math.max(s,t.width),c=n(l,[10,Math.max(10,window.innerWidth-10-d)]);u.style.minWidth=s+"px",u.style.right=c+"px"}let o=v(),i=window.innerHeight-20,s=w.scrollHeight,c=window.getComputedStyle(p),f=parseInt(c.borderTopWidth,10),m=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),h=f+m+s+parseInt(c.paddingBottom,10)+g,x=Math.min(5*S.offsetHeight,h),y=window.getComputedStyle(w),C=parseInt(y.paddingTop,10),P=parseInt(y.paddingBottom,10),k=e.top+e.height/2-10,D=S.offsetHeight/2,N=f+m+(S.offsetTop+D);if(N<=k){let e=o.length>0&&S===o[o.length-1].ref.current;u.style.bottom="0px";let t=Math.max(i-k,D+(e?P:0)+(p.clientHeight-w.offsetTop-w.offsetHeight)+g);u.style.height=N+t+"px"}else{let e=o.length>0&&S===o[0].ref.current;u.style.top="0px";let t=Math.max(k,f+w.offsetTop+(e?C:0)+D);u.style.height=t+(h-N)+"px",w.scrollTop=N-k+w.offsetTop}u.style.margin="10px 0",u.style.minHeight=x+"px",u.style.maxHeight=i+"px",l?.(),requestAnimationFrame(()=>b.current=!0)}},[v,d.trigger,d.valueNode,u,p,w,S,j,d.dir,l]);(0,y.useLayoutEffect)(()=>P(),[P]);let[k,D]=r.useState();(0,y.useLayoutEffect)(()=>{p&&D(window.getComputedStyle(p).zIndex)},[p]);let N=r.useCallback(e=>{e&&!0===x.current&&(P(),C?.(),x.current=!1)},[P,C]);return(0,t.jsx)(Z,{scope:o,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:N,children:(0,t.jsx)("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,t.jsx)(h.Primitive.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Q.displayName="SelectItemAlignedPosition";var J=r.forwardRef((e,r)=>{let{__scopeSelect:a,align:n="start",collisionPadding:o=10,...l}=e,i=I(a);return(0,t.jsx)(m.Content,{...i,...l,ref:r,align:n,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});J.displayName="SelectPopperPosition";var[Z,ee]=T(K,{}),et="SelectViewport",er=r.forwardRef((e,a)=>{let{__scopeSelect:n,nonce:l,...s}=e,d=q(et,n),c=ee(et,n),u=(0,i.useComposedRefs)(a,d.onViewportChange),f=r.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(N.Slot,{scope:n,children:(0,t.jsx)(h.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:(0,o.composeEventHandlers)(s.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:a}=c;if(a?.current&&r){let e=Math.abs(f.current-t.scrollTop);if(e>0){let a=window.innerHeight-20,n=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(n<a){let o=n+e,l=Math.min(a,o),i=o-l;r.style.height=l+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})});er.displayName=et;var ea="SelectGroup",[en,eo]=T(ea),el=r.forwardRef((e,r)=>{let{__scopeSelect:a,...n}=e,o=(0,p.useId)();return(0,t.jsx)(en,{scope:a,id:o,children:(0,t.jsx)(h.Primitive.div,{role:"group","aria-labelledby":o,...n,ref:r})})});el.displayName=ea;var ei="SelectLabel",es=r.forwardRef((e,r)=>{let{__scopeSelect:a,...n}=e,o=eo(ei,a);return(0,t.jsx)(h.Primitive.div,{id:o.id,...n,ref:r})});es.displayName=ei;var ed="SelectItem",[ec,eu]=T(ed),ef=r.forwardRef((e,a)=>{let{__scopeSelect:n,value:l,disabled:s=!1,textValue:d,...c}=e,u=_(ed,n),f=q(ed,n),m=u.value===l,[g,v]=r.useState(d??""),[b,x]=r.useState(!1),y=(0,i.useComposedRefs)(a,e=>f.itemRefCallback?.(e,l,s)),w=(0,p.useId)(),S=r.useRef("touch"),j=()=>{s||(u.onValueChange(l),u.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(ec,{scope:n,value:l,disabled:s,textId:w,isSelected:m,onItemTextChange:r.useCallback(e=>{v(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(N.ItemSlot,{scope:n,value:l,disabled:s,textValue:g,children:(0,t.jsx)(h.Primitive.div,{role:"option","aria-labelledby":w,"data-highlighted":b?"":void 0,"aria-selected":m&&b,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:y,onFocus:(0,o.composeEventHandlers)(c.onFocus,()=>x(!0)),onBlur:(0,o.composeEventHandlers)(c.onBlur,()=>x(!1)),onClick:(0,o.composeEventHandlers)(c.onClick,()=>{"mouse"!==S.current&&j()}),onPointerUp:(0,o.composeEventHandlers)(c.onPointerUp,()=>{"mouse"===S.current&&j()}),onPointerDown:(0,o.composeEventHandlers)(c.onPointerDown,e=>{S.current=e.pointerType}),onPointerMove:(0,o.composeEventHandlers)(c.onPointerMove,e=>{S.current=e.pointerType,s?f.onItemLeave?.():"mouse"===S.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,o.composeEventHandlers)(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:(0,o.composeEventHandlers)(c.onKeyDown,e=>{(f.searchRef?.current===""||" "!==e.key)&&(k.includes(e.key)&&j()," "===e.key&&e.preventDefault())})})})})});ef.displayName=ed;var ep="SelectItemText",em=r.forwardRef((e,n)=>{let{__scopeSelect:o,className:l,style:s,...d}=e,c=_(ep,o),u=q(ep,o),f=eu(ep,o),p=O(ep,o),[m,g]=r.useState(null),v=(0,i.useComposedRefs)(n,e=>g(e),f.onItemTextChange,e=>u.itemTextRefCallback?.(e,f.value,f.disabled)),b=m?.textContent,x=r.useMemo(()=>(0,t.jsx)("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=p;return(0,y.useLayoutEffect)(()=>(w(x),()=>S(x)),[w,S,x]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Primitive.span,{id:f.textId,...d,ref:v}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(d.children,c.valueNode):null]})});em.displayName=ep;var eg="SelectItemIndicator",eh=r.forwardRef((e,r)=>{let{__scopeSelect:a,...n}=e;return eu(eg,a).isSelected?(0,t.jsx)(h.Primitive.span,{"aria-hidden":!0,...n,ref:r}):null});eh.displayName=eg;var ev="SelectScrollUpButton",eb=r.forwardRef((e,a)=>{let n=q(ev,e.__scopeSelect),o=ee(ev,e.__scopeSelect),[l,s]=r.useState(!1),d=(0,i.useComposedRefs)(a,o.onScrollButtonChange);return(0,y.useLayoutEffect)(()=>{if(n.viewport&&n.isPositioned){let e=function(){s(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),l?(0,t.jsx)(ew,{...e,ref:d,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eb.displayName=ev;var ex="SelectScrollDownButton",ey=r.forwardRef((e,a)=>{let n=q(ex,e.__scopeSelect),o=ee(ex,e.__scopeSelect),[l,s]=r.useState(!1),d=(0,i.useComposedRefs)(a,o.onScrollButtonChange);return(0,y.useLayoutEffect)(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;s(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),l?(0,t.jsx)(ew,{...e,ref:d,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});ey.displayName=ex;var ew=r.forwardRef((e,a)=>{let{__scopeSelect:n,onAutoScroll:l,...i}=e,s=q("SelectScrollButton",n),d=r.useRef(null),c=E(n),u=r.useCallback(()=>{null!==d.current&&(window.clearInterval(d.current),d.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),(0,y.useLayoutEffect)(()=>{let e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),(0,t.jsx)(h.Primitive.div,{"aria-hidden":!0,...i,ref:a,style:{flexShrink:0,...i.style},onPointerDown:(0,o.composeEventHandlers)(i.onPointerDown,()=>{null===d.current&&(d.current=window.setInterval(l,50))}),onPointerMove:(0,o.composeEventHandlers)(i.onPointerMove,()=>{s.onItemLeave?.(),null===d.current&&(d.current=window.setInterval(l,50))}),onPointerLeave:(0,o.composeEventHandlers)(i.onPointerLeave,()=>{u()})})}),eS=r.forwardRef((e,r)=>{let{__scopeSelect:a,...n}=e;return(0,t.jsx)(h.Primitive.div,{"aria-hidden":!0,...n,ref:r})});eS.displayName="SelectSeparator";var ej="SelectArrow",eC=r.forwardRef((e,r)=>{let{__scopeSelect:a,...n}=e,o=I(a),l=_(ej,a),i=q(ej,a);return l.open&&"popper"===i.position?(0,t.jsx)(m.Arrow,{...o,...n,ref:r}):null});eC.displayName=ej;var eP=r.forwardRef(({__scopeSelect:e,value:a,...n},o)=>{let l=r.useRef(null),s=(0,i.useComposedRefs)(o,l),d=(0,w.usePrevious)(a);return r.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(d!==a&&t){let r=new Event("change",{bubbles:!0});t.call(e,a),e.dispatchEvent(r)}},[d,a]),(0,t.jsx)(h.Primitive.select,{...n,style:{...S.VISUALLY_HIDDEN_STYLES,...n.style},ref:s,defaultValue:a})});function ek(e){return""===e||void 0===e}function eD(e){let t=(0,b.useCallbackRef)(e),a=r.useRef(""),n=r.useRef(0),o=r.useCallback(e=>{let r=a.current+e;t(r),function e(t){a.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),l=r.useCallback(()=>{a.current="",window.clearTimeout(n.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(n.current),[]),[a,o,l]}function eN(e,t,r){var a,n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,l=r?e.indexOf(r):-1,i=(a=e,n=Math.max(l,0),a.map((e,t)=>a[(n+t)%a.length]));1===o.length&&(i=i.filter(e=>e!==r));let s=i.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==r?s:void 0}eP.displayName="SelectBubbleInput",e.s(["Arrow",()=>eC,"Content",()=>W,"Group",()=>el,"Icon",()=>$,"Item",()=>ef,"ItemIndicator",()=>eh,"ItemText",()=>em,"Label",()=>es,"Portal",()=>V,"Root",()=>F,"ScrollDownButton",()=>ey,"ScrollUpButton",()=>eb,"Select",()=>F,"SelectArrow",()=>eC,"SelectContent",()=>W,"SelectGroup",()=>el,"SelectIcon",()=>$,"SelectItem",()=>ef,"SelectItemIndicator",()=>eh,"SelectItemText",()=>em,"SelectLabel",()=>es,"SelectPortal",()=>V,"SelectScrollDownButton",()=>ey,"SelectScrollUpButton",()=>eb,"SelectSeparator",()=>eS,"SelectTrigger",()=>H,"SelectValue",()=>U,"SelectViewport",()=>er,"Separator",()=>eS,"Trigger",()=>H,"Value",()=>U,"Viewport",()=>er,"createSelectScope",()=>A],83830);var eE=e.i(83830),eE=eE,eR=e.i(23925),eT=e.i(99105),eA=e.i(48829),eI=e.i(31777);let eL=eE.Root;eE.Group;let e_=eE.Value,eM=r.forwardRef(({className:e,children:r,...a},n)=>(0,t.jsxs)(eE.Trigger,{ref:n,className:(0,eI.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[r,(0,t.jsx)(eE.Icon,{asChild:!0,children:(0,t.jsx)(eT.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));eM.displayName=eE.Trigger.displayName;let eO=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(eE.ScrollUpButton,{ref:a,className:(0,eI.cn)("flex cursor-default items-center justify-center py-1",e),...r,children:(0,t.jsx)(eA.ChevronUp,{className:"h-4 w-4"})}));eO.displayName=eE.ScrollUpButton.displayName;let eF=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(eE.ScrollDownButton,{ref:a,className:(0,eI.cn)("flex cursor-default items-center justify-center py-1",e),...r,children:(0,t.jsx)(eT.ChevronDown,{className:"h-4 w-4"})}));eF.displayName=eE.ScrollDownButton.displayName;let ez=r.forwardRef(({className:e,children:r,position:a="popper",...n},o)=>(0,t.jsx)(eE.Portal,{children:(0,t.jsxs)(eE.Content,{ref:o,className:(0,eI.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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[(0,t.jsx)(eO,{}),(0,t.jsx)(eE.Viewport,{className:(0,eI.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,t.jsx)(eF,{})]})}));ez.displayName=eE.Content.displayName,r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(eE.Label,{ref:a,className:(0,eI.cn)("px-2 py-1.5 text-sm font-semibold",e),...r})).displayName=eE.Label.displayName;let eH=r.forwardRef(({className:e,children:r,...a},n)=>(0,t.jsxs)(eE.Item,{ref:n,className:(0,eI.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eE.ItemIndicator,{children:(0,t.jsx)(eR.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eE.ItemText,{children:r})]}));eH.displayName=eE.Item.displayName,r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(eE.Separator,{ref:a,className:(0,eI.cn)("bg-muted -mx-1 my-1 h-px",e),...r})).displayName=eE.Separator.displayName,e.s(["Select",()=>eL,"SelectContent",()=>ez,"SelectItem",()=>eH,"SelectTrigger",()=>eM,"SelectValue",()=>e_],47373)},89305,e=>{e.v(t=>Promise.all(["static/chunks/6d7b999c99d6d175.js"].map(t=>e.l(t))).then(()=>t(15567)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66033,e=>{"use strict";var t=e.i(79054),r=e.i(20314),s=t.createContext(void 0),i=e=>{let{dir:t,children:i}=e;return(0,r.jsx)(s.Provider,{value:t,children:i})};function n(e){let r=t.useContext(s);return e||r||"ltr"}e.s(["DirectionProvider",()=>i,"Provider",()=>i,"useDirection",()=>n])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),i=e.i(86874),n=e.i(20314);function a(e){let a=e+"CollectionProvider",[o,u]=(0,r.createContextScope)(a),[l,c]=o(a,{collectionRef:{current:null},itemMap:new Map}),h=e=>{let{scope:r,children:s}=e,i=t.default.useRef(null),a=t.default.useRef(new Map).current;return(0,n.jsx)(l,{scope:r,itemMap:a,collectionRef:i,children:s})};h.displayName=a;let d=e+"CollectionSlot",f=(0,i.createSlot)(d),p=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,a=c(d,r),o=(0,s.useComposedRefs)(t,a.collectionRef);return(0,n.jsx)(f,{ref:o,children:i})});p.displayName=d;let y=e+"CollectionItemSlot",v="data-radix-collection-item",m=(0,i.createSlot)(y),b=t.default.forwardRef((e,r)=>{let{scope:i,children:a,...o}=e,u=t.default.useRef(null),l=(0,s.useComposedRefs)(r,u),h=c(y,i);return t.default.useEffect(()=>(h.itemMap.set(u,{ref:u,...o}),()=>void h.itemMap.delete(u))),(0,n.jsx)(m,{...{[v]:""},ref:l,children:a})});return b.displayName=y,[{Provider:h,Slot:p,ItemSlot:b},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},u]}var o=new WeakMap;function u(e,t){var r,s;let i,n,a;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,s=t,i=r.length,(a=(n=l(s))>=0?n:i+n)<0||a>=i?-1:a);return -1===o?void 0:e[o]}function l(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],o.set(this,!0)}set(e,t){return o.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,i=this.has(t),n=this.#e.length,a=l(e),o=a>=0?a:n+a,u=o<0||o>=n?-1:o;if(u===this.size||i&&u===this.size-1||-1===u)return this.set(t,r),this;let c=this.size+ +!i;a<0&&o++;let h=[...this.#e],d=!1;for(let e=o;e<c;e++)if(o===e){let n=h[e];h[e]===t&&(n=h[e+1]),i&&this.delete(t),s=this.get(n),this.set(t,r)}else{d||h[e-1]!==t||(d=!0);let r=h[d?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=u(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=u(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return u(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>a])},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),s=e.i(87342),i=e.i(5978),n=e.i(22528),a=e.i(13123),o=e.i(87620),u=e.i(29297),l=e.i(36589),c=e.i(66033),h=e.i(20314),d="rovingFocusGroup.onEntryFocus",f={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[y,v,m]=(0,s.createCollection)(p),[b,g]=(0,n.createContextScope)(p,[m]),[R,S]=b(p),w=t.forwardRef((e,t)=>(0,h.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(T,{...e,ref:t})})}));w.displayName=p;var T=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:n,orientation:a,loop:y=!1,dir:m,currentTabStopId:b,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:S,onEntryFocus:w,preventScrollOnEntryFocus:T=!1,...C}=e,O=t.useRef(null),x=(0,i.useComposedRefs)(s,O),I=(0,c.useDirection)(m),[F,k]=(0,l.useControllableState)({prop:b,defaultProp:g??null,onChange:S,caller:p}),[M,Q]=t.useState(!1),j=(0,u.useCallbackRef)(w),D=v(n),A=t.useRef(!1),[P,U]=t.useState(0);return t.useEffect(()=>{let e=O.current;if(e)return e.addEventListener(d,j),()=>e.removeEventListener(d,j)},[j]),(0,h.jsx)(R,{scope:n,orientation:a,dir:I,loop:y,currentTabStopId:F,onItemFocus:t.useCallback(e=>k(e),[k]),onItemShiftTab:t.useCallback(()=>Q(!0),[]),onFocusableItemAdd:t.useCallback(()=>U(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>U(e=>e-1),[]),children:(0,h.jsx)(o.Primitive.div,{tabIndex:M||0===P?-1:0,"data-orientation":a,...C,ref:x,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{A.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!A.current;if(e.target===e.currentTarget&&t&&!M){let t=new CustomEvent(d,f);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);E([e.find(e=>e.active),e.find(e=>e.id===F),...e].filter(Boolean).map(e=>e.ref.current),T)}}A.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>Q(!1))})})}),C="RovingFocusGroupItem",O=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:i,focusable:n=!0,active:u=!1,tabStopId:l,children:c,...d}=e,f=(0,a.useId)(),p=l||f,m=S(C,i),b=m.currentTabStopId===p,g=v(i),{onFocusableItemAdd:R,onFocusableItemRemove:w,currentTabStopId:T}=m;return t.useEffect(()=>{if(n)return R(),()=>w()},[n,R,w]),(0,h.jsx)(y.ItemSlot,{scope:i,id:p,focusable:n,active:u,children:(0,h.jsx)(o.Primitive.span,{tabIndex:b?0:-1,"data-orientation":m.orientation,...d,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{n?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var s;let i=(s=e.key,"rtl"!==r?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return x[i]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,s;"prev"===t&&i.reverse();let n=i.indexOf(e.currentTarget);i=m.loop?(r=i,s=n+1,r.map((e,t)=>r[(s+t)%r.length])):i.slice(n+1)}setTimeout(()=>E(i))}}),children:"function"==typeof c?c({isCurrentTabStop:b,hasTabStop:null!=T}):c})})});O.displayName=C;var x={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E(e,t=!1){let r=document.activeElement;for(let s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>O,"Root",()=>w,"createRovingFocusGroupScope",()=>g])},68304,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),i=e.i(22528),n=e.i(51080),a=e.i(85995),o=e.i(87620),u=e.i(66033),l=e.i(36589),c=e.i(13123),h="Tabs",[d,f]=(0,i.createContextScope)(h,[n.createRovingFocusGroupScope]),p=(0,n.createRovingFocusGroupScope)(),[y,v]=d(h),m=r.forwardRef((e,r)=>{let{__scopeTabs:s,value:i,onValueChange:n,defaultValue:a,orientation:d="horizontal",dir:f,activationMode:p="automatic",...v}=e,m=(0,u.useDirection)(f),[b,g]=(0,l.useControllableState)({prop:i,onChange:n,defaultProp:a??"",caller:h});return(0,t.jsx)(y,{scope:s,baseId:(0,c.useId)(),value:b,onValueChange:g,orientation:d,dir:m,activationMode:p,children:(0,t.jsx)(o.Primitive.div,{dir:m,"data-orientation":d,...v,ref:r})})});m.displayName=h;var b="TabsList",g=r.forwardRef((e,r)=>{let{__scopeTabs:s,loop:i=!0,...a}=e,u=v(b,s),l=p(s);return(0,t.jsx)(n.Root,{asChild:!0,...l,orientation:u.orientation,dir:u.dir,loop:i,children:(0,t.jsx)(o.Primitive.div,{role:"tablist","aria-orientation":u.orientation,...a,ref:r})})});g.displayName=b;var R="TabsTrigger",S=r.forwardRef((e,r)=>{let{__scopeTabs:i,value:a,disabled:u=!1,...l}=e,c=v(R,i),h=p(i),d=C(c.baseId,a),f=O(c.baseId,a),y=a===c.value;return(0,t.jsx)(n.Item,{asChild:!0,...h,focusable:!u,active:y,children:(0,t.jsx)(o.Primitive.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":f,"data-state":y?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:d,...l,ref:r,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{u||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(a)}),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(a)}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;y||u||!e||c.onValueChange(a)})})})});S.displayName=R;var w="TabsContent",T=r.forwardRef((e,s)=>{let{__scopeTabs:i,value:n,forceMount:u,children:l,...c}=e,h=v(w,i),d=C(h.baseId,n),f=O(h.baseId,n),p=n===h.value,y=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.Presence,{present:u||p,children:({present:r})=>(0,t.jsx)(o.Primitive.div,{"data-state":p?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:f,tabIndex:0,...c,ref:s,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&l})})});function C(e,t){return`${e}-trigger-${t}`}function O(e,t){return`${e}-content-${t}`}T.displayName=w,e.s(["Content",()=>T,"List",()=>g,"Root",()=>m,"Tabs",()=>m,"TabsContent",()=>T,"TabsList",()=>g,"TabsTrigger",()=>S,"Trigger",()=>S,"createTabsScope",()=>f],43133);var x=e.i(43133),x=x,E=e.i(31777);let I=x.Root,F=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(x.List,{ref:s,className:(0,E.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...r}));F.displayName=x.List.displayName;let k=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(x.Trigger,{ref:s,className:(0,E.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...r}));k.displayName=x.Trigger.displayName;let M=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(x.Content,{ref:s,className:(0,E.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...r}));M.displayName=x.Content.displayName,e.s(["Tabs",()=>I,"TabsContent",()=>M,"TabsList",()=>F,"TabsTrigger",()=>k],68304)},26370,48829,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",()=>r],26370);let s=(0,t.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["ChevronUp",()=>s],48829)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},67669,e=>{"use strict";let t=(0,e.i(3645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],67669)},94365,e=>{"use strict";let t=(0,e.i(3645).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],94365)},4520,77501,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t],77501);var r=new class extends t{#t;#r;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>r],4520)},3,68911,e=>{"use strict";e.i(44172);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#i=t;#n=!1;setTimeoutProvider(e){this.#i=e}setTimeout(e,t){return this.#i.setTimeout(e,t)}clearTimeout(e){this.#i.clearTimeout(e)}setInterval(e,t){return this.#i.setInterval(e,t)}clearInterval(e){this.#i.clearInterval(e)}};function s(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>s,"timeoutManager",()=>r],68911);var i="u"<typeof window||"Deno"in globalThis;function n(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:s,fetchStatus:i,predicate:n,queryKey:a,stale:o}=e;if(a){if(s){if(t.queryHash!==f(a,t.options))return!1}else if(!y(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!i||i===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:r,status:s,predicate:i,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(n))return!1}else if(!y(t.options.mutationKey,n))return!1}return(!s||t.state.status===s)&&(!i||!!i(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>g(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function y(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>y(e[r],t[r]))}var v=Object.prototype.hasOwnProperty;function m(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e){if(!R(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!R(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function R(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){return new Promise(t=>{r.setTimeout(t,e)})}function w(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,s=0){if(t===r)return t;if(s>500)return r;let i=b(t)&&b(r);if(!i&&!(g(t)&&g(r)))return r;let n=(i?t:Object.keys(t)).length,a=i?r:Object.keys(r),o=a.length,u=i?Array(o):{},l=0;for(let c=0;c<o;c++){let o=i?c:a[c],h=t[o],d=r[o];if(h===d){u[o]=h,(i?c<n:v.call(t,o))&&l++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){u[o]=d;continue}let f=e(h,d,s+1);u[o]=f,f===h&&l++}return n===o&&l===n?t:u}(e,t):t}function T(e,t,r=0){let s=[...e,t];return r&&s.length>r?s.slice(1):s}function C(e,t,r=0){let s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var O=Symbol();function x(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==O?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function E(e,t){return"function"==typeof e?e(...t):!!e}function I(e,t,r){let s,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}e.s(["addConsumeAwareSignal",()=>I,"addToEnd",()=>T,"addToStart",()=>C,"ensureQueryFn",()=>x,"functionalUpdate",()=>a,"hashKey",()=>p,"hashQueryKeyByOptions",()=>f,"isServer",()=>i,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>y,"replaceData",()=>w,"resolveEnabled",()=>c,"resolveStaleTime",()=>l,"shallowEqualObjects",()=>m,"shouldThrowError",()=>E,"skipToken",()=>O,"sleep",()=>S,"timeUntilStale",()=>u],3)},65617,e=>{"use strict";let t;var r=e.i(3),s=(t=()=>r.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",()=>s])},6786,e=>{"use strict";let t,r,s,i,n,a;var o=e.i(68911).systemSetTimeoutZero,u=(t=[],r=0,s=e=>{e()},i=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{s(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{s(e)})},setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>u])},13598,20820,e=>{"use strict";var t=e.i(77501),r=new class extends t.Subscribable{#a=!0;#r;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function s(){let e,t,r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}e.s(["onlineManager",()=>r],13598),e.i(3),e.s(["pendingThenable",()=>s],20820)},28574,20979,19644,34682,e=>{"use strict";e.i(44172);var t=e.i(3),r=e.i(6786),s=e.i(4520),i=e.i(13598),n=e.i(20820),a=e.i(65617);function o(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||i.onlineManager.isOnline()}var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,c=!1,h=0,d=(0,n.pendingThenable)(),f=()=>s.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),p=()=>u(e.networkMode)&&e.canRun(),y=e=>{"pending"===d.status&&(r?.(),d.resolve(e))},v=e=>{"pending"===d.status&&(r?.(),d.reject(e))},m=()=>new Promise(t=>{r=e=>{("pending"!==d.status||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===d.status&&e.onContinue?.()}),b=()=>{let r;if("pending"!==d.status)return;let s=0===h?e.initialPromise:void 0;try{r=s??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(y).catch(r=>{if("pending"!==d.status)return;let s=e.retry??3*!a.environmentManager.isServer(),i=e.retryDelay??o,n="function"==typeof i?i(h,r):i,u=!0===s||"number"==typeof s&&h<s||"function"==typeof s&&s(h,r);c||!u?v(r):(h++,e.onFail?.(h,r),(0,t.sleep)(n).then(()=>f()?void 0:m()).then(()=>{c?v(r):b()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let r=new l(t);v(r),e.onCancel?.(r)}},continue:()=>(r?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:p,start:()=>(p()?b():m().then(b),d)}}e.s(["CancelledError",()=>l,"canFetch",()=>u,"createRetryer",()=>c],20979);var h=e.i(68911),d=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#o=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){this.#o&&(h.timeoutManager.clearTimeout(this.#o),this.#o=void 0)}};e.s(["Removable",()=>d],19644);var f=class extends d{#u;#l;#c;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#c=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#u=v(this.options),this.state=e.state??this.#u,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=v(this.options);void 0!==e.data&&(this.setState(y(e.data,e.dataUpdatedAt)),this.#u=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,r){let s=(0,t.replaceData)(this.state.data,e,this.options);return this.#y({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e,t){this.#y({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#d?.promise;return this.#d?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#u}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#v()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#v(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#y({type:"invalidate"})}async fetch(e,r){let s;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,i.signal)})},a=()=>{let e,s=(0,t.ensureQueryFn)(this.options,r),i=(n(e={client:this.#h,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(s,i,this):s(i)},o=(n(s={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:a}),s);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#y({type:"fetch",meta:o.fetchOptions?.meta}),this.#d=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof l&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),i.abort()},onFail:(e,t)=>{this.#y({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#y({type:"pause"})},onContinue:()=>{this.#y({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof l){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#y({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#y(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...y(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function y(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>f,"fetchState",()=>p],28574);var m=e.i(79054),b=e.i(20314),g=m.createContext(void 0),R=e=>{let t=m.useContext(g);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},S=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,b.jsx)(g.Provider,{value:e,children:t}));e.s(["QueryClientProvider",()=>S,"useQueryClient",()=>R],34682)},62885,e=>{"use strict";let t;var r=e.i(4520),s=e.i(65617),i=e.i(6786),n=e.i(28574),a=e.i(77501),o=e.i(20820),u=e.i(3),l=e.i(68911),c=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#h=e,this.#m=null,this.#b=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#h;#g=void 0;#R=void 0;#S=void 0;#w;#T;#b;#m;#C;#O;#x;#E;#I;#F;#k=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),h(this.#g,this.options)?this.#M():this.updateResult(),this.#Q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#D(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,u.resolveEnabled)(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#A(),this.#g.setOptions(this.options),t._defaulted&&!(0,u.shallowEqualObjects)(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let s=this.hasListeners();s&&f(this.#g,r,this.options,t)&&this.#M(),this.updateResult(),s&&(this.#g!==r||(0,u.resolveEnabled)(this.options.enabled,this.#g)!==(0,u.resolveEnabled)(t.enabled,this.#g)||(0,u.resolveStaleTime)(this.options.staleTime,this.#g)!==(0,u.resolveStaleTime)(t.staleTime,this.#g))&&this.#P();let i=this.#U();s&&(this.#g!==r||(0,u.resolveEnabled)(this.options.enabled,this.#g)!==(0,u.resolveEnabled)(t.enabled,this.#g)||i!==this.#F)&&this.#q(i)}getOptimisticResult(e){var t,r;let s=this.#h.getQueryCache().build(this.#h,e),i=this.createResult(s,e);return t=this,r=i,(0,u.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#S=i,this.#T=this.options,this.#w=this.#g.state),i}getCurrentResult(){return this.#S}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#b.status||this.#b.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#k.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#M({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#S))}#M(e){this.#A();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u.noop)),t}#P(){this.#j();let e=(0,u.resolveStaleTime)(this.options.staleTime,this.#g);if(s.environmentManager.isServer()||this.#S.isStale||!(0,u.isValidTimeout)(e))return;let t=(0,u.timeUntilStale)(this.#S.dataUpdatedAt,e);this.#E=l.timeoutManager.setTimeout(()=>{this.#S.isStale||this.updateResult()},t+1)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#q(e){this.#D(),this.#F=e,!s.environmentManager.isServer()&&!1!==(0,u.resolveEnabled)(this.options.enabled,this.#g)&&(0,u.isValidTimeout)(this.#F)&&0!==this.#F&&(this.#I=l.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||r.focusManager.isFocused())&&this.#M()},this.#F))}#Q(){this.#P(),this.#q(this.#U())}#j(){this.#E&&(l.timeoutManager.clearTimeout(this.#E),this.#E=void 0)}#D(){this.#I&&(l.timeoutManager.clearInterval(this.#I),this.#I=void 0)}createResult(e,t){let r,s=this.#g,i=this.options,a=this.#S,l=this.#w,c=this.#T,d=e!==s?e.state:this.#R,{state:y}=e,v={...y},m=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&h(e,t),o=r&&f(e,s,t,i);(a||o)&&(v={...v,...(0,n.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:R}=v;r=v.data;let S=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===R){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,S=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#x?.state.data,this.#x):t.placeholderData,void 0!==e&&(R="success",r=(0,u.replaceData)(a?.data,e,t),m=!0)}if(t.select&&void 0!==r&&!S)if(a&&r===l?.data&&t.select===this.#C)r=this.#O;else try{this.#C=t.select,r=t.select(r),r=(0,u.replaceData)(a?.data,r,t),this.#O=r,this.#m=null}catch(e){this.#m=e}this.#m&&(b=this.#m,r=this.#O,g=Date.now(),R="error");let w="fetching"===v.fetchStatus,T="pending"===R,C="error"===R,O=T&&w,x=void 0!==r,E={status:R,fetchStatus:v.fetchStatus,isPending:T,isSuccess:"success"===R,isError:C,isInitialLoading:O,isLoading:O,data:r,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:v.dataUpdateCount>d.dataUpdateCount||v.errorUpdateCount>d.errorUpdateCount,isFetching:w,isRefetching:w&&!T,isLoadingError:C&&!x,isPaused:"paused"===v.fetchStatus,isPlaceholderData:m,isRefetchError:C&&x,isStale:p(e,t),refetch:this.refetch,promise:this.#b,isEnabled:!1!==(0,u.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==E.data,r="error"===E.status&&!t,i=e=>{r?e.reject(E.error):t&&e.resolve(E.data)},n=()=>{i(this.#b=E.promise=(0,o.pendingThenable)())},a=this.#b;switch(a.status){case"pending":e.queryHash===s.queryHash&&i(a);break;case"fulfilled":(r||E.data!==a.value)&&n();break;case"rejected":r&&E.error===a.reason||n()}}return E}updateResult(){let e=this.#S,t=this.createResult(this.#g,this.options);if(this.#w=this.#g.state,this.#T=this.options,void 0!==this.#w.data&&(this.#x=this.#g),(0,u.shallowEqualObjects)(t,e))return;this.#S=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#k.size)return!0;let s=new Set(r??this.#k);return this.options.throwOnError&&s.add("error"),Object.keys(this.#S).some(t=>this.#S[t]!==e[t]&&s.has(t))};this.#L({listeners:r()})}#A(){let e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#R=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#Q()}#L(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#S)}),this.#h.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function h(e,t){return!1!==(0,u.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,r){if(!1!==(0,u.resolveEnabled)(t.enabled,e)&&"static"!==(0,u.resolveStaleTime)(t.staleTime,e)){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&p(e,t)}return!1}function f(e,t,r,s){return(e!==t||!1===(0,u.resolveEnabled)(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&p(e,r)}function p(e,t){return!1!==(0,u.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,u.resolveStaleTime)(t.staleTime,e))}e.i(44172);var y=e.i(79054),v=e.i(34682);e.i(20314);var m=y.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),b=y.createContext(!1);b.Provider;var g=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function R(e,t){return function(e,t,r){let n,a=y.useContext(b),o=y.useContext(m),l=(0,v.useQueryClient)(r),c=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let h=l.getQueryCache().get(c.queryHash);if(c._optimisticResults=a?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}n=h?.state.error&&"function"==typeof c.throwOnError?(0,u.shouldThrowError)(c.throwOnError,[h.state.error,h]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||n)&&!o.isReset()&&(c.retryOnMount=!1),y.useEffect(()=>{o.clearReset()},[o]);let d=!l.getQueryCache().get(c.queryHash),[f]=y.useState(()=>new t(l,c)),p=f.getOptimisticResult(c),R=!a&&!1!==e.subscribed;if(y.useSyncExternalStore(y.useCallback(e=>{let t=R?f.subscribe(i.notifyManager.batchCalls(e)):u.noop;return f.updateResult(),t},[f,R]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),y.useEffect(()=>{f.setOptions(c)},[c,f]),c?.suspense&&p.isPending)throw g(c,f,o);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(0,u.shouldThrowError)(r,[e.error,s])))({result:p,errorResetBoundary:o,throwOnError:c.throwOnError,query:h,suspense:c.suspense}))throw p.error;if(l.getDefaultOptions().queries?._experimental_afterQuery?.(c,p),c.experimental_prefetchInRender&&!s.environmentManager.isServer()&&p.isLoading&&p.isFetching&&!a){let e=d?g(c,f,o):h?.promise;e?.catch(u.noop).finally(()=>{f.updateResult()})}return c.notifyOnChangeProps?p:f.trackResult(p)}(e,c,t)}e.s(["useQuery",()=>R],62885)}]);
@@ -1 +0,0 @@
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),a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=a((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=(e,t,n)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?r(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n},o=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function o(e,t,r,n){var a=""+t,o=""+r;if(!e&&a>o){var s=a;a=o,o=s}return a+"\x01"+o+"\x01"+(void 0===n?"\0":n)}function s(e,t){return o(e,t.v,t.w,t.name)}t.exports=class{constructor(e){a(this,"_isDirected",!0),a(this,"_isMultigraph",!1),a(this,"_isCompound",!1),a(this,"_label"),a(this,"_defaultNodeLabelFn",()=>{}),a(this,"_defaultEdgeLabelFn",()=>{}),a(this,"_nodes",{}),a(this,"_in",{}),a(this,"_preds",{}),a(this,"_out",{}),a(this,"_sucs",{}),a(this,"_edgeObjs",{}),a(this,"_edgeLabels",{}),a(this,"_nodeCount",0),a(this,"_edgeCount",0),a(this,"_parent"),a(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(a){var o=r.parent(a);return void 0===o||t.hasNode(o)?(n[a]=o,o):o in n?n[o]:e(o)}(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,a){return n.length>1?r.setEdge(e,a,t):r.setEdge(e,a),a}),this}setEdge(){var e,t,n,a,s=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,n=i.name,2==arguments.length&&(a=arguments[1],s=!0)):(e=i,t=arguments[1],n=arguments[3],arguments.length>2&&(a=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var l=o(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return s&&(this._edgeLabels[l]=a),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[l]=s?a:this._defaultEdgeLabelFn(e,t,n);var d=function(e,t,r,n){var a=""+t,o=""+r;if(!e&&a>o){var s=a;a=o,o=s}var i={v:a,w:o};return n&&(i.name=n),i}(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[l]=d,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=d,this._out[e][l]=d,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):o(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]):o(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var a=1==arguments.length?s(this._isDirected,arguments[0]):o(this._isDirected,e,t,r),i=this._edgeObjs[a];return i&&(e=i.v,t=i.w,delete this._edgeLabels[a],delete this._edgeObjs[a],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][a],delete this._out[e][a],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"}),i=n((e,t)=>{t.exports={Graph:o(),version:s()}}),l=n((e,t)=>{var r=o();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),a={v:e};return void 0!==r&&(a.value=r),void 0!==n&&(a.parent=n),a}),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}}}),d=n((e,t)=>{t.exports=function(e,t,n,a){return function(e,t,r,n){var a={},o=!0,s=0,i=e.nodes(),l=function(e){var t=r(e);a[e.v].distance+t<a[e.w].distance&&(a[e.w]={distance:a[e.v].distance+t,predecessor:e.v},o=!0)},d=function(){i.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;l({v:r,w:n})})})};i.forEach(function(e){a[e]={distance:e===t?0:1/0}});for(var c=i.length,u=1;u<c&&(o=!1,s++,d(),o);u++);if(s===c-1&&(o=!1,d(),o))throw Error("The graph contains a negative weight cycle");return a}(e,String(t),n||r,a||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(a){t=[],function n(a){Object.hasOwn(r,a)||(r[a]=!0,t.push(a),e.successors(a).forEach(n),e.predecessors(a).forEach(n))}(a),t.length&&n.push(t)}),n}}),u=n((e,t)=>{t.exports=class{constructor(){a(this,"_arr",[]),a(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,a=n.length;return r[e]=a,n.push({key:e,priority:t}),this._decrease(a),!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,a=e;r<t.length&&(a=t[r].priority<t[a].priority?r:a,n<t.length&&(a=t[n].priority<t[a].priority?n:a),a!==e&&(this._swap(e,a),this._heapify(a)))}_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,a=r[e],o=r[t];r[e]=o,r[t]=a,n[o.key]=e,n[a.key]=t}}}),h=n((e,t)=>{var r=u();t.exports=function(e,t,a,o){return function(e,t,n,a){var o,s,i={},l=new r,d=function(e){var t=e.v!==o?e.v:e.w,r=i[t],a=n(e),d=s.distance+a;if(a<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+a);d<r.distance&&(r.distance=d,r.predecessor=o,l.decrease(t,d))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;i[e]={distance:r},l.add(e,r)});l.size()>0&&(s=i[o=l.removeMin()]).distance!==1/0;)a(o).forEach(d);return i}(e,String(t),a||n,o||function(t){return e.outEdges(t)})};var n=()=>1}),p=n((e,t)=>{var r=h();t.exports=function(e,t,n){return e.nodes().reduce(function(a,o){return a[o]=r(e,o,t,n),a},{})}}),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=[],a=r;a!==t;)n.push(a),a=e[a].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},a=[];return e.nodes().forEach(function(o){Object.hasOwn(n,o)||function o(s){var i=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&&(i.lowlink=Math.min(i.lowlink,n[e].index)):(o(e),i.lowlink=Math.min(i.lowlink,n[e].lowlink))}),i.lowlink===i.index){var l,d=[];do n[l=r.pop()].onStack=!1,d.push(l);while(s!==l)a.push(d)}}(o)}),a}}),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])})}}),x=n((e,t)=>{t.exports=function(e,t,n){var a,o,s,i,l;return a=e,o=t||r,s=n||function(t){return e.outEdges(t)},i={},(l=a.nodes()).forEach(function(e){i[e]={},i[e][e]={distance:0},l.forEach(function(t){e!==t&&(i[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=o(t);i[e][r]={distance:n,predecessor:e}})}),l.forEach(function(e){var t=i[e];l.forEach(function(r){var n=i[r];l.forEach(function(r){var a=n[e],o=t[r],s=n[r],i=a.distance+o.distance;i<s.distance&&(s.distance=i,s.predecessor=o.predecessor)})})}),i};var r=()=>1}),v=n((e,t)=>{function r(e){var t={},r={},a=[];if(e.sinks().forEach(function o(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete r[s],a.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return a}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),y=n((e,t)=>{var r=v();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),b=n((e,t)=>{t.exports=function(e,t,r,n,a){Array.isArray(t)||(t=[t]);var o=(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);a=function e(t,r,n,a,o,s,i){return Object.hasOwn(a,r)||(a[r]=!0,n||(i=s(i,r)),o(r).forEach(function(r){i=e(t,r,n,a,o,s,i)}),n&&(i=s(i,r))),i}(e,t,"post"===r,s,o,n,a)}),a}}),w=n((e,t)=>{var r=b();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),k=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"post")}}),j=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"pre")}}),N=n((e,t)=>{var r=o(),n=u();t.exports=function(e,t){var a,o=new r,s={},i=new n;function l(e){var r=e.v===a?e.w:e.v,n=i.priority(r);if(void 0!==n){var o=t(e);o<n&&(s[r]=a,i.decrease(r,o))}}if(0===e.nodeCount())return o;e.nodes().forEach(function(e){i.add(e,1/0),o.setNode(e)}),i.decrease(e.nodes()[0],0);for(var d=!1;i.size()>0;){if(Object.hasOwn(s,a=i.removeMin()))o.setEdge(a,s[a]);else{if(d)throw Error("Input graph is not connected: "+e);d=!0}e.nodeEdges(a).forEach(l)}return o}}),E=n((e,t)=>{var r=h(),n=d();t.exports=function(e,t,a,o){return function(e,t,a,o){if(void 0===a)return r(e,t,a,o);for(var s=!1,i=e.nodes(),l=0;l<i.length;l++){for(var d=o(i[l]),c=0;c<d.length;c++){var u=d[c],h=u.v===i[l]?u.v:u.w,p=h===u.v?u.w:u.v;0>a({v:h,w:p})&&(s=!0)}if(s)return n(e,t,a,o)}return r(e,t,a,o)}(e,t,a,o||function(t){return e.outEdges(t)})}}),C=n((e,t)=>{t.exports={bellmanFord:d(),components:c(),dijkstra:h(),dijkstraAll:p(),extractPath:f(),findCycles:m(),floydWarshall:x(),isAcyclic:y(),postorder:k(),preorder:j(),prim:N(),shortestPaths:E(),reduce:b(),tarjan:g(),topsort:v()}}),_=i();t.exports={Graph:_.Graph,json:l(),alg:C(),version:_.version}}),s=a((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(", ")+"]"}}}),i=a((e,t)=>{var r=o().Graph,n=s();t.exports=function(e,t){var o,s;let d,c,u,h,p;if(1>=e.nodeCount())return[];let f=(o=e,s=t||a,d=new r,c=0,u=0,o.nodes().forEach(e=>{d.setNode(e,{v:e,in:0,out:0})}),o.edges().forEach(e=>{let t=d.edge(e.v,e.w)||0,r=s(e);d.setEdge(e.v,e.w,t+r),u=Math.max(u,d.node(e.v).out+=r),c=Math.max(c,d.node(e.w).in+=r)}),h=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(u+c+3).map(()=>new n),p=c+1,d.nodes().forEach(e=>{l(h,p,d.node(e))}),{graph:d,buckets:h,zeroIdx:p});return(function(e,t,r){let n=[],a=t[t.length-1],o=t[0],s;for(;e.nodeCount();){for(;s=o.dequeue();)i(e,t,r,s);for(;s=a.dequeue();)i(e,t,r,s);if(e.nodeCount()){for(let a=t.length-2;a>0;--a)if(s=t[a].dequeue()){n=n.concat(i(e,t,r,s,!0));break}}}return n})(f.graph,f.buckets,f.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var a=()=>1;function i(e,t,r,n,a){let o=a?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),i=e.node(n.v);a&&o.push({v:n.v,w:n.w}),i.out-=s,l(t,r,i)}),e.outEdges(n.v).forEach(n=>{let a=e.edge(n),o=n.w,s=e.node(o);s.in-=a,l(t,r,s)}),e.removeNode(n.v),o}function l(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=a((e,t)=>{var r=o().Graph;function n(e,t,r,n){for(var a=n;e.hasNode(a);)a=l(n);return r.dummy=t,e.setNode(a,r),a}t.exports={addBorderNode:function(e,t,r,a){let o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=a),n(e,"border",o,t)},addDummyNode:n,applyWithChunking:a,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=d(s(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),a=n.rank;void 0!==a&&(t[a][n.order]=r)}),t},intersectRect:function(e,t){let r,n,a=e.x,o=e.y,s=t.x-a,i=t.y-o,l=e.width/2,d=e.height/2;if(!s&&!i)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(i)*l>Math.abs(s)*d?(i<0&&(d=-d),r=d*s/i,n=d):(s<0&&(l=-l),r=l,n=l*i/s),{x:a+r,y:o+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:s,normalizeRanks:function(e){let t=a(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:d,removeEmptyRanks:function(e){let t=a(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let a=e.node(n).rank-t;r[a]||(r[a]=[]),r[a].push(n)});let n=0,o=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%o!=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},a=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.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:l,zipObject:c};function a(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 a=e.slice(n,n+t);r.push(a)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function s(e){return a(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var i=0;function l(e){return e+""+ ++i}function d(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let a=[];for(let t=e;n(t);t+=r)a.push(t);return a}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),d=a((e,t)=>{var r=i(),n=l().uniqueId;t.exports={run:function(e){var t,a;let o,s,i;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(o=[],s={},i={},(a=e).nodes().forEach(function e(t){Object.hasOwn(i,t)||(i[t]=!0,s[t]=!0,a.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?o.push(t):e(t.w)}),delete s[t])}),o)).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)}})}}}),c=a((e,t)=>{var r=l();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,a,o,s=t.v,i=e.node(s).rank,l=t.w,d=e.node(l).rank,c=t.name,u=e.edge(t),h=u.labelRank;if(d!==i+1){for(e.removeEdge(t),o=0,++i;i<d;++o,++i)u.points=[],a={width:0,height:0,edgeLabel:u,edgeObj:t,rank:i},n=r.addDummyNode(e,"edge",a,"_d"),i===h&&(a.width=u.width,a.height=u.height,a.dummy="edge-label",a.labelpos=u.labelpos),e.setEdge(s,n,{weight:u.weight},c),0===o&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,l,{weight:u.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,a;for(e.setEdge(r.edgeObj,n);r.dummy;)a=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=a,r=e.node(t)})}}}),u=a((e,t)=>{var{applyWithChunking:r}=l();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(a){var o=e.node(a);if(Object.hasOwn(t,a))return o.rank;t[a]=!0;var s=r(Math.min,e.outEdges(a).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),o.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=a((e,t)=>{var r=o().Graph,n=u().slack;t.exports=function(e){var t,a,o,s,i=new r({directed:!1}),l=e.nodes()[0],d=e.nodeCount();for(i.setNode(l,{});t=i,a=e,t.nodes().forEach(function e(r){a.nodeEdges(r).forEach(o=>{var s=o.v,i=r===s?o.w:s;t.hasNode(i)||n(a,o)||(t.setNode(i,{}),t.setEdge(r,i,{}),e(i))})}),t.nodeCount()<d;)o=function(e,t){return t.edges().reduce((r,a)=>{let o=1/0;return e.hasNode(a.v)!==e.hasNode(a.w)&&(o=n(t,a)),o<r[0]?[o,a]:r},[1/0,null])[1]}(i,e),s=i.hasNode(o.v)?n(e,o):-n(e,o),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(i,e,s);return i}}),p=a((e,t)=>{var r=h(),n=u().slack,a=u().longestPath,s=o().alg.preorder,i=o().alg.postorder,d=l().simplify;function c(e){a(e=d(e));var t,n,o=r(e);for(g(o),p(o,e);t=m(o);)n=x(o,e,t),v(o,e,t,n)}function p(e,t){var r=i(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,a,o,s;return n=e,a=t,o=r,s=n.node(o).parent,void(n.edge(o,s).cutvalue=f(n,a,o))})}function f(e,t,r){var n=e.node(r).parent,a=!0,o=t.edge(r,n),s=0;return o||(a=!1,o=t.edge(n,r)),s=o.weight,t.nodeEdges(r).forEach(o=>{var i=o.v===r,l=i?o.w:o.v;if(l!==n){var d,c,u,h=i===a,p=t.edge(o).weight;if(s+=h?p:-p,d=e,c=r,u=l,d.hasEdge(c,u)){var f=e.edge(r,l).cutvalue;s+=h?-f:f}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,a,o){var s=n,i=t.node(a);return r[a]=!0,t.neighbors(a).forEach(o=>{Object.hasOwn(r,o)||(n=e(t,r,n,o,a))}),i.low=s,i.lim=n++,o?i.parent=o:delete i.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function x(e,t,r){var a=r.v,o=r.w;t.hasEdge(a,o)||(a=r.w,o=r.v);var s=e.node(a),i=e.node(o),l=s,d=!1;return s.lim>i.lim&&(l=i,d=!0),t.edges().filter(t=>d===y(e,e.node(t.v),l)&&d!==y(e,e.node(t.w),l)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function v(e,t,r,n){var a,o,i,l,d=r.v,c=r.w;e.removeEdge(d,c),e.setEdge(n.v,n.w,{}),g(e),p(e,t),a=e,o=t,i=a.nodes().find(e=>!o.node(e).parent),(l=(l=s(a,i)).slice(1)).forEach(e=>{var t=a.node(e).parent,r=o.edge(e,t),n=!1;r||(r=o.edge(t,e),n=!0),o.node(e).rank=o.node(t).rank+(n?r.minlen:-r.minlen)})}function y(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=p,c.calcCutValue=f,c.leaveEdge=m,c.enterEdge=x,c.exchangeEdges=v}),f=a((e,t)=>{var r=u().longestPath,n=h(),a=p();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:a(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":o(e);case"none":}};var o=r}),g=a((e,t)=>{t.exports=function(e){var t;let r,n,a=(r={},n=0,(t=e).children().forEach(function e(a){let o=n;t.children(a).forEach(e),r[a]={low:o,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,o=function(e,t,r,n){let a=[],o=[],s=Math.min(t[r].low,t[n].low),i=Math.max(t[r].lim,t[n].lim),l,d;l=r;do a.push(l=e.parent(l));while(l&&(t[l].low>s||i>t[l].lim))for(d=l,l=n;(l=e.parent(l))!==d;)o.push(l);return{path:a.concat(o.reverse()),lca:d}}(e,a,n.v,n.w),s=o.path,i=o.lca,l=0,d=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(d=s[l])!==i&&e.node(d).maxRank<r.rank;)l++;d===i&&(c=!1)}if(!c){for(;l<s.length-1&&e.node(d=s[l+1]).minRank<=r.rank;)l++;d=s[l]}e.setParent(t,d),t=e.successors(t)[0]}})}}),m=a((e,t)=>{var r=l();t.exports={run:function(e){var t,n,a;let o=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,a){var o=t.children(r);o&&o.length&&o.forEach(t=>e(t,a+1)),n[r]=a})(e,1)),n),i=Object.values(s),l=r.applyWithChunking(Math.max,i)-1,d=2*l+1;e.graph().nestingRoot=o,e.edges().forEach(t=>e.edge(t).minlen*=d);let c=(a=e).edges().reduce((e,t)=>e+a.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,a,o,s,i,l){let d=t.children(l);if(!d.length){l!==n&&t.setEdge(n,l,{weight:0,minlen:a});return}let c=r.addBorderNode(t,"_bt"),u=r.addBorderNode(t,"_bb"),h=t.node(l);t.setParent(c,l),h.borderTop=c,t.setParent(u,l),h.borderBottom=u,d.forEach(r=>{e(t,n,a,o,s,i,r);let d=t.node(r),h=d.borderTop?d.borderTop:r,p=d.borderBottom?d.borderBottom:r,f=d.borderTop?o:2*o,g=h!==p?1:s-i[l]+1;t.setEdge(c,h,{weight:f,minlen:g,nestingEdge:!0}),t.setEdge(p,u,{weight:f,minlen:g,nestingEdge:!0})}),t.parent(l)||t.setEdge(n,c,{weight:0,minlen:s+i[l]})})(e,o,d,c,l,s,t)),e.graph().nodeRankFactor=d},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)})}}}),x=a((e,t)=>{var r=l();function n(e,t,n,a,o,s){let i=o[t][s-1],l=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);o[t][s]=l,e.setParent(l,a),i&&e.setEdge(i,l,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let a=e.children(r),o=e.node(r);if(a.length&&a.forEach(t),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let t=o.minRank,a=o.maxRank+1;t<a;++t)n(e,"borderLeft","_bl",r,o,t),n(e,"borderRight","_br",r,o,t)}})}}),v=a((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 a(e){e.y=-e.y}function o(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=>a(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(a),Object.hasOwn(r,"y")&&a(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>o(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(o),Object.hasOwn(t,"x")&&o(t)}),r(e))}}}),y=a((e,t)=>{var r=l();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),a=n.map(t=>e.node(t).rank),o=r.applyWithChunking(Math.max,a),s=r.range(o+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}}),b=a((e,t)=>{var r=l().zipObject;t.exports=function(e,t){let n=0;for(let a=1;a<t.length;++a)n+=function(e,t,n){let a=r(n,n.map((e,t)=>t)),o=t.flatMap(t=>e.outEdges(t).map(t=>({pos:a[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let i=2*s-1;s-=1;let l=Array(i).fill(0),d=0;return o.forEach(e=>{let t=e.pos+s;l[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=l[t+1]),t=t-1>>1,l[t]+=e.weight;d+=e.weight*r}),d}(e,t[a-1],t[a]);return n}}),w=a((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),a=e.node(r.v);return{sum:t.sum+n.weight*a.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),k=a((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=a((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 a;let o=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=o.lhs,i=o.rhs.sort((e,t)=>t.i-e.i),l=[],d=0,c=0,u=0;s.sort((a=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:a?t.i-e.i:e.i-t.i)),u=n(l,i,u),s.forEach(e=>{u+=e.vs.length,l.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,u=n(l,i,u)});let h={vs:l.flat(!0)};return c&&(h.barycenter=d/c,h.weight=c),h}}),N=a((e,t)=>{var r=w(),n=k(),a=j();t.exports=function e(t,o,s,i){var l,d;let c=t.children(o),u=t.node(o),h=u?u.borderLeft:void 0,p=u?u.borderRight:void 0,f={};h&&(c=c.filter(e=>e!==h&&e!==p));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,a;let o=e(t,r.v,s,i);f[r.v]=o,Object.hasOwn(o,"barycenter")&&(n=r,a=o,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+a.barycenter*a.weight)/(n.weight+a.weight),n.weight+=a.weight):(n.barycenter=a.barycenter,n.weight=a.weight))}});let m=n(g,s);l=m,d=f,l.forEach(e=>{e.vs=e.vs.flatMap(e=>d[e]?d[e].vs:e)});let x=a(m,i);if(h&&(x.vs=[h,x.vs,p].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),r=t.node(t.predecessors(p)[0]);Object.hasOwn(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+e.order+r.order)/(x.weight+2),x.weight+=2}return x}}),E=a((e,t)=>{var r=o().Graph,n=l();t.exports=function(e,t,a,o){o||(o=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),i=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return o.forEach(r=>{let n=e.node(r),o=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(i.setNode(r),i.setParent(r,o||s),e[a](r).forEach(t=>{let n=t.v===r?t.w:t.v,a=i.edge(n,r),o=void 0!==a?a.weight:0;i.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(n,"minRank")&&i.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),i}}),C=a((e,t)=>{t.exports=function(e,t,r){let n={},a;r.forEach(r=>{let o=e.parent(r),s,i;for(;o;){if((s=e.parent(o))?(i=n[s],n[s]=o):(i=a,a=o),i&&i!==o)return void t.setEdge(i,o);o=s}})}}),_=a((e,t)=>{var r=y(),n=b(),a=N(),s=E(),i=C(),d=o().Graph,c=l();function u(e,t,r){let n=new Map,a=(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&&a(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&a(e,t)}return t.map(function(t){return s(e,t,r,n.get(t)||[])})}function h(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,o={}){if("function"==typeof o.customOrder)return void o.customOrder(t,e);let s=c.maxRank(t),l=u(t,c.range(1,s+1),"inEdges"),p=u(t,c.range(s-1,-1,-1),"outEdges"),f=r(t);if(h(t,f),o.disableOptimalOrderHeuristic)return;let g=1/0,m,x=o.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 o=e.graph().root,s=a(e,o,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),i(e,n,s.vs)})})(e%2?l:p,e%4>=2,x),f=c.buildLayerMatrix(t);let o=n(t,f);o<g?(r=0,m=Object.assign({},f),g=o):o===g&&(m=structuredClone(f))}h(t,m)}}),S=a((e,t)=>{var r=o().Graph,n=l();function a(e,t){let r={};return t.length&&t.reduce(function(t,n){let a=0,o=0,s=t.length,l=n[n.length-1];return n.forEach((t,d)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),u=c?e.node(c).order:s;(c||t===l)&&(n.slice(o,d+1).forEach(t=>{e.predecessors(t).forEach(n=>{let o=e.node(n),s=o.order;(s<a||u<s)&&!(o.dummy&&e.node(t).dummy)&&i(r,n,t)})}),o=d+1,a=u)}),n}),r}function s(e,t){let r={};function a(t,a,o,s,l){let d;n.range(a,o).forEach(n=>{d=t[n],e.node(d).dummy&&e.predecessors(d).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>l)&&i(r,t,d)})})}return t.length&&t.reduce(function(t,r){let n=-1,o,s=0;return r.forEach((i,l)=>{if("border"===e.node(i).dummy){let t=e.predecessors(i);t.length&&(o=e.node(t[0]).order,a(r,s,l,n,o),s=l,n=o)}a(r,s,r.length,o,t.length)}),r}),r}function i(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 a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let i=n(e);if(i.length){let n=((i=i.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=i[l];o[e]===e&&t<s[n]&&!d(r,e,n)&&(o[n]=e,o[e]=a[e]=a[n],t=s[n])}}})}),{root:a,align:o}}function u(e,t,n,a,o){var s,i,l,d,c,u,h;let p,f,g,m={},x=(s=e,i=t,l=n,d=o,p=new r,g=(c=(f=s.graph()).nodesep,u=f.edgesep,h=d,(e,t,r)=>{let n=e.node(t),a=e.node(r),o,s;if(o=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&&(o+=h?s:-s),s=0,o+=(n.dummy?u:c)/2,o+=(a.dummy?u:c)/2,o+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=a.width/2;break;case"r":s=-a.width/2}return s&&(o+=h?s:-s),s=0,o}),i.forEach(e=>{let t;e.forEach(e=>{let r=l[e];if(p.setNode(r),t){var n=l[t],a=p.edge(n,r);p.setEdge(n,r,Math.max(g(s,e,t),a||0))}t=e})}),p),v=o?"borderLeft":"borderRight";function y(e,t){let r=x.nodes().slice(),n={},a=r.pop();for(;a;){if(n[a])e(a);else for(let e of(n[a]=!0,r.push(a),t(a)))r.push(e);a=r.pop()}}return y(function(e){m[e]=x.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+x.edge(t)),0)},x.predecessors.bind(x)),y(function(t){let r=x.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-x.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==v&&(m[t]=Math.max(m[t],r))},x.successors.bind(x)),Object.keys(a).forEach(e=>m[e]=m[n[e]]),m}function h(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,a=1/0;Object.entries(r).forEach(([t,r])=>{var o,s;let i=(o=e,s=t,o.node(s).width/2);n=Math.max(r+i,n),a=Math.min(r-i,a)});let o=n-a;return o<t[0]&&(t=[o,r]),t},[1/0,null])[1]}function p(e,t){let r=Object.values(t),a=n.applyWithChunking(Math.min,r),o=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let i=r+s,l=e[i];if(l===t)return;let d=Object.values(l),c=a-n.applyWithChunking(Math.min,d);"l"!==s&&(c=o-n.applyWithChunking(Math.max,d)),c&&(e[i]=n.mapValues(l,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(a(e,t),s(e,t)),o={},i;["u","d"].forEach(a=>{i="u"===a?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(i=i.map(e=>Object.values(e).reverse()));let s=("u"===a?e.predecessors:e.successors).bind(e),l=c(e,i,r,s),d=u(e,i,l.root,l.align,"r"===t);"r"===t&&(d=n.mapValues(d,e=>-e)),o[a+t]=d})});let l=h(e,o);return p(o,l),f(o,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:i,hasConflict:d,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:p,findSmallestWidthAlignment:h,balance:f}}),M=a((e,t)=>{var r=l(),n=S().positionX;t.exports=function(e){var t;let a,o,s,i;t=e=r.asNonCompoundGraph(e),a=r.buildLayerMatrix(t),o=t.graph().ranksep,s=t.graph().rankalign,i=0,a.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=i+n.height/2:"bottom"===s?n.y=i+r-n.height/2:n.y=i+r/2}),i+=r+o}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),R=a((e,t)=>{var r=d(),n=c(),a=f(),s=l().normalizeRanks,i=g(),u=l().removeEmptyRanks,h=m(),p=x(),y=v(),b=_(),w=M(),k=l(),j=o().Graph;t.exports=function(e,t={}){let o=t.debugTiming?k.time:k.notime;return o("layout",()=>{let l=o(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new j({multigraph:!0,compound:!0}),n=L(t.graph()),r.setGraph(Object.assign({},E,F(n,N),k.pick(n,C))),t.nodes().forEach(e=>{let n=F(L(t.node(e)),S);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=L(t.edge(e));r.setEdge(e,Object.assign({},P,F(n,O),k.pick(n,T)))}),r});return o(" runLayout",()=>{var e,d,c;return e=l,d=o,c=t,void(d(" 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)}))}),d(" 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)}})}),d(" acyclic",()=>r.run(e)),d(" nestingGraph.run",()=>h.run(e)),d(" rank",()=>a(k.asNonCompoundGraph(e))),d(" 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};k.addDummyNode(t,"edge-proxy",n,"_ep")}})}),d(" removeEmptyRanks",()=>u(e)),d(" nestingGraph.cleanup",()=>h.cleanup(e)),d(" normalizeRanks",()=>s(e)),d(" 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)}),d(" 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))})}),d(" normalize.run",()=>n.run(e)),d(" parentDummyChains",()=>i(e)),d(" addBorderSegments",()=>p(e)),d(" order",()=>b(e,c)),d(" insertSelfEdges",()=>{var t;return t=e,void k.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var a=t.node(e);a.order=n+r,(a.selfEdges||[]).forEach(e=>{k.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:a.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete a.selfEdges})})}),d(" adjustCoordinateSystem",()=>y.adjust(e)),d(" position",()=>w(e)),d(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),a=n.x+n.width/2,o=n.y,s=r.x-a,i=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:a+2*s/3,y:o-i},{x:a+5*s/6,y:o-i},{x:a+s,y:o},{x:a+5*s/6,y:o+i},{x:a+2*s/3,y:o+i}],r.label.x=r.x,r.label.y=r.y}})}),d(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),a=t.node(r.borderBottom),o=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-o.x),r.height=Math.abs(a.y-n.y),r.x=o.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),d(" normalize.undo",()=>n.undo(e)),d(" 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}})}),d(" undoCoordinateSystem",()=>y.undo(e)),d(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,a=0,o=e.graph(),s=o.marginx||0,i=o.marginy||0;function l(e){let o=e.x,s=e.y,i=e.width,l=e.height;t=Math.min(t,o-i/2),r=Math.max(r,o+i/2),n=Math.min(n,s-l/2),a=Math.max(a,s+l/2)}e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&l(r)}),t-=s,n-=i,e.nodes().forEach(r=>{let a=e.node(r);a.x-=t,a.y-=n}),e.edges().forEach(r=>{let a=e.edge(r);a.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(a,"x")&&(a.x-=t),Object.hasOwn(a,"y")&&(a.y-=n)}),o.width=r-t+s,o.height=a-n+i})(e)),d(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),a=t.node(e.w),o,s;r.points?(o=r.points[0],s=r.points[r.points.length-1]):(r.points=[],o=a,s=n),r.points.unshift(k.intersectRect(n,o)),r.points.push(k.intersectRect(a,s))})}),d(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),d(" acyclic.undo",()=>r.undo(e)))}),o(" updateInputGraph",()=>{var t,r;return t=e,r=l,void(t.nodes().forEach(e=>{let n=t.node(e),a=r.node(e);n&&(n.x=a.x,n.y=a.y,n.order=a.order,n.rank=a.rank,r.children(e).length&&(n.width=a.width,n.height=a.height))}),t.edges().forEach(e=>{let n=t.edge(e),a=r.edge(e);n.points=a.points,Object.hasOwn(a,"x")&&(n.x=a.x,n.y=a.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),l})};var N=["nodesep","edgesep","ranksep","marginx","marginy"],E={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],S=["width","height","rank"],R={width:0,height:0},O=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function F(e,t){return k.mapValues(k.pick(e,t),Number)}function L(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),O=a((e,t)=>{var r=l(),n=o().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),a=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{a.setNode(t,{label:t}),a.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>a.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{a.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(a.setEdge(e,t,{style:"invis"}),t))}),a}}}),P=a((e,t)=>{t.exports="2.0.4"});let T=a((e,t)=>{t.exports={graphlib:o(),layout:R(),debug:O(),util:{time:l().time,notime:l().notime},version:P()}})(),F={direction:"LR",ranksep:200,nodesep:30};function L(e="ltr"){return{...F,direction:"rtl"===e?"RL":"LR"}}let A={featureNode:{width:388,height:140},repositoryNode:{width:400,height:140}};function D(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:A[e.type??""]??t}function I(e,t,r={}){let{direction:n="TB",nodeSize:a={width:172,height:36},ranksep:o=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let i=new T.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:n,ranksep:o,nodesep:s});let l=new Set;for(let e of t)l.add(e.source),l.add(e.target);let d=e.filter(e=>l.has(e.id)),c=e.filter(e=>!l.has(e.id));for(let e of d){let t=D(e,a);i.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)i.hasNode(e.source)&&i.hasNode(e.target)&&i.setEdge(e.source,e.target,{},e.id);T.layout(i);let{targetPosition:u,sourcePosition:h}=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="LR"===n||"RL"===n,f=new Map;for(let e of d){let t=i.node(e.id),r=D(e,a);f.set(e.id,{cx:t.x,cy:t.y,w:r.width,h:r.height})}let g=0;for(let e of f.values()){g=p?e.cx:e.cy;break}for(let e of c){let t=D(e,a);f.set(e.id,{cx:p?g:0,cy:p?0:g,w:t.width,h:t.height})}let m=new Map;for(let e of t)f.has(e.source)&&f.has(e.target)&&(m.has(e.source)||m.set(e.source,[]),m.get(e.source).push(e.target));let x=new Map;for(let t=0;t<e.length;t++)x.set(e[t].id,t);for(let[,e]of m)e.sort((e,t)=>(x.get(e)??0)-(x.get(t)??0));let v=new Set;for(let e of m.values())for(let t of e)v.add(t);let y=[...[...l].filter(e=>f.has(e)&&!v.has(e)),...c.map(e=>e.id)];y.sort((e,t)=>(x.get(e)??0)-(x.get(t)??0));let b=new Map;for(let e of y)!function e(t){if(b.has(t))return b.get(t);let r=f.get(t),n=p?r.h:r.w,a=m.get(t);if(!a||0===a.length)return b.set(t,n),n;let o=0;for(let t of a)o+=e(t);let i=Math.max(n,o+=(a.length-1)*s);return b.set(t,i),i}(e);let w=0;for(let e of y){let t=b.get(e)??0;!function e(t,r){let n=f.get(t);p?n.cy=r:n.cx=r;let a=m.get(t);if(!a||0===a.length)return;let o=0;for(let e of a)o+=b.get(e)??0;let i=r-(o+=(a.length-1)*s)/2;for(let t of a){let r=b.get(t)??0;e(t,i+r/2),i+=r+s}}(e,w+t/2),w+=t+s}let k=[];for(let t of e){let e=f.get(t.id);e&&k.push({...t,targetPosition:u,sourcePosition:h,position:{x:e.cx-e.w/2,y:e.cy-e.h/2}})}return{nodes:k,edges:[...t]}}var $=e.i(21023);let z=(0,$.createServerReference)("4095be3ecb7a64a2c609df38029cfa4cb56db0aa35",$.callServer,void 0,$.findSourceMapURL,"archiveFeature"),B=(0,$.createServerReference)("78f7965f0ecd56ad66cf9d316810d87c301e2336b3",$.callServer,void 0,$.findSourceMapURL,"deleteFeature");var G=e.i(49764),U=e.i(54164);let q=(0,$.createServerReference)("4066e26d358edaf45f4e7409a15328f8d03a42bc03",$.callServer,void 0,$.findSourceMapURL,"stopFeature"),W=(0,$.createServerReference)("403895d64354e1e407ae20ef500d42d0be9e55edaa",$.callServer,void 0,$.findSourceMapURL,"unarchiveFeature");var V=e.i(19338);let H=(0,$.createServerReference)("40a4032c5475e0d3276c532abab0c99592dad084ba",$.callServer,void 0,$.findSourceMapURL,"deleteRepository"),X=(0,$.createServerReference)("405c420f1a36bc2d746c0f845eabb59e4021635b6c",$.callServer,void 0,$.findSourceMapURL,"getFeatureMetadata");var J=e.i(39443),K=e.i(8361),Y=e.i(18354),Q=e.i(99045);e.i(41001);var Z=e.i(64780);function ee(e,t){let r=new Map;for(let e of t)"dependencyEdge"===e.type&&r.set(e.target,e.source);let n=new Map,a=new Map;for(let t of e)"featureNode"===t.type?n.set(t.id,{nodeId:t.id,data:t.data,parentNodeId:r.get(t.id)}):"repositoryNode"===t.type&&a.set(t.id,{nodeId:t.id,data:t.data});return{featureMap:n,repoMap:a}}function et(e,t){return(void 0===t.state||t.state===e.state)&&(void 0===t.lifecycle||t.lifecycle===e.lifecycle)&&(void 0===t.name||t.name===e.name)&&(void 0===t.description||t.description===e.description)}function er(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||n.parentNodeId!==e.parentNodeId||n.data!==e.data&&JSON.stringify(n.data)!==JSON.stringify(e.data))return!1}return!0}let en=(0,Y.createLogger)("[Polling]"),ea=0,eo=0;function es(e,a){let o=(0,r.useRouter)(),s=(0,K.useSoundAction)("delete"),i=(0,K.useSoundAction)("create"),[l,d]=(0,t.useState)(!1),{nodes:c,edges:u,reconcile:h,updateFeature:p,addPendingFeature:f,removeFeature:g,restoreFeature:m,addRepository:x,removeRepository:v,replaceRepository:y,getFeatureRepositoryPath:b,getRepositoryData:w,getRepoMapSize:k,setCallbacks:j,beginMutation:N,endMutation:E,isMutating:C}=function(e,r,n=!1){let{i18n:a}=(0,Z.useTranslation)(),o=(0,t.useMemo)(()=>L(a.dir()),[a]),s=(0,t.useMemo)(()=>ee(e,r),[]),[i,l]=(0,t.useState)(s.featureMap),[d,c]=(0,t.useState)(s.repoMap),[u,h]=(0,t.useState)(new Map),p=(0,t.useRef)(new Map),f=(0,t.useRef)(new Set),g=(0,t.useRef)(0),m=(0,t.useRef)(new Set),x=(0,t.useRef)(new Set),v=(0,t.useRef)({}),y=(0,t.useMemo)(()=>({onNodeAction:e=>v.current.onNodeAction?.(e),onNodeSettings:e=>v.current.onNodeSettings?.(e),onFeatureDelete:(e,t,r,n)=>v.current.onFeatureDelete?.(e,t,r,n),onRepositoryAdd:e=>v.current.onRepositoryAdd?.(e),onRepositoryClick:e=>v.current.onRepositoryClick?.(e),onRepositoryDelete:e=>v.current.onRepositoryDelete?.(e),onRetryFeature:e=>v.current.onRetryFeature?.(e),onStartFeature:e=>v.current.onStartFeature?.(e),onArchiveFeature:e=>v.current.onArchiveFeature?.(e),onUnarchiveFeature:e=>v.current.onUnarchiveFeature?.(e)}),[]),b=(0,t.useRef)(i);b.current=i;let w=(0,t.useRef)(d);w.current=d;let k=(0,t.useMemo)(()=>{if(n)return i;let e=new Map;for(let[t,r]of i)"archived"!==r.data.state&&e.set(t,r);return e.size===i.size?i:e},[i,n]),j=(0,t.useMemo)(()=>(function(e,t,r,n){let a=[],o=[],s=e=>e.replace(/\\/g,"/"),i=new Map;for(let[e,r]of t)r.data.repositoryPath&&i.set(s(r.data.repositoryPath),e);let l=new Map;for(let[e,r]of[...t.entries()].sort((e,t)=>{let r=e[1].data.createdAt,n=t[1].data.createdAt;return("number"!=typeof r||Number.isNaN(r)?1/0:r)-("number"!=typeof n||Number.isNaN(n)?1/0:n)})){let t={...r.data,...n?.onRepositoryAdd&&{onAdd:()=>n.onRepositoryAdd(e)},...n?.onRepositoryClick&&{onClick:()=>n.onRepositoryClick(e)},...n?.onRepositoryDelete&&{onDelete:n.onRepositoryDelete}};a.push({id:e,type:"repositoryNode",position:{x:0,y:0},data:t})}for(let[t,d,c]of[...[...e.entries()].map(([e,t])=>[e,t,!1]),...[...r.entries()].filter(([t])=>!e.has(t)).map(([e,t])=>[e,t,!0])]){let u="creating"===d.data.state||c,h={...d.data,...!u&&n?.onNodeAction&&{onAction:()=>n.onNodeAction(t)},...!u&&n?.onNodeSettings&&{onSettings:()=>n.onNodeSettings(t)},...!u&&n?.onFeatureDelete&&{onDelete:n.onFeatureDelete},...!u&&"error"===d.data.state&&n?.onRetryFeature&&{onRetry:n.onRetryFeature},...!u&&"pending"===d.data.state&&n?.onStartFeature&&{onStart:n.onStartFeature},...!u&&("running"===d.data.state||"action-required"===d.data.state)&&n?.onStopFeature&&{onStop:n.onStopFeature},...!u&&"archived"!==d.data.state&&"deleting"!==d.data.state&&n?.onArchiveFeature&&{onArchive:n.onArchiveFeature},...!u&&"archived"===d.data.state&&n?.onUnarchiveFeature&&{onUnarchive:n.onUnarchiveFeature}};if(a.push({id:t,type:"featureNode",position:{x:0,y:0},data:h}),d.parentNodeId&&(e.has(d.parentNodeId)||r.has(d.parentNodeId)))o.push({id:`dep-${d.parentNodeId}-${t}`,source:d.parentNodeId,target:t,type:"dependencyEdge"});else{let e=s(d.data.repositoryPath),r=i.get(e)??function(e){if(l.has(e))return l.get(e);let t=`virtual-repo-${e}`,r=e.split("/").filter(Boolean).at(-1)??e;return a.push({id:t,type:"repositoryNode",position:{x:0,y:0},data:{name:r,repositoryPath:e}}),l.set(e,t),t}(e);o.push({id:`edge-${r}-${t}`,source:r,target:t,style:{strokeDasharray:"5 5"}})}}let d=new Set;for(let e of o)"dependencyEdge"===e.type&&d.add(e.source);let c=o.length>0;for(let e of a){let t=e.data;t.showHandles=c,"featureNode"===e.type&&(t.hasChildren=d.has(e.id))}return{nodes:a,edges:o}})(k,d,u,y),[k,d,u,y]),N=(0,t.useRef)({key:"",positions:new Map}),{nodes:E,edges:C}=(0,t.useMemo)(()=>{let e=j.nodes.map(e=>e.id).sort().join(","),t=j.edges.map(e=>`${e.source}-${e.target}`).sort().join(","),r=`${e}|${t}|${o.direction}`;if(r!==N.current.key){let e=I(j.nodes,j.edges,o),t=new Map;for(let r of e.nodes)t.set(r.id,{position:r.position,targetPosition:r.targetPosition,sourcePosition:r.sourcePosition});let n=N.current.positions;if(n.size>0){let r=0,a=0;for(let[e,o]of t){let t=n.get(e);if(t){r=t.position.x-o.position.x,a=t.position.y-o.position.y;break}}if(0!==r||0!==a){for(let e of t.values())e.position={x:e.position.x+r,y:e.position.y+a};for(let t of e.nodes)t.position={x:t.position.x+r,y:t.position.y+a}}}return N.current={key:r,positions:t},e}let{positions:n}=N.current;return{nodes:j.nodes.map(e=>{let t=n.get(e.id);return t?{...e,...t}:e}),edges:j.edges}},[j,o]),_=(0,t.useCallback)((e,t)=>{if(g.current>0)return;let{featureMap:r,repoMap:n}=ee(e,t),a=new Set([...r.values()].map(e=>`${e.data.name}\0${e.data.repositoryPath}`));l(e=>{let t=[...e.entries()].filter(([,e])=>"creating"===e.data.state),n=new Map(r);for(let[e,r]of t){let t=`${r.data.name}\0${r.data.repositoryPath}`;a.has(t)||n.set(e,r)}let o=new Set;for(let[t,r]of e)"deleting"===r.data.state&&(n.has(t)?n.set(t,{...n.get(t),data:{...n.get(t).data,state:"deleting"}}):x.current.has(t)||(n.set(t,r),o.add(t)));for(let[e,t]of(x.current=o,p.current)){let r=n.get(e);r&&(n.set(e,{...r,data:{...r.data,...t}}),p.current.delete(e))}return er(e,n)?e:n}),h(e=>{if(0===e.size)return e;let t=!1,r=new Map(e);for(let[n,o]of e){let e=`${o.data.name}\0${o.data.repositoryPath}`;a.has(e)&&(r.delete(n),t=!0)}return t?r:e}),c(e=>{let t=new Map(n),r=new Set([...n.values()].map(e=>e.data.repositoryPath));for(let[n,a]of e){if(t.has(n)||r.has(a.data.repositoryPath)){f.current.delete(n);continue}(n.startsWith("repo-temp-")||f.current.has(n))&&t.set(n,a)}return er(e,t)?e:t})},[]),S=(0,t.useCallback)((e,t)=>{l(r=>{let n=r.get(e);if(!n)return p.current.set(e,{...p.current.get(e),...t}),r;if(p.current.delete(e),et(n.data,t))return r;let a=new Map(r);return a.set(e,{...n,data:{...n.data,...t}}),a}),h(r=>{let n=r.get(e);if(!n||et(n.data,t))return r;let a=new Map(r);return a.set(e,{...n,data:{...n.data,...t}}),a})},[]),M=(0,t.useCallback)((e,t,r)=>{h(n=>{let a=new Map(n);return a.set(e,{nodeId:e,data:t,parentNodeId:r}),a})},[]),R=(0,t.useCallback)(e=>{h(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),O=(0,t.useCallback)(e=>{l(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),P=(0,t.useCallback)((e,t)=>{l(r=>{let n=new Map(r);return n.set(e,t),n})},[]),T=(0,t.useCallback)((e,t)=>{f.current.add(e),c(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),F=(0,t.useCallback)(e=>{f.current.delete(e),c(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),A=(0,t.useCallback)((e,t,r)=>{f.current.delete(e),f.current.add(t),c(n=>{if(!n.has(e))return n;let a=new Map(n);return a.delete(e),a.set(t,{nodeId:t,data:r}),a})},[]),D=(0,t.useCallback)(e=>b.current.get(e)?.data.repositoryPath,[]),$=(0,t.useCallback)(e=>w.current.get(e)?.data,[]),z=(0,t.useCallback)(()=>w.current.size,[]),B=(0,t.useCallback)(e=>{v.current=e},[]),G=(0,t.useCallback)(()=>{g.current++},[]),U=(0,t.useCallback)((e=3e3)=>{let t=setTimeout(()=>{g.current=Math.max(0,g.current-1),m.current.delete(t)},e);m.current.add(t)},[]),q=(0,t.useCallback)(()=>g.current>0,[]);return(0,t.useEffect)(()=>{let e=m.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]),{nodes:E,edges:C,reconcile:_,updateFeature:S,addPendingFeature:M,removePendingFeature:R,removeFeature:O,restoreFeature:P,addRepository:T,removeRepository:F,replaceRepository:A,getFeatureRepositoryPath:D,getRepositoryData:$,getRepoMapSize:z,setCallbacks:B,beginMutation:G,endMutation:U,isMutating:q}}(e,a,l),_=(0,t.useRef)(c),S=(0,t.useRef)(u);(0,t.useEffect)(()=>{_.current=c,S.current=u},[c,u]);let M=(0,t.useMemo)(()=>e.map(e=>e.id).sort().join(","),[e]),R=(0,t.useMemo)(()=>e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(","),[e]),O=(0,t.useRef)("");(0,t.useEffect)(()=>{let t=`${M}|${R}`;t!==O.current&&(O.current=t,h(e,a))},[M,R,e,a,h]);let P=(0,t.useRef)(new Map),{events:T}=(0,J.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=P.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,a=t.get(r.id);void 0!==a&&a!==e.state&&(T.some(t=>t.featureId===e.featureId&&(0,Q.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:()=>o.push(`/feature/${e.featureId}`)}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[R,e,T,o]);let F=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(F.current>T.length&&(F.current=0),T.length<=F.current)return;let e=T.slice(F.current);for(let{featureId:t,state:r,lifecycle:n}of(F.current=T.length,(0,Q.resolveSseEventUpdates)(e)))if(void 0!==r||void 0!==n){let e=`feat-${t}`,a=_.current.find(t=>t.id===e),o=a?a.data.state:void 0;if("deleting"===o||"error"===r&&C()&&"running"===o)continue;p(e,{...void 0!==r&&{state:r},...void 0!==n&&{lifecycle:n}})}},[T,p,C]),(0,t.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;N(),p(`feat-${t}`,{state:"running"}),E()};return window.addEventListener("shep:feature-approved",e),()=>window.removeEventListener("shep:feature-approved",e)},[p,N,E]);let A=(0,t.useRef)(new Set),D=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(D.current>T.length&&(D.current=0),T.length<=D.current)return;let e=T.slice(D.current);for(let t of(D.current=T.length,e)){if("Feature metadata updated"!==t.message||A.current.has(t.featureId))continue;A.current.add(t.featureId);let e=`feat-${t.featureId}`;X(t.featureId).then(t=>{t&&p(e,{name:t.name,description:t.description})}).catch(()=>{})}},[T,p]),(0,t.useEffect)(()=>{en.debug("polling enabled (15000ms interval)");let e=setInterval(async()=>{if(!document.hidden&&!C())try{let e=await fetch("/api/graph-data");if(!e.ok)throw Error(`status ${e.status}`);let{nodes:t,edges:r}=await e.json();h(t,r)}catch{en.warn("poll fetch failed — will retry next interval")}},15e3);return()=>{en.debug("polling disabled"),clearInterval(e)}},[h,C]);let $=(0,t.useCallback)(e=>{},[]),Y=(0,t.useCallback)(e=>{},[]),es=(0,t.useCallback)((e,t,r)=>{let n=t?.featureId?`feat-${t.featureId}`:`feature-${Date.now()}-${ea++}`,a={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:t?.featureId??`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return f(n,a,"dependencyEdge"===r&&e?e:void 0),n},[f]),ei=(0,t.useCallback)(e=>{let t=`feat-${e}`;N(),p(t,{state:"running"}),(0,G.resumeFeature)(e).then(e=>{e.error?(p(t,{state:"error"}),n.toast.error(e.error)):n.toast.success("Feature resumed")}).catch(()=>{p(t,{state:"error"}),n.toast.error("Failed to resume feature")}).finally(()=>E())},[p,N,E]),el=(0,t.useCallback)(e=>{let t=`feat-${e}`;N(),p(t,{state:"running"}),(0,U.startFeature)(e).then(e=>{e.error?(p(t,{state:"pending"}),n.toast.error(e.error)):n.toast.success("Feature started")}).catch(()=>{p(t,{state:"pending"}),n.toast.error("Failed to start feature")}).finally(()=>E())},[p,N,E]),ed=(0,t.useCallback)(e=>{N(),q(e).then(e=>{e.error?n.toast.error(e.error):n.toast.success("Agent stopped")}).catch(()=>{n.toast.error("Failed to stop agent")}).finally(()=>E())},[N,E]),ec=(0,t.useCallback)(e=>{let t=`feat-${e}`;N(),p(t,{state:"archived"}),z(e).then(e=>{e.error?(p(t,{state:"done"}),n.toast.error(e.error)):n.toast.success("Feature archived")}).catch(()=>{p(t,{state:"done"}),n.toast.error("Failed to archive feature")}).finally(()=>E())},[p,N,E]),eu=(0,t.useCallback)(e=>{let t=`feat-${e}`;N(),p(t,{state:"done"}),W(e).then(e=>{e.error?(p(t,{state:"archived"}),n.toast.error(e.error)):n.toast.success("Feature unarchived")}).catch(()=>{p(t,{state:"archived"}),n.toast.error("Failed to unarchive feature")}).finally(()=>E())},[p,N,E]),eh=(0,t.useCallback)((e,t,r,a)=>{let i=`feat-${e}`,l=[];if(!0===r){let e=[i];for(;e.length>0;){let t=e.shift();for(let r of S.current)"dependencyEdge"===r.type&&r.source===t&&(l.push(r.target),e.push(r.target))}}let d=new Map;for(let e of[i,...l]){let t=_.current.find(t=>t.id===e);t&&d.set(e,t.data.state)}for(let e of(N(),p(i,{state:"deleting"}),l))p(e,{state:"deleting"});s.play(),o.push("/"),B(e,t,r,a).then(e=>{if(e.error){for(let[e,t]of d)t&&p(e,{state:t});n.toast.error(e.error)}else for(let e of(g(i),l))g(e)}).catch(()=>{for(let[e,t]of d)t&&p(e,{state:t});n.toast.error("Failed to delete feature")}).finally(()=>E())},[o,s,p,g,N,E]),ep=(0,t.useCallback)(async e=>{let t=`repo-${e}`,r=new Set(S.current.filter(e=>e.source===t).map(e=>e.target)),a=w(t),o=new Map;for(let e of r){let t=_.current.find(t=>t.id===e);t&&o.set(e,{nodeId:e,data:t.data})}let i=()=>{for(let[e,r]of(a&&x(t,a),o))m(e,r)};for(let e of(N(),v(t),r))g(e);try{let t=await H(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),i();return}s.play()}catch{n.toast.error("Failed to remove repository"),i()}finally{E()}},[s,v,g,x,m,w,N,E]),ef=(0,t.useCallback)(e=>{let t=I(_.current,S.current,{...L(),direction:e});h(t.nodes,t.edges)},[h]);return{nodes:c,edges:u,onNodesChange:$,handleConnect:Y,handleAddRepository:(0,t.useCallback)(e=>{let t=0===k(),r=`repo-temp-${++eo}`,a=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e;return N(),x(r,{name:a,repositoryPath:e,id:r,createdAt:Date.now(),gitInfoStatus:"loading"}),(0,V.addRepository)({path:e,name:a}).then(e=>{if(e.error){v(r),n.toast.error(e.error);return}let t=e.repository;y(r,`repo-${t.id}`,{name:t.name,repositoryPath:t.path,id:t.id,createdAt:t.createdAt instanceof Date?t.createdAt.getTime():Number(t.createdAt)}),i.play()}).catch(()=>{v(r),n.toast.error("Failed to add repository")}).finally(()=>E()),{wasEmpty:t,repoPath:e}},[x,v,y,i,k,N,E]),handleArchiveFeature:ec,handleLayout:ef,handleDeleteFeature:eh,handleRetryFeature:ei,handleStartFeature:el,handleStopFeature:ed,handleUnarchiveFeature:eu,handleDeleteRepository:ep,createFeatureNode:es,showArchived:l,setShowArchived:d,getFeatureRepositoryPath:b,getRepositoryData:w,setCallbacks:j}}e.s(["useControlCenterState",()=>es],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(92786),a=e.i(79054),o=e.i(31406),s=e.i(53756),i=e.i(91925),l=e.i(3645);let d=(0,l.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 c=e.i(49228),u=e.i(3214);e.i(41001);var h=e.i(64780),p=e.i(31777),f=e.i(35364);e.i(54793);var g=e.i(7729);e.i(47506);var m=e.i(89313),x=e.i(92002),v=e.i(8986),y=e.i(38573),b=e.i(19933),w=e.i(67669),k=e.i(24042),j=e.i(6910),N=e.i(48923),E=e.i(7311),C=e.i(94365),_=e.i(38227),S=e.i(48109);e.i(81803);var M=e.i(72714),R=e.i(2287),O=e.i(2828),P=e.i(8537),T=e.i(75921),F=e.i(76852),L=e.i(57779),A=e.i(80554),D=e.i(80519);function I({data:e,selected:n}){let{t:s,i18n:i}=(0,h.useTranslation)("web"),l=(0,o.useRouter)(),g="rtl"===i.dir(),m=g?x.Position.Right:x.Position.Left,I=g?x.Position.Left:x.Position.Right,$=(0,T.useFeatureFlags)(),[z,B]=(0,a.useState)(!1),G=e.id?`repo-${e.id}`:`repo-${e.name}`,U=(0,A.useTurnStatus)(G),q=(0,F.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),W=(0,P.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),V="Booting"===W.status||"Ready"===W.status,H=(0,a.useCallback)((t,r)=>{if(!e.repositoryPath)return;let n=t.preview?t.preview.slice(0,200):"Unknown conversation",a=["Continue work from a previous agent session.","","## Session Context",`- Session ID: ${t.id}`,`- Messages: ${t.messageCount}`,t.lastMessageAt?`- Last active: ${t.lastMessageAt}`:"",`- Conversation file: ${r}`,"","## Session Preview",`> ${n}`,"","## Instructions","1. Read the full conversation history from the file above",`2. Analyze the current state of the repository — what was done, what remains`,"3. Create or update spec files to accurately reflect the current state and remaining work","4. Continue implementing any unfinished work from the conversation"].filter(Boolean).join("\n"),o=new URLSearchParams({repo:e.repositoryPath,prompt:a});l.push(`/create?${o.toString()}`)},[e.repositoryPath,l]);return(0,t.jsxs)("div",{className:(0,p.cn)("group relative",e.onDelete&&e.id&&"ps-10"),style:{direction:g?"rtl":"ltr"},children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:m,isConnectable:!1,className:"opacity-0!",style:{top:70}}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute -start-3 top-1/2 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":s("repositoryNode.removeRepository"),"data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),B(!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)(w.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(O.TooltipContent,{children:s("repositoryNode.removeRepository")})]})})}),(0,t.jsx)(R.Dialog,{open:z,onOpenChange:B,children:(0,t.jsxs)(R.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(R.DialogHeader,{children:[(0,t.jsx)(R.DialogTitle,{children:s("repositoryNode.removeConfirmTitle")}),(0,t.jsx)(R.DialogDescription,{children:s("repositoryNode.removeConfirmDescription",{name:e.name})})]}),(0,t.jsxs)(R.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(R.DialogClose,{asChild:!0,children:(0,t.jsx)(f.Button,{variant:"outline",children:s("repositoryNode.cancel")})}),(0,t.jsx)(f.Button,{variant:"destructive",onClick:()=>{B(!1),e.onDelete?.(e.id)},children:s("repositoryNode.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:(0,p.cn)("nodrag bg-card flex w-[26rem] cursor-pointer flex-col overflow-hidden rounded-xl border shadow-sm transition-[border-color,box-shadow] duration-200 dark:bg-neutral-800/80",n&&"border-blue-400 dark:border-amber-500/60"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)(d,{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,p.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ms-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(M.ActionButton,{label:s("repositoryNode.openInIde"),onClick:q.openInIde,loading:q.ideLoading,error:!!q.ideError,icon:v.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(O.TooltipContent,{children:s("repositoryNode.openInIde")})]})}),(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(M.ActionButton,{label:s("repositoryNode.openInShell"),onClick:q.openInShell,loading:q.shellLoading,error:!!q.shellError,icon:y.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(O.TooltipContent,{children:s("repositoryNode.openInShell")})]})}),(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(M.ActionButton,{label:s("repositoryNode.openFolder"),onClick:q.openFolder,loading:q.folderLoading,error:!!q.folderError,icon:b.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(O.TooltipContent,{children:s("repositoryNode.openFolder")})]})}),(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)(f.Button,{variant:"ghost",size:"icon-xs","aria-label":s("repositoryNode.chatWithAgent"),onClick:t=>{t.stopPropagation(),e.id&&l.push(`/repository/${e.id}/chat`)},className:"nodrag relative cursor-pointer text-violet-500 hover:text-violet-600 dark:text-violet-400 dark:hover:text-violet-300",children:[(0,t.jsx)(S.MessageSquare,{className:"h-3 w-3"}),(0,t.jsx)(L.ChatDotIndicator,{status:U})]})}),(0,t.jsx)(O.TooltipContent,{children:s("repositoryNode.chatWithAgent")})]})}),(0,t.jsx)(D.FeatureSessionsDropdown,{repositoryPath:e.repositoryPath,includeWorktrees:!0,onCreateFromSession:H})]}):null,e.onAdd?(0,t.jsx)("div",{className:"ms-1.5"}):null,e.onAdd?(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{"aria-label":s("repositoryNode.newFeature"),"data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:(0,p.cn)("flex h-6 shrink-0 cursor-pointer items-center gap-0.5 rounded bg-blue-500 px-1.5 text-[11px] font-bold text-white transition-colors hover:bg-blue-600 dark:bg-amber-500 dark:hover:bg-amber-400",e.pulseAdd&&"animate-pulse-cta"),children:[(0,t.jsx)(u.Plus,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"translate-y-px",children:s("repositoryNode.new")})]})}),(0,t.jsx)(O.TooltipContent,{side:"top",children:s("repositoryNode.newFeature")})]})}):null]})]}),e.branch?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-testid":"repository-node-git-info",className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 truncate","data-testid":"repository-node-branch",children:[(0,t.jsx)(c.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),null!=e.behindCount&&e.behindCount>0?(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap text-amber-500","data-testid":"repository-node-behind",children:[(0,t.jsx)(E.ArrowDown,{className:"h-3 w-3 shrink-0"}),s("repositoryNode.behind",{count:e.behindCount})]}):null]})}),e.commitMessage?(0,t.jsx)("div",{"data-testid":"repository-node-commit-info",className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(N.GitCommitHorizontal,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate","data-testid":"repository-node-commit-message",children:e.commitMessage}),e.committer?(0,t.jsxs)("span",{className:"text-muted-foreground/70 ms-auto flex shrink-0 items-center gap-1","data-testid":"repository-node-committer",children:[(0,t.jsx)(C.User,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{children:e.committer})]}):null]})}):null]}):"not-a-repo"===e.gitInfoStatus?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-testid":"repository-node-not-repo",className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(b.FolderOpen,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate opacity-60",children:e.repositoryPath??"Unknown path"})]})}),(0,t.jsx)("div",{className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs opacity-40",children:[(0,t.jsx)(c.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{children:s("repositoryNode.notAGitRepository")})]})})]}):"ready"!==e.gitInfoStatus?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-testid":"repository-node-git-loading",className:"border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex h-4 items-center gap-2 text-xs",children:[(0,t.jsx)(c.GitBranch,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"bg-muted h-3 w-20 animate-pulse rounded"})]})}),(0,t.jsx)("div",{className:"border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex h-4 items-center gap-2 text-xs",children:[(0,t.jsx)(N.GitCommitHorizontal,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"bg-muted h-3 w-36 animate-pulse rounded"})]})})]}):null,$.envDeploy&&e.repositoryPath?(0,t.jsx)("div",{"data-testid":"repository-node-dev-preview",className:"border-border/50 border-t px-4 py-2",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[W.deployError?(0,t.jsx)("span",{className:"truncate text-xs text-red-500",children:W.deployError}):V?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"me-0.5 inline-block h-2 w-2 shrink-0 rounded-full bg-green-500"}),W.url?(0,t.jsx)("a",{href:W.url,target:"_blank",rel:"noopener noreferrer",className:"truncate text-green-700 hover:underline dark:text-green-400",children:W.url}):(0,t.jsx)("span",{className:"text-muted-foreground",children:s("repositoryNode.starting")})]}):(0,t.jsxs)("span",{className:"text-muted-foreground inline-flex items-baseline gap-2",children:[(0,t.jsx)("span",{children:s("repositoryNode.run")}),(0,t.jsx)("span",{className:"text-muted-foreground/50 text-[10px]",children:s("repositoryNode.startLocalEnvironment")})]}),(0,t.jsx)(O.TooltipProvider,{children:(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:(0,p.cn)("ms-auto flex items-center",!V&&!W.deployError&&"[&_button]:text-green-600 [&_button]:hover:text-green-700 dark:[&_button]:text-green-400 dark:[&_button]:hover:text-green-300"),children:(0,t.jsx)(M.ActionButton,{label:s(W.deployError?"repositoryNode.retry":V?"repositoryNode.stopDevServer":"repositoryNode.startDevServer"),onClick:V?W.stop:W.deploy,loading:W.deployLoading||W.stopLoading,error:!1,icon:W.deployError?_.RotateCcw:V?j.Square:k.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(O.TooltipContent,{children:s(V?"repositoryNode.stopDevServer":"repositoryNode.startDevServer")})]})})]})}):null]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:I,isConnectable:!e.showHandles,className:"opacity-0!",style:{top:70}}):null]})}function $(e){let[n]=(0,x.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"}})}e.i(1650),e.i(45811),e.i(25235);let z={x:30,y:30,zoom:.85};function B({nodes:e,edges:n,selectedFeatureId:o,selectedRepository:s,defaultViewport:i,onNodesChange:l,onAddFeature:d,onConnect:c,onNodeClick:x,onPaneClick:v,onCanvasDrag:y,onMoveEnd:b,toolbar:w,emptyState:k}){let{t:j}=(0,h.useTranslation)("web"),N=(0,a.useMemo)(()=>({featureNode:m.FeatureNode,repositoryNode:I}),[]),E=(0,a.useMemo)(()=>({dependencyEdge:$}),[]),C=(0,a.useMemo)(()=>{let t=null!=o,r=null!=s&&(null!=s.id||null!=s.path);return t||r?e.map(e=>{if(t&&"featureNode"===e.type&&e.data.featureId===o)return{...e,selected:!0};if(r&&"repositoryNode"===e.type){let t=e.data,r=null!=s.id&&(e.id===s.id||t.id===s.id),n=null!=s.path&&t.repositoryPath===s.path;if(r||n)return{...e,selected:!0}}return e}):e},[e,o,s]),_=0===e.length,[S,M]=(0,a.useState)(_),[R,O]=(0,a.useState)(!1),P=(0,a.useRef)(_);(0,a.useEffect)(()=>{if(P.current&&!_){O(!0);let e=setTimeout(()=>{M(!1),O(!1)},300);return P.current=_,()=>clearTimeout(e)}!P.current&&_&&M(!0),P.current=_},[_]);let T=_&&!k?(0,t.jsx)(g.EmptyState,{title:j("canvas.noFeatures"),description:j("canvas.noFeaturesDescription"),action:(0,t.jsxs)(f.Button,{onClick:d,children:[(0,t.jsx)(u.Plus,{className:"me-2 h-4 w-4"}),j("canvas.newFeature")]})}):null,F=k??T;return(0,t.jsxs)("div",{"data-testid":_?"features-canvas-empty":"features-canvas","data-no-drawer-close":!0,className:"dark:bg-background pointer-events-auto relative h-full w-full bg-[#f6f7f8]",children:[(0,t.jsxs)(r.ReactFlow,{nodes:C,edges:n,nodeTypes:N,edgeTypes:E,onConnect:c,onNodesChange:l,onNodeClick:x,onPaneClick:v,onMoveStart:y,onMoveEnd:b,defaultViewport:i??z,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},className:"[&_.react-flow__pane]:!cursor-default",children:[(0,t.jsx)(r.Background,{variant:r.BackgroundVariant.Dots,gap:24,size:1,color:"#b8bcc4",className:"dark:[&_circle]:!fill-white/[0.1]"}),!_&&w?(0,t.jsx)(r.Panel,{position:"top-right",className:"!me-3 !mt-3",children:w}):null]}),S&&F?(0,t.jsx)("div",{className:(0,p.cn)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",R?"opacity-0":"animate-in fade-in opacity-100 duration-200"),children:(0,t.jsx)("div",{className:"pointer-events-auto h-full w-full",children:F})}):null]})}var G=e.i(87889);let U=(0,l.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),q=(0,l.default)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),W=(0,l.default)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),V=(0,l.default)("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);function H({showArchived:e,onToggleArchived:n,onResetViewport:o}){let{t:s}=(0,h.useTranslation)("web"),{zoomIn:i,zoomOut:l,fitView:d,setViewport:c}=(0,r.useReactFlow)(),u=(0,a.useCallback)(()=>{i({duration:200})},[i]),p=(0,a.useCallback)(()=>{l({duration:200})},[l]),f=(0,a.useCallback)(()=>{d({duration:400,padding:.3})},[d]),g=(0,a.useCallback)(()=>{o&&c(o(),{duration:400})},[o,c]);return(0,t.jsxs)("div",{className:"bg-background flex items-center gap-1 rounded-xl border px-2 py-1.5 shadow-md dark:bg-neutral-900",children:[(0,t.jsx)(X,{onClick:n,title:s(e?"canvas.hideArchived":"canvas.showArchived"),active:e,label:s(e?"canvas.hideArchivedLabel":"canvas.showArchivedLabel"),children:e?(0,t.jsx)(G.Eye,{className:"h-4 w-4"}):(0,t.jsx)(U,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"bg-border mx-1 h-5 w-px"}),(0,t.jsx)(X,{onClick:p,title:s("canvas.zoomOut"),children:(0,t.jsx)(W,{className:"h-4 w-4"})}),(0,t.jsx)(X,{onClick:u,title:s("canvas.zoomIn"),children:(0,t.jsx)(q,{className:"h-4 w-4"})}),(0,t.jsx)(X,{onClick:f,title:s("canvas.fitView"),children:(0,t.jsx)(V,{className:"h-4 w-4"})}),o?(0,t.jsx)(X,{onClick:g,title:s("canvas.resetView"),children:(0,t.jsx)(_.RotateCcw,{className:"h-4 w-4"})}):null]})}function X({children:e,onClick:r,title:n,label:a,active:o}){return(0,t.jsxs)("button",{type:"button",onClick:r,title:n,className:(0,p.cn)("inline-flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium transition-colors","hover:bg-accent hover:text-accent-foreground",o?"text-primary bg-primary/10":"text-muted-foreground"),children:[e,a?(0,t.jsx)("span",{children:a}):null]})}var J=e.i(83428),K=e.i(60253);function Y({actions:e,className:r,style:n}){let{t:o}=(0,h.useTranslation)("web"),[s,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(s)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&i(!1)}},[s]),(0,t.jsxs)(t.Fragment,{children:[s?(0,t.jsx)("div",{"data-testid":"fab-overlay",className:"fixed inset-0 z-40",onClick:()=>i(!1),"aria-hidden":"true"}):null,(0,t.jsxs)("div",{"data-testid":"floating-action-button",className:(0,p.cn)("relative z-50",r),style:n,children:[(0,t.jsx)("div",{className:(0,p.cn)("absolute start-0 bottom-[calc(100%+24px)] flex flex-col items-start gap-2",!s&&"pointer-events-none"),"data-testid":"fab-actions",children:e.map((r,n)=>{let a=(e.length-1-n)*50;return(0,t.jsxs)("button",{"data-testid":`fab-action-${r.id}`,"aria-label":r.label,disabled:r.disabled??r.loading,className:(0,p.cn)("flex h-10 items-center gap-2.5 rounded-full px-4","bg-background text-foreground shadow-md","border-border border","hover:bg-accent hover:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50","text-sm font-medium whitespace-nowrap",s?"translate-y-0 opacity-100":"pointer-events-none translate-y-0 opacity-0"),style:{transition:`opacity ${s?250:120}ms ease-out ${s?a:0}ms, transform ${s?250:120}ms ease-out ${s?a:0}ms`},onClick:()=>{r.onClick(),i(!1)},children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:r.loading?(0,t.jsx)(J.Loader2,{className:"h-4 w-4 animate-spin"}):r.icon}),(0,t.jsx)("span",{children:r.label})]},r.id)})}),(0,t.jsxs)(f.Button,{size:"icon","data-testid":"fab-trigger","aria-label":o(s?"fab.closeActions":"fab.createNew"),className:(0,p.cn)("relative h-14 w-14 rounded-full shadow-lg","bg-indigo-500 text-white hover:bg-indigo-400 dark:bg-indigo-500 dark:hover:bg-indigo-400","transition-all duration-200 hover:scale-105 hover:shadow-xl active:scale-95"),onClick:()=>i(e=>!e),children:[(0,t.jsx)(u.Plus,{className:(0,p.cn)("absolute h-7 w-7 stroke-[2.5] transition-all",s?"scale-0 rotate-90 opacity-0":"scale-100 rotate-0 opacity-100"),style:{transitionDuration:"250ms"}}),(0,t.jsx)(K.X,{className:(0,p.cn)("absolute h-6 w-6 stroke-[2.5] transition-all",s?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-90 opacity-0"),style:{transitionDuration:"250ms"}})]})]})]})}var Q=e.i(5147),Z=e.i(8361),ee=e.i(30153);let et="shep-canvas-viewport",er={x:30,y:30,zoom:.85};var en=e.i(57638),ea=e.i(62639),eo=e.i(33548),es=e.i(23925),ei=e.i(35e3),el=e.i(79687),ed=e.i(99105),ec=e.i(30702),eu=e.i(78521);e.i(13322);var eh=e.i(61201),ep=e.i(21023);let ef=(0,ep.createServerReference)("007fcfedefceea5a9fe5ae4f1b6faa9230d35f9681",ep.callServer,void 0,ep.findSourceMapURL,"isAgentSetupComplete"),eg=(0,ep.createServerReference)("0097884381c297d4fc23b6162e0a60537b9a8d8516",ep.callServer,void 0,ep.findSourceMapURL,"checkAgentAuth"),em=(0,ep.createServerReference)("00a0eb127c35675f503f4ffe5fd2d83a374bbb0e5b",ep.callServer,void 0,ep.findSourceMapURL,"checkToolStatus");var ex=e.i(11345),ev=e.i(58481),ey=e.i(3396),eb=e.i(4267),ew=e.i(86782),ek=e.i(29847);let ej=["select-agent","select-model"];function eN({onComplete:e,className:r}){let{t:n}=(0,h.useTranslation)("web"),[o,s]=(0,a.useState)([]),[i,l]=(0,a.useState)(!0),[d,c]=(0,a.useState)("select-agent"),[u,f]=(0,a.useState)(null),[g,m]=(0,a.useState)(!1),[x,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!0),w=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{(0,ey.getAllAgentModels)().then(s).finally(()=>l(!1))},[]);let k=u?o.find(e=>e.agentType===u):null,j=(0,a.useCallback)((e,t)=>{v(!0),b(!1),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{t?.(),c(e),requestAnimationFrame(()=>{b(!0),v(!1)})},150)},[]);(0,a.useEffect)(()=>()=>{w.current&&clearTimeout(w.current)},[]);let N=(0,a.useCallback)(async(t,r)=>{m(!0);try{await (0,eb.updateAgentAndModel)(t,r),b(!1),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{e()},200)}catch{m(!1)}},[e]),E=(0,a.useCallback)(e=>{let t=o.find(t=>t.agentType===e);t&&t.models.length>0?j("select-model",()=>{f(e)}):N(e,null)},[o,j,N]),C=(0,a.useCallback)(e=>{u&&N(u,e)},[u,N]),_=(0,a.useCallback)(()=>{"select-model"===d&&j("select-agent",()=>{f(null)})},[d,j]);if(i)return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,p.cn)("flex flex-col items-center justify-center gap-4",r),children:[(0,t.jsx)(J.Loader2,{className:"text-muted-foreground h-5 w-5 animate-spin"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:n("welcome.loadingAgents")})]});let S=ej.indexOf(d),M=n("select-agent"===d?"welcome.chooseAgent":"welcome.pickModel"),R="select-agent"===d?n("welcome.selectAgentSubtitle"):k?n("welcome.chooseModelSubtitle",{label:k.label}):"";return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,p.cn)("flex w-full flex-col items-center",r),children:[(0,t.jsx)("div",{className:"mb-8 flex w-full max-w-xs items-center gap-1.5",children:ej.map((e,r)=>(0,t.jsx)("div",{className:(0,p.cn)("h-[3px] flex-1 rounded-full transition-colors duration-300",r<=S?"bg-foreground/60":"bg-muted")},e))}),(0,t.jsxs)("div",{className:(0,p.cn)("flex w-full flex-col items-center transition-opacity duration-200",y&&!x?"opacity-100":"opacity-0"),children:[(0,t.jsx)("h1",{className:"text-foreground/90 text-center text-5xl font-extralight tracking-tight",children:M}),(0,t.jsx)("p",{className:"text-muted-foreground mt-3 text-center text-lg leading-relaxed font-light",children:R}),"select-agent"===d&&(0,t.jsxs)("div",{"data-testid":"gh-cli-notice",className:"mt-5 flex items-start gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 dark:border-amber-900 dark:bg-amber-950/40",children:[(0,t.jsx)(ev.AlertTriangle,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-500"}),(0,t.jsxs)("p",{className:"text-sm leading-relaxed text-amber-800 dark:text-amber-300",children:[(0,t.jsx)("span",{className:"font-medium",children:n("welcome.ghCliRequired")})," ",n("welcome.ghCliRequiredText")," ",(0,t.jsx)("a",{href:"https://cli.github.com/",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-amber-900 dark:hover:text-amber-200",children:n("welcome.installHere")}),"."]})]}),(0,t.jsxs)("div",{className:"mt-8 flex w-full flex-col items-center",children:["select-agent"===d&&(0,t.jsx)("div",{"data-testid":"agent-list",className:"grid w-full max-w-lg gap-3",style:{gridTemplateColumns:`repeat(${Math.min(o.length,4)}, minmax(0, 1fr))`},children:o.map(e=>{let r=(0,ew.getAgentTypeIcon)(e.agentType);return(0,t.jsxs)("button",{type:"button",disabled:g,"data-testid":`agent-option-${e.agentType}`,className:"border-border hover:bg-accent hover:border-foreground/20 flex cursor-pointer flex-col items-center gap-3 rounded-2xl border px-4 py-5 transition-all duration-150 active:scale-[0.97] disabled:opacity-50",onClick:()=>E(e.agentType),children:[(0,t.jsx)(r,{className:"text-foreground/70 h-7 w-7"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:e.label})]},e.agentType)})}),"select-model"===d&&k?(0,t.jsxs)("div",{"data-testid":"model-list",className:"flex w-full max-w-lg flex-col items-center gap-4",children:[(0,t.jsxs)("button",{type:"button",disabled:g,className:"text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1.5 self-start text-sm transition-colors",onClick:_,children:[(0,t.jsx)(ex.ChevronLeft,{className:"h-4 w-4"}),n("welcome.back")]}),(0,t.jsx)("div",{className:"grid w-full gap-3",style:{gridTemplateColumns:`repeat(${Math.min(k.models.length,3)}, minmax(0, 1fr))`},children:k.models.map(e=>{let r=(0,ek.getModelMeta)(e.id);return(0,t.jsxs)("button",{type:"button",disabled:g,"data-testid":`model-option-${e.id}`,className:"border-border hover:bg-accent hover:border-foreground/20 flex cursor-pointer flex-col items-center gap-2 rounded-2xl border px-4 py-5 text-center transition-all duration-150 active:scale-[0.97] disabled:opacity-50",onClick:()=>C(e.id),children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:r.displayName||e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs leading-tight",children:r.description||e.description})]},e.id)})})]}):null]})]})]})}let eE=["cd ~/my-repo",'shep feat new "sleek dashboard"'];function eC({onRepositorySelect:e,className:r}){let{t:n}=(0,h.useTranslation)("web"),[o,s]=(0,a.useState)(!1),[i,l]=(0,a.useState)(!1),[d,c]=(0,a.useState)(!1),[u,f]=(0,a.useState)(null),[g,m]=(0,a.useState)(null),[x,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),{reactFileManager:j}=(0,T.useFeatureFlags)();async function N(){if(!i){if(j)return void c(!0);l(!0);try{let t=await (0,eu.pickFolder)();t&&e?.(t)}catch{c(!0)}finally{l(!1)}}}(0,a.useEffect)(()=>{ef().then(e=>{f(e)})},[]),(0,a.useEffect)(()=>{u&&(eg().then(m),em().then(k))},[u]);let E=(0,a.useCallback)(async()=>{await navigator.clipboard.writeText(eE.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]),C=(0,a.useCallback)(()=>{f(!0)},[]),_=(0,a.useCallback)(()=>{m(null),eg().then(m)},[]);return null===u?null:(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,p.cn)("relative flex h-full w-full flex-col items-center justify-center px-8",r),children:[u?(0,t.jsxs)("div",{className:"animate-in fade-in flex w-full max-w-md flex-col items-center duration-300",children:[(0,t.jsx)("h1",{className:"text-foreground/90 text-center text-5xl font-extralight tracking-tight",children:n("emptyState.addProject")}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-3 text-center text-lg leading-relaxed font-light",children:[n("emptyState.addProjectDescription"),(0,t.jsx)("br",{}),n("emptyState.addProjectDescriptionLine2")]}),(0,t.jsxs)("div",{className:"mt-8 flex w-full flex-col gap-3",children:[(0,t.jsx)(e_,{status:g,onRetry:_}),(0,t.jsx)(eS,{label:n("emptyState.git"),status:w?.git??null,missingHint:n("emptyState.gitRequired")}),(0,t.jsx)(eS,{label:n("emptyState.githubCli"),status:w?.gh??null,missingHint:n("emptyState.githubCliRequired")})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:N,disabled:i,className:"bg-foreground text-background hover:bg-foreground/90 mt-10 flex w-full cursor-pointer items-center justify-center gap-2.5 rounded-xl px-6 py-4 text-base font-medium shadow-lg transition-all duration-200 hover:shadow-xl active:scale-[0.98] disabled:cursor-wait disabled:opacity-50",children:[i?(0,t.jsx)(J.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(b.FolderOpen,{className:"h-5 w-5"}),n(i?"emptyState.opening":"emptyState.chooseFolder")]}),(0,t.jsx)("p",{className:"text-muted-foreground/60 mt-3 text-center text-sm",children:n("emptyState.folderHint")})]}):(0,t.jsx)(eN,{onComplete:C}),u?(0,t.jsxs)("div",{className:"absolute bottom-8 flex flex-col items-center",style:{animationDelay:"400ms",animationDuration:"600ms",animationFillMode:"both"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>v(!x),className:"text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1.5 transition-colors duration-200",children:[(0,t.jsx)(y.Terminal,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-sm",children:n("emptyState.orUseCli")}),(0,t.jsx)(ed.ChevronDown,{className:(0,p.cn)("h-3.5 w-3.5 transition-transform duration-200",x?"":"rotate-180")})]}),x?(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-top-1 mt-3 w-80 duration-200",children:(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative rounded-xl bg-zinc-900 px-5 py-4 font-mono text-[13px] leading-relaxed text-zinc-400",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:E,className:"absolute top-3 right-3 cursor-pointer rounded-md p-1.5 text-zinc-600 transition-colors hover:bg-zinc-800 hover:text-zinc-300","aria-label":n("emptyState.copyCommands"),children:o?(0,t.jsx)(es.Check,{className:"h-3.5 w-3.5 text-emerald-400"}):(0,t.jsx)(eo.Copy,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("div",{className:"space-y-1",children:eE.map(e=>(0,t.jsxs)("div",{className:"whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-zinc-600 select-none",children:"$ "}),(0,t.jsx)("span",{className:"text-zinc-300",children:e})]},e))})]})}):null]}):null,(0,t.jsx)(eh.ReactFileManagerDialog,{open:d,onOpenChange:e=>{e||c(!1)},onSelect:function(t){t&&e?.(t),c(!1)}})]})}function e_({status:e,onRetry:r}){let{t:n}=(0,h.useTranslation)("web");return e?e.installed&&e.authenticated?(0,t.jsx)(eM,{icon:(0,t.jsx)(ei.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}),children:(0,t.jsx)("span",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:n("emptyState.ready",{label:e.label})})}):e.installed?(0,t.jsxs)(eM,{icon:(0,t.jsx)(el.AlertCircle,{className:"h-4 w-4 text-amber-500"}),children:[(0,t.jsx)("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:n("emptyState.needsAuth",{label:e.label})}),e.authCommand?(0,t.jsx)(eR,{command:e.authCommand}):null,(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e.binaryName?(0,t.jsxs)("button",{type:"button","data-testid":"auth-banner-open-terminal",onClick:async()=>{try{let t="claude-code"===e.agentType?"claude-code":e.agentType;await fetch(`/api/tools/${t}/launch`,{method:"POST"})}catch{}},className:"flex items-center gap-1 text-xs font-medium text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:[(0,t.jsx)(y.Terminal,{className:"h-3 w-3"}),n("emptyState.open",{label:e.label})]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:n("emptyState.reCheck")})]})]}):(0,t.jsxs)(eM,{icon:(0,t.jsx)(el.AlertCircle,{className:"h-4 w-4 text-amber-500"}),children:[(0,t.jsx)("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:n("emptyState.notInstalled",{label:e.label})}),e.installCommand?(0,t.jsx)(eR,{command:e.installCommand}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:n("emptyState.reCheck")})]}):(0,t.jsx)(eM,{icon:(0,t.jsx)(J.Loader2,{className:"text-muted-foreground/50 h-4 w-4 animate-spin"}),children:(0,t.jsx)("span",{className:"text-muted-foreground/50 text-sm",children:n("emptyState.checkingSetup")})})}function eS({label:e,status:r,missingHint:n}){let{t:a}=(0,h.useTranslation)("web");return r?r.installed?(0,t.jsx)(eM,{icon:(0,t.jsx)(ei.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}),children:(0,t.jsxs)("span",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:a("emptyState.ready",{label:e})}),r.version?(0,t.jsxs)("span",{className:"text-muted-foreground/40 text-xs",children:["v",r.version]}):null]})}):(0,t.jsxs)(eM,{icon:(0,t.jsx)(el.AlertCircle,{className:"h-4 w-4 text-amber-500"}),children:[(0,t.jsx)("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:a("emptyState.notFound",{label:e})}),(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:n}),r.installCommand?(0,t.jsx)(eR,{command:r.installCommand}):null,r.installUrl?(0,t.jsxs)("a",{href:r.installUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-amber-600 underline underline-offset-2 hover:text-amber-800 dark:text-amber-400",children:[a("emptyState.docs")," ",(0,t.jsx)(ec.ExternalLink,{className:"h-3 w-3"})]}):null]}):(0,t.jsx)(eM,{icon:(0,t.jsx)(J.Loader2,{className:"text-muted-foreground/50 h-4 w-4 animate-spin"}),children:(0,t.jsx)("span",{className:"text-muted-foreground/50 text-sm",children:a("emptyState.checking",{label:e})})})}function eM({icon:e,children:r}){return(0,t.jsxs)("div",{className:"animate-in fade-in flex items-start gap-2.5",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:e}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:r})]})}function eR({command:e}){let[r,n]=(0,a.useState)(!1);return(0,t.jsxs)("button",{type:"button",onClick:async()=>{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},className:"group/cmd flex cursor-pointer items-center justify-between gap-2 rounded-md bg-zinc-100 py-1 ps-2.5 pe-2 text-start transition-colors hover:bg-zinc-200 dark:bg-zinc-800 dark:hover:bg-zinc-700",children:[(0,t.jsx)("code",{className:"min-w-0 truncate text-[11px] leading-relaxed text-zinc-600 dark:text-zinc-300",children:e}),r?(0,t.jsx)(es.Check,{className:"h-3 w-3 shrink-0 text-emerald-500"}):(0,t.jsx)(eo.Copy,{className:"h-3 w-3 shrink-0 text-zinc-400 opacity-0 transition-opacity group-hover/cmd:opacity-100"})]})}var eO=e.i(17840);let eP={maxZoom:1,padding:.5,duration:500};function eT({initialNodes:e,initialEdges:n}){let l,u,p,f,g,m,{t:x}=(0,h.useTranslation)("web"),v=(0,o.useRouter)(),y=(0,o.usePathname)(),b=(l=(0,o.usePathname)().match(/^\/feature\/([^/]+)/),l?.[1]??null),w=(u=(0,o.usePathname)(),p=(0,o.useSearchParams)(),f=u.match(/^\/repository\/([^/]+)/),{id:f?.[1]??null,path:u.startsWith("/create")?p.get("repo"):null}),k=(0,Z.useSoundAction)("click"),{guardedNavigate:j}=(0,ee.useDrawerCloseGuard)(),{fitView:N}=(0,r.useReactFlow)(),E=(0,a.useRef)(null),{defaultViewport:C,onMoveEnd:_,resetViewport:S}=(g=(0,a.useRef)(function(){try{let e=localStorage.getItem(et);if(null==e)return er;let t=JSON.parse(e);return!(null==t||"object"!=typeof t||Array.isArray(t))&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.zoom&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?t:er}catch{return er}}()).current,m=(0,a.useRef)(null),(0,a.useEffect)(()=>()=>{null!=m.current&&clearTimeout(m.current)},[]),{defaultViewport:g,onMoveEnd:(0,a.useCallback)(e=>{null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{try{localStorage.setItem(et,JSON.stringify(e))}catch{}},500)},[]),resetViewport:(0,a.useCallback)(()=>{try{localStorage.removeItem(et)}catch{}return er},[])}),{nodes:M,edges:R,onNodesChange:O,handleConnect:P,handleAddRepository:F,handleArchiveFeature:L,handleDeleteFeature:A,handleRetryFeature:D,handleStartFeature:I,handleStopFeature:$,handleUnarchiveFeature:z,handleDeleteRepository:G,createFeatureNode:U,showArchived:q,setShowArchived:W,setCallbacks:V}=(0,eO.useControlCenterState)(e,n),{setFeatures:X,setHasRepositories:J}=(0,Q.useSidebarFeaturesContext)(),K=(0,a.useMemo)(()=>M.filter(e=>"featureNode"===e.type),[M]),Y=(0,a.useMemo)(()=>K.map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.name}:${t.repositoryPath}`}).sort().join(","),[K]);(0,a.useEffect)(()=>{X(K.map(e=>{let t=e.data,r=(0,Q.mapNodeStateToSidebarStatus)(t.state);if(!r)return null;let n=t.repositoryPath??"";return{featureId:t.featureId,name:t.name,status:r,repositoryPath:n,repositoryName:t.repositoryName??n.split("/").filter(Boolean).pop()??n,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime},...t.agentType&&{agentType:t.agentType},...t.modelId&&{modelId:t.modelId}}}).filter(Boolean))},[Y,K,X]);let en=(0,a.useCallback)((e,t)=>{if("featureNode"===t.type){let r=t.data;"creating"!==r.state&&"deleting"!==r.state&&e.target.closest('[data-testid="feature-node-card"]')&&j(()=>{k.play(),v.push(`/feature/${r.featureId}`)})}},[v,k,j]),ea=(0,a.useCallback)(()=>{k.play(),v.push("/create")},[v,k]),eo=(0,a.useCallback)(e=>{k.play();let t=M.find(t=>t.id===e),r=t?.data?.repositoryPath;r?v.push(`/create?repo=${encodeURIComponent(r)}`):v.push("/create")},[M,v,k]),es=(0,a.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=R.find(t=>t.target===e),n=r?M.find(e=>e.id===r.source):null,a=n?.data?.repositoryPath;k.play();let o=new URLSearchParams;a&&o.set("repo",a),o.set("parent",t),v.push(`/create?${o.toString()}`)},[M,R,v,k]),ei=(0,a.useCallback)(e=>{let t=M.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&j(()=>v.push(`/repository/${e.id}`))}},[M,v,j]),el=(0,a.useCallback)(()=>{"/"!==y&&j(()=>v.push("/"))},[v,y,j]),ed=(0,a.useCallback)(e=>{setTimeout(()=>{N(eP),E.current=setTimeout(()=>{j(()=>v.push(`/create?repo=${encodeURIComponent(e)}`))},600)},0)},[N,j,v]),ec=(0,a.useCallback)(e=>{let{wasEmpty:t,repoPath:r}=F(e);t&&ed(r)},[F,ed]);(0,a.useEffect)(()=>{let e=e=>{ec(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>{window.removeEventListener("shep:add-repository",e),null!=E.current&&clearTimeout(E.current)}},[ec]),(0,a.useEffect)(()=>{let e=e=>{let t=e.detail;if(t.parentId)return void U(`feat-${t.parentId}`,{state:"creating",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath},"dependencyEdge");let r=M.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);U(r?.id??null,{state:"running",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[M,U]),(0,a.useEffect)(()=>{let e=e=>{let{featureId:t,cleanup:r,cascadeDelete:n,closePr:a}=e.detail;A(t,r,n,a)};return window.addEventListener("shep:feature-delete-requested",e),()=>window.removeEventListener("shep:feature-delete-requested",e)},[A]),(0,a.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;L(t)};return window.addEventListener("shep:feature-archive-requested",e),()=>window.removeEventListener("shep:feature-archive-requested",e)},[L]),(0,a.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;z(t)};return window.addEventListener("shep:feature-unarchive-requested",e),()=>window.removeEventListener("shep:feature-unarchive-requested",e)},[z]),(0,a.useEffect)(()=>{V({onNodeAction:es,onFeatureDelete:A,onRetryFeature:D,onStartFeature:I,onStopFeature:$,onArchiveFeature:L,onUnarchiveFeature:z,onRepositoryAdd:eo,onRepositoryClick:ei,onRepositoryDelete:G})},[V,es,L,A,D,I,$,z,eo,ei,G]);let eu=(0,a.useCallback)((e,t)=>{_(t)},[_]),eh=M.some(e=>"repositoryNode"===e.type);(0,a.useEffect)(()=>{J(eh)},[eh,J]);let[ep,ef]=(0,a.useState)(eh),eg=(0,a.useRef)(null);(0,a.useEffect)(()=>(eh?(eg.current&&(clearTimeout(eg.current),eg.current=null),ef(!0)):ep&&(S(),eg.current=setTimeout(()=>{ef(!1),eg.current=null},500)),()=>{eg.current&&clearTimeout(eg.current)}),[eh,ep,S]);let em=y.startsWith("/create"),ex=(0,a.useMemo)(()=>{let e=M.filter(e=>"repositoryNode"===e.type),t=M.some(e=>"featureNode"===e.type);return 1!==e.length||t||em?M:M.map(e=>"repositoryNode"===e.type?{...e,data:{...e.data,pulseAdd:!0}}:e)},[M,em]),ev=(0,a.useCallback)(()=>{window.dispatchEvent(new CustomEvent("shep:pick-folder"))},[]),ey=(0,T.useFeatureFlags)(),eb=(0,a.useMemo)(()=>{let e=[{id:"new-feature",label:x("fab.newFeature"),icon:(0,t.jsx)(s.Sparkles,{className:"h-4 w-4"}),onClick:()=>{k.play(),j(()=>v.push("/create"))}},{id:"add-local-repo",label:x("fab.localFolder"),icon:(0,t.jsx)(i.FolderPlus,{className:"h-4 w-4"}),onClick:ev}];return ey.adoptBranch&&e.push({id:"adopt-branch",label:x("fab.adoptBranch"),icon:(0,t.jsx)(c.GitBranch,{className:"h-4 w-4"}),onClick:()=>{j(()=>v.push("/adopt"))}}),ey.githubImport&&e.push({id:"add-github-repo",label:x("fab.fromGithub"),icon:(0,t.jsx)(d,{className:"h-4 w-4"}),onClick:()=>{window.dispatchEvent(new CustomEvent("shep:open-github-import"))}}),e},[x,k,j,v,ev,ey.adoptBranch,ey.githubImport]),ew=(0,t.jsx)(H,{showArchived:q,onToggleArchived:()=>W(!q),onResetViewport:S});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{nodes:ep?ex:[],edges:ep?R:[],selectedFeatureId:b,selectedRepository:w,defaultViewport:C,onNodesChange:O,onConnect:P,onAddFeature:ea,onNodeClick:en,onPaneClick:el,onMoveEnd:eu,toolbar:ew,emptyState:(0,t.jsx)(eC,{onRepositorySelect:ec})}),ep?(0,t.jsx)(eF,{actions:eb}):null]})}function eF({actions:e}){let{state:r}=(0,en.useSidebar)(),{i18n:n}=(0,h.useTranslation)("web"),{swapPosition:a}=(0,ea.useFabLayout)(),o="rtl"===n.dir();if(a)return(0,t.jsx)(Y,{actions:e,className:"!fixed bottom-6",style:o?{left:"calc(var(--sidebar-width-icon) + 32px)",transition:"left 200ms ease-in-out"}:{right:"32px",transition:"right 200ms ease-in-out"}});let s="expanded"===r?"calc(var(--sidebar-width) + 32px)":"calc(var(--sidebar-width-icon) + 32px)";return(0,t.jsx)(Y,{actions:e,className:"!fixed bottom-6",style:o?{right:s,transition:"right 200ms ease-in-out"}:{left:s,transition:"left 200ms ease-in-out"}})}function eL({initialNodes:e,initialEdges:a,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(n.SessionsProvider,{children:(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(eT,{initialNodes:e,initialEdges:a})})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>eL],48246)}]);