actshield 0.9.0__py3-none-any.whl

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 (366) hide show
  1. actshield/__init__.py +439 -0
  2. actshield/__main__.py +46 -0
  3. actshield/agents/__init__.py +12 -0
  4. actshield/agents/agent.py +200 -0
  5. actshield/agents/identity.py +114 -0
  6. actshield/api/__init__.py +34 -0
  7. actshield/api/models.py +198 -0
  8. actshield/api/server.py +669 -0
  9. actshield/api/service.py +599 -0
  10. actshield/approval/__init__.py +15 -0
  11. actshield/approval/approval.py +164 -0
  12. actshield/cli/__init__.py +8 -0
  13. actshield/cli/graph.py +49 -0
  14. actshield/cli/main.py +802 -0
  15. actshield/cli/shell.py +406 -0
  16. actshield/cli/theme.py +110 -0
  17. actshield/client.py +757 -0
  18. actshield/config.py +88 -0
  19. actshield/context/__init__.py +14 -0
  20. actshield/context/context.py +161 -0
  21. actshield/context/provenance.py +108 -0
  22. actshield/context/taint.py +48 -0
  23. actshield/decisions/decision.py +74 -0
  24. actshield/delegation/__init__.py +11 -0
  25. actshield/delegation/authority.py +63 -0
  26. actshield/delegation/delegation.py +180 -0
  27. actshield/demo.py +139 -0
  28. actshield/doctor.py +94 -0
  29. actshield/drift/__init__.py +27 -0
  30. actshield/drift/drift_engine.py +149 -0
  31. actshield/drift/drift_models.py +63 -0
  32. actshield/evaluation/__init__.py +1 -0
  33. actshield/evaluation/cases/__init__.py +1 -0
  34. actshield/evaluation/eval_suite.py +254 -0
  35. actshield/forensics/__init__.py +53 -0
  36. actshield/forensics/access_graph.py +216 -0
  37. actshield/forensics/authority_graph.py +186 -0
  38. actshield/forensics/delegation_graph.py +119 -0
  39. actshield/forensics/explanation.py +254 -0
  40. actshield/forensics/models.py +488 -0
  41. actshield/forensics/queries.py +367 -0
  42. actshield/forensics/serializers.py +68 -0
  43. actshield/forensics/service.py +310 -0
  44. actshield/forensics/snapshots.py +174 -0
  45. actshield/gates/__init__.py +13 -0
  46. actshield/gates/gate_models.py +46 -0
  47. actshield/gates/security_gate.py +191 -0
  48. actshield/gateway/__init__.py +13 -0
  49. actshield/gateway/http.py +191 -0
  50. actshield/gateway/mcp.py +292 -0
  51. actshield/incidents/__init__.py +25 -0
  52. actshield/incidents/incident.py +94 -0
  53. actshield/incidents/incident_engine.py +163 -0
  54. actshield/incidents/incident_rules.py +116 -0
  55. actshield/incidents/incident_state.py +58 -0
  56. actshield/integrations/__init__.py +24 -0
  57. actshield/integrations/ai_secura.py +169 -0
  58. actshield/integrations/ai_secura_analysis.py +236 -0
  59. actshield/integrations/apiris.py +122 -0
  60. actshield/integrations/few_shot.py +104 -0
  61. actshield/integrations/ollama_adapter.py +538 -0
  62. actshield/integrations/prompts/__init__.py +1 -0
  63. actshield/integrations/prompts/examples/__init__.py +1 -0
  64. actshield/integrations/security_packet.py +82 -0
  65. actshield/llm_config.py +89 -0
  66. actshield/offensive/__init__.py +95 -0
  67. actshield/offensive/adaptive/__init__.py +22 -0
  68. actshield/offensive/adaptive/adaptive_engine.py +165 -0
  69. actshield/offensive/adaptive/attack_selector.py +51 -0
  70. actshield/offensive/adaptive/boundary_search.py +99 -0
  71. actshield/offensive/adaptive/campaign_memory.py +123 -0
  72. actshield/offensive/adaptive/feedback.py +84 -0
  73. actshield/offensive/adaptive/mutation_planner.py +57 -0
  74. actshield/offensive/attack.py +78 -0
  75. actshield/offensive/campaign.py +219 -0
  76. actshield/offensive/corpus.py +155 -0
  77. actshield/offensive/engine.py +466 -0
  78. actshield/offensive/evaluator.py +116 -0
  79. actshield/offensive/evidence.py +63 -0
  80. actshield/offensive/generator.py +128 -0
  81. actshield/offensive/mutation.py +101 -0
  82. actshield/offensive/results.py +77 -0
  83. actshield/offensive/safety.py +80 -0
  84. actshield/offensive/strategies/__init__.py +22 -0
  85. actshield/offensive/strategies/authority_escalation.py +100 -0
  86. actshield/offensive/strategies/base.py +34 -0
  87. actshield/offensive/strategies/context_manipulation.py +100 -0
  88. actshield/offensive/strategies/data_exfiltration.py +100 -0
  89. actshield/offensive/strategies/delegation_attacks.py +100 -0
  90. actshield/offensive/strategies/mcp_attacks.py +100 -0
  91. actshield/offensive/strategies/prompt_injection.py +100 -0
  92. actshield/offensive/strategies/tool_poisoning.py +100 -0
  93. actshield/offensive/target.py +113 -0
  94. actshield/offensive/vulnerable_target.py +121 -0
  95. actshield/persistence/__init__.py +18 -0
  96. actshield/persistence/siem.py +102 -0
  97. actshield/persistence/storage.py +240 -0
  98. actshield/policy/__init__.py +12 -0
  99. actshield/policy/evaluator.py +294 -0
  100. actshield/policy/intent.py +113 -0
  101. actshield/policy/policy.py +48 -0
  102. actshield/posture/__init__.py +26 -0
  103. actshield/posture/posture_engine.py +186 -0
  104. actshield/posture/posture_models.py +152 -0
  105. actshield/posture/posture_rules.py +137 -0
  106. actshield/providers/__init__.py +32 -0
  107. actshield/providers/anthropic_provider.py +146 -0
  108. actshield/providers/base.py +160 -0
  109. actshield/providers/gemini_provider.py +133 -0
  110. actshield/providers/null_provider.py +40 -0
  111. actshield/providers/ollama_provider.py +135 -0
  112. actshield/providers/openai_provider.py +142 -0
  113. actshield/providers/registry.py +244 -0
  114. actshield/py.typed +0 -0
  115. actshield/response/__init__.py +14 -0
  116. actshield/response/response_actions.py +39 -0
  117. actshield/response/response_audit.py +32 -0
  118. actshield/response/response_engine.py +139 -0
  119. actshield/risk/models.py +104 -0
  120. actshield/serve.py +117 -0
  121. actshield/static/404.html +1 -0
  122. actshield/static/__next.__PAGE__.txt +24 -0
  123. actshield/static/__next._full.txt +20 -0
  124. actshield/static/__next._tree.txt +4 -0
  125. actshield/static/_next/static/Yp_swxN-C9UoCRNOwkYnY/_buildManifest.js +11 -0
  126. actshield/static/_next/static/Yp_swxN-C9UoCRNOwkYnY/_clientMiddlewareManifest.js +1 -0
  127. actshield/static/_next/static/Yp_swxN-C9UoCRNOwkYnY/_ssgManifest.js +1 -0
  128. actshield/static/_next/static/chunks/09kny2eqjc2or.js +1 -0
  129. actshield/static/_next/static/chunks/0c1zba1u9whdp.js +1 -0
  130. actshield/static/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  131. actshield/static/_next/static/chunks/0dbjjeg01x25o.js +1 -0
  132. actshield/static/_next/static/chunks/0duobs55ne238.js +1 -0
  133. actshield/static/_next/static/chunks/0iaz41l6068e4.js +1 -0
  134. actshield/static/_next/static/chunks/0mjhyv72x2idp.js +1 -0
  135. actshield/static/_next/static/chunks/0nelpqfu_ciq6.js +1 -0
  136. actshield/static/_next/static/chunks/0p1bci9ch797v.js +1 -0
  137. actshield/static/_next/static/chunks/0tld_ygho5tgm.js +1 -0
  138. actshield/static/_next/static/chunks/0w1-y7oni66j9.js +1 -0
  139. actshield/static/_next/static/chunks/10537zyl427zj.js +1 -0
  140. actshield/static/_next/static/chunks/11pc_jkl3aggn.js +1 -0
  141. actshield/static/_next/static/chunks/16k7nw0b3t8ys.js +1 -0
  142. actshield/static/_next/static/chunks/19mx3mg6lkumu.js +1 -0
  143. actshield/static/_next/static/chunks/1_8p47b-kxg2a.js +1 -0
  144. actshield/static/_next/static/chunks/1dszjozwfqegx.js +1 -0
  145. actshield/static/_next/static/chunks/1h43jcb90-m2r.js +22 -0
  146. actshield/static/_next/static/chunks/1ly04cvt_wh_j.js +1 -0
  147. actshield/static/_next/static/chunks/1odxrypuwuwp_.js +1 -0
  148. actshield/static/_next/static/chunks/1oes4c35qz5ku.js +1 -0
  149. actshield/static/_next/static/chunks/1ow883jl4ln-r.js +16 -0
  150. actshield/static/_next/static/chunks/1po7bna1as8tc.js +1 -0
  151. actshield/static/_next/static/chunks/1rsh0og8ifkzx.js +1 -0
  152. actshield/static/_next/static/chunks/1v0lwzv-859z_.js +1 -0
  153. actshield/static/_next/static/chunks/25iat2epwx25a.js +1 -0
  154. actshield/static/_next/static/chunks/25uvt4s2f39a4.js +1 -0
  155. actshield/static/_next/static/chunks/27t_qfc-3_lzs.js +1 -0
  156. actshield/static/_next/static/chunks/28bkmy8mez7gm.js +1 -0
  157. actshield/static/_next/static/chunks/2b6brmw_drw1p.js +1 -0
  158. actshield/static/_next/static/chunks/2fnhtxi4j6vge.js +1 -0
  159. actshield/static/_next/static/chunks/2p087eftxemg4.js +6 -0
  160. actshield/static/_next/static/chunks/2s8pao_z8pgtq.js +1 -0
  161. actshield/static/_next/static/chunks/2yj7ooc2c-zpg.js +1 -0
  162. actshield/static/_next/static/chunks/3-mrrr8udt5tk.js +1 -0
  163. actshield/static/_next/static/chunks/310vm2bl3xxpt.js +31 -0
  164. actshield/static/_next/static/chunks/35mvsv251jx1r.css +3 -0
  165. actshield/static/_next/static/chunks/370vf0oetlsx9.js +1 -0
  166. actshield/static/_next/static/chunks/3e-2m72tyo556.js +1 -0
  167. actshield/static/_next/static/chunks/3fntmmi971322.js +1 -0
  168. actshield/static/_next/static/chunks/3fzw-g0hycl2c.js +1 -0
  169. actshield/static/_next/static/chunks/3lopq3lhmcjxg.js +129 -0
  170. actshield/static/_next/static/chunks/3mpe2jejel0v2.css +1 -0
  171. actshield/static/_next/static/chunks/3t8o4f2lzr2sf.js +1 -0
  172. actshield/static/_next/static/chunks/3y-v1neyllne5.js +1 -0
  173. actshield/static/_next/static/chunks/43oiwy8mx6cs1.js +1 -0
  174. actshield/static/_next/static/chunks/turbopack-23wzuebcy_lxm.js +1 -0
  175. actshield/static/_next/static/media/1bffadaabf893a1e-s.3-6t-g6q0vh0a.woff2 +0 -0
  176. actshield/static/_next/static/media/2bbe8d2671613f1f-s.0k62hbripvv8p.woff2 +0 -0
  177. actshield/static/_next/static/media/2c55a0e60120577a-s.0-dom-5bn10r2.woff2 +0 -0
  178. actshield/static/_next/static/media/5476f68d60460930-s.2uwcyprjm3xu3.woff2 +0 -0
  179. actshield/static/_next/static/media/83afe278b6a6bb3c-s.p.2bn3s6zvc0dyp.woff2 +0 -0
  180. actshield/static/_next/static/media/9c72aa0f40e4eef8-s.1y4-pdgsjb-pw.woff2 +0 -0
  181. actshield/static/_next/static/media/ad66f9afd8947f86-s.3lvt2whj97whp.woff2 +0 -0
  182. actshield/static/_next/static/media/favicon.2vob68tjqpejf.ico +0 -0
  183. actshield/static/_not-found/__next._full.txt +17 -0
  184. actshield/static/_not-found/__next._not-found/__PAGE__.txt +23 -0
  185. actshield/static/_not-found/__next._tree.txt +3 -0
  186. actshield/static/_not-found.html +1 -0
  187. actshield/static/_not-found.txt +17 -0
  188. actshield/static/access/matrix/__next._full.txt +24 -0
  189. actshield/static/access/matrix/__next._tree.txt +4 -0
  190. actshield/static/access/matrix/__next.access/matrix/__PAGE__.txt +30 -0
  191. actshield/static/access/matrix.html +1 -0
  192. actshield/static/access/matrix.txt +24 -0
  193. actshield/static/activity/__next._full.txt +22 -0
  194. actshield/static/activity/__next._tree.txt +4 -0
  195. actshield/static/activity/__next.activity/__PAGE__.txt +27 -0
  196. actshield/static/activity.html +1 -0
  197. actshield/static/activity.txt +22 -0
  198. actshield/static/agents/__next._full.txt +22 -0
  199. actshield/static/agents/__next._tree.txt +4 -0
  200. actshield/static/agents/__next.agents/__PAGE__.txt +27 -0
  201. actshield/static/agents.html +1 -0
  202. actshield/static/agents.txt +22 -0
  203. actshield/static/ai-secura/__next._full.txt +22 -0
  204. actshield/static/ai-secura/__next._tree.txt +4 -0
  205. actshield/static/ai-secura/__next.ai-secura/__PAGE__.txt +27 -0
  206. actshield/static/ai-secura.html +1 -0
  207. actshield/static/ai-secura.txt +22 -0
  208. actshield/static/api/__next._full.txt +22 -0
  209. actshield/static/api/__next._tree.txt +4 -0
  210. actshield/static/api/__next.api/__PAGE__.txt +27 -0
  211. actshield/static/api.html +15 -0
  212. actshield/static/api.txt +22 -0
  213. actshield/static/apiris/__next._full.txt +22 -0
  214. actshield/static/apiris/__next._tree.txt +4 -0
  215. actshield/static/apiris/__next.apiris/__PAGE__.txt +27 -0
  216. actshield/static/apiris.html +1 -0
  217. actshield/static/apiris.txt +22 -0
  218. actshield/static/attack-graph/__next._full.txt +23 -0
  219. actshield/static/attack-graph/__next._tree.txt +5 -0
  220. actshield/static/attack-graph/__next.attack-graph/__PAGE__.txt +28 -0
  221. actshield/static/attack-graph.html +2 -0
  222. actshield/static/attack-graph.txt +23 -0
  223. actshield/static/campaigns/__next._full.txt +22 -0
  224. actshield/static/campaigns/__next._tree.txt +4 -0
  225. actshield/static/campaigns/__next.campaigns/__PAGE__.txt +27 -0
  226. actshield/static/campaigns.html +1 -0
  227. actshield/static/campaigns.txt +22 -0
  228. actshield/static/context/__next._full.txt +22 -0
  229. actshield/static/context/__next._tree.txt +4 -0
  230. actshield/static/context/__next.context/__PAGE__.txt +27 -0
  231. actshield/static/context.html +1 -0
  232. actshield/static/context.txt +22 -0
  233. actshield/static/dashboard/__next._full.txt +22 -0
  234. actshield/static/dashboard/__next._tree.txt +4 -0
  235. actshield/static/dashboard/__next.dashboard/__PAGE__.txt +27 -0
  236. actshield/static/dashboard.html +1 -0
  237. actshield/static/dashboard.txt +22 -0
  238. actshield/static/delegations/__next._full.txt +22 -0
  239. actshield/static/delegations/__next._tree.txt +4 -0
  240. actshield/static/delegations/__next.delegations/__PAGE__.txt +27 -0
  241. actshield/static/delegations.html +1 -0
  242. actshield/static/delegations.txt +22 -0
  243. actshield/static/demo/__next._full.txt +22 -0
  244. actshield/static/demo/__next._tree.txt +4 -0
  245. actshield/static/demo/__next.demo/__PAGE__.txt +27 -0
  246. actshield/static/demo.html +1 -0
  247. actshield/static/demo.txt +22 -0
  248. actshield/static/drift/__next._full.txt +22 -0
  249. actshield/static/drift/__next._tree.txt +4 -0
  250. actshield/static/drift/__next.drift/__PAGE__.txt +27 -0
  251. actshield/static/drift.html +1 -0
  252. actshield/static/drift.txt +22 -0
  253. actshield/static/favicon.ico +0 -0
  254. actshield/static/file.svg +1 -0
  255. actshield/static/forensics/__next._full.txt +22 -0
  256. actshield/static/forensics/__next._tree.txt +4 -0
  257. actshield/static/forensics/__next.forensics/__PAGE__.txt +27 -0
  258. actshield/static/forensics.html +1 -0
  259. actshield/static/forensics.txt +22 -0
  260. actshield/static/globe.svg +1 -0
  261. actshield/static/incidents/__next._full.txt +22 -0
  262. actshield/static/incidents/__next._tree.txt +4 -0
  263. actshield/static/incidents/__next.incidents/__PAGE__.txt +27 -0
  264. actshield/static/incidents.html +1 -0
  265. actshield/static/incidents.txt +22 -0
  266. actshield/static/index.html +3 -0
  267. actshield/static/index.txt +20 -0
  268. actshield/static/logo.png +0 -0
  269. actshield/static/metrics/__next._full.txt +22 -0
  270. actshield/static/metrics/__next._tree.txt +4 -0
  271. actshield/static/metrics/__next.metrics/__PAGE__.txt +27 -0
  272. actshield/static/metrics.html +1 -0
  273. actshield/static/metrics.txt +22 -0
  274. actshield/static/next.svg +1 -0
  275. actshield/static/offensive/__next._full.txt +22 -0
  276. actshield/static/offensive/__next._tree.txt +4 -0
  277. actshield/static/offensive/__next.offensive/__PAGE__.txt +27 -0
  278. actshield/static/offensive.html +1 -0
  279. actshield/static/offensive.txt +22 -0
  280. actshield/static/policies/__next._full.txt +22 -0
  281. actshield/static/policies/__next._tree.txt +4 -0
  282. actshield/static/policies/__next.policies/__PAGE__.txt +27 -0
  283. actshield/static/policies.html +1 -0
  284. actshield/static/policies.txt +22 -0
  285. actshield/static/posture/__next._full.txt +22 -0
  286. actshield/static/posture/__next._tree.txt +4 -0
  287. actshield/static/posture/__next.posture/__PAGE__.txt +27 -0
  288. actshield/static/posture.html +1 -0
  289. actshield/static/posture.txt +22 -0
  290. actshield/static/regressions/__next._full.txt +22 -0
  291. actshield/static/regressions/__next._tree.txt +4 -0
  292. actshield/static/regressions/__next.regressions/__PAGE__.txt +27 -0
  293. actshield/static/regressions.html +1 -0
  294. actshield/static/regressions.txt +22 -0
  295. actshield/static/reports/__next._full.txt +22 -0
  296. actshield/static/reports/__next._tree.txt +4 -0
  297. actshield/static/reports/__next.reports/__PAGE__.txt +27 -0
  298. actshield/static/reports.html +1 -0
  299. actshield/static/reports.txt +22 -0
  300. actshield/static/resources/__next._full.txt +22 -0
  301. actshield/static/resources/__next._tree.txt +4 -0
  302. actshield/static/resources/__next.resources/__PAGE__.txt +27 -0
  303. actshield/static/resources.html +1 -0
  304. actshield/static/resources.txt +22 -0
  305. actshield/static/security-gates/__next._full.txt +22 -0
  306. actshield/static/security-gates/__next._tree.txt +4 -0
  307. actshield/static/security-gates/__next.security-gates/__PAGE__.txt +27 -0
  308. actshield/static/security-gates.html +1 -0
  309. actshield/static/security-gates.txt +22 -0
  310. actshield/static/settings/__next._full.txt +22 -0
  311. actshield/static/settings/__next._tree.txt +4 -0
  312. actshield/static/settings/__next.settings/__PAGE__.txt +27 -0
  313. actshield/static/settings.html +1 -0
  314. actshield/static/settings.txt +22 -0
  315. actshield/static/tasks/__next._full.txt +22 -0
  316. actshield/static/tasks/__next._tree.txt +4 -0
  317. actshield/static/tasks/__next.tasks/__PAGE__.txt +27 -0
  318. actshield/static/tasks.html +1 -0
  319. actshield/static/tasks.txt +22 -0
  320. actshield/static/threats/__next._full.txt +22 -0
  321. actshield/static/threats/__next._tree.txt +4 -0
  322. actshield/static/threats/__next.threats/__PAGE__.txt +27 -0
  323. actshield/static/threats.html +1 -0
  324. actshield/static/threats.txt +22 -0
  325. actshield/static/tools/__next._full.txt +22 -0
  326. actshield/static/tools/__next._tree.txt +4 -0
  327. actshield/static/tools/__next.tools/__PAGE__.txt +27 -0
  328. actshield/static/tools.html +1 -0
  329. actshield/static/tools.txt +22 -0
  330. actshield/static/traces/__next._full.txt +22 -0
  331. actshield/static/traces/__next._tree.txt +4 -0
  332. actshield/static/traces/__next.traces/__PAGE__.txt +27 -0
  333. actshield/static/traces.html +1 -0
  334. actshield/static/traces.txt +22 -0
  335. actshield/static/vercel.svg +1 -0
  336. actshield/static/window.svg +1 -0
  337. actshield/tasks/__init__.py +6 -0
  338. actshield/tasks/task.py +143 -0
  339. actshield/threatmodel/__init__.py +70 -0
  340. actshield/threatmodel/actors.py +210 -0
  341. actshield/threatmodel/analyzer.py +131 -0
  342. actshield/threatmodel/assets.py +167 -0
  343. actshield/threatmodel/boundaries.py +165 -0
  344. actshield/threatmodel/exporters.py +49 -0
  345. actshield/threatmodel/mitigations.py +209 -0
  346. actshield/threatmodel/models.py +80 -0
  347. actshield/threatmodel/report.py +341 -0
  348. actshield/threatmodel/scenarios.py +212 -0
  349. actshield/threatmodel/scoring.py +66 -0
  350. actshield/threatmodel/threats.py +387 -0
  351. actshield/tools/__init__.py +20 -0
  352. actshield/tools/interceptor.py +256 -0
  353. actshield/tools/tool.py +71 -0
  354. actshield/tracing/__init__.py +38 -0
  355. actshield/tracing/correlation.py +173 -0
  356. actshield/tracing/events.py +75 -0
  357. actshield/tracing/tracer.py +305 -0
  358. actshield/watch.py +129 -0
  359. actshield-0.9.0.dist-info/METADATA +57 -0
  360. actshield-0.9.0.dist-info/RECORD +366 -0
  361. actshield-0.9.0.dist-info/WHEEL +5 -0
  362. actshield-0.9.0.dist-info/entry_points.txt +4 -0
  363. actshield-0.9.0.dist-info/top_level.txt +2 -0
  364. agentguard/__init__.py +39 -0
  365. agentguard/__main__.py +8 -0
  366. agentguard/py.typed +1 -0
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,45716,e=>{"use strict";var t,n,r,o,i,a,l,s,u,c,d,f,h,p,m,g=e.i(43476),y=e.i(71645);function v(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)""!==(r=v(e[n]))&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var x=e.i(30224);let b=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,o,i);return i},{useDebugValue:w}=y.default,{useSyncExternalStoreWithSelector:_}=x.default,S=e=>e;function E(e,t=S,n){let r=_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return w(r),r}let M=(e,t)=>{let n=e?b(e):b,r=(e,r=t)=>E(n,e,r);return Object.assign(r,n),r};function N(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var C={value:()=>{}};function k(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new A(r)}function A(e){this._=e}function z(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=C,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function P(){}function O(e){return null==e?P:function(){return this.querySelector(e)}}function $(){return[]}function I(e){return null==e?$:function(){return this.querySelectorAll(e)}}function R(e){return function(){return this.matches(e)}}function T(e){return function(t){return t.matches(e)}}A.prototype=k.prototype={constructor:A,on:function(e,t){var n,r=this._,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,a=o.length;if(arguments.length<2){for(;++i<a;)if((n=(e=o[i]).type)&&(n=function(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=z(r[n],e.name,t);else if(null==t)for(n in r)r[n]=z(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new A(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],i=0,n=r.length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var D=Array.prototype.find;function B(){return this.firstElementChild}var L=Array.prototype.filter;function H(){return Array.from(this.children)}function j(e){return Array(e.length)}function V(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function X(e,t,n,r,o,i){for(var a,l=0,s=t.length,u=i.length;l<u;++l)(a=t[l])?(a.__data__=i[l],r[l]=a):n[l]=new V(e,i[l]);for(;l<s;++l)(a=t[l])&&(o[l]=a)}function F(e,t,n,r,o,i,a){var l,s,u,c=new Map,d=t.length,f=i.length,h=Array(d);for(l=0;l<d;++l)(s=t[l])&&(h[l]=u=a.call(s,s.__data__,l,t)+"",c.has(u)?o[l]=s:c.set(u,s));for(l=0;l<f;++l)u=a.call(e,i[l],l,i)+"",(s=c.get(u))?(r[l]=s,s.__data__=i[l],c.delete(u)):n[l]=new V(e,i[l]);for(l=0;l<d;++l)(s=t[l])&&c.get(h[l])===s&&(o[l]=s)}function Y(e){return e.__data__}function K(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}V.prototype={constructor:V,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var W="http://www.w3.org/1999/xhtml";let Z={svg:"http://www.w3.org/2000/svg",xhtml:W,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function U(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Z.hasOwnProperty(t)?{space:Z[t],local:e}:e}function q(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function G(e,t){return e.style.getPropertyValue(t)||q(e).getComputedStyle(e,null).getPropertyValue(t)}function Q(e){return e.trim().split(/^|\s+/)}function J(e){return e.classList||new ee(e)}function ee(e){this._node=e,this._names=Q(e.getAttribute("class")||"")}function et(e,t){for(var n=J(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function en(e,t){for(var n=J(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function er(){this.textContent=""}function eo(){this.innerHTML=""}function ei(){this.nextSibling&&this.parentNode.appendChild(this)}function ea(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function el(e){var t=U(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===W&&t.documentElement.namespaceURI===W?t.createElement(e):t.createElementNS(n,e)}})(t)}function es(){return null}function eu(){var e=this.parentNode;e&&e.removeChild(this)}function ec(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ed(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ef(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function eh(e,t,n){return function(){var r,o=this.__on,i=function(e){t.call(this,e,this.__data__)};if(o){for(var a=0,l=o.length;a<l;++a)if((r=o[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ep(e,t,n){var r=q(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}ee.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var em=[null];function eg(e,t){this._groups=e,this._parents=t}function ey(){return new eg([[document.documentElement]],em)}function ev(e){return"string"==typeof e?new eg([[document.querySelector(e)]],[document.documentElement]):new eg([[e]],em)}eg.prototype=ey.prototype={constructor:eg,select:function(e){"function"!=typeof e&&(e=O(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a,l=t[o],s=l.length,u=r[o]=Array(s),c=0;c<s;++c)(i=l[c])&&(a=e.call(i,i.__data__,c,l))&&("__data__"in i&&(a.__data__=i.__data__),u[c]=a);return new eg(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=I(e);for(var n=this._groups,r=n.length,o=[],i=[],a=0;a<r;++a)for(var l,s=n[a],u=s.length,c=0;c<u;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),i.push(l));return new eg(o,i)},selectChild:function(e){var t;return this.select(null==e?B:(t="function"==typeof e?e:T(e),function(){return D.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?H:(t="function"==typeof e?e:T(e),function(){return L.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=R(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new eg(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Y);var n=t?F:X,r=this._parents,o=this._groups;"function"!=typeof e&&(v=e,e=function(){return v});for(var i=o.length,a=Array(i),l=Array(i),s=Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,h="object"==typeof(y=e.call(c,c&&c.__data__,u,r))&&"length"in y?y:Array.from(y),p=h.length,m=l[u]=Array(p),g=a[u]=Array(p);n(c,d,m,g,s[u]=Array(f),h,t);for(var y,v,x,b,w=0,_=0;w<p;++w)if(x=m[w]){for(w>=_&&(_=w+1);!(b=g[_])&&++_<p;);x._next=b||null}}return(a=new eg(a,r))._enter=l,a._exit=s,a},enter:function(){return new eg(this._enter||this._groups.map(j),this._parents)},exit:function(){return new eg(this._exit||this._groups.map(j),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),l=Array(o),s=0;s<a;++s)for(var u,c=n[s],d=r[s],f=c.length,h=l[s]=Array(f),p=0;p<f;++p)(u=c[p]||d[p])&&(h[p]=u);for(;s<o;++s)l[s]=n[s];return new eg(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=K);for(var n=this._groups,r=n.length,o=Array(r),i=0;i<r;++i){for(var a,l=n[i],s=l.length,u=o[i]=Array(s),c=0;c<s;++c)(a=l[c])&&(u[c]=a);u.sort(t)}return new eg(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,l=i.length;a<l;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=U(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):G(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=Q(e+"");if(arguments.length<2){for(var r=J(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?et:en)(this,e)}}:t?function(e){return function(){et(this,e)}}:function(e){return function(){en(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?er:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?eo:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(ei)},lower:function(){return this.each(ea)},append:function(e){var t="function"==typeof e?e:el(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:el(e),r=null==t?es:"function"==typeof t?t:O(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(eu)},clone:function(e){return this.select(e?ed:ec)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),a=i.length;if(arguments.length<2){var l=this.node().__on;if(l){for(var s,u=0,c=l.length;u<c;++u)for(r=0,s=l[u];r<a;++r)if((o=i[r]).type===s.type&&o.name===s.name)return s.value}return}for(l=t?eh:ef,r=0;r<a;++r)this.each(l(i[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return ep(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return ep(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};let ex={passive:!1},eb={capture:!0,passive:!1};function ew(e){e.stopImmediatePropagation()}function e_(e){e.preventDefault(),e.stopImmediatePropagation()}function eS(e){var t=e.document.documentElement,n=ev(e).on("dragstart.drag",e_,eb);"onselectstart"in t?n.on("selectstart.drag",e_,eb):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function eE(e,t){var n=e.document.documentElement,r=ev(e).on("dragstart.drag",null);t&&(r.on("click.drag",e_,eb),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function eM(e){return((e=Math.exp(e))+1/e)/2}let eN=function e(t,n,r){function o(e,o){var i,a,l=e[0],s=e[1],u=e[2],c=o[0],d=o[1],f=o[2],h=c-l,p=d-s,m=h*h+p*p;if(m<1e-12)a=Math.log(f/u)/t,i=function(e){return[l+e*h,s+e*p,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(f*f-u*u+r*m)/(2*u*n*g),v=(f*f-u*u-r*m)/(2*f*n*g),x=Math.log(Math.sqrt(y*y+1)-y);a=(Math.log(Math.sqrt(v*v+1)-v)-x)/t,i=function(e){var r,o,i=e*a,c=eM(x),d=u/(n*g)*(c*(((r=Math.exp(2*(r=t*i+x)))-1)/(r+1))-((o=Math.exp(o=x))-1/o)/2);return[l+d*h,s+d*p,u*c/eM(t*i+x)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);function eC(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}var ek,eA,ez=0,eP=0,eO=0,e$=0,eI=0,eR=0,eT="object"==typeof performance&&performance.now?performance:Date,eD="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eB(){return eI||(eD(eL),eI=eT.now()+eR)}function eL(){eI=0}function eH(){this._call=this._time=this._next=null}function ej(e,t,n){var r=new eH;return r.restart(e,t,n),r}function eV(){eI=(e$=eT.now())+eR,ez=eP=0;try{eB(),++ez;for(var e,t=ek;t;)(e=eI-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ez}finally{ez=0,function(){for(var e,t,n=ek,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ek=t);eA=e,eF(r)}(),eI=0}}function eX(){var e=eT.now(),t=e-e$;t>1e3&&(eR-=t,e$=e)}function eF(e){!ez&&(eP&&(eP=clearTimeout(eP)),e-eI>24?(e<1/0&&(eP=setTimeout(eV,e-eT.now()-eR)),eO&&(eO=clearInterval(eO))):(eO||(e$=eT.now(),eO=setInterval(eX,1e3)),ez=1,eD(eV)))}function eY(e,t,n){var r=new eH;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}eH.prototype=ej.prototype={constructor:eH,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?eB():+n)+(null==t?0:+t),this._next||eA===this||(eA?eA._next=this:ek=this,eA=this),this._call=e,this._time=n,eF()},stop:function(){this._call&&(this._call=null,this._time=1/0,eF())}};var eK=k("start","end","cancel","interrupt"),eW=[];function eZ(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(s){var u,c,d,f;if(1!==n.state)return l();for(u in o)if((f=o[u]).name===n.name){if(3===f.state)return eY(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[u]):+u<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[u])}if(eY(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=Array(d=n.tween.length),u=0,c=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=ej(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:eK,tween:eW,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function eU(e,t){var n=eG(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function eq(e,t){var n=eG(e,t);if(n.state>3)throw Error("too late; already running");return n}function eG(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function eQ(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i){if((n=i[o]).name!==t){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]}a&&delete e.__transition}}var eJ=e.i(68593),e0=180/Math.PI,e1={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function e2(e,t,n,r,o,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*e0,skewX:Math.atan(s)*e0,scaleX:a,scaleY:l}}function e3(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var l,s,u,c,d=[],f=[];return i=e(i),a=e(a),!function(e,r,o,i,a,l){if(e!==o||r!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:(0,eJ.default)(e,o)},{i:s-2,x:(0,eJ.default)(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,d,f),l=i.rotate,s=a.rotate,l!==s?(l-s>180?s+=360:s-l>180&&(l+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:(0,eJ.default)(l,s)})):s&&d.push(o(d)+"rotate("+s+r),u=i.skewX,c=a.skewX,u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:(0,eJ.default)(u,c)}):c&&d.push(o(d)+"skewX("+c+r),!function(e,t,n,r,i,a){if(e!==n||t!==r){var l=i.push(o(i)+"scale(",null,",",null,")");a.push({i:l-4,x:(0,eJ.default)(e,n)},{i:l-2,x:(0,eJ.default)(t,r)})}else(1!==n||1!==r)&&i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,d,f),i=a=null,function(e){for(var t,n=-1,r=f.length;++n<r;)d[(t=f[n]).i]=t.x(e);return d.join("")}}}var e5=e3(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?e1:e2(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),e4=e3(function(e){return null==e?e1:(s||(s=document.createElementNS("http://www.w3.org/2000/svg","g")),s.setAttribute("transform",e),e=s.transform.baseVal.consolidate())?e2((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):e1},", ",")",")");function e6(e,t,n){var r=e._id;return e.each(function(){var e=eq(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return eG(e,r).value[t]}}var e7=e.i(79996),e8=e.i(52491),e9=e.i(65445),e9=e9,te=e.i(35204),te=te;function tt(e,t){var n;return("number"==typeof t?e8.interpolateNumber:t instanceof e7.color?e9.default:(n=(0,e7.color)(t))?(t=n,e9.default):te.default)(e,t)}var tn=ey.prototype.constructor;function tr(e){return function(){this.style.removeProperty(e)}}var to=0;function ti(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var ta=ey.prototype;ti.prototype=(function(e){return ey().transition(e)}).prototype={constructor:ti,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=O(e));for(var r=this._groups,o=r.length,i=Array(o),a=0;a<o;++a)for(var l,s,u=r[a],c=u.length,d=i[a]=Array(c),f=0;f<c;++f)(l=u[f])&&(s=e.call(l,l.__data__,f,u))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,eZ(d[f],t,n,f,d,eG(l,n)));return new ti(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=I(e));for(var r=this._groups,o=r.length,i=[],a=[],l=0;l<o;++l)for(var s,u=r[l],c=u.length,d=0;d<c;++d)if(s=u[d]){for(var f,h=e.call(s,s.__data__,d,u),p=eG(s,n),m=0,g=h.length;m<g;++m)(f=h[m])&&eZ(f,t,n,m,h,p);i.push(h),a.push(s)}return new ti(i,a,t,n)},selectChild:ta.selectChild,selectChildren:ta.selectChildren,filter:function(e){"function"!=typeof e&&(e=R(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new ti(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=Array(r),l=0;l<i;++l)for(var s,u=t[l],c=n[l],d=u.length,f=a[l]=Array(d),h=0;h<d;++h)(s=u[h]||c[h])&&(f[h]=s);for(;l<r;++l)a[l]=t[l];return new ti(a,this._parents,this._name,this._id)},selection:function(){return new tn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++to,r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,u=0;u<s;++u)if(a=l[u]){var c=eG(a,t);eZ(a,e,n,u,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ti(r,this._parents,e,n)},call:ta.call,nodes:ta.nodes,node:ta.node,size:ta.size,empty:ta.empty,each:ta.each,on:function(e,t){var n,r,o,i,a,l,s=this._id;return arguments.length<2?eG(this.node(),s).on.on(e):this.each((n=s,r=e,o=t,l=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eU:eq,function(){var e=l(this,n),t=e.on;t!==i&&(a=(i=t).copy()).on(r,o),e.on=a}))},attr:function(e,t){var n=U(e),r="transform"===n?e4:tt;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,o,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}:function(e,t,n){var r,o,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttribute(e):(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}})(n,r,e6(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}:function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=U(e);return this.tween(n,(r.local?function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttributeNS(e.space,e.local,o.call(this,t))}),n}return o._value=t,o}:function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttribute(e,o.call(this,t))}),n}return o._value=t,o})(r,t))},style:function(e,t,n){var r,o,i,a,l,s,u,c,d,f,h,p,m,g,y,v,x,b,w,_,S,E="transform"==(e+="")?e5:tt;return null==t?this.styleTween(e,(r=e,function(){var e=G(this,r),t=(this.style.removeProperty(r),G(this,r));return e===t?null:e===o&&t===i?a:a=E(o=e,i=t)})).on("end.style."+e,tr(e)):"function"==typeof t?this.styleTween(e,(l=e,s=e6(this,"style."+e,t),function(){var e=G(this,l),t=s(this),n=t+"";return null==t&&(this.style.removeProperty(l),n=t=G(this,l)),e===n?null:e===u&&n===c?d:(c=n,d=E(u=e,t))})).each((f=this._id,x="end."+(v="style."+(h=e)),function(){var e=eq(this,f),t=e.on,n=null==e.value[v]?y||(y=tr(h)):void 0;(t!==p||g!==n)&&(m=(p=t).copy()).on(x,g=n),e.on=m})):this.styleTween(e,(b=e,S=t+"",function(){var e=G(this,b);return e===S?null:e===w?_:_=E(w=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t){this.style.setProperty(e,i.call(this,t),n)}),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=e6(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=eG(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var o=eq(this,e),i=o.tween;if(i!==n){r=n=i;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}}o.tween=r}}:function(e,t,n){var r,o;if("function"!=typeof n)throw Error();return function(){var i=eq(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var l={name:t,value:n},s=0,u=o.length;s<u;++s)if(o[s].name===t){o[s]=l;break}s===u&&o.push(l)}i.tween=o}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eU(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eU(this,e).delay=t}})(t,e)):eG(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eq(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eq(this,e).duration=t}})(t,e)):eG(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){eq(this,e).ease=t}}(t,e)):eG(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();eq(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var l={value:a},s={value:function(){0==--o&&i()}};n.each(function(){var n=eq(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t}),0===o&&i()})},[Symbol.iterator]:ta[Symbol.iterator]};var tl={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};ey.prototype.interrupt=function(e){return this.each(function(){eQ(this,e)})},ey.prototype.transition=function(e){var t,n;e instanceof ti?(t=e._id,e=e._name):(t=++to,(n=tl).time=eB(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,u=0;u<s;++u)(a=l[u])&&eZ(a,e,t,u,l,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new ti(r,this._parents,e,t)};let ts=e=>()=>e;function tu(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function tc(e,t,n){this.k=e,this.x=t,this.y=n}tc.prototype={constructor:tc,scale:function(e){return 1===e?this:new tc(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new tc(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var td=new tc(1,0,0);function tf(e){e.stopImmediatePropagation()}function th(e){e.preventDefault(),e.stopImmediatePropagation()}function tp(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function tm(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function tg(){return this.__zoom||td}function ty(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tv(){return navigator.maxTouchPoints||"ontouchstart"in this}function tx(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function tb(){var e,t,n,r=tp,o=tm,i=tx,a=ty,l=tv,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,d=eN,f=k("start","zoom","end"),h=0,p=10;function m(e){e.property("__zoom",tg).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",E).filter(l).on("touchstart.zoom",M).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new tc(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new tc(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,t,n,r){e.on("start.zoom",function(){b(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,i=b(this,e).event(r),a=o.apply(this,e),l=null==n?v(a):"function"==typeof n?n.apply(this,e):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=this.__zoom,c="function"==typeof t?t.apply(this,e):t,f=d(u.invert(l).concat(s/u.k),c.invert(l).concat(s/c.k));return function(e){if(1===e)e=c;else{var t=f(e),n=s/t[2];e=new tc(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function b(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function _(e,...t){if(r.apply(this,arguments)){var n=b(this,t).event(e),o=this.__zoom,l=Math.max(s[0],Math.min(s[1],o.k*Math.pow(2,a.apply(this,arguments)))),c=eC(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=o.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(o.k===l)return;n.mouse=[c,o.invert(c)],eQ(this),n.start()}th(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(y(g(o,l),n.mouse[0],n.mouse[1]),n.extent,u))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=b(this,t,!0).event(e),l=ev(e.view).on("mousemove.zoom",function(e){if(th(e),!a.moved){var t=e.clientX-c,n=e.clientY-d;a.moved=t*t+n*n>h}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=eC(e,o),a.mouse[1]),a.extent,u))},!0).on("mouseup.zoom",function(e){l.on("mousemove.zoom mouseup.zoom",null),eE(e.view,a.moved),th(e),a.event(e).end()},!0),s=eC(e,o),c=e.clientX,d=e.clientY;eS(e.view),tf(e),a.mouse=[s,this.__zoom.invert(s)],eQ(this),a.start()}}function E(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=eC(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=i(y(g(n,s),a,l),o.apply(this,t),u);th(e),c>0?ev(this).transition().duration(c).call(x,d,a,e):ev(this).call(m.transform,d,a,e)}}function M(n,...o){if(r.apply(this,arguments)){var i,a,l,s,u=n.touches,c=u.length,d=b(this,o,n.changedTouches.length===c).event(n);for(tf(n),a=0;a<c;++a)s=[s=eC(l=u[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=s[0],e=setTimeout(function(){e=null},500)),eQ(this),d.start())}}function N(e,...t){if(this.__zooming){var n,r,o,a,l=b(this,t).event(e),s=e.changedTouches,c=s.length;for(th(e),n=0;n<c;++n)o=eC(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=o:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=o);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],h=l.touch1[0],p=l.touch1[1],m=(m=h[0]-d[0])*m+(m=h[1]-d[1])*m,v=(v=p[0]-f[0])*v+(v=p[1]-f[1])*v;r=g(r,Math.sqrt(m/v)),o=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!l.touch0)return;o=l.touch0[0],a=l.touch0[1]}l.zoom("touch",i(y(r,o,a),l.extent,u))}}function C(e,...r){if(this.__zooming){var o,i,a=b(this,r).event(e),l=e.changedTouches,s=l.length;for(tf(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<s;++o)i=l[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.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&&(i=eC(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<p)){var u=ev(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",tg),e!==o?x(e,t,n,r):o.interrupt().each(function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,s),a,l),e,u)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),u)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,l=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return i(td.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,u)},r,a)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ev(this.that).datum();f.call(e,this.that,new tu(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:ts(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:ts(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:ts(!!e),m):l},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:ts([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(u[0][0]=+e[0][0],u[1][0]=+e[1][0],u[0][1]=+e[0][1],u[1][1]=+e[1][1],m):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(c=+e,m):c},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(h=(e*=1)*e,m):Math.sqrt(h)},m.tapDistance=function(e){return arguments.length?(p=+e,m):p},m}tc.prototype;let tw=e=>()=>e;function t_(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:l,dx:s,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function tS(e){return!e.ctrlKey&&!e.button}function tE(){return this.parentNode}function tM(e,t){return null==t?{x:e.x,y:e.y}:t}function tN(){return navigator.maxTouchPoints||"ontouchstart"in this}t_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e},e.i(74080);let tC=(0,y.createContext)(null),tk=tC.Provider,tA="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function tz(e,t){let n=(0,y.useContext)(tC);if(null===n)throw Error(tA);return E(n,e,t)}let tP=()=>{let e=(0,y.useContext)(tC);if(null===e)throw Error(tA);return(0,y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},tO=e=>e.userSelectionActive?"none":"all";function t$({position:e,children:t,className:n,style:r,...o}){let i=tz(tO),a=`${e}`.split("-");return y.default.createElement("div",{className:v(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...o},t)}function tI({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:y.default.createElement(t$,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},y.default.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var tR=(0,y.memo)(({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:s,className:u,...c})=>{let d=(0,y.useRef)(null),[f,h]=(0,y.useState)({x:0,y:0,width:0,height:0}),p=v(["react-flow__edge-textwrapper",u]);return((0,y.useEffect)(()=>{if(d.current){let e=d.current.getBBox();h({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),void 0!==n&&n)?y.default.createElement("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c},o&&y.default.createElement("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),y.default.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r},n),s):null});let tT=e=>({width:e.offsetWidth,height:e.offsetHeight}),tD=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),tB=(e={x:0,y:0},t)=>({x:tD(e.x,t[0][0],t[1][0]),y:tD(e.y,t[0][1],t[1][1])}),tL=(e,t,n)=>e<t?tD(Math.abs(e-t),1,50)/50:e>n?-tD(Math.abs(e-n),1,50)/50:0,tH=(e,t)=>[20*tL(e.x,35,t.width-35),20*tL(e.y,35,t.height-35)],tj=e=>e.getRootNode?.()||window?.document,tV=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),tX=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),tF=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),tY=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),tK=(e,t)=>Math.ceil(Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))),tW=e=>!isNaN(e)&&isFinite(e),tZ=Symbol.for("internals"),tU=["Enter"," ","Escape"],tq=(e,t)=>{};function tG(e){let t="nativeEvent"in e?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}let tQ=(e,t)=>{let n="clientX"in e,r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},tJ=()=>"u">typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,t0=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h=20})=>y.default.createElement(y.default.Fragment,null,y.default.createElement("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&y.default.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&tW(n)&&tW(r)?y.default.createElement(tR,{x:n,y:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u}):null);function t1(e,t,n){return void 0===n?n:r=>{let o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function t2({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,i=Math.abs(r-t)/2;return[n<e?n+o:n-o,r<t?r+i:r-i,o,i]}function t3({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:l}){let s=.125*e+.375*o+.375*a+.125*n,u=.125*t+.375*i+.375*l+.125*r,c=Math.abs(s-e),d=Math.abs(u-t);return[s,u,c,d]}function t5({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===p.Left||e===p.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function t4({sourceX:e,sourceY:t,sourcePosition:n=p.Bottom,targetX:r,targetY:o,targetPosition:i=p.Top}){let[a,l]=t5({pos:n,x1:e,y1:t,x2:r,y2:o}),[s,u]=t5({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,h]=t3({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:u});return[`M${e},${t} C${a},${l} ${s},${u} ${r},${o}`,c,d,f,h]}t0.displayName="BaseEdge",(t=u||(u={})).Strict="strict",t.Loose="loose",(n=c||(c={})).Free="free",n.Vertical="vertical",n.Horizontal="horizontal",(r=d||(d={})).Partial="partial",r.Full="full",(o=f||(f={})).Bezier="default",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o.SimpleBezier="simplebezier",(i=h||(h={})).Arrow="arrow",i.ArrowClosed="arrowclosed",(a=p||(p={})).Left="left",a.Top="top",a.Right="right",a.Bottom="bottom";let t6=(0,y.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=p.Bottom,targetPosition:i=p.Top,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:g})=>{let[v,x,b]=t4({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return y.default.createElement(t0,{path:v,labelX:x,labelY:b,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:g})});t6.displayName="SimpleBezierEdge";let t7={[p.Left]:{x:-1,y:0},[p.Right]:{x:1,y:0},[p.Top]:{x:0,y:-1},[p.Bottom]:{x:0,y:1}},t8=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function t9({sourceX:e,sourceY:t,sourcePosition:n=p.Bottom,targetX:r,targetY:o,targetPosition:i=p.Top,borderRadius:a=5,centerX:l,centerY:s,offset:u=20}){let[c,d,f,h,m]=function({source:e,sourcePosition:t=p.Bottom,target:n,targetPosition:r=p.Top,center:o,offset:i}){let a,l,s=t7[t],u=t7[r],c={x:e.x+s.x*i,y:e.y+s.y*i},d={x:n.x+u.x*i,y:n.y+u.y*i},f=(({source:e,sourcePosition:t=p.Bottom,target:n})=>t===p.Left||t===p.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:c,sourcePosition:t,target:d}),h=0!==f.x?"x":"y",m=f[h],g=[],y={x:0,y:0},v={x:0,y:0},[x,b,w,_]=t2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[h]*u[h]==-1){a=o.x??x,l=o.y??b;let e=[{x:a,y:c.y},{x:a,y:d.y}],t=[{x:c.x,y:l},{x:d.x,y:l}];g=s[h]===m?"x"===h?e:t:"x"===h?t:e}else{let o=[{x:c.x,y:d.y}],f=[{x:d.x,y:c.y}];if(g="x"===h?s.x===m?f:o:s.y===m?o:f,t===r){let t=Math.abs(e[h]-n[h]);if(t<=i){let r=Math.min(i-1,i-t);s[h]===m?y[h]=(c[h]>e[h]?-1:1)*r:v[h]=(d[h]>n[h]?-1:1)*r}}if(t!==r){let e="x"===h?"y":"x",t=s[h]===u[e],n=c[e]>d[e],r=c[e]<d[e];(1===s[h]&&(!t&&n||t&&r)||1!==s[h]&&(!t&&r||t&&n))&&(g="x"===h?o:f)}let p={x:c.x+y.x,y:c.y+y.y},x={x:d.x+v.x,y:d.y+v.y};Math.max(Math.abs(p.x-g[0].x),Math.abs(x.x-g[0].x))>=Math.max(Math.abs(p.y-g[0].y),Math.abs(x.y-g[0].y))?(a=(p.x+x.x)/2,l=g[0].y):(a=g[0].x,l=(p.y+x.y)/2)}return[[e,{x:c.x+y.x,y:c.y+y.y},...g,{x:d.x+v.x,y:d.y+v.y},n],a,l,w,_]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:s},offset:u});return[c.reduce((e,t,n)=>e+(n>0&&n<c.length-1?function(e,t,n,r){let o=Math.min(t8(e,t)/2,t8(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${i+o*t},${a}Q ${i},${a} ${i},${a+o*r}`}let l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${i},${a+o*s}Q ${i},${a} ${i+o*l},${a}`}(c[n-1],t,c[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`),""),d,f,h,m]}let ne=(0,y.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:c,sourcePosition:d=p.Bottom,targetPosition:f=p.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:v})=>{let[x,b,w]=t9({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:g?.borderRadius,offset:g?.offset});return y.default.createElement(t0,{path:x,labelX:b,labelY:w,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:m,interactionWidth:v})});ne.displayName="SmoothStepEdge";let nt=(0,y.memo)(e=>y.default.createElement(ne,{...e,pathOptions:(0,y.useMemo)(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));nt.displayName="StepEdge";let nn=(0,y.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{let[p,m,g]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,i,a,l]=t2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,l]}({sourceX:e,sourceY:t,targetX:n,targetY:r});return y.default.createElement(t0,{path:p,labelX:m,labelY:g,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});function nr(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function no({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case p.Left:return[t-nr(t-r,i),n];case p.Right:return[t+nr(r-t,i),n];case p.Top:return[t,n-nr(n-o,i)];case p.Bottom:return[t,n+nr(o-n,i)]}}function ni({sourceX:e,sourceY:t,sourcePosition:n=p.Bottom,targetX:r,targetY:o,targetPosition:i=p.Top,curvature:a=.25}){let[l,s]=no({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[u,c]=no({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,h,m]=t3({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${s} ${u},${c} ${r},${o}`,d,f,h,m]}nn.displayName="StraightEdge";let na=(0,y.memo)(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=p.Bottom,targetPosition:i=p.Top,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:v})=>{let[x,b,w]=ni({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:g?.curvature});return y.default.createElement(t0,{path:x,labelX:b,labelY:w,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})});na.displayName="BezierEdge";let nl=(0,y.createContext)(null),ns=nl.Provider;nl.Consumer;let nu=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},nc=({x:e,y:t},[n,r,o],i,[a,l])=>{let s={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(s.x/a),y:l*Math.round(s.y/l)}:s},nd=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),nf=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};let n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},nh=(e,t=[0,0])=>0===e.length?{x:0,y:0,width:0,height:0}:tF(e.reduce((e,n)=>{let{x:r,y:o}=nf(n,t).positionAbsolute;return tV(e,tX({x:r,y:o,width:n.width||0,height:n.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),np=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,l=[0,0])=>{let s={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(e=>{let{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;let{positionAbsolute:c}=nf(e,l),d=tK(s,{x:c.x,y:c.y,width:t||0,height:n||0}),f=void 0===t||void 0===n||null===t||null===n,h=(t||0)*(n||0);(f||i&&d>0||d>=h||e.dragging)&&u.push(e)}),u},nm=(e,t)=>{let n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},ng=(e,t,n,r,o,i=.1)=>{let a=tD(Math.min(t/(e.width*(1+i)),n/(e.height*(1+i))),r,o);return{x:t/2-(e.x+e.width/2)*a,y:n/2-(e.y+e.height/2)*a,zoom:a}},ny=(e,t=0)=>e.transition().duration(t);function nv(e,t,n,r){return(t[n]||[]).reduce((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t),[])}let nx={source:null,target:null,sourceHandle:null,targetHandle:null},nb=()=>({handleDomNode:null,isValid:!1,connection:nx,endHandle:null});function nw(e,t,n,r,o,i,a){let l="target"===o,s=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...nb(),handleDomNode:s};if(s){let e=n_(void 0,s),o=s.getAttribute("data-nodeid"),a=s.getAttribute("data-handleid"),d=s.classList.contains("connectable"),f=s.classList.contains("connectableend"),h={source:l?o:n,sourceHandle:l?a:r,target:l?n:o,targetHandle:l?r:a};c.connection=h,d&&f&&(t===u.Strict?l&&"source"===e||!l&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(h))}return c}function n_(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}function nS(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function nE({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:u}){let c,d,f=tj(e.target),{connectionMode:h,domNode:p,autoPanOnConnect:m,connectionRadius:g,onConnectStart:y,panBy:v,getNodes:x,cancelConnection:b}=i(),w=0,{x:_,y:S}=tQ(e),E=n_(s,f?.elementFromPoint(_,S)),M=p?.getBoundingClientRect();if(!M||!E)return;let N=tQ(e,M),C=!1,k=null,A=!1,z=null,P=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[tZ]){let{handleBounds:i}=o[tZ],a=[],l=[];i&&(a=nv(o,i,"source",`${t}-${n}-${r}`),l=nv(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...l)}return e},[])}({nodes:x(),nodeId:n,handleId:t,handleType:E}),O=()=>{if(!m)return;let[e,t]=tH(N,M);v({x:e,y:t}),w=requestAnimationFrame(O)};function $(e){var r,s;let u,{transform:p}=i();N=tQ(e,M);let{handle:m,validHandleResult:y}=function(e,t,n,r,o,i){let{x:a,y:l}=tQ(e),s=t.elementsFromPoint(a,l).find(e=>e.classList.contains("react-flow__handle"));if(s){let e=s.getAttribute("data-nodeid");if(e){let t=n_(void 0,s),r=s.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){let i=o.find(n=>n.nodeId===e&&n.type===t&&n.id===r);return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let u=[],c=1/0;if(o.forEach(e=>{let t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){let n=i(e);t<=c&&(t<c?u=[{handle:e,validHandleResult:n}]:t===c&&u.push({handle:e,validHandleResult:n}),c=t)}}),!u.length)return{handle:null,validHandleResult:nb()};if(1===u.length)return u[0];let d=u.some(({validHandleResult:e})=>e.isValid),f=u.some(({handle:e})=>"target"===e.type);return u.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||u[0]}(e,f,nc(N,p,!1,[1,1]),g,P,e=>nw(e,h,n,t,o?"target":"source",l,f));if(c=m,C||(O(),C=!0),z=y.handleDomNode,k=y.connection,A=y.isValid,a({connectionPosition:c&&A?nd({x:c.x,y:c.y},p):N,connectionStatus:(r=!!c,u=null,(s=A)?u="valid":r&&!s&&(u="invalid"),u),connectionEndHandle:y.endHandle}),!c&&!A&&!z)return nS(d);k.source!==k.target&&z&&(nS(d),d=z,z.classList.add("connecting","react-flow__handle-connecting"),z.classList.toggle("valid",A),z.classList.toggle("react-flow__handle-valid",A))}function I(e){(c||z)&&k&&A&&r?.(k),i().onConnectEnd?.(e),s&&u?.(e),nS(d),b(),cancelAnimationFrame(w),C=!1,A=!1,k=null,z=null,f.removeEventListener("mousemove",$),f.removeEventListener("mouseup",I),f.removeEventListener("touchmove",$),f.removeEventListener("touchend",I)}a({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:E,connectionStartHandle:{nodeId:n,handleId:t,type:E},connectionEndHandle:null}),y?.(e,{nodeId:n,handleId:t,handleType:E}),f.addEventListener("mousemove",$),f.addEventListener("mouseup",I),f.addEventListener("touchmove",$),f.addEventListener("touchend",I)}let nM=()=>!0,nN=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),nC=(0,y.forwardRef)(({type:e="source",position:t=p.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:s,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{let m=a||null,g="target"===e,x=tP(),b=(0,y.useContext)(nl),{connectOnClick:w,noPanClassName:_}=tz(nN,N),{connecting:S,clickConnecting:E}=tz(t=>{let{connectionStartHandle:n,connectionEndHandle:r,connectionClickStartHandle:o}=t;return{connecting:n?.nodeId===b&&n?.handleId===m&&n?.type===e||r?.nodeId===b&&r?.handleId===m&&r?.type===e,clickConnecting:o?.nodeId===b&&o?.handleId===m&&o?.type===e}},N);b||x.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");let M=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=x.getState(),o={...t,...e};if(r){let{edges:e,setEdges:t}=x.getState();t(((e,t)=>{let n,r;return e.source&&e.target?(r=n="id"in e&&"source"in e&&"target"in e?{...e}:{...e,id:(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`)(e)},t.some(e=>e.source===r.source&&e.target===r.target&&(e.sourceHandle===r.sourceHandle||!e.sourceHandle&&!r.sourceHandle)&&(e.targetHandle===r.targetHandle||!e.targetHandle&&!r.targetHandle)))?t:t.concat(n):(tq("006","Can't create edge. An edge needs a source and a target."),t)})(o,e))}n?.(o),l?.(o)},C=e=>{if(!b)return;let t="clientX"in e;o&&(t&&0===e.button||!t)&&nE({event:e,handleId:m,nodeId:b,onConnect:M,isTarget:g,getState:x.getState,setState:x.setState,isValidConnection:n||x.getState().isValidConnection||nM}),t?c?.(e):d?.(e)};return y.default.createElement("div",{"data-handleid":m,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${m}-${e}`,className:v(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,u,{source:!g,target:g,connectable:r,connectablestart:o,connectableend:i,connecting:E,connectionindicator:r&&(o&&!S||i&&S)}]),onMouseDown:C,onTouchStart:C,onClick:w?t=>{let{onClickConnectStart:r,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s}=x.getState();if(!b||!a&&!o)return;if(!a){r?.(t,{nodeId:b,handleId:m,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:m}});return}let u=tj(t.target),c=n||s||nM,{connection:d,isValid:f}=nw({nodeId:b,id:m,type:e},l,a.nodeId,a.handleId||null,a.type,c,u);f&&M(d),i?.(t),x.setState({connectionClickStartHandle:null})}:void 0,ref:h,...f},s)});nC.displayName="Handle";var nk=(0,y.memo)(nC);let nA=({data:e,isConnectable:t,targetPosition:n=p.Top,sourcePosition:r=p.Bottom})=>y.default.createElement(y.default.Fragment,null,y.default.createElement(nk,{type:"target",position:n,isConnectable:t}),e?.label,y.default.createElement(nk,{type:"source",position:r,isConnectable:t}));nA.displayName="DefaultNode";var nz=(0,y.memo)(nA);let nP=({data:e,isConnectable:t,sourcePosition:n=p.Bottom})=>y.default.createElement(y.default.Fragment,null,e?.label,y.default.createElement(nk,{type:"source",position:n,isConnectable:t}));nP.displayName="InputNode";var nO=(0,y.memo)(nP);let n$=({data:e,isConnectable:t,targetPosition:n=p.Top})=>y.default.createElement(y.default.Fragment,null,y.default.createElement(nk,{type:"target",position:n,isConnectable:t}),e?.label);n$.displayName="OutputNode";var nI=(0,y.memo)(n$);let nR=()=>null;nR.displayName="GroupNode";let nT=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),nD=e=>e.id;function nB(e,t){return N(e.selectedNodes.map(nD),t.selectedNodes.map(nD))&&N(e.selectedEdges.map(nD),t.selectedEdges.map(nD))}let nL=(0,y.memo)(({onSelectionChange:e})=>{let t=tP(),{selectedNodes:n,selectedEdges:r}=tz(nT,nB);return(0,y.useEffect)(()=>{let o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(e=>e(o))},[n,r,e]),null});nL.displayName="SelectionListener";let nH=e=>!!e.onSelectionChange;function nj({onSelectionChange:e}){let t=tz(nH);return e||t?y.default.createElement(nL,{onSelectionChange:e}):null}let nV=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function nX(e,t){(0,y.useEffect)(()=>{void 0!==e&&t(e)},[e])}function nF(e,t,n){(0,y.useEffect)(()=>{void 0!==t&&n({[e]:t})},[t])}let nY=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:s,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:m,maxZoom:g,nodeExtent:v,onNodesChange:x,onEdgesChange:b,elementsSelectable:w,connectionMode:_,snapGrid:S,snapToGrid:E,translateExtent:M,connectOnClick:C,defaultEdgeOptions:k,fitView:A,fitViewOptions:z,onNodesDelete:P,onEdgesDelete:O,onNodeDrag:$,onNodeDragStart:I,onNodeDragStop:R,onSelectionDrag:T,onSelectionDragStart:D,onSelectionDragStop:B,noPanClassName:L,nodeOrigin:H,rfId:j,autoPanOnConnect:V,autoPanOnNodeDrag:X,onError:F,connectionRadius:Y,isValidConnection:K,nodeDragThreshold:W})=>{let{setNodes:Z,setEdges:U,setDefaultNodesAndEdges:q,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:et}=tz(nV,N),en=tP();return(0,y.useEffect)(()=>(q(n,r?.map(e=>({...e,...k}))),()=>{et()}),[]),nF("defaultEdgeOptions",k,en.setState),nF("connectionMode",_,en.setState),nF("onConnect",o,en.setState),nF("onConnectStart",i,en.setState),nF("onConnectEnd",a,en.setState),nF("onClickConnectStart",l,en.setState),nF("onClickConnectEnd",s,en.setState),nF("nodesDraggable",u,en.setState),nF("nodesConnectable",c,en.setState),nF("nodesFocusable",d,en.setState),nF("edgesFocusable",f,en.setState),nF("edgesUpdatable",h,en.setState),nF("elementsSelectable",w,en.setState),nF("elevateNodesOnSelect",p,en.setState),nF("snapToGrid",E,en.setState),nF("snapGrid",S,en.setState),nF("onNodesChange",x,en.setState),nF("onEdgesChange",b,en.setState),nF("connectOnClick",C,en.setState),nF("fitViewOnInit",A,en.setState),nF("fitViewOnInitOptions",z,en.setState),nF("onNodesDelete",P,en.setState),nF("onEdgesDelete",O,en.setState),nF("onNodeDrag",$,en.setState),nF("onNodeDragStart",I,en.setState),nF("onNodeDragStop",R,en.setState),nF("onSelectionDrag",T,en.setState),nF("onSelectionDragStart",D,en.setState),nF("onSelectionDragStop",B,en.setState),nF("noPanClassName",L,en.setState),nF("nodeOrigin",H,en.setState),nF("rfId",j,en.setState),nF("autoPanOnConnect",V,en.setState),nF("autoPanOnNodeDrag",X,en.setState),nF("onError",F,en.setState),nF("connectionRadius",Y,en.setState),nF("isValidConnection",K,en.setState),nF("nodeDragThreshold",W,en.setState),nX(e,Z),nX(t,U),nX(m,G),nX(g,Q),nX(M,J),nX(v,ee),null},nK={display:"none"},nW={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},nZ="react-flow__node-desc",nU="react-flow__edge-desc",nq=e=>e.ariaLiveMessage;function nG({rfId:e}){let t=tz(nq);return y.default.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:nW},t)}function nQ({rfId:e,disableKeyboardA11y:t}){return y.default.createElement(y.default.Fragment,null,y.default.createElement("div",{id:`${nZ}-${e}`,style:nK},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),y.default.createElement("div",{id:`${nU}-${e}`,style:nK},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&y.default.createElement(nG,{rfId:e}))}var nJ=(e=null,t={actInsideInputWithModifier:!0})=>{let[n,r]=(0,y.useState)(!1),o=(0,y.useRef)(!1),i=(0,y.useRef)(new Set([])),[a,l]=(0,y.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,y.useEffect)(()=>{let n="u">typeof document?document:null,s=t?.target||n;if(null!==e){let e=e=>{if(o.current=e.ctrlKey||e.metaKey||e.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&tG(e))return!1;let n=n1(e.code,l);i.current.add(e[n]),n0(a,i.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&tG(e))return!1;let n=n1(e.code,l);n0(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[n]),"Meta"===e.key&&i.current.clear(),o.current=!1},u=()=>{i.current.clear(),r(!1)};return s?.addEventListener("keydown",e),s?.addEventListener("keyup",n),window.addEventListener("blur",u),()=>{s?.removeEventListener("keydown",e),s?.removeEventListener("keyup",n),window.removeEventListener("blur",u)}}},[e,r]),n};function n0(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function n1(e,t){return t.includes(e)?"code":"key"}function n2(e,t,n){e.forEach(r=>{let o=r.parentNode||r.parentId;if(o&&!e.has(o))throw Error(`Parent node ${o} not found`);if(o||n?.[r.id]){let{x:o,y:i,z:a}=function e(t,n,r,o){let i=t.parentNode||t.parentId;if(!i)return r;let a=n.get(i),l=nf(a,o);return e(a,n,{x:(r.x??0)+l.x,y:(r.y??0)+l.y,z:(a[tZ]?.z??0)>(r.z??0)?a[tZ]?.z??0:r.z??0},o)}(r,e,{...r.position,z:r[tZ]?.z??0},t);r.positionAbsolute={x:o,y:i},r[tZ].z=a,n?.[r.id]&&(r[tZ].isParent=!0)}})}function n3(e,t,n,r){let o=new Map,i={},a=1e3*!!r;return e.forEach(e=>{let n=(tW(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),l={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},s=e.parentNode||e.parentId;s&&(i[s]=!0),Object.defineProperty(l,tZ,{enumerable:!1,value:{handleBounds:r?.type&&r?.type!==e.type?void 0:r?.[tZ]?.handleBounds,z:n}}),o.set(e.id,l)}),n2(o,n,i),o}function n5(e,t={}){let{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:s,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(l&&s&&(f||!t.initial)){let e=n().filter(e=>{let n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),u=e.every(e=>e.width&&e.height);if(e.length>0&&u){let{x:n,y:u,zoom:c}=ng(nh(e,d),r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),f=td.translate(n,u).scale(c);return"number"==typeof t.duration&&t.duration>0?l.transform(ny(s,t.duration),f):l.transform(s,f),!0}}return!1}function n4({changedNodes:e,changedEdges:t,get:n,set:r}){let{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:s,hasDefaultEdges:u}=n();e?.length&&(s&&r({nodeInternals:(e.forEach(e=>{let t=o.get(e.id);t&&o.set(t.id,{...t,[tZ]:t[tZ],selected:e.selected})}),new Map(o))}),a?.(e)),t?.length&&(u&&r({edges:i.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.selected=n.selected),e})}),l?.(t))}let n6=()=>{},n7={zoomIn:n6,zoomOut:n6,zoomTo:n6,getZoom:()=>1,setViewport:n6,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:n6,fitBounds:n6,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},n8=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function n9(){let e=(()=>{let e=tP(),{d3Zoom:t,d3Selection:n}=tz(n8,N);return(0,y.useMemo)(()=>n&&t?{zoomIn:e=>t.scaleBy(ny(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(ny(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(ny(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{let[i,a,l]=e.getState().transform,s=td.translate(r.x??i,r.y??a).scale(r.zoom??l);t.transform(ny(n,o?.duration),s)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>n5(e.getState,t),setCenter:(r,o,i)=>{let{width:a,height:l,maxZoom:s}=e.getState(),u=void 0!==i?.zoom?i.zoom:s,c=a/2-r*u,d=l/2-o*u,f=td.translate(c,d).scale(u);t.transform(ny(n,i?.duration),f)},fitBounds:(r,o)=>{let{width:i,height:a,minZoom:l,maxZoom:s}=e.getState(),{x:u,y:c,zoom:d}=ng(r,i,a,l,s,o?.padding??.1),f=td.translate(u,c).scale(d);t.transform(ny(n,o?.duration),f)},project:t=>{let{transform:n,snapToGrid:r,snapGrid:o}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),nc(t,n,r,o)},screenToFlowPosition:t=>{let{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=e.getState();if(!i)return t;let{x:a,y:l}=i.getBoundingClientRect();return nc({x:t.x-a,y:t.y-l},n,r,o)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:o,y:i}=r.getBoundingClientRect(),a=nd(t,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:n7,[t,n])})(),t=tP(),n=(0,y.useCallback)(()=>t.getState().getNodes().map(e=>({...e})),[]),r=(0,y.useCallback)(e=>t.getState().nodeInternals.get(e),[]),o=(0,y.useCallback)(()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},[]),i=(0,y.useCallback)(e=>{let{edges:n=[]}=t.getState();return n.find(t=>t.id===e)},[]),a=(0,y.useCallback)(e=>{let{getNodes:n,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=t.getState(),a=n(),l="function"==typeof e?e(a):e;o?r(l):i&&i(0===l.length?a.map(e=>({type:"remove",id:e.id})):l.map(e=>({item:e,type:"reset"})))},[]),l=(0,y.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=t.getState(),a="function"==typeof e?e(n):e;o?r(a):i&&i(0===a.length?n.map(e=>({type:"remove",id:e.id})):a.map(e=>({item:e,type:"reset"})))},[]),s=(0,y.useCallback)(e=>{let n=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=t.getState();i?o([...r(),...n]):a&&a(n.map(e=>({item:e,type:"add"})))},[]),u=(0,y.useCallback)(e=>{let n=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=t.getState();i?o([...r,...n]):a&&a(n.map(e=>({item:e,type:"add"})))},[]),c=(0,y.useCallback)(()=>{let{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,i,a]=r;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:i,zoom:a}}},[]),d=(0,y.useCallback)(({nodes:e,edges:n})=>{let{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,hasDefaultEdges:l,onNodesDelete:s,onEdgesDelete:u,onNodesChange:c,onEdgesChange:d}=t.getState(),f=(e||[]).map(e=>e.id),h=(n||[]).map(e=>e.id),p=o().reduce((e,t)=>{let n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e},[]),m=i.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>h.includes(e.id));if(p||g){let e=[...g,...nm(p,m)],n=e.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);(l||a)&&(l&&t.setState({edges:i.filter(e=>!n.includes(e.id))}),a&&(p.forEach(e=>{r.delete(e.id)}),t.setState({nodeInternals:new Map(r)}))),n.length>0&&(u?.(e),d&&d(n.map(e=>({id:e,type:"remove"})))),p.length>0&&(s?.(p),c&&c(p.map(e=>({id:e.id,type:"remove"}))))}},[]),f=(0,y.useCallback)(e=>{let n=tW(e.width)&&tW(e.height)&&tW(e.x)&&tW(e.y),r=n?null:t.getState().nodeInternals.get(e.id);return n||r?[n?e:tY(r),r,n]:[null,null,n]},[]),h=(0,y.useCallback)((e,n=!0,r)=>{let[o,i,a]=f(e);return o?(r||t.getState().getNodes()).filter(e=>{if(!a&&(e.id===i.id||!e.positionAbsolute))return!1;let t=tK(tY(e),o);return n&&t>0||t>=o.width*o.height}):[]},[]),p=(0,y.useCallback)((e,t,n=!0)=>{let[r]=f(e);if(!r)return!1;let o=tK(r,t);return n&&o>0||o>=r.width*r.height},[]);return(0,y.useMemo)(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:a,setEdges:l,addNodes:s,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,o,i,a,l,s,u,c,d,h,p])}let re={actInsideInputWithModifier:!1},rt={position:"absolute",width:"100%",height:"100%",top:0,left:0},rn=e=>({x:e.x,y:e.y,zoom:e.k}),rr=(e,t)=>e.target.closest(`.${t}`),ro=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),ri=e=>{let t=e.ctrlKey&&tJ()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},ra=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),rl=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:s=c.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:h,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:x=!0,children:b,noWheelClassName:w,noPanClassName:_})=>{let S,E=(0,y.useRef)(),M=tP(),C=(0,y.useRef)(!1),k=(0,y.useRef)(!1),A=(0,y.useRef)(null),z=(0,y.useRef)({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:O,d3ZoomHandler:$,userSelectionActive:I}=tz(ra,N),R=nJ(v),T=(0,y.useRef)(0),D=(0,y.useRef)(!1),B=(0,y.useRef)();return S=tP(),(0,y.useEffect)(()=>{let e,t=()=>{if(!A.current)return;let e=tT(A.current);(0===e.height||0===e.width)&&S.getState().onError?.("004","The React Flow parent container needs a width and a height to render the graph."),S.setState({width:e.width||500,height:e.height||500})};return t(),window.addEventListener("resize",t),A.current&&(e=new ResizeObserver(()=>t())).observe(A.current),()=>{window.removeEventListener("resize",t),e&&A.current&&e.unobserve(A.current)}},[]),(0,y.useEffect)(()=>{if(A.current){let e=A.current.getBoundingClientRect(),t=tb().scaleExtent([m,g]).translateExtent(p),n=ev(A.current).call(t),r=td.translate(h.x,h.y).scale(tD(h.zoom,m,g)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,p);t.transform(n,i),t.wheelDelta(ri),M.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:A.current.closest(".react-flow")})}},[]),(0,y.useEffect)(()=>{O&&P&&(!a||R||I?void 0!==$&&O.on("wheel.zoom",function(e,t){if(!x&&"wheel"===e.type&&!e.ctrlKey||rr(e,w))return null;e.preventDefault(),$.call(this,e,t)},{passive:!1}):O.on("wheel.zoom",r=>{if(rr(r,w))return!1;r.preventDefault(),r.stopImmediatePropagation();let o=O.property("__zoom").k||1;if(r.ctrlKey&&i){let e=eC(r),t=o*Math.pow(2,ri(r));P.scaleTo(O,t,e,r);return}let a=1===r.deltaMode?20:1,u=s===c.Vertical?0:r.deltaX*a,d=s===c.Horizontal?0:r.deltaY*a;!tJ()&&r.shiftKey&&s!==c.Vertical&&(u=r.deltaY*a,d=0),P.translateBy(O,-(u/o)*l,-(d/o)*l,{internal:!0});let f=rn(O.property("__zoom")),{onViewportChangeStart:h,onViewportChange:p,onViewportChangeEnd:m}=M.getState();clearTimeout(B.current),D.current||(D.current=!0,t?.(r,f),h?.(f)),D.current&&(e?.(r,f),p?.(f),B.current=setTimeout(()=>{n?.(r,f),m?.(f),D.current=!1},150))},{passive:!1}))},[I,a,s,O,P,$,R,i,x,w,t,e,n]),(0,y.useEffect)(()=>{P&&P.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;T.current=e.sourceEvent?.button;let{onViewportChangeStart:n}=M.getState(),r=rn(e.transform);C.current=!0,z.current=r,e.sourceEvent?.type==="mousedown"&&M.setState({paneDragging:!0}),n?.(r),t?.(e.sourceEvent,r)})},[P,t]),(0,y.useEffect)(()=>{P&&(I&&!C.current?P.on("zoom",null):I||P.on("zoom",t=>{let{onViewportChange:n}=M.getState();if(M.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),k.current=!!(r&&ro(f,T.current??0)),(e||n)&&!t.sourceEvent?.internal){let r=rn(t.transform);n?.(r),e?.(t.sourceEvent,r)}}))},[I,P,e,f,r]),(0,y.useEffect)(()=>{P&&P.on("end",e=>{let t,o;if(!e.sourceEvent||e.sourceEvent.internal)return null;let{onViewportChangeEnd:i}=M.getState();if(C.current=!1,M.setState({paneDragging:!1}),r&&ro(f,T.current??0)&&!k.current&&r(e.sourceEvent),k.current=!1,(n||i)&&(t=z.current,o=e.transform,t.x!==o.x||t.y!==o.y||t.zoom!==o.k)){let t=rn(e.transform);z.current=t,clearTimeout(E.current),E.current=setTimeout(()=>{i?.(t),n?.(e.sourceEvent,t)},150*!!a)}})},[P,a,f,n,r]),(0,y.useEffect)(()=>{P&&P.filter(e=>{let t=R||o,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(rr(e,"react-flow__node")||rr(e,"react-flow__edge")))return!0;if(!f&&!t&&!a&&!u&&!i||I||!u&&"dblclick"===e.type||rr(e,w)&&"wheel"===e.type||rr(e,_)&&("wheel"!==e.type||a&&"wheel"===e.type&&!R)||!i&&e.ctrlKey&&"wheel"===e.type||!t&&!a&&!n&&"wheel"===e.type||!f&&("mousedown"===e.type||"touchstart"===e.type)||Array.isArray(f)&&!f.includes(e.button)&&"mousedown"===e.type)return!1;let r=Array.isArray(f)&&f.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[I,P,o,i,a,u,f,d,R]),y.default.createElement("div",{className:"react-flow__renderer",ref:A,style:rt},b)},rs=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ru(){let{userSelectionActive:e,userSelectionRect:t}=tz(rs,N);return e&&t?y.default.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function rc(e,t){let n=t.parentNode||t.parentId,r=e.find(e=>e.id===n);if(r){let e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){let e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){let e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function rd(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);let n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{let r=e.filter(e=>e.id===n.id);if(0===r.length)return t.push(n),t;let o={...n};for(let e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&rc(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&rc(t,o);break;case"remove":return t}return t.push(o),t},n)}function rf(e,t){return rd(e,t)}let rh=(e,t)=>({id:e,type:"select",selected:t});function rp(e,t){return e.reduce((e,n)=>{let r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(rh(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(rh(n.id,!1))),e},[])}let rm=(e,t)=>n=>{n.target===t.current&&e?.(n)},rg=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ry=(0,y.memo)(({isSelecting:e,selectionMode:t=d.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:s,onPaneMouseMove:u,onPaneMouseLeave:c,children:f})=>{let h=(0,y.useRef)(null),p=tP(),m=(0,y.useRef)(0),g=(0,y.useRef)(0),x=(0,y.useRef)(),{userSelectionActive:b,elementsSelectable:w,dragging:_}=tz(rg,N),S=()=>{p.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,g.current=0},E=e=>{i?.(e),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},M=w&&(e||b);return y.default.createElement("div",{className:v(["react-flow__pane",{dragging:_,selection:e}]),onClick:M?void 0:rm(E,h),onContextMenu:rm(e=>{Array.isArray(n)&&n?.includes(2)?e.preventDefault():a?.(e)},h),onWheel:rm(l?e=>l(e):void 0,h),onMouseEnter:M?void 0:s,onMouseDown:M?t=>{let{resetSelectedElements:n,domNode:o}=p.getState();if(x.current=o?.getBoundingClientRect(),!w||!e||0!==t.button||t.target!==h.current||!x.current)return;let{x:i,y:a}=tQ(t,x.current);n(),p.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),r?.(t)}:void 0,onMouseMove:M?n=>{let{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:l,onEdgesChange:s,nodeOrigin:u,getNodes:c}=p.getState();if(!e||!x.current||!r)return;p.setState({userSelectionActive:!0,nodesSelectionActive:!1});let f=tQ(n,x.current),h=r.startX??0,y=r.startY??0,v={...r,x:f.x<h?f.x:h,y:f.y<y?f.y:y,width:Math.abs(f.x-h),height:Math.abs(f.y-y)},b=c(),w=np(o,v,a,t===d.Partial,!0,u),_=nm(w,i).map(e=>e.id),S=w.map(e=>e.id);if(m.current!==S.length){m.current=S.length;let e=rp(b,S);e.length&&l?.(e)}if(g.current!==_.length){g.current=_.length;let e=rp(i,_);e.length&&s?.(e)}p.setState({userSelectionRect:v})}:u,onMouseUp:M?e=>{if(0!==e.button)return;let{userSelectionRect:t}=p.getState();!b&&t&&e.target===h.current&&E?.(e),p.setState({nodesSelectionActive:m.current>0}),S(),o?.(e)}:void 0,onMouseLeave:M?e=>{b&&(p.setState({nodesSelectionActive:m.current>0}),o?.(e)),S()}:c,ref:h,style:rt},f,y.default.createElement(ru,null))});function rv(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)break;r=r.parentElement}while(r)return!1}function rx(e,t,n,r,o=[0,0],i){var a;let l=(a=e.extent||r)&&"parent"!==a?[a[0],[a[1][0]-(e.width||0),a[1][1]-(e.height||0)]]:a,s=l,u=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&u&&"parent"!==e.extent){let{x:t,y:r}=nf(n.get(u),o).positionAbsolute;s=[[e.extent[0][0]+t,e.extent[0][1]+r],[e.extent[1][0]+t,e.extent[1][1]+r]]}}else if(u&&e.width&&e.height){let t=n.get(u),{x:r,y:i}=nf(t,o).positionAbsolute;s=t&&tW(r)&&tW(i)&&tW(t.width)&&tW(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:s}else i?.("005","Only child nodes can use a parent extent."),s=l;let c={x:0,y:0};u&&(c=nf(n.get(u),o).positionAbsolute);let d=s&&"parent"!==s?tB(t,s):t;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function rb({nodeId:e,dragItems:t,nodeInternals:n}){let r=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?r.find(t=>t.id===e):r[0],r]}ry.displayName="Pane";let rw=(e,t,n,r)=>{let o=t.querySelectorAll(e);if(!o||!o.length)return null;let i=Array.from(o),a=t.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return i.map(e=>{let t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-l.x)/n,y:(t.top-a.top-l.y)/n,...tT(e)}})};function r_(e,t,n){return void 0===n?n:r=>{let o=t().nodeInternals.get(e);o&&n(r,{...o})}}function rS({id:e,store:t,unselect:n=!1,nodeRef:r}){let o,{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:l,nodeInternals:s,onError:u}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&l)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):u?.("012",(o=e,`Node with id "${o}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`))}function rE(e){return(t,n,r)=>e?.(t,r)}function rM({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:a}){let l,s=tP(),[u,c]=(0,y.useState)(!1),d=(0,y.useRef)([]),f=(0,y.useRef)({x:null,y:null}),h=(0,y.useRef)(0),p=(0,y.useRef)(null),m=(0,y.useRef)({x:0,y:0}),g=(0,y.useRef)(null),v=(0,y.useRef)(!1),x=(0,y.useRef)(!1),b=(0,y.useRef)(!1),w=(l=tP(),(0,y.useCallback)(({sourceEvent:e})=>{let{transform:t,snapGrid:n,snapToGrid:r}=l.getState(),o=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,a={x:(o-t[0])/t[2],y:(i-t[1])/t[2]};return{xSnapped:r?n[0]*Math.round(a.x/n[0]):a.x,ySnapped:r?n[1]*Math.round(a.y/n[1]):a.y,...a}},[]));return(0,y.useEffect)(()=>{if(e?.current){let l=ev(e.current),u=({x:e,y:t})=>{let{nodeInternals:n,onNodeDrag:r,onSelectionDrag:i,updateNodePositions:a,nodeExtent:l,snapGrid:u,snapToGrid:h,nodeOrigin:p,onError:m}=s.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&l&&(v=tX(nh(d.current,p))),d.current=d.current.map(r=>{let o={x:e-r.distance.x,y:t-r.distance.y};h&&(o.x=u[0]*Math.round(o.x/u[0]),o.y=u[1]*Math.round(o.y/u[1]));let i=[[l[0][0],l[0][1]],[l[1][0],l[1][1]]];d.current.length>1&&l&&!r.extent&&(i[0][0]=r.positionAbsolute.x-v.x+l[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-v.x2+l[1][0],i[0][1]=r.positionAbsolute.y-v.y+l[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-v.y2+l[1][1]);let a=rx(r,o,n,i,p,m);return y=y||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r}),!y)return;a(d.current,!0,!0),c(!0);let x=o?r:rE(i);if(x&&g.current){let[e,t]=rb({nodeId:o,dragItems:d.current,nodeInternals:n});x(g.current,e,t)}},y=()=>{if(!p.current)return;let[e,t]=tH(m.current,p.current);if(0!==e||0!==t){let{transform:n,panBy:r}=s.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],r({x:e,y:t})&&u(f.current)}h.current=requestAnimationFrame(y)},_=t=>{let{nodeInternals:n,multiSelectionActive:r,nodesDraggable:l,unselectNodesAndEdges:u,onNodeDragStart:c,onSelectionDragStart:h}=s.getState();x.current=!0;let p=o?c:rE(h);a&&i||r||!o||n.get(o)?.selected||u(),o&&i&&a&&rS({id:o,store:s,nodeRef:e});let m=w(t);if(f.current=m,d.current=Array.from(n.values()).filter(e=>(e.selected||e.id===o)&&(!e.parentNode||e.parentId||!function e(t,n){let r=t.parentNode||t.parentId;if(!r)return!1;let o=n.get(r);return!!o&&(!!o.selected||e(o,n))}(e,n))&&(e.draggable||l&&void 0===e.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:m.x-(e.positionAbsolute?.x??0),y:m.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent})),p&&d.current){let[e,r]=rb({nodeId:o,dragItems:d.current,nodeInternals:n});p(t.sourceEvent,e,r)}};if(t)l.on(".drag",null);else{let t=(function(){var e,t,n,r,o=tS,i=tE,a=tM,l=tN,s={},u=k("start","drag","end"),c=0,d=0;function f(e){e.on("mousedown.drag",h).filter(l).on("touchstart.drag",g).on("touchmove.drag",y,ex).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(a,l){if(!r&&o.call(this,a,l)){var s=x(this,i.call(this,a,l),a,l,"mouse");s&&(ev(a.view).on("mousemove.drag",p,eb).on("mouseup.drag",m,eb),eS(a.view),ew(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function p(r){if(e_(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}s.mouse("drag",r)}function m(e){ev(e.view).on("mousemove.drag mouseup.drag",null),eE(e.view,n),e_(e),s.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,l=i.call(this,e,t),s=a.length;for(n=0;n<s;++n)(r=x(this,l,e,t,a[n].identifier,a[n]))&&(ew(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=s[r[t].identifier])&&(e_(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=s[o[t].identifier])&&(ew(e),n("end",e,o[t]))}function x(e,t,n,r,o,i){var l,d,h,p=u.copy(),m=eC(i||n,t);if(null!=(h=a.call(e,new t_("beforestart",{sourceEvent:n,target:f,identifier:o,active:c,x:m[0],y:m[1],dx:0,dy:0,dispatch:p}),r)))return l=h.x-m[0]||0,d=h.y-m[1]||0,function n(i,a,u){var g,y=m;switch(i){case"start":s[o]=n,g=c++;break;case"end":delete s[o],--c;case"drag":m=eC(u||a,t),g=c}p.call(i,e,new t_(i,{sourceEvent:a,subject:h,target:f,identifier:o,active:g,x:m[0]+l,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:p}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:tw(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:tw(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:tw(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:tw(!!e),f):l},f.on=function(){var e=u.on.apply(u,arguments);return e===u?f:e},f.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,f):Math.sqrt(d)},f})().on("start",e=>{let{domNode:t,nodeDragThreshold:n}=s.getState();0===n&&_(e),b.current=!1,f.current=w(e),p.current=t?.getBoundingClientRect()||null,m.current=tQ(e.sourceEvent,p.current)}).on("drag",e=>{let t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=s.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!v.current&&x.current&&n&&(v.current=!0,y()),!x.current){let n=t.xSnapped-(f?.current?.x??0),o=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+o*o)>r&&_(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&x.current&&(g.current=e.sourceEvent,m.current=tQ(e.sourceEvent,p.current),u(t))}}).on("end",e=>{if(x.current&&!b.current&&(c(!1),v.current=!1,x.current=!1,cancelAnimationFrame(h.current),d.current)){let{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:i}=s.getState(),a=o?r:rE(i);if(t(d.current,!1,!1),a){let[t,r]=rb({nodeId:o,dragItems:d.current,nodeInternals:n});a(e.sourceEvent,t,r)}}}).filter(t=>{let o=t.target;return!t.button&&(!n||!rv(o,`.${n}`,e))&&(!r||rv(o,r,e))});return l.call(t),()=>{l.on(".drag",null)}}}},[e,t,n,r,i,s,o,a,w]),u}function rN(){let e=tP();return(0,y.useCallback)(t=>{let{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:l,onError:s,nodesDraggable:u}=e.getState(),c=i().filter(e=>e.selected&&(e.draggable||u&&void 0===e.draggable)),d=a?l[0]:5,f=a?l[1]:5,h=t.isShiftPressed?4:1,p=t.x*d*h,m=t.y*f*h;o(c.map(e=>{if(e.positionAbsolute){let t={x:e.positionAbsolute.x+p,y:e.positionAbsolute.y+m};a&&(t.x=l[0]*Math.round(t.x/l[0]),t.y=l[1]*Math.round(t.y/l[1]));let{positionAbsolute:o,position:i}=rx(e,t,n,r,void 0,s);e.position=i,e.positionAbsolute=o}return e}),!0,!1)},[])}let rC={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var rk=e=>{let t=({id:t,type:n,data:r,xPos:o,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:s,onClick:u,onMouseEnter:c,onMouseMove:d,onMouseLeave:f,onContextMenu:h,onDoubleClick:p,style:m,className:g,isDraggable:x,isSelectable:b,isConnectable:w,isFocusable:_,selectNodesOnDrag:S,sourcePosition:E,targetPosition:M,hidden:N,resizeObserver:C,dragHandle:k,zIndex:A,isParent:z,noDragClassName:P,noPanClassName:O,initialized:$,disableKeyboardA11y:I,ariaLabel:R,rfId:T,hasHandleBounds:D})=>{let B=tP(),L=(0,y.useRef)(null),H=(0,y.useRef)(null),j=(0,y.useRef)(E),V=(0,y.useRef)(M),X=(0,y.useRef)(n),F=b||x||u||c||d||f,Y=rN(),K=r_(t,B.getState,c),W=r_(t,B.getState,d),Z=r_(t,B.getState,f),U=r_(t,B.getState,h),q=r_(t,B.getState,p);(0,y.useEffect)(()=>()=>{H.current&&(C?.unobserve(H.current),H.current=null)},[]),(0,y.useEffect)(()=>{if(L.current&&!N){let e=L.current;$&&D&&H.current===e||(H.current&&C?.unobserve(H.current),C?.observe(e),H.current=e)}},[N,$,D]),(0,y.useEffect)(()=>{let e=X.current!==n,r=j.current!==E,o=V.current!==M;L.current&&(e||r||o)&&(e&&(X.current=n),r&&(j.current=E),o&&(V.current=M),B.getState().updateNodeDimensions([{id:t,nodeElement:L.current,forceUpdate:!0}]))},[t,n,E,M]);let G=rM({nodeRef:L,disabled:N||!x,noDragClassName:P,handleSelector:k,nodeId:t,isSelectable:b,selectNodesOnDrag:S});return N?null:y.default.createElement("div",{className:v(["react-flow__node",`react-flow__node-${n}`,{[O]:x},g,{selected:s,selectable:b,parent:z,dragging:G}]),ref:L,style:{zIndex:A,transform:`translate(${a}px,${l}px)`,pointerEvents:F?"all":"none",visibility:$?"visible":"hidden",...m},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:K,onMouseMove:W,onMouseLeave:Z,onContextMenu:U,onClick:e=>{let{nodeDragThreshold:n}=B.getState();if(b&&(!S||!x||n>0)&&rS({id:t,store:B,nodeRef:L}),u){let n=B.getState().nodeInternals.get(t);n&&u(e,{...n})}},onDoubleClick:q,onKeyDown:_?e=>{tG(e)||!I&&(tU.includes(e.key)&&b?rS({id:t,store:B,unselect:"Escape"===e.key,nodeRef:L}):x&&s&&Object.prototype.hasOwnProperty.call(rC,e.key)&&(B.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~i}`}),Y({x:rC[e.key].x,y:rC[e.key].y,isShiftPressed:e.shiftKey})))}:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":I?void 0:`${nZ}-${T}`,"aria-label":R},y.default.createElement(ns,{value:t},y.default.createElement(e,{id:t,data:r,type:n,xPos:o,yPos:i,selected:s,isConnectable:w,sourcePosition:E,targetPosition:M,dragging:G,dragHandle:k,zIndex:A})))};return t.displayName="NodeWrapper",(0,y.memo)(t)};let rA=e=>({...nh(e.getNodes().filter(e=>e.selected),e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive});var rz=(0,y.memo)(function({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=tP(),{width:o,height:i,x:a,y:l,transformString:s,userSelectionActive:u}=tz(rA,N),c=rN(),d=(0,y.useRef)(null);if((0,y.useEffect)(()=>{n||d.current?.focus({preventScroll:!0})},[n]),rM({nodeRef:d}),u||!o||!i)return null;let f=e?t=>{e(t,r.getState().getNodes().filter(e=>e.selected))}:void 0;return y.default.createElement("div",{className:v(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s}},y.default.createElement("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(rC,e.key)&&c({x:rC[e.key].x,y:rC[e.key].y,isShiftPressed:e.shiftKey})},style:{width:o,height:i,top:l,left:a}}))});let rP=e=>e.nodesSelectionActive,rO=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:s,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:_,panOnScroll:S,panOnScrollSpeed:E,panOnScrollMode:M,zoomOnDoubleClick:N,panOnDrag:C,defaultViewport:k,translateExtent:A,minZoom:z,maxZoom:P,preventScrolling:O,onSelectionContextMenu:$,noWheelClassName:I,noPanClassName:R,disableKeyboardA11y:T})=>{let D=tz(rP),B=nJ(d),L=nJ(v),H=L||C,j=L||S,V=B||f&&!0!==H;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{let n=tP(),{deleteElements:r}=n9(),o=nJ(e,re),i=nJ(t);(0,y.useEffect)(()=>{if(o){let{edges:e,getNodes:t}=n.getState();r({nodes:t().filter(e=>e.selected),edges:e.filter(e=>e.selected)}),n.setState({nodesSelectionActive:!1})}},[o]),(0,y.useEffect)(()=>{n.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:l,multiSelectionKeyCode:g}),y.default.createElement(rl,{onMove:s,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:_,panOnScroll:j,panOnScrollSpeed:E,panOnScrollMode:M,zoomOnDoubleClick:N,panOnDrag:!B&&H,defaultViewport:k,translateExtent:A,minZoom:z,maxZoom:P,zoomActivationKeyCode:x,preventScrolling:O,noWheelClassName:I,noPanClassName:R},y.default.createElement(ry,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:H,isSelecting:!!V,selectionMode:h},e,D&&y.default.createElement(rz,{onSelectionContextMenu:$,noPanClassName:R,disableKeyboardA11y:T})))};rO.displayName="FlowRenderer";var r$=(0,y.memo)(rO);function rI(e){let t={input:rk(e.input||nO),default:rk(e.default||nz),output:rk(e.output||nI),group:rk(e.group||nR)},n=Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=rk(e[n]||nz),t),{});return{...t,...n}}let rR=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),rT=e=>{var t;let{nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,updateNodeDimensions:a,onError:l}=tz(rR,N),s=(t=e.onlyRenderVisibleElements,tz((0,y.useCallback)(e=>t?np(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[t]))),u=(0,y.useRef)(),c=(0,y.useMemo)(()=>{if("u"<typeof ResizeObserver)return null;let e=new ResizeObserver(e=>{a(e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0})))});return u.current=e,e},[]);return(0,y.useEffect)(()=>()=>{u?.current?.disconnect()},[]),y.default.createElement("div",{className:"react-flow__nodes",style:rt},s.map(t=>{let a,s=t.type||"default";e.nodeTypes[s]||(l?.("003",(a=s,`Node type "${a}" not found. Using fallback type "default".`)),s="default");let u=e.nodeTypes[s]||e.nodeTypes.default,d=!!(t.draggable||n&&void 0===t.draggable),f=!!(t.selectable||i&&void 0===t.selectable),h=!!(t.connectable||r&&void 0===t.connectable),m=!!(t.focusable||o&&void 0===t.focusable),g=e.nodeExtent?tB(t.positionAbsolute,e.nodeExtent):t.positionAbsolute,v=g?.x??0,x=g?.y??0,b=(({x:e,y:t,width:n,height:r,origin:o})=>!n||!r||o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]})({x:v,y:x,width:t.width??0,height:t.height??0,origin:e.nodeOrigin});return y.default.createElement(u,{key:t.id,id:t.id,className:t.className,style:t.style,type:s,data:t.data,sourcePosition:t.sourcePosition||p.Bottom,targetPosition:t.targetPosition||p.Top,hidden:t.hidden,xPos:v,yPos:x,xPosOrigin:b.x,yPosOrigin:b.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!t.selected,isDraggable:d,isSelectable:f,isConnectable:h,isFocusable:m,resizeObserver:c,dragHandle:t.dragHandle,zIndex:t[tZ]?.z??0,isParent:!!t[tZ]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!t.width&&!!t.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:t.ariaLabel,hasHandleBounds:!!t[tZ]?.handleBounds})}))};rT.displayName="NodeRenderer";var rD=(0,y.memo)(rT);let rB="react-flow__edgeupdater",rL=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:a,type:l})=>y.default.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:a,className:v([rB,`${rB}-${l}`]),cx:e===p.Left?t-r:e===p.Right?t+r:t,cy:e===p.Top?n-r:e===p.Bottom?n+r:n,r:r,stroke:"transparent",fill:"transparent"}),rH=()=>!0;var rj=e=>{let t=({id:t,className:n,type:r,data:o,onClick:i,onEdgeDoubleClick:a,selected:l,animated:s,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,source:g,target:x,sourceX:b,sourceY:w,targetX:_,targetY:S,sourcePosition:E,targetPosition:M,elementsSelectable:N,hidden:C,sourceHandleId:k,targetHandleId:A,onContextMenu:z,onMouseEnter:P,onMouseMove:O,onMouseLeave:$,reconnectRadius:I,onReconnect:R,onReconnectStart:T,onReconnectEnd:D,markerEnd:B,markerStart:L,rfId:H,ariaLabel:j,isFocusable:V,isReconnectable:X,pathOptions:F,interactionWidth:Y,disableKeyboardA11y:K})=>{let W=(0,y.useRef)(null),[Z,U]=(0,y.useState)(!1),[q,G]=(0,y.useState)(!1),Q=tP(),J=(0,y.useMemo)(()=>`url('#${nu(L,H)}')`,[L,H]),ee=(0,y.useMemo)(()=>`url('#${nu(B,H)}')`,[B,H]);if(C)return null;let et=t1(t,Q.getState,a),en=t1(t,Q.getState,z),er=t1(t,Q.getState,P),eo=t1(t,Q.getState,O),ei=t1(t,Q.getState,$),ea=(e,n)=>{if(0!==e.button)return;let{edges:r,isValidConnection:o}=Q.getState(),i=n?x:g,a=(n?A:k)||null,l=n?"target":"source",s=r.find(e=>e.id===t);G(!0),T?.(e,s,l),nE({event:e,handleId:a,nodeId:i,onConnect:e=>R?.(s,e),isTarget:n,getState:Q.getState,setState:Q.setState,isValidConnection:o||rH,edgeUpdaterType:l,onReconnectEnd:e=>{G(!1),D?.(e,s,l)}})},el=()=>U(!0),es=()=>U(!1);return y.default.createElement("g",{className:v(["react-flow__edge",`react-flow__edge-${r}`,n,{selected:l,animated:s,inactive:!N&&!i,updating:Z}]),onClick:e=>{let{edges:n,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=Q.getState(),l=n.find(e=>e.id===t);l&&(N&&(Q.setState({nodesSelectionActive:!1}),l.selected&&a?(o({nodes:[],edges:[l]}),W.current?.blur()):r([t])),i&&i(e,l))},onDoubleClick:et,onContextMenu:en,onMouseEnter:er,onMouseMove:eo,onMouseLeave:ei,onKeyDown:V?e=>{if(!K&&tU.includes(e.key)&&N){let{unselectNodesAndEdges:n,addSelectedEdges:r,edges:o}=Q.getState();"Escape"===e.key?(W.current?.blur(),n({edges:[o.find(e=>e.id===t)]})):r([t])}}:void 0,tabIndex:V?0:void 0,role:V?"button":"img","data-testid":`rf__edge-${t}`,"aria-label":null===j?void 0:j||`Edge from ${g} to ${x}`,"aria-describedby":V?`${nU}-${H}`:void 0,ref:W},!q&&y.default.createElement(e,{id:t,source:g,target:x,selected:l,animated:s,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,data:o,style:m,sourceX:b,sourceY:w,targetX:_,targetY:S,sourcePosition:E,targetPosition:M,sourceHandleId:k,targetHandleId:A,markerStart:J,markerEnd:ee,pathOptions:F,interactionWidth:Y}),X&&y.default.createElement(y.default.Fragment,null,("source"===X||!0===X)&&y.default.createElement(rL,{position:E,centerX:b,centerY:w,radius:I,onMouseDown:e=>ea(e,!0),onMouseEnter:el,onMouseOut:es,type:"source"}),("target"===X||!0===X)&&y.default.createElement(rL,{position:M,centerX:_,centerY:S,radius:I,onMouseDown:e=>ea(e,!1),onMouseEnter:el,onMouseOut:es,type:"target"})))};return t.displayName="EdgeWrapper",(0,y.memo)(t)};function rV(e){let t={default:rj(e.default||na),straight:rj(e.bezier||nn),step:rj(e.step||nt),smoothstep:rj(e.step||ne),simplebezier:rj(e.simplebezier||t6)},n=Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=rj(e[n]||na),t),{});return{...t,...n}}function rX(e,t,n=null){let r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case p.Top:return{x:r+i/2,y:o};case p.Right:return{x:r+i,y:o+a/2};case p.Bottom:return{x:r+i/2,y:o+a};case p.Left:return{x:r,y:o+a/2}}}function rF(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function rY(e){let t=e?.[tZ]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}let rK=[{level:0,isMaxLevel:!0,edges:[]}],rW={[h.Arrow]:({color:e="none",strokeWidth:t=1})=>y.default.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[h.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>y.default.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},rZ=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{let s,u=(s=tP(),(0,y.useMemo)(()=>{let e;return Object.prototype.hasOwnProperty.call(rW,t)?rW[t]:(s.getState().onError?.("009",(e=t,`Marker type "${e}" doesn't exist.`)),null)},[t]));return u?y.default.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},y.default.createElement(u,{color:n,strokeWidth:a})):null},rU=({defaultColor:e,rfId:t})=>{let n=tz((0,y.useCallback)((({defaultColor:e,rfId:t})=>n=>{let r=[];return n.edges.reduce((n,o)=>([o.markerStart,o.markerEnd].forEach(o=>{if(o&&"object"==typeof o){let i=nu(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:e,rfId:t}),[e,t]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return y.default.createElement("defs",null,n.map(e=>y.default.createElement(rZ,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient})))};rU.displayName="MarkerDefinitions";var rq=(0,y.memo)(rU);let rG=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),rQ=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:x,children:b,disableKeyboardA11y:w})=>{let{edgesFocusable:_,edgesUpdatable:S,elementsSelectable:E,width:M,height:C,connectionMode:k,nodeInternals:A,onError:z}=tz(rG,N),P=function(e,t,n=!1){let r=-1,o=Object.entries(e.reduce((e,o)=>{let i=tW(o.zIndex),a=i?o.zIndex:0;if(n){let e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,l=Math.max(n?.[tZ]?.z||0,e?.[tZ]?.z||0,1e3);a=(i?o.zIndex:0)+(r?l:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e},{})).map(([e,t])=>{let n=+e;return{edges:t,level:n,isMaxLevel:n===r}});return 0===o.length?rK:o}(tz((0,y.useCallback)(e=>t?e.edges.filter(t=>{let n=A.get(t.source),r=A.get(t.target);return n?.width&&n?.height&&r?.width&&r?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,height:l,transform:s}){let u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);let c=tX({x:(0-s[0])/s[2],y:(0-s[1])/s[2],width:a/s[2],height:l/s[2]});return Math.ceil(Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x))*Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y)))>0}({sourcePos:n.positionAbsolute||{x:0,y:0},targetPos:r.positionAbsolute||{x:0,y:0},sourceWidth:n.width,sourceHeight:n.height,targetWidth:r.width,targetHeight:r.height,width:e.width,height:e.height,transform:e.transform})}):e.edges,[t,A])),A,n);return M?y.default.createElement(y.default.Fragment,null,P.map(({level:t,edges:n,isMaxLevel:b})=>y.default.createElement("svg",{key:t,style:{zIndex:t},width:M,height:C,className:"react-flow__edges react-flow__container"},b&&y.default.createElement(rq,{defaultColor:e,rfId:r}),y.default.createElement("g",null,n.map(e=>{let t,n,b,[M,N,C]=rY(A.get(e.source)),[P,O,$]=rY(A.get(e.target));if(!C||!$)return null;let I=e.type||"default";o[I]||(z?.("011",(t=I,`Edge type "${t}" not found. Using fallback type "default".`)),I="default");let R=o[I]||o.default,T=k===u.Strict?O.target:(O.target??[]).concat(O.source??[]),D=rF(N.source,e.sourceHandle),B=rF(T,e.targetHandle),L=D?.position||p.Bottom,H=B?.position||p.Top,j=!!(e.focusable||_&&void 0===e.focusable),V=e.reconnectable||e.updatable;if(!D||!B){let t,n;return z?.("008",(t=D,n=e,`Couldn't create edge for ${!t?"source":"target"} handle id: "${!t?n.sourceHandle:n.targetHandle}", edge id: ${n.id}.`)),null}let{sourceX:X,sourceY:F,targetX:Y,targetY:K}=(n=rX(L,M,D),b=rX(H,P,B),{sourceX:n.x,sourceY:n.y,targetX:b.x,targetY:b.y});return y.default.createElement(R,{key:e.id,id:e.id,className:v([e.className,i]),type:I,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:X,sourceY:F,targetX:Y,targetY:K,sourcePosition:L,targetPosition:H,elementsSelectable:E,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,onClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:x,rfId:r,ariaLabel:e.ariaLabel,isFocusable:j,isReconnectable:void 0!==h&&(V||S&&void 0===V),pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:w})})))),b):null};rQ.displayName="EdgeRenderer";var rJ=(0,y.memo)(rQ);let r0=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function r1({children:e}){let t=tz(r0);return y.default.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}let r2={[p.Left]:p.Right,[p.Right]:p.Left,[p.Top]:p.Bottom,[p.Bottom]:p.Top},r3=({nodeId:e,handleType:t,style:n,type:r=f.Bezier,CustomComponent:o,connectionStatus:i})=>{let{fromNode:a,handleId:l,toX:s,toY:c,connectionMode:d}=tz((0,y.useCallback)(t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode}),[e]),N),h=a?.[tZ]?.handleBounds,p=h?.[t];if(d===u.Loose&&(p=p||h?.["source"===t?"target":"source"]),!a||!p)return null;let m=l?p.find(e=>e.id===l):p[0],g=m?m.x+m.width/2:(a.width??0)/2,v=m?m.y+m.height/2:a.height??0,x=(a.positionAbsolute?.x??0)+g,b=(a.positionAbsolute?.y??0)+v,w=m?.position,_=w?r2[w]:null;if(!w||!_)return null;if(o)return y.default.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:m,fromX:x,fromY:b,toX:s,toY:c,fromPosition:w,toPosition:_,connectionStatus:i});let S="",E={sourceX:x,sourceY:b,sourcePosition:w,targetX:s,targetY:c,targetPosition:_};return r===f.Bezier?[S]=ni(E):r===f.Step?[S]=t9({...E,borderRadius:0}):r===f.SmoothStep?[S]=t9(E):r===f.SimpleBezier?[S]=t4(E):S=`M${x},${b} ${s},${c}`,y.default.createElement("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};r3.displayName="ConnectionLine";let r5=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function r4({containerStyle:e,style:t,type:n,component:r}){let{nodeId:o,handleType:i,nodesConnectable:a,width:l,height:s,connectionStatus:u}=tz(r5,N);return o&&i&&l&&a?y.default.createElement("svg",{style:e,width:l,height:s,className:"react-flow__edges react-flow__connectionline react-flow__container"},y.default.createElement("g",{className:v(["react-flow__connection",u])},y.default.createElement(r3,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u}))):null}function r6(e,t){return(0,y.useRef)(null),tP(),(0,y.useMemo)(()=>t(e),[e])}let r7=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:s,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:g,connectionLineType:v,connectionLineStyle:x,connectionLineComponent:b,connectionLineContainerStyle:w,selectionKeyCode:_,selectionOnDrag:S,selectionMode:E,multiSelectionKeyCode:M,panActivationKeyCode:N,zoomActivationKeyCode:C,deleteKeyCode:k,onlyRenderVisibleElements:A,elementsSelectable:z,selectNodesOnDrag:P,defaultViewport:O,translateExtent:$,minZoom:I,maxZoom:R,preventScrolling:T,defaultMarkerColor:D,zoomOnScroll:B,zoomOnPinch:L,panOnScroll:H,panOnScrollSpeed:j,panOnScrollMode:V,zoomOnDoubleClick:X,panOnDrag:F,onPaneClick:Y,onPaneMouseEnter:K,onPaneMouseMove:W,onPaneMouseLeave:Z,onPaneScroll:U,onPaneContextMenu:q,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:et,onReconnectStart:en,onReconnectEnd:er,reconnectRadius:eo,noDragClassName:ei,noWheelClassName:ea,noPanClassName:el,elevateEdgesOnSelect:es,disableKeyboardA11y:eu,nodeOrigin:ec,nodeExtent:ed,rfId:ef})=>{let eh,ep,em=r6(e,rI),eg=r6(t,rV);return eh=n9(),ep=(0,y.useRef)(!1),(0,y.useEffect)(()=>{!ep.current&&eh.viewportInitialized&&i&&(setTimeout(()=>i(eh),1),ep.current=!0)},[i,eh.viewportInitialized]),y.default.createElement(r$,{onPaneClick:Y,onPaneMouseEnter:K,onPaneMouseMove:W,onPaneMouseLeave:Z,onPaneContextMenu:q,onPaneScroll:U,deleteKeyCode:k,selectionKeyCode:_,selectionOnDrag:S,selectionMode:E,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:M,panActivationKeyCode:N,zoomActivationKeyCode:C,elementsSelectable:z,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:B,zoomOnPinch:L,zoomOnDoubleClick:X,panOnScroll:H,panOnScrollSpeed:j,panOnScrollMode:V,panOnDrag:F,defaultViewport:O,translateExtent:$,minZoom:I,maxZoom:R,onSelectionContextMenu:p,preventScrolling:T,noDragClassName:ei,noWheelClassName:ea,noPanClassName:el,disableKeyboardA11y:eu},y.default.createElement(r1,null,y.default.createElement(rJ,{edgeTypes:eg,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:A,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:et,onReconnectStart:en,onReconnectEnd:er,reconnectRadius:eo,defaultMarkerColor:D,noPanClassName:el,elevateEdgesOnSelect:!!es,disableKeyboardA11y:eu,rfId:ef},y.default.createElement(r4,{style:x,type:v,component:b,containerStyle:w})),y.default.createElement("div",{className:"react-flow__edgelabel-renderer"}),y.default.createElement(rD,{nodeTypes:em,onNodeClick:a,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:P,onlyRenderVisibleElements:A,noPanClassName:el,noDragClassName:ei,disableKeyboardA11y:eu,nodeOrigin:ec,nodeExtent:ed,rfId:ef})))};r7.displayName="GraphView";var r8=(0,y.memo)(r7);let r9=[[-1/0,-1/0],[1/0,1/0]],oe={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:r9,nodeExtent:r9,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:u.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:tq,isValidConnection:void 0},ot=({children:e})=>{let t,n,r=(0,y.useRef)(null);return r.current||(t=(e,t)=>({...oe,setNodes:n=>{let{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:n3(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{let{defaultEdgeOptions:r={}}=t();e({edges:n.map(e=>({...r,...e}))})},setDefaultNodesAndEdges:(n,r)=>{let o=void 0!==n,i=void 0!==r;e({nodeInternals:o?n3(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{let{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:s,nodeOrigin:u}=t(),c=s?.querySelector(".react-flow__viewport");if(!c)return;let d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((e,t)=>{let n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[tZ]:{...n[tZ],handleBounds:void 0}});else if(n){let r=tT(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[tZ]:{...n[tZ],handleBounds:{source:rw(".source",t.nodeElement,f,u),target:rw(".target",t.nodeElement,f,u)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);n2(o,u);let p=a||i&&!a&&n5(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:p}),h?.length>0&&r?.(h)},updateNodePositions:(e,n=!0,r=!1)=>{let{triggerNodeChanges:o}=t();o(e.map(e=>{let t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}))},triggerNodeChanges:n=>{let{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:s}=t();n?.length&&(i&&e({nodeInternals:n3(rf(n,l()),o,a,s)}),r?.(n))},addSelectedNodes:n=>{let r,{multiSelectionActive:o,edges:i,getNodes:a}=t(),l=null;o?r=n.map(e=>rh(e,!0)):(r=rp(a(),n),l=rp(i,[])),n4({changedNodes:r,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{let r,{multiSelectionActive:o,edges:i,getNodes:a}=t(),l=null;o?r=n.map(e=>rh(e,!0)):(r=rp(i,n),l=rp(a(),[])),n4({changedNodes:l,changedEdges:r,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{let{edges:o,getNodes:i}=t();n4({changedNodes:(n||i()).map(e=>(e.selected=!1,rh(e.id,!1))),changedEdges:(r||o).map(e=>rh(e.id,!1)),get:t,set:e})},setMinZoom:n=>{let{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{let{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{let{edges:n,getNodes:r}=t();n4({changedNodes:r().filter(e=>e.selected).map(e=>rh(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>rh(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{let{nodeInternals:r}=t();r.forEach(e=>{e.positionAbsolute=tB(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{let{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:l}=t();if(!i||!a||!e.x&&!e.y)return!1;let s=td.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),u=i?.constrain()(s,[[0,0],[r,o]],l);return i.transform(a,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:oe.connectionNodeId,connectionHandleId:oe.connectionHandleId,connectionHandleType:oe.connectionHandleType,connectionStatus:oe.connectionStatus,connectionStartHandle:oe.connectionStartHandle,connectionEndHandle:oe.connectionEndHandle}),reset:()=>e({...oe})}),n=Object.is,r.current=t?M(t,n):M),y.default.createElement(tk,{value:r.current},e)};ot.displayName="ReactFlowProvider";let on=({children:e})=>(0,y.useContext)(tC)?y.default.createElement(y.default.Fragment,null,e):y.default.createElement(ot,null,e);on.displayName="ReactFlowWrapper";let or={input:nO,default:nz,output:nI,group:nR},oo={default:na,straight:nn,step:nt,smoothstep:ne,simplebezier:t6},oi=[0,0],oa=[15,15],ol={x:0,y:0,zoom:1},os={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ou=(0,y.forwardRef)(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=or,edgeTypes:a=oo,onNodeClick:l,onEdgeClick:s,onInit:h,onMove:p,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:b,onConnectEnd:w,onClickConnectStart:_,onClickConnectEnd:S,onNodeMouseEnter:E,onNodeMouseMove:M,onNodeMouseLeave:N,onNodeContextMenu:C,onNodeDoubleClick:k,onNodeDragStart:A,onNodeDrag:z,onNodeDragStop:P,onNodesDelete:O,onEdgesDelete:$,onSelectionChange:I,onSelectionDragStart:R,onSelectionDrag:T,onSelectionDragStop:D,onSelectionContextMenu:B,onSelectionStart:L,onSelectionEnd:H,connectionMode:j=u.Strict,connectionLineType:V=f.Bezier,connectionLineStyle:X,connectionLineComponent:F,connectionLineContainerStyle:Y,deleteKeyCode:K="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:Z=!1,selectionMode:U=d.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:G=tJ()?"Meta":"Control",zoomActivationKeyCode:Q=tJ()?"Meta":"Control",snapToGrid:J=!1,snapGrid:ee=oa,onlyRenderVisibleElements:et=!1,selectNodesOnDrag:en=!0,nodesDraggable:er,nodesConnectable:eo,nodesFocusable:ei,nodeOrigin:ea=oi,edgesFocusable:el,edgesUpdatable:es,elementsSelectable:eu,defaultViewport:ec=ol,minZoom:ed=.5,maxZoom:ef=2,translateExtent:eh=r9,preventScrolling:ep=!0,nodeExtent:em,defaultMarkerColor:eg="#b1b1b7",zoomOnScroll:ey=!0,zoomOnPinch:ev=!0,panOnScroll:ex=!1,panOnScrollSpeed:eb=.5,panOnScrollMode:ew=c.Free,zoomOnDoubleClick:e_=!0,panOnDrag:eS=!0,onPaneClick:eE,onPaneMouseEnter:eM,onPaneMouseMove:eN,onPaneMouseLeave:eC,onPaneScroll:ek,onPaneContextMenu:eA,children:ez,onEdgeContextMenu:eP,onEdgeDoubleClick:eO,onEdgeMouseEnter:e$,onEdgeMouseMove:eI,onEdgeMouseLeave:eR,onEdgeUpdate:eT,onEdgeUpdateStart:eD,onEdgeUpdateEnd:eB,onReconnect:eL,onReconnectStart:eH,onReconnectEnd:ej,reconnectRadius:eV=10,edgeUpdaterRadius:eX=10,onNodesChange:eF,onEdgesChange:eY,noDragClassName:eK="nodrag",noWheelClassName:eW="nowheel",noPanClassName:eZ="nopan",fitView:eU=!1,fitViewOptions:eq,connectOnClick:eG=!0,attributionPosition:eQ,proOptions:eJ,defaultEdgeOptions:e0,elevateNodesOnSelect:e1=!0,elevateEdgesOnSelect:e2=!1,disableKeyboardA11y:e3=!1,autoPanOnConnect:e5=!0,autoPanOnNodeDrag:e4=!0,connectionRadius:e6=20,isValidConnection:e7,onError:e8,style:e9,id:te,nodeDragThreshold:tt,...tn},tr)=>{let to=te||"1";return y.default.createElement("div",{...tn,style:{...e9,...os},ref:tr,className:v(["react-flow",o]),"data-testid":"rf__wrapper",id:te},y.default.createElement(on,null,y.default.createElement(r8,{onInit:h,onMove:p,onMoveStart:m,onMoveEnd:g,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:E,onNodeMouseMove:M,onNodeMouseLeave:N,onNodeContextMenu:C,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:a,connectionLineType:V,connectionLineStyle:X,connectionLineComponent:F,connectionLineContainerStyle:Y,selectionKeyCode:W,selectionOnDrag:Z,selectionMode:U,deleteKeyCode:K,multiSelectionKeyCode:G,panActivationKeyCode:q,zoomActivationKeyCode:Q,onlyRenderVisibleElements:et,selectNodesOnDrag:en,defaultViewport:ec,translateExtent:eh,minZoom:ed,maxZoom:ef,preventScrolling:ep,zoomOnScroll:ey,zoomOnPinch:ev,zoomOnDoubleClick:e_,panOnScroll:ex,panOnScrollSpeed:eb,panOnScrollMode:ew,panOnDrag:eS,onPaneClick:eE,onPaneMouseEnter:eM,onPaneMouseMove:eN,onPaneMouseLeave:eC,onPaneScroll:ek,onPaneContextMenu:eA,onSelectionContextMenu:B,onSelectionStart:L,onSelectionEnd:H,onEdgeContextMenu:eP,onEdgeDoubleClick:eO,onEdgeMouseEnter:e$,onEdgeMouseMove:eI,onEdgeMouseLeave:eR,onReconnect:eL??eT,onReconnectStart:eH??eD,onReconnectEnd:ej??eB,reconnectRadius:eV??eX,defaultMarkerColor:eg,noDragClassName:eK,noWheelClassName:eW,noPanClassName:eZ,elevateEdgesOnSelect:e2,rfId:to,disableKeyboardA11y:e3,nodeOrigin:ea,nodeExtent:em}),y.default.createElement(nY,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:b,onConnectEnd:w,onClickConnectStart:_,onClickConnectEnd:S,nodesDraggable:er,nodesConnectable:eo,nodesFocusable:ei,edgesFocusable:el,edgesUpdatable:es,elementsSelectable:eu,elevateNodesOnSelect:e1,minZoom:ed,maxZoom:ef,nodeExtent:em,onNodesChange:eF,onEdgesChange:eY,snapToGrid:J,snapGrid:ee,connectionMode:j,translateExtent:eh,connectOnClick:eG,defaultEdgeOptions:e0,fitView:eU,fitViewOptions:eq,onNodesDelete:O,onEdgesDelete:$,onNodeDragStart:A,onNodeDrag:z,onNodeDragStop:P,onSelectionDrag:T,onSelectionDragStart:R,onSelectionDragStop:D,noPanClassName:eZ,nodeOrigin:ea,rfId:to,autoPanOnConnect:e5,autoPanOnNodeDrag:e4,onError:e8,connectionRadius:e6,isValidConnection:e7,nodeDragThreshold:tt}),y.default.createElement(nj,{onSelectionChange:I}),ez,y.default.createElement(tI,{proOptions:eJ,position:eQ}),y.default.createElement(nQ,{rfId:to,disableKeyboardA11y:e3})))});function oc(e){return t=>{let[n,r]=(0,y.useState)(t),o=(0,y.useCallback)(t=>r(n=>e(t,n)),[]);return[n,r,o]}}ou.displayName="ReactFlow";let od=oc(rf),of=oc(function(e,t){return rd(e,t)});function oh({color:e,dimensions:t,lineWidth:n}){return y.default.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function op({color:e,radius:t}){return y.default.createElement("circle",{cx:t,cy:t,r:t,fill:e})}(l=m||(m={})).Lines="lines",l.Dots="dots",l.Cross="cross";let om={[m.Dots]:"#91919a",[m.Lines]:"#eee",[m.Cross]:"#e2e2e2"},og={[m.Dots]:1,[m.Lines]:1,[m.Cross]:6},oy=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ov({id:e,variant:t=m.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:a,style:l,className:s}){let u=(0,y.useRef)(null),{transform:c,patternId:d}=tz(oy,N),f=a||om[t],h=r||og[t],p=t===m.Dots,g=t===m.Cross,x=Array.isArray(n)?n:[n,n],b=[x[0]*c[2]||1,x[1]*c[2]||1],w=h*c[2],_=g?[w,w]:b,S=p?[w/i,w/i]:[_[0]/i,_[1]/i];return y.default.createElement("svg",{className:v(["react-flow__background",s]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},y.default.createElement("pattern",{id:d+e,x:c[0]%b[0],y:c[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`},p?y.default.createElement(op,{color:f,radius:w/i}):y.default.createElement(oh,{dimensions:_,color:f,lineWidth:o})),y.default.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${d+e})`}))}ov.displayName="Background";var ox=(0,y.memo)(ov);function ob(){return y.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},y.default.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function ow(){return y.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},y.default.createElement("path",{d:"M0 0h32v4.2H0z"}))}function o_(){return y.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},y.default.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function oS(){return y.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},y.default.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function oE(){return y.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},y.default.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}let oM=({children:e,className:t,...n})=>y.default.createElement("button",{type:"button",className:v(["react-flow__controls-button",t]),...n},e);oM.displayName="ControlButton";let oN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),oC=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:s,className:u,children:c,position:d="bottom-left"})=>{let f=tP(),[h,p]=(0,y.useState)(!1),{isInteractive:m,minZoomReached:g,maxZoomReached:x}=tz(oN,N),{zoomIn:b,zoomOut:w,fitView:_}=n9();return((0,y.useEffect)(()=>{p(!0)},[]),h)?y.default.createElement(t$,{className:v(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls"},t&&y.default.createElement(y.default.Fragment,null,y.default.createElement(oM,{onClick:()=>{b(),i?.()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:x},y.default.createElement(ob,null)),y.default.createElement(oM,{onClick:()=>{w(),a?.()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:g},y.default.createElement(ow,null))),n&&y.default.createElement(oM,{className:"react-flow__controls-fitview",onClick:()=>{_(o),l?.()},title:"fit view","aria-label":"fit view"},y.default.createElement(o_,null)),r&&y.default.createElement(oM,{className:"react-flow__controls-interactive",onClick:()=>{f.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),s?.(!m)},title:"toggle interactivity","aria-label":"toggle interactivity"},m?y.default.createElement(oE,null):y.default.createElement(oS,null)),c):null};oC.displayName="Controls";var ok=(0,y.memo)(oC);let oA=({id:e,x:t,y:n,width:r,height:o,style:i,color:a,strokeColor:l,strokeWidth:s,className:u,borderRadius:c,shapeRendering:d,onClick:f,selected:h})=>{let{background:p,backgroundColor:m}=i||{};return y.default.createElement("rect",{className:v(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,fill:a||p||m,stroke:l,strokeWidth:s,shapeRendering:d,onClick:f?t=>f(t,e):void 0})};oA.displayName="MiniMapNode";var oz=(0,y.memo)(oA);let oP=e=>e.nodeOrigin,oO=e=>e.getNodes().filter(e=>!e.hidden&&e.width&&e.height),o$=e=>e instanceof Function?e:()=>e;var oI=(0,y.memo)(function({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:i=oz,onClick:a}){let l=tz(oO,N),s=tz(oP),u=o$(t),c=o$(e),d=o$(n),f="u"<typeof window||window.chrome?"crispEdges":"geometricPrecision";return y.default.createElement(y.default.Fragment,null,l.map(e=>{let{x:t,y:n}=nf(e,s).positionAbsolute;return y.default.createElement(i,{key:e.id,x:t,y:n,width:e.width,height:e.height,style:e.style,selected:e.selected,className:d(e),color:u(e),borderRadius:r,strokeColor:c(e),strokeWidth:o,shapeRendering:f,onClick:a,id:e.id})}))});let oR=e=>{let t,n=e.getNodes(),r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:n.length>0?(t=nh(n,e.nodeOrigin),tF(tV(tX(t),tX(r)))):r,rfId:e.rfId}};function oT({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:s="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:c=1,position:d="bottom-right",onClick:f,onNodeClick:h,pannable:p=!1,zoomable:m=!1,ariaLabel:g="React Flow mini map",inversePan:x=!1,zoomStep:b=10,offsetScale:w=5}){let _=tP(),S=(0,y.useRef)(null),{boundingRect:E,viewBB:M,rfId:C}=tz(oR,N),k=e?.width??200,A=e?.height??150,z=Math.max(E.width/k,E.height/A),P=z*k,O=z*A,$=w*z,I=E.x-(P-E.width)/2-$,R=E.y-(O-E.height)/2-$,T=P+2*$,D=O+2*$,B=`react-flow__minimap-desc-${C}`,L=(0,y.useRef)(0);L.current=z,(0,y.useEffect)(()=>{if(S.current){let e=ev(S.current),t=tb().on("zoom",p?e=>{let{transform:t,d3Selection:n,d3Zoom:r,translateExtent:o,width:i,height:a}=_.getState();if("mousemove"!==e.sourceEvent.type||!n||!r)return;let l=L.current*Math.max(1,t[2])*(x?-1:1),s={x:t[0]-e.sourceEvent.movementX*l,y:t[1]-e.sourceEvent.movementY*l},u=td.translate(s.x,s.y).scale(t[2]),c=r.constrain()(u,[[0,0],[i,a]],o);r.transform(n,c)}:null).on("zoom.wheel",m?e=>{let{transform:t,d3Selection:n,d3Zoom:r}=_.getState();if("wheel"!==e.sourceEvent.type||!n||!r)return;let o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*b,i=t[2]*Math.pow(2,o);r.scaleTo(n,i)}:null);return e.call(t),()=>{e.on("zoom",null)}}},[p,m,x,b]);let H=f?e=>{let t=eC(e);f(e,{x:t[0],y:t[1]})}:void 0,j=h?(e,t)=>{h(e,_.getState().nodeInternals.get(t))}:void 0;return y.default.createElement(t$,{position:d,style:e,className:v(["react-flow__minimap",t]),"data-testid":"rf__minimap"},y.default.createElement("svg",{width:k,height:A,viewBox:`${I} ${R} ${T} ${D}`,role:"img","aria-labelledby":B,ref:S,onClick:H},g&&y.default.createElement("title",{id:B},g),y.default.createElement(oI,{onClick:j,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:l}),y.default.createElement("path",{className:"react-flow__minimap-mask",d:`M${I-$},${R-$}h${T+2*$}v${D+2*$}h${-T-2*$}z
2
+ M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fill:s,fillRule:"evenodd",stroke:u,strokeWidth:c,pointerEvents:"none"})))}oT.displayName="MiniMap";var oD=(0,y.memo)(oT),oB=e.i(74064),oL=e.i(37757),oH=e.i(72854);let oj={graphNode:function({data:e}){let t="blocked"===e.status||"block"===e.status;return(0,g.jsxs)("div",{className:`
3
+ px-3.5 py-2.5 rounded-lg border bg-white shadow-xs min-w-[150px] max-w-[190px]
4
+ transition-all duration-150 cursor-pointer hover:shadow-md
5
+ ${t?"border-red-400 bg-red-50/40 ring-2 ring-red-200":"border-slate-200 hover:border-slate-300"}
6
+ `,children:[(0,g.jsx)(nk,{type:"target",position:p.Top,style:{background:"#94a3b8",border:"none",width:6,height:6}}),(0,g.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,g.jsx)("span",{className:"text-xs font-semibold text-slate-900 truncate",children:e.label}),t?(0,g.jsx)("span",{className:"w-2 h-2 rounded-full bg-red-600"}):(0,g.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-600"})]}),(0,g.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.trust&&(0,g.jsx)("span",{className:`text-[10px] font-mono px-1.5 py-0.2 rounded border ${"high"===e.trust?"bg-emerald-50 text-emerald-800 border-emerald-200":"untrusted"===e.trust?"bg-red-50 text-red-800 border-red-200 font-bold":"bg-slate-100 text-slate-700 border-slate-200"}`,children:e.trust}),"TAINTED"===e.taint&&(0,g.jsx)("span",{className:"text-[10px] font-mono px-1.5 py-0.2 rounded bg-amber-50 text-amber-800 border-amber-200 font-bold",children:"TAINTED"}),t&&(0,g.jsx)("span",{className:"text-[10px] font-mono px-1.5 py-0.2 rounded bg-red-100 text-red-800 border-red-300 font-bold",children:"BLOCKED"})]}),(0,g.jsx)(nk,{type:"source",position:p.Bottom,style:{background:"#94a3b8",border:"none",width:6,height:6}})]})}};e.s(["default",0,function(){let[e,,t]=od(oB.ATTACK_FLOW_NODES.map(e=>({...e,type:"graphNode"}))),[n,,r]=of(oB.ATTACK_FLOW_EDGES.map(e=>({...e,style:{stroke:e.data?.blocked?"#dc2626":"#94a3b8",strokeWidth:e.data?.blocked?2.5:1.5,strokeDasharray:e.data?.blocked?"5 5":void 0}}))),[o,i]=(0,y.useState)(null),a=(0,y.useCallback)((e,t)=>{i(t.data)},[]);return(0,g.jsxs)("div",{className:"p-8 space-y-6 max-w-7xl mx-auto",children:[(0,g.jsx)(oL.PageHeader,{title:"Attack Graph & Taint Flow",subtitle:"Visual directed acyclic graph mapping provenance, untrusted inputs, taint propagation, and policy block points",badge:"Provenance DAG"}),(0,g.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg shadow-xs overflow-hidden",children:[(0,g.jsxs)("div",{className:"p-4 border-b border-slate-200 flex items-center justify-between text-xs text-slate-600 bg-slate-50/50",children:[(0,g.jsxs)("div",{className:"flex items-center gap-4",children:[(0,g.jsx)("span",{className:"font-semibold text-slate-900",children:"DAG Legend:"}),(0,g.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,g.jsx)("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500"}),(0,g.jsx)("span",{children:"Verified Clean"})]}),(0,g.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,g.jsx)("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-500"}),(0,g.jsx)("span",{children:"Tainted State"})]}),(0,g.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,g.jsx)("span",{className:"w-2.5 h-2.5 rounded-full bg-red-600"}),(0,g.jsx)("span",{children:"Policy Intercept / Block"})]})]}),(0,g.jsx)("span",{className:"text-[11px] text-slate-500 font-mono",children:"Scroll to zoom • Drag to pan"})]}),(0,g.jsx)("div",{className:"h-[520px] w-full bg-slate-50/30",children:(0,g.jsxs)(ou,{nodes:e,edges:n,onNodesChange:t,onEdgesChange:r,onNodeClick:a,nodeTypes:oj,fitView:!0,children:[(0,g.jsx)(ox,{variant:m.Dots,gap:16,size:1,color:"#cbd5e1"}),(0,g.jsx)(ok,{className:"!bg-white !border !border-slate-200 !shadow-xs !rounded-md"}),(0,g.jsx)(oD,{className:"!bg-white !border !border-slate-200 !rounded-md",nodeColor:e=>e.data?.status==="blocked"?"#ef4444":e.data?.taint==="TAINTED"?"#f59e0b":"#10b981"})]})})]}),o&&(0,g.jsxs)("div",{className:"p-4 bg-white border border-slate-200 rounded-lg shadow-xs space-y-2",children:[(0,g.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Node Inspector"}),(0,g.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-bold text-slate-900 text-sm",children:o.label}),(0,g.jsxs)("span",{className:"text-slate-500 ml-2 font-mono",children:["type: ",o.type]})]}),(0,g.jsxs)("div",{className:"flex items-center gap-2",children:[o.trust&&(0,g.jsx)("span",{className:"font-mono text-slate-700 bg-slate-100 px-2 py-0.5 rounded border border-slate-200",children:o.trust}),(0,g.jsx)(oH.StatusBadge,{status:"blocked"===o.status?"BLOCK":"ALLOW"})]})]})]})]})}],45716)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63676,e=>{"use strict";var t=e.i(56420);let s={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};s.node;let a=(0,t.default)(s);e.s(["X",0,a],63676)},45759,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(26091),l=e.i(37757),r=e.i(68442),i=e.i(32471),n=e.i(49744),d=e.i(3469);let o=[{report_id:"rpt_phase5_adaptive",title:"Phase 5 Adaptive Campaign Scorecard",type:"OFFENSIVE",generated_at:"2026-09-19T11:00:00Z",format:"JSON + Markdown",path:"reports/phase5/adaptive_dashboard.json",summary:"70 attack variants tested across 10 seed trees. 100% empirical prevention rate. 0 bypasses. 0 sensitive DB calls.",status:"READY"},{report_id:"rpt_phase5_campaign_md",title:"Phase 5 Campaign Summary (Markdown)",type:"OFFENSIVE",generated_at:"2026-09-19T11:00:00Z",format:"Markdown",path:"reports/phase5/adaptive_campaign_summary.md",summary:"Human-readable summary with mutation lineage, bypass evidence, and remediation verification.",status:"READY"},{report_id:"rpt_security_posture",title:"Daily Security Posture Report",type:"POSTURE",generated_at:"2026-09-19T09:00:00Z",format:"Markdown",path:"reports/daily/2026-09-19-posture.md",summary:"189 decisions. 100% enforcement uptime. 4 HITL escalations. 5 active agents. Policy engine nominal.",status:"READY"},{report_id:"rpt_forensics_export",title:"Incident Forensics Export",type:"FORENSICS",generated_at:"2026-09-19T10:50:00Z",format:"JSON",path:"reports/forensics/2026-09-19-incidents.json",summary:"2 active incidents exported with full evidence chains, delegation graphs, and provenance maps.",status:"READY"},{report_id:"rpt_compliance",title:"Monthly Compliance Audit Log",type:"COMPLIANCE",generated_at:"2026-09-19T07:22:00Z",format:"PDF",path:"reports/compliance/2026-09-audit.pdf",summary:"All 174 passing tests verified. Zero policy violations in production. Audit trail complete.",status:"READY"}],c={OFFENSIVE:"bg-red-50 text-red-700 border-red-200",POSTURE:"bg-blue-50 text-blue-700 border-blue-200",FORENSICS:"bg-purple-50 text-purple-700 border-purple-200",COMPLIANCE:"bg-emerald-50 text-emerald-700 border-emerald-200"};e.s(["default",0,function(){let[e,x]=(0,s.useState)(""),[m,p]=(0,s.useState)("ALL"),[h,u]=(0,s.useState)(null),b=o.filter(t=>{let s=t.title.toLowerCase().includes(e.toLowerCase())||t.summary.toLowerCase().includes(e.toLowerCase())||t.report_id.toLowerCase().includes(e.toLowerCase()),a="ALL"===m||t.type===m;return s&&a}),f=[{key:"title",header:"Report Title",render:e=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded bg-slate-100 flex items-center justify-center text-slate-600 border border-slate-200",children:(0,t.jsx)(a.FileText,{size:13})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold text-xs text-slate-900",children:e.title}),(0,t.jsx)("div",{className:"text-[11px] font-mono text-slate-500",children:e.path})]})]})},{key:"type",header:"Category",width:"130px",render:e=>(0,t.jsx)("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded border ${c[e.type]}`,children:e.type})},{key:"format",header:"Format",width:"120px",render:e=>(0,t.jsx)("span",{className:"text-xs text-slate-600 font-mono bg-slate-50 px-2 py-0.5 rounded border border-slate-200",children:e.format})},{key:"generated_at",header:"Generated",width:"140px",render:e=>(0,t.jsx)("span",{className:"text-xs text-slate-500",children:new Date(e.generated_at).toLocaleDateString()})},{key:"status",header:"Status",width:"100px",render:e=>(0,t.jsx)("span",{className:"text-[11px] font-semibold text-emerald-700 bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200",children:e.status})}];return(0,t.jsxs)("div",{className:"p-8 space-y-6 max-w-7xl mx-auto",children:[(0,t.jsx)(l.PageHeader,{title:"Security Reports & Artifacts",subtitle:"Downloadable compliance audits, offensive campaign summaries, and forensic investigation exports",badge:"Audit & Compliance"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,t.jsx)(r.MetricCard,{label:"Total Reports",value:o.length}),(0,t.jsx)(r.MetricCard,{label:"Offensive Scorecards",value:o.filter(e=>"OFFENSIVE"===e.type).length,status:"ALLOW"}),(0,t.jsx)(r.MetricCard,{label:"Forensic Exports",value:o.filter(e=>"FORENSICS"===e.type).length,status:"ALLOW"}),(0,t.jsx)(r.MetricCard,{label:"Compliance Audits",value:o.filter(e=>"COMPLIANCE"===e.type).length,status:"ALLOW"})]}),(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg p-5 shadow-xs space-y-4",children:[(0,t.jsx)(i.FilterBar,{searchQuery:e,onSearchChange:x,searchPlaceholder:"Search reports by title or path...",filters:[{key:"type",label:"Category",options:[{label:"All Categories",value:"ALL"},{label:"Offensive",value:"OFFENSIVE"},{label:"Posture",value:"POSTURE"},{label:"Forensics",value:"FORENSICS"},{label:"Compliance",value:"COMPLIANCE"}],value:m,onChange:p}],activeCount:"ALL"!==m||e?1:0,onReset:()=>{x(""),p("ALL")}}),(0,t.jsx)(n.DataTable,{columns:f,data:b,keyField:"report_id",onRowClick:e=>u(e),emptyMessage:"No reports matched your search criteria."})]}),(0,t.jsx)(d.DetailDrawer,{isOpen:!!h,onClose:()=>u(null),title:h?h.title:"",subtitle:h?`ID: ${h.report_id} • ${h.format}`:"",badge:h?(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded border ${c[h.type]}`,children:h.type}):null,children:h&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"p-3.5 bg-slate-50 border border-slate-200 rounded-lg space-y-1.5",children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-500",children:"Executive Summary"}),(0,t.jsx)("p",{className:"text-xs text-slate-800 leading-relaxed",children:h.summary})]}),(0,t.jsxs)("div",{className:"space-y-2 text-xs text-slate-600",children:[(0,t.jsxs)("div",{className:"flex justify-between py-1.5 border-b border-slate-100",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Filesystem Location"}),(0,t.jsx)("span",{className:"font-mono text-slate-900",children:h.path})]}),(0,t.jsxs)("div",{className:"flex justify-between py-1.5 border-b border-slate-100",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Generated At"}),(0,t.jsx)("span",{className:"font-mono",children:new Date(h.generated_at).toUTCString()})]}),(0,t.jsxs)("div",{className:"flex justify-between py-1.5",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Artifact Status"}),(0,t.jsx)("span",{className:"font-semibold text-emerald-700",children:h.status})]})]})]})})]})}])},49744,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(56420);let l={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};l.node;let r=(0,a.default)(l);var i=e.i(67927);let n={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};n.node;let d=(0,a.default)(n);e.s(["DataTable",0,function({columns:e,data:a,keyExtractor:l,keyField:n,onRowClick:o,selectedKey:c,emptyMessage:x="No records found",emptySubtext:m="Try adjusting your filters or search query.",pageSize:p=15,isLoading:h=!1}){let[u,b]=s.default.useState(1),f=Math.max(1,Math.ceil(a.length/p)),g=a.slice((u-1)*p,u*p);return s.default.useEffect(()=>{b(1)},[a.length]),(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg shadow-sm overflow-hidden flex flex-col",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left border-collapse text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{className:"bg-slate-50 border-b border-slate-200",children:e.map(e=>(0,t.jsx)("th",{style:{width:e.width},className:`px-3.5 py-2.5 font-semibold text-slate-600 uppercase tracking-wider text-[10px] ${"right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"}`,children:e.header},e.key))})}),(0,t.jsx)("tbody",{className:"divide-y divide-slate-100",children:h?(0,t.jsx)("tr",{children:(0,t.jsxs)("td",{colSpan:e.length,className:"py-12 text-center text-slate-400",children:[(0,t.jsx)("div",{className:"inline-block animate-spin rounded-full h-5 w-5 border-2 border-slate-300 border-t-sky-600 mb-2"}),(0,t.jsx)("div",{className:"text-xs",children:"Loading telemetry records…"})]})}):0===g.length?(0,t.jsx)("tr",{children:(0,t.jsxs)("td",{colSpan:e.length,className:"py-12 text-center",children:[(0,t.jsx)(d,{size:28,className:"mx-auto text-slate-300 mb-2"}),(0,t.jsx)("div",{className:"text-sm font-semibold text-slate-700",children:x}),(0,t.jsx)("div",{className:"text-xs text-slate-400 mt-0.5",children:m})]})}):g.map((s,a)=>{let r=l?l(s,a):n&&s[n]?String(s[n]):String(s.id||s.key||a),i=c===r;return(0,t.jsx)("tr",{onClick:()=>o&&o(s),className:`transition-colors ${i?"bg-sky-50/80 font-medium":"hover:bg-slate-50/80"} ${o?"cursor-pointer":""}`,children:e.map(e=>{let l=s[e.key],r=e.render?e.render(s,a):l;return(0,t.jsx)("td",{className:`px-3.5 py-2.5 text-slate-700 ${e.mono?"font-mono text-[11px]":""} ${"right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"}`,children:r},e.key)})},r)})})]})}),a.length>p&&(0,t.jsxs)("div",{className:"px-4 py-2.5 border-t border-slate-200 bg-slate-50 flex items-center justify-between text-xs text-slate-500",children:[(0,t.jsxs)("div",{children:["Showing ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:(u-1)*p+1})," to"," ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:Math.min(u*p,a.length)})," ","of ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:a.length})," records"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>b(e=>Math.max(1,e-1)),disabled:1===u,className:"p-1 rounded border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50 transition-colors",children:(0,t.jsx)(r,{size:14})}),(0,t.jsxs)("span",{className:"px-2 font-mono text-[11px]",children:[u," / ",f]}),(0,t.jsx)("button",{onClick:()=>b(e=>Math.min(f,e+1)),disabled:u===f,className:"p-1 rounded border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50 transition-colors",children:(0,t.jsx)(i.ChevronRight,{size:14})})]})]})]})}],49744)},3469,e=>{"use strict";var t=e.i(43476),s=e.i(63676);e.s(["DetailDrawer",0,function({isOpen:e,onClose:a,title:l,subtitle:r,badge:i,children:n,footer:d,width:o="w-full md:w-[480px]"}){return e?(0,t.jsxs)("div",{className:"fixed inset-y-0 right-0 z-50 flex",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-slate-900/20 backdrop-blur-[1px] transition-opacity",onClick:a}),(0,t.jsxs)("div",{className:`relative ${o} bg-white shadow-2xl border-l border-slate-200 flex flex-col h-full z-10 transition-transform`,children:[(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-slate-200 flex items-start justify-between gap-3 bg-slate-50/50",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-slate-900 truncate",children:l}),i]}),r&&(0,t.jsx)("p",{className:"text-xs text-slate-500 font-mono mt-0.5 truncate",children:r})]}),(0,t.jsx)("button",{onClick:a,className:"p-1 rounded-md text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition-colors",children:(0,t.jsx)(s.X,{size:18})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-5 space-y-5 text-sm text-slate-700",children:n}),d&&(0,t.jsx)("div",{className:"px-5 py-3 border-t border-slate-200 bg-slate-50 flex items-center justify-end gap-2",children:d})]})]}):null}])},32471,e=>{"use strict";var t=e.i(43476),s=e.i(66595),a=e.i(95925);e.s(["FilterBar",0,function({searchQuery:e,onSearchChange:l,searchPlaceholder:r="Search records…",dropdowns:i,filters:n,onReset:d,activeCount:o,totalCount:c,actions:x}){let m=n||i;return(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg p-3 mb-4 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5 flex-1",children:[l&&(0,t.jsxs)("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[(0,t.jsx)(s.Search,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400"}),(0,t.jsx)("input",{type:"text",value:e??"",onChange:e=>l(e.target.value),placeholder:r,className:"w-full pl-8 pr-3 py-1.5 text-xs bg-slate-50 border border-slate-200 rounded-md text-slate-800 placeholder:text-slate-400 focus:bg-white focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 transition-all"})]}),m&&m.map(e=>(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:(0,t.jsx)("select",{value:e.value,onChange:t=>e.onChange(t.target.value),className:"text-xs bg-slate-50 border border-slate-200 rounded-md px-2.5 py-1.5 text-slate-700 font-medium focus:bg-white focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 transition-all cursor-pointer",children:e.options.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})},e.key||e.name||e.label)),d&&(0,t.jsxs)("button",{onClick:d,className:"flex items-center gap-1 text-xs text-slate-500 hover:text-slate-800 px-2 py-1.5 rounded hover:bg-slate-100 transition-colors",title:"Reset Filters",children:[(0,t.jsx)(a.RotateCcw,{size:12}),(0,t.jsx)("span",{children:"Reset"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 self-end md:self-auto text-xs text-slate-500",children:[void 0!==c&&(0,t.jsx)("span",{className:"font-mono text-slate-600",children:void 0!==o&&o!==c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{className:"text-slate-900",children:o})," of ",c]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{className:"text-slate-900",children:c})," total"]})}),x]})]})}])},68442,e=>{"use strict";var t=e.i(43476);e.s(["MetricCard",0,function({label:e,value:s,subtext:a,trend:l,status:r="neutral",icon:i,badge:n}){return(0,t.jsxs)("div",{className:`bg-white rounded-lg border border-slate-200 p-4 shadow-sm ${{healthy:"border-l-4 border-l-emerald-500",warning:"border-l-4 border-l-amber-500",critical:"border-l-4 border-l-red-500",neutral:"border-l-4 border-l-slate-300"}["ALLOW"===r||"MONITOR"===r||"healthy"===r?"healthy":"HITL"===r||"warning"===r?"warning":"BLOCK"===r||"critical"===r?"critical":"neutral"]} flex flex-col justify-between`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-medium tracking-wider uppercase text-slate-500",children:e}),i&&(0,t.jsx)(i,{size:16,className:"text-slate-400"}),n&&(0,t.jsx)("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-slate-100 text-slate-700",children:n})]}),(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2 mt-1",children:[(0,t.jsx)("div",{className:"text-2xl font-bold tracking-tight text-slate-900 font-mono",children:s}),l&&(0,t.jsx)("span",{className:`text-xs font-medium ${l.isNeutral?"text-slate-500":l.isPositive?"text-emerald-700":"text-red-700"}`,children:l.value})]}),a&&(0,t.jsx)("div",{className:"mt-2 text-xs text-slate-500 truncate",children:a})]})}])},37757,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(22016),l=e.i(67927);e.s(["PageHeader",0,function({title:e,description:r,subtitle:i,breadcrumbs:n,actions:d,badge:o}){let c=r||i;return(0,t.jsxs)("div",{className:"mb-6 pb-4 border-b border-slate-200",children:[n&&n.length>0&&(0,t.jsx)("nav",{className:"flex items-center gap-1.5 text-xs text-slate-500 mb-2",children:n.map((e,r)=>{let i=r===n.length-1;return(0,t.jsxs)(s.default.Fragment,{children:[r>0&&(0,t.jsx)(l.ChevronRight,{size:12,className:"text-slate-400"}),e.href&&!i?(0,t.jsx)(a.default,{href:e.href,className:"hover:text-slate-800 transition-colors",children:e.label}):(0,t.jsx)("span",{className:i?"text-slate-900 font-medium":"",children:e.label})]},r)})}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold text-slate-900 tracking-tight",children:e}),o&&(0,t.jsx)("div",{children:o})]}),c&&(0,t.jsx)("p",{className:"mt-1 text-xs text-slate-500 max-w-3xl leading-relaxed",children:c})]}),d&&(0,t.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:d})]})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63676,e=>{"use strict";var t=e.i(56420);let s={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};s.node;let a=(0,t.default)(s);e.s(["X",0,a],63676)},43447,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(37757),l=e.i(32471),r=e.i(49744),n=e.i(72854),i=e.i(3469),d=e.i(56420);let o={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};o.node;let c=(0,d.default)(o);var x=e.i(6537),m=e.i(79432);let p=[{agent_id:"agt_orch001",name:"orchestrator-001",role:"Central Workflow Orchestrator",status:"ACTIVE",trust_level:"HIGH",authority_scope:"delegate, report_generation",active_tasks:2,tools_count:5,risk_rating:"LOW",last_activity:"1 min ago",capabilities:["delegate","report_generation","task_dispatch"],allowed_resources:["task_queue","internal_docs","reporting_bucket"]},{agent_id:"agt_res002",name:"research-agent-001",role:"Market & Web Research Worker",status:"ACTIVE",trust_level:"MEDIUM",authority_scope:"public_search, sec_filings (read-only)",active_tasks:1,tools_count:3,risk_rating:"MEDIUM",last_activity:"3 mins ago",capabilities:["public_search","sec_filings_read"],parent_agent:"orchestrator-001",allowed_resources:["public_web","sec_cache"]},{agent_id:"agt_ana003",name:"analysis-agent-001",role:"Financial Analytics & Metrics Agent",status:"ACTIVE",trust_level:"HIGH",authority_scope:"data_analysis, metrics_read",active_tasks:1,tools_count:4,risk_rating:"LOW",last_activity:"Just now",capabilities:["data_analysis","metrics_read","chart_render"],parent_agent:"orchestrator-001",allowed_resources:["finance_ledger","metrics_store"]},{agent_id:"agt_ext009",name:"external-mcp-agent",role:"Third-Party Ingestion Bot",status:"QUARANTINED",trust_level:"UNTRUSTED",authority_scope:"none (revoked by incident INC-1048)",active_tasks:0,tools_count:1,risk_rating:"CRITICAL",last_activity:"45 mins ago",capabilities:["untrusted_ingest"],allowed_resources:[]}];e.s(["default",0,function(){let[e,d]=(0,s.useState)(""),[o,u]=(0,s.useState)("ALL"),[b,h]=(0,s.useState)("ALL"),[g,f]=(0,s.useState)(p[0]),[j,N]=(0,s.useState)(!1),v=(0,s.useMemo)(()=>p.filter(t=>{if(e){let s=e.toLowerCase();if(!(t.agent_id.toLowerCase().includes(s)||t.name.toLowerCase().includes(s)||t.role.toLowerCase().includes(s)||t.authority_scope.toLowerCase().includes(s)))return!1}return("ALL"===o||t.trust_level===o)&&("ALL"===b||t.status===b)}),[e,o,b]),y=[{key:"name",header:"Agent Identity",render:e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold text-slate-900 flex items-center gap-1.5",children:(0,t.jsx)("span",{children:e.name})}),(0,t.jsx)("div",{className:"font-mono text-[10px] text-slate-400",children:e.agent_id})]})},{key:"status",header:"Status",width:"120px",render:e=>(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-bold ${"ACTIVE"===e.status?"bg-emerald-50 text-emerald-800 border border-emerald-200":"bg-red-50 text-red-800 border border-red-200"}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${"ACTIVE"===e.status?"bg-emerald-600":"bg-red-600"}`}),e.status]})},{key:"trust_level",header:"Trust Level",width:"110px",render:e=>(0,t.jsx)(n.TrustBadge,{trust:e.trust_level})},{key:"authority_scope",header:"Declared Authority Scope",render:e=>(0,t.jsx)("span",{className:"font-mono text-[11px] text-slate-600",children:e.authority_scope})},{key:"active_tasks",header:"Tasks",align:"center",width:"70px",render:e=>(0,t.jsx)("span",{className:"font-mono font-semibold text-slate-800",children:e.active_tasks})},{key:"tools_count",header:"Tools",align:"center",width:"70px",render:e=>(0,t.jsx)("span",{className:"font-mono text-slate-600",children:e.tools_count})},{key:"risk_rating",header:"Risk",width:"90px",render:e=>(0,t.jsx)(n.SeverityBadge,{severity:e.risk_rating})},{key:"last_activity",header:"Last Activity",align:"right",width:"110px",render:e=>(0,t.jsx)("span",{className:"text-slate-400 text-[11px]",children:e.last_activity})}];return(0,t.jsxs)("div",{className:"max-w-[1600px] mx-auto",children:[(0,t.jsx)(a.PageHeader,{title:"Agents",description:"Catalog of registered autonomous agents, cryptographic identities, delegated authority scopes, and continuous behavioral baselines.",breadcrumbs:[{label:"Operations",href:"/dashboard"},{label:"Agents"}]}),(0,t.jsx)(l.FilterBar,{searchQuery:e,onSearchChange:d,searchPlaceholder:"Search agents by ID, name, capability…",totalCount:p.length,activeCount:v.length,onReset:()=>{d(""),u("ALL"),h("ALL")},dropdowns:[{name:"trust",label:"Trust",value:o,onChange:u,options:[{label:"All Trust Levels",value:"ALL"},{label:"HIGH",value:"HIGH"},{label:"MEDIUM",value:"MEDIUM"},{label:"UNTRUSTED",value:"UNTRUSTED"}]},{name:"status",label:"Status",value:b,onChange:h,options:[{label:"All Statuses",value:"ALL"},{label:"ACTIVE",value:"ACTIVE"},{label:"QUARANTINED",value:"QUARANTINED"}]}]}),(0,t.jsx)(r.DataTable,{columns:y,data:v,keyExtractor:e=>e.agent_id,onRowClick:e=>{f(e),N(!0)},selectedKey:g?.agent_id}),(0,t.jsx)(i.DetailDrawer,{isOpen:j,onClose:()=>N(!1),title:`Agent: ${g?.name}`,subtitle:g?.agent_id,badge:g&&(0,t.jsx)(n.TrustBadge,{trust:g.trust_level}),children:g&&(0,t.jsxs)("div",{className:"space-y-5 text-xs",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 p-3 bg-slate-50 border border-slate-200 rounded-lg",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-400 block",children:"STATUS"}),(0,t.jsx)("span",{className:"font-semibold text-slate-900",children:g.status})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-400 block",children:"ROLE"}),(0,t.jsx)("span",{className:"text-slate-700",children:g.role})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-400 block",children:"PARENT AGENT"}),(0,t.jsx)("span",{className:"font-mono text-slate-800",children:g.parent_agent||"Root (None)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-400 block",children:"RISK POSTURE"}),(0,t.jsx)(n.SeverityBadge,{severity:g.risk_rating})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(c,{size:13,className:"text-slate-400"}),(0,t.jsx)("span",{children:"Declared Capabilities"})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:g.capabilities.map(e=>(0,t.jsx)("span",{className:"px-2 py-1 bg-slate-100 border border-slate-200 text-slate-800 font-mono text-[11px] rounded",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(x.Lock,{size:13,className:"text-slate-400"}),(0,t.jsx)("span",{children:"Reachable Resources"})]}),(0,t.jsx)("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-3 space-y-1.5",children:g.allowed_resources.length>0?g.allowed_resources.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-slate-700 font-mono text-[11px]",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),(0,t.jsx)("span",{children:e})]},e)):(0,t.jsx)("span",{className:"text-slate-400 italic",children:"No resources accessible"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(m.Activity,{size:13,className:"text-slate-400"}),(0,t.jsx)("span",{children:"Behavioral Baseline"})]}),(0,t.jsxs)("div",{className:"p-3 bg-white border border-slate-200 rounded-lg space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Anomaly Rate"}),(0,t.jsx)("span",{className:"font-mono font-bold text-emerald-700",children:"0.0% (Stable)"})]}),(0,t.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Entropy Score"}),(0,t.jsx)("span",{className:"font-mono text-slate-800",children:"1.21 / 5.0"})]})]})]})]})})]})}],43447)},49744,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(56420);let l={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};l.node;let r=(0,a.default)(l);var n=e.i(67927);let i={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};i.node;let d=(0,a.default)(i);e.s(["DataTable",0,function({columns:e,data:a,keyExtractor:l,keyField:i,onRowClick:o,selectedKey:c,emptyMessage:x="No records found",emptySubtext:m="Try adjusting your filters or search query.",pageSize:p=15,isLoading:u=!1}){let[b,h]=s.default.useState(1),g=Math.max(1,Math.ceil(a.length/p)),f=a.slice((b-1)*p,b*p);return s.default.useEffect(()=>{h(1)},[a.length]),(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg shadow-sm overflow-hidden flex flex-col",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left border-collapse text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{className:"bg-slate-50 border-b border-slate-200",children:e.map(e=>(0,t.jsx)("th",{style:{width:e.width},className:`px-3.5 py-2.5 font-semibold text-slate-600 uppercase tracking-wider text-[10px] ${"right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"}`,children:e.header},e.key))})}),(0,t.jsx)("tbody",{className:"divide-y divide-slate-100",children:u?(0,t.jsx)("tr",{children:(0,t.jsxs)("td",{colSpan:e.length,className:"py-12 text-center text-slate-400",children:[(0,t.jsx)("div",{className:"inline-block animate-spin rounded-full h-5 w-5 border-2 border-slate-300 border-t-sky-600 mb-2"}),(0,t.jsx)("div",{className:"text-xs",children:"Loading telemetry records…"})]})}):0===f.length?(0,t.jsx)("tr",{children:(0,t.jsxs)("td",{colSpan:e.length,className:"py-12 text-center",children:[(0,t.jsx)(d,{size:28,className:"mx-auto text-slate-300 mb-2"}),(0,t.jsx)("div",{className:"text-sm font-semibold text-slate-700",children:x}),(0,t.jsx)("div",{className:"text-xs text-slate-400 mt-0.5",children:m})]})}):f.map((s,a)=>{let r=l?l(s,a):i&&s[i]?String(s[i]):String(s.id||s.key||a),n=c===r;return(0,t.jsx)("tr",{onClick:()=>o&&o(s),className:`transition-colors ${n?"bg-sky-50/80 font-medium":"hover:bg-slate-50/80"} ${o?"cursor-pointer":""}`,children:e.map(e=>{let l=s[e.key],r=e.render?e.render(s,a):l;return(0,t.jsx)("td",{className:`px-3.5 py-2.5 text-slate-700 ${e.mono?"font-mono text-[11px]":""} ${"right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"}`,children:r},e.key)})},r)})})]})}),a.length>p&&(0,t.jsxs)("div",{className:"px-4 py-2.5 border-t border-slate-200 bg-slate-50 flex items-center justify-between text-xs text-slate-500",children:[(0,t.jsxs)("div",{children:["Showing ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:(b-1)*p+1})," to"," ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:Math.min(b*p,a.length)})," ","of ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:a.length})," records"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>h(e=>Math.max(1,e-1)),disabled:1===b,className:"p-1 rounded border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50 transition-colors",children:(0,t.jsx)(r,{size:14})}),(0,t.jsxs)("span",{className:"px-2 font-mono text-[11px]",children:[b," / ",g]}),(0,t.jsx)("button",{onClick:()=>h(e=>Math.min(g,e+1)),disabled:b===g,className:"p-1 rounded border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50 transition-colors",children:(0,t.jsx)(n.ChevronRight,{size:14})})]})]})]})}],49744)},3469,e=>{"use strict";var t=e.i(43476),s=e.i(63676);e.s(["DetailDrawer",0,function({isOpen:e,onClose:a,title:l,subtitle:r,badge:n,children:i,footer:d,width:o="w-full md:w-[480px]"}){return e?(0,t.jsxs)("div",{className:"fixed inset-y-0 right-0 z-50 flex",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-slate-900/20 backdrop-blur-[1px] transition-opacity",onClick:a}),(0,t.jsxs)("div",{className:`relative ${o} bg-white shadow-2xl border-l border-slate-200 flex flex-col h-full z-10 transition-transform`,children:[(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-slate-200 flex items-start justify-between gap-3 bg-slate-50/50",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-slate-900 truncate",children:l}),n]}),r&&(0,t.jsx)("p",{className:"text-xs text-slate-500 font-mono mt-0.5 truncate",children:r})]}),(0,t.jsx)("button",{onClick:a,className:"p-1 rounded-md text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition-colors",children:(0,t.jsx)(s.X,{size:18})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-5 space-y-5 text-sm text-slate-700",children:i}),d&&(0,t.jsx)("div",{className:"px-5 py-3 border-t border-slate-200 bg-slate-50 flex items-center justify-end gap-2",children:d})]})]}):null}])},32471,e=>{"use strict";var t=e.i(43476),s=e.i(66595),a=e.i(95925);e.s(["FilterBar",0,function({searchQuery:e,onSearchChange:l,searchPlaceholder:r="Search records…",dropdowns:n,filters:i,onReset:d,activeCount:o,totalCount:c,actions:x}){let m=i||n;return(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg p-3 mb-4 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5 flex-1",children:[l&&(0,t.jsxs)("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[(0,t.jsx)(s.Search,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400"}),(0,t.jsx)("input",{type:"text",value:e??"",onChange:e=>l(e.target.value),placeholder:r,className:"w-full pl-8 pr-3 py-1.5 text-xs bg-slate-50 border border-slate-200 rounded-md text-slate-800 placeholder:text-slate-400 focus:bg-white focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 transition-all"})]}),m&&m.map(e=>(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:(0,t.jsx)("select",{value:e.value,onChange:t=>e.onChange(t.target.value),className:"text-xs bg-slate-50 border border-slate-200 rounded-md px-2.5 py-1.5 text-slate-700 font-medium focus:bg-white focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 transition-all cursor-pointer",children:e.options.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})},e.key||e.name||e.label)),d&&(0,t.jsxs)("button",{onClick:d,className:"flex items-center gap-1 text-xs text-slate-500 hover:text-slate-800 px-2 py-1.5 rounded hover:bg-slate-100 transition-colors",title:"Reset Filters",children:[(0,t.jsx)(a.RotateCcw,{size:12}),(0,t.jsx)("span",{children:"Reset"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 self-end md:self-auto text-xs text-slate-500",children:[void 0!==c&&(0,t.jsx)("span",{className:"font-mono text-slate-600",children:void 0!==o&&o!==c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{className:"text-slate-900",children:o})," of ",c]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{className:"text-slate-900",children:c})," total"]})}),x]})]})}])},37757,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(22016),l=e.i(67927);e.s(["PageHeader",0,function({title:e,description:r,subtitle:n,breadcrumbs:i,actions:d,badge:o}){let c=r||n;return(0,t.jsxs)("div",{className:"mb-6 pb-4 border-b border-slate-200",children:[i&&i.length>0&&(0,t.jsx)("nav",{className:"flex items-center gap-1.5 text-xs text-slate-500 mb-2",children:i.map((e,r)=>{let n=r===i.length-1;return(0,t.jsxs)(s.default.Fragment,{children:[r>0&&(0,t.jsx)(l.ChevronRight,{size:12,className:"text-slate-400"}),e.href&&!n?(0,t.jsx)(a.default,{href:e.href,className:"hover:text-slate-800 transition-colors",children:e.label}):(0,t.jsx)("span",{className:n?"text-slate-900 font-medium":"",children:e.label})]},r)})}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold text-slate-900 tracking-tight",children:e}),o&&(0,t.jsx)("div",{children:o})]}),c&&(0,t.jsx)("p",{className:"mt-1 text-xs text-slate-500 max-w-3xl leading-relaxed",children:c})]}),d&&(0,t.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:d})]})]})}])},72854,e=>{"use strict";var t=e.i(43476);function s({decision:e,status:a}){let l=(e||a||"").toUpperCase();return"BLOCK"===l||"DENY"===l||"BLOCKED"===l?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-red-50 text-red-700 border border-red-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-600"}),"BLOCK"]}):"ALLOW"===l||"ALLOWED"===l?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-600"}),"ALLOW"]}):"HITL"===l||"APPROVAL_REQUIRED"===l?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-amber-50 text-amber-700 border border-amber-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-600"}),"HITL"]}):"MONITOR"===l||"AUDIT"===l?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-blue-50 text-blue-700 border border-blue-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-600"}),"MONITOR"]}):(0,t.jsx)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-slate-100 text-slate-700 border border-slate-200",children:e||a||"UNKNOWN"})}e.s(["DecisionBadge",0,s,"SeverityBadge",0,function({severity:e}){let s=(e||"").toUpperCase();return"CRITICAL"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-red-50 text-red-700 border border-red-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-600"}),"CRITICAL"]}):"HIGH"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-orange-50 text-orange-700 border border-orange-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-600"}),"HIGH"]}):"MEDIUM"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-amber-50 text-amber-700 border border-amber-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-600"}),"MEDIUM"]}):"LOW"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-blue-50 text-blue-700 border border-blue-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-600"}),"LOW"]}):(0,t.jsx)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-slate-100 text-slate-600 border border-slate-200",children:e||"INFO"})},"StatusBadge",0,s,"TaintBadge",0,function({taint:e}){let s=(e||"").toUpperCase();return"TAINTED"===s||"CRITICAL"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-semibold bg-red-50 text-red-700 border border-red-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-600"}),"TAINTED"]}):"CLEAN"===s||"TRUSTED"===s||"NONE"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-emerald-50 text-emerald-700 border border-emerald-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),"CLEAN"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-amber-50 text-amber-700 border border-amber-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500"}),e||"UNASSESSED"]})},"TrustBadge",0,function({trust:e}){let s=(e||"").toUpperCase();return"HIGH"===s||"TRUSTED"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-emerald-50 text-emerald-700 border border-emerald-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),e]}):"MEDIUM"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-blue-50 text-blue-700 border border-blue-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500"}),"MEDIUM"]}):"LOW"===s||"UNTRUSTED"===s?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-red-50 text-red-700 border border-red-200",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),e]}):(0,t.jsx)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] font-medium bg-slate-100 text-slate-700 border border-slate-200",children:e||"UNKNOWN"})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79432,e=>{"use strict";var t=e.i(56420);let r={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};r.node;let s=(0,t.default)(r);e.s(["Activity",0,s],79432)},67927,56420,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},a=(0,t.createContext)({}),n=(0,t.forwardRef)(({color:e,size:n,width:i,height:l,strokeWidth:o,absoluteStrokeWidth:d,nonScalingStroke:c,className:u="",children:f,iconNode:x=[],icon:h={node:x,aliases:[],size:24},...m},p)=>{let{size:b=24,strokeWidth:g=2,absoluteStrokeWidth:y=!1,nonScalingStroke:v=!1,color:j="currentColor",className:w=""}=(0,t.useContext)(a)??{},N=!!f||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[_,k,C=[]]=function(e,t={}){return function(e,t={}){let a=t.attributeNames??{},n=e=>a[e]??e,i=e.size??e.width??s.width,l=e.size??e.height??s.height,o=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],d=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(" ").filter(Boolean)??[],u=!1===t.includeDefaultClasses?r(...c):r("lucide",...d,...c),f=t.absoluteStrokeWidth?Number(t.strokeWidth??s["stroke-width"])*Number(e.size??e.width??s.width)/Number(t.size??t.width??s.width):t.strokeWidth??s["stroke-width"];return["svg",{...Object.entries(s).reduce((e,[t,r])=>(e[n(t)]=r,e),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&null!=t.size&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&null!=t.width&&{[n("width")]:t.width},..."height"in t&&null!=t.height&&{[n("height")]:t.height},[n("stroke-width")]:f,...u&&{[n("class")]:u},[n("viewBox")]:`0 0 ${i} ${l}`,...!1===t.hasA11yProp?{[n("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[r,s,a]=e,i=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...s}:s;return a?[r,i,a]:[r,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(h,{color:e??j,width:i??n??b,height:l??n??b,strokeWidth:o??g,absoluteStrokeWidth:d??y,nonScalingStroke:c??v,className:r(w,u),hasA11yProp:N,attributes:m});return(0,t.createElement)(_,{ref:p,...k},[...C.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(f)?f:[f]])});function i(e,r=[],s=[]){let a,l="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,r,s):e,o=(0,t.forwardRef)(({className:e,...r},s)=>(0,t.createElement)(n,{ref:s,icon:l,className:e,...r}));return l.name&&(o.displayName=(a=(e=>{let t="",r=!1;for(let s of e){if("-"===s||"_"===s||s<=" "){r=t.length>0;continue}0===t.length?t+=s.toLowerCase():t+=r?s.toUpperCase():s,r=!1}return t})(l.name)).charAt(0).toUpperCase()+a.slice(1)),o}e.s(["default",0,i],56420);let l={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};l.node;let o=i(l);e.s(["ChevronRight",0,o],67927)},41120,e=>{"use strict";var t=e.i(56420);let r={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};r.node;let s=(0,t.default)(r);e.s(["RefreshCw",0,s],41120)},95925,e=>{"use strict";var t=e.i(56420);let r={name:"rotate-ccw",size:24,node:[["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"}]]};r.node;let s=(0,t.default)(r);e.s(["RotateCcw",0,s],95925)},66595,e=>{"use strict";var t=e.i(56420);let r={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};r.node;let s=(0,t.default)(r);e.s(["Search",0,s],66595)},63676,e=>{"use strict";var t=e.i(56420);let r={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};r.node;let s=(0,t.default)(r);e.s(["X",0,s],63676)},22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var s={default:function(){return b},useLinkStatus:function(){return y}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(90809),i=e.r(43476),l=n._(e.r(71645)),o=e.r(95057),d=e.r(8372),c=e.r(18581),u=e.r(18967),f=e.r(5550),x=e.r(88540),h=e.r(91949),m=e.r(73668),p=e.r(9396);function b(t){var r;let s,a,n,[b,y]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:w,children:N,prefetch:_=null,passHref:k,replace:C,shallow:S,scroll:T,onClick:L,onMouseEnter:R,onTouchStart:A,legacyBehavior:E=!1,onNavigate:O,transitionTypes:D,ref:I,unstable_dynamicOnHover:P,...M}=t;s=N,E&&("string"==typeof s||"number"==typeof s)&&(s=(0,i.jsx)("a",{children:s}));let z=l.default.useContext(d.AppRouterContext),$=!1!==_,U=!1===_?"none":!0===_?"full":"auto",F="none"!==U?"auto"===U?p.FetchStrategy.PPR:p.FetchStrategy.Full:p.FetchStrategy.PPR,B="string"==typeof(r=w||j)?r:(0,o.formatUrl)(r);if(E){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(s)}let H=E?a&&"object"==typeof a&&a.ref:I,q,W=l.default.useCallback(e=>(null!==z&&(v.current=(0,h.mountLinkInstance)(e,B,z,F,$,y,q)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[$,B,z,F,y,q]),K={ref:(0,c.useMergedRef)(W,H),onClick(t){E||"function"!=typeof L||L(t),E&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!z||t.defaultPrevented||function(t,r,s,a,n,i,o,d="none"){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);l.default.startTransition(()=>{f(r,a?"replace":"push",!1===n?x.ScrollBehavior.NoScroll:x.ScrollBehavior.Default,s.current,o,d)})}}(t,B,v,C,T,O,D,U)},onMouseEnter(e){E||"function"!=typeof R||R(e),E&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),z&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){E||"function"!=typeof A||A(e),E&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),z&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,u.isAbsoluteUrl)(B)?K.href=B:E&&!k&&("a"!==a.type||"href"in a.props)||(K.href=(0,f.addBasePath)(B)),n=E?l.default.cloneElement(a,K):(0,i.jsx)("a",{...M,...K,children:s}),(0,i.jsx)(g.Provider,{value:b,children:n})}let g=(0,l.createContext)(h.IDLE_LINK_STATUS),y=()=>(0,l.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let s=e.r(71645);function a(e,t){let r=(0,s.useRef)(null),a=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=n(e,s)),t&&(a.current=n(t,s))},[e,t])}function n(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var s={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return v},NormalizeError:function(){return g},PageNotFoundError:function(){return y},SP:function(){return m},ST:function(){return p},WEB_VITALS:function(){return n},execOnce:function(){return i},getDisplayName:function(){return u},getLocationOrigin:function(){return d},getURL:function(){return c},isAbsoluteUrl:function(){return o},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return x},stringifyError:function(){return w}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...s)=>(r||(r=!0,t=e(...s)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function d(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=d();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function x(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(r&&f(r))return s;if(!s)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return s}let m="u">typeof performance,p=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class g extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return n}});let s=e.r(18967),a=e.r(52817);function n(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={assign:function(){return o},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return l}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});function n(e){let t={};for(let[r,s]of e.entries()){let e=t[r];void 0===e?t[r]=s:Array.isArray(e)?e.push(s):t[r]=[e,s]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(r,i(e));else t.set(r,i(s));return t}function o(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,s]of r.entries())e.append(t,s)}return e}},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var s={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return o}};for(var a in s)Object.defineProperty(r,a,{enumerable:!0,get:s[a]});let n=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,s=e.protocol||"",a=e.pathname||"",l=e.hash||"",o=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),o&&"object"==typeof o&&(o=String(n.urlQueryToSearchParams(o)));let c=e.search||o&&`?${o}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||i.test(s))&&!1!==d?(d="//"+(d||""),a&&"/"!==a[0]&&(a="/"+a)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${s}${d}${a}${c}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},41961,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(79432),a=e.i(41120),n=e.i(37757),i=e.i(68442),l=e.i(32471),o=e.i(49744),d=e.i(3469);let c=[{drift_id:"drf_a7fe6289575f406f",category:"CONTEXT_DRIFT",severity:"HIGH",entity_id:"ctx_59eaf37bafbc4bc4",entity_type:"context",title:"Context Trust State Transition (TRUSTED -> UNTRUSTED)",description:"Context from source 'external_mcp' changed trust classification to 'UNTRUSTED'.",before_state:"TRUSTED",after_state:"UNTRUSTED",security_implication:"Taint boundary crossed. Downstream agents consuming this context must be restricted from sensitive sinks.",review_required:!0,detected_at:new Date().toISOString(),evidence_refs:["mcp_req_0091"]},{drift_id:"drf_363372b7cac94429",category:"AUTHORITY_DRIFT",severity:"HIGH",entity_id:"agt_60aeff2cd2a44742",entity_type:"agent",title:"Authority Expansion Detected on Agent 'agt_60aeff2cd2a44742'",description:"Agent granted new capabilities: ['exec_bash', 'write_db']",before_state:["read_file"],after_state:["read_file","write_db","exec_bash"],security_implication:"Agent capability boundary expanded. Verify alignment with principle of least privilege.",review_required:!0,detected_at:new Date().toISOString(),evidence_refs:["del_003"]},{drift_id:"drf_7cf39d1b76304bc3",category:"ACCESS_DRIFT",severity:"MEDIUM",entity_id:"agt_220dca9e87ac4fe2",entity_type:"agent",title:"New Resource Target Attempted: 'fin_export_api'",description:"Agent 'agt_220dca9e87ac4fe2' attempted access to 'fin_export_api' for the first time.",before_state:["local_fs","quarterly_reports"],after_state:["local_fs","quarterly_reports","fin_export_api"],security_implication:"Anomalous resource access path. Potential lateral movement or prompt injection target.",review_required:!0,detected_at:new Date().toISOString(),evidence_refs:["act_0942"]}],u={CRITICAL:"bg-red-50 text-red-700 border-red-200 font-semibold",HIGH:"bg-amber-50 text-amber-700 border-amber-200 font-medium",MEDIUM:"bg-blue-50 text-blue-700 border-blue-200",LOW:"bg-slate-50 text-slate-700 border-slate-200"},f={CONTEXT_DRIFT:"bg-purple-50 text-purple-700 border-purple-200",AUTHORITY_DRIFT:"bg-amber-50 text-amber-700 border-amber-200",ACCESS_DRIFT:"bg-blue-50 text-blue-700 border-blue-200"};e.s(["default",0,function(){let[e,x]=(0,r.useState)(c),[h,m]=(0,r.useState)(!1),[p,b]=(0,r.useState)(""),[g,y]=(0,r.useState)("ALL"),[v,j]=(0,r.useState)("ALL"),[w,N]=(0,r.useState)(null),_=async()=>{m(!0);try{let e=await fetch("/api/v1/drift");if(e.ok){let t=await e.json(),r=t.events||t.drift_events||[];r.length>0&&x(r)}}catch{}finally{m(!1)}};(0,r.useEffect)(()=>{_()},[]);let k=e.filter(e=>{let t=e.title.toLowerCase().includes(p.toLowerCase())||e.description.toLowerCase().includes(p.toLowerCase())||e.entity_id.toLowerCase().includes(p.toLowerCase()),r="ALL"===g||e.category===g,s="ALL"===v||e.severity===v;return t&&r&&s}),C=[{key:"title",header:"Anomaly Event",render:e=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-md bg-slate-100 flex items-center justify-center text-slate-600 border border-slate-200",children:(0,t.jsx)(s.Activity,{size:13})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold text-xs text-slate-900",children:e.title}),(0,t.jsx)("div",{className:"text-[11px] font-mono text-slate-500",children:e.drift_id})]})]})},{key:"category",header:"Category",width:"150px",render:e=>(0,t.jsx)("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded border ${f[e.category]||"bg-slate-100 text-slate-700"}`,children:e.category.replace("_"," ")})},{key:"severity",header:"Severity",width:"100px",render:e=>(0,t.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded border ${u[e.severity]||"bg-slate-100 text-slate-700"}`,children:e.severity})},{key:"entity_id",header:"Entity Impacted",width:"160px",render:e=>(0,t.jsx)("span",{className:"font-mono text-xs text-blue-700 bg-blue-50 px-2 py-0.5 rounded border border-blue-200",children:e.entity_id})},{key:"review_required",header:"Triage Status",width:"120px",render:e=>(0,t.jsx)("span",{className:`text-[11px] font-medium px-2 py-0.5 rounded border ${e.review_required?"bg-amber-50 text-amber-800 border-amber-200":"bg-slate-50 text-slate-600 border-slate-200"}`,children:e.review_required?"Review Pending":"Resolved"})},{key:"detected_at",header:"Detected",width:"130px",render:e=>(0,t.jsx)("span",{className:"text-xs text-slate-500",children:new Date(e.detected_at).toLocaleTimeString()})}];return(0,t.jsxs)("div",{className:"p-8 space-y-6 max-w-7xl mx-auto",children:[(0,t.jsx)(n.PageHeader,{title:"Behavioral Drift & Anomalies",subtitle:"Real-time statistical and deterministic drift detection against verified agent baseline models",badge:"Anomaly Engine",actions:(0,t.jsxs)("button",{onClick:_,disabled:h,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-slate-200 rounded-md text-xs font-medium text-slate-700 hover:bg-slate-50 transition-colors shadow-2xs",children:[(0,t.jsx)(a.RefreshCw,{size:13,className:h?"animate-spin":""}),(0,t.jsx)("span",{children:"Refresh"})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,t.jsx)(i.MetricCard,{label:"Total Drift Events",value:e.length}),(0,t.jsx)(i.MetricCard,{label:"Context Drifts",value:e.filter(e=>"CONTEXT_DRIFT"===e.category).length,status:"BLOCK"}),(0,t.jsx)(i.MetricCard,{label:"Authority Expansions",value:e.filter(e=>"AUTHORITY_DRIFT"===e.category).length,status:"HITL"}),(0,t.jsx)(i.MetricCard,{label:"Access Path Drifts",value:e.filter(e=>"ACCESS_DRIFT"===e.category).length,status:"ALLOW"})]}),(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg p-5 shadow-xs space-y-4",children:[(0,t.jsx)(l.FilterBar,{searchQuery:p,onSearchChange:b,searchPlaceholder:"Search drift events by title, entity, or description...",filters:[{key:"category",label:"Category",options:[{label:"All Categories",value:"ALL"},{label:"Context Drift",value:"CONTEXT_DRIFT"},{label:"Authority Drift",value:"AUTHORITY_DRIFT"},{label:"Access Drift",value:"ACCESS_DRIFT"}],value:g,onChange:y},{key:"severity",label:"Severity",options:[{label:"All Severities",value:"ALL"},{label:"High / Critical",value:"HIGH"},{label:"Medium",value:"MEDIUM"},{label:"Low",value:"LOW"}],value:v,onChange:j}],activeCount:"ALL"!==g||"ALL"!==v||p?1:0,onReset:()=>{b(""),y("ALL"),j("ALL")}}),(0,t.jsx)(o.DataTable,{columns:C,data:k,keyField:"drift_id",onRowClick:e=>N(e),emptyMessage:"No drift anomalies matched your filter criteria."})]}),(0,t.jsx)(d.DetailDrawer,{isOpen:!!w,onClose:()=>N(null),title:w?w.title:"",subtitle:w?`ID: ${w.drift_id} • Entity: ${w.entity_id}`:"",badge:w?(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded border ${u[w.severity]}`,children:w.severity}):null,children:w&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-3.5 space-y-2",children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-500",children:"Event Description"}),(0,t.jsx)("p",{className:"text-xs text-slate-800 leading-relaxed",children:w.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-500 mb-2",children:"State Transition Diff"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"p-3 bg-red-50/60 border border-red-200 rounded-lg",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase font-semibold text-red-700 mb-1",children:"Baseline / Before"}),(0,t.jsx)("pre",{className:"text-xs font-mono text-red-900 overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(w.before_state,null,2)})]}),(0,t.jsxs)("div",{className:"p-3 bg-emerald-50/60 border border-emerald-200 rounded-lg",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase font-semibold text-emerald-700 mb-1",children:"Observed / After"}),(0,t.jsx)("pre",{className:"text-xs font-mono text-emerald-900 overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(w.after_state,null,2)})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-500 mb-2",children:"Security Implication"}),(0,t.jsxs)("div",{className:"p-3.5 bg-amber-50/80 border border-amber-200 rounded-lg text-xs text-amber-900 leading-relaxed",children:[(0,t.jsx)("span",{className:"font-semibold block mb-1",children:"Threat Model Impact:"}),w.security_implication]})]}),(0,t.jsxs)("div",{className:"border-t border-slate-200 pt-4 space-y-2 text-xs text-slate-600",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Detected At"}),(0,t.jsx)("span",{className:"font-mono",children:new Date(w.detected_at).toUTCString()})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-slate-500",children:"Triage Requirement"}),(0,t.jsx)("span",{className:"font-medium text-slate-800",children:w.review_required?"HITL Review Required":"Informational Only"})]})]})]})})]})}])},49744,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(56420);let a={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};a.node;let n=(0,s.default)(a);var i=e.i(67927);let l={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};l.node;let o=(0,s.default)(l);e.s(["DataTable",0,function({columns:e,data:s,keyExtractor:a,keyField:l,onRowClick:d,selectedKey:c,emptyMessage:u="No records found",emptySubtext:f="Try adjusting your filters or search query.",pageSize:x=15,isLoading:h=!1}){let[m,p]=r.default.useState(1),b=Math.max(1,Math.ceil(s.length/x)),g=s.slice((m-1)*x,m*x);return r.default.useEffect(()=>{p(1)},[s.length]),(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg shadow-sm overflow-hidden flex flex-col",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left border-collapse text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{className:"bg-slate-50 border-b border-slate-200",children:e.map(e=>(0,t.jsx)("th",{style:{width:e.width},className:`px-3.5 py-2.5 font-semibold text-slate-600 uppercase tracking-wider text-[10px] ${"right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"}`,children:e.header},e.key))})}),(0,t.jsx)("tbody",{className:"divide-y divide-slate-100",children:h?(0,t.jsx)("tr",{children:(0,t.jsxs)("td",{colSpan:e.length,className:"py-12 text-center text-slate-400",children:[(0,t.jsx)("div",{className:"inline-block animate-spin rounded-full h-5 w-5 border-2 border-slate-300 border-t-sky-600 mb-2"}),(0,t.jsx)("div",{className:"text-xs",children:"Loading telemetry records…"})]})}):0===g.length?(0,t.jsx)("tr",{children:(0,t.jsxs)("td",{colSpan:e.length,className:"py-12 text-center",children:[(0,t.jsx)(o,{size:28,className:"mx-auto text-slate-300 mb-2"}),(0,t.jsx)("div",{className:"text-sm font-semibold text-slate-700",children:u}),(0,t.jsx)("div",{className:"text-xs text-slate-400 mt-0.5",children:f})]})}):g.map((r,s)=>{let n=a?a(r,s):l&&r[l]?String(r[l]):String(r.id||r.key||s),i=c===n;return(0,t.jsx)("tr",{onClick:()=>d&&d(r),className:`transition-colors ${i?"bg-sky-50/80 font-medium":"hover:bg-slate-50/80"} ${d?"cursor-pointer":""}`,children:e.map(e=>{let a=r[e.key],n=e.render?e.render(r,s):a;return(0,t.jsx)("td",{className:`px-3.5 py-2.5 text-slate-700 ${e.mono?"font-mono text-[11px]":""} ${"right"===e.align?"text-right":"center"===e.align?"text-center":"text-left"}`,children:n},e.key)})},n)})})]})}),s.length>x&&(0,t.jsxs)("div",{className:"px-4 py-2.5 border-t border-slate-200 bg-slate-50 flex items-center justify-between text-xs text-slate-500",children:[(0,t.jsxs)("div",{children:["Showing ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:(m-1)*x+1})," to"," ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:Math.min(m*x,s.length)})," ","of ",(0,t.jsx)("span",{className:"font-medium text-slate-800",children:s.length})," records"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:1===m,className:"p-1 rounded border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50 transition-colors",children:(0,t.jsx)(n,{size:14})}),(0,t.jsxs)("span",{className:"px-2 font-mono text-[11px]",children:[m," / ",b]}),(0,t.jsx)("button",{onClick:()=>p(e=>Math.min(b,e+1)),disabled:m===b,className:"p-1 rounded border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50 transition-colors",children:(0,t.jsx)(i.ChevronRight,{size:14})})]})]})]})}],49744)},3469,e=>{"use strict";var t=e.i(43476),r=e.i(63676);e.s(["DetailDrawer",0,function({isOpen:e,onClose:s,title:a,subtitle:n,badge:i,children:l,footer:o,width:d="w-full md:w-[480px]"}){return e?(0,t.jsxs)("div",{className:"fixed inset-y-0 right-0 z-50 flex",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-slate-900/20 backdrop-blur-[1px] transition-opacity",onClick:s}),(0,t.jsxs)("div",{className:`relative ${d} bg-white shadow-2xl border-l border-slate-200 flex flex-col h-full z-10 transition-transform`,children:[(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-slate-200 flex items-start justify-between gap-3 bg-slate-50/50",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-slate-900 truncate",children:a}),i]}),n&&(0,t.jsx)("p",{className:"text-xs text-slate-500 font-mono mt-0.5 truncate",children:n})]}),(0,t.jsx)("button",{onClick:s,className:"p-1 rounded-md text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition-colors",children:(0,t.jsx)(r.X,{size:18})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-5 space-y-5 text-sm text-slate-700",children:l}),o&&(0,t.jsx)("div",{className:"px-5 py-3 border-t border-slate-200 bg-slate-50 flex items-center justify-end gap-2",children:o})]})]}):null}])},32471,e=>{"use strict";var t=e.i(43476),r=e.i(66595),s=e.i(95925);e.s(["FilterBar",0,function({searchQuery:e,onSearchChange:a,searchPlaceholder:n="Search records…",dropdowns:i,filters:l,onReset:o,activeCount:d,totalCount:c,actions:u}){let f=l||i;return(0,t.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg p-3 mb-4 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5 flex-1",children:[a&&(0,t.jsxs)("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[(0,t.jsx)(r.Search,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400"}),(0,t.jsx)("input",{type:"text",value:e??"",onChange:e=>a(e.target.value),placeholder:n,className:"w-full pl-8 pr-3 py-1.5 text-xs bg-slate-50 border border-slate-200 rounded-md text-slate-800 placeholder:text-slate-400 focus:bg-white focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 transition-all"})]}),f&&f.map(e=>(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:(0,t.jsx)("select",{value:e.value,onChange:t=>e.onChange(t.target.value),className:"text-xs bg-slate-50 border border-slate-200 rounded-md px-2.5 py-1.5 text-slate-700 font-medium focus:bg-white focus:outline-none focus:border-sky-500 focus:ring-1 focus:ring-sky-500 transition-all cursor-pointer",children:e.options.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})},e.key||e.name||e.label)),o&&(0,t.jsxs)("button",{onClick:o,className:"flex items-center gap-1 text-xs text-slate-500 hover:text-slate-800 px-2 py-1.5 rounded hover:bg-slate-100 transition-colors",title:"Reset Filters",children:[(0,t.jsx)(s.RotateCcw,{size:12}),(0,t.jsx)("span",{children:"Reset"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 self-end md:self-auto text-xs text-slate-500",children:[void 0!==c&&(0,t.jsx)("span",{className:"font-mono text-slate-600",children:void 0!==d&&d!==c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{className:"text-slate-900",children:d})," of ",c]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{className:"text-slate-900",children:c})," total"]})}),u]})]})}])},68442,e=>{"use strict";var t=e.i(43476);e.s(["MetricCard",0,function({label:e,value:r,subtext:s,trend:a,status:n="neutral",icon:i,badge:l}){return(0,t.jsxs)("div",{className:`bg-white rounded-lg border border-slate-200 p-4 shadow-sm ${{healthy:"border-l-4 border-l-emerald-500",warning:"border-l-4 border-l-amber-500",critical:"border-l-4 border-l-red-500",neutral:"border-l-4 border-l-slate-300"}["ALLOW"===n||"MONITOR"===n||"healthy"===n?"healthy":"HITL"===n||"warning"===n?"warning":"BLOCK"===n||"critical"===n?"critical":"neutral"]} flex flex-col justify-between`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-medium tracking-wider uppercase text-slate-500",children:e}),i&&(0,t.jsx)(i,{size:16,className:"text-slate-400"}),l&&(0,t.jsx)("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-slate-100 text-slate-700",children:l})]}),(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2 mt-1",children:[(0,t.jsx)("div",{className:"text-2xl font-bold tracking-tight text-slate-900 font-mono",children:r}),a&&(0,t.jsx)("span",{className:`text-xs font-medium ${a.isNeutral?"text-slate-500":a.isPositive?"text-emerald-700":"text-red-700"}`,children:a.value})]}),s&&(0,t.jsx)("div",{className:"mt-2 text-xs text-slate-500 truncate",children:s})]})}])},37757,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(22016),a=e.i(67927);e.s(["PageHeader",0,function({title:e,description:n,subtitle:i,breadcrumbs:l,actions:o,badge:d}){let c=n||i;return(0,t.jsxs)("div",{className:"mb-6 pb-4 border-b border-slate-200",children:[l&&l.length>0&&(0,t.jsx)("nav",{className:"flex items-center gap-1.5 text-xs text-slate-500 mb-2",children:l.map((e,n)=>{let i=n===l.length-1;return(0,t.jsxs)(r.default.Fragment,{children:[n>0&&(0,t.jsx)(a.ChevronRight,{size:12,className:"text-slate-400"}),e.href&&!i?(0,t.jsx)(s.default,{href:e.href,className:"hover:text-slate-800 transition-colors",children:e.label}):(0,t.jsx)("span",{className:i?"text-slate-900 font-medium":"",children:e.label})]},n)})}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold text-slate-900 tracking-tight",children:e}),d&&(0,t.jsx)("div",{children:d})]}),c&&(0,t.jsx)("p",{className:"mt-1 text-xs text-slate-500 max-w-3xl leading-relaxed",children:c})]}),o&&(0,t.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:o})]})]})}])}]);