@minuque/no-pi-no-gang 0.0.3

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 (459) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +28 -0
  3. package/.next/build/chunks/[root-of-the-server]__0d-m0h0._.js +206 -0
  4. package/.next/build/chunks/[root-of-the-server]__0ubbtyl._.js +500 -0
  5. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_06e.r3r._.js +13 -0
  6. package/.next/build/chunks/[turbopack]_runtime.js +890 -0
  7. package/.next/build/chunks/node_modules_13sb.px._.js +6765 -0
  8. package/.next/build/package.json +1 -0
  9. package/.next/build/postcss.js +6 -0
  10. package/.next/build-manifest.json +21 -0
  11. package/.next/diagnostics/build-diagnostics.json +6 -0
  12. package/.next/diagnostics/framework.json +1 -0
  13. package/.next/diagnostics/route-bundle-stats.json +30 -0
  14. package/.next/export-marker.json +6 -0
  15. package/.next/fallback-build-manifest.json +13 -0
  16. package/.next/images-manifest.json +71 -0
  17. package/.next/next-minimal-server.js.nft.json +1 -0
  18. package/.next/next-server.js.nft.json +1 -0
  19. package/.next/package.json +1 -0
  20. package/.next/prerender-manifest.json +114 -0
  21. package/.next/required-server-files.js +343 -0
  22. package/.next/required-server-files.json +343 -0
  23. package/.next/routes-manifest.json +283 -0
  24. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  25. package/.next/server/app/_global-error/page/build-manifest.json +17 -0
  26. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  27. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  28. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  29. package/.next/server/app/_global-error/page.js +10 -0
  30. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  31. package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  32. package/.next/server/app/_global-error.html +1 -0
  33. package/.next/server/app/_global-error.meta +15 -0
  34. package/.next/server/app/_global-error.rsc +15 -0
  35. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  36. package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
  37. package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
  38. package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
  39. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  40. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  41. package/.next/server/app/_not-found/page/build-manifest.json +17 -0
  42. package/.next/server/app/_not-found/page/next-font-manifest.json +8 -0
  43. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  44. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  45. package/.next/server/app/_not-found/page.js +13 -0
  46. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  47. package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  48. package/.next/server/app/_not-found.html +1 -0
  49. package/.next/server/app/_not-found.meta +16 -0
  50. package/.next/server/app/_not-found.rsc +16 -0
  51. package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -0
  52. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  53. package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
  54. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  55. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
  56. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  57. package/.next/server/app/api/agent/[id]/events/route/app-paths-manifest.json +3 -0
  58. package/.next/server/app/api/agent/[id]/events/route/build-manifest.json +9 -0
  59. package/.next/server/app/api/agent/[id]/events/route/server-reference-manifest.json +4 -0
  60. package/.next/server/app/api/agent/[id]/events/route.js +6 -0
  61. package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -0
  62. package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +3 -0
  63. package/.next/server/app/api/agent/[id]/route/app-paths-manifest.json +3 -0
  64. package/.next/server/app/api/agent/[id]/route/build-manifest.json +9 -0
  65. package/.next/server/app/api/agent/[id]/route/server-reference-manifest.json +4 -0
  66. package/.next/server/app/api/agent/[id]/route.js +7 -0
  67. package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -0
  68. package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +3 -0
  69. package/.next/server/app/api/agent/new/route/app-paths-manifest.json +3 -0
  70. package/.next/server/app/api/agent/new/route/build-manifest.json +9 -0
  71. package/.next/server/app/api/agent/new/route/server-reference-manifest.json +4 -0
  72. package/.next/server/app/api/agent/new/route.js +7 -0
  73. package/.next/server/app/api/agent/new/route.js.nft.json +1 -0
  74. package/.next/server/app/api/agent/new/route_client-reference-manifest.js +3 -0
  75. package/.next/server/app/api/auth/all-providers/route/app-paths-manifest.json +3 -0
  76. package/.next/server/app/api/auth/all-providers/route/build-manifest.json +9 -0
  77. package/.next/server/app/api/auth/all-providers/route/server-reference-manifest.json +4 -0
  78. package/.next/server/app/api/auth/all-providers/route.js +6 -0
  79. package/.next/server/app/api/auth/all-providers/route.js.nft.json +1 -0
  80. package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +3 -0
  81. package/.next/server/app/api/auth/api-key/[provider]/route/app-paths-manifest.json +3 -0
  82. package/.next/server/app/api/auth/api-key/[provider]/route/build-manifest.json +9 -0
  83. package/.next/server/app/api/auth/api-key/[provider]/route/server-reference-manifest.json +4 -0
  84. package/.next/server/app/api/auth/api-key/[provider]/route.js +7 -0
  85. package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +1 -0
  86. package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +3 -0
  87. package/.next/server/app/api/auth/login/[provider]/route/app-paths-manifest.json +3 -0
  88. package/.next/server/app/api/auth/login/[provider]/route/build-manifest.json +9 -0
  89. package/.next/server/app/api/auth/login/[provider]/route/server-reference-manifest.json +4 -0
  90. package/.next/server/app/api/auth/login/[provider]/route.js +6 -0
  91. package/.next/server/app/api/auth/login/[provider]/route.js.nft.json +1 -0
  92. package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +3 -0
  93. package/.next/server/app/api/auth/logout/[provider]/route/app-paths-manifest.json +3 -0
  94. package/.next/server/app/api/auth/logout/[provider]/route/build-manifest.json +9 -0
  95. package/.next/server/app/api/auth/logout/[provider]/route/server-reference-manifest.json +4 -0
  96. package/.next/server/app/api/auth/logout/[provider]/route.js +6 -0
  97. package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +1 -0
  98. package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +3 -0
  99. package/.next/server/app/api/auth/providers/route/app-paths-manifest.json +3 -0
  100. package/.next/server/app/api/auth/providers/route/build-manifest.json +9 -0
  101. package/.next/server/app/api/auth/providers/route/server-reference-manifest.json +4 -0
  102. package/.next/server/app/api/auth/providers/route.js +6 -0
  103. package/.next/server/app/api/auth/providers/route.js.nft.json +1 -0
  104. package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +3 -0
  105. package/.next/server/app/api/cwd/validate/route/app-paths-manifest.json +3 -0
  106. package/.next/server/app/api/cwd/validate/route/build-manifest.json +9 -0
  107. package/.next/server/app/api/cwd/validate/route/server-reference-manifest.json +4 -0
  108. package/.next/server/app/api/cwd/validate/route.js +7 -0
  109. package/.next/server/app/api/cwd/validate/route.js.nft.json +1 -0
  110. package/.next/server/app/api/cwd/validate/route_client-reference-manifest.js +3 -0
  111. package/.next/server/app/api/default-cwd/route/app-paths-manifest.json +3 -0
  112. package/.next/server/app/api/default-cwd/route/build-manifest.json +9 -0
  113. package/.next/server/app/api/default-cwd/route/server-reference-manifest.json +4 -0
  114. package/.next/server/app/api/default-cwd/route.js +7 -0
  115. package/.next/server/app/api/default-cwd/route.js.nft.json +1 -0
  116. package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +3 -0
  117. package/.next/server/app/api/files/[...path]/route/app-paths-manifest.json +3 -0
  118. package/.next/server/app/api/files/[...path]/route/build-manifest.json +9 -0
  119. package/.next/server/app/api/files/[...path]/route/server-reference-manifest.json +4 -0
  120. package/.next/server/app/api/files/[...path]/route.js +8 -0
  121. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -0
  122. package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +3 -0
  123. package/.next/server/app/api/home/route/app-paths-manifest.json +3 -0
  124. package/.next/server/app/api/home/route/build-manifest.json +9 -0
  125. package/.next/server/app/api/home/route/server-reference-manifest.json +4 -0
  126. package/.next/server/app/api/home/route.js +7 -0
  127. package/.next/server/app/api/home/route.js.nft.json +1 -0
  128. package/.next/server/app/api/home/route_client-reference-manifest.js +3 -0
  129. package/.next/server/app/api/models/route/app-paths-manifest.json +3 -0
  130. package/.next/server/app/api/models/route/build-manifest.json +9 -0
  131. package/.next/server/app/api/models/route/server-reference-manifest.json +4 -0
  132. package/.next/server/app/api/models/route.js +6 -0
  133. package/.next/server/app/api/models/route.js.nft.json +1 -0
  134. package/.next/server/app/api/models/route_client-reference-manifest.js +3 -0
  135. package/.next/server/app/api/models-config/route/app-paths-manifest.json +3 -0
  136. package/.next/server/app/api/models-config/route/build-manifest.json +9 -0
  137. package/.next/server/app/api/models-config/route/server-reference-manifest.json +4 -0
  138. package/.next/server/app/api/models-config/route.js +7 -0
  139. package/.next/server/app/api/models-config/route.js.nft.json +1 -0
  140. package/.next/server/app/api/models-config/route_client-reference-manifest.js +3 -0
  141. package/.next/server/app/api/models-config/test/route/app-paths-manifest.json +3 -0
  142. package/.next/server/app/api/models-config/test/route/build-manifest.json +9 -0
  143. package/.next/server/app/api/models-config/test/route/server-reference-manifest.json +4 -0
  144. package/.next/server/app/api/models-config/test/route.js +7 -0
  145. package/.next/server/app/api/models-config/test/route.js.nft.json +1 -0
  146. package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +3 -0
  147. package/.next/server/app/api/sessions/[id]/context/route/app-paths-manifest.json +3 -0
  148. package/.next/server/app/api/sessions/[id]/context/route/build-manifest.json +9 -0
  149. package/.next/server/app/api/sessions/[id]/context/route/server-reference-manifest.json +4 -0
  150. package/.next/server/app/api/sessions/[id]/context/route.js +7 -0
  151. package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -0
  152. package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +3 -0
  153. package/.next/server/app/api/sessions/[id]/route/app-paths-manifest.json +3 -0
  154. package/.next/server/app/api/sessions/[id]/route/build-manifest.json +9 -0
  155. package/.next/server/app/api/sessions/[id]/route/server-reference-manifest.json +4 -0
  156. package/.next/server/app/api/sessions/[id]/route.js +7 -0
  157. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -0
  158. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +3 -0
  159. package/.next/server/app/api/sessions/new/route/app-paths-manifest.json +3 -0
  160. package/.next/server/app/api/sessions/new/route/build-manifest.json +9 -0
  161. package/.next/server/app/api/sessions/new/route/server-reference-manifest.json +4 -0
  162. package/.next/server/app/api/sessions/new/route.js +6 -0
  163. package/.next/server/app/api/sessions/new/route.js.nft.json +1 -0
  164. package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +3 -0
  165. package/.next/server/app/api/sessions/route/app-paths-manifest.json +3 -0
  166. package/.next/server/app/api/sessions/route/build-manifest.json +9 -0
  167. package/.next/server/app/api/sessions/route/server-reference-manifest.json +4 -0
  168. package/.next/server/app/api/sessions/route.js +7 -0
  169. package/.next/server/app/api/sessions/route.js.nft.json +1 -0
  170. package/.next/server/app/api/sessions/route_client-reference-manifest.js +3 -0
  171. package/.next/server/app/api/skills/install/route/app-paths-manifest.json +3 -0
  172. package/.next/server/app/api/skills/install/route/build-manifest.json +9 -0
  173. package/.next/server/app/api/skills/install/route/server-reference-manifest.json +4 -0
  174. package/.next/server/app/api/skills/install/route.js +7 -0
  175. package/.next/server/app/api/skills/install/route.js.nft.json +1 -0
  176. package/.next/server/app/api/skills/install/route_client-reference-manifest.js +3 -0
  177. package/.next/server/app/api/skills/route/app-paths-manifest.json +3 -0
  178. package/.next/server/app/api/skills/route/build-manifest.json +9 -0
  179. package/.next/server/app/api/skills/route/server-reference-manifest.json +4 -0
  180. package/.next/server/app/api/skills/route.js +7 -0
  181. package/.next/server/app/api/skills/route.js.nft.json +1 -0
  182. package/.next/server/app/api/skills/route_client-reference-manifest.js +3 -0
  183. package/.next/server/app/api/skills/search/route/app-paths-manifest.json +3 -0
  184. package/.next/server/app/api/skills/search/route/build-manifest.json +9 -0
  185. package/.next/server/app/api/skills/search/route/server-reference-manifest.json +4 -0
  186. package/.next/server/app/api/skills/search/route.js +7 -0
  187. package/.next/server/app/api/skills/search/route.js.nft.json +1 -0
  188. package/.next/server/app/api/skills/search/route_client-reference-manifest.js +3 -0
  189. package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
  190. package/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
  191. package/.next/server/app/favicon.ico/route.js +8 -0
  192. package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  193. package/.next/server/app/favicon.ico.body +0 -0
  194. package/.next/server/app/favicon.ico.meta +1 -0
  195. package/.next/server/app/index.html +1 -0
  196. package/.next/server/app/index.meta +14 -0
  197. package/.next/server/app/index.rsc +20 -0
  198. package/.next/server/app/index.segments/__PAGE__.segment.rsc +10 -0
  199. package/.next/server/app/index.segments/_full.segment.rsc +20 -0
  200. package/.next/server/app/index.segments/_head.segment.rsc +6 -0
  201. package/.next/server/app/index.segments/_index.segment.rsc +5 -0
  202. package/.next/server/app/index.segments/_tree.segment.rsc +4 -0
  203. package/.next/server/app/page/app-paths-manifest.json +3 -0
  204. package/.next/server/app/page/build-manifest.json +17 -0
  205. package/.next/server/app/page/next-font-manifest.json +8 -0
  206. package/.next/server/app/page/react-loadable-manifest.json +28 -0
  207. package/.next/server/app/page/server-reference-manifest.json +4 -0
  208. package/.next/server/app/page.js +14 -0
  209. package/.next/server/app/page.js.nft.json +1 -0
  210. package/.next/server/app/page_client-reference-manifest.js +3 -0
  211. package/.next/server/app-paths-manifest.json +28 -0
  212. package/.next/server/chunks/[externals]__055mlvl._.js +3 -0
  213. package/.next/server/chunks/[externals]_fs_0eo4gmu._.js +3 -0
  214. package/.next/server/chunks/[externals]_next_dist_0d5ans~._.js +3 -0
  215. package/.next/server/chunks/[externals]_os_0149k2b._.js +3 -0
  216. package/.next/server/chunks/[root-of-the-server]__0.6ktu2._.js +3 -0
  217. package/.next/server/chunks/[root-of-the-server]__0.gdd-b._.js +3 -0
  218. package/.next/server/chunks/[root-of-the-server]__00uikch._.js +13 -0
  219. package/.next/server/chunks/[root-of-the-server]__00zc4o9._.js +3 -0
  220. package/.next/server/chunks/[root-of-the-server]__010..td._.js +3 -0
  221. package/.next/server/chunks/[root-of-the-server]__01k0sdb._.js +3 -0
  222. package/.next/server/chunks/[root-of-the-server]__02~3pb0._.js +3 -0
  223. package/.next/server/chunks/[root-of-the-server]__046ig0_._.js +3 -0
  224. package/.next/server/chunks/[root-of-the-server]__04slun~._.js +11 -0
  225. package/.next/server/chunks/[root-of-the-server]__07h66vy._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__0_yokg6._.js +8 -0
  227. package/.next/server/chunks/[root-of-the-server]__0b46pqj._.js +3 -0
  228. package/.next/server/chunks/[root-of-the-server]__0b6-ha-._.js +3 -0
  229. package/.next/server/chunks/[root-of-the-server]__0ezj5sg._.js +11 -0
  230. package/.next/server/chunks/[root-of-the-server]__0h5n0y4._.js +5 -0
  231. package/.next/server/chunks/[root-of-the-server]__0j9v1it._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__0ku8iqx._.js +3 -0
  233. package/.next/server/chunks/[root-of-the-server]__0s7rdqd._.js +5 -0
  234. package/.next/server/chunks/[root-of-the-server]__0sa69ta._.js +3 -0
  235. package/.next/server/chunks/[root-of-the-server]__0yp3ehn._.js +5 -0
  236. package/.next/server/chunks/[root-of-the-server]__0z0dr.m._.js +3 -0
  237. package/.next/server/chunks/[root-of-the-server]__0~3icx-._.js +11 -0
  238. package/.next/server/chunks/[root-of-the-server]__11j~5mn._.js +3 -0
  239. package/.next/server/chunks/[root-of-the-server]__11r3.m~._.js +5 -0
  240. package/.next/server/chunks/[turbopack]_runtime.js +903 -0
  241. package/.next/server/chunks/_0rd1g.~._.js +51 -0
  242. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_events_route_actions_05o7blz.js +3 -0
  243. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_route_actions_0kr98j0.js +3 -0
  244. package/.next/server/chunks/_next-internal_server_app_api_agent_new_route_actions_0w3r5tj.js +3 -0
  245. package/.next/server/chunks/_next-internal_server_app_api_auth_all-providers_route_actions_0qx7ozc.js +3 -0
  246. package/.next/server/chunks/_next-internal_server_app_api_auth_api-key_[provider]_route_actions_02zwuk7.js +3 -0
  247. package/.next/server/chunks/_next-internal_server_app_api_auth_login_[provider]_route_actions_0iuf38..js +3 -0
  248. package/.next/server/chunks/_next-internal_server_app_api_auth_logout_[provider]_route_actions_0rakqrt.js +3 -0
  249. package/.next/server/chunks/_next-internal_server_app_api_auth_providers_route_actions_0d~j0qt.js +3 -0
  250. package/.next/server/chunks/_next-internal_server_app_api_cwd_validate_route_actions_036l79..js +3 -0
  251. package/.next/server/chunks/_next-internal_server_app_api_default-cwd_route_actions_0nw97z4.js +3 -0
  252. package/.next/server/chunks/_next-internal_server_app_api_files_[___path]_route_actions_0_g4akf.js +3 -0
  253. package/.next/server/chunks/_next-internal_server_app_api_home_route_actions_0_7wduh.js +3 -0
  254. package/.next/server/chunks/_next-internal_server_app_api_models-config_route_actions_0ipr5cq.js +3 -0
  255. package/.next/server/chunks/_next-internal_server_app_api_models-config_test_route_actions_078zink.js +3 -0
  256. package/.next/server/chunks/_next-internal_server_app_api_models_route_actions_0vfccm4.js +3 -0
  257. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_context_route_actions_0d0pnzf.js +3 -0
  258. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_route_actions_0eo4u5w.js +3 -0
  259. package/.next/server/chunks/_next-internal_server_app_api_sessions_new_route_actions_093p~n-.js +3 -0
  260. package/.next/server/chunks/_next-internal_server_app_api_sessions_route_actions_0y1t9w0.js +3 -0
  261. package/.next/server/chunks/_next-internal_server_app_api_skills_install_route_actions_03-v3ve.js +3 -0
  262. package/.next/server/chunks/_next-internal_server_app_api_skills_route_actions_0kp0j6w.js +3 -0
  263. package/.next/server/chunks/_next-internal_server_app_api_skills_search_route_actions_011wkra.js +3 -0
  264. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js +3 -0
  265. package/.next/server/chunks/node_modules_next_04~_e52._.js +13 -0
  266. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0yubv2d.js +3 -0
  267. package/.next/server/chunks/ssr/[root-of-the-server]__06-2p1a._.js +33 -0
  268. package/.next/server/chunks/ssr/[root-of-the-server]__0e7mf6k._.js +3 -0
  269. package/.next/server/chunks/ssr/[root-of-the-server]__0ft0rpu._.js +3 -0
  270. package/.next/server/chunks/ssr/[root-of-the-server]__0jtt0~0._.js +3 -0
  271. package/.next/server/chunks/ssr/[root-of-the-server]__0wovenu._.js +3 -0
  272. package/.next/server/chunks/ssr/[root-of-the-server]__11aaox2._.js +3 -0
  273. package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
  274. package/.next/server/chunks/ssr/_0q~ogd.._.js +18 -0
  275. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +3 -0
  276. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +3 -0
  277. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +3 -0
  278. package/.next/server/chunks/ssr/app_global-error_tsx_0m9qisk._.js +3 -0
  279. package/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +3 -0
  280. package/.next/server/chunks/ssr/app_layout_tsx_13yf0ls._.js +3 -0
  281. package/.next/server/chunks/ssr/app_not-found_tsx_0u.hoe4._.js +3 -0
  282. package/.next/server/chunks/ssr/node_modules_0vtdjw7._.js +3 -0
  283. package/.next/server/chunks/ssr/node_modules_next_dist_03nkrli._.js +19 -0
  284. package/.next/server/chunks/ssr/node_modules_next_dist_0xdsm99._.js +6 -0
  285. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0ee1czk._.js +3 -0
  286. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js +3 -0
  287. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0_4weur.js +4 -0
  288. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0c93gwg.js +4 -0
  289. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hrtur5.js +4 -0
  290. package/.next/server/functions-config-manifest.json +4 -0
  291. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  292. package/.next/server/middleware-build-manifest.js +21 -0
  293. package/.next/server/middleware-manifest.json +6 -0
  294. package/.next/server/next-font-manifest.js +1 -0
  295. package/.next/server/next-font-manifest.json +9 -0
  296. package/.next/server/pages/404.html +1 -0
  297. package/.next/server/pages/500.html +1 -0
  298. package/.next/server/pages-manifest.json +4 -0
  299. package/.next/server/prefetch-hints.json +1 -0
  300. package/.next/server/server-reference-manifest.js +1 -0
  301. package/.next/server/server-reference-manifest.json +5 -0
  302. package/.next/static/chunks/0-_x27yxy_uq_.js +93 -0
  303. package/.next/static/chunks/0-whcx~709zzu.js +80 -0
  304. package/.next/static/chunks/0.e1a_4mnksx8.js +104 -0
  305. package/.next/static/chunks/0.fiftciismd2.js +226 -0
  306. package/.next/static/chunks/0.wuin48y61b7.js +1 -0
  307. package/.next/static/chunks/002jt~~cq5_aa.js +1 -0
  308. package/.next/static/chunks/004q74ucr0rud.js +152 -0
  309. package/.next/static/chunks/02ls~ed5vnxqv.js +24 -0
  310. package/.next/static/chunks/03~yq9q893hmn.js +1 -0
  311. package/.next/static/chunks/04fvpl_2xcddp.js +1 -0
  312. package/.next/static/chunks/06lwnambhb4f0.js +80 -0
  313. package/.next/static/chunks/06pzacrhunxk5.js +1 -0
  314. package/.next/static/chunks/07.pn5e.-cj9a.js +2 -0
  315. package/.next/static/chunks/07vyd7~f6.0u..js +10 -0
  316. package/.next/static/chunks/089d7..-0wnw3.js +1 -0
  317. package/.next/static/chunks/08praq-~ae4zt.js +1 -0
  318. package/.next/static/chunks/08zok6.5_1m~9.js +1 -0
  319. package/.next/static/chunks/09mnng_7obe78.js +1 -0
  320. package/.next/static/chunks/09ojirkh94w5..js +1 -0
  321. package/.next/static/chunks/0_68cloqifx~6.js +1 -0
  322. package/.next/static/chunks/0_u58hj44ucg2.js +1 -0
  323. package/.next/static/chunks/0a000ymgl7f3p.js +1 -0
  324. package/.next/static/chunks/0c9b-g9awna8q.js +29 -0
  325. package/.next/static/chunks/0ccl4ntkq96ni.js +1 -0
  326. package/.next/static/chunks/0cf94j-5q3pkw.js +1 -0
  327. package/.next/static/chunks/0coux02phyasu.js +1 -0
  328. package/.next/static/chunks/0d50~al.ol-4..js +7 -0
  329. package/.next/static/chunks/0dkt4l-f5ndy2.js +1 -0
  330. package/.next/static/chunks/0e1gsufr5shdc.js +62 -0
  331. package/.next/static/chunks/0egtubyx5jnob.js +1 -0
  332. package/.next/static/chunks/0fekzj03ltn5y.js +60 -0
  333. package/.next/static/chunks/0guyki.b1rj56.js +2 -0
  334. package/.next/static/chunks/0g~f0923b0wjv.js +1 -0
  335. package/.next/static/chunks/0h3ddk5cyq9xz.js +31 -0
  336. package/.next/static/chunks/0h4bblvd1oiwg.js +1 -0
  337. package/.next/static/chunks/0jbpr802lbcrt.css +5 -0
  338. package/.next/static/chunks/0kh6122expmgj.js +1 -0
  339. package/.next/static/chunks/0kl8vyx5367.j.js +64 -0
  340. package/.next/static/chunks/0kx.ki.9u_0dy.js +4 -0
  341. package/.next/static/chunks/0l_tj98f_5ot-.js +90 -0
  342. package/.next/static/chunks/0lesd95xyhlx9.js +1 -0
  343. package/.next/static/chunks/0lmm~3cjla0c9.js +148 -0
  344. package/.next/static/chunks/0lr2ip~4h2o.z.js +36 -0
  345. package/.next/static/chunks/0m56dahgfz4ep.js +1 -0
  346. package/.next/static/chunks/0m__cntkqew.o.js +13 -0
  347. package/.next/static/chunks/0nfagbuti-8nm.js +43 -0
  348. package/.next/static/chunks/0njmix7y_6miv.js +1 -0
  349. package/.next/static/chunks/0nt-wtu-~b7hv.js +15 -0
  350. package/.next/static/chunks/0nwbvs~t8m~k6.js +201 -0
  351. package/.next/static/chunks/0oliu54k0bk8f.js +2 -0
  352. package/.next/static/chunks/0pqew2nbfoy2f.js +1 -0
  353. package/.next/static/chunks/0puq-xa16mucw.js +15 -0
  354. package/.next/static/chunks/0qsudywiw6qo5.css +1 -0
  355. package/.next/static/chunks/0rgczfc39wsyk.js +19 -0
  356. package/.next/static/chunks/0rr4nl_auvf0b.js +115 -0
  357. package/.next/static/chunks/0r~pe8dyxc6dg.js +6 -0
  358. package/.next/static/chunks/0sxewv6qrvo3o.js +1 -0
  359. package/.next/static/chunks/0t-7~zw5_oj33.js +1 -0
  360. package/.next/static/chunks/0t-ecot2ot8jq.js +1 -0
  361. package/.next/static/chunks/0t1nhjmm.2-8-.js +287 -0
  362. package/.next/static/chunks/0tvexet6666de.js +1 -0
  363. package/.next/static/chunks/0v8zy131j2_sl.js +5 -0
  364. package/.next/static/chunks/0vj43fihkfmqz.js +1 -0
  365. package/.next/static/chunks/0vrtmg..zn4iz.js +1 -0
  366. package/.next/static/chunks/0v~puv980n2mn.js +1 -0
  367. package/.next/static/chunks/0w3.kcsbsqud9.js +1 -0
  368. package/.next/static/chunks/0w4h2u4jedq4..js +1 -0
  369. package/.next/static/chunks/0w8fjaur4pi6e.js +1 -0
  370. package/.next/static/chunks/0wed0o6unsb42.js +1 -0
  371. package/.next/static/chunks/0wlv.a_8drzhy.js +1 -0
  372. package/.next/static/chunks/0z9df3ijvbr8h.js +148 -0
  373. package/.next/static/chunks/0~dqy1ppqqjc9.js +9 -0
  374. package/.next/static/chunks/0~fjlnit~fkey.js +79 -0
  375. package/.next/static/chunks/10hi2_f5v~p3x.js +1 -0
  376. package/.next/static/chunks/11.py1pvzox4i.js +24 -0
  377. package/.next/static/chunks/11905-quym2vs.js +127 -0
  378. package/.next/static/chunks/143c.4snyrdfs.js +1 -0
  379. package/.next/static/chunks/152e7m9_0zf_j.js +1 -0
  380. package/.next/static/chunks/15ewybx3hor-7.js +15 -0
  381. package/.next/static/chunks/1683bx2og-ppu.js +4 -0
  382. package/.next/static/chunks/16_rz~7nlmstm.js +119 -0
  383. package/.next/static/chunks/17-ric8y98z08.js +1 -0
  384. package/.next/static/chunks/179i-blt6kp34.js +15 -0
  385. package/.next/static/chunks/17me7gnh4-..3.js +23 -0
  386. package/.next/static/chunks/17xrrnvso~-8i.js +1 -0
  387. package/.next/static/chunks/187wyatc9ke~-.js +1 -0
  388. package/.next/static/chunks/turbopack-0o4h.yrdaxsr5.js +1 -0
  389. package/.next/static/media/favicon.0~uco8ba8mwit.ico +0 -0
  390. package/.next/static/media/jetbrains-mono-cyrillic-400-italic.0kxdsy2j98sdf.woff2 +0 -0
  391. package/.next/static/media/jetbrains-mono-cyrillic-400-italic.0yt8fcr_h34m_.woff +0 -0
  392. package/.next/static/media/jetbrains-mono-cyrillic-400-normal.087r1-tljb70l.woff2 +0 -0
  393. package/.next/static/media/jetbrains-mono-cyrillic-400-normal.0bpn27hhc~-d3.woff +0 -0
  394. package/.next/static/media/jetbrains-mono-cyrillic-600-normal.0b5vejrrirynb.woff +0 -0
  395. package/.next/static/media/jetbrains-mono-cyrillic-600-normal.0zm.b9icodj1d.woff2 +0 -0
  396. package/.next/static/media/jetbrains-mono-cyrillic-700-normal.013_5dph8sw_..woff2 +0 -0
  397. package/.next/static/media/jetbrains-mono-cyrillic-700-normal.145y-n9zy1zqe.woff +0 -0
  398. package/.next/static/media/jetbrains-mono-cyrillic-ext-400-italic.0ocl60c9i6viu.woff +0 -0
  399. package/.next/static/media/jetbrains-mono-cyrillic-ext-400-italic.10790__pku._6.woff2 +0 -0
  400. package/.next/static/media/jetbrains-mono-cyrillic-ext-400-normal.0tng7c41iftcp.woff +0 -0
  401. package/.next/static/media/jetbrains-mono-cyrillic-ext-400-normal.0xpgvcoxruq.8.woff2 +0 -0
  402. package/.next/static/media/jetbrains-mono-cyrillic-ext-600-normal.15aye3ng77~2..woff +0 -0
  403. package/.next/static/media/jetbrains-mono-cyrillic-ext-600-normal.15l1uglw06i2m.woff2 +0 -0
  404. package/.next/static/media/jetbrains-mono-cyrillic-ext-700-normal.0752zn.y.dy9x.woff +0 -0
  405. package/.next/static/media/jetbrains-mono-cyrillic-ext-700-normal.16c.x..m_ubc2.woff2 +0 -0
  406. package/.next/static/media/jetbrains-mono-greek-400-italic.0a9mpf0j.3g3c.woff2 +0 -0
  407. package/.next/static/media/jetbrains-mono-greek-400-italic.0phe0-35czffn.woff +0 -0
  408. package/.next/static/media/jetbrains-mono-greek-400-normal.0bemy31mtia~~.woff2 +0 -0
  409. package/.next/static/media/jetbrains-mono-greek-400-normal.15k7shgxnlfr2.woff +0 -0
  410. package/.next/static/media/jetbrains-mono-greek-600-normal.0.qfkh0.i7~80.woff2 +0 -0
  411. package/.next/static/media/jetbrains-mono-greek-600-normal.0tkl4oj11l_1h.woff +0 -0
  412. package/.next/static/media/jetbrains-mono-greek-700-normal.0l3ez~ea.ay5s.woff2 +0 -0
  413. package/.next/static/media/jetbrains-mono-greek-700-normal.0w5srk3jqf2s0.woff +0 -0
  414. package/.next/static/media/jetbrains-mono-latin-400-italic.0_egpny69anx8.woff +0 -0
  415. package/.next/static/media/jetbrains-mono-latin-400-italic.10f5cvhkww5xz.woff2 +0 -0
  416. package/.next/static/media/jetbrains-mono-latin-400-normal.0ytsw4b~7cqpy.woff +0 -0
  417. package/.next/static/media/jetbrains-mono-latin-400-normal.0~~285bd0hytg.woff2 +0 -0
  418. package/.next/static/media/jetbrains-mono-latin-600-normal.0q148sfpujlfj.woff +0 -0
  419. package/.next/static/media/jetbrains-mono-latin-600-normal.0uc1d..6ne28b.woff2 +0 -0
  420. package/.next/static/media/jetbrains-mono-latin-700-normal.0m9n5azko2fxt.woff2 +0 -0
  421. package/.next/static/media/jetbrains-mono-latin-700-normal.13jqqvs3baw_9.woff +0 -0
  422. package/.next/static/media/jetbrains-mono-latin-ext-400-italic.0_d.82yhle_f2.woff +0 -0
  423. package/.next/static/media/jetbrains-mono-latin-ext-400-italic.0l9sf.e.fhsvq.woff2 +0 -0
  424. package/.next/static/media/jetbrains-mono-latin-ext-400-normal.00uufft-w4e71.woff +0 -0
  425. package/.next/static/media/jetbrains-mono-latin-ext-400-normal.0m58wcl-45-e_.woff2 +0 -0
  426. package/.next/static/media/jetbrains-mono-latin-ext-600-normal.06nws4-kvn67y.woff +0 -0
  427. package/.next/static/media/jetbrains-mono-latin-ext-600-normal.0cj1gverw~qa~.woff2 +0 -0
  428. package/.next/static/media/jetbrains-mono-latin-ext-700-normal.0ssmx3bb4p_-o.woff2 +0 -0
  429. package/.next/static/media/jetbrains-mono-latin-ext-700-normal.18dhjbjjbfb~w.woff +0 -0
  430. package/.next/static/media/jetbrains-mono-vietnamese-400-italic.03cr.d44h7lai.woff2 +0 -0
  431. package/.next/static/media/jetbrains-mono-vietnamese-400-italic.0s4jmzb.u_ekk.woff +0 -0
  432. package/.next/static/media/jetbrains-mono-vietnamese-400-normal.0if3lc5k5lnhh.woff +0 -0
  433. package/.next/static/media/jetbrains-mono-vietnamese-400-normal.0yjr~p._1wjhq.woff2 +0 -0
  434. package/.next/static/media/jetbrains-mono-vietnamese-600-normal.0-bvm4.0k8yo6.woff2 +0 -0
  435. package/.next/static/media/jetbrains-mono-vietnamese-600-normal.04vz7.37ouk2l.woff +0 -0
  436. package/.next/static/media/jetbrains-mono-vietnamese-700-normal.00wj-mmx-ff5_.woff +0 -0
  437. package/.next/static/media/jetbrains-mono-vietnamese-700-normal.037krr091qkni.woff2 +0 -0
  438. package/.next/static/p5NTaAoK5vdcRUpPT9JJo/_buildManifest.js +11 -0
  439. package/.next/static/p5NTaAoK5vdcRUpPT9JJo/_clientMiddlewareManifest.js +1 -0
  440. package/.next/static/p5NTaAoK5vdcRUpPT9JJo/_ssgManifest.js +1 -0
  441. package/.next/trace +1 -0
  442. package/.next/trace-build +1 -0
  443. package/.next/turbopack +0 -0
  444. package/.next/types/routes.d.ts +94 -0
  445. package/.next/types/validator.ts +268 -0
  446. package/LICENSE +21 -0
  447. package/README.md +148 -0
  448. package/bin/no-pi-no-gang.js +73 -0
  449. package/next.config.ts +110 -0
  450. package/package.json +81 -0
  451. package/public/file.svg +1 -0
  452. package/public/globe.svg +1 -0
  453. package/public/manifest.json +16 -0
  454. package/public/next.svg +1 -0
  455. package/public/pi-logo-on-dark.svg +20 -0
  456. package/public/pi-logo-on-light.svg +20 -0
  457. package/public/robots.txt +2 -0
  458. package/public/vercel.svg +1 -0
  459. package/public/window.svg +1 -0
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,57965,e=>{"use strict";var t=e.i(47167),r=e.i(18050),n=e.i(71645),i=e.i(85699);async function o(e,t){let r=await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json().catch(()=>({}));if(!r.ok||n.error)throw Error(n.error??`HTTP ${r.status}`);return n.data}function a(e){if("assistant"!==e.role)return e;let t=e.content;if(!Array.isArray(t))return e;let r=t.map(e=>("object"!=typeof e||null===e||Array.isArray(e)||"toolCall"!==e.type?null:{type:"toolCall",toolCallId:"string"==typeof e.toolCallId?e.toolCallId:"string"==typeof e.id?e.id:"",toolName:"string"==typeof e.toolName?e.toolName:"string"==typeof e.name?e.name:"",input:"object"!=typeof e.input||null===e.input||Array.isArray(e.input)?"object"!=typeof e.arguments||null===e.arguments||Array.isArray(e.arguments)?{}:e.arguments:e.input})??e);return{...e,content:r}}function l(e,t){switch(t.type){case"start":return{isStreaming:!0,streamingMessage:null};case"update":return{isStreaming:!0,streamingMessage:t.message};case"end":case"reset":return{isStreaming:!1,streamingMessage:null};default:return e}}async function s(e){return(await e.json().catch(()=>({}))).error??`HTTP ${e.status}`}var c=e.i(26302);let d=["auto","off","minimal","low","medium","high","xhigh"],u={auto:"沿用 pi 默认设置",off:"关闭推理",minimal:"最少推理",low:"低强度推理",medium:"中等推理",high:"高强度推理",xhigh:"最高强度推理"},p=(0,n.forwardRef)(function({onSend:e,onAbort:t,isStreaming:i,model:o,modelNames:a,modelList:l,onModelChange:s,thinkingLevel:c,onThinkingLevelChange:p,availableThinkingLevels:g,thinkingLevelMap:h,retryInfo:x,contextUsage:m,commands:f=[],currentProject:v,recentCwds:y=[],homeDir:b="",onCwdSelect:k,onCwdDefault:w,toolPreset:j="default",streamingTokens:S,streamingTps:C,agentStatus:T},R){let L,[I,M]=(0,n.useState)(""),[E,W]=(0,n.useState)(!1),[$,z]=(0,n.useState)(!1),[D,N]=(0,n.useState)([]),[A,F]=(0,n.useState)(!1),[_,H]=(0,n.useState)(""),[B,O]=(0,n.useState)(0),[U,P]=(0,n.useState)([]),[q,Y]=(0,n.useState)(!1),[J,K]=(0,n.useState)(!1),[V,X]=(0,n.useState)(!1),[Z,G]=(0,n.useState)(!1),[Q,ee]=(0,n.useState)(!1),[et,er]=(0,n.useState)(""),[en,ei]=(0,n.useState)(null),[eo,ea]=(0,n.useState)(!1),el=(0,n.useRef)(null),es=(0,n.useRef)(null),ec=(0,n.useRef)(null),ed=(0,n.useRef)(null),eu=(0,n.useRef)(null),ep=(0,n.useRef)(null),eg=(0,n.useRef)(null),eh=(0,n.useRef)(!1),ex=(0,n.useRef)(0),em=(0,n.useRef)(null),ef=(0,n.useRef)([]),ev=(0,n.useRef)(-1),ey=(0,n.useRef)("");(0,n.useImperativeHandle)(R,()=>({insertIfEmpty(e){let t=ec.current;(t?t.value:I).trim()||(M(e),requestAnimationFrame(()=>{t&&(t.focus(),t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,200)}px`)}))},insertText(e){let t=ec.current;if(!t)return void M(t=>t+(t?" ":"")+e);let r=t.selectionStart??t.value.length,n=t.selectionEnd??t.value.length,i=t.value.slice(0,r),o=t.value.slice(n),a=i.length>0&&!i.endsWith(" ")?" ":"";M(i+a+e+o),requestAnimationFrame(()=>{if(!t)return;let n=r+a.length+e.length;t.setSelectionRange(n,n),t.focus(),t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,200)}px`})},addImages(e){eb(e)}}));let eb=(0,n.useCallback)(async e=>{let t=e.filter(e=>e.type.startsWith("image/"));if(!t.length)return;let r=await Promise.all(t.map(e=>new Promise((t,r)=>{let n=new FileReader;n.onload=()=>{t({data:n.result.split(",")[1],mimeType:e.type,previewUrl:URL.createObjectURL(e)})},n.onerror=r,n.readAsDataURL(e)})));N(e=>[...e,...r])},[]),ek=(0,n.useCallback)(e=>{N(t=>{let r=[...t];return URL.revokeObjectURL(r[e].previewUrl),r.splice(e,1),r})},[]),ew=(0,n.useCallback)(()=>{N(e=>(e.forEach(e=>URL.revokeObjectURL(e.previewUrl)),[]))},[]),ej=(0,n.useCallback)(()=>{let t=I.trim();if((t||D.length)&&!i){if(t){let e=ef.current;(0===e.length||e[e.length-1]!==t)&&e.push(t)}ev.current=-1,ey.current="",e(t,D.length?D:void 0),M(""),ew(),ec.current&&(ec.current.style.height="auto")}},[I,D,i,e,ew]),eS=(0,n.useCallback)(async()=>{let e=et.trim();if(e&&!eo){ea(!0),ei(null);try{let t=await fetch("/api/cwd/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),r=await t.json().catch(()=>({}));if(!t.ok||r.error)return void ei(r.error??`HTTP ${t.status}`);k?.(r.cwd??e),X(!1),ee(!1),er(""),ei(null)}catch(e){ei(e instanceof Error?e.message:String(e))}finally{ea(!1)}}},[et,eo,k]),eC=(0,n.useCallback)(async e=>{ea(!0),ei(null);try{let t=await fetch("/api/cwd/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),r=await t.json().catch(()=>({}));if(!t.ok||r.error){ee(!0),er(e),ei(r.error??`HTTP ${t.status}`);return}k?.(r.cwd??e),X(!1),ee(!1),er(""),ei(null)}catch(t){ee(!0),er(e),ei(t instanceof Error?t.message:String(t))}finally{ea(!1)}},[k]),eT=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/default-cwd",{method:"POST"}),t=await e.json();t.cwd&&(k?.(t.cwd),X(!1),ee(!1),er(""),ei(null))}catch{}},[k]),eR=(0,n.useCallback)(e=>{let t=ec.current;if(!t)return;let r=t.selectionStart??0,n=t.value,i=n.slice(0,r).lastIndexOf("/");-1===i||(M(n.slice(0,i)+"/"+e+" "+n.slice(r)),F(!1),requestAnimationFrame(()=>{if(!t)return;let r=i+e.length+2;t.focus(),t.setSelectionRange(r,r)}))},[]),eL=(0,n.useCallback)(e=>{if(A){if("ArrowDown"===e.key){e.preventDefault(),O(e=>Math.min(e+1,U.length-1));return}if("ArrowUp"===e.key){e.preventDefault(),O(e=>Math.max(e-1,0));return}if("Enter"===e.key&&!e.shiftKey||"Tab"===e.key){e.preventDefault();let t=U[B];t&&eR(t.name);return}if("Escape"===e.key){e.preventDefault(),F(!1);return}}if("Enter"===e.key&&e.shiftKey)return;if(!A){let t=ec.current,r=t?.value??"";if("ArrowUp"===e.key&&!r){e.preventDefault();let t=ef.current;if(!t.length)return;-1===ev.current&&(ey.current="");let r=-1===ev.current?t.length-1:Math.max(0,ev.current-1);ev.current=r,M(t[r]),requestAnimationFrame(()=>{let e=ec.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,200)}px`,e.setSelectionRange(e.value.length,e.value.length))});return}if("ArrowDown"===e.key&&ev.current>=0){e.preventDefault();let t=ef.current,r=ev.current+1;r<t.length?(ev.current=r,M(t[r])):(ev.current=-1,M(ey.current)),requestAnimationFrame(()=>{let e=ec.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,200)}px`,e.setSelectionRange(e.value.length,e.value.length))});return}}let t=e.nativeEvent,r=Date.now()-ex.current<100,n=eh.current||t.isComposing||229===t.keyCode;if("Enter"===e.key&&!e.shiftKey&&(n||r)){r&&e.preventDefault();return}"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),i||document.activeElement!==ec.current||ej())},[i,ej,A,U,B,eR]),eI=(0,n.useCallback)(()=>{let e=ec.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[]),eM=(0,n.useCallback)(e=>{let t=Array.from(e.clipboardData?.items??[]).filter(e=>e.type.startsWith("image/"));t.length&&(e.preventDefault(),eb(t.map(e=>e.getAsFile()).filter(e=>null!==e)))},[eb]),eE=(0,n.useCallback)(e=>{let t=Array.from(e.dataTransfer.types);t.includes("Files")||t.includes("text/plain")&&(e.preventDefault(),G(!0))},[]),eW=(0,n.useCallback)(e=>{G(!1)},[]),e$=(0,n.useCallback)(e=>{if(Array.from(e.dataTransfer.types).includes("Files"))return;e.preventDefault(),G(!1);let t=e.dataTransfer.getData("text/plain");if(!t)return;let r=ec.current,n="`"+t+"`";if(!r)return void M(e=>e+(e?" ":"")+n);let i=r.selectionStart??r.value.length,o=r.selectionEnd??r.value.length,a=r.value.slice(0,i),l=r.value.slice(o),s=a.length>0&&!a.endsWith(" ")?" ":"";M(a+s+n+l),requestAnimationFrame(()=>{if(!r)return;let e=i+s.length+n.length;r.setSelectionRange(e,e),r.focus(),r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,200)}px`})},[]),ez=(0,n.useCallback)(e=>{let t=e.target.value;if(M(t),ev.current>=0&&(ev.current=-1),eh.current)return;let r=e.target.selectionStart??0,n=t.slice(0,r),i=n.lastIndexOf("/");if(-1!==i&&(0===i||" "===n[i-1])){let e=n.slice(i+1);if(!e.includes(" ")){let t=f.filter(t=>t.name.toLowerCase().startsWith(e.toLowerCase()));P(t),H(e),F(t.length>0),O(0);return}}F(!1)},[f]),eD=l&&l.length>0?l.map(e=>({provider:e.provider,modelId:e.id,name:e.name})):Object.entries(a??{}).map(([e,t])=>({provider:o?.provider??"unknown",modelId:e,name:t})),eN=[];for(let e of eD){let t=eN.find(t=>t.provider===e.provider);t?t.options.push(e):eN.push({provider:e.provider,options:[e]})}let eA=o?eD.find(e=>e.modelId===o.modelId&&e.provider===o.provider)?.name??o.modelId:eD.length>0?eD[0].name:null;return(0,n.useEffect)(()=>{let e=e=>{ed.current&&!ed.current.contains(e.target)&&eu.current&&!eu.current.contains(e.target)&&W(!1),ep.current&&!ep.current.contains(e.target)&&z(!1),em.current&&!em.current.contains(e.target)&&F(!1),es.current&&!es.current.contains(e.target)&&(X(!1),ee(!1),er(""),ei(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.jsxs)("div",{style:{flexShrink:0,background:"transparent",padding:"0 16px 8px",paddingRight:16},children:[(0,r.jsx)("input",{ref:eg,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{eb(Array.from(e.target.files??[])),e.target.value=""}}),(0,r.jsxs)("div",{style:{maxWidth:1148,margin:"0 auto"},children:[x&&(0,r.jsxs)("div",{style:{marginBottom:8,padding:"5px 10px",background:"color-mix(in oklab, var(--warn), transparent 92%)",border:"1px solid color-mix(in oklab, var(--warn), transparent 75%)",borderRadius:6,fontSize:12,color:"var(--warn)",display:"flex",alignItems:"center",gap:6},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,r.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,r.jsx)("path",{d:"M3 3v5h5"})]}),"Retrying (",x.attempt,"/",x.maxAttempts,")…",x.errorMessage&&(0,r.jsxs)("span",{style:{opacity:.7,marginLeft:4},children:["- ",x.errorMessage]})]}),D.length>0&&(0,r.jsx)("div",{style:{display:"flex",gap:6,marginBottom:6,flexWrap:"wrap"},children:D.map((e,t)=>(0,r.jsxs)("div",{style:{position:"relative",flexShrink:0},children:[(0,r.jsx)("img",{src:e.previewUrl,alt:"",style:{width:56,height:56,objectFit:"cover",borderRadius:6,border:"1px solid var(--border)",display:"block"}}),(0,r.jsx)("button",{onClick:()=>ek(t),style:{position:"absolute",top:-4,right:-4,width:16,height:16,borderRadius:"50%",background:"var(--bg-panel)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,color:"var(--text-muted)"},children:(0,r.jsxs)("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[(0,r.jsx)("line",{x1:"1",y1:"1",x2:"7",y2:"7"}),(0,r.jsx)("line",{x1:"7",y1:"1",x2:"1",y2:"7"})]})})]},t))}),i&&(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,minHeight:20,fontSize:12,color:"var(--text-dim)",fontFamily:"var(--font-mono)",overflow:"hidden"},children:[T&&(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,color:"var(--text-muted)",animation:"codex-status-enter 160ms ease-out both"},children:[(0,r.jsx)("span",{"aria-hidden":!0,style:{width:5,height:5,borderRadius:"50%",flexShrink:0,background:"currentColor",boxShadow:"0 0 0 0 color-mix(in oklab, currentColor, transparent 45%)",animation:"codex-status-dot 1.25s ease-in-out infinite"}}),(0,r.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",animation:"codex-status-breathe 1.8s ease-in-out infinite"},children:T})]}),i&&null!=C&&C>0&&(L=C>=50?"high":C>=20?"mid":"low",(0,r.jsxs)("span",{style:{padding:"1px 6px",borderRadius:4,background:`var(--ui-tps-${L}-bg)`,color:`var(--ui-tps-${L}-fg)`,fontSize:12,fontWeight:500,lineHeight:"18px",flexShrink:0},children:[C.toFixed(1)," t/s"]})),i&&void 0!==S&&S>0&&(0,r.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3,flexShrink:0},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"5",y1:"1.5",x2:"5",y2:"8.5"}),(0,r.jsx)("polyline",{points:"2 6 5 8.5 8 6"})]}),S]})]}),(0,r.jsxs)("div",{style:{position:"relative",display:"flex",gap:8,alignItems:"center",background:Z?"color-mix(in oklab, var(--accent), transparent 92%)":"var(--bg)",border:`1px solid ${Z?"var(--accent)":i?"color-mix(in oklab, var(--danger), transparent 60%)":q?"var(--accent-focus)":"color-mix(in srgb, var(--border) 70%, transparent)"}`,borderRadius:14,padding:"10px 10px 10px 14px",boxShadow:i?"var(--ui-input-streaming-ring), 0 1px 2px rgba(0,0,0,0.25), 0 8px 24px -12px rgba(0,0,0,0.35)":q?"var(--ui-input-focus-ring), 0 1px 2px rgba(0,0,0,0.25), 0 8px 24px -12px rgba(0,0,0,0.35)":"0 1px 2px rgba(0,0,0,0.18), 0 8px 24px -12px rgba(0,0,0,0.25)",transition:"border-color 0.15s, background 0.15s, box-shadow 0.2s"},onDragOver:eE,onDragLeave:eW,onDrop:e$,children:[(0,r.jsxs)("div",{style:{flex:1,position:"relative",display:"flex"},children:[(0,r.jsx)("textarea",{ref:ec,value:I,onChange:ez,onKeyDown:eL,onCompositionStart:()=>{eh.current=!0},onCompositionEnd:()=>{eh.current=!1,ex.current=Date.now()},onInput:eI,onPaste:eM,onFocus:()=>Y(!0),onBlur:()=>Y(!1),placeholder:i?"Agent is running…":"Describe a task or ask a question","aria-label":"Chat message input",rows:1,style:{flex:1,background:"none",border:"none",outline:"none",resize:"none",color:"var(--text)",fontSize:14,lineHeight:1.6,fontFamily:"inherit",minHeight:24,maxHeight:200,overflow:"auto",paddingRight:24}}),!i&&(0,r.jsx)("span",{style:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)",color:"var(--text-dim)",fontSize:14,pointerEvents:"none",fontFamily:"var(--font-mono)",lineHeight:1,opacity:.5},children:"↵"})]}),i&&(0,r.jsxs)("button",{onClick:t,title:"停止 Agent",style:{flexShrink:0,alignSelf:"flex-end",display:"flex",alignItems:"center",gap:6,padding:"7px 14px",background:"color-mix(in oklab, var(--danger), transparent 90%)",border:"1px solid color-mix(in oklab, var(--danger), transparent 65%)",borderRadius:8,color:"var(--danger)",cursor:"pointer",fontSize:13,fontWeight:600,letterSpacing:"-0.01em",transition:"background 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="color-mix(in oklab, var(--danger), transparent 82%)"},onMouseLeave:e=>{e.currentTarget.style.background="color-mix(in oklab, var(--danger), transparent 90%)"},children:[(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,r.jsx)("rect",{x:"1.5",y:"1.5",width:"7",height:"7",rx:"1.5",fill:"currentColor"})}),"Stop"]}),A&&U.length>0&&(0,r.jsx)("div",{ref:em,style:{position:"absolute",bottom:"calc(100% + 6px)",left:0,right:0,zIndex:100,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 -4px 16px rgba(0,0,0,0.30)",overflow:"hidden",width:"100%",maxHeight:240,overflowY:"auto"},children:U.map((e,t)=>(0,r.jsxs)("button",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",background:t===B?"var(--bg-hover)":"none",border:"none",color:t===B?"var(--text)":"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left",fontWeight:t===B?600:400,whiteSpace:"nowrap"},onMouseEnter:()=>O(t),onClick:()=>eR(e.name),children:[(0,r.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:13,flexShrink:0},children:["/",e.name]}),(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis"},children:e.description})]},e.name))})]}),(0,r.jsxs)("div",{style:{marginTop:8,display:"flex",alignItems:"center",gap:6},children:[(0,r.jsxs)("div",{style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:6},children:[(0,r.jsx)("button",{onClick:()=>eg.current?.click(),disabled:i,title:"Attach image",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,background:D.length?"color-mix(in oklab, var(--accent), transparent 92%)":"none",border:`1px solid ${D.length?"var(--accent)":"var(--border)"}`,borderRadius:9999,color:D.length?"var(--accent)":"var(--text-muted)",cursor:i?"not-allowed":"pointer",opacity:i?.5:1,transition:"background 0.12s, color 0.12s"},onMouseEnter:e=>{i||(e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text)")},onMouseLeave:e=>{i||(e.currentTarget.style.background=D.length?"color-mix(in oklab, var(--accent), transparent 92%)":"none",e.currentTarget.style.color=D.length?"var(--accent)":"var(--text-muted)")},children:(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[(0,r.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,r.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),(0,r.jsxs)("div",{ref:es,style:{position:"relative"},children:[(0,r.jsxs)("button",{onClick:()=>{i||X(e=>!e)},disabled:i,title:"Switch project directory",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",height:28,background:V?"var(--bg-hover)":"none",border:"1px solid var(--border)",borderRadius:9999,color:V?"var(--text)":"var(--text-muted)",cursor:i?"not-allowed":"pointer",fontSize:12,fontFamily:"var(--font-body)",whiteSpace:"nowrap",opacity:i?.5:1,transition:"background 0.12s, color 0.12s"},onMouseEnter:e=>{i||(e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text)")},onMouseLeave:e=>{i||(e.currentTarget.style.background=V?"var(--bg-hover)":"none",e.currentTarget.style.color="var(--text-muted)")},children:[(0,r.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,r.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),v||"no-pi-no-gang"]}),V&&(0,r.jsxs)("div",{style:{position:"absolute",bottom:"calc(100% + 6px)",left:0,zIndex:100,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 -4px 16px rgba(0,0,0,0.30)",overflow:"hidden",minWidth:260,maxWidth:380},children:[(y??[]).map(e=>{let t,n,i;return(0,r.jsxs)("button",{onClick:()=>{eC(e)},style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"8px 10px",background:"none",border:"none",borderBottom:"1px solid var(--border)",color:"var(--text-muted)",cursor:"pointer",textAlign:"left",fontSize:12,fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:[(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.1",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,r.jsx)("path",{d:"M1 3A1 1 0 0 1 2 2H4L5 3.5H8.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7A.5.5 0 0 1 1 8V3Z"})}),(0,r.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(n=(t=b&&e.startsWith(b)?"~"+e.slice(b.length):e).includes("/")?"/":"\\",(i=t.split(n).filter(Boolean)).length<=2?t:"…/"+i.slice(-2).join(n))})]},e)}),!Q&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),eT()},style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"8px 10px",background:"none",border:"none",borderTop:(y??[]).length>0?"1px solid var(--border)":"none",color:"var(--text-muted)",cursor:"pointer",textAlign:"left",fontSize:12},children:[(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,r.jsx)("path",{d:"M1 3A1 1 0 0 1 2 2H4L5 3.5H8.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7A.5.5 0 0 1 1 8V3Z"})}),(0,r.jsx)("span",{children:"Use default directory"})]}),Q?(0,r.jsxs)("div",{style:{padding:"6px 8px",borderTop:(y??[]).length>0?"none":void 0},children:[(0,r.jsx)("input",{ref:el,value:et,onChange:e=>{er(e.target.value),ei(null)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eS()),"Escape"===e.key&&(ee(!1),er(""),ei(null))},placeholder:"/path/to/project",style:{width:"100%",fontSize:12,fontFamily:"var(--font-mono)",padding:"5px 8px",border:"1px solid var(--accent)",borderRadius:5,outline:"none",background:"var(--bg)",color:"var(--text)",boxSizing:"border-box"}}),en&&(0,r.jsx)("div",{style:{marginTop:5,color:"var(--danger)",fontSize:12,lineHeight:1.35,overflowWrap:"anywhere"},children:en}),(0,r.jsxs)("div",{style:{display:"flex",gap:5,marginTop:5},children:[(0,r.jsx)("button",{onClick:()=>void eS(),disabled:eo||!et.trim(),style:{flex:1,padding:"4px 0",background:"var(--accent-hover)",border:"none",borderRadius:5,color:"var(--accent-on)",fontSize:12,fontWeight:600,cursor:eo||!et.trim()?"not-allowed":"pointer",opacity:eo||!et.trim()?.65:1},children:eo?"Checking…":"Open"}),(0,r.jsx)("button",{onClick:()=>{ee(!1),er(""),ei(null)},style:{flex:1,padding:"4px 0",background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-muted)",fontSize:12,cursor:"pointer"},children:"Cancel"})]})]}):(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),ee(!0),ei(null),setTimeout(()=>el.current?.focus(),0)},style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"8px 10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",textAlign:"left",fontSize:12},children:[(0,r.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round",style:{flexShrink:0},children:[(0,r.jsx)("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),(0,r.jsx)("line",{x1:"1",y1:"5",x2:"9",y2:"5"})]}),(0,r.jsx)("span",{children:"Custom path…"})]})]})]}),"none"===j&&(0,r.jsxs)("span",{title:"Tools are disabled for the next request",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",height:28,background:"color-mix(in oklab, var(--warn), transparent 92%)",border:"1px solid color-mix(in oklab, var(--warn), transparent 72%)",borderRadius:9999,color:"var(--warn)",fontSize:12,fontFamily:"var(--font-body)",whiteSpace:"nowrap"},children:[(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]}),"No tools"]})]}),(0,r.jsx)("div",{style:{flex:1}}),(0,r.jsxs)("div",{style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:6},children:[eD.length>0&&eA&&s&&(0,r.jsxs)("div",{ref:ed,style:{position:"relative"},children:[(0,r.jsxs)("button",{onClick:()=>W(e=>!e),disabled:i,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",height:28,maxWidth:260,overflow:"hidden",background:E?"var(--bg-hover)":"none",border:"1px solid var(--border)",borderRadius:9999,color:"var(--text-muted)",cursor:i?"not-allowed":"pointer",fontSize:12,opacity:i?.5:1,transition:"background 0.12s, color 0.12s",fontFamily:"var(--font-body)"},onMouseEnter:e=>{i||(e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text)")},onMouseLeave:e=>{e.currentTarget.style.background=E?"var(--bg-hover)":"none",e.currentTarget.style.color="var(--text-muted)"},children:[(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,r.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),(0,r.jsx)("rect",{x:"9",y:"9",width:"6",height:"6"}),(0,r.jsx)("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),(0,r.jsx)("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),(0,r.jsx)("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),(0,r.jsx)("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),(0,r.jsx)("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),(0,r.jsx)("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),(0,r.jsx)("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),(0,r.jsx)("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]}),(0,r.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:eA}),m?.contextWindow!=null&&(0,r.jsxs)("span",{style:{color:"var(--text-dim)",whiteSpace:"nowrap"},children:["(",m.contextWindow>=1e6?`${(m.contextWindow/1e6).toFixed(1).replace(/\.0$/,"")}M`:`${Math.round(m.contextWindow/1e3)}k`,")"]})]}),E&&(0,r.jsx)("div",{ref:eu,style:{position:"absolute",bottom:"calc(100% + 6px)",left:0,zIndex:100,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 -4px 16px rgba(0,0,0,0.30)",overflow:"hidden",width:"max-content",minWidth:180,maxHeight:360,overflowY:"auto"},children:eN.map((e,t)=>(0,r.jsxs)("div",{children:[eN.length>1&&(0,r.jsx)("div",{style:{padding:"6px 12px 4px",fontSize:12,fontWeight:600,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.07em",borderTop:t>0?"1px solid var(--border)":"none"},children:e.provider}),e.options.map(e=>{let t=e.modelId===o?.modelId&&e.provider===o?.provider;return(0,r.jsxs)("button",{onClick:()=>{W(!1),t||s(e.provider,e.modelId)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",background:t?"var(--bg-selected)":"none",border:"none",color:t?"var(--text)":"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left",fontWeight:t?600:400,whiteSpace:"nowrap"},onMouseEnter:e=>{t||(e.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:e=>{t||(e.currentTarget.style.background="none")},children:[t?(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,r.jsx)("polyline",{points:"1.5 5 4 7.5 8.5 2.5"})}):(0,r.jsx)("span",{style:{width:10,flexShrink:0}}),e.name]},`${e.provider}:${e.modelId}`)})]},e.provider))})]}),!i&&p&&(0,r.jsxs)("div",{ref:ep,style:{position:"relative"},children:[(0,r.jsxs)("button",{onClick:()=>!i&&z(e=>!e),disabled:i,title:"切换推理强度",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",height:28,background:$?"var(--bg-hover)":"none",border:"1px solid var(--border)",borderRadius:9999,color:"var(--text-muted)",cursor:i?"not-allowed":"pointer",fontSize:12,opacity:i?.5:1,transition:"background 0.12s, color 0.12s",fontFamily:"var(--font-body)"},onMouseEnter:e=>{i||(e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text)")},onMouseLeave:e=>{e.currentTarget.style.background=$?"var(--bg-hover)":"none",e.currentTarget.style.color="var(--text-muted)"},children:[(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,r.jsx)("path",{d:"M9.5 2A5.5 5.5 0 0 0 4 7.5c0 1.7.78 3.21 2 4.21V14a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2.29c1.22-1 2-2.51 2-4.21A5.5 5.5 0 0 0 9.5 2z"}),(0,r.jsx)("line",{x1:"7",y1:"18",x2:"12",y2:"18"}),(0,r.jsx)("line",{x1:"8",y1:"21",x2:"11",y2:"21"})]}),(0,r.jsx)("span",{children:(()=>{let e=c??"auto";if("auto"===e||!h)return e;let t=h[e];return null!=t?t:e})()})]}),$&&(0,r.jsx)("div",{style:{position:"absolute",bottom:"calc(100% + 6px)",right:0,zIndex:100,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 -4px 16px rgba(0,0,0,0.30)",overflow:"hidden",minWidth:180},children:d.filter(e=>!g||"auto"===e||g.includes(e)).map(e=>{let t=(c??"auto")===e,n=u[e],i="auto"!==e&&h?h[e]:void 0,o=null!=i&&i!==e?i:e,a=null!=i&&i!==e;return(0,r.jsxs)("button",{onClick:()=>{z(!1),t||p(e)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",background:t?"var(--bg-selected)":"none",border:"none",color:t?"var(--text)":"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left",fontWeight:t?600:400,whiteSpace:"nowrap"},onMouseEnter:e=>{t||(e.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:e=>{t||(e.currentTarget.style.background="none")},children:[t?(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,r.jsx)("polyline",{points:"1.5 5 4 7.5 8.5 2.5"})}):(0,r.jsx)("span",{style:{width:10,flexShrink:0}}),(0,r.jsxs)("span",{style:{flex:1},children:[o,a&&(0,r.jsxs)("span",{style:{fontSize:12,color:"var(--text-dim)",fontFamily:"var(--font-mono)",marginLeft:5},children:["(",e,")"]})]}),(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)",marginLeft:8},children:n})]},e)})})]}),null!=m&&(0,r.jsxs)("div",{style:{position:"relative",display:"flex"},onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:[(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 10px",height:28,background:"none",border:"1px solid var(--border)",borderRadius:9999,color:"var(--text-muted)",cursor:"default",fontSize:12,fontFamily:"var(--font-body)",whiteSpace:"nowrap"},children:[(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),null!=m.percent?Math.round(m.percent)+"%":"—"]}),(0,r.jsxs)("div",{style:{position:"absolute",bottom:"calc(100% + 8px)",right:0,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,padding:"10px 14px",fontSize:12,color:"var(--text)",whiteSpace:"nowrap",pointerEvents:"none",opacity:+!!J,transition:"opacity 0.15s",zIndex:100,boxShadow:"0 4px 16px rgba(0,0,0,0.12)",display:"flex",flexDirection:"column",gap:8,minWidth:200},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)",fontSize:12,fontWeight:500},children:"Context window"}),(0,r.jsx)("span",{style:{color:"var(--text)",fontSize:12,fontWeight:600,fontFamily:"var(--font-mono)"},children:null!=m.percent?`${Math.round(m.percent)}%`:"—"})]}),null!=m.percent&&(0,r.jsx)("div",{style:{height:4,borderRadius:2,background:"var(--border)",overflow:"hidden"},children:(0,r.jsx)("div",{style:{height:"100%",borderRadius:2,width:`${m.percent}%`,background:m.percent>90?"var(--danger)":m.percent>75?"var(--warn)":"var(--accent)",transition:"width 0.4s ease"}})}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",color:"var(--text-dim)",fontSize:12,fontFamily:"var(--font-mono)"},children:[(0,r.jsx)("span",{children:null!=m.tokens?`${(m.tokens/1e3).toFixed(1).replace(/\.0$/,"")}k tokens`:"—"}),(0,r.jsx)("span",{children:null!=m.contextWindow?m.contextWindow>=1e6?`${(m.contextWindow/1e6).toFixed(1).replace(/\.0$/,"")}M window`:`${(m.contextWindow/1e3).toFixed(0)}k window`:"—"})]})]})]})]})]})]})]})}),g=(0,e.i(70703).default)(()=>e.A(57788).then(e=>e.RichMarkdownBlock),{loadableGenerated:{modules:[59294]},ssr:!1});function h(e){if(!e)return null;let t=new Date(e),r=new Date,n=t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate(),i=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(n)return i;let o=t.toLocaleDateString([],{month:"short",day:"numeric",year:t.getFullYear()!==r.getFullYear()?"numeric":void 0});return`${o} ${i}`}function x(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);try{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}catch{return Promise.reject()}}function m(e){return e?e.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n"):null}function f(e){return null!==e&&("(no output)"===e.trim()||""===e.trim())}function v(e,t){return e?.isError?"error":e?"done":t?"running":"pending"}function y(e){return"error"===e?"var(--danger)":"done"===e?"var(--success)":"running"===e?"var(--accent)":"var(--text-dim)"}function b({state:e}){return(0,r.jsx)("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:y(e),flexShrink:0,..."running"===e?{animation:"pulse 1.5s ease-in-out infinite"}:{}}})}function k({message:e,isStreaming:t,toolResults:n,modelNames:i,entryId:o,onFork:a,forking:l,onNavigate:s,prevAssistantEntryId:c,onEditContent:d,showTimestamp:u,prevTimestamp:p,onRetry:g,onEditResend:h}){return"user"===e.role?(0,r.jsx)(w,{message:e,entryId:o,onFork:a,forking:l,onNavigate:s,prevAssistantEntryId:c,onEditContent:d,onEditResend:h}):"assistant"===e.role?(0,r.jsx)(j,{message:e,isStreaming:t,toolResults:n,modelNames:i,showTimestamp:u,prevTimestamp:p,onRetry:g}):(e.role,null)}function w({message:e,entryId:t,onFork:i,forking:o,onNavigate:a,prevAssistantEntryId:l,onEditContent:s,onEditResend:c}){let d,u,[p,g]=(0,n.useState)(!1),[m,f]=(0,n.useState)(!1),[v,y]=(0,n.useState)(!1),[b,k]=(0,n.useState)(""),j=(0,n.useRef)(null),S="string"==typeof e.content?e.content:e.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n"),C="string"==typeof e.content?[]:e.content.filter(e=>"image"===e.type),T=h(e.timestamp),R=!!t&&!!i,L=!!l&&!!a,I=()=>{let e=b.trim();e&&c&&c(e),y(!1)},M=()=>{y(!1)};return(0,n.useEffect)(()=>{if(v&&j.current){let e=j.current;e.focus(),e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,200)}px`,e.setSelectionRange(e.value.length,e.value.length)}},[v]),(0,r.jsxs)("div",{style:{marginBottom:"var(--ui-msg-gap)",display:"flex",flexDirection:"column",alignItems:"flex-end"},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[(0,r.jsx)("div",{style:{display:"flex",alignItems:"flex-end",gap:6,maxWidth:"var(--ui-msg-max-width)"},children:v?(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsx)("textarea",{ref:j,value:b,onChange:e=>{k(e.target.value),e.currentTarget.style.height="auto",e.currentTarget.style.height=`${Math.min(e.currentTarget.scrollHeight,200)}px`},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),M())},style:{width:"100%",background:"var(--bg)",border:"1px solid var(--accent-border)",borderRadius:12,padding:"8px 12px",fontSize:14,lineHeight:1.6,color:"var(--text)",resize:"none",fontFamily:"inherit",minHeight:36,maxHeight:200,outline:"none"}}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4,justifyContent:"flex-end"},children:[(0,r.jsx)("button",{onClick:M,style:{padding:"3px 10px",height:24,background:"none",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-dim)",cursor:"pointer",fontSize:12},children:"Cancel"}),(0,r.jsx)("button",{onClick:I,disabled:!b.trim(),style:{padding:"3px 10px",height:24,background:b.trim()?"var(--accent-hover)":"var(--bg-panel)",border:"none",borderRadius:5,color:b.trim()?"var(--accent-on)":"var(--text-dim)",cursor:b.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:600},children:"Send"})]})]}):(0,r.jsxs)("div",{style:{minWidth:0,background:p?"var(--ui-msg-user-hover-bg, var(--user-bg))":"var(--user-bg)",border:"var(--ui-msg-user-border)",borderRadius:"var(--ui-msg-radius)",padding:"var(--ui-msg-padding)",boxShadow:"var(--ui-msg-user-shadow)",fontSize:14,lineHeight:1.6,color:"var(--text)",whiteSpace:"pre-wrap",wordBreak:"break-word",transition:"background 0.15s ease"},children:[C.length>0&&(0,r.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:8*!!S},children:C.map((e,t)=>{let n=e.source?"base64"===e.source.type?`data:${e.source.media_type};base64,${e.source.data}`:e.source.url??"":e.data?`data:${e.mimeType};base64,${e.data}`:"";return(0,r.jsx)("img",{src:n,alt:"",style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:"contain",display:"block",border:"1px solid var(--border)"}},t)})}),e.skillCommand&&"string"==typeof e.content?(d=`/${e.skillCommand}`,u=S.startsWith(d)?S.slice(d.length):S,(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{style:{color:"var(--accent)",fontWeight:500},children:d}),(0,r.jsx)("span",{children:u})]})):S]})}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:6,marginTop:3},children:[(0,r.jsx)("div",{style:{display:"flex",gap:3,transition:"opacity 0.12s"},children:c&&(0,r.jsxs)("button",{onClick:()=>{k(S),y(!0)},title:"Edit and resend",style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:"var(--text-dim)",cursor:"pointer",fontSize:12,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)"},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,r.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]})}),(0,r.jsxs)("button",{onClick:()=>{x(S).then(()=>{f(!0),setTimeout(()=>f(!1),1500)})},title:"Copy message",style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:m?"var(--accent)":"var(--text-dim)",cursor:"pointer",fontSize:12,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{m||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{m||(e.currentTarget.style.color="var(--text-dim)")},children:[m?(0,r.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),m?"Copied":"Copy"]}),(R||L)&&(0,r.jsxs)("div",{style:{display:"flex",gap:3},children:[L&&(0,r.jsxs)("button",{onClick:()=>{a(l),s?.(S)},title:"Branch — edit from here within this session",style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:"var(--text-dim)",cursor:"pointer",fontSize:12,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)"},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("polyline",{points:"15 10 20 15 15 20"}),(0,r.jsx)("path",{d:"M4 4v7a4 4 0 0 0 4 4h12"})]}),"Branch"]}),R&&(0,r.jsxs)("button",{onClick:()=>{i(t)},disabled:o,title:o?"Creating new session…":"Fork — creates an independent copy from here",style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:o?"var(--accent)":"var(--text-dim)",cursor:o?"not-allowed":"pointer",fontSize:12,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{o||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{o||(e.currentTarget.style.color="var(--text-dim)")},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,r.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),o?"Creating…":"Fork"]})]}),T&&(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)"},children:T})]})]})}function j({message:e,isStreaming:t,toolResults:i,modelNames:o,showTimestamp:a,prevTimestamp:l,onRetry:s}){let c=a?h(e.timestamp):null,d=e.content??[],[u,p]=(0,n.useState)(!1),[g,m]=(0,n.useState)(!1),f=(0,n.useRef)(d);f.current=d;let v=(0,n.useRef)(new Map),[y,b]=(0,n.useState)(new Map),k=(0,n.useMemo)(()=>{if(!e.timestamp||!l)return;let t=Math.round((e.timestamp-l)/1e3);return t>0?t:void 0},[e.timestamp,l]),w=(0,n.useMemo)(()=>{let t=new Map;if(!i||!e.timestamp)return t;for(let[r,n]of i)if(n.timestamp){let i=d.find(e=>"toolCall"===e.type&&e.toolCallId===r),o=i?._sourceTs??e.timestamp,a=Math.round((n.timestamp-o)/1e3);a>0&&t.set(r,a)}return t},[i,e.timestamp,d]),C=d.filter(e=>"text"===e.type).map(e=>e.text).join("\n");return(0,n.useEffect)(()=>{if(!t){let e=Date.now();b(t=>{let r=new Map(t);for(let[t,n]of v.current)r.has(t)||r.set(t,Math.round((e-n)/1e3));return r});return}let e=setInterval(()=>{let e=f.current,t=Date.now();e.forEach((e,r)=>{v.current.has(r)||v.current.set(r,t)}),b(r=>{let n=!1,i=new Map(r);for(let r=0;r<e.length-1;r++)if(!i.has(r)&&v.current.has(r)){let e=v.current.get(r),o=v.current.get(r+1)??t;i.set(r,Math.round((o-e)/1e3)),n=!0}return n?i:r})},300);return()=>clearInterval(e)},[t]),(0,r.jsxs)("div",{style:{marginBottom:"var(--ui-msg-gap)"},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:(0,r.jsx)(S,{blocks:d,toolResults:i,isStreaming:t,streamingDurations:y,thinkingDurationFromFile:k,toolCallDurations:w})}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[s&&!t&&(0,r.jsxs)("button",{onClick:s,title:"Retry with the same prompt",style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:"var(--text-dim)",cursor:"pointer",fontSize:12,fontWeight:400,whiteSpace:"nowrap",transition:"opacity 0.12s, color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)"},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,r.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),"Retry"]}),C&&!t&&(0,r.jsxs)("button",{onClick:()=>{x(C).then(()=>{m(!0),setTimeout(()=>m(!1),1500)})},title:"Copy message",style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:g?"var(--accent)":"var(--text-dim)",cursor:"pointer",fontSize:12,fontWeight:400,whiteSpace:"nowrap",transition:"opacity 0.12s, color 0.12s"},onMouseEnter:e=>{g||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{g||(e.currentTarget.style.color="var(--text-dim)")},children:[g?(0,r.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),g?"Copied":"Copy"]}),c&&!t&&(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)",marginLeft:"auto"},children:c})]})]})}function S({blocks:e,toolResults:t,isStreaming:n,streamingDurations:i,thinkingDurationFromFile:o,toolCallDurations:a}){let l=[],s=[],c=()=>{0!==s.length&&(l.push((0,r.jsx)(L,{blocks:s.map(e=>e.block),toolResults:t,isStreaming:n,toolCallDurations:a},`tools-${s[0].idx}`)),s=[])};for(let t=0;t<e.length;t++){let a=e[t];if("toolCall"===a.type)s.push({block:a,idx:t});else if(c(),"text"===a.type)l.push((0,r.jsx)(C,{block:a,isStreaming:n},t));else if("thinking"===a.type){let e=i.get(t)??o;l.push((0,r.jsx)(T,{block:a,duration:e,isStreaming:n},t))}}return c(),(0,r.jsx)(r.Fragment,{children:l})}function C({block:e,isStreaming:i}){let[o,a]=(0,n.useState)(e.text.length),l=(0,n.useRef)(e.text);l.current=e.text;let s=(0,n.useRef)(null),c=(0,n.useRef)(i);(0,n.useEffect)(()=>{if(!i){a(l.current.length),c.current=!0;return}c.current&&(c.current=!1,a(l.current.length));let e=performance.now(),t=()=>{let r=performance.now(),n=Math.min((r-e)/1e3,.1);e=r,a(e=>{let r=l.current.length;if(e>=r)return s.current=null,e;let i=r-e,o=Math.min(r,e+Math.max(1,Math.round(250*n*(i>150?3.2:i>80?2:1))));return o<r?s.current=requestAnimationFrame(t):s.current=null,o})};return s.current=requestAnimationFrame(t),()=>{null!==s.current&&(cancelAnimationFrame(s.current),s.current=null)}},[i,e.text]);let d=i&&o<e.text.length?e.text.slice(0,o):e.text;return"1"===t.default.env.NEXT_PUBLIC_PI_WEB_LIGHT_RENDER?(0,r.jsx)("div",{className:"markdown-body",children:(0,r.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:d})}):(0,r.jsx)("div",{className:"markdown-body",children:(0,r.jsx)(g,{text:d,isStreaming:i})})}function T({block:e,duration:t,isStreaming:i}){let[o,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!document.getElementById("think-pulse-style")){let e=document.createElement("style");e.id="think-pulse-style",e.innerHTML="@keyframes think-pulse { 0%,100%{opacity:.45} 50%{opacity:1} }@keyframes think-collapse-in { from{opacity:0;max-height:0;margin-top:0} to{opacity:1;max-height:600px;margin-top:8px} }@keyframes fadeInUp { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }",document.head.appendChild(e)}},[]),(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{onClick:()=>a(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 10px",background:"var(--bg-subtle)",border:"none",borderRadius:14,color:"var(--text-dim)",cursor:"pointer",fontSize:12,lineHeight:"20px",transition:"color 0.15s, background 0.15s",...i?{animation:"think-pulse 1.8s ease-in-out infinite"}:{}},onMouseEnter:e=>{e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)",e.currentTarget.style.background="var(--bg-subtle)"},children:[(0,r.jsx)("span",{children:"Thinking"}),i&&(0,r.jsxs)("span",{style:{display:"flex",gap:2,alignItems:"flex-end",height:12},children:[(0,r.jsx)("span",{style:{width:3,height:3,borderRadius:"50%",background:"currentColor",animation:"think-pulse 1.2s ease-in-out infinite",animationDelay:"0s"}}),(0,r.jsx)("span",{style:{width:3,height:3,borderRadius:"50%",background:"currentColor",animation:"think-pulse 1.2s ease-in-out infinite",animationDelay:"0.2s"}}),(0,r.jsx)("span",{style:{width:3,height:3,borderRadius:"50%",background:"currentColor",animation:"think-pulse 1.2s ease-in-out infinite",animationDelay:"0.4s"}})]}),void 0!==t&&(0,r.jsxs)("span",{style:{fontSize:12,fontVariantNumeric:"tabular-nums"},children:[t,"s"]}),(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),o&&(0,r.jsx)("div",{style:{padding:"8px 12px",marginTop:6,color:"var(--text-muted)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap",background:"var(--bg-subtle)",borderRadius:8,borderLeft:"2px solid var(--border)",animation:"think-collapse-in 250ms ease both",overflow:"hidden"},children:e.thinking})]})}function R({block:e,result:t,isRunning:i,duration:o,isFirst:a,isLast:l}){let s,[c,d]=(0,n.useState)(!1),u=JSON.stringify(e.input,null,2),p=m(t),g=f(p),h=t?.isError??!1,x=v(t,i),k=null===(s=m(t))||f(s)?"":s.trim().replace(/\s+/g," ").slice(0,120);return(0,r.jsxs)("div",{style:{position:"relative",paddingLeft:18,paddingBottom:2*!l},children:[!l&&(0,r.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",left:5,top:15*!!a,bottom:-2,width:1,background:"var(--border)"}}),(0,r.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",left:2,top:11,display:"flex",alignItems:"center",justifyContent:"center",width:7,height:7},children:(0,r.jsx)(b,{state:x})}),(0,r.jsxs)("button",{onClick:()=>d(e=>!e),style:{display:"flex",alignItems:"center",gap:7,width:"100%",minHeight:28,padding:"4px 6px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:12,fontFamily:"var(--font-mono)",textAlign:"left",minWidth:0,borderRadius:5},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-subtle)"},onMouseLeave:e=>{e.currentTarget.style.background="none"},children:[(0,r.jsx)("span",{style:{color:y(x),fontWeight:600,flexShrink:0},children:e.toolName}),(0,r.jsx)("span",{style:{color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:k?"0 1 auto":1,minWidth:0},children:function(e){let t=e.input;if(!t||"object"!=typeof t)return"";let r=Object.keys(t);return 0===r.length?"":"command"in t?String(t.command).slice(0,120):"path"in t?String(t.path).slice(0,120):"file_path"in t?String(t.file_path).slice(0,120):"pattern"in t?String(t.pattern).slice(0,120):"query"in t?String(t.query).slice(0,120):String(t[r[0]]).slice(0,120)}(e)}),k&&(0,r.jsx)("span",{style:{color:h?"var(--danger)":"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:k}),void 0!==o&&(0,r.jsxs)("span",{style:{fontSize:12,color:"var(--text-dim)",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:[o,"s"]}),(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:c?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),c&&(0,r.jsxs)("div",{style:{margin:"2px 0 8px 6px",border:"1px solid var(--border)",borderRadius:7,overflow:"hidden",background:"var(--bg-panel)",animation:"fade-in-up 160ms ease"},children:[(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",color:"var(--text-muted)",fontSize:12,lineHeight:1.5,overflow:"auto",background:"var(--bg-subtle)",borderTop:"1px solid var(--border)",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:u}),t&&(0,r.jsx)(I,{text:p??"",isEmpty:g,isError:h})]})]})}function L({blocks:e,toolResults:t,isStreaming:i,toolCallDurations:o}){let[a,l]=(0,n.useState)(!1),s=(0,n.useRef)(0),[c,d]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(0===s.current&&(s.current=Date.now()),!i)return void d(Math.round((Date.now()-s.current)/1e3));let e=()=>d(Math.round((Date.now()-s.current)/1e3));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[i]);let u=e.every(e=>t?.has(e.toolCallId)),p=e.map(e=>v(t?.get(e.toolCallId),i&&!t?.has(e.toolCallId))),g=p.filter(e=>"error"===e).length,h=p.filter(e=>"running"===e).length,x=p.filter(e=>"done"===e).length,m=g>0?`${g} failed`:h>0?`${h} running`:u?`${x} done`:"pending",f=a?e:e.slice(0,3),y=e.length-f.length;return(0,r.jsxs)("div",{style:{margin:"6px 0",display:"flex",flexDirection:"column",gap:2},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,paddingLeft:18,color:"var(--text-dim)",fontSize:12,fontFamily:"var(--font-mono)"},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)",fontWeight:600},children:"Tools"}),(0,r.jsxs)("span",{style:{color:g>0?"var(--danger)":h>0?"var(--accent)":"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:[e.length," steps · ",m]}),c>0&&(0,r.jsxs)("span",{style:{flexShrink:0,fontVariantNumeric:"tabular-nums",color:"var(--text-dim)",opacity:.5,...i&&!u?{animation:"pulse 1.5s ease-in-out infinite"}:{}},children:[c,"s"]})]}),(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:f.map((e,n)=>{let a=t?.get(e.toolCallId);return(0,r.jsx)(R,{block:e,result:a,isRunning:i&&!a,duration:o?.get(e.toolCallId),isFirst:0===n,isLast:n===f.length-1&&0===y},e.toolCallId)})}),y>0&&(0,r.jsxs)("button",{onClick:()=>l(!0),style:{alignSelf:"flex-start",marginLeft:18,marginTop:2,padding:"2px 6px",background:"none",border:"none",borderRadius:5,color:"var(--text-dim)",cursor:"pointer",fontSize:12,fontFamily:"var(--font-mono)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-subtle)",e.currentTarget.style.color="var(--text-muted)"},onMouseLeave:e=>{e.currentTarget.style.background="none",e.currentTarget.style.color="var(--text-dim)"},children:["Show ",y," more"]})]})}function I({text:e,isEmpty:t,isError:n}){return(0,r.jsx)("div",{style:{borderTop:"1px solid var(--border)",background:"var(--bg-panel)"},children:(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",color:n?"var(--danger)":t?"var(--text-dim)":"var(--text-muted)",fontSize:12,lineHeight:1.5,overflow:"auto",maxHeight:400,background:"var(--bg)",whiteSpace:"pre-wrap",wordBreak:"break-all",fontStyle:t?"italic":"normal",opacity:t?.6:1},children:t?"(no output)":e})})}function M(){return(0,r.jsxs)("div",{className:"session-loading",children:[(0,r.jsxs)("div",{className:"sl-messages",children:[(0,r.jsxs)("div",{className:"sl-msg sl-msg--left sl-msg--a",children:[(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w80"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w65"})]}),(0,r.jsx)("div",{className:"sl-msg sl-msg--right sl-msg--b",children:(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w90"})}),(0,r.jsxs)("div",{className:"sl-msg sl-msg--left sl-msg--c",children:[(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w95"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w100"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w70"})]}),(0,r.jsxs)("div",{className:"sl-msg sl-msg--left sl-msg--d",children:[(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w50"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w75"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w85"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w40"})]}),(0,r.jsxs)("div",{className:"sl-msg sl-msg--right sl-msg--e",children:[(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w70"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w35"})]}),(0,r.jsxs)("div",{className:"sl-msg sl-msg--left sl-msg--f",children:[(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w95"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w100"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w90"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w85"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w100"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w70"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w50"}),(0,r.jsx)("div",{className:"sl-msg-line sl-msg-line--w35"})]}),(0,r.jsx)("div",{style:{height:8,flexShrink:0}})]}),(0,r.jsx)("div",{className:"sl-input-wrap",children:(0,r.jsx)("div",{className:"sl-input",children:(0,r.jsx)("div",{className:"sl-input-line"})})})]})}function E({visibleAnchors:e,activeAnchorId:t,panelHeight:n,panelOpen:i,onPanelOpenChange:o,onScrollTo:a}){return(0,r.jsxs)("nav",{className:"hidden xl:flex","aria-label":"User message navigator",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o(!1)},style:{position:"absolute",right:18,top:"50%",transform:"translateY(-50%)",zIndex:9,width:42,height:n,flexDirection:"column",alignItems:"flex-end",justifyContent:"center",overflow:"visible",pointerEvents:"none"},children:[(0,r.jsx)("div",{style:{display:"flex",width:28,height:n,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:0,padding:"14px 0",pointerEvents:"auto"},children:e.map(e=>{let n=t===e.id;return(0,r.jsx)("button",{type:"button","aria-label":`Jump to prompt ${e.index}: ${e.label}`,"aria-current":n?"location":void 0,onClick:()=>a(e.id),style:{width:20,height:28,padding:0,border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-end"},onMouseEnter:e=>{let t=e.currentTarget.firstElementChild;t&&!n&&(t.style.background="var(--text-muted)")},onMouseLeave:e=>{let t=e.currentTarget.firstElementChild;t&&!n&&(t.style.background="var(--border)")},children:(0,r.jsx)("span",{"aria-hidden":!0,style:{width:n?11:7,height:n?3:2,borderRadius:9999,background:n?"var(--accent)":"var(--border)",transition:"width 0.12s ease, background 0.12s ease"}})},e.id)})}),i&&(0,r.jsxs)("div",{style:{position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",width:224,maxWidth:"min(224px, calc(100vw - 560px))",height:n,pointerEvents:"auto"},children:[(0,r.jsx)("style",{children:`
2
+ @keyframes user-anchor-panel-in {
3
+ from { opacity: 0; transform: translateX(12px) scale(0.98); }
4
+ to { opacity: 1; transform: translateX(0) scale(1); }
5
+ }
6
+ `}),(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:0,padding:"14px 10px",height:n,overflow:"hidden",borderRadius:14,border:"1px solid var(--border)",background:"var(--bg-panel)",boxShadow:"var(--shadow-lg)",backdropFilter:"blur(14px)",animation:"user-anchor-panel-in 180ms cubic-bezier(.2,.8,.2,1) both"},children:e.map(e=>{let n=t===e.id;return(0,r.jsxs)("button",{type:"button",title:e.title&&e.title!==e.label?e.title:void 0,"aria-label":`Jump to prompt ${e.index}: ${e.label}`,"aria-current":n?"location":void 0,onClick:()=>a(e.id),style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) 18px",alignItems:"center",gap:12,minHeight:28,padding:"0 8px 0 10px",border:"none",borderRadius:7,background:"transparent",color:n?"var(--text)":"var(--text-muted)",cursor:"pointer",fontSize:14,lineHeight:1.15,fontWeight:n?500:400,textAlign:"left",letterSpacing:"-0.02em",transition:"color 160ms ease, background 160ms ease, transform 160ms ease"},onMouseEnter:e=>{if(n)return;e.currentTarget.style.color="var(--text)",e.currentTarget.style.background="var(--bg-hover)";let t=e.currentTarget.lastElementChild;t&&(t.style.background="var(--text-dim)")},onMouseLeave:e=>{if(n)return;e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.background="transparent";let t=e.currentTarget.lastElementChild;t&&(t.style.background="var(--border)")},children:[(0,r.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),(0,r.jsx)("span",{"aria-hidden":!0,style:{justifySelf:"end",width:n?13:10,height:n?4:3,borderRadius:9999,background:n?"var(--accent)":"var(--border)",transition:"width 160ms ease, height 160ms ease, background 160ms ease"}})]},e.id)})})]})]})}let W=["ready when you are.","ask me anything.","let's build something cool.","explore your codebase.","draft an email.","summarize that paper.","plan your weekend.","explain it like I'm five.","pair-program with me.","fix that pesky bug.","translate to 中文.","write a haiku.","brainstorm ideas.","review my pull request.","what should we cook tonight?","ship it.","make it pretty.","rubber-duck with me."];function $(e){let t=e.content;return"string"==typeof t?t:t.map(e=>"text"===e.type&&"text"in e?e.text:"").filter(Boolean).join("\n")}function z({phrases:e}){let[t,i]=(0,n.useState)(()=>Math.floor(Math.random()*e.length)),[o,a]=(0,n.useState)(""),[l,s]=(0,n.useState)(!1),[c,d]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=setInterval(()=>d(e=>!e),530);return()=>clearInterval(e)},[]),(0,n.useEffect)(()=>{let r,n=e[t];if(l||o!==n)if(l&&""===o)s(!1),i(t=>(t+1)%e.length);else{let e=l?n.slice(0,o.length-1):n.slice(0,o.length+1);r=setTimeout(()=>a(e),l?28:55)}else r=setTimeout(()=>s(!0),1800);return()=>clearTimeout(r)},[o,l,t,e]),(0,r.jsxs)("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[o,(0,r.jsx)("span",{style:{opacity:+!!c,color:"var(--accent)",marginLeft:1},children:"▍"})]})}e.s(["ChatWindow",0,function({session:t,newSessionCwd:d,onAgentEnd:u,onSessionCreated:g,onSessionForked:h,modelsRefreshKey:x,chatInputRef:m,onBranchDataChange:f,onStreamingChange:v,onSystemPromptChange:y,onSessionStatsChange:b,onContextUsageChange:w,onLoadingChange:j,recentCwds:S,homeDir:C="",onCwdSelect:T,onCwdDefault:R}){let{data:L,loading:I,branchLoading:D,error:N,messages:A,entryIds:F,streamState:_,commands:H,agentRunning:B,modelNames:O,modelList:U,modelThinkingLevels:P,modelThinkingLevelMaps:q,toolPreset:Y,thinkingLevel:J,retryInfo:K,contextUsage:V,forkingEntryId:X,displayModel:Z,sessionStats:G,agentPhase:Q,activeLeafId:ee,isNew:et,handleSend:er,handleAbort:en,handleFork:ei,handleNavigate:eo,handleModelChange:ea,handleThinkingLevelChange:el,handleAgentEventRef:es}=function(t){let{session:r,newSessionCwd:c,onAgentEnd:d,onSessionCreated:u,onSessionForked:p,modelsRefreshKey:g,onBranchDataChange:h,onSystemPromptChange:x}=t,m=null===r&&null!==c,[f,v]=(0,n.useState)(null),[y,b]=(0,n.useState)(null!==r),[k,w]=(0,n.useState)(!1),[j,S]=(0,n.useState)(null),[C,T]=(0,n.useState)(null),[R,L]=(0,n.useState)([]),[I,M]=(0,n.useState)([]),[E,W]=(0,n.useReducer)(l,{isStreaming:!1,streamingMessage:null}),[$,z]=(0,n.useState)(!1),[D,N]=(0,n.useState)({}),[A,F]=(0,n.useState)([]),[_,H]=(0,n.useState)({}),[B,O]=(0,n.useState)({}),[U,P]=(0,n.useState)(null),[q,Y]=(0,n.useState)("default"),[J,K]=(0,n.useState)("auto"),[V,X]=(0,n.useState)(null),[Z,G]=(0,n.useState)(null),[Q,ee]=(0,n.useState)(null),[et,er]=(0,n.useState)(null),[en,ei]=(0,n.useState)(null),[eo,ea]=(0,n.useState)(null),[el,es]=(0,n.useState)(!1),[ec,ed]=(0,n.useState)(null),[eu,ep]=(0,n.useState)(null),[eg,eh]=(0,n.useState)("idle"),[ex,em]=(0,n.useState)([]),ef=(0,n.useRef)(null),ev=(0,n.useRef)(r?.id??null),ey=(0,n.useRef)(!1),eb=(0,n.useRef)(null),ek=(0,n.useRef)(0),ew=(0,n.useRef)(A);ew.current=A;let ej=t.setNewSessionModel??P,eS=t.setToolPreset??Y,eC=en??f?.context.model??eo??null,eT=m?U:eC,eR=(()=>{let e={input:0,output:0,cacheRead:0,cacheWrite:0},t=0;for(let r of R){if("assistant"!==r.role)continue;let n=r.usage;n&&(e.input+=n.input??0,e.output+=n.output??0,e.cacheRead+=n.cacheRead??0,e.cacheWrite+=n.cacheWrite??0,t+=n.cost?.total??0)}return e.input+e.output+e.cacheRead+e.cacheWrite>0?{tokens:e,cost:t}:null})(),eL=(0,n.useCallback)(async(e,t=!1,r=!1)=>{let n=ek.current;try{t&&b(!0);let i=r?`/api/sessions/${encodeURIComponent(e)}?includeState`:`/api/sessions/${encodeURIComponent(e)}`,o=await fetch(i);if(ek.current!==n)return null;if(404===o.status)return t&&(v(null),T(null),L([]),S(null)),null;if(!o.ok)throw Error(`HTTP ${o.status}`);let a=await o.json();if(ek.current!==n)return null;return v(a),T(a.leafId),L(e$(a.context.messages)),M(a.context.entryIds??[]),ei(null),S(null),!a.agentState?.state?.thinkingLevel&&a.context.thinkingLevel&&"off"!==a.context.thinkingLevel&&K(a.context.thinkingLevel),a.agentState?.state?.contextUsage!==void 0&&G(a.agentState.state.contextUsage??null),a.agentState??null}catch(e){return S(String(e)),null}finally{t&&b(!1)}},[]),eI=(0,n.useCallback)(async(e,t)=>{let r=ek.current,n=performance.now();w(!0);try{let n=t?`/api/sessions/${encodeURIComponent(e)}/context?leafId=${encodeURIComponent(t)}`:`/api/sessions/${encodeURIComponent(e)}/context`,i=await fetch(n);if(ek.current!==r)return;if(!i.ok)throw Error(`HTTP ${i.status}`);let o=await i.json();if(ek.current!==r)return;L(e$(o.context.messages)),M(o.context.entryIds??[])}catch(e){console.error("Failed to load context:",e)}finally{if(ek.current!==r)return;let e=Math.max(0,500-(performance.now()-n));e>0?setTimeout(()=>w(!1),e):w(!1)}},[]),eM=(0,n.useCallback)(async t=>{try{let r=await o(t,{type:"get_tools"});if(r){let{getPresetFromTools:t}=await e.A(10579);eS(t(r))}}catch(e){console.error("Failed to load tools:",e)}},[eS]),eE=(0,n.useCallback)(e=>{ef.current&&(ef.current.close(),ef.current=null),eh("connecting");let t=new EventSource(`/api/agent/${encodeURIComponent(e)}/events`);ef.current=t,t.onopen=()=>{ef.current===t&&eh("connected")},t.onmessage=e=>{ef.current===t&&eh("connected");try{let t=JSON.parse(e.data);eb.current?.(t)}catch{}},t.onerror=()=>{ef.current===t&&ey.current?(eh("reconnecting"),t.close(),ef.current=null,setTimeout(()=>{ey.current&&eE(e)},1e3)):ef.current===t&&eh("idle")}},[]);(0,n.useEffect)(()=>{ey.current=$},[$]);let eW=e=>{if("assistant"!==e.role)return!1;let t=e.content;return Array.isArray(t)&&t.length>0&&t.every(e=>"toolCall"===e.type)},e$=e=>{let t=[];for(let r of e){if(!eW(r)){t.push(r);continue}let e=t[t.length-1];if(e?.role==="assistant"){let n=r.content.map(e=>({...e,_sourceTs:r.timestamp}));t[t.length-1]={...e,content:[...e.content,...n]}}else t.push(r)}return t};eb.current=(0,n.useCallback)(e=>{switch(e.type){case"agent_start":z(!0),ep(e=>e?.kind==="running_skill"?e:{kind:"waiting_model"}),W({type:"start"});break;case"agent_end":z(!1),ep(null),eh("idle"),X(null),W({type:"end"}),ek.current+=1,ev.current&&(fetch(`/api/agent/${encodeURIComponent(ev.current)}`).then(e=>e.json()).then(e=>{e.state?.contextUsage!==void 0&&G(e.state.contextUsage??null),e.state?.systemPrompt!==void 0&&ee(e.state.systemPrompt??null)}).catch(()=>{}),eL(ev.current).catch(()=>{})),d?.();break;case"message_start":case"message_update":{let t=e.message;if(t?.role==="user")break;t&&W({type:"update",message:a(t)}),ep(e=>e?.kind==="running_skill"?{kind:"waiting_model"}:null);break}case"message_end":{let t=e.message;t&&"user"!==t.role&&L(e=>e$([...e,a(t)])),W({type:"reset"}),ep({kind:"waiting_model"});break}case"tool_execution_start":{let t=e.toolCallId,r=e.toolName;ep(e=>{let n=e?.kind==="running_tools"?[...e.tools]:[];return n.some(e=>e.id===t)||n.push({id:t,name:r}),{kind:"running_tools",tools:n}});break}case"tool_execution_end":{let t=e.toolCallId;ep(e=>{if(e?.kind!=="running_tools")return e;let r=e.tools.filter(e=>e.id!==t);return 0===r.length?{kind:"waiting_model"}:{kind:"running_tools",tools:r}});break}case"auto_retry_start":X({attempt:e.attempt,maxAttempts:e.maxAttempts,errorMessage:e.errorMessage});break;case"auto_retry_end":X(null);break;case"auto_compaction_start":case"compaction_start":es(!0),ed(null);break;case"auto_compaction_end":case"compaction_end":es(!1),e.errorMessage?ed(e.errorMessage):!e.aborted&&(ek.current+=1,ev.current&&eL(ev.current))}},[eL,d]);let ez=(0,n.useCallback)(async e=>{try{let t=await fetch(`/api/skills?cwd=${encodeURIComponent(e)}`);if(!t.ok)return;let r=await t.json();em(r.skills?.map(e=>({name:e.name,description:e.description}))??[])}catch(e){console.error("Failed to fetch commands:",e)}},[]),eD=(0,n.useCallback)(async(t,n,a)=>{if($)return;if(0===ew.current.length)return void i.toast.error("No models configured. Add models in Settings → Models first.");ek.current+=1;let l=a?.map(e=>({type:"image",source:{type:"base64",media_type:e.mimeType,data:e.data}})),d={role:"user",skillCommand:t,content:l?.length?[...n.trim()?[{type:"text",text:`/${t} ${n}`}]:[{type:"text",text:`/${t}`}],...l]:n.trim()?`/${t} ${n}`:`/${t}`,timestamp:Date.now()};L(e=>[...e,d]),z(!0),ep({kind:"running_skill",skill:t}),W({type:"start"});let p=a?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}));try{if(m&&c){U&&ea(U);let{PRESET_NONE:r,PRESET_DEFAULT:i,PRESET_FULL:o}=await e.A(10579),a="none"===q?r:"default"===q?i:o,l=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:c,type:"command",command:t,message:n,toolNames:a,...p?.length?{images:p}:{},...U?{provider:U.provider,modelId:U.modelId}:{},..."auto"!==J?{thinkingLevel:J}:{}})});if(!l.ok)throw Error(await s(l));let d=await l.json();ev.current=d.sessionId,eE(d.sessionId),u?.({id:d.sessionId,path:"",cwd:c,name:void 0,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:n})}else r&&(eE(r.id),await o(r.id,{type:"command",command:t,message:n,...p?.length?{images:p}:{}}))}catch(e){console.error("Failed to send command:",e),i.toast.error(e instanceof Error?e.message:String(e)),z(!1),ep(null),W({type:"end"})}},[m,c,U,q,J,r,$,eE,u]),eN=(0,n.useCallback)(async(t,n)=>{if(!t.trim()&&!n?.length||$)return;if(!r&&!c)return void i.toast.error("Select a project directory before chatting.");if(0===ew.current.length)return void i.toast.error("No models configured. Add models in Settings → Models first.");ek.current+=1;let a=t.match(/^(\/[a-zA-Z0-9._-]+)\s*(.*)$/);if(a){let e=a[1].slice(1),t=a[2];if(ex.some(t=>t.name===e))return eD(e,t,n)}let l=n?.map(e=>({type:"image",source:{type:"base64",media_type:e.mimeType,data:e.data}})),d={role:"user",content:l?.length?[...t.trim()?[{type:"text",text:t}]:[],...l]:t,timestamp:Date.now()};L(e=>[...e,d]),z(!0),ep({kind:"waiting_model"}),W({type:"start"});let p=n?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}));try{if(m&&c){U&&ea(U);let{PRESET_NONE:r,PRESET_DEFAULT:n,PRESET_FULL:i}=await e.A(10579),o="none"===q?r:"default"===q?n:i,a=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:c,type:"prompt",message:t,toolNames:o,...p?.length?{images:p}:{},...U?{provider:U.provider,modelId:U.modelId}:{},..."auto"!==J?{thinkingLevel:J}:{}})});if(!a.ok)throw Error(await s(a));let l=(await a.json()).sessionId;ev.current=l,eE(l),u?.({id:l,path:"",cwd:c,name:void 0,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:t})}else r&&(eE(r.id),await o(r.id,{type:"prompt",message:t,...p?.length?{images:p}:{}}))}catch(e){console.error("Failed to send message:",e),i.toast.error(e instanceof Error?e.message:String(e)),z(!1),ep(null),W({type:"end"})}},[m,c,U,q,J,r,$,eE,u,ex,eD]),eA=(0,n.useCallback)(async()=>{let e=ev.current;if(e)try{await o(e,{type:"abort"})}catch(e){console.error("Failed to abort:",e)}},[]),eF=(0,n.useCallback)(async e=>{let t=ev.current;if(t){er(e);try{let{cancelled:r,newSessionId:n}=await o(t,{type:"fork",entryId:e})??{};!r&&n&&p?.(n)}catch(e){console.error("Fork failed:",e)}finally{er(null)}}},[p]),e_=(0,n.useCallback)(async e=>{let t=ev.current;t&&(ek.current+=1,o(t,{type:"navigate_tree",targetId:e}).catch(()=>{}),T(e),await eI(t,e))},[eI]),eH=(0,n.useCallback)(async e=>{T(e);let t=ev.current;t&&(ek.current+=1,await eI(t,e),e&&o(t,{type:"navigate_tree",targetId:e}).catch(()=>{}))},[eI]),eB=(0,n.useCallback)(async(e,t)=>{if(m)return void ej({provider:e,modelId:t});let r=ev.current;if(r)try{await o(r,{type:"set_model",provider:e,modelId:t}),ei({provider:e,modelId:t})}catch(e){console.error("Failed to set model:",e)}},[m,ej]),eO=(0,n.useCallback)(async()=>{let e=ev.current;if(e&&!el){es(!0),ed(null);try{await o(e,{type:"compact"}),await eL(e,!0)}catch(e){ed(e instanceof Error?e.message:String(e))}finally{es(!1)}}},[el,eL]),eU=(0,n.useCallback)(async(e,t)=>{let r=ev.current;if(!r)return;L(t=>[...t,{role:"user",content:`[steer] ${e}`,timestamp:Date.now()}]);let n=t?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}));try{await o(r,{type:"steer",message:e,...n?.length?{images:n}:{}})}catch(e){console.error("Failed to steer:",e)}},[]),eP=(0,n.useCallback)(async(e,t)=>{let r=ev.current;if(!r)return;L(t=>[...t,{role:"user",content:e,timestamp:Date.now()}]);let n=t?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}));try{await o(r,{type:"follow_up",message:e,...n?.length?{images:n}:{}})}catch(e){console.error("Failed to follow up:",e)}},[]),eq=(0,n.useCallback)(async()=>{let e=ev.current;if(e)try{await o(e,{type:"abort_compaction"})}catch(e){console.error("Failed to abort compaction:",e)}},[]),eY=(0,n.useCallback)(async e=>{if(K(e),"auto"===e)return;let t=ev.current;if(t)try{await o(t,{type:"set_thinking_level",level:e})}catch(e){console.error("Failed to set thinking level:",e)}},[]),eJ=(0,n.useCallback)(async t=>{let{PRESET_NONE:r,PRESET_DEFAULT:n,PRESET_FULL:i}=await e.A(10579);eS(t);let a=ev.current;if(a)try{await o(a,{type:"set_tools",toolNames:"none"===t?r:"default"===t?n:i})}catch(e){console.error("Failed to set tools:",e)}},[eS]);return(0,n.useEffect)(()=>(r&&(ev.current=r.id,eL(r.id,!0,!0).then(e=>{e?.running&&(eM(r.id),e.state?.isStreaming&&(z(!0),ep({kind:"waiting_model"}),eE(r.id))),e?.state&&(void 0!==e.state.isCompacting&&es(e.state.isCompacting),void 0!==e.state.contextUsage&&G(e.state.contextUsage??null),void 0!==e.state.systemPrompt&&ee(e.state.systemPrompt??null),void 0!==e.state.thinkingLevel&&K(e.state.thinkingLevel??"auto"))})),()=>{ef.current?.close(),ef.current=null,eh("idle")}),[]),(0,n.useEffect)(()=>{x?.(Q)},[Q,x]),(0,n.useEffect)(()=>{h&&h(f?.tree??[],C,eH)},[f?.tree,C,eH,h]),(0,n.useEffect)(()=>{fetch("/api/models").then(e=>e.json()).then(e=>{if(N(e.models),e.thinkingLevels&&H(e.thinkingLevels),e.thinkingLevelMaps&&O(e.thinkingLevelMaps),e.modelList&&(F(e.modelList),m&&e.modelList.length>0)){let t=e.defaultModel,r=t&&e.modelList.find(e=>e.id===t.modelId&&e.provider===t.provider);ej(r?{provider:r.provider,modelId:r.id}:{provider:e.modelList[0].provider,modelId:e.modelList[0].id})}}).catch(()=>{})},[m,g,ej]),(0,n.useEffect)(()=>{if(!ec)return;let e=setTimeout(()=>ed(null),3e3);return()=>clearTimeout(e)},[ec]),(0,n.useEffect)(()=>{let e=m?c:r?.cwd;e&&ez(e)},[m,c,r?.cwd,ez]),{data:f,loading:y,branchLoading:k,error:j,activeLeafId:C,messages:R,entryIds:I,streamState:E,commands:ex,agentRunning:$,modelNames:D,modelList:A,modelThinkingLevels:_,modelThinkingLevelMaps:B,newSessionModel:U,toolPreset:q,thinkingLevel:J,retryInfo:V,contextUsage:Z,systemPrompt:Q,forkingEntryId:et,isCompacting:el,compactError:ec,currentModel:eC,displayModel:eT,sessionStats:eR,agentPhase:eu,eventStatus:eg,isNew:m,sessionIdRef:ev,eventSourceRef:ef,handleSend:eN,handleAbort:eA,handleFork:eF,handleNavigate:e_,handleModelChange:eB,handleCompact:eO,handleSteer:eU,handleFollowUp:eP,handleAbortCompaction:eq,handleToolPresetChange:eJ,handleThinkingLevelChange:eY,fetchCommands:ez,loadTools:eM,setActiveLeafId:T,setData:v,setMessages:L,dispatch:W,setAgentRunning:z,setForkingEntryId:er,handleAgentEventRef:eb}}({session:t,newSessionCwd:d,onAgentEnd:u,onSessionCreated:g,onSessionForked:h,modelsRefreshKey:x,onBranchDataChange:f,onSystemPromptChange:y}),{isDark:ec}=(0,c.useTheme)(),ed=G?`${G.tokens.input}|${G.tokens.output}|${G.tokens.cacheRead}|${G.tokens.cacheWrite}|${G.cost??0}`:null,eu=(0,n.useRef)(G);eu.current=G,(0,n.useEffect)(()=>{b?.(eu.current)},[ed,b]),(0,n.useEffect)(()=>()=>{b?.(null)},[b]);let ep=V?`${V.percent??"null"}|${V.contextWindow}|${V.tokens??"null"}`:null,eg=(0,n.useRef)(V);eg.current=V,(0,n.useEffect)(()=>{w?.(eg.current)},[ep,w]),(0,n.useEffect)(()=>()=>{w?.(null)},[w]),(0,n.useEffect)(()=>{j?.(I)},[I,j]),(0,n.useEffect)(()=>()=>{j?.(!1)},[j]),(0,n.useEffect)(()=>{v?.(B)},[B,v]),(0,n.useEffect)(()=>()=>{v?.(!1)},[v]);let{isDragOver:eh,handleDragEnter:ex,handleDragOver:em,handleDragLeave:ef,handleDrop:ev}=function(e){let[t,r]=(0,n.useState)(!1),i=(0,n.useRef)(0),o=(0,n.useCallback)(e=>{Array.from(e.dataTransfer.items).some(e=>e.type.startsWith("image/"))&&(e.preventDefault(),i.current+=1,r(!0))},[]),a=(0,n.useCallback)(e=>{Array.from(e.dataTransfer.items).some(e=>e.type.startsWith("image/"))&&e.preventDefault()},[]);return{isDragOver:t,handleDragEnter:o,handleDragOver:a,handleDragLeave:(0,n.useCallback)(()=>{i.current-=1,i.current<=0&&(i.current=0,r(!1))},[]),handleDrop:(0,n.useCallback)(t=>{t.preventDefault(),i.current=0,r(!1),e(Array.from(t.dataTransfer.files))},[e])}}((0,n.useCallback)(e=>{m?.current?.addImages(e)},[m])),ey=(0,n.useCallback)(()=>{let e=[...A].reverse().find(e=>"user"===e.role);if(!e)return;let t="";(t="string"==typeof e.content?e.content:e.content.filter(e=>"text"===e.type).map(e=>e.text??"").join("\n"))&&er(t)},[A,er]),eb=(0,n.useCallback)(e=>{er(e)},[er]),ek=!t&&0===A.length&&!_.isStreaming&&!B,ew=Z?P[`${Z.provider}:${Z.modelId}`]??null:null,ej=Z?q[`${Z.provider}:${Z.modelId}`]??null:null,eS=t?.cwd??d,eC=eS?eS.split(/[/\\]/).pop():void 0,eT=(0,n.useMemo)(()=>{let e=L?.tree;if(e&&ee)return function e(t){for(let r of t){if(r.entry.id===ee)return r.label;let t=e(r.children);if(t)return t}}(e)},[L?.tree,ee]),eR=(0,n.useRef)(null),[eL,eI]=(0,n.useState)(0),[eM,eE]=(0,n.useState)(null),eW=(0,n.useRef)(_);eW.current=_,(0,n.useEffect)(()=>{if(!B){eR.current=null,eI(0),eE(null);return}let e=setInterval(()=>{let e=eW.current.streamingMessage;if(!e)return;let t=e.content;if(!t)return;let r=0;if("string"==typeof t)r=t.length;else if(Array.isArray(t))for(let e of t)"text"===e.type?r+=e.text?.length??0:"thinking"===e.type?r+=e.thinking?.length??0:"toolCall"===e.type&&(r+=JSON.stringify(e.input??{}).length);let n=Math.round(r/4);eI(n);let i=Date.now();null===eR.current&&(eR.current=i);let o=(i-eR.current)/1e3;o>.5&&eE(n/o)},300);return()=>clearInterval(e)},[B]);let{containerRef:e$,setContainerRef:ez,contentRef:eD,scrollToBottom:eN,isAtBottom:eA}=function({follow:e=!1,onAtBottomChange:t}={}){let r=(0,n.useRef)(null),[i,o]=(0,n.useState)(null),a=(0,n.useCallback)(e=>{r.current=e,o(e)},[]),[l,s]=(0,n.useState)(null),c=(0,n.useCallback)(e=>{s(e)},[]),d=(0,n.useRef)(e);d.current=e;let u=(0,n.useRef)(t);u.current=t;let p=(0,n.useRef)(!0),g=(0,n.useRef)(!0),[h,x]=(0,n.useState)(!0),m=(0,n.useRef)(0),f=(0,n.useRef)(null),v=(0,n.useRef)(null),y=(0,n.useCallback)(e=>e.scrollHeight<=e.clientHeight||e.scrollHeight-e.scrollTop-e.clientHeight<=8,[]),b=(0,n.useCallback)(e=>{g.current!==e&&(g.current=e,x(e),u.current?.(e))},[]),k=(0,n.useCallback)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight,m.current=e.scrollTop,b(!0))},[b]),w=(0,n.useCallback)(()=>{d.current&&p.current&&null===f.current&&(f.current=requestAnimationFrame(()=>{f.current=null,d.current&&p.current&&k()}))},[k]),j=(0,n.useCallback)((e="instant")=>{let t=r.current;t&&(p.current=!0,b(!0),"instant"===e?t.scrollTop=t.scrollHeight:t.scrollTo({top:t.scrollHeight,behavior:e}),m.current=t.scrollTop)},[b]),S=(0,n.useCallback)(()=>{let e=r.current;if(!e)return;let t=y(e);!t&&m.current>e.scrollTop?(p.current=!1,b(!1)):t?(p.current=!0,b(!0)):g.current&&b(!1),m.current=e.scrollTop},[y,b]),C=(0,n.useCallback)(e=>{let t=r.current;t&&e.deltaY<0&&t.scrollTop>0&&(p.current=!1,b(!1))},[b]),T=(0,n.useCallback)(e=>{v.current=e.touches[0]?.clientY??null},[]),R=(0,n.useCallback)(e=>{let t=v.current,n=e.touches[0]?.clientY??null,i=r.current;i&&null!==t&&null!==n&&n>t&&i.scrollTop>0&&(p.current=!1,b(!1)),v.current=n},[b]);return(0,n.useEffect)(()=>{if(i)return m.current=i.scrollTop,i.addEventListener("scroll",S,{passive:!0}),i.addEventListener("wheel",C,{passive:!0}),i.addEventListener("touchstart",T,{passive:!0}),i.addEventListener("touchmove",R,{passive:!0}),()=>{i.removeEventListener("scroll",S),i.removeEventListener("wheel",C),i.removeEventListener("touchstart",T),i.removeEventListener("touchmove",R)}},[i,S,R,T,C]),(0,n.useEffect)(()=>{e&&w()},[e,w]),(0,n.useEffect)(()=>{let e=l??i?.firstElementChild;if(!i||!e)return;let t=new ResizeObserver(w);return t.observe(e),()=>{t.disconnect(),null!==f.current&&(cancelAnimationFrame(f.current),f.current=null)}},[i,l,w]),{containerRef:r,setContainerRef:a,contentRef:c,scrollToBottom:j,shouldAutoScrollRef:p,isAtBottom:h}}({follow:B}),eF=(0,n.useMemo)(()=>{let e=new Map;for(let t of A)"toolResult"===t.role&&e.set(t.toolCallId,t);return e},[A]),e_=(0,n.useMemo)(()=>{let e=[];for(let t=0;t<A.length;t++){let r=A[t];if("toolResult"!==r.role){if("assistant"===r.role){let t=r.content;if(Array.isArray(t)&&t.length>0&&t.every(e=>"toolCall"===e.type)){let n=e[e.length-1];if(n?.msg.role==="assistant"){let e=t.map(e=>({...e,_sourceTs:r.timestamp}));n.msg={...n.msg,content:[...n.msg.content,...e]};continue}}}e.push({msg:r,entryId:F[t],originalIndex:t})}}let t=-1;for(let r=e.length-1;r>=0;r--)if("assistant"===e[r].msg.role){t=r;break}return{items:e,lastAssistantIdx:t}},[A,F]),eH=(0,n.useRef)(new Map),[eB,eO]=(0,n.useState)(null),[eU,eP]=(0,n.useState)(!1),eq=(0,n.useMemo)(()=>e_.items.filter(({msg:e})=>"user"===e.role).map(({msg:e,entryId:t,originalIndex:r},n)=>{var i;let o;return{id:t??`message-${r}`,index:n+1,label:(i=`User message ${n+1}`,(o=$(e).replace(/\s+/g," ").trim())?o.length>28?`${o.slice(0,28)}...`:o:i),title:$(e).replace(/\s+/g," ").trim()||void 0}}),[e_.items]),eY=Math.max(0,Math.min(Math.max(0,eq.findIndex(e=>e.id===eB))-4,Math.max(0,eq.length-9))),eJ=eq.slice(eY,eY+9),eK=28*eJ.length+28,eV=(0,n.useCallback)(e=>{let t=eH.current.get(e);t&&(eO(e),t.scrollIntoView({block:"center",behavior:"smooth"}))},[]);(0,n.useEffect)(()=>{let e=e$.current;if(!e||0===eq.length)return;let t=()=>{let t=e.getBoundingClientRect().top+Math.min(.32*e.clientHeight,220),r=eq[0].id,n=1/0;for(let e of eq){let i=eH.current.get(e.id);if(!i)continue;let o=Math.abs(i.getBoundingClientRect().top-t);o<n&&(n=o,r=e.id)}eO(e=>e===r?e:r)};return t(),e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[e$,eq]);let eX=(0,n.useRef)(!1);(0,n.useEffect)(()=>{eX.current=!1},[t?.id]),(0,n.useEffect)(()=>{eX.current||!(A.length>0)||B||(eX.current=!0,eN("instant"))},[A.length,B,eN]),(0,n.useEffect)(()=>{B&&eN("auto")},[B,eN]);let eZ=(0,r.jsx)(p,{ref:m,onSend:er,onAbort:en,isStreaming:B,model:Z,modelNames:O,modelList:U,onModelChange:ea,thinkingLevel:J,onThinkingLevelChange:t||et?el:void 0,availableThinkingLevels:ew,thinkingLevelMap:ej,retryInfo:K,commands:H,contextUsage:V,currentProject:eC,recentCwds:S,homeDir:C,onCwdSelect:T,onCwdDefault:R,toolPreset:Y,streamingTokens:eL,streamingTps:eM,agentStatus:B?function(e){if(e?.kind==="running_skill")return`Running skill: ${e.skill}...`;if(e?.kind==="running_tools"){let t=e.tools.map(e=>e.name);return 0===t.length?"Running tool...":1===t.length?`Running ${t[0]}...`:t.length<=3?`Running ${t.join(", ")}...`:`Running ${t.slice(0,2).join(", ")} (+${t.length-2})...`}return e?.kind==="waiting_model"?"Waiting for model...":"Thinking..."}(Q):void 0});return I?(0,r.jsx)(M,{}):N?(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-red-400",children:N}):(0,r.jsxs)("div",{className:"relative flex h-full flex-col overflow-hidden",onDragEnter:ex,onDragOver:em,onDragLeave:ef,onDrop:ev,children:[eh&&(0,r.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-50 flex animate-[drop-zone-in_0.15s_ease_both] items-center justify-center backdrop-blur-[1px]",style:{background:"var(--accent-subtle)"},children:[(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:[0,.8,1.6].map(e=>(0,r.jsx)("div",{className:"absolute h-[720px] w-[720px] rounded-full animate-[drop-ripple_2.4s_ease-out_infinite_backwards]",style:{transformOrigin:"center",animationDelay:`${e}s`,border:"1.5px solid var(--accent-ring)"}},e))}),(0,r.jsxs)("svg",{width:"280",height:"280",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{filter:"drop-shadow(0 6px 18px color-mix(in oklab, var(--accent), transparent 82%))"},children:[(0,r.jsx)("rect",{x:"28",y:"44",width:"84",height:"60",rx:"8",fill:"var(--accent-soft)",stroke:"var(--accent-ring)",strokeWidth:"1.8"}),(0,r.jsx)("path",{d:"M36 100 L54 72 L68 88 L80 74 L104 100Z",fill:"color-mix(in oklab, var(--accent), transparent 84%)",stroke:"color-mix(in oklab, var(--accent), transparent 60%)",strokeWidth:"1.4",strokeLinejoin:"round"}),(0,r.jsx)("circle",{cx:"96",cy:"58",r:"8",fill:"color-mix(in oklab, var(--accent), transparent 78%)",stroke:"color-mix(in oklab, var(--accent), transparent 45%)",strokeWidth:"1.6"}),(0,r.jsxs)("g",{stroke:"color-mix(in oklab, var(--accent), transparent 55%)",strokeWidth:"1.4",strokeLinecap:"round",children:[(0,r.jsx)("line",{x1:"96",y1:"46",x2:"96",y2:"43"}),(0,r.jsx)("line",{x1:"96",y1:"70",x2:"96",y2:"73"}),(0,r.jsx)("line",{x1:"84",y1:"58",x2:"81",y2:"58"}),(0,r.jsx)("line",{x1:"108",y1:"58",x2:"111",y2:"58"}),(0,r.jsx)("line",{x1:"87.5",y1:"49.5",x2:"85.4",y2:"47.4"}),(0,r.jsx)("line",{x1:"104.5",y1:"66.5",x2:"106.6",y2:"68.6"}),(0,r.jsx)("line",{x1:"104.5",y1:"49.5",x2:"106.6",y2:"47.4"}),(0,r.jsx)("line",{x1:"87.5",y1:"66.5",x2:"85.4",y2:"68.6"})]})]})]}),ek?(0,r.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center overflow-y-auto px-4 py-8",style:{animation:"fade-in-up 0.4s ease both"},children:(0,r.jsxs)("div",{className:"w-full max-w-[1148px]",children:[(0,r.jsxs)("div",{className:"mb-3",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginLeft:16,marginRight:24,fontFamily:"var(--font-mono)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0,flex:1,lineHeight:1.4},children:[(0,r.jsx)("img",{src:ec?"/pi-logo-on-dark.svg":"/pi-logo-on-light.svg",alt:"No Pi No Gang",width:28,height:28}),(0,r.jsx)("span",{style:{fontSize:14,minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:(0,r.jsx)(z,{phrases:W})})]}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2,flexShrink:0},children:[(0,r.jsxs)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["web"," ",(0,r.jsxs)("span",{style:{color:"var(--text)"},children:["v","0.0.3"]})]}),(0,r.jsxs)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["pi"," ",(0,r.jsxs)("span",{style:{color:"var(--text)"},children:["v","0.78.0"]})]})]})]}),eZ]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex-1 overflow-hidden relative",style:{animation:"fade-in-up 0.35s ease both"},children:[(0,r.jsx)("div",{ref:ez,className:"h-full overflow-y-auto [scrollbar-width:none]",children:(0,r.jsxs)("div",{ref:eD,style:{paddingTop:16},children:[e_.items.map(({msg:e,entryId:t,originalIndex:n},i)=>{let o=i>0?e_.items[i-1]:void 0,a=i<e_.items.length-1?e_.items[i+1]:void 0,l="user"===e.role&&o?.msg.role==="assistant"?o.entryId:void 0,s=!1;"assistant"===e.role&&(s=!0,a?.msg.role==="assistant"&&(s=!1),s&&_.isStreaming&&i===e_.items.length-1&&(s=!1));let c="assistant"===e.role&&i===e_.lastAssistantIdx&&!_.isStreaming,d=[t?`entry ${t}`:null,ee?`leaf ${ee}`:null,eT?`branch ${eT}`:"branch main"].filter(Boolean).join("\n"),u=t??`message-${n}`;return(0,r.jsxs)("div",{ref:"user"===e.role?e=>{e?eH.current.set(u,e):eH.current.delete(u)}:void 0,className:"relative mx-auto max-w-[1148px] px-4",children:[t&&"assistant"===e.role&&(0,r.jsx)("span",{title:d,style:{position:"absolute",left:0,top:2,transform:"translateX(-50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:9999,background:"var(--surface)",border:"1px solid var(--border)",pointerEvents:"auto"},children:(0,r.jsx)("img",{src:"/favicon.ico",alt:"",style:{width:13,height:13,display:"block"}})}),(0,r.jsx)(k,{message:e,toolResults:eF,modelNames:O,entryId:t,onFork:B||et||0===i&&"user"===e.role?void 0:ei,forking:X===t,onNavigate:B?void 0:eo,prevAssistantEntryId:B?void 0:l,onEditContent:e=>m?.current?.insertIfEmpty(e),showTimestamp:s,prevTimestamp:o?.msg.timestamp,onRetry:c&&!B?ey:void 0,onEditResend:"user"!==e.role||B?void 0:eb})]},t??n)}),_.isStreaming&&_.streamingMessage&&(0,r.jsx)("div",{className:"mx-auto max-w-[1148px] px-4",children:(0,r.jsx)(k,{message:_.streamingMessage,isStreaming:!0,modelNames:O})}),(0,r.jsx)("div",{style:{height:24}})]})}),eq.length>1&&(0,r.jsx)(E,{visibleAnchors:eJ,activeAnchorId:eB,panelHeight:eK,panelOpen:eU,onPanelOpenChange:eP,onScrollTo:eV}),!eA&&(0,r.jsx)("div",{style:{position:"absolute",bottom:12,left:0,right:0,display:"flex",justifyContent:"center",zIndex:10,pointerEvents:"none"},children:(0,r.jsx)("button",{onClick:()=>eN("smooth"),title:"Scroll to bottom",style:{pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:"50%",background:"var(--bg-panel)",border:"1px solid var(--border)",cursor:"pointer",color:"var(--text-muted)",boxShadow:"0 2px 12px rgba(0,0,0,0.30)",transition:"background 0.15s, color 0.15s, transform 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text)",e.currentTarget.style.transform="scale(1.05)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--bg-panel)",e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.transform="scale(1)"},children:(0,r.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"6 9 12 15 18 9"})})})})]}),eZ,D&&!I&&!ek&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,zIndex:20,display:"flex",alignItems:"center",justifyContent:"center",background:"color-mix(in oklab, var(--bg), transparent 15%)",backdropFilter:"blur(1px)",animation:"fade-in 0.15s ease both"},children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10},children:[(0,r.jsx)("div",{style:{width:28,height:28,borderRadius:"50%",border:"2.5px solid var(--border)",borderTopColor:"var(--accent)",animation:"spin 0.7s linear infinite"}}),(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:"Loading branch…"})]})})]})]})}],57965)},10970,e=>{e.n(e.i(57965))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26322,e=>{"use strict";var i=e.i(18050),r=e.i(18789),d=e.i(42531);e.s(["MarkdownRenderer",0,function({content:e}){return(0,i.jsx)("div",{className:"markdown-body markdown-file-preview",style:{padding:"24px 32px",maxWidth:800},children:(0,i.jsx)(r.default,{remarkPlugins:[d.default],children:e})})}])},81413,e=>{e.n(e.i(26322))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65332,t=>{"use strict";t.s(["initRange",0,function(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}])},64912,48293,84511,t=>{"use strict";function n(t,n){if(!isFinite(t)||0===t)return null;var r=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),e=t.slice(0,r);return[e.length>1?e[0]+e.slice(2):e,+t.slice(r+1)]}function r(t){return(t=n(Math.abs(t)))?t[1]:NaN}t.s(["default",0,r],48293);var e,i,a,o,u=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(t){var n;if(!(n=u.exec(t)))throw Error("invalid format: "+t);return new s({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function s(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function c(t,r){var e=n(t,r);if(!e)return t+"";var i=e[0],a=e[1];return a<0?"0."+Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+Array(a-i.length+2).join("0")}l.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},t.s(["default",0,l],84511);let f={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>c(100*t,n),r:c,s:function(t,r){var i=n(t,r);if(!i)return e=void 0,t.toPrecision(r);var a=i[0],o=i[1],u=o-(e=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return u===l?a:u>l?a+Array(u-l+1).join("0"):u>0?a.slice(0,u)+"."+a.slice(u):"0."+Array(1-u).join("0")+n(t,Math.max(0,r+u-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function h(t){return t}var d=Array.prototype.map,m=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];a=(i=function(t){var n,i,a,o=void 0===t.grouping||void 0===t.thousands?h:(n=d.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var e=t.length,a=[],o=0,u=n[0],l=0;e>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(t.substring(e-=u,e+u)),!((l+=u+1)>r));)u=n[o=(o+1)%n.length];return a.reverse().join(i)}),u=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",c=void 0===t.decimal?".":t.decimal+"",g=void 0===t.numerals?h:(a=d.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return a[+t]})}),p=void 0===t.percent?"%":t.percent+"",v=void 0===t.minus?"−":t.minus+"",M=void 0===t.nan?"NaN":t.nan+"";function y(t,n){var r=(t=l(t)).fill,i=t.align,a=t.sign,h=t.symbol,d=t.zero,y=t.width,b=t.comma,x=t.precision,N=t.trim,k=t.type;"n"===k?(b=!0,k="g"):f[k]||(void 0===x&&(x=12),N=!0,k="g"),(d||"0"===r&&"="===i)&&(d=!0,r="0",i="=");var w=(n&&void 0!==n.prefix?n.prefix:"")+("$"===h?u:"#"===h&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),A=("$"===h?s:/[%p]/.test(k)?p:"")+(n&&void 0!==n.suffix?n.suffix:""),S=f[k],P=/[defgprs%]/.test(k);function j(t){var n,u,l,s=w,f=A;if("c"===k)f=S(t)+f,t="";else{var h=(t*=1)<0||1/t<0;if(t=isNaN(t)?M:S(Math.abs(t),x),N&&(t=function(t){t:for(var n,r=t.length,e=1,i=-1;e<r;++e)switch(t[e]){case".":i=n=e;break;case"0":0===i&&(i=e),n=e;break;default:if(!+t[e])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),h&&0==+t&&"+"!==a&&(h=!1),s=(h?"("===a?a:v:"-"===a||"("===a?"":a)+s,f=("s"!==k||isNaN(t)||void 0===e?"":m[8+e/3])+f+(h&&"("===a?")":""),P){for(n=-1,u=t.length;++n<u;)if(48>(l=t.charCodeAt(n))||l>57){f=(46===l?c+t.slice(n+1):t.slice(n))+f,t=t.slice(0,n);break}}}b&&!d&&(t=o(t,1/0));var p=s.length+t.length+f.length,j=p<y?Array(y-p+1).join(r):"";switch(b&&d&&(t=o(j+t,j.length?y-f.length:1/0),j=""),i){case"<":t=s+t+f+j;break;case"=":t=s+j+t+f;break;case"^":t=j.slice(0,p=j.length>>1)+s+t+f+j.slice(p);break;default:t=j+s+t+f}return g(t)}return x=void 0===x?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),j.toString=function(){return t+""},j}return{format:y,formatPrefix:function(t,n){var e=3*Math.max(-8,Math.min(8,Math.floor(r(n)/3))),i=Math.pow(10,-e),a=y(((t=l(t)).type="f",t),{suffix:m[8+e/3]});return function(t){return a(i*t)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,o=i.formatPrefix,t.s(["format",()=>a,"formatPrefix",()=>o],64912)},17877,94479,t=>{"use strict";function n(t,n){return null==t||null==n?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function r(t,n){return null==t||null==n?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function e(){return 0}t.s(["default",0,n],94479),t.s(["default",0,function(t){let i,a,o;function u(t,n,r=0,e=t.length){if(r<e){if(0!==i(n,n))return e;do{let i=r+e>>>1;0>a(t[i],n)?r=i+1:e=i}while(r<e)}return r}return 2!==t.length?(i=n,a=(r,e)=>n(t(r),e),o=(n,r)=>t(n)-r):(i=t===n||t===r?t:e,a=t,o=t),{left:u,center:function(t,n,r=0,e=t.length){let i=u(t,n,r,e-1);return i>r&&o(t[i-1],n)>-o(t[i],n)?i-1:i},right:function(t,n,r=0,e=t.length){if(r<e){if(0!==i(n,n))return e;do{let i=r+e>>>1;0>=a(t[i],n)?r=i+1:e=i}while(r<e)}return r}}}],17877)},28322,t=>{"use strict";let n=Math.sqrt(50),r=Math.sqrt(10),e=Math.sqrt(2);function i(t,a,o){let u,l,s,c=(a-t)/Math.max(0,o),f=Math.floor(Math.log10(c)),h=c/Math.pow(10,f),d=h>=n?10:h>=r?5:h>=e?2:1;return(f<0?(u=Math.round(t*(s=Math.pow(10,-f)/d)),l=Math.round(a*s),u/s<t&&++u,l/s>a&&--l,s=-s):(u=Math.round(t/(s=Math.pow(10,f)*d)),l=Math.round(a/s),u*s<t&&++u,l*s>a&&--l),l<u&&.5<=o&&o<2)?i(t,a,2*o):[u,l,s]}function a(t,n,r){return i(t*=1,n*=1,r*=1)[2]}t.s(["default",0,function(t,n,r){if(n*=1,t*=1,!((r*=1)>0))return[];if(t===n)return[t];let e=n<t,[a,o,u]=e?i(n,t,r):i(t,n,r);if(!(o>=a))return[];let l=o-a+1,s=Array(l);if(e)if(u<0)for(let t=0;t<l;++t)s[t]=-((o-t)/u);else for(let t=0;t<l;++t)s[t]=(o-t)*u;else if(u<0)for(let t=0;t<l;++t)s[t]=-((a+t)/u);else for(let t=0;t<l;++t)s[t]=(a+t)*u;return s},"tickIncrement",0,a,"tickStep",0,function(t,n,r){n*=1,t*=1,r*=1;let e=n<t,i=e?a(n,t,r):a(t,n,r);return(e?-1:1)*(i<0?-(1/i):i)}])},59086,t=>{"use strict";var n=t.i(94479),r=t.i(17877);let e=(0,r.default)(n.default),i=e.right;e.left,(0,r.default)(function(t){return null===t?NaN:+t}).center;var a=t.i(44307),o=t.i(52491);function u(t,n){return t*=1,n*=1,function(r){return Math.round(t*(1-r)+n*r)}}function l(t){return+t}var s=[0,1];function c(t){return t}function f(t,n){var r;return(n-=t*=1)?function(r){return(r-t)/n}:(r=isNaN(n)?NaN:.5,function(){return r})}function h(t,n,r){var e=t[0],i=t[1],a=n[0],o=n[1];return i<e?(e=f(i,e),a=r(o,a)):(e=f(e,i),a=r(a,o)),function(t){return a(e(t))}}function d(t,n,r){var e=Math.min(t.length,n.length)-1,a=Array(e),o=Array(e),u=-1;for(t[e]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++u<e;)a[u]=f(t[u],t[u+1]),o[u]=r(n[u],n[u+1]);return function(n){var r=i(t,n,1,e)-1;return o[r](a[r](n))}}t.s(["copy",0,function(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())},"default",0,function(){return(function(){var t,n,r,e,i,f,m=s,g=s,p=a.interpolate,v=c;function M(){var t,n,r,a=Math.min(m.length,g.length);return v!==c&&(t=m[0],n=m[a-1],t>n&&(r=t,t=n,n=r),v=function(r){return Math.max(t,Math.min(n,r))}),e=a>2?d:h,i=f=null,y}function y(n){return null==n||isNaN(n*=1)?r:(i||(i=e(m.map(t),g,p)))(t(v(n)))}return y.invert=function(r){return v(n((f||(f=e(g,m.map(t),o.interpolateNumber)))(r)))},y.domain=function(t){return arguments.length?(m=Array.from(t,l),M()):m.slice()},y.range=function(t){return arguments.length?(g=Array.from(t),M()):g.slice()},y.rangeRound=function(t){return g=Array.from(t),p=u,M()},y.clamp=function(t){return arguments.length?(v=!!t||c,M()):v!==c},y.interpolate=function(t){return arguments.length?(p=t,M()):p},y.unknown=function(t){return arguments.length?(r=t,y):r},function(r,e){return t=r,n=e,M()}})()(c,c)}],59086)},27975,t=>{"use strict";var n=t.i(28322);t.s(["ticks",()=>n.default])},82803,t=>{"use strict";var n=t.i(27975),r=t.i(28322),e=t.i(59086),i=t.i(65332),a=t.i(64912),o=t.i(84511),o=o,u=t.i(48293);t.s(["scaleLinear",0,function t(){var l,s=(0,e.default)();return s.copy=function(){return(0,e.copy)(s,t())},i.initRange.apply(s,arguments),l=s.domain,s.ticks=function(t){var r=l();return(0,n.ticks)(r[0],r[r.length-1],null==t?10:t)},s.tickFormat=function(t,n){var e=l();return function(t,n,e,i){var l,s,c,f=(0,r.tickStep)(t,n,e);switch((i=(0,o.default)(null==i?",f":i)).type){case"s":var h=Math.max(Math.abs(t),Math.abs(n));return null!=i.precision||isNaN(c=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor((0,u.default)(h)/3)))-(0,u.default)(Math.abs(f))))||(i.precision=c),(0,a.formatPrefix)(i,h);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN((l=f,s=Math.abs(s=Math.max(Math.abs(t),Math.abs(n)))-(l=Math.abs(l)),c=Math.max(0,(0,u.default)(s)-(0,u.default)(l))+1))||(i.precision=c-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(c=Math.max(0,-(0,u.default)(Math.abs(f))))||(i.precision=c-("%"===i.type)*2)}return(0,a.format)(i)}(e[0],e[e.length-1],null==t?10:t,n)},s.nice=function(t){null==t&&(t=10);var n,e,i=l(),a=0,o=i.length-1,u=i[a],c=i[o],f=10;for(c<u&&(e=u,u=c,c=e,e=a,a=o,o=e);f-- >0;){if((e=(0,r.tickIncrement)(u,c,t))===n)return i[a]=u,i[o]=c,l(i);if(e>0)u=Math.floor(u/e)*e,c=Math.ceil(c/e)*e;else if(e<0)u=Math.ceil(u*e)/e,c=Math.floor(c*e)/e;else break;n=e}return s},s}],82803)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51273,(t,e,i)=>{t.e,e.exports=function(){var t=[function(t,e,i){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,e,i){"use strict";var r=i(2),n=i(8),o=i(9);function s(t,e,i){r.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(var a in s.prototype=Object.create(r.prototype),r)s[a]=r[a];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(t,e){for(var i=this.getOtherEnd(t),r=e.getGraphManager().getRoot();;){if(i.getOwner()==e)return i;if(i.getOwner()==r)break;i=i.getOwner().getParent()}return null},s.prototype.updateLength=function(){var t=[,,,,];this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],1>Math.abs(this.lengthX)&&(this.lengthX=o.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),1>Math.abs(this.lengthX)&&(this.lengthX=o.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,i){"use strict";t.exports=function(t){this.vGraphObject=t}},function(t,e,i){"use strict";var r=i(2),n=i(10),o=i(13),s=i(0),a=i(16),h=i(4);function l(t,e,i,s){null==i&&null==s&&(s=e),r.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,null!=i&&null!=e?this.rect=new o(e.x,e.y,i.width,i.height):this.rect=new o}for(var g in l.prototype=Object.create(r.prototype),r)l[g]=r[g];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(t){this.rect.width=t},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(t){this.rect.height=t},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},l.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},l.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},l.prototype.getEdgeListToNode=function(t){var e=[],i=this;return i.edges.forEach(function(r){if(r.target==t){if(r.source!=i)throw"Incorrect edge source!";e.push(r)}}),e},l.prototype.getEdgesBetween=function(t){var e=[],i=this;return i.edges.forEach(function(r){if(r.source!=i&&r.target!=i)throw"Incorrect edge source and/or target";(r.target==t||r.source==t)&&e.push(r)}),e},l.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach(function(i){if(i.source==e)t.add(i.target);else{if(i.target!=e)throw"Incorrect incidency!";t.add(i.source)}}),t},l.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),i=0;i<e.length;i++)e[i].withChildren().forEach(function(e){t.add(e)});return t},l.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),i=0;i<e.length;i++)t+=e[i].getNoOfChildren();return 0==t&&(t=1),t},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},l.prototype.scatter=function(){var t,e,i=-s.INITIAL_WORLD_BOUNDARY,r=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+a.nextDouble()*(r-i)+i;var n=-s.INITIAL_WORLD_BOUNDARY,o=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+a.nextDouble()*(o-n)+n,this.rect.x=t,this.rect.y=e},l.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),i=t.getBottom()-t.getTop();this.labelWidth>e&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>i&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-i)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-i),this.setHeight(this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},l.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var i=this.rect.y;i>s.WORLD_BOUNDARY?i=s.WORLD_BOUNDARY:i<-s.WORLD_BOUNDARY&&(i=-s.WORLD_BOUNDARY);var r=new h(e,i),n=t.inverseTransformPoint(r);this.setLocation(n.x,n.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=l},function(t,e,i){"use strict";function r(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,e,i){"use strict";var r=i(2),n=i(10),o=i(0),s=i(6),a=i(3),h=i(1),l=i(13),g=i(12),u=i(11);function c(t,e,i){r.call(this,i),this.estimatedSize=n.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var d in c.prototype=Object.create(r.prototype),r)c[d]=r[d];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(t,e,i){if(null==e&&null==i){if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(t)>-1)throw"Node already in graph!";return t.owner=this,this.getNodes().push(t),t}if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(i)>-1))throw"Source or target not in graph!";if(e.owner!=i.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=i.owner?null:(t.source=e,t.target=i,t.isInterGraph=!1,this.getEdges().push(t),e.edges.push(t),i!=e&&i.edges.push(t),t)},c.prototype.remove=function(t){if(t instanceof a){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var e,i=t.edges.slice(),r=i.length,n=0;n<r;n++)(e=i[n]).isInterGraph?this.graphManager.remove(e):e.source.owner.remove(e);var o=this.nodes.indexOf(t);if(-1==o)throw"Node not in owner node list!";this.nodes.splice(o,1)}else if(t instanceof h){var e=t;if(null==e)throw"Edge is null!";if(null==e.source||null==e.target)throw"Source and/or target is null!";if(null==e.source.owner||null==e.target.owner||e.source.owner!=this||e.target.owner!=this)throw"Source and/or target owner is invalid!";var s=e.source.edges.indexOf(e),l=e.target.edges.indexOf(e);if(!(s>-1&&l>-1))throw"Source and/or target doesn't know this edge!";e.source.edges.splice(s,1),e.target!=e.source&&e.target.edges.splice(l,1);var o=e.source.owner.getEdges().indexOf(e);if(-1==o)throw"Not in owner's edge list!";e.source.owner.getEdges().splice(o,1)}},c.prototype.updateLeftTop=function(){for(var t,e,i,r=n.MAX_VALUE,o=n.MAX_VALUE,s=this.getNodes(),a=s.length,h=0;h<a;h++){var l=s[h];t=l.getTop(),e=l.getLeft(),r>t&&(r=t),o>e&&(o=e)}return r==n.MAX_VALUE?null:(i=void 0!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=o-i,this.top=r-i,new g(this.left,this.top))},c.prototype.updateBounds=function(t){for(var e,i,r,o,s,a=n.MAX_VALUE,h=-n.MAX_VALUE,g=n.MAX_VALUE,u=-n.MAX_VALUE,c=this.nodes,d=c.length,p=0;p<d;p++){var f=c[p];t&&null!=f.child&&f.updateBounds(),e=f.getLeft(),i=f.getRight(),r=f.getTop(),o=f.getBottom(),a>e&&(a=e),h<i&&(h=i),g>r&&(g=r),u<o&&(u=o)}var y=new l(a,g,h-a,u-g);a==n.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=void 0!=c[0].getParent().paddingLeft?c[0].getParent().paddingLeft:this.margin,this.left=y.x-s,this.right=y.x+y.width+s,this.top=y.y-s,this.bottom=y.y+y.height+s},c.calculateBounds=function(t){for(var e,i,r,o,s=n.MAX_VALUE,a=-n.MAX_VALUE,h=n.MAX_VALUE,g=-n.MAX_VALUE,u=t.length,c=0;c<u;c++){var d=t[c];e=d.getLeft(),i=d.getRight(),r=d.getTop(),o=d.getBottom(),s>e&&(s=e),a<i&&(a=i),h>r&&(h=r),g<o&&(g=o)}return new l(s,h,a-s,g-h)},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,i=e.length,r=0;r<i;r++)t+=e[r].calcEstimatedSize();return 0==t?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=t/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var t,e,i=this;if(0==this.nodes.length){this.isConnected=!0;return}var r=new u,n=new Set,o=this.nodes[0];for(o.withChildren().forEach(function(t){r.push(t),n.add(t)});0!==r.length;)for(var s=(t=(o=r.shift()).getEdges()).length,a=0;a<s;a++)null==(e=t[a].getOtherEndInGraph(o,this))||n.has(e)||e.withChildren().forEach(function(t){r.push(t),n.add(t)});if(this.isConnected=!1,n.size>=this.nodes.length){var h=0;n.forEach(function(t){t.owner==i&&h++}),h==this.nodes.length&&(this.isConnected=!0)}},t.exports=c},function(t,e,i){"use strict";var r,n=i(1);function o(t){r=i(5),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),i=this.add(t,e);return this.setRootGraph(i),this.rootGraph},o.prototype.add=function(t,e,i,r,n){if(null==i&&null==r&&null==n){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}n=i,r=e,i=t;var o=r.getOwner(),s=n.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==s)return i.isInterGraph=!1,o.add(i,r,n);if(i.isInterGraph=!0,i.source=r,i.target=n,this.edges.indexOf(i)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(i),null==i.source||null==i.target)throw"Edge source and/or target is null!";if(-1!=i.source.edges.indexOf(i)||-1!=i.target.edges.indexOf(i))throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},o.prototype.remove=function(t){if(t instanceof r){if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var e,i,o=[],s=(o=o.concat(t.getEdges())).length,a=0;a<s;a++)e=o[a],t.remove(e);var h=[];s=(h=h.concat(t.getNodes())).length;for(var a=0;a<s;a++)i=h[a],t.remove(i);t==this.rootGraph&&this.setRootGraph(null);var l=this.graphs.indexOf(t);this.graphs.splice(l,1),t.parent=null}else if(t instanceof n){if(null==(e=t))throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(null==e.source||null==e.target)throw"Source and/or target is null!";if(-1==e.source.edges.indexOf(e)||-1==e.target.edges.indexOf(e))throw"Source and/or target doesn't know this edge!";var l=e.source.edges.indexOf(e);if(e.source.edges.splice(l,1),l=e.target.edges.indexOf(e),e.target.edges.splice(l,1),null==e.source.owner||null==e.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==e.source.owner.getGraphManager().edges.indexOf(e))throw"Not in owner graph manager's edge list!";var l=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(l,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),i=e.length,r=0;r<i;r++)t=t.concat(e[r].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var i=0;i<e.length;i++)t=t.concat(e[i].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var i,r=t.getOwner();null!=(i=r.getParent());){if(i==e)return!0;if(null==(r=i.getOwner()))break}for(r=e.getOwner();null!=(i=r.getParent());){if(i==t)return!0;if(null==(r=i.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,i,r,n,o=this.getAllEdges(),s=o.length,a=0;a<s;a++){if(e=(t=o[a]).source,i=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=i,e==i){t.lca=e.getOwner();continue}for(r=e.getOwner();null==t.lca;){for(t.targetInLca=i,n=i.getOwner();null==t.lca;){if(n==r){t.lca=n;break}if(n==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=n.getParent(),n=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var i=t.getOwner();null!=i;){for(var r=e.getOwner();null!=r;){if(r==i)return r;r=r.getParent().getOwner()}i=i.getParent().getOwner()}return i},o.prototype.calcInclusionTreeDepths=function(t,e){null==t&&null==e&&(t=this.rootGraph,e=1);for(var i,r=t.getNodes(),n=r.length,o=0;o<n;o++)(i=r[o]).inclusionTreeDepth=e,null!=i.child&&this.calcInclusionTreeDepths(i.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=this.edges.length,i=0;i<e;i++)if(t=this.edges[i],this.isOneAncestorOfOther(t.source,t.target))return!0;return!1},t.exports=o},function(t,e,i){"use strict";var r=i(0);function n(){}for(var o in r)n[o]=r[o];n.MAX_ITERATIONS=2500,n.DEFAULT_EDGE_LENGTH=50,n.DEFAULT_SPRING_STRENGTH=.45,n.DEFAULT_REPULSION_STRENGTH=4500,n.DEFAULT_GRAVITY_STRENGTH=.4,n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,n.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,n.COOLING_ADAPTATION_FACTOR=.33,n.ADAPTATION_LOWER_NODE_LIMIT=1e3,n.ADAPTATION_UPPER_NODE_LIMIT=5e3,n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,n.MAX_NODE_DISPLACEMENT=3*n.MAX_NODE_DISPLACEMENT_INCREMENTAL,n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10,n.CONVERGENCE_CHECK_PERIOD=100,n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,n.MIN_EDGE_LENGTH=1,n.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=n},function(t,e,i){"use strict";var r=i(12);function n(){}n.calcSeparationAmount=function(t,e,i,r){if(!t.intersects(e))throw"assert failed";var n=[,,];this.decideDirectionsForOverlappingNodes(t,e,n),i[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),i[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(i[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(i[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var s=o*i[0],a=i[1]/o;i[0]<a?a=i[0]:s=i[1],i[0]=-1*n[0]*(a/2+r),i[1]=-1*n[1]*(s/2+r)},n.decideDirectionsForOverlappingNodes=function(t,e,i){t.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,t.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},n.getIntersection2=function(t,e,i){var r=t.getCenterX(),n=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return i[0]=r,i[1]=n,i[2]=o,i[3]=s,!0;var a=t.getX(),h=t.getY(),l=t.getRight(),g=t.getX(),u=t.getBottom(),c=t.getRight(),d=t.getWidthHalf(),p=t.getHeightHalf(),f=e.getX(),y=e.getY(),E=e.getRight(),v=e.getX(),A=e.getBottom(),T=e.getRight(),N=e.getWidthHalf(),_=e.getHeightHalf(),L=!1,m=!1;if(r===o)n>s?(i[0]=r,i[1]=h,i[2]=o,i[3]=A):n<s&&(i[0]=r,i[1]=u,i[2]=o,i[3]=y);else if(n===s)r>o?(i[0]=a,i[1]=n,i[2]=E,i[3]=s):r<o&&(i[0]=l,i[1]=n,i[2]=f,i[3]=s);else{var O=t.height/t.width,I=e.height/e.width,D=(s-n)/(o-r),w=void 0,R=void 0,C=void 0,M=void 0,G=void 0,x=void 0;if(-O===D?(r>o?(i[0]=g,i[1]=u):(i[0]=l,i[1]=h),L=!0):O===D&&(r>o?(i[0]=a,i[1]=h):(i[0]=c,i[1]=u),L=!0),-I===D?(o>r?(i[2]=v,i[3]=A):(i[2]=E,i[3]=y),m=!0):I===D&&(o>r?(i[2]=f,i[3]=y):(i[2]=T,i[3]=A),m=!0),L&&m)return!1;if(r>o?n>s?(w=this.getCardinalDirection(O,D,4),R=this.getCardinalDirection(I,D,2)):(w=this.getCardinalDirection(-O,D,3),R=this.getCardinalDirection(-I,D,1)):n>s?(w=this.getCardinalDirection(-O,D,1),R=this.getCardinalDirection(-I,D,3)):(w=this.getCardinalDirection(O,D,2),R=this.getCardinalDirection(I,D,4)),!L)switch(w){case 1:M=h,C=r+-p/D,i[0]=C,i[1]=M;break;case 2:C=c,M=n+d*D,i[0]=C,i[1]=M;break;case 3:M=u,C=r+p/D,i[0]=C,i[1]=M;break;case 4:C=g,M=n+-d*D,i[0]=C,i[1]=M}if(!m)switch(R){case 1:x=y,G=o+-_/D,i[2]=G,i[3]=x;break;case 2:G=T,x=s+N*D,i[2]=G,i[3]=x;break;case 3:x=A,G=o+_/D,i[2]=G,i[3]=x;break;case 4:G=v,x=s+-N*D,i[2]=G,i[3]=x}}return!1},n.getCardinalDirection=function(t,e,i){return t>e?i:1+i%4},n.getIntersection=function(t,e,i,n){if(null==n)return this.getIntersection2(t,e,i);var o=t.x,s=t.y,a=e.x,h=e.y,l=i.x,g=i.y,u=n.x,c=n.y,d=void 0,p=void 0,f=void 0,y=void 0,E=void 0,v=void 0,A=void 0;return(d=h-s,f=o-a,E=a*s-o*h,p=c-g,y=l-u,v=u*g-l*c,0==(A=d*y-p*f))?null:new r((f*v-y*E)/A,(p*E-d*v)/A)},n.angleOfVector=function(t,e,i,r){var n=void 0;return t!==i?(n=Math.atan((r-e)/(i-t)),i<t?n+=Math.PI:r<e&&(n+=this.TWO_PI)):n=r<e?this.ONE_AND_HALF_PI:this.HALF_PI,n},n.doIntersect=function(t,e,i,r){var n=t.x,o=t.y,s=e.x,a=e.y,h=i.x,l=i.y,g=r.x,u=r.y,c=(s-n)*(u-l)-(g-h)*(a-o);if(0===c)return!1;var d=((u-l)*(g-n)+(h-g)*(u-o))/c,p=((o-a)*(g-n)+(s-n)*(u-o))/c;return 0<d&&d<1&&0<p&&p<1},n.HALF_PI=.5*Math.PI,n.ONE_AND_HALF_PI=1.5*Math.PI,n.TWO_PI=2*Math.PI,n.THREE_PI=3*Math.PI,t.exports=n},function(t,e,i){"use strict";function r(){}r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,e,i){"use strict";function r(){}r.MAX_VALUE=0x7fffffff,r.MIN_VALUE=-0x80000000,t.exports=r},function(t,e,i){"use strict";var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n=function(t){return{value:t,next:null,prev:null}},o=function(t,e,i,r){return null!==t?t.next=e:r.head=e,null!==i?i.prev=e:r.tail=e,e.prev=t,e.next=i,r.length++,e},s=function(t,e){var i=t.prev,r=t.next;return null!==i?i.next=r:e.head=r,null!==r?r.prev=i:e.tail=i,t.prev=t.next=null,e.length--,t};t.exports=function(){function t(e){var i=this;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach(function(t){return i.push(t)})}return r(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,n(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,n(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,n(t),null,this)}},{key:"unshift",value:function(t){return o(null,n(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,i=this.head;e<t;)i=i.next,e++;return i.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var i=1,r=this.head;i<t;)r=r.next,i++;r.value=e}}}]),t}()},function(t,e,i){"use strict";function r(t,e,i){this.x=null,this.y=null,null==t&&null==e&&null==i?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==i?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==i&&(i=t,this.x=i.x,this.y=i.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(t,e,i){"Point"==t.constructor.name&&null==e&&null==i?(i=t,this.setLocation(i.x,i.y)):"number"==typeof t&&"number"==typeof e&&null==i&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},r.prototype.move=function(t,e){this.x=t,this.y=e},r.prototype.translate=function(t,e){this.x+=t,this.y+=e},r.prototype.equals=function(t){return"Point"==t.constructor.name?this.x==t.x&&this.y==t.y:this==t},r.prototype.toString=function(){return new r().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,e,i){"use strict";function r(t,e,i,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=i&&null!=r&&(this.x=t,this.y=e,this.width=i,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(t){this.x=t},r.prototype.getY=function(){return this.y},r.prototype.setY=function(t){this.y=t},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},t.exports=r},function(t,e,i){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function n(){}n.lastID=0,n.createID=function(t){return n.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=n.getString(),n.lastID++),t.uniqueID)},n.getString=function(t){return null==t&&(t=n.lastID),"Object#"+t},n.isPrimitive=function(t){var e=void 0===t?"undefined":r(t);return null==t||"object"!=e&&"function"!=e},t.exports=n},function(t,e,i){"use strict";function r(t){if(!Array.isArray(t))return Array.from(t);for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}var n=i(0),o=i(6),s=i(3),a=i(1),h=i(5),l=i(4),g=i(17),u=i(27);function c(t){u.call(this),this.layoutQuality=n.QUALITY,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=n.DEFAULT_INCREMENTAL,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}c.RANDOM_SEED=1,c.prototype=Object.create(u.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},c.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},c.prototype.newNode=function(t){return new s(this.graphManager,t)},c.prototype.newEdge=function(t){return new a(null,null,t)},c.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==n.ANIMATE&&(t&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];for(var i=this.graphManager.getRoot().getNodes(),e=0;e<i.length;e++)i[e];this.update(this.graphManager.getRoot())}},c.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){if(null!=t.getChild())for(var e=t.getChild().getNodes(),i=0;i<e.length;i++)update(e[i]);null!=t.vGraphObject&&t.vGraphObject.update(t)}else t instanceof a?null!=t.vGraphObject&&t.vGraphObject.update(t):t instanceof h&&null!=t.vGraphObject&&t.vGraphObject.update(t)},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=n.QUALITY,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=n.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(t){if(void 0==t)this.transform(new l(0,0));else{var e=new g,i=this.graphManager.getRoot().updateLeftTop();if(null!=i){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(i.x),e.setDeviceOrgY(i.y);for(var r=this.getAllNodes(),n=0;n<r.length;n++)r[n].transform(e)}}},c.prototype.positionNodesRandomly=function(t){if(void 0==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,i,r=t.getNodes(),n=0;n<r.length;n++)null==(i=(e=r[n]).getChild())||0==i.getNodes().length?e.scatter():(this.positionNodesRandomly(i),e.updateBounds())},c.prototype.getFlatForest=function(){for(var t=[],e=!0,i=this.graphManager.getRoot().getNodes(),n=!0,o=0;o<i.length;o++)null!=i[o].getChild()&&(n=!1);if(!n)return t;var s=new Set,a=[],h=new Map,l=[];for(l=l.concat(i);l.length>0&&e;){for(a.push(l[0]);a.length>0&&e;){var g=a[0];a.splice(0,1),s.add(g);for(var u=g.getEdges(),o=0;o<u.length;o++){var c=u[o].getOtherEnd(g);if(h.get(g)!=c)if(s.has(c)){e=!1;break}else a.push(c),h.set(c,g)}}if(e){var d=[].concat(r(s));t.push(d);for(var o=0;o<d.length;o++){var p=d[o],f=l.indexOf(p);f>-1&&l.splice(f,1)}s=new Set,h=new Map}else t=[]}return t},c.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],i=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),n=0;n<t.bendpoints.length;n++){var o=this.newNode(null);o.setRect(new Point(0,0),new Dimension(1,1)),r.add(o);var s=this.newEdge(null);this.graphManager.add(s,i,o),e.add(o),i=o}var s=this.newEdge(null);return this.graphManager.add(s,i,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),e},c.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var i=t[e];if(i.bendpoints.length>0){for(var n=this.edgeToDummyNodes.get(i),o=0;o<n.length;o++){var s=n[o],a=new l(s.getCenterX(),s.getCenterY()),h=i.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(i,i.source,i.target)}}},c.transform=function(t,e,i,r){if(void 0==i||void 0==r)return t<=50?(n=9*e/500,o=e/10):(n=9*e/50,o=-8*e),n*t+o;var n,o,s=e;return t<=50?s-=(e-e/i)/50*(50-t):s+=(e*r-e)/50*(t-50),s},c.findCenterOfTree=function(t){var e=[];e=e.concat(t);var i=[],r=new Map,n=!1,o=null;(1==e.length||2==e.length)&&(n=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=e[s],h=a.getNeighborsList().size;r.set(a,a.getNeighborsList().size),1==h&&i.push(a)}var l=[];for(l=l.concat(i);!n;){var g=[];g=g.concat(l),l=[];for(var s=0;s<e.length;s++){var a=e[s],u=e.indexOf(a);u>=0&&e.splice(u,1),a.getNeighborsList().forEach(function(t){if(0>i.indexOf(t)){var e=r.get(t)-1;1==e&&l.push(t),r.set(t,e)}})}i=i.concat(l),(1==e.length||2==e.length)&&(n=!0,o=e[0])}return o},c.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=c},function(t,e,i){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,e,i){"use strict";var r=i(4);function n(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(t){this.lworldExtX=t},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(t){this.lworldExtY=t},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},n.prototype.transformX=function(t){var e=0,i=this.lworldExtX;return 0!=i&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/i),e},n.prototype.transformY=function(t){var e=0,i=this.lworldExtY;return 0!=i&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/i),e},n.prototype.inverseTransformX=function(t){var e=0,i=this.ldeviceExtX;return 0!=i&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/i),e},n.prototype.inverseTransformY=function(t){var e=0,i=this.ldeviceExtY;return 0!=i&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/i),e},n.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=n},function(t,e,i){"use strict";var r=i(15),n=i(7),o=i(0),s=i(8),a=i(9);function h(){r.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=n.DEFAULT_EDGE_LENGTH,this.springConstant=n.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=n.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}for(var l in h.prototype=Object.create(r.prototype),r)h[l]=r[l];h.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,i,r,s,a,h=this.getGraphManager().getAllEdges(),l=0;l<h.length;l++)(t=h[l]).idealLength=this.idealEdgeLength,t.isInterGraph&&(i=t.getSource(),r=t.getTarget(),s=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=s+a-2*o.SIMPLE_NODE_SIZE),e=t.getLca().getInclusionTreeDepth(),t.idealLength+=n.DEFAULT_EDGE_LENGTH*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(i.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*e))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),i=0;i<e.length;i++)t=e[i],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,i,r,o,s=!(arguments.length>0)||void 0===arguments[0]||arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),o=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,o,s,a),o.add(i);else for(t=0;t<h.length;t++)for(i=h[t],e=t+1;e<h.length;e++)r=h[e],i.getOwner()==r.getOwner()&&this.calcRepulsionForce(i,r)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),i=0;i<e.length;i++)t=e[i],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var i,r,n,o,s=t.getSource(),a=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==a.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(i=t.getLength())&&(n=(r=this.springConstant*(i-e))*(t.lengthX/i),o=r*(t.lengthY/i),s.springForceX+=n,s.springForceY+=o,a.springForceX-=n,a.springForceY-=o)},h.prototype.calcRepulsionForce=function(t,e){var i,r,o,h,l,g,u,c=t.getRect(),d=e.getRect(),p=[,,],f=[,,,,];if(c.intersects(d)){s.calcSeparationAmount(c,d,p,n.DEFAULT_EDGE_LENGTH/2),g=2*p[0],u=2*p[1];var y=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=y*g,t.repulsionForceY-=y*u,e.repulsionForceX+=y*g,e.repulsionForceY+=y*u}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(i=d.getCenterX()-c.getCenterX(),r=d.getCenterY()-c.getCenterY()):(s.getIntersection(c,d,f),i=f[2]-f[0],r=f[3]-f[1]),Math.abs(i)<n.MIN_REPULSION_DIST&&(i=a.sign(i)*n.MIN_REPULSION_DIST),Math.abs(r)<n.MIN_REPULSION_DIST&&(r=a.sign(r)*n.MIN_REPULSION_DIST),h=Math.sqrt(o=i*i+r*r),g=(l=this.repulsionConstant*t.noOfChildren*e.noOfChildren/o)*i/h,u=l*r/h,t.repulsionForceX-=g,t.repulsionForceY-=u,e.repulsionForceX+=g,e.repulsionForceY+=u},h.prototype.calcGravitationalForce=function(t){var e,i,r,n,o,s,a,h;i=((e=t.getOwner()).getRight()+e.getLeft())/2,r=(e.getTop()+e.getBottom())/2,n=t.getCenterX()-i,o=t.getCenterY()-r,s=Math.abs(n)+t.getWidth()/2,a=Math.abs(o)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(h=e.getEstimatedSize()*this.gravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*n,t.gravitationForceY=-this.gravityConstant*o):(s>(h=e.getEstimatedSize()*this.compoundGravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=2>Math.abs(this.totalDisplacement-this.oldTotalDisplacement)),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)(t=e[i]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e=0,i=0;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),i=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=Array(e),n=0;n<e;n++)r[n]=Array(i);for(var n=0;n<e;n++)for(var o=0;o<i;o++)r[n][o]=[];return r},h.prototype.addNodeToGrid=function(t,e,i){var r=0,n=0,o=0,s=0;r=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),n=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange));for(var a=r;a<=n;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(r,n,o,s)},h.prototype.updateGrid=function(){var t,e,i=this.getAllNodes();for(t=0,this.grid=this.calcGrid(this.graphManager.getRoot());t<i.length;t++)e=i[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,i,r){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&i||r){var o,s=new Set;t.surrounding=[];for(var a=this.grid,h=t.startX-1;h<t.finishX+2;h++)for(var l=t.startY-1;l<t.finishY+2;l++)if(!(h<0||l<0||h>=a.length||l>=a[0].length)){for(var g=0;g<a[h][l].length;g++)if(o=a[h][l][g],t.getOwner()==o.getOwner()&&t!=o&&!e.has(o)&&!s.has(o)){var u=Math.abs(t.getCenterX()-o.getCenterX())-(t.getWidth()/2+o.getWidth()/2),c=Math.abs(t.getCenterY()-o.getCenterY())-(t.getHeight()/2+o.getHeight()/2);u<=this.repulsionRange&&c<=this.repulsionRange&&s.add(o)}}t.surrounding=[].concat(function(t){if(!Array.isArray(t))return Array.from(t);for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}(s))}for(h=0;h<t.surrounding.length;h++)this.calcRepulsionForce(t,t.surrounding[h])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,i){"use strict";var r=i(1),n=i(7);function o(t,e,i){r.call(this,t,e,i),this.idealLength=n.DEFAULT_EDGE_LENGTH}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];t.exports=o},function(t,e,i){"use strict";var r=i(3);function n(t,e,i,n){r.call(this,t,e,i,n),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];n.prototype.setGridCoordinates=function(t,e,i,r){this.startX=t,this.finishX=e,this.startY=i,this.finishY=r},t.exports=n},function(t,e,i){"use strict";function r(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},t.exports=r},function(t,e,i){"use strict";var r=i(14);function n(){this.map={},this.keys=[]}n.prototype.put=function(t,e){var i=r.createID(t);this.contains(i)||(this.map[i]=e,this.keys.push(t))},n.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},n.prototype.get=function(t){var e=r.createID(t);return this.map[e]},n.prototype.keySet=function(){return this.keys},t.exports=n},function(t,e,i){"use strict";var r=i(14);function n(){this.set={}}n.prototype.add=function(t){var e=r.createID(t);this.contains(e)||(this.set[e]=t)},n.prototype.remove=function(t){delete this.set[r.createID(t)]},n.prototype.clear=function(){this.set={}},n.prototype.contains=function(t){return this.set[r.createID(t)]==t},n.prototype.isEmpty=function(){return 0===this.size()},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),i=e.length,r=0;r<i;r++)t.push(this.set[e[r]])},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAll=function(t){for(var e=t.length,i=0;i<e;i++){var r=t[i];this.add(r)}},t.exports=n},function(t,e,i){"use strict";var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),n=i(11);t.exports=function(){function t(e,i){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");(null!==i||void 0!==i)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=e instanceof n?e.size():e.length,this._quicksort(e,0,r-1)}return r(t,[{key:"_quicksort",value:function(t,e,i){if(e<i){var r=this._partition(t,e,i);this._quicksort(t,e,r),this._quicksort(t,r+1,i)}}},{key:"_partition",value:function(t,e,i){for(var r=this._get(t,e),n=e,o=i;;){for(;this.compareFunction(r,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,n),r);)n++;if(!(n<o))return o;this._swap(t,n,o),n++,o--}}},{key:"_get",value:function(t,e){return t instanceof n?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,i){t instanceof n?t.set_object_at(e,i):t[e]=i}},{key:"_swap",value:function(t,e,i){var r=this._get(t,e);this._set(t,e,this._get(t,i)),this._set(t,i,r)}},{key:"_defaultCompareFunction",value:function(t,e){return e>t}}]),t}()},function(t,e,i){"use strict";var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();t.exports=function(){function t(e,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.sequence1=e,this.sequence2=i,this.match_score=r,this.mismatch_penalty=n,this.gap_penalty=o,this.iMax=e.length+1,this.jMax=i.length+1,this.grid=Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[h][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var r=1;r<this.jMax;r++){var n=[this.sequence1[i-1]===this.sequence2[r-1]?this.grid[i-1][r-1]+this.match_score:this.grid[i-1][r-1]+this.mismatch_penalty,this.grid[i-1][r]+this.gap_penalty,this.grid[i][r-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(n);this.grid[i][r]=n[o[0]],this.tracebackGrid[i][r]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],i=this.tracebackGrid[e.pos[0]][e.pos[1]];i[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),i[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),i[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var i=[],r=-1;-1!==(r=t.indexOf(e,r+1));)i.push(r);return i}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}()},function(t,e,i){"use strict";var r=function(){};r.FDLayout=i(18),r.FDLayoutConstants=i(7),r.FDLayoutEdge=i(19),r.FDLayoutNode=i(20),r.DimensionD=i(21),r.HashMap=i(22),r.HashSet=i(23),r.IGeometry=i(8),r.IMath=i(9),r.Integer=i(10),r.Point=i(12),r.PointD=i(4),r.RandomSeed=i(16),r.RectangleD=i(13),r.Transform=i(17),r.UniqueIDGeneretor=i(14),r.Quicksort=i(24),r.LinkedList=i(11),r.LGraphObject=i(2),r.LGraph=i(5),r.LEdge=i(1),r.LGraphManager=i(6),r.LNode=i(3),r.Layout=i(15),r.LayoutConstants=i(0),r.NeedlemanWunsch=i(25),t.exports=r},function(t,e,i){"use strict";function r(){this.listeners=[]}var n=r.prototype;n.addListener=function(t,e){this.listeners.push({event:t,callback:e})},n.removeListener=function(t,e){for(var i=this.listeners.length;i>=0;i--){var r=this.listeners[i];r.event===t&&r.callback===e&&this.listeners.splice(i,1)}},n.emit=function(t,e){for(var i=0;i<this.listeners.length;i++){var r=this.listeners[i];t===r.event&&r.callback(e)}},t.exports=r}],e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=26)}()},97659,(t,e,i)=>{t.e,e.exports=function(t){var e=[function(e,i){e.exports=t},function(t,e,i){"use strict";var r=i(0).FDLayoutConstants;function n(){}for(var o in r)n[o]=r[o];n.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,n.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,n.DEFAULT_COMPONENT_SEPERATION=60,n.TILE=!0,n.TILING_PADDING_VERTICAL=10,n.TILING_PADDING_HORIZONTAL=10,n.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=n},function(t,e,i){"use strict";var r=i(0).FDLayoutEdge;function n(t,e,i){r.call(this,t,e,i)}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];t.exports=n},function(t,e,i){"use strict";var r=i(0).LGraph;function n(t,e,i){r.call(this,t,e,i)}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];t.exports=n},function(t,e,i){"use strict";var r=i(0).LGraphManager;function n(t){r.call(this,t)}for(var o in n.prototype=Object.create(r.prototype),r)n[o]=r[o];t.exports=n},function(t,e,i){"use strict";var r=i(0).FDLayoutNode,n=i(0).IMath;function o(t,e,i,n){r.call(this,t,e,i,n)}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.move=function(){var t=this.graphManager.getLayout();this.displacementX=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},o.prototype.propogateDisplacementToChildren=function(t,e){for(var i,r=this.getChild().getNodes(),n=0;n<r.length;n++)null==(i=r[n]).getChild()?(i.moveBy(t,e),i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},o.prototype.setPred1=function(t){this.pred1=t},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(t){this.next=t},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(t){this.processed=t},o.prototype.isProcessed=function(){return processed},t.exports=o},function(t,e,i){"use strict";var r=i(0).FDLayout,n=i(4),o=i(3),s=i(5),a=i(2),h=i(1),l=i(0).FDLayoutConstants,g=i(0).LayoutConstants,u=i(0).Point,c=i(0).PointD,d=i(0).Layout,p=i(0).Integer,f=i(0).IGeometry,y=i(0).LGraph,E=i(0).Transform;function v(){r.call(this),this.toBeTiled={}}for(var A in v.prototype=Object.create(r.prototype),r)v[A]=r[A];v.prototype.newGraphManager=function(){var t=new n(this);return this.graphManager=t,t},v.prototype.newGraph=function(t){return new o(null,this.graphManager,t)},v.prototype.newNode=function(t){return new s(this.graphManager,t)},v.prototype.newEdge=function(t){return new a(null,null,t)},v.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=l.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=l.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=l.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(e)}}else{var i=this.getFlatForest();if(i.length>0)this.positionNodesRadially(i);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(e),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var i=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(i,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var r=t[i].rect,n=t[i].id;e[n]={id:n,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return e},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===l.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,i=[],r=this.graphManager.getGraphs(),n=r.length;for(e=0;e<n;e++)(t=r[e]).updateConnected(),t.isConnected||(i=i.concat(t.getNodes()));return i},v.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e=new Set;for(o=0;o<t.length;o++){var i=t[o];if(!e.has(i)){var r=i.getSource(),n=i.getTarget();if(r==n)i.getBendpoints().push(new c),i.getBendpoints().push(new c),this.createDummyNodesForBendpoints(i),e.add(i);else{var o,s,a=[];if(a=(a=a.concat(r.getEdgeListToNode(n))).concat(n.getEdgeListToNode(r)),!e.has(a[0])){if(a.length>1)for(s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new c),this.createDummyNodesForBendpoints(h)}a.forEach(function(t){e.add(t)})}}}if(e.size==t.length)break}},v.prototype.positionNodesRadially=function(t){for(var e=new u(0,0),i=Math.ceil(Math.sqrt(t.length)),r=0,n=0,o=0,s=new c(0,0),a=0;a<t.length;a++){a%i==0&&(o=0,n=r,0!=a&&(n+=h.DEFAULT_COMPONENT_SEPERATION),r=0);var l=t[a],p=d.findCenterOfTree(l);e.x=o,e.y=n,(s=v.radialLayout(l,p,e)).y>r&&(r=Math.floor(s.y)),o=Math.floor(s.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new c(g.WORLD_CENTER_X-s.x/2,g.WORLD_CENTER_Y-s.y/2))},v.radialLayout=function(t,e,i){var r=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(e,null,0,359,0,r);var n=y.calculateBounds(t),o=new E;o.setDeviceOrgX(n.getMinX()),o.setDeviceOrgY(n.getMinY()),o.setWorldOrgX(i.x),o.setWorldOrgY(i.y);for(var s=0;s<t.length;s++)t[s].transform(o);var a=new c(n.getMaxX(),n.getMaxY());return o.inverseTransformPoint(a)},v.branchRadialLayout=function(t,e,i,r,n,o){var s,a=(r-i+1)/2;a<0&&(a+=180);var h=(a+i)%360*f.TWO_PI/360,l=n*Math.cos(h),g=n*Math.sin(h);t.setCenter(l,g);var u=[],c=(u=u.concat(t.getEdges())).length;null!=e&&c--;for(var d=0,p=u.length,y=t.getEdgesBetween(e);y.length>1;){var E=y[0];y.splice(0,1);var A=u.indexOf(E);A>=0&&u.splice(A,1),p--,c--}s=null!=e?(u.indexOf(y[0])+1)%p:0;for(var T=Math.abs(r-i)/c,N=s;d!=c;N=++N%p){var _=u[N].getOtherEnd(t);if(_!=e){var L=(i+d*T)%360,m=(L+T)%360;v.branchRadialLayout(_,t,L,m,n+o,o),d++}}},v.maxDiagonalInTree=function(t){for(var e=p.MIN_VALUE,i=0;i<t.length;i++){var r=t[i].getDiagonal();r>e&&(e=r)}return e},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var i=[],r=this.graphManager.getAllNodes(),n=0;n<r.length;n++){var o=r[n],a=o.getParent();0!==this.getNodeDegreeWithChildren(o)||void 0!=a.id&&this.getToBeTiled(a)||i.push(o)}for(var n=0;n<i.length;n++){var o=i[n],h=o.getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(o)}Object.keys(e).forEach(function(i){if(e[i].length>1){var r="DummyCompound_"+i;t.memberGroups[r]=e[i];var n=e[i][0].getParent(),o=new s(t.graphManager);o.id=r,o.paddingLeft=n.paddingLeft||0,o.paddingRight=n.paddingRight||0,o.paddingBottom=n.paddingBottom||0,o.paddingTop=n.paddingTop||0,t.idToDummyNode[r]=o;var a=t.getGraphManager().add(t.newGraph(),o),h=n.getChild();h.add(o);for(var l=0;l<e[i].length;l++){var g=e[i][l];h.remove(g),a.add(g)}}})},v.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},v.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(i){var r=t.idToDummyNode[i];e[i]=t.tileNodes(t.memberGroups[i],r.paddingLeft+r.paddingRight),r.rect.width=e[i].width,r.rect.height=e[i].height})},v.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],i=e.id,r=e.paddingLeft,n=e.paddingTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,r,n)}},v.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach(function(i){var r=t.idToDummyNode[i],n=r.paddingLeft,o=r.paddingTop;t.adjustLocations(e[i],r.rect.x,r.rect.y,n,o)})},v.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var i=t.getChild();if(null==i)return this.toBeTiled[e]=!1,!1;for(var r=i.getNodes(),n=0;n<r.length;n++){var o=r[n];if(this.getNodeDegree(o)>0)return this.toBeTiled[e]=!1,!1;if(null==o.getChild()){this.toBeTiled[o.id]=!1;continue}if(!this.getToBeTiled(o))return this.toBeTiled[e]=!1,!1}return this.toBeTiled[e]=!0,!0},v.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,r=0;r<e.length;r++){var n=e[r];n.getSource().id!==n.getTarget().id&&(i+=1)}return i},v.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var i=t.getChild().getNodes(),r=0;r<i.length;r++){var n=i[r];e+=this.getNodeDegreeWithChildren(n)}return e},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},v.prototype.adjustLocations=function(t,e,i,r,n){e+=r,i+=n;for(var o=e,s=0;s<t.rows.length;s++){var a=t.rows[s];e=o;for(var h=0,l=0;l<a.length;l++){var g=a[l];g.rect.x=e,g.rect.y=i,e+=g.rect.width+t.horizontalPadding,g.rect.height>h&&(h=g.rect.height)}i+=h+t.verticalPadding}},v.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(r){var n=e[r];i.tiledMemberPack[r]=i.tileNodes(t[r],n.paddingLeft+n.paddingRight),n.rect.width=i.tiledMemberPack[r].width,n.rect.height=i.tiledMemberPack[r].height})},v.prototype.tileNodes=function(t,e){var i={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:h.TILING_PADDING_VERTICAL,horizontalPadding:h.TILING_PADDING_HORIZONTAL};t.sort(function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:+(t.rect.width*t.rect.height<e.rect.width*e.rect.height)});for(var r=0;r<t.length;r++){var n=t[r];0==i.rows.length?this.insertNodeToRow(i,n,0,e):this.canAddHorizontal(i,n.rect.width,n.rect.height)?this.insertNodeToRow(i,n,this.getShortestRowIndex(i),e):this.insertNodeToRow(i,n,i.rows.length,e),this.shiftToLastRow(i)}return i},v.prototype.insertNodeToRow=function(t,e,i,r){i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(r),t.rowHeight.push(0));var n=t.rowWidth[i]+e.rect.width;t.rows[i].length>0&&(n+=t.horizontalPadding),t.rowWidth[i]=n,t.width<n&&(t.width=n);var o=e.rect.height;i>0&&(o+=t.verticalPadding);var s=0;o>t.rowHeight[i]&&(s=t.rowHeight[i],t.rowHeight[i]=o,s=t.rowHeight[i]-s),t.height+=s,t.rows[i].push(e)},v.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<i&&(e=r,i=t.rowWidth[r]);return e},v.prototype.getLongestRowIndex=function(t){for(var e=-1,i=5e-324,r=0;r<t.rows.length;r++)t.rowWidth[r]>i&&(e=r,i=t.rowWidth[r]);return e},v.prototype.canAddHorizontal=function(t,e,i){var r,n,o=this.getShortestRowIndex(t);if(o<0)return!0;var s=t.rowWidth[o];if(s+t.horizontalPadding+e<=t.width)return!0;var a=0;return t.rowHeight[o]<i&&o>0&&(a=i+t.verticalPadding-t.rowHeight[o]),r=t.width-s>=e+t.horizontalPadding?(t.height+a)/(s+e+t.horizontalPadding):(t.height+a)/t.width,a=i+t.verticalPadding,(n=t.width<e?(t.height+a)/e:(t.height+a)/t.width)<1&&(n=1/n),r<1&&(r=1/r),r<n},v.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,r=t.rows[e],n=r[r.length-1],o=n.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>o&&e!=i){r.splice(-1,1),t.rows[i].push(n),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[i]=t.rowWidth[i]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=5e-324,a=0;a<r.length;a++)r[a].height>s&&(s=r[a].height);e>0&&(s+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[i];t.rowHeight[e]=s,t.rowHeight[i]<n.height+t.verticalPadding&&(t.rowHeight[i]=n.height+t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[i];t.height+=l-h,this.shiftToLastRow(t)}},v.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var t,e=[],i=!0;i;){var r=this.graphManager.getAllNodes(),n=[];i=!1;for(var o=0;o<r.length;o++)1!=(t=r[o]).getEdges().length||t.getEdges()[0].isInterGraph||null!=t.getChild()||(n.push([t,t.getEdges()[0],t.getOwner()]),i=!0);if(!0==i){for(var s=[],a=0;a<n.length;a++)1==n[a][0].getEdges().length&&(s.push(n[a]),n[a][0].getOwner().remove(n[a][0]));e.push(s),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},v.prototype.growTree=function(t){for(var e,i=t.length,r=t[i-1],n=0;n<r.length;n++)e=r[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(t){var e,i,r,n,o=t[0],s=(i=o==t[1].source?t[1].target:t[1].source).startX,a=i.finishX,h=i.startY,g=i.finishY,u=[0,0,0,0];if(h>0)for(var c=s;c<=a;c++)u[0]+=this.grid[c][h-1].length+this.grid[c][h].length-1;if(a<this.grid.length-1)for(var c=h;c<=g;c++)u[1]+=this.grid[a+1][c].length+this.grid[a][c].length-1;if(g<this.grid[0].length-1)for(var c=s;c<=a;c++)u[2]+=this.grid[c][g+1].length+this.grid[c][g].length-1;if(s>0)for(var c=h;c<=g;c++)u[3]+=this.grid[s-1][c].length+this.grid[s][c].length-1;for(var d=p.MAX_VALUE,f=0;f<u.length;f++)u[f]<d?(d=u[f],r=1,n=f):u[f]==d&&r++;if(3==r&&0==d)0==u[0]&&0==u[1]&&0==u[2]?e=1:0==u[0]&&0==u[1]&&0==u[3]?e=0:0==u[0]&&0==u[2]&&0==u[3]?e=3:0==u[1]&&0==u[2]&&0==u[3]&&(e=2);else if(2==r&&0==d){var y=Math.floor(2*Math.random());e=0==u[0]&&0==u[1]?+(0!=y):0==u[0]&&0==u[2]?2*(0!=y):0==u[0]&&0==u[3]?3*(0!=y):0==u[1]&&0==u[2]?0==y?1:2:0==u[1]&&0==u[3]?0==y?1:3:0==y?2:3}else if(4==r&&0==d){var y=Math.floor(4*Math.random());e=y}else e=n;0==e?o.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-l.DEFAULT_EDGE_LENGTH-o.getHeight()/2):1==e?o.setCenter(i.getCenterX()+i.getWidth()/2+l.DEFAULT_EDGE_LENGTH+o.getWidth()/2,i.getCenterY()):2==e?o.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+l.DEFAULT_EDGE_LENGTH+o.getHeight()/2):o.setCenter(i.getCenterX()-i.getWidth()/2-l.DEFAULT_EDGE_LENGTH-o.getWidth()/2,i.getCenterY())},t.exports=v},function(t,e,i){"use strict";var r={};r.layoutBase=i(0),r.CoSEConstants=i(1),r.CoSEEdge=i(2),r.CoSEGraph=i(3),r.CoSEGraphManager=i(4),r.CoSELayout=i(6),r.CoSENode=i(5),t.exports=r}],i={};function r(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=i,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}(t.r(51273))},15363,(t,e,i)=>{t.e,e.exports=function(t){var e=[function(e,i){e.exports=t},function(t,e,i){"use strict";var r=i(0).layoutBase.LayoutConstants,n=i(0).layoutBase.FDLayoutConstants,o=i(0).CoSEConstants,s=i(0).CoSELayout,a=i(0).CoSENode,h=i(0).layoutBase.PointD,l=i(0).layoutBase.DimensionD,g={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function u(t){this.options=function(t,e){var i={};for(var r in t)i[r]=t[r];for(var r in e)i[r]=e[r];return i}(g,t),c(this.options)}var c=function(t){null!=t.nodeRepulsion&&(o.DEFAULT_REPULSION_STRENGTH=n.DEFAULT_REPULSION_STRENGTH=t.nodeRepulsion),null!=t.idealEdgeLength&&(o.DEFAULT_EDGE_LENGTH=n.DEFAULT_EDGE_LENGTH=t.idealEdgeLength),null!=t.edgeElasticity&&(o.DEFAULT_SPRING_STRENGTH=n.DEFAULT_SPRING_STRENGTH=t.edgeElasticity),null!=t.nestingFactor&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(o.DEFAULT_GRAVITY_STRENGTH=n.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(o.MAX_ITERATIONS=n.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=n.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=n.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),"draft"==t.quality?r.QUALITY=0:"proof"==t.quality?r.QUALITY=2:r.QUALITY=1,o.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!t.randomize,o.ANIMATE=n.ANIMATE=r.ANIMATE=t.animate,o.TILE=t.tile,o.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal};u.prototype.run=function(){var t,e,i=this.options;this.idToLNode={};var r=this.layout=new s,n=this;n.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var o=r.newGraphManager();this.gm=o;var a=this.options.eles.nodes(),h=this.options.eles.edges();this.root=o.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(a),r);for(var l=0;l<h.length;l++){var g=h[l],u=this.idToLNode[g.data("source")],c=this.idToLNode[g.data("target")];u!==c&&0==u.getEdgesBetween(c).length&&(o.add(r.newEdge(),u,c).id=g.id())}var d=function(t,e){"number"==typeof t&&(t=e);var i=t.data("id"),r=n.idToLNode[i];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},p=function o(){for(var s,a=function(){i.fit&&i.cy.fit(i.eles,i.padding),t||(t=!0,n.cy.one("layoutready",i.ready),n.cy.trigger({type:"layoutready",layout:n}))},h=n.options.refresh,l=0;l<h&&!s;l++)s=n.stopped||n.layout.tick();if(s){r.checkLayoutSuccess()&&!r.isSubLayout&&r.doPostLayout(),r.tilingPostLayout&&r.tilingPostLayout(),r.isLayoutFinished=!0,n.options.eles.nodes().positions(d),a(),n.cy.one("layoutstop",n.options.stop),n.cy.trigger({type:"layoutstop",layout:n}),e&&cancelAnimationFrame(e),t=!1;return}var g=n.layout.getPositionsData();i.eles.nodes().positions(function(t,e){if("number"==typeof t&&(t=e),!t.isParent()){for(var i=t.id(),r=g[i],n=t;null==r&&(r=g[n.data("parent")]||g["DummyCompound_"+n.data("parent")],g[i]=r,void 0!=(n=n.parent()[0])););return null!=r?{x:r.x,y:r.y}:{x:t.position("x"),y:t.position("y")}}}),a(),e=requestAnimationFrame(o)};return r.addListener("layoutstarted",function(){"during"===n.options.animate&&(e=requestAnimationFrame(p))}),r.runLayout(),"during"!==this.options.animate&&(n.options.eles.nodes().not(":parent").layoutPositions(n,n.options,d),t=!1),this},u.prototype.getTopMostNodes=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].id()]=!0;return t.filter(function(t,i){"number"==typeof t&&(t=i);for(var r=t.parent()[0];null!=r;){if(e[r.id()])return!1;r=r.parent()[0]}return!0})},u.prototype.processChildrenList=function(t,e,i){for(var r=e.length,n=0;n<r;n++){var o,s,g=e[n],u=g.children(),c=g.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((o=null!=g.outerWidth()&&null!=g.outerHeight()?t.add(new a(i.graphManager,new h(g.position("x")-c.w/2,g.position("y")-c.h/2),new l(parseFloat(c.w),parseFloat(c.h)))):t.add(new a(this.graphManager))).id=g.data("id"),o.paddingLeft=parseInt(g.css("padding")),o.paddingTop=parseInt(g.css("padding")),o.paddingRight=parseInt(g.css("padding")),o.paddingBottom=parseInt(g.css("padding")),this.options.nodeDimensionsIncludeLabels&&g.isParent()){var d=g.boundingBox({includeLabels:!0,includeNodes:!1}).w,p=g.boundingBox({includeLabels:!0,includeNodes:!1}).h,f=g.css("text-halign");o.labelWidth=d,o.labelHeight=p,o.labelPos=f}this.idToLNode[g.data("id")]=o,isNaN(o.rect.x)&&(o.rect.x=0),isNaN(o.rect.y)&&(o.rect.y=0),null!=u&&u.length>0&&(s=i.getGraphManager().add(i.newGraph(),o),this.processChildrenList(s,u,i))}},u.prototype.stop=function(){return this.stopped=!0,this};var d=function(t){t("layout","cose-bilkent",u)};"u">typeof cytoscape&&d(cytoscape),t.exports=d}],i={};function r(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=i,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}(t.r(97659))},97810,t=>{"use strict";var e=t.i(71206),i=t.i(77871),r=t.i(15363);t.i(47716);var n=t.i(23685);function o(t,e){t.forEach(t=>{let i={id:t.id,labelText:t.label,height:t.height,width:t.width,padding:t.padding??0};Object.keys(t).forEach(e=>{["id","label","height","width","padding","x","y"].includes(e)||(i[e]=t[e])}),e.add({group:"nodes",data:i,position:{x:t.x??0,y:t.y??0}})})}function s(t,e){t.forEach(t=>{let i={id:t.id,source:t.start,target:t.end};Object.keys(t).forEach(e=>{["id","start","end"].includes(e)||(i[e]=t[e])}),e.add({group:"edges",data:i})})}function a(t){return new Promise(r=>{let a=(0,n.select)("body").append("div").attr("id","cy").attr("style","display:none"),h=(0,i.default)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),o(t.nodes,h),s(t.edges,h),h.nodes().forEach(function(t){t.layoutDimensions=()=>{let e=t.data();return{w:e.width,h:e.height}}}),h.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),h.ready(t=>{e.log.info("Cytoscape ready",t),r(h)})})}function h(t){return t.nodes().map(t=>{let e=t.data(),i=t.position(),r={id:e.id,x:i.x,y:i.y};return Object.keys(e).forEach(t=>{"id"!==t&&(r[t]=e[t])}),r})}function l(t){return t.edges().map(t=>{let e=t.data(),i=t._private.rscratch,r={id:e.id,source:e.source,target:e.target,startX:i.startX,startY:i.startY,midX:i.midX,midY:i.midY,endX:i.endX,endY:i.endY};return Object.keys(e).forEach(t=>{["id","source","target"].includes(t)||(r[t]=e[t])}),r})}async function g(t,i){e.log.debug("Starting cose-bilkent layout algorithm");try{u(t);let i=await a(t),r=h(i),n=l(i);return e.log.debug(`Layout completed: ${r.length} nodes, ${n.length} edges`),{nodes:r,edges:n}}catch(t){throw e.log.error("Error in cose-bilkent layout algorithm:",t),t}}function u(t){if(!t)throw Error("Layout data is required");if(!t.config)throw Error("Configuration is required in layout data");if(!t.rootNode)throw Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw Error("Edges array is required in layout data");return!0}i.default.use(r.default),(0,e.__name)(o,"addNodes"),(0,e.__name)(s,"addEdges"),(0,e.__name)(a,"createCytoscapeInstance"),(0,e.__name)(h,"extractPositionedNodes"),(0,e.__name)(l,"extractPositionedEdges"),(0,e.__name)(g,"executeCoseBilkentLayout"),(0,e.__name)(u,"validateLayoutData");var c=(0,e.__name)(async(t,e,{insertCluster:i,insertEdge:r,insertEdgeLabel:n,insertMarkers:o,insertNode:s,log:a,positionEdgeLabel:h},{algorithm:l})=>{let u={},c={},d=e.select("g");o(d,t.markers,t.type,t.diagramId);let p=d.insert("g").attr("class","subgraphs"),f=d.insert("g").attr("class","edgePaths"),y=d.insert("g").attr("class","edgeLabels"),E=d.insert("g").attr("class","nodes");a.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async e=>{if(e.isGroup){let t={...e};c[e.id]=t,u[e.id]=t,await i(p,e)}else{let i={...e};u[e.id]=i;let r=await s(E,e,{config:t.config,dir:t.direction||"TB"}),n=r.node().getBBox();i.width=n.width,i.height=n.height,i.domId=r,a.debug(`Node ${e.id} dimensions: ${n.width}x${n.height}`)}})),a.debug("Running cose-bilkent layout algorithm");let v={...t,nodes:t.nodes.map(t=>{let e=u[t.id];return{...t,width:e.width,height:e.height}})},A=await g(v,t.config);a.debug("Positioning nodes based on layout results"),A.nodes.forEach(t=>{let e=u[t.id];e?.domId&&(e.domId.attr("transform",`translate(${t.x}, ${t.y})`),e.x=t.x,e.y=t.y,a.debug(`Positioned node ${e.id} at center (${t.x}, ${t.y})`))}),A.edges.forEach(e=>{let i=t.edges.find(t=>t.id===e.id);i&&(i.points=[{x:e.startX,y:e.startY},{x:e.midX,y:e.midY},{x:e.endX,y:e.endY}])}),a.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async e=>{await n(y,e);let i=u[e.start??""],o=u[e.end??""];if(i&&o){let n=A.edges.find(t=>t.id===e.id);if(n){a.debug("APA01 positionedEdge",n);let s={...e},l=r(f,s,c,t.type,i,o,t.diagramId);h(s,l)}else{let n={...e,points:[{x:i.x||0,y:i.y||0},{x:o.x||0,y:o.y||0}]},s=r(f,n,c,t.type,i,o,t.diagramId);h(n,s)}}})),a.debug("Cose-bilkent rendering completed")},"render");t.s(["render",0,c])}]);