speckit-assistant 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +56 -20
  3. package/.next/app-path-routes-manifest.json +6 -1
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/cache/next-devtools-config.json +1 -0
  6. package/.next/cache/webpack/client-development/0.pack.gz +0 -0
  7. package/.next/cache/webpack/client-development/index.pack.gz +0 -0
  8. package/.next/cache/webpack/client-production/0.pack +0 -0
  9. package/.next/cache/webpack/client-production/1.pack +0 -0
  10. package/.next/cache/webpack/client-production/11.pack +0 -0
  11. package/.next/cache/webpack/client-production/12.pack +0 -0
  12. package/.next/cache/webpack/client-production/13.pack +0 -0
  13. package/.next/cache/webpack/client-production/15.pack +0 -0
  14. package/.next/cache/webpack/client-production/16.pack +0 -0
  15. package/.next/cache/webpack/client-production/17.pack +0 -0
  16. package/.next/cache/webpack/client-production/18.pack +0 -0
  17. package/.next/cache/webpack/client-production/19.pack +0 -0
  18. package/.next/cache/webpack/client-production/2.pack +0 -0
  19. package/.next/cache/webpack/client-production/20.pack +0 -0
  20. package/.next/cache/webpack/client-production/21.pack +0 -0
  21. package/.next/cache/webpack/client-production/22.pack +0 -0
  22. package/.next/cache/webpack/client-production/23.pack +0 -0
  23. package/.next/cache/webpack/client-production/24.pack +0 -0
  24. package/.next/cache/webpack/client-production/25.pack +0 -0
  25. package/.next/cache/webpack/client-production/26.pack +0 -0
  26. package/.next/cache/webpack/client-production/27.pack +0 -0
  27. package/.next/cache/webpack/client-production/28.pack +0 -0
  28. package/.next/cache/webpack/client-production/29.pack +0 -0
  29. package/.next/cache/webpack/client-production/3.pack +0 -0
  30. package/.next/cache/webpack/client-production/30.pack +0 -0
  31. package/.next/cache/webpack/client-production/31.pack +0 -0
  32. package/.next/cache/webpack/client-production/32.pack +0 -0
  33. package/.next/cache/webpack/client-production/33.pack +0 -0
  34. package/.next/cache/webpack/client-production/34.pack +0 -0
  35. package/.next/cache/webpack/client-production/4.pack +0 -0
  36. package/.next/cache/webpack/client-production/6.pack +0 -0
  37. package/.next/cache/webpack/client-production/7.pack +0 -0
  38. package/.next/cache/webpack/client-production/8.pack +0 -0
  39. package/.next/cache/webpack/client-production/9.pack +0 -0
  40. package/.next/cache/webpack/client-production/index.pack +0 -0
  41. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  42. package/.next/cache/webpack/server-production/0.pack +0 -0
  43. package/.next/cache/webpack/server-production/1.pack +0 -0
  44. package/.next/cache/webpack/server-production/10.pack +0 -0
  45. package/.next/cache/webpack/server-production/11.pack +0 -0
  46. package/.next/cache/webpack/server-production/12.pack +0 -0
  47. package/.next/cache/webpack/server-production/13.pack +0 -0
  48. package/.next/cache/webpack/server-production/14.pack +0 -0
  49. package/.next/cache/webpack/server-production/16.pack +0 -0
  50. package/.next/cache/webpack/server-production/18.pack +0 -0
  51. package/.next/cache/webpack/server-production/19.pack +0 -0
  52. package/.next/cache/webpack/server-production/2.pack +0 -0
  53. package/.next/cache/webpack/server-production/20.pack +0 -0
  54. package/.next/cache/webpack/server-production/21.pack +0 -0
  55. package/.next/cache/webpack/server-production/23.pack +0 -0
  56. package/.next/cache/webpack/server-production/24.pack +0 -0
  57. package/.next/cache/webpack/server-production/25.pack +0 -0
  58. package/.next/cache/webpack/server-production/26.pack +0 -0
  59. package/.next/cache/webpack/server-production/27.pack +0 -0
  60. package/.next/cache/webpack/server-production/28.pack +0 -0
  61. package/.next/cache/webpack/server-production/29.pack +0 -0
  62. package/.next/cache/webpack/server-production/3.pack +0 -0
  63. package/.next/cache/webpack/server-production/30.pack +0 -0
  64. package/.next/cache/webpack/server-production/31.pack +0 -0
  65. package/.next/cache/webpack/server-production/32.pack +0 -0
  66. package/.next/cache/webpack/server-production/33.pack +0 -0
  67. package/.next/cache/webpack/server-production/4.pack +0 -0
  68. package/.next/cache/webpack/server-production/5.pack +0 -0
  69. package/.next/cache/webpack/server-production/6.pack +0 -0
  70. package/.next/cache/webpack/server-production/7.pack +0 -0
  71. package/.next/cache/webpack/server-production/9.pack +0 -0
  72. package/.next/cache/webpack/server-production/index.pack +0 -0
  73. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  74. package/.next/prerender-manifest.json +7 -7
  75. package/.next/react-loadable-manifest.json +8 -1
  76. package/.next/required-server-files.json +3 -0
  77. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/_not-found.html +1 -1
  79. package/.next/server/app/_not-found.rsc +2 -2
  80. package/.next/server/app/api/feature/route.js +1 -1
  81. package/.next/server/app/api/feature/route.js.nft.json +1 -1
  82. package/.next/server/app/api/feature/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/file/route.js +1 -1
  84. package/.next/server/app/api/file/route.js.nft.json +1 -1
  85. package/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/git/route.js +1 -0
  87. package/.next/server/app/api/git/route.js.nft.json +1 -0
  88. package/.next/server/app/api/git/route_client-reference-manifest.js +1 -0
  89. package/.next/server/app/api/personas/route.js +1 -0
  90. package/.next/server/app/api/personas/route.js.nft.json +1 -0
  91. package/.next/server/app/api/personas/route_client-reference-manifest.js +1 -0
  92. package/.next/server/app/api/phase/route.js +3 -3
  93. package/.next/server/app/api/phase/route.js.nft.json +1 -1
  94. package/.next/server/app/api/phase/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/state/route.js +1 -1
  96. package/.next/server/app/api/state/route.js.nft.json +1 -1
  97. package/.next/server/app/api/state/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/state/watch/route.js +2 -2
  99. package/.next/server/app/api/state/watch/route.js.nft.json +1 -1
  100. package/.next/server/app/api/state/watch/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/task/route.js +1 -1
  102. package/.next/server/app/api/task/route.js.nft.json +1 -1
  103. package/.next/server/app/api/task/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/terminal/input/route.js +1 -0
  105. package/.next/server/app/api/terminal/input/route.js.nft.json +1 -0
  106. package/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -0
  107. package/.next/server/app/api/terminal/resize/route.js +1 -0
  108. package/.next/server/app/api/terminal/resize/route.js.nft.json +1 -0
  109. package/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -0
  110. package/.next/server/app/api/terminal/stream/route.js +3 -0
  111. package/.next/server/app/api/terminal/stream/route.js.nft.json +1 -0
  112. package/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -0
  113. package/.next/server/app/index.html +1 -1
  114. package/.next/server/app/index.rsc +4 -4
  115. package/.next/server/app/page.js +26 -7
  116. package/.next/server/app/page_client-reference-manifest.js +1 -1
  117. package/.next/server/app-paths-manifest.json +6 -1
  118. package/.next/server/chunks/607.js +2 -2
  119. package/.next/server/chunks/897.js +13 -7
  120. package/.next/server/middleware-build-manifest.js +1 -1
  121. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  122. package/.next/server/pages/404.html +1 -1
  123. package/.next/server/pages/500.html +1 -1
  124. package/.next/static/8CUCTC2XnkR-leKsH4TwE/_buildManifest.js +1 -0
  125. package/.next/static/chunks/111acf76-29d5e5905666f1e0.js +18 -0
  126. package/.next/static/chunks/343.91af0d46f6df0f05.js +1 -0
  127. package/.next/static/chunks/873-a995367ae371a5e4.js +1 -0
  128. package/.next/static/chunks/app/api/feature/route-b4fbc89d13fef983.js +1 -0
  129. package/.next/static/chunks/app/api/file/route-b4fbc89d13fef983.js +1 -0
  130. package/.next/static/chunks/app/api/git/route-b4fbc89d13fef983.js +1 -0
  131. package/.next/static/chunks/app/api/personas/route-b4fbc89d13fef983.js +1 -0
  132. package/.next/static/chunks/app/api/phase/route-b4fbc89d13fef983.js +1 -0
  133. package/.next/static/chunks/app/api/state/route-b4fbc89d13fef983.js +1 -0
  134. package/.next/static/chunks/app/api/state/watch/route-b4fbc89d13fef983.js +1 -0
  135. package/.next/static/chunks/app/api/task/route-b4fbc89d13fef983.js +1 -0
  136. package/.next/static/chunks/app/api/terminal/input/route-b4fbc89d13fef983.js +1 -0
  137. package/.next/static/chunks/app/api/terminal/resize/route-b4fbc89d13fef983.js +1 -0
  138. package/.next/static/chunks/app/api/terminal/stream/route-b4fbc89d13fef983.js +1 -0
  139. package/.next/static/chunks/app/page-b3dea12c644f2054.js +1 -0
  140. package/.next/static/chunks/webpack-c997c7bd3e8f7cdf.js +1 -0
  141. package/.next/static/css/0024e90648d29466.css +3 -0
  142. package/.next/static/css/{008a05b0ad6b854a.css → af3f40f14f702ff7.css} +1 -1
  143. package/.next/trace +3 -3
  144. package/.next/types/app/api/git/route.ts +347 -0
  145. package/.next/types/app/api/personas/route.ts +347 -0
  146. package/.next/types/app/api/terminal/input/route.ts +347 -0
  147. package/.next/types/app/api/terminal/resize/route.ts +347 -0
  148. package/.next/types/app/api/terminal/stream/route.ts +347 -0
  149. package/.next/types/routes.d.ts +6 -1
  150. package/.next/types/validator.ts +45 -0
  151. package/bin/adapters/primary/api/terminalManager.js +92 -0
  152. package/bin/adapters/secondary/agent/ProcessAgentRunner.js +170 -65
  153. package/bin/adapters/secondary/fs/FSWorkspaceRepository.js +40 -5
  154. package/bin/adapters/secondary/pty/ptyLoader.js +128 -0
  155. package/bin/app/api/git/route.js +156 -0
  156. package/bin/app/api/personas/route.js +76 -0
  157. package/bin/app/api/phase/route.js +18 -5
  158. package/bin/app/api/state/watch/route.js +7 -2
  159. package/bin/app/api/terminal/input/route.js +18 -0
  160. package/bin/app/api/terminal/resize/route.js +18 -0
  161. package/bin/app/api/terminal/stream/route.js +44 -0
  162. package/bin/domain/models/personas.js +65 -0
  163. package/bin/domain/services/WorkflowService.js +79 -5
  164. package/next.config.mjs +3 -0
  165. package/package.json +13 -1
  166. package/.next/static/Bxo1ckOxvQcndtSKD9Yna/_buildManifest.js +0 -1
  167. package/.next/static/chunks/590-a6568595ecd2a994.js +0 -1
  168. package/.next/static/chunks/app/api/feature/route-bb3c1a82e892ab58.js +0 -1
  169. package/.next/static/chunks/app/api/file/route-bb3c1a82e892ab58.js +0 -1
  170. package/.next/static/chunks/app/api/phase/route-bb3c1a82e892ab58.js +0 -1
  171. package/.next/static/chunks/app/api/state/route-bb3c1a82e892ab58.js +0 -1
  172. package/.next/static/chunks/app/api/state/watch/route-bb3c1a82e892ab58.js +0 -1
  173. package/.next/static/chunks/app/api/task/route-bb3c1a82e892ab58.js +0 -1
  174. package/.next/static/chunks/app/page-8a5248f7704cde29.js +0 -1
  175. package/.next/static/chunks/webpack-c460f8e58a9e9eff.js +0 -1
  176. package/.next/static/css/6fd2e11db3a59771.css +0 -3
  177. /package/.next/static/{Bxo1ckOxvQcndtSKD9Yna → 8CUCTC2XnkR-leKsH4TwE}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[343],{7343:(e,t,r)=>{r.r(t),r.d(t,{TerminalPanel:()=>s,default:()=>c});var n=r(8886),o=r(9398),l=r(6848),a=r(1694);r(9170);let s=()=>{let e=(0,o.useRef)(null),t=(0,o.useRef)(null);return(0,o.useEffect)(()=>{if(!e.current)return;let r=new l.B({cursorBlink:!0,theme:{background:"#000000",foreground:"#a1a1aa",cursor:"#f4f4f5",selectionBackground:"#27272a"},fontFamily:'Menlo, Monaco, Consolas, "Courier New", monospace',fontSize:11,rows:24}),n=new a.Y;r.loadAddon(n),r.open(e.current),n.fit(),t.current=r;let o=()=>{fetch("/api/terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cols:r.cols,rows:r.rows})}).catch(()=>{})};o();let s=new EventSource("/api/terminal/stream");s.onmessage=e=>{try{let t=JSON.parse(e.data);t.output&&r.write(t.output)}catch(e){}};let c=r.onData(e=>{fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})}).catch(e=>console.error("Failed to send input:",e))}),i=new ResizeObserver(()=>{try{n.fit(),o()}catch(e){}});return i.observe(e.current),()=>{i.disconnect(),r.dispose(),s.close(),c.dispose()}},[]),(0,n.jsx)("div",{className:"h-full w-full bg-black flex flex-col min-h-0 border-t border-zinc-800",children:(0,n.jsx)("div",{ref:e,className:"flex-1 w-full h-full p-3 overflow-hidden"})})},c=s}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{47:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},367:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]])},451:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]])},496:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]])},509:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},641:(t,e,n)=>{"use strict";var r=n(9398),i=n(1447),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=i.useSyncExternalStore,u=r.useRef,l=r.useEffect,s=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var h=u(null);if(null===h.current){var f={hasValue:!1,value:null};h.current=f}else f=h.current;var d=a(t,(h=s(function(){function t(t){if(!l){if(l=!0,a=t,t=r(t),void 0!==i&&f.hasValue){var e=f.value;if(i(e,t))return u=e}return u=t}if(e=u,o(a,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(a=t,e):(a=t,u=n)}var a,u,l=!1,s=void 0===n?null:n;return[function(){return t(e())},null===s?void 0:function(){return t(s())}]},[e,n,r,i]))[0],h[1]);return l(function(){f.hasValue=!0,f.value=d},[d]),c(d),d}},779:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},913:(t,e,n)=>{"use strict";t.exports=n(641)},1240:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},1269:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},1447:(t,e,n)=>{"use strict";t.exports=n(3106)},1609:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(4455).createAsyncLocalStorage)()},1694:(t,e,n)=>{"use strict";n.d(e,{Y:()=>r});var r=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(0===t.css.cell.width||0===t.css.cell.height)return;let e=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),i=Math.max(0,parseInt(n.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),a={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},u=a.top+a.bottom;return{cols:Math.max(2,Math.floor((i-(a.right+a.left)-e)/t.css.cell.width)),rows:Math.max(1,Math.floor((r-u)/t.css.cell.height))}}}},2084:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},2393:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]])},2768:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]])},2852:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},3088:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3106:(t,e,n)=>{"use strict";var r=n(9398),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,a=r.useEffect,u=r.useLayoutEffect,l=r.useDebugValue;function s(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,c=r[1];return u(function(){i.value=n,i.getSnapshot=e,s(i)&&c({inst:i})},[t,n,e]),a(function(){return s(i)&&c({inst:i}),t(function(){s(i)&&c({inst:i})})},[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},3199:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},3277:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},3353:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},3383:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])},3541:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},3781:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},3917:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});let r=n(506)._(n(9397));function i(t,e){var n;let i={};"function"==typeof t&&(i.loader=t);let o={...i,...e};return(0,r.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},3933:(t,e,n)=>{"use strict";n.d(e,{h:()=>h,n:()=>s});var r=n(9398),i=n(913);let o=t=>{let e,n=new Set,r=(t,r)=>{let i="function"==typeof t?t(e):t;if(!Object.is(i,e)){let t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>a,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=e=t(r,i,o);return o},{useDebugValue:a}=r,{useSyncExternalStoreWithSelector:u}=i,l=t=>t;function s(t,e=l,n){let r=u(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return a(r),r}let c=(t,e)=>{let n=(t=>t?o(t):o)(t),r=(t,r=e)=>s(n,t,r);return Object.assign(r,n),r},h=(t,e)=>t?c(t,e):c},4140:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},4172:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]])},4186:(t,e,n)=>{"use strict";function r(t){let{reason:e,children:n}=t;return n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(6198)},4201:(t,e,n)=>{"use strict";n.d(e,{Do:()=>u,WZ:()=>i,TG:()=>l,ny:()=>o,yX:()=>s,xN:()=>c,Qc:()=>a,I$:()=>rc,aQ:()=>ry,di:()=>rm,kO:()=>rM,rN:()=>nF,bi:()=>rt,_s:()=>nz,_7:()=>na,aE:()=>nt,kr:()=>nm,Hm:()=>n5,tM:()=>eQ,tn:()=>eG,xc:()=>eZ,us:()=>nE,IO:()=>e9,e_:()=>nO,Fp:()=>nq,Mi:()=>nf,HF:()=>e1,Eo:()=>nP,b5:()=>nJ,Tq:()=>ne,qX:()=>nD,q1:()=>nj,M_:()=>n1,oj:()=>nT,aZ:()=>e7,aW:()=>n3,uD:()=>nM,Jo:()=>e6,U$:()=>e8,X6:()=>nd,oN:()=>nG,ah:()=>nW,R4:()=>n_,r8:()=>rr,ZO:()=>eU,bK:()=>eJ,b$:()=>e2,uj:()=>nX,v5:()=>nC,Ue:()=>nb,Er:()=>nH,oB:()=>e3,kf:()=>ny,mW:()=>np,Q6:()=>nS,QE:()=>nA,kM:()=>nc,No:()=>ro,Ff:()=>nv,zj:()=>nx,s_:()=>ng,vS:()=>n8,qn:()=>ru,uL:()=>ri,YN:()=>n$});var r,i,o,a,u,l,s,c,h={value:()=>{}};function f(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw Error("illegal type: "+t);r[t]=[]}return new d(r)}function d(t){this._=t}function p(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=h,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}function y(){}function m(t){return null==t?y:function(){return this.querySelector(t)}}function g(){return[]}function v(t){return null==t?g:function(){return this.querySelectorAll(t)}}function x(t){return function(){return this.matches(t)}}function w(t){return function(e){return e.matches(t)}}d.prototype=f.prototype={constructor:d,on:function(t,e){var n,r=this._,i=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:e}}),o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((n=(t=i[o]).type)&&(n=function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(r[n],t.name)))return n;return}if(null!=e&&"function"!=typeof e)throw Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=p(r[n],t.name,e);else if(null==e)for(n in r)r[n]=p(r[n],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new d(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(r=this._[t],o=0,n=r.length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var _=Array.prototype.find;function b(){return this.firstElementChild}var k=Array.prototype.filter;function M(){return Array.from(this.children)}function A(t){return Array(t.length)}function E(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function z(t,e,n,r,i,o){for(var a,u=0,l=e.length,s=o.length;u<s;++u)(a=e[u])?(a.__data__=o[u],r[u]=a):n[u]=new E(t,o[u]);for(;u<l;++u)(a=e[u])&&(i[u]=a)}function $(t,e,n,r,i,o,a){var u,l,s,c=new Map,h=e.length,f=o.length,d=Array(h);for(u=0;u<h;++u)(l=e[u])&&(d[u]=s=a.call(l,l.__data__,u,e)+"",c.has(s)?i[u]=l:c.set(s,l));for(u=0;u<f;++u)s=a.call(t,o[u],u,o)+"",(l=c.get(s))?(r[u]=l,l.__data__=o[u],c.delete(s)):n[u]=new E(t,o[u]);for(u=0;u<h;++u)(l=e[u])&&c.get(d[u])===l&&(i[u]=l)}function S(t){return t.__data__}function N(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}E.prototype={constructor:E,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var P="http://www.w3.org/1999/xhtml";let T={svg:"http://www.w3.org/2000/svg",xhtml:P,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function I(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),T.hasOwnProperty(e)?{space:T[e],local:t}:t}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function H(t,e){return t.style.getPropertyValue(e)||C(t).getComputedStyle(t,null).getPropertyValue(e)}function j(t){return t.trim().split(/^|\s+/)}function L(t){return t.classList||new O(t)}function O(t){this._node=t,this._names=j(t.getAttribute("class")||"")}function B(t,e){for(var n=L(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function V(t,e){for(var n=L(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function q(){this.textContent=""}function R(){this.innerHTML=""}function D(){this.nextSibling&&this.parentNode.appendChild(this)}function X(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y(t){var e=I(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===P&&e.documentElement.namespaceURI===P?e.createElement(t):e.createElementNS(n,t)}})(e)}function F(){return null}function W(){var t=this.parentNode;t&&t.removeChild(this)}function K(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Z(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function U(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)(n=e[r],t.type&&n.type!==t.type||n.name!==t.name)?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function G(t,e,n){return function(){var r,i=this.__on,o=function(t){e.call(this,t,this.__data__)};if(i){for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function Q(t,e,n){var r=C(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}O.prototype={add:function(t){0>this._names.indexOf(t)&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var J=[null];function tt(t,e){this._groups=t,this._parents=e}function te(){return new tt([[document.documentElement]],J)}function tn(t){return"string"==typeof t?new tt([[document.querySelector(t)]],[document.documentElement]):new tt([[t]],J)}function tr(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}tt.prototype=te.prototype={constructor:tt,select:function(t){"function"!=typeof t&&(t=m(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a,u=e[i],l=u.length,s=r[i]=Array(l),c=0;c<l;++c)(o=u[c])&&(a=t.call(o,o.__data__,c,u))&&("__data__"in o&&(a.__data__=o.__data__),s[c]=a);return new tt(r,this._parents)},selectAll:function(t){if("function"==typeof t){var e;e=t,t=function(){var t;return t=e.apply(this,arguments),null==t?[]:Array.isArray(t)?t:Array.from(t)}}else t=v(t);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var u,l=n[a],s=l.length,c=0;c<s;++c)(u=l[c])&&(i.push(t.call(u,u.__data__,c,l)),o.push(u));return new tt(i,o)},selectChild:function(t){var e;return this.select(null==t?b:(e="function"==typeof t?t:w(t),function(){return _.call(this.children,e)}))},selectChildren:function(t){var e;return this.selectAll(null==t?M:(e="function"==typeof t?t:w(t),function(){return k.call(this.children,e)}))},filter:function(t){"function"!=typeof t&&(t=x(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new tt(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,S);var n=e?$:z,r=this._parents,i=this._groups;"function"!=typeof t&&(v=t,t=function(){return v});for(var o=i.length,a=Array(o),u=Array(o),l=Array(o),s=0;s<o;++s){var c=r[s],h=i[s],f=h.length,d="object"==typeof(g=t.call(c,c&&c.__data__,s,r))&&"length"in g?g:Array.from(g),p=d.length,y=u[s]=Array(p),m=a[s]=Array(p);n(c,h,y,m,l[s]=Array(f),d,e);for(var g,v,x,w,_=0,b=0;_<p;++_)if(x=y[_]){for(_>=b&&(b=_+1);!(w=m[b])&&++b<p;);x._next=w||null}}return(a=new tt(a,r))._enter=u,a._exit=l,a},enter:function(){return new tt(this._enter||this._groups.map(A),this._parents)},exit:function(){return new tt(this._exit||this._groups.map(A),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=Array(i),l=0;l<a;++l)for(var s,c=n[l],h=r[l],f=c.length,d=u[l]=Array(f),p=0;p<f;++p)(s=c[p]||h[p])&&(d[p]=s);for(;l<i;++l)u[l]=n[l];return new tt(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=N);for(var n=this._groups,r=n.length,i=Array(r),o=0;o<r;++o){for(var a,u=n[o],l=u.length,s=i[o]=Array(l),c=0;c<l;++c)(a=u[c])&&(s[c]=a);s.sort(e)}return new tt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(let e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=I(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):H(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=j(t+"");if(arguments.length<2){for(var r=L(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?B:V)(this,t)}}:e?function(t){return function(){B(this,t)}}:function(t){return function(){V(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?q:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?R:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(D)},lower:function(){return this.each(X)},append:function(t){var e="function"==typeof t?t:Y(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Y(t),r=null==e?F:"function"==typeof e?e:m(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(W)},clone:function(t){return this.select(t?Z:K)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}),a=o.length;if(arguments.length<2){var u=this.node().__on;if(u){for(var l,s=0,c=u.length;s<c;++s)for(r=0,l=u[s];r<a;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value}return}for(r=0,u=e?G:U;r<a;++r)this.each(u(o[r],e,n));return this},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return Q(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return Q(this,t,e)}})(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};let ti={passive:!1},to={capture:!0,passive:!1};function ta(t){t.stopImmediatePropagation()}function tu(t){t.preventDefault(),t.stopImmediatePropagation()}function tl(t){var e=t.document.documentElement,n=tn(t).on("dragstart.drag",tu,to);"onselectstart"in e?n.on("selectstart.drag",tu,to):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function ts(t,e){var n=t.document.documentElement,r=tn(t).on("dragstart.drag",null);e&&(r.on("click.drag",tu,to),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let tc=t=>()=>t;function th(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:u,dx:l,dy:s,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:c}})}function tf(t){return!t.ctrlKey&&!t.button}function td(){return this.parentNode}function tp(t,e){return null==e?{x:t.x,y:t.y}:e}function ty(){return navigator.maxTouchPoints||"ontouchstart"in this}function tm(t){return((t=Math.exp(t))+1/t)/2}th.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let tg=function t(e,n,r){function i(t,i){var o,a,u=t[0],l=t[1],s=t[2],c=i[0],h=i[1],f=i[2],d=c-u,p=h-l,y=d*d+p*p;if(y<1e-12)a=Math.log(f/s)/e,o=function(t){return[u+t*d,l+t*p,s*Math.exp(e*t*a)]};else{var m=Math.sqrt(y),g=(f*f-s*s+r*y)/(2*s*n*m),v=(f*f-s*s-r*y)/(2*f*n*m),x=Math.log(Math.sqrt(g*g+1)-g);a=(Math.log(Math.sqrt(v*v+1)-v)-x)/e,o=function(t){var r,i,o=t*a,c=tm(x),h=s/(n*m)*(c*(((r=Math.exp(2*(r=e*o+x)))-1)/(r+1))-((i=Math.exp(i=x))-1/i)/2);return[u+h*d,l+h*p,s*c/tm(e*o+x)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);var tv,tx,tw=0,t_=0,tb=0,tk=0,tM=0,tA=0,tE="object"==typeof performance&&performance.now?performance:Date,tz="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function t$(){return tM||(tz(tS),tM=tE.now()+tA)}function tS(){tM=0}function tN(){this._call=this._time=this._next=null}function tP(t,e,n){var r=new tN;return r.restart(t,e,n),r}function tT(){tM=(tk=tE.now())+tA,tw=t_=0;try{t$(),++tw;for(var t,e=tv;e;)(t=tM-e._time)>=0&&e._call.call(void 0,t),e=e._next;--tw}finally{tw=0,function(){for(var t,e,n=tv,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:tv=e);tx=t,tC(r)}(),tM=0}}function tI(){var t=tE.now(),e=t-tk;e>1e3&&(tA-=e,tk=t)}function tC(t){!tw&&(t_&&(t_=clearTimeout(t_)),t-tM>24?(t<1/0&&(t_=setTimeout(tT,t-tE.now()-tA)),tb&&(tb=clearInterval(tb))):(tb||(tk=tE.now(),tb=setInterval(tI,1e3)),tw=1,tz(tT)))}function tH(t,e,n){var r=new tN;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}tN.prototype=tP.prototype={constructor:tN,restart:function(t,e,n){if("function"!=typeof t)throw TypeError("callback is not a function");n=(null==n?t$():+n)+(null==e?0:+e),this._next||tx===this||(tx?tx._next=this:tv=this,tx=this),this._call=t,this._time=n,tC()},stop:function(){this._call&&(this._call=null,this._time=1/0,tC())}};var tj=f("start","end","cancel","interrupt"),tL=[];function tO(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(l){var s,c,h,f;if(1!==n.state)return u();for(s in i)if((f=i[s]).name===n.name){if(3===f.state)return tH(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[s]):+s<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[s])}if(tH(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(s=0,n.state=3,r=Array(h=n.tween.length),c=-1;s<h;++s)(f=n.tween[s].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=tP(function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)},0,n.time)}(t,n,{name:e,index:r,group:i,on:tj,tween:tL,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function tB(t,e){var n=tq(t,e);if(n.state>0)throw Error("too late; already scheduled");return n}function tV(t,e){var n=tq(t,e);if(n.state>3)throw Error("too late; already running");return n}function tq(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw Error("transition not found");return n}function tR(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o){if((n=o[i]).name!==e){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]}a&&delete t.__transition}}function tD(t,e){return t*=1,e*=1,function(n){return t*(1-n)+e*n}}var tX=180/Math.PI,tY={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tF(t,e,n,r,i,o){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*tX,skewX:Math.atan(l)*tX,scaleX:a,scaleY:u}}function tW(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u,l,s,c,h=[],f=[];return o=t(o),a=t(a),!function(t,r,i,o,a,u){if(t!==i||r!==o){var l=a.push("translate(",null,e,null,n);u.push({i:l-4,x:tD(t,i)},{i:l-2,x:tD(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,h,f),u=o.rotate,l=a.rotate,u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:tD(u,l)})):l&&h.push(i(h)+"rotate("+l+r),s=o.skewX,c=a.skewX,s!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:tD(s,c)}):c&&h.push(i(h)+"skewX("+c+r),!function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:tD(t,n)},{i:u-2,x:tD(e,r)})}else(1!==n||1!==r)&&o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,h,f),o=a=null,function(t){for(var e,n=-1,r=f.length;++n<r;)h[(e=f[n]).i]=e.x(t);return h.join("")}}}var tK=tW(function(t){let e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?tY:tF(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),tZ=tW(function(t){return null==t?tY:(r||(r=document.createElementNS("http://www.w3.org/2000/svg","g")),r.setAttribute("transform",t),t=r.transform.baseVal.consolidate())?tF((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):tY},", ",")",")");function tU(t,e,n){var r=t._id;return t.each(function(){var t=tV(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return tq(t,r).value[e]}}function tG(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function tQ(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function tJ(){}var t0="\\s*([+-]?\\d+)\\s*",t1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",t2="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",t3=/^#([0-9a-f]{3,8})$/,t5=RegExp(`^rgb\\(${t0},${t0},${t0}\\)$`),t4=RegExp(`^rgb\\(${t2},${t2},${t2}\\)$`),t6=RegExp(`^rgba\\(${t0},${t0},${t0},${t1}\\)$`),t7=RegExp(`^rgba\\(${t2},${t2},${t2},${t1}\\)$`),t8=RegExp(`^hsl\\(${t1},${t2},${t2}\\)$`),t9=RegExp(`^hsla\\(${t1},${t2},${t2},${t1}\\)$`),et={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function ee(){return this.rgb().formatHex()}function en(){return this.rgb().formatRgb()}function er(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=t3.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ei(e):3===n?new eu(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?eo(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?eo(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=t5.exec(t))?new eu(e[1],e[2],e[3],1):(e=t4.exec(t))?new eu(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=t6.exec(t))?eo(e[1],e[2],e[3],e[4]):(e=t7.exec(t))?eo(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=t8.exec(t))?ed(e[1],e[2]/100,e[3]/100,1):(e=t9.exec(t))?ed(e[1],e[2]/100,e[3]/100,e[4]):et.hasOwnProperty(t)?ei(et[t]):"transparent"===t?new eu(NaN,NaN,NaN,0):null}function ei(t){return new eu(t>>16&255,t>>8&255,255&t,1)}function eo(t,e,n,r){return r<=0&&(t=e=n=NaN),new eu(t,e,n,r)}function ea(t,e,n,r){var i;return 1==arguments.length?((i=t)instanceof tJ||(i=er(i)),i)?new eu((i=i.rgb()).r,i.g,i.b,i.opacity):new eu:new eu(t,e,n,null==r?1:r)}function eu(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function el(){return`#${ef(this.r)}${ef(this.g)}${ef(this.b)}`}function es(){let t=ec(this.opacity);return`${1===t?"rgb(":"rgba("}${eh(this.r)}, ${eh(this.g)}, ${eh(this.b)}${1===t?")":`, ${t})`}`}function ec(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function eh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ef(t){return((t=eh(t))<16?"0":"")+t.toString(16)}function ed(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ey(t,e,n,r)}function ep(t){if(t instanceof ey)return new ey(t.h,t.s,t.l,t.opacity);if(t instanceof tJ||(t=er(t)),!t)return new ey;if(t instanceof ey)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,l=(o+i)/2;return u?(a=e===o?(n-r)/u+(n<r)*6:n===o?(r-e)/u+2:(e-n)/u+4,u/=l<.5?o+i:2-o-i,a*=60):u=l>0&&l<1?0:a,new ey(a,u,l,t.opacity)}function ey(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function em(t){return(t=(t||0)%360)<0?t+360:t}function eg(t){return Math.max(0,Math.min(1,t||0))}function ev(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function ex(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}tG(tJ,er,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ee,formatHex:ee,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ep(this).formatHsl()},formatRgb:en,toString:en}),tG(eu,ea,tQ(tJ,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new eu(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new eu(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new eu(eh(this.r),eh(this.g),eh(this.b),ec(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:el,formatHex:el,formatHex8:function(){return`#${ef(this.r)}${ef(this.g)}${ef(this.b)}${ef((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:es,toString:es})),tG(ey,function(t,e,n,r){return 1==arguments.length?ep(t):new ey(t,e,n,null==r?1:r)},tQ(tJ,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new ey(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new ey(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new eu(ev(t>=240?t-240:t+120,i,r),ev(t,i,r),ev(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ey(em(this.h),eg(this.s),eg(this.l),ec(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=ec(this.opacity);return`${1===t?"hsl(":"hsla("}${em(this.h)}, ${100*eg(this.s)}%, ${100*eg(this.l)}%${1===t?")":`, ${t})`}`}}));let ew=t=>()=>t;function e_(t,e){var n=e-t;return n?function(e){return t+e*n}:ew(isNaN(t)?e:t)}let eb=function t(e){var n,r=1==(n=+e)?e_:function(t,e){var r,i,o;return e-t?(r=t,i=e,r=Math.pow(r,o=n),i=Math.pow(i,o)-r,o=1/o,function(t){return Math.pow(r+t*i,o)}):ew(isNaN(t)?e:t)};function i(t,e){var n=r((t=ea(t)).r,(e=ea(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=e_(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function ek(t){return function(e){var n,r,i=e.length,o=Array(i),a=Array(i),u=Array(i);for(n=0;n<i;++n)r=ea(e[n]),o[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return o=t(o),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=u(t),r+""}}}ek(function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r<e-1?t[r+2]:2*o-i;return ex((n-r/e)*e,a,i,o,u)}}),ek(function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return ex((n-r/e)*e,i,o,a,u)}});var eM=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,eA=RegExp(eM.source,"g");function eE(t,e){var n,r,i,o,a,u=eM.lastIndex=eA.lastIndex=0,l=-1,s=[],c=[];for(t+="",e+="";(i=eM.exec(t))&&(o=eA.exec(e));)(a=o.index)>u&&(a=e.slice(u,a),s[l]?s[l]+=a:s[++l]=a),(i=i[0])===(o=o[0])?s[l]?s[l]+=o:s[++l]=o:(s[++l]=null,c.push({i:l,x:tD(i,o)})),u=eA.lastIndex;return u<e.length&&(a=e.slice(u),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?(n=c[0].x,function(t){return n(t)+""}):(r=e,function(){return r}):(e=c.length,function(t){for(var n,r=0;r<e;++r)s[(n=c[r]).i]=n.x(t);return s.join("")})}function ez(t,e){var n;return("number"==typeof e?tD:e instanceof er?eb:(n=er(e))?(e=n,eb):eE)(t,e)}var e$=te.prototype.constructor;function eS(t){return function(){this.style.removeProperty(t)}}var eN=0;function eP(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}var eT=te.prototype;eP.prototype=(function(t){return te().transition(t)}).prototype={constructor:eP,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=m(t));for(var r=this._groups,i=r.length,o=Array(i),a=0;a<i;++a)for(var u,l,s=r[a],c=s.length,h=o[a]=Array(c),f=0;f<c;++f)(u=s[f])&&(l=t.call(u,u.__data__,f,s))&&("__data__"in u&&(l.__data__=u.__data__),h[f]=l,tO(h[f],e,n,f,h,tq(u,n)));return new eP(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=v(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var l,s=r[u],c=s.length,h=0;h<c;++h)if(l=s[h]){for(var f,d=t.call(l,l.__data__,h,s),p=tq(l,n),y=0,m=d.length;y<m;++y)(f=d[y])&&tO(f,e,n,y,d,p);o.push(d),a.push(l)}return new eP(o,a,e,n)},selectChild:eT.selectChild,selectChildren:eT.selectChildren,filter:function(t){"function"!=typeof t&&(t=x(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new eP(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw Error();for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=Array(r),u=0;u<o;++u)for(var l,s=e[u],c=n[u],h=s.length,f=a[u]=Array(h),d=0;d<h;++d)(l=s[d]||c[d])&&(f[d]=l);for(;u<r;++u)a[u]=e[u];return new eP(a,this._parents,this._name,this._id)},selection:function(){return new e$(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=++eN,r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)if(a=u[s]){var c=tq(a,e);tO(a,t,n,s,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new eP(r,this._parents,t,n)},call:eT.call,nodes:eT.nodes,node:eT.node,size:eT.size,empty:eT.empty,each:eT.each,on:function(t,e){var n,r,i,o,a,u,l=this._id;return arguments.length<2?tq(this.node(),l).on.on(t):this.each((n=l,r=t,i=e,u=(r+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})?tB:tV,function(){var t=u(this,n),e=t.on;e!==o&&(a=(o=e).copy()).on(r,i),t.on=a}))},attr:function(t,e){var n=I(t),r="transform"===n?tZ:ez;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,o;return function(){var a,u,l=n(this);return null==l?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,l))}}:function(t,e,n){var r,i,o;return function(){var a,u,l=n(this);return null==l?void this.removeAttribute(t):(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,l))}})(n,r,tU(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}:function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw Error();var r=I(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttributeNS(t.space,t.local,i.call(this,e))}),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttribute(t,i.call(this,e))}),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r,i,o,a,u,l,s,c,h,f,d,p,y,m,g,v,x,w,_,b,k,M="transform"==(t+="")?tK:ez;return null==e?this.styleTween(t,(r=t,function(){var t=H(this,r),e=(this.style.removeProperty(r),H(this,r));return t===e?null:t===i&&e===o?a:a=M(i=t,o=e)})).on("end.style."+t,eS(t)):"function"==typeof e?this.styleTween(t,(u=t,l=tU(this,"style."+t,e),function(){var t=H(this,u),e=l(this),n=e+"";return null==e&&(this.style.removeProperty(u),n=e=H(this,u)),t===n?null:t===s&&n===c?h:(c=n,h=M(s=t,e))})).each((f=this._id,x="end."+(v="style."+(d=t)),function(){var t=tV(this,f),e=t.on,n=null==t.value[v]?g||(g=eS(d)):void 0;(e!==p||m!==n)&&(y=(p=e).copy()).on(x,m=n),t.on=y})):this.styleTween(t,(w=t,k=e+"",function(){var t=H(this,w);return t===k?null:t===_?b:b=M(_=t,e)}),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw Error();return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(e){this.style.setProperty(t,o.call(this,e),n)}),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){var e,n;return this.tween("text","function"==typeof t?(e=tU(this,"text",t),function(){var t=e(this);this.textContent=null==t?"":t}):(n=null==t?"":t+"",function(){this.textContent=n}))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw Error();return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){this.textContent=r.call(this,t)}),e}return r._value=t,r}(t))},remove:function(){var t;return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=tq(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?function(t,e){var n,r;return function(){var i=tV(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,u=r.length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}}i.tween=r}}:function(t,e,n){var r,i;if("function"!=typeof n)throw Error();return function(){var o=tV(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:e,value:n},l=0,s=i.length;l<s;++l)if(i[l].name===e){i[l]=u;break}l===s&&i.push(u)}o.tween=i}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){tB(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){tB(this,t).delay=e}})(e,t)):tq(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){tV(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){tV(this,t).duration=e}})(e,t)):tq(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw Error();return function(){tV(this,t).ease=e}}(e,t)):tq(this.node(),e).ease},easeVarying:function(t){var e;if("function"!=typeof t)throw Error();return this.each((e=this._id,function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw Error();tV(this,e).ease=n}))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var u={value:a},l={value:function(){0==--i&&o()}};n.each(function(){var n=tV(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),n.on=e}),0===i&&o()})},[Symbol.iterator]:eT[Symbol.iterator]};var eI={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};te.prototype.interrupt=function(t){return this.each(function(){tR(this,t)})},te.prototype.transition=function(t){var e,n;t instanceof eP?(e=t._id,t=t._name):(e=++eN,(n=eI).time=t$(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)(a=u[s])&&tO(a,t,e,s,u,n||function(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw Error(`transition ${e} not found`);return n}(a,e));return new eP(r,this._parents,t,e)};let eC=t=>()=>t;function eH(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ej(t,e,n){this.k=t,this.x=e,this.y=n}ej.prototype={constructor:ej,scale:function(t){return 1===t?this:new ej(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new ej(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var eL=new ej(1,0,0);function eO(t){for(;!t.__zoom;)if(!(t=t.parentNode))return eL;return t.__zoom}function eB(t){t.stopImmediatePropagation()}function eV(t){t.preventDefault(),t.stopImmediatePropagation()}function eq(t){return(!t.ctrlKey||"wheel"===t.type)&&!t.button}function eR(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function eD(){return this.__zoom||eL}function eX(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function eY(){return navigator.maxTouchPoints||"ontouchstart"in this}function eF(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function eW(){var t,e,n,r=eq,i=eR,o=eF,a=eX,u=eY,l=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,h=tg,d=f("start","zoom","end"),p=0,y=10;function m(t){t.property("__zoom",eD).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",A).filter(u).on("touchstart.zoom",E).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new ej(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new ej(t.k,r,i)}function x(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",function(){_(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(r).end()}).tween("zoom",function(){var t=arguments,o=_(this,t).event(r),a=i.apply(this,t),u=null==n?x(a):"function"==typeof n?n.apply(this,t):n,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=this.__zoom,c="function"==typeof e?e.apply(this,t):e,f=h(s.invert(u).concat(l/s.k),c.invert(u).concat(l/c.k));return function(t){if(1===t)t=c;else{var e=f(t),n=l/e[2];t=new ej(n,u[0]-e[0]*n,u[1]-e[1]*n)}o.zoom(null,t)}})}function _(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function k(t,...e){if(r.apply(this,arguments)){var n=_(this,e).event(t),i=this.__zoom,u=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,a.apply(this,arguments)))),c=tr(t);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=i.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(i.k===u)return;n.mouse=[c,i.invert(c)],tR(this),n.start()}eV(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",o(v(g(i,u),n.mouse[0],n.mouse[1]),n.extent,s))}}function M(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=_(this,e,!0).event(t),u=tn(t.view).on("mousemove.zoom",function(t){if(eV(t),!a.moved){var e=t.clientX-c,n=t.clientY-h;a.moved=e*e+n*n>p}a.event(t).zoom("mouse",o(v(a.that.__zoom,a.mouse[0]=tr(t,i),a.mouse[1]),a.extent,s))},!0).on("mouseup.zoom",function(t){u.on("mousemove.zoom mouseup.zoom",null),ts(t.view,a.moved),eV(t),a.event(t).end()},!0),l=tr(t,i),c=t.clientX,h=t.clientY;tl(t.view),eB(t),a.mouse=[l,this.__zoom.invert(l)],tR(this),a.start()}}function A(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=tr(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),h=o(v(g(n,l),a,u),i.apply(this,e),s);eV(t),c>0?tn(this).transition().duration(c).call(w,h,a,t):tn(this).call(m.transform,h,a,t)}}function E(n,...i){if(r.apply(this,arguments)){var o,a,u,l,s=n.touches,c=s.length,h=_(this,i,n.changedTouches.length===c).event(n);for(eB(n),a=0;a<c;++a)l=[l=tr(u=s[a],this),this.__zoom.invert(l),u.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,o=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(h.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),tR(this),h.start())}}function z(t,...e){if(this.__zooming){var n,r,i,a,u=_(this,e).event(t),l=t.changedTouches,c=l.length;for(eV(t),n=0;n<c;++n)i=tr(r=l[n],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=i:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=i);if(r=u.that.__zoom,u.touch1){var h=u.touch0[0],f=u.touch0[1],d=u.touch1[0],p=u.touch1[1],y=(y=d[0]-h[0])*y+(y=d[1]-h[1])*y,m=(m=p[0]-f[0])*m+(m=p[1]-f[1])*m;r=g(r,Math.sqrt(y/m)),i=[(h[0]+d[0])/2,(h[1]+d[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!u.touch0)return;i=u.touch0[0],a=u.touch0[1]}u.zoom("touch",o(v(r,i,a),u.extent,s))}}function $(t,...r){if(this.__zooming){var i,o,a=_(this,r).event(t),u=t.changedTouches,l=u.length;for(eB(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<l;++i)o=u[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=tr(o,this),Math.hypot(e[0]-o[0],e[1]-o[1])<y)){var s=tn(this).on("dblclick.zoom");s&&s.apply(this,arguments)}}}return m.transform=function(t,e,n,r){var i=t.selection?t.selection():t;i.property("__zoom",eD),t!==i?w(t,e,n,r):i.interrupt().each(function(){_(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},m.scaleBy=function(t,e,n,r){m.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n},n,r)},m.scaleTo=function(t,e,n,r){m.transform(t,function(){var t=i.apply(this,arguments),r=this.__zoom,a=null==n?x(t):"function"==typeof n?n.apply(this,arguments):n,u=r.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return o(v(g(r,l),a,u),t,s)},n,r)},m.translateBy=function(t,e,n,r){m.transform(t,function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),s)},null,r)},m.translateTo=function(t,e,n,r,a){m.transform(t,function(){var t=i.apply(this,arguments),a=this.__zoom,u=null==r?x(t):"function"==typeof r?r.apply(this,arguments):r;return o(eL.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,s)},r,a)},b.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=tn(this.that).datum();d.call(t,this.that,new eH(t,{sourceEvent:this.sourceEvent,target:m,type:t,transform:this.that.__zoom,dispatch:d}),e)}},m.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:eC(+t),m):a},m.filter=function(t){return arguments.length?(r="function"==typeof t?t:eC(!!t),m):r},m.touchable=function(t){return arguments.length?(u="function"==typeof t?t:eC(!!t),m):u},m.extent=function(t){return arguments.length?(i="function"==typeof t?t:eC([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):i},m.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],m):[l[0],l[1]]},m.translateExtent=function(t){return arguments.length?(s[0][0]=+t[0][0],s[1][0]=+t[1][0],s[0][1]=+t[0][1],s[1][1]=+t[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(t){return arguments.length?(o=t,m):o},m.duration=function(t){return arguments.length?(c=+t,m):c},m.interpolate=function(t){return arguments.length?(h=t,m):h},m.on=function(){var t=d.on.apply(d,arguments);return t===d?m:t},m.clickDistance=function(t){return arguments.length?(p=(t*=1)*t,m):Math.sqrt(p)},m.tapDistance=function(t){return arguments.length?(y=+t,m):y},m}function eK(t,e){var n,r,i=typeof e;return null==e||"boolean"===i?ew(e):("number"===i?tD:"string"===i?(r=er(e))?(e=r,eb):eE:e instanceof er?eb:e instanceof Date?function(t,e){var n=new Date;return t*=1,e*=1,function(r){return n.setTime(t*(1-r)+e*r),n}}:!ArrayBuffer.isView(n=e)||n instanceof DataView?Array.isArray(e)?function(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=Array(i),a=Array(r);for(n=0;n<i;++n)o[n]=eK(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?function(t,e){var n,r={},i={};for(n in(null===t||"object"!=typeof t)&&(t={}),(null===e||"object"!=typeof e)&&(e={}),e)n in t?r[n]=eK(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}:tD:function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}})(t,e)}eO.prototype=ej.prototype;let eZ={error001:(t="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${t} handle id: "${"source"===t?n:r}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},eU=[[-1/0,-1/0],[1/0,1/0]],eG=["Enter"," ","Escape"],eQ={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};!function(t){t.Strict="strict",t.Loose="loose"}(i||(i={})),function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"}(o||(o={})),function(t){t.Partial="partial",t.Full="full"}(a||(a={}));let eJ={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};!function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"}(u||(u={})),function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"}(l||(l={})),function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"}(s||(s={}));let e0={[s.Left]:s.Right,[s.Right]:s.Left,[s.Top]:s.Bottom,[s.Bottom]:s.Top};function e1(t){return null===t?null:t?"valid":"invalid"}let e2=t=>"id"in t&&"source"in t&&"target"in t,e3=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),e5=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),e4=(t,e=[0,0])=>{let{width:n,height:r}=nM(t),i=t.origin??e,o=n*i[0],a=r*i[1];return{x:t.position.x-o,y:t.position.y-a}},e6=(t,e={nodeOrigin:[0,0]})=>0===t.length?{x:0,y:0,width:0,height:0}:ns(t.reduce((t,n)=>{let r="string"==typeof n,i=e.nodeLookup||r?void 0:n;return e.nodeLookup&&(i=r?e.nodeLookup.get(n):e5(n)?n:e.nodeLookup.get(n.id)),nu(t,i?nh(i,e.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),e7=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return t.forEach(t=>{(void 0===e.filter||e.filter(t))&&(n=nu(n,nh(t)),r=!0)}),r?ns(n):{x:0,y:0,width:0,height:0}},e8=(t,e,[n,r,i]=[0,0,1],o=!1,a=!1)=>{let u={...nv(e,[n,r,i]),width:e.width/i,height:e.height/i},l=[];for(let e of t.values()){let{measured:t,selectable:n=!0,hidden:r=!1}=e;if(a&&!n||r)continue;let i=t.width??e.width??e.initialWidth??null,s=t.height??e.height??e.initialHeight??null,c=nd(u,nc(e)),h=(i??0)*(s??0),f=o&&c>0;(!e.internals.handleBounds||f||c>=h||e.dragging)&&l.push(e)}return l};async function e9({nodes:t,width:e,height:n,panZoom:r,minZoom:i,maxZoom:o},a){if(0===t.size)return!0;let u=n_(e7(function(t,e){let n=new Map,r=e?.nodes?new Set(e.nodes.map(t=>t.id)):null;return t.forEach(t=>{t.measured.width&&t.measured.height&&(e?.includeHiddenNodes||!t.hidden)&&(!r||r.has(t.id))&&n.set(t.id,t)}),n}(t,a)),e,n,a?.minZoom??i,a?.maxZoom??o,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}function nt({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){let a=n.get(t),u=a.parentId?n.get(a.parentId):void 0,{x:l,y:s}=u?u.internals.positionAbsolute:{x:0,y:0},c=a.origin??r,h=a.extent||i;if("parent"!==a.extent||a.expandParent)u&&nk(a.extent)&&(h=[[a.extent[0][0]+l,a.extent[0][1]+s],[a.extent[1][0]+l,a.extent[1][1]+s]]);else if(u){let t=u.measured.width,e=u.measured.height;t&&e&&(h=[[l,s],[l+t,s+e]])}else o?.("005",eZ.error005());let f=nk(h)?nr(e,h,a.measured):e;return(void 0===a.measured.width||void 0===a.measured.height)&&o?.("015",eZ.error015()),{position:{x:f.x-l+(a.measured.width??0)*c[0],y:f.y-s+(a.measured.height??0)*c[1]},positionAbsolute:f}}async function ne({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:r,onBeforeDelete:i}){let o=new Set(t.map(t=>t.id)),a=[];for(let t of n){if(!1===t.deletable)continue;let e=o.has(t.id),n=!e&&t.parentId&&a.find(e=>e.id===t.parentId);(e||n)&&a.push(t)}let u=new Set(e.map(t=>t.id)),l=r.filter(t=>!1!==t.deletable),s=((t,e)=>{let n=new Set;return t.forEach(t=>{n.add(t.id)}),e.filter(t=>n.has(t.source)||n.has(t.target))})(a,l);for(let t of l)u.has(t.id)&&!s.find(e=>e.id===t.id)&&s.push(t);if(!i)return{edges:s,nodes:a};let c=await i({nodes:a,edges:s});return"boolean"==typeof c?c?{edges:s,nodes:a}:{edges:[],nodes:[]}:c}let nn=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),nr=(t={x:0,y:0},e,n)=>({x:nn(t.x,e[0][0],e[1][0]-(n?.width??0)),y:nn(t.y,e[0][1],e[1][1]-(n?.height??0))});function ni(t,e,n){let{width:r,height:i}=nM(n),{x:o,y:a}=n.internals.positionAbsolute;return nr(t,[[o,a],[o+r,a+i]],e)}let no=(t,e,n)=>t<e?nn(Math.abs(t-e),1,e)/e:t>n?-nn(Math.abs(t-n),1,e)/e:0,na=(t,e,n=15,r=40)=>[no(t.x,r,e.width-r)*n,no(t.y,r,e.height-r)*n],nu=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),nl=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),ns=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),nc=(t,e=[0,0])=>{let{x:n,y:r}=e5(t)?t.internals.positionAbsolute:e4(t,e);return{x:n,y:r,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},nh=(t,e=[0,0])=>{let{x:n,y:r}=e5(t)?t.internals.positionAbsolute:e4(t,e);return{x:n,y:r,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:r+(t.measured?.height??t.height??t.initialHeight??0)}},nf=(t,e)=>ns(nu(nl(t),nl(e))),nd=(t,e)=>Math.ceil(Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))),np=t=>ny(t.width)&&ny(t.height)&&ny(t.x)&&ny(t.y),ny=t=>!isNaN(t)&&isFinite(t),nm=(t,e)=>(t,e)=>{},ng=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),nv=({x:t,y:e},[n,r,i],o=!1,a=[1,1])=>{let u={x:(t-n)/i,y:(e-r)/i};return o?ng(u,a):u},nx=({x:t,y:e},[n,r,i])=>({x:t*i+n,y:e*i+r});function nw(t,e){if("number"==typeof t)return Math.floor((e-e/(1+t))*.5);if("string"==typeof t&&t.endsWith("px")){let e=parseFloat(t);if(!Number.isNaN(e))return Math.floor(e)}if("string"==typeof t&&t.endsWith("%")){let n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let n_=(t,e,n,r,i,o)=>{let a=function(t,e,n){if("string"==typeof t||"number"==typeof t){let r=nw(t,n),i=nw(t,e);return{top:r,right:i,bottom:r,left:i,x:2*i,y:2*r}}if("object"==typeof t){let r=nw(t.top??t.y??0,n),i=nw(t.bottom??t.y??0,n),o=nw(t.left??t.x??0,e),a=nw(t.right??t.x??0,e);return{top:r,right:a,bottom:i,left:o,x:o+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(o,e,n),u=nn(Math.min((e-a.x)/t.width,(n-a.y)/t.height),r,i),l=t.x+t.width/2,s=t.y+t.height/2,c=e/2-l*u,h=n/2-s*u,f=function(t,e,n,r,i,o){let{x:a,y:u}=nx(t,[e,n,r]),{x:l,y:s}=nx({x:t.x+t.width,y:t.y+t.height},[e,n,r]);return{left:Math.floor(a),top:Math.floor(u),right:Math.floor(i-l),bottom:Math.floor(o-s)}}(t,c,h,u,e,n),d={left:Math.min(f.left-a.left,0),top:Math.min(f.top-a.top,0),right:Math.min(f.right-a.right,0),bottom:Math.min(f.bottom-a.bottom,0)};return{x:c-d.left+d.right,y:h-d.top+d.bottom,zoom:u}},nb=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nk(t){return null!=t&&"parent"!==t}function nM(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function nA(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function nE(t,e={width:0,height:0},n,r,i){let o={...t},a=r.get(n);if(a){let t=a.origin||i;o.x+=a.internals.positionAbsolute.x-(e.width??0)*t[0],o.y+=a.internals.positionAbsolute.y-(e.height??0)*t[1]}return o}function nz(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function n$(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function nS(t){return{...eQ,...t||{}}}function nN(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:o,y:a}=nj(t),u=nv({x:o-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:s}=n?ng(u,e):u;return{xSnapped:l,ySnapped:s,...u}}let nP=t=>({width:t.offsetWidth,height:t.offsetHeight}),nT=t=>t?.getRootNode?.()||window?.document,nI=["INPUT","SELECT","TEXTAREA"];function nC(t){let e=t.composedPath?.()?.[0]||t.target;return e?.nodeType===1&&(nI.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey"))}let nH=t=>"clientX"in t,nj=(t,e)=>{let n=nH(t),r=n?t.clientX:t.touches?.[0].clientX,i=n?t.clientY:t.touches?.[0].clientY;return{x:r-(e?.left??0),y:i-(e?.top??0)}},nL=(t,e,n,r,i)=>{let o=e.querySelectorAll(`.${t}`);return o&&o.length?Array.from(o).map(e=>{let o=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),type:t,nodeId:i,position:e.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...nP(e)}}):null};function nO({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:u}){let l=.125*t+.375*i+.375*a+.125*n,s=.125*e+.375*o+.375*u+.125*r,c=Math.abs(l-t),h=Math.abs(s-e);return[l,s,c,h]}function nB(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function nV({pos:t,x1:e,y1:n,x2:r,y2:i,c:o}){switch(t){case s.Left:return[e-nB(e-r,o),n];case s.Right:return[e+nB(r-e,o),n];case s.Top:return[e,n-nB(n-i,o)];case s.Bottom:return[e,n+nB(i-n,o)]}}function nq({sourceX:t,sourceY:e,sourcePosition:n=s.Bottom,targetX:r,targetY:i,targetPosition:o=s.Top,curvature:a=.25}){let[u,l]=nV({pos:n,x1:t,y1:e,x2:r,y2:i,c:a}),[c,h]=nV({pos:o,x1:r,y1:i,x2:t,y2:e,c:a}),[f,d,p,y]=nO({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:u,sourceControlY:l,targetControlX:c,targetControlY:h});return[`M${t},${e} C${u},${l} ${c},${h} ${r},${i}`,f,d,p,y]}function nR({sourceX:t,sourceY:e,targetX:n,targetY:r}){let i=Math.abs(n-t)/2,o=Math.abs(r-e)/2;return[n<t?n+i:n-i,r<e?r+o:r-o,i,o]}function nD({sourceNode:t,targetNode:e,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if("manual"===o)return r;let a=Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0);return(i&&n?r+1e3:r)+a}function nX({sourceNode:t,targetNode:e,width:n,height:r,transform:i}){let o=nu(nh(t),nh(e));return o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1),nd({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},ns(o))>0}let nY=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`xy-edge__${t}${e||""}-${n}${r||""}`,nF=(t,e,n={})=>{let r;if(!t.source||!t.target)return n.onError?.("006",eZ.error006()),e;let i=n.getEdgeId||nY;return((t,e)=>e.some(e=>e.source===t.source&&e.target===t.target&&(e.sourceHandle===t.sourceHandle||!e.sourceHandle&&!t.sourceHandle)&&(e.targetHandle===t.targetHandle||!e.targetHandle&&!t.targetHandle)))(r=e2(t)?{...t}:{...t,id:i(t)},e)?e:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,e.concat(r))};function nW({sourceX:t,sourceY:e,targetX:n,targetY:r}){let[i,o,a,u]=nR({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,i,o,a,u]}let nK={[s.Left]:{x:-1,y:0},[s.Right]:{x:1,y:0},[s.Top]:{x:0,y:-1},[s.Bottom]:{x:0,y:1}},nZ=({source:t,sourcePosition:e=s.Bottom,target:n})=>e===s.Left||e===s.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},nU=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function nG({sourceX:t,sourceY:e,sourcePosition:n=s.Bottom,targetX:r,targetY:i,targetPosition:o=s.Top,borderRadius:a=5,centerX:u,centerY:l,offset:c=20,stepPosition:h=.5}){let[f,d,p,y,m]=function({source:t,sourcePosition:e=s.Bottom,target:n,targetPosition:r=s.Top,center:i,offset:o,stepPosition:a}){let u,l,c=nK[e],h=nK[r],f={x:t.x+c.x*o,y:t.y+c.y*o},d={x:n.x+h.x*o,y:n.y+h.y*o},p=nZ({source:f,sourcePosition:e,target:d}),y=0!==p.x?"x":"y",m=p[y],g=[],v={x:0,y:0},x={x:0,y:0},[,,w,_]=nR({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(c[y]*h[y]==-1){"x"===y?(u=i.x??f.x+(d.x-f.x)*a,l=i.y??(f.y+d.y)/2):(u=i.x??(f.x+d.x)/2,l=i.y??f.y+(d.y-f.y)*a);let t=[{x:u,y:f.y},{x:u,y:d.y}],e=[{x:f.x,y:l},{x:d.x,y:l}];g=c[y]===m?"x"===y?t:e:"x"===y?e:t}else{let i=[{x:f.x,y:d.y}],a=[{x:d.x,y:f.y}];if(g="x"===y?c.x===m?a:i:c.y===m?i:a,e===r){let e=Math.abs(t[y]-n[y]);if(e<=o){let r=Math.min(o-1,o-e);c[y]===m?v[y]=(f[y]>t[y]?-1:1)*r:x[y]=(d[y]>n[y]?-1:1)*r}}if(e!==r){let t="x"===y?"y":"x",e=c[y]===h[t],n=f[t]>d[t],r=f[t]<d[t];(1===c[y]&&(!e&&n||e&&r)||1!==c[y]&&(!e&&r||e&&n))&&(g="x"===y?i:a)}let s={x:f.x+v.x,y:f.y+v.y},p={x:d.x+x.x,y:d.y+x.y};Math.max(Math.abs(s.x-g[0].x),Math.abs(p.x-g[0].x))>=Math.max(Math.abs(s.y-g[0].y),Math.abs(p.y-g[0].y))?(u=(s.x+p.x)/2,l=g[0].y):(u=g[0].x,l=(s.y+p.y)/2)}let b={x:f.x+v.x,y:f.y+v.y},k={x:d.x+x.x,y:d.y+x.y};return[[t,...b.x!==g[0].x||b.y!==g[0].y?[b]:[],...g,...k.x!==g[g.length-1].x||k.y!==g[g.length-1].y?[k]:[],n],u,l,w,_]}({source:{x:t,y:e},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:u,y:l},offset:c,stepPosition:h}),g=`M${f[0].x} ${f[0].y}`;for(let t=1;t<f.length-1;t++)g+=function(t,e,n,r){let i=Math.min(nU(t,e)/2,nU(e,n)/2,r),{x:o,y:a}=e;if(t.x===o&&o===n.x||t.y===a&&a===n.y)return`L${o} ${a}`;if(t.y===a){let e=t.x<n.x?-1:1,r=t.y<n.y?1:-1;return`L ${o+i*e},${a}Q ${o},${a} ${o},${a+i*r}`}let u=t.x<n.x?1:-1,l=t.y<n.y?-1:1;return`L ${o},${a+i*l}Q ${o},${a} ${o+i*u},${a}`}(f[t-1],f[t],f[t+1],a);return[g+=`L${f[f.length-1].x} ${f[f.length-1].y}`,d,p,y,m]}function nQ(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function nJ(t){let{sourceNode:e,targetNode:n}=t;if(!nQ(e)||!nQ(n))return null;let r=e.internals.handleBounds||n0(e.handles),o=n.internals.handleBounds||n0(n.handles),a=n2(r?.source??[],t.sourceHandle),u=n2(t.connectionMode===i.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),t.targetHandle);if(!a||!u)return t.onError?.("008",eZ.error008(!a?"source":"target",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;let l=a?.position||s.Bottom,c=u?.position||s.Top,h=n1(e,a,l),f=n1(n,u,c);return{sourceX:h.x,sourceY:h.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:c}}function n0(t){if(!t)return null;let e=[],n=[];for(let r of t)r.width=r.width??1,r.height=r.height??1,"source"===r.type?e.push(r):"target"===r.type&&n.push(r);return{source:e,target:n}}function n1(t,e,n=s.Left,r=!1){let i=(e?.x??0)+t.internals.positionAbsolute.x,o=(e?.y??0)+t.internals.positionAbsolute.y,{width:a,height:u}=e??nM(t);if(r)return{x:i+a/2,y:o+u/2};switch(e?.position??n){case s.Top:return{x:i+a/2,y:o};case s.Right:return{x:i+a,y:o+u/2};case s.Bottom:return{x:i+a/2,y:o+u};case s.Left:return{x:i,y:o+u/2}}}function n2(t,e){return t&&(e?t.find(t=>t.id===e):t[0])||null}function n3(t,e){if(!t)return"";if("string"==typeof t)return t;let n=e?`${e}__`:"";return`${n}${Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join("&")}`}function n5(t,{id:e,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let o=new Set;return t.reduce((t,a)=>([a.markerStart||r,a.markerEnd||i].forEach(r=>{if(r&&"object"==typeof r){let i=n3(r,e);o.has(i)||(t.push({id:i,color:r.color||n,...r}),o.add(i))}}),t),[]).sort((t,e)=>t.id.localeCompare(e.id))}let n4={nodeOrigin:[0,0],nodeExtent:eU,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},n6={...n4,checkEquality:!0};function n7(t,e){let n={...t};for(let t in e)void 0!==e[t]&&(n[t]=e[t]);return n}function n8(t,e,n){let r=n7(n4,n);for(let n of t.values())if(n.parentId)re(n,t,e,r);else{let t=nr(e4(n,r.nodeOrigin),nk(n.extent)?n.extent:r.nodeExtent,nM(n));n.internals.positionAbsolute=t}}function n9(t){return"manual"===t}function rt(t,e,n,r={}){let i=n7(n6,r),o={i:0},a=new Map(e),u=i?.elevateNodesOnSelect&&!n9(i.zIndexMode)?1e3:0,l=t.length>0,s=!1;for(let c of(e.clear(),n.clear(),t)){let t=a.get(c.id);if(i.checkEquality&&c===t?.internals.userNode)e.set(c.id,t);else{let n=nr(e4(c,i.nodeOrigin),nk(c.extent)?c.extent:i.nodeExtent,nM(c));t={...i.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:n,handleBounds:function(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;let n=[],r=[];for(let e of t.handles){let i={id:e.id,width:e.width??1,height:e.height??1,nodeId:t.id,x:e.x,y:e.y,position:e.position,type:e.type};"source"===e.type?n.push(i):"target"===e.type&&r.push(i)}return{source:n,target:r}}(c,t),z:rn(c,u,i.zIndexMode),userNode:c}},e.set(c.id,t)}void 0!==t.measured&&void 0!==t.measured.width&&void 0!==t.measured.height||t.hidden||(l=!1),c.parentId&&re(t,e,n,r,o),s||=c.selected??!1}return{nodesInitialized:l,hasSelectedNodes:s}}function re(t,e,n,r,i){let{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:u,zIndexMode:l}=n7(n4,r),s=t.parentId,c=e.get(s);if(!c)return void console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(t,e){if(!t.parentId)return;let n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}(t,n),i&&!c.parentId&&void 0===c.internals.rootParentIndex&&"auto"===l&&(c.internals.rootParentIndex=++i.i,c.internals.z=c.internals.z+10*i.i),i&&void 0!==c.internals.rootParentIndex&&(i.i=c.internals.rootParentIndex);let{x:h,y:f,z:d}=function(t,e,n,r,i,o){let{x:a,y:u}=e.internals.positionAbsolute,l=nM(t),s=e4(t,n),c=nk(t.extent)?nr(s,t.extent,l):s,h=nr({x:a+c.x,y:u+c.y},r,l);"parent"===t.extent&&(h=ni(h,l,e));let f=rn(t,i,o),d=e.internals.z??0;return{x:h.x,y:h.y,z:d>=f?d+1:f}}(t,c,a,u,o&&!n9(l)?1e3:0,l),{positionAbsolute:p}=t.internals,y=h!==p.x||f!==p.y;(y||d!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:y?{x:h,y:f}:p,z:d}})}function rn(t,e,n){let r=ny(t.zIndex)?t.zIndex:0;return n9(n)?r:r+(t.selected?e:0)}function rr(t,e,n,r=[0,0]){let i=[],o=new Map;for(let n of t){let t=e.get(n.parentId);if(!t)continue;let r=nf(o.get(n.parentId)?.expandedRect??nc(t),n.rect);o.set(n.parentId,{expandedRect:r,parent:t})}return o.size>0&&o.forEach(({expandedRect:e,parent:o},a)=>{let u=o.internals.positionAbsolute,l=nM(o),s=o.origin??r,c=e.x<u.x?Math.round(Math.abs(u.x-e.x)):0,h=e.y<u.y?Math.round(Math.abs(u.y-e.y)):0,f=Math.max(l.width,Math.round(e.width)),d=Math.max(l.height,Math.round(e.height)),p=(f-l.width)*s[0],y=(d-l.height)*s[1];(c>0||h>0||p||y)&&(i.push({id:a,type:"position",position:{x:o.position.x-c+p,y:o.position.y-h+y}}),n.get(a)?.forEach(e=>{t.some(t=>t.id===e.id)||i.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+h}})})),(l.width<e.width||l.height<e.height||c||h)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(c?s[0]*c-p:0),height:d+(h?s[1]*h-y:0)}})}),i}function ri(t,e,n,r,i,o,a){let u=r?.querySelector(".xyflow__viewport"),l=!1;if(!u)return{changes:[],updatedInternals:l};let s=[],c=window.getComputedStyle(u),{m22:h}=new window.DOMMatrixReadOnly(c.transform),f=[];for(let r of t.values()){let t=e.get(r.id);if(!t)continue;if(t.hidden){e.set(t.id,{...t,internals:{...t.internals,handleBounds:void 0}}),l=!0;continue}let u=nP(r.nodeElement),c=t.measured.width!==u.width||t.measured.height!==u.height;if(u.width&&u.height&&(c||!t.internals.handleBounds||r.force)){let d=r.nodeElement.getBoundingClientRect(),p=nk(t.extent)?t.extent:o,{positionAbsolute:y}=t.internals;t.parentId&&"parent"===t.extent?y=ni(y,u,e.get(t.parentId)):p&&(y=nr(y,p,u));let m={...t,measured:u,internals:{...t.internals,positionAbsolute:y,handleBounds:{source:nL("source",r.nodeElement,d,h,t.id),target:nL("target",r.nodeElement,d,h,t.id)}}};e.set(t.id,m),t.parentId&&re(m,e,n,{nodeOrigin:i,zIndexMode:a}),l=!0,c&&(s.push({id:t.id,type:"dimensions",dimensions:u}),t.expandParent&&t.parentId&&f.push({id:t.id,parentId:t.parentId,rect:nc(m,i)}))}}if(f.length>0){let t=rr(f,e,n,i);s.push(...t)}return{changes:s,updatedInternals:l}}async function ro({delta:t,panZoom:e,transform:n,translateExtent:r,width:i,height:o}){if(!e||!t.x&&!t.y)return!1;let a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,o]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function ra(t,e,n,r,i,o){let a=i,u=r.get(a)||new Map;r.set(a,u.set(n,e)),a=`${i}-${t}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,e)),o){a=`${i}-${t}-${o}`;let u=r.get(a)||new Map;r.set(a,u.set(n,e))}}function ru(t,e,n){for(let r of(t.clear(),e.clear(),n)){let{source:n,target:i,sourceHandle:o=null,targetHandle:a=null}=r,u={edgeId:r.id,source:n,target:i,sourceHandle:o,targetHandle:a},l=`${n}-${o}--${i}-${a}`;ra("source",u,`${i}-${a}--${n}-${o}`,t,n,o),ra("target",u,l,t,i,a),e.set(r.id,r)}}function rl(t,e,n){let r=t;do{if(r?.matches?.(e))return!0;if(r===n)break;r=r?.parentElement}while(r);return!1}function rs({nodeId:t,dragItems:e,nodeLookup:n,dragging:r=!0}){let i=[];for(let[t,o]of e){let e=n.get(t)?.internals.userNode;e&&i.push({...e,position:o.position,dragging:r})}if(!t)return[i[0],i];let o=n.get(t)?.internals.userNode;return[o?{...o,position:e.get(t)?.position||o.position,dragging:r}:i[0],i]}function rc({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},a=0,u=new Map,l=!1,s={x:0,y:0},c=null,h=!1,d=null,p=!1,y=!1,m=null;return{update:function({noDragClassName:g,handleSelector:v,domNode:x,isSelectable:w,nodeId:_,nodeClickDistance:b=0}){function k({x:t,y:n}){let{nodeLookup:i,nodeExtent:a,snapGrid:l,snapToGrid:s,nodeOrigin:c,onNodeDrag:h,onSelectionDrag:f,onError:d,updateNodePositions:p}=e();o={x:t,y:n};let g=!1,v=u.size>1,x=v&&a?nl(e7(u)):null,w=v&&s?function({dragItems:t,snapGrid:e,x:n,y:r}){let i=t.values().next().value;if(!i)return null;let o={x:n-i.distance.x,y:r-i.distance.y},a=ng(o,e);return{x:a.x-o.x,y:a.y-o.y}}({dragItems:u,snapGrid:l,x:t,y:n}):null;for(let[e,r]of u){if(!i.has(e))continue;let o={x:t-r.distance.x,y:n-r.distance.y};s&&(o=w?{x:Math.round(o.x+w.x),y:Math.round(o.y+w.y)}:ng(o,l));let u=null;if(v&&a&&!r.extent&&x){let{positionAbsolute:t}=r.internals,e=t.x-x.x+a[0][0],n=t.x+r.measured.width-x.x2+a[1][0];u=[[e,t.y-x.y+a[0][1]],[n,t.y+r.measured.height-x.y2+a[1][1]]]}let{position:h,positionAbsolute:f}=nt({nodeId:e,nextPosition:o,nodeLookup:i,nodeExtent:u||a,nodeOrigin:c,onError:d});g=g||r.position.x!==h.x||r.position.y!==h.y,r.position=h,r.internals.positionAbsolute=f}if(y=y||g,g&&(p(u,!0),m&&(r||h||!_&&f))){let[t,e]=rs({nodeId:_,dragItems:u,nodeLookup:i});r?.(m,u,t,e),h?.(m,t,e),_||f?.(m,e)}}async function M(){if(!c)return;let{transform:t,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=e();if(!i){l=!1,cancelAnimationFrame(a);return}let[u,h]=na(s,c,r);(0!==u||0!==h)&&(o.x=(o.x??0)-u/t[2],o.y=(o.y??0)-h/t[2],await n({x:u,y:h})&&k(o)),a=requestAnimationFrame(M)}function A(r){let{nodeLookup:i,multiSelectionActive:a,nodesDraggable:l,transform:s,snapGrid:f,snapToGrid:d,selectNodesOnDrag:p,onNodeDragStart:y,onSelectionDragStart:m,unselectNodesAndEdges:g}=e();h=!0,p&&w||a||!_||i.get(_)?.selected||g(),w&&p&&_&&t?.(_);let v=nN(r.sourceEvent,{transform:s,snapGrid:f,snapToGrid:d,containerBounds:c});if(o=v,(u=function(t,e,n,r){let i=new Map;for(let[o,a]of t)if((a.selected||a.id===r)&&(!a.parentId||!function t(e,n){if(!e.parentId)return!1;let r=n.get(e.parentId);return!!r&&(!!r.selected||t(r,n))}(a,t))&&(a.draggable||e&&void 0===a.draggable)){let e=t.get(o);e&&i.set(o,{id:o,position:e.position||{x:0,y:0},distance:{x:n.x-e.internals.positionAbsolute.x,y:n.y-e.internals.positionAbsolute.y},extent:e.extent,parentId:e.parentId,origin:e.origin,expandParent:e.expandParent,internals:{positionAbsolute:e.internals.positionAbsolute||{x:0,y:0}},measured:{width:e.measured.width??0,height:e.measured.height??0}})}return i}(i,l,v,_)).size>0&&(n||y||!_&&m)){let[t,e]=rs({nodeId:_,dragItems:u,nodeLookup:i});n?.(r.sourceEvent,u,t,e),y?.(r.sourceEvent,t,e),_||m?.(r.sourceEvent,e)}}d=tn(x);let E=(function(){var t,e,n,r,i=tf,o=td,a=tp,u=ty,l={},s=f("start","drag","end"),c=0,h=0;function d(t){t.on("mousedown.drag",p).filter(u).on("touchstart.drag",g).on("touchmove.drag",v,ti).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,u){if(!r&&i.call(this,a,u)){var l=w(this,o.call(this,a,u),a,u,"mouse");l&&(tn(a.view).on("mousemove.drag",y,to).on("mouseup.drag",m,to),tl(a.view),ta(a),n=!1,t=a.clientX,e=a.clientY,l("start",a))}}function y(r){if(tu(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>h}l.mouse("drag",r)}function m(t){tn(t.view).on("mousemove.drag mouseup.drag",null),ts(t.view,n),tu(t),l.mouse("end",t)}function g(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,u=o.call(this,t,e),l=a.length;for(n=0;n<l;++n)(r=w(this,u,t,e,a[n].identifier,a[n]))&&(ta(t),r("start",t,a[n]))}}function v(t){var e,n,r=t.changedTouches,i=r.length;for(e=0;e<i;++e)(n=l[r[e].identifier])&&(tu(t),n("drag",t,r[e]))}function x(t){var e,n,i=t.changedTouches,o=i.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),e=0;e<o;++e)(n=l[i[e].identifier])&&(ta(t),n("end",t,i[e]))}function w(t,e,n,r,i,o){var u,h,f,p=s.copy(),y=tr(o||n,e);if(null!=(f=a.call(t,new th("beforestart",{sourceEvent:n,target:d,identifier:i,active:c,x:y[0],y:y[1],dx:0,dy:0,dispatch:p}),r)))return u=f.x-y[0]||0,h=f.y-y[1]||0,function n(o,a,s){var m,g=y;switch(o){case"start":l[i]=n,m=c++;break;case"end":delete l[i],--c;case"drag":y=tr(s||a,e),m=c}p.call(o,t,new th(o,{sourceEvent:a,subject:f,target:d,identifier:i,active:m,x:y[0]+u,y:y[1]+h,dx:y[0]-g[0],dy:y[1]-g[1],dispatch:p}),r)}}return d.filter=function(t){return arguments.length?(i="function"==typeof t?t:tc(!!t),d):i},d.container=function(t){return arguments.length?(o="function"==typeof t?t:tc(t),d):o},d.subject=function(t){return arguments.length?(a="function"==typeof t?t:tc(t),d):a},d.touchable=function(t){return arguments.length?(u="function"==typeof t?t:tc(!!t),d):u},d.on=function(){var t=s.on.apply(s,arguments);return t===s?d:t},d.clickDistance=function(t){return arguments.length?(h=(t*=1)*t,d):Math.sqrt(h)},d})().clickDistance(b).on("start",t=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:a,snapToGrid:u}=e();c=n?.getBoundingClientRect()||null,p=!1,y=!1,m=t.sourceEvent,0===r&&A(t),o=nN(t.sourceEvent,{transform:i,snapGrid:a,snapToGrid:u,containerBounds:c}),s=nj(t.sourceEvent,c)}).on("drag",t=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:a,nodeDragThreshold:f,nodeLookup:d}=e(),y=nN(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:c});if(m=t.sourceEvent,("touchmove"===t.sourceEvent.type&&t.sourceEvent.touches.length>1||_&&!d.has(_))&&(p=!0),!p){if(!l&&n&&h&&(l=!0,M()),!h){let e=nj(t.sourceEvent,c),n=e.x-s.x,r=e.y-s.y;Math.sqrt(n*n+r*r)>f&&A(t)}(o.x!==y.xSnapped||o.y!==y.ySnapped)&&u&&h&&(s=nj(t.sourceEvent,c),k(y))}}).on("end",t=>{if(!h||p){p&&u.size>0&&e().updateNodePositions(u,!1);return}if(l=!1,h=!1,cancelAnimationFrame(a),u.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:o,onSelectionDragStop:a}=e();if(y&&(r(u,!1),y=!1),i||o||!_&&a){let[e,r]=rs({nodeId:_,dragItems:u,nodeLookup:n,dragging:!1});i?.(t.sourceEvent,u,e,r),o?.(t.sourceEvent,e,r),_||a?.(t.sourceEvent,r)}}}).filter(t=>{let e=t.target;return!t.button&&(!g||!rl(e,`.${g}`,x))&&(!v||rl(e,v,x))});d.call(E)},destroy:function(){d?.on(".drag",null)}}}function rh(t,e,n,r,i,o=!1){let a=r.get(t);if(!a)return null;let u="strict"===i?a.internals.handleBounds?.[e]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?u?.find(t=>t.id===n):u?.[0])??null;return l&&o?{...l,...n1(a,l,l.position,!0)}:l}function rf(t,e){return t?t:e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null}let rd=()=>!0;function rp(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:a,doc:u,lib:l,flowId:s,isValidConnection:c=rd,nodeLookup:h}){let f="target"===a,d=e?u.querySelector(`.${l}-flow__handle[data-id="${s}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:p,y}=nj(t),m=u.elementFromPoint(p,y),g=m?.classList.contains(`${l}-flow__handle`)?m:d,v={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let t=rf(void 0,g),e=g.getAttribute("data-nodeid"),a=g.getAttribute("data-handleid"),u=g.classList.contains("connectable"),l=g.classList.contains("connectableend");if(!e||!t)return v;let s={source:f?e:r,sourceHandle:f?a:o,target:f?r:e,targetHandle:f?o:a};v.connection=s,v.isValid=u&&l&&(n===i.Strict?f&&"source"===t||!f&&"target"===t:e!==r||a!==o)&&c(s),v.toHandle=rh(e,t,a,h,n,!0)}return v}let ry={onPointerDown:function(t,{connectionMode:e,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:a,domNode:u,nodeLookup:l,lib:c,autoPanOnConnect:h,flowId:f,panBy:d,cancelConnection:p,onConnectStart:y,onConnect:m,onConnectEnd:g,isValidConnection:v=rd,onReconnectEnd:x,updateConnection:w,getTransform:_,getFromHandle:b,autoPanSpeed:k,dragThreshold:M=1,handleDomNode:A}){let E,z=nT(t.target),$=0,{x:S,y:N}=nj(t),P=rf(o,A),T=u?.getBoundingClientRect(),I=!1;if(!T||!P)return;let C=rh(i,P,r,l,e);if(!C)return;let H=nj(t,T),j=!1,L=null,O=!1,B=null,V={...C,nodeId:i,type:P,position:C.position},q=l.get(i),R={inProgress:!0,isValid:null,from:n1(q,V,s.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:q,to:H,toHandle:null,toPosition:e0[V.position],toNode:null,pointer:H};function D(){I=!0,w(R),y?.(t,{nodeId:i,handleId:r,handleType:P})}function X(t){var o,u;let p;if(!I){let{x:e,y:n}=nj(t),r=e-S,i=n-N;if(!(r*r+i*i>M*M))return;D()}if(!b()||!V)return void Y(t);let y=_();E=function(t,e,n,r){let i=[],o=1/0;for(let a of function(t,e,n){let r=[],i={x:t.x-n,y:t.y-n,width:2*n,height:2*n};for(let t of e.values())nd(i,nc(t))>0&&r.push(t);return r}(t,n,e+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:u,y:l}=n1(a,n,n.position,!0),s=Math.sqrt(Math.pow(u-t.x,2)+Math.pow(l-t.y,2));s>e||(s<o?(i=[{...n,x:u,y:l}],o=s):s===o&&i.push({...n,x:u,y:l}))}if(!i.length)return null;if(i.length>1){let t="source"===r.type?"target":"source";return i.find(e=>e.type===t)??i[0]}return i[0]}(nv(H=nj(t,T),y,!1,[1,1]),n,l,V),j||(!function t(){if(!h||!T)return;let[e,n]=na(H,T,k);d({x:e,y:n}),$=requestAnimationFrame(t)}(),j=!0);let m=rp(t,{handle:E,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:v,doc:z,lib:c,flowId:f,nodeLookup:l});B=m.handleDomNode,L=m.connection,o=!!E,u=m.isValid,p=null,u?p=!0:o&&!u&&(p=!1),O=p;let g=l.get(i),x=g?n1(g,V,s.Left,!0):R.from,A={...R,from:x,isValid:O,to:m.toHandle&&O?nx({x:m.toHandle.x,y:m.toHandle.y},y):H,toHandle:m.toHandle,toPosition:O&&m.toHandle?m.toHandle.position:e0[V.position],toNode:m.toHandle?l.get(m.toHandle.nodeId):null,pointer:H};w(A),R=A}function Y(t){if(!("touches"in t)||!(t.touches.length>0)){if(I){(E||B)&&L&&O&&m?.(L);let{inProgress:e,...n}=R,r={...n,toPosition:R.toHandle?R.toPosition:null};g?.(t,r),o&&x?.(t,r)}p(),cancelAnimationFrame($),j=!1,O=!1,L=null,B=null,z.removeEventListener("mousemove",X),z.removeEventListener("mouseup",Y),z.removeEventListener("touchmove",X),z.removeEventListener("touchend",Y)}}0===M&&D(),z.addEventListener("mousemove",X),z.addEventListener("mouseup",Y),z.addEventListener("touchmove",X),z.addEventListener("touchend",Y)},isValid:rp};function rm({domNode:t,panZoom:e,getTransform:n,getViewScale:r}){let i=tn(t);return{update:function({translateExtent:t,width:o,height:a,zoomStep:u=1,pannable:l=!0,zoomable:s=!0,inversePan:c=!1}){let h=[0,0],f=eW().on("start",t=>{("mousedown"===t.sourceEvent.type||"touchstart"===t.sourceEvent.type)&&(h=[t.sourceEvent.clientX??t.sourceEvent.touches[0].clientX,t.sourceEvent.clientY??t.sourceEvent.touches[0].clientY])}).on("zoom",l?i=>{let u=n();if("mousemove"!==i.sourceEvent.type&&"touchmove"!==i.sourceEvent.type||!e)return;let l=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],s=[l[0]-h[0],l[1]-h[1]];h=l;let f=r()*Math.max(u[2],Math.log(u[2]))*(c?-1:1),d={x:u[0]-s[0]*f,y:u[1]-s[1]*f};e.setViewportConstrained({x:d.x,y:d.y,zoom:u[2]},[[0,0],[o,a]],t)}:null).on("zoom.wheel",s?t=>{if("wheel"!==t.sourceEvent.type||!e)return;let r=n(),i=t.sourceEvent.ctrlKey&&nb()?10:1,o=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*u,a=r[2]*Math.pow(2,o*i);e.scaleTo(a)}:null);i.call(f,{})},destroy:function(){i.on("zoom",null)},pointer:tr}}let rg=t=>({x:t.x,y:t.y,zoom:t.k}),rv=({x:t,y:e,zoom:n})=>eL.translate(t,e).scale(n),rx=(t,e)=>t.target.closest(`.${e}`),rw=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),r_=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,rb=(t,e=0,n=r_,r=()=>{})=>{let i="number"==typeof e&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t},rk=t=>{let e=t.ctrlKey&&nb()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};function rM({domNode:t,minZoom:e,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:u,onPanZoomEnd:l,onDraggingChange:s}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=t.getBoundingClientRect(),f=eW().scaleExtent([e,n]).translateExtent(r),d=tn(t).call(f);v({x:i.x,y:i.y,zoom:nn(i.zoom,e,n)},[[0,0],[h.width,h.height]],r);let p=d.on("wheel.zoom"),y=d.on("dblclick.zoom");async function m(t,e){return!!d&&new Promise(n=>{f?.interpolate(e?.interpolate==="linear"?eK:tg).transform(rb(d,e?.duration,e?.ease,()=>n(!0)),t)})}function g(){f.on("zoom",null)}async function v(t,e,n){let r=rv(t),i=f?.constrain()(r,e,n);return i&&await m(i),i}return f.wheelDelta(rk),{update:function({noWheelClassName:t,noPanClassName:e,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:h,panOnScrollMode:m,panOnScrollSpeed:v,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:_,zoomOnDoubleClick:b,zoomActivationKeyPressed:k,lib:M,onTransformChange:A,connectionInProgress:E,paneClickDistance:z,selectionOnDrag:$}){r&&!c.isZoomingOrPanning&&g();let S=i&&!k&&!r;f.clickDistance($?1/0:!ny(z)||z<0?0:z);let N=S?function({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:u,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}){return h=>{if(rx(h,e))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(h.ctrlKey&&u){let t=tr(h),e=f*Math.pow(2,rk(h));r.scaleTo(n,e,t,h);return}let d=1===h.deltaMode?20:1,p=i===o.Vertical?0:h.deltaX*d,y=i===o.Horizontal?0:h.deltaY*d;!nb()&&h.shiftKey&&i!==o.Vertical&&(p=h.deltaY*d,y=0),r.translateBy(n,-(p/f)*a,-(y/f)*a,{internal:!0});let m=rg(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(s?.(h,m),t.panScrollTimeout=setTimeout(()=>{c?.(h,m),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,l?.(h,m))}}({zoomPanValues:c,noWheelClassName:t,d3Selection:d,d3Zoom:f,panOnScrollMode:m,panOnScrollSpeed:v,zoomOnPinch:w,onPanZoomStart:u,onPanZoom:a,onPanZoomEnd:l}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(r,i){let o="wheel"===r.type,a=!e&&o&&!r.ctrlKey,u=rx(r,t);if(r.ctrlKey&&o&&u&&r.preventDefault(),a||u)return null;r.preventDefault(),n.call(this,r,i)}}({noWheelClassName:t,preventScrolling:x,d3ZoomHandler:p});d.on("wheel.zoom",N,{passive:!1});let P=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=rg(r.transform);t.mouseButton=r.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=i,r.sourceEvent?.type==="mousedown"&&e(!0),n&&n?.(r.sourceEvent,i)}}({zoomPanValues:c,onDraggingChange:s,onPanZoomStart:u});f.on("start",P);let T=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{t.usedRightMouseButton=!!(n&&rw(e,t.mouseButton??0)),o.sourceEvent?.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!o.sourceEvent?.internal&&i?.(o.sourceEvent,rg(o.transform))}}({zoomPanValues:c,panOnDrag:h,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:A});f.on("zoom",T);let I=function({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return a=>{if(!a.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,o&&rw(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),t.usedRightMouseButton=!1,r(!1),i)){let e=rg(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i?.(a.sourceEvent,e)},150*!!n)}}}({zoomPanValues:c,panOnDrag:h,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:s});f.on("end",I);let C=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:u,noPanClassName:l,lib:s,connectionInProgress:c}){return h=>{let f=t||e,d=n&&h.ctrlKey,p="wheel"===h.type;if(1===h.button&&"mousedown"===h.type&&(rx(h,`${s}-flow__node`)||rx(h,`${s}-flow__edge`)))return!0;if(!r&&!f&&!i&&!o&&!n||a||c&&!p||rx(h,u)&&p||rx(h,l)&&(!p||i&&p&&!t)||!n&&h.ctrlKey&&p)return!1;if(!n&&"touchstart"===h.type&&h.touches?.length>1)return h.preventDefault(),!1;if(!f&&!i&&!d&&p||!r&&("mousedown"===h.type||"touchstart"===h.type)||Array.isArray(r)&&!r.includes(h.button)&&"mousedown"===h.type)return!1;let y=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||p)&&y}}({zoomActivationKeyPressed:k,panOnDrag:h,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:w,userSelectionActive:r,noPanClassName:e,noWheelClassName:t,lib:M,connectionInProgress:E});f.filter(C),b?d.on("dblclick.zoom",y):d.on("dblclick.zoom",null)},destroy:g,setViewport:async function t(t,e){let n=rv(t);return await m(n,e),n},setViewportConstrained:v,getViewport:function(){let t=d?eO(d.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:async function t(t,e){return!!d&&new Promise(n=>{f?.interpolate(e?.interpolate==="linear"?eK:tg).scaleTo(rb(d,e?.duration,e?.ease,()=>n(!0)),t)})},scaleBy:async function t(t,e){return!!d&&new Promise(n=>{f?.interpolate(e?.interpolate==="linear"?eK:tg).scaleBy(rb(d,e?.duration,e?.ease,()=>n(!0)),t)})},setScaleExtent:function(t){f?.scaleExtent(t)},setTranslateExtent:function(t){f?.translateExtent(t)},syncViewport:function(t){if(d){let e=rv(t),n=d.property("__zoom");(n.k!==t.zoom||n.x!==t.x||n.y!==t.y)&&f?.transform(d,e,null,{sync:!0})}},setClickDistance:function(t){let e=!ny(t)||t<0?0:t;f?.clickDistance(e)}}}!function(t){t.Line="line",t.Handle="handle"}(c||(c={}))},4455:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),!function(t,e){for(var n in e)Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}(e,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return u}});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(t){return t}}let i="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new r}function a(t){return i?i.bind(t):r.bind(t)}function u(){return i?i.snapshot():function(t,...e){return t(...e)}}},4727:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]])},4807:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},4850:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},4908:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},4970:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},5074:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},5106:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},5955:(t,e,n)=>{"use strict";n.d(e,{A:()=>function t(e){if("string"==typeof e||"number"==typeof e)return""+e;let n="";if(Array.isArray(e))for(let r=0,i;r<e.length;r++)""!==(i=t(e[r]))&&(n+=(n&&" ")+i);else for(let t in e)e[t]&&(n+=(n&&" ")+t);return n}})},6323:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(9398);let i=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((t,e,n)=>!!t&&""!==t.trim()&&n.indexOf(t)===e).join(" ").trim()};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((t,e)=>{let{color:n="currentColor",size:a=24,strokeWidth:u=2,absoluteStrokeWidth:l,className:s="",children:c,iconNode:h,...f}=t;return(0,r.createElement)("svg",{ref:e,...o,width:a,height:a,stroke:n,strokeWidth:l?24*Number(u)/Number(a):u,className:i("lucide",s),...f},[...h.map(t=>{let[e,n]=t;return(0,r.createElement)(e,n)}),...Array.isArray(c)?c:[c]])}),u=(t,e)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:u,...l}=n;return(0,r.createElement)(a,{ref:o,iconNode:e,className:i("lucide-".concat(t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),u),...l})});return n.displayName="".concat(t),n}},6337:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},6714:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},6888:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(1609)},6930:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Heading",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]])},7004:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},7308:(t,e,n)=>{"use strict";n.d(e,{default:()=>i.a});var r=n(3917),i=n.n(r)},7570:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},7603:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},7613:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]])},8053:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},8221:(t,e,n)=>{"use strict";function r(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[n,r]of t)if(!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}let n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}n.d(e,{x:()=>r})},8317:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},8725:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},9127:(t,e,n)=>{"use strict";function r(t){let{moduleIds:e}=t;return null}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(8886),n(8339),n(6888),n(5973)},9136:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},9170:()=>{},9234:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},9397:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}});let r=n(8886),i=n(9398),o=n(4186);function a(t){return{default:t&&"default"in t?t.default:t}}n(9127);let u={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},l=function(t){let e={...u,...t},n=(0,i.lazy)(()=>e.loader().then(a)),l=e.loading;function s(t){let a=l?(0,r.jsx)(l,{isLoading:!0,pastDelay:!0,error:null}):null,u=!e.ssr||!!e.loading,s=u?i.Suspense:i.Fragment,c=e.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...t})]}):(0,r.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...t})});return(0,r.jsx)(s,{...u?{fallback:a}:{},children:c})}return s.displayName="LoadableComponent",s}},9516:()=>{},9597:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},9756:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(6323).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33,124,191,241,517,556,673,761,769,822,843],{7422:()=>{}},_=>{_.O(0,[480,920,358],()=>_(_.s=7422)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{694:(e,t,n)=>{Promise.resolve().then(n.bind(n,9219))},9219:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ef});var s=n(8886),i=n(9398),r=n(7308);let a=[{id:"qa",label:"QA",command:"/speckit.review.qa",enabled:!0,model:"gemini-2.5-flash",description:"Automated quality assurance agent. Runs tests, verifies regression suite, and inspects validation logs.",systemPrompt:"You are the QA persona in a Spec-Driven Development cycle. Your goal is to run unit/integration tests and check that code changes do not break existing features. Output verification reports with a clear VERDICT: PASS or FAIL.",capabilities:["Runs Vitest/Jest test suites","Generates coverage reports","Checks edge cases in inputs","Identifies code regressions"],tools:["vitest","npm test","coverage-reporter","test-generator"]},{id:"code-review",label:"Code Review",command:"/speckit.review.code",enabled:!0,model:"gemini-2.5-pro",description:"Automated code standard and architectural reviewer. Validates SOLID patterns and code complexity.",systemPrompt:"You are the Code Reviewer persona. Analyze source code diffs for adherence to architectural standards, clean code practices (SOLID, DRY), and formatting. Output feedback with a final VERDICT: PASS or FAIL.",capabilities:["Analyzes design pattern compliance","Checks cyclomatic complexity","Identifies redundant code blocks","Ensures type safety"],tools:["eslint","typescript-compiler","complexity-analyzer","stylelint"]},{id:"security",label:"Security",command:"/speckit.review.security",enabled:!0,model:"claude-3-5-sonnet",description:"Automated security compliance agent. Scans for hardcoded credentials, dependency CVEs, and OWASP vulnerabilities.",systemPrompt:"You are the Security Auditor persona. Scan changes for exposed credentials, API keys, dependency vulnerabilities, injection flaws, and other OWASP Top 10 risks. Output a final VERDICT: PASS or FAIL.",capabilities:["Scans for exposed secrets","Identifies dependency CVEs","Detects injection vulnerabilities","Verifies authentication protocols"],tools:["git-secrets","npm audit","owasp-scanner","trivy"]},{id:"tech-lead",label:"Tech Lead",command:"/speckit.review.techlead",enabled:!0,model:"gemini-2.5-pro",description:"Tech Lead agent responsible for final signature sign-off. Aggregates reviews and signs the implementation gate.",systemPrompt:"You are the Tech Lead persona. You represent the final automated validation step. Aggregate findings from previous agents, confirm architecture completeness, and sign the gate. Output a final VERDICT: PASS or FAIL.",capabilities:["Aggregates reviews and signals","Confirms architecture patterns","Approves merge readiness","Performs final API signature verification"],tools:["git-merge-dryrun","dependency-checker","signature-verifier"]}];var c=n(7603),l=n(5106),o=n(2852),d=n(509),x=n(8053),p=n(3088),h=n(2084),u=n(3199),b=n(4850),m=n(1240),g=n(4908),f=n(8725);let z={developer:"Developer",qa:"QA","code-review":"Code",security:"Sec","tech-lead":"Lead"},v={developer:"Implements the features, writes source code, and completes specification tasks.",qa:"Runs unit tests, lint checks and validates coverage requirements.","code-review":"Analyzes code complexity, patterns, and style conventions.",security:"Inspects code for secret leaks, injection risks and path safety.","tech-lead":"Approves technical plan adherence and signs off execution."},k=e=>{switch(e){case"running":return"text-blue-500 bg-blue-500/10 border-blue-500/20 animate-pulse";case"passed":return"text-green-500 bg-green-500/10 border-green-500/20";case"failed":return"text-red-500 bg-red-500/10 border-red-500/20";default:return"text-zinc-400 bg-zinc-100 dark:bg-zinc-900 border-zinc-200 dark:border-zinc-800"}},j={specification:"Specification",clarification:"Clarification",planning:"Planning",checklist:"Checklist",analysis:"Analysis",tasks:"Tasks",taskstoissues:"Tasks to Issues",implementation:"Implementation",completed:"Completed"},N=e=>{let{state:t,onRunPhase:n,onApprovePhase:r,onDiscardPhase:a,onSelectFeature:N,onDeleteFeature:y,onSelectPhaseFile:w,onCardDrop:C,onRerunGate:A,onOpenReview:S,onStopPhase:P}=e,[T,O]=i.useState(null),[F,R]=i.useState(null),E=e=>{if("idle"===e.status)return"idle";if("running"===e.status){var t;return(null==(t=e.personas)?void 0:t.some(e=>"idle"!==e.status))?"passed":"running"}return"passed"},I=e=>{e.preventDefault()},L=()=>{O(null)},D=(e,t)=>{if(t)return(0,s.jsxs)("span",{className:"flex items-center gap-1 text-[10px] font-semibold text-red-500 bg-red-500/10 px-1.5 py-0.5 rounded border border-red-500/20",children:[(0,s.jsx)(c.A,{size:10}),"STALE"]});switch(e){case"running":return(0,s.jsx)("span",{className:"flex items-center gap-1 text-[10px] font-semibold text-blue-500 bg-blue-500/10 px-1.5 py-0.5 rounded border border-blue-500/20 animate-pulse",children:"RUNNING"});case"awaiting_review":return(0,s.jsx)("span",{className:"flex items-center gap-1 text-[10px] font-semibold text-amber-500 bg-amber-500/10 px-1.5 py-0.5 rounded border border-amber-500/20",children:"REVIEW"});case"approved":return(0,s.jsx)("span",{className:"flex items-center gap-1 text-[10px] font-semibold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded border border-green-500/20",children:"APPROVED"});default:return(0,s.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 bg-zinc-100 dark:bg-zinc-900 px-1.5 py-0.5 rounded border border-zinc-200 dark:border-zinc-800",children:"IDLE"})}};return(0,s.jsxs)("div",{className:"flex flex-col h-full bg-white dark:bg-black overflow-y-auto",children:[(0,s.jsxs)("div",{className:"mx-6 my-4 p-4 border border-zinc-200 dark:border-zinc-800 rounded-lg bg-zinc-50 dark:bg-zinc-950 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h2",{className:"text-sm font-bold text-zinc-900 dark:text-zinc-100",children:"Project Constitution"}),D(t.constitutionPhase.status,t.constitutionPhase.stale)]}),(0,s.jsx)("p",{className:"text-xs text-zinc-500 mt-1",children:"Governing principles and rules that guide all subsequent planning and implementation."})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>w(t.constitutionPhase.filePath),disabled:!t.constitutionPhase.filePath,className:"px-3 py-1.5 border border-zinc-200 dark:border-zinc-800 hover:bg-zinc-100 dark:hover:bg-zinc-900 rounded text-xs transition disabled:opacity-50",children:"View Constitution"}),"approved"!==t.constitutionPhase.status?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:()=>n("constitution",null),disabled:"running"===t.constitutionPhase.status,className:"flex items-center gap-1 px-3 py-1.5 bg-black dark:bg-white text-white dark:text-black rounded text-xs font-semibold hover:opacity-90 transition disabled:opacity-50",children:[(0,s.jsx)(l.A,{size:10,fill:"currentColor"})," Run"]}),"awaiting_review"===t.constitutionPhase.status&&(0,s.jsxs)("button",{onClick:()=>r("constitution",null),className:"flex items-center gap-1 px-3 py-1.5 bg-green-650 hover:bg-green-700 text-white rounded text-xs font-semibold transition",children:[(0,s.jsx)(o.A,{size:10})," Approve"]})]}):(0,s.jsxs)("button",{onClick:()=>a("constitution",null),className:"flex items-center gap-1 px-3 py-1.5 border border-zinc-200 dark:border-zinc-800 hover:bg-zinc-100 dark:hover:bg-zinc-900 rounded text-xs transition",children:[(0,s.jsx)(d.A,{size:10})," Discard"]})]})]}),(0,s.jsx)("div",{className:"flex-1 flex gap-4 px-6 pb-6 overflow-x-auto min-h-0",children:["specification","clarification","planning","checklist","analyze","tasks","taskstoissues","implementation","completed"].map(e=>{let c=t.features.filter(t=>(e=>{for(let t of e.phases)if("approved"!==t.status)return t.phase;return"completed"})(t)===e);return(0,s.jsxs)("div",{onDragOver:I,onDragEnter:t=>{t.preventDefault(),O(e)},onDragLeave:L,onDrop:t=>((e,t)=>{e.preventDefault(),O(null);let n=e.dataTransfer.getData("text/plain");n&&(null==C||C(n,t))})(t,e),className:"flex flex-col flex-shrink-0 w-72 h-full border rounded-lg overflow-hidden transition-all duration-200 ".concat(T===e?"border-dashed border-zinc-400 dark:border-zinc-500 bg-zinc-100/70 dark:bg-zinc-900/40 ring-1 ring-zinc-400 dark:ring-zinc-500":"border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-950/20"),children:[(0,s.jsxs)("div",{className:"flex justify-between items-center px-3.5 py-3 border-b border-zinc-200 dark:border-zinc-800 bg-zinc-100 dark:bg-zinc-950/70",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-zinc-500",children:j[e]}),(0,s.jsx)("span",{className:"text-xs text-zinc-400 bg-zinc-200 dark:bg-zinc-900 px-1.5 py-0.5 rounded-full font-semibold",children:c.length})]}),(0,s.jsx)("div",{className:"flex-1 p-3 overflow-y-auto space-y-3",style:{scrollbarWidth:"thin"},children:0===c.length?(0,s.jsx)("div",{className:"flex items-center justify-center h-24 border border-dashed border-zinc-200 dark:border-zinc-800 rounded bg-white dark:bg-black/10 text-xs text-zinc-400",children:"No features in this phase"}):c.map(c=>{let j=(e=>{let t=e.phases.find(e=>"tasks"===e.phase);if(!(null==t?void 0:t.content))return null;let n=[...t.content.matchAll(/^\s*(?:[-*]|\d+\.)\s+\[( |x|X)\]/gm)];return 0===n.length?null:{done:n.filter(e=>"x"===e[1].toLowerCase()).length,total:n.length}})(c),C="completed"===e?c.phases[c.phases.length-1]:c.phases.find(t=>t.phase===e),A=t.activeFeatureName===c.name;return(0,s.jsxs)("div",{draggable:!0,onDragStart:e=>((e,t)=>{e.dataTransfer.setData("text/plain",t),e.dataTransfer.effectAllowed="move"})(e,c.name),onClick:()=>N(c.name),className:"p-3.5 border rounded-lg bg-white dark:bg-black transition-all cursor-pointer group flex flex-col justify-between hover:shadow-sm active:scale-[0.98] ".concat(A?"border-black dark:border-white ring-1 ring-black dark:ring-white shadow-sm":"border-zinc-200 dark:border-zinc-850 hover:border-zinc-350 dark:hover:border-zinc-700"),children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-start gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-zinc-850 dark:text-zinc-100 truncate group-hover:text-black dark:group-hover:text-white",children:c.name}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),y(c.name)},className:"text-zinc-400 hover:text-red-500 p-0.5 hover:bg-zinc-100 dark:hover:bg-zinc-900 rounded opacity-0 group-hover:opacity-100 transition",children:(0,s.jsx)(x.A,{size:12})})]}),"completed"!==e&&(0,s.jsxs)("div",{className:"flex justify-between items-center mt-3",children:[D(C.status,C.stale),j&&(0,s.jsxs)("span",{className:"text-[10px] font-mono text-zinc-400 bg-zinc-100 dark:bg-zinc-900 px-1 py-0.5 rounded",children:[j.done,"/",j.total," Tasks"]})]}),("implementation"===e||"completed"===e)&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(0,s.jsx)(p.A,{size:11,className:"text-zinc-400"}),(0,s.jsx)("span",{title:"developer: ".concat(E(C)),className:"text-[9px] font-semibold px-1.5 py-0.5 rounded border ".concat(k(E(C))),children:"Dev"}),C.personas&&C.personas.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.A,{size:9,className:"text-zinc-300 dark:text-zinc-700"}),C.personas.map((e,t)=>(0,s.jsxs)(i.Fragment,{children:[t>0&&(0,s.jsx)(h.A,{size:9,className:"text-zinc-300 dark:text-zinc-700"}),(0,s.jsx)("span",{title:"".concat(e.id,": ").concat(e.status),className:"text-[9px] font-semibold px-1.5 py-0.5 rounded border ".concat(k(e.status)),children:z[e.id]||e.id})]},e.id))]})]}),(0,s.jsxs)("button",{onClick:e=>{e.stopPropagation(),R(F===c.name?null:c.name)},className:"w-full text-[10px] flex items-center justify-between text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 mt-2 px-2 py-1 rounded border border-zinc-200 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-950/30 hover:bg-zinc-100 dark:hover:bg-zinc-900 transition",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(p.A,{size:11,className:"text-zinc-400"}),(0,s.jsx)("span",{className:"font-semibold",children:"Review Gate Dashboard"})]}),F===c.name?(0,s.jsx)(u.A,{size:11}):(0,s.jsx)(b.A,{size:11})]}),F===c.name&&(0,s.jsxs)("div",{className:"mt-2.5 p-2.5 rounded-md border border-zinc-150 dark:border-zinc-850 bg-zinc-50/20 dark:bg-zinc-950/20 space-y-2.5",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("div",{className:"space-y-2",children:["developer","qa","code-review","security","tech-lead"].map(e=>{let t="idle",i=null,r="";if("developer"===e)t=E(C),i=C.filePath,r="Developer";else{var a;let n=(null==(a=C.personas)?void 0:a.find(t=>t.id===e))||{id:e,status:"idle",reportPath:null};t=n.status,i=n.reportPath,r="qa"===e?"QA Agent":"code-review"===e?"Code Reviewer":"security"===e?"Security Auditor":"Tech Lead"}return(0,s.jsx)("div",{className:"p-2 rounded-md border transition flex flex-col gap-1.5 ".concat("passed"===t?"bg-green-500/5 border-green-500/20 dark:border-green-500/10":"failed"===t?"bg-red-500/5 border-red-500/20 dark:border-red-500/10":"running"===t?"bg-blue-500/5 border-blue-500/20 dark:border-blue-500/10 animate-pulse":"bg-white dark:bg-black border-zinc-200 dark:border-zinc-850"),children:(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-[10px] font-bold text-zinc-700 dark:text-zinc-300",children:r}),(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full ".concat("passed"===t?"bg-green-500":"failed"===t?"bg-red-500":"running"===t?"bg-blue-500 animate-ping":"bg-zinc-300 dark:bg-zinc-700")})]}),(0,s.jsx)("p",{className:"text-[9px] text-zinc-400 dark:text-zinc-500 mt-0.5 leading-normal",children:v[e]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:["developer"===e&&"idle"===t&&(0,s.jsxs)("button",{onClick:()=>n("implementation",c.name),className:"text-[9px] font-semibold text-white bg-black dark:bg-white dark:text-black px-1.5 py-0.5 rounded transition hover:opacity-90 flex items-center gap-1 shrink-0",children:[(0,s.jsx)(l.A,{size:8,fill:"currentColor"})," Code"]}),"running"===t&&(0,s.jsxs)("button",{onClick:()=>null==P?void 0:P("implementation",c.name),className:"text-[9px] font-semibold text-white bg-red-650 hover:bg-red-700 px-1.5 py-0.5 rounded transition flex items-center gap-1 shrink-0",title:"Stop execution of this agent persona",children:[(0,s.jsx)(m.A,{size:8})," Stop"]}),i?(0,s.jsx)("button",{onClick:()=>w(i),className:"text-[9px] font-semibold text-blue-500 dark:text-blue-400 hover:underline px-1.5 py-0.5 border border-blue-500/10 hover:border-blue-500/20 bg-blue-500/5 rounded transition shrink-0",children:"Report"}):"developer"!==e&&"running"!==t&&(0,s.jsx)("span",{className:"text-[9px] text-zinc-400 italic shrink-0",children:"No report"})]})]})},e)})}),(e=>"passed"===E(e)&&(!e.personas||e.personas.every(e=>"idle"===e.status)))(C)&&(0,s.jsxs)("div",{className:"p-2 border border-blue-500/20 bg-blue-500/5 text-blue-500 dark:text-blue-400 rounded-md text-[9px] leading-normal flex items-start gap-1",children:[(0,s.jsx)(g.A,{size:11,className:"mt-0.5 shrink-0"}),(0,s.jsxs)("span",{children:["Developer finished coding. Trigger the ",(0,s.jsx)("strong",{children:"Review Gate"})," to verify implementation."]})]})]})]})]}),(0,s.jsxs)("div",{className:"mt-4 pt-3 border-t border-zinc-100 dark:border-zinc-900 flex justify-end items-center gap-1.5",children:[(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),w(C.filePath)},disabled:!C.filePath,className:"mr-auto text-[10px] hover:underline text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-0",children:"Open File"}),"completed"!==e?"approved"!==C.status?(0,s.jsxs)(s.Fragment,{children:["running"===C.status?(0,s.jsxs)("button",{onClick:t=>{t.stopPropagation(),null==P||P(e,c.name)},className:"flex items-center gap-0.5 p-1 px-2 bg-red-650 hover:bg-red-700 text-white text-[10px] font-semibold rounded transition",children:[(0,s.jsx)(m.A,{size:8})," Stop"]}):(0,s.jsxs)("button",{onClick:t=>{t.stopPropagation(),n(e,c.name)},className:"flex items-center gap-0.5 p-1 px-2 border border-zinc-200 dark:border-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-900 text-[10px] font-semibold rounded transition",children:[(0,s.jsx)(l.A,{size:8,fill:"currentColor"})," Run"]}),"implementation"===e&&(0,s.jsxs)("button",{onClick:e=>{e.stopPropagation(),S(c.name,C)},disabled:"running"===C.status,title:"Open the human developer audit portal",className:"flex items-center gap-0.5 p-1 px-2 border border-zinc-200 dark:border-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-900 text-[10px] font-semibold rounded transition disabled:opacity-50",children:[(0,s.jsx)(p.A,{size:8})," Review"]}),"awaiting_review"===C.status&&(0,s.jsxs)("button",{onClick:t=>{t.stopPropagation(),r(e,c.name)},className:"flex items-center gap-0.5 p-1 px-2 bg-green-500 hover:bg-green-600 text-white text-[10px] font-semibold rounded transition",children:[(0,s.jsx)(o.A,{size:8})," Approve"]})]}):(0,s.jsxs)("button",{onClick:t=>{t.stopPropagation(),a(e,c.name)},className:"flex items-center gap-0.5 p-1 px-2 border border-zinc-200 dark:border-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-900 text-[10px] font-semibold rounded text-zinc-500 hover:text-zinc-700 transition",children:[(0,s.jsx)(d.A,{size:8})," Reset"]}):(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-green-500 font-bold text-[10px] uppercase",children:[(0,s.jsx)(f.A,{size:10})," Complete"]})]})]},c.name)})})]},e)})})]})};var y=n(5014),w=n(4201);n(9516);var C=n(7570);let A={idle:"#71717a",running:"#3b82f6",awaiting_review:"#f59e0b",approved:"#10b981"},S={idle:"Idle",running:"Running",awaiting_review:"Review",approved:"Approved"},P={constitution:"Constitution",specification:"Spec",clarification:"Clarify",planning:"Plan",checklist:"Checklist",analyze:"Analysis",tasks:"Tasks",taskstoissues:"Issues",implementation:"Implementation"},T={constitution:e=>{let{data:t}=e,n=A[t.status],i="running"===t.status;return(0,s.jsxs)("div",{className:"bg-white dark:bg-black rounded-lg border px-3 py-2 text-center select-none shadow-sm min-w-[150px] transition-all",style:{borderColor:t.stale?"#ef4444":n,borderStyle:t.stale?"dashed":"solid",borderWidth:"2px"},children:[(0,s.jsx)("div",{className:"text-xs font-bold text-zinc-950 dark:text-zinc-50 tracking-wide mb-1",children:"Constitution"}),(0,s.jsx)("div",{className:"flex items-center justify-center gap-1 text-[10px] font-semibold",style:{color:n,animation:i?"pulse 1.2s ease-in-out infinite":"none"},children:(0,s.jsx)("span",{children:S[t.status]})}),t.filePath&&(0,s.jsxs)("button",{onClick:e=>{var n;e.stopPropagation(),null==(n=t.onOpenFile)||n.call(t,t.filePath)},className:"mt-2 flex items-center justify-center gap-1 mx-auto text-[9px] font-medium text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 transition",children:[(0,s.jsx)(C.A,{size:10})," Open File"]}),(0,s.jsx)(y.h7,{type:"source",position:w.yX.Bottom,id:"bottom",className:"w-2 h-2 bg-zinc-400 dark:bg-zinc-650 border-0"})]})},phase:e=>{let{data:t}=e,n=A[t.status],i="running"===t.status;return(0,s.jsxs)("div",{className:"bg-white dark:bg-black rounded-lg border px-3 py-2 select-none shadow-sm min-w-[140px] transition-all ".concat(t.isActive?"border-black dark:border-white ring-1 ring-black dark:ring-white":""),style:{borderColor:t.stale?"#ef4444":n,borderStyle:t.stale?"dashed":"solid",borderWidth:t.isActive?"2px":"1.5px"},children:[t.isFirst&&(0,s.jsx)(y.h7,{type:"target",position:w.yX.Top,id:"top",className:"w-2 h-2 bg-zinc-400 dark:bg-zinc-650 border-0"}),!t.isFirst&&(0,s.jsx)(y.h7,{type:"target",position:w.yX.Left,id:"left",className:"w-2 h-2 bg-zinc-400 dark:bg-zinc-650 border-0"}),(0,s.jsx)("div",{className:"text-xs font-bold text-zinc-950 dark:text-zinc-50 mb-1",children:t.label}),(0,s.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-semibold",style:{color:n,animation:i?"pulse 1.2s ease-in-out infinite":"none"},children:[(0,s.jsx)("span",{children:S[t.status]}),t.stale&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-red-500 text-[8px] font-bold",children:[(0,s.jsx)(c.A,{size:8})," STALE"]})]}),t.taskProgress&&t.taskProgress.total>0&&(0,s.jsxs)("div",{className:"mt-2 space-y-1",children:["implementation"===t.phase&&(0,s.jsx)("div",{className:"h-1 bg-zinc-100 dark:bg-zinc-900 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full transition-all duration-300",style:{width:"".concat(Math.round(t.taskProgress.done/t.taskProgress.total*100),"%"),backgroundColor:t.taskProgress.done===t.taskProgress.total?"#10b981":"#3b82f6"}})}),(0,s.jsx)("div",{className:"text-[9px] text-zinc-400 dark:text-zinc-500 font-mono",children:"implementation"===t.phase?"".concat(t.taskProgress.done,"/").concat(t.taskProgress.total," tasks"):"".concat(t.taskProgress.total," task").concat(1!==t.taskProgress.total?"s":"")})]}),t.filePath&&(0,s.jsxs)("button",{onClick:e=>{var n;e.stopPropagation(),null==(n=t.onOpenFile)||n.call(t,t.filePath)},className:"mt-2 flex items-center gap-1 text-[9px] font-medium text-zinc-500 hover:text-zinc-850 dark:hover:text-zinc-200 transition",children:[(0,s.jsx)(C.A,{size:10})," Open File"]}),!t.isLast&&(0,s.jsx)(y.h7,{type:"source",position:w.yX.Right,id:"right",className:"w-2 h-2 bg-zinc-400 dark:bg-zinc-650 border-0"})]})}},O=e=>{let{state:t,onSelectFeature:n,onSelectPhaseFile:r}=e,{nodes:a,edges:c}=(0,i.useMemo)(()=>{var e,n;let s=[],i=[],a=t.features.find(e=>e.name===t.activeFeatureName),c="approved"===t.constitutionPhase.status?null!=(e=null==a?void 0:a.phases.find(e=>"approved"!==e.status))?e:null:t.constitutionPhase;return s.push({id:"constitution",type:"constitution",position:{x:735,y:15},data:{status:t.constitutionPhase.status,stale:null!=(n=t.constitutionPhase.stale)&&n,filePath:t.constitutionPhase.filePath,onOpenFile:r},style:{width:160}}),t.features.forEach((e,n)=>{let a=175+130*n,l=e.phases.find(e=>"tasks"===e.phase),o=null;if(null==l?void 0:l.content){let e=[...l.content.matchAll(/^\s*(?:[-*]|\d+\.)\s+\[( |x|X)\]/gm)];e.length>0&&(o={done:e.filter(e=>"x"===e[1].toLowerCase()).length,total:e.length})}e.phases.forEach((n,l)=>{var d;let x="".concat(e.name,"::").concat(n.phase),p=0===l,h=l===e.phases.length-1,u=(null==c?void 0:c.phase)===n.phase&&e.name===t.activeFeatureName,b="tasks"===n.phase||"implementation"===n.phase;s.push({id:x,type:"phase",position:{x:210*l,y:a},data:{label:P[n.phase],phase:n.phase,status:n.status,stale:null!=(d=n.stale)&&d,filePath:n.filePath,featureName:e.name,isFirst:p,isLast:h,isActive:u,taskProgress:b?o:null,onOpenFile:r},style:{width:160}});let m={stroke:A[n.status]||"#71717a",strokeWidth:"approved"===n.status?2:1.5,strokeDasharray:"awaiting_review"===n.status?"5 3":void 0},g="running"===n.status||"awaiting_review"===n.status;if(p&&i.push({id:"constitution--\x3e".concat(x),source:"constitution",sourceHandle:"bottom",target:x,targetHandle:"top",type:"smoothstep",animated:g,style:m}),!p){let t="".concat(e.name,"::").concat(e.phases[l-1].phase);i.push({id:"".concat(t,"--\x3e").concat(x),source:t,sourceHandle:"right",target:x,targetHandle:"left",type:"smoothstep",animated:g,style:m})}}),s.push({id:"".concat(e.name,"::label"),type:"default",position:{x:-140,y:a+37.5-10},data:{label:e.name},style:{background:"transparent",border:"none",fontSize:"11px",color:"#888",fontWeight:600,width:120,textAlign:"right",boxShadow:"none",pointerEvents:"none"},selectable:!1,draggable:!1})}),{nodes:s,edges:i}},[t,r]);return(0,s.jsx)("div",{className:"w-full h-full bg-zinc-50 dark:bg-black",children:(0,s.jsxs)(y.Gc,{nodes:a,edges:c,nodeTypes:T,onNodeClick:(e,t)=>{t.id.includes("::")&&n(t.id.split("::")[0])},fitView:!0,minZoom:.5,maxZoom:1.5,children:[(0,s.jsx)(y.VS,{gap:16,size:1,color:"#e4e4e7",className:"dark:opacity-10"}),(0,s.jsx)(y.H2,{showInteractive:!1,className:"border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 rounded shadow-md"})]})})};var F=n(3383),R=n(3353),E=n(4172),I=n(8317),L=n(47),D=n(1269),W=n(4727),G=n(496),J=n(6930),M=n(4140),q=n(7613),V=n(2768),H=n(6337);let _=[{phase:"constitution",label:"Constitution",file:"constitution.md",defaultPath:()=>".specify/memory/constitution.md"},{phase:"specification",label:"Spec",file:"spec.md",defaultPath:e=>"specs/".concat(e,"/spec.md")},{phase:"clarification",label:"Clarification",file:"clarification.md",defaultPath:e=>"specs/".concat(e,"/clarification.md")},{phase:"planning",label:"Planning",file:"plan.md",defaultPath:e=>"specs/".concat(e,"/plan.md")},{phase:"checklist",label:"Checklist",file:"checklist.md",defaultPath:e=>"specs/".concat(e,"/checklist.md")},{phase:"analyze",label:"Analysis",file:"analysis.md",defaultPath:e=>"specs/".concat(e,"/analysis.md")},{phase:"tasks",label:"Tasks",file:"tasks.md",defaultPath:e=>"specs/".concat(e,"/tasks.md")}],U=e=>{let{filePath:t,initialContent:n,onSave:r,onToggleTask:a,state:c,isMaximized:l=!1,onToggleMaximize:o,onSelectFile:d}=e,[x,p]=(0,i.useState)(""),[h,u]=(0,i.useState)("split"),[b,m]=(0,i.useState)(!1),[g,f]=(0,i.useState)(!1),z=(0,i.useRef)(null),v=(0,i.useRef)(null),k=e=>{let t=v.current;if(!t)return;let n=t.selectionStart,s=t.selectionEnd,i=t.value,r=i.substring(n,s),a="",c=0,l=0;switch(e){case"bold":a="**".concat(r||"bold text","**"),c=2,l=a.length-2;break;case"italic":a="*".concat(r||"italic text","*"),c=1,l=a.length-1;break;case"heading":let o=0===n||"\n"===i.charAt(n-1);a="".concat(o?"":"\n","### ").concat(r||"Heading"),c=o?4:5,l=a.length;break;case"link":a="[".concat(r||"link text","](https://example.com)"),c=1,l=(r||"link text").length+1;break;case"code":a="\n```\n".concat(r||"code here","\n```\n"),c=5,l=a.length-5;break;case"table":c=2,l=(a="\n| Header 1 | Header 2 |\n| -------- | -------- |\n| Cell 1 | Cell 2 |\n").length-1;break;case"checkbox":let d=0===n||"\n"===i.charAt(n-1);a="".concat(d?"":"\n","- [ ] ").concat(r||"New Task"),c=d?6:7,l=a.length}p(i.substring(0,n)+a+i.substring(s)),setTimeout(()=>{t.focus(),t.setSelectionRange(n+c,n+l)},50)};(0,i.useEffect)(()=>{n!==z.current&&(n===x?f(!1):x===z.current||null===z.current?(p(n||""),f(!1)):f(!0),z.current=n)},[n,x]);let j=async()=>{if(t){m(!0);try{await r(x)}finally{m(!1)}}},N=e=>{let t=[],n=e,i=0;for(;n.length>0;){let e=n.match(/^([^\*]*)\*\*([^\*]+)\*\*(.*)/),r=n.match(/^([^`]*)`([^`]+)`(.*)/);if(r&&(!e||r[1].length<e[1].length))r[1]&&t.push((0,s.jsx)("span",{children:r[1]},i++)),t.push((0,s.jsx)("code",{className:"px-1 py-0.5 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded font-mono text-xs text-red-500 dark:text-red-400",children:r[2]},i++)),n=r[3];else if(e)e[1]&&t.push((0,s.jsx)("span",{children:e[1]},i++)),t.push((0,s.jsx)("strong",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:e[2]},i++)),n=e[3];else{t.push((0,s.jsx)("span",{children:n},i++));break}}return t.length>0?t:[e]};return(0,s.jsxs)("div",{className:"flex flex-col h-full border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-black rounded-lg overflow-hidden",children:[c&&d&&(0,s.jsx)("div",{className:"flex items-center border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-950/30 overflow-x-auto scrollbar-none shrink-0",children:_.map(e=>{let n=(e=>{if("constitution"===e.phase){var t;return(null==c||null==(t=c.constitutionPhase)?void 0:t.filePath)||".specify/memory/constitution.md"}if(!(null==c?void 0:c.activeFeatureName))return null;let n=c.features.find(e=>e.name===c.activeFeatureName),s=null==n?void 0:n.phases.find(t=>t.phase===e.phase);return(null==s?void 0:s.filePath)||e.defaultPath(c.activeFeatureName)})(e),i="constitution"!==e.phase&&!(null==c?void 0:c.activeFeatureName),r=(e=>{if("constitution"===e){var t;return(null==c||null==(t=c.constitutionPhase)?void 0:t.status)||"idle"}if(!(null==c?void 0:c.activeFeatureName))return"idle";let n=c.features.find(e=>e.name===c.activeFeatureName),s=null==n?void 0:n.phases.find(t=>t.phase===e);return(null==s?void 0:s.status)||"idle"})(e.phase),a=!i&&n&&t&&(n.replace(/\\/g,"/").toLowerCase()===t.replace(/\\/g,"/").toLowerCase()||t.replace(/\\/g,"/").toLowerCase().endsWith(n.replace(/\\/g,"/").toLowerCase())||n.replace(/\\/g,"/").toLowerCase().endsWith(t.replace(/\\/g,"/").toLowerCase())),l="bg-zinc-300 dark:bg-zinc-700";return"approved"===r&&(l="bg-emerald-500"),"awaiting_review"===r&&(l="bg-amber-500"),"running"===r&&(l="bg-blue-500 animate-pulse"),(0,s.jsxs)("button",{disabled:i,onClick:()=>n&&d(n),className:"flex items-center gap-2 px-4 py-2.5 text-xs font-medium border-b-2 transition shrink-0 ".concat(i?"text-zinc-300 dark:text-zinc-800 cursor-not-allowed border-transparent":a?"text-black dark:text-white border-black dark:border-white bg-white dark:bg-zinc-900/50":"text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-300 border-transparent hover:bg-zinc-100/30 dark:hover:bg-zinc-900/30"),children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full ".concat(l)}),(0,s.jsx)("span",{children:e.label})]},e.phase)})}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center px-4 py-2.5 border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-950/50 shrink-0",children:[(0,s.jsx)("span",{className:"text-xs font-mono text-zinc-500 truncate max-w-[200px] sm:max-w-md",children:t.split("/").pop()}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded p-0.5",children:[(0,s.jsxs)("button",{onClick:()=>u("edit"),className:"p-1.5 rounded transition text-xs flex items-center gap-1 ".concat("edit"===h?"bg-white dark:bg-zinc-800 text-zinc-850 dark:text-zinc-50 shadow-sm":"text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[(0,s.jsx)(F.A,{size:12}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:()=>u("preview"),className:"p-1.5 rounded transition text-xs flex items-center gap-1 ".concat("preview"===h?"bg-white dark:bg-zinc-800 text-zinc-850 dark:text-zinc-50 shadow-sm":"text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[(0,s.jsx)(R.A,{size:12}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Preview"})]}),(0,s.jsxs)("button",{onClick:()=>u("split"),className:"p-1.5 rounded transition text-xs flex items-center gap-1 ".concat("split"===h?"bg-white dark:bg-zinc-800 text-zinc-850 dark:text-zinc-50 shadow-sm":"text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[(0,s.jsx)(E.A,{size:12}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Split"})]})]}),(0,s.jsxs)("button",{onClick:j,disabled:b,className:"flex items-center gap-1 px-3 py-1.5 bg-black dark:bg-white text-white dark:text-black rounded text-xs font-medium hover:bg-zinc-800 dark:hover:bg-zinc-100 transition disabled:opacity-50",children:[(0,s.jsx)(I.A,{size:12}),(0,s.jsx)("span",{children:b?"Saving...":"Save"})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"w-px h-5 bg-zinc-200 dark:bg-zinc-800 mx-1"}),(0,s.jsx)("button",{onClick:o,className:"p-1.5 rounded text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-900 transition",title:l?"Restore Layout":"Maximize Editor",children:l?(0,s.jsx)(L.A,{size:12}):(0,s.jsx)(D.A,{size:12})})]})]})]}),("edit"===h||"split"===h)&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 px-4 py-1.5 border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50/35 dark:bg-zinc-950/20 overflow-x-auto scrollbar-none shrink-0",children:[(0,s.jsx)("button",{onClick:()=>k("bold"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Bold",children:(0,s.jsx)(W.A,{size:13})}),(0,s.jsx)("button",{onClick:()=>k("italic"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Italic",children:(0,s.jsx)(G.A,{size:13})}),(0,s.jsx)("button",{onClick:()=>k("heading"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Heading",children:(0,s.jsx)(J.A,{size:13})}),(0,s.jsx)("div",{className:"w-px h-4 bg-zinc-200 dark:bg-zinc-800 mx-1"}),(0,s.jsx)("button",{onClick:()=>k("link"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Insert Link",children:(0,s.jsx)(M.A,{size:13})}),(0,s.jsx)("button",{onClick:()=>k("code"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-650 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Insert Code Block",children:(0,s.jsx)(q.A,{size:13})}),(0,s.jsx)("button",{onClick:()=>k("table"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-650 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Insert Table",children:(0,s.jsx)(V.A,{size:13})}),(0,s.jsx)("button",{onClick:()=>k("checkbox"),className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-650 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 transition",title:"Add Task",children:(0,s.jsx)(H.A,{size:13})})]}),g&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-amber-50 dark:bg-amber-950/20 border-b border-amber-200 dark:border-amber-900/50 text-xs text-amber-800 dark:text-amber-300 transition-all shrink-0",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5 font-medium",children:(0,s.jsx)("span",{children:"⚠️ External changes detected. The file on disk has been modified."})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>{p(n||""),f(!1)},className:"px-2 py-1 bg-amber-600 dark:bg-amber-700 text-white rounded hover:bg-amber-700 dark:hover:bg-amber-600 transition font-semibold",children:"Reload from disk"}),(0,s.jsx)("button",{onClick:()=>{f(!1)},className:"px-2 py-1 bg-zinc-200 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 rounded hover:bg-zinc-300 dark:hover:bg-zinc-750 transition font-semibold",children:"Keep my changes"})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[("edit"===h||"split"===h)&&(0,s.jsx)("textarea",{ref:v,value:x,onChange:e=>p(e.target.value),className:"flex-1 p-4 bg-transparent resize-none border-0 outline-none focus:ring-0 text-zinc-800 dark:text-zinc-100 font-mono text-xs leading-relaxed ".concat("split"===h?"border-r border-zinc-200 dark:border-zinc-800":""),placeholder:"Write markdown here..."}),("preview"===h||"split"===h)&&(0,s.jsx)("div",{className:"flex-1 p-5 overflow-y-auto bg-transparent prose dark:prose-invert max-w-none",children:(()=>{if(!x)return(0,s.jsx)("p",{className:"text-zinc-400 italic text-sm",children:"No content to display."});let e=x.split("\n"),t=!1,n=[],r=[];for(let c=0;c<e.length;c++){let l=e[c];if(l.trim().startsWith("```")){t?(t=!1,r.push((0,s.jsx)("pre",{className:"p-3 bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded font-mono text-xs overflow-x-auto text-zinc-800 dark:text-zinc-200 my-3",children:(0,s.jsx)("code",{children:n.join("\n")})},"code-".concat(c))),n=[]):t=!0;continue}if(t){n.push(l);continue}if(l.trim().startsWith("|")&&c+1<e.length&&e[c+1].trim().match(/^\|?\s*(:?-+:?\s*\|?)+$/)){let t=l.split("|").map(e=>e.trim()).filter((e,t,n)=>(0!==t||""!==e)&&(t!==n.length-1||""!==e)),n=[],i=c;for(c+=2;c<e.length&&e[c].trim().startsWith("|");){let t=e[c].split("|").map(e=>e.trim()).filter((e,t,n)=>(0!==t||""!==e)&&(t!==n.length-1||""!==e));n.push(t),c++}c--,r.push((0,s.jsx)("div",{className:"overflow-x-auto my-4",children:(0,s.jsxs)("table",{className:"min-w-full border-collapse border border-zinc-200 dark:border-zinc-800 text-sm",children:[(0,s.jsx)("thead",{className:"bg-zinc-50 dark:bg-zinc-900/50",children:(0,s.jsx)("tr",{children:t.map((e,t)=>(0,s.jsx)("th",{className:"border border-zinc-200 dark:border-zinc-800 px-4 py-2 text-left font-bold text-zinc-900 dark:text-zinc-100",children:N(e)},t))})}),(0,s.jsx)("tbody",{children:n.map((e,t)=>(0,s.jsx)("tr",{className:"hover:bg-zinc-50/50 dark:hover:bg-zinc-900/10 odd:bg-zinc-50/10 dark:odd:bg-zinc-950/10",children:e.map((e,t)=>(0,s.jsx)("td",{className:"border border-zinc-200 dark:border-zinc-800 px-4 py-2 text-zinc-700 dark:text-zinc-350",children:N(e)},t))},t))})]})},"table-".concat(i)));continue}let o=l.match(/^(\s*(?:[-*]|\d+\.)\s+\[)( |x|X)(\])(.*)/);if(o){let e="x"===o[2].toLowerCase(),t=o[4],n=l.search(/\S/);r.push((0,s.jsxs)("div",{className:"flex items-start gap-2.5 py-1",style:{paddingLeft:"".concat(12*n,"px")},children:[(0,s.jsx)("input",{type:"checkbox",checked:e,onChange:e=>null==a?void 0:a(c,e.target.checked),className:"mt-1 w-4 h-4 rounded border-zinc-300 dark:border-zinc-700 bg-transparent text-black dark:text-white focus:ring-0 cursor-pointer"}),(0,s.jsx)("span",{className:"text-sm leading-relaxed ".concat(e?"line-through text-zinc-400 dark:text-zinc-500":"text-zinc-800 dark:text-zinc-200"),children:N(t)})]},c));continue}let d=l.match(/^(#{1,6})\s+(.*)/);if(d){let e=d[1].length,t=d[2],n=["","text-2xl font-bold border-b border-zinc-200 dark:border-zinc-850 pb-1 mt-6 mb-3 text-zinc-900 dark:text-zinc-100","text-xl font-bold mt-5 mb-2.5 text-zinc-900 dark:text-zinc-100","text-lg font-semibold mt-4 mb-2 text-zinc-800 dark:text-zinc-200","text-base font-semibold mt-3 mb-2 text-zinc-800 dark:text-zinc-200","text-sm font-semibold mt-2.5 mb-1.5 text-zinc-850 dark:text-zinc-250","text-xs font-semibold mt-2 mb-1 text-zinc-900 dark:text-zinc-300"];r.push(i.createElement("h".concat(e),{key:c,className:n[e]},N(t)));continue}let x=l.match(/^>\s+\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\](.*)/i);if(x){let e=x[1].toUpperCase(),t=x[2],n={NOTE:"bg-zinc-50 dark:bg-zinc-950 border-blue-500 text-zinc-800 dark:text-zinc-200",TIP:"bg-zinc-50 dark:bg-zinc-950 border-green-500 text-zinc-800 dark:text-zinc-200",IMPORTANT:"bg-zinc-50 dark:bg-zinc-950 border-purple-500 text-zinc-800 dark:text-zinc-200",WARNING:"bg-zinc-50 dark:bg-zinc-950 border-amber-500 text-zinc-800 dark:text-zinc-200",CAUTION:"bg-zinc-50 dark:bg-zinc-950 border-red-500 text-zinc-800 dark:text-zinc-200"};r.push((0,s.jsxs)("div",{className:"p-3.5 border-l-4 my-3 rounded-r text-sm font-medium ".concat(n[e]),children:[(0,s.jsx)("div",{className:"font-bold text-xs tracking-wider mb-1 text-zinc-400",children:e}),(0,s.jsx)("div",{children:N(t)})]},c));continue}if(l.startsWith(">")){r.push((0,s.jsx)("blockquote",{className:"border-l-4 border-zinc-200 dark:border-zinc-800 pl-4 py-1.5 my-3 text-zinc-500 italic text-sm",children:N(l.substring(1).trim())},c));continue}if("---"===l.trim()){r.push((0,s.jsx)("hr",{className:"my-6 border-zinc-200 dark:border-zinc-800"},c));continue}if(l.trim().startsWith("- ")||l.trim().startsWith("* ")){let e=l.trim().substring(2);r.push((0,s.jsx)("li",{className:"ml-4 list-disc text-sm leading-relaxed text-zinc-700 dark:text-zinc-300 my-0.5",children:N(e)},c));continue}if(""===l.trim()){r.push((0,s.jsx)("div",{className:"h-2"},c));continue}r.push((0,s.jsx)("p",{className:"text-sm leading-relaxed text-zinc-700 dark:text-zinc-300 my-1",children:N(l)},c))}return(0,s.jsx)("div",{className:"space-y-1",children:r})})()})]})]}):(0,s.jsx)("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-zinc-400 bg-zinc-50 dark:bg-zinc-950/10",children:(0,s.jsx)("p",{className:"text-sm",children:"Select a tab or a phase to start editing or viewing markdown."})})]})};var Q=n(6848),Y=n(1694);n(9170);var B=n(7004);let X=(0,i.forwardRef)((e,t)=>{let{active:n,running:r=!1,onInput:a,onResize:c}=e,l=(0,i.useRef)(null),o=(0,i.useRef)(null),d=(0,i.useRef)(null),p=(0,i.useRef)(a),h=(0,i.useRef)(c);return p.current=a,h.current=c,(0,i.useImperativeHandle)(t,()=>({write:e=>{var t;return null==(t=o.current)?void 0:t.write(e)},clear:()=>{var e;return null==(e=o.current)?void 0:e.clear()},focus:()=>{var e;return null==(e=o.current)?void 0:e.focus()}}),[]),(0,i.useEffect)(()=>{var e;if(!l.current)return;let t=new Q.B({cursorBlink:!0,theme:{background:"#000000",foreground:"#a1a1aa",cursor:"#f4f4f5",selectionBackground:"#27272a"},fontFamily:'Menlo, Monaco, Consolas, "Courier New", monospace',fontSize:11}),n=new Y.Y;t.loadAddon(n),t.open(l.current);try{n.fit()}catch(e){}o.current=t,d.current=n;let s=t.onData(e=>{var t;return null==(t=p.current)?void 0:t.call(p,e)}),i=t.onResize(e=>{var t;let{cols:n,rows:s}=e;return null==(t=h.current)?void 0:t.call(h,n,s)});null==(e=h.current)||e.call(h,t.cols,t.rows);let r=new ResizeObserver(()=>{try{n.fit()}catch(e){}});return r.observe(l.current),()=>{r.disconnect(),s.dispose(),i.dispose(),t.dispose(),o.current=null,d.current=null}},[]),(0,i.useEffect)(()=>{if(!n)return;let e=requestAnimationFrame(()=>{var e,t;try{null==(t=d.current)||t.fit()}catch(e){}null==(e=o.current)||e.focus()});return()=>cancelAnimationFrame(e)},[n]),(0,s.jsxs)("div",{className:"flex flex-col h-full bg-black border-t border-zinc-800",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center px-4 py-2 border-b border-zinc-900 bg-zinc-950 shrink-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(B.A,{size:14,className:"text-zinc-500"}),(0,s.jsx)("span",{className:"font-mono text-xs font-semibold tracking-wider text-zinc-400",children:"CONSOLE OUTPUT"}),r&&(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 animate-pulse"})]}),(0,s.jsx)("button",{onClick:()=>{var e;return null==(e=o.current)?void 0:e.clear()},title:"Clear console",className:"p-1 hover:bg-zinc-800 rounded transition text-zinc-500 hover:text-zinc-300",children:(0,s.jsx)(x.A,{size:14})})]}),(0,s.jsx)("div",{ref:l,onClick:()=>{var e;return null==(e=o.current)?void 0:e.focus()},className:"flex-1 w-full min-h-0 p-2 overflow-hidden"})]})});X.displayName="AgentConsole";var K=n(3277);let Z=e=>{let{isOpen:t,onClose:n,persona:r,onSave:a}=e,[c,l]=(0,i.useState)(""),[o,d]=(0,i.useState)(""),[x,p]=(0,i.useState)(!0),[h,u]=(0,i.useState)("gemini-2.5-flash"),[b,f]=(0,i.useState)(""),[z,v]=(0,i.useState)(""),[k,j]=(0,i.useState)(""),[N,y]=(0,i.useState)("");return((0,i.useEffect)(()=>{r&&(l(r.label||""),d(r.command||""),p(!1!==r.enabled),u(r.model||"gemini-2.5-flash"),f(r.description||""),v(r.systemPrompt||""),j(Array.isArray(r.capabilities)?r.capabilities.join("\n"):""),y(Array.isArray(r.tools)?r.tools.join("\n"):""))},[r,t]),t&&r)?(0,s.jsx)("div",{className:"fixed inset-0 bg-black/85 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"bg-zinc-950 border border-zinc-850 w-full max-w-2xl h-[85vh] rounded-xl flex flex-col overflow-hidden shadow-2xl animate-in fade-in zoom-in duration-200",children:[(0,s.jsxs)("header",{className:"px-6 py-4 border-b border-zinc-850 flex justify-between items-center bg-zinc-900/50",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 bg-blue-500/10 text-blue-400 rounded-lg",children:(0,s.jsx)(K.A,{size:18})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("h2",{className:"text-base font-bold text-white tracking-tight",children:["Configure Persona Agent: ",r.id.toUpperCase()]}),(0,s.jsx)("p",{className:"text-xs text-zinc-400 mt-0.5",children:"Customize capabilities, core instructions, models, and slash command integration."})]})]}),(0,s.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-zinc-800 rounded-lg text-zinc-400 hover:text-zinc-200 transition",children:(0,s.jsx)(m.A,{size:18})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider mb-1.5",children:"Persona Name"}),(0,s.jsx)("input",{type:"text",value:c,onChange:e=>l(e.target.value),className:"w-full px-3 py-2 text-xs bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700",placeholder:"e.g. QA Agent"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider mb-1.5",children:"LLM Model"}),(0,s.jsxs)("select",{value:h,onChange:e=>u(e.target.value),className:"w-full px-3 py-2 text-xs bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700",children:[(0,s.jsx)("option",{value:"gemini-2.5-flash",children:"Gemini 2.5 Flash (Fast, Google)"}),(0,s.jsx)("option",{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro (Analytical, Google)"}),(0,s.jsx)("option",{value:"claude-3-5-sonnet",children:"Claude 3.5 Sonnet (Coding, Anthropic)"}),(0,s.jsx)("option",{value:"gpt-4o",children:"GPT-4o (Reasoning, OpenAI)"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 items-center",children:[(0,s.jsxs)("div",{className:"md:col-span-2",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider mb-1.5",children:"Slash Command / Execution Path"}),(0,s.jsx)("input",{type:"text",value:o,onChange:e=>d(e.target.value),className:"w-full px-3 py-2 text-xs font-mono bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700",placeholder:"e.g. /speckit.review.qa"})]}),(0,s.jsx)("div",{className:"flex items-center h-full pt-4",children:(0,s.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none",children:[(0,s.jsx)("input",{type:"checkbox",checked:x,onChange:e=>p(e.target.checked),className:"w-4 h-4 rounded border-zinc-800 bg-zinc-900 text-blue-500 focus:ring-0 focus:ring-offset-0"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-white",children:"Enable Agent Persona"}),(0,s.jsx)("span",{className:"text-[10px] text-zinc-500",children:"Run persona in review gate"})]})]})})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider",children:"Agent Description"}),(0,s.jsx)("textarea",{rows:2,value:b,onChange:e=>f(e.target.value),className:"w-full p-3 text-xs bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700 resize-none",placeholder:"Provide a general summary of this agent's responsibilities..."})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider",children:"System Prompt & Core Instructions"}),(0,s.jsx)("textarea",{rows:5,value:z,onChange:e=>v(e.target.value),className:"w-full p-3 text-xs font-mono bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700",placeholder:"System prompt instructions..."})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider",children:"Capabilities (one per line)"}),(0,s.jsxs)("span",{className:"text-[9px] text-zinc-500 flex items-center gap-0.5",children:[(0,s.jsx)(g.A,{size:10})," Environment injection"]})]}),(0,s.jsx)("textarea",{rows:4,value:k,onChange:e=>j(e.target.value),className:"w-full p-3 text-xs font-mono bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700",placeholder:"e.g. Runs Vitest suite"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase tracking-wider",children:"Authorized Tools (one per line)"}),(0,s.jsxs)("span",{className:"text-[9px] text-zinc-500 flex items-center gap-0.5",children:[(0,s.jsx)(g.A,{size:10})," CLI commands"]})]}),(0,s.jsx)("textarea",{rows:4,value:N,onChange:e=>y(e.target.value),className:"w-full p-3 text-xs font-mono bg-zinc-900 border border-zinc-800 rounded outline-none text-white focus:border-zinc-700",placeholder:"e.g. npm test"})]})]})]}),(0,s.jsxs)("footer",{className:"px-6 py-4 border-t border-zinc-850 flex justify-end gap-3 bg-zinc-900/30",children:[(0,s.jsx)("button",{onClick:n,className:"px-4 py-2 bg-zinc-900 hover:bg-zinc-850 border border-zinc-850 hover:border-zinc-800 text-zinc-300 font-semibold text-xs rounded-lg transition",children:"Cancel"}),(0,s.jsxs)("button",{onClick:()=>{let e=k.split("\n").map(e=>e.trim()).filter(e=>e.length>0),t=N.split("\n").map(e=>e.trim()).filter(e=>e.length>0);a({...r,label:c,command:o,enabled:x,model:h,description:b,systemPrompt:z,capabilities:e,tools:t})},className:"px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white font-semibold text-xs rounded-lg transition flex items-center gap-1.5",children:[(0,s.jsx)(I.A,{size:14}),(0,s.jsx)("span",{children:"Save Configuration"})]})]})]})}):null};var $=n(4970),ee=n(5074),et=n(367),en=n(9234),es=n(2393);let ei={developer:"Developer",qa:"QA Agent","code-review":"Code Reviewer",security:"Security Auditor","tech-lead":"Tech Lead"},er={developer:"Implements features and writes source code.",qa:"Runs unit and integration test suites.","code-review":"Reviews code styles and architectural patterns.",security:"Checks for security vulnerabilities and secrets.","tech-lead":"Performs final technical audit and validation."},ea=e=>{var t,n,r,a,c;let{isOpen:l,onClose:d,featureName:x,activePhaseState:h,onApprove:u}=e,[b,g]=(0,i.useState)([]),[z,v]=(0,i.useState)([]),[k,j]=(0,i.useState)(""),[N,y]=(0,i.useState)(""),[w,A]=(0,i.useState)("main"),[S,P]=(0,i.useState)(!1),[T,O]=(0,i.useState)(""),[F,R]=(0,i.useState)("files"),[E,I]=(0,i.useState)("");if((0,i.useEffect)(()=>{if(!l)return;let e=!0;return P(!0),O(""),fetch("/api/git?action=status").then(e=>{if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return e.json()}).then(t=>{e&&(t.error?O(t.error):(g(t.files||[]),v(t.log||[]),A(t.branch||"main"),t.files&&t.files.length>0?j(t.files[0].path):j("")))}).catch(t=>{e&&O(t.message||"Failed to fetch git status.")}).finally(()=>{e&&P(!1)}),()=>{e=!1}},[l]),(0,i.useEffect)(()=>{if(!l||!k)return void y("");let e=!0;return y("Loading diff..."),fetch("/api/git?action=diff&file=".concat(encodeURIComponent(k))).then(e=>{if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return e.json()}).then(t=>{e&&(t.error?y("Error: ".concat(t.error)):y(t.diff||"No modifications found."))}).catch(t=>{e&&y("Failed to load diff: ".concat(t.message))}),()=>{e=!1}},[l,k]),!l)return null;let L=b.reduce((e,t)=>e+t.additions,0),D=b.reduce((e,t)=>e+t.deletions,0),W=(()=>{if(!h||"idle"===h.status)return"idle";if("running"===h.status){var e;return(null==(e=h.personas)?void 0:e.some(e=>"idle"!==e.status))?"passed":"running"}return"passed"})(),G=null==h||null==(t=h.personas)?void 0:t.find(e=>"qa"===e.id),J=G?G.status:"idle",M=null==h||null==(n=h.personas)?void 0:n.find(e=>"security"===e.id),V=M?M.status:"idle",_=(null==h||null==(r=h.personas)?void 0:r.length)||0,U=(null==h||null==(a=h.personas)?void 0:a.filter(e=>"passed"===e.status).length)||0,Q=_>0?Math.round(U/_*100):100*("passed"===W),Y=[{id:"developer",label:ei.developer,desc:er.developer,status:W},...((null==h?void 0:h.personas)||[]).map(e=>({id:e.id,label:ei[e.id]||e.id,desc:er[e.id]||"",status:e.status}))];return(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 dark:bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"bg-white dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 w-full h-[95vh] rounded-xl flex flex-col overflow-hidden shadow-2xl animate-in fade-in zoom-in duration-200",children:[(0,s.jsxs)("header",{className:"px-6 py-4 border-b border-zinc-200 dark:border-zinc-800 flex justify-between items-center bg-zinc-50 dark:bg-zinc-900/50",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"text-2xl",children:"⚡"}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("h2",{className:"text-base font-bold text-zinc-900 dark:text-white tracking-tight",children:["Human Audit Portal: ",x]}),(0,s.jsx)("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20 uppercase animate-pulse",children:"Awaiting Sign-off"})]}),(0,s.jsx)("p",{className:"text-xs text-zinc-600 dark:text-zinc-400 mt-0.5",children:"Inspect code changes, check agent validation reports, and sign off the gate to approve implementation."})]})]}),(0,s.jsx)("button",{onClick:d,className:"p-1.5 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 transition",children:(0,s.jsx)(m.A,{size:18})})]}),T&&(0,s.jsxs)("div",{className:"mx-6 mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center gap-2 text-xs text-red-600 dark:text-red-400",children:[(0,s.jsx)($.A,{size:14,className:"shrink-0"}),(0,s.jsx)("span",{children:T})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 px-6 py-4 border-b border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950",children:[(0,s.jsxs)("div",{className:"p-3 bg-zinc-50 dark:bg-zinc-900/40 border border-zinc-200 dark:border-zinc-800/50 rounded-lg flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded bg-green-500/10 text-green-600 dark:text-green-400",children:(0,s.jsx)(H.A,{size:16})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-[10px] font-bold text-zinc-500 uppercase",children:"Tests Coverage"}),(0,s.jsx)("div",{className:"text-sm font-bold text-zinc-900 dark:text-white mt-0.5",children:"passed"===J?"100% Passed":"running"===J?"Running...":"Awaiting QA"})]})]}),(0,s.jsxs)("div",{className:"p-3 bg-zinc-50 dark:bg-zinc-900/40 border border-zinc-200 dark:border-zinc-800/50 rounded-lg flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded bg-blue-500/10 text-blue-600 dark:text-blue-400",children:(0,s.jsx)(q.A,{size:16})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-[10px] font-bold text-zinc-500 uppercase",children:"Lines Added"}),(0,s.jsx)("div",{className:"text-sm font-bold text-zinc-900 dark:text-white mt-0.5",children:S?"Loading...":"+".concat(L," / -").concat(D," lines")})]})]}),(0,s.jsxs)("div",{className:"p-3 bg-zinc-50 dark:bg-zinc-900/40 border border-zinc-200 dark:border-zinc-800/50 rounded-lg flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded bg-purple-500/10 text-purple-600 dark:text-purple-400",children:(0,s.jsx)(p.A,{size:16})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-[10px] font-bold text-zinc-500 uppercase",children:"Security Scan"}),(0,s.jsx)("div",{className:"text-sm font-bold text-zinc-900 dark:text-white mt-0.5",children:"passed"===V?"Grade A (Clean)":"failed"===V?"Failed":"running"===V?"Scanning...":"Awaiting Scan"})]})]}),(0,s.jsxs)("div",{className:"p-3 bg-zinc-50 dark:bg-zinc-900/40 border border-zinc-200 dark:border-zinc-800/50 rounded-lg flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,s.jsx)(ee.A,{size:16})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-[10px] font-bold text-zinc-500 uppercase",children:"Validation Duration"}),(0,s.jsx)("div",{className:"text-sm font-bold text-zinc-900 dark:text-white mt-0.5",children:(null==h||null==(c=h.personas)?void 0:c.some(e=>"passed"===e.status))?"1m 20s total":"0s"})]})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[(0,s.jsxs)("div",{className:"w-80 border-r border-zinc-200 dark:border-zinc-800 flex flex-col bg-white dark:bg-zinc-950 shrink-0",children:[(0,s.jsxs)("div",{className:"flex border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-900/20",children:[(0,s.jsx)("button",{onClick:()=>R("files"),className:"flex-1 py-2.5 text-center text-xs font-semibold border-b-2 transition ".concat("files"===F?"text-zinc-900 border-zinc-900 dark:text-white dark:border-white":"text-zinc-500 border-transparent hover:text-zinc-700 dark:hover:text-zinc-400"),children:"Modified Files"}),(0,s.jsx)("button",{onClick:()=>R("git"),className:"flex-1 py-2.5 text-center text-xs font-semibold border-b-2 transition ".concat("git"===F?"text-zinc-900 border-zinc-900 dark:text-white dark:border-white":"text-zinc-500 border-transparent hover:text-zinc-700 dark:hover:text-zinc-400"),children:"Git Commit History"})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto p-4 space-y-1",children:"files"===F?S?(0,s.jsx)("div",{className:"text-zinc-500 text-xs text-center py-8",children:"Loading files..."}):0===b.length?(0,s.jsx)("div",{className:"text-zinc-500 text-xs text-center py-8",children:"No modified files found."}):b.map(e=>(0,s.jsxs)("div",{onClick:()=>j(e.path),className:"p-2.5 rounded-lg border text-xs cursor-pointer transition flex justify-between items-center ".concat(k===e.path?"bg-zinc-100 dark:bg-zinc-900 border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-white":"bg-transparent border-transparent text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-900/50 hover:text-zinc-900 dark:hover:text-zinc-200"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(C.A,{size:13,className:"code"===e.type?"text-blue-600 dark:text-blue-400":"text-zinc-500"}),(0,s.jsx)("span",{className:"truncate font-mono text-[11px]",children:e.path.split("/").pop()})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 font-mono text-[10px] font-bold",children:[(0,s.jsxs)("span",{className:"text-green-500",children:["+",e.additions]}),(0,s.jsxs)("span",{className:"text-red-500",children:["-",e.deletions]})]})]},e.path)):(0,s.jsxs)("div",{className:"space-y-4 py-2",children:[(0,s.jsxs)("div",{className:"p-3 bg-zinc-50 dark:bg-zinc-900/30 border border-zinc-200 dark:border-zinc-800 rounded-lg flex items-center gap-2 mb-2",children:[(0,s.jsx)(et.A,{size:14,className:"text-blue-500 animate-pulse"}),(0,s.jsx)("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 font-bold",children:w}),(0,s.jsx)(en.A,{size:10,className:"text-zinc-500"}),(0,s.jsxs)("span",{className:"text-[10px] text-zinc-500 font-mono",children:["origin/",w]})]}),S?(0,s.jsx)("div",{className:"text-zinc-500 text-xs text-center py-8",children:"Loading commit history..."}):0===z.length?(0,s.jsx)("div",{className:"text-zinc-500 text-xs text-center py-8",children:"No commit history found."}):z.map((e,t)=>(0,s.jsxs)("div",{className:"flex gap-3 relative pl-1",children:[t<z.length-1&&(0,s.jsx)("div",{className:"absolute left-2.5 top-5 bottom-0 w-px bg-zinc-200 dark:bg-zinc-800"}),(0,s.jsx)("div",{className:"relative z-10 mt-1",children:(0,s.jsx)(es.A,{size:12,className:"text-blue-500 bg-white dark:bg-zinc-950 rounded-full"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono text-[10px] text-zinc-500",children:e.hash}),(0,s.jsx)("span",{className:"text-[9px] text-zinc-500",children:e.date})]}),(0,s.jsx)("p",{className:"text-[11px] font-semibold text-zinc-700 dark:text-zinc-200 truncate mt-0.5 font-sans font-medium",children:e.message}),(0,s.jsxs)("span",{className:"text-[9px] text-zinc-500 mt-1 block",children:["by ",e.author]})]})]},e.hash))]})})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col bg-zinc-50 dark:bg-zinc-900/20 overflow-hidden",children:[(0,s.jsxs)("div",{className:"px-4 py-2.5 bg-white dark:bg-zinc-950 border-b border-zinc-200 dark:border-zinc-800 flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-xs font-mono text-zinc-700 dark:text-zinc-300 font-bold",children:k||"No file selected"}),(0,s.jsx)("span",{className:"text-[10px] font-bold text-zinc-500 uppercase tracking-wide bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 px-2 py-0.5 rounded",children:"Unified Diff"})]}),(0,s.jsx)("div",{className:"flex-1 p-4 overflow-auto font-mono text-[11px] leading-relaxed text-zinc-700 dark:text-zinc-300 bg-zinc-50 dark:bg-black/60 select-text",children:N?N.split("\n").map((e,t)=>{let n="text-zinc-600 dark:text-zinc-400";return e.startsWith("+")?n="text-green-600 dark:text-green-500 bg-green-500/5 font-semibold":e.startsWith("-")&&(n="text-red-600 dark:text-red-500 bg-red-500/5 font-semibold"),(0,s.jsx)("div",{className:"px-2 py-0.5 rounded ".concat(n),children:e},t)}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-zinc-500 text-xs",children:[(0,s.jsx)(C.A,{size:32,className:"mb-2 text-zinc-400 dark:text-zinc-600"}),(0,s.jsx)("span",{children:"Select a code file from the left panel to inspect the git diff."})]})})]}),(0,s.jsxs)("div",{className:"w-96 border-l border-zinc-200 dark:border-zinc-800 flex flex-col bg-white dark:bg-zinc-950 shrink-0 overflow-y-auto",children:[(0,s.jsxs)("div",{className:"p-5 border-b border-zinc-200 dark:border-zinc-800 space-y-4",children:[(0,s.jsx)("h3",{className:"text-xs font-bold text-zinc-600 dark:text-zinc-400 uppercase tracking-wider",children:"Gate Analytics"}),(0,s.jsxs)("div",{className:"flex justify-between items-center gap-4 bg-zinc-50 dark:bg-zinc-900/30 border border-zinc-200 dark:border-zinc-800 p-3 rounded-lg",children:[(0,s.jsxs)("div",{className:"relative w-16 h-16 shrink-0 flex items-center justify-center",children:[(0,s.jsxs)("svg",{className:"w-full h-full transform -rotate-90",children:[(0,s.jsx)("circle",{cx:"32",cy:"32",r:"28",className:"stroke-zinc-200 dark:stroke-zinc-800",strokeWidth:"4",fill:"transparent"}),(0,s.jsx)("circle",{cx:"32",cy:"32",r:"28",className:"stroke-green-500",strokeWidth:"4",fill:"transparent",strokeDasharray:175,strokeDashoffset:175*(1-Q/100)})]}),(0,s.jsxs)("span",{className:"absolute text-[11px] font-bold text-zinc-900 dark:text-white",children:[Q,"%"]})]}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"text-[10px] text-zinc-500 uppercase font-bold",children:"QA Gate Grade"}),(0,s.jsxs)("p",{className:"text-xs text-zinc-700 dark:text-zinc-200 mt-0.5 font-semibold",children:[U," of ",_," automated verification reviews passed."]})]})]}),(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsx)("span",{className:"text-[10px] text-zinc-500 uppercase font-bold",children:"Execution Time per Persona"}),(0,s.jsx)("div",{className:"space-y-2 bg-zinc-50 dark:bg-zinc-900/30 border border-zinc-200 dark:border-zinc-800 p-3.5 rounded-lg",children:[{label:"Developer",time:"idle"===W?"0s":"45s",pct:100*("idle"!==W),color:"bg-zinc-500"},...((null==h?void 0:h.personas)||[]).map(e=>{let t="idle"!==e.status,n="0s",s=0;return t&&("qa"===e.id?(n="12s",s=26):"code-review"===e.id?(n="15s",s=33):"security"===e.id?(n="8s",s=18):"tech-lead"===e.id&&(n="10s",s=22)),{label:ei[e.id]||e.id,time:n,pct:s,color:({qa:"bg-green-500","code-review":"bg-blue-500",security:"bg-purple-500","tech-lead":"bg-amber-500"})[e.id]||"bg-zinc-500"}})].map(e=>(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-[10px] font-medium text-zinc-700 dark:text-zinc-300 font-sans",children:[(0,s.jsx)("span",{children:e.label}),(0,s.jsx)("span",{className:"font-mono",children:e.time})]}),(0,s.jsx)("div",{className:"h-1.5 w-full bg-zinc-200 dark:bg-zinc-800 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full ".concat(e.color),style:{width:"".concat(e.pct,"%")}})})]},e.label))})]})]}),(0,s.jsxs)("div",{className:"p-5 border-b border-zinc-200 dark:border-zinc-800 space-y-3",children:[(0,s.jsx)("h3",{className:"text-xs font-bold text-zinc-600 dark:text-zinc-400 uppercase tracking-wider",children:"Persona Audits Summary"}),(0,s.jsx)("div",{className:"space-y-3",children:Y.map(e=>{let t=(0,s.jsx)(ee.A,{size:13,className:"text-zinc-500 mt-0.5 shrink-0"});return"passed"===e.status?t=(0,s.jsx)(f.A,{size:13,className:"text-green-500 mt-0.5 shrink-0"}):"failed"===e.status?t=(0,s.jsx)($.A,{size:13,className:"text-red-500 mt-0.5 shrink-0"}):"running"===e.status&&(t=(0,s.jsx)(ee.A,{size:13,className:"text-blue-400 animate-pulse mt-0.5 shrink-0"})),(0,s.jsxs)("div",{className:"flex gap-2.5 items-start",children:[t,(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-[10px] font-bold text-zinc-700 dark:text-zinc-300",children:e.label}),(0,s.jsx)("span",{className:"text-[8px] font-bold px-1 rounded uppercase tracking-wider ".concat("passed"===e.status?"bg-green-500/10 text-green-600 dark:text-green-400 border border-green-500/20":"failed"===e.status?"bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20":"running"===e.status?"bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20 animate-pulse":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 border border-zinc-200 dark:border-zinc-700"),children:e.status})]}),(0,s.jsx)("p",{className:"text-[9px] text-zinc-500",children:e.desc})]})]},e.id)})})]}),(0,s.jsxs)("div",{className:"p-5 flex-1 flex flex-col justify-end gap-3 min-h-[200px]",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-500 uppercase",children:"Reviewer Comments"}),(0,s.jsx)("textarea",{placeholder:"Insert audit notes or observations...",value:E,onChange:e=>I(e.target.value),className:"w-full h-16 p-2 text-xs bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded outline-none resize-none text-zinc-900 dark:text-white focus:border-zinc-400 dark:focus:border-zinc-700"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:d,className:"flex-1 py-2 bg-zinc-100 dark:bg-zinc-900 hover:bg-zinc-200 dark:hover:bg-zinc-800 border border-zinc-200 dark:border-zinc-800 hover:border-zinc-300 dark:hover:border-zinc-800 text-zinc-700 dark:text-zinc-300 font-semibold text-xs rounded transition",children:"Cancel Audit"}),(0,s.jsxs)("button",{onClick:u,className:"flex-1 py-2 bg-green-500 hover:bg-green-600 text-white font-semibold text-xs rounded transition flex items-center justify-center gap-1.5",children:[(0,s.jsx)(o.A,{size:14}),(0,s.jsx)("span",{children:"Approve & Merge"})]})]})]})]})]})]})})};var ec=n(3781),el=n(451),eo=n(3541),ed=n(9597),ex=n(6714),ep=n(9756),eh=n(4807),eu=n(779),eb=n(9136);let em=(0,r.default)(()=>n.e(343).then(n.bind(n,7343)),{loadableGenerated:{webpack:()=>[7343]},ssr:!1}),eg={constitution:"Constitution",specification:"Specification",clarification:"Clarification",planning:"Planning",checklist:"Checklist",analyze:"Analysis",tasks:"Tasks",taskstoissues:"Tasks to Issues",implementation:"Implementation"};function ef(){let[e,t]=(0,i.useState)(null),n=i.useRef(null),[r,c]=(0,i.useState)(null),[o,d]=(0,i.useState)("kanban"),[x,u]=(0,i.useState)("dark"),[b,g]=(0,i.useState)({agentType:"claude",customCommand:"",agentPath:""}),[f,z]=(0,i.useState)(""),[v,k]=(0,i.useState)(a),[j,y]=(0,i.useState)(null),[w,C]=(0,i.useState)(null),[A,S]=(0,i.useState)(""),[P,T]=(0,i.useState)(!1),[F,R]=(0,i.useState)(!1),[E,I]=(0,i.useState)("editor"),[W,G]=(0,i.useState)(null),[J,M]=(0,i.useState)(!1),[q,V]=(0,i.useState)(!1),H=()=>{V(e=>{let t=!e;return localStorage.setItem("isSidebarCollapsed",String(t)),t})};(0,i.useEffect)(()=>{"true"===localStorage.getItem("isSidebarCollapsed")&&V(!0)},[]);let _=i.useRef(r);(0,i.useEffect)(()=>{_.current=r},[r]),(0,i.useEffect)(()=>{Q(),Y(),window.document.documentElement.classList.add("dark");let e=new EventSource("/api/state/watch");return e.addEventListener("update",e=>{let n=JSON.parse(e.data),s=n.state||n,i=n.changedFile||null;t(s),_.current&&i&&_.current.path.replace(/\\/g,"/")===i.replace(/\\/g,"/")&&et(_.current.path)}),()=>{e.close()}},[]);let Q=async()=>{try{let e=await fetch("/api/state"),n=await e.json();t(n)}catch(e){console.error("Failed to fetch state:",e)}},Y=async()=>{try{let e=await fetch("/api/personas");if(e.ok){let t=await e.json();k(t)}}catch(e){console.error("Failed to fetch personas:",e)}},B=async e=>{let t=v.map(t=>t.id===e.id?e:t);k(t),y(null);try{await fetch("/api/personas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){console.error("Failed to save persona config:",e)}},K=async e=>{try{let n=await fetch("/api/state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({activeFeatureName:e})}),s=await n.json();t(s);let i=s.features.find(t=>t.name===e),r=null==i?void 0:i.phases.find(e=>"specification"===e.phase);(null==r?void 0:r.filePath)?et(r.filePath):c(null)}catch(e){console.error(e)}},$=async e=>{if(e.preventDefault(),A.trim())try{let e=await fetch("/api/feature",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A.trim()})}),n=await e.json();t(n),S("");let s="specs/".concat(A.trim(),"/spec.md");c({path:s,content:""})}catch(e){console.error(e)}},ee=async n=>{if(confirm('Are you sure you want to delete feature "'.concat(n,'"?')))try{let s=await fetch("/api/feature",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})}),i=await s.json();t(i),(null==e?void 0:e.activeFeatureName)===n&&c(null)}catch(e){console.error(e)}},et=async e=>{try{let t=await fetch("/api/file?path=".concat(encodeURIComponent(e))),n=await t.json();c(n)}catch(e){console.error(e)}},en=async e=>{if(r)try{let n=await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r.path,content:e})}),s=await n.json();c({path:r.path,content:e}),s.state&&t(s.state)}catch(e){console.error(e)}},es=async(n,s)=>{if(null==e?void 0:e.activeFeatureName)try{let i=await fetch("/api/task",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureName:e.activeFeatureName,lineIndex:n,checked:s})}),a=await i.json();t(a);let c=a.features.find(e=>e.name===a.activeFeatureName),l=null==c?void 0:c.phases.find(e=>"tasks"===e.phase);(null==l?void 0:l.filePath)&&(null==r?void 0:r.path)===l.filePath&&et(l.filePath)}catch(e){console.error(e)}},ei=async(e,s,i)=>{var r,a,c;let l=null==(r=e.body)?void 0:r.getReader();if(!l){T(!1),G(null);return}let o=new TextDecoder,d="";for(;;){let{value:e,done:r}=await l.read();if(r)break;let x=(d+=o.decode(e)).split("\n\n");for(let e of(d=x.pop()||"",x))if(e.startsWith("event: log")){let t=e.split("\n").find(e=>e.startsWith("data: "));if(t){let e=JSON.parse(t.substring(6));null==(a=n.current)||a.write(e.text)}}else if(e.startsWith("event: done")){let n=e.split("\n").find(e=>e.startsWith("data: "));if(n){let e=JSON.parse(n.substring(6));t(e.state);let r=i||e.state.activeFeatureName,a=e.state.features.find(e=>e.name===r),c=null==a?void 0:a.phases.find(e=>e.phase===s);(null==c?void 0:c.filePath)&&et(c.filePath)}T(!1),G(null),z("")}else if(e.startsWith("event: error")){let t=e.split("\n").find(e=>e.startsWith("data: "));if(t){let e=JSON.parse(t.substring(6));null==(c=n.current)||c.write("\r\n\x1b[31mError: ".concat(e.message,"\x1b[0m\r\n"))}T(!1),G(null)}}Q()},er=async(t,s)=>{var i,r;null==(i=n.current)||i.clear(),T(!0),I("console"),G({phase:t,featureName:s||(null==e?void 0:e.activeFeatureName)||null});try{let n=await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"run",phase:t,featureName:s||(null==e?void 0:e.activeFeatureName),agentConfig:b,prompt:f,..."implementation"===t?{personas:v}:{}})});await ei(n,t,s)}catch(e){null==(r=n.current)||r.write("\r\n\x1b[31mExecution failed: ".concat(e.message,"\x1b[0m\r\n")),T(!1),G(null)}},ef=async t=>{var s,i;let r=t||(null==e?void 0:e.activeFeatureName)||null;null==(s=n.current)||s.clear(),T(!0),I("console"),G({phase:"implementation",featureName:r});try{let e=await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"run-gate",phase:"implementation",featureName:r,agentConfig:b,personas:v})});await ei(e,"implementation",r)}catch(e){null==(i=n.current)||i.write("\r\n\x1b[31mExecution failed: ".concat(e.message,"\x1b[0m\r\n")),T(!1),G(null)}},ez=()=>{var t,n;if((null==W?void 0:W.phase)!=="implementation")return;let s=null==e?void 0:e.features.find(e=>e.name===W.featureName),i=null==s?void 0:s.phases.find(e=>"implementation"===e.phase);return null==i||null==(n=i.personas)||null==(t=n.find(e=>"running"===e.status))?void 0:t.id},ev=async(t,n)=>{try{let s=n||(null==e?void 0:e.activeFeatureName)||null,i=ez();await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"stop",phase:t,featureName:s,personaId:i})}),T(!1),G(null),Q()}catch(e){console.error("Failed to stop phase:",e)}},ek=async(n,s)=>{try{let i=await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"approve",phase:n,featureName:s||(null==e?void 0:e.activeFeatureName)})}),r=await i.json();t(r)}catch(e){console.error(e)}},ej=async(n,s)=>{try{let i=await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"discard",phase:n,featureName:s||(null==e?void 0:e.activeFeatureName)})}),a=await i.json();t(a),(null==r?void 0:r.path)&&r.path.includes(n)&&c(null)}catch(e){console.error(e)}},eN=async(n,s)=>{if(!e)return;let i=e.features.find(e=>e.name===n);if(!i)return;let a=["specification","clarification","planning","checklist","analyze","tasks","taskstoissues","implementation"],l=(()=>{for(let e of i.phases)if("approved"!==e.status)return e.phase;return"completed"})();if(l===s)return;let o="completed"===l?a.length:a.indexOf(l),d="completed"===s?a.length:a.indexOf(s);if(e.activeFeatureName!==n&&await K(n),d>o){for(let e=o;e<d;e++){let s=a[e],i=await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"approve",phase:s,featureName:n})});t(await i.json())}"completed"!==s&&er(s,n)}else{let e=await fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"discard",phase:s,featureName:n})});t(await e.json()),(null==r?void 0:r.path)&&r.path.includes(s)&&c(null)}},ey=(()=>{if(!e||"approved"!==e.constitutionPhase.status)return{phase:"constitution",label:"Constitution"};let t=e.features.find(t=>t.name===e.activeFeatureName);if(!t)return{phase:"specification",label:"Specification"};for(let e of t.phases)if("approved"!==e.status)return{phase:e.phase,label:eg[e.phase]};return{phase:"specification",label:"Specification"}})();return(0,s.jsxs)("div",{className:"flex flex-col h-screen bg-white dark:bg-black text-zinc-900 dark:text-zinc-50 overflow-hidden font-sans",children:[(0,s.jsxs)("header",{className:"flex justify-between items-center px-6 py-4 border-b border-zinc-200 dark:border-zinc-800 bg-white dark:bg-black z-10 shrink-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"text-xl",children:"\uD83C\uDF31"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Spec Kit Assistant"}),(0,s.jsxs)("p",{className:"text-[10px] text-zinc-400 font-mono",children:["WORKSPACE: ",e?"ACTIVE":"CONNECTING..."]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-0.5",children:[(0,s.jsxs)("button",{onClick:()=>d("kanban"),className:"p-1.5 rounded-md transition text-xs flex items-center gap-1.5 ".concat("kanban"===o?"bg-white dark:bg-zinc-800 text-zinc-900 dark:text-zinc-50 shadow-sm":"text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[(0,s.jsx)(ec.A,{size:13}),(0,s.jsx)("span",{children:"Kanban"})]}),(0,s.jsxs)("button",{onClick:()=>d("dag"),className:"p-1.5 rounded-md transition text-xs flex items-center gap-1.5 ".concat("dag"===o?"bg-white dark:bg-zinc-800 text-zinc-900 dark:text-zinc-50 shadow-sm":"text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[(0,s.jsx)(el.A,{size:13}),(0,s.jsx)("span",{children:"DAG Map"})]})]}),(0,s.jsx)("button",{onClick:()=>R(!F),className:"p-2 border border-zinc-200 dark:border-zinc-800 rounded-lg transition hover:bg-zinc-100 dark:hover:bg-zinc-900 ".concat(F?"bg-zinc-100 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-50":"text-zinc-500"),title:"Configure AI Agent",children:(0,s.jsx)(eo.A,{size:14})}),(0,s.jsxs)("button",{onClick:()=>{let t=null==e?void 0:e.activeFeatureName,n=null==e?void 0:e.features.find(e=>e.name===t);C({name:t||"Workspace",phaseState:(null==n?void 0:n.phases.find(e=>"implementation"===e.phase))||{phase:"implementation",status:"idle",filePath:null,content:null}})},className:"p-2 border border-zinc-200 dark:border-zinc-800 rounded-lg text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition hover:bg-zinc-100 dark:hover:bg-zinc-900 flex items-center gap-1.5 text-xs font-semibold",title:"Open Human Review Portal",children:[(0,s.jsx)(p.A,{size:14,className:"text-blue-500"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Review Portal"})]}),(0,s.jsx)("button",{onClick:()=>{let e=window.document.documentElement;"light"===x?(e.classList.add("dark"),u("dark")):(e.classList.remove("dark"),u("light"))},className:"p-2 border border-zinc-200 dark:border-zinc-800 rounded-lg text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100 transition hover:bg-zinc-100 dark:hover:bg-zinc-900",children:"light"===x?(0,s.jsx)(ed.A,{size:14}):(0,s.jsx)(ex.A,{size:14})})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[(0,s.jsx)("aside",{className:"border-r border-zinc-200 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-950/20 flex flex-col shrink-0 transition-all duration-300 ".concat(q?"w-12 items-center justify-between py-4":"w-64"),children:q?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:H,className:"p-1.5 hover:bg-zinc-150 dark:hover:bg-zinc-900 rounded text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 transition",title:"Expand Sidebar",children:(0,s.jsx)(h.A,{size:16})}),(0,s.jsxs)("div",{onClick:H,className:"relative group cursor-pointer p-2 rounded hover:bg-zinc-150 dark:hover:bg-zinc-900 transition text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Click to view Features list",children:[(0,s.jsx)(ep.A,{size:18}),(null==e?void 0:e.features)&&e.features.length>0&&(0,s.jsx)("span",{className:"absolute -top-1 -right-1 bg-black dark:bg-white text-white dark:text-black text-[9px] w-4 h-4 rounded-full flex items-center justify-center font-bold",children:e.features.length})]}),(0,s.jsx)("div",{onClick:H,className:"group cursor-pointer p-2 rounded hover:bg-zinc-150 dark:hover:bg-zinc-900 transition text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Trigger Agent: ".concat(ey.label),children:(0,s.jsx)(eh.A,{size:16})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-800 shrink-0",children:[(0,s.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-wider text-zinc-400",children:"Features Manager"}),(0,s.jsx)("button",{onClick:H,className:"p-1 hover:bg-zinc-150 dark:hover:bg-zinc-900 rounded text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 transition",title:"Collapse Sidebar",children:(0,s.jsx)(eu.A,{size:14})})]}),(0,s.jsx)("form",{onSubmit:$,className:"p-4 border-b border-zinc-200 dark:border-zinc-800 shrink-0",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",placeholder:"New feature name...",value:A,onChange:e=>S(e.target.value),className:"flex-1 px-3 py-1.5 bg-white dark:bg-black border border-zinc-200 dark:border-zinc-800 rounded-md text-xs outline-none focus:border-zinc-400 dark:focus:border-zinc-650"}),(0,s.jsx)("button",{type:"submit",className:"p-2 bg-black dark:bg-white text-white dark:text-black rounded-md hover:opacity-90 transition",children:(0,s.jsx)(eb.A,{size:12})})]})}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",style:{scrollbarWidth:"thin"},children:[(0,s.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-zinc-400",children:"Features"}),null==e?void 0:e.features.map(t=>{let n=e.activeFeatureName===t.name;return(0,s.jsxs)("div",{onClick:()=>K(t.name),className:"group flex items-center justify-between px-2.5 py-2 rounded-md text-xs font-medium cursor-pointer transition ".concat(n?"bg-zinc-100 dark:bg-zinc-900 text-zinc-950 dark:text-zinc-50":"text-zinc-500 hover:bg-zinc-50 dark:hover:bg-zinc-950"),children:[(0,s.jsx)("span",{className:"truncate",children:t.name}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),ee(t.name)},className:"p-1 hover:bg-zinc-200 dark:hover:bg-zinc-800 rounded text-zinc-400 hover:text-red-500 transition opacity-0 group-hover:opacity-100",children:(0,s.jsx)(m.A,{size:10})})]},t.name)}),(null==e?void 0:e.features.length)===0&&(0,s.jsx)("p",{className:"text-xs text-zinc-400 italic p-2",children:"No features created yet."})]}),(0,s.jsxs)("div",{className:"p-4 border-t border-zinc-200 dark:border-zinc-800 bg-white dark:bg-black shrink-0",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,s.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-wider text-zinc-400",children:["Trigger Agent: ",ey.label]}),(0,s.jsx)(eh.A,{size:10,className:"text-zinc-400"})]}),(0,s.jsx)("textarea",{placeholder:"Refinements or prompts...",value:f,onChange:e=>z(e.target.value),disabled:P||!e,className:"w-full h-16 p-2 text-xs bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-md outline-none resize-none disabled:opacity-50"}),P?(0,s.jsxs)("button",{onClick:()=>{W&&ev(W.phase,W.featureName)},className:"w-full mt-2 py-1.5 bg-red-650 hover:bg-red-700 text-white rounded-md text-xs font-semibold transition flex items-center justify-center gap-1",children:[(0,s.jsx)(m.A,{size:10})," Stop Execution"]}):(0,s.jsxs)("button",{onClick:()=>er(ey.phase,null),disabled:!e,className:"w-full mt-2 py-1.5 bg-black dark:bg-white text-white dark:text-black rounded-md text-xs font-semibold hover:opacity-90 transition flex items-center justify-center gap-1 disabled:opacity-50",children:[(0,s.jsx)(l.A,{size:10,fill:"currentColor"})," Run ",ey.label]})]})]})}),(0,s.jsxs)("main",{className:"flex-1 flex flex-col min-w-0 overflow-hidden bg-white dark:bg-black relative",children:[F&&(0,s.jsxs)("div",{className:"absolute top-0 left-0 right-0 border-b border-zinc-200 dark:border-zinc-800 bg-white dark:bg-black p-4 z-20 shadow-md",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-zinc-500",children:"AI Agent Config"}),(0,s.jsx)("button",{onClick:()=>R(!1),className:"p-1 hover:bg-zinc-100 dark:hover:bg-zinc-900 rounded",children:(0,s.jsx)(m.A,{size:12})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase mb-1",children:"Agent CLI"}),(0,s.jsxs)("select",{value:b.agentType,onChange:e=>g({...b,agentType:e.target.value}),className:"w-full px-3 py-1.5 text-xs bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-md outline-none",children:[(0,s.jsx)("option",{value:"claude",children:"Claude CLI (Anthropic)"}),(0,s.jsx)("option",{value:"gemini",children:"Gemini CLI (Google)"}),(0,s.jsx)("option",{value:"copilot",children:"GitHub Copilot (ghcs)"}),(0,s.jsx)("option",{value:"openai",children:"OpenAI Codex"}),(0,s.jsx)("option",{value:"custom",children:"Custom Command"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase mb-1",children:"Custom Binary Path (Optional)"}),(0,s.jsx)("input",{type:"text",placeholder:"e.g. /usr/local/bin/claude",value:b.agentPath||"",onChange:e=>g({...b,agentPath:e.target.value}),className:"w-full px-3 py-1.5 text-xs bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-md outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-400 uppercase mb-1",children:"Custom Spawn Shell Command"}),(0,s.jsx)("input",{type:"text",placeholder:"e.g. my-agent {{prompt}}",value:b.customCommand||"",disabled:"custom"!==b.agentType,onChange:e=>g({...b,customCommand:e.target.value}),className:"w-full px-3 py-1.5 text-xs bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-md outline-none disabled:opacity-50"})]})]}),(0,s.jsxs)("div",{className:"mt-4 pt-4 border-t border-zinc-200 dark:border-zinc-800",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("label",{className:"block text-[10px] font-bold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider",children:"Review Gate Agent Personas (runs in order, Tech Lead signs off)"}),(0,s.jsxs)("span",{className:"text-[10px] text-zinc-500 font-semibold bg-zinc-100 dark:bg-zinc-900 px-2 py-0.5 rounded border border-zinc-200 dark:border-zinc-800",children:[v.filter(e=>e.enabled).length,"/",v.length," enabled"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:v.map((e,t)=>(0,s.jsxs)("div",{className:"flex flex-col justify-between p-3.5 bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-lg hover:border-zinc-300 dark:hover:border-zinc-700 transition",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:e.enabled,onChange:async n=>{let s=[...v];s[t]={...e,enabled:n.target.checked},k(s);try{await fetch("/api/personas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(e){console.error("Failed to save persona enable state:",e)}},className:"w-4 h-4 rounded border-zinc-300 dark:border-zinc-800 text-blue-500 focus:ring-0 cursor-pointer"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-bold text-zinc-800 dark:text-zinc-200",children:e.label}),(0,s.jsx)("span",{className:"ml-1.5 text-[9px] font-mono px-1 py-0.5 rounded bg-zinc-200/50 dark:bg-zinc-900 text-zinc-500 uppercase font-semibold",children:e.id})]})]}),(0,s.jsx)("button",{onClick:()=>y(e),className:"px-2 py-0.5 border border-zinc-200 dark:border-zinc-800 hover:bg-zinc-100 dark:hover:bg-zinc-900 text-[10px] font-bold rounded text-blue-500 dark:text-blue-400 transition",children:"Configure"})]}),(0,s.jsx)("p",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 line-clamp-1 mb-2 font-medium",children:e.description||"No description provided."}),(0,s.jsxs)("div",{className:"flex justify-between items-center text-[9px] text-zinc-500 font-mono",children:[(0,s.jsx)("span",{className:"truncate max-w-[150px] font-semibold",children:e.command}),(0,s.jsx)("span",{className:"shrink-0 px-1 py-0.25 rounded bg-zinc-200 dark:bg-zinc-900 font-semibold",children:e.model||"N/A"})]})]},e.id))})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[!J&&(0,s.jsx)("div",{className:"flex-1 min-h-[50%] relative",children:e?"kanban"===o?(0,s.jsx)(N,{state:e,onRunPhase:er,onApprovePhase:ek,onDiscardPhase:ej,onSelectFeature:K,onDeleteFeature:ee,onSelectPhaseFile:et,onCardDrop:eN,onRerunGate:ef,onOpenReview:(e,t)=>C({name:e,phaseState:t}),onStopPhase:ev}):(0,s.jsx)(O,{state:e,onSelectFeature:K,onSelectPhaseFile:et}):(0,s.jsx)("div",{className:"flex items-center justify-center h-full text-zinc-400 text-xs",children:"Loading Spec-Driven Development workspace state..."})}),(0,s.jsxs)("div",{className:"flex flex-col min-h-0 bg-white dark:bg-black transition-all duration-300 ".concat(J?"flex-1 h-full":"h-[40%] border-t border-zinc-200 dark:border-zinc-800"),children:[(0,s.jsxs)("div",{className:"flex justify-between items-center px-4 py-2 border-b border-zinc-150 dark:border-zinc-900 bg-zinc-50/70 dark:bg-zinc-950/20 shrink-0",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("button",{onClick:()=>I("editor"),className:"text-xs font-bold tracking-wide transition pb-1 border-b-2 ".concat("editor"===E?"text-black dark:text-white border-black dark:border-white":"text-zinc-400 border-transparent"),children:"MARKDOWN EDITOR"}),(0,s.jsxs)("button",{onClick:()=>I("console"),className:"text-xs font-bold tracking-wide transition pb-1 border-b-2 ".concat("console"===E?"text-black dark:text-white border-black dark:border-white":"text-zinc-400 border-transparent"),children:["AGENT RUN CONSOLE ",P&&(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 animate-pulse ml-1"})]}),(0,s.jsx)("button",{onClick:()=>I("terminal"),className:"text-xs font-bold tracking-wide transition pb-1 border-b-2 ".concat("terminal"===E?"text-black dark:text-white border-black dark:border-white":"text-zinc-400 border-transparent"),children:"WORKSPACE TERMINAL"})]}),(0,s.jsx)("button",{onClick:()=>M(!J),className:"p-1.5 rounded text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-900 transition",title:J?"Restore Layout":"Maximize Panel",children:J?(0,s.jsx)(L.A,{size:13}):(0,s.jsx)(D.A,{size:13})})]}),(0,s.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden",children:["editor"===E&&(0,s.jsx)("div",{className:"h-full p-3 bg-white dark:bg-black",children:(0,s.jsx)(U,{filePath:(null==r?void 0:r.path)||null,initialContent:(null==r?void 0:r.content)||null,onSave:en,onToggleTask:es,state:e,isMaximized:J,onToggleMaximize:()=>M(!J),onSelectFile:et})}),(0,s.jsx)("div",{className:"console"===E?"h-full":"hidden",children:(0,s.jsx)(X,{ref:n,active:"console"===E,running:P,onInput:e=>{W&&fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"input",phase:W.phase,featureName:W.featureName,text:e,personaId:ez()})}).catch(e=>console.error("Failed to send input:",e))},onResize:(e,t)=>{W&&fetch("/api/phase",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resize",phase:W.phase,featureName:W.featureName,cols:e,rows:t,personaId:ez()})}).catch(()=>{})}})}),"terminal"===E&&(0,s.jsx)(em,{})]})]})]})]})]}),j&&(0,s.jsx)(Z,{isOpen:!0,onClose:()=>y(null),persona:j,onSave:B}),w&&(0,s.jsx)(ea,{isOpen:!0,onClose:()=>C(null),featureName:w.name,activePhaseState:w.phaseState,onApprove:()=>{ek("implementation",w.name),C(null)}})]})}}},e=>{e.O(0,[299,307,314,873,480,920,358],()=>e(e.s=694)),_N_E=e.O()}]);