@shepai/cli 1.72.4 → 1.72.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +8 -2
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +2 -2
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts +3 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +13 -5
- package/dist/src/presentation/web/hooks/drawer-close-guard.d.ts +2 -0
- package/dist/src/presentation/web/hooks/drawer-close-guard.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/drawer-close-guard.js +2 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/cache/.previewinfo +1 -1
- package/web/.next/cache/.rscinfo +1 -1
- package/web/.next/cache/.tsbuildinfo +1 -1
- package/web/.next/cache/config.json +3 -3
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +17 -17
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +17 -17
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -12
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_2b7834f6.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_2b7834f6.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6923c575.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6923c575.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07385073._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07385073._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6db85a66._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8fcb9132._.js +2 -2
- package/web/.next/server/chunks/ssr/_00e6c698._.js +1 -1
- package/web/.next/server/chunks/ssr/_00e6c698._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_07c2a32a._.js +1 -1
- package/web/.next/server/chunks/ssr/_07c2a32a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_37259405._.js +1 -1
- package/web/.next/server/chunks/ssr/_37259405._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_85d0351b._.js +1 -1
- package/web/.next/server/chunks/ssr/_85d0351b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_6f07b817._.js → _8fcb97eb._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_6f07b817._.js.map → _8fcb97eb._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_fc3a6895._.js +1 -1
- package/web/.next/server/chunks/ssr/_fc3a6895._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_1a32dbcb._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_1a32dbcb._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_398553b0._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_398553b0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5c87e8e4._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5c87e8e4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f4952172.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f4952172.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c1bc6240._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c1bc6240._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +20 -20
- package/web/.next/standalone/src/presentation/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/src/presentation/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/src/presentation/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/src/presentation/web/.next/required-server-files.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +14 -14
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +17 -17
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +14 -14
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +17 -17
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +12 -12
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +12 -12
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_2b7834f6.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6923c575.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__07385073._.js +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6db85a66._.js +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__8fcb9132._.js +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_00e6c698._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_07c2a32a._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_37259405._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_85d0351b._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/{_6f07b817._.js → _8fcb97eb._.js} +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_fc3a6895._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_1a32dbcb._.js +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_398553b0._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_5c87e8e4._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_f4952172.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_c1bc6240._.js +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.json +20 -20
- package/web/.next/standalone/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx +8 -2
- package/web/.next/standalone/src/presentation/web/components/features/control-center/control-center-inner.tsx +2 -2
- package/web/.next/standalone/src/presentation/web/components/features/control-center/use-control-center-state.ts +11 -5
- package/web/.next/standalone/src/presentation/web/hooks/drawer-close-guard.tsx +5 -1
- package/web/.next/standalone/src/presentation/web/server.js +1 -1
- package/web/.next/static/chunks/{ef5c9b5ca75f5471.js → 06dfd668334ffb4e.js} +1 -1
- package/web/.next/static/chunks/{b17ac661ba6821cd.js → 0f3e1ea42efba7e8.js} +1 -1
- package/web/.next/static/chunks/{e44849eb58a3335f.js → 515d5b157a7620b9.js} +1 -1
- package/web/.next/static/chunks/{a6a90c6798cbc332.js → 5a962b5baf7c4d1d.js} +1 -1
- package/web/.next/static/chunks/{8b185ff4023149e8.js → 87db91411a520cea.js} +1 -1
- package/web/.next/static/chunks/{d9a30c62ba67d6da.js → 9261e2adb145d388.js} +1 -1
- package/web/.next/static/chunks/{498879011ae095f1.js → 92ebb1cad6f24333.js} +1 -1
- package/web/.next/static/chunks/{d7cc1029085b27db.js → 952c8aa7247dcb3f.js} +1 -1
- package/web/.next/static/chunks/{d717b59752363f9b.js → d2e6361bdd7a02a5.js} +1 -1
- package/web/.next/static/chunks/{a7d37a627c7869eb.js → ebfd2ed5b143b5b6.js} +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- /package/web/.next/static/{BKlbRwdm1wGLZiZ1JfGrF → KbyvoLS1Q62iF5F25ZKYW}/_buildManifest.js +0 -0
- /package/web/.next/static/{BKlbRwdm1wGLZiZ1JfGrF → KbyvoLS1Q62iF5F25ZKYW}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{BKlbRwdm1wGLZiZ1JfGrF → KbyvoLS1Q62iF5F25ZKYW}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}e.s(["Input",()=>n])},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)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},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)},31406,(e,t,r)=>{t.exports=e.r(67013)},80764,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(79054);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=i(e,n)),t&&(o.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},3214,e=>{"use strict";var t=e.i(91891);e.s(["Plus",()=>t.default])},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])},10942,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default])},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);function n(e,t,r,n){if("u"<typeof EventSource)return()=>{};let o=null,i=!1,a=1e3,u=null,s=null;return!function l(){i||(o=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),o.onopen=()=>{n("connected"),s=setTimeout(()=>{s=null,a=1e3},5e3)},o.onerror=()=>{o?.close(),o=null,n("disconnected"),null!==s&&(clearTimeout(s),s=null);let e=a;a=Math.min(2*e,3e4),u=setTimeout(()=>{u=null,l()},e)},o.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>[...e,n]),r(n)}))}(),()=>{i=!0,null!==u&&(clearTimeout(u),u=null),null!==s&&(clearTimeout(s),s=null),o&&(o.close(),o=null)}}let o=(0,r.createContext)(null);function i({children:e,runId:i}){let a=function(e){let[t,o]=(0,r.useState)([]),[i,a]=(0,r.useState)(null),[u,s]=(0,r.useState)("disconnected"),l=e?.runId,c=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;o(t=>[...t,e]),a(e)}else"status"===t.type&&s(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return n(l,o,a,s);let t=!1,r={current:void 0};function i(e){t||(c.current=e,e.postMessage({type:"subscribe",runId:l}),s("connecting"))}function u(){if(t)return;let e=navigator.serviceWorker.controller;e&&(c.current=e,e.postMessage({type:"subscribe",runId:l}),s("connecting"))}return navigator.serviceWorker.addEventListener("message",d),navigator.serviceWorker.addEventListener("controllerchange",u),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let u=e.active??e.installing??e.waiting;if(!u){r.current=n(l,o,a,s);return}"activated"===u.state?i(u):u.addEventListener("statechange",()=>{"activated"===u.state&&i(u)})}).catch(()=>{t||(r.current=n(l,o,a,s))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",d),navigator.serviceWorker.removeEventListener("controllerchange",u),c.current?.postMessage({type:"unsubscribe"}),c.current=null,r.current?.()}},[l,d]),{events:t,lastEvent:i,connectionStatus:u}}({runId:i});return(0,t.jsx)(o.Provider,{value:a,children:e})}function a(){let e=(0,r.useContext)(o);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>i,"useAgentEventsContext",()=>a],39443)},1354,78986,1963,17845,5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054),n=e.i(3214),o=e.i(83428),i=e.i(21023);let a=(0,i.createServerReference)("00a0ef582772903fdfdababbf8c171b8c6fb46fd0e",i.callServer,void 0,i.findSourceMapURL,"pickFolder");async function u(){let e=await a();if(e.error)throw Error(e.error);return e.path}function s({data:e}){let[i,a]=(0,r.useState)(!1);async function s(){if(!i){a(!0);try{let t=await u();t&&e.onSelect?.(t)}finally{a(!1)}}}return(0,t.jsx)("div",{className:"group",children:(0,t.jsxs)("button",{type:"button","data-testid":"add-repository-node-card",onClick:s,disabled:i,className:"nodrag border-muted-foreground/30 flex w-56 cursor-pointer items-center gap-3 rounded-full border-2 border-dashed px-4 py-3 transition-colors hover:border-blue-500 hover:text-blue-500 disabled:cursor-wait disabled:opacity-60",children:[i?(0,t.jsx)(o.Loader2,{className:"h-5 w-5 shrink-0 animate-spin"}):(0,t.jsx)(n.Plus,{className:"h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"add-repository-node-label",className:"text-sm font-medium",children:i?"Opening...":"Add Repository"})]})})}e.s(["pickFolder",()=>u],78986),e.s(["AddRepositoryNode",()=>s],1963);let l=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var c=e.i(35364),d=e.i(2828);function f({onSelect:e}){let[n,i]=(0,r.useState)(!1);async function a(){if(!n){i(!0);try{let t=await u();t&&e?.(t)}finally{i(!1)}}}return(0,t.jsx)(d.TooltipProvider,{children:(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon","aria-label":"Add Repository","data-testid":"add-repository-button",onClick:a,disabled:n,children:n?(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(l,{className:"h-5 w-5"})})}),(0,t.jsx)(d.TooltipContent,{children:"Add Repository"})]})})}e.s(["AddRepositoryButton",()=>f],17845),e.s([],1354);let p={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"in-progress",error:"in-progress",creating:null};function h(e){return p[e]}let g=(0,r.createContext)(null);function y({children:e}){let[n,o]=(0,r.useState)([]),i=(0,r.useMemo)(()=>({features:n,setFeatures:o}),[n]);return(0,t.jsx)(g.Provider,{value:i,children:e})}function v(){let e=(0,r.useContext)(g);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>y,"mapNodeStateToSidebarStatus",()=>h,"useSidebarFeaturesContext",()=>v],5147)},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function u(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066)._(e.r(76314)),a=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==l?(l="//"+(l||""),o&&"/"!==o[0]&&(o="/"+o)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${l}${o}${c}${u}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return u(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return m},SP:function(){return g},ST:function(){return y},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return E}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>u.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function d(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 h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,y=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class b extends Error{}class m extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class P extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function E(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(58464),o=e.r(53626);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return m}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066),a=e.r(20314),u=i._(e.r(79054)),s=e.r(95889),l=e.r(18152),c=e.r(80764),d=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),g=e.r(95555);function y(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,o,i,[s,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),m=(0,u.useRef)(null),{href:x,as:P,children:E,prefetch:j=null,passHref:S,replace:w,shallow:C,scroll:k,onClick:O,onMouseEnter:T,onTouchStart:_,legacyBehavior:R=!1,onNavigate:L,ref:N,unstable_dynamicOnHover:M,...A}=t;n=E,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let U=u.default.useContext(l.AppRouterContext),I=!1!==j,$=!1!==j?null===(r=j)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:F,as:z}=u.default.useMemo(()=>{let e=y(x);return{href:e,as:P?y(P):e}},[x,P]);if(R){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=u.default.Children.only(n)}let B=R?o&&"object"==typeof o&&o.ref:N,D=u.default.useCallback(e=>(null!==U&&(m.current=(0,p.mountLinkInstance)(e,F,U,$,I,v)),()=>{m.current&&((0,p.unmountLinkForCurrentNavigation)(m.current),m.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,F,U,$,v]),W={ref:(0,c.useMergedRef)(D,B),onClick(t){R||"function"!=typeof O||O(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,i,a,s){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(81574);u.default.startTransition(()=>{d(n||r,i?"replace":"push",a??!0,o.current)})}}(t,F,z,m,w,k,L)},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===M)},onTouchStart:function(e){R||"function"!=typeof _||_(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===M)}};return(0,d.isAbsoluteUrl)(z)?W.href=z:R&&!S&&("a"!==o.type||"href"in o.props)||(W.href=(0,f.addBasePath)(z)),i=R?u.default.cloneElement(o,W):(0,a.jsx)("a",{...A,...W,children:n}),(0,a.jsx)(b.Provider,{value:s,children:i})}e.r(38670);let b=(0,u.createContext)(p.IDLE_LINK_STATUS),m=()=>(0,u.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)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},98127,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function n({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}e.s(["Input",()=>n])},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)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function n(e){let n=t.useContext(r);return e||n||"ltr"}e.s(["useDirection",()=>n])},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)},31406,(e,t,r)=>{t.exports=e.r(67013)},80764,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(79054);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=i(e,n)),t&&(o.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},3214,e=>{"use strict";var t=e.i(91891);e.s(["Plus",()=>t.default])},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])},10942,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default])},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);function n(e,t,r,n){if("u"<typeof EventSource)return()=>{};let o=null,i=!1,a=1e3,u=null,s=null;return!function l(){i||(o=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),n("connecting"),o.onopen=()=>{n("connected"),s=setTimeout(()=>{s=null,a=1e3},5e3)},o.onerror=()=>{o?.close(),o=null,n("disconnected"),null!==s&&(clearTimeout(s),s=null);let e=a;a=Math.min(2*e,3e4),u=setTimeout(()=>{u=null,l()},e)},o.addEventListener("notification",e=>{let n=JSON.parse(e.data);t(e=>[...e,n]),r(n)}))}(),()=>{i=!0,null!==u&&(clearTimeout(u),u=null),null!==s&&(clearTimeout(s),s=null),o&&(o.close(),o=null)}}let o=(0,r.createContext)(null);function i({children:e,runId:i}){let a=function(e){let[t,o]=(0,r.useState)([]),[i,a]=(0,r.useState)(null),[u,s]=(0,r.useState)("disconnected"),l=e?.runId,c=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;o(t=>[...t,e]),a(e)}else"status"===t.type&&s(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return n(l,o,a,s);let t=!1,r={current:void 0};function i(e){t||(c.current=e,e.postMessage({type:"subscribe",runId:l}),s("connecting"))}function u(){if(t)return;let e=navigator.serviceWorker.controller;e&&(c.current=e,e.postMessage({type:"subscribe",runId:l}),s("connecting"))}return navigator.serviceWorker.addEventListener("message",d),navigator.serviceWorker.addEventListener("controllerchange",u),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let u=e.active??e.installing??e.waiting;if(!u){r.current=n(l,o,a,s);return}"activated"===u.state?i(u):u.addEventListener("statechange",()=>{"activated"===u.state&&i(u)})}).catch(()=>{t||(r.current=n(l,o,a,s))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",d),navigator.serviceWorker.removeEventListener("controllerchange",u),c.current?.postMessage({type:"unsubscribe"}),c.current=null,r.current?.()}},[l,d]),{events:t,lastEvent:i,connectionStatus:u}}({runId:i});return(0,t.jsx)(o.Provider,{value:a,children:e})}function a(){let e=(0,r.useContext)(o);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>i,"useAgentEventsContext",()=>a],39443)},1354,78986,1963,17845,5147,e=>{"use strict";var t=e.i(20314),r=e.i(79054),n=e.i(3214),o=e.i(83428),i=e.i(21023);let a=(0,i.createServerReference)("0030d68c0064a2d730237108650c88c7cbfc731360",i.callServer,void 0,i.findSourceMapURL,"pickFolder");async function u(){let e=await a();if(e.error)throw Error(e.error);return e.path}function s({data:e}){let[i,a]=(0,r.useState)(!1);async function s(){if(!i){a(!0);try{let t=await u();t&&e.onSelect?.(t)}finally{a(!1)}}}return(0,t.jsx)("div",{className:"group",children:(0,t.jsxs)("button",{type:"button","data-testid":"add-repository-node-card",onClick:s,disabled:i,className:"nodrag border-muted-foreground/30 flex w-56 cursor-pointer items-center gap-3 rounded-full border-2 border-dashed px-4 py-3 transition-colors hover:border-blue-500 hover:text-blue-500 disabled:cursor-wait disabled:opacity-60",children:[i?(0,t.jsx)(o.Loader2,{className:"h-5 w-5 shrink-0 animate-spin"}):(0,t.jsx)(n.Plus,{className:"h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"add-repository-node-label",className:"text-sm font-medium",children:i?"Opening...":"Add Repository"})]})})}e.s(["pickFolder",()=>u],78986),e.s(["AddRepositoryNode",()=>s],1963);let l=(0,e.i(3645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var c=e.i(35364),d=e.i(2828);function f({onSelect:e}){let[n,i]=(0,r.useState)(!1);async function a(){if(!n){i(!0);try{let t=await u();t&&e?.(t)}finally{i(!1)}}}return(0,t.jsx)(d.TooltipProvider,{children:(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon","aria-label":"Add Repository","data-testid":"add-repository-button",onClick:a,disabled:n,children:n?(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(l,{className:"h-5 w-5"})})}),(0,t.jsx)(d.TooltipContent,{children:"Add Repository"})]})})}e.s(["AddRepositoryButton",()=>f],17845),e.s([],1354);let p={"action-required":"action-needed",running:"in-progress",done:"done",blocked:"in-progress",error:"in-progress",creating:null};function h(e){return p[e]}let g=(0,r.createContext)(null);function y({children:e}){let[n,o]=(0,r.useState)([]),i=(0,r.useMemo)(()=>({features:n,setFeatures:o}),[n]);return(0,t.jsx)(g.Provider,{value:i,children:e})}function v(){let e=(0,r.useContext)(g);if(!e)throw Error("useSidebarFeaturesContext must be used within a <SidebarFeaturesProvider>");return e}e.s(["SidebarFeaturesProvider",()=>y,"mapNodeStateToSidebarStatus",()=>h,"useSidebarFeaturesContext",()=>v],5147)},76314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function u(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95889,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066)._(e.r(76314)),a=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==l?(l="//"+(l||""),o&&"/"!==o[0]&&(o="/"+o)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${l}${o}${c}${u}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return u(e)}},58464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return m},SP:function(){return g},ST:function(){return y},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return E}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>u.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function d(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 h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,y=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class b extends Error{}class m extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class P extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function E(e){return JSON.stringify({message:e.message,stack:e.stack})}},51380,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(58464),o=e.r(53626);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},38670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},24035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return m}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(44066),a=e.r(20314),u=i._(e.r(79054)),s=e.r(95889),l=e.r(18152),c=e.r(80764),d=e.r(58464),f=e.r(99267);e.r(24270);let p=e.r(59624),h=e.r(51380),g=e.r(95555);function y(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,o,i,[s,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),m=(0,u.useRef)(null),{href:x,as:P,children:E,prefetch:j=null,passHref:S,replace:w,shallow:C,scroll:k,onClick:O,onMouseEnter:T,onTouchStart:_,legacyBehavior:R=!1,onNavigate:L,ref:N,unstable_dynamicOnHover:M,...A}=t;n=E,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let U=u.default.useContext(l.AppRouterContext),I=!1!==j,$=!1!==j?null===(r=j)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,{href:F,as:z}=u.default.useMemo(()=>{let e=y(x);return{href:e,as:P?y(P):e}},[x,P]);if(R){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=u.default.Children.only(n)}let B=R?o&&"object"==typeof o&&o.ref:N,D=u.default.useCallback(e=>(null!==U&&(m.current=(0,p.mountLinkInstance)(e,F,U,$,I,v)),()=>{m.current&&((0,p.unmountLinkForCurrentNavigation)(m.current),m.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,F,U,$,v]),W={ref:(0,c.useMergedRef)(D,B),onClick(t){R||"function"!=typeof O||O(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,i,a,s){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(81574);u.default.startTransition(()=>{d(n||r,i?"replace":"push",a??!0,o.current)})}}(t,F,z,m,w,k,L)},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===M)},onTouchStart:function(e){R||"function"!=typeof _||_(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===M)}};return(0,d.isAbsoluteUrl)(z)?W.href=z:R&&!S&&("a"!==o.type||"href"in o.props)||(W.href=(0,f.addBasePath)(z)),i=R?u.default.cloneElement(o,W):(0,a.jsx)("a",{...A,...W,children:n}),(0,a.jsx)(b.Provider,{value:s,children:i})}e.r(38670);let b=(0,u.createContext)(p.IDLE_LINK_STATUS),m=()=>(0,u.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)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17840,e=>{"use strict";var t=e.i(79054),r=e.i(31406),n=e.i(60112),o=e.i(53271),i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=i((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,n)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?r(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n},i=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function i(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}return o+"\x01"+i+"\x01"+(void 0===n?"\0":n)}function s(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,t,n,o,s=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var d=i(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,d))return s&&(this._edgeLabels[d]=o),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[d]=s?o:this._defaultEdgeLabelFn(e,t,n);var l=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}var a={v:o,w:i};return n&&(a.name=n),a}(this._isDirected,e,t,n);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[d]=l,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][d]=l,this._out[e][d]=l,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var o=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r),a=this._edgeObjs[o];return a&&(e=a.v,t=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,r){if(e){var n=Object.values(e);return r?n.filter(function(e){return e.v===t&&e.w===r||e.v===r&&e.w===t}):n}}}}),s=n((e,t)=>{t.exports="3.0.2"}),a=n((e,t)=>{t.exports={Graph:i(),version:s()}}),d=n((e,t)=>{var r=i();t.exports={write:function(e){var t,r,n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(function(e){var t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})};return void 0!==e.graph()&&(n.value=structuredClone(e.graph())),n},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=n((e,t)=>{t.exports=function(e,t,n,o){return function(e,t,r,n){var o={},i=!0,s=0,a=e.nodes(),d=function(e){var t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},l=function(){a.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};a.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=a.length,h=1;h<c&&(i=!1,s++,l(),i);h++);if(s===c-1&&(i=!1,l(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),n||r,o||function(t){return e.outEdges(t)})};var r=()=>1}),c=n((e,t)=>{t.exports=function(e){var t,r={},n=[];return e.nodes().forEach(function(o){t=[],function n(o){Object.hasOwn(r,o)||(r[o]=!0,t.push(o),e.successors(o).forEach(n),e.predecessors(o).forEach(n))}(o),t.length&&n.push(t)}),n}}),h=n((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(!Object.hasOwn(r,e=String(e))){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}}}),u=n((e,t)=>{var r=h();t.exports=function(e,t,o,i){return function(e,t,n,o){var i,s,a={},d=new r,l=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),l=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<r.distance&&(r.distance=l,r.predecessor=i,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;a[e]={distance:r},d.add(e,r)});d.size()>0&&(s=a[i=d.removeMin()]).distance!==1/0;)o(i).forEach(l);return a}(e,String(t),o||n,i||function(t){return e.outEdges(t)})};var n=()=>1}),p=n((e,t)=>{var r=u();t.exports=function(e,t,n){return e.nodes().reduce(function(o,i){return o[i]=r(e,i,t,n),o},{})}}),f=n((e,t)=>{t.exports=function(e,t,r){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[r].predecessor&&r!==t)throw Error("Invalid destination vertex");return{weight:e[r].distance,path:function(e,t,r){for(var n=[],o=r;o!==t;)n.push(o),o=e[o].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(n,i)||function i(s){var a=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(i(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(i)}),o}}),m=n((e,t)=>{var r=g();t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),v=n((e,t)=>{t.exports=function(e,t,n){var o,i,s,a,d;return o=e,i=t||r,s=n||function(t){return e.outEdges(t)},a={},(d=o.nodes()).forEach(function(e){a[e]={},a[e][e]={distance:0},d.forEach(function(t){e!==t&&(a[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=i(t);a[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=a[e];d.forEach(function(r){var n=a[r];d.forEach(function(r){var o=n[e],i=t[r],s=n[r],a=o.distance+i.distance;a<s.distance&&(s.distance=a,s.predecessor=i.predecessor)})})}),a};var r=()=>1}),y=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function i(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(i),delete r[s],o.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return o}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),b=n((e,t)=>{var r=y();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),w=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,r,n,o,i,s,a){return Object.hasOwn(o,r)||(o[r]=!0,n||(a=s(a,r)),i(r).forEach(function(r){a=e(t,r,n,o,i,s,a)}),n&&(a=s(a,r))),a}(e,t,"post"===r,s,i,n,o)}),o}}),x=n((e,t)=>{var r=w();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=i(),n=h();t.exports=function(e,t){var o,i=new r,s={},a=new n;function d(e){var r=e.v===o?e.w:e.v,n=a.priority(r);if(void 0!==n){var i=t(e);i<n&&(s[r]=o,a.decrease(r,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){a.add(e,1/0),i.setNode(e)}),a.decrease(e.nodes()[0],0);for(var l=!1;a.size()>0;){if(Object.hasOwn(s,o=a.removeMin()))i.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return i}}),_=n((e,t)=>{var r=u(),n=l();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return r(e,t,o,i);for(var s=!1,a=e.nodes(),d=0;d<a.length;d++){for(var l=i(a[d]),c=0;c<l.length;c++){var h=l[c],u=h.v===a[d]?h.v:h.w,p=u===h.v?h.w:h.v;0>o({v:u,w:p})&&(s=!0)}if(s)return n(e,t,o,i)}return r(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),N=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:u(),dijkstraAll:p(),extractPath:f(),findCycles:m(),floydWarshall:v(),isAcyclic:b(),postorder:E(),preorder:k(),prim:j(),shortestPaths:_(),reduce:w(),tarjan:g(),topsort:y()}}),C=a();t.exports={Graph:C.Graph,json:d(),alg:N(),version:C.version}}),a=i((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),d=i((e,t)=>{var r=s().Graph,n=a();t.exports=function(e,t){var s,a;let l,c,h,u,p;if(1>=e.nodeCount())return[];let f=(s=e,a=t||o,l=new r,c=0,h=0,s.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),s.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=a(e);l.setEdge(e.v,e.w,t+r),h=Math.max(h,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),u=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(h+c+3).map(()=>new n),p=c+1,l.nodes().forEach(e=>{d(u,p,l.node(e))}),{graph:l,buckets:u,zeroIdx:p});return(function(e,t,r){let n=[],o=t[t.length-1],s=t[0],a;for(;e.nodeCount();){for(;a=s.dequeue();)i(e,t,r,a);for(;a=o.dequeue();)i(e,t,r,a);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(a=t[o].dequeue()){n=n.concat(i(e,t,r,a,!0));break}}}return n})(f.graph,f.buckets,f.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let i=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),a=e.node(n.v);o&&i.push({v:n.v,w:n.w}),a.out-=s,d(t,r,a)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),i=n.w,s=e.node(i);s.in-=o,d(t,r,s)}),e.removeNode(n.v),i}function d(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}}),l=i((e,t)=>{var r=s().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=d(n);return r.dummy=t,e.setNode(o,r),o}t.exports={addBorderNode:function(e,t,r,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=o),n(e,"border",i,t)},addDummyNode:n,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t},buildLayerMatrix:function(e){let t=l(i(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,i=e.y,s=t.x-o,a=t.y-i,d=e.width/2,l=e.height/2;if(!s&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(s)*l?(a<0&&(l=-l),r=l*s/a,n=l):(s<0&&(d=-d),r=d,n=d*a/s),{x:o+r,y:i+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:i,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}));e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});let n=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%i!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:d,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let r=function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function i(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var a=0;function d(e){return e+""+ ++a}function l(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),c=i((e,t)=>{var r=d(),n=l().uniqueId;t.exports={run:function(e){var t,o;let i,s,a;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(i=[],s={},a={},(o=e).nodes().forEach(function e(t){Object.hasOwn(a,t)||(a[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?i.push(t):e(t.w)}),delete s[t])}),i)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),h=i((e,t)=>{var r=l();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,i,s=t.v,a=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,h=e.edge(t),u=h.labelRank;if(l!==a+1){for(e.removeEdge(t),i=0,++a;a<l;++i,++a)h.points=[],o={width:0,height:0,edgeLabel:h,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",o,"_d"),a===u&&(o.width=h.width,o.height=h.height,o.dummy="edge-label",o.labelpos=h.labelpos),e.setEdge(s,n,{weight:h.weight},c),0===i&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:h.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}}}),u=i((e,t)=>{var{applyWithChunking:r}=l();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var s=r(Math.min,e.outEdges(o).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),i.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),p=i((e,t)=>{var r=s().Graph,n=u().slack;t.exports=function(e){var t,o,i,s,a=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(a.setNode(d,{});t=a,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(i=>{var s=i.v,a=r===s?i.w:s;t.hasNode(a)||n(o,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),e(a))})}),t.nodeCount()<l;)i=function(e,t){return t.edges().reduce((r,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=n(t,o)),i<r[0]?[i,o]:r},[1/0,null])[1]}(a,e),s=a.hasNode(i.v)?n(e,i):-n(e,i),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(a,e,s);return a}}),f=i((e,t)=>{var r=p(),n=u().slack,o=u().longestPath,i=s().alg.preorder,a=s().alg.postorder,d=l().simplify;function c(e){o(e=d(e));var t,n,i=r(e);for(g(i),h(i,e);t=m(i);)n=v(i,e,t),y(i,e,t,n)}function h(e,t){var r=a(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,i,s;return n=e,o=t,i=r,s=n.node(i).parent,void(n.edge(i,s).cutvalue=f(n,o,i))})}function f(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),s=0;return i||(o=!1,i=t.edge(n,r)),s=i.weight,t.nodeEdges(r).forEach(i=>{var a=i.v===r,d=a?i.w:i.v;if(d!==n){var l,c,h,u=a===o,p=t.edge(i).weight;if(s+=u?p:-p,l=e,c=r,h=d,l.hasEdge(c,h)){var f=e.edge(r,d).cutvalue;s+=u?-f:f}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var s=n,a=t.node(o);return r[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(r,i)||(n=e(t,r,n,i,o))}),a.low=s,a.lim=n++,i?a.parent=i:delete a.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v(e,t,r){var o=r.v,i=r.w;t.hasEdge(o,i)||(o=r.w,i=r.v);var s=e.node(o),a=e.node(i),d=s,l=!1;return s.lim>a.lim&&(d=a,l=!0),t.edges().filter(t=>l===b(e,e.node(t.v),d)&&l!==b(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function y(e,t,r,n){var o,s,a,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),h(e,t),o=e,s=t,a=o.nodes().find(e=>!s.node(e).parent),(d=(d=i(o,a)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=s.edge(e,t),n=!1;r||(r=s.edge(t,e),n=!0),s.node(e).rank=s.node(t).rank+(n?r.minlen:-r.minlen)})}function b(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=h,c.calcCutValue=f,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=y}),g=i((e,t)=>{var r=u().longestPath,n=p(),o=f();t.exports=function(e){var t,s=e.graph().ranker;if(s instanceof Function)return s(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":i(e);case"none":}};var i=r}),m=i((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let i=n;t.children(o).forEach(e),r[o]={low:i,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,i=function(e,t,r,n){let o=[],i=[],s=Math.min(t[r].low,t[n].low),a=Math.max(t[r].lim,t[n].lim),d,l;d=r;do o.push(d=e.parent(d));while(d&&(t[d].low>s||a>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)i.push(d);return{path:o.concat(i.reverse()),lca:l}}(e,o,n.v,n.w),s=i.path,a=i.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==a&&e.node(l).maxRank<r.rank;)d++;l===a&&(c=!1)}if(!c){for(;d<s.length-1&&e.node(l=s[d+1]).minRank<=r.rank;)d++;l=s[d]}e.setParent(t,l),t=e.successors(t)[0]}})}}),v=i((e,t)=>{var r=l();t.exports={run:function(e){var t,n,o;let i=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var i=t.children(r);i&&i.length&&i.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),a=Object.values(s),d=r.applyWithChunking(Math.max,a)-1,l=2*d+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,o,i,s,a,d){let l=t.children(d);if(!l.length){d!==n&&t.setEdge(n,d,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),h=r.addBorderNode(t,"_bb"),u=t.node(d);t.setParent(c,d),u.borderTop=c,t.setParent(h,d),u.borderBottom=h,l.forEach(r=>{e(t,n,o,i,s,a,r);let l=t.node(r),u=l.borderTop?l.borderTop:r,p=l.borderBottom?l.borderBottom:r,f=l.borderTop?i:2*i,g=u!==p?1:s-a[d]+1;t.setEdge(c,u,{weight:f,minlen:g,nestingEdge:!0}),t.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+a[d]})})(e,i,l,c,d,s,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),y=i((e,t)=>{var r=l();function n(e,t,n,o,i,s){let a=i[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);i[t][s]=d,e.setParent(d,o),a&&e.setEdge(a,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),i=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,i,t),n(e,"borderRight","_br",r,i,t)}})}}),b=i((e,t)=>{function r(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>n(e.edge(t)))}function n(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let s=e.graph().rankdir.toLowerCase();("bt"===s||"rl"===s)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(o),Object.hasOwn(r,"y")&&o(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>i(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),r(e))}}}),w=i((e,t)=>{var r=l();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),i=r.applyWithChunking(Math.max,o),s=r.range(i+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),x=i((e,t)=>{var r=l().zipObject;t.exports=function(e,t){let n=0;for(let o=1;o<t.length;++o)n+=function(e,t,n){let o=r(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let d=Array(a).fill(0),l=0;return i.forEach(e=>{let t=e.pos+s;d[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=d[t+1]),t=t-1>>1,d[t]+=e.weight;l+=e.weight*r}),l}(e,t[o-1],t[o]);return n}}),E=i((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),k=i((e,t)=>{var r=l();t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}),j=i((e,t)=>{var r=l();function n(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}t.exports=function(e,t){var o;let i=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=i.lhs,a=i.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,h=0;s.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),h=n(d,a,h),s.forEach(e=>{h+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=n(d,a,h)});let u={vs:d.flat(!0)};return c&&(u.barycenter=l/c,u.weight=c),u}}),_=i((e,t)=>{var r=E(),n=k(),o=j();t.exports=function e(t,i,s,a){var d,l;let c=t.children(i),h=t.node(i),u=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,f={};u&&(c=c.filter(e=>e!==u&&e!==p));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let i=e(t,r.v,s,a);f[r.v]=i,Object.hasOwn(i,"barycenter")&&(n=r,o=i,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+o.barycenter*o.weight)/(n.weight+o.weight),n.weight+=o.weight):(n.barycenter=o.barycenter,n.weight=o.weight))}});let m=n(g,s);d=m,l=f,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,a);if(u&&(v.vs=[u,v.vs,p].flat(!0),t.predecessors(u).length)){let e=t.node(t.predecessors(u)[0]),r=t.node(t.predecessors(p)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+r.order)/(v.weight+2),v.weight+=2}return v}}),N=i((e,t)=>{var r=s().Graph,n=l();t.exports=function(e,t,o,i){i||(i=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),a=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(r=>{let n=e.node(r),i=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(a.setNode(r),a.setParent(r,i||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=a.edge(n,r),i=void 0!==o?o.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+i})}),Object.hasOwn(n,"minRank")&&a.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),a}}),C=i((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let i=e.parent(r),s,a;for(;i;){if((s=e.parent(i))?(a=n[s],n[s]=i):(a=o,o=i),a&&a!==i)return void t.setEdge(a,i);i=s}})}}),O=i((e,t)=>{var r=w(),n=x(),o=_(),i=N(),a=C(),d=s().Graph,c=l();function h(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){return i(e,t,r,n.get(t)||[])})}function u(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,i={}){if("function"==typeof i.customOrder)return void i.customOrder(t,e);let s=c.maxRank(t),l=h(t,c.range(1,s+1),"inEdges"),p=h(t,c.range(s-1,-1,-1),"outEdges"),f=r(t);if(u(t,f),i.disableOptimalOrderHeuristic)return;let g=1/0,m,v=i.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new d;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let i=e.graph().root,s=o(e,i,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),a(e,n,s.vs)})})(e%2?l:p,e%4>=2,v),f=c.buildLayerMatrix(t);let i=n(t,f);i<g?(r=0,m=Object.assign({},f),g=i):i===g&&(m=structuredClone(f))}u(t,m)}}),R=i((e,t)=>{var r=s().Graph,n=l();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,i=0,s=t.length,d=n[n.length-1];return n.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),h=c?e.node(c).order:s;(c||t===d)&&(n.slice(i,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let i=e.node(n),s=i.order;(s<o||h<s)&&!(i.dummy&&e.node(t).dummy)&&a(r,n,t)})}),i=l+1,o=h)}),n}),r}function i(e,t){let r={};function o(t,o,i,s,d){let l;n.range(o,i).forEach(n=>{l=t[n],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>d)&&a(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,i,s=0;return r.forEach((a,d)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(i=e.node(t[0]).order,o(r,s,d,n,i),s=d,n=i)}o(r,s,r.length,i,t.length)}),r}),r}function a(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function d(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function c(e,t,r,n){let o={},i={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=n(e);if(a.length){let n=((a=a.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let l=Math.floor(n),c=Math.ceil(n);l<=c;++l){let n=a[l];i[e]===e&&t<s[n]&&!d(r,e,n)&&(i[n]=e,i[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:i}}function h(e,t,n,o,i){var s,a,d,l,c,h,u;let p,f,g,m={},v=(s=e,a=t,d=n,l=i,p=new r,g=(c=(f=s.graph()).nodesep,h=f.edgesep,u=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),i,s;if(i=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(i+=u?s:-s),s=0,i+=(n.dummy?h:c)/2,i+=(o.dummy?h:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(i+=u?s:-s),s=0,i}),a.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(p.setNode(r),t){var n=d[t],o=p.edge(n,r);p.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),p),y=i?"borderLeft":"borderRight";function b(e,t){let r=v.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return b(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),b(function(t){let r=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==y&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function u(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var i,s;let a=(i=e,s=t,i.node(s).width/2);n=Math.max(r+a,n),o=Math.min(r-a,o)});let i=n-o;return i<t[0]&&(t=[i,r]),t},[1/0,null])[1]}function p(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),i=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let a=r+s,d=e[a];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=i-n.applyWithChunking(Math.max,l)),c&&(e[a]=n.mapValues(d,e=>e+c))})})}function f(e,t){return n.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=n.buildLayerMatrix(e),r=Object.assign(o(e,t),i(e,t)),s={},a;["u","d"].forEach(o=>{a="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(a=a.map(e=>Object.values(e).reverse()));let i=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,a,r,i),l=h(e,a,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),s[o+t]=l})});let d=u(e,s);return p(s,d),f(s,e.graph().align)},findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:d,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:p,findSmallestWidthAlignment:u,balance:f}}),P=i((e,t)=>{var r=l(),n=R().positionX;t.exports=function(e){var t;let o,i,s,a;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),i=t.graph().ranksep,s=t.graph().rankalign,a=0,o.forEach(e=>{let r=e.reduce((e,r)=>{let n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>{let n=t.node(e);"top"===s?n.y=a+n.height/2:"bottom"===s?n.y=a+r-n.height/2:n.y=a+r/2}),a+=r+i}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=i((e,t)=>{var r=c(),n=h(),o=g(),i=l().normalizeRanks,a=m(),d=l().removeEmptyRanks,u=v(),p=y(),f=b(),w=O(),x=P(),E=l(),k=s().Graph;t.exports=function(e,t={}){let s=t.debugTiming?E.time:E.notime;return s("layout",()=>{let l=s(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=D(t.graph()),r.setGraph(Object.assign({},_,S(n,j),E.pick(n,N))),t.nodes().forEach(e=>{let n=S(D(t.node(e)),C);Object.keys(R).forEach(e=>{void 0===n[e]&&(n[e]=R[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=D(t.edge(e));r.setEdge(e,Object.assign({},T,S(n,M),E.pick(n,L)))}),r});return s(" runLayout",()=>{var e,c,h;return e=l,c=s,h=t,void(c(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),c(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),c(" acyclic",()=>r.run(e)),c(" nestingGraph.run",()=>u.run(e)),c(" rank",()=>o(E.asNonCompoundGraph(e))),c(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};E.addDummyNode(t,"edge-proxy",n,"_ep")}})}),c(" removeEmptyRanks",()=>d(e)),c(" nestingGraph.cleanup",()=>u.cleanup(e)),c(" normalizeRanks",()=>i(e)),c(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),c(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),c(" normalize.run",()=>n.run(e)),c(" parentDummyChains",()=>a(e)),c(" addBorderSegments",()=>p(e)),c(" order",()=>w(e,h)),c(" insertSelfEdges",()=>{var t;return t=e,void E.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{E.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),c(" adjustCoordinateSystem",()=>f.adjust(e)),c(" position",()=>x(e)),c(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),o=n.x+n.width/2,i=n.y,s=r.x-o,a=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:i-a},{x:o+5*s/6,y:i-a},{x:o+s,y:i},{x:o+5*s/6,y:i+a},{x:o+2*s/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}),c(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),c(" normalize.undo",()=>n.undo(e)),c(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),c(" undoCoordinateSystem",()=>f.undo(e)),c(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,i=e.graph(),s=i.marginx||0,a=i.marginy||0;function d(e){let i=e.x,s=e.y,a=e.width,d=e.height;t=Math.min(t,i-a/2),r=Math.max(r,i+a/2),n=Math.min(n,s-d/2),o=Math.max(o,s+d/2)}e.nodes().forEach(t=>d(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&d(r)}),t-=s,n-=a,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+s,i.height=o-n+a})(e)),c(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=o,s=n),r.points.unshift(E.intersectRect(n,i)),r.points.push(E.intersectRect(o,s))})}),c(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),c(" acyclic.undo",()=>r.undo(e)))}),s(" updateInputGraph",()=>{var t,r;return t=e,r=l,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),l})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],C=["width","height","rank"],R={width:0,height:0},M=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function S(e,t){return E.mapValues(E.pick(e,t),Number)}function D(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),T=i((e,t)=>{var r=l(),n=s().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),L=i((e,t)=>{t.exports="2.0.4"});let S=i((e,t)=>{t.exports={graphlib:s(),layout:M(),debug:T(),util:{time:l().time,notime:l().notime},version:L()}})(),D={featureNode:{width:288,height:140},repositoryNode:{width:288,height:50},addRepositoryNode:{width:224,height:50}};function A(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:D[e.type??""]??t}function F(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:i=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let a=new S.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:n,ranksep:i,nodesep:s});let d=new Set;for(let e of t)d.add(e.source),d.add(e.target);let l=e.filter(e=>d.has(e.id)),c=e.filter(e=>!d.has(e.id));for(let e of l){let t=A(e,o);a.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)a.hasNode(e.source)&&a.hasNode(e.target)&&a.setEdge(e.source,e.target,{},e.id);S.layout(a);let{targetPosition:h,sourcePosition:u}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),p=[];for(let e of l){let t=a.node(e.id),r=A(e,o);p.push({...e,targetPosition:h,sourcePosition:u,position:{x:t.x-r.width/2,y:t.y-r.height/2}})}if(c.length>0){let e=0,t=1/0;for(let r of p){let n=A(r,o);e=Math.max(e,r.position.y+n.height),t=Math.min(t,r.position.x)}t===1/0&&(t=0);for(let r=0;r<c.length;r++){let n=c[r],i=A(n,o);p.push({...n,targetPosition:h,sourcePosition:u,position:{x:t,y:e+30+r*(i.height+20)}})}}return{nodes:p,edges:[...t]}}var I=e.i(19886),z=e.i(21023);let G=(0,z.createServerReference)("40ab2b158297b58deefdef3b5b2edb693133aef266",z.callServer,void 0,z.findSourceMapURL,"addRepository"),B=(0,z.createServerReference)("4078d71e027636bff51d7c1abcd6587e2c672fea3d",z.callServer,void 0,z.findSourceMapURL,"deleteRepository");var $=e.i(39443),q=e.i(8361),W=e.i(99045);let V=0;function H(e,i){let s=(0,r.useRouter)(),[a,d]=(0,t.useState)(e),[l,c]=(0,t.useState)(i),h=(0,t.useRef)(i),u=(0,t.useCallback)(e=>{c(t=>{let r="function"==typeof e?e(t):e;return h.current=r,r})},[]),p=(0,q.useSoundAction)("delete"),f=(0,q.useSoundAction)("create"),g=e.map(e=>e.id).sort().join(","),m=i.map(e=>e.id).sort().join(","),v=(0,t.useRef)(new Map),y=e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(",");(0,t.useEffect)(()=>{d(t=>{let r=new Map(t.map(e=>[e.id,e])),n=new Set(e.map(e=>e.id)),o=t.filter(e=>"featureNode"===e.type&&"creating"===e.data.state&&!n.has(e.id));return e.map(e=>{let t=r.get(e.id);if(t)return{...e,position:t.position};if("featureNode"===e.type&&o.length>0){let t=o.shift();return{...e,position:t.position}}return e})})},[g,e]),(0,t.useEffect)(()=>{u(i)},[m,i,u]);let{events:b}=(0,$.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=v.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,o=t.get(r.id);void 0!==o&&o!==e.state&&(b.some(t=>t.featureId===e.featureId&&(0,W.mapEventTypeToState)(t.eventType)===e.state)||("done"===e.state?n.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?n.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>{s.push(`/feature/${e.featureId}`)}}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[y,e,b,s]);let w=(0,t.useRef)(0),x=(0,t.useRef)(void 0);(0,t.useEffect)(()=>()=>clearTimeout(x.current),[]),(0,t.useEffect)(()=>{if(b.length<=w.current)return;let e=b.slice(w.current);for(let t of(w.current=b.length,e)){let e=(0,W.mapEventTypeToState)(t.eventType),r=(0,W.mapPhaseNameToLifecycle)(t.phaseName);d(n=>n.map(n=>{if("featureNode"!==n.type)return n;let o=n.data;return o.featureId!==t.featureId?n:{...n,data:{...o,state:e,...void 0!==r&&{lifecycle:r}}}}))}clearTimeout(x.current),x.current=setTimeout(()=>s.refresh(),3e3)},[b,s]),(0,t.useEffect)(()=>{if(!a.some(e=>{if("featureNode"!==e.type)return!1;let t=e.data;return"running"===t.state||"action-required"===t.state||"creating"===t.state}))return;let e=setInterval(()=>s.refresh(),5e3);return()=>clearInterval(e)},[a,s]);let E=(0,t.useCallback)(e=>{d(t=>(0,o.applyNodeChanges)(e,t))},[]),k=(0,t.useCallback)(e=>{e.source&&e.target&&d(t=>{let r=t.find(t=>t.id===e.source);return r?.type!=="repositoryNode"||u(r=>r.some(r=>{let n=t.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===e.target})?r:[...r,{id:`edge-${e.source}-${e.target}`,source:e.source,target:e.target,style:{strokeDasharray:"5 5"}}]),t})},[u]),j=(0,t.useCallback)((e,t,r)=>{let n=`feature-${Date.now()}-${V++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return d(t=>{let r,i=e?new Set(h.current.filter(t=>t.source===e).map(e=>e.target)):new Set,s=t.filter(e=>i.has(e.id));if(s.length>0){let e=s.map(e=>e.position.y).sort((e,t)=>e-t),t=e[e.length-1],n=e.length>1?e[1]-e[0]:160;r={x:s[0].position.x,y:t+n}}else if(e){let n=t.find(t=>t.id===e);r=n?{x:n.position.x+488,y:n.position.y}:{x:400,y:200}}else{let e=t.length>0?Math.max(...t.map(e=>e.position.y)):0;r={x:400,y:t.length>0?e+160:200}}let a=r.y+140,d=new Set([e,...i]),l=t.filter(e=>d.has(e.id)).reduce((e,t)=>{let r="featureNode"===t.type?140:50;return Math.max(e,t.position.y+r)},0),c=Math.max(0,a-l),u=c>0?t.map(e=>d.has(e.id)||i.has(e.id)?e:e.position.y>=l?{...e,position:{...e.position,y:e.position.y+c}}:e):t;return[...e?u.map(t=>{if(t.id!==e)return t;let n=[...s.map(e=>e.position.y),r.y],o=(Math.min(...n)+Math.max(...n)+140)/2,i="featureNode"===t.type?140:50;return{...t,position:{...t.position,y:o-i/2}}}):u,{id:n,type:"featureNode",position:r,data:o}]}),e&&u(t=>[...t,{id:"dependencyEdge"===r?`dep-${e}-${n}`:`edge-${e}-${n}`,source:e,target:n,...r?{type:r}:{style:{strokeDasharray:"5 5"}}}]),n},[u]),_=(0,t.useCallback)(async e=>{try{let t=await (0,I.deleteFeature)(e);if(t.error)return void n.toast.error(t.error);d(t=>{let r=t.filter(t=>t.id!==e),n=l.filter(t=>t.source!==e&&t.target!==e),o=F(r,n,{direction:"LR",ranksep:200,nodesep:60});return u(o.edges),o.nodes}),p.play(),n.toast.success("Feature deleted successfully"),s.refresh()}catch{n.toast.error("Failed to delete feature")}},[s,l,p,u]),N=(0,t.useCallback)(async e=>{let t=`repo-${e}`;d(e=>e.filter(e=>e.id!==t)),u(e=>e.filter(e=>e.source!==t&&e.target!==t));try{let t=await B(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),s.refresh();return}p.play(),n.toast.success("Repository removed"),s.refresh()}catch{n.toast.error("Failed to remove repository"),s.refresh()}},[s,p,u]),C=(0,t.useCallback)(e=>{d(t=>{let r=F(t,l,{direction:e,ranksep:60,nodesep:20});return u(r.edges),r.nodes})},[l,u]);return{nodes:a,edges:l,onNodesChange:E,handleConnect:k,handleAddRepository:(0,t.useCallback)(e=>{let t=`repo-temp-${Date.now()}`,r=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e,o=0;d(n=>{let i=n.filter(e=>"repositoryNode"===e.type),s=n.find(e=>"addRepositoryNode"===e.type);s&&(o=s.position.y);let a={x:i[0]?.position.x??s?.position.x??50,y:s?s.position.y:0},d=s?s.position.y+50+15:a.y+50+15;return n.map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:d}}:e).concat({id:t,type:"repositoryNode",position:a,data:{name:r,repositoryPath:e,id:t}})}),G({path:e,name:r}).then(e=>{if(e.error){d(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error(e.error);return}let r=e.repository,i=`repo-${r.id}`;d(e=>e.map(e=>e.id===t?{...e,id:i,data:{...e.data,id:r.id,repositoryPath:r.path}}:e)),u(e=>e.map(e=>({...e,source:e.source===t?i:e.source,target:e.target===t?i:e.target,id:e.id.replace(t,i)}))),f.play(),s.refresh()}).catch(()=>{d(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error("Failed to add repository")})},[s,f,u]),handleLayout:C,handleDeleteFeature:_,handleDeleteRepository:N,createFeatureNode:j}}e.s(["useControlCenterState",()=>H],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),i=e.i(3214),s=e.i(35364);e.i(54793);var a=e.i(7729);e.i(47506);var d=e.i(89313),l=e.i(92002),c=e.i(3645);let h=(0,c.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var u=e.i(8986),p=e.i(38573),f=e.i(19933),g=e.i(67669),m=e.i(24042),v=e.i(64970),y=e.i(31777);e.i(81803);var b=e.i(72714),w=e.i(71326),x=e.i(2828);e.i(99348);var E=e.i(17466),k=e.i(8537),j=e.i(63629),_=e.i(76852);function N({data:e}){let[o,s]=(0,n.useState)(!1),a=(0,_.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),d=(0,k.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),c="Booting"===d.status||"Ready"===d.status;return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),s(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(g.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.AlertDialog,{open:o,onOpenChange:s,children:(0,t.jsxs)(w.AlertDialogContent,{size:"sm",children:[(0,t.jsxs)(w.AlertDialogHeader,{children:[(0,t.jsx)(w.AlertDialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.AlertDialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.AlertDialogFooter,{children:[(0,t.jsx)(w.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(w.AlertDialogAction,{variant:"destructive",onClick:()=>e.onDelete?.(e.id),children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-default items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(h,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,y.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in IDE",onClick:a.openInIde,loading:a.ideLoading,error:!!a.ideError,icon:u.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in Shell",onClick:a.openInShell,loading:a.shellLoading,error:!!a.shellError,icon:p.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open Folder",onClick:a.openFolder,loading:a.folderLoading,error:!!a.folderError,icon:f.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open Folder"})]})}),j.featureFlags.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:c?"Stop Dev Server":"Start Dev Server",onClick:c?d.stop:d.deploy,loading:d.deployLoading||d.stopLoading,error:!!d.deployError,icon:c?v.Square:m.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:c?"Stop Dev Server":"Start Dev Server"})]})}),c?(0,t.jsx)(E.DeploymentStatusBadge,{status:d.status,url:d.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:"text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",children:(0,t.jsx)(i.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:l.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}e.i(1650),e.i(45811),e.i(25235),e.i(1354);var C=e.i(1963);function O(e){let[n]=(0,l.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}function R({nodes:e,edges:o,selectedFeatureId:l,onNodesChange:c,onAddFeature:h,onNodeAction:u,onNodeSettings:p,onConnect:f,onNodeClick:g,onPaneClick:m,onRepositoryAdd:v,onRepositoryClick:y,onRepositoryDelete:b,onFeatureDelete:w,onRepositorySelect:x,onCanvasDrag:E,toolbar:k,emptyState:j}){let _=(0,n.useMemo)(()=>({featureNode:d.FeatureNode,repositoryNode:N,addRepositoryNode:C.AddRepositoryNode}),[]),R=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),P=(0,n.useCallback)(t=>{let r=e.find(e=>e.id===t.source);return r?.type!=="repositoryNode"||!o.some(r=>{let n=e.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===t.target})},[e,o]),M=(0,n.useMemo)(()=>e.map(e=>({...e,..."featureNode"===e.type&&{selected:null!=l&&e.data.featureId===l},data:{...e.data,showHandles:o.length>0,..."featureNode"===e.type&&"creating"!==e.data.state?{onAction:u?()=>u(e.id):void 0,onSettings:p?()=>p(e.id):void 0,onDelete:w}:{},..."repositoryNode"===e.type&&{onAdd:v?()=>v(e.id):void 0,onClick:y?()=>y(e.id):void 0,onDelete:b},..."addRepositoryNode"===e.type&&{onSelect:x?e=>x(e):void 0}}})),[e,o.length,l,u,p,w,v,y,b,x]);return 0===e.length?j?(0,t.jsx)("div",{"data-testid":"features-canvas-empty",className:"h-full w-full",children:j}):(0,t.jsx)("div",{"data-testid":"features-canvas-empty",children:(0,t.jsx)(a.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(s.Button,{onClick:h,children:[(0,t.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})})}):(0,t.jsx)("div",{"data-testid":"features-canvas","data-no-drawer-close":!0,className:"pointer-events-auto h-full w-full",children:(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsxs)(r.ReactFlow,{nodes:M,edges:o,nodeTypes:_,edgeTypes:R,isValidConnection:P,onConnect:f,onNodesChange:c,onNodeClick:g,onPaneClick:m,onMoveStart:E,defaultViewport:{x:30,y:30,zoom:.85},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[(0,t.jsx)(r.Background,{}),(0,t.jsx)(r.Controls,{}),k]})})})}let P=(0,c.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var M=e.i(60253);let T="shep:notification-banner-dismissed";function L(){let[e,r]=(0,n.useState)(!1);(0,n.useEffect)(()=>{void 0===globalThis.Notification||"default"!==globalThis.Notification.permission||"true"!==localStorage.getItem(T)&&r(!0)},[]);let o=(0,n.useCallback)(async()=>{if(void 0===globalThis.Notification)return;let e=await globalThis.Notification.requestPermission();("granted"===e||"denied"===e)&&r(!1)},[]),i=(0,n.useCallback)(()=>{localStorage.setItem(T,"true"),r(!1)},[]);return e?(0,t.jsxs)("div",{className:"bg-background absolute bottom-4 left-4 z-50 flex max-w-sm items-center gap-3 rounded-lg border p-3 shadow-lg",children:[(0,t.jsx)(P,{className:"text-muted-foreground size-5 shrink-0"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Enable desktop notifications to stay updated on feature progress."}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(s.Button,{size:"sm",onClick:o,children:"Enable"}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon-xs",onClick:i,"aria-label":"Dismiss notification banner",children:(0,t.jsx)(M.X,{})})]})]}):null}var S=e.i(5147),D=e.i(8361),A=e.i(30153);let F=(0,c.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var I=e.i(33548),z=e.i(23925),G=e.i(83428),B=e.i(78986);let $=["cd ~/my-repo",'shep feat new "create modern, sleek dashboards"'];function q({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[a,d]=(0,n.useState)(!1);async function l(){if(!a){d(!0);try{let t=await (0,B.pickFolder)();t&&e?.(t)}finally{d(!1)}}}let c=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText($.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]);return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,y.cn)("relative h-full w-full",r),children:[(0,t.jsx)("div",{className:"absolute inset-0 [background-image:radial-gradient(circle,_var(--color-border)_1px,_transparent_1px)] [background-size:24px_24px]"}),(0,t.jsxs)("div",{className:"absolute top-8 left-8 z-10",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-3xl font-light",children:"Control Center"})]}),(0,t.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-6",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(h,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:l,disabled:a,className:"border-muted-foreground/30 hover:border-primary hover:text-primary flex cursor-pointer items-center gap-3 rounded-lg border-2 border-dashed px-8 py-4 transition-colors disabled:cursor-wait disabled:opacity-60",children:[a?(0,t.jsx)(G.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(i.Plus,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a?"Opening...":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-border h-px w-16"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(F,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Or start from the command line"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-16"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-lg bg-zinc-900 px-5 py-4 font-mono text-sm text-zinc-100",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:c,className:"absolute top-3 right-3 cursor-pointer rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200","aria-label":"Copy commands",children:o?(0,t.jsx)(z.Check,{className:"h-4 w-4"}):(0,t.jsx)(I.Copy,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"space-y-1",children:$.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Feature will appear on canvas once created"})]})})]})}var W=e.i(17840);function V({initialNodes:e,initialEdges:r}){let i,s=(0,o.useRouter)(),a=(0,o.usePathname)(),d=(i=(0,o.usePathname)().match(/^\/feature\/(.+)$/),i?.[1]??null),l=(0,D.useSoundAction)("click"),{guardedNavigate:c}=(0,A.useDrawerCloseGuard)(),{nodes:h,edges:u,onNodesChange:p,handleConnect:f,handleAddRepository:g,handleDeleteFeature:m,handleDeleteRepository:v,createFeatureNode:y}=(0,W.useControlCenterState)(e,r),{setFeatures:b}=(0,S.useSidebarFeaturesContext)(),w=(0,n.useMemo)(()=>h.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.runtime??""}:${t.startedAt??""}`}).sort().join(","),[h]);(0,n.useEffect)(()=>{b(h.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data,r=(0,S.mapNodeStateToSidebarStatus)(t.state);return r?{featureId:t.featureId,name:t.name,status:r,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime}}:null}).filter(Boolean))},[w,h,b]);let x=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let e=t.data;"creating"!==e.state&&c(()=>{l.play(),s.push(`/feature/${e.featureId}`)})}},[s,l,c]),E=(0,n.useCallback)(()=>{l.play(),s.push("/create")},[s,l]),k=(0,n.useCallback)(e=>{l.play();let t=h.find(t=>t.id===e),r=t?.data?.repositoryPath;r?s.push(`/create?repo=${encodeURIComponent(r)}`):s.push("/create")},[h,s,l]),j=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=u.find(t=>t.target===e),n=r?h.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;l.play();let i=new URLSearchParams;o&&i.set("repo",o),i.set("parent",t),s.push(`/create?${i.toString()}`)},[h,u,s,l]),_=(0,n.useCallback)(e=>{let t=h.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&c(()=>s.push(`/repository/${e.id}`))}},[h,s,c]),N=(0,n.useCallback)(()=>{"/"!==a&&c(()=>s.push("/"))},[s,a,c]);return((0,n.useEffect)(()=>{let e=e=>{g(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[g]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail,r=h.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);y(r?.id??null,{state:"creating",name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[h,y]),h.some(e=>"repositoryNode"===e.type))?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(R,{nodes:h,edges:u,selectedFeatureId:d,onNodesChange:p,onConnect:f,onAddFeature:E,onNodeAction:j,onNodeClick:x,onPaneClick:N,onRepositoryAdd:k,onRepositoryClick:_,onRepositoryDelete:v,onFeatureDelete:m,onRepositorySelect:g,emptyState:(0,t.jsx)(q,{onRepositorySelect:g})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(q,{onRepositorySelect:g})]})}function H({initialNodes:e,initialEdges:n,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(V,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>H],48246)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17840,e=>{"use strict";var t=e.i(79054),r=e.i(31406),n=e.i(60112),o=e.i(53271),i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=i((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,n)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?r(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n},i=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function i(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}return o+"\x01"+i+"\x01"+(void 0===n?"\0":n)}function s(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,t,n,o,s=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var d=i(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,d))return s&&(this._edgeLabels[d]=o),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[d]=s?o:this._defaultEdgeLabelFn(e,t,n);var l=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var s=o;o=i,i=s}var a={v:o,w:i};return n&&(a.name=n),a}(this._isDirected,e,t,n);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[d]=l,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][d]=l,this._out[e][d]=l,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var o=1==arguments.length?s(this._isDirected,arguments[0]):i(this._isDirected,e,t,r),a=this._edgeObjs[o];return a&&(e=a.v,t=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,r){if(e){var n=Object.values(e);return r?n.filter(function(e){return e.v===t&&e.w===r||e.v===r&&e.w===t}):n}}}}),s=n((e,t)=>{t.exports="3.0.2"}),a=n((e,t)=>{t.exports={Graph:i(),version:s()}}),d=n((e,t)=>{var r=i();t.exports={write:function(e){var t,r,n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(function(e){var t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})};return void 0!==e.graph()&&(n.value=structuredClone(e.graph())),n},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=n((e,t)=>{t.exports=function(e,t,n,o){return function(e,t,r,n){var o={},i=!0,s=0,a=e.nodes(),d=function(e){var t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},l=function(){a.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};a.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=a.length,h=1;h<c&&(i=!1,s++,l(),i);h++);if(s===c-1&&(i=!1,l(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),n||r,o||function(t){return e.outEdges(t)})};var r=()=>1}),c=n((e,t)=>{t.exports=function(e){var t,r={},n=[];return e.nodes().forEach(function(o){t=[],function n(o){Object.hasOwn(r,o)||(r[o]=!0,t.push(o),e.successors(o).forEach(n),e.predecessors(o).forEach(n))}(o),t.length&&n.push(t)}),n}}),h=n((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(!Object.hasOwn(r,e=String(e))){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}}}),u=n((e,t)=>{var r=h();t.exports=function(e,t,o,i){return function(e,t,n,o){var i,s,a={},d=new r,l=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),l=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<r.distance&&(r.distance=l,r.predecessor=i,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;a[e]={distance:r},d.add(e,r)});d.size()>0&&(s=a[i=d.removeMin()]).distance!==1/0;)o(i).forEach(l);return a}(e,String(t),o||n,i||function(t){return e.outEdges(t)})};var n=()=>1}),p=n((e,t)=>{var r=u();t.exports=function(e,t,n){return e.nodes().reduce(function(o,i){return o[i]=r(e,i,t,n),o},{})}}),f=n((e,t)=>{t.exports=function(e,t,r){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[r].predecessor&&r!==t)throw Error("Invalid destination vertex");return{weight:e[r].distance,path:function(e,t,r){for(var n=[],o=r;o!==t;)n.push(o),o=e[o].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(n,i)||function i(s){var a=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(i(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(i)}),o}}),m=n((e,t)=>{var r=g();t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),v=n((e,t)=>{t.exports=function(e,t,n){var o,i,s,a,d;return o=e,i=t||r,s=n||function(t){return e.outEdges(t)},a={},(d=o.nodes()).forEach(function(e){a[e]={},a[e][e]={distance:0},d.forEach(function(t){e!==t&&(a[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=i(t);a[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=a[e];d.forEach(function(r){var n=a[r];d.forEach(function(r){var o=n[e],i=t[r],s=n[r],a=o.distance+i.distance;a<s.distance&&(s.distance=a,s.predecessor=i.predecessor)})})}),a};var r=()=>1}),y=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function i(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(i),delete r[s],o.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return o}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),b=n((e,t)=>{var r=y();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),w=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,r,n,o,i,s,a){return Object.hasOwn(o,r)||(o[r]=!0,n||(a=s(a,r)),i(r).forEach(function(r){a=e(t,r,n,o,i,s,a)}),n&&(a=s(a,r))),a}(e,t,"post"===r,s,i,n,o)}),o}}),x=n((e,t)=>{var r=w();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=x();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=i(),n=h();t.exports=function(e,t){var o,i=new r,s={},a=new n;function d(e){var r=e.v===o?e.w:e.v,n=a.priority(r);if(void 0!==n){var i=t(e);i<n&&(s[r]=o,a.decrease(r,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){a.add(e,1/0),i.setNode(e)}),a.decrease(e.nodes()[0],0);for(var l=!1;a.size()>0;){if(Object.hasOwn(s,o=a.removeMin()))i.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return i}}),_=n((e,t)=>{var r=u(),n=l();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return r(e,t,o,i);for(var s=!1,a=e.nodes(),d=0;d<a.length;d++){for(var l=i(a[d]),c=0;c<l.length;c++){var h=l[c],u=h.v===a[d]?h.v:h.w,p=u===h.v?h.w:h.v;0>o({v:u,w:p})&&(s=!0)}if(s)return n(e,t,o,i)}return r(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),N=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:u(),dijkstraAll:p(),extractPath:f(),findCycles:m(),floydWarshall:v(),isAcyclic:b(),postorder:E(),preorder:k(),prim:j(),shortestPaths:_(),reduce:w(),tarjan:g(),topsort:y()}}),C=a();t.exports={Graph:C.Graph,json:d(),alg:N(),version:C.version}}),a=i((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),d=i((e,t)=>{var r=s().Graph,n=a();t.exports=function(e,t){var s,a;let l,c,h,u,p;if(1>=e.nodeCount())return[];let f=(s=e,a=t||o,l=new r,c=0,h=0,s.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),s.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=a(e);l.setEdge(e.v,e.w,t+r),h=Math.max(h,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),u=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(h+c+3).map(()=>new n),p=c+1,l.nodes().forEach(e=>{d(u,p,l.node(e))}),{graph:l,buckets:u,zeroIdx:p});return(function(e,t,r){let n=[],o=t[t.length-1],s=t[0],a;for(;e.nodeCount();){for(;a=s.dequeue();)i(e,t,r,a);for(;a=o.dequeue();)i(e,t,r,a);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(a=t[o].dequeue()){n=n.concat(i(e,t,r,a,!0));break}}}return n})(f.graph,f.buckets,f.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let i=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),a=e.node(n.v);o&&i.push({v:n.v,w:n.w}),a.out-=s,d(t,r,a)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),i=n.w,s=e.node(i);s.in-=o,d(t,r,s)}),e.removeNode(n.v),i}function d(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}}),l=i((e,t)=>{var r=s().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=d(n);return r.dummy=t,e.setNode(o,r),o}t.exports={addBorderNode:function(e,t,r,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=o),n(e,"border",i,t)},addDummyNode:n,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t},buildLayerMatrix:function(e){let t=l(i(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,i=e.y,s=t.x-o,a=t.y-i,d=e.width/2,l=e.height/2;if(!s&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(s)*l?(a<0&&(l=-l),r=l*s/a,n=l):(s<0&&(d=-d),r=d,n=d*a/s),{x:o+r,y:i+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:i,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}));e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});let n=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%i!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:d,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let r=function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function i(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var a=0;function d(e){return e+""+ ++a}function l(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),c=i((e,t)=>{var r=d(),n=l().uniqueId;t.exports={run:function(e){var t,o;let i,s,a;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(i=[],s={},a={},(o=e).nodes().forEach(function e(t){Object.hasOwn(a,t)||(a[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?i.push(t):e(t.w)}),delete s[t])}),i)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),h=i((e,t)=>{var r=l();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,i,s=t.v,a=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,h=e.edge(t),u=h.labelRank;if(l!==a+1){for(e.removeEdge(t),i=0,++a;a<l;++i,++a)h.points=[],o={width:0,height:0,edgeLabel:h,edgeObj:t,rank:a},n=r.addDummyNode(e,"edge",o,"_d"),a===u&&(o.width=h.width,o.height=h.height,o.dummy="edge-label",o.labelpos=h.labelpos),e.setEdge(s,n,{weight:h.weight},c),0===i&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:h.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}}}),u=i((e,t)=>{var{applyWithChunking:r}=l();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var s=r(Math.min,e.outEdges(o).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),i.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),p=i((e,t)=>{var r=s().Graph,n=u().slack;t.exports=function(e){var t,o,i,s,a=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(a.setNode(d,{});t=a,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(i=>{var s=i.v,a=r===s?i.w:s;t.hasNode(a)||n(o,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),e(a))})}),t.nodeCount()<l;)i=function(e,t){return t.edges().reduce((r,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=n(t,o)),i<r[0]?[i,o]:r},[1/0,null])[1]}(a,e),s=a.hasNode(i.v)?n(e,i):-n(e,i),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(a,e,s);return a}}),f=i((e,t)=>{var r=p(),n=u().slack,o=u().longestPath,i=s().alg.preorder,a=s().alg.postorder,d=l().simplify;function c(e){o(e=d(e));var t,n,i=r(e);for(g(i),h(i,e);t=m(i);)n=v(i,e,t),y(i,e,t,n)}function h(e,t){var r=a(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,i,s;return n=e,o=t,i=r,s=n.node(i).parent,void(n.edge(i,s).cutvalue=f(n,o,i))})}function f(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),s=0;return i||(o=!1,i=t.edge(n,r)),s=i.weight,t.nodeEdges(r).forEach(i=>{var a=i.v===r,d=a?i.w:i.v;if(d!==n){var l,c,h,u=a===o,p=t.edge(i).weight;if(s+=u?p:-p,l=e,c=r,h=d,l.hasEdge(c,h)){var f=e.edge(r,d).cutvalue;s+=u?-f:f}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var s=n,a=t.node(o);return r[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(r,i)||(n=e(t,r,n,i,o))}),a.low=s,a.lim=n++,i?a.parent=i:delete a.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v(e,t,r){var o=r.v,i=r.w;t.hasEdge(o,i)||(o=r.w,i=r.v);var s=e.node(o),a=e.node(i),d=s,l=!1;return s.lim>a.lim&&(d=a,l=!0),t.edges().filter(t=>l===b(e,e.node(t.v),d)&&l!==b(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function y(e,t,r,n){var o,s,a,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),h(e,t),o=e,s=t,a=o.nodes().find(e=>!s.node(e).parent),(d=(d=i(o,a)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=s.edge(e,t),n=!1;r||(r=s.edge(t,e),n=!0),s.node(e).rank=s.node(t).rank+(n?r.minlen:-r.minlen)})}function b(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=h,c.calcCutValue=f,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=y}),g=i((e,t)=>{var r=u().longestPath,n=p(),o=f();t.exports=function(e){var t,s=e.graph().ranker;if(s instanceof Function)return s(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":i(e);case"none":}};var i=r}),m=i((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let i=n;t.children(o).forEach(e),r[o]={low:i,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,i=function(e,t,r,n){let o=[],i=[],s=Math.min(t[r].low,t[n].low),a=Math.max(t[r].lim,t[n].lim),d,l;d=r;do o.push(d=e.parent(d));while(d&&(t[d].low>s||a>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)i.push(d);return{path:o.concat(i.reverse()),lca:l}}(e,o,n.v,n.w),s=i.path,a=i.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==a&&e.node(l).maxRank<r.rank;)d++;l===a&&(c=!1)}if(!c){for(;d<s.length-1&&e.node(l=s[d+1]).minRank<=r.rank;)d++;l=s[d]}e.setParent(t,l),t=e.successors(t)[0]}})}}),v=i((e,t)=>{var r=l();t.exports={run:function(e){var t,n,o;let i=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var i=t.children(r);i&&i.length&&i.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),a=Object.values(s),d=r.applyWithChunking(Math.max,a)-1,l=2*d+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,o,i,s,a,d){let l=t.children(d);if(!l.length){d!==n&&t.setEdge(n,d,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),h=r.addBorderNode(t,"_bb"),u=t.node(d);t.setParent(c,d),u.borderTop=c,t.setParent(h,d),u.borderBottom=h,l.forEach(r=>{e(t,n,o,i,s,a,r);let l=t.node(r),u=l.borderTop?l.borderTop:r,p=l.borderBottom?l.borderBottom:r,f=l.borderTop?i:2*i,g=u!==p?1:s-a[d]+1;t.setEdge(c,u,{weight:f,minlen:g,nestingEdge:!0}),t.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+a[d]})})(e,i,l,c,d,s,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),y=i((e,t)=>{var r=l();function n(e,t,n,o,i,s){let a=i[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);i[t][s]=d,e.setParent(d,o),a&&e.setEdge(a,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),i=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,i,t),n(e,"borderRight","_br",r,i,t)}})}}),b=i((e,t)=>{function r(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>n(e.edge(t)))}function n(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let s=e.graph().rankdir.toLowerCase();("bt"===s||"rl"===s)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(o),Object.hasOwn(r,"y")&&o(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>i(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),r(e))}}}),w=i((e,t)=>{var r=l();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),i=r.applyWithChunking(Math.max,o),s=r.range(i+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),x=i((e,t)=>{var r=l().zipObject;t.exports=function(e,t){let n=0;for(let o=1;o<t.length;++o)n+=function(e,t,n){let o=r(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let a=2*s-1;s-=1;let d=Array(a).fill(0),l=0;return i.forEach(e=>{let t=e.pos+s;d[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=d[t+1]),t=t-1>>1,d[t]+=e.weight;l+=e.weight*r}),l}(e,t[o-1],t[o]);return n}}),E=i((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),k=i((e,t)=>{var r=l();t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}),j=i((e,t)=>{var r=l();function n(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}t.exports=function(e,t){var o;let i=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=i.lhs,a=i.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,h=0;s.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),h=n(d,a,h),s.forEach(e=>{h+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=n(d,a,h)});let u={vs:d.flat(!0)};return c&&(u.barycenter=l/c,u.weight=c),u}}),_=i((e,t)=>{var r=E(),n=k(),o=j();t.exports=function e(t,i,s,a){var d,l;let c=t.children(i),h=t.node(i),u=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,f={};u&&(c=c.filter(e=>e!==u&&e!==p));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let i=e(t,r.v,s,a);f[r.v]=i,Object.hasOwn(i,"barycenter")&&(n=r,o=i,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+o.barycenter*o.weight)/(n.weight+o.weight),n.weight+=o.weight):(n.barycenter=o.barycenter,n.weight=o.weight))}});let m=n(g,s);d=m,l=f,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,a);if(u&&(v.vs=[u,v.vs,p].flat(!0),t.predecessors(u).length)){let e=t.node(t.predecessors(u)[0]),r=t.node(t.predecessors(p)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+r.order)/(v.weight+2),v.weight+=2}return v}}),N=i((e,t)=>{var r=s().Graph,n=l();t.exports=function(e,t,o,i){i||(i=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),a=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(r=>{let n=e.node(r),i=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(a.setNode(r),a.setParent(r,i||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=a.edge(n,r),i=void 0!==o?o.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+i})}),Object.hasOwn(n,"minRank")&&a.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),a}}),C=i((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let i=e.parent(r),s,a;for(;i;){if((s=e.parent(i))?(a=n[s],n[s]=i):(a=o,o=i),a&&a!==i)return void t.setEdge(a,i);i=s}})}}),O=i((e,t)=>{var r=w(),n=x(),o=_(),i=N(),a=C(),d=s().Graph,c=l();function h(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){return i(e,t,r,n.get(t)||[])})}function u(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,i={}){if("function"==typeof i.customOrder)return void i.customOrder(t,e);let s=c.maxRank(t),l=h(t,c.range(1,s+1),"inEdges"),p=h(t,c.range(s-1,-1,-1),"outEdges"),f=r(t);if(u(t,f),i.disableOptimalOrderHeuristic)return;let g=1/0,m,v=i.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new d;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let i=e.graph().root,s=o(e,i,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),a(e,n,s.vs)})})(e%2?l:p,e%4>=2,v),f=c.buildLayerMatrix(t);let i=n(t,f);i<g?(r=0,m=Object.assign({},f),g=i):i===g&&(m=structuredClone(f))}u(t,m)}}),R=i((e,t)=>{var r=s().Graph,n=l();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,i=0,s=t.length,d=n[n.length-1];return n.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),h=c?e.node(c).order:s;(c||t===d)&&(n.slice(i,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let i=e.node(n),s=i.order;(s<o||h<s)&&!(i.dummy&&e.node(t).dummy)&&a(r,n,t)})}),i=l+1,o=h)}),n}),r}function i(e,t){let r={};function o(t,o,i,s,d){let l;n.range(o,i).forEach(n=>{l=t[n],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>d)&&a(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,i,s=0;return r.forEach((a,d)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(i=e.node(t[0]).order,o(r,s,d,n,i),s=d,n=i)}o(r,s,r.length,i,t.length)}),r}),r}function a(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function d(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function c(e,t,r,n){let o={},i={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let a=n(e);if(a.length){let n=((a=a.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let l=Math.floor(n),c=Math.ceil(n);l<=c;++l){let n=a[l];i[e]===e&&t<s[n]&&!d(r,e,n)&&(i[n]=e,i[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:i}}function h(e,t,n,o,i){var s,a,d,l,c,h,u;let p,f,g,m={},v=(s=e,a=t,d=n,l=i,p=new r,g=(c=(f=s.graph()).nodesep,h=f.edgesep,u=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),i,s;if(i=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(i+=u?s:-s),s=0,i+=(n.dummy?h:c)/2,i+=(o.dummy?h:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(i+=u?s:-s),s=0,i}),a.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(p.setNode(r),t){var n=d[t],o=p.edge(n,r);p.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),p),y=i?"borderLeft":"borderRight";function b(e,t){let r=v.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return b(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),b(function(t){let r=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==y&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function u(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var i,s;let a=(i=e,s=t,i.node(s).width/2);n=Math.max(r+a,n),o=Math.min(r-a,o)});let i=n-o;return i<t[0]&&(t=[i,r]),t},[1/0,null])[1]}function p(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),i=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let a=r+s,d=e[a];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=i-n.applyWithChunking(Math.max,l)),c&&(e[a]=n.mapValues(d,e=>e+c))})})}function f(e,t){return n.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=n.buildLayerMatrix(e),r=Object.assign(o(e,t),i(e,t)),s={},a;["u","d"].forEach(o=>{a="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(a=a.map(e=>Object.values(e).reverse()));let i=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,a,r,i),l=h(e,a,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),s[o+t]=l})});let d=u(e,s);return p(s,d),f(s,e.graph().align)},findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:d,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:p,findSmallestWidthAlignment:u,balance:f}}),P=i((e,t)=>{var r=l(),n=R().positionX;t.exports=function(e){var t;let o,i,s,a;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),i=t.graph().ranksep,s=t.graph().rankalign,a=0,o.forEach(e=>{let r=e.reduce((e,r)=>{let n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>{let n=t.node(e);"top"===s?n.y=a+n.height/2:"bottom"===s?n.y=a+r-n.height/2:n.y=a+r/2}),a+=r+i}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=i((e,t)=>{var r=c(),n=h(),o=g(),i=l().normalizeRanks,a=m(),d=l().removeEmptyRanks,u=v(),p=y(),f=b(),w=O(),x=P(),E=l(),k=s().Graph;t.exports=function(e,t={}){let s=t.debugTiming?E.time:E.notime;return s("layout",()=>{let l=s(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=D(t.graph()),r.setGraph(Object.assign({},_,S(n,j),E.pick(n,N))),t.nodes().forEach(e=>{let n=S(D(t.node(e)),C);Object.keys(R).forEach(e=>{void 0===n[e]&&(n[e]=R[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=D(t.edge(e));r.setEdge(e,Object.assign({},T,S(n,M),E.pick(n,L)))}),r});return s(" runLayout",()=>{var e,c,h;return e=l,c=s,h=t,void(c(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),c(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),c(" acyclic",()=>r.run(e)),c(" nestingGraph.run",()=>u.run(e)),c(" rank",()=>o(E.asNonCompoundGraph(e))),c(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};E.addDummyNode(t,"edge-proxy",n,"_ep")}})}),c(" removeEmptyRanks",()=>d(e)),c(" nestingGraph.cleanup",()=>u.cleanup(e)),c(" normalizeRanks",()=>i(e)),c(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),c(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),c(" normalize.run",()=>n.run(e)),c(" parentDummyChains",()=>a(e)),c(" addBorderSegments",()=>p(e)),c(" order",()=>w(e,h)),c(" insertSelfEdges",()=>{var t;return t=e,void E.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{E.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),c(" adjustCoordinateSystem",()=>f.adjust(e)),c(" position",()=>x(e)),c(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),o=n.x+n.width/2,i=n.y,s=r.x-o,a=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:i-a},{x:o+5*s/6,y:i-a},{x:o+s,y:i},{x:o+5*s/6,y:i+a},{x:o+2*s/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}),c(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),i=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),c(" normalize.undo",()=>n.undo(e)),c(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),c(" undoCoordinateSystem",()=>f.undo(e)),c(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,i=e.graph(),s=i.marginx||0,a=i.marginy||0;function d(e){let i=e.x,s=e.y,a=e.width,d=e.height;t=Math.min(t,i-a/2),r=Math.max(r,i+a/2),n=Math.min(n,s-d/2),o=Math.max(o,s+d/2)}e.nodes().forEach(t=>d(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&d(r)}),t-=s,n-=a,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+s,i.height=o-n+a})(e)),c(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=o,s=n),r.points.unshift(E.intersectRect(n,i)),r.points.push(E.intersectRect(o,s))})}),c(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),c(" acyclic.undo",()=>r.undo(e)))}),s(" updateInputGraph",()=>{var t,r;return t=e,r=l,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),l})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],C=["width","height","rank"],R={width:0,height:0},M=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},L=["labelpos"];function S(e,t){return E.mapValues(E.pick(e,t),Number)}function D(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),T=i((e,t)=>{var r=l(),n=s().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),L=i((e,t)=>{t.exports="2.0.4"});let S=i((e,t)=>{t.exports={graphlib:s(),layout:M(),debug:T(),util:{time:l().time,notime:l().notime},version:L()}})(),D={featureNode:{width:288,height:140},repositoryNode:{width:288,height:50},addRepositoryNode:{width:224,height:50}};function A(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:D[e.type??""]??t}function F(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:i=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let a=new S.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:n,ranksep:i,nodesep:s});let d=new Set;for(let e of t)d.add(e.source),d.add(e.target);let l=e.filter(e=>d.has(e.id)),c=e.filter(e=>!d.has(e.id));for(let e of l){let t=A(e,o);a.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)a.hasNode(e.source)&&a.hasNode(e.target)&&a.setEdge(e.source,e.target,{},e.id);S.layout(a);let{targetPosition:h,sourcePosition:u}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),p=[];for(let e of l){let t=a.node(e.id),r=A(e,o);p.push({...e,targetPosition:h,sourcePosition:u,position:{x:t.x-r.width/2,y:t.y-r.height/2}})}if(c.length>0){let e=0,t=1/0;for(let r of p){let n=A(r,o);e=Math.max(e,r.position.y+n.height),t=Math.min(t,r.position.x)}t===1/0&&(t=0);for(let r=0;r<c.length;r++){let n=c[r],i=A(n,o);p.push({...n,targetPosition:h,sourcePosition:u,position:{x:t,y:e+30+r*(i.height+20)}})}}return{nodes:p,edges:[...t]}}var I=e.i(21172),z=e.i(21023);let G=(0,z.createServerReference)("40de9c5b21e39c57e707232029004207cff79a3992",z.callServer,void 0,z.findSourceMapURL,"addRepository"),B=(0,z.createServerReference)("4098a5c3da48f5a05a1bf2c85062bd88acab0b0a2f",z.callServer,void 0,z.findSourceMapURL,"deleteRepository");var $=e.i(39443),q=e.i(8361),W=e.i(99045);let V=0;function H(e,i,s){let a=(0,r.useRouter)(),[d,l]=(0,t.useState)(e),[c,h]=(0,t.useState)(i),u=(0,t.useRef)(i),p=(0,t.useCallback)(e=>{h(t=>{let r="function"==typeof e?e(t):e;return u.current=r,r})},[]),f=(0,q.useSoundAction)("delete"),g=(0,q.useSoundAction)("create"),m=e.map(e=>e.id).sort().join(","),v=i.map(e=>e.id).sort().join(","),y=(0,t.useRef)(new Map),b=e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(",");(0,t.useEffect)(()=>{l(t=>{let r=new Map(t.map(e=>[e.id,e])),n=new Set(e.map(e=>e.id)),o=t.filter(e=>"featureNode"===e.type&&"creating"===e.data.state&&!n.has(e.id));return e.map(e=>{let t=r.get(e.id);if(t)return{...e,position:t.position};if("featureNode"===e.type&&o.length>0){let t=o.shift();return{...e,position:t.position}}return e})})},[m,e]),(0,t.useEffect)(()=>{p(i)},[v,i,p]);let{events:w}=(0,$.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=y.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,o=t.get(r.id);void 0!==o&&o!==e.state&&(w.some(t=>t.featureId===e.featureId&&(0,W.mapEventTypeToState)(t.eventType)===e.state)||("done"===e.state?n.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?n.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>{a.push(`/feature/${e.featureId}`)}}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[b,e,w,a]);let x=(0,t.useRef)(0),E=(0,t.useRef)(void 0);(0,t.useEffect)(()=>()=>clearTimeout(E.current),[]),(0,t.useEffect)(()=>{if(w.length<=x.current)return;let e=w.slice(x.current);for(let t of(x.current=w.length,e)){let e=(0,W.mapEventTypeToState)(t.eventType),r=(0,W.mapPhaseNameToLifecycle)(t.phaseName);l(n=>n.map(n=>{if("featureNode"!==n.type)return n;let o=n.data;return o.featureId!==t.featureId?n:{...n,data:{...o,state:e,...void 0!==r&&{lifecycle:r}}}}))}clearTimeout(E.current),E.current=setTimeout(()=>{s?.()||a.refresh()},3e3)},[w,a,s]),(0,t.useEffect)(()=>{if(!d.some(e=>{if("featureNode"!==e.type)return!1;let t=e.data;return"running"===t.state||"action-required"===t.state||"creating"===t.state}))return;let e=setInterval(()=>{s?.()||a.refresh()},5e3);return()=>clearInterval(e)},[d,a,s]);let k=(0,t.useCallback)(e=>{l(t=>(0,o.applyNodeChanges)(e,t))},[]),j=(0,t.useCallback)(e=>{e.source&&e.target&&l(t=>{let r=t.find(t=>t.id===e.source);return r?.type!=="repositoryNode"||p(r=>r.some(r=>{let n=t.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===e.target})?r:[...r,{id:`edge-${e.source}-${e.target}`,source:e.source,target:e.target,style:{strokeDasharray:"5 5"}}]),t})},[p]),_=(0,t.useCallback)((e,t,r)=>{let n=`feature-${Date.now()}-${V++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return l(t=>{let r,i=e?new Set(u.current.filter(t=>t.source===e).map(e=>e.target)):new Set,s=t.filter(e=>i.has(e.id));if(s.length>0){let e=s.map(e=>e.position.y).sort((e,t)=>e-t),t=e[e.length-1],n=e.length>1?e[1]-e[0]:160;r={x:s[0].position.x,y:t+n}}else if(e){let n=t.find(t=>t.id===e);r=n?{x:n.position.x+488,y:n.position.y}:{x:400,y:200}}else{let e=t.length>0?Math.max(...t.map(e=>e.position.y)):0;r={x:400,y:t.length>0?e+160:200}}let a=r.y+140,d=new Set([e,...i]),l=t.filter(e=>d.has(e.id)).reduce((e,t)=>{let r="featureNode"===t.type?140:50;return Math.max(e,t.position.y+r)},0),c=Math.max(0,a-l),h=c>0?t.map(e=>d.has(e.id)||i.has(e.id)?e:e.position.y>=l?{...e,position:{...e.position,y:e.position.y+c}}:e):t;return[...e?h.map(t=>{if(t.id!==e)return t;let n=[...s.map(e=>e.position.y),r.y],o=(Math.min(...n)+Math.max(...n)+140)/2,i="featureNode"===t.type?140:50;return{...t,position:{...t.position,y:o-i/2}}}):h,{id:n,type:"featureNode",position:r,data:o}]}),e&&p(t=>[...t,{id:"dependencyEdge"===r?`dep-${e}-${n}`:`edge-${e}-${n}`,source:e,target:n,...r?{type:r}:{style:{strokeDasharray:"5 5"}}}]),n},[p]),N=(0,t.useCallback)(async e=>{try{let t=await (0,I.deleteFeature)(e);if(t.error)return void n.toast.error(t.error);l(t=>{let r=t.filter(t=>t.id!==e),n=c.filter(t=>t.source!==e&&t.target!==e),o=F(r,n,{direction:"LR",ranksep:200,nodesep:60});return p(o.edges),o.nodes}),f.play(),n.toast.success("Feature deleted successfully"),a.refresh()}catch{n.toast.error("Failed to delete feature")}},[a,c,f,p]),C=(0,t.useCallback)(async e=>{let t=`repo-${e}`;l(e=>e.filter(e=>e.id!==t)),p(e=>e.filter(e=>e.source!==t&&e.target!==t));try{let t=await B(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),a.refresh();return}f.play(),n.toast.success("Repository removed"),a.refresh()}catch{n.toast.error("Failed to remove repository"),a.refresh()}},[a,f,p]),O=(0,t.useCallback)(e=>{l(t=>{let r=F(t,c,{direction:e,ranksep:60,nodesep:20});return p(r.edges),r.nodes})},[c,p]);return{nodes:d,edges:c,onNodesChange:k,handleConnect:j,handleAddRepository:(0,t.useCallback)(e=>{let t=`repo-temp-${Date.now()}`,r=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e,o=0;l(n=>{let i=n.filter(e=>"repositoryNode"===e.type),s=n.find(e=>"addRepositoryNode"===e.type);s&&(o=s.position.y);let a={x:i[0]?.position.x??s?.position.x??50,y:s?s.position.y:0},d=s?s.position.y+50+15:a.y+50+15;return n.map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:d}}:e).concat({id:t,type:"repositoryNode",position:a,data:{name:r,repositoryPath:e,id:t}})}),G({path:e,name:r}).then(e=>{if(e.error){l(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error(e.error);return}let r=e.repository,i=`repo-${r.id}`;l(e=>e.map(e=>e.id===t?{...e,id:i,data:{...e.data,id:r.id,repositoryPath:r.path}}:e)),p(e=>e.map(e=>({...e,source:e.source===t?i:e.source,target:e.target===t?i:e.target,id:e.id.replace(t,i)}))),g.play(),a.refresh()}).catch(()=>{l(e=>e.filter(e=>e.id!==t).map(e=>"addRepositoryNode"===e.type?{...e,position:{...e.position,y:o}}:e)),n.toast.error("Failed to add repository")})},[a,g,p]),handleLayout:O,handleDeleteFeature:N,handleDeleteRepository:C,createFeatureNode:_}}e.s(["useControlCenterState",()=>H],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),i=e.i(3214),s=e.i(35364);e.i(54793);var a=e.i(7729);e.i(47506);var d=e.i(89313),l=e.i(92002),c=e.i(3645);let h=(0,c.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var u=e.i(8986),p=e.i(38573),f=e.i(19933),g=e.i(67669),m=e.i(24042),v=e.i(64970),y=e.i(31777);e.i(81803);var b=e.i(72714),w=e.i(71326),x=e.i(2828);e.i(99348);var E=e.i(17466),k=e.i(8537),j=e.i(63629),_=e.i(76852);function N({data:e}){let[o,s]=(0,n.useState)(!1),a=(0,_.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),d=(0,k.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),c="Booting"===d.status||"Ready"===d.status;return(0,t.jsxs)("div",{className:"group relative",children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:l.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 -left-10 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),s(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(g.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.AlertDialog,{open:o,onOpenChange:s,children:(0,t.jsxs)(w.AlertDialogContent,{size:"sm",children:[(0,t.jsxs)(w.AlertDialogHeader,{children:[(0,t.jsx)(w.AlertDialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.AlertDialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.AlertDialogFooter,{children:[(0,t.jsx)(w.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(w.AlertDialogAction,{variant:"destructive",onClick:()=>e.onDelete?.(e.id),children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-default items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(h,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,y.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in IDE",onClick:a.openInIde,loading:a.ideLoading,error:!!a.ideError,icon:u.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in Shell",onClick:a.openInShell,loading:a.shellLoading,error:!!a.shellError,icon:p.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open Folder",onClick:a.openFolder,loading:a.folderLoading,error:!!a.folderError,icon:f.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:"Open Folder"})]})}),j.featureFlags.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:c?"Stop Dev Server":"Start Dev Server",onClick:c?d.stop:d.deploy,loading:d.deployLoading||d.stopLoading,error:!!d.deployError,icon:c?v.Square:m.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(x.TooltipContent,{children:c?"Stop Dev Server":"Start Dev Server"})]})}),c?(0,t.jsx)(E.DeploymentStatusBadge,{status:d.status,url:d.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:"text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",children:(0,t.jsx)(i.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:l.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}e.i(1650),e.i(45811),e.i(25235),e.i(1354);var C=e.i(1963);function O(e){let[n]=(0,l.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}function R({nodes:e,edges:o,selectedFeatureId:l,onNodesChange:c,onAddFeature:h,onNodeAction:u,onNodeSettings:p,onConnect:f,onNodeClick:g,onPaneClick:m,onRepositoryAdd:v,onRepositoryClick:y,onRepositoryDelete:b,onFeatureDelete:w,onRepositorySelect:x,onCanvasDrag:E,toolbar:k,emptyState:j}){let _=(0,n.useMemo)(()=>({featureNode:d.FeatureNode,repositoryNode:N,addRepositoryNode:C.AddRepositoryNode}),[]),R=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),P=(0,n.useCallback)(t=>{let r=e.find(e=>e.id===t.source);return r?.type!=="repositoryNode"||!o.some(r=>{let n=e.find(e=>e.id===r.source);return n?.type==="repositoryNode"&&r.target===t.target})},[e,o]),M=(0,n.useMemo)(()=>e.map(e=>({...e,..."featureNode"===e.type&&{selected:null!=l&&e.data.featureId===l},data:{...e.data,showHandles:o.length>0,..."featureNode"===e.type&&"creating"!==e.data.state?{onAction:u?()=>u(e.id):void 0,onSettings:p?()=>p(e.id):void 0,onDelete:w}:{},..."repositoryNode"===e.type&&{onAdd:v?()=>v(e.id):void 0,onClick:y?()=>y(e.id):void 0,onDelete:b},..."addRepositoryNode"===e.type&&{onSelect:x?e=>x(e):void 0}}})),[e,o.length,l,u,p,w,v,y,b,x]);return 0===e.length?j?(0,t.jsx)("div",{"data-testid":"features-canvas-empty",className:"h-full w-full",children:j}):(0,t.jsx)("div",{"data-testid":"features-canvas-empty",children:(0,t.jsx)(a.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(s.Button,{onClick:h,children:[(0,t.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})})}):(0,t.jsx)("div",{"data-testid":"features-canvas","data-no-drawer-close":!0,className:"pointer-events-auto h-full w-full",children:(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsxs)(r.ReactFlow,{nodes:M,edges:o,nodeTypes:_,edgeTypes:R,isValidConnection:P,onConnect:f,onNodesChange:c,onNodeClick:g,onPaneClick:m,onMoveStart:E,defaultViewport:{x:30,y:30,zoom:.85},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[(0,t.jsx)(r.Background,{}),(0,t.jsx)(r.Controls,{}),k]})})})}let P=(0,c.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var M=e.i(60253);let T="shep:notification-banner-dismissed";function L(){let[e,r]=(0,n.useState)(!1);(0,n.useEffect)(()=>{void 0===globalThis.Notification||"default"!==globalThis.Notification.permission||"true"!==localStorage.getItem(T)&&r(!0)},[]);let o=(0,n.useCallback)(async()=>{if(void 0===globalThis.Notification)return;let e=await globalThis.Notification.requestPermission();("granted"===e||"denied"===e)&&r(!1)},[]),i=(0,n.useCallback)(()=>{localStorage.setItem(T,"true"),r(!1)},[]);return e?(0,t.jsxs)("div",{className:"bg-background absolute bottom-4 left-4 z-50 flex max-w-sm items-center gap-3 rounded-lg border p-3 shadow-lg",children:[(0,t.jsx)(P,{className:"text-muted-foreground size-5 shrink-0"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Enable desktop notifications to stay updated on feature progress."}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(s.Button,{size:"sm",onClick:o,children:"Enable"}),(0,t.jsx)(s.Button,{variant:"ghost",size:"icon-xs",onClick:i,"aria-label":"Dismiss notification banner",children:(0,t.jsx)(M.X,{})})]})]}):null}var S=e.i(5147),D=e.i(8361),A=e.i(30153);let F=(0,c.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var I=e.i(33548),z=e.i(23925),G=e.i(83428),B=e.i(78986);let $=["cd ~/my-repo",'shep feat new "create modern, sleek dashboards"'];function q({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[a,d]=(0,n.useState)(!1);async function l(){if(!a){d(!0);try{let t=await (0,B.pickFolder)();t&&e?.(t)}finally{d(!1)}}}let c=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText($.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]);return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,y.cn)("relative h-full w-full",r),children:[(0,t.jsx)("div",{className:"absolute inset-0 [background-image:radial-gradient(circle,_var(--color-border)_1px,_transparent_1px)] [background-size:24px_24px]"}),(0,t.jsxs)("div",{className:"absolute top-8 left-8 z-10",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-3xl font-light",children:"Control Center"})]}),(0,t.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-6",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(h,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:l,disabled:a,className:"border-muted-foreground/30 hover:border-primary hover:text-primary flex cursor-pointer items-center gap-3 rounded-lg border-2 border-dashed px-8 py-4 transition-colors disabled:cursor-wait disabled:opacity-60",children:[a?(0,t.jsx)(G.Loader2,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(i.Plus,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a?"Opening...":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-border h-px w-16"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(F,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-widest uppercase",children:"Or start from the command line"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-16"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-lg bg-zinc-900 px-5 py-4 font-mono text-sm text-zinc-100",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:c,className:"absolute top-3 right-3 cursor-pointer rounded p-1.5 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200","aria-label":"Copy commands",children:o?(0,t.jsx)(z.Check,{className:"h-4 w-4"}):(0,t.jsx)(I.Copy,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"space-y-1",children:$.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Feature will appear on canvas once created"})]})})]})}var W=e.i(17840);function V({initialNodes:e,initialEdges:r}){let i,s=(0,o.useRouter)(),a=(0,o.usePathname)(),d=(i=(0,o.usePathname)().match(/^\/feature\/(.+)$/),i?.[1]??null),l=(0,D.useSoundAction)("click"),{guardedNavigate:c,getIsDirty:h}=(0,A.useDrawerCloseGuard)(),{nodes:u,edges:p,onNodesChange:f,handleConnect:g,handleAddRepository:m,handleDeleteFeature:v,handleDeleteRepository:y,createFeatureNode:b}=(0,W.useControlCenterState)(e,r,h),{setFeatures:w}=(0,S.useSidebarFeaturesContext)(),x=(0,n.useMemo)(()=>u.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.runtime??""}:${t.startedAt??""}`}).sort().join(","),[u]);(0,n.useEffect)(()=>{w(u.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data,r=(0,S.mapNodeStateToSidebarStatus)(t.state);return r?{featureId:t.featureId,name:t.name,status:r,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime}}:null}).filter(Boolean))},[x,u,w]);let E=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let e=t.data;"creating"!==e.state&&c(()=>{l.play(),s.push(`/feature/${e.featureId}`)})}},[s,l,c]),k=(0,n.useCallback)(()=>{l.play(),s.push("/create")},[s,l]),j=(0,n.useCallback)(e=>{l.play();let t=u.find(t=>t.id===e),r=t?.data?.repositoryPath;r?s.push(`/create?repo=${encodeURIComponent(r)}`):s.push("/create")},[u,s,l]),_=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=p.find(t=>t.target===e),n=r?u.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;l.play();let i=new URLSearchParams;o&&i.set("repo",o),i.set("parent",t),s.push(`/create?${i.toString()}`)},[u,p,s,l]),N=(0,n.useCallback)(e=>{let t=u.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&c(()=>s.push(`/repository/${e.id}`))}},[u,s,c]),C=(0,n.useCallback)(()=>{"/"!==a&&c(()=>s.push("/"))},[s,a,c]);return((0,n.useEffect)(()=>{let e=e=>{m(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[m]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail,r=u.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);b(r?.id??null,{state:"creating",name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[u,b]),u.some(e=>"repositoryNode"===e.type))?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(R,{nodes:u,edges:p,selectedFeatureId:d,onNodesChange:f,onConnect:g,onAddFeature:k,onNodeAction:_,onNodeClick:E,onPaneClick:C,onRepositoryAdd:j,onRepositoryClick:N,onRepositoryDelete:y,onFeatureDelete:v,onRepositorySelect:m,emptyState:(0,t.jsx)(q,{onRepositorySelect:m})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(q,{onRepositorySelect:m})]})}function H({initialNodes:e,initialEdges:n,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(V,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>H],48246)}]);
|
package/web/.next/trace
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"generate-buildid","duration":
|
|
1
|
+
[{"name":"generate-buildid","duration":198,"timestamp":194018400,"id":4,"parentId":1,"tags":{},"startTime":1772633667892,"traceId":"9e332b737c75cfbc"},{"name":"load-custom-routes","duration":298,"timestamp":194018700,"id":5,"parentId":1,"tags":{},"startTime":1772633667892,"traceId":"9e332b737c75cfbc"},{"name":"create-dist-dir","duration":233,"timestamp":194019042,"id":6,"parentId":1,"tags":{},"startTime":1772633667892,"traceId":"9e332b737c75cfbc"},{"name":"clean","duration":203,"timestamp":194019689,"id":7,"parentId":1,"tags":{},"startTime":1772633667893,"traceId":"9e332b737c75cfbc"},{"name":"create-pages-mapping","duration":206,"timestamp":194073644,"id":8,"parentId":1,"tags":{},"startTime":1772633667947,"traceId":"9e332b737c75cfbc"},{"name":"collect-app-files","duration":2635,"timestamp":194073888,"id":9,"parentId":1,"tags":{},"startTime":1772633667947,"traceId":"9e332b737c75cfbc"},{"name":"create-app-mapping","duration":1065,"timestamp":194076553,"id":10,"parentId":1,"tags":{},"startTime":1772633667950,"traceId":"9e332b737c75cfbc"},{"name":"create-app-layouts","duration":143,"timestamp":194077643,"id":11,"parentId":1,"tags":{},"startTime":1772633667951,"traceId":"9e332b737c75cfbc"},{"name":"collect-default-files","duration":1719,"timestamp":194080877,"id":13,"parentId":1,"tags":{},"startTime":1772633667954,"traceId":"9e332b737c75cfbc"},{"name":"create-default-mapping","duration":134,"timestamp":194082611,"id":14,"parentId":1,"tags":{},"startTime":1772633667956,"traceId":"9e332b737c75cfbc"},{"name":"generate-route-types","duration":25528,"timestamp":194079752,"id":12,"parentId":1,"tags":{},"startTime":1772633667953,"traceId":"9e332b737c75cfbc"},{"name":"public-dir-conflict-check","duration":108,"timestamp":194105327,"id":15,"parentId":1,"tags":{},"startTime":1772633667979,"traceId":"9e332b737c75cfbc"},{"name":"generate-routes-manifest","duration":2313,"timestamp":194105496,"id":16,"parentId":1,"tags":{},"startTime":1772633667979,"traceId":"9e332b737c75cfbc"},{"name":"run-turbopack","duration":9375599,"timestamp":194111144,"id":18,"parentId":1,"tags":{},"startTime":1772633667984,"traceId":"9e332b737c75cfbc"},{"name":"run-typescript","duration":7760887,"timestamp":203511425,"id":20,"parentId":1,"tags":{},"startTime":1772633677385,"traceId":"9e332b737c75cfbc"},{"name":"generate-required-server-files","duration":1995,"timestamp":211272903,"id":22,"parentId":1,"tags":{},"startTime":1772633685146,"traceId":"9e332b737c75cfbc"},{"name":"check-static-error-page","duration":5752,"timestamp":211357489,"id":24,"parentId":23,"tags":{},"startTime":1772633685231,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":244434,"timestamp":211367090,"id":42,"parentId":26,"tags":{},"startTime":1772633685240,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":250324,"timestamp":211361314,"id":26,"parentId":23,"tags":{"page":"/_global-error"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":317877,"timestamp":211366790,"id":41,"parentId":25,"tags":{},"startTime":1772633685240,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":324830,"timestamp":211359892,"id":25,"parentId":23,"tags":{"page":"/_not-found"},"startTime":1772633685233,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":352845,"timestamp":211369435,"id":44,"parentId":35,"tags":{},"startTime":1772633685243,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":359896,"timestamp":211362436,"id":35,"parentId":23,"tags":{"page":"/api/tools/[id]/install"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":353334,"timestamp":211369205,"id":43,"parentId":34,"tags":{},"startTime":1772633685243,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":360260,"timestamp":211362301,"id":34,"parentId":23,"tags":{"page":"/api/dialog/pick-files"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":358697,"timestamp":211369569,"id":46,"parentId":37,"tags":{},"startTime":1772633685243,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":365701,"timestamp":211362620,"id":37,"parentId":23,"tags":{"page":"/api/tools"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":350829,"timestamp":211380868,"id":48,"parentId":31,"tags":{},"startTime":1772633685254,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":369754,"timestamp":211361970,"id":31,"parentId":23,"tags":{"page":"/api/agent-events/health"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":362348,"timestamp":211369498,"id":45,"parentId":36,"tags":{},"startTime":1772633685243,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":369340,"timestamp":211362526,"id":36,"parentId":23,"tags":{"page":"/api/tools/[id]/launch"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":353827,"timestamp":211380340,"id":47,"parentId":32,"tags":{},"startTime":1772633685254,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":372114,"timestamp":211362075,"id":32,"parentId":23,"tags":{"page":"/api/agent-events"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":354541,"timestamp":211381536,"id":49,"parentId":33,"tags":{},"startTime":1772633685255,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":373915,"timestamp":211362194,"id":33,"parentId":23,"tags":{"page":"/api/deployment-logs"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":358645,"timestamp":211388920,"id":50,"parentId":38,"tags":{},"startTime":1772633685262,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":384641,"timestamp":211362951,"id":38,"parentId":23,"tags":{"page":"/skills"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":368716,"timestamp":211390420,"id":53,"parentId":27,"tags":{},"startTime":1772633685264,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":397631,"timestamp":211361531,"id":27,"parentId":23,"tags":{"page":"/create"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":373956,"timestamp":211388970,"id":51,"parentId":40,"tags":{},"startTime":1772633685262,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":399795,"timestamp":211363153,"id":40,"parentId":23,"tags":{"page":"/version"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":375827,"timestamp":211389155,"id":52,"parentId":39,"tags":{},"startTime":1772633685262,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":401942,"timestamp":211363079,"id":39,"parentId":23,"tags":{"page":"/tools"},"startTime":1772633685236,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":374549,"timestamp":211390543,"id":54,"parentId":28,"tags":{},"startTime":1772633685264,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":403480,"timestamp":211361630,"id":28,"parentId":23,"tags":{"page":"/feature/[featureId]"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":390556,"timestamp":211390774,"id":56,"parentId":30,"tags":{},"startTime":1772633685264,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":419492,"timestamp":211361868,"id":30,"parentId":23,"tags":{"page":"/"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"is-page-static","duration":392134,"timestamp":211390651,"id":55,"parentId":29,"tags":{},"startTime":1772633685264,"traceId":"9e332b737c75cfbc"},{"name":"check-page","duration":421081,"timestamp":211361722,"id":29,"parentId":23,"tags":{"page":"/repository/[repositoryId]"},"startTime":1772633685235,"traceId":"9e332b737c75cfbc"},{"name":"static-check","duration":426228,"timestamp":211356604,"id":23,"parentId":1,"tags":{},"startTime":1772633685230,"traceId":"9e332b737c75cfbc"},{"name":"write-routes-manifest","duration":1492,"timestamp":211783359,"id":58,"parentId":1,"tags":{},"startTime":1772633685657,"traceId":"9e332b737c75cfbc"},{"name":"load-dotenv","duration":48,"timestamp":211791993,"id":61,"parentId":60,"tags":{},"startTime":1772633685665,"traceId":"9e332b737c75cfbc"},{"name":"run-export-path-map","duration":308,"timestamp":211793981,"id":62,"parentId":60,"tags":{},"startTime":1772633685667,"traceId":"9e332b737c75cfbc"},{"name":"next-export","duration":73384,"timestamp":211791127,"id":60,"parentId":1,"tags":{},"startTime":1772633685664,"traceId":"9e332b737c75cfbc"},{"name":"move-exported-app-global-error-","duration":440,"timestamp":211865539,"id":63,"parentId":59,"tags":{},"startTime":1772633685739,"traceId":"9e332b737c75cfbc"},{"name":"static-generation","duration":80348,"timestamp":211787359,"id":59,"parentId":1,"tags":{},"startTime":1772633685661,"traceId":"9e332b737c75cfbc"},{"name":"write-routes-manifest","duration":270,"timestamp":211867842,"id":64,"parentId":1,"tags":{},"startTime":1772633685741,"traceId":"9e332b737c75cfbc"},{"name":"write-standalone-directory","duration":286131,"timestamp":211877847,"id":66,"parentId":1,"tags":{},"startTime":1772633685751,"traceId":"9e332b737c75cfbc"},{"name":"output-standalone","duration":286263,"timestamp":211877733,"id":65,"parentId":1,"tags":{},"startTime":1772633685751,"traceId":"9e332b737c75cfbc"},{"name":"print-tree-view","duration":2254,"timestamp":212164117,"id":67,"parentId":1,"tags":{},"startTime":1772633686037,"traceId":"9e332b737c75cfbc"},{"name":"telemetry-flush","duration":64,"timestamp":212166382,"id":68,"parentId":1,"tags":{},"startTime":1772633686040,"traceId":"9e332b737c75cfbc"},{"name":"next-build","duration":18363263,"timestamp":193803194,"id":1,"tags":{"buildMode":"default","version":"16.1.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1772633667677,"traceId":"9e332b737c75cfbc"}]
|
package/web/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-turbopack","duration":
|
|
1
|
+
[{"name":"run-turbopack","duration":9375599,"timestamp":194111144,"id":18,"parentId":1,"tags":{},"startTime":1772633667984,"traceId":"9e332b737c75cfbc"},{"name":"run-typescript","duration":7760887,"timestamp":203511425,"id":20,"parentId":1,"tags":{},"startTime":1772633677385,"traceId":"9e332b737c75cfbc"},{"name":"static-check","duration":426228,"timestamp":211356604,"id":23,"parentId":1,"tags":{},"startTime":1772633685230,"traceId":"9e332b737c75cfbc"},{"name":"static-generation","duration":80348,"timestamp":211787359,"id":59,"parentId":1,"tags":{},"startTime":1772633685661,"traceId":"9e332b737c75cfbc"},{"name":"output-standalone","duration":286263,"timestamp":211877733,"id":65,"parentId":1,"tags":{},"startTime":1772633685751,"traceId":"9e332b737c75cfbc"},{"name":"telemetry-flush","duration":64,"timestamp":212166382,"id":68,"parentId":1,"tags":{},"startTime":1772633686040,"traceId":"9e332b737c75cfbc"},{"name":"next-build","duration":18363263,"timestamp":193803194,"id":1,"tags":{"buildMode":"default","version":"16.1.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1772633667677,"traceId":"9e332b737c75cfbc"}]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|