@shepai/cli 1.110.1 → 1.110.2-pr343.55002ac
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/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +3 -2
- package/dist/src/presentation/web/components/common/merge-review/index.d.ts +1 -0
- package/dist/src/presentation/web/components/common/merge-review/index.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/merge-review/index.js +1 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.d.ts +7 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.js +160 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.d.ts +18 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-diff-viewer.stories.js +240 -0
- package/dist/src/presentation/web/components/common/merge-review/merge-review.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/merge-review/merge-review.js +2 -2
- package/dist/src/presentation/web/components/ui/code-block.d.ts +28 -0
- package/dist/src/presentation/web/components/ui/code-block.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/code-block.js +47 -0
- package/dist/src/presentation/web/components/ui/code-block.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/ui/code-block.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/code-block.stories.js +89 -0
- package/dist/src/presentation/web/components/ui/file-tree.d.ts +22 -0
- package/dist/src/presentation/web/components/ui/file-tree.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/file-tree.js +61 -0
- package/dist/src/presentation/web/components/ui/file-tree.stories.d.ts +14 -0
- package/dist/src/presentation/web/components/ui/file-tree.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/file-tree.stories.js +116 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
- 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 +18 -18
- 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 +20 -20
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
- 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 +18 -18
- 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 +18 -18
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d52e4ffa._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d52e4ffa._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d91fdd51._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d91fdd51._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f4e2e929._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f4e2e929._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js +1 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_d4d44f39._.js → _72bc8b0e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_d4d44f39._.js.map → _72bc8b0e._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_f3c9f75e._.js → _ba7a3d30._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_f3c9f75e._.js.map → _ba7a3d30._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_ccec5866._.js → _f728cbf8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ccec5866._.js.map → _f728cbf8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_scroll-area_tsx_53ae5be7._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_scroll-area_tsx_53ae5be7._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.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 +31 -31
- package/web/.next/static/chunks/{0abe4c1aa4868d43.js → 05417418b2a9cee3.js} +1 -1
- package/web/.next/static/chunks/{fd69e290a23f42db.js → 101ecf26d6966833.js} +1 -1
- package/web/.next/static/chunks/{d2696b56eaa27811.js → 1337f3e3c08718c7.js} +1 -1
- package/web/.next/static/chunks/2ec28c90ceaf4a13.js +11 -0
- package/web/.next/static/chunks/302445eb4ccd97da.css +1 -0
- package/web/.next/static/chunks/31776630de2d206b.js +1 -0
- package/web/.next/static/chunks/{c5d0ea070fd28a5f.js → 3a91978763f307a4.js} +1 -1
- package/web/.next/static/chunks/4943e3f713ca59b9.js +1 -0
- package/web/.next/static/chunks/{ff30b8acb47c382f.js → 7a5a5fd6ca5f68b0.js} +1 -1
- package/web/.next/static/chunks/aa4d2f43278ff233.js +2 -0
- package/web/.next/static/chunks/c271f980766af122.js +1 -0
- package/web/.next/static/chunks/{1b53abdc3e0915fa.js → c2cf5f8de6e440f4.js} +1 -1
- package/web/.next/static/chunks/d721d84d863d8f7d.js +1 -0
- package/web/.next/static/chunks/db88d096c40852ed.js +1 -0
- package/web/.next/static/chunks/{d332c5a1d5b931b6.js → f9b654bc46c065d1.js} +2 -2
- package/web/package.json +3 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +0 -1
- package/web/.next/static/chunks/07b853e29af1e5f2.js +0 -1
- package/web/.next/static/chunks/303a1217006489b9.js +0 -1
- package/web/.next/static/chunks/4e97c46640657f42.js +0 -11
- package/web/.next/static/chunks/5543614d36607aef.js +0 -1
- package/web/.next/static/chunks/5558a658fa82a01f.css +0 -1
- package/web/.next/static/chunks/d14c7aec739301f8.js +0 -2
- package/web/.next/static/chunks/d7fa87cf3302ec81.js +0 -1
- /package/web/.next/static/{OhzCWJVe_Ly9xvRRY6B0s → kP5AxZfxARVpUZmGJasAa}/_buildManifest.js +0 -0
- /package/web/.next/static/{OhzCWJVe_Ly9xvRRY6B0s → kP5AxZfxARVpUZmGJasAa}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{OhzCWJVe_Ly9xvRRY6B0s → kP5AxZfxARVpUZmGJasAa}/_ssgManifest.js +0 -0
|
@@ -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,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=o((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},a=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function a(e,t,r,n){var o=""+t,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(void 0===n?"\0":n)}function s(e,t){return a(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 a=r.parent(o);return void 0===a||t.hasNode(a)?(n[o]=a,a):a in n?n[a]:e(a)}(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,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,n=i.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=i,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=a(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,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}var i={v:o,w:a};return n&&(i.name=n),i}(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]):a(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]):a(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]):a(this._isDirected,e,t,r),i=this._edgeObjs[o];return i&&(e=i.v,t=i.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"}),i=n((e,t)=>{t.exports={Graph:a(),version:s()}}),d=n((e,t)=>{var r=a();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={},a=!0,s=0,i=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},a=!0)},l=function(){i.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};i.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=i.length,u=1;u<c&&(a=!1,s++,l(),a);u++);if(s===c-1&&(a=!1,l(),a))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}}),u=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],a=r[t];r[e]=a,r[t]=o,n[a.key]=e,n[o.key]=t}}}),h=n((e,t)=>{var r=u();t.exports=function(e,t,o,a){return function(e,t,n,o){var a,s,i={},d=new r,l=function(e){var t=e.v!==a?e.v:e.w,r=i[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=a,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;i[e]={distance:r},d.add(e,r)});d.size()>0&&(s=i[a=d.removeMin()]).distance!==1/0;)o(a).forEach(l);return i}(e,String(t),o||n,a||function(t){return e.outEdges(t)})};var n=()=>1}),f=n((e,t)=>{var r=h();t.exports=function(e,t,n){return e.nodes().reduce(function(o,a){return o[a]=r(e,a,t,n),o},{})}}),p=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(a){Object.hasOwn(n,a)||function a(s){var i=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(i.lowlink=Math.min(i.lowlink,n[e].index)):(a(e),i.lowlink=Math.min(i.lowlink,n[e].lowlink))}),i.lowlink===i.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(a)}),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,a,s,i,d;return o=e,a=t||r,s=n||function(t){return e.outEdges(t)},i={},(d=o.nodes()).forEach(function(e){i[e]={},i[e][e]={distance:0},d.forEach(function(t){e!==t&&(i[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=a(t);i[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=i[e];d.forEach(function(r){var n=i[r];d.forEach(function(r){var o=n[e],a=t[r],s=n[r],i=o.distance+a.distance;i<s.distance&&(s.distance=i,s.predecessor=a.predecessor)})})}),i};var r=()=>1}),x=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function a(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(a),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}),y=n((e,t)=>{var r=x();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),b=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var a=(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,a,s,i){return Object.hasOwn(o,r)||(o[r]=!0,n||(i=s(i,r)),a(r).forEach(function(r){i=e(t,r,n,o,a,s,i)}),n&&(i=s(i,r))),i}(e,t,"post"===r,s,a,n,o)}),o}}),w=n((e,t)=>{var r=b();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=a(),n=u();t.exports=function(e,t){var o,a=new r,s={},i=new n;function d(e){var r=e.v===o?e.w:e.v,n=i.priority(r);if(void 0!==n){var a=t(e);a<n&&(s[r]=o,i.decrease(r,a))}}if(0===e.nodeCount())return a;e.nodes().forEach(function(e){i.add(e,1/0),a.setNode(e)}),i.decrease(e.nodes()[0],0);for(var l=!1;i.size()>0;){if(Object.hasOwn(s,o=i.removeMin()))a.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return a}}),N=n((e,t)=>{var r=h(),n=l();t.exports=function(e,t,o,a){return function(e,t,o,a){if(void 0===o)return r(e,t,o,a);for(var s=!1,i=e.nodes(),d=0;d<i.length;d++){for(var l=a(i[d]),c=0;c<l.length;c++){var u=l[c],h=u.v===i[d]?u.v:u.w,f=h===u.v?u.w:u.v;0>o({v:h,w:f})&&(s=!0)}if(s)return n(e,t,o,a)}return r(e,t,o,a)}(e,t,o,a||function(t){return e.outEdges(t)})}}),C=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:h(),dijkstraAll:f(),extractPath:p(),findCycles:m(),floydWarshall:v(),isAcyclic:y(),postorder:E(),preorder:k(),prim:j(),shortestPaths:N(),reduce:b(),tarjan:g(),topsort:x()}}),_=i();t.exports={Graph:_.Graph,json:d(),alg:C(),version:_.version}}),s=o((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),i=o((e,t)=>{var r=a().Graph,n=s();t.exports=function(e,t){var a,s;let l,c,u,h,f;if(1>=e.nodeCount())return[];let p=(a=e,s=t||o,l=new r,c=0,u=0,a.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),a.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=s(e);l.setEdge(e.v,e.w,t+r),u=Math.max(u,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),h=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(u+c+3).map(()=>new n),f=c+1,l.nodes().forEach(e=>{d(h,f,l.node(e))}),{graph:l,buckets:h,zeroIdx:f});return(function(e,t,r){let n=[],o=t[t.length-1],a=t[0],s;for(;e.nodeCount();){for(;s=a.dequeue();)i(e,t,r,s);for(;s=o.dequeue();)i(e,t,r,s);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue()){n=n.concat(i(e,t,r,s,!0));break}}}return n})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let a=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),i=e.node(n.v);o&&a.push({v:n.v,w:n.w}),i.out-=s,d(t,r,i)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),a=n.w,s=e.node(a);s.in-=o,d(t,r,s)}),e.removeNode(n.v),a}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)}}),d=o((e,t)=>{var r=a().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 a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=o),n(e,"border",a,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(s(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,a=e.y,s=t.x-o,i=t.y-a,d=e.width/2,l=e.height/2;if(!s&&!i)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(i)*d>Math.abs(s)*l?(i<0&&(l=-l),r=l*s/i,n=l):(s<0&&(d=-d),r=d,n=d*i/s),{x:o+r,y:a+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:s,normalizeRanks:function(e){let t=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,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%a!=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 s(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var i=0;function d(e){return e+""+ ++i}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),{})}}),l=o((e,t)=>{var r=i(),n=d().uniqueId;t.exports={run:function(e){var t,o;let a,s,i;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(a=[],s={},i={},(o=e).nodes().forEach(function e(t){Object.hasOwn(i,t)||(i[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?a.push(t):e(t.w)}),delete s[t])}),a)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),c=o((e,t)=>{var r=d();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,a,s=t.v,i=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,u=e.edge(t),h=u.labelRank;if(l!==i+1){for(e.removeEdge(t),a=0,++i;i<l;++a,++i)u.points=[],o={width:0,height:0,edgeLabel:u,edgeObj:t,rank:i},n=r.addDummyNode(e,"edge",o,"_d"),i===h&&(o.width=u.width,o.height=u.height,o.dummy="edge-label",o.labelpos=u.labelpos),e.setEdge(s,n,{weight:u.weight},c),0===a&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:u.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=o((e,t)=>{var{applyWithChunking:r}=d();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var a=e.node(o);if(Object.hasOwn(t,o))return a.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),a.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=o((e,t)=>{var r=a().Graph,n=u().slack;t.exports=function(e){var t,o,a,s,i=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(i.setNode(d,{});t=i,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(a=>{var s=a.v,i=r===s?a.w:s;t.hasNode(i)||n(o,a)||(t.setNode(i,{}),t.setEdge(r,i,{}),e(i))})}),t.nodeCount()<l;)a=function(e,t){return t.edges().reduce((r,o)=>{let a=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(a=n(t,o)),a<r[0]?[a,o]:r},[1/0,null])[1]}(i,e),s=i.hasNode(a.v)?n(e,a):-n(e,a),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(i,e,s);return i}}),f=o((e,t)=>{var r=h(),n=u().slack,o=u().longestPath,s=a().alg.preorder,i=a().alg.postorder,l=d().simplify;function c(e){o(e=l(e));var t,n,a=r(e);for(g(a),f(a,e);t=m(a);)n=v(a,e,t),x(a,e,t,n)}function f(e,t){var r=i(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,a,s;return n=e,o=t,a=r,s=n.node(a).parent,void(n.edge(a,s).cutvalue=p(n,o,a))})}function p(e,t,r){var n=e.node(r).parent,o=!0,a=t.edge(r,n),s=0;return a||(o=!1,a=t.edge(n,r)),s=a.weight,t.nodeEdges(r).forEach(a=>{var i=a.v===r,d=i?a.w:a.v;if(d!==n){var l,c,u,h=i===o,f=t.edge(a).weight;if(s+=h?f:-f,l=e,c=r,u=d,l.hasEdge(c,u)){var p=e.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,a){var s=n,i=t.node(o);return r[o]=!0,t.neighbors(o).forEach(a=>{Object.hasOwn(r,a)||(n=e(t,r,n,a,o))}),i.low=s,i.lim=n++,a?i.parent=a:delete i.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,a=r.w;t.hasEdge(o,a)||(o=r.w,a=r.v);var s=e.node(o),i=e.node(a),d=s,l=!1;return s.lim>i.lim&&(d=i,l=!0),t.edges().filter(t=>l===y(e,e.node(t.v),d)&&l!==y(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function x(e,t,r,n){var o,a,i,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),f(e,t),o=e,a=t,i=o.nodes().find(e=>!a.node(e).parent),(d=(d=s(o,i)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=a.edge(e,t),n=!1;r||(r=a.edge(t,e),n=!0),a.node(e).rank=a.node(t).rank+(n?r.minlen:-r.minlen)})}function y(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=f,c.calcCutValue=p,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=x}),p=o((e,t)=>{var r=u().longestPath,n=h(),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":a(e);case"none":}};var a=r}),g=o((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let a=n;t.children(o).forEach(e),r[o]={low:a,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,a=function(e,t,r,n){let o=[],a=[],s=Math.min(t[r].low,t[n].low),i=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||i>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)a.push(d);return{path:o.concat(a.reverse()),lca:l}}(e,o,n.v,n.w),s=a.path,i=a.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==i&&e.node(l).maxRank<r.rank;)d++;l===i&&(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]}})}}),m=o((e,t)=>{var r=d();t.exports={run:function(e){var t,n,o;let a=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var a=t.children(r);a&&a.length&&a.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),i=Object.values(s),d=r.applyWithChunking(Math.max,i)-1,l=2*d+1;e.graph().nestingRoot=a,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,a,s,i,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"),u=r.addBorderNode(t,"_bb"),h=t.node(d);t.setParent(c,d),h.borderTop=c,t.setParent(u,d),h.borderBottom=u,l.forEach(r=>{e(t,n,o,a,s,i,r);let l=t.node(r),h=l.borderTop?l.borderTop:r,f=l.borderBottom?l.borderBottom:r,p=l.borderTop?a:2*a,g=h!==f?1:s-i[d]+1;t.setEdge(c,h,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,u,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+i[d]})})(e,a,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)})}}}),v=o((e,t)=>{var r=d();function n(e,t,n,o,a,s){let i=a[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);a[t][s]=d,e.setParent(d,o),i&&e.setEdge(i,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),a=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,o=a.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,a,t),n(e,"borderRight","_br",r,a,t)}})}}),x=o((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 a(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=>a(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(a),Object.hasOwn(t,"x")&&a(t)}),r(e))}}}),y=o((e,t)=>{var r=d();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),a=r.applyWithChunking(Math.max,o),s=r.range(a+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),b=o((e,t)=>{var r=d().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)),a=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 i=2*s-1;s-=1;let d=Array(i).fill(0),l=0;return a.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}}),w=o((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}}})}}),E=o((e,t)=>{var r=d();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))}}),k=o((e,t)=>{var r=d();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 a=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=a.lhs,i=a.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,u=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)),u=n(d,i,u),s.forEach(e=>{u+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,u=n(d,i,u)});let h={vs:d.flat(!0)};return c&&(h.barycenter=l/c,h.weight=c),h}}),j=o((e,t)=>{var r=w(),n=E(),o=k();t.exports=function e(t,a,s,i){var d,l;let c=t.children(a),u=t.node(a),h=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};h&&(c=c.filter(e=>e!==h&&e!==f));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let a=e(t,r.v,s,i);p[r.v]=a,Object.hasOwn(a,"barycenter")&&(n=r,o=a,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=p,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,i);if(h&&(v.vs=[h,v.vs,f].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),r=t.node(t.predecessors(f)[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=o((e,t)=>{var r=a().Graph,n=d();t.exports=function(e,t,o,a){a||(a=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),i=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return a.forEach(r=>{let n=e.node(r),a=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(i.setNode(r),i.setParent(r,a||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=i.edge(n,r),a=void 0!==o?o.weight:0;i.setEdge(n,r,{weight:e.edge(t).weight+a})}),Object.hasOwn(n,"minRank")&&i.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),i}}),C=o((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let a=e.parent(r),s,i;for(;a;){if((s=e.parent(a))?(i=n[s],n[s]=a):(i=o,o=a),i&&i!==a)return void t.setEdge(i,a);a=s}})}}),_=o((e,t)=>{var r=y(),n=b(),o=j(),s=N(),i=C(),l=a().Graph,c=d();function u(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 s(e,t,r,n.get(t)||[])})}function h(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,a={}){if("function"==typeof a.customOrder)return void a.customOrder(t,e);let s=c.maxRank(t),d=u(t,c.range(1,s+1),"inEdges"),f=u(t,c.range(s-1,-1,-1),"outEdges"),p=r(t);if(h(t,p),a.disableOptimalOrderHeuristic)return;let g=1/0,m,v=a.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new l;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let a=e.graph().root,s=o(e,a,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),i(e,n,s.vs)})})(e%2?d:f,e%4>=2,v),p=c.buildLayerMatrix(t);let a=n(t,p);a<g?(r=0,m=Object.assign({},p),g=a):a===g&&(m=structuredClone(p))}h(t,m)}}),O=o((e,t)=>{var r=a().Graph,n=d();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,a=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),u=c?e.node(c).order:s;(c||t===d)&&(n.slice(a,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let a=e.node(n),s=a.order;(s<o||u<s)&&!(a.dummy&&e.node(t).dummy)&&i(r,n,t)})}),a=l+1,o=u)}),n}),r}function s(e,t){let r={};function o(t,o,a,s,d){let l;n.range(o,a).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)&&i(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,a,s=0;return r.forEach((i,d)=>{if("border"===e.node(i).dummy){let t=e.predecessors(i);t.length&&(a=e.node(t[0]).order,o(r,s,d,n,a),s=d,n=a)}o(r,s,r.length,a,t.length)}),r}),r}function i(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function l(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={},a={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,a[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let i=n(e);if(i.length){let n=((i=i.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let d=Math.floor(n),c=Math.ceil(n);d<=c;++d){let n=i[d];a[e]===e&&t<s[n]&&!l(r,e,n)&&(a[n]=e,a[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:a}}function u(e,t,n,o,a){var s,i,d,l,c,u,h;let f,p,g,m={},v=(s=e,i=t,d=n,l=a,f=new r,g=(c=(p=s.graph()).nodesep,u=p.edgesep,h=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),a,s;if(a=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&&(a+=h?s:-s),s=0,a+=(n.dummy?u:c)/2,a+=(o.dummy?u:c)/2,a+=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&&(a+=h?s:-s),s=0,a}),i.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(f.setNode(r),t){var n=d[t],o=f.edge(n,r);f.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),f),x=a?"borderLeft":"borderRight";function y(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 y(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),y(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!==x&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function h(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var a,s;let i=(a=e,s=t,a.node(s).width/2);n=Math.max(r+i,n),o=Math.min(r-i,o)});let a=n-o;return a<t[0]&&(t=[a,r]),t},[1/0,null])[1]}function f(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),a=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let i=r+s,d=e[i];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=a-n.applyWithChunking(Math.max,l)),c&&(e[i]=n.mapValues(d,e=>e+c))})})}function p(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),s(e,t)),a={},i;["u","d"].forEach(o=>{i="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(i=i.map(e=>Object.values(e).reverse()));let s=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,i,r,s),l=u(e,i,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),a[o+t]=l})});let d=h(e,a);return f(a,d),p(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:i,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}}),R=o((e,t)=>{var r=d(),n=O().positionX;t.exports=function(e){var t;let o,a,s,i;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),a=t.graph().ranksep,s=t.graph().rankalign,i=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=i+n.height/2:"bottom"===s?n.y=i+r-n.height/2:n.y=i+r/2}),i+=r+a}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=o((e,t)=>{var r=l(),n=c(),o=p(),s=d().normalizeRanks,i=g(),u=d().removeEmptyRanks,h=m(),f=v(),y=x(),b=_(),w=R(),E=d(),k=a().Graph;t.exports=function(e,t={}){let a=t.debugTiming?E.time:E.notime;return a("layout",()=>{let d=a(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=A(t.graph()),r.setGraph(Object.assign({},N,L(n,j),E.pick(n,C))),t.nodes().forEach(e=>{let n=L(A(t.node(e)),O);Object.keys(M).forEach(e=>{void 0===n[e]&&(n[e]=M[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=A(t.edge(e));r.setEdge(e,Object.assign({},P,L(n,S),E.pick(n,T)))}),r});return a(" runLayout",()=>{var e,l,c;return e=d,l=a,c=t,void(l(" 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)}))}),l(" 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)}})}),l(" acyclic",()=>r.run(e)),l(" nestingGraph.run",()=>h.run(e)),l(" rank",()=>o(E.asNonCompoundGraph(e))),l(" 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")}})}),l(" removeEmptyRanks",()=>u(e)),l(" nestingGraph.cleanup",()=>h.cleanup(e)),l(" normalizeRanks",()=>s(e)),l(" 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)}),l(" 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))})}),l(" normalize.run",()=>n.run(e)),l(" parentDummyChains",()=>i(e)),l(" addBorderSegments",()=>f(e)),l(" order",()=>b(e,c)),l(" 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})})}),l(" adjustCoordinateSystem",()=>y.adjust(e)),l(" position",()=>w(e)),l(" 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,a=n.y,s=r.x-o,i=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:a-i},{x:o+5*s/6,y:a-i},{x:o+s,y:a},{x:o+5*s/6,y:a+i},{x:o+2*s/3,y:a+i}],r.label.x=r.x,r.label.y=r.y}})}),l(" 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),a=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-a.x),r.height=Math.abs(o.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),l(" normalize.undo",()=>n.undo(e)),l(" 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}})}),l(" undoCoordinateSystem",()=>y.undo(e)),l(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,a=e.graph(),s=a.marginx||0,i=a.marginy||0;function d(e){let a=e.x,s=e.y,i=e.width,d=e.height;t=Math.min(t,a-i/2),r=Math.max(r,a+i/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-=i,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)}),a.width=r-t+s,a.height=o-n+i})(e)),l(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=o,s=n),r.points.unshift(E.intersectRect(n,a)),r.points.push(E.intersectRect(o,s))})}),l(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),l(" acyclic.undo",()=>r.undo(e)))}),a(" updateInputGraph",()=>{var t,r;return t=e,r=d,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)}),d})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],O=["width","height","rank"],M={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function L(e,t){return E.mapValues(E.pick(e,t),Number)}function A(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),S=o((e,t)=>{var r=d(),n=a().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}}}),P=o((e,t)=>{t.exports="2.0.4"});let T=o((e,t)=>{t.exports={graphlib:a(),layout:M(),debug:S(),util:{time:d().time,notime:d().notime},version:P()}})(),L={direction:"LR",ranksep:200,nodesep:15},A={featureNode:{width:288,height:140},repositoryNode:{width:328,height:50}};function D(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:A[e.type??""]??t}function I(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:a=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let i=new T.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:n,ranksep:a,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=D(e,o);i.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)i.hasNode(e.source)&&i.hasNode(e.target)&&i.setEdge(e.source,e.target,{},e.id);T.layout(i);let{targetPosition:u,sourcePosition:h}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),f="LR"===n||"RL"===n,p=new Map;for(let e of l){let t=i.node(e.id),r=D(e,o);p.set(e.id,{cx:t.x,cy:t.y,w:r.width,h:r.height})}let g=0;for(let e of p.values()){g=f?e.cx:e.cy;break}for(let e of c){let t=D(e,o);p.set(e.id,{cx:f?g:0,cy:f?0:g,w:t.width,h:t.height})}let m=new Map;for(let e of t)p.has(e.source)&&p.has(e.target)&&(m.has(e.source)||m.set(e.source,[]),m.get(e.source).push(e.target));let v=new Map;for(let t=0;t<e.length;t++)v.set(e[t].id,t);for(let[,e]of m)e.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let x=new Set;for(let e of m.values())for(let t of e)x.add(t);let y=[...[...d].filter(e=>p.has(e)&&!x.has(e)),...c.map(e=>e.id)];y.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let b=new Map;for(let e of y)!function e(t){if(b.has(t))return b.get(t);let r=p.get(t),n=f?r.h:r.w,o=m.get(t);if(!o||0===o.length)return b.set(t,n),n;let a=0;for(let t of o)a+=e(t);let i=Math.max(n,a+=(o.length-1)*s);return b.set(t,i),i}(e);let w=0;for(let e of y){let t=b.get(e)??0;!function e(t,r){let n=p.get(t);f?n.cy=r:n.cx=r;let o=m.get(t);if(!o||0===o.length)return;let a=0;for(let e of o)a+=b.get(e)??0;let i=r-(a+=(o.length-1)*s)/2;for(let t of o){let r=b.get(t)??0;e(t,i+r/2),i+=r+s}}(e,w+t/2),w+=t+s}let E=[];for(let t of e){let e=p.get(t.id);e&&E.push({...t,targetPosition:u,sourcePosition:h,position:{x:e.cx-e.w/2,y:e.cy-e.h/2}})}return{nodes:E,edges:[...t]}}var F=e.i(21023);let $=(0,F.createServerReference)("6046d784274f1b80add086a49dae89fefa40d11cf1",F.callServer,void 0,F.findSourceMapURL,"deleteFeature");var z=e.i(17196);let B=(0,F.createServerReference)("40f3ca539d3425f5187d3a88e4eb2c0482b0592fa8",F.callServer,void 0,F.findSourceMapURL,"addRepository"),G=(0,F.createServerReference)("40e52942ba496ab765a22d9a8d91652637919911e5",F.callServer,void 0,F.findSourceMapURL,"deleteRepository"),q=(0,F.createServerReference)("401285fe7c326deaf8ba888684d5d012143984fe89",F.callServer,void 0,F.findSourceMapURL,"getFeatureMetadata");var W=e.i(39443),V=e.i(8361),U=e.i(18354),H=e.i(99045);function X(e,t){let r=new Map;for(let e of t)"dependencyEdge"===e.type&&r.set(e.target,e.source);let n=new Map,o=new Map;for(let t of e)"featureNode"===t.type?n.set(t.id,{nodeId:t.id,data:t.data,parentNodeId:r.get(t.id)}):"repositoryNode"===t.type&&o.set(t.id,{nodeId:t.id,data:t.data});return{featureMap:n,repoMap:o}}function J(e,t){return(void 0===t.state||t.state===e.state)&&(void 0===t.lifecycle||t.lifecycle===e.lifecycle)&&(void 0===t.name||t.name===e.name)&&(void 0===t.description||t.description===e.description)}function K(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||n.parentNodeId!==e.parentNodeId||n.data!==e.data&&JSON.stringify(n.data)!==JSON.stringify(e.data))return!1}return!0}let Y=(0,U.createLogger)("[Polling]"),Q=0,Z=0;function ee(e,o){let a=(0,r.useRouter)(),s=(0,V.useSoundAction)("delete"),i=(0,V.useSoundAction)("create"),{nodes:d,edges:l,reconcile:c,updateFeature:u,addPendingFeature:h,removeFeature:f,restoreFeature:p,addRepository:g,removeRepository:m,replaceRepository:v,getFeatureRepositoryPath:x,getRepositoryData:y,getRepoMapSize:b,setCallbacks:w,beginMutation:E,endMutation:k,isMutating:j}=function(e,r){let n=(0,t.useMemo)(()=>X(e,r),[]),[o,a]=(0,t.useState)(n.featureMap),[s,i]=(0,t.useState)(n.repoMap),[d,l]=(0,t.useState)(new Map),c=(0,t.useRef)(new Map),u=(0,t.useRef)(new Set),h=(0,t.useRef)(0),f=(0,t.useRef)(new Set),p=(0,t.useRef)(new Set),g=(0,t.useRef)({}),m=(0,t.useMemo)(()=>({onNodeAction:e=>g.current.onNodeAction?.(e),onNodeSettings:e=>g.current.onNodeSettings?.(e),onFeatureDelete:e=>g.current.onFeatureDelete?.(e),onRepositoryAdd:e=>g.current.onRepositoryAdd?.(e),onRepositoryClick:e=>g.current.onRepositoryClick?.(e),onRepositoryDelete:e=>g.current.onRepositoryDelete?.(e),onRetryFeature:e=>g.current.onRetryFeature?.(e)}),[]),v=(0,t.useRef)(o);v.current=o;let x=(0,t.useRef)(s);x.current=s;let y=(0,t.useMemo)(()=>(function(e,t,r,n){let o=[],a=[],s=e=>e.replace(/\\/g,"/"),i=new Map;for(let[e,r]of t)r.data.repositoryPath&&i.set(s(r.data.repositoryPath),e);let d=new Map;for(let[e,r]of[...t.entries()].sort((e,t)=>(e[1].data.createdAt??0)-(t[1].data.createdAt??0))){let t={...r.data,...n?.onRepositoryAdd&&{onAdd:()=>n.onRepositoryAdd(e)},...n?.onRepositoryClick&&{onClick:()=>n.onRepositoryClick(e)},...n?.onRepositoryDelete&&{onDelete:n.onRepositoryDelete}};o.push({id:e,type:"repositoryNode",position:{x:0,y:0},data:t})}for(let[t,l,c]of[...[...e.entries()].map(([e,t])=>[e,t,!1]),...[...r.entries()].filter(([t])=>!e.has(t)).map(([e,t])=>[e,t,!0])]){let e="creating"===l.data.state||c,r={...l.data,...!e&&n?.onNodeAction&&{onAction:()=>n.onNodeAction(t)},...!e&&n?.onNodeSettings&&{onSettings:()=>n.onNodeSettings(t)},...!e&&n?.onFeatureDelete&&{onDelete:n.onFeatureDelete},...!e&&"error"===l.data.state&&n?.onRetryFeature&&{onRetry:n.onRetryFeature}};if(o.push({id:t,type:"featureNode",position:{x:0,y:0},data:r}),l.parentNodeId)a.push({id:`dep-${l.parentNodeId}-${t}`,source:l.parentNodeId,target:t,type:"dependencyEdge"});else{let e=s(l.data.repositoryPath),r=i.get(e)??function(e){if(d.has(e))return d.get(e);let t=`virtual-repo-${e}`,r=e.split("/").filter(Boolean).at(-1)??e;return o.push({id:t,type:"repositoryNode",position:{x:0,y:0},data:{name:r,repositoryPath:e}}),d.set(e,t),t}(e);a.push({id:`edge-${r}-${t}`,source:r,target:t,style:{strokeDasharray:"5 5"}})}}let l=a.length>0;for(let e of o)e.data.showHandles=l;return{nodes:o,edges:a}})(o,s,d,m),[o,s,d,m]),b=(0,t.useRef)({key:"",positions:new Map}),{nodes:w,edges:E}=(0,t.useMemo)(()=>{let e=y.nodes.map(e=>e.id).sort().join(","),t=y.edges.map(e=>`${e.source}-${e.target}`).sort().join(","),r=`${e}|${t}`;if(r!==b.current.key){let e=I(y.nodes,y.edges,L),t=new Map;for(let r of e.nodes)t.set(r.id,{position:r.position,targetPosition:r.targetPosition,sourcePosition:r.sourcePosition});let n=b.current.positions;if(n.size>0){let r=0,o=0;for(let[e,a]of t){let t=n.get(e);if(t){r=t.position.x-a.position.x,o=t.position.y-a.position.y;break}}if(0!==r||0!==o){for(let e of t.values())e.position={x:e.position.x+r,y:e.position.y+o};for(let t of e.nodes)t.position={x:t.position.x+r,y:t.position.y+o}}}return b.current={key:r,positions:t},e}let{positions:n}=b.current;return{nodes:y.nodes.map(e=>{let t=n.get(e.id);return t?{...e,...t}:e}),edges:y.edges}},[y]),k=(0,t.useCallback)((e,t)=>{if(h.current>0)return;let{featureMap:r,repoMap:n}=X(e,t),o=new Set([...r.values()].map(e=>`${e.data.name}\0${e.data.repositoryPath}`));a(e=>{let t=[...e.entries()].filter(([,e])=>"creating"===e.data.state),n=new Map(r);for(let[e,r]of t){let t=`${r.data.name}\0${r.data.repositoryPath}`;o.has(t)||n.set(e,r)}let a=new Set;for(let[t,r]of e)"deleting"===r.data.state&&(n.has(t)?n.set(t,{...n.get(t),data:{...n.get(t).data,state:"deleting"}}):p.current.has(t)||(n.set(t,r),a.add(t)));for(let[e,t]of(p.current=a,c.current)){let r=n.get(e);r&&(n.set(e,{...r,data:{...r.data,...t}}),c.current.delete(e))}return K(e,n)?e:n}),l(e=>{if(0===e.size)return e;let t=!1,r=new Map(e);for(let[n,a]of e){let e=`${a.data.name}\0${a.data.repositoryPath}`;o.has(e)&&(r.delete(n),t=!0)}return t?r:e}),i(e=>{let t=new Map(n),r=new Set([...n.values()].map(e=>e.data.repositoryPath));for(let[n,o]of e){if(t.has(n)||r.has(o.data.repositoryPath)){u.current.delete(n);continue}(n.startsWith("repo-temp-")||u.current.has(n))&&t.set(n,o)}return K(e,t)?e:t})},[]),j=(0,t.useCallback)((e,t)=>{a(r=>{let n=r.get(e);if(!n)return c.current.set(e,{...c.current.get(e),...t}),r;if(c.current.delete(e),J(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o}),l(r=>{let n=r.get(e);if(!n||J(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o})},[]),N=(0,t.useCallback)((e,t,r)=>{l(n=>{let o=new Map(n);return o.set(e,{nodeId:e,data:t,parentNodeId:r}),o})},[]),C=(0,t.useCallback)(e=>{l(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),_=(0,t.useCallback)(e=>{a(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),O=(0,t.useCallback)((e,t)=>{a(r=>{let n=new Map(r);return n.set(e,t),n})},[]),R=(0,t.useCallback)((e,t)=>{u.current.add(e),i(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),M=(0,t.useCallback)(e=>{u.current.delete(e),i(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),S=(0,t.useCallback)((e,t,r)=>{u.current.delete(e),u.current.add(t),i(n=>{if(!n.has(e))return n;let o=new Map(n);return o.delete(e),o.set(t,{nodeId:t,data:r}),o})},[]),P=(0,t.useCallback)(e=>v.current.get(e)?.data.repositoryPath,[]),T=(0,t.useCallback)(e=>x.current.get(e)?.data,[]),A=(0,t.useCallback)(()=>x.current.size,[]),D=(0,t.useCallback)(e=>{g.current=e},[]),F=(0,t.useCallback)(()=>{h.current++},[]),$=(0,t.useCallback)((e=3e3)=>{let t=setTimeout(()=>{h.current=Math.max(0,h.current-1),f.current.delete(t)},e);f.current.add(t)},[]),z=(0,t.useCallback)(()=>h.current>0,[]);return(0,t.useEffect)(()=>{let e=f.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]),{nodes:w,edges:E,reconcile:k,updateFeature:j,addPendingFeature:N,removePendingFeature:C,removeFeature:_,restoreFeature:O,addRepository:R,removeRepository:M,replaceRepository:S,getFeatureRepositoryPath:P,getRepositoryData:T,getRepoMapSize:A,setCallbacks:D,beginMutation:F,endMutation:$,isMutating:z}}(e,o),N=(0,t.useRef)(d),C=(0,t.useRef)(l);(0,t.useEffect)(()=>{N.current=d,C.current=l},[d,l]);let _=(0,t.useMemo)(()=>e.map(e=>e.id).sort().join(","),[e]),O=(0,t.useMemo)(()=>e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(","),[e]),R=(0,t.useRef)("");(0,t.useEffect)(()=>{let t=`${_}|${O}`;t!==R.current&&(R.current=t,c(e,o))},[_,O,e,o,c]);let M=(0,t.useRef)(new Map),{events:S}=(0,W.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=M.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&&(S.some(t=>t.featureId===e.featureId&&(0,H.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)}},[O,e,S,a]);let P=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(P.current>S.length&&(P.current=0),S.length<=P.current)return;let e=S.slice(P.current);for(let{featureId:t,state:r,lifecycle:n}of(P.current=S.length,(0,H.resolveSseEventUpdates)(e)))if(void 0!==r||void 0!==n){let e=`feat-${t}`,o=N.current.find(t=>t.id===e);if(o&&"deleting"===o.data.state)continue;u(e,{...void 0!==r&&{state:r},...void 0!==n&&{lifecycle:n}})}},[S,u]),(0,t.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;u(`feat-${t}`,{state:"running"})};return window.addEventListener("shep:feature-approved",e),()=>window.removeEventListener("shep:feature-approved",e)},[u]);let T=(0,t.useRef)(new Set),A=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(A.current>S.length&&(A.current=0),S.length<=A.current)return;let e=S.slice(A.current);for(let t of(A.current=S.length,e)){if("Feature metadata updated"!==t.message||T.current.has(t.featureId))continue;T.current.add(t.featureId);let e=`feat-${t.featureId}`;q(t.featureId).then(t=>{t&&u(e,{name:t.name,description:t.description})}).catch(()=>{})}},[S,u]),(0,t.useEffect)(()=>{Y.debug("polling enabled (3000ms interval)");let e=setInterval(async()=>{if(!j())try{let e=await fetch("/api/graph-data");if(!e.ok)throw Error(`status ${e.status}`);let{nodes:t,edges:r}=await e.json();c(t,r)}catch{Y.warn("poll fetch failed — will retry next interval")}},3e3);return()=>{Y.debug("polling disabled"),clearInterval(e)}},[c,j]);let D=(0,t.useCallback)(e=>{},[]),F=(0,t.useCallback)(e=>{},[]),U=(0,t.useCallback)((e,t,r)=>{let n=t?.featureId?`feat-${t.featureId}`:`feature-${Date.now()}-${Q++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:t?.featureId??`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return h(n,o,"dependencyEdge"===r&&e?e:void 0),n},[h]),ee=(0,t.useCallback)(e=>{let t=`feat-${e}`;E(),u(t,{state:"running"}),(0,z.resumeFeature)(e).then(e=>{e.error?(u(t,{state:"error"}),n.toast.error(e.error)):n.toast.success("Feature resumed")}).catch(()=>{u(t,{state:"error"}),n.toast.error("Failed to resume feature")}).finally(()=>k())},[u,E,k]),et=(0,t.useCallback)((e,t)=>{let r=`feat-${e}`,o=[],i=[r];for(;i.length>0;){let e=i.shift();for(let t of C.current)"dependencyEdge"===t.type&&t.source===e&&(o.push(t.target),i.push(t.target))}let d=new Map;for(let e of[r,...o]){let t=N.current.find(t=>t.id===e);t&&d.set(e,t.data.state)}for(let e of(E(),u(r,{state:"deleting"}),o))u(e,{state:"deleting"});s.play(),a.push("/"),$(e,t).then(e=>{if(e.error){for(let[e,t]of d)t&&u(e,{state:t});n.toast.error(e.error)}else for(let e of(f(r),o))f(e)}).catch(()=>{for(let[e,t]of d)t&&u(e,{state:t});n.toast.error("Failed to delete feature")}).finally(()=>k())},[a,s,u,f,E,k]),er=(0,t.useCallback)(async e=>{let t=`repo-${e}`,r=new Set(C.current.filter(e=>e.source===t).map(e=>e.target)),o=y(t),a=new Map;for(let e of r){let t=N.current.find(t=>t.id===e);t&&a.set(e,{nodeId:e,data:t.data})}let i=()=>{for(let[e,r]of(o&&g(t,o),a))p(e,r)};for(let e of(E(),m(t),r))f(e);try{let t=await G(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),i();return}s.play()}catch{n.toast.error("Failed to remove repository"),i()}finally{k()}},[s,m,f,g,p,y,E,k]),en=(0,t.useCallback)(e=>{let t=I(N.current,C.current,{...L,direction:e});c(t.nodes,t.edges)},[c]);return{nodes:d,edges:l,onNodesChange:D,handleConnect:F,handleAddRepository:(0,t.useCallback)(e=>{let t=0===b(),r=`repo-temp-${++Z}`,o=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e;return E(),g(r,{name:o,repositoryPath:e,id:r,createdAt:Date.now()}),B({path:e,name:o}).then(e=>{if(e.error){m(r),n.toast.error(e.error);return}let t=e.repository;v(r,`repo-${t.id}`,{name:t.name,repositoryPath:t.path,id:t.id,createdAt:t.createdAt instanceof Date?t.createdAt.getTime():Number(t.createdAt)}),i.play()}).catch(()=>{m(r),n.toast.error("Failed to add repository")}).finally(()=>k()),{wasEmpty:t,repoPath:e}},[g,m,v,i,b,E,k]),handleLayout:en,handleDeleteFeature:et,handleRetryFeature:ee,handleDeleteRepository:er,createFeatureNode:U,getFeatureRepositoryPath:x,getRepositoryData:y,setCallbacks:w}}e.s(["useControlCenterState",()=>ee],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),a=e.i(3214),s=e.i(38227),i=e.i(31777),d=e.i(35364);e.i(54793);var l=e.i(7729);e.i(47506);var c=e.i(89313),u=e.i(92002),h=e.i(3645);let f=(0,h.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 p=e.i(8986),g=e.i(38573),m=e.i(19933),v=e.i(67669),x=e.i(24042),y=e.i(64970);e.i(81803);var b=e.i(72714),w=e.i(2287),E=e.i(2828);e.i(99348);var k=e.i(17466),j=e.i(8537),N=e.i(75921),C=e.i(76852);function _({data:e}){let o=(0,N.useFeatureFlags)(),[s,l]=(0,n.useState)(!1),c=(0,C.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),h=(0,j.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),_="Booting"===h.status||"Ready"===h.status;return(0,t.jsxs)("div",{className:(0,i.cn)("group relative",e.onDelete&&e.id&&"pl-10"),children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:u.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-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),l(!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)(v.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(E.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.Dialog,{open:s,onOpenChange:l,children:(0,t.jsxs)(w.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(w.DialogHeader,{children:[(0,t.jsx)(w.DialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.DialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," and all its features from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(w.DialogClose,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(d.Button,{variant:"destructive",onClick:()=>{l(!1),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-pointer items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(f,{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,i.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)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in IDE",onClick:c.openInIde,loading:c.ideLoading,error:!!c.ideError,icon:p.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in Shell",onClick:c.openInShell,loading:c.shellLoading,error:!!c.shellError,icon:g.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open Folder",onClick:c.openFolder,loading:c.folderLoading,error:!!c.folderError,icon:m.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open Folder"})]})}),o.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:_?"Stop Dev Server":"Start Dev Server",onClick:_?h.stop:h.deploy,loading:h.deployLoading||h.stopLoading,error:!!h.deployError,icon:_?y.Square:x.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:_?"Stop Dev Server":"Start Dev Server"})]})}),_?(0,t.jsx)(k.DeploymentStatusBadge,{status:h.status,url:h.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.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:(0,i.cn)("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",e.pulseAdd&&"animate-pulse-cta bg-blue-100 text-blue-500 dark:bg-blue-900/40"),children:(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(E.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:u.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}function O(e){let[n]=(0,u.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}e.i(1650),e.i(45811),e.i(25235);let R={x:30,y:30,zoom:.85};function M({onResetViewport:e}){let{setViewport:o}=(0,r.useReactFlow)(),a=(0,n.useCallback)(()=>{o(e(),{duration:400})},[e,o]);return(0,t.jsx)(r.ControlButton,{onClick:a,title:"Reset view","aria-label":"Reset view",children:(0,t.jsx)(s.RotateCcw,{style:{fill:"none"}})})}function S({nodes:e,edges:o,selectedFeatureId:s,defaultViewport:u,onNodesChange:h,onAddFeature:f,onConnect:p,onNodeClick:g,onPaneClick:m,onCanvasDrag:v,onMoveEnd:x,onResetViewport:y,toolbar:b,emptyState:w}){let E=(0,n.useMemo)(()=>({featureNode:c.FeatureNode,repositoryNode:_}),[]),k=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),j=(0,n.useMemo)(()=>null==s?e:e.map(e=>"featureNode"===e.type&&e.data.featureId===s?{...e,selected:!0}:e),[e,s]),N=0===e.length,[C,S]=(0,n.useState)(N),[P,T]=(0,n.useState)(!1),L=(0,n.useRef)(N);(0,n.useEffect)(()=>{if(L.current&&!N){T(!0);let e=setTimeout(()=>{S(!1),T(!1)},300);return L.current=N,()=>clearTimeout(e)}!L.current&&N&&S(!0),L.current=N},[N]);let A=N&&!w?(0,t.jsx)(l.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(d.Button,{onClick:f,children:[(0,t.jsx)(a.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})}):null,D=w??A;return(0,t.jsxs)("div",{"data-testid":N?"features-canvas-empty":"features-canvas","data-no-drawer-close":!0,className:"dark:bg-background pointer-events-auto relative h-full w-full bg-[#f6f7f8]",children:[(0,t.jsxs)(r.ReactFlow,{nodes:j,edges:o,nodeTypes:E,edgeTypes:k,onConnect:p,onNodesChange:h,onNodeClick:g,onPaneClick:m,onMoveStart:v,onMoveEnd:x,defaultViewport:u??R,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,t.jsx)(r.Background,{variant:r.BackgroundVariant.Dots,gap:24,size:1,color:"#b8bcc4",className:"dark:[&_circle]:!fill-white/[0.1]"}),!N&&(0,t.jsx)(r.Controls,{showInteractive:!1,children:y?(0,t.jsx)(M,{onResetViewport:y}):null}),b]}),C&&D?(0,t.jsx)("div",{className:(0,i.cn)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",P?"opacity-0":"animate-in fade-in opacity-100 duration-200"),children:(0,t.jsx)("div",{className:"pointer-events-auto",children:D})}):null]})}var P=e.i(5147),T=e.i(8361),L=e.i(30153);let A="shep-canvas-viewport",D={x:30,y:30,zoom:.85},I=(0,h.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var F=e.i(33548),$=e.i(23925),z=e.i(83428),B=e.i(35e3),G=e.i(79687),q=e.i(78521),W=e.i(21023);let V=(0,W.createServerReference)("0012efd992549bfc0f4cf5f313c7a1e2c636f4dd1b",W.callServer,void 0,W.findSourceMapURL,"isAgentSetupComplete"),U=(0,W.createServerReference)("0089eaf6989b17f1909f40250f7512104416c5f890",W.callServer,void 0,W.findSourceMapURL,"checkAgentAuth");var H=e.i(76016),X=e.i(11345),J=e.i(26370),K=e.i(28701),Y=e.i(65652),Q=e.i(86782),Z=e.i(29847);let ee=["select-agent","select-model"];function et({onComplete:e,className:r}){let o,[a,s]=(0,n.useState)([]),[d,l]=(0,n.useState)(!0),[c,u]=(0,n.useState)("select-agent"),[h,f]=(0,n.useState)(null),[p,g]=(0,n.useState)(!1),[m,v]=(0,n.useState)(!1),[x,y]=(0,n.useState)(!0),b=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{(0,K.getAllAgentModels)().then(s).finally(()=>l(!1))},[]);let w=h?a.find(e=>e.agentType===h):null,E=(0,n.useCallback)((e,t)=>{v(!0),y(!1),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{t?.(),u(e),requestAnimationFrame(()=>{y(!0),v(!1)})},150)},[]);(0,n.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let k=(0,n.useCallback)(async(t,r)=>{g(!0);try{await (0,Y.updateAgentAndModel)(t,r),e()}finally{g(!1)}},[e]),j=(0,n.useCallback)(e=>{let t=a.find(t=>t.agentType===e);t&&t.models.length>0?E("select-model",()=>{f(e)}):k(e,null)},[a,E,k]),N=(0,n.useCallback)(e=>{h&&k(h,e)},[h,k]),C=(0,n.useCallback)(()=>{"select-model"===c&&E("select-agent",()=>{f(null)})},[c,E]);if(d)return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,i.cn)("flex flex-col items-center justify-center gap-3",r),children:[(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Loading agents…"})]});let _=ee.indexOf(c);return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,i.cn)("flex flex-col items-center gap-4","w-72",r),children:[(0,t.jsx)("div",{className:"flex flex-col items-center gap-1",children:(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:["select-agent"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.Bot,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Choose your agent"})]}),"select-model"===c&&w?(o=(0,Q.getAgentTypeIcon)(w.agentType),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:[w.label," — Pick a model"]})]})):null]})}),(0,t.jsx)("div",{className:"flex w-full items-center gap-1",children:ee.map((e,r)=>(0,t.jsx)("div",{className:(0,i.cn)("h-0.5 flex-1 rounded-full transition-colors duration-300",r<=_?"bg-foreground/60":"bg-muted")},e))}),(0,t.jsxs)("div",{className:(0,i.cn)("flex w-full flex-col items-center transition-opacity duration-150",x&&!m?"opacity-100":"opacity-0"),children:["select-agent"===c&&(0,t.jsx)("div",{"data-testid":"agent-list",className:"flex w-full flex-col gap-1.5",children:a.map(e=>{let r=(0,Q.getAgentTypeIcon)(e.agentType);return(0,t.jsxs)("button",{type:"button",disabled:p,"data-testid":`agent-option-${e.agentType}`,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 transition-colors disabled:opacity-50",onClick:()=>j(e.agentType),children:[(0,t.jsx)(r,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left text-xs font-medium",children:e.label}),(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3"})]},e.agentType)})}),"select-model"===c&&w?(0,t.jsxs)("div",{"data-testid":"model-list",className:"flex w-full flex-col gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:p,className:"text-muted-foreground hover:text-foreground mb-0.5 flex cursor-pointer items-center gap-1 self-start text-[10px] font-medium transition-colors",onClick:C,children:[(0,t.jsx)(X.ChevronLeft,{className:"h-3 w-3"}),"Back"]}),(0,t.jsx)("div",{className:"flex max-h-48 w-full flex-col gap-1.5 overflow-y-auto",children:w.models.map(e=>{let r=(0,Z.getModelMeta)(e.id);return(0,t.jsxs)("button",{type:"button",disabled:p,"data-testid":`model-option-${e.id}`,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 text-left transition-colors disabled:opacity-50",onClick:()=>N(e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:r.displayName||e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] leading-tight",children:r.description||e.description})]}),(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"})]},e.id)})})]}):null]})]})}let er=["cd ~/my-repo",'shep feat new "sleek dashboard"'];function en({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[d,l]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[h,p]=(0,n.useState)(null);async function g(){if(!d){l(!0);try{let t=await (0,q.pickFolder)();t&&e?.(t)}finally{l(!1)}}}(0,n.useEffect)(()=>{V().then(e=>{u(e)})},[]),(0,n.useEffect)(()=>{c&&U().then(p)},[c]);let m=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText(er.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]),v=(0,n.useCallback)(()=>{u(!0)},[]),x=(0,n.useCallback)(()=>{p(null),U().then(p)},[]);return null===c?null:(0,t.jsx)("div",{"data-testid":"control-center-empty-state",className:(0,i.cn)("flex flex-col items-center justify-center",r),children:(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 w-96 rounded-2xl border border-white/30 bg-white/50 px-8 py-8 shadow-lg backdrop-blur-xl duration-300 dark:border-white/10 dark:bg-white/5",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsxs)("div",{className:"mb-2 text-center",children:[(0,t.jsx)("h1",{className:"text-xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-light",children:"Control Center"})]}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{status:h,onRetry:x}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:g,disabled:d,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 transition-colors disabled:cursor-wait disabled:opacity-50",children:[d?(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"}):(0,t.jsx)(a.Plus,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:d?"Opening…":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)("div",{className:"bg-border h-px w-10"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(I,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Or via CLI"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-10"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-md bg-zinc-900 px-3 py-2 font-mono text-[11px] text-zinc-300",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:m,className:"absolute top-2 right-2 cursor-pointer rounded p-1 text-zinc-500 transition-colors hover:bg-zinc-800 hover:text-zinc-300","aria-label":"Copy commands",children:o?(0,t.jsx)($.Check,{className:"h-3 w-3"}):(0,t.jsx)(F.Copy,{className:"h-3 w-3"})}),(0,t.jsx)("div",{className:"space-y-0.5",children:er.map(e=>(0,t.jsxs)("div",{className:"whitespace-nowrap",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-[10px]",children:"Feature will appear on canvas once created"})]}):(0,t.jsx)(et,{onComplete:v,className:"w-full"})]})})})}function eo({status:e,onRetry:r}){return e?e.installed&&e.authenticated?(0,t.jsxs)("div",{className:"animate-in fade-in flex w-full items-center gap-2 rounded-md bg-emerald-500/10 px-3 py-1.5",children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3 w-3 text-emerald-600 dark:text-emerald-400"}),(0,t.jsxs)("span",{className:"text-[10px] text-emerald-700 dark:text-emerald-300",children:[e.label," ready"]})]}):e.installed?(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-md bg-amber-500/10 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(G.AlertCircle,{className:"h-3 w-3 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("span",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:[e.label," needs authentication"]})]}),e.authCommand?(0,t.jsxs)("div",{className:"rounded bg-zinc-900 px-2 py-1 font-mono text-[10px] text-zinc-300",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),e.authCommand]}):null,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.binaryName?(0,t.jsxs)("button",{type:"button","data-testid":"auth-banner-open-terminal",onClick:async()=>{try{let t="claude-code"===e.agentType?"claude-code":e.agentType;await fetch(`/api/tools/${t}/launch`,{method:"POST"})}catch{}},className:"flex items-center gap-1 rounded border border-amber-600/30 px-2 py-0.5 text-[10px] font-medium text-amber-700 transition-colors hover:bg-amber-500/10 dark:text-amber-300",children:[(0,t.jsx)(g.Terminal,{className:"h-2.5 w-2.5"}),"Open ",e.label]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[10px] font-medium text-amber-700 underline underline-offset-2 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",children:"Re-check"})]})]}):(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-md bg-amber-500/10 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(G.AlertCircle,{className:"h-3 w-3 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("span",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:[e.label," not installed"]})]}),e.binaryName?(0,t.jsxs)("div",{className:"rounded bg-zinc-900 px-2 py-1 font-mono text-[10px] text-zinc-300",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),"npm install -g ",e.binaryName]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"self-start text-[10px] font-medium text-amber-700 underline underline-offset-2 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",children:"Re-check"})]}):(0,t.jsxs)("div",{className:"bg-muted/50 flex w-full items-center gap-2 rounded-md px-3 py-1.5",children:[(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-3 w-3 animate-spin"}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:"Checking agent setup…"})]})}var ea=e.i(17840);let es={maxZoom:1,padding:.5,duration:500};function ei({initialNodes:e,initialEdges:a}){let s,i,d,l=(0,o.useRouter)(),c=(0,o.usePathname)(),u=(s=(0,o.usePathname)().match(/^\/feature\/([^/]+)/),s?.[1]??null),h=(0,T.useSoundAction)("click"),{guardedNavigate:f}=(0,L.useDrawerCloseGuard)(),{fitView:p}=(0,r.useReactFlow)(),g=(0,n.useRef)(null),{defaultViewport:m,onMoveEnd:v,resetViewport:x}=(i=(0,n.useRef)(function(){try{let e=localStorage.getItem(A);if(null==e)return D;let t=JSON.parse(e);return!(null==t||"object"!=typeof t||Array.isArray(t))&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.zoom&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?t:D}catch{return D}}()).current,d=(0,n.useRef)(null),(0,n.useEffect)(()=>()=>{null!=d.current&&clearTimeout(d.current)},[]),{defaultViewport:i,onMoveEnd:(0,n.useCallback)(e=>{null!=d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{try{localStorage.setItem(A,JSON.stringify(e))}catch{}},500)},[]),resetViewport:(0,n.useCallback)(()=>{try{localStorage.removeItem(A)}catch{}return D},[])}),{nodes:y,edges:b,onNodesChange:w,handleConnect:E,handleAddRepository:k,handleDeleteFeature:j,handleRetryFeature:N,handleDeleteRepository:C,createFeatureNode:_,setCallbacks:O}=(0,ea.useControlCenterState)(e,a),{setFeatures:R}=(0,P.useSidebarFeaturesContext)(),M=(0,n.useMemo)(()=>y.filter(e=>"featureNode"===e.type),[y]),I=(0,n.useMemo)(()=>M.map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.name}`}).sort().join(","),[M]);(0,n.useEffect)(()=>{R(M.map(e=>{let t=e.data,r=(0,P.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},...t.agentType&&{agentType:t.agentType},...t.modelId&&{modelId:t.modelId}}:null}).filter(Boolean))},[I,M,R]);let F=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let r=t.data;"creating"!==r.state&&"deleting"!==r.state&&e.target.closest('[data-testid="feature-node-card"]')&&f(()=>{h.play(),l.push(`/feature/${r.featureId}`)})}},[l,h,f]),$=(0,n.useCallback)(()=>{h.play(),l.push("/create")},[l,h]),z=(0,n.useCallback)(e=>{h.play();let t=y.find(t=>t.id===e),r=t?.data?.repositoryPath;r?l.push(`/create?repo=${encodeURIComponent(r)}`):l.push("/create")},[y,l,h]),B=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=b.find(t=>t.target===e),n=r?y.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;h.play();let a=new URLSearchParams;o&&a.set("repo",o),a.set("parent",t),l.push(`/create?${a.toString()}`)},[y,b,l,h]),G=(0,n.useCallback)(e=>{let t=y.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&f(()=>l.push(`/repository/${e.id}`))}},[y,l,f]),q=(0,n.useCallback)(()=>{"/"!==c&&f(()=>l.push("/"))},[l,c,f]);(0,n.useEffect)(()=>{let e=e=>{let{wasEmpty:t,repoPath:r}=k(e.detail.path);t&&setTimeout(()=>{p(es),g.current=setTimeout(()=>{f(()=>l.push(`/create?repo=${encodeURIComponent(r)}`))},600)},0)};return window.addEventListener("shep:add-repository",e),()=>{window.removeEventListener("shep:add-repository",e),null!=g.current&&clearTimeout(g.current)}},[k,p,f,l]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail;if(t.parentId)return void _(`feat-${t.parentId}`,{state:"creating",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath},"dependencyEdge");let r=y.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);_(r?.id??null,{state:"running",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[y,_]),(0,n.useEffect)(()=>{let e=e=>{let{featureId:t,cleanup:r}=e.detail;j(t,r)};return window.addEventListener("shep:feature-delete-requested",e),()=>window.removeEventListener("shep:feature-delete-requested",e)},[j]),(0,n.useEffect)(()=>{O({onNodeAction:B,onFeatureDelete:j,onRetryFeature:N,onRepositoryAdd:z,onRepositoryClick:G,onRepositoryDelete:C})},[O,B,j,N,z,G,C]);let W=(0,n.useCallback)((e,t)=>{v(t)},[v]),V=y.some(e=>"repositoryNode"===e.type),[U,H]=(0,n.useState)(V),X=(0,n.useRef)(null);(0,n.useEffect)(()=>(V?(X.current&&(clearTimeout(X.current),X.current=null),H(!0)):U&&(X.current=setTimeout(()=>{H(!1),X.current=null},500)),()=>{X.current&&clearTimeout(X.current)}),[V,U]);let J=c.startsWith("/create"),K=(0,n.useMemo)(()=>{let e=y.filter(e=>"repositoryNode"===e.type),t=y.some(e=>"featureNode"===e.type);return 1!==e.length||t||J?y:y.map(e=>"repositoryNode"===e.type?{...e,data:{...e.data,pulseAdd:!0}}:e)},[y,J]);return(0,t.jsx)(S,{nodes:U?K:[],edges:U?b:[],selectedFeatureId:u,defaultViewport:m,onNodesChange:w,onConnect:E,onAddFeature:$,onNodeClick:F,onPaneClick:q,onMoveEnd:W,onResetViewport:x,emptyState:(0,t.jsx)(en,{onRepositorySelect:k})})}function ed({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)(ei,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>ed],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,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=o((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},a=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function a(e,t,r,n){var o=""+t,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(void 0===n?"\0":n)}function s(e,t){return a(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 a=r.parent(o);return void 0===a||t.hasNode(a)?(n[o]=a,a):a in n?n[a]:e(a)}(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,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,n=i.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=i,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=a(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,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}var i={v:o,w:a};return n&&(i.name=n),i}(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]):a(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]):a(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]):a(this._isDirected,e,t,r),i=this._edgeObjs[o];return i&&(e=i.v,t=i.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"}),i=n((e,t)=>{t.exports={Graph:a(),version:s()}}),d=n((e,t)=>{var r=a();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={},a=!0,s=0,i=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},a=!0)},l=function(){i.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};i.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=i.length,u=1;u<c&&(a=!1,s++,l(),a);u++);if(s===c-1&&(a=!1,l(),a))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}}),u=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],a=r[t];r[e]=a,r[t]=o,n[a.key]=e,n[o.key]=t}}}),h=n((e,t)=>{var r=u();t.exports=function(e,t,o,a){return function(e,t,n,o){var a,s,i={},d=new r,l=function(e){var t=e.v!==a?e.v:e.w,r=i[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=a,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;i[e]={distance:r},d.add(e,r)});d.size()>0&&(s=i[a=d.removeMin()]).distance!==1/0;)o(a).forEach(l);return i}(e,String(t),o||n,a||function(t){return e.outEdges(t)})};var n=()=>1}),f=n((e,t)=>{var r=h();t.exports=function(e,t,n){return e.nodes().reduce(function(o,a){return o[a]=r(e,a,t,n),o},{})}}),p=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(a){Object.hasOwn(n,a)||function a(s){var i=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(i.lowlink=Math.min(i.lowlink,n[e].index)):(a(e),i.lowlink=Math.min(i.lowlink,n[e].lowlink))}),i.lowlink===i.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(a)}),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,a,s,i,d;return o=e,a=t||r,s=n||function(t){return e.outEdges(t)},i={},(d=o.nodes()).forEach(function(e){i[e]={},i[e][e]={distance:0},d.forEach(function(t){e!==t&&(i[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=a(t);i[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=i[e];d.forEach(function(r){var n=i[r];d.forEach(function(r){var o=n[e],a=t[r],s=n[r],i=o.distance+a.distance;i<s.distance&&(s.distance=i,s.predecessor=a.predecessor)})})}),i};var r=()=>1}),x=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function a(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(a),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}),y=n((e,t)=>{var r=x();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),b=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var a=(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,a,s,i){return Object.hasOwn(o,r)||(o[r]=!0,n||(i=s(i,r)),a(r).forEach(function(r){i=e(t,r,n,o,a,s,i)}),n&&(i=s(i,r))),i}(e,t,"post"===r,s,a,n,o)}),o}}),w=n((e,t)=>{var r=b();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=a(),n=u();t.exports=function(e,t){var o,a=new r,s={},i=new n;function d(e){var r=e.v===o?e.w:e.v,n=i.priority(r);if(void 0!==n){var a=t(e);a<n&&(s[r]=o,i.decrease(r,a))}}if(0===e.nodeCount())return a;e.nodes().forEach(function(e){i.add(e,1/0),a.setNode(e)}),i.decrease(e.nodes()[0],0);for(var l=!1;i.size()>0;){if(Object.hasOwn(s,o=i.removeMin()))a.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return a}}),N=n((e,t)=>{var r=h(),n=l();t.exports=function(e,t,o,a){return function(e,t,o,a){if(void 0===o)return r(e,t,o,a);for(var s=!1,i=e.nodes(),d=0;d<i.length;d++){for(var l=a(i[d]),c=0;c<l.length;c++){var u=l[c],h=u.v===i[d]?u.v:u.w,f=h===u.v?u.w:u.v;0>o({v:h,w:f})&&(s=!0)}if(s)return n(e,t,o,a)}return r(e,t,o,a)}(e,t,o,a||function(t){return e.outEdges(t)})}}),C=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:h(),dijkstraAll:f(),extractPath:p(),findCycles:m(),floydWarshall:v(),isAcyclic:y(),postorder:E(),preorder:k(),prim:j(),shortestPaths:N(),reduce:b(),tarjan:g(),topsort:x()}}),_=i();t.exports={Graph:_.Graph,json:d(),alg:C(),version:_.version}}),s=o((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),i=o((e,t)=>{var r=a().Graph,n=s();t.exports=function(e,t){var a,s;let l,c,u,h,f;if(1>=e.nodeCount())return[];let p=(a=e,s=t||o,l=new r,c=0,u=0,a.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),a.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=s(e);l.setEdge(e.v,e.w,t+r),u=Math.max(u,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),h=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(u+c+3).map(()=>new n),f=c+1,l.nodes().forEach(e=>{d(h,f,l.node(e))}),{graph:l,buckets:h,zeroIdx:f});return(function(e,t,r){let n=[],o=t[t.length-1],a=t[0],s;for(;e.nodeCount();){for(;s=a.dequeue();)i(e,t,r,s);for(;s=o.dequeue();)i(e,t,r,s);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue()){n=n.concat(i(e,t,r,s,!0));break}}}return n})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let a=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),i=e.node(n.v);o&&a.push({v:n.v,w:n.w}),i.out-=s,d(t,r,i)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),a=n.w,s=e.node(a);s.in-=o,d(t,r,s)}),e.removeNode(n.v),a}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)}}),d=o((e,t)=>{var r=a().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 a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=o),n(e,"border",a,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(s(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,a=e.y,s=t.x-o,i=t.y-a,d=e.width/2,l=e.height/2;if(!s&&!i)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(i)*d>Math.abs(s)*l?(i<0&&(l=-l),r=l*s/i,n=l):(s<0&&(d=-d),r=d,n=d*i/s),{x:o+r,y:a+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:s,normalizeRanks:function(e){let t=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,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%a!=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 s(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var i=0;function d(e){return e+""+ ++i}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),{})}}),l=o((e,t)=>{var r=i(),n=d().uniqueId;t.exports={run:function(e){var t,o;let a,s,i;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(a=[],s={},i={},(o=e).nodes().forEach(function e(t){Object.hasOwn(i,t)||(i[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?a.push(t):e(t.w)}),delete s[t])}),a)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),c=o((e,t)=>{var r=d();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,a,s=t.v,i=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,u=e.edge(t),h=u.labelRank;if(l!==i+1){for(e.removeEdge(t),a=0,++i;i<l;++a,++i)u.points=[],o={width:0,height:0,edgeLabel:u,edgeObj:t,rank:i},n=r.addDummyNode(e,"edge",o,"_d"),i===h&&(o.width=u.width,o.height=u.height,o.dummy="edge-label",o.labelpos=u.labelpos),e.setEdge(s,n,{weight:u.weight},c),0===a&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:u.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=o((e,t)=>{var{applyWithChunking:r}=d();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var a=e.node(o);if(Object.hasOwn(t,o))return a.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),a.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=o((e,t)=>{var r=a().Graph,n=u().slack;t.exports=function(e){var t,o,a,s,i=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(i.setNode(d,{});t=i,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(a=>{var s=a.v,i=r===s?a.w:s;t.hasNode(i)||n(o,a)||(t.setNode(i,{}),t.setEdge(r,i,{}),e(i))})}),t.nodeCount()<l;)a=function(e,t){return t.edges().reduce((r,o)=>{let a=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(a=n(t,o)),a<r[0]?[a,o]:r},[1/0,null])[1]}(i,e),s=i.hasNode(a.v)?n(e,a):-n(e,a),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(i,e,s);return i}}),f=o((e,t)=>{var r=h(),n=u().slack,o=u().longestPath,s=a().alg.preorder,i=a().alg.postorder,l=d().simplify;function c(e){o(e=l(e));var t,n,a=r(e);for(g(a),f(a,e);t=m(a);)n=v(a,e,t),x(a,e,t,n)}function f(e,t){var r=i(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,a,s;return n=e,o=t,a=r,s=n.node(a).parent,void(n.edge(a,s).cutvalue=p(n,o,a))})}function p(e,t,r){var n=e.node(r).parent,o=!0,a=t.edge(r,n),s=0;return a||(o=!1,a=t.edge(n,r)),s=a.weight,t.nodeEdges(r).forEach(a=>{var i=a.v===r,d=i?a.w:a.v;if(d!==n){var l,c,u,h=i===o,f=t.edge(a).weight;if(s+=h?f:-f,l=e,c=r,u=d,l.hasEdge(c,u)){var p=e.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,a){var s=n,i=t.node(o);return r[o]=!0,t.neighbors(o).forEach(a=>{Object.hasOwn(r,a)||(n=e(t,r,n,a,o))}),i.low=s,i.lim=n++,a?i.parent=a:delete i.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,a=r.w;t.hasEdge(o,a)||(o=r.w,a=r.v);var s=e.node(o),i=e.node(a),d=s,l=!1;return s.lim>i.lim&&(d=i,l=!0),t.edges().filter(t=>l===y(e,e.node(t.v),d)&&l!==y(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function x(e,t,r,n){var o,a,i,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),f(e,t),o=e,a=t,i=o.nodes().find(e=>!a.node(e).parent),(d=(d=s(o,i)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=a.edge(e,t),n=!1;r||(r=a.edge(t,e),n=!0),a.node(e).rank=a.node(t).rank+(n?r.minlen:-r.minlen)})}function y(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=f,c.calcCutValue=p,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=x}),p=o((e,t)=>{var r=u().longestPath,n=h(),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":a(e);case"none":}};var a=r}),g=o((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let a=n;t.children(o).forEach(e),r[o]={low:a,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,a=function(e,t,r,n){let o=[],a=[],s=Math.min(t[r].low,t[n].low),i=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||i>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)a.push(d);return{path:o.concat(a.reverse()),lca:l}}(e,o,n.v,n.w),s=a.path,i=a.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==i&&e.node(l).maxRank<r.rank;)d++;l===i&&(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]}})}}),m=o((e,t)=>{var r=d();t.exports={run:function(e){var t,n,o;let a=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var a=t.children(r);a&&a.length&&a.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),i=Object.values(s),d=r.applyWithChunking(Math.max,i)-1,l=2*d+1;e.graph().nestingRoot=a,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,a,s,i,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"),u=r.addBorderNode(t,"_bb"),h=t.node(d);t.setParent(c,d),h.borderTop=c,t.setParent(u,d),h.borderBottom=u,l.forEach(r=>{e(t,n,o,a,s,i,r);let l=t.node(r),h=l.borderTop?l.borderTop:r,f=l.borderBottom?l.borderBottom:r,p=l.borderTop?a:2*a,g=h!==f?1:s-i[d]+1;t.setEdge(c,h,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,u,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+i[d]})})(e,a,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)})}}}),v=o((e,t)=>{var r=d();function n(e,t,n,o,a,s){let i=a[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);a[t][s]=d,e.setParent(d,o),i&&e.setEdge(i,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),a=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,o=a.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,a,t),n(e,"borderRight","_br",r,a,t)}})}}),x=o((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 a(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=>a(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(a),Object.hasOwn(t,"x")&&a(t)}),r(e))}}}),y=o((e,t)=>{var r=d();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),a=r.applyWithChunking(Math.max,o),s=r.range(a+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),b=o((e,t)=>{var r=d().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)),a=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 i=2*s-1;s-=1;let d=Array(i).fill(0),l=0;return a.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}}),w=o((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}}})}}),E=o((e,t)=>{var r=d();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))}}),k=o((e,t)=>{var r=d();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 a=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=a.lhs,i=a.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,u=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)),u=n(d,i,u),s.forEach(e=>{u+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,u=n(d,i,u)});let h={vs:d.flat(!0)};return c&&(h.barycenter=l/c,h.weight=c),h}}),j=o((e,t)=>{var r=w(),n=E(),o=k();t.exports=function e(t,a,s,i){var d,l;let c=t.children(a),u=t.node(a),h=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};h&&(c=c.filter(e=>e!==h&&e!==f));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let a=e(t,r.v,s,i);p[r.v]=a,Object.hasOwn(a,"barycenter")&&(n=r,o=a,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=p,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,i);if(h&&(v.vs=[h,v.vs,f].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),r=t.node(t.predecessors(f)[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=o((e,t)=>{var r=a().Graph,n=d();t.exports=function(e,t,o,a){a||(a=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),i=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return a.forEach(r=>{let n=e.node(r),a=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(i.setNode(r),i.setParent(r,a||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=i.edge(n,r),a=void 0!==o?o.weight:0;i.setEdge(n,r,{weight:e.edge(t).weight+a})}),Object.hasOwn(n,"minRank")&&i.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),i}}),C=o((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let a=e.parent(r),s,i;for(;a;){if((s=e.parent(a))?(i=n[s],n[s]=a):(i=o,o=a),i&&i!==a)return void t.setEdge(i,a);a=s}})}}),_=o((e,t)=>{var r=y(),n=b(),o=j(),s=N(),i=C(),l=a().Graph,c=d();function u(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 s(e,t,r,n.get(t)||[])})}function h(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,a={}){if("function"==typeof a.customOrder)return void a.customOrder(t,e);let s=c.maxRank(t),d=u(t,c.range(1,s+1),"inEdges"),f=u(t,c.range(s-1,-1,-1),"outEdges"),p=r(t);if(h(t,p),a.disableOptimalOrderHeuristic)return;let g=1/0,m,v=a.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new l;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let a=e.graph().root,s=o(e,a,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),i(e,n,s.vs)})})(e%2?d:f,e%4>=2,v),p=c.buildLayerMatrix(t);let a=n(t,p);a<g?(r=0,m=Object.assign({},p),g=a):a===g&&(m=structuredClone(p))}h(t,m)}}),O=o((e,t)=>{var r=a().Graph,n=d();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,a=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),u=c?e.node(c).order:s;(c||t===d)&&(n.slice(a,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let a=e.node(n),s=a.order;(s<o||u<s)&&!(a.dummy&&e.node(t).dummy)&&i(r,n,t)})}),a=l+1,o=u)}),n}),r}function s(e,t){let r={};function o(t,o,a,s,d){let l;n.range(o,a).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)&&i(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,a,s=0;return r.forEach((i,d)=>{if("border"===e.node(i).dummy){let t=e.predecessors(i);t.length&&(a=e.node(t[0]).order,o(r,s,d,n,a),s=d,n=a)}o(r,s,r.length,a,t.length)}),r}),r}function i(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function l(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={},a={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,a[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let i=n(e);if(i.length){let n=((i=i.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let d=Math.floor(n),c=Math.ceil(n);d<=c;++d){let n=i[d];a[e]===e&&t<s[n]&&!l(r,e,n)&&(a[n]=e,a[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:a}}function u(e,t,n,o,a){var s,i,d,l,c,u,h;let f,p,g,m={},v=(s=e,i=t,d=n,l=a,f=new r,g=(c=(p=s.graph()).nodesep,u=p.edgesep,h=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),a,s;if(a=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&&(a+=h?s:-s),s=0,a+=(n.dummy?u:c)/2,a+=(o.dummy?u:c)/2,a+=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&&(a+=h?s:-s),s=0,a}),i.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(f.setNode(r),t){var n=d[t],o=f.edge(n,r);f.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),f),x=a?"borderLeft":"borderRight";function y(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 y(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),y(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!==x&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function h(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var a,s;let i=(a=e,s=t,a.node(s).width/2);n=Math.max(r+i,n),o=Math.min(r-i,o)});let a=n-o;return a<t[0]&&(t=[a,r]),t},[1/0,null])[1]}function f(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),a=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let i=r+s,d=e[i];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=a-n.applyWithChunking(Math.max,l)),c&&(e[i]=n.mapValues(d,e=>e+c))})})}function p(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),s(e,t)),a={},i;["u","d"].forEach(o=>{i="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(i=i.map(e=>Object.values(e).reverse()));let s=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,i,r,s),l=u(e,i,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),a[o+t]=l})});let d=h(e,a);return f(a,d),p(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:i,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}}),R=o((e,t)=>{var r=d(),n=O().positionX;t.exports=function(e){var t;let o,a,s,i;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),a=t.graph().ranksep,s=t.graph().rankalign,i=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=i+n.height/2:"bottom"===s?n.y=i+r-n.height/2:n.y=i+r/2}),i+=r+a}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=o((e,t)=>{var r=l(),n=c(),o=p(),s=d().normalizeRanks,i=g(),u=d().removeEmptyRanks,h=m(),f=v(),y=x(),b=_(),w=R(),E=d(),k=a().Graph;t.exports=function(e,t={}){let a=t.debugTiming?E.time:E.notime;return a("layout",()=>{let d=a(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=A(t.graph()),r.setGraph(Object.assign({},N,L(n,j),E.pick(n,C))),t.nodes().forEach(e=>{let n=L(A(t.node(e)),O);Object.keys(M).forEach(e=>{void 0===n[e]&&(n[e]=M[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=A(t.edge(e));r.setEdge(e,Object.assign({},P,L(n,S),E.pick(n,T)))}),r});return a(" runLayout",()=>{var e,l,c;return e=d,l=a,c=t,void(l(" 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)}))}),l(" 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)}})}),l(" acyclic",()=>r.run(e)),l(" nestingGraph.run",()=>h.run(e)),l(" rank",()=>o(E.asNonCompoundGraph(e))),l(" 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")}})}),l(" removeEmptyRanks",()=>u(e)),l(" nestingGraph.cleanup",()=>h.cleanup(e)),l(" normalizeRanks",()=>s(e)),l(" 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)}),l(" 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))})}),l(" normalize.run",()=>n.run(e)),l(" parentDummyChains",()=>i(e)),l(" addBorderSegments",()=>f(e)),l(" order",()=>b(e,c)),l(" 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})})}),l(" adjustCoordinateSystem",()=>y.adjust(e)),l(" position",()=>w(e)),l(" 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,a=n.y,s=r.x-o,i=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:a-i},{x:o+5*s/6,y:a-i},{x:o+s,y:a},{x:o+5*s/6,y:a+i},{x:o+2*s/3,y:a+i}],r.label.x=r.x,r.label.y=r.y}})}),l(" 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),a=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-a.x),r.height=Math.abs(o.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),l(" normalize.undo",()=>n.undo(e)),l(" 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}})}),l(" undoCoordinateSystem",()=>y.undo(e)),l(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,a=e.graph(),s=a.marginx||0,i=a.marginy||0;function d(e){let a=e.x,s=e.y,i=e.width,d=e.height;t=Math.min(t,a-i/2),r=Math.max(r,a+i/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-=i,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)}),a.width=r-t+s,a.height=o-n+i})(e)),l(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=o,s=n),r.points.unshift(E.intersectRect(n,a)),r.points.push(E.intersectRect(o,s))})}),l(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),l(" acyclic.undo",()=>r.undo(e)))}),a(" updateInputGraph",()=>{var t,r;return t=e,r=d,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)}),d})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],O=["width","height","rank"],M={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function L(e,t){return E.mapValues(E.pick(e,t),Number)}function A(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),S=o((e,t)=>{var r=d(),n=a().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}}}),P=o((e,t)=>{t.exports="2.0.4"});let T=o((e,t)=>{t.exports={graphlib:a(),layout:M(),debug:S(),util:{time:d().time,notime:d().notime},version:P()}})(),L={direction:"LR",ranksep:200,nodesep:15},A={featureNode:{width:288,height:140},repositoryNode:{width:328,height:50}};function D(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:A[e.type??""]??t}function I(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:a=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let i=new T.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:n,ranksep:a,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=D(e,o);i.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)i.hasNode(e.source)&&i.hasNode(e.target)&&i.setEdge(e.source,e.target,{},e.id);T.layout(i);let{targetPosition:u,sourcePosition:h}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),f="LR"===n||"RL"===n,p=new Map;for(let e of l){let t=i.node(e.id),r=D(e,o);p.set(e.id,{cx:t.x,cy:t.y,w:r.width,h:r.height})}let g=0;for(let e of p.values()){g=f?e.cx:e.cy;break}for(let e of c){let t=D(e,o);p.set(e.id,{cx:f?g:0,cy:f?0:g,w:t.width,h:t.height})}let m=new Map;for(let e of t)p.has(e.source)&&p.has(e.target)&&(m.has(e.source)||m.set(e.source,[]),m.get(e.source).push(e.target));let v=new Map;for(let t=0;t<e.length;t++)v.set(e[t].id,t);for(let[,e]of m)e.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let x=new Set;for(let e of m.values())for(let t of e)x.add(t);let y=[...[...d].filter(e=>p.has(e)&&!x.has(e)),...c.map(e=>e.id)];y.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let b=new Map;for(let e of y)!function e(t){if(b.has(t))return b.get(t);let r=p.get(t),n=f?r.h:r.w,o=m.get(t);if(!o||0===o.length)return b.set(t,n),n;let a=0;for(let t of o)a+=e(t);let i=Math.max(n,a+=(o.length-1)*s);return b.set(t,i),i}(e);let w=0;for(let e of y){let t=b.get(e)??0;!function e(t,r){let n=p.get(t);f?n.cy=r:n.cx=r;let o=m.get(t);if(!o||0===o.length)return;let a=0;for(let e of o)a+=b.get(e)??0;let i=r-(a+=(o.length-1)*s)/2;for(let t of o){let r=b.get(t)??0;e(t,i+r/2),i+=r+s}}(e,w+t/2),w+=t+s}let E=[];for(let t of e){let e=p.get(t.id);e&&E.push({...t,targetPosition:u,sourcePosition:h,position:{x:e.cx-e.w/2,y:e.cy-e.h/2}})}return{nodes:E,edges:[...t]}}var F=e.i(21023);let $=(0,F.createServerReference)("60444b38644888b8c72ce8758a209a6149deac842e",F.callServer,void 0,F.findSourceMapURL,"deleteFeature");var z=e.i(55198);let B=(0,F.createServerReference)("40f0e467251111dd777dd75377b9a270a632824a07",F.callServer,void 0,F.findSourceMapURL,"addRepository"),G=(0,F.createServerReference)("40125a88151158e44fc8f2561c739070e1e22520fa",F.callServer,void 0,F.findSourceMapURL,"deleteRepository"),q=(0,F.createServerReference)("40f46e6041936de24a0e16fbf47258175190117a90",F.callServer,void 0,F.findSourceMapURL,"getFeatureMetadata");var W=e.i(39443),V=e.i(8361),U=e.i(18354),H=e.i(99045);function X(e,t){let r=new Map;for(let e of t)"dependencyEdge"===e.type&&r.set(e.target,e.source);let n=new Map,o=new Map;for(let t of e)"featureNode"===t.type?n.set(t.id,{nodeId:t.id,data:t.data,parentNodeId:r.get(t.id)}):"repositoryNode"===t.type&&o.set(t.id,{nodeId:t.id,data:t.data});return{featureMap:n,repoMap:o}}function J(e,t){return(void 0===t.state||t.state===e.state)&&(void 0===t.lifecycle||t.lifecycle===e.lifecycle)&&(void 0===t.name||t.name===e.name)&&(void 0===t.description||t.description===e.description)}function K(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||n.parentNodeId!==e.parentNodeId||n.data!==e.data&&JSON.stringify(n.data)!==JSON.stringify(e.data))return!1}return!0}let Y=(0,U.createLogger)("[Polling]"),Q=0,Z=0;function ee(e,o){let a=(0,r.useRouter)(),s=(0,V.useSoundAction)("delete"),i=(0,V.useSoundAction)("create"),{nodes:d,edges:l,reconcile:c,updateFeature:u,addPendingFeature:h,removeFeature:f,restoreFeature:p,addRepository:g,removeRepository:m,replaceRepository:v,getFeatureRepositoryPath:x,getRepositoryData:y,getRepoMapSize:b,setCallbacks:w,beginMutation:E,endMutation:k,isMutating:j}=function(e,r){let n=(0,t.useMemo)(()=>X(e,r),[]),[o,a]=(0,t.useState)(n.featureMap),[s,i]=(0,t.useState)(n.repoMap),[d,l]=(0,t.useState)(new Map),c=(0,t.useRef)(new Map),u=(0,t.useRef)(new Set),h=(0,t.useRef)(0),f=(0,t.useRef)(new Set),p=(0,t.useRef)(new Set),g=(0,t.useRef)({}),m=(0,t.useMemo)(()=>({onNodeAction:e=>g.current.onNodeAction?.(e),onNodeSettings:e=>g.current.onNodeSettings?.(e),onFeatureDelete:e=>g.current.onFeatureDelete?.(e),onRepositoryAdd:e=>g.current.onRepositoryAdd?.(e),onRepositoryClick:e=>g.current.onRepositoryClick?.(e),onRepositoryDelete:e=>g.current.onRepositoryDelete?.(e),onRetryFeature:e=>g.current.onRetryFeature?.(e)}),[]),v=(0,t.useRef)(o);v.current=o;let x=(0,t.useRef)(s);x.current=s;let y=(0,t.useMemo)(()=>(function(e,t,r,n){let o=[],a=[],s=e=>e.replace(/\\/g,"/"),i=new Map;for(let[e,r]of t)r.data.repositoryPath&&i.set(s(r.data.repositoryPath),e);let d=new Map;for(let[e,r]of[...t.entries()].sort((e,t)=>(e[1].data.createdAt??0)-(t[1].data.createdAt??0))){let t={...r.data,...n?.onRepositoryAdd&&{onAdd:()=>n.onRepositoryAdd(e)},...n?.onRepositoryClick&&{onClick:()=>n.onRepositoryClick(e)},...n?.onRepositoryDelete&&{onDelete:n.onRepositoryDelete}};o.push({id:e,type:"repositoryNode",position:{x:0,y:0},data:t})}for(let[t,l,c]of[...[...e.entries()].map(([e,t])=>[e,t,!1]),...[...r.entries()].filter(([t])=>!e.has(t)).map(([e,t])=>[e,t,!0])]){let e="creating"===l.data.state||c,r={...l.data,...!e&&n?.onNodeAction&&{onAction:()=>n.onNodeAction(t)},...!e&&n?.onNodeSettings&&{onSettings:()=>n.onNodeSettings(t)},...!e&&n?.onFeatureDelete&&{onDelete:n.onFeatureDelete},...!e&&"error"===l.data.state&&n?.onRetryFeature&&{onRetry:n.onRetryFeature}};if(o.push({id:t,type:"featureNode",position:{x:0,y:0},data:r}),l.parentNodeId)a.push({id:`dep-${l.parentNodeId}-${t}`,source:l.parentNodeId,target:t,type:"dependencyEdge"});else{let e=s(l.data.repositoryPath),r=i.get(e)??function(e){if(d.has(e))return d.get(e);let t=`virtual-repo-${e}`,r=e.split("/").filter(Boolean).at(-1)??e;return o.push({id:t,type:"repositoryNode",position:{x:0,y:0},data:{name:r,repositoryPath:e}}),d.set(e,t),t}(e);a.push({id:`edge-${r}-${t}`,source:r,target:t,style:{strokeDasharray:"5 5"}})}}let l=a.length>0;for(let e of o)e.data.showHandles=l;return{nodes:o,edges:a}})(o,s,d,m),[o,s,d,m]),b=(0,t.useRef)({key:"",positions:new Map}),{nodes:w,edges:E}=(0,t.useMemo)(()=>{let e=y.nodes.map(e=>e.id).sort().join(","),t=y.edges.map(e=>`${e.source}-${e.target}`).sort().join(","),r=`${e}|${t}`;if(r!==b.current.key){let e=I(y.nodes,y.edges,L),t=new Map;for(let r of e.nodes)t.set(r.id,{position:r.position,targetPosition:r.targetPosition,sourcePosition:r.sourcePosition});let n=b.current.positions;if(n.size>0){let r=0,o=0;for(let[e,a]of t){let t=n.get(e);if(t){r=t.position.x-a.position.x,o=t.position.y-a.position.y;break}}if(0!==r||0!==o){for(let e of t.values())e.position={x:e.position.x+r,y:e.position.y+o};for(let t of e.nodes)t.position={x:t.position.x+r,y:t.position.y+o}}}return b.current={key:r,positions:t},e}let{positions:n}=b.current;return{nodes:y.nodes.map(e=>{let t=n.get(e.id);return t?{...e,...t}:e}),edges:y.edges}},[y]),k=(0,t.useCallback)((e,t)=>{if(h.current>0)return;let{featureMap:r,repoMap:n}=X(e,t),o=new Set([...r.values()].map(e=>`${e.data.name}\0${e.data.repositoryPath}`));a(e=>{let t=[...e.entries()].filter(([,e])=>"creating"===e.data.state),n=new Map(r);for(let[e,r]of t){let t=`${r.data.name}\0${r.data.repositoryPath}`;o.has(t)||n.set(e,r)}let a=new Set;for(let[t,r]of e)"deleting"===r.data.state&&(n.has(t)?n.set(t,{...n.get(t),data:{...n.get(t).data,state:"deleting"}}):p.current.has(t)||(n.set(t,r),a.add(t)));for(let[e,t]of(p.current=a,c.current)){let r=n.get(e);r&&(n.set(e,{...r,data:{...r.data,...t}}),c.current.delete(e))}return K(e,n)?e:n}),l(e=>{if(0===e.size)return e;let t=!1,r=new Map(e);for(let[n,a]of e){let e=`${a.data.name}\0${a.data.repositoryPath}`;o.has(e)&&(r.delete(n),t=!0)}return t?r:e}),i(e=>{let t=new Map(n),r=new Set([...n.values()].map(e=>e.data.repositoryPath));for(let[n,o]of e){if(t.has(n)||r.has(o.data.repositoryPath)){u.current.delete(n);continue}(n.startsWith("repo-temp-")||u.current.has(n))&&t.set(n,o)}return K(e,t)?e:t})},[]),j=(0,t.useCallback)((e,t)=>{a(r=>{let n=r.get(e);if(!n)return c.current.set(e,{...c.current.get(e),...t}),r;if(c.current.delete(e),J(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o}),l(r=>{let n=r.get(e);if(!n||J(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o})},[]),N=(0,t.useCallback)((e,t,r)=>{l(n=>{let o=new Map(n);return o.set(e,{nodeId:e,data:t,parentNodeId:r}),o})},[]),C=(0,t.useCallback)(e=>{l(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),_=(0,t.useCallback)(e=>{a(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),O=(0,t.useCallback)((e,t)=>{a(r=>{let n=new Map(r);return n.set(e,t),n})},[]),R=(0,t.useCallback)((e,t)=>{u.current.add(e),i(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),M=(0,t.useCallback)(e=>{u.current.delete(e),i(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),S=(0,t.useCallback)((e,t,r)=>{u.current.delete(e),u.current.add(t),i(n=>{if(!n.has(e))return n;let o=new Map(n);return o.delete(e),o.set(t,{nodeId:t,data:r}),o})},[]),P=(0,t.useCallback)(e=>v.current.get(e)?.data.repositoryPath,[]),T=(0,t.useCallback)(e=>x.current.get(e)?.data,[]),A=(0,t.useCallback)(()=>x.current.size,[]),D=(0,t.useCallback)(e=>{g.current=e},[]),F=(0,t.useCallback)(()=>{h.current++},[]),$=(0,t.useCallback)((e=3e3)=>{let t=setTimeout(()=>{h.current=Math.max(0,h.current-1),f.current.delete(t)},e);f.current.add(t)},[]),z=(0,t.useCallback)(()=>h.current>0,[]);return(0,t.useEffect)(()=>{let e=f.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]),{nodes:w,edges:E,reconcile:k,updateFeature:j,addPendingFeature:N,removePendingFeature:C,removeFeature:_,restoreFeature:O,addRepository:R,removeRepository:M,replaceRepository:S,getFeatureRepositoryPath:P,getRepositoryData:T,getRepoMapSize:A,setCallbacks:D,beginMutation:F,endMutation:$,isMutating:z}}(e,o),N=(0,t.useRef)(d),C=(0,t.useRef)(l);(0,t.useEffect)(()=>{N.current=d,C.current=l},[d,l]);let _=(0,t.useMemo)(()=>e.map(e=>e.id).sort().join(","),[e]),O=(0,t.useMemo)(()=>e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(","),[e]),R=(0,t.useRef)("");(0,t.useEffect)(()=>{let t=`${_}|${O}`;t!==R.current&&(R.current=t,c(e,o))},[_,O,e,o,c]);let M=(0,t.useRef)(new Map),{events:S}=(0,W.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=M.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&&(S.some(t=>t.featureId===e.featureId&&(0,H.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)}},[O,e,S,a]);let P=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(P.current>S.length&&(P.current=0),S.length<=P.current)return;let e=S.slice(P.current);for(let{featureId:t,state:r,lifecycle:n}of(P.current=S.length,(0,H.resolveSseEventUpdates)(e)))if(void 0!==r||void 0!==n){let e=`feat-${t}`,o=N.current.find(t=>t.id===e);if(o&&"deleting"===o.data.state)continue;u(e,{...void 0!==r&&{state:r},...void 0!==n&&{lifecycle:n}})}},[S,u]),(0,t.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;u(`feat-${t}`,{state:"running"})};return window.addEventListener("shep:feature-approved",e),()=>window.removeEventListener("shep:feature-approved",e)},[u]);let T=(0,t.useRef)(new Set),A=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(A.current>S.length&&(A.current=0),S.length<=A.current)return;let e=S.slice(A.current);for(let t of(A.current=S.length,e)){if("Feature metadata updated"!==t.message||T.current.has(t.featureId))continue;T.current.add(t.featureId);let e=`feat-${t.featureId}`;q(t.featureId).then(t=>{t&&u(e,{name:t.name,description:t.description})}).catch(()=>{})}},[S,u]),(0,t.useEffect)(()=>{Y.debug("polling enabled (3000ms interval)");let e=setInterval(async()=>{if(!j())try{let e=await fetch("/api/graph-data");if(!e.ok)throw Error(`status ${e.status}`);let{nodes:t,edges:r}=await e.json();c(t,r)}catch{Y.warn("poll fetch failed — will retry next interval")}},3e3);return()=>{Y.debug("polling disabled"),clearInterval(e)}},[c,j]);let D=(0,t.useCallback)(e=>{},[]),F=(0,t.useCallback)(e=>{},[]),U=(0,t.useCallback)((e,t,r)=>{let n=t?.featureId?`feat-${t.featureId}`:`feature-${Date.now()}-${Q++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:t?.featureId??`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return h(n,o,"dependencyEdge"===r&&e?e:void 0),n},[h]),ee=(0,t.useCallback)(e=>{let t=`feat-${e}`;E(),u(t,{state:"running"}),(0,z.resumeFeature)(e).then(e=>{e.error?(u(t,{state:"error"}),n.toast.error(e.error)):n.toast.success("Feature resumed")}).catch(()=>{u(t,{state:"error"}),n.toast.error("Failed to resume feature")}).finally(()=>k())},[u,E,k]),et=(0,t.useCallback)((e,t)=>{let r=`feat-${e}`,o=[],i=[r];for(;i.length>0;){let e=i.shift();for(let t of C.current)"dependencyEdge"===t.type&&t.source===e&&(o.push(t.target),i.push(t.target))}let d=new Map;for(let e of[r,...o]){let t=N.current.find(t=>t.id===e);t&&d.set(e,t.data.state)}for(let e of(E(),u(r,{state:"deleting"}),o))u(e,{state:"deleting"});s.play(),a.push("/"),$(e,t).then(e=>{if(e.error){for(let[e,t]of d)t&&u(e,{state:t});n.toast.error(e.error)}else for(let e of(f(r),o))f(e)}).catch(()=>{for(let[e,t]of d)t&&u(e,{state:t});n.toast.error("Failed to delete feature")}).finally(()=>k())},[a,s,u,f,E,k]),er=(0,t.useCallback)(async e=>{let t=`repo-${e}`,r=new Set(C.current.filter(e=>e.source===t).map(e=>e.target)),o=y(t),a=new Map;for(let e of r){let t=N.current.find(t=>t.id===e);t&&a.set(e,{nodeId:e,data:t.data})}let i=()=>{for(let[e,r]of(o&&g(t,o),a))p(e,r)};for(let e of(E(),m(t),r))f(e);try{let t=await G(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),i();return}s.play()}catch{n.toast.error("Failed to remove repository"),i()}finally{k()}},[s,m,f,g,p,y,E,k]),en=(0,t.useCallback)(e=>{let t=I(N.current,C.current,{...L,direction:e});c(t.nodes,t.edges)},[c]);return{nodes:d,edges:l,onNodesChange:D,handleConnect:F,handleAddRepository:(0,t.useCallback)(e=>{let t=0===b(),r=`repo-temp-${++Z}`,o=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e;return E(),g(r,{name:o,repositoryPath:e,id:r,createdAt:Date.now()}),B({path:e,name:o}).then(e=>{if(e.error){m(r),n.toast.error(e.error);return}let t=e.repository;v(r,`repo-${t.id}`,{name:t.name,repositoryPath:t.path,id:t.id,createdAt:t.createdAt instanceof Date?t.createdAt.getTime():Number(t.createdAt)}),i.play()}).catch(()=>{m(r),n.toast.error("Failed to add repository")}).finally(()=>k()),{wasEmpty:t,repoPath:e}},[g,m,v,i,b,E,k]),handleLayout:en,handleDeleteFeature:et,handleRetryFeature:ee,handleDeleteRepository:er,createFeatureNode:U,getFeatureRepositoryPath:x,getRepositoryData:y,setCallbacks:w}}e.s(["useControlCenterState",()=>ee],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),a=e.i(3214),s=e.i(38227),i=e.i(31777),d=e.i(35364);e.i(54793);var l=e.i(7729);e.i(47506);var c=e.i(89313),u=e.i(92002),h=e.i(3645);let f=(0,h.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 p=e.i(8986),g=e.i(38573),m=e.i(19933),v=e.i(67669),x=e.i(24042),y=e.i(64970);e.i(81803);var b=e.i(72714),w=e.i(2287),E=e.i(2828);e.i(99348);var k=e.i(17466),j=e.i(8537),N=e.i(75921),C=e.i(76852);function _({data:e}){let o=(0,N.useFeatureFlags)(),[s,l]=(0,n.useState)(!1),c=(0,C.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),h=(0,j.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),_="Booting"===h.status||"Ready"===h.status;return(0,t.jsxs)("div",{className:(0,i.cn)("group relative",e.onDelete&&e.id&&"pl-10"),children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:u.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-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),l(!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)(v.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(E.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.Dialog,{open:s,onOpenChange:l,children:(0,t.jsxs)(w.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(w.DialogHeader,{children:[(0,t.jsx)(w.DialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.DialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," and all its features from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(w.DialogClose,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(d.Button,{variant:"destructive",onClick:()=>{l(!1),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-pointer items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(f,{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,i.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)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in IDE",onClick:c.openInIde,loading:c.ideLoading,error:!!c.ideError,icon:p.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open in Shell",onClick:c.openInShell,loading:c.shellLoading,error:!!c.shellError,icon:g.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:"Open Folder",onClick:c.openFolder,loading:c.folderLoading,error:!!c.folderError,icon:m.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open Folder"})]})}),o.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(b.ActionButton,{label:_?"Stop Dev Server":"Start Dev Server",onClick:_?h.stop:h.deploy,loading:h.deployLoading||h.stopLoading,error:!!h.deployError,icon:_?y.Square:x.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:_?"Stop Dev Server":"Start Dev Server"})]})}),_?(0,t.jsx)(k.DeploymentStatusBadge,{status:h.status,url:h.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.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:(0,i.cn)("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",e.pulseAdd&&"animate-pulse-cta bg-blue-100 text-blue-500 dark:bg-blue-900/40"),children:(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(E.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:u.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}function O(e){let[n]=(0,u.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}e.i(1650),e.i(45811),e.i(25235);let R={x:30,y:30,zoom:.85};function M({onResetViewport:e}){let{setViewport:o}=(0,r.useReactFlow)(),a=(0,n.useCallback)(()=>{o(e(),{duration:400})},[e,o]);return(0,t.jsx)(r.ControlButton,{onClick:a,title:"Reset view","aria-label":"Reset view",children:(0,t.jsx)(s.RotateCcw,{style:{fill:"none"}})})}function S({nodes:e,edges:o,selectedFeatureId:s,defaultViewport:u,onNodesChange:h,onAddFeature:f,onConnect:p,onNodeClick:g,onPaneClick:m,onCanvasDrag:v,onMoveEnd:x,onResetViewport:y,toolbar:b,emptyState:w}){let E=(0,n.useMemo)(()=>({featureNode:c.FeatureNode,repositoryNode:_}),[]),k=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),j=(0,n.useMemo)(()=>null==s?e:e.map(e=>"featureNode"===e.type&&e.data.featureId===s?{...e,selected:!0}:e),[e,s]),N=0===e.length,[C,S]=(0,n.useState)(N),[P,T]=(0,n.useState)(!1),L=(0,n.useRef)(N);(0,n.useEffect)(()=>{if(L.current&&!N){T(!0);let e=setTimeout(()=>{S(!1),T(!1)},300);return L.current=N,()=>clearTimeout(e)}!L.current&&N&&S(!0),L.current=N},[N]);let A=N&&!w?(0,t.jsx)(l.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(d.Button,{onClick:f,children:[(0,t.jsx)(a.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})}):null,D=w??A;return(0,t.jsxs)("div",{"data-testid":N?"features-canvas-empty":"features-canvas","data-no-drawer-close":!0,className:"dark:bg-background pointer-events-auto relative h-full w-full bg-[#f6f7f8]",children:[(0,t.jsxs)(r.ReactFlow,{nodes:j,edges:o,nodeTypes:E,edgeTypes:k,onConnect:p,onNodesChange:h,onNodeClick:g,onPaneClick:m,onMoveStart:v,onMoveEnd:x,defaultViewport:u??R,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,t.jsx)(r.Background,{variant:r.BackgroundVariant.Dots,gap:24,size:1,color:"#b8bcc4",className:"dark:[&_circle]:!fill-white/[0.1]"}),!N&&(0,t.jsx)(r.Controls,{showInteractive:!1,children:y?(0,t.jsx)(M,{onResetViewport:y}):null}),b]}),C&&D?(0,t.jsx)("div",{className:(0,i.cn)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",P?"opacity-0":"animate-in fade-in opacity-100 duration-200"),children:(0,t.jsx)("div",{className:"pointer-events-auto",children:D})}):null]})}var P=e.i(5147),T=e.i(8361),L=e.i(30153);let A="shep-canvas-viewport",D={x:30,y:30,zoom:.85},I=(0,h.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var F=e.i(33548),$=e.i(23925),z=e.i(83428),B=e.i(35e3),G=e.i(79687),q=e.i(78521),W=e.i(21023);let V=(0,W.createServerReference)("00c4856c02050710dc73f9718a9b223b06f9ba2308",W.callServer,void 0,W.findSourceMapURL,"isAgentSetupComplete"),U=(0,W.createServerReference)("0059ee27842468c4a027f00b18316b42380adb4ef9",W.callServer,void 0,W.findSourceMapURL,"checkAgentAuth");var H=e.i(76016),X=e.i(11345),J=e.i(26370),K=e.i(47983),Y=e.i(99060),Q=e.i(86782),Z=e.i(29847);let ee=["select-agent","select-model"];function et({onComplete:e,className:r}){let o,[a,s]=(0,n.useState)([]),[d,l]=(0,n.useState)(!0),[c,u]=(0,n.useState)("select-agent"),[h,f]=(0,n.useState)(null),[p,g]=(0,n.useState)(!1),[m,v]=(0,n.useState)(!1),[x,y]=(0,n.useState)(!0),b=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{(0,K.getAllAgentModels)().then(s).finally(()=>l(!1))},[]);let w=h?a.find(e=>e.agentType===h):null,E=(0,n.useCallback)((e,t)=>{v(!0),y(!1),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{t?.(),u(e),requestAnimationFrame(()=>{y(!0),v(!1)})},150)},[]);(0,n.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let k=(0,n.useCallback)(async(t,r)=>{g(!0);try{await (0,Y.updateAgentAndModel)(t,r),e()}finally{g(!1)}},[e]),j=(0,n.useCallback)(e=>{let t=a.find(t=>t.agentType===e);t&&t.models.length>0?E("select-model",()=>{f(e)}):k(e,null)},[a,E,k]),N=(0,n.useCallback)(e=>{h&&k(h,e)},[h,k]),C=(0,n.useCallback)(()=>{"select-model"===c&&E("select-agent",()=>{f(null)})},[c,E]);if(d)return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,i.cn)("flex flex-col items-center justify-center gap-3",r),children:[(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Loading agents…"})]});let _=ee.indexOf(c);return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,i.cn)("flex flex-col items-center gap-4","w-72",r),children:[(0,t.jsx)("div",{className:"flex flex-col items-center gap-1",children:(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:["select-agent"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.Bot,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Choose your agent"})]}),"select-model"===c&&w?(o=(0,Q.getAgentTypeIcon)(w.agentType),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:[w.label," — Pick a model"]})]})):null]})}),(0,t.jsx)("div",{className:"flex w-full items-center gap-1",children:ee.map((e,r)=>(0,t.jsx)("div",{className:(0,i.cn)("h-0.5 flex-1 rounded-full transition-colors duration-300",r<=_?"bg-foreground/60":"bg-muted")},e))}),(0,t.jsxs)("div",{className:(0,i.cn)("flex w-full flex-col items-center transition-opacity duration-150",x&&!m?"opacity-100":"opacity-0"),children:["select-agent"===c&&(0,t.jsx)("div",{"data-testid":"agent-list",className:"flex w-full flex-col gap-1.5",children:a.map(e=>{let r=(0,Q.getAgentTypeIcon)(e.agentType);return(0,t.jsxs)("button",{type:"button",disabled:p,"data-testid":`agent-option-${e.agentType}`,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 transition-colors disabled:opacity-50",onClick:()=>j(e.agentType),children:[(0,t.jsx)(r,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left text-xs font-medium",children:e.label}),(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3"})]},e.agentType)})}),"select-model"===c&&w?(0,t.jsxs)("div",{"data-testid":"model-list",className:"flex w-full flex-col gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:p,className:"text-muted-foreground hover:text-foreground mb-0.5 flex cursor-pointer items-center gap-1 self-start text-[10px] font-medium transition-colors",onClick:C,children:[(0,t.jsx)(X.ChevronLeft,{className:"h-3 w-3"}),"Back"]}),(0,t.jsx)("div",{className:"flex max-h-48 w-full flex-col gap-1.5 overflow-y-auto",children:w.models.map(e=>{let r=(0,Z.getModelMeta)(e.id);return(0,t.jsxs)("button",{type:"button",disabled:p,"data-testid":`model-option-${e.id}`,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 text-left transition-colors disabled:opacity-50",onClick:()=>N(e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:r.displayName||e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] leading-tight",children:r.description||e.description})]}),(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"})]},e.id)})})]}):null]})]})}let er=["cd ~/my-repo",'shep feat new "sleek dashboard"'];function en({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[d,l]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[h,p]=(0,n.useState)(null);async function g(){if(!d){l(!0);try{let t=await (0,q.pickFolder)();t&&e?.(t)}finally{l(!1)}}}(0,n.useEffect)(()=>{V().then(e=>{u(e)})},[]),(0,n.useEffect)(()=>{c&&U().then(p)},[c]);let m=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText(er.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]),v=(0,n.useCallback)(()=>{u(!0)},[]),x=(0,n.useCallback)(()=>{p(null),U().then(p)},[]);return null===c?null:(0,t.jsx)("div",{"data-testid":"control-center-empty-state",className:(0,i.cn)("flex flex-col items-center justify-center",r),children:(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 w-96 rounded-2xl border border-white/30 bg-white/50 px-8 py-8 shadow-lg backdrop-blur-xl duration-300 dark:border-white/10 dark:bg-white/5",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsxs)("div",{className:"mb-2 text-center",children:[(0,t.jsx)("h1",{className:"text-xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-light",children:"Control Center"})]}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{status:h,onRetry:x}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:g,disabled:d,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 transition-colors disabled:cursor-wait disabled:opacity-50",children:[d?(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"}):(0,t.jsx)(a.Plus,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:d?"Opening…":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)("div",{className:"bg-border h-px w-10"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(I,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Or via CLI"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-10"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-md bg-zinc-900 px-3 py-2 font-mono text-[11px] text-zinc-300",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:m,className:"absolute top-2 right-2 cursor-pointer rounded p-1 text-zinc-500 transition-colors hover:bg-zinc-800 hover:text-zinc-300","aria-label":"Copy commands",children:o?(0,t.jsx)($.Check,{className:"h-3 w-3"}):(0,t.jsx)(F.Copy,{className:"h-3 w-3"})}),(0,t.jsx)("div",{className:"space-y-0.5",children:er.map(e=>(0,t.jsxs)("div",{className:"whitespace-nowrap",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-[10px]",children:"Feature will appear on canvas once created"})]}):(0,t.jsx)(et,{onComplete:v,className:"w-full"})]})})})}function eo({status:e,onRetry:r}){return e?e.installed&&e.authenticated?(0,t.jsxs)("div",{className:"animate-in fade-in flex w-full items-center gap-2 rounded-md bg-emerald-500/10 px-3 py-1.5",children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3 w-3 text-emerald-600 dark:text-emerald-400"}),(0,t.jsxs)("span",{className:"text-[10px] text-emerald-700 dark:text-emerald-300",children:[e.label," ready"]})]}):e.installed?(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-md bg-amber-500/10 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(G.AlertCircle,{className:"h-3 w-3 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("span",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:[e.label," needs authentication"]})]}),e.authCommand?(0,t.jsxs)("div",{className:"rounded bg-zinc-900 px-2 py-1 font-mono text-[10px] text-zinc-300",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),e.authCommand]}):null,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.binaryName?(0,t.jsxs)("button",{type:"button","data-testid":"auth-banner-open-terminal",onClick:async()=>{try{let t="claude-code"===e.agentType?"claude-code":e.agentType;await fetch(`/api/tools/${t}/launch`,{method:"POST"})}catch{}},className:"flex items-center gap-1 rounded border border-amber-600/30 px-2 py-0.5 text-[10px] font-medium text-amber-700 transition-colors hover:bg-amber-500/10 dark:text-amber-300",children:[(0,t.jsx)(g.Terminal,{className:"h-2.5 w-2.5"}),"Open ",e.label]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[10px] font-medium text-amber-700 underline underline-offset-2 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",children:"Re-check"})]})]}):(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-md bg-amber-500/10 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(G.AlertCircle,{className:"h-3 w-3 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("span",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:[e.label," not installed"]})]}),e.binaryName?(0,t.jsxs)("div",{className:"rounded bg-zinc-900 px-2 py-1 font-mono text-[10px] text-zinc-300",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),"npm install -g ",e.binaryName]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"self-start text-[10px] font-medium text-amber-700 underline underline-offset-2 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",children:"Re-check"})]}):(0,t.jsxs)("div",{className:"bg-muted/50 flex w-full items-center gap-2 rounded-md px-3 py-1.5",children:[(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-3 w-3 animate-spin"}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:"Checking agent setup…"})]})}var ea=e.i(17840);let es={maxZoom:1,padding:.5,duration:500};function ei({initialNodes:e,initialEdges:a}){let s,i,d,l=(0,o.useRouter)(),c=(0,o.usePathname)(),u=(s=(0,o.usePathname)().match(/^\/feature\/([^/]+)/),s?.[1]??null),h=(0,T.useSoundAction)("click"),{guardedNavigate:f}=(0,L.useDrawerCloseGuard)(),{fitView:p}=(0,r.useReactFlow)(),g=(0,n.useRef)(null),{defaultViewport:m,onMoveEnd:v,resetViewport:x}=(i=(0,n.useRef)(function(){try{let e=localStorage.getItem(A);if(null==e)return D;let t=JSON.parse(e);return!(null==t||"object"!=typeof t||Array.isArray(t))&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.zoom&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?t:D}catch{return D}}()).current,d=(0,n.useRef)(null),(0,n.useEffect)(()=>()=>{null!=d.current&&clearTimeout(d.current)},[]),{defaultViewport:i,onMoveEnd:(0,n.useCallback)(e=>{null!=d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{try{localStorage.setItem(A,JSON.stringify(e))}catch{}},500)},[]),resetViewport:(0,n.useCallback)(()=>{try{localStorage.removeItem(A)}catch{}return D},[])}),{nodes:y,edges:b,onNodesChange:w,handleConnect:E,handleAddRepository:k,handleDeleteFeature:j,handleRetryFeature:N,handleDeleteRepository:C,createFeatureNode:_,setCallbacks:O}=(0,ea.useControlCenterState)(e,a),{setFeatures:R}=(0,P.useSidebarFeaturesContext)(),M=(0,n.useMemo)(()=>y.filter(e=>"featureNode"===e.type),[y]),I=(0,n.useMemo)(()=>M.map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.name}`}).sort().join(","),[M]);(0,n.useEffect)(()=>{R(M.map(e=>{let t=e.data,r=(0,P.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},...t.agentType&&{agentType:t.agentType},...t.modelId&&{modelId:t.modelId}}:null}).filter(Boolean))},[I,M,R]);let F=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let r=t.data;"creating"!==r.state&&"deleting"!==r.state&&e.target.closest('[data-testid="feature-node-card"]')&&f(()=>{h.play(),l.push(`/feature/${r.featureId}`)})}},[l,h,f]),$=(0,n.useCallback)(()=>{h.play(),l.push("/create")},[l,h]),z=(0,n.useCallback)(e=>{h.play();let t=y.find(t=>t.id===e),r=t?.data?.repositoryPath;r?l.push(`/create?repo=${encodeURIComponent(r)}`):l.push("/create")},[y,l,h]),B=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=b.find(t=>t.target===e),n=r?y.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;h.play();let a=new URLSearchParams;o&&a.set("repo",o),a.set("parent",t),l.push(`/create?${a.toString()}`)},[y,b,l,h]),G=(0,n.useCallback)(e=>{let t=y.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&f(()=>l.push(`/repository/${e.id}`))}},[y,l,f]),q=(0,n.useCallback)(()=>{"/"!==c&&f(()=>l.push("/"))},[l,c,f]);(0,n.useEffect)(()=>{let e=e=>{let{wasEmpty:t,repoPath:r}=k(e.detail.path);t&&setTimeout(()=>{p(es),g.current=setTimeout(()=>{f(()=>l.push(`/create?repo=${encodeURIComponent(r)}`))},600)},0)};return window.addEventListener("shep:add-repository",e),()=>{window.removeEventListener("shep:add-repository",e),null!=g.current&&clearTimeout(g.current)}},[k,p,f,l]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail;if(t.parentId)return void _(`feat-${t.parentId}`,{state:"creating",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath},"dependencyEdge");let r=y.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);_(r?.id??null,{state:"running",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[y,_]),(0,n.useEffect)(()=>{let e=e=>{let{featureId:t,cleanup:r}=e.detail;j(t,r)};return window.addEventListener("shep:feature-delete-requested",e),()=>window.removeEventListener("shep:feature-delete-requested",e)},[j]),(0,n.useEffect)(()=>{O({onNodeAction:B,onFeatureDelete:j,onRetryFeature:N,onRepositoryAdd:z,onRepositoryClick:G,onRepositoryDelete:C})},[O,B,j,N,z,G,C]);let W=(0,n.useCallback)((e,t)=>{v(t)},[v]),V=y.some(e=>"repositoryNode"===e.type),[U,H]=(0,n.useState)(V),X=(0,n.useRef)(null);(0,n.useEffect)(()=>(V?(X.current&&(clearTimeout(X.current),X.current=null),H(!0)):U&&(X.current=setTimeout(()=>{H(!1),X.current=null},500)),()=>{X.current&&clearTimeout(X.current)}),[V,U]);let J=c.startsWith("/create"),K=(0,n.useMemo)(()=>{let e=y.filter(e=>"repositoryNode"===e.type),t=y.some(e=>"featureNode"===e.type);return 1!==e.length||t||J?y:y.map(e=>"repositoryNode"===e.type?{...e,data:{...e.data,pulseAdd:!0}}:e)},[y,J]);return(0,t.jsx)(S,{nodes:U?K:[],edges:U?b:[],selectedFeatureId:u,defaultViewport:m,onNodesChange:w,onConnect:E,onAddFeature:$,onNodeClick:F,onPaneClick:q,onMoveEnd:W,onResetViewport:x,emptyState:(0,t.jsx)(en,{onRepositorySelect:k})})}function ed({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)(ei,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>ed],48246)}]);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,35340,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(87620),n=e.i(85995),l=e.i(22528),a=e.i(5978),i=e.i(29297),s=e.i(66033),c=e.i(5192),u=e.i(27069),d=e.i(91967),f="ScrollArea",[p,v]=(0,l.createContextScope)(f),[g,m]=p(f),h=r.forwardRef((e,n)=>{let{__scopeScrollArea:l,type:i="hover",dir:c,scrollHideDelay:u=600,...d}=e,[f,p]=r.useState(null),[v,m]=r.useState(null),[h,w]=r.useState(null),[b,x]=r.useState(null),[y,C]=r.useState(null),[D,S]=r.useState(0),[R,j]=r.useState(0),[E,P]=r.useState(!1),[A,T]=r.useState(!1),k=(0,a.useComposedRefs)(n,e=>p(e)),_=(0,s.useDirection)(c);return(0,t.jsx)(g,{scope:l,type:i,dir:_,scrollHideDelay:u,scrollArea:f,viewport:v,onViewportChange:m,content:h,onContentChange:w,scrollbarX:b,onScrollbarXChange:x,scrollbarXEnabled:E,onScrollbarXEnabledChange:P,scrollbarY:y,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:T,onCornerWidthChange:S,onCornerHeightChange:j,children:(0,t.jsx)(o.Primitive.div,{dir:_,...d,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":D+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});h.displayName=f;var w="ScrollAreaViewport",b=r.forwardRef((e,n)=>{let{__scopeScrollArea:l,children:i,nonce:s,...c}=e,u=m(w,l),d=r.useRef(null),f=(0,a.useComposedRefs)(n,d,u.onViewportChange);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),(0,t.jsx)(o.Primitive.div,{"data-radix-scroll-area-viewport":"",...c,ref:f,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,t.jsx)("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});b.displayName=w;var x="ScrollAreaScrollbar",y=r.forwardRef((e,o)=>{let{forceMount:n,...l}=e,a=m(x,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=a,c="horizontal"===e.orientation;return r.useEffect(()=>(c?i(!0):s(!0),()=>{c?i(!1):s(!1)}),[c,i,s]),"hover"===a.type?(0,t.jsx)(C,{...l,ref:o,forceMount:n}):"scroll"===a.type?(0,t.jsx)(D,{...l,ref:o,forceMount:n}):"auto"===a.type?(0,t.jsx)(S,{...l,ref:o,forceMount:n}):"always"===a.type?(0,t.jsx)(R,{...l,ref:o}):null});y.displayName=x;var C=r.forwardRef((e,o)=>{let{forceMount:l,...a}=e,i=m(x,e.__scopeScrollArea),[s,c]=r.useState(!1);return r.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let r=()=>{window.clearTimeout(t),c(!0)},o=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",o),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",o)}}},[i.scrollArea,i.scrollHideDelay]),(0,t.jsx)(n.Presence,{present:l||s,children:(0,t.jsx)(S,{"data-state":s?"visible":"hidden",...a,ref:o})})}),D=r.forwardRef((e,o)=>{var l;let{forceMount:a,...i}=e,s=m(x,e.__scopeScrollArea),c="horizontal"===e.orientation,u=B(()=>p("SCROLL_END"),100),[f,p]=(l={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>l[e][t]??e,"hidden"));return r.useEffect(()=>{if("idle"===f){let e=window.setTimeout(()=>p("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[f,s.scrollHideDelay,p]),r.useEffect(()=>{let e=s.viewport,t=c?"scrollLeft":"scrollTop";if(e){let r=e[t],o=()=>{let o=e[t];r!==o&&(p("SCROLL"),u()),r=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}},[s.viewport,c,p,u]),(0,t.jsx)(n.Presence,{present:a||"hidden"!==f,children:(0,t.jsx)(R,{"data-state":"hidden"===f?"hidden":"visible",...i,ref:o,onPointerEnter:(0,d.composeEventHandlers)(e.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:(0,d.composeEventHandlers)(e.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),S=r.forwardRef((e,o)=>{let l=m(x,e.__scopeScrollArea),{forceMount:a,...i}=e,[s,c]=r.useState(!1),u="horizontal"===e.orientation,d=B(()=>{if(l.viewport){let e=l.viewport.offsetWidth<l.viewport.scrollWidth,t=l.viewport.offsetHeight<l.viewport.scrollHeight;c(u?e:t)}},10);return X(l.viewport,d),X(l.content,d),(0,t.jsx)(n.Presence,{present:a||s,children:(0,t.jsx)(R,{"data-state":s?"visible":"hidden",...i,ref:o})})}),R=r.forwardRef((e,o)=>{let{orientation:n="vertical",...l}=e,a=m(x,e.__scopeScrollArea),i=r.useRef(null),s=r.useRef(0),[c,u]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=H(c.viewport,c.content),f={...l,sizes:c,onSizesChange:u,hasThumb:!!(d>0&&d<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:e=>s.current=e};function p(e,t){return function(e,t,r,o="ltr"){let n=F(r),l=t||n/2,a=r.scrollbar.paddingStart+l,i=r.scrollbar.size-r.scrollbar.paddingEnd-(n-l),s=r.content-r.viewport;return W([a,i],"ltr"===o?[0,s]:[-1*s,0])(e)}(e,s.current,c,t)}return"horizontal"===n?(0,t.jsx)(j,{...f,ref:o,onThumbPositionChange:()=>{if(a.viewport&&i.current){let e=M(a.viewport.scrollLeft,c,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=p(e,a.dir))}}):"vertical"===n?(0,t.jsx)(E,{...f,ref:o,onThumbPositionChange:()=>{if(a.viewport&&i.current){let e=M(a.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=p(e))}}):null}),j=r.forwardRef((e,o)=>{let{sizes:n,onSizesChange:l,...i}=e,s=m(x,e.__scopeScrollArea),[c,u]=r.useState(),d=r.useRef(null),f=(0,a.useComposedRefs)(o,d,s.onScrollbarXChange);return r.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),(0,t.jsx)(T,{"data-orientation":"horizontal",...i,ref:f,sizes:n,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":F(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(s.viewport){var o,n;let l=s.viewport.scrollLeft+t.deltaX;e.onWheelScroll(l),o=l,n=r,o>0&&o<n&&t.preventDefault()}},onResize:()=>{d.current&&s.viewport&&c&&l({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:z(c.paddingLeft),paddingEnd:z(c.paddingRight)}})}})}),E=r.forwardRef((e,o)=>{let{sizes:n,onSizesChange:l,...i}=e,s=m(x,e.__scopeScrollArea),[c,u]=r.useState(),d=r.useRef(null),f=(0,a.useComposedRefs)(o,d,s.onScrollbarYChange);return r.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),(0,t.jsx)(T,{"data-orientation":"vertical",...i,ref:f,sizes:n,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":F(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(s.viewport){var o,n;let l=s.viewport.scrollTop+t.deltaY;e.onWheelScroll(l),o=l,n=r,o>0&&o<n&&t.preventDefault()}},onResize:()=>{d.current&&s.viewport&&c&&l({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:z(c.paddingTop),paddingEnd:z(c.paddingBottom)}})}})}),[P,A]=p(x),T=r.forwardRef((e,n)=>{let{__scopeScrollArea:l,sizes:s,hasThumb:c,onThumbChange:u,onThumbPointerUp:f,onThumbPointerDown:p,onThumbPositionChange:v,onDragScroll:g,onWheelScroll:h,onResize:w,...b}=e,y=m(x,l),[C,D]=r.useState(null),S=(0,a.useComposedRefs)(n,e=>D(e)),R=r.useRef(null),j=r.useRef(""),E=y.viewport,A=s.content-s.viewport,T=(0,i.useCallbackRef)(h),k=(0,i.useCallbackRef)(v),_=B(w,10);function N(e){R.current&&g({x:e.clientX-R.current.left,y:e.clientY-R.current.top})}return r.useEffect(()=>{let e=e=>{let t=e.target;C?.contains(t)&&T(e,A)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[E,C,A,T]),r.useEffect(k,[s,k]),X(C,_),X(y.content,_),(0,t.jsx)(P,{scope:l,scrollbar:C,hasThumb:c,onThumbChange:(0,i.useCallbackRef)(u),onThumbPointerUp:(0,i.useCallbackRef)(f),onThumbPositionChange:k,onThumbPointerDown:(0,i.useCallbackRef)(p),children:(0,t.jsx)(o.Primitive.div,{...b,ref:S,style:{position:"absolute",...b.style},onPointerDown:(0,d.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),R.current=C.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),N(e))}),onPointerMove:(0,d.composeEventHandlers)(e.onPointerMove,N),onPointerUp:(0,d.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=j.current,y.viewport&&(y.viewport.style.scrollBehavior=""),R.current=null})})})}),k="ScrollAreaThumb",_=r.forwardRef((e,r)=>{let{forceMount:o,...l}=e,a=A(k,e.__scopeScrollArea);return(0,t.jsx)(n.Presence,{present:o||a.hasThumb,children:(0,t.jsx)(N,{ref:r,...l})})}),N=r.forwardRef((e,n)=>{let{__scopeScrollArea:l,style:i,...s}=e,c=m(k,l),u=A(k,l),{onThumbPositionChange:f}=u,p=(0,a.useComposedRefs)(n,e=>u.onThumbChange(e)),v=r.useRef(void 0),g=B(()=>{v.current&&(v.current(),v.current=void 0)},100);return r.useEffect(()=>{let e=c.viewport;if(e){let t=()=>{g(),v.current||(v.current=U(e,f),f())};return f(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[c.viewport,g,f]),(0,t.jsx)(o.Primitive.div,{"data-state":u.hasThumb?"visible":"hidden",...s,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:(0,d.composeEventHandlers)(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,o=e.clientY-t.top;u.onThumbPointerDown({x:r,y:o})}),onPointerUp:(0,d.composeEventHandlers)(e.onPointerUp,u.onThumbPointerUp)})});_.displayName=k;var L="ScrollAreaCorner",O=r.forwardRef((e,r)=>{let o=m(L,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return"scroll"!==o.type&&n?(0,t.jsx)(I,{...e,ref:r}):null});O.displayName=L;var I=r.forwardRef((e,n)=>{let{__scopeScrollArea:l,...a}=e,i=m(L,l),[s,c]=r.useState(0),[u,d]=r.useState(0),f=!!(s&&u);return X(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),X(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),f?(0,t.jsx)(o.Primitive.div,{...a,ref:n,style:{width:s,height:u,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null});function z(e){return e?parseInt(e,10):0}function H(e,t){let r=e/t;return isNaN(r)?0:r}function F(e){let t=H(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function M(e,t,r="ltr"){let o=F(t),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-n,a=t.content-t.viewport,i=(0,u.clamp)(e,"ltr"===r?[0,a]:[-1*a,0]);return W([0,a],[0,l-o])(i)}function W(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}var U=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},o=0;return!function n(){let l={left:e.scrollLeft,top:e.scrollTop},a=r.left!==l.left,i=r.top!==l.top;(a||i)&&t(),r=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function B(e,t){let o=(0,i.useCallbackRef)(e),n=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(n.current),[]),r.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)},[o,t])}function X(e,t){let r=(0,i.useCallbackRef)(t);(0,c.useLayoutEffect)(()=>{let t=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(t),o.unobserve(e)}}},[e,r])}e.s(["Corner",()=>O,"Root",()=>h,"ScrollArea",()=>h,"ScrollAreaCorner",()=>O,"ScrollAreaScrollbar",()=>y,"ScrollAreaThumb",()=>_,"ScrollAreaViewport",()=>b,"Scrollbar",()=>y,"Thumb",()=>_,"Viewport",()=>b,"createScrollAreaScope",()=>v],87516);var Y=e.i(87516),Y=Y,$=e.i(31777);function V({className:e,children:r,...o}){return(0,t.jsxs)(Y.Root,{"data-slot":"scroll-area",className:(0,$.cn)("relative",e),...o,children:[(0,t.jsx)(Y.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:block!",children:r}),(0,t.jsx)(G,{}),(0,t.jsx)(Y.Corner,{})]})}function G({className:e,orientation:r="vertical",...o}){return(0,t.jsx)(Y.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:r,className:(0,$.cn)("flex touch-none p-px transition-colors select-none","vertical"===r&&"h-full w-2.5 border-l border-l-transparent","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent",e),...o,children:(0,t.jsx)(Y.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}e.s(["ScrollArea",()=>V],35340)},80764,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let o=e.r(79054);function n(e,t){let r=(0,o.useRef)(null),n=(0,o.useRef)(null);return(0,o.useCallback)(o=>{if(null===o){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=l(e,o)),t&&(n.current=l(t,o))},[e,t])}function l(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)},66033,e=>{"use strict";var t=e.i(79054);e.i(20314);var r=t.createContext(void 0);function o(e){let o=t.useContext(r);return e||o||"ltr"}e.s(["useDirection",()=>o])},27069,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},10942,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],10942);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let o=(0,e.i(18354).createLogger)("[SSE]");function n(e,t,r,o){if("u"<typeof EventSource)return()=>{};let n=null,l=!1,a=1e3,i=null,s=null;return!function c(){l||(n=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),o("connecting"),n.onopen=()=>{o("connected"),s=setTimeout(()=>{s=null,a=1e3},5e3)},n.onerror=()=>{n?.close(),n=null,o("disconnected"),null!==s&&(clearTimeout(s),s=null);let e=a;a=Math.min(2*e,3e4),i=setTimeout(()=>{i=null,c()},e)},n.addEventListener("notification",e=>{let o=JSON.parse(e.data);t(e=>{let t=[...e,o];return t.length>500?t.slice(-250):t}),r(o)}))}(),()=>{l=!0,null!==i&&(clearTimeout(i),i=null),null!==s&&(clearTimeout(s),s=null),n&&(n.close(),n=null)}}let l=(0,r.createContext)(null);function a({children:e,runId:a}){let{events:i,lastEvent:s,connectionStatus:c}=function(e){let[t,l]=(0,r.useState)([]),[a,i]=(0,r.useState)(null),[s,c]=(0,r.useState)("disconnected"),u=e?.runId,d=(0,r.useRef)(null),f=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;o.debug("event received:",e.eventType,e),l(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),i(e)}else"status"===t.type&&c(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return n(u,l,i,c);let t=!1,r={current:void 0};function o(e){t||(d.current=e,e.postMessage({type:"subscribe",runId:u}),c("connecting"))}function a(){if(t)return;let e=navigator.serviceWorker.controller;e&&(d.current=e,e.postMessage({type:"subscribe",runId:u}),c("connecting"))}return navigator.serviceWorker.addEventListener("message",f),navigator.serviceWorker.addEventListener("controllerchange",a),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let a=e.active??e.installing??e.waiting;if(!a){r.current=n(u,l,i,c);return}if("activated"===a.state)o(a);else{let e=()=>{"activated"===a.state&&(a.removeEventListener("statechange",e),o(a))};a.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=n(u,l,i,c))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",f),navigator.serviceWorker.removeEventListener("controllerchange",a),d.current?.postMessage({type:"unsubscribe"}),d.current=null,r.current?.()}},[u,f]),{events:t,lastEvent:a,connectionStatus:s}}({runId:a}),u=(0,r.useMemo)(()=>({events:i,lastEvent:s,connectionStatus:c}),[i,s,c]);return(0,t.jsx)(l.Provider,{value:u,children:e})}function i(){let e=(0,r.useContext)(l);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>a,"useAgentEventsContext",()=>i],39443)},25235,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(87620),n="horizontal",l=["horizontal","vertical"],a=r.forwardRef((e,r)=>{var a;let{decorative:i,orientation:s=n,...c}=e,u=(a=s,l.includes(a))?s:n;return(0,t.jsx)(o.Primitive.div,{"data-orientation":u,...i?{role:"none"}:{"aria-orientation":"vertical"===u?u:void 0,role:"separator"},...c,ref:r})});a.displayName="Separator",e.s(["Root",()=>a,"Separator",()=>a],47402);var i=e.i(47402),i=i,s=e.i(31777);function c({className:e,orientation:r="horizontal",decorative:o=!0,...n}){return(0,t.jsx)(i.Root,{"data-slot":"separator",decorative:o,orientation:r,className:(0,s.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}e.s(["Separator",()=>c],25235)},48249,90537,e=>{"use strict";let t=(0,e.i(3645).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t],90537),e.s(["XIcon",()=>t],48249)},567,e=>{"use strict";var t=e.i(79054),r=e.i(91967),o=e.i(5978),n=e.i(22528),l=e.i(13123),a=e.i(36589),i=e.i(53532),s=e.i(56720),c=e.i(39979),u=e.i(85995),d=e.i(87620),f=e.i(41687),p=e.i(13044),v=e.i(73772),g=e.i(86874),m=e.i(20314),h="Dialog",[w,b]=(0,n.createContextScope)(h),[x,y]=w(h),C=e=>{let{__scopeDialog:r,children:o,open:n,defaultOpen:i,onOpenChange:s,modal:c=!0}=e,u=t.useRef(null),d=t.useRef(null),[f,p]=(0,a.useControllableState)({prop:n,defaultProp:i??!1,onChange:s,caller:h});return(0,m.jsx)(x,{scope:r,triggerRef:u,contentRef:d,contentId:(0,l.useId)(),titleId:(0,l.useId)(),descriptionId:(0,l.useId)(),open:f,onOpenChange:p,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),modal:c,children:o})};C.displayName=h;var D="DialogTrigger",S=t.forwardRef((e,t)=>{let{__scopeDialog:n,...l}=e,a=y(D,n),i=(0,o.useComposedRefs)(t,a.triggerRef);return(0,m.jsx)(d.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":X(a.open),...l,ref:i,onClick:(0,r.composeEventHandlers)(e.onClick,a.onOpenToggle)})});S.displayName=D;var R="DialogPortal",[j,E]=w(R,{forceMount:void 0}),P=e=>{let{__scopeDialog:r,forceMount:o,children:n,container:l}=e,a=y(R,r);return(0,m.jsx)(j,{scope:r,forceMount:o,children:t.Children.map(n,e=>(0,m.jsx)(u.Presence,{present:o||a.open,children:(0,m.jsx)(c.Portal,{asChild:!0,container:l,children:e})}))})};P.displayName=R;var A="DialogOverlay",T=t.forwardRef((e,t)=>{let r=E(A,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,l=y(A,e.__scopeDialog);return l.modal?(0,m.jsx)(u.Presence,{present:o||l.open,children:(0,m.jsx)(_,{...n,ref:t})}):null});T.displayName=A;var k=(0,g.createSlot)("DialogOverlay.RemoveScroll"),_=t.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=y(A,r);return(0,m.jsx)(p.RemoveScroll,{as:k,allowPinchZoom:!0,shards:[n.contentRef],children:(0,m.jsx)(d.Primitive.div,{"data-state":X(n.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),N="DialogContent",L=t.forwardRef((e,t)=>{let r=E(N,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,l=y(N,e.__scopeDialog);return(0,m.jsx)(u.Presence,{present:o||l.open,children:l.modal?(0,m.jsx)(O,{...n,ref:t}):(0,m.jsx)(I,{...n,ref:t})})});L.displayName=N;var O=t.forwardRef((e,n)=>{let l=y(N,e.__scopeDialog),a=t.useRef(null),i=(0,o.useComposedRefs)(n,l.contentRef,a);return t.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,m.jsx)(z,{...e,ref:i,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),l.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),I=t.forwardRef((e,r)=>{let o=y(N,e.__scopeDialog),n=t.useRef(!1),l=t.useRef(!1);return(0,m.jsx)(z,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||o.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,l.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(l.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&l.current&&t.preventDefault()}})}),z=t.forwardRef((e,r)=>{let{__scopeDialog:n,trapFocus:l,onOpenAutoFocus:a,onCloseAutoFocus:c,...u}=e,d=y(N,n),p=t.useRef(null),v=(0,o.useComposedRefs)(r,p);return(0,f.useFocusGuards)(),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s.FocusScope,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:a,onUnmountAutoFocus:c,children:(0,m.jsx)(i.DismissableLayer,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":X(d.open),...u,ref:v,onDismiss:()=>d.onOpenChange(!1)})}),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(G,{titleId:d.titleId}),(0,m.jsx)(q,{contentRef:p,descriptionId:d.descriptionId})]})]})}),H="DialogTitle",F=t.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=y(H,r);return(0,m.jsx)(d.Primitive.h2,{id:n.titleId,...o,ref:t})});F.displayName=H;var M="DialogDescription",W=t.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=y(M,r);return(0,m.jsx)(d.Primitive.p,{id:n.descriptionId,...o,ref:t})});W.displayName=M;var U="DialogClose",B=t.forwardRef((e,t)=>{let{__scopeDialog:o,...n}=e,l=y(U,o);return(0,m.jsx)(d.Primitive.button,{type:"button",...n,ref:t,onClick:(0,r.composeEventHandlers)(e.onClick,()=>l.onOpenChange(!1))})});function X(e){return e?"open":"closed"}B.displayName=U;var Y="DialogTitleWarning",[$,V]=(0,n.createContext)(Y,{contentName:N,titleName:H,docsSlug:"dialog"}),G=({titleId:e})=>{let r=V(Y),o=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return t.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},q=({contentRef:e,descriptionId:r})=>{let o=V("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${o.contentName}}.`;return t.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");r&&t&&(document.getElementById(r)||console.warn(n))},[n,e,r]),null};e.s(["Close",()=>B,"Content",()=>L,"Description",()=>W,"Dialog",()=>C,"DialogClose",()=>B,"DialogContent",()=>L,"DialogDescription",()=>W,"DialogOverlay",()=>T,"DialogPortal",()=>P,"DialogTitle",()=>F,"DialogTrigger",()=>S,"Overlay",()=>T,"Portal",()=>P,"Root",()=>C,"Title",()=>F,"Trigger",()=>S,"WarningProvider",()=>$,"createDialogScope",()=>b])},90033,e=>{"use strict";var t=e.i(567);e.s(["Dialog",0,t])},51251,14748,e=>{"use strict";let t=(0,e.i(3645).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t],14748),e.s(["CircleAlert",()=>t],51251)},83428,15506,e=>{"use strict";let t=(0,e.i(3645).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",()=>t],15506),e.s(["Loader2",()=>t],83428)},8361,73709,18354,e=>{"use strict";var t=e.i(44172),r=e.i(79054);let o="shep-sound-enabled",n="shep:sound-toggle";function l(){let[e,t]=(0,r.useState)(!0);(0,r.useEffect)(()=>{"false"===localStorage.getItem(o)&&t(!1);let e=e=>{t(e.detail)};return window.addEventListener(n,e),()=>window.removeEventListener(n,e)},[]);let l=(0,r.useCallback)(()=>{let r=!e;localStorage.setItem(o,String(r)),t(r),window.dispatchEvent(new CustomEvent(n,{detail:r}))},[e]);return{enabled:e,toggle:l}}e.s(["useSoundEnabled",()=>l],73709);let a=new Map,i={navigate:{sound:"tap_01",volume:.2},"menu-item":{sound:"tap_01",volume:.2},select:{sound:"select",volume:.3},"toggle-on":{sound:"toggle_on",volume:.3},"toggle-off":{sound:"toggle_off",volume:.3},click:{sound:"tap_01",volume:.3},cancel:{sound:"transition_down",volume:.3},expand:{sound:"swipe",volume:.3},collapse:{sound:"swipe",volume:.3},"menu-open":{sound:"select",volume:.3},copy:{sound:"select",volume:.3},"drawer-open":{sound:"transition_up",volume:.4},"drawer-close":{sound:"transition_down",volume:.4},submit:{sound:"button",volume:.4},approve:{sound:"celebration",volume:.5},reject:{sound:"caution",volume:.5},create:{sound:"transition_up",volume:.5},delete:{sound:"transition_down",volume:.5},"notification-success":{sound:"celebration",volume:.5},"notification-error":{sound:"caution",volume:.5},"notification-warning":{sound:"notification",volume:.5},"notification-info":{sound:"button",volume:.5}};function s(e){let{sound:t,volume:o}=i[e];return function(e,t={}){let{volume:o=1,loop:n=!1}=t,{enabled:i}=l(),s=(0,r.useRef)(null),c=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let t,r=((t=a.get(e))||((t=new Audio(`/sounds/${e}.wav`)).preload="auto",a.set(e,t)),t);return r.loop=n,r.volume=Math.max(0,Math.min(1,o)),r.addEventListener("ended",()=>{c.current=!1}),s.current=r,()=>{r.pause(),s.current=null,c.current=!1}},[e,n,o]),{play:(0,r.useCallback)(()=>{if(!i)return;let e=s.current;e&&(e.currentTime=0,e.play()?.catch(e=>{}),c.current=!0)},[i,e]),stop:(0,r.useCallback)(()=>{let e=s.current;e&&(e.pause(),e.currentTime=0,c.current=!1)},[]),isPlaying:c.current}}(t,{volume:o})}e.s(["useSoundAction",()=>s],8361);let c=!!t.default.env.NEXT_PUBLIC_DEBUG,u=()=>void 0;function d(e){return{info:c?(...t)=>console.info(e,...t):u,debug:c?(...t)=>console.debug(e,...t):u,warn:(...t)=>console.warn(e,...t),error:(...t)=>console.error(e,...t)}}e.s(["createLogger",()=>d],18354)},75921,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let o=(0,r.createContext)({skills:!1,envDeploy:!0,debug:!1});function n({children:e,flags:r}){return(0,t.jsx)(o.Provider,{value:r,children:e})}function l(){return(0,r.useContext)(o)}e.s(["FeatureFlagsProvider",()=>n,"useFeatureFlags",()=>l])},31406,(e,t,r)=>{t.exports=e.r(67013)},30153,71326,e=>{"use strict";var t=e.i(20314),r=e.i(79054),o=e.i(22528),n=e.i(5978),l=e.i(567),a=e.i(91967),i=e.i(86874),s="AlertDialog",[c,u]=(0,o.createContextScope)(s,[l.createDialogScope]),d=(0,l.createDialogScope)(),f=e=>{let{__scopeAlertDialog:r,...o}=e,n=d(r);return(0,t.jsx)(l.Root,{...n,...o,modal:!0})};f.displayName=s;var p=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,a=d(o);return(0,t.jsx)(l.Trigger,{...a,...n,ref:r})});p.displayName="AlertDialogTrigger";var v=e=>{let{__scopeAlertDialog:r,...o}=e,n=d(r);return(0,t.jsx)(l.Portal,{...n,...o})};v.displayName="AlertDialogPortal";var g=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,a=d(o);return(0,t.jsx)(l.Overlay,{...a,...n,ref:r})});g.displayName="AlertDialogOverlay";var m="AlertDialogContent",[h,w]=c(m),b=(0,i.createSlottable)("AlertDialogContent"),x=r.forwardRef((e,o)=>{let{__scopeAlertDialog:i,children:s,...c}=e,u=d(i),f=r.useRef(null),p=(0,n.useComposedRefs)(o,f),v=r.useRef(null);return(0,t.jsx)(l.WarningProvider,{contentName:m,titleName:y,docsSlug:"alert-dialog",children:(0,t.jsx)(h,{scope:i,cancelRef:v,children:(0,t.jsxs)(l.Content,{role:"alertdialog",...u,...c,ref:p,onOpenAutoFocus:(0,a.composeEventHandlers)(c.onOpenAutoFocus,e=>{e.preventDefault(),v.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(b,{children:s}),(0,t.jsx)(P,{contentRef:f})]})})})});x.displayName=m;var y="AlertDialogTitle",C=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,a=d(o);return(0,t.jsx)(l.Title,{...a,...n,ref:r})});C.displayName=y;var D="AlertDialogDescription",S=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,a=d(o);return(0,t.jsx)(l.Description,{...a,...n,ref:r})});S.displayName=D;var R=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...n}=e,a=d(o);return(0,t.jsx)(l.Close,{...a,...n,ref:r})});R.displayName="AlertDialogAction";var j="AlertDialogCancel",E=r.forwardRef((e,r)=>{let{__scopeAlertDialog:o,...a}=e,{cancelRef:i}=w(j,o),s=d(o),c=(0,n.useComposedRefs)(r,i);return(0,t.jsx)(l.Close,{...s,...a,ref:c})});E.displayName=j;var P=({contentRef:e})=>{let t=`\`${m}\` requires a description for the component to be accessible for screen reader users.
|
|
6
|
+
|
|
7
|
+
You can add a description to the \`${m}\` by passing a \`${D}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
8
|
+
|
|
9
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${m}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
10
|
+
|
|
11
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return r.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null};e.s(["Action",()=>R,"AlertDialog",()=>f,"AlertDialogAction",()=>R,"AlertDialogCancel",()=>E,"AlertDialogContent",()=>x,"AlertDialogDescription",()=>S,"AlertDialogOverlay",()=>g,"AlertDialogPortal",()=>v,"AlertDialogTitle",()=>C,"AlertDialogTrigger",()=>p,"Cancel",()=>E,"Content",()=>x,"Description",()=>S,"Overlay",()=>g,"Portal",()=>v,"Root",()=>f,"Title",()=>C,"Trigger",()=>p,"createAlertDialogScope",()=>u],28883);var A=e.i(28883),A=A,T=e.i(31777),k=e.i(35364);function _({...e}){return(0,t.jsx)(A.Root,{"data-slot":"alert-dialog",...e})}function N({...e}){return(0,t.jsx)(A.Portal,{"data-slot":"alert-dialog-portal",...e})}function L({className:e,onClick:r,...o}){return(0,t.jsx)(A.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,T.cn)("fixed inset-0 z-50 bg-black/50",e),onClick:e=>{e.stopPropagation(),r?.(e)},...o})}function O({className:e,size:r="default",...o}){return(0,t.jsxs)(N,{children:[(0,t.jsx)(L,{}),(0,t.jsx)(A.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,T.cn)("bg-background group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...o})]})}function I({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,T.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...r})}function z({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,T.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...r})}function H({className:e,...r}){return(0,t.jsx)(A.Title,{"data-slot":"alert-dialog-title",className:(0,T.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...r})}function F({className:e,...r}){return(0,t.jsx)(A.Description,{"data-slot":"alert-dialog-description",className:(0,T.cn)("text-muted-foreground text-sm",e),...r})}function M({className:e,variant:r="default",size:o="default",...n}){return(0,t.jsx)(k.Button,{variant:r,size:o,asChild:!0,children:(0,t.jsx)(A.Action,{"data-slot":"alert-dialog-action",className:(0,T.cn)(e),...n})})}function W({className:e,variant:r="outline",size:o="default",...n}){return(0,t.jsx)(k.Button,{variant:r,size:o,asChild:!0,children:(0,t.jsx)(A.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,T.cn)(e),...n})})}e.s(["AlertDialog",()=>_,"AlertDialogAction",()=>M,"AlertDialogCancel",()=>W,"AlertDialogContent",()=>O,"AlertDialogDescription",()=>F,"AlertDialogFooter",()=>z,"AlertDialogHeader",()=>I,"AlertDialogTitle",()=>H],71326);let U=(0,r.createContext)(null);function B({children:e}){let o=(0,r.useRef)(null),n=(0,r.useRef)(null),[l,a]=(0,r.useState)(!1),i=(0,r.useCallback)(e=>{o.current=e},[]),s=(0,r.useCallback)(e=>{if(o.current?.isDirty){n.current=e,a(!0);return}e()},[]),c=(0,r.useCallback)(()=>{a(!1),o.current?.onReset(),o.current=null,n.current?.(),n.current=null},[]),u=(0,r.useCallback)(()=>{a(!1),n.current=null},[]),d=(0,r.useCallback)(()=>o.current?.isDirty??!1,[]);return(0,t.jsxs)(U,{value:{setGuard:i,guardedNavigate:s,getIsDirty:d},children:[e,(0,t.jsx)(_,{open:l,children:(0,t.jsxs)(O,{children:[(0,t.jsxs)(I,{children:[(0,t.jsx)(H,{children:"Discard unsaved changes?"}),(0,t.jsx)(F,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),(0,t.jsxs)(z,{children:[(0,t.jsx)(M,{variant:"destructive",onClick:c,children:"Discard"}),(0,t.jsx)(W,{onClick:u,children:"Keep editing"})]})]})})]})}function X(){let e=(0,r.useContext)(U);if(!e)throw Error("useDrawerCloseGuard must be used within DrawerCloseGuardProvider");return e}function Y({open:e,isDirty:t,onClose:o,onReset:n}){let{setGuard:l,guardedNavigate:a}=X();return(0,r.useEffect)(()=>(e?l({isDirty:t,onReset:n}):l(null),()=>l(null)),[e,t,n,l]),{attemptClose:(0,r.useCallback)(()=>{a(()=>{n(),o()})},[a,o,n])}}e.s(["DrawerCloseGuardProvider",()=>B,"useDrawerCloseGuard",()=>X,"useGuardedDrawerClose",()=>Y],30153)},3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},81975,e=>{"use strict";let t=(0,e.i(3645).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",()=>t],81975)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t])},54277,e=>{"use strict";var t=e.i(30090);e.s(["CircleX",()=>t.default])}]);
|